Update Preferences class

Preferences class setters are guaranteed to accept string with both native and qt-style separators, getters are guaranteed to return string with qt-style separators
This commit is contained in:
Nick Tiskov
2013-11-09 19:45:01 +04:00
parent 1334386a1b
commit 48250c7b76
3 changed files with 47 additions and 43 deletions

View File

@@ -82,12 +82,8 @@ QVariant ScanFoldersModel::data(const QModelIndex &index, int role) const {
const PathData* pathData = m_pathList.at(index.row());
if (index.column() == PathColumn && role == Qt::DisplayRole) {
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
QString ret = pathData->path;
return ret.replace("/", "\\");
#else
return pathData->path;
#endif
return fsutils::toNativePath(pathData->path);
}
if (index.column() == DownloadAtTorrentColumn && role == Qt::CheckStateRole)
return pathData->downloadAtPath ? Qt::Checked : Qt::Unchecked;
@@ -181,7 +177,7 @@ bool ScanFoldersModel::downloadInTorrentFolder(const QString &filePath) const {
int ScanFoldersModel::findPathData(const QString &path) const {
for (int i = 0; i < m_pathList.count(); ++i) {
const PathData* pathData = m_pathList.at(i);
if (pathData->path == path)
if (pathData->path == fsutils::fromNativePath(path))
return i;
}