diff options
author | Arno <am@disconnect.de> | 2010-12-18 12:02:44 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2010-12-18 12:02:44 +0100 |
commit | 8abf0a7882dbd1c80e24e5d01b79cd1cf60925e2 (patch) | |
tree | 498ca056a3de589b546c4a2602fa0c1268fcac74 /fileview.cpp | |
parent | 4f64bd4ee5b465fe64237500b32b03f286dd7faf (diff) | |
download | SheMov-8abf0a7882dbd1c80e24e5d01b79cd1cf60925e2.tar.gz SheMov-8abf0a7882dbd1c80e24e5d01b79cd1cf60925e2.tar.bz2 SheMov-8abf0a7882dbd1c80e24e5d01b79cd1cf60925e2.zip |
Fix rename files in FSWidget
Rename files inline, letting the model do all the work. Part of getting
rid of MessageDialog. Maybe this broke the filename templates. We'll
see...
Diffstat (limited to 'fileview.cpp')
-rw-r--r-- | fileview.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fileview.cpp b/fileview.cpp index 082ec92..331c7b8 100644 --- a/fileview.cpp +++ b/fileview.cpp @@ -22,6 +22,9 @@ #include <QVariant> #include <QList> #include <QDir> +#include <QSortFilterProxyModel> + +#include <QDebug> #include "fileview.h" #include "messagedialog.h" @@ -66,6 +69,12 @@ void FileView::readConfig(){ mHoverWin->setWindowOpacity(s.value("ui/hoveropacity", 10).toFloat() / 10.0); } +void FileView::closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint){ + QTreeView::closeEditor(editor, hint); + QSortFilterProxyModel *proxy = qobject_cast<QSortFilterProxyModel*>(model()); + QModelIndex sourceIdx = proxy->mapToSource(currentIndex()); + emit editorClosed(sourceIdx); +} void FileView::doMark(){ int rowCount = model()->rowCount(rootIndex()); @@ -124,6 +133,10 @@ void FileView::contextMenuEvent(QContextMenuEvent *e){ } void FileView::keyPressEvent(QKeyEvent *e){ + if(!hasFocus()){ + QTreeView::keyPressEvent(e); + return; + } switch(e->key()){ case Qt::Key_Backspace: emit upDir(); |