summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-03-26 19:15:22 -0400
committerLoren Burkholder <computersemiexpert@outlook.com>2021-09-11 19:35:31 -0400
commit069115ba5fd03798e80166c115c55f8c4b3d17b7 (patch)
tree1dcaf0bb6083ad1c9f16a2697259925e90378feb /src
parentOnly set identicon source if used (diff)
downloadnheko-069115ba5fd03798e80166c115c55f8c4b3d17b7.tar.xz
Don't add toggle for jdenticon if the plugin can't be found
Diffstat (limited to 'src')
-rw-r--r--src/UserSettingsPage.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp

index bfe5232b..7df9d55d 100644 --- a/src/UserSettingsPage.cpp +++ b/src/UserSettingsPage.cpp
@@ -757,7 +757,6 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge trayToggle_ = new Toggle{this}; startInTrayToggle_ = new Toggle{this}; avatarCircles_ = new Toggle{this}; - useIdenticon_ = new Toggle{this}; decryptSidebar_ = new Toggle(this); privacyScreen_ = new Toggle{this}; onlyShareKeysWithVerifiedUsers_ = new Toggle(this); @@ -791,7 +790,6 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge trayToggle_->setChecked(settings_->tray()); startInTrayToggle_->setChecked(settings_->startInTray()); avatarCircles_->setChecked(settings_->avatarCircles()); - useIdenticon_->setChecked(settings_->useIdenticon()); decryptSidebar_->setChecked(settings_->decryptSidebar()); privacyScreen_->setChecked(settings_->privacyScreen()); onlyShareKeysWithVerifiedUsers_->setChecked(settings_->onlyShareKeysWithVerifiedUsers()); @@ -811,6 +809,11 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge useStunServer_->setChecked(settings_->useStunServer()); mobileMode_->setChecked(settings_->mobileMode()); + if (JdenticonProvider::isAvailable()) { + useIdenticon_ = new Toggle{this}; + useIdenticon_->setChecked(settings_->useIdenticon()); + } + if (!settings_->tray()) { startInTrayToggle_->setState(false); startInTrayToggle_->setDisabled(true); @@ -1282,9 +1285,10 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge settings_->setAvatarCircles(enabled); }); - connect(useIdenticon_, &Toggle::toggled, this, [this](bool enabled) { - settings_->setUseIdenticon(enabled); - }); + if (JdenticonProvider::isAvailable()) + connect(useIdenticon_, &Toggle::toggled, this, [this](bool enabled) { + settings_->setUseIdenticon(enabled); + }); connect(markdown_, &Toggle::toggled, this, [this](bool enabled) { settings_->setMarkdown(enabled);