Commit f25188e0 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau Committed by David Faure
Browse files

Deprecate KShortcutsEditor::undoChanges() in favour of new undo()

parent 4f425962
......@@ -86,7 +86,7 @@ ecm_generate_export_header(KF5XmlGui
GROUP_BASE_NAME KF
VERSION ${KF5_VERSION}
DEPRECATED_BASE_VERSION 0
DEPRECATION_VERSIONS 4.0 4.1 5.0
DEPRECATION_VERSIONS 4.0 4.1 5.0 5.75
EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
)
......
......@@ -74,7 +74,7 @@ public:
i18n("The current shortcut scheme is modified. Save before switching to the new one?")) == KMessageBox::Yes) {
m_keyChooser->save();
} else {
m_keyChooser->undoChanges();
m_keyChooser->undo();
}
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
......@@ -106,9 +106,9 @@ public:
QApplication::restoreOverrideCursor();
}
void undoChanges()
void undo()
{
m_keyChooser->undoChanges();
m_keyChooser->undo();
}
void toggleDetails()
......@@ -175,7 +175,7 @@ KShortcutsDialog::KShortcutsDialog(KShortcutsEditor::ActionTypes types, KShortcu
connect(d->m_detailsButton, SIGNAL(clicked()), this, SLOT(toggleDetails()));
connect(printButton, &QPushButton::clicked,
d->m_keyChooser, &KShortcutsEditor::printShortcuts);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(undoChanges()));
connect(buttonBox, &QDialogButtonBox::rejected, this, [this]() { d->undo(); });
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
......
......@@ -142,7 +142,6 @@ Q_SIGNALS:
private:
Q_PRIVATE_SLOT(d, void changeShortcutScheme(const QString &))
Q_PRIVATE_SLOT(d, void undoChanges())
Q_PRIVATE_SLOT(d, void toggleDetails())
class KShortcutsDialogPrivate;
......
......@@ -232,8 +232,14 @@ void KShortcutsEditor::save()
commit();
}
// KDE5 : rename to undo()
#if KXMLGUI_BUILD_DEPRECATED_SINCE(5, 75)
void KShortcutsEditor::undoChanges()
{
undo();
}
#endif
void KShortcutsEditor::undo()
{
//This function used to crash sometimes when invoked by clicking on "cancel"
//with Qt 4.2.something. Apparently items were deleted too early by Qt.
......@@ -245,7 +251,7 @@ void KShortcutsEditor::undoChanges()
}
}
//We ask the user here if there are any conflicts, as opposed to undoChanges().
//We ask the user here if there are any conflicts, as opposed to undo().
//They don't do the same thing anyway, this just not to confuse any readers.
//slot
void KShortcutsEditor::allDefault()
......
......@@ -127,8 +127,19 @@ public:
/**
* Undo all change made since the last commit().
*
* @since 5.75
*/
void undo();
#if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 75)
/**
* Undo all change made since the last commit().
* @deprecated Since 5.75, use undo()
*/
KXMLGUI_DEPRECATED_VERSION(5, 75, "Use KShortcutsEditor::undo()")
void undoChanges();
#endif
/**
* Save the changes.
......
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