diff --git a/src/gui/editlocallymanager.cpp b/src/gui/editlocallymanager.cpp index 42555608f7b3a..a323960f70cac 100644 --- a/src/gui/editlocallymanager.cpp +++ b/src/gui/editlocallymanager.cpp @@ -96,12 +96,16 @@ void EditLocallyManager::verify(const AccountStatePtr &accountState, const QString &relPath, const QString &token) { +#ifndef BUILD_FILE_PROVIDER_MODULE // Show the loading dialog but don't show the filename until we have - // verified the token + // verified the token. File Provider handles nc:// without a progress dialog. Systray::instance()->createEditFileLocallyLoadingDialog({}); +#endif const auto finishedHandler = [this, token] { +#ifndef BUILD_FILE_PROVIDER_MODULE Systray::instance()->destroyEditFileLocallyLoadingDialog(); +#endif _verificationJobs.remove(token); }; const auto errorEditLocally = [finishedHandler] { diff --git a/src/gui/macOS/fileprovidereditlocallyjob.cpp b/src/gui/macOS/fileprovidereditlocallyjob.cpp index 5ae84bc3c209d..03288c59f5139 100644 --- a/src/gui/macOS/fileprovidereditlocallyjob.cpp +++ b/src/gui/macOS/fileprovidereditlocallyjob.cpp @@ -9,7 +9,6 @@ #include "editlocallymanager.h" #include "networkjobs.h" -#include "systray.h" using namespace Qt::StringLiterals; @@ -43,9 +42,6 @@ void FileProviderEditLocallyJob::start() return; } - const auto filename = relPathSplit.last(); - Systray::instance()->createEditFileLocallyLoadingDialog(filename); - qCDebug(lcFileProviderEditLocallyJob) << "Getting file ocId for" << _relPath; const auto idJob = new PropfindJob(_accountState->account(), _relPath, this); @@ -62,7 +58,6 @@ void FileProviderEditLocallyJob::start() void FileProviderEditLocallyJob::showError(const QString &message, const QString &informativeText) { - Systray::instance()->destroyEditFileLocallyLoadingDialog(); EditLocallyManager::showError(message, informativeText); Q_EMIT error(message, informativeText); } diff --git a/src/gui/macOS/fileprovidereditlocallyjob_mac.mm b/src/gui/macOS/fileprovidereditlocallyjob_mac.mm index f113c671cf93d..4e3b774a42598 100644 --- a/src/gui/macOS/fileprovidereditlocallyjob_mac.mm +++ b/src/gui/macOS/fileprovidereditlocallyjob_mac.mm @@ -6,11 +6,11 @@ #include "fileprovidereditlocallyjob.h" #include +#include #include "account.h" #include "accountstate.h" #include "editlocallymanager.h" -#include "systray.h" #include "macOS/fileprovider.h" #include "macOS/fileproviderdomainmanager.h" @@ -55,10 +55,6 @@ [manager getUserVisibleURLForItemIdentifier:nsOcId completionHandler:^(NSURL *const url, NSError *const error) { - dispatch_async(dispatch_get_main_queue(), ^{ - Systray::instance()->destroyEditFileLocallyLoadingDialog(); - }); - if (error != nil) { const auto errorMessage = QString::fromNSString(error.localizedDescription); qCWarning(lcFileProviderEditLocallyMacJob) << "Error getting user visible URL for item:" << errorMessage; @@ -67,9 +63,14 @@ }); } else if (url != nil) { const auto itemLocalPath = QString::fromNSString(url.path); - qCDebug(lcFileProviderEditLocallyMacJob) << "Got user visible URL for item:" << itemLocalPath; - [NSWorkspace.sharedWorkspace openURL:url]; + qCDebug(lcFileProviderEditLocallyMacJob) << "Revealing file provider item in Finder:" << itemLocalPath; + dispatch_async(dispatch_get_main_queue(), ^{ + QTimer::singleShot(0, [itemLocalPath] { + qCDebug(lcFileProviderEditLocallyMacJob) << "Activating Finder for file provider item:" << itemLocalPath; + const auto urlToReveal = [NSURL fileURLWithPath:itemLocalPath.toNSString()]; + [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:@[urlToReveal]]; + }); emit finished(); }); } else {