mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-17 15:31:20 +00:00
Do not rename files unexpectedly when changing the URL
This is the real fix now - note that the last commit
4de9a23364
was actually the fix for bug
320823. Somehow, I have messed up the local branches in my git
respository clone - sorry for the confusion!
BUG: 319912
FIXED-IN: 4.10.5
REVIEW: 110908
This commit is contained in:
parent
15b34a0d05
commit
9cf54dcc02
|
@ -174,8 +174,8 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) :
|
||||||
this, SLOT(slotSortRoleChangedByHeader(QByteArray,QByteArray)));
|
this, SLOT(slotSortRoleChangedByHeader(QByteArray,QByteArray)));
|
||||||
connect(m_view, SIGNAL(visibleRolesChanged(QList<QByteArray>,QList<QByteArray>)),
|
connect(m_view, SIGNAL(visibleRolesChanged(QList<QByteArray>,QList<QByteArray>)),
|
||||||
this, SLOT(slotVisibleRolesChangedByHeader(QList<QByteArray>,QList<QByteArray>)));
|
this, SLOT(slotVisibleRolesChangedByHeader(QList<QByteArray>,QList<QByteArray>)));
|
||||||
connect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
|
connect(m_view, SIGNAL(roleEditingCanceled(int,QByteArray,QVariant)),
|
||||||
this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
|
this, SLOT(slotRoleEditingCanceled(int,QByteArray,QVariant)));
|
||||||
connect(m_view->header(), SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)),
|
connect(m_view->header(), SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)),
|
||||||
this, SLOT(slotHeaderColumnWidthChanged(QByteArray,qreal,qreal)));
|
this, SLOT(slotHeaderColumnWidthChanged(QByteArray,qreal,qreal)));
|
||||||
|
|
||||||
|
@ -609,6 +609,9 @@ void DolphinView::setUrl(const KUrl& url)
|
||||||
|
|
||||||
hideToolTip();
|
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
|
// It is important to clear the items from the model before
|
||||||
// applying the view properties, otherwise expensive operations
|
// applying the view properties, otherwise expensive operations
|
||||||
// might be done on the existing items although they get cleared
|
// might be done on the existing items although they get cleared
|
||||||
|
@ -648,6 +651,9 @@ void DolphinView::renameSelectedItems()
|
||||||
if (items.count() == 1 && GeneralSettings::renameInline()) {
|
if (items.count() == 1 && GeneralSettings::renameInline()) {
|
||||||
const int index = m_model->index(items.first());
|
const int index = m_model->index(items.first());
|
||||||
m_view->editRole(index, "text");
|
m_view->editRole(index, "text");
|
||||||
|
|
||||||
|
connect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
|
||||||
|
this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
|
||||||
} else {
|
} else {
|
||||||
RenameDialog* dialog = new RenameDialog(this, items);
|
RenameDialog* dialog = new RenameDialog(this, items);
|
||||||
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
@ -1366,8 +1372,17 @@ void DolphinView::slotVisibleRolesChangedByHeader(const QList<QByteArray>& curre
|
||||||
emit visibleRolesChanged(m_visibleRoles, previousVisibleRoles);
|
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)
|
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()) {
|
if (index < 0 || index >= m_model->count()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -655,6 +655,7 @@ private slots:
|
||||||
void slotVisibleRolesChangedByHeader(const QList<QByteArray>& current,
|
void slotVisibleRolesChangedByHeader(const QList<QByteArray>& current,
|
||||||
const QList<QByteArray>& previous);
|
const QList<QByteArray>& previous);
|
||||||
|
|
||||||
|
void slotRoleEditingCanceled(int index, const QByteArray& role, const QVariant& value);
|
||||||
void slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value);
|
void slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue