MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / deleteShortcut

Method deleteShortcut

app/src/Misc/ShortcutGenerator.cpp:274–289  ·  view source on GitHub ↗

* @brief Removes a shortcut on disk. macOS .app bundles are removed recursively. */

Source from the content-addressed store, hash-verified

272 * @brief Removes a shortcut on disk. macOS .app bundles are removed recursively.
273 */
274void Misc::ShortcutGenerator::deleteShortcut(const QString& shortcutPath)
275{
276 const QString resolved =
277 QUrl(shortcutPath).isLocalFile() ? QUrl(shortcutPath).toLocalFile() : shortcutPath;
278 if (resolved.isEmpty())
279 return;
280
281 QFileInfo info(resolved);
282 if (!info.exists())
283 return;
284
285 if (info.isDir())
286 QDir(resolved).removeRecursively();
287 else
288 QFile::remove(resolved);
289}
290
291//--------------------------------------------------------------------------------------------------
292// File-write dispatcher

Callers 1

verifyShortcutProjectMethod · 0.80

Calls 3

isEmptyMethod · 0.80
existsMethod · 0.80
QUrlClass · 0.50

Tested by

no test coverage detected