diff options
author | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-07-10 15:53:58 +0000 |
---|---|---|
committer | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-07-10 15:53:58 +0000 |
commit | 4f1e2ee030f01facefab808f687d301c37707f74 (patch) | |
tree | de032f70dc137e433b1875e3067e3cf33d130989 /filesystemwidget.cpp | |
parent | b6a85b8b76a4e86783c4c83048918d30bb36bdb8 (diff) | |
download | SheMov-4f1e2ee030f01facefab808f687d301c37707f74.tar.gz SheMov-4f1e2ee030f01facefab808f687d301c37707f74.tar.bz2 SheMov-4f1e2ee030f01facefab808f687d301c37707f74.zip |
-fixed selection handling
-implemented proper window titles (not yet working)
git-svn-id: file:///var/svn/repos2/shemov/trunk@382 f440f766-f032-0410-8965-dc7d17de2ca0
Diffstat (limited to 'filesystemwidget.cpp')
-rw-r--r-- | filesystemwidget.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/filesystemwidget.cpp b/filesystemwidget.cpp index 24e769b..365adaf 100644 --- a/filesystemwidget.cpp +++ b/filesystemwidget.cpp @@ -16,6 +16,7 @@ #include <QLabel> #include <QCompleter> #include <QProcess> +#include <QApplication> #include <QDebug> #include "filesystemwidget.h" @@ -68,13 +69,14 @@ FilesystemWidget::FilesystemWidget(QWidget *parent) : QWidget(parent) { fileWidget->setLayout(fwLayout); connect(mDirView->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(directoryChanged(const QModelIndex &, const QModelIndex &))); - connect(mFileView, SIGNAL(activated(const QModelIndex &)), this, SLOT(fileViewActivated(const QModelIndex &))); + connect(mFileView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(fileViewActivated(const QModelIndex &))); + connect(mFileView, SIGNAL(enterPressed(const QModelIndex &)), this, SLOT(fileViewActivated(const QModelIndex &))); connect(mFileView, SIGNAL(upDir()), this, SLOT(parentDir())); - //connect(mFileView, SIGNAL(show()), this, SLOT(showItem())); 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); @@ -106,9 +108,9 @@ void FilesystemWidget::directoryChanged(const QModelIndex &selected, const QMode return; } mDirEdit->setText(mModel->filePath(real)); + windowTitle(mModel->filePath(real)); QModelIndex oldSelected = mDirProxy->mapToSource(deselected); - mFileView->selectionModel()->clear(); - mFileView->setCurrentIndex(mFileProxy->mapFromSource(oldSelected)); + mFileView->selectionModel()->setCurrentIndex(mFileProxy->mapFromSource(oldSelected), QItemSelectionModel::NoUpdate); mFileView->setRootIndex(mFileProxy->mapFromSource(real)); } @@ -154,3 +156,8 @@ void FilesystemWidget::parentDir(){ mFileView->selectionModel()->clearSelection(); } +void FilesystemWidget::setWindowTitle(const QString &dir){ + QString title = QString("%1 - %2").arg(qApp->applicationName(), dir); + emit windowTitle(title); +} + |