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:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user