mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-28 17:29:19 +00:00
fix(app): avoid crash if calls window is disabled
This commit is contained in:
parent
927b1e10c7
commit
a3dc41ec55
4 changed files with 24 additions and 15 deletions
|
|
@ -125,8 +125,11 @@ static void cliInitiateConference (QHash<QString, QString> &args) {
|
|||
const QString id = args["conference-id"];
|
||||
|
||||
auto updateCallsWindow = []() {
|
||||
// TODO: Set the view to the "waiting call view".
|
||||
QQuickWindow *callsWindow = App::getInstance()->getCallsWindow();
|
||||
if (!callsWindow)
|
||||
return;
|
||||
|
||||
// TODO: Set the view to the "waiting call view".
|
||||
if (CoreManager::getInstance()->getSettingsModel()->getKeepCallsWindowInBackground()) {
|
||||
if (!callsWindow->isVisible())
|
||||
callsWindow->showMinimized();
|
||||
|
|
|
|||
|
|
@ -339,12 +339,13 @@ void CallModel::accept (bool withVideo) {
|
|||
setRecordFile(params);
|
||||
|
||||
QQuickWindow *callsWindow = App::getInstance()->getCallsWindow();
|
||||
if (coreManager->getSettingsModel()->getKeepCallsWindowInBackground()) {
|
||||
if (!callsWindow->isVisible())
|
||||
callsWindow->showMinimized();
|
||||
} else
|
||||
App::smartShowWindow(callsWindow);
|
||||
|
||||
if (callsWindow) {
|
||||
if (coreManager->getSettingsModel()->getKeepCallsWindowInBackground()) {
|
||||
if (!callsWindow->isVisible())
|
||||
callsWindow->showMinimized();
|
||||
} else
|
||||
App::smartShowWindow(callsWindow);
|
||||
}
|
||||
mCall->acceptWithParams(params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -230,11 +230,13 @@ bool CallsListModel::removeRows (int row, int count, const QModelIndex &parent)
|
|||
void CallsListModel::addCall (const shared_ptr<linphone::Call> &call) {
|
||||
if (call->getDir() == linphone::CallDirOutgoing) {
|
||||
QQuickWindow *callsWindow = App::getInstance()->getCallsWindow();
|
||||
if (CoreManager::getInstance()->getSettingsModel()->getKeepCallsWindowInBackground()) {
|
||||
if (!callsWindow->isVisible())
|
||||
callsWindow->showMinimized();
|
||||
} else
|
||||
App::smartShowWindow(callsWindow);
|
||||
if (callsWindow) {
|
||||
if (CoreManager::getInstance()->getSettingsModel()->getKeepCallsWindowInBackground()) {
|
||||
if (!callsWindow->isVisible())
|
||||
callsWindow->showMinimized();
|
||||
} else
|
||||
App::smartShowWindow(callsWindow);
|
||||
}
|
||||
}
|
||||
|
||||
CallModel *callModel = new CallModel(call);
|
||||
|
|
|
|||
|
|
@ -69,9 +69,12 @@ ChatProxyModel::ChatProxyModel (QObject *parent) : QSortFilterProxyModel(parent)
|
|||
QObject::connect(app->getMainWindow(), &QWindow::activeChanged, this, [this]() {
|
||||
handleIsActiveChanged(App::getInstance()->getMainWindow());
|
||||
});
|
||||
QObject::connect(app->getCallsWindow(), &QWindow::activeChanged, this, [this]() {
|
||||
handleIsActiveChanged(App::getInstance()->getCallsWindow());
|
||||
});
|
||||
|
||||
QQuickWindow *callsWindow = app->getCallsWindow();
|
||||
if (callsWindow)
|
||||
QObject::connect(callsWindow, &QWindow::activeChanged, this, [this, callsWindow]() {
|
||||
handleIsActiveChanged(callsWindow);
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue