Remove unneeded checks for GtkIntegration::loaded()

Due to rearranged loading of gtk methods
This commit is contained in:
Ilya Fedin 2021-02-22 08:10:58 +04:00 committed by John Preston
parent 53fd3fce84
commit 23c8d7f38f
3 changed files with 3 additions and 14 deletions

View file

@ -22,8 +22,6 @@ using BaseGtkIntegration = base::Platform::GtkIntegration;
namespace {
bool Loaded = false;
QLibrary &Library() {
return BaseGtkIntegration::Instance()->library();
}
@ -57,7 +55,8 @@ GtkIntegration *GtkIntegration::Instance() {
}
void GtkIntegration::load() {
Expects(!loaded());
static bool Loaded = false;
Expects(!Loaded);
if (!BaseGtkIntegration::Instance()->loaded()) {
return;
@ -134,13 +133,8 @@ void GtkIntegration::load() {
Loaded = true;
}
bool GtkIntegration::loaded() const {
return Loaded;
}
std::optional<int> GtkIntegration::scaleFactor() const {
if (!loaded()
|| (gdk_display_get_default == nullptr)
if ((gdk_display_get_default == nullptr)
|| (gdk_display_get_monitor == nullptr)
|| (gdk_display_get_primary_monitor == nullptr)
|| (gdk_monitor_get_scale_factor == nullptr)) {

View file

@ -17,7 +17,6 @@ public:
static GtkIntegration *Instance();
void load();
[[nodiscard]] bool loaded() const;
[[nodiscard]] std::optional<int> scaleFactor() const;

View file

@ -20,10 +20,6 @@ GtkIntegration *GtkIntegration::Instance() {
void GtkIntegration::load() {
}
bool GtkIntegration::loaded() const {
return false;
}
std::optional<int> GtkIntegration::scaleFactor() const {
return std::nullopt;
}