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

Method initializeNotifications

kdevplatform/tests/autotestshell.cpp:37–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void AutoTestShell::initializeNotifications()
38{
39 // Guard against installing to a non-test location.
40 QVERIFY2(QStandardPaths::isTestModeEnabled(),
41 "AutoTestShell::initializeNotifications() may be called only after AutoTestShell::init()");
42
43 const QString destination = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
44 + QLatin1String{"/knotifications6/"} + QCoreApplication::applicationName() + QLatin1String{".notifyrc"};
45
46 const auto destinationDirectory = destination.first(destination.lastIndexOf(QLatin1Char{'/'}));
47 QVERIFY(QDir().mkpath(destinationDirectory));
48
49 // Remove the destination first because QFile::copy() does not overwrite
50 // and would keep a possibly obsolete version of the file.
51 QFile::remove(destination);
52
53 const auto source = QStringLiteral(KDEVELOP_APP_DIR "/kdevelop.notifyrc");
54 QVERIFY(QFile::copy(source, destination));
55}

Callers

nothing calls this directly

Calls 2

QDirClass · 0.50
firstMethod · 0.45

Tested by

no test coverage detected