Skip to content

Commit

Permalink
Include folders when displaying the local metadata about a conflict.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <hello@camilasan.com>
  • Loading branch information
camilasan authored and mgallien committed Dec 12, 2024
1 parent 2badd54 commit 90bcf65
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 90bcf65

Please sign in to comment.