summaryrefslogtreecommitdiffstats
path: root/shemov.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2011-01-09 11:08:52 +0100
committerArno <am@disconnect.de>2011-01-09 11:08:52 +0100
commitcde287db9cb3ae5739cb45c5639313ea4847c960 (patch)
tree04cf6a5ed5a1682745fa16b8fa1e4d0cf946d24b /shemov.cpp
parent70ad086ccaf69cf4592db90a641daf0a23ab1428 (diff)
downloadSheMov-cde287db9cb3ae5739cb45c5639313ea4847c960.tar.gz
SheMov-cde287db9cb3ae5739cb45c5639313ea4847c960.tar.bz2
SheMov-cde287db9cb3ae5739cb45c5639313ea4847c960.zip
Automatically add files in configured folder when archiving movies
Added an option to automatically add files in a configurable folder when archiving movies. It's intended for putting cover files in that directory so they don't have to be added manually.
Diffstat (limited to 'shemov.cpp')
-rw-r--r--shemov.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/shemov.cpp b/shemov.cpp
index fbe4cb9..51a432f 100644
--- a/shemov.cpp
+++ b/shemov.cpp
@@ -29,6 +29,8 @@
#include <QToolBar>
#include <QIcon>
#include <QHeaderView>
+#include <QDir>
+#include <QFileInfo>
#include <sys/vfs.h>
@@ -257,6 +259,15 @@ void SheMov::newMovieWizardWithFiles(){
foreach(QModelIndex sel, selected){
mNewMovieWizard->infoPage()->addFile(sel.data(QFileSystemModel::FilePathRole).toString());
}
+ QSettings s;
+ bool autoAddCovers = s.value("ui/autoaddcovers", false).toBool();
+ QString coverPath = s.value("paths/coverpath").toString();
+ if(autoAddCovers && !coverPath.isEmpty()){
+ QDir coverDir(coverPath);
+ foreach(QFileInfo fi, coverDir.entryInfoList(QDir::Files)){
+ mNewMovieWizard->infoPage()->addFile(fi.absoluteFilePath());
+ }
+ }
mNewMovieWizard->show();
}