From 95bd97d4f5dc4d0ee91cfeeff89b88ff3d8f26df Mon Sep 17 00:00:00 2001 From: am Date: Wed, 15 Jul 2009 19:16:26 +0000 Subject: -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 --- filesystemwidget.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'filesystemwidget.cpp') 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(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); -- cgit v1.2.3-70-g09d2