mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 08:27:24 -06:00
Fix scan dirs saving
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.5.3
|
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.5.3
|
||||||
- BUGFIX: Fix priority up/down for multiple torrents at the same time (closes #692184)
|
- BUGFIX: Fix priority up/down for multiple torrents at the same time (closes #692184)
|
||||||
- BUGFIX: Make sure the number of torrents is properly set on startup (closes #694135)
|
- BUGFIX: Make sure the number of torrents is properly set on startup (closes #694135)
|
||||||
|
- BUGFIX: Fix scan directories saving (closes #694768)
|
||||||
|
- BUGFIX: Make sure the main window has focus on startup
|
||||||
|
|
||||||
* Sun Dec 19 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.5.2
|
* Sun Dec 19 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.5.2
|
||||||
- BUGFIX: Fix alternative speed icon staying pressed when disabled
|
- BUGFIX: Fix alternative speed icon staying pressed when disabled
|
||||||
|
|||||||
@@ -296,6 +296,8 @@ int main(int argc, char *argv[]){
|
|||||||
torrentCmdLine.removeFirst();
|
torrentCmdLine.removeFirst();
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
MainWindow window(0, torrentCmdLine);
|
MainWindow window(0, torrentCmdLine);
|
||||||
|
if(!no_splash)
|
||||||
|
QObject::connect(splash, SIGNAL(destroyed()), &window, SLOT(raise()));
|
||||||
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
|
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
|
||||||
&window, SLOT(processParams(const QString&)));
|
&window, SLOT(processParams(const QString&)));
|
||||||
app.setActivationWindow(&window);
|
app.setActivationWindow(&window);
|
||||||
|
|||||||
@@ -225,6 +225,8 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
|
|||||||
} else {
|
} else {
|
||||||
if(pref.startMinimized())
|
if(pref.startMinimized())
|
||||||
showMinimized();
|
showMinimized();
|
||||||
|
else
|
||||||
|
setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start watching the executable for updates
|
// Start watching the executable for updates
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ void options_imp::saveOptions(){
|
|||||||
pref.preAllocateAllFiles(preAllocateAllFiles());
|
pref.preAllocateAllFiles(preAllocateAllFiles());
|
||||||
pref.useAdditionDialog(useAdditionDialog());
|
pref.useAdditionDialog(useAdditionDialog());
|
||||||
pref.addTorrentsInPause(addTorrentsInPause());
|
pref.addTorrentsInPause(addTorrentsInPause());
|
||||||
ScanFoldersModel::instance()->makePersistent(pref);
|
ScanFoldersModel::instance()->makePersistent();
|
||||||
addedScanDirs.clear();
|
addedScanDirs.clear();
|
||||||
QString export_dir = getExportDir();
|
QString export_dir = getExportDir();
|
||||||
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
|
|||||||
@@ -276,7 +276,8 @@ void QBtSession::configureSession() {
|
|||||||
}
|
}
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (const QString &dir, scan_dirs) {
|
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;
|
++i;
|
||||||
}
|
}
|
||||||
// * Export Dir
|
// * Export Dir
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "scannedfoldersmodel.h"
|
#include "scannedfoldersmodel.h"
|
||||||
|
#include "preferences.h"
|
||||||
#include "filesystemwatcher.h"
|
#include "filesystemwatcher.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -189,15 +189,16 @@ int ScanFoldersModel::findPathData(const QString &path) const {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScanFoldersModel::makePersistent(QIniSettings &settings) {
|
void ScanFoldersModel::makePersistent() {
|
||||||
|
Preferences pref;
|
||||||
QStringList paths;
|
QStringList paths;
|
||||||
QList<bool> downloadInFolderInfo;
|
QList<bool> downloadInFolderInfo;
|
||||||
foreach (const PathData* pathData, m_pathList) {
|
foreach (const PathData* pathData, m_pathList) {
|
||||||
paths << pathData->path;
|
paths << pathData->path;
|
||||||
downloadInFolderInfo << pathData->downloadAtPath;
|
downloadInFolderInfo << pathData->downloadAtPath;
|
||||||
}
|
}
|
||||||
settings.setValue(QString::fromUtf8("ScanDirs"), paths);
|
pref.setScanDirs(paths);
|
||||||
settings.setValue(QString::fromUtf8("DownloadInScanDirs"), misc::toStringList(downloadInFolderInfo));
|
pref.setDownloadInScanDirs(downloadInFolderInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScanFoldersModel *ScanFoldersModel::m_instance = 0;
|
ScanFoldersModel *ScanFoldersModel::m_instance = 0;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
PathStatus setDownloadAtPath(int row, bool downloadAtPath);
|
PathStatus setDownloadAtPath(int row, bool downloadAtPath);
|
||||||
|
|
||||||
bool downloadInTorrentFolder(const QString &filePath) const;
|
bool downloadInTorrentFolder(const QString &filePath) const;
|
||||||
void makePersistent(QIniSettings &settings);
|
void makePersistent();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// The absolute paths of new torrent files in the scanned directories.
|
// The absolute paths of new torrent files in the scanned directories.
|
||||||
|
|||||||
Reference in New Issue
Block a user