2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Deduplicate executable path computation

This commit is contained in:
Ilya Fedin
2023-06-15 00:36:50 +04:00
committed by John Preston
parent 22235226d6
commit 32f13c3716
3 changed files with 9 additions and 15 deletions

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "base/integration.h"
#include "ui/style/style_core.h"
#define DeclareReadSetting(Type, Name) extern Type g##Name; \
@@ -56,11 +57,15 @@ inline void cForceWorkingDir(const QString &newDir) {
}
}
DeclareReadSetting(QString, ExeName);
DeclareReadSetting(QString, ExeDir);
inline QString cExeName() {
return base::Integration::Instance().executableName();
}
inline QString cExeDir() {
return base::Integration::Instance().executableDir();
}
DeclareSetting(QString, DialogLastPath);
DeclareSetting(QString, DialogHelperPath);
inline const QString &cDialogHelperPathFinal() {
inline QString cDialogHelperPathFinal() {
return cDialogHelperPath().isEmpty() ? cExeDir() : cDialogHelperPath();
}