summaryrefslogtreecommitdiffstats
path: root/archivebrowser.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2014-02-07 15:06:09 +0100
committerArno <am@disconnect.de>2014-02-07 15:06:09 +0100
commit424d37e94dbf820e3d0559e0041d6d2cd005f072 (patch)
tree01abb191003753566ac4715a35057e830dc335a1 /archivebrowser.cpp
parent67cabcc0905600121dc65ff043bf2fb810474b73 (diff)
downloadSheMov-424d37e94dbf820e3d0559e0041d6d2cd005f072.tar.gz
SheMov-424d37e94dbf820e3d0559e0041d6d2cd005f072.tar.bz2
SheMov-424d37e94dbf820e3d0559e0041d6d2cd005f072.zip
Actually move Files...
...when moving them to burn. Was too eager removing debug statements Also behave properly after a model reset.
Diffstat (limited to 'archivebrowser.cpp')
-rw-r--r--archivebrowser.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/archivebrowser.cpp b/archivebrowser.cpp
index 5c919e2..fa72253 100644
--- a/archivebrowser.cpp
+++ b/archivebrowser.cpp
@@ -55,6 +55,7 @@ ArchiveBrowser::ArchiveBrowser(QWidget *parent) : QWidget(parent), mSelectedSize
//connect
connect(mTree->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(browserSelectionChanged(QItemSelection,QItemSelection)));
+ connect(mModel, SIGNAL(populated()), this, SLOT(resetAll()));
//make widget
QVBoxLayout *mainLayout = new QVBoxLayout;
@@ -125,6 +126,7 @@ void ArchiveBrowser::moveToBurn() {
int type = child.data(ArchiveBrowserModel::FileTypeRole).toInt();
QString destination = QString("%1/%2").arg(burnDirS).arg(current.fileName());
if(type == 1){ //movie
+ QFile::rename(current.absoluteFilePath(), destination);
filesToUpdate << child.data(ArchiveBrowserModel::GenericIdRole).toInt();
}else{
QFile::copy(current.absoluteFilePath(), destination);
@@ -134,6 +136,7 @@ void ArchiveBrowser::moveToBurn() {
}
mModel->updateDVDNo(filesToUpdate);
mModel->refresh();
+ mProxy->setBytesRemaining(0);
}
}
@@ -174,6 +177,14 @@ void ArchiveBrowser::setupQualityFilter(){
mQualityFilter->addItems(qualityList);
}
+void ArchiveBrowser::resetAll() {
+ mTree->selectionModel()->clear();
+ mSelectedItems = 0;
+ mSelectedSize = 0;
+ emit sizeChanged(0);
+ emit itemCountChanged(0);
+}
+
QModelIndexList ArchiveBrowser::selectedRows(const QItemSelection &sel){
QModelIndexList retval;
QModelIndexList selIdx = sel.indexes();