Commit be629306 authored by hjk's avatar hjk
Browse files

Utils: Remove unneeded Q_SLOT and stale debug output in SavedAction



Also adjust RegisterPostMortemAction.

Change-Id: I6395b0c853d0e37e94d22c5e90499e5465de610b
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent f3ad26b2
......@@ -196,8 +196,6 @@ void SavedAction::readSettings(const QSettings *settings)
if (isCheckable() && !var.isValid())
var = false;
setValue(var);
//qDebug() << "READING: " << var.isValid() << m_settingsKey << " -> " << m_value
// << " (default: " << m_defaultValue << ")" << var;
}
/*
......@@ -212,7 +210,6 @@ void SavedAction::writeSettings(QSettings *settings)
return;
settings->beginGroup(m_settingsGroup);
settings->setValue(m_settingsKey, m_value);
//qDebug() << "WRITING: " << m_settingsKey << " -> " << toString();
settings->endGroup();
}
......@@ -242,12 +239,10 @@ void SavedAction::connectWidget(QWidget *widget, ApplyMode applyMode)
this, &SavedAction::checkableButtonClicked);
} else if (QSpinBox *spinBox = qobject_cast<QSpinBox *>(widget)) {
spinBox->setValue(m_value.toInt());
//qDebug() << "SETTING VALUE" << spinBox->value();
connect(spinBox, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &SavedAction::spinBoxValueChanged);
} else if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget)) {
lineEdit->setText(m_value.toString());
//qDebug() << "SETTING TEXT" << lineEdit->text();
connect(lineEdit, &QLineEdit::editingFinished,
this, &SavedAction::lineEditEditingFinished);
} else if (PathChooser *pathChooser = qobject_cast<PathChooser *>(widget)) {
......@@ -309,7 +304,6 @@ void SavedAction::checkableButtonClicked(bool)
{
QCheckBox *button = qobject_cast<QCheckBox *>(sender());
QTC_ASSERT(button, return);
//qDebug() << "CHECKABLE BUTTON: " << sender();
if (m_applyMode == ImmediateApply)
setValue(button->isChecked());
}
......
......@@ -51,27 +51,27 @@ public:
SavedAction(QObject *parent = 0);
QVariant value() const;
Q_SLOT void setValue(const QVariant &value, bool doemit = true);
void setValue(const QVariant &value, bool doemit = true);
QVariant defaultValue() const;
Q_SLOT void setDefaultValue(const QVariant &value);
void setDefaultValue(const QVariant &value);
Q_SLOT void trigger(const QVariant &data);
void trigger(const QVariant &data);
// used for persistency
QString settingsKey() const;
Q_SLOT void setSettingsKey(const QString &key);
Q_SLOT void setSettingsKey(const QString &group, const QString &key);
void setSettingsKey(const QString &key);
void setSettingsKey(const QString &group, const QString &key);
QString settingsGroup() const;
Q_SLOT void setSettingsGroup(const QString &group);
void setSettingsGroup(const QString &group);
virtual void readSettings(const QSettings *settings);
Q_SLOT virtual void writeSettings(QSettings *settings);
virtual void writeSettings(QSettings *settings);
void connectWidget(QWidget *widget, ApplyMode applyMode = DeferedApply);
void disconnectWidget();
Q_SLOT void apply(QSettings *settings);
void apply(QSettings *settings);
QString toString() const;
......
......@@ -75,7 +75,7 @@ void RegisterPostMortemAction::registerNow(const QVariant &value)
RegisterPostMortemAction::RegisterPostMortemAction(QObject *parent) : Utils::SavedAction(parent)
{
connect(this, SIGNAL(valueChanged(QVariant)), SLOT(registerNow(QVariant)));
connect(this, &SavedAction::valueChanged, this, &RegisterPostMortemAction::registerNow);
}
void RegisterPostMortemAction::readSettings(const QSettings *)
......
......@@ -38,14 +38,13 @@ namespace Internal {
class RegisterPostMortemAction : public Utils::SavedAction
{
Q_OBJECT
private:
Q_SLOT void registerNow(const QVariant &value);
public:
RegisterPostMortemAction(QObject *parent = 0);
void readSettings(const QSettings *settings = 0);
Q_SLOT virtual void writeSettings(QSettings *) {}
void readSettings(const QSettings *settings = 0) override;
void writeSettings(QSettings *) override {}
private:
void registerNow(const QVariant &value);
};
} // namespace Internal
......
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