MCPcopy Create free account
hub / github.com/KDE/kdevelop / initialize

Method initialize

kdevplatform/tests/testcore.cpp:33–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33TestCore* TestCore::initialize(Core::Setup mode, const QString& session)
34{
35 qRegisterMetaType<QList<QUrl>>("QList<QUrl>");
36 KLocalizedString::setApplicationDomain(QByteArrayLiteral("kdevelop"));
37
38 if (!Core::m_self) {
39 new TestCore;
40 }
41
42 auto* core = qobject_cast<TestCore*>(Core::m_self);
43 Q_ASSERT(core);
44 core->initializeNonStatic(mode, session);
45
46 if (mode == Default) {
47 // we don't want the window to be visible, hide it
48 // the unit tests should work anyways
49 core->uiController()->activeMainWindow()->hide();
50 }
51
52 // resume the background parser when a unit test replaces the project controller
53 QObject::connect(core->d->projectController.data(), &ProjectController::destroyed,
54 core, [core]() {
55 core->d->languageController->backgroundParser()->resume();
56 });
57
58 return core;
59}
60
61void TestCore::initializeNonStatic(Core::Setup mode, const QString& _session)
62{

Callers 1

initializeNonStaticMethod · 0.45

Calls 6

initializeNonStaticMethod · 0.80
uiControllerMethod · 0.80
backgroundParserMethod · 0.80
activeMainWindowMethod · 0.45
dataMethod · 0.45
resumeMethod · 0.45

Tested by

no test coverage detected