From 6b7bd559311d9de0c66af8f6d86cc6931f282af8 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Fri, 30 Nov 2012 01:37:08 +0200 Subject: [PATCH 1/2] Improve the handling of native directory separators. --- src/fs_utils.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/fs_utils.cpp b/src/fs_utils.cpp index 08c63c655..2e9ecd8a7 100644 --- a/src/fs_utils.cpp +++ b/src/fs_utils.cpp @@ -73,12 +73,7 @@ using namespace libtorrent; */ QString fsutils::toDisplayPath(const QString& path) { -#if defined(Q_WS_WIN) || defined(Q_OS_OS2) - QString ret = path; - return ret.replace("/", "\\"); -#else - return path; -#endif + return QDir::toNativeSeparators(path); } /** From 4749fa45e898c39d4629293bbdaf6ccbcff38577 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Fri, 30 Nov 2012 01:38:01 +0200 Subject: [PATCH 2/2] Improve the display of paths in the 'Add new torrent' dialog. --- src/addnewtorrentdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/addnewtorrentdialog.cpp b/src/addnewtorrentdialog.cpp index 18aa0fc09..2a6f8e9c8 100644 --- a/src/addnewtorrentdialog.cpp +++ b/src/addnewtorrentdialog.cpp @@ -225,7 +225,7 @@ bool AddNewTorrentDialog::loadTorrent(const QString& torrent_path, const QString QString single_file_relpath = misc::toQStringU(m_torrentInfo->file_at(0).path.string()); #endif for (int i=0; isave_path_combo->count()-1; ++i) { - ui->save_path_combo->setItemText(i, QDir(ui->save_path_combo->itemText(i)).absoluteFilePath(single_file_relpath)); + ui->save_path_combo->setItemText(i, fsutils::toDisplayPath(QDir(ui->save_path_combo->itemText(i)).absoluteFilePath(single_file_relpath))); } }