massive changes inside

* use pass by ref instead of by value if possible
* use reference in interation over collections
* fix no tag inserting
This commit is contained in:
2017-05-04 15:00:50 +03:00
parent 6e99e262d4
commit 6e62ceaac7
119 changed files with 645 additions and 634 deletions

View File

@ -27,7 +27,7 @@
#include "awformatterhelper.h"
AWFormatterConfig::AWFormatterConfig(QWidget *parent, const QStringList keys)
AWFormatterConfig::AWFormatterConfig(QWidget *parent, const QStringList &keys)
: QDialog(parent)
, ui(new Ui::AWFormatterConfig)
, m_keys(keys)
@ -114,7 +114,7 @@ void AWFormatterConfig::addSelector(const QStringList &keys,
void AWFormatterConfig::clearSelectors()
{
for (auto selector : m_selectors) {
for (auto &selector : m_selectors) {
disconnect(selector, SIGNAL(selectionChanged()), this,
SLOT(updateUi()));
ui->verticalLayout->removeWidget(selector);
@ -128,7 +128,7 @@ void AWFormatterConfig::execDialog()
{
int ret = exec();
QHash<QString, QString> data;
for (auto selector : m_selectors) {
for (auto &selector : m_selectors) {
QPair<QString, QString> select = selector->current();
if (select.first.isEmpty())
continue;
@ -175,7 +175,7 @@ void AWFormatterConfig::updateDialog()
QHash<QString, QString> appliedFormatters = m_helper->getFormatters();
auto keys = initKeys();
for (auto key : appliedFormatters.keys())
for (auto &key : appliedFormatters.keys())
addSelector(keys.first, keys.second,
QPair<QString, QString>(key, appliedFormatters[key]));
// empty one