diff --git a/systemmonitor/ksystemactivitydialog.cpp b/systemmonitor/ksystemactivitydialog.cpp index cd4ab01a6..b45d3f1e8 100644 --- a/systemmonitor/ksystemactivitydialog.cpp +++ b/systemmonitor/ksystemactivitydialog.cpp @@ -31,14 +31,14 @@ #include #include #include +#include #include #include #include #include #include - -//#include "krunnersettings.h" +#include KSystemActivityDialog::KSystemActivityDialog(QWidget *parent) : QDialog(parent), m_processList(0) @@ -59,7 +59,15 @@ KSystemActivityDialog::KSystemActivityDialog(QWidget *parent) connect(closeWindow, &QAction::triggered, this, &KSystemActivityDialog::accept); addAction(closeWindow); + // We need the resizing to be done once the dialog has been initialized + // otherwise we don't actually have a window. + QTimer::singleShot(0, this, SLOT(slotInit())); +} + +void KSystemActivityDialog::slotInit() +{ resize(QSize(650, 420)); + KConfigGroup cg = KSharedConfig::openConfig()->group("TaskDialog"); KWindowConfig::restoreWindowSize(windowHandle(), cg); @@ -67,7 +75,7 @@ KSystemActivityDialog::KSystemActivityDialog(QWidget *parent) // Since we default to forcing the window to be KeepAbove, if the user turns this off, remember this const bool keepAbove = true; // KRunnerSettings::keepTaskDialogAbove(); if (keepAbove) { - KWindowSystem::setState(winId(), NET::KeepAbove ); + KWindowSystem::setState(winId(), NET::KeepAbove); } QDBusConnection con = QDBusConnection::sessionBus(); diff --git a/systemmonitor/ksystemactivitydialog.h b/systemmonitor/ksystemactivitydialog.h index c38ea37c4..a5664ac9a 100644 --- a/systemmonitor/ksystemactivitydialog.h +++ b/systemmonitor/ksystemactivitydialog.h @@ -32,6 +32,7 @@ */ class KSystemActivityDialog : public QDialog { + Q_OBJECT public: KSystemActivityDialog(QWidget *parent = NULL); @@ -53,6 +54,9 @@ class KSystemActivityDialog : public QDialog /** Save the settings if the user clicks (x) button on the window */ void closeEvent(QCloseEvent *event); + private slots: + void slotInit(); + private: void saveDialogSettings();