Skip to content

Commit

Permalink
Merge pull request #7639 from nextcloud/bugfix/conflict
Browse files Browse the repository at this point in the history
Include folders when displaying the local metadata about a conflict.
  • Loading branch information
mgallien authored Dec 12, 2024
2 parents 2badd54 + 90bcf65 commit e5db153
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 e5db153

Please sign in to comment.