File applet.patch of Package applet-window-buttons
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ecec88..d8eb476 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,14 +1,14 @@
project(applet_windowbuttons)
-cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
-set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD 20)
set(VERSION 0.11.1)
set(AUTHOR "Michail Vourlakos")
set(EMAIL "mvourlakos@gmail.com")
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.81.0")
-set(KDECORATION2_MIN_VERSION "5.24.0")
+set(KDECORATION2_MIN_VERSION "5.27.0")
set(KF5_LOCALE_PREFIX "")
diff --git a/libappletdecoration/CMakeLists.txt b/libappletdecoration/CMakeLists.txt
index 9a13741..759adf5 100644
--- a/libappletdecoration/CMakeLists.txt
+++ b/libappletdecoration/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(QT_MIN_VERSION "5.6.0")
set(KF5_MIN_VERSION "5.26.0")
diff --git a/libappletdecoration/appletdecorationplugin.h b/libappletdecoration/appletdecorationplugin.h
index 63a898d..c25104f 100644
--- a/libappletdecoration/appletdecorationplugin.h
+++ b/libappletdecoration/appletdecorationplugin.h
@@ -17,8 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef APPLETDECORATIONPLUGIN_H
-#define APPLETDECORATIONPLUGIN_H
+#pragma once
#include <QQmlExtensionPlugin>
@@ -35,6 +34,3 @@ public:
}
}
-
-#endif
-
diff --git a/libappletdecoration/auroraetheme.cpp b/libappletdecoration/auroraetheme.cpp
index 305587a..09f2f34 100644
--- a/libappletdecoration/auroraetheme.cpp
+++ b/libappletdecoration/auroraetheme.cpp
@@ -99,7 +99,7 @@ void AuroraeTheme::setTheme(QString theme)
m_theme = theme;
updateAurorae(theme);
- emit themeChanged();
+ Q_EMIT themeChanged();
}
QString AuroraeTheme::themeName() const
@@ -209,7 +209,7 @@ void AuroraeTheme::loadSettings()
parseThemeImages();
- emit settingsChanged();
+ Q_EMIT settingsChanged();
}
void AuroraeTheme::parseThemeImages()
diff --git a/libappletdecoration/auroraetheme.h b/libappletdecoration/auroraetheme.h
index 869cce8..15373c3 100644
--- a/libappletdecoration/auroraetheme.h
+++ b/libappletdecoration/auroraetheme.h
@@ -17,8 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef AURORAETHEME_H
-#define AURORAETHEME_H
+#pragma once
#include <QColor>
#include <QObject>
@@ -75,11 +74,11 @@ public:
bool hasMonochromeIcons() const;
QString monochromePrefix() const;
-signals:
+Q_SIGNALS:
void settingsChanged();
void themeChanged();
-private slots:
+private Q_SLOTS:
void parseThemeImages();
void auroraeRCChanged(const QString &filename);
@@ -110,4 +109,3 @@ private:
}
}
-#endif
diff --git a/libappletdecoration/buttonsmodel.h b/libappletdecoration/buttonsmodel.h
index 1b536d5..1c0e7d1 100644
--- a/libappletdecoration/buttonsmodel.h
+++ b/libappletdecoration/buttonsmodel.h
@@ -21,8 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef KDECOARTIONS_PREVIEW_BUTTONS_MODEL_H
-#define KDECOARTIONS_PREVIEW_BUTTONS_MODEL_H
+#pragma once
#include <KDecoration2/DecorationButton>
#include <QAbstractListModel>
@@ -61,6 +60,3 @@ private:
}
}
-
-#endif
-
diff --git a/libappletdecoration/config-decoration.h.cmake b/libappletdecoration/config-decoration.h.cmake
index 3d90693..ef06ca8 100644
--- a/libappletdecoration/config-decoration.h.cmake
+++ b/libappletdecoration/config-decoration.h.cmake
@@ -1,6 +1,3 @@
-#ifndef CONFIG_DECORATION_H
-#define CONFIG_DECORATION_H
+#pragma once
#cmakedefine KDECORATION2_VERSION_MINOR @KDECORATION2_VERSION_MINOR@
-
-#endif // CONFIG_DECORATION_H
diff --git a/libappletdecoration/decorationpalette.cpp b/libappletdecoration/decorationpalette.cpp
index c96ebc7..06755c9 100644
--- a/libappletdecoration/decorationpalette.cpp
+++ b/libappletdecoration/decorationpalette.cpp
@@ -53,7 +53,7 @@ DecorationPalette::DecorationPalette(const QString &colorScheme)
connect(&m_watcher, &QFileSystemWatcher::fileChanged, [this]() {
m_watcher.addPath(m_colorScheme);
update();
- emit changed();
+ Q_EMIT changed();
});
update();
@@ -131,7 +131,7 @@ void DecorationPalette::update()
m_palette = KColorScheme::createApplicationPalette(config);
- m_activeFrameColor = wmConfig.readEntry("frame", m_palette.color(QPalette::Active, QPalette::Background));
+ m_activeFrameColor = wmConfig.readEntry("frame", m_palette.color(QPalette::Active, QPalette::Window));
m_inactiveFrameColor = wmConfig.readEntry("inactiveFrame", m_activeFrameColor);
m_activeTitleBarColor = wmConfig.readEntry("activeBackground", m_palette.color(QPalette::Active, QPalette::Highlight));
m_inactiveTitleBarColor = wmConfig.readEntry("inactiveBackground", m_inactiveFrameColor);
diff --git a/libappletdecoration/decorationpalette.h b/libappletdecoration/decorationpalette.h
index b4f8b4f..536f113 100644
--- a/libappletdecoration/decorationpalette.h
+++ b/libappletdecoration/decorationpalette.h
@@ -20,8 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
-#ifndef KWIN_DECORATION_PALETTE_H
-#define KWIN_DECORATION_PALETTE_H
+#pragma once
#include <KDecoration2/DecorationSettings>
#include <QFileSystemWatcher>
@@ -64,5 +63,3 @@ private:
}
}
-
-#endif
diff --git a/libappletdecoration/decorationsmodel.cpp b/libappletdecoration/decorationsmodel.cpp
index a19f65e..c7d1a4b 100644
--- a/libappletdecoration/decorationsmodel.cpp
+++ b/libappletdecoration/decorationsmodel.cpp
@@ -27,11 +27,9 @@
#include <KDecoration2/DecorationSettings>
#include <KDecoration2/DecorationThemeProvider>
// KDE
+#include <KConfigGroup>
#include <KDirWatch>
-#include <KPluginInfo>
-#include <KPluginLoader>
#include <KPluginFactory>
-#include <KPluginTrader>
#include <KSharedConfig>
// Qt
#include <QDebug>
@@ -82,7 +80,7 @@ void DecorationsModel::setCurrentPlugin(QString plugin)
}
m_currentPlugin = plugin;
- emit currentPluginChanged();
+ Q_EMIT currentPluginChanged();
}
QString DecorationsModel::currentTheme() const
@@ -97,7 +95,7 @@ void DecorationsModel::setCurrentTheme(QString theme)
}
m_currentTheme = theme;
- emit currentThemeChanged();
+ Q_EMIT currentThemeChanged();
}
int DecorationsModel::rowCount(const QModelIndex &parent) const
diff --git a/libappletdecoration/decorationsmodel.h b/libappletdecoration/decorationsmodel.h
index 10a8edd..47ce4ff 100644
--- a/libappletdecoration/decorationsmodel.h
+++ b/libappletdecoration/decorationsmodel.h
@@ -21,8 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef DECORATIONSMODEL_H
-#define DECORATIONSMODEL_H
+#pragma once
#include <QAbstractListModel>
@@ -59,12 +58,12 @@ public Q_SLOTS:
Q_INVOKABLE bool decorationExists(const QString &plugin, const QString &theme);
Q_INVOKABLE bool isAurorae(const QString &plugin, const QString &theme);
-signals:
+Q_SIGNALS:
void countChanged();
void currentThemeChanged();
void currentPluginChanged();
-private slots:
+private Q_SLOTS:
void init();
void loadCurrents();
void kwinChanged(const QString &filename);
@@ -94,5 +93,3 @@ private:
}
}
-
-#endif
diff --git a/libappletdecoration/environment.cpp b/libappletdecoration/environment.cpp
index 982705c..a686b46 100644
--- a/libappletdecoration/environment.cpp
+++ b/libappletdecoration/environment.cpp
@@ -24,7 +24,7 @@
#include <QProcess>
// Plasma
-#include <plasma/version.h>
+#include <KF5/Plasma/plasma_version.h>
namespace Decoration {
namespace Applet {
@@ -41,7 +41,7 @@ Environment::~Environment()
uint Environment::frameworksVersion() const
{
- return Plasma::version();
+ return PLASMA_VERSION;
}
uint Environment::plasmaDesktopVersion()
diff --git a/libappletdecoration/environment.h b/libappletdecoration/environment.h
index b7cc15f..6a6eeb7 100644
--- a/libappletdecoration/environment.h
+++ b/libappletdecoration/environment.h
@@ -17,8 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef ENVIRONMENT_H
-#define ENVIRONMENT_H
+#pragma once
// Qt
#include <QObject>
@@ -52,10 +51,10 @@ public:
return new Environment;
}
-public slots:
+public Q_SLOTS:
Q_INVOKABLE uint makeVersion(uint major, uint minor, uint release) const;
-signals:
+Q_SIGNALS:
void frameworksVersionChanged();
void plasmaDesktopVersionChanged();
@@ -72,5 +71,3 @@ private:
}
}
-
-#endif // ENVIRONMENT_H
diff --git a/libappletdecoration/padding.cpp b/libappletdecoration/padding.cpp
index 96eb314..efeaf26 100644
--- a/libappletdecoration/padding.cpp
+++ b/libappletdecoration/padding.cpp
@@ -46,7 +46,7 @@ void Padding::setTop(int top)
}
m_top = top;
- emit topChanged();
+ Q_EMIT topChanged();
}
int Padding::left() const
@@ -61,7 +61,7 @@ void Padding::setLeft(int left)
}
m_left = left;
- emit leftChanged();
+ Q_EMIT leftChanged();
}
int Padding::bottom()const
@@ -76,7 +76,7 @@ void Padding::setBottom(int bottom)
}
m_bottom = bottom;
- emit bottomChanged();
+ Q_EMIT bottomChanged();
}
int Padding::right() const
@@ -91,7 +91,7 @@ void Padding::setRight(int right)
}
m_right = right;
- emit rightChanged();
+ Q_EMIT rightChanged();
}
}
diff --git a/libappletdecoration/padding.h b/libappletdecoration/padding.h
index a574700..670c295 100644
--- a/libappletdecoration/padding.h
+++ b/libappletdecoration/padding.h
@@ -20,8 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef PADDING_H
-#define PADDING_H
+#pragma once
#include <QObject>
@@ -53,7 +52,7 @@ public:
int right() const;
void setRight(int right);
-signals:
+Q_SIGNALS:
void topChanged();
void leftChanged();
void bottomChanged();
@@ -68,5 +67,3 @@ private:
}
}
-
-#endif
diff --git a/libappletdecoration/previewbridge.cpp b/libappletdecoration/previewbridge.cpp
index 27a29ea..df19eeb 100644
--- a/libappletdecoration/previewbridge.cpp
+++ b/libappletdecoration/previewbridge.cpp
@@ -30,11 +30,9 @@
#include <KDecoration2/DecoratedClient>
#include <KDecoration2/Decoration>
-#include <KCModule>
#include <KDirWatch>
-#include <KPluginLoader>
#include <KPluginFactory>
-#include <KPluginTrader>
+#include <KPluginMetaData>
#include <QDebug>
#include <QDBusConnection>
@@ -74,14 +72,14 @@ std::unique_ptr<KDecoration2::DecoratedClientPrivate> PreviewBridge::createClien
{
auto ptr = std::unique_ptr<PreviewClient>(new PreviewClient(client, decoration));
m_lastCreatedClient = ptr.get();
- return std::move(ptr);
+ return ptr;
}
std::unique_ptr<KDecoration2::DecorationSettingsPrivate> PreviewBridge::settings(KDecoration2::DecorationSettings *parent)
{
auto ptr = std::unique_ptr<PreviewSettings>(new PreviewSettings(parent));
m_lastCreatedSettings = ptr.get();
- return std::move(ptr);
+ return ptr;
}
void PreviewBridge::registerButton(PreviewButtonItem *button)
@@ -102,7 +100,7 @@ void PreviewBridge::setPlugin(const QString &plugin)
m_plugin = plugin;
qDebug() << "Plugin changed to: " << m_plugin;
- emit pluginChanged();
+ Q_EMIT pluginChanged();
}
QString PreviewBridge::theme() const
@@ -117,7 +115,7 @@ void PreviewBridge::setTheme(const QString &theme)
}
m_theme = theme;
- emit themeChanged();
+ Q_EMIT themeChanged();
}
QString PreviewBridge::plugin() const
@@ -135,9 +133,11 @@ void PreviewBridge::createFactory()
return;
}
- const auto offers = KPluginTrader::self()->query(s_pluginName,
- s_pluginName,
- QStringLiteral("[X-KDE-PluginInfo-Name] == '%1'").arg(m_plugin));
+ //const auto offers = KPluginMetaData::findPlugins(s_pluginName);
+ const auto offers = KPluginMetaData::findPlugins(s_pluginName,
+ [this](const KPluginMetaData& md) {
+ return md.pluginId() == m_plugin;
+ });
if (offers.isEmpty()) {
setValid(false);
@@ -145,8 +145,9 @@ void PreviewBridge::createFactory()
return;
}
- KPluginLoader loader(offers.first().libraryPath());
- m_factory = loader.factory();
+ //m_factory = KPluginLoader(offers.first().fileName()).factory();
+ const KPluginMetaData& data = offers.first();
+ m_factory = KPluginFactory::loadFactory(data).plugin;
qDebug() << "Factory: " << !m_factory.isNull();
setValid(!m_factory.isNull());
reconfigure();
@@ -164,7 +165,7 @@ void PreviewBridge::setValid(bool valid)
}
m_valid = valid;
- emit validChanged();
+ Q_EMIT validChanged();
}
KDecoration2::Decoration *PreviewBridge::createDecoration(QObject *parent)
@@ -188,17 +189,7 @@ KDecoration2::DecorationButton *PreviewBridge::createButton(KDecoration2::Decora
return nullptr;
}
- auto button = m_factory->create<KDecoration2::DecorationButton>(parent, QVariantList({QVariant::fromValue(type), QVariant::fromValue(decoration)}));
-
- if (!button) {
- //! support decorations that have not been updated yet to KWin 5.23 decoration plugin approach
- button = m_factory->create<KDecoration2::DecorationButton>(QStringLiteral("button"), parent, QVariantList({QVariant::fromValue(type), QVariant::fromValue(decoration)}));
- if (button) {
- qWarning() << "Loading a KDecoration2::DecorationButton using the button keyword is deprecated in KWin 5.23, register the plugin without a keyword instead" << m_plugin;
- }
- }
-
- return button;
+ return m_factory->create<KDecoration2::DecorationButton>(parent, QVariantList({QVariant::fromValue(type), QVariant::fromValue(decoration)}));
}
void PreviewBridge::settingsFileChanged(const QString &filename)
@@ -213,7 +204,7 @@ void PreviewBridge::settingsFileChanged(const QString &filename)
void PreviewBridge::reconfigure()
{
if (m_lastCreatedSettings) {
- emit m_lastCreatedSettings->decorationSettings()->reconfigured();
+ Q_EMIT m_lastCreatedSettings->decorationSettings()->reconfigured();
}
}
diff --git a/libappletdecoration/previewbridge.h b/libappletdecoration/previewbridge.h
index e6abda5..edc1a3e 100644
--- a/libappletdecoration/previewbridge.h
+++ b/libappletdecoration/previewbridge.h
@@ -21,8 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef KDECORATIONS_PREVIEW_BRIDGE_H
-#define KDECORATIONS_PREVIEW_BRIDGE_H
+#pragma once
#include <KDecoration2/Private/DecorationBridge>
#include <KDecoration2/DecorationButton>
@@ -79,7 +78,7 @@ Q_SIGNALS:
void themeChanged();
void validChanged();
-private slots:
+private Q_SLOTS:
void settingsFileChanged(const QString &filename);
private:
@@ -140,5 +139,3 @@ private:
}
Q_DECLARE_METATYPE(Decoration::Applet::PreviewBridge *)
-
-#endif
diff --git a/libappletdecoration/previewbutton.cpp b/libappletdecoration/previewbutton.cpp
index 0b785ae..b48edeb 100644
--- a/libappletdecoration/previewbutton.cpp
+++ b/libappletdecoration/previewbutton.cpp
@@ -97,7 +97,7 @@ void PreviewButtonItem::setIsActive(bool active)
m_client->setActive(m_isActive);
}
- emit isActiveChanged();
+ Q_EMIT isActiveChanged();
}
bool PreviewButtonItem::isMaximized() const
@@ -124,7 +124,7 @@ void PreviewButtonItem::setIsMaximized(bool maximized)
}
}
- emit isMaximizedChanged();
+ Q_EMIT isMaximizedChanged();
}
bool PreviewButtonItem::isOnAllDesktops() const
@@ -148,7 +148,7 @@ void PreviewButtonItem::setIsOnAllDesktops(bool onalldesktops)
}
}
- emit isOnAllDesktopsChanged();
+ Q_EMIT isOnAllDesktopsChanged();
}
bool PreviewButtonItem::isKeepAbove() const
@@ -172,7 +172,7 @@ void PreviewButtonItem::setIsKeepAbove(bool keepabove)
}
}
- emit isKeepAboveChanged();
+ Q_EMIT isKeepAboveChanged();
}
KDecoration2::DecorationButtonType PreviewButtonItem::type() const
@@ -197,7 +197,7 @@ void PreviewButtonItem::setType(KDecoration2::DecorationButtonType type)
}
m_type = type;
- emit typeChanged();
+ Q_EMIT typeChanged();
}
QString PreviewButtonItem::scheme() const
@@ -218,7 +218,7 @@ void PreviewButtonItem::setScheme(QString scheme)
qDebug() << "buttons scheme update to:" << m_scheme;
}
- emit schemeChanged();
+ Q_EMIT schemeChanged();
}
PreviewBridge *PreviewButtonItem::bridge() const
@@ -242,7 +242,7 @@ void PreviewButtonItem::setBridge(PreviewBridge *bridge)
m_bridge->registerButton(this);
}
- emit bridgeChanged();
+ Q_EMIT bridgeChanged();
}
int PreviewButtonItem::typeAsInt() const
@@ -263,7 +263,7 @@ void PreviewButtonItem::setLocalX(int x)
m_localX = x;
- emit localXChanged();
+ Q_EMIT localXChanged();
}
int PreviewButtonItem::localY() const
@@ -279,7 +279,7 @@ void PreviewButtonItem::setLocalY(int y)
m_localY = y;
- emit localYChanged();
+ Q_EMIT localYChanged();
}
KDecoration2::Decoration *PreviewButtonItem::decoration() const
@@ -306,7 +306,7 @@ void PreviewButtonItem::setSharedDecoration(SharedDecoration *sharedDecoration)
connect(m_sharedDecoration, &Decoration::Applet::SharedDecoration::decorationChanged, this, &Decoration::Applet::PreviewButtonItem::createButton);
- emit sharedDecorationChanged();
+ Q_EMIT sharedDecorationChanged();
}
void PreviewButtonItem::componentComplete()
@@ -395,7 +395,7 @@ void PreviewButtonItem::syncInternalGeometry()
void PreviewButtonItem::onButtonDamaged()
{
if (m_sharedDecoration && m_sharedDecoration->decoration()) {
- emit m_sharedDecoration->decoration()->damaged(m_visualGeometry);
+ Q_EMIT m_sharedDecoration->decoration()->damaged(m_visualGeometry);
} else {
update();
}
@@ -464,7 +464,7 @@ void PreviewButtonItem::mouseReleaseEvent(QMouseEvent *event)
QCoreApplication::instance()->sendEvent(m_button, event);
if (inItem) {
- emit clicked();
+ Q_EMIT clicked();
}
}
diff --git a/libappletdecoration/previewbutton.h b/libappletdecoration/previewbutton.h
index 05b202e..d6f798b 100644
--- a/libappletdecoration/previewbutton.h
+++ b/libappletdecoration/previewbutton.h
@@ -21,8 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef KDECORATIONS_PREVIEW_BUTTON_ITEM_H
-#define KDECORATIONS_PREVIEW_BUTTON_ITEM_H
+#pragma once
#include <QMargins>
#include <QQuickPaintedItem>
@@ -81,7 +80,7 @@ public:
bool isOnAllDesktops() const;
void setIsOnAllDesktops(bool onalldesktops);
-
+
bool isKeepAbove() const;
void setIsKeepAbove(bool keepabove);
@@ -165,5 +164,3 @@ private:
} // namespace Applet
} // namespace Decoration
-
-#endif
diff --git a/libappletdecoration/previewclient.cpp b/libappletdecoration/previewclient.cpp
index 2cf184b..e34f8b6 100644
--- a/libappletdecoration/previewclient.cpp
+++ b/libappletdecoration/previewclient.cpp
@@ -86,27 +86,27 @@ PreviewClient::PreviewClient(KDecoration2::DecoratedClient *c, KDecoration2::Dec
// connect(this, &PreviewClient::, c, &DecoratedClient::);
connect(this, &PreviewClient::maximizedVerticallyChanged, this,
[this]() {
- emit maximizedChanged(isMaximized());
+ Q_EMIT maximizedChanged(isMaximized());
}
);
connect(this, &PreviewClient::maximizedHorizontallyChanged, this,
[this]() {
- emit maximizedChanged(isMaximized());
+ Q_EMIT maximizedChanged(isMaximized());
}
);
connect(this, &PreviewClient::iconNameChanged, this,
[this]() {
m_icon = QIcon::fromTheme(m_iconName);
- emit iconChanged(m_icon);
+ Q_EMIT iconChanged(m_icon);
}
);
connect(this, &PreviewClient::desktopChanged, this,
[this](int) {
- emit onAllDesktopsChanged(isOnAllDesktops());
+ Q_EMIT onAllDesktopsChanged(isOnAllDesktops());
}
);
/* connect(m_palette, &KWin::Decoration::DecorationPalette::changed, [this]() {
- emit paletteChanged(m_palette->palette());
+ Q_EMIT paletteChanged(m_palette->palette());
});*/
auto emitEdgesChanged = [this, c]() {
c->adjacentScreenEdgesChanged(adjacentScreenEdges());
@@ -126,7 +126,7 @@ PreviewClient::~PreviewClient() = default;
void PreviewClient::setIcon(const QIcon &pixmap)
{
m_icon = pixmap;
- emit iconChanged(m_icon);
+ Q_EMIT iconChanged(m_icon);
}
int PreviewClient::width() const
@@ -165,7 +165,7 @@ void PreviewClient::setDesktop(int desktop)
}
m_desktop = desktop;
- emit desktopChanged(m_desktop);
+ Q_EMIT desktopChanged(m_desktop);
}
QIcon PreviewClient::icon() const
@@ -263,6 +263,11 @@ WId PreviewClient::windowId() const
return 0;
}
+QString PreviewClient::windowClass() const
+{
+ return QString("kwin_preview");
+}
+
QPalette PreviewClient::palette() const
{
return m_palette->palette();
@@ -287,7 +292,7 @@ void PreviewClient::setColorScheme(QString scheme)
m_palette = new Decoration::Applet::DecorationPalette(scheme);
- emit paletteChanged(m_palette->palette());
+ Q_EMIT paletteChanged(m_palette->palette());
}
Qt::Edges PreviewClient::adjacentScreenEdges() const
@@ -350,7 +355,7 @@ void PreviewClient::setBordersBottomEdge(bool enabled)
}
m_bordersBottomEdge = enabled;
- emit bordersBottomEdgeChanged(enabled);
+ Q_EMIT bordersBottomEdgeChanged(enabled);
}
void PreviewClient::setBordersLeftEdge(bool enabled)
@@ -360,7 +365,7 @@ void PreviewClient::setBordersLeftEdge(bool enabled)
}
m_bordersLeftEdge = enabled;
- emit bordersLeftEdgeChanged(enabled);
+ Q_EMIT bordersLeftEdgeChanged(enabled);
}
void PreviewClient::setBordersRightEdge(bool enabled)
@@ -370,7 +375,7 @@ void PreviewClient::setBordersRightEdge(bool enabled)
}
m_bordersRightEdge = enabled;
- emit bordersRightEdgeChanged(enabled);
+ Q_EMIT bordersRightEdgeChanged(enabled);
}
void PreviewClient::setBordersTopEdge(bool enabled)
@@ -380,7 +385,7 @@ void PreviewClient::setBordersTopEdge(bool enabled)
}
m_bordersTopEdge = enabled;
- emit bordersTopEdgeChanged(enabled);
+ Q_EMIT bordersTopEdgeChanged(enabled);
}
@@ -408,19 +413,19 @@ QSize PreviewClient::size() const
#if KDECORATION2_VERSION_MINOR <= 20
void PreviewClient::requestShowWindowMenu()
{
- emit showWindowMenuRequested();
+ Q_EMIT showWindowMenuRequested();
}
#else
-void PreviewClient::requestShowWindowMenu(const QRect &rect)
+void PreviewClient::requestShowWindowMenu(const QRect &/*rect*/)
{
- emit showWindowMenuRequested();
+ Q_EMIT showWindowMenuRequested();
}
#endif
void PreviewClient::requestClose()
{
- emit closeRequested();
+ Q_EMIT closeRequested();
}
void PreviewClient::requestContextHelp()
@@ -443,7 +448,7 @@ void PreviewClient::requestToggleMaximization(Qt::MouseButtons buttons)
void PreviewClient::requestMinimize()
{
- emit minimizeRequested();
+ Q_EMIT minimizeRequested();
}
void PreviewClient::requestToggleKeepAbove()
@@ -484,7 +489,7 @@ void PreviewClient::requestToggleShade()
return; \
} \
m_##variable = variable; \
- emit variable##Changed(m_##variable); \
+ Q_EMIT variable##Changed(m_##variable); \
}
#define SETTER2(name, variable) SETTER(bool, name, variable)
diff --git a/libappletdecoration/previewclient.h b/libappletdecoration/previewclient.h
index c479acc..a0071f4 100644
--- a/libappletdecoration/previewclient.h
+++ b/libappletdecoration/previewclient.h
@@ -21,8 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef KDECORATIONS_PREVIEW_CLIENT_H
-#define KDECORATIONS_PREVIEW_CLIENT_H
+#pragma once
#include "decorationpalette.h"
@@ -74,6 +73,7 @@ public:
QString caption() const override;
WId decorationId() const override;
WId windowId() const override;
+ QString windowClass() const override;
int desktop() const override;
QIcon icon() const override;
bool isActive() const override;
@@ -229,5 +229,3 @@ private:
} // namespace Applet
} // namespace Decoration
-
-#endif
diff --git a/libappletdecoration/previewsettings.cpp b/libappletdecoration/previewsettings.cpp
index c0d31a7..1b4f05f 100644
--- a/libappletdecoration/previewsettings.cpp
+++ b/libappletdecoration/previewsettings.cpp
@@ -155,7 +155,7 @@ void PreviewSettings::setAlphaChannelSupported(bool supported)
}
m_alphaChannelSupported = supported;
- emit alphaChannelSupportedChanged(m_alphaChannelSupported);
+ Q_EMIT alphaChannelSupportedChanged(m_alphaChannelSupported);
}
void PreviewSettings::setOnAllDesktopsAvailable(bool available)
@@ -165,7 +165,7 @@ void PreviewSettings::setOnAllDesktopsAvailable(bool available)
}
m_onAllDesktopsAvailable = available;
- emit onAllDesktopsAvailableChanged(m_onAllDesktopsAvailable);
+ Q_EMIT onAllDesktopsAvailableChanged(m_onAllDesktopsAvailable);
}
void PreviewSettings::setCloseOnDoubleClickOnMenu(bool enabled)
@@ -175,7 +175,7 @@ void PreviewSettings::setCloseOnDoubleClickOnMenu(bool enabled)
}
m_closeOnDoubleClick = enabled;
- emit closeOnDoubleClickOnMenuChanged(enabled);
+ Q_EMIT closeOnDoubleClickOnMenuChanged(enabled);
}
QVector< KDecoration2::DecorationButtonType > PreviewSettings::decorationButtonsLeft() const
@@ -217,8 +217,8 @@ void PreviewSettings::setBorderSizesIndex(int index)
}
m_borderSize = index;
- emit borderSizesIndexChanged(index);
- emit decorationSettings()->borderSizeChanged(borderSize());
+ Q_EMIT borderSizesIndexChanged(index);
+ Q_EMIT decorationSettings()->borderSizeChanged(borderSize());
}
KDecoration2::BorderSize PreviewSettings::borderSize() const
@@ -233,7 +233,7 @@ void PreviewSettings::setFont(const QFont &font)
}
m_font = font;
- emit fontChanged(m_font);
+ Q_EMIT fontChanged(m_font);
}
Settings::Settings(QObject *parent)
@@ -251,7 +251,7 @@ void Settings::setBridge(PreviewBridge *bridge)
}
m_bridge = bridge;
- emit bridgeChanged();
+ Q_EMIT bridgeChanged();
}
PreviewBridge *Settings::bridge() const
@@ -270,7 +270,7 @@ void Settings::createSettings()
connect(this, &Settings::borderSizesIndexChanged, m_previewSettings, &PreviewSettings::setBorderSizesIndex);
}
- emit settingsChanged();
+ Q_EMIT settingsChanged();
}
QSharedPointer<KDecoration2::DecorationSettings> Settings::settings() const
@@ -290,7 +290,7 @@ void Settings::setBorderSizesIndex(int index)
}
m_borderSize = index;
- emit borderSizesIndexChanged(m_borderSize);
+ Q_EMIT borderSizesIndexChanged(m_borderSize);
}
}
diff --git a/libappletdecoration/previewsettings.h b/libappletdecoration/previewsettings.h
index 87a86c0..0413bb9 100644
--- a/libappletdecoration/previewsettings.h
+++ b/libappletdecoration/previewsettings.h
@@ -21,8 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef KDECOARTIONS_PREVIEW_SETTINGS_H
-#define KDECOARTIONS_PREVIEW_SETTINGS_H
+#pragma once
#include <KDecoration2/Private/DecorationSettingsPrivate>
#include <KDecoration2/DecorationSettings>
@@ -165,5 +164,3 @@ private:
}
}
-
-#endif
diff --git a/libappletdecoration/previewshareddecoration.cpp b/libappletdecoration/previewshareddecoration.cpp
index 25a3bc2..9f60562 100644
--- a/libappletdecoration/previewshareddecoration.cpp
+++ b/libappletdecoration/previewshareddecoration.cpp
@@ -61,7 +61,7 @@ void SharedDecoration::setBridge(PreviewBridge *bridge)
connect(m_bridge, &Decoration::Applet::PreviewBridge::validChanged, this, &Decoration::Applet::SharedDecoration::createDecoration);
- emit bridgeChanged();
+ Q_EMIT bridgeChanged();
}
KDecoration2::Decoration *SharedDecoration::decoration() const
@@ -84,7 +84,7 @@ void SharedDecoration::setSettings(Settings *settings)
createDecoration();
- emit settingsChanged();
+ Q_EMIT settingsChanged();
}
void SharedDecoration::applySettings()
@@ -122,7 +122,7 @@ void SharedDecoration::createDecoration()
m_lastPlugin = m_bridge->plugin();
m_lastTheme = m_bridge->theme();
- emit decorationChanged();
+ Q_EMIT decorationChanged();
}
void SharedDecoration::initDecoration()
diff --git a/libappletdecoration/previewshareddecoration.h b/libappletdecoration/previewshareddecoration.h
index be5c9bd..a11fda0 100644
--- a/libappletdecoration/previewshareddecoration.h
+++ b/libappletdecoration/previewshareddecoration.h
@@ -20,8 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef PREVIEWSHAREDDECORATION_H
-#define PREVIEWSHAREDDECORATION_H
+#pragma once
#include <QObject>
@@ -81,5 +80,3 @@ private:
}
}
-
-#endif
diff --git a/libappletdecoration/schemecolors.cpp b/libappletdecoration/schemecolors.cpp
index f0f263e..4314767 100644
--- a/libappletdecoration/schemecolors.cpp
+++ b/libappletdecoration/schemecolors.cpp
@@ -145,7 +145,7 @@ void SchemeColors::setSchemeFile(QString file)
}
m_schemeFile = file;
- emit schemeFileChanged();
+ Q_EMIT schemeFileChanged();
}
QString SchemeColors::possibleSchemeFile(QString scheme)
@@ -237,7 +237,7 @@ void SchemeColors::updateScheme()
m_buttonHoverColor = buttonGroup.readEntry("DecorationHover", QColor());
m_buttonFocusColor = buttonGroup.readEntry("DecorationFocus", QColor());
- emit colorsChanged();
+ Q_EMIT colorsChanged();
}
}
diff --git a/libappletdecoration/schemecolors.h b/libappletdecoration/schemecolors.h
index b01e573..b46f742 100644
--- a/libappletdecoration/schemecolors.h
+++ b/libappletdecoration/schemecolors.h
@@ -18,8 +18,7 @@
*
*/
-#ifndef SCHEMECOLORS_H
-#define SCHEMECOLORS_H
+#pragma once
#include <QObject>
#include <QColor>
@@ -75,11 +74,11 @@ public:
static QString possibleSchemeFile(QString scheme);
static QString schemeName(QString originalFile);
-signals:
+Q_SIGNALS:
void colorsChanged();
void schemeFileChanged();
-public slots:
+public Q_SLOTS:
void updateScheme();
private:
@@ -108,5 +107,3 @@ private:
}
}
-
-#endif
diff --git a/libappletdecoration/schemesmodel.h b/libappletdecoration/schemesmodel.h
index 3050cd1..fbe23b5 100644
--- a/libappletdecoration/schemesmodel.h
+++ b/libappletdecoration/schemesmodel.h
@@ -18,8 +18,7 @@
*
*/
-#ifndef SCHEMESMODEL_H
-#define SCHEMESMODEL_H
+#pragma once
#include <QAbstractListModel>
@@ -44,7 +43,7 @@ public:
Q_INVOKABLE QColor backgroundOf(const int &index) const;
Q_INVOKABLE QString defaultSchemeFile() const;
-private slots:
+private Q_SLOTS:
void initSchemes();
private:
@@ -57,5 +56,3 @@ private:
}
}
-
-#endif
diff --git a/libappletdecoration/themeextended.cpp b/libappletdecoration/themeextended.cpp
index b2b1587..fd5efc8 100644
--- a/libappletdecoration/themeextended.cpp
+++ b/libappletdecoration/themeextended.cpp
@@ -74,7 +74,7 @@ void ExtendedTheme::setOriginalSchemeFile(const QString &file)
updateDefaultScheme();
- emit themeChanged();
+ Q_EMIT themeChanged();
}
//! WM records need to be updated based on the colors that
@@ -96,14 +96,14 @@ void ExtendedTheme::updateDefaultScheme()
if (m_colorsScheme) {
disconnect(m_colorsScheme, &SchemeColors::colorsChanged, this, &ExtendedTheme::themeChanged);
m_colorsScheme->deleteLater();
- }
+ }
m_colorsScheme = new SchemeColors(this, m_colorsSchemePath, true);
connect(m_colorsScheme, &SchemeColors::colorsChanged, this, &ExtendedTheme::themeChanged);
qDebug() << "Window Buttons : plasma theme default colors ::: " << m_colorsSchemePath;
- emit colorsChanged();
+ Q_EMIT colorsChanged();
}
void ExtendedTheme::updateDefaultSchemeValues()
diff --git a/libappletdecoration/themeextended.h b/libappletdecoration/themeextended.h
index 280fde7..23ae8f6 100644
--- a/libappletdecoration/themeextended.h
+++ b/libappletdecoration/themeextended.h
@@ -18,8 +18,7 @@
*
*/
-#ifndef PLASMAEXTENDEDTHEME_H
-#define PLASMAEXTENDEDTHEME_H
+#pragma once
// C++
#include <array>
@@ -58,7 +57,7 @@ public:
void load();
-signals:
+Q_SIGNALS:
void colorsChanged();
void themeChanged();
@@ -86,5 +85,3 @@ private:
}
}
-
-#endif
diff --git a/libappletdecoration/types.h b/libappletdecoration/types.h
index 254f3dc..7d2d58f 100644
--- a/libappletdecoration/types.h
+++ b/libappletdecoration/types.h
@@ -17,8 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef TYPES_H
-#define TYPES_H
+#pragma once
#include <QObject>
#include <QMetaEnum>
@@ -101,5 +100,3 @@ public:
}
}
-
-#endif
diff --git a/libappletdecoration/windowsystem.cpp b/libappletdecoration/windowsystem.cpp
index 05ecb28..19299d1 100644
--- a/libappletdecoration/windowsystem.cpp
+++ b/libappletdecoration/windowsystem.cpp
@@ -37,7 +37,9 @@ WindowSystem::~WindowSystem() = default;
bool WindowSystem::kwin_disabledMaximizedBorders() const
{
QProcess process;
- process.start("kreadconfig5 --file kwinrc --group Windows --key BorderlessMaximizedWindows");
+ QStringList arguments;
+ arguments << "--file" << "kwinrc" << "--group" << "Windows" << "--key" << "BorderlessMaximizedWindows";
+ process.start("kreadconfig5", arguments);
process.waitForFinished();
QString output(process.readAllStandardOutput());
@@ -55,8 +57,9 @@ void WindowSystem::setDisabledMaximizedBorders(bool disable)
QString disableText = disable ? "true" : "false";
QProcess process;
- QString commandStr = "kwriteconfig5 --file kwinrc --group Windows --key BorderlessMaximizedWindows --type bool " + disableText;
- process.start(commandStr);
+ QStringList arguments;
+ arguments << "--file" << "kwinrc" << "--group" << "Windows" << "--key" << "BorderlessMaximizedWindows" << "--type" << "bool" << disableText;
+ process.start("kwriteconfig5", arguments);
process.waitForFinished();
QDBusInterface iface("org.kde.KWin", "/KWin", "", QDBusConnection::sessionBus());
diff --git a/libappletdecoration/windowsystem.h b/libappletdecoration/windowsystem.h
index 881b6ea..ca7ad71 100644
--- a/libappletdecoration/windowsystem.h
+++ b/libappletdecoration/windowsystem.h
@@ -18,8 +18,7 @@
*
*/
-#ifndef WINDOWSYSTEM_H
-#define WINDOWSYSTEM_H
+#pragma once
#include <QObject>
@@ -42,6 +41,3 @@ private:
}
}
-
-#endif
-
diff --git a/package/metadata.desktop b/package/metadata.desktop
deleted file mode 100644
index ceea2c3..0000000
--- a/package/metadata.desktop
+++ /dev/null
@@ -1,21 +0,0 @@
-[Desktop Entry]
-Name=Window Buttons
-Comment=Window buttons for your panels
-
-Encoding=UTF-8
-Icon=focus-windows
-Keywords=window buttons
-Type=Service
-
-X-Plasma-API=declarativeappletscript
-X-Plasma-MainScript=ui/main.qml
-
-X-KDE-PluginInfo-Author=Michail Vourlakos
-X-KDE-PluginInfo-Category=Windows and Tasks
-X-KDE-PluginInfo-Email=mvourlakos@gmail.com
-X-KDE-PluginInfo-License=GPLv2
-X-KDE-PluginInfo-Name=org.kde.windowbuttons
-X-KDE-PluginInfo-Version=0.11.1
-X-KDE-PluginInfo-Website=https://github.com/psifidotos/applet-window-buttons
-X-KDE-ServiceTypes=Plasma/Applet
-
diff --git a/package/metadata.json b/package/metadata.json
new file mode 100644
index 0000000..a5da32a
--- /dev/null
+++ b/package/metadata.json
@@ -0,0 +1,24 @@
+{
+ "KPlugin": {
+ "Authors": [
+ {
+ "Email": "mvourlakos@gmail.com",
+ "Name": "Michail Vourlakos"
+ }
+ ],
+ "Category": "Windows and Tasks",
+ "Description": "Window buttons for your panels",
+ "Icon": "focus-windows",
+ "Id": "org.kde.windowbuttons",
+ "License": "GPLv2",
+ "Name": "Window Buttons",
+ "ServiceTypes": [
+ "Plasma/Applet"
+ ],
+ "Version": "0.11.1",
+ "Website": "https://github.com/psifidotos/applet-window-buttons"
+ },
+ "Keywords": "window buttons",
+ "X-Plasma-API": "declarativeappletscript",
+ "X-Plasma-MainScript": "ui/main.qml"
+}