From 59686c828631b456d2e6627e25fa092fe3248bf5 Mon Sep 17 00:00:00 2001 From: alex-z Date: Wed, 1 Mar 2023 14:46:08 +0100 Subject: [PATCH] Fix review comments. Signed-off-by: alex-z --- src/gui/filedetails/sharemodel.cpp | 3 +-- src/gui/socketapi/socketapi.cpp | 2 +- src/gui/socketapi/socketapi.h | 2 +- src/libsync/clientsideencryption.cpp | 2 +- src/libsync/clientsideencryption.h | 2 +- src/libsync/updatefiledropmetadata.cpp | 2 +- test/syncenginetestutils.cpp | 2 +- test/testsecurefiledrop.cpp | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/gui/filedetails/sharemodel.cpp b/src/gui/filedetails/sharemodel.cpp index 7c98920e47cca..f210e4550e783 100644 --- a/src/gui/filedetails/sharemodel.cpp +++ b/src/gui/filedetails/sharemodel.cpp @@ -388,8 +388,7 @@ void ShareModel::handleLinkShare() { if (!_isEncryptedItem) { handlePlaceholderLinkShare(); - } - if (_isSecureFileDropSupportedFolder) { + } else if (_isSecureFileDropSupportedFolder) { handleSecureFileDropLinkShare(); } } diff --git a/src/gui/socketapi/socketapi.cpp b/src/gui/socketapi/socketapi.cpp index fafa60aab75e8..4e0ef59ae1dff 100644 --- a/src/gui/socketapi/socketapi.cpp +++ b/src/gui/socketapi/socketapi.cpp @@ -1374,7 +1374,7 @@ void SocketApi::command_GET_MENU_ITEMS(const QString &argument, OCC::SocketListe sendEncryptFolderCommandMenuEntries(fileInfo, fileData, isE2eEncryptedPath, listener); sendLockFileCommandMenuEntries(fileInfo, syncFolder, fileData, listener); const auto itemEncryptionFlag = isE2eEncryptedPath ? SharingContextItemEncryptedFlag::EncryptedItem : SharingContextItemEncryptedFlag::NotEncryptedItem; - const auto rootE2eeFolderFlag = isE2eEncryptedRootFolder ? SharingContextItemRootEncryptedFolderFlag::RootEncryptedFolder : SharingContextItemRootEncryptedFolderFlag::NotARootNecryptedFolder; + const auto rootE2eeFolderFlag = isE2eEncryptedRootFolder ? SharingContextItemRootEncryptedFolderFlag::RootEncryptedFolder : SharingContextItemRootEncryptedFolderFlag::NonRootEncryptedFolder; sendSharingContextMenuOptions(fileData, listener, itemEncryptionFlag, rootE2eeFolderFlag); // Conflict files get conflict resolution actions diff --git a/src/gui/socketapi/socketapi.h b/src/gui/socketapi/socketapi.h index ca9a44ba14693..afa5ef965e4e3 100644 --- a/src/gui/socketapi/socketapi.h +++ b/src/gui/socketapi/socketapi.h @@ -58,7 +58,7 @@ class SocketApi : public QObject enum SharingContextItemRootEncryptedFolderFlag { RootEncryptedFolder, - NotARootNecryptedFolder + NonRootEncryptedFolder }; public: diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp index fad780b4ed777..1eb7a9bd98ac5 100644 --- a/src/libsync/clientsideencryption.cpp +++ b/src/libsync/clientsideencryption.cpp @@ -1766,7 +1766,7 @@ bool FolderMetadata::isFileDropPresent() const return _fileDrop.size() > 0; } -bool FolderMetadata::moveFileDropToFiles() +bool FolderMetadata::moveFromFileDropToFiles() { if (_fileDrop.isEmpty()) { return false; diff --git a/src/libsync/clientsideencryption.h b/src/libsync/clientsideencryption.h index 69d3479d6e34c..4cbe776b1e1d8 100644 --- a/src/libsync/clientsideencryption.h +++ b/src/libsync/clientsideencryption.h @@ -198,7 +198,7 @@ class OWNCLOUDSYNC_EXPORT FolderMetadata { [[nodiscard]] bool isFileDropPresent() const; - [[nodiscard]] bool moveFileDropToFiles(); + [[nodiscard]] bool moveFromFileDropToFiles(); [[nodiscard]] QJsonObject fileDrop() const; diff --git a/src/libsync/updatefiledropmetadata.cpp b/src/libsync/updatefiledropmetadata.cpp index 98591fafc05ae..0d23f2f70f778 100644 --- a/src/libsync/updatefiledropmetadata.cpp +++ b/src/libsync/updatefiledropmetadata.cpp @@ -123,7 +123,7 @@ void UpdateFileDropMetadataJob::slotFolderEncryptedMetadataReceived(const QJsonD // Encrypt File! _metadata.reset(new FolderMetadata(propagator()->account(), json.toJson(QJsonDocument::Compact), statusCode)); - if (!_metadata->moveFileDropToFiles()) { + if (!_metadata->moveFromFileDropToFiles()) { unlockFolder(); return; } diff --git a/test/syncenginetestutils.cpp b/test/syncenginetestutils.cpp index b40ddac7810b6..b5d9beaed7274 100644 --- a/test/syncenginetestutils.cpp +++ b/test/syncenginetestutils.cpp @@ -1077,7 +1077,7 @@ QNetworkReply * FakeQNAM::overrideReplyWithError(QString fileName, QNetworkAcces { QNetworkReply *reply = nullptr; - //Q_ASSERT(!fileName.isNull()); + Q_ASSERT(!fileName.isNull()); if (_errorPaths.contains(fileName)) { reply = new FakeErrorReply { op, newRequest, this, _errorPaths[fileName] }; } diff --git a/test/testsecurefiledrop.cpp b/test/testsecurefiledrop.cpp index d68cb9a6a0f65..33653b800ae4b 100644 --- a/test/testsecurefiledrop.cpp +++ b/test/testsecurefiledrop.cpp @@ -71,7 +71,7 @@ private slots: const auto jsonDoc = QJsonDocument::fromJson(fakeJsonReplyFile.readAll()); _parsedMetadataWithFileDrop.reset(new FolderMetadata(_fakeFolder.syncEngine().account(), jsonDoc.toJson())); _parsedMetadataAfterProcessingFileDrop.reset(new FolderMetadata(_fakeFolder.syncEngine().account(), jsonDoc.toJson())); - [[maybe_unused]] const auto result = _parsedMetadataAfterProcessingFileDrop->moveFileDropToFiles(); + [[maybe_unused]] const auto result = _parsedMetadataAfterProcessingFileDrop->moveFromFileDropToFiles(); reply = new FakePayloadReply(op, req, jsonDoc.toJson(), nullptr); ++_getMetadataCallsCount; } else {