Changeset View
Changeset View
Standalone View
Standalone View
kmousetool/kmousetool.cpp
Show First 20 Lines • Show All 373 Lines • ▼ Show 20 Line(s) | |||||
374 | { | 374 | { | ||
375 | QString sym = autostartdirname; | 375 | QString sym = autostartdirname; | ||
376 | sym += QLatin1String( "kmousetool" ); // sym is now full path to symlink | 376 | sym += QLatin1String( "kmousetool" ); // sym is now full path to symlink | ||
377 | QFileInfo fi(sym); | 377 | QFileInfo fi(sym); | ||
378 | QString cmd; | 378 | QString cmd; | ||
379 | 379 | | |||
380 | if (start) { | 380 | if (start) { | ||
381 | if (!fi.exists()) // if it doesn't exist, make it | 381 | if (!fi.exists()) // if it doesn't exist, make it | ||
382 | cmd = QStringLiteral( "ln -s %1 %2" ).arg(appfilename).arg(autostartdirname); | 382 | QFile(appfilename).link(sym); | ||
383 | } else { | 383 | } else { | ||
384 | if (fi.exists()) // if it exists, delete it | 384 | if (fi.exists()) // if it exists, delete it | ||
385 | cmd = QStringLiteral( "rm -f %1" ).arg(sym); | 385 | QFile(sym).remove(); | ||
386 | } | 386 | } | ||
387 | system(cmd.toLatin1()); | | |||
388 | } | 387 | } | ||
389 | 388 | | |||
390 | bool KMouseTool::applySettings() | 389 | bool KMouseTool::applySettings() | ||
391 | { | 390 | { | ||
392 | int drag, dwell; | 391 | int drag, dwell; | ||
393 | 392 | | |||
394 | dwell = dwellTimeEdit->value(); | 393 | dwell = dwellTimeEdit->value(); | ||
395 | drag = dragTimeEdit->value() ; | 394 | drag = dragTimeEdit->value() ; | ||
▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines |