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;
|
||||
|
||||
foreach (const QString& filename, filenames) {
|
||||
QUrl url(filename);
|
||||
foreach (const QUrl& url, urls) {
|
||||
if (url.scheme() != "file") {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <QCryptographicHash>
|
||||
#include <QSize>
|
||||
#include <QString>
|
||||
#include <QUrl>
|
||||
|
||||
#include <boost/scoped_array.hpp>
|
||||
|
||||
|
@ -49,7 +50,7 @@ namespace Utilities {
|
|||
bool CopyRecursive(const QString& source, const QString& destination);
|
||||
bool Copy(QIODevice* source, QIODevice* destination);
|
||||
|
||||
void OpenInFileBrowser(const QStringList& filenames);
|
||||
void OpenInFileBrowser(const QList<QUrl>& filenames);
|
||||
|
||||
enum HashFunction {
|
||||
Md5_Algo,
|
||||
|
|
|
@ -542,10 +542,10 @@ void LibraryView::EditSmartPlaylistFinished() {
|
|||
}
|
||||
|
||||
void LibraryView::ShowInBrowser() {
|
||||
QStringList filenames;
|
||||
QList<QUrl> urls;
|
||||
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() {
|
||||
QStringList filenames;
|
||||
QList<QUrl> urls;
|
||||
QModelIndexList proxy_indexes = ui_->playlist->view()->selectionModel()->selectedRows();
|
||||
|
||||
foreach (const QModelIndex& proxy_index, proxy_indexes) {
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue