diff --git a/autotests/kdeplatformtheme_unittest.cpp b/autotests/kdeplatformtheme_unittest.cpp index 8e51d79..6217ac1 100644 --- a/autotests/kdeplatformtheme_unittest.cpp +++ b/autotests/kdeplatformtheme_unittest.cpp @@ -1,340 +1,340 @@ /* This file is part of the KDE libraries * Copyright 2013 Alejandro Fiestas Olivares * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "kdeplatformtheme_config.h" #include "../src/platformtheme/kdeplatformtheme.h" #include "../src/platformtheme/khintssettings.h" #include #undef HAVE_X11 #define HAVE_X11 0 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static void prepareEnvironment() { QStandardPaths::setTestModeEnabled(true); QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); if(!QDir(configPath).mkpath(QStringLiteral("."))) { qFatal("Failed to create test configuration directory."); } configPath.append("/kdeglobals"); QFile::remove(configPath); if(!QFile::copy(CONFIGFILE, configPath)) { qFatal("Failed to copy kdeglobals required for tests."); } } Q_CONSTRUCTOR_FUNCTION(prepareEnvironment) class EventTest : public QObject { public: EventTest(QObject *tested, QEvent::Type type) : QObject(), gotEvent(false), m_type(type) { tested->installEventFilter(this); } - bool eventFilter(QObject *, QEvent *e) Q_DECL_OVERRIDE + bool eventFilter(QObject *, QEvent *e) override { if (e->type() == m_type) { gotEvent = true; } return false; } bool gotEvent; QEvent::Type m_type; }; class KdePlatformTheme_UnitTest : public QObject { Q_OBJECT public: KdePlatformTheme_UnitTest() {} private: void sendNotifyChange(KHintsSettings::ChangeType type, int arg = -1) { QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KGlobalSettings"), QStringLiteral("org.kde.KGlobalSettings"), QStringLiteral("notifyChange")); QList args; args.append(static_cast(type)); if (arg >= 0) { args.append(arg); } message.setArguments(args); QDBusConnection::sessionBus().send(message); } QEventLoop m_loop; QToolButton m_toolBtn; KdePlatformTheme *m_qpa; private Q_SLOTS: void initTestCase() { m_qpa = new KdePlatformTheme(); QDBusConnection::sessionBus().connect(QString(), QStringLiteral("/KGlobalSettings"), QStringLiteral("org.kde.KGlobalSettings"), QStringLiteral("notifyChange"), &m_loop, SLOT(quit())); } void cleanupTestCase() { QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); configPath.append("/kdeglobals"); QFile::remove(configPath); } void testPlatformHints() { QCOMPARE(qApp->cursorFlashTime(), 1042); QCOMPARE(qApp->doubleClickInterval(), 4343); QCOMPARE(qApp->startDragDistance(), 15); QCOMPARE(qApp->startDragTime(), 555); QCOMPARE(m_qpa->themeHint(QPlatformTheme::ToolButtonStyle).toInt(), (int) Qt::ToolButtonTextOnly); QCOMPARE(m_qpa->themeHint(QPlatformTheme::ToolBarIconSize).toInt(), 2); QCOMPARE(m_qpa->themeHint(QPlatformTheme::ItemViewActivateItemOnSingleClick).toBool(), false); QCOMPARE(m_qpa->themeHint(QPlatformTheme::SystemIconThemeName).toString(), QLatin1String("non-existent-icon-theme")); QCOMPARE(m_qpa->themeHint(QPlatformTheme::SystemIconFallbackThemeName).toString(), QLatin1String("hicolor")); QStringList iconThemeSearchPaths = m_qpa->themeHint(QPlatformTheme::IconThemeSearchPaths).toStringList(); foreach (const QString &iconPath, iconThemeSearchPaths) { QVERIFY( iconPath.endsWith(QLatin1String("/icons")) || iconPath.endsWith(QLatin1String("/.icons")) ); QVERIFY(QFile::exists(iconPath)); } // there must be *some* icons in XDG_DATA_DIRS, right? QVERIFY(!iconThemeSearchPaths.isEmpty()); QStringList styles; styles << QStringLiteral("non-existent-widget-style") << QStringLiteral(BREEZE_STYLE_NAME) << QStringLiteral("oxygen") << QStringLiteral("fusion") << QStringLiteral("windows"); QCOMPARE(m_qpa->themeHint(QPlatformTheme::StyleNames).toStringList(), styles); QCOMPARE(m_qpa->themeHint(QPlatformTheme::DialogButtonBoxLayout).toInt(), (int) QDialogButtonBox::KdeLayout); QCOMPARE(m_qpa->themeHint(QPlatformTheme::DialogButtonBoxButtonsHaveIcons).toBool(), false); QCOMPARE(m_qpa->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool(), true); QCOMPARE(m_qpa->themeHint(QPlatformTheme::KeyboardScheme).toInt(), (int) QPlatformTheme::KdeKeyboardScheme); QCOMPARE(m_qpa->themeHint(QPlatformTheme::UiEffects).toInt(), 0); QCOMPARE(m_qpa->themeHint(QPlatformTheme::IconPixmapSizes).value >(), QList() << 512 << 256 << 128 << 64 << 32 << 22 << 16 << 8); QCOMPARE(qApp->wheelScrollLines(), 1234); QCOMPARE(qApp->testAttribute(Qt::AA_DontShowIconsInMenus), false); } void testPlatformPalette() { const QPalette palette = qApp->palette(); QPalette::ColorGroup states[3] = {QPalette::Active, QPalette::Inactive, QPalette::Disabled}; QColor greenColor(QColor(0, 128, 0)); QBrush greenBrush(greenColor); for (int i = 0; i < 3; i++) { QCOMPARE(palette.brush(states[i], QPalette::ButtonText), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::WindowText), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::Window), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::Base), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::Text), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::Button), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::ButtonText), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::Highlight), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::HighlightedText), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::ToolTipBase), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::ToolTipText), greenBrush); //KColorScheme applies modifications and we can't disable them, so I extracted //the values and blindly compare them. QCOMPARE(palette.color(states[i], QPalette::Light).green(), 162); QCOMPARE(palette.color(states[i], QPalette::Midlight).green(), 144); QCOMPARE(palette.color(states[i], QPalette::Mid).green(), 109); QCOMPARE(palette.color(states[i], QPalette::Dark).green(), 62); QCOMPARE(palette.color(states[i], QPalette::Shadow).green(), 43); QCOMPARE(palette.brush(states[i], QPalette::AlternateBase), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::Link), greenBrush); QCOMPARE(palette.brush(states[i], QPalette::LinkVisited), greenBrush); } } void testPlatformIconEngine() { QIconEngine *engine = m_qpa->createIconEngine(QStringLiteral("test-icon")); QCOMPARE(engine->key(), QStringLiteral("KIconEngine")); } void testPlatformIconEngineTheme() { // The current theme should be what we defined. KdePlatformTheme().createIconEngine(QStringLiteral("test-icon")); QCOMPARE(KIconLoader::global()->theme()->current(), QStringLiteral("non-existent-icon-theme")); } void testPlatformIconChanges() { QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); configPath.append("/kdeglobals"); QFile::remove(configPath); QFile::copy(CHANGED_CONFIGFILE, configPath); QDBusConnection::sessionBus().connect(QString(), QStringLiteral("/KIconLoader"), QStringLiteral("org.kde.KIconLoader"), QStringLiteral("iconChanged"), &m_loop, SLOT(quit())); QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KIconLoader"), QStringLiteral("org.kde.KIconLoader"), QStringLiteral("iconChanged")); message.setArguments(QList() << int(KIconLoader::MainToolbar)); QDBusConnection::sessionBus().send(message); m_loop.exec(); QCOMPARE(m_qpa->themeHint(QPlatformTheme::ToolBarIconSize).toInt(), 11); } void testPlatformHintChanges() { EventTest tester(&m_toolBtn, QEvent::StyleChange); sendNotifyChange(KHintsSettings::SettingsChanged, KHintsSettings::SETTINGS_QT); m_loop.exec(); QCOMPARE(qApp->cursorFlashTime(), 1022); sendNotifyChange(KHintsSettings::SettingsChanged, KHintsSettings::SETTINGS_MOUSE); m_loop.exec(); QCOMPARE(m_qpa->themeHint(QPlatformTheme::ItemViewActivateItemOnSingleClick).toBool(), true); QCOMPARE(qApp->doubleClickInterval(), 401); QCOMPARE(qApp->startDragDistance(), 35); QCOMPARE(qApp->startDragTime(), 501); QCOMPARE(qApp->wheelScrollLines(), 122); QCOMPARE(qApp->testAttribute(Qt::AA_DontShowIconsInMenus), true); sendNotifyChange(KHintsSettings::ToolbarStyleChanged, 2); m_loop.exec(); QCOMPARE(m_qpa->themeHint(QPlatformTheme::ToolButtonStyle).toInt(), (int) Qt::ToolButtonTextUnderIcon); QCOMPARE(tester.gotEvent, true); sendNotifyChange(KHintsSettings::StyleChanged, 2); m_loop.exec(); QStringList styles; styles << QStringLiteral("another-non-existent-widget-style") << QStringLiteral(BREEZE_STYLE_NAME) << QStringLiteral("oxygen") << QStringLiteral("fusion") << QStringLiteral("windows"); QCOMPARE(m_qpa->themeHint(QPlatformTheme::StyleNames).toStringList(), styles); sendNotifyChange(KHintsSettings::SettingsChanged, KHintsSettings::SETTINGS_STYLE); m_loop.exec(); QCOMPARE(m_qpa->themeHint(QPlatformTheme::DialogButtonBoxButtonsHaveIcons).toBool(), true); sendNotifyChange(KHintsSettings::IconChanged, 4); m_loop.exec(); QCOMPARE(m_qpa->themeHint(QPlatformTheme::SystemIconThemeName).toString(), QLatin1String("other-non-existent")); } void testPlatformPaletteChanges() { EventTest tester(QGuiApplication::instance(), QEvent::ApplicationPaletteChange); sendNotifyChange(KHintsSettings::PaletteChanged, 0); m_loop.exec(); QCOMPARE(tester.gotEvent, true); const QPalette *palette = m_qpa->palette(); QPalette::ColorGroup states[3] = {QPalette::Active, QPalette::Inactive, QPalette::Disabled}; QColor redColor(QColor(174, 11, 11)); QBrush redBrush(redColor); for (int i = 0; i < 3; i++) { QCOMPARE(palette->brush(states[i], QPalette::ButtonText), redBrush); QCOMPARE(palette->brush(states[i], QPalette::WindowText), redBrush); QCOMPARE(palette->brush(states[i], QPalette::Window), redBrush); QCOMPARE(palette->brush(states[i], QPalette::Base), redBrush); QCOMPARE(palette->brush(states[i], QPalette::Text), redBrush); QCOMPARE(palette->brush(states[i], QPalette::Button), redBrush); QCOMPARE(palette->brush(states[i], QPalette::ButtonText), redBrush); QCOMPARE(palette->brush(states[i], QPalette::Highlight), redBrush); QCOMPARE(palette->brush(states[i], QPalette::HighlightedText), redBrush); QCOMPARE(palette->brush(states[i], QPalette::ToolTipBase), redBrush); QCOMPARE(palette->brush(states[i], QPalette::ToolTipText), redBrush); //KColorScheme applies modifications and we can't disable them, so I extracted //the values and blindly compare them. QCOMPARE(palette->color(states[i], QPalette::Light).red(), 230); QCOMPARE(palette->color(states[i], QPalette::Midlight).red(), 203); QCOMPARE(palette->color(states[i], QPalette::Mid).red(), 149); QCOMPARE(palette->color(states[i], QPalette::Dark).red(), 84); QCOMPARE(palette->color(states[i], QPalette::Shadow).red(), 60); QCOMPARE(palette->brush(states[i], QPalette::AlternateBase), redBrush); QCOMPARE(palette->brush(states[i], QPalette::Link), redBrush); QCOMPARE(palette->brush(states[i], QPalette::LinkVisited), redBrush); } } void dndWindowFlagsTest() { if (!QX11Info::isPlatformX11()) { QSKIP("This test requires xcb platform."); } QDrag *drag = new QDrag(this); QMimeData *data = new QMimeData; data->setData("Text/Plain", "drag data"); drag->setMimeData(data); bool succeeded = false; QTimer::singleShot(1000, [&succeeded] { auto windows = QGuiApplication::allWindows(); auto it = std::find_if(windows.constBegin(), windows.constEnd(), [] (QWindow *w) { return w->inherits("QShapedPixmapWindow"); }); if (it != windows.constEnd()) { KWindowInfo info((*it)->winId(), NET::WMWindowType); succeeded = info.windowType(NET::DNDIconMask) == NET::DNDIcon; } QTest::keyClick(windows.first(), Qt::Key_Escape); }); drag->exec(); QVERIFY(succeeded); } }; QTEST_MAIN(KdePlatformTheme_UnitTest) #include "kdeplatformtheme_unittest.moc" diff --git a/autotests/kfontsettingsdata_unittest.cpp b/autotests/kfontsettingsdata_unittest.cpp index 9f21ffe..a465045 100644 --- a/autotests/kfontsettingsdata_unittest.cpp +++ b/autotests/kfontsettingsdata_unittest.cpp @@ -1,121 +1,121 @@ /* This file is part of the KDE libraries * Copyright 2013 Alejandro Fiestas Olivares * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "kdeplatformtheme_config.h" #include "../src/platformtheme/kfontsettingsdata.h" #include #include #include #include #include #include #include #include #include #include #include #include static void prepareEnvironment() { qputenv("KDEHOME", QFile::encodeName(QDir::homePath() + QStringLiteral("/.kde5-unit-test-platformtheme"))); qputenv("XDG_DATA_HOME", QFile::encodeName(QDir::homePath() + QStringLiteral("/.kde5-unit-test-platformtheme/xdg/local"))); QByteArray configPath = QFile::encodeName(QDir::homePath() + QStringLiteral("/.kde5-unit-test-platformtheme/xdg/config")); qputenv("XDG_CONFIG_HOME", configPath); qputenv("KDE_SKIP_KDERC", "1"); qunsetenv("KDE_COLOR_DEBUG"); QDir().mkpath(configPath); configPath.append("/kdeglobals"); QFile::remove(configPath); QFile::copy(CONFIGFILE, configPath); } // Run prepareEnvironment before qApp is created! slightly incorrect, QFile::encodeName can be wrong then. // But we can't use Q_COREAPP_STARTUP_FUNCTION because the platform theme ends up being created // first, with the wrong environment. Q_CONSTRUCTOR_FUNCTION(prepareEnvironment); class KFontSettingsData_UnitTest : public QWidget { Q_OBJECT public: - bool event(QEvent *e) Q_DECL_OVERRIDE + bool event(QEvent *e) override { if (e->type() == QEvent::ApplicationFontChange) { m_appChangedFont = true; } return QWidget::event(e); } private: bool m_appChangedFont; KFontSettingsData *m_fonts; private Q_SLOTS: void initTestCase() { m_appChangedFont = false; m_fonts = new KFontSettingsData; qApp->processEvents(); // give time to delayed dbus connect } void testFonts() { QCOMPARE(m_fonts->font(KFontSettingsData::GeneralFont)->family(), QStringLiteral("OxyFontTest")); QCOMPARE(m_fonts->font(KFontSettingsData::FixedFont)->family(), QStringLiteral("OxyFixedTest Mono")); QCOMPARE(m_fonts->font(KFontSettingsData::ToolbarFont)->family(), QStringLiteral("OxyToolbarTest")); QCOMPARE(m_fonts->font(KFontSettingsData::MenuFont)->family(), QStringLiteral("OxyMenuTest")); QCOMPARE(m_fonts->font(KFontSettingsData::WindowTitleFont)->family(), QStringLiteral("OxyActiveTest")); QCOMPARE(m_fonts->font(KFontSettingsData::TaskbarFont)->family(), QStringLiteral("OxyTaskbarTest")); QCOMPARE(m_fonts->font(KFontSettingsData::SmallestReadableFont)->family(), QStringLiteral("OxySmallestReadableTest")); } void testFontsChanged() { QByteArray configPath = qgetenv("XDG_CONFIG_HOME"); configPath.append("/kdeglobals"); QFile::remove(configPath); QVERIFY(QFile::copy(CHANGED_CONFIGFILE, configPath)); QEventLoop loop; QDBusConnection::sessionBus().connect(QString(), QStringLiteral("/KDEPlatformTheme"), QStringLiteral("org.kde.KDEPlatformTheme"), QStringLiteral("refreshFonts"), &loop, SLOT(quit())); QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KDEPlatformTheme"), QStringLiteral("org.kde.KDEPlatformTheme"), QStringLiteral("refreshFonts")); QDBusConnection::sessionBus().send(message); loop.exec(); QVERIFY(m_appChangedFont); QCOMPARE(m_fonts->font(KFontSettingsData::GeneralFont)->family(), QStringLiteral("ChangedFontTest")); QCOMPARE(m_fonts->font(KFontSettingsData::FixedFont)->family(), QStringLiteral("ChangedFixedTest Mono")); QCOMPARE(m_fonts->font(KFontSettingsData::ToolbarFont)->family(), QStringLiteral("ChangedToolbarTest")); QCOMPARE(m_fonts->font(KFontSettingsData::MenuFont)->family(), QStringLiteral("ChangedMenuTest")); QCOMPARE(m_fonts->font(KFontSettingsData::WindowTitleFont)->family(), QStringLiteral("ChangedActiveTest")); QCOMPARE(m_fonts->font(KFontSettingsData::TaskbarFont)->family(), QStringLiteral("ChangedTaskbarTest")); QCOMPARE(m_fonts->font(KFontSettingsData::SmallestReadableFont)->family(), QStringLiteral("ChangedSmallestReadableTest")); } }; QTEST_MAIN(KFontSettingsData_UnitTest) #include "kfontsettingsdata_unittest.moc" diff --git a/src/platformtheme/kdeplatformfiledialogbase_p.h b/src/platformtheme/kdeplatformfiledialogbase_p.h index a7cbe74..487bdbb 100644 --- a/src/platformtheme/kdeplatformfiledialogbase_p.h +++ b/src/platformtheme/kdeplatformfiledialogbase_p.h @@ -1,63 +1,63 @@ /* This file is part of the KDE libraries * Copyright 2013 Aleix Pol Gonzalez * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KDEPLATFORMFILEDIALOGBASE_H #define KDEPLATFORMFILEDIALOGBASE_H #include #include #include class KFileWidget; class QDialogButtonBox; class KDEPlatformFileDialogBase : public QDialog { Q_OBJECT public: friend class KDEPlatformFileDialogHelper; explicit KDEPlatformFileDialogBase(); virtual QUrl directory() = 0; virtual void selectMimeTypeFilter(const QString &filter) = 0; virtual void selectNameFilter(const QString &filter) = 0; virtual void setDirectory(const QUrl &directory) = 0; virtual void selectFile(const QUrl &filename) = 0; virtual QString selectedMimeTypeFilter() = 0; virtual QString selectedNameFilter() = 0; virtual QList selectedFiles() = 0; void delayedShow(); void discardDelayedShow(); Q_SIGNALS: void closed(); void fileSelected(const QUrl &file); void filesSelected(const QList &files); void currentChanged(const QUrl &path); void directoryEntered(const QUrl &directory); void filterSelected(const QString &filter); protected: - void closeEvent(QCloseEvent *e) Q_DECL_OVERRIDE; + void closeEvent(QCloseEvent *e) override; QDialogButtonBox *m_buttons; QTimer m_timer; }; #endif diff --git a/src/platformtheme/kdeplatformfiledialoghelper.h b/src/platformtheme/kdeplatformfiledialoghelper.h index 3b8446d..24cf561 100644 --- a/src/platformtheme/kdeplatformfiledialoghelper.h +++ b/src/platformtheme/kdeplatformfiledialoghelper.h @@ -1,87 +1,87 @@ /* This file is part of the KDE libraries * Copyright 2013 Aleix Pol Gonzalez * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KDEPLATFORMFILEDIALOGHELPER_H #define KDEPLATFORMFILEDIALOGHELPER_H #include #include "kdeplatformfiledialogbase_p.h" class KFileWidget; class QDialogButtonBox; class KDEPlatformFileDialog : public KDEPlatformFileDialogBase { Q_OBJECT public: friend class KDEPlatformFileDialogHelper; explicit KDEPlatformFileDialog(); - QUrl directory() Q_DECL_OVERRIDE; - void selectMimeTypeFilter(const QString &filter) Q_DECL_OVERRIDE; - void selectNameFilter(const QString &filter) Q_DECL_OVERRIDE; - void setDirectory(const QUrl &directory) Q_DECL_OVERRIDE; - void selectFile(const QUrl &filename) Q_DECL_OVERRIDE; + QUrl directory() override; + void selectMimeTypeFilter(const QString &filter) override; + void selectNameFilter(const QString &filter) override; + void setDirectory(const QUrl &directory) override; + void selectFile(const QUrl &filename) override; void setViewMode(QFileDialogOptions::ViewMode view); void setFileMode(QFileDialogOptions::FileMode mode); void setCustomLabel(QFileDialogOptions::DialogLabel label, const QString & text); - QString selectedMimeTypeFilter() Q_DECL_OVERRIDE; - QString selectedNameFilter() Q_DECL_OVERRIDE; - QList selectedFiles() Q_DECL_OVERRIDE; + QString selectedMimeTypeFilter() override; + QString selectedNameFilter() override; + QList selectedFiles() override; protected: KFileWidget *m_fileWidget; }; class KDEPlatformFileDialogHelper : public QPlatformFileDialogHelper { Q_OBJECT public: KDEPlatformFileDialogHelper(); virtual ~KDEPlatformFileDialogHelper(); void initializeDialog(); - bool defaultNameFilterDisables() const Q_DECL_OVERRIDE; - QUrl directory() const Q_DECL_OVERRIDE; - QList selectedFiles() const Q_DECL_OVERRIDE; + bool defaultNameFilterDisables() const override; + QUrl directory() const override; + QList selectedFiles() const override; #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) - QString selectedMimeTypeFilter() const Q_DECL_OVERRIDE; - void selectMimeTypeFilter(const QString &filter) Q_DECL_OVERRIDE; + QString selectedMimeTypeFilter() const override; + void selectMimeTypeFilter(const QString &filter) override; #endif - QString selectedNameFilter() const Q_DECL_OVERRIDE; - void selectNameFilter(const QString &filter) Q_DECL_OVERRIDE; - void selectFile(const QUrl &filename) Q_DECL_OVERRIDE; - void setFilter() Q_DECL_OVERRIDE; - void setDirectory(const QUrl &directory) Q_DECL_OVERRIDE; - bool isSupportedUrl(const QUrl& url) const Q_DECL_OVERRIDE; + QString selectedNameFilter() const override; + void selectNameFilter(const QString &filter) override; + void selectFile(const QUrl &filename) override; + void setFilter() override; + void setDirectory(const QUrl &directory) override; + bool isSupportedUrl(const QUrl& url) const override; - void exec() Q_DECL_OVERRIDE; - void hide() Q_DECL_OVERRIDE; - bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) Q_DECL_OVERRIDE; + void exec() override; + void hide() override; + bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override; private Q_SLOTS: void saveSize(); private: void restoreSize(); KDEPlatformFileDialogBase *m_dialog; }; #endif // KDEPLATFORMFILEDIALOGHELPER_H diff --git a/src/platformtheme/kdeplatformsystemtrayicon.h b/src/platformtheme/kdeplatformsystemtrayicon.h index 6825b4d..c8a7b96 100644 --- a/src/platformtheme/kdeplatformsystemtrayicon.h +++ b/src/platformtheme/kdeplatformsystemtrayicon.h @@ -1,111 +1,111 @@ /* This file is part of the KDE libraries * Copyright 2014 Martin Gräßlin * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KDEPLATFORMSYSTEMTRAYICON_H #define KDEPLATFORMSYSTEMTRAYICON_H #include #include class KStatusNotifierItem; class SystemTrayMenuItem; class QAction; class QMenu; class SystemTrayMenu : public QPlatformMenu { Q_OBJECT public: SystemTrayMenu(); - ~SystemTrayMenu() Q_DECL_OVERRIDE; - void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) Q_DECL_OVERRIDE; - QPlatformMenuItem *menuItemAt(int position) const Q_DECL_OVERRIDE; - QPlatformMenuItem *menuItemForTag(quintptr tag) const Q_DECL_OVERRIDE; - void removeMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE; - void setEnabled(bool enabled) Q_DECL_OVERRIDE; - void setIcon(const QIcon &icon) Q_DECL_OVERRIDE; - void setTag(quintptr tag) Q_DECL_OVERRIDE; - void setText(const QString &text) Q_DECL_OVERRIDE; - void setVisible(bool visible) Q_DECL_OVERRIDE; - void syncMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE; - void syncSeparatorsCollapsible(bool enable) Q_DECL_OVERRIDE; - quintptr tag() const Q_DECL_OVERRIDE; - QPlatformMenuItem *createMenuItem() const Q_DECL_OVERRIDE; + ~SystemTrayMenu() override; + void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) override; + QPlatformMenuItem *menuItemAt(int position) const override; + QPlatformMenuItem *menuItemForTag(quintptr tag) const override; + void removeMenuItem(QPlatformMenuItem *menuItem) override; + void setEnabled(bool enabled) override; + void setIcon(const QIcon &icon) override; + void setTag(quintptr tag) override; + void setText(const QString &text) override; + void setVisible(bool visible) override; + void syncMenuItem(QPlatformMenuItem *menuItem) override; + void syncSeparatorsCollapsible(bool enable) override; + quintptr tag() const override; + QPlatformMenuItem *createMenuItem() const override; QMenu *menu() const; private: quintptr m_tag; QPointer m_menu; QList m_items; }; class SystemTrayMenuItem : public QPlatformMenuItem { Q_OBJECT public: SystemTrayMenuItem(); - ~SystemTrayMenuItem() Q_DECL_OVERRIDE; - void setCheckable(bool checkable) Q_DECL_OVERRIDE; - void setChecked(bool isChecked) Q_DECL_OVERRIDE; - void setEnabled(bool enabled) Q_DECL_OVERRIDE; - void setFont(const QFont &font) Q_DECL_OVERRIDE; - void setIcon(const QIcon &icon) Q_DECL_OVERRIDE; - void setIsSeparator(bool isSeparator) Q_DECL_OVERRIDE; - void setMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE; - void setRole(MenuRole role) Q_DECL_OVERRIDE; - void setShortcut(const QKeySequence &shortcut) Q_DECL_OVERRIDE; - void setTag(quintptr tag) Q_DECL_OVERRIDE; - void setText(const QString &text) Q_DECL_OVERRIDE; - void setVisible(bool isVisible) Q_DECL_OVERRIDE; - quintptr tag() const Q_DECL_OVERRIDE; - void setIconSize(int size) Q_DECL_OVERRIDE; + ~SystemTrayMenuItem() override; + void setCheckable(bool checkable) override; + void setChecked(bool isChecked) override; + void setEnabled(bool enabled) override; + void setFont(const QFont &font) override; + void setIcon(const QIcon &icon) override; + void setIsSeparator(bool isSeparator) override; + void setMenu(QPlatformMenu *menu) override; + void setRole(MenuRole role) override; + void setShortcut(const QKeySequence &shortcut) override; + void setTag(quintptr tag) override; + void setText(const QString &text) override; + void setVisible(bool isVisible) override; + quintptr tag() const override; + void setIconSize(int size) override; QAction *action() const; private: quintptr m_tag; QAction *m_action; }; class KDEPlatformSystemTrayIcon : public QPlatformSystemTrayIcon { public: KDEPlatformSystemTrayIcon(); - ~KDEPlatformSystemTrayIcon() Q_DECL_OVERRIDE; + ~KDEPlatformSystemTrayIcon() override; - void init() Q_DECL_OVERRIDE; - void cleanup() Q_DECL_OVERRIDE; - void updateIcon(const QIcon &icon) Q_DECL_OVERRIDE; - void updateToolTip(const QString &tooltip) Q_DECL_OVERRIDE; - void updateMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE; - QRect geometry() const Q_DECL_OVERRIDE; + void init() override; + void cleanup() override; + void updateIcon(const QIcon &icon) override; + void updateToolTip(const QString &tooltip) override; + void updateMenu(QPlatformMenu *menu) override; + QRect geometry() const override; void showMessage(const QString &title, const QString &msg, - const QIcon &icon, MessageIcon iconType, int secs) Q_DECL_OVERRIDE; + const QIcon &icon, MessageIcon iconType, int secs) override; - bool isSystemTrayAvailable() const Q_DECL_OVERRIDE; - bool supportsMessages() const Q_DECL_OVERRIDE; + bool isSystemTrayAvailable() const override; + bool supportsMessages() const override; - QPlatformMenu *createMenu() const Q_DECL_OVERRIDE; + QPlatformMenu *createMenu() const override; private: KStatusNotifierItem *m_sni; }; #endif diff --git a/src/platformtheme/kdeplatformtheme.h b/src/platformtheme/kdeplatformtheme.h index 74f97ff..356b9b2 100644 --- a/src/platformtheme/kdeplatformtheme.h +++ b/src/platformtheme/kdeplatformtheme.h @@ -1,84 +1,84 @@ /* This file is part of the KDE libraries * Copyright 2013 Kevin Ottens * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KDEPLATFORMTHEME_H #define KDEPLATFORMTHEME_H #include #include #include #include class KHintsSettings; class KFontSettingsData; class KWaylandIntegration; class X11Integration; class QIconEngine; class QWindow; class AltKeyEventListener; class KdePlatformTheme : public QPlatformTheme { public: KdePlatformTheme(); ~KdePlatformTheme(); - QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE; + QVariant themeHint(ThemeHint hint) const override; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions) const override; #else QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size, QPlatformTheme::IconOptions iconOptions) const override; // this will be the implementation QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions) const; #endif - const QPalette *palette(Palette type = SystemPalette) const Q_DECL_OVERRIDE; - const QFont *font(Font type) const Q_DECL_OVERRIDE; - QIconEngine *createIconEngine(const QString &iconName) const Q_DECL_OVERRIDE; - QList keyBindings(QKeySequence::StandardKey key) const Q_DECL_OVERRIDE; + const QPalette *palette(Palette type = SystemPalette) const override; + const QFont *font(Font type) const override; + QIconEngine *createIconEngine(const QString &iconName) const override; + QList keyBindings(QKeySequence::StandardKey key) const override; - QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const Q_DECL_OVERRIDE; - bool usePlatformNativeDialog(DialogType type) const Q_DECL_OVERRIDE; + QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override; + bool usePlatformNativeDialog(DialogType type) const override; - QString standardButtonText(int button) const Q_DECL_OVERRIDE; + QString standardButtonText(int button) const override; - QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE; + QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override; #if QT_VERSION >= QT_VERSION_CHECK(5,7,0) - QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE; + QPlatformMenuBar *createPlatformMenuBar() const override; #endif private: void loadSettings(); static void setWindowProperty(QWindow *window, const QByteArray &name, const QByteArray &value); KHintsSettings *m_hints; KFontSettingsData *m_fontsData; QScopedPointer m_kwaylandIntegration; QScopedPointer m_x11Integration; }; #endif // KDEPLATFORMTHEME_H diff --git a/src/platformtheme/kdirselectdialog_p.h b/src/platformtheme/kdirselectdialog_p.h index 89401e8..85bd86f 100644 --- a/src/platformtheme/kdirselectdialog_p.h +++ b/src/platformtheme/kdirselectdialog_p.h @@ -1,138 +1,138 @@ /* Copyright (C) 2001 Michael Jarrett Copyright (C) 2001 Carsten Pfeiffer Copyright (C) 2009 Shaun Reich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KDIRSELECTDIALOG_H #define KDIRSELECTDIALOG_H #include "kdeplatformfiledialogbase_p.h" #include class QAbstractItemView; /** * A pretty dialog for a KDirSelect control for selecting directories. * @author Michael Jarrett * @deprecated since 5.0, use QFileDialog::getExistingDirectoryUrl instead. */ class KDirSelectDialog : public KDEPlatformFileDialogBase { Q_OBJECT public: /** * Creates a new directory selection dialog. * @internal use the static selectDirectory function * @param startDir the directory, initially shown * @param localOnly unused. You can only select paths below the startDir * @param parent the parent for the dialog, usually 0L */ explicit KDirSelectDialog(const QUrl &startDir = QUrl(), bool localOnly = false, QWidget *parent = 0L); /** * Destroys the directory selection dialog. */ ~KDirSelectDialog(); /** * Returns the currently selected URL, or an empty one if no item is selected. * * If the URL entered in the combobox is valid and exists, it is returned. * Otherwise, the URL selected in the treeview is returned instead. */ QUrl url() const; /** * Returns the root url */ QUrl rootUrl() const; /** * Returns a pointer to the view which is used for displaying the directories. */ QAbstractItemView *view() const; /** * Returns whether only local directories can be selected. */ bool localOnly() const; /** * Creates a KDirSelectDialog, and returns the result. * @param startDir the directory, initially shown * The tree will display this directory and subdirectories of it. * @param localOnly unused. You can only select paths below the startDir * @param parent the parent widget to use for the dialog, or NULL to create a parent-less dialog * @param caption the caption to use for the dialog, or QString() for the default caption * @return The URL selected, or an empty URL if the user canceled * or no URL was selected. * * @deprecated since 5.0, use QFileDialog::getExistingDirectory (if localOnly was true) * or QFileDialog::getExistingDirectoryUrl (if localOnly was false) instead. */ static QUrl selectDirectory(const QUrl &startDir = QUrl(), bool localOnly = false, QWidget *parent = 0L, const QString &caption = QString()); /** * @return The path for the root node */ QUrl startDir() const; - QUrl directory() Q_DECL_OVERRIDE; - void selectMimeTypeFilter(const QString &filter) Q_DECL_OVERRIDE; - void selectNameFilter(const QString &filter) Q_DECL_OVERRIDE; - void setDirectory(const QUrl &directory) Q_DECL_OVERRIDE; - void selectFile(const QUrl &filename) Q_DECL_OVERRIDE; - QString selectedMimeTypeFilter() Q_DECL_OVERRIDE; - QString selectedNameFilter() Q_DECL_OVERRIDE; - QList selectedFiles() Q_DECL_OVERRIDE; + QUrl directory() override; + void selectMimeTypeFilter(const QString &filter) override; + void selectNameFilter(const QString &filter) override; + void setDirectory(const QUrl &directory) override; + void selectFile(const QUrl &filename) override; + QString selectedMimeTypeFilter() override; + QString selectedNameFilter() override; + QList selectedFiles() override; public Q_SLOTS: /** * Sets the current @p url in the dialog. */ void setCurrentUrl(const QUrl &url); protected: - void accept() Q_DECL_OVERRIDE; + void accept() override; /** * Reimplemented for saving the dialog geometry. */ - void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE; + void hideEvent(QHideEvent *event) override; private: class Private; Private *const d; Q_PRIVATE_SLOT(d, void slotCurrentChanged()) Q_PRIVATE_SLOT(d, void slotExpand(const QModelIndex &)) Q_PRIVATE_SLOT(d, void slotUrlActivated(const QString &)) Q_PRIVATE_SLOT(d, void slotComboTextChanged(const QString &)) Q_PRIVATE_SLOT(d, void slotContextMenuRequested(const QPoint &)) Q_PRIVATE_SLOT(d, void slotNewFolder()) Q_PRIVATE_SLOT(d, void slotMoveToTrash()) Q_PRIVATE_SLOT(d, void slotDelete()) Q_PRIVATE_SLOT(d, void slotProperties()) }; #endif diff --git a/src/platformtheme/kfiletreeview_p.h b/src/platformtheme/kfiletreeview_p.h index 8442018..3a27164 100644 --- a/src/platformtheme/kfiletreeview_p.h +++ b/src/platformtheme/kfiletreeview_p.h @@ -1,128 +1,128 @@ /* This file is part of the KDE project Copyright (C) 2007 Tobias Koenig This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KFILETREEVIEW_H #define KFILETREEVIEW_H #include #include /** * The file treeview offers a treeview on the filesystem. */ class KFileTreeView : public QTreeView // exported only for kfiletreeviewtest { Q_OBJECT public: /** * Creates a new file tree view. */ KFileTreeView(QWidget *parent = 0); /** * Destroys the file tree view. */ ~KFileTreeView(); /** * Returns the current url. */ QUrl currentUrl() const; /** * Returns the selected url. */ QUrl selectedUrl() const; /** * Returns all selected urls. */ QList selectedUrls() const; /** * Returns the current root url of the view. */ QUrl rootUrl() const; /** * Returns true if the view is currently showing hidden files * @since 4.3 */ bool showHiddenFiles() const; /** * @reimplemented */ - QSize sizeHint() const Q_DECL_OVERRIDE; + QSize sizeHint() const override; public Q_SLOTS: /** * Sets whether the dir-only mode is @p enabled. * * In dir-only mode, only directories and subdirectories * are listed in the view. */ void setDirOnlyMode(bool enabled); /** * Sets whether hidden files shall be listed. */ void setShowHiddenFiles(bool enabled); /** * Sets the current @p url of the view. */ void setCurrentUrl(const QUrl &url); /** * Sets the root @p url of the view. * * The default is file:///. */ void setRootUrl(const QUrl &url); Q_SIGNALS: /** * This signal is emitted whenever an @p url has been activated. */ void activated(const QUrl &url); /** * This signal is emitted whenever the current @p url has been changed. */ void currentChanged(const QUrl &url); protected: using QTreeView::currentChanged; - void contextMenuEvent(QContextMenuEvent *) Q_DECL_OVERRIDE; + void contextMenuEvent(QContextMenuEvent *) override; private: class Private; Private *const d; Q_PRIVATE_SLOT(d, void _k_activated(const QModelIndex &)) Q_PRIVATE_SLOT(d, void _k_currentChanged(const QModelIndex &, const QModelIndex &)) Q_PRIVATE_SLOT(d, void _k_expanded(const QModelIndex &)) }; #endif diff --git a/src/platformtheme/kwaylandintegration.h b/src/platformtheme/kwaylandintegration.h index 46d8112..8c074c2 100644 --- a/src/platformtheme/kwaylandintegration.h +++ b/src/platformtheme/kwaylandintegration.h @@ -1,55 +1,55 @@ /* This file is part of the KDE libraries * Copyright 2015 Martin Gräßlin * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KWAYLANDINTEGRATION_H #define KWAYLANDINTEGRATION_H #include class QWindow; namespace KWayland { namespace Client { class ServerSideDecorationManager; } } class KWaylandIntegration : public QObject { Q_OBJECT public: explicit KWaylandIntegration(); virtual ~KWaylandIntegration(); void init(); void setWindowProperty(QWindow *window, const QByteArray &name, const QByteArray &value); - bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; + bool eventFilter(QObject *watched, QEvent *event) override; private: void shellSurfaceCreated(QWindow *w); void shellSurfaceDestroyed(QWindow *w); void installColorScheme(QWindow *w); KWayland::Client::ServerSideDecorationManager *m_decoration; }; #endif diff --git a/src/platformtheme/main.cpp b/src/platformtheme/main.cpp index 252f045..28a9d50 100644 --- a/src/platformtheme/main.cpp +++ b/src/platformtheme/main.cpp @@ -1,41 +1,41 @@ /* This file is part of the KDE libraries * Copyright 2013 Kevin Ottens * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include #include "kdeplatformtheme.h" class KdePlatformThemePlugin : public QPlatformThemePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1" FILE "kdeplatformtheme.json") public: KdePlatformThemePlugin(QObject *parent = 0) : QPlatformThemePlugin(parent) {} - QPlatformTheme *create(const QString &key, const QStringList ¶mList) Q_DECL_OVERRIDE + QPlatformTheme *create(const QString &key, const QStringList ¶mList) override { Q_UNUSED(key) Q_UNUSED(paramList) return new KdePlatformTheme; } }; #include "main.moc" diff --git a/src/platformtheme/qdbusmenubar_p.h b/src/platformtheme/qdbusmenubar_p.h index 63c6104..13343d1 100644 --- a/src/platformtheme/qdbusmenubar_p.h +++ b/src/platformtheme/qdbusmenubar_p.h @@ -1,110 +1,110 @@ /**************************************************************************** ** ** Copyright (C) 2016 Dmitry Shachnev ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QDBUSMENUBAR_P_H #define QDBUSMENUBAR_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #if (QT_VERSION < QT_VERSION_CHECK(5, 8, 0)) #include #include #include #include #else #include #include #include #include #endif QT_BEGIN_NAMESPACE class QDBusMenuBar : public QPlatformMenuBar { Q_OBJECT public: QDBusMenuBar(); virtual ~QDBusMenuBar(); - void insertMenu(QPlatformMenu *menu, QPlatformMenu *before) Q_DECL_OVERRIDE; - void removeMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE; - void syncMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE; - void handleReparent(QWindow *newParentWindow) Q_DECL_OVERRIDE; - QPlatformMenu *menuForTag(quintptr tag) const Q_DECL_OVERRIDE; - QPlatformMenu *createMenu() const Q_DECL_OVERRIDE; + void insertMenu(QPlatformMenu *menu, QPlatformMenu *before) override; + void removeMenu(QPlatformMenu *menu) override; + void syncMenu(QPlatformMenu *menu) override; + void handleReparent(QWindow *newParentWindow) override; + QPlatformMenu *menuForTag(quintptr tag) const override; + QPlatformMenu *createMenu() const override; QWindow *window() const { return m_window; } QString objectPath() const { return m_objectPath; } Q_SIGNALS: void windowChanged(QWindow *newWindow, QWindow *oldWindow); private: QDBusPlatformMenu *m_menu; QDBusMenuAdaptor *m_menuAdaptor; QHash m_menuItems; QWindow *m_window = nullptr; QString m_objectPath; QDBusPlatformMenuItem *menuItemForMenu(QPlatformMenu *menu); static void updateMenuItem(QDBusPlatformMenuItem *item, QPlatformMenu *menu); void registerMenuBar(); void unregisterMenuBar(); }; QT_END_NAMESPACE #endif // QDBUSMENUBAR_P_H diff --git a/src/platformtheme/x11integration.h b/src/platformtheme/x11integration.h index 183dfdd..e431ffd 100644 --- a/src/platformtheme/x11integration.h +++ b/src/platformtheme/x11integration.h @@ -1,48 +1,48 @@ /* This file is part of the KDE libraries * Copyright 2015 Martin Gräßlin * Copyright 2016 Marco Martin * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef X11INTEGRATION_H #define X11INTEGRATION_H #include #include #include class QWindow; class X11Integration : public QObject { Q_OBJECT public: explicit X11Integration(); virtual ~X11Integration(); void init(); void setWindowProperty(QWindow *window, const QByteArray &name, const QByteArray &value); - bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; + bool eventFilter(QObject *watched, QEvent *event) override; private: void installColorScheme(QWindow *w); void installDesktopFileName(QWindow *w); QHash m_atoms; }; #endif