Commit d0725e31 authored by hjk's avatar hjk

remove "fat" BaseMode constructor

parent 08e7b0f4
......@@ -82,38 +82,6 @@ BaseMode::BaseMode(QObject *parent):
{
}
/*!
\fn BaseMode::BaseMode(const QString &name,
const char * uniqueModeName,
const QIcon &icon,
int priority,
QWidget *widget,
QObject *parent)
Creates a mode with the given properties.
\a name
\a uniqueModeName
\a icon
\a priority
\a widget
\a parent
*/
BaseMode::BaseMode(const QString &name,
const char * uniqueModeName,
const QIcon &icon,
int priority,
QWidget *widget,
QObject *parent):
IMode(parent),
m_name(name),
m_icon(icon),
m_priority(priority),
m_widget(widget),
m_uniqueModeName(uniqueModeName)
{
}
/*!
\fn BaseMode::~BaseMode()
*/
......
......@@ -49,12 +49,6 @@ class CORE_EXPORT BaseMode
public:
BaseMode(QObject *parent = 0);
BaseMode(const QString &name,
const char * uniqueModeName,
const QIcon &icon,
int priority,
QWidget *widget,
QObject *parent = 0);
~BaseMode();
// IMode
......
......@@ -283,11 +283,12 @@ bool MainWindow::init(ExtensionSystem::PluginManager *pm, QString *)
outputModeWidget->setLayout(new QVBoxLayout);
outputModeWidget->layout()->setMargin(0);
outputModeWidget->layout()->setSpacing(0);
m_outputMode = new BaseMode(tr("Output"),
Constants::MODE_OUTPUT,
QIcon(QLatin1String(":/fancyactionbar/images/mode_Output.png")),
Constants::P_MODE_OUTPUT,
outputModeWidget);
m_outputMode = new BaseMode;
m_outputMode->setName(tr("Output"));
m_outputMode->setUniqueModeName(Constants::MODE_OUTPUT);
m_outputMode->setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Output.png")));
m_outputMode->setPriority(Constants::P_MODE_OUTPUT);
m_outputMode->setWidget(outputModeWidget);
OutputPanePlaceHolder *oph = new OutputPanePlaceHolder(m_outputMode);
oph->setVisible(true);
oph->setCloseable(false);
......
......@@ -163,10 +163,12 @@ public:
} // namespace Debugger
DebugMode::DebugMode(QObject *parent)
: BaseMode(tr("Debug"), Constants::MODE_DEBUG,
QIcon(":/fancyactionbar/images/mode_Debug.png"),
Constants::P_MODE_DEBUG, 0, parent)
: BaseMode(parent)
{
setName(tr("Debug"));
setUniqueModeName(Constants::MODE_DEBUG);
setIcon(QIcon(":/fancyactionbar/images/mode_Debug.png"));
setPriority(Constants::P_MODE_DEBUG);
}
DebugMode::~DebugMode()
......
......@@ -41,13 +41,14 @@
using namespace Help;
using namespace Help::Internal;
HelpMode::HelpMode(QWidget *widget, QWidget *centralWidget, QObject *parent):
BaseMode(tr("Help"),
Constants::ID_MODE_HELP,
QIcon((QLatin1String(":/fancyactionbar/images/mode_Reference.png"))),
Constants::P_MODE_HELP, widget, parent),
m_centralWidget(centralWidget)
HelpMode::HelpMode(QWidget *widget, QWidget *centralWidget, QObject *parent)
: BaseMode(parent), m_centralWidget(centralWidget)
{
setName(tr("Help"));
setUniqueModeName(Constants::ID_MODE_HELP);
setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Reference.png")));
setPriority(Constants::P_MODE_HELP);
setWidget(widget);
m_centralWidget->layout()->setSpacing(0);
m_centralWidget->layout()->addWidget(new Core::FindToolBarPlaceHolder(this));
}
......
......@@ -181,11 +181,12 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
QList<int> pecontext;
pecontext << m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_PROJECTEXPLORER);
Core::BaseMode *mode = new Core::BaseMode(tr("Projects"),
Constants::MODE_SESSION,
QIcon(QLatin1String(":/fancyactionbar/images/mode_Project.png")),
Constants::P_MODE_SESSION,
m_proWindow);
Core::BaseMode *mode = new Core::BaseMode;
mode->setName(tr("Projects"));
mode->setUniqueModeName(Constants::MODE_SESSION);
mode->setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Project.png")));
mode->setPriority(Constants::P_MODE_SESSION);
mode->setWidget(m_proWindow);
mode->setContext(QList<int>() << pecontext);
addAutoReleasedObject(mode);
m_proWindow->layout()->addWidget(new Core::FindToolBarPlaceHolder(mode));
......
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