Commit 46e71d0f authored by dt's avatar dt
Browse files

This code can be simplified.

parent 771f30a6
......@@ -97,16 +97,13 @@ QString SettingsPage::trCategory() const
QWidget *SettingsPage::createPage(QWidget *parent)
{
if (!m_widget)
m_widget = new SettingsPageWidget(parent);
m_widget = new SettingsPageWidget(parent);
m_widget->setSettings(GitPlugin::instance()->settings());
return m_widget;
}
void SettingsPage::apply()
{
if (!m_widget)
return;
const GitSettings newSettings = m_widget->settings();
// Warn if git cannot be found in path if the widget is on top
if (m_widget->isVisible()) {
......
......@@ -78,7 +78,7 @@ public:
void finish() { }
private:
QPointer<SettingsPageWidget> m_widget;
SettingsPageWidget* m_widget;
};
} // namespace Internal
......
......@@ -108,16 +108,12 @@ QString SettingsPage::trCategory() const
QWidget *SettingsPage::createPage(QWidget *parent)
{
if (!m_widget)
m_widget = new SettingsPageWidget(parent);
m_widget = new SettingsPageWidget(parent);
m_widget->setSettings(PerforcePlugin::perforcePluginInstance()->settings());
return m_widget;
}
void SettingsPage::apply()
{
if (!m_widget)
return;
PerforcePlugin::perforcePluginInstance()->setSettings(m_widget->p4Command(), m_widget->p4Port(), m_widget->p4Client(), m_widget->p4User(), m_widget->defaultEnv());
}
......@@ -76,7 +76,7 @@ public:
void finish() { }
private:
QPointer<SettingsPageWidget> m_widget;
SettingsPageWidget* m_widget;
};
} // namespace Internal
......
......@@ -95,6 +95,7 @@ void AbstractMakeStep::setBuildParser(const QString &parser)
}
if (m_buildParser) {
m_buildParserName = parser;
connect(m_buildParser, SIGNAL(addToOutputWindow(const QString &)),
this, SIGNAL(addToOutputWindow(const QString &)),
Qt::DirectConnection);
......
......@@ -51,10 +51,11 @@ public:
virtual void run(QFutureInterface<bool> &);
protected:
// derived classes needs to call these functions
virtual void stdOut(const QString &line);
virtual void stdError(const QString &line);
// derived classes need to call those functions
// derived classes needs to call this function
void setBuildParser(const QString &parser);
QString buildParser() const;
private slots:
......
......@@ -71,20 +71,20 @@ QString SettingsPage::trCategory() const
QWidget *SettingsPage::createPage(QWidget *parent)
{
if (!m_page) {
m_page = new QWidget(parent);
m_ui.setupUi(m_page);
connect(m_ui.filterList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
this, SLOT(updateButtonStates()));
connect(m_ui.filterList, SIGNAL(itemActivated(QListWidgetItem *)),
this, SLOT(configureFilter(QListWidgetItem *)));
connect(m_ui.editButton, SIGNAL(clicked()),
this, SLOT(configureFilter()));
connect(m_ui.addButton, SIGNAL(clicked()),
this, SLOT(addCustomFilter()));
connect(m_ui.removeButton, SIGNAL(clicked()),
this, SLOT(removeCustomFilter()));
}
m_page = new QWidget(parent);
m_ui.setupUi(m_page);
connect(m_ui.filterList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
this, SLOT(updateButtonStates()));
connect(m_ui.filterList, SIGNAL(itemActivated(QListWidgetItem *)),
this, SLOT(configureFilter(QListWidgetItem *)));
connect(m_ui.editButton, SIGNAL(clicked()),
this, SLOT(configureFilter()));
connect(m_ui.addButton, SIGNAL(clicked()),
this, SLOT(addCustomFilter()));
connect(m_ui.removeButton, SIGNAL(clicked()),
this, SLOT(removeCustomFilter()));
m_ui.refreshInterval->setValue(m_plugin->refreshInterval());
m_filters = m_plugin->filters();
m_customFilters = m_plugin->customFilters();
......
......@@ -78,7 +78,7 @@ private:
Ui::SettingsWidget m_ui;
QuickOpenPlugin *m_plugin;
QPointer<QWidget> m_page;
QWidget* m_page;
QList<IQuickOpenFilter *> m_filters;
QList<IQuickOpenFilter *> m_addedFilters;
QList<IQuickOpenFilter *> m_removedFilters;
......
......@@ -96,15 +96,12 @@ QString SettingsPage::trCategory() const
QWidget *SettingsPage::createPage(QWidget *parent)
{
if (!m_widget)
m_widget = new SettingsPageWidget(parent);
m_widget = new SettingsPageWidget(parent);
m_widget->setSettings(SubversionPlugin::subversionPluginInstance()->settings());
return m_widget;
}
void SettingsPage::apply()
{
if (!m_widget)
return;
SubversionPlugin::subversionPluginInstance()->setSettings(m_widget->settings());
}
......@@ -77,7 +77,7 @@ public:
void finish() { }
private:
QPointer<SettingsPageWidget> m_widget;
SettingsPageWidget* m_widget;
};
} // namespace Subversion
......
......@@ -80,7 +80,7 @@ signals:
private:
void updateNickNames();
QPointer<VCSBaseSettingsWidget> m_widget;
VCSBaseSettingsWidget* m_widget;
VCSBaseSettings m_settings;
};
......
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