Browse Source

- fixed delete permanently in finished list

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
5e73539393
  1. 1
      TODO
  2. 20
      qBittorrent.kdevelop
  3. 11
      src/FinishedTorrents.cpp
  4. 3
      src/GUI.cpp

1
TODO

@ -45,3 +45,4 @@
- Allow the user to see when peers were blocked thanks to IPFilter. Maybe in a file in order not to spam the GUI. - Allow the user to see when peers were blocked thanks to IPFilter. Maybe in a file in order not to spam the GUI.
- Allow to scan multiple directories - Allow to scan multiple directories
- Fix all (or almost all) opened bugs in bug tracker - Fix all (or almost all) opened bugs in bug tracker
- Add an icon for encryption in program preferences

20
qBittorrent.kdevelop

@ -13,8 +13,8 @@
<ignoreparts/> <ignoreparts/>
<projectdirectory>.</projectdirectory> <projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath> <absoluteprojectpath>false</absoluteprojectpath>
<description></description> <description/>
<defaultencoding></defaultencoding> <defaultencoding/>
<versioncontrol>kdevsubversion</versioncontrol> <versioncontrol>kdevsubversion</versioncontrol>
</general> </general>
<kdevfileview> <kdevfileview>
@ -72,11 +72,11 @@
</kdevdoctreeview> </kdevdoctreeview>
<kdevdebugger> <kdevdebugger>
<general> <general>
<dbgshell></dbgshell> <dbgshell/>
<gdbpath></gdbpath> <gdbpath/>
<configGdbScript></configGdbScript> <configGdbScript/>
<runShellScript></runShellScript> <runShellScript/>
<runGdbScript></runGdbScript> <runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs> <breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty> <separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar> <floatingtoolbar>false</floatingtoolbar>
@ -154,8 +154,8 @@
<run> <run>
<directoryradio>executable</directoryradio> <directoryradio>executable</directoryradio>
<mainprogram>/home/chris/qbittorrent_svn/trunk/src/qbittorrent</mainprogram> <mainprogram>/home/chris/qbittorrent_svn/trunk/src/qbittorrent</mainprogram>
<programargs></programargs> <programargs/>
<globaldebugarguments></globaldebugarguments> <globaldebugarguments/>
<globalcwd>/home/chris/qbittorrent_svn/trunk</globalcwd> <globalcwd>/home/chris/qbittorrent_svn/trunk</globalcwd>
<useglobalprogram>true</useglobalprogram> <useglobalprogram>true</useglobalprogram>
<terminal>false</terminal> <terminal>false</terminal>
@ -169,7 +169,7 @@
<runmultiplejobs>false</runmultiplejobs> <runmultiplejobs>false</runmultiplejobs>
<numberofjobs>1</numberofjobs> <numberofjobs>1</numberofjobs>
<dontact>false</dontact> <dontact>false</dontact>
<makebin></makebin> <makebin/>
<prio>0</prio> <prio>0</prio>
<envvars/> <envvars/>
</make> </make>

11
src/FinishedTorrents.cpp

@ -279,16 +279,15 @@ int FinishedTorrents::getRowFromHash(const QString& hash) const{
// Will move it to download tab // Will move it to download tab
void FinishedTorrents::deleteFromFinishedList(QString hash){ void FinishedTorrents::deleteFromFinishedList(QString hash){
finishedSHAs.removeAll(hash); int row = getRowFromHash(hash);
QList<QStandardItem *> items = finishedListModel->findItems(hash, Qt::MatchExactly, HASH ); if(row == -1){
if(items.size() != 1){ std::cerr << "Error: couldn't find hash in finished list\n";
qDebug("Problem: Can't delete torrent from finished list");
return;
} }
finishedListModel->removeRow(finishedListModel->indexFromItem(items.at(0)).row()); finishedListModel->removeRow(row);
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished"); QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished");
--nbFinished; --nbFinished;
((GUI*)parent)->setTabText(1, tr("Finished") +" ("+QString(misc::toString(nbFinished).c_str())+")"); ((GUI*)parent)->setTabText(1, tr("Finished") +" ("+QString(misc::toString(nbFinished).c_str())+")");
finishedSHAs.removeAll(hash);
} }
QTreeView* FinishedTorrents::getFinishedList(){ QTreeView* FinishedTorrents::getFinishedList(){

3
src/GUI.cpp

@ -864,9 +864,10 @@ void GUI::on_actionOpen_triggered(){
void GUI::on_actionDelete_Permanently_triggered(){ void GUI::on_actionDelete_Permanently_triggered(){
if(tabs->currentIndex() > 1) return; if(tabs->currentIndex() > 1) return;
QModelIndexList selectedIndexes; QModelIndexList selectedIndexes;
bool inDownloadList = true; bool inDownloadList;
if(tabs->currentIndex() == 0) { if(tabs->currentIndex() == 0) {
selectedIndexes = downloadList->selectionModel()->selectedIndexes(); selectedIndexes = downloadList->selectionModel()->selectedIndexes();
inDownloadList = true;
} else { } else {
selectedIndexes = finishedTorrentTab->getFinishedList()->selectionModel()->selectedIndexes(); selectedIndexes = finishedTorrentTab->getFinishedList()->selectionModel()->selectedIndexes();
inDownloadList = false; inDownloadList = false;

Loading…
Cancel
Save