diff options
author | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-07-15 19:16:26 +0000 |
---|---|---|
committer | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-07-15 19:16:26 +0000 |
commit | 95bd97d4f5dc4d0ee91cfeeff89b88ff3d8f26df (patch) | |
tree | 59dec9ad30bbb5457ae66eddbe59b3348dd1feec /filesystemwidget.cpp | |
parent | 440f3fe87e9adc95f6155b924162e335f2b434e0 (diff) | |
download | SheMov-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.cpp | 17 |
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); |