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