mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 13:25:52 +03:00
Merge pull request #5253 from nextcloud/bugfix/editLocallyShouldWork
do not create GUI from a random thread and show error on real error
This commit is contained in:
commit
34d5b82fa8
2 changed files with 4 additions and 3 deletions
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue