35 #include <QtCore/QtPlugin>
38 using namespace Core::Internal;
40 CorePlugin::CorePlugin()
42 , m_secondaryAttempts(0)
43 , m_secondaryTimer(new QTimer)
45 connect(m_mainWindow, SIGNAL(splashMessages(QString)),
this, SIGNAL(splashMessages(QString)));
46 connect(m_mainWindow, SIGNAL(hideSplash()),
this, SIGNAL(hideSplash()));
47 connect(m_mainWindow, SIGNAL(showSplash()),
this, SIGNAL(showSplash()));
50 CorePlugin::~CorePlugin()
52 m_secondaryTimer->stop();
53 delete m_secondaryTimer;
57 bool CorePlugin::initialize(
const QStringList &arguments, QString *errorMessage)
59 if (arguments.contains(
"crashme")) {
60 if ((arguments.length() > 1) && (arguments.at(arguments.indexOf(
"crashme") + 1) ==
"yes")) {
65 const bool success = m_mainWindow->
init(errorMessage);
72 void CorePlugin::extensionsInitialized()
78 m_secondaryTimer->setInterval(1000);
79 connect(m_secondaryTimer, &QTimer::timeout,
this, [
this]() {
83 if (attempts != m_secondaryAttempts && m_mainWindow)
84 m_mainWindow->activateWindow();
85 m_secondaryAttempts = attempts;
87 m_secondaryTimer->start();
96 m_mainWindow->activateWindow();
100 void CorePlugin::shutdown()
quint64 secondaryAttempts()
Number of secondary instances attempted to start.
void extensionsInitialized()
static RunGuard & instance(const QString &key)
Get instance of this singleton.
bool init(QString *errorMessage)
void remoteArgument(const QString &=QString())