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;
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()
}
}
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