Use URLs for openInFileBrowser.
This commit is contained in:
parent
cc986b7177
commit
a1ece63f3a
|
@ -283,11 +283,10 @@ QString GetConfigPath(ConfigPath config) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenInFileBrowser(const QStringList& filenames) {
|
void OpenInFileBrowser(const QList<QUrl>& urls) {
|
||||||
QSet<QString> dirs;
|
QSet<QString> dirs;
|
||||||
|
|
||||||
foreach (const QString& filename, filenames) {
|
foreach (const QUrl& url, urls) {
|
||||||
QUrl url(filename);
|
|
||||||
if (url.scheme() != "file") {
|
if (url.scheme() != "file") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
#include <QSize>
|
#include <QSize>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
#include <boost/scoped_array.hpp>
|
#include <boost/scoped_array.hpp>
|
||||||
|
|
||||||
|
@ -49,7 +50,7 @@ namespace Utilities {
|
||||||
bool CopyRecursive(const QString& source, const QString& destination);
|
bool CopyRecursive(const QString& source, const QString& destination);
|
||||||
bool Copy(QIODevice* source, QIODevice* destination);
|
bool Copy(QIODevice* source, QIODevice* destination);
|
||||||
|
|
||||||
void OpenInFileBrowser(const QStringList& filenames);
|
void OpenInFileBrowser(const QList<QUrl>& filenames);
|
||||||
|
|
||||||
enum HashFunction {
|
enum HashFunction {
|
||||||
Md5_Algo,
|
Md5_Algo,
|
||||||
|
|
|
@ -542,10 +542,10 @@ void LibraryView::EditSmartPlaylistFinished() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LibraryView::ShowInBrowser() {
|
void LibraryView::ShowInBrowser() {
|
||||||
QStringList filenames;
|
QList<QUrl> urls;
|
||||||
foreach (const Song& song, GetSelectedSongs()) {
|
foreach (const Song& song, GetSelectedSongs()) {
|
||||||
filenames << song.url().toLocalFile();
|
urls << song.url();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utilities::OpenInFileBrowser(filenames);
|
Utilities::OpenInFileBrowser(urls);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1862,15 +1862,15 @@ void MainWindow::PlaylistDelete() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::PlaylistOpenInBrowser() {
|
void MainWindow::PlaylistOpenInBrowser() {
|
||||||
QStringList filenames;
|
QList<QUrl> urls;
|
||||||
QModelIndexList proxy_indexes = ui_->playlist->view()->selectionModel()->selectedRows();
|
QModelIndexList proxy_indexes = ui_->playlist->view()->selectionModel()->selectedRows();
|
||||||
|
|
||||||
foreach (const QModelIndex& proxy_index, proxy_indexes) {
|
foreach (const QModelIndex& proxy_index, proxy_indexes) {
|
||||||
const QModelIndex index = playlists_->current()->proxy()->mapToSource(proxy_index);
|
const QModelIndex index = playlists_->current()->proxy()->mapToSource(proxy_index);
|
||||||
filenames << index.sibling(index.row(), Playlist::Column_Filename).data().toString();
|
urls << index.sibling(index.row(), Playlist::Column_Filename).data().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utilities::OpenInFileBrowser(filenames);
|
Utilities::OpenInFileBrowser(urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::DeleteFinished(const SongList& songs_with_errors) {
|
void MainWindow::DeleteFinished(const SongList& songs_with_errors) {
|
||||||
|
|
Loading…
Reference in New Issue