- fixed delete permanently in finished list

This commit is contained in:
Christophe Dumez 2007-06-17 12:15:04 +00:00
parent 68b867e480
commit 5e73539393
4 changed files with 19 additions and 18 deletions

3
TODO
View file

@ -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

View file

@ -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 @@
</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 @@
<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 @@
<runmultiplejobs>false</runmultiplejobs>
<numberofjobs>1</numberofjobs>
<dontact>false</dontact>
<makebin></makebin>
<makebin/>
<prio>0</prio>
<envvars/>
</make>

View file

@ -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(){

View file

@ -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;