Commit 7d81a4b9 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Layout reset button will now restore deleted default layouts and reset...

Layout reset button will now restore deleted default layouts and reset selected one to default value
parent b2c030c3
......@@ -334,6 +334,15 @@ void LayoutManagement::slotManageLayouts()
currentNames << list.item(i)->data(Qt::UserRole).toString();
}
int pos = 0;
// Reset selected layout if it is a default one
if (list.currentItem()) {
QString selectedName = list.currentItem()->data(Qt::UserRole).toString();
if (defaultLayoutNames.contains(selectedName)) {
layouts.writeEntry(selectedName, defaultLayout.readEntry(selectedName));
}
}
// Re-add missing default layouts
for (const QString &name : defaultLayoutNames) {
if (!currentNames.contains(name)) {
// Insert default layout
......
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