summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Strobach <[email protected]>2018-03-01 21:10:12 +0100
committerDavid Edmundson <[email protected]>2018-04-12 00:59:12 +0100
commitd55f70722af76015dd79b278618fdbf9972c29ff (patch)
tree9d859ae76bb1621aeca743e54123490e2fa7f215
parent5eb5f6841ef7da1cb6e6d1c35de330e74e74b92d (diff)
Fix crash while displaying Settings dialog
-rw-r--r--app/chat-window.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 478aa96..27807c7 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -53,6 +53,7 @@
#include <QLabel>
#include <QLineEdit>
#include <QMouseEvent>
+#include <QScrollArea>
#include <TelepathyQt/Account>
#include <TelepathyQt/ContactCapabilities>
@@ -760,7 +761,9 @@ void ChatWindow::showSettingsDialog()
KSettings::Dialog *dialog = new KSettings::Dialog(this);
KPageWidgetItem *configPage = dialog->addModule(QLatin1String("kcm_ktp_chat_appearance"));
- KCModuleProxy *proxy = qobject_cast<KCModuleProxy*>(configPage->widget());
+ QScrollArea *moduleScroll = qobject_cast<QScrollArea*>(configPage->widget());
+ Q_ASSERT(moduleScroll);
+ KCModuleProxy *proxy = qobject_cast<KCModuleProxy*>(moduleScroll->widget());
Q_ASSERT(proxy);
connect(proxy->realModule(), SIGNAL(reloadTheme()),
@@ -770,7 +773,9 @@ void ChatWindow::showSettingsDialog()
dialog->addModule(QLatin1String("kcm_ktp_chat_messages"));
KPageWidgetItem *otrConfigPage = dialog->addModule(QLatin1String("kcm_ktp_chat_otr"));
- proxy = qobject_cast<KCModuleProxy*>(otrConfigPage->widget());
+ moduleScroll = qobject_cast<QScrollArea*>(otrConfigPage->widget());
+ Q_ASSERT(moduleScroll);
+ proxy = qobject_cast<KCModuleProxy*>(moduleScroll->widget());
Q_ASSERT(proxy);
QVariant value;
value.setValue(m_proxyService);