mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-28 01:09:19 +00:00
fix(ui/views/App/Main/MainWindow): avoid crash
This commit is contained in:
parent
c1b38dc675
commit
42cb9bc7f4
3 changed files with 15 additions and 9 deletions
|
|
@ -41,8 +41,6 @@ class QTimer;
|
|||
class CoreManager : public QObject {
|
||||
Q_OBJECT;
|
||||
|
||||
Q_PROPERTY(bool linphoneCoreCreated READ getLinphoneCoreCreated NOTIFY linphoneCoreCreated);
|
||||
|
||||
public:
|
||||
~CoreManager () = default;
|
||||
|
||||
|
|
@ -118,10 +116,6 @@ private:
|
|||
|
||||
void createLinphoneCore (const QString &config_path);
|
||||
|
||||
bool getLinphoneCoreCreated () {
|
||||
return m_promise_build.isFinished();
|
||||
}
|
||||
|
||||
std::shared_ptr<linphone::Core> m_core;
|
||||
std::shared_ptr<CoreHandlers> m_handlers;
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,11 @@ ApplicationWindow {
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Connections {
|
||||
target: CoreManager
|
||||
onLinphoneCoreCreated: mainLoader.active = true
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequence: StandardKey.Close
|
||||
onActivated: window.hide()
|
||||
|
|
@ -67,12 +72,11 @@ ApplicationWindow {
|
|||
Loader {
|
||||
id: mainLoader
|
||||
|
||||
active: CoreManager.linphoneCoreCreated
|
||||
active: false
|
||||
anchors.fill: parent
|
||||
|
||||
sourceComponent: ColumnLayout {
|
||||
// Workaround to get these properties in `MainWindow.js`.
|
||||
// TODO: Find better Workaround.
|
||||
readonly property alias collapse: collapse
|
||||
readonly property alias contentLoader: contentLoader
|
||||
readonly property alias menu: menu
|
||||
|
|
@ -252,6 +256,6 @@ ApplicationWindow {
|
|||
height: MainWindowStyle.toolBar.height
|
||||
width: MainWindowStyle.toolBar.leftMargin
|
||||
|
||||
onClicked: CoreManager.linphoneCoreCreated && CoreManager.forceRefreshRegisters()
|
||||
onClicked: CoreManager.forceRefreshRegisters()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
import QtQuick 2.7
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Window {
|
||||
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue