avoid wrong usage of QStringBuilder via auto type deduction
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 21 Aug 2024 16:16:42 +0000 (18:16 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Thu, 22 Aug 2024 12:53:46 +0000 (14:53 +0200)
detected via https://github.com/KDE/clazy/blob/master/docs/checks/README-auto-unexpected-qstringbuilder.md#auto-unexpected-qstringbuilder

also reported by g++ via compile time warnings

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/folder.cpp
src/gui/proxyauthhandler.cpp

index 3aad88a0f807852070095f3ad8a82f5d4b48f8c3..5c7620c6a7fa06b2c6d76fbd17ab1f06cb8b1160 100644 (file)
@@ -1481,7 +1481,7 @@ void Folder::warnOnNewExcludedItem(const SyncJournalFileRecord &record, const QS
     // Note: This assumes we're getting file watcher notifications
     // for folders only on creation and deletion - if we got a notification
     // on content change that would create spurious warnings.
-    const auto fullPath = _canonicalLocalPath + path;
+    const auto fullPath = QString{_canonicalLocalPath + path};
     QFileInfo fi(fullPath);
     if (!FileSystem::fileExists(fullPath))
         return;
index 13228e2d5bdf9b6c0d4436d41aa4c7c478e333d8..360f0dec46450c3553ac0baf917c6bb7f5609be6 100644 (file)
@@ -58,7 +58,7 @@ void ProxyAuthHandler::handleProxyAuthenticationRequired(
     }
 
     const auto account = qobject_cast<Account *>(sender());
-    const auto key = proxy.hostName() + QLatin1Char(':') + QString::number(proxy.port());
+    const auto key = QString{proxy.hostName() + QLatin1Char(':') + QString::number(proxy.port())};
 
     // If the proxy server has changed, forget what we know.
     if (key != _proxy) {