Actually check if a file exists to know if it's local or not (therefore set the scheme to "file" therefore interpret it correctly in SongLoader)
URLs with ":" were sometimes wrongly interpreted as remote URLs. But some local files may have ":", and moreover on Windows all files have ":" because of the drive letter scheme.
This commit is contained in:
parent
49e3400545
commit
f51ac3f970
@ -220,10 +220,11 @@ bool CommandlineOptions::Parse() {
|
||||
// Get any filenames or URLs following the arguments
|
||||
for (int i=optind ; i<argc_ ; ++i) {
|
||||
QString value = QFile::decodeName(argv_[i]);
|
||||
if (value.contains(":"))
|
||||
urls_ << value;
|
||||
QFileInfo file_info(value);
|
||||
if (file_info.exists())
|
||||
urls_ << QUrl::fromLocalFile(file_info.canonicalFilePath());
|
||||
else
|
||||
urls_ << QUrl::fromLocalFile(QFileInfo(value).canonicalFilePath());
|
||||
urls_ << value;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user