summaryrefslogtreecommitdiffstats
path: root/filesystemwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'filesystemwidget.cpp')
-rw-r--r--filesystemwidget.cpp15
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);
+}
+