diff --git a/src/gui/activity/activitydata.cpp b/src/gui/activity/activitydata.cpp index 10baf7bef401c..8d41c85cdd6f6 100644 --- a/src/gui/activity/activitydata.cpp +++ b/src/gui/activity/activitydata.cpp @@ -178,7 +178,7 @@ OCC::Activity Activity::fromActivityJson(const QJsonObject &json, const AccountP QString Activity::relativeServerFileTypeIconPath(const QMimeType &mimeType) { const auto iconPath = QStringLiteral("/index.php/apps/theming/img/core/filetypes/"); - const auto defaultIcon = iconPath + QStringLiteral("file.svg"); + const QString defaultIcon = iconPath + QStringLiteral("file.svg"); if (!mimeType.isValid()) { return defaultIcon; } diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index 3d6e2378393a8..1d585bf7059a7 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -283,7 +283,7 @@ void GeneralSettings::confirmEnableFileProviderMode() void GeneralSettings::confirmDisableFileProviderMode() { - const auto text = tr("File Provider will be turned off for all accounts, and your files will no longer be available in Finder under the \"Locations\" section.") + const QString text = tr("File Provider will be turned off for all accounts, and your files will no longer be available in Finder under the \"Locations\" section.") + QStringLiteral("\n\n") + tr("Items that were not uploaded yet will be preserved and shown to you. Classic sync folders are not set up again automatically — you can add folder sync connections afterwards in each account's settings."); diff --git a/src/gui/notificationsoundplayer.cpp b/src/gui/notificationsoundplayer.cpp index 2e668f528860c..4200ed6191189 100644 --- a/src/gui/notificationsoundplayer.cpp +++ b/src/gui/notificationsoundplayer.cpp @@ -55,10 +55,10 @@ QString extractQrcToCache(const QString &qrcResourcePath) fingerprint += QByteArray::number(bytes.size()); const auto hash = QCryptographicHash::hash(fingerprint, QCryptographicHash::Sha1).toHex(); - const auto cacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QStringLiteral("/sounds"); + const QString cacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QStringLiteral("/sounds"); const auto suffix = QFileInfo(qrcResourcePath).suffix(); const auto dottedSuffix = suffix.isEmpty() ? QString() : QStringLiteral(".") + suffix; - const auto destinationPath = cacheDir + QStringLiteral("/") + QString::fromLatin1(hash) + dottedSuffix; + const QString destinationPath = cacheDir + QStringLiteral("/") + QString::fromLatin1(hash) + dottedSuffix; if (QFile::exists(destinationPath)) { extractedPaths.insert(qrcResourcePath, destinationPath); diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index b6136e9557a11..3e04f33798550 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -945,7 +945,7 @@ void User::slotFileProviderInsufficientQuotaForItem(const QString &domainIdentif // user-visible refusal can produce many `reportInsufficientQuotaForItem` calls. Dedupe // per (domain, relativePath) so the activity list shows one row per affected file rather // than one per retry. See https://github.com/nextcloud/desktop/issues/9598. - const auto dedupKey = domainIdentifier + QLatin1Char('|') + relativePath; + const QString dedupKey = domainIdentifier + QLatin1Char('|') + relativePath; if (_reportedQuotaItems.contains(dedupKey)) { qCDebug(lcActivity) << "Suppressing duplicate quota-item entry for" << relativePath << "in domain" << domainIdentifier; return; @@ -1043,7 +1043,7 @@ void User::slotFileProviderRetryUploads(const QString &domainIdentifier) // Re-arm dedupe so the next quota event for this domain produces a fresh summary entry // and fresh per-item entries (one per affected file, not one per retry). _reportedQuotaSummaryDomains.remove(domainIdentifier); - const auto domainPrefix = domainIdentifier + QLatin1Char('|'); + const QString domainPrefix = domainIdentifier + QLatin1Char('|'); QMutableSetIterator it(_reportedQuotaItems); while (it.hasNext()) { if (it.next().startsWith(domainPrefix)) { diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index a586016e99330..25d53130ee3cb 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -407,7 +407,7 @@ void DiscoverySingleLocalDirectoryJob::run() { // Access lock state on the worker thread so a blocking open cannot freeze the GUI #10464 if (!i.isSymLink && !i.isVirtualFile && !i.isDirectory) { - const auto absoluteLocalPath = localPath + QLatin1Char('/') + i.name; + const QString absoluteLocalPath = localPath + QLatin1Char('/') + i.name; i.isLocked = FileSystem::isFileLocked(absoluteLocalPath, FileSystem::LockMode::SharedRead); qCDebug(lcDiscovery) << "File" << absoluteLocalPath << "isLocked" << i.isLocked; } diff --git a/src/libsync/filesystem.cpp b/src/libsync/filesystem.cpp index 88731dc75e1c0..99fdb8d5b0f7c 100644 --- a/src/libsync/filesystem.cpp +++ b/src/libsync/filesystem.cpp @@ -243,7 +243,7 @@ QString FileSystem::filePathLockFilePatternMatch(const QString &path) // Adobe lock files (.idlk / .prlock) are identified by extension, not prefix. const auto suffix = QFileInfo{pathSplit.last()}.suffix().toLower().toStdString(); if (adobeLockFileDocumentExtensions.contains(suffix)) { - const auto pattern = QStringLiteral(".") + QString::fromStdString(suffix); + const QString pattern = QStringLiteral(".") + QString::fromStdString(suffix); qCDebug(OCC::lcFileSystem) << "Found an Adobe lock file with extension:" << pattern << "in path:" << path; return pattern; } diff --git a/test/testlockedfiles.cpp b/test/testlockedfiles.cpp index d4d84ffcdff47..3f89fab12a261 100644 --- a/test/testlockedfiles.cpp +++ b/test/testlockedfiles.cpp @@ -131,6 +131,46 @@ private slots: QVERIFY(tmp.remove()); } + // Functional check for local directory discovery #10535: DiscoverySingleLocalDirectoryJob + // must return every regular file and subdirectory with its name and flags intact. + void testLocalDirectoryDiscoveryReturnsAllEntries() + { + QTemporaryDir tmp; + QVERIFY(tmp.isValid()); + QStringList expectedFiles; + for (int i = 0; i < 50; ++i) { + // Varied lengths and non ascii, matching the discovery concat path. + const QString name = QStringLiteral("entry_%1_ααβγ_%2.txt").arg(i).arg(QString(i % 20, QChar('x'))); + QFile file(tmp.filePath(name)); + QVERIFY(file.open(QIODevice::WriteOnly)); + file.write("data"); + expectedFiles.append(name); + } + QVERIFY(QDir(tmp.path()).mkdir(QStringLiteral("subdir"))); + + const auto job = new DiscoverySingleLocalDirectoryJob({}, tmp.path(), nullptr, false); + QSignalSpy finishedSpy(job, &DiscoverySingleLocalDirectoryJob::finished); + QThreadPool::globalInstance()->start(job); + QTRY_COMPARE_WITH_TIMEOUT(finishedSpy.count(), 1, 5000); + + const auto results = finishedSpy.takeFirst().at(0).value>(); + QCOMPARE(results.size(), expectedFiles.size() + 1); + + QStringList seenFiles; + for (const auto &info : results) { + QVERIFY(!info.name.isEmpty()); + if (info.isDirectory) { + QCOMPARE(info.name, QStringLiteral("subdir")); + continue; + } + QVERIFY(!info.isLocked); + seenFiles.append(info.name); + } + seenFiles.sort(); + expectedFiles.sort(); + QCOMPARE(seenFiles, expectedFiles); + } + #ifdef Q_OS_WIN void testLockDetectionUsesRealFileSystemCheck() {