diff --git a/src/preferences/options_imp.cpp b/src/preferences/options_imp.cpp index e3209d6c7..74a51ac2f 100644 --- a/src/preferences/options_imp.cpp +++ b/src/preferences/options_imp.cpp @@ -351,7 +351,7 @@ void options_imp::saveOptions(){ pref.preAllocateAllFiles(preAllocateAllFiles()); pref.useAdditionDialog(useAdditionDialog()); pref.addTorrentsInPause(addTorrentsInPause()); - ScanFoldersModel::instance()->makePersistent(pref); + ScanFoldersModel::instance()->makePersistent(); addedScanDirs.clear(); QString export_dir = getExportDir(); #if defined(Q_WS_WIN) || defined(Q_OS_OS2) diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index b9b9ff382..f8a7046e6 100644 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -280,7 +280,8 @@ void QBtSession::configureSession() { } int i = 0; foreach (const QString &dir, scan_dirs) { - m_scanFolders->addPath(dir, downloadInDirList.at(i)); + qDebug() << "Adding scan dir" << dir << downloadInDirList.at(i); + ScanFoldersModel::PathStatus ret = m_scanFolders->addPath(dir, downloadInDirList.at(i)); ++i; } // * Export Dir diff --git a/src/scannedfoldersmodel.cpp b/src/scannedfoldersmodel.cpp index 466d28957..52c3d4dc8 100644 --- a/src/scannedfoldersmodel.cpp +++ b/src/scannedfoldersmodel.cpp @@ -29,7 +29,7 @@ */ #include "scannedfoldersmodel.h" - +#include "preferences.h" #include "filesystemwatcher.h" #include @@ -189,15 +189,16 @@ int ScanFoldersModel::findPathData(const QString &path) const { return -1; } -void ScanFoldersModel::makePersistent(QIniSettings &settings) { +void ScanFoldersModel::makePersistent() { + Preferences pref; QStringList paths; QList downloadInFolderInfo; foreach (const PathData* pathData, m_pathList) { paths << pathData->path; downloadInFolderInfo << pathData->downloadAtPath; } - settings.setValue(QString::fromUtf8("ScanDirs"), paths); - settings.setValue(QString::fromUtf8("DownloadInScanDirs"), misc::toStringList(downloadInFolderInfo)); + pref.setScanDirs(paths); + pref.setDownloadInScanDirs(downloadInFolderInfo); } ScanFoldersModel *ScanFoldersModel::m_instance = 0; diff --git a/src/scannedfoldersmodel.h b/src/scannedfoldersmodel.h index 35da569a5..f0551d3e6 100644 --- a/src/scannedfoldersmodel.h +++ b/src/scannedfoldersmodel.h @@ -61,7 +61,7 @@ public: PathStatus setDownloadAtPath(int row, bool downloadAtPath); bool downloadInTorrentFolder(const QString &filePath) const; - void makePersistent(QIniSettings &settings); + void makePersistent(); signals: // The absolute paths of new torrent files in the scanned directories.