Commit 42cb9bc7 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(ui/views/App/Main/MainWindow): avoid crash

parent c1b38dc6
...@@ -41,8 +41,6 @@ class QTimer; ...@@ -41,8 +41,6 @@ class QTimer;
class CoreManager : public QObject { class CoreManager : public QObject {
Q_OBJECT; Q_OBJECT;
Q_PROPERTY(bool linphoneCoreCreated READ getLinphoneCoreCreated NOTIFY linphoneCoreCreated);
public: public:
~CoreManager () = default; ~CoreManager () = default;
...@@ -118,10 +116,6 @@ private: ...@@ -118,10 +116,6 @@ private:
void createLinphoneCore (const QString &config_path); void createLinphoneCore (const QString &config_path);
bool getLinphoneCoreCreated () {
return m_promise_build.isFinished();
}
std::shared_ptr<linphone::Core> m_core; std::shared_ptr<linphone::Core> m_core;
std::shared_ptr<CoreHandlers> m_handlers; std::shared_ptr<CoreHandlers> m_handlers;
......
...@@ -57,6 +57,11 @@ ApplicationWindow { ...@@ -57,6 +57,11 @@ ApplicationWindow {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
Connections {
target: CoreManager
onLinphoneCoreCreated: mainLoader.active = true
}
Shortcut { Shortcut {
sequence: StandardKey.Close sequence: StandardKey.Close
onActivated: window.hide() onActivated: window.hide()
...@@ -67,12 +72,11 @@ ApplicationWindow { ...@@ -67,12 +72,11 @@ ApplicationWindow {
Loader { Loader {
id: mainLoader id: mainLoader
active: CoreManager.linphoneCoreCreated active: false
anchors.fill: parent anchors.fill: parent
sourceComponent: ColumnLayout { sourceComponent: ColumnLayout {
// Workaround to get these properties in `MainWindow.js`. // Workaround to get these properties in `MainWindow.js`.
// TODO: Find better Workaround.
readonly property alias collapse: collapse readonly property alias collapse: collapse
readonly property alias contentLoader: contentLoader readonly property alias contentLoader: contentLoader
readonly property alias menu: menu readonly property alias menu: menu
...@@ -252,6 +256,6 @@ ApplicationWindow { ...@@ -252,6 +256,6 @@ ApplicationWindow {
height: MainWindowStyle.toolBar.height height: MainWindowStyle.toolBar.height
width: MainWindowStyle.toolBar.leftMargin width: MainWindowStyle.toolBar.leftMargin
onClicked: CoreManager.linphoneCoreCreated && CoreManager.forceRefreshRegisters() onClicked: CoreManager.forceRefreshRegisters()
} }
} }
import QtQuick 2.7
import QtQuick.Window 2.2
// =============================================================================
Window {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment