Commit bc247307 authored by Luigi Toscano's avatar Luigi Toscano

Use Qt to create the autostart entry instead of system calls

Summary: Probably the code predates QFile?

Test Plan:
The symlinks is created and removed as expected (and seen
by kcm_autostart).

Reviewers: whiting

Reviewed By: whiting

Differential Revision: https://phabricator.kde.org/D5630
parent fa1428ea
......@@ -379,12 +379,11 @@ void KMouseTool::setAutostart (bool start)
if (start) {
if (!fi.exists()) // if it doesn't exist, make it
cmd = QStringLiteral( "ln -s %1 %2" ).arg(appfilename).arg(autostartdirname);
QFile(appfilename).link(sym);
} else {
if (fi.exists()) // if it exists, delete it
cmd = QStringLiteral( "rm -f %1" ).arg(sym);
QFile(sym).remove();
}
system(cmd.toLatin1());
}
bool KMouseTool::applySettings()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment