Fix brightray::GetApplicationName(), ..Version() on Linux (#11980)
* add brightray API to override app version * in atom browser, use brightray app version API * on Linux, have GetApplicationVersion() use brightray version API * on Linux, implement brightray::GetApplicationName() * fix typo in brightray API * make browser.GetName() logic follow GetVersion() logic * improve variable name in OverrideApplicationVersion declaration * fix typo in brightray impl
This commit is contained in:
parent
dc62e51ba4
commit
8d086a43cb
6 changed files with 84 additions and 24 deletions
|
@ -97,27 +97,21 @@ void Browser::Shutdown() {
|
|||
}
|
||||
|
||||
std::string Browser::GetVersion() const {
|
||||
if (version_override_.empty()) {
|
||||
std::string version = GetExecutableFileVersion();
|
||||
if (!version.empty())
|
||||
return version;
|
||||
}
|
||||
|
||||
return version_override_;
|
||||
std::string ret = brightray::GetOverriddenApplicationVersion();
|
||||
if (ret.empty())
|
||||
ret = GetExecutableFileVersion();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Browser::SetVersion(const std::string& version) {
|
||||
version_override_ = version;
|
||||
brightray::OverrideApplicationVersion(version);
|
||||
}
|
||||
|
||||
std::string Browser::GetName() const {
|
||||
if (name_override_.empty()) {
|
||||
std::string name = GetExecutableFileProductName();
|
||||
if (!name.empty())
|
||||
return name;
|
||||
}
|
||||
|
||||
return name_override_;
|
||||
std::string ret = name_override_;
|
||||
if (ret.empty())
|
||||
ret = GetExecutableFileProductName();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Browser::SetName(const std::string& name) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue