diff --git a/src/gui/caseclashfilenamedialog.cpp b/src/gui/caseclashfilenamedialog.cpp index cfba3660f1e7b..27ca251a69911 100644 --- a/src/gui/caseclashfilenamedialog.cpp +++ b/src/gui/caseclashfilenamedialog.cpp @@ -88,7 +88,10 @@ CaseClashFilenameDialog::CaseClashFilenameDialog(AccountPtr account, _relativeFilePath = filePathFileInfo.path() + QStringLiteral("/"); _relativeFilePath = _relativeFilePath.replace(folder->path(), QLatin1String()); - _relativeFilePath = _relativeFilePath.isEmpty() ? QString() : _relativeFilePath + QStringLiteral("/"); + _relativeFilePath = _relativeFilePath.isEmpty() ? QString() : _relativeFilePath; + if (!_relativeFilePath.isEmpty() && !_relativeFilePath.endsWith(QStringLiteral("/"))) { + _relativeFilePath += QStringLiteral("/"); + } _originalFileName = _relativeFilePath + conflictFileName; @@ -208,7 +211,7 @@ void CaseClashFilenameDialog::updateFileWidgetGroup(const QString &filePath, const auto fileSizeString = locale().formattedDataSize(filePathFileInfo.size()); const auto fileUrl = QUrl::fromLocalFile(filePath).toString(); const auto linkString = QStringLiteral("%2").arg(fileUrl, linkText); - const auto mime = QMimeDatabase().mimeTypeForFile(_filePath); + const auto mime = QMimeDatabase().mimeTypeForFile(_filePath, QMimeDatabase::MatchExtension); QIcon fileTypeIcon; qCDebug(lcCaseClashConflictFialog) << filePath << filePathFileInfo.exists() << filename << lastModifiedString << fileSizeString << fileUrl << linkString << mime;