From dcc54a7f351271f8bdaf58b10e0c18fb0e87a256 Mon Sep 17 00:00:00 2001 From: Arnaud Demaiziere Date: Fri, 29 Jun 2007 13:42:10 +0000 Subject: [PATCH] fixed addtorrent signal, add bool onstartup to connect methods --- src/GUI.cpp | 12 ++++++------ src/torrentAddition.h | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/GUI.cpp b/src/GUI.cpp index 3c70e2b8b..f9b941b4a 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -845,7 +845,7 @@ void GUI::dropEvent(QDropEvent *event){ foreach(file, files){ if(useTorrentAdditionDialog){ torrentAdditionDialog *dialog = new torrentAdditionDialog(this); - connect(dialog, SIGNAL(torrentAddition(const QString&, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); + connect(dialog, SIGNAL(torrentAddition(const QString&, bool, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&))); dialog->showLoad(file.trimmed().replace("file://", "")); }else{ @@ -884,8 +884,8 @@ void GUI::on_actionOpen_triggered(){ for(unsigned int i=0; ishowLoad(pathsList.at(i)); }else{ BTSession.addTorrent(pathsList.at(i)); @@ -1114,7 +1114,7 @@ void GUI::processParams(const QStringList& params){ }else{ if(useTorrentAdditionDialog){ torrentAdditionDialog *dialog = new torrentAdditionDialog(this); - connect(dialog, SIGNAL(torrentAddition(const QString&, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); + connect(dialog, SIGNAL(torrentAddition(const QString&, bool, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&))); dialog->showLoad(param); }else{ @@ -1131,7 +1131,7 @@ void GUI::processScannedFiles(const QStringList& params){ foreach(param, params){ if(useTorrentAdditionDialog){ torrentAdditionDialog *dialog = new torrentAdditionDialog(this); - connect(dialog, SIGNAL(torrentAddition(const QString&, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); + connect(dialog, SIGNAL(torrentAddition(const QString&, bool, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&))); dialog->showLoad(param, true); }else{ @@ -1145,7 +1145,7 @@ void GUI::processDownloadedFiles(const QString& path, const QString& url){ bool useTorrentAdditionDialog = settings.value("Options/Misc/TorrentAdditionDialog/Enabled", true).toBool(); if(useTorrentAdditionDialog){ torrentAdditionDialog *dialog = new torrentAdditionDialog(this); - connect(dialog, SIGNAL(torrentAddition(const QString&, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); + connect(dialog, SIGNAL(torrentAddition(const QString&, bool, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&))); dialog->showLoad(path, false, url); }else{ diff --git a/src/torrentAddition.h b/src/torrentAddition.h index d6969b23f..570b52e8e 100644 --- a/src/torrentAddition.h +++ b/src/torrentAddition.h @@ -45,7 +45,7 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{ signals: void setInfoBarGUI(const QString& info, const QString& color); - void torrentAddition(const QString& filePath, bool fromScanDir, const QString& from_url); + void torrentAddition(const QString& filePath, bool fromScanDir, bool onStartup, const QString& from_url); private: QString fileName; @@ -237,7 +237,8 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{ // save filtered files savePiecesPriorities(); // Add to download list - emit torrentAddition(filePath, fromScanDir, from_url); + // TODO : quick fix + emit torrentAddition(filePath, fromScanDir, false, from_url); close(); }