1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 19:31:02 +01:00

Show filenames in the filename column if the URL has a "file" scheme. Also convert the path to native separators for windows

This commit is contained in:
David Sansome 2011-11-12 19:57:21 +00:00
parent 97cc6bb1b5
commit 23bc7acaee

View File

@ -423,8 +423,13 @@ QWidget* TagCompletionItemDelegate::createEditor(
}
QString NativeSeparatorsDelegate::displayText(const QVariant& value, const QLocale&) const {
QString str = value.toString();
if (str.contains("://"))
return str;
return QDir::toNativeSeparators(str);
const QString text = value.toString();
if (text.contains("://")) {
const QUrl url = QUrl::fromEncoded(text.toAscii());
if (url.scheme() == "file") {
return QDir::toNativeSeparators(url.toLocalFile());
}
return text;
}
return QDir::toNativeSeparators(text);
}