mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-27 11:20:54 +00:00
Merge with develop
--HG-- branch : compatibility-develop
This commit is contained in:
commit
320f3e6c46
5 changed files with 19 additions and 25 deletions
|
@ -188,6 +188,11 @@ bool CConfigFile::save() const
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CConfigFile::remove()
|
||||||
|
{
|
||||||
|
return QFile::remove(m_configPath);
|
||||||
|
}
|
||||||
|
|
||||||
CConfigFile* CConfigFile::getInstance()
|
CConfigFile* CConfigFile::getInstance()
|
||||||
{
|
{
|
||||||
return s_instance;
|
return s_instance;
|
||||||
|
@ -729,11 +734,8 @@ QString CConfigFile::getInstallerOriginalDirPath() const
|
||||||
|
|
||||||
QString CConfigFile::getInstallerMenuLinkFullPath() const
|
QString CConfigFile::getInstallerMenuLinkFullPath() const
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN32
|
// don't put extension
|
||||||
return QString("%1/%2/%2 Installer.lnk").arg(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)).arg(QApplication::applicationName());
|
return QString("%1/%2/%2 Installer").arg(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)).arg(QApplication::applicationName());
|
||||||
#else
|
|
||||||
return "";
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList CConfigFile::getInstallerRequiredFiles() const
|
QStringList CConfigFile::getInstallerRequiredFiles() const
|
||||||
|
|
|
@ -38,6 +38,7 @@ public:
|
||||||
bool load();
|
bool load();
|
||||||
bool load(const QString &filename);
|
bool load(const QString &filename);
|
||||||
bool save() const;
|
bool save() const;
|
||||||
|
bool remove();
|
||||||
|
|
||||||
static CConfigFile* getInstance();
|
static CConfigFile* getInstance();
|
||||||
|
|
||||||
|
|
|
@ -1179,6 +1179,9 @@ void COperationDialog::deleteComponentsInstaller()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// delete configuration file
|
||||||
|
config->remove();
|
||||||
|
|
||||||
// reset it once it's done
|
// reset it once it's done
|
||||||
m_removeComponents.installer = false;
|
m_removeComponents.installer = false;
|
||||||
|
|
||||||
|
|
|
@ -65,24 +65,12 @@ QString CProfile::getClientFullPath() const
|
||||||
|
|
||||||
QString CProfile::getClientDesktopShortcutFullPath() const
|
QString CProfile::getClientDesktopShortcutFullPath() const
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN32
|
return CConfigFile::getInstance()->getDesktopDirectory() + "/" + name;
|
||||||
return CConfigFile::getInstance()->getDesktopDirectory() + "/" + name + ".lnk";
|
|
||||||
#elif defined(Q_OS_MAC)
|
|
||||||
return "";
|
|
||||||
#else
|
|
||||||
return CConfigFile::getInstance()->getDesktopDirectory() + "/" + name + ".desktop";
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CProfile::getClientMenuShortcutFullPath() const
|
QString CProfile::getClientMenuShortcutFullPath() const
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN32
|
return CConfigFile::getInstance()->getMenuDirectory() + "/" + name;
|
||||||
return CConfigFile::getInstance()->getMenuDirectory() + "/" + name + ".lnk";
|
|
||||||
#elif defined(Q_OS_MAC)
|
|
||||||
return "";
|
|
||||||
#else
|
|
||||||
return CConfigFile::getInstance()->getMenuDirectory() + "/" + name + ".desktop";
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CProfile::createShortcuts() const
|
void CProfile::createShortcuts() const
|
||||||
|
|
|
@ -152,17 +152,15 @@ bool createLink(const QString &link, const QString &name, const QString &executa
|
||||||
psl->SetArguments(qToWide(arguments));
|
psl->SetArguments(qToWide(arguments));
|
||||||
psl->SetWorkingDirectory(qToWide(QDir::toNativeSeparators(workingDir)));
|
psl->SetWorkingDirectory(qToWide(QDir::toNativeSeparators(workingDir)));
|
||||||
|
|
||||||
// Query IShellLink for the IPersistFile interface, used for saving the
|
// Query IShellLink for the IPersistFile interface, used for saving the shortcut in persistent storage.
|
||||||
// shortcut in persistent storage.
|
|
||||||
hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
|
hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
|
||||||
|
|
||||||
if (SUCCEEDED(hres))
|
if (SUCCEEDED(hres))
|
||||||
{
|
{
|
||||||
// Add code here to check return value from MultiByteWideChar
|
QString path(link + ".lnk");
|
||||||
// for success.
|
|
||||||
|
|
||||||
// Save the link by calling IPersistFile::Save.
|
// Save the link by calling IPersistFile::Save.
|
||||||
hres = ppf->Save(qToWide(QDir::toNativeSeparators(link)), TRUE);
|
hres = ppf->Save(qToWide(QDir::toNativeSeparators(path)), TRUE);
|
||||||
ppf->Release();
|
ppf->Release();
|
||||||
}
|
}
|
||||||
psl->Release();
|
psl->Release();
|
||||||
|
@ -261,8 +259,10 @@ bool createLink(const QString &link, const QString &name, const QString &executa
|
||||||
data.replace("$COMMAND", command);
|
data.replace("$COMMAND", command);
|
||||||
data.replace("$ICON", icon);
|
data.replace("$ICON", icon);
|
||||||
|
|
||||||
|
QString path(link + ".desktop");
|
||||||
|
|
||||||
// write file
|
// write file
|
||||||
file.setFileName(link);
|
file.setFileName(path);
|
||||||
|
|
||||||
if (!file.open(QFile::WriteOnly)) return false;
|
if (!file.open(QFile::WriteOnly)) return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue