diff options
author | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-07-16 19:34:57 +0000 |
---|---|---|
committer | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-07-16 19:34:57 +0000 |
commit | 1b1e48aa11c4518e100004dac594540e6024fa68 (patch) | |
tree | 0a44ad1d42f463960a045c9207d0fb2188309e57 /filesystemwidget.cpp | |
parent | 95bd97d4f5dc4d0ee91cfeeff89b88ff3d8f26df (diff) | |
download | SheMov-1b1e48aa11c4518e100004dac594540e6024fa68.tar.gz SheMov-1b1e48aa11c4518e100004dac594540e6024fa68.tar.bz2 SheMov-1b1e48aa11c4518e100004dac594540e6024fa68.zip |
-Fixed extractor... Just look at the examples for QProcess :)
-Beautified extractor output for unrar
-Added User interface configuration options
-So, there are Usability fixes
git-svn-id: file:///var/svn/repos2/shemov/trunk@388 f440f766-f032-0410-8965-dc7d17de2ca0
Diffstat (limited to 'filesystemwidget.cpp')
-rw-r--r-- | filesystemwidget.cpp | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/filesystemwidget.cpp b/filesystemwidget.cpp index e02e564..349176b 100644 --- a/filesystemwidget.cpp +++ b/filesystemwidget.cpp @@ -87,22 +87,24 @@ FilesystemWidget::FilesystemWidget(QWidget *parent) : QWidget(parent) { connect(mDirEdit, SIGNAL(returnPressed()), this, SLOT(directoryEdited())); QSettings s; - QString startDir = s.value("paths/start", QDir::homePath()).toString(); - windowTitle(startDir); - QModelIndex startIndex = mModel->index(startDir); - if(startIndex.isValid()){ - QModelIndex proxyIndex = mDirProxy->mapFromSource(startIndex); - mDirView->setCurrentIndex(proxyIndex); - mDirView->setExpanded(proxyIndex, true); - QModelIndex parent = proxyIndex.parent(); - do { - mDirView->setExpanded(parent, true); - parent = parent.parent(); - }while(parent.isValid()); + QStringList expandPaths = s.value("ui/expandpaths").toStringList(); + QString last; + foreach(QString p, expandPaths){ + QModelIndex idx = mModel->index(p); + last = p; + if(idx.isValid()){ + QModelIndex proxy = mDirProxy->mapFromSource(idx); + mDirView->setExpanded(proxy, true); + expandParents(proxy); + } } + QString select = s.value("ui/selectstartup").toString(); + windowTitle(select); + setWindowTitle(select); + QModelIndex sel = mModel->index(select); + mDirView->setCurrentIndex(mDirProxy->mapFromSource(sel)); mFileView->resizeColumnToContents(0); - setWindowTitle(startDir); QVBoxLayout *mainLayout = new QVBoxLayout; QSplitter *splitter = new QSplitter; @@ -423,6 +425,17 @@ void FilesystemWidget::doRenameFile(){ emit newTemplate(mTemplate); } +void FilesystemWidget::expandParents(const QModelIndex &idx){ + if(idx.isValid()){ + QModelIndex parent = idx.parent(); + do{ + mDirView->setExpanded(parent, true); + parent = parent.parent(); + + }while(parent.isValid()); + } +} + QAction * FilesystemWidget::action(QWidget *widget, const QVariant &data) const{ QAction *retval = 0; foreach(QAction *a, widget->actions()){ |