MCPcopy Create free account
hub / github.com/ckaiser/Lightscreen / setStartup

Method setStartup

tools/os.cpp:257–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257void os::setStartup(bool startup, bool hide)
258{
259 QString lightscreen = QDir::toNativeSeparators(qApp->applicationFilePath());
260
261 if (hide) {
262 lightscreen.append(" -h");
263 }
264
265#ifdef Q_OS_WIN
266 // Windows startup settings
267 QSettings init("Microsoft", "Windows");
268 init.beginGroup("CurrentVersion");
269 init.beginGroup("Run");
270
271 if (startup) {
272 init.setValue("Lightscreen", lightscreen);
273 } else {
274 init.remove("Lightscreen");
275 }
276
277 init.endGroup();
278 init.endGroup();
279#endif
280
281#if defined(Q_OS_LINUX)
282 QFile desktopFile(QDir::homePath() + "/.config/autostart/lightscreen.desktop");
283
284 desktopFile.remove();
285
286 if (startup) {
287 desktopFile.open(QIODevice::WriteOnly);
288 desktopFile.write(QString("[Desktop Entry]\nExec=%1\nType=Application").arg(lightscreen).toLatin1());
289 }
290#endif
291}
292
293QGraphicsEffect *os::shadow(const QColor &color, int blurRadius, int offset)
294{

Callers

nothing calls this directly

Calls 1

QStringClass · 0.85

Tested by

no test coverage detected