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() ...@@ -334,6 +334,15 @@ void LayoutManagement::slotManageLayouts()
currentNames << list.item(i)->data(Qt::UserRole).toString(); currentNames << list.item(i)->data(Qt::UserRole).toString();
} }
int pos = 0; 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) { for (const QString &name : defaultLayoutNames) {
if (!currentNames.contains(name)) { if (!currentNames.contains(name)) {
// Insert default layout // 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