mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-26 17:16:20 +00:00
Fixed: Unable to find a shortcut
This commit is contained in:
parent
53f6021738
commit
aacdfbb9b4
3 changed files with 21 additions and 2 deletions
|
@ -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…
Reference in a new issue