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