From: Kevin Ottens Date: Thu, 18 Jun 2020 13:15:25 +0000 (+0200) Subject: Use QHash instead of QMap X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~130^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3e13919c3523fbe6da1b6b209644196f4159ad6f;p=nextcloud-desktop.git Use QHash instead of QMap This is not only a question of performances in our case (complexity being better on look ups). It also provides a few more services. Signed-off-by: Kevin Ottens --- diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp index f1e690efb..45b356b1e 100644 --- a/src/libsync/clientsideencryption.cpp +++ b/src/libsync/clientsideencryption.cpp @@ -1223,7 +1223,7 @@ void ClientSideEncryption::fetchFolderEncryptedStatus() { getEncryptedStatus->start(); } -void ClientSideEncryption::folderEncryptedStatusFetched(const QMap& result) +void ClientSideEncryption::folderEncryptedStatusFetched(const QHash& result) { _refreshingEncryptionStatus = false; _folder2encryptedStatus = result; diff --git a/src/libsync/clientsideencryption.h b/src/libsync/clientsideencryption.h index 7d9ce5fce..17f48348d 100644 --- a/src/libsync/clientsideencryption.h +++ b/src/libsync/clientsideencryption.h @@ -94,7 +94,7 @@ public slots: void slotRequestMnemonic(); private slots: - void folderEncryptedStatusFetched(const QMap &values); + void folderEncryptedStatusFetched(const QHash &values); void folderEncryptedStatusError(int error); void publicKeyFetched(QKeychain::Job *incoming); @@ -122,8 +122,8 @@ private: bool isInitialized = false; bool _refreshingEncryptionStatus = false; //TODO: Save this on disk. - QMap _folder2token; - QMap _folder2encryptedStatus; + QHash _folder2token; + QHash _folder2encryptedStatus; public: //QSslKey _privateKey; diff --git a/src/libsync/clientsideencryptionjobs.cpp b/src/libsync/clientsideencryptionjobs.cpp index 707612413..afd7df08d 100644 --- a/src/libsync/clientsideencryptionjobs.cpp +++ b/src/libsync/clientsideencryptionjobs.cpp @@ -77,7 +77,7 @@ bool GetFolderEncryptStatusJob::finished() QString currFile; int currEncryptedStatus = -1; - QMap folderStatus; + QHash folderStatus; while (!reader.atEnd()) { auto type = reader.readNext(); if (type == QXmlStreamReader::StartElement) { diff --git a/src/libsync/clientsideencryptionjobs.h b/src/libsync/clientsideencryptionjobs.h index 8831f7483..9a375ff92 100644 --- a/src/libsync/clientsideencryptionjobs.h +++ b/src/libsync/clientsideencryptionjobs.h @@ -293,7 +293,7 @@ protected: bool finished() override; signals: - void encryptStatusReceived(const QMap folderMetadata2EncryptionStatus); + void encryptStatusReceived(const QHash folderMetadata2EncryptionStatus); void encryptStatusFolderReceived(const QString &folder, bool isEncrypted); void encryptStatusError(int statusCode); private: