|
|
|
@ -943,7 +943,6 @@ void SettingsDialog::addLayoutForFile(QString file, QString layoutName, bool new
|
|
|
|
|
|
|
|
|
|
void SettingsDialog::loadSettings()
|
|
|
|
|
{
|
|
|
|
|
m_initLayoutPaths.clear();
|
|
|
|
|
m_model->clear();
|
|
|
|
|
m_sharesMap.clear();
|
|
|
|
|
|
|
|
|
@ -977,7 +976,6 @@ void SettingsDialog::loadSettings()
|
|
|
|
|
original.textColor = QString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_initLayoutPaths.append(original.id);
|
|
|
|
|
m_layouts[original.id] = central;
|
|
|
|
|
|
|
|
|
|
//! create initial SHARES maps
|
|
|
|
@ -1439,17 +1437,17 @@ bool SettingsDialog::saveAllChanges()
|
|
|
|
|
|
|
|
|
|
QHash<QString, Layout::GenericLayout *> activeLayoutsToRename;
|
|
|
|
|
|
|
|
|
|
Settings::Data::LayoutsTable removedLayouts = o_layoutsOriginalData.subtracted(m_model->currentData());
|
|
|
|
|
|
|
|
|
|
//! remove layouts that have been removed from the user
|
|
|
|
|
for (const auto &initLayout : m_initLayoutPaths) {
|
|
|
|
|
if (!idExistsInModel(initLayout)) {
|
|
|
|
|
QFile(initLayout).remove();
|
|
|
|
|
for (int i=0; i<removedLayouts.rowCount(); ++i) {
|
|
|
|
|
QFile(removedLayouts[i].id).remove();
|
|
|
|
|
|
|
|
|
|
if (m_layouts.contains(initLayout)) {
|
|
|
|
|
CentralLayout *removedLayout = m_layouts.take(initLayout);
|
|
|
|
|
if (m_layouts.contains(removedLayouts[i].id)) {
|
|
|
|
|
CentralLayout *removedLayout = m_layouts.take(removedLayouts[i].id);
|
|
|
|
|
delete removedLayout;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < m_model->rowCount(); ++i) {
|
|
|
|
|
QString id = m_model->data(m_model->index(i, IDCOLUMN), Qt::DisplayRole).toString();
|
|
|
|
@ -1556,12 +1554,6 @@ bool SettingsDialog::saveAllChanges()
|
|
|
|
|
|
|
|
|
|
if (tId == fromRenamePaths[i]) {
|
|
|
|
|
m_model->setData(m_model->index(j, IDCOLUMN), newFile, Qt::DisplayRole);
|
|
|
|
|
m_initLayoutPaths.append(newFile);
|
|
|
|
|
|
|
|
|
|
QFont font = qvariant_cast<QFont>(m_model->data(m_model->index(j, NAMECOLUMN), Qt::FontRole));
|
|
|
|
|
|
|
|
|
|
font.setItalic(false);
|
|
|
|
|
m_model->setData(m_model->index(j, NAMECOLUMN), font, Qt::FontRole);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|