mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Remove unneeded checks for GtkIntegration::loaded()
Due to rearranged loading of gtk methods
This commit is contained in:
parent
53fd3fce84
commit
23c8d7f38f
3 changed files with 3 additions and 14 deletions
|
@ -22,8 +22,6 @@ using BaseGtkIntegration = base::Platform::GtkIntegration;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
bool Loaded = false;
|
|
||||||
|
|
||||||
QLibrary &Library() {
|
QLibrary &Library() {
|
||||||
return BaseGtkIntegration::Instance()->library();
|
return BaseGtkIntegration::Instance()->library();
|
||||||
}
|
}
|
||||||
|
@ -57,7 +55,8 @@ GtkIntegration *GtkIntegration::Instance() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GtkIntegration::load() {
|
void GtkIntegration::load() {
|
||||||
Expects(!loaded());
|
static bool Loaded = false;
|
||||||
|
Expects(!Loaded);
|
||||||
|
|
||||||
if (!BaseGtkIntegration::Instance()->loaded()) {
|
if (!BaseGtkIntegration::Instance()->loaded()) {
|
||||||
return;
|
return;
|
||||||
|
@ -134,13 +133,8 @@ void GtkIntegration::load() {
|
||||||
Loaded = true;
|
Loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GtkIntegration::loaded() const {
|
|
||||||
return Loaded;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<int> GtkIntegration::scaleFactor() const {
|
std::optional<int> GtkIntegration::scaleFactor() const {
|
||||||
if (!loaded()
|
if ((gdk_display_get_default == nullptr)
|
||||||
|| (gdk_display_get_default == nullptr)
|
|
||||||
|| (gdk_display_get_monitor == nullptr)
|
|| (gdk_display_get_monitor == nullptr)
|
||||||
|| (gdk_display_get_primary_monitor == nullptr)
|
|| (gdk_display_get_primary_monitor == nullptr)
|
||||||
|| (gdk_monitor_get_scale_factor == nullptr)) {
|
|| (gdk_monitor_get_scale_factor == nullptr)) {
|
||||||
|
|
|
@ -17,7 +17,6 @@ public:
|
||||||
static GtkIntegration *Instance();
|
static GtkIntegration *Instance();
|
||||||
|
|
||||||
void load();
|
void load();
|
||||||
[[nodiscard]] bool loaded() const;
|
|
||||||
|
|
||||||
[[nodiscard]] std::optional<int> scaleFactor() const;
|
[[nodiscard]] std::optional<int> scaleFactor() const;
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,6 @@ GtkIntegration *GtkIntegration::Instance() {
|
||||||
void GtkIntegration::load() {
|
void GtkIntegration::load() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GtkIntegration::loaded() const {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<int> GtkIntegration::scaleFactor() const {
|
std::optional<int> GtkIntegration::scaleFactor() const {
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue