Skip to content

Commit

Permalink
Merge pull request #7646 from nextcloud/backport/7639/stable-3.15
Browse files Browse the repository at this point in the history
[stable-3.15] Include folders when displaying the local metadata about a conflict.
  • Loading branch information
mgallien authored Dec 12, 2024
2 parents d4cb677 + ff0030e commit 1a34110
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/gui/caseclashfilenamedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,22 +175,24 @@ QString CaseClashFilenameDialog::caseClashConflictFile(const QString &conflictFi
{
const auto filePathFileInfo = QFileInfo(conflictFilePath);
const auto conflictFileName = filePathFileInfo.fileName();
const auto lookingForDirectory = FileSystem::isDir(filePathFileInfo.absoluteFilePath());

QDirIterator it(filePathFileInfo.path(), QDirIterator::Subdirectories);

while(it.hasNext()) {
const auto filePath = it.next();
qCDebug(lcCaseClashConflictFialog) << filePath;

if (FileSystem::isDir(filePath)) {
if (FileSystem::isDir(filePath) && !lookingForDirectory) {
continue;
}

QFileInfo fileInfo(filePath);
const auto currentFileName = fileInfo.fileName();
if (currentFileName.compare(conflictFileName, Qt::CaseInsensitive) == 0 &&
currentFileName != conflictFileName) {
const auto currentFileName = QFileInfo(filePath).fileName();
if (currentFileName.compare(conflictFileName, Qt::CaseInsensitive) != 0) {
continue;
}

if (currentFileName != conflictFileName) {
return filePath;
}
}
Expand Down

0 comments on commit 1a34110

Please sign in to comment.