QString destPath;
QTreeWidgetItem *parentItem;
bool isSlideshow = false;
+ int items = 0;
// We parse all files going into one folder, then start the copy job
item = parentItem->child(j);
if (item->isDisabled()) continue;
// Special case: slideshows
+ items++;
if (isSlideshow) {
destPath += item->data(0, Qt::UserRole).toString() + "/";
destUrl = KUrl(archive_url->url().path(KUrl::AddTrailingSlash) + destPath);
}
}
+ if (items == 0) {
+ // No clips to archive
+ if (isArchive) slotArchivingFinished(NULL, true);
+ return true;
+ }
+
if (destPath.isEmpty()) {
if (m_duplicateFiles.isEmpty()) return false;
QMapIterator<KUrl, KUrl> i(m_duplicateFiles);
return true;
}
-void ArchiveWidget::slotArchivingFinished(KJob *job)
+void ArchiveWidget::slotArchivingFinished(KJob *job, bool finished)
{
if (job == NULL || job->error() == 0) {
- if (slotStartArchiving(false)) {
+ if (!finished && slotStartArchiving(false)) {
// We still have files to archive
return;
}
private slots:
void slotCheckSpace();
bool slotStartArchiving(bool firstPass = true);
- void slotArchivingFinished(KJob *job = NULL);
+ void slotArchivingFinished(KJob *job = NULL, bool finished = false);
void slotArchivingProgress(KJob *, qulonglong);
virtual void done ( int r );
bool closeAccepted();