From e345cd43d88767cf8d30da7dacbb93d7e575aa09 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 29 May 2024 00:03:07 +0800 Subject: [PATCH] Connect receipt of a file's ocId with file opening procedure in FileProviderEditLocallyJob Signed-off-by: Claudio Cambra --- src/gui/macOS/fileprovidereditlocallyjob.cpp | 9 +++++++++ src/gui/macOS/fileprovidereditlocallyjob.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/gui/macOS/fileprovidereditlocallyjob.cpp b/src/gui/macOS/fileprovidereditlocallyjob.cpp index 441c44d22a..1045c14240 100644 --- a/src/gui/macOS/fileprovidereditlocallyjob.cpp +++ b/src/gui/macOS/fileprovidereditlocallyjob.cpp @@ -53,10 +53,17 @@ void FileProviderEditLocallyJob::start() 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); idJob->setProperties({ QByteArrayLiteral("http://owncloud.org/ns:id") }); connect(idJob, &PropfindJob::finishedWithError, this, &FileProviderEditLocallyJob::idGetError); connect(idJob, &PropfindJob::result, this, &FileProviderEditLocallyJob::idGetFinished); + + connect(this, &FileProviderEditLocallyJob::ocIdAcquired, + this, &FileProviderEditLocallyJob::openFileProviderFile); + + idJob->start(); } void FileProviderEditLocallyJob::showError(const QString &message, @@ -83,6 +90,8 @@ void FileProviderEditLocallyJob::idGetFinished(const QVariantMap &data) return; } + qCDebug(lcFileProviderEditLocallyJob) << "Got file ocId for" << _relPath << ocId; + emit ocIdAcquired(ocId); } } // namespace OCC::Mac diff --git a/src/gui/macOS/fileprovidereditlocallyjob.h b/src/gui/macOS/fileprovidereditlocallyjob.h index 1f3829999a..ead0f0e44b 100644 --- a/src/gui/macOS/fileprovidereditlocallyjob.h +++ b/src/gui/macOS/fileprovidereditlocallyjob.h @@ -47,6 +47,7 @@ private slots: void showError(const QString &message, const QString &informativeText); void idGetError(const QNetworkReply *const reply); void idGetFinished(const QVariantMap &data); + void openFileProviderFile(const QString &ocId); private: AccountStatePtr _accountState;