diff --git a/src/gui/editlocallyjob.cpp b/src/gui/editlocallyjob.cpp index 1027243e38..69eccd62fc 100644 --- a/src/gui/editlocallyjob.cpp +++ b/src/gui/editlocallyjob.cpp @@ -37,6 +37,7 @@ EditLocallyJob::EditLocallyJob(const QString &userId, , _relPath(relPath) , _token(token) { + connect(this, &EditLocallyJob::callShowError, this, &EditLocallyJob::showError, Qt::QueuedConnection); } void EditLocallyJob::startSetup() @@ -546,8 +547,8 @@ void EditLocallyJob::openFile() // from a separate thread, or, there will be a freeze. To avoid searching for a specific folder and checking // if the VFS is enabled - we just always call it from a separate thread. QtConcurrent::run([localFilePathUrl, this]() { - if (QDesktopServices::openUrl(localFilePathUrl)) { - showError(tr("Could not open %1").arg(_fileName), tr("Please try again.")); + if (!QDesktopServices::openUrl(localFilePathUrl)) { + emit callShowError(tr("Could not open %1").arg(_fileName), tr("Please try again.")); } Systray::instance()->destroyEditFileLocallyLoadingDialog(); diff --git a/src/gui/editlocallyjob.h b/src/gui/editlocallyjob.h index 158e0fc5d2..6456492460 100644 --- a/src/gui/editlocallyjob.h +++ b/src/gui/editlocallyjob.h @@ -46,7 +46,7 @@ signals: void setupFinished(); void error(const QString &message, const QString &informativeText); void finished(); - + void callShowError(const QString &message, const QString &informativeText); public slots: void startSetup(); void startEditLocally();