┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2013-06-10 21:40:41 +0200
committerFrank Reininghaus <[email protected]>2013-06-10 21:40:41 +0200
commite8c3df5f60aae3c34545c4112b9ec1c323ee66fd (patch)
tree74ae282d66eb8294962082cf2c62bbd1d1a98836 /src/views
parent7c4d91c465d3e7383e8d0f7583018118efef40ef (diff)
parent9cf54dcc025073f29e6a1f55c83c4edcec6a5ea3 (diff)
Merge remote-tracking branch 'origin/KDE/4.10'
Diffstat (limited to 'src/views')
-rw-r--r--src/views/dolphinview.cpp19
-rw-r--r--src/views/dolphinview.h1
2 files changed, 18 insertions, 2 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 53d327708..16b92801b 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -177,8 +177,8 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) :
this, SLOT(slotSortRoleChangedByHeader(QByteArray,QByteArray)));
connect(m_view, SIGNAL(visibleRolesChanged(QList<QByteArray>,QList<QByteArray>)),
this, SLOT(slotVisibleRolesChangedByHeader(QList<QByteArray>,QList<QByteArray>)));
- connect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
- this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
+ connect(m_view, SIGNAL(roleEditingCanceled(int,QByteArray,QVariant)),
+ this, SLOT(slotRoleEditingCanceled(int,QByteArray,QVariant)));
connect(m_view->header(), SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)),
this, SLOT(slotHeaderColumnWidthChanged(QByteArray,qreal,qreal)));
@@ -612,6 +612,9 @@ void DolphinView::setUrl(const KUrl& url)
hideToolTip();
+ disconnect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
+ this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
+
// It is important to clear the items from the model before
// applying the view properties, otherwise expensive operations
// might be done on the existing items although they get cleared
@@ -651,6 +654,9 @@ void DolphinView::renameSelectedItems()
if (items.count() == 1 && GeneralSettings::renameInline()) {
const int index = m_model->index(items.first());
m_view->editRole(index, "text");
+
+ connect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
+ this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
} else {
RenameDialog* dialog = new RenameDialog(this, items);
dialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -1439,8 +1445,17 @@ void DolphinView::slotVisibleRolesChangedByHeader(const QList<QByteArray>& curre
emit visibleRolesChanged(m_visibleRoles, previousVisibleRoles);
}
+void DolphinView::slotRoleEditingCanceled(int index, const QByteArray& role, const QVariant& value)
+{
+ disconnect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
+ this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
+}
+
void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value)
{
+ disconnect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
+ this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
+
if (index < 0 || index >= m_model->count()) {
return;
}
diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h
index 0cd6ff2f4..d77a3a198 100644
--- a/src/views/dolphinview.h
+++ b/src/views/dolphinview.h
@@ -670,6 +670,7 @@ private slots:
void slotVisibleRolesChangedByHeader(const QList<QByteArray>& current,
const QList<QByteArray>& previous);
+ void slotRoleEditingCanceled(int index, const QByteArray& role, const QVariant& value);
void slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value);
/**