┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.cpp
diff options
context:
space:
mode:
authorLuca Beltrame <[email protected]>2012-09-21 10:55:08 +0200
committerLuca Beltrame <[email protected]>2012-09-21 10:55:08 +0200
commitf1b822d926316d739ec10d8b05917b6b0c2d92b5 (patch)
tree20e52bfd70694a34f86fa650d3797be67bda8f67 /src/views/dolphinview.cpp
parent399c4b22ea9947047c7d2777d7f361df6b5e9636 (diff)
parentc8243401470156d9ee76e2015a23741570d3dba1 (diff)
Merge branch 'KDE/4.9'
Conflicts: konq-plugins/dirfilter/dirfilterplugin.cpp konq-plugins/dirfilter/dirfilterplugin.h
Diffstat (limited to 'src/views/dolphinview.cpp')
-rw-r--r--src/views/dolphinview.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 20edd6110..05849729f 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -635,7 +635,7 @@ void DolphinView::renameSelectedItems()
return;
}
- if (items.count() == 1) {
+ if (items.count() == 1 && GeneralSettings::renameInline()) {
const int index = m_model->index(items.first());
m_view->editRole(index, "text");
} else {
@@ -753,6 +753,20 @@ void DolphinView::hideEvent(QHideEvent* event)
QWidget::hideEvent(event);
}
+bool DolphinView::event(QEvent* event)
+{
+ /* See Bug 297355
+ * Dolphin leaves file preview tooltips open even when is not visible.
+ *
+ * Hide tool-tip when Dolphin loses focus.
+ */
+ if (event->type() == QEvent::WindowDeactivate) {
+ hideToolTip();
+ }
+
+ return QWidget::event(event);
+}
+
void DolphinView::activate()
{
setActive(true);
@@ -1329,6 +1343,10 @@ void DolphinView::slotVisibleRolesChangedByHeader(const QList<QByteArray>& curre
void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value)
{
+ if (index < 0 || index >= m_model->count()) {
+ return;
+ }
+
if (role == "text") {
const KFileItem oldItem = m_model->fileItem(index);
const QString newName = value.toString();