Use URLs for openInFileBrowser.

This commit is contained in:
John Maguire 2011-10-26 14:54:24 +02:00
parent cc986b7177
commit a1ece63f3a
4 changed files with 10 additions and 10 deletions

View File

@ -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;
}

View File

@ -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,

View File

@ -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);
}

View File

@ -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) {