Use QUrl::isLocalFile()
This commit is contained in:
@@ -1826,7 +1826,7 @@ void Playlist::InvalidateDeletedSongs() {
|
||||
PlaylistItemPtr item = items_[row];
|
||||
Song song = item->Metadata();
|
||||
|
||||
if (song.url().scheme() == "file") {
|
||||
if (song.url().isLocalFile()) {
|
||||
bool exists = QFile::exists(song.url().toLocalFile());
|
||||
|
||||
if (!exists && !item->HasForegroundColor(kInvalidSongPriority)) {
|
||||
|
||||
@@ -426,7 +426,7 @@ QString NativeSeparatorsDelegate::displayText(const QVariant &value, const QLoca
|
||||
return QDir::toNativeSeparators(string_value);
|
||||
}
|
||||
|
||||
if (url.scheme() == "file") {
|
||||
if (url.isLocalFile()) {
|
||||
return QDir::toNativeSeparators(url.toLocalFile());
|
||||
}
|
||||
return string_value;
|
||||
|
||||
@@ -40,7 +40,7 @@ bool SongPlaylistItem::InitFromQuery(const SqlRow &query) {
|
||||
QUrl SongPlaylistItem::Url() const { return song_.url(); }
|
||||
|
||||
void SongPlaylistItem::Reload() {
|
||||
if (song_.url().scheme() != "file") return;
|
||||
if (!song_.url().isLocalFile()) return;
|
||||
TagReaderClient::Instance()->ReadFileBlocking(song_.url().toLocalFile(), &song_);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user