Browse Source

- fixed delete permanently in finished list

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

3
TODO

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

11
src/FinishedTorrents.cpp

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

3
src/GUI.cpp

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

Loading…
Cancel
Save