Cross-platform Shortcut creation
| 366 | |
| 367 | // Cross-platform Shortcut creation |
| 368 | bool createShortCut(QString location, QString dest, QStringList args, QString name, QString icon) |
| 369 | { |
| 370 | #if !defined(Q_OS_WIN) && !defined(Q_OS_OSX) |
| 371 | location = PathCombine(location, name + ".desktop"); |
| 372 | |
| 373 | QFile f(location); |
| 374 | f.open(QIODevice::WriteOnly | QIODevice::Text); |
| 375 | QTextStream stream(&f); |
| 376 | |
| 377 | QString argstring; |
| 378 | if (!args.empty()) |
| 379 | argstring = " '" + args.join("' '") + "'"; |
| 380 | |
| 381 | stream << "[Desktop Entry]" |
| 382 | << "\n"; |
| 383 | stream << "Type=Application" |
| 384 | << "\n"; |
| 385 | stream << "TryExec=" << dest.toLocal8Bit() << "\n"; |
| 386 | stream << "Exec=" << dest.toLocal8Bit() << argstring.toLocal8Bit() << "\n"; |
| 387 | stream << "Name=" << name.toLocal8Bit() << "\n"; |
| 388 | stream << "Icon=" << icon.toLocal8Bit() << "\n"; |
| 389 | |
| 390 | stream.flush(); |
| 391 | f.close(); |
| 392 | |
| 393 | f.setPermissions(f.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeGroup | QFileDevice::ExeOther); |
| 394 | |
| 395 | return true; |
| 396 | #else |
| 397 | qWarning("Desktop Shortcuts not supported on your platform!"); |
| 398 | return false; |
| 399 | #endif |
| 400 | } |
| 401 | |
| 402 | bool mergeFolders(QString dstpath, QString srcpath) |
| 403 | { |
nothing calls this directly
no test coverage detected