[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kcalc/frameworks] /: KF5 port: KGlobalSettings -> event() for font/palette changes
From:       Christoph Feck <christoph () maxiom ! de>
Date:       2014-09-30 22:05:37
Message-ID: E1XZ5Y9-0003kV-45 () scm ! kde ! org
[Download RAW message or body]

Git commit 9dc9ea633d2975a09c693d2e4095253c1e568aca by Christoph Feck.
Committed on 24/09/2014 at 23:31.
Pushed by cfeck into branch 'frameworks'.

KF5 port: KGlobalSettings -> event() for font/palette changes

M  +19   -4    kcalc.cpp
M  +1    -0    kcalc.h

http://commits.kde.org/kcalc/9dc9ea633d2975a09c693d2e4095253c1e568aca

diff --git a/kcalc.cpp b/kcalc.cpp
index a2b985b..8b450be 100644
--- a/kcalc.cpp
+++ b/kcalc.cpp
@@ -159,10 +159,6 @@ KCalculator::KCalculator(QWidget *parent) :
 	setAngle();
 	setBase();
 =

-	// connections
-	connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), SLOT(s=
etColors()));
-	connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()), SLOT(setF=
onts()));
-
 	calc_display->setFocus();
 }
 =

@@ -2151,6 +2147,25 @@ void KCalculator::setFonts() {
 }
 =

 //------------------------------------------------------------------------=
------
+// Name: event
+// Desc: catch application's palette and font change events
+//------------------------------------------------------------------------=
------
+bool KCalculator::event(QEvent *e) {
+
+	switch (e->type()) {
+	case QEvent::ApplicationFontChange:
+		setFonts();
+		break;
+	case QEvent::ApplicationPaletteChange:
+		setColors();
+		break;
+	default:
+		break;
+	}
+	return KXmlGuiWindow::event(e);
+}
+
+//------------------------------------------------------------------------=
------
 // Name: setPrecision
 // Desc: set the precision of the display
 //------------------------------------------------------------------------=
------
diff --git a/kcalc.h b/kcalc.h
index 1e6dc28..7841d72 100644
--- a/kcalc.h
+++ b/kcalc.h
@@ -116,6 +116,7 @@ public:
 =

 private:
     virtual bool eventFilter(QObject *o, QEvent *e);
+    virtual bool event(QEvent *e);
     void updateGeometry();
     void setupMainActions();
     void setupKeys();

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic