Commit 97e64267 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

not necessary to rename if we don't change name or cancel it

parent 4e292862
Pipeline #70301 passed with stage
in 24 minutes and 41 seconds
......@@ -49,11 +49,14 @@ void ConfigureFiltersWidget::slotCustomContextMenuRequested(const QPoint &pos)
QMenu menu(this);
const QString identifier = item->identifier();
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-rename")), i18n("Rename..."), this, [this, identifier, item]() {
QString newName = QInputDialog::getText(this, i18n("Rename Filter"), i18n("name"), QLineEdit::Normal, item->text());
newName = newName.trimmed();
if (!newName.isEmpty()) {
renameFilterInfo(identifier, newName);
item->setText(newName);
bool ok = false;
QString newName = QInputDialog::getText(this, i18n("Rename Filter"), i18n("name"), QLineEdit::Normal, item->text(), &ok);
if (ok) {
newName = newName.trimmed();
if (!newName.isEmpty() && (newName != item->text())) {
renameFilterInfo(identifier, newName);
item->setText(newName);
}
}
});
menu.addSeparator();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment