summaryrefslogtreecommitdiffstats
path: root/filesystemwidget.cpp
diff options
context:
space:
mode:
authoram <am@f440f766-f032-0410-8965-dc7d17de2ca0>2009-07-15 19:16:26 +0000
committeram <am@f440f766-f032-0410-8965-dc7d17de2ca0>2009-07-15 19:16:26 +0000
commit95bd97d4f5dc4d0ee91cfeeff89b88ff3d8f26df (patch)
tree59dec9ad30bbb5457ae66eddbe59b3348dd1feec /filesystemwidget.cpp
parent440f3fe87e9adc95f6155b924162e335f2b434e0 (diff)
downloadSheMov-95bd97d4f5dc4d0ee91cfeeff89b88ff3d8f26df.tar.gz
SheMov-95bd97d4f5dc4d0ee91cfeeff89b88ff3d8f26df.tar.bz2
SheMov-95bd97d4f5dc4d0ee91cfeeff89b88ff3d8f26df.zip
-finished calling extractor
-QProcess doesn't work as promised in the docs, dunno how to do it yet, but we need a thread to keep the GUI responsive... -fixed some bugs with the extractionpaths git-svn-id: file:///var/svn/repos2/shemov/trunk@387 f440f766-f032-0410-8965-dc7d17de2ca0
Diffstat (limited to 'filesystemwidget.cpp')
-rw-r--r--filesystemwidget.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/filesystemwidget.cpp b/filesystemwidget.cpp
index 317fbad..e02e564 100644
--- a/filesystemwidget.cpp
+++ b/filesystemwidget.cpp
@@ -31,6 +31,7 @@
#include "filesystemfileproxy.h"
#include "helper.h"
#include "messagedialog.h"
+#include "extractordialog.h"
FilesystemWidget::FilesystemWidget(QWidget *parent) : QWidget(parent) {
mModel = new QDirModel;
@@ -342,11 +343,27 @@ void FilesystemWidget::setTemplate(){
if(idx.column() != 0){
idx = mFileView->model()->index(idx.row(), 0);
}
+ //since we only need the filename, no need to map it to anything!
QFileInfo info(idx.data().toString());
mTemplate = info.completeBaseName().toLower();
emit newTemplate(mTemplate);
}
+void FilesystemWidget::extract(const QString &destDir){
+ QModelIndex idx = mFileView->currentIndex();
+ if(idx.column() != 0){
+ idx = mFileView->model()->index(idx.row(), 0);
+ }
+ QSortFilterProxyModel *proxy = static_cast<QSortFilterProxyModel*>(mFileView->model());
+ QModelIndex real = proxy->mapToSource(idx);
+ QFileInfo info = mModel->fileInfo(real);
+ if(info.isDir()){
+ return;
+ }
+ ExtractorDialog dlg(info.absoluteFilePath(), destDir, this);
+ dlg.exec();
+}
+
void FilesystemWidget::setWindowTitle(const QString &dir){
mWindowTitle = QString("%1 - %2").arg(qApp->applicationName()).arg(dir);
emit windowTitle(mWindowTitle);