mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 15:47:11 +02:00
Add a cheat code to install launcher on Linux
This commit is contained in:
parent
0881e5b20d
commit
204a08df14
3 changed files with 12 additions and 3 deletions
|
@ -1129,13 +1129,15 @@ void start() {
|
|||
void finish() {
|
||||
}
|
||||
|
||||
void InstallLauncher() {
|
||||
void InstallLauncher(bool force) {
|
||||
static const auto DisabledByEnv = qEnvironmentVariableIsSet(
|
||||
"TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION");
|
||||
|
||||
// don't update desktop file for alpha version or if updater is disabled
|
||||
if (cAlphaVersion() || Core::UpdaterDisabled() || DisabledByEnv)
|
||||
if ((cAlphaVersion() || Core::UpdaterDisabled() || DisabledByEnv)
|
||||
&& !force) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto applicationsPath = QStandardPaths::writableLocation(
|
||||
QStandardPaths::ApplicationsLocation) + '/';
|
||||
|
|
|
@ -41,7 +41,7 @@ QString GetIconName();
|
|||
inline void IgnoreApplicationActivationRightNow() {
|
||||
}
|
||||
|
||||
void InstallLauncher();
|
||||
void InstallLauncher(bool force = false);
|
||||
|
||||
} // namespace Platform
|
||||
|
||||
|
|
|
@ -157,6 +157,13 @@ auto GenerateCodes() {
|
|||
});
|
||||
#endif // Q_OS_WIN || Q_OS_MAC
|
||||
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
codes.emplace(qsl("installauncher"), [](SessionController *window) {
|
||||
Platform::InstallLauncher(true);
|
||||
Ui::Toast::Show("Forced launcher installation.");
|
||||
});
|
||||
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||
|
||||
auto audioFilters = qsl("Audio files (*.wav *.mp3);;") + FileDialog::AllFilesFilter();
|
||||
auto audioKeys = {
|
||||
qsl("msg_incoming"),
|
||||
|
|
Loading…
Add table
Reference in a new issue