diff --git a/src/chatlog/chatlog.cpp b/src/chatlog/chatlog.cpp index b2e9a85e2..ef5109789 100644 --- a/src/chatlog/chatlog.cpp +++ b/src/chatlog/chatlog.cpp @@ -69,20 +69,29 @@ ChatLog::ChatLog(QWidget* parent) copyAction->setIcon(QIcon::fromTheme("edit-copy")); copyAction->setShortcut(QKeySequence::Copy); copyAction->setEnabled(false); - connect(copyAction, &QAction::triggered, this, [this]() { copySelectedText(); }); + connect(copyAction, &QAction::triggered, this, [this]() + { + copySelectedText(); + }); addAction(copyAction); #ifdef Q_OS_LINUX // Ctrl+Insert shortcut QShortcut* copyCtrlInsShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Insert), this); - connect(copyCtrlInsShortcut, &QShortcut::activated, this, [this]() { copySelectedText(); }); + connect(copyCtrlInsShortcut, &QShortcut::activated, this, [this]() + { + copySelectedText(); + }); #endif // select all action (ie. Ctrl+A) selectAllAction = new QAction(this); selectAllAction->setIcon(QIcon::fromTheme("edit-select-all")); selectAllAction->setShortcut(QKeySequence::SelectAll); - connect(selectAllAction, &QAction::triggered, this, [this]() { selectAll(); }); + connect(selectAllAction, &QAction::triggered, this, [this]() + { + selectAll(); + }); addAction(selectAllAction); // This timer is used to scroll the view while the user is diff --git a/src/persistence/profile.cpp b/src/persistence/profile.cpp index c8f32d53b..daf09b7e3 100644 --- a/src/persistence/profile.cpp +++ b/src/persistence/profile.cpp @@ -328,7 +328,7 @@ void Profile::saveToxSave(QByteArray data) saveFile.write(data); // check if everything got written - if(saveFile.flush()) + if (saveFile.flush()) { saveFile.commit(); newProfile = false; @@ -511,23 +511,23 @@ QVector Profile::remove() QVector ret; - if(!profileMain.remove() && profileMain.exists()) + if (!profileMain.remove() && profileMain.exists()) { ret.push_back(profileMain.fileName()); qWarning() << "Could not remove file " << profileMain.fileName(); } - if(!profileConfig.remove() && profileConfig.exists()) + if (!profileConfig.remove() && profileConfig.exists()) { ret.push_back(profileConfig.fileName()); qWarning() << "Could not remove file " << profileConfig.fileName(); } - if(!historyLegacyUnencrypted.remove() && historyLegacyUnencrypted.exists()) + if (!historyLegacyUnencrypted.remove() && historyLegacyUnencrypted.exists()) { ret.push_back(historyLegacyUnencrypted.fileName()); qWarning() << "Could not remove file " << historyLegacyUnencrypted.fileName(); } - if(!historyLegacyEncrypted.remove() && historyLegacyEncrypted.exists()) + if (!historyLegacyEncrypted.remove() && historyLegacyEncrypted.exists()) { ret.push_back(historyLegacyEncrypted.fileName()); qWarning() << "Could not remove file " << historyLegacyUnencrypted.fileName(); @@ -535,7 +535,7 @@ QVector Profile::remove() if (history) { - if(!history->remove() && QFile::exists(History::getDbPath(name))) + if (!history->remove() && QFile::exists(History::getDbPath(name))) { ret.push_back(History::getDbPath(name)); qWarning() << "Could not remove file " << History::getDbPath(name); diff --git a/src/persistence/settingsserializer.cpp b/src/persistence/settingsserializer.cpp index df8ac02d2..28aa1ccd5 100644 --- a/src/persistence/settingsserializer.cpp +++ b/src/persistence/settingsserializer.cpp @@ -283,7 +283,7 @@ void SettingsSerializer::save() f.write(data); // check if everything got written - if(f.flush()) + if (f.flush()) { f.commit(); } @@ -412,10 +412,10 @@ void SettingsSerializer::readIni() // Add all keys if (!s.group().isEmpty()) beginGroup(s.group()); + for (QString k : s.childKeys()) { setValue(k, s.value(k)); - //qDebug() << "Read key "< a.size) a.size = groupArrayIndex; @@ -530,7 +528,6 @@ void SettingsSerializer::readIni() v.array = ai; v.arrayIndex = groupArrayIndex; a.values.append(vi); - //qDebug() << "Found key"<