From: Michael Schuster Date: Thu, 22 Oct 2020 01:57:29 +0000 (+0200) Subject: Delay initialization of SettingsDialog X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~96^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0fb10163a3b8ae08f0c149570a3c0705734c3511;p=nextcloud-desktop.git Delay initialization of SettingsDialog ownCloudGui::slotShowSettings already got what it takes to create it only when we try to show it for the first time. This however has some implications: Pros: - Only created when needed, while testing saved ca. 20 MB of RAM and got freed again after closing the dialog. - Since we defaulted to the new Tray UI from 3.0, this is an added bonus for users don't opening the settings. Cons: - Resources like the avatar image have to be refetched everytime the dialog is recreated. This may be desired as well, because it ensures displaying no outdated info (e.g. on connection issues). Signed-off-by: Michael Schuster --- diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index f328cb79d..9b8c42a7b 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -59,7 +59,7 @@ const char propertyAccountC[] = "oc_account"; ownCloudGui::ownCloudGui(Application *parent) : QObject(parent) , _tray(nullptr) - , _settingsDialog(new SettingsDialog(this)) + , _settingsDialog(nullptr) , _logBrowser(nullptr) #ifdef WITH_LIBCLOUDPROVIDERS , _bus(QDBusConnection::sessionBus())