diff --git a/src/desktopicon.h b/src/desktopicon.h index 3f37663e..4e2fba7f 100644 --- a/src/desktopicon.h +++ b/src/desktopicon.h @@ -1,115 +1,115 @@ /* * Copyright 2011 Marco Martin * Copyright 2014 Aleix Pol Gonzalez * * This program 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, or * (at your option) any later version. * * This program 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 General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef QICONITEM_H #define QICONITEM_H #include #include #include #include class QNetworkAccessManager; class QNetworkReply; namespace Kirigami { class PlatformTheme; } class DesktopIcon : public QQuickItem { Q_OBJECT Q_PROPERTY(QVariant source READ source WRITE setSource NOTIFY sourceChanged) Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged) Q_PROPERTY(int implicitWidth READ implicitWidth CONSTANT) Q_PROPERTY(int implicitHeight READ implicitHeight CONSTANT) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged) Q_PROPERTY(bool valid READ valid NOTIFY validChanged) Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectedChanged) Q_PROPERTY(bool isMask READ isMask WRITE setIsMask NOTIFY isMaskChanged) Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) public: DesktopIcon(QQuickItem *parent=0); ~DesktopIcon(); void setSource(const QVariant &source); QVariant source() const; int implicitWidth() const; int implicitHeight() const; void setSmooth(const bool smooth); bool smooth() const; void setEnabled(bool enabled = true); void setActive(bool active = true); bool active() const; bool valid() const; void setSelected(bool selected = true); bool selected() const; void setIsMask(bool mask); bool isMask() const; void setColor(const QColor &color); QColor color() const; - QSGNode* updatePaintNode(QSGNode* node, UpdatePaintNodeData* data) Q_DECL_OVERRIDE; + QSGNode* updatePaintNode(QSGNode* node, UpdatePaintNodeData* data) override; //HACKY but we need the base path for internal icons registered by kirigamiplugin itself static QString s_internalIconPath; Q_SIGNALS: void sourceChanged(); void smoothChanged(); void enabledChanged(); void activeChanged(); void validChanged(); void selectedChanged(); void isMaskChanged(); void colorChanged(); protected: - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; QImage findIcon(const QSize& size); void handleFinished(QNetworkAccessManager* qnam, QNetworkReply* reply); void handleReadyRead(QNetworkReply* reply); QIcon::Mode iconMode() const; private: Kirigami::PlatformTheme *m_theme = nullptr; QPointer m_networkReply; QVariant m_source; bool m_smooth; bool m_changed; bool m_active; bool m_selected; bool m_isMask; QImage m_loadedImage; QColor m_color = Qt::transparent; }; #endif diff --git a/src/kirigamiplugin.h b/src/kirigamiplugin.h index c5c2a883..0c1d8290 100644 --- a/src/kirigamiplugin.h +++ b/src/kirigamiplugin.h @@ -1,73 +1,73 @@ /* * Copyright 2009 by Alan Alpert * Copyright 2010 by Ménard Alexis * Copyright 2010 by Marco Martin * This program 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, or * (at your option) any later version. * * This program 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 program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MOBILECOMPONENTSPLUGIN_H #define MOBILECOMPONENTSPLUGIN_H #include #include #include class KirigamiPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: - void registerTypes(const char *uri) Q_DECL_OVERRIDE; + void registerTypes(const char *uri) override; #ifdef KIRIGAMI_BUILD_TYPE_STATIC static KirigamiPlugin& getInstance() { static KirigamiPlugin instance; return instance; } static void registerTypes() { static KirigamiPlugin instance; instance.registerTypes("org.kde.kirigami"); } #endif private: QUrl componentUrl(const QString &fileName) const; QString resolveFilePath(const QString &path) const { #ifdef KIRIGAMI_BUILD_TYPE_STATIC return QStringLiteral(":/org/kde/kirigami/") + path; #else return baseUrl().toLocalFile() + QLatin1Char('/') + path; #endif } QString resolveFileUrl(const QString &filePath) const { #ifdef KIRIGAMI_BUILD_TYPE_STATIC return filePath; #else return baseUrl().toString() + QLatin1Char('/') + filePath; #endif } QStringList m_stylesFallbackChain; }; #endif