Changeset View
Changeset View
Standalone View
Standalone View
src/views/dolphinview.cpp
Context not available. | |||||
68 | #include <QScrollBar> | 68 | #include <QScrollBar> | ||
---|---|---|---|---|---|
69 | #include <QTimer> | 69 | #include <QTimer> | ||
70 | #include <QVBoxLayout> | 70 | #include <QVBoxLayout> | ||
71 | #include <kitemviews/private/kitemlistroleeditor.h> | ||||
71 | 72 | | |||
72 | DolphinView::DolphinView(const QUrl& url, QWidget* parent) : | 73 | DolphinView::DolphinView(const QUrl& url, QWidget* parent) : | ||
73 | QWidget(parent), | 74 | QWidget(parent), | ||
Context not available. | |||||
1572 | 1573 | | |||
1573 | if (role == "text") { | 1574 | if (role == "text") { | ||
1574 | const KFileItem oldItem = m_model->fileItem(index); | 1575 | const KFileItem oldItem = m_model->fileItem(index); | ||
1575 | const QString newName = value.toString(); | 1576 | const EditResult retVal = value.value<EditResult>(); | ||
1577 | const QString newName = retVal.newName; | ||||
1576 | if (!newName.isEmpty() && newName != oldItem.text() && newName != QLatin1Char('.') && newName != QLatin1String("..")) { | 1578 | if (!newName.isEmpty() && newName != oldItem.text() && newName != QLatin1Char('.') && newName != QLatin1String("..")) { | ||
1577 | const QUrl oldUrl = oldItem.url(); | 1579 | const QUrl oldUrl = oldItem.url(); | ||
1578 | 1580 | | |||
Context not available. | |||||
1627 | connect(job, &KJob::result, this, &DolphinView::slotRenamingResult); | 1629 | connect(job, &KJob::result, this, &DolphinView::slotRenamingResult); | ||
1628 | } | 1630 | } | ||
1629 | } | 1631 | } | ||
1632 | | ||||
1633 | if (retVal.editNext) { | ||||
1634 | m_container->controller()->selectionManager()->setSelected(index, 1, KItemListSelectionManager::Deselect); | ||||
1635 | m_container->controller()->selectionManager()->setSelected(index + 1, 1, KItemListSelectionManager::Select); | ||||
1636 | renameSelectedItems(); | ||||
1637 | } | ||||
1630 | } | 1638 | } | ||
1631 | } | 1639 | } | ||
1632 | 1640 | | |||
Context not available. |