This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2goplasmabindings. from 1299e85 CMakeLists.txt: include ECMInstallIcons module. new 2a962a0 /: add plasma_compat.h, defining the helper macro X2GOPLASMOID_PLASMA5_COMPAT if we're building against Plasma 5. new 4e5a987 plasmoidhoveredicon.{cpp,h}: use QFrame in Plasma 5 mode, where Plasma::Frame is not available. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 5 +++++ plasma_compat.h | 24 ++++++++++++++++++++++++ plasmoidhovereditem.cpp | 25 ++++++++++++++++++++++++- plasmoidhovereditem.h | 13 ++++++++++++- 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 plasma_compat.h -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goplasmabindings.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goplasmabindings. commit 2a962a0615b99255854209e3a55b3eafdd3f2da8 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon May 8 21:47:17 2023 +0200 /: add plasma_compat.h, defining the helper macro X2GOPLASMOID_PLASMA5_COMPAT if we're building against Plasma 5. --- debian/changelog | 2 ++ plasma_compat.h | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/debian/changelog b/debian/changelog index 452dc87..12a784c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,8 @@ x2goplasmabindings (3.0.2.3-0x2go1) UNRELEASED; urgency=medium - x2goplasmabindings.spec: add cmake(Qt5{,Quick,Core}) BRs. - CMakeLists.txt: fix Qt5 package name. - CMakeLists.txt: include ECMInstallIcons module. + - /: add plasma_compat.h, defining the helper macro + X2GOPLASMOID_PLASMA5_COMPAT if we're building against Plasma 5. * debian/control: + Adapt description to also mention KDE 5. + Build-Depend on libkf5plasma-dev and libkf5i18n-dev, with a fallback to diff --git a/plasma_compat.h b/plasma_compat.h new file mode 100644 index 0000000..32a7ff3 --- /dev/null +++ b/plasma_compat.h @@ -0,0 +1,24 @@ +#ifndef x2goplasmoid_plasma_compat_h_ + +#define x2goplasmoid_plasma_compat_h_ + +#include <plasma/version.h> + +/* + * Plasma 5.85 deprecated plasma/version.h and wants users to use + * plasma_version.h instead. + * + * While including plasma/version.h still works, prepare for using the other + * header instead - and make sure that we will not use anything but things + * defined in the other header for future compatibility. + */ +#ifndef PLASMA_VERSION_MAJOR +#include <Plasma/plasma_version.h> +#endif /* !defined (PLASMA_VERSION_MAJOR) */ + +#if PLASMA_VERSION_MAJOR >= 5 +/* Shorthand macro for Plasma 5 support. */ +#define X2GOPLASMOID_PLASMA5_COMPAT 1 +#endif + +#endif /* !defined (x2goplasmoid_plasma_compat_h_) */ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goplasmabindings.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goplasmabindings. commit 4e5a987cbc5a63ca2ef28ed691b86abb3766d87b Author: Mihai Moldovan <ionic@ionic.de> Date: Mon May 8 23:34:53 2023 +0200 plasmoidhoveredicon.{cpp,h}: use QFrame in Plasma 5 mode, where Plasma::Frame is not available. We try to recreate the previous look by using a StyledFrame with the default lineWidth of one. --- debian/changelog | 3 +++ plasmoidhovereditem.cpp | 25 ++++++++++++++++++++++++- plasmoidhovereditem.h | 13 ++++++++++++- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 12a784c..6ef9cb4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,6 +28,9 @@ x2goplasmabindings (3.0.2.3-0x2go1) UNRELEASED; urgency=medium - CMakeLists.txt: include ECMInstallIcons module. - /: add plasma_compat.h, defining the helper macro X2GOPLASMOID_PLASMA5_COMPAT if we're building against Plasma 5. + - plasmoidhoveredicon.{cpp,h}: use QFrame in Plasma 5 mode, where + Plasma::Frame is not available. We try to recreate the previous look by + using a StyledFrame with the default lineWidth of one. * debian/control: + Adapt description to also mention KDE 5. + Build-Depend on libkf5plasma-dev and libkf5i18n-dev, with a fallback to diff --git a/plasmoidhovereditem.cpp b/plasmoidhovereditem.cpp index 2bc73af..f143a7f 100644 --- a/plasmoidhovereditem.cpp +++ b/plasmoidhovereditem.cpp @@ -19,16 +19,27 @@ Boston, MA 02110-1301, USA. */ +#include "plasma_compat.h" #include "plasmoidhovereditem.h" #include <QDebug> +#ifdef X2GOPLASMOID_PLASMA5_COMPAT +#include <QFrame> +#else #include <plasma/widgets/frame.h> +#endif #include <plasma/widgets/iconwidget.h> #include <plasma/widgets/label.h> #include <QGraphicsLinearLayout> -PlasmoidHoveredItem::PlasmoidHoveredItem(QGraphicsWidget* parent): Plasma::Frame(parent),label(0),icon(0) +PlasmoidHoveredItem::PlasmoidHoveredItem(QGraphicsWidget* parent): +#ifdef X2GOPLASMOID_PLASMA5_COMPAT + QFrame (parent) +#else + Plasma::Frame(parent) +#endif + , label(0),icon(0) { setAcceptHoverEvents(true); setZValue(0); @@ -41,6 +52,10 @@ PlasmoidHoveredItem::PlasmoidHoveredItem(QGraphicsWidget* parent): Plasma::Frame icon->setAcceptHoverEvents(false); icon->setAcceptedMouseButtons(0); icon->setMaximumWidth(18); + +#ifdef X2GOPLASMOID_PLASMA5_COMPAT + this->setFrameStyle (QFrame::StyledPanel | QFrame::Plain); +#endif } PlasmoidHoveredItem::~PlasmoidHoveredItem() @@ -54,13 +69,21 @@ void PlasmoidHoveredItem::buttonPressed() void PlasmoidHoveredItem::hoverEnter() { +#ifdef X2GOPLASMOID_PLASMA5_COMPAT + this->setFrameStyle (this->frameShape () | QFrame::Raised); +#else setFrameShadow(Plasma::Frame::Raised); +#endif update(); } void PlasmoidHoveredItem::hoverLeave() { +#ifdef X2GOPLASMOID_PLASMA5_COMPAT + this->setFrameStyle (this->frameShape () | QFrame::Plain); +#else setFrameShadow(Plasma::Frame::Plain); +#endif update(); } diff --git a/plasmoidhovereditem.h b/plasmoidhovereditem.h index 4ef6f12..bc254f1 100644 --- a/plasmoidhovereditem.h +++ b/plasmoidhovereditem.h @@ -22,14 +22,25 @@ #ifndef SHAREITEM_H #define SHAREITEM_H +#include "plasma_compat.h" + +#ifdef X2GOPLASMOID_PLASMA5_COMPAT +#include <QFrame> +#else #include <plasma/widgets/frame.h> +#endif #include <QObject> #include <plasma/widgets/label.h> #include <plasma/widgets/iconwidget.h> class QGraphicsLinearLayout; -class PlasmoidHoveredItem : public Plasma::Frame +class PlasmoidHoveredItem : public +#ifdef X2GOPLASMOID_PLASMA5_COMPAT + QFrame +#else + Plasma::Frame +#endif { Q_OBJECT public: -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goplasmabindings.git