Fixed: Unable to find a shortcut

--HG--
branch : develop
feature/pipeline-tools
kervala 8 years ago
parent f39e135494
commit f17f7954ac

@ -676,7 +676,7 @@ bool CConfigFile::shouldCreateDesktopShortcut() const
QString shortcut = profile.getClientDesktopShortcutFullPath();
return !shortcut.isEmpty() && !NLMISC::CFile::isExists(qToUtf8(shortcut));
return !shortcut.isEmpty() && !NLMISC::CFile::isExists(qToUtf8(appendLinkExtension(shortcut)));
}
bool CConfigFile::shouldCreateMenuShortcut() const
@ -687,7 +687,7 @@ bool CConfigFile::shouldCreateMenuShortcut() const
QString shortcut = profile.getClientMenuShortcutFullPath();
return !shortcut.isEmpty() && !NLMISC::CFile::isExists(qToUtf8(shortcut));
return !shortcut.isEmpty() && !NLMISC::CFile::isExists(qToUtf8(appendLinkExtension(shortcut)));
}
bool CConfigFile::shouldCopyInstaller() const

@ -282,6 +282,24 @@ bool resolveLink(const QWidget &window, const QString &pathLink, QString &pathOb
#endif
QString appendLinkExtension(const QString &link)
{
QString extension;
#ifdef Q_OS_WIN32
extension = ".lnk";
#elif Q_OS_MAC
// TODO
#else
extension = ".desktop";
#endif
// already the good extension
if (link.indexOf(extension) > -1) return link;
return link + extension;
}
QString getVersionFromExecutable(const QString &path)
{
// launch executable with --version argument

@ -52,6 +52,7 @@ wchar_t* qToWide(const QString &str);
bool createLink(const QString &link, const QString &name, const QString &executable, const QString &arguments, const QString &icon, const QString &workingDir);
bool resolveLink(const QWidget &window, const QString &pathLink, QString &pathObj);
QString appendLinkExtension(const QString &link);
QString getVersionFromExecutable(const QString &path);

Loading…
Cancel
Save