diff --git a/abstractentry.h b/abstractentry.h index 9f89016dd..39d48fa8b 100644 --- a/abstractentry.h +++ b/abstractentry.h @@ -1,79 +1,79 @@ /*************************************************************************** * Copyright (C) 2012 Aurélien Gâteau * * Copyright (C) 2014-2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 ABSTRACTENTRY_H #define ABSTRACTENTRY_H #include "abstractmodel.h" #include #include class AbstractEntry { public: explicit AbstractEntry(AbstractModel *owner); virtual ~AbstractEntry(); enum EntryType { RunnableType, GroupType, SeparatorType }; virtual EntryType type() const = 0; AbstractModel *owner() const; virtual bool isValid() const; virtual QIcon icon() const; virtual QString name() const; virtual QString group() const; virtual QString description() const; virtual QString id() const; virtual QUrl url() const; virtual bool hasChildren() const; virtual AbstractModel *childModel() const; virtual bool hasActions() const; virtual QVariantList actions() const; virtual bool run(const QString& actionId = QString(), const QVariant &argument = QVariant()); protected: AbstractModel* m_owner; }; class AbstractGroupEntry : public AbstractEntry { public: explicit AbstractGroupEntry(AbstractModel *owner); - EntryType type() const { return GroupType; } + EntryType type() const Q_DECL_OVERRIDE { return GroupType; } }; class SeparatorEntry : public AbstractEntry { public: explicit SeparatorEntry(AbstractModel *owner); - EntryType type() const { return SeparatorType; } + EntryType type() const Q_DECL_OVERRIDE { return SeparatorType; } }; #endif diff --git a/abstractmodel.h b/abstractmodel.h index c34b6033b..b777b9250 100644 --- a/abstractmodel.h +++ b/abstractmodel.h @@ -1,86 +1,86 @@ /*************************************************************************** * Copyright (C) 2014-2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 ABSTRACTMODEL_H #define ABSTRACTMODEL_H #include class AbstractEntry; class AbstractModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(QString description READ description NOTIFY descriptionChanged) Q_PROPERTY(int count READ count NOTIFY countChanged) Q_PROPERTY(int separatorCount READ separatorCount NOTIFY separatorCountChanged) Q_PROPERTY(int iconSize READ iconSize WRITE setIconSize NOTIFY iconSizeChanged) Q_PROPERTY(AbstractModel* favoritesModel READ favoritesModel WRITE setFavoritesModel NOTIFY favoritesModelChanged) public: explicit AbstractModel(QObject *parent = 0); ~AbstractModel(); - virtual QHash roleNames() const; + QHash roleNames() const Q_DECL_OVERRIDE; virtual QString description() const = 0; int count() const; virtual int separatorCount() const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; int iconSize() const; void setIconSize(int size); Q_INVOKABLE virtual bool trigger(int row, const QString &actionId, const QVariant &argument) = 0; Q_INVOKABLE virtual void refresh(); Q_INVOKABLE virtual QString labelForRow(int row); Q_INVOKABLE virtual AbstractModel *modelForRow(int row); Q_INVOKABLE virtual int rowForModel(AbstractModel *model); virtual bool hasActions() const; virtual QVariantList actions() const; virtual AbstractModel* favoritesModel(); virtual void setFavoritesModel(AbstractModel *model); AbstractModel* rootModel(); virtual void entryChanged(AbstractEntry *entry); Q_SIGNALS: void descriptionChanged() const; void countChanged() const; void separatorCountChanged() const; void iconSizeChanged() const; void favoritesModelChanged() const; protected: AbstractModel *m_favoritesModel; private: int m_iconSize; }; #endif diff --git a/appentry.h b/appentry.h index 4ee770669..4823a2bc7 100644 --- a/appentry.h +++ b/appentry.h @@ -1,93 +1,93 @@ /*************************************************************************** * Copyright (C) 201 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 APPENTRY_H #define APPENTRY_H #include "abstractentry.h" #include #include class AppsModel; class MenuEntryEditor; class AppEntry : public AbstractEntry { public: enum NameFormat { NameOnly = 0, GenericNameOnly, NameAndGenericName, GenericNameAndName }; explicit AppEntry(AbstractModel *owner, KService::Ptr service, NameFormat nameFormat); explicit AppEntry(AbstractModel *owner, const QString &id); - EntryType type() const { return RunnableType; } + EntryType type() const Q_DECL_OVERRIDE { return RunnableType; } - bool isValid() const; + bool isValid() const Q_DECL_OVERRIDE; - QIcon icon() const; - QString name() const; - QString description() const; + QIcon icon() const Q_DECL_OVERRIDE; + QString name() const Q_DECL_OVERRIDE; + QString description() const Q_DECL_OVERRIDE; KService::Ptr service() const; - QString id() const; - QUrl url() const; + QString id() const Q_DECL_OVERRIDE; + QUrl url() const Q_DECL_OVERRIDE; - bool hasActions() const; - QVariantList actions() const; + bool hasActions() const Q_DECL_OVERRIDE; + QVariantList actions() const Q_DECL_OVERRIDE; - bool run(const QString& actionId = QString(), const QVariant &argument = QVariant()); + bool run(const QString& actionId = QString(), const QVariant &argument = QVariant()) Q_DECL_OVERRIDE; static QString nameFromService(const KService::Ptr service, NameFormat nameFormat); static KService::Ptr defaultAppByName(const QString &name); private: void init(NameFormat nameFormat); QString m_id; QString m_name; QString m_description; mutable QIcon m_icon; KService::Ptr m_service; static MenuEntryEditor *m_menuEntryEditor; }; class AppGroupEntry : public AbstractGroupEntry { public: AppGroupEntry(AppsModel *parentModel, KServiceGroup::Ptr group, bool paginate, int pageSize, bool flat, bool sorted, bool separators, int appNameFormat); - QIcon icon() const; - QString name() const; + QIcon icon() const Q_DECL_OVERRIDE; + QString name() const Q_DECL_OVERRIDE; - bool hasChildren() const; - AbstractModel *childModel() const; + bool hasChildren() const Q_DECL_OVERRIDE; + AbstractModel *childModel() const Q_DECL_OVERRIDE; private: KServiceGroup::Ptr m_group; mutable QIcon m_icon; QPointer m_childModel; }; #endif diff --git a/appsmodel.h b/appsmodel.h index b59804181..b6b85847b 100644 --- a/appsmodel.h +++ b/appsmodel.h @@ -1,137 +1,137 @@ /*************************************************************************** * Copyright (C) 2012 Aurélien Gâteau * * Copyright (C) 2013-2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 APPSMODEL_H #define APPSMODEL_H #include "abstractmodel.h" #include "appentry.h" #include class AppGroupEntry; class QTimer; class AppsModel : public AbstractModel { Q_OBJECT Q_PROPERTY(bool paginate READ paginate WRITE setPaginate NOTIFY paginateChanged) Q_PROPERTY(int pageSize READ pageSize WRITE setPageSize NOTIFY pageSizeChanged) Q_PROPERTY(bool flat READ flat WRITE setFlat NOTIFY flatChanged) Q_PROPERTY(bool sorted READ sorted WRITE setSorted NOTIFY sortedChanged) Q_PROPERTY(bool showSeparators READ showSeparators WRITE setShowSeparators NOTIFY showSeparatorsChanged) Q_PROPERTY(int appNameFormat READ appNameFormat WRITE setAppNameFormat NOTIFY appNameFormatChanged) Q_PROPERTY(QObject* appletInterface READ appletInterface WRITE setAppletInterface NOTIFY appletInterfaceChanged); public: explicit AppsModel(const QString &entryPath = QString(), bool paginate = false, int pageSize = 24, bool flat = false, bool sorted = true, bool separators = true, QObject *parent = 0); explicit AppsModel(const QList entryList, bool deleteEntriesOnDestruction, QObject *parent = 0); ~AppsModel(); - QString description() const; + QString description() const Q_DECL_OVERRIDE; void setDescription(const QString &text); - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - int rowCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - Q_INVOKABLE virtual bool trigger(int row, const QString &actionId, const QVariant &argument); + Q_INVOKABLE virtual bool trigger(int row, const QString &actionId, const QVariant &argument) Q_DECL_OVERRIDE; - Q_INVOKABLE AbstractModel *modelForRow(int row); - Q_INVOKABLE int rowForModel(AbstractModel *model); + Q_INVOKABLE AbstractModel *modelForRow(int row) Q_DECL_OVERRIDE; + Q_INVOKABLE int rowForModel(AbstractModel *model) Q_DECL_OVERRIDE; - int separatorCount() const; + int separatorCount() const Q_DECL_OVERRIDE; bool paginate() const; void setPaginate(bool paginate); int pageSize() const; void setPageSize(int size); bool flat() const; void setFlat(bool flat); bool sorted() const; void setSorted(bool sorted); bool showSeparators() const; void setShowSeparators(bool showSeparators); int appNameFormat() const; void setAppNameFormat(int format); QObject *appletInterface() const; void setAppletInterface(QObject *appletInterface); QStringList hiddenEntries() const; - void entryChanged(AbstractEntry *entry); + void entryChanged(AbstractEntry *entry) Q_DECL_OVERRIDE; Q_SIGNALS: void cleared() const; void paginateChanged() const; void pageSizeChanged() const; void flatChanged() const; void sortedChanged() const; void showSeparatorsChanged() const; void appNameFormatChanged() const; void appletInterfaceChanged() const; void hiddenEntriesChanged() const; protected Q_SLOTS: - virtual void refresh(); + void refresh() Q_DECL_OVERRIDE; protected: void refreshInternal(); bool m_paginate; int m_pageSize; QList m_entryList; bool m_deleteEntriesOnDestruction; int m_separatorCount; bool m_showSeparators; QObject *m_appletInterface; private Q_SLOTS: void checkSycocaChanges(const QStringList &changes); private: void processServiceGroup(KServiceGroup::Ptr group); void sortEntries(); QString m_description; QString m_entryPath; bool m_staticEntryList; QTimer *m_changeTimer; bool m_flat; bool m_sorted; AppEntry::NameFormat m_appNameFormat; QStringList m_hiddenEntries; static MenuEntryEditor *m_menuEntryEditor; }; #endif diff --git a/computermodel.h b/computermodel.h index ba82d7a14..241b140ba 100644 --- a/computermodel.h +++ b/computermodel.h @@ -1,117 +1,117 @@ /*************************************************************************** * Copyright (C) 2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 COMPUTERMODEL_H #define COMPUTERMODEL_H #include "forwardingmodel.h" #include "appentry.h" #include #include class FavoritesModel; class KConcatenateRowsProxyModel; class KFilePlacesModel; namespace Solid { class Device; } class FilteredPlacesModel : public QSortFilterProxyModel { Q_OBJECT public: FilteredPlacesModel(QObject *parent = 0); ~FilteredPlacesModel(); QUrl url(const QModelIndex &index) const; bool isDevice(const QModelIndex &index) const; Solid::Device deviceForIndex(const QModelIndex &index) const; protected: - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; - bool lessThan(const QModelIndex &left, const QModelIndex &right) const; + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const Q_DECL_OVERRIDE; + bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; private: KFilePlacesModel *m_placesModel; }; class RunCommandModel : public AbstractModel { public: RunCommandModel(QObject *parent = 0); ~RunCommandModel(); - QString description() const; + QString description() const Q_DECL_OVERRIDE; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - int rowCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument); + Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument) Q_DECL_OVERRIDE; }; class ComputerModel : public ForwardingModel { Q_OBJECT Q_PROPERTY(int appNameFormat READ appNameFormat WRITE setAppNameFormat NOTIFY appNameFormatChanged) Q_PROPERTY(QObject* appletInterface READ appletInterface WRITE setAppletInterface NOTIFY appletInterfaceChanged) Q_PROPERTY(QStringList systemApplications READ systemApplications WRITE setSystemApplications NOTIFY systemApplicationsChanged) public: explicit ComputerModel(QObject *parent = 0); ~ComputerModel(); - QString description() const; + QString description() const Q_DECL_OVERRIDE; int appNameFormat() const; void setAppNameFormat(int format); QObject *appletInterface() const; void setAppletInterface(QObject *appletInterface); QStringList systemApplications() const; void setSystemApplications(const QStringList &apps); - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument); + Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument) Q_DECL_OVERRIDE; Q_SIGNALS: void appNameFormatChanged() const; void appletInterfaceChanged() const; void systemApplicationsChanged() const; private Q_SLOTS: void onSetupDone(Solid::ErrorType error, QVariant errorData, const QString &udi); private: KConcatenateRowsProxyModel *m_concatProxy; RunCommandModel *m_runCommandModel; FavoritesModel *m_systemAppsModel; FilteredPlacesModel *m_filteredPlacesModel; AppEntry::NameFormat m_appNameFormat; QObject *m_appletInterface; }; #endif diff --git a/contactentry.h b/contactentry.h index ed9695c0d..575300f5f 100644 --- a/contactentry.h +++ b/contactentry.h @@ -1,55 +1,55 @@ /*************************************************************************** * Copyright (C) 201 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 CONTACTENTRY_H #define CONTACTENTRY_H #include "abstractentry.h" namespace KPeople { class PersonData; } class ContactEntry : public AbstractEntry { public: explicit ContactEntry(AbstractModel *owner, const QString &id); - EntryType type() const { return RunnableType; } + EntryType type() const Q_DECL_OVERRIDE { return RunnableType; } - bool isValid() const; + bool isValid() const Q_DECL_OVERRIDE; - QIcon icon() const; - QString name() const; + QIcon icon() const Q_DECL_OVERRIDE; + QString name() const Q_DECL_OVERRIDE; - QString id() const; - QUrl url() const; + QString id() const Q_DECL_OVERRIDE; + QUrl url() const Q_DECL_OVERRIDE; - bool hasActions() const; - QVariantList actions() const; + bool hasActions() const Q_DECL_OVERRIDE; + QVariantList actions() const Q_DECL_OVERRIDE; - bool run(const QString& actionId = QString(), const QVariant &argument = QVariant()); + bool run(const QString& actionId = QString(), const QVariant &argument = QVariant()) Q_DECL_OVERRIDE; static void showPersonDetailsDialog(const QString &id); private: KPeople::PersonData *m_personData; }; #endif diff --git a/favoritesmodel.h b/favoritesmodel.h index f92604547..8ed1bf921 100644 --- a/favoritesmodel.h +++ b/favoritesmodel.h @@ -1,91 +1,91 @@ /*************************************************************************** * Copyright (C) 2014-2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 FAVORITESMODEL_H #define FAVORITESMODEL_H #include "abstractmodel.h" #include #include class FavoritesModel : public AbstractModel { Q_OBJECT Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) Q_PROPERTY(QStringList favorites READ favorites WRITE setFavorites NOTIFY favoritesChanged) Q_PROPERTY(int maxFavorites READ maxFavorites WRITE setMaxFavorites NOTIFY maxFavoritesChanged) Q_PROPERTY(int dropPlaceholderIndex READ dropPlaceholderIndex WRITE setDropPlaceholderIndex NOTIFY dropPlaceholderIndexChanged) public: explicit FavoritesModel(QObject *parent = 0); ~FavoritesModel(); - QString description() const; + QString description() const Q_DECL_OVERRIDE; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - int rowCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument); + Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument) Q_DECL_OVERRIDE; bool enabled() const; void setEnabled(bool enable); QStringList favorites() const; void setFavorites(const QStringList &favorites); int maxFavorites() const; void setMaxFavorites(int max); Q_INVOKABLE bool isFavorite(const QString &id) const; Q_INVOKABLE void addFavorite(const QString &id, int index = -1); Q_INVOKABLE void removeFavorite(const QString &id); Q_INVOKABLE void moveRow(int from, int to); int dropPlaceholderIndex() const; void setDropPlaceholderIndex(int index); - AbstractModel* favoritesModel(); + AbstractModel* favoritesModel() Q_DECL_OVERRIDE; public Q_SLOTS: - virtual void refresh(); + void refresh() Q_DECL_OVERRIDE; Q_SIGNALS: void enabledChanged() const; void favoritesChanged() const; void maxFavoritesChanged() const; void dropPlaceholderIndexChanged(); private: AbstractEntry *favoriteFromId(const QString &id); bool m_enabled; QList m_entryList; QStringList m_favorites; int m_maxFavorites; int m_dropPlaceholderIndex; }; #endif diff --git a/fileentry.h b/fileentry.h index da3f984b7..71f30adcd 100644 --- a/fileentry.h +++ b/fileentry.h @@ -1,53 +1,53 @@ /*************************************************************************** * Copyright (C) 2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 FILEENTRY_H #define FILEENTRY_H #include "abstractentry.h" class KFileItem; class FileEntry : public AbstractEntry { public: explicit FileEntry(AbstractModel *owner, const QUrl &url); ~FileEntry(); - EntryType type() const { return RunnableType; } + EntryType type() const Q_DECL_OVERRIDE { return RunnableType; } - bool isValid() const; + bool isValid() const Q_DECL_OVERRIDE; - QIcon icon() const; - QString name() const; - QString description() const; + QIcon icon() const Q_DECL_OVERRIDE; + QString name() const Q_DECL_OVERRIDE; + QString description() const Q_DECL_OVERRIDE; - QString id() const; - QUrl url() const; + QString id() const Q_DECL_OVERRIDE; + QUrl url() const Q_DECL_OVERRIDE; - bool hasActions() const; - QVariantList actions() const; + bool hasActions() const Q_DECL_OVERRIDE; + QVariantList actions() const Q_DECL_OVERRIDE; - bool run(const QString& actionId = QString(), const QVariant &argument = QVariant()); + bool run(const QString& actionId = QString(), const QVariant &argument = QVariant()) Q_DECL_OVERRIDE; private: KFileItem *m_fileItem; }; #endif diff --git a/forwardingmodel.h b/forwardingmodel.h index 3d4edf643..4e4403162 100644 --- a/forwardingmodel.h +++ b/forwardingmodel.h @@ -1,77 +1,77 @@ /*************************************************************************** * Copyright (C) 2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 FORWARDINGMODEL_H #define FORWARDINGMODEL_H #include "abstractmodel.h" #include class ForwardingModel : public AbstractModel { Q_OBJECT Q_PROPERTY(QAbstractItemModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged); public: explicit ForwardingModel(QObject *parent = 0); ~ForwardingModel(); - QString description() const; + QString description() const Q_DECL_OVERRIDE; QAbstractItemModel *sourceModel() const; virtual void setSourceModel(QAbstractItemModel *sourceModel); - bool canFetchMore(const QModelIndex &parent) const; - void fetchMore(const QModelIndex &parent); + bool canFetchMore(const QModelIndex &parent) const Q_DECL_OVERRIDE; + void fetchMore(const QModelIndex &parent) Q_DECL_OVERRIDE; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &index) const; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - int rowCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument); + Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument) Q_DECL_OVERRIDE; - Q_INVOKABLE QString labelForRow(int row); + Q_INVOKABLE QString labelForRow(int row) Q_DECL_OVERRIDE; - Q_INVOKABLE AbstractModel *modelForRow(int row); + Q_INVOKABLE AbstractModel *modelForRow(int row) Q_DECL_OVERRIDE; - AbstractModel* favoritesModel(); + AbstractModel* favoritesModel() Q_DECL_OVERRIDE; - int separatorCount() const; + int separatorCount() const Q_DECL_OVERRIDE; public Q_SLOTS: void reset(); Q_SIGNALS: void sourceModelChanged() const; protected: QModelIndex indexToSourceIndex(const QModelIndex &index) const; void connectSignals(); void disconnectSignals(); QPointer m_sourceModel; }; #endif diff --git a/funnelmodel.h b/funnelmodel.h index 1846e691a..4acb97ed1 100644 --- a/funnelmodel.h +++ b/funnelmodel.h @@ -1,36 +1,36 @@ /*************************************************************************** * Copyright (C) 2014 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 FUNNELMODEL_H #define FUNNELMODEL_H #include "forwardingmodel.h" class FunnelModel : public ForwardingModel { Q_OBJECT public: explicit FunnelModel(QObject *parent = 0); ~FunnelModel(); - void setSourceModel(QAbstractItemModel *model); + void setSourceModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; }; #endif diff --git a/kickerplugin.h b/kickerplugin.h index 539435581..f4a0d6828 100644 --- a/kickerplugin.h +++ b/kickerplugin.h @@ -1,35 +1,35 @@ /*************************************************************************** * Copyright (C) 2014 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 KICKERPLUGIN_H #define KICKERPLUGIN_H #include #include class KickerPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: - virtual void registerTypes(const char *uri); + void registerTypes(const char *uri) Q_DECL_OVERRIDE; }; #endif // KICKERPLUGIN_H diff --git a/recentcontactsmodel.h b/recentcontactsmodel.h index ef659fc65..eb0b6d661 100644 --- a/recentcontactsmodel.h +++ b/recentcontactsmodel.h @@ -1,59 +1,59 @@ /*************************************************************************** * Copyright (C) 2012 by Aurélien Gâteau * * Copyright (C) 2014-2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 RECENTCONTACTSMODEL_H #define RECENTCONTACTSMODEL_H #include "forwardingmodel.h" namespace KPeople { class PersonData; } class RecentContactsModel : public ForwardingModel { Q_OBJECT public: explicit RecentContactsModel(QObject *parent = 0); ~RecentContactsModel(); - QString description() const; + QString description() const Q_DECL_OVERRIDE; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument); + Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument) Q_DECL_OVERRIDE; - bool hasActions() const; - QVariantList actions() const; + bool hasActions() const Q_DECL_OVERRIDE; + QVariantList actions() const Q_DECL_OVERRIDE; private Q_SLOTS: - void refresh(); + void refresh() Q_DECL_OVERRIDE; void buildCache(); void personDataChanged(); private: void insertPersonData(const QString &id, int row); QHash m_idToData; QHash m_dataToRow; }; #endif diff --git a/recentusagemodel.h b/recentusagemodel.h index 170c74c2a..fdbd1b293 100644 --- a/recentusagemodel.h +++ b/recentusagemodel.h @@ -1,112 +1,112 @@ /*************************************************************************** * Copyright (C) 2014-2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 RECENTUSAGEMODEL_H #define RECENTUSAGEMODEL_H #include "forwardingmodel.h" #include #include class GroupSortProxy : public QSortFilterProxyModel { public: explicit GroupSortProxy(QAbstractItemModel *sourceModel); ~GroupSortProxy(); protected: - bool lessThan(const QModelIndex &left, const QModelIndex &right) const; + bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; }; class InvalidAppsFilterProxy : public QSortFilterProxyModel { Q_OBJECT public: explicit InvalidAppsFilterProxy(AbstractModel *parentModel, QAbstractItemModel *sourceModel); ~InvalidAppsFilterProxy(); protected: - bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const; + bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const Q_DECL_OVERRIDE; private Q_SLOTS: void connectNewFavoritesModel(); private: QPointer m_parentModel; }; class RecentUsageModel : public ForwardingModel, public QQmlParserStatus { Q_OBJECT Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(int ordering READ ordering WRITE setOrdering NOTIFY orderingChanged) public: enum IncludeUsage { AppsAndDocs, OnlyApps, OnlyDocs }; enum Ordering { Recent, Popular }; explicit RecentUsageModel( QObject *parent = 0, IncludeUsage usage = AppsAndDocs, int ordering = Recent); ~RecentUsageModel(); - QString description() const; + QString description() const Q_DECL_OVERRIDE; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument); + Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument) Q_DECL_OVERRIDE; - bool hasActions() const; - QVariantList actions() const; + bool hasActions() const Q_DECL_OVERRIDE; + QVariantList actions() const Q_DECL_OVERRIDE; IncludeUsage usage() const; void setOrdering(int ordering); int ordering() const; void classBegin() override; void componentComplete() override; Q_SIGNALS: void orderingChanged(int ordering); private Q_SLOTS: - void refresh(); + void refresh() Q_DECL_OVERRIDE; private: QVariant appData(const QString &resource, int role) const; QVariant docData(const QString &resource, int role) const; QString resourceAt(int row) const; QString forgetAllActionName() const; IncludeUsage m_usage; QPointer m_activitiesModel; Ordering m_ordering; bool m_complete; }; #endif diff --git a/rootmodel.h b/rootmodel.h index 2e0f2ef04..b9356fa9c 100644 --- a/rootmodel.h +++ b/rootmodel.h @@ -1,137 +1,137 @@ /*************************************************************************** * Copyright (C) 2014-2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 ROOTMODEL_H #define ROOTMODEL_H #include "appsmodel.h" #include class FavoritesModel; class RecentContactsModel; class RecentUsageModel; class SystemModel; class RootModel; class GroupEntry : public AbstractGroupEntry { public: GroupEntry(AppsModel *parentModel, const QString &name, const QString &iconName, AbstractModel *childModel); - QIcon icon() const; - QString name() const; + QIcon icon() const Q_DECL_OVERRIDE; + QString name() const Q_DECL_OVERRIDE; - bool hasChildren() const; - AbstractModel *childModel() const; + bool hasChildren() const Q_DECL_OVERRIDE; + AbstractModel *childModel() const Q_DECL_OVERRIDE; private: QString m_name; QString m_iconName; QPointer m_childModel; }; class RootModel : public AppsModel, public QQmlParserStatus { Q_OBJECT Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(bool autoPopulate READ autoPopulate WRITE setAutoPopulate NOTIFY autoPopulateChanged) Q_PROPERTY(QObject* systemFavoritesModel READ systemFavoritesModel NOTIFY systemFavoritesModelChanged) Q_PROPERTY(bool showAllApps READ showAllApps WRITE setShowAllApps NOTIFY showAllAppsChanged) Q_PROPERTY(bool showRecentApps READ showRecentApps WRITE setShowRecentApps NOTIFY showRecentAppsChanged) Q_PROPERTY(bool showRecentDocs READ showRecentDocs WRITE setShowRecentDocs NOTIFY showRecentDocsChanged) Q_PROPERTY(bool showRecentContacts READ showRecentContacts WRITE setShowRecentContacts NOTIFY showRecentContactsChanged) Q_PROPERTY(int recentOrdering READ recentOrdering WRITE setRecentOrdering NOTIFY recentOrderingChanged) Q_PROPERTY(bool showPowerSession READ showPowerSession WRITE setShowPowerSession NOTIFY showPowerSessionChanged) public: explicit RootModel(QObject *parent = 0); ~RootModel(); - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - Q_INVOKABLE virtual bool trigger(int row, const QString &actionId, const QVariant &argument); + Q_INVOKABLE virtual bool trigger(int row, const QString &actionId, const QVariant &argument) Q_DECL_OVERRIDE; bool autoPopulate() const; void setAutoPopulate(bool populate); bool showAllApps() const; void setShowAllApps(bool show); bool showRecentApps() const; void setShowRecentApps(bool show); bool showRecentDocs() const; void setShowRecentDocs(bool show); bool showRecentContacts() const; void setShowRecentContacts(bool show); int recentOrdering() const; void setRecentOrdering(int ordering); bool showPowerSession() const; void setShowPowerSession(bool show); - AbstractModel* favoritesModel(); + AbstractModel* favoritesModel() Q_DECL_OVERRIDE; AbstractModel* systemFavoritesModel(); void classBegin() override; void componentComplete() override; Q_SIGNALS: void refreshed() const; void systemFavoritesModelChanged() const; void autoPopulateChanged() const; void showAllAppsChanged() const; void showRecentAppsChanged() const; void showRecentDocsChanged() const; void showRecentContactsChanged() const; void showPowerSessionChanged() const; void recentOrderingChanged() const; void recentAppsModelChanged() const; protected Q_SLOTS: - void refresh(); + void refresh() Q_DECL_OVERRIDE; private: bool m_complete; FavoritesModel *m_favorites; SystemModel *m_systemModel; bool m_autoPopulate; bool m_showAllApps; bool m_showRecentApps; bool m_showRecentDocs; bool m_showRecentContacts; int m_recentOrdering; bool m_showPowerSession; RecentUsageModel *m_recentAppsModel; RecentUsageModel *m_recentDocsModel; RecentContactsModel *m_recentContactsModel; }; #endif diff --git a/runnermatchesmodel.h b/runnermatchesmodel.h index 246c2a8ae..cdc2c2f86 100644 --- a/runnermatchesmodel.h +++ b/runnermatchesmodel.h @@ -1,64 +1,64 @@ /*************************************************************************** * Copyright (C) 2012 by Aurélien Gâteau * * Copyright (C) 2014 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 RUNNERMATCHESMODEL_H #define RUNNERMATCHESMODEL_H #include "abstractmodel.h" #include namespace Plasma { class RunnerManager; } class RunnerMatchesModel : public AbstractModel { Q_OBJECT Q_PROPERTY(QString name READ name CONSTANT) public: explicit RunnerMatchesModel(const QString &runnerId, const QString &name, Plasma::RunnerManager *manager, QObject *parent = 0); - QString description() const; + QString description() const Q_DECL_OVERRIDE; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - int rowCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument); + Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument) Q_DECL_OVERRIDE; QString runnerId() const { return m_runnerId; } QString name() const { return m_name; } void setMatches(const QList &matches); - AbstractModel* favoritesModel(); + AbstractModel* favoritesModel() Q_DECL_OVERRIDE; private: QString m_runnerId; QString m_name; Plasma::RunnerManager *m_runnerManager; QList m_matches; }; #endif diff --git a/runnermodel.h b/runnermodel.h index 5437a9839..b70483516 100644 --- a/runnermodel.h +++ b/runnermodel.h @@ -1,108 +1,108 @@ /*************************************************************************** * Copyright (C) 2012 by Aurélien Gâteau * * Copyright (C) 2014 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 RUNNERMODEL_H #define RUNNERMODEL_H #include "abstractmodel.h" #include #include #include namespace Plasma { class RunnerManager; } class AbstractModel; class RunnerMatchesModel; class RunnerModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(int count READ count NOTIFY countChanged) Q_PROPERTY(AbstractModel* favoritesModel READ favoritesModel WRITE setFavoritesModel NOTIFY favoritesModelChanged) Q_PROPERTY(QObject* appletInterface READ appletInterface WRITE setAppletInterface NOTIFY appletInterfaceChanged) Q_PROPERTY(QStringList runners READ runners WRITE setRunners NOTIFY runnersChanged); Q_PROPERTY(QString query READ query WRITE setQuery NOTIFY queryChanged); Q_PROPERTY(bool mergeResults READ mergeResults WRITE setMergeResults NOTIFY mergeResultsChanged) Q_PROPERTY(bool deleteWhenEmpty READ deleteWhenEmpty WRITE setDeleteWhenEmpty NOTIFY deleteWhenEmptyChanged) public: explicit RunnerModel(QObject *parent = 0); ~RunnerModel(); - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; QHash roleNames() const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; int count() const; Q_INVOKABLE QObject *modelForRow(int row); QStringList runners() const; void setRunners(const QStringList &runners); QString query() const; void setQuery(const QString &query); AbstractModel *favoritesModel() const; void setFavoritesModel(AbstractModel *model); QObject *appletInterface() const; void setAppletInterface(QObject *appletInterface); bool mergeResults() const; void setMergeResults(bool merge); bool deleteWhenEmpty() const; void setDeleteWhenEmpty(bool deleteWhenEmpty); Q_SIGNALS: void countChanged() const; void favoritesModelChanged() const; void appletInterfaceChanged() const; void runnersChanged() const; void queryChanged() const; void mergeResultsChanged() const; void deleteWhenEmptyChanged(); private Q_SLOTS: void startQuery(); void matchesChanged(const QList &matches); private: void createManager(); void clear(); AbstractModel *m_favoritesModel; QObject *m_appletInterface; Plasma::RunnerManager *m_runnerManager; QStringList m_runners; QList m_models; QString m_query; QTimer m_queryTimer; bool m_mergeResults; bool m_deleteWhenEmpty; }; #endif diff --git a/systementry.h b/systementry.h index 10797f8b7..67c9f06f1 100644 --- a/systementry.h +++ b/systementry.h @@ -1,69 +1,69 @@ /*************************************************************************** * Copyright (C) 2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 SYSTEMENTRY_H #define SYSTEMENTRY_H #include "abstractentry.h" class KDisplayManager; class SystemEntry : public AbstractEntry { public: enum Action { NoAction = 0, LockSession, LogoutSession, SaveSession, SwitchUser, SuspendToRam, SuspendToDisk, Reboot, Shutdown }; explicit SystemEntry(AbstractModel *owner, Action action); explicit SystemEntry(AbstractModel *owner, const QString &id); - EntryType type() const { return RunnableType; } + EntryType type() const Q_DECL_OVERRIDE { return RunnableType; } - bool isValid() const; + bool isValid() const Q_DECL_OVERRIDE; - QIcon icon() const; + QIcon icon() const Q_DECL_OVERRIDE; QString iconName() const; - QString name() const; - QString group() const; - QString description() const; + QString name() const Q_DECL_OVERRIDE; + QString group() const Q_DECL_OVERRIDE; + QString description() const Q_DECL_OVERRIDE; - QString id() const; + QString id() const Q_DECL_OVERRIDE; - bool run(const QString& actionId = QString(), const QVariant &argument = QVariant()); + bool run(const QString& actionId = QString(), const QVariant &argument = QVariant()) Q_DECL_OVERRIDE; private: void init(); Action m_action; bool m_valid; static KDisplayManager *m_displayManager; }; #endif diff --git a/systemmodel.h b/systemmodel.h index 2319ee498..e92b1ce56 100644 --- a/systemmodel.h +++ b/systemmodel.h @@ -1,52 +1,52 @@ /*************************************************************************** * Copyright (C) 2014-2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 SYSTEMMODEL_H #define SYSTEMMODEL_H #include "abstractmodel.h" class SystemEntry; class SystemModel : public AbstractModel { Q_OBJECT public: explicit SystemModel(QObject *parent = 0); ~SystemModel(); - QString description() const; + QString description() const Q_DECL_OVERRIDE; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - int rowCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument); + Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument) Q_DECL_OVERRIDE; protected Q_SLOTS: - virtual void refresh(); + void refresh() Q_DECL_OVERRIDE; private: void init(); QList m_entryList; }; #endif diff --git a/wheelinterceptor.h b/wheelinterceptor.h index a43eefc41..d27df5ab1 100644 --- a/wheelinterceptor.h +++ b/wheelinterceptor.h @@ -1,52 +1,52 @@ /************************************************************************** * Copyright (C) 2014-2015 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 WHEELINTERCEPTOR_H #define WHEELINTERCEPTOR_H #include #include class WheelInterceptor : public QQuickItem { Q_OBJECT Q_PROPERTY(QQuickItem* destination READ destination WRITE setDestination NOTIFY destinationChanged) public: WheelInterceptor(QQuickItem *parent = 0); ~WheelInterceptor(); QQuickItem *destination() const; void setDestination(QQuickItem *destination); Q_INVOKABLE QQuickItem *findWheelArea(QQuickItem *parent) const; Q_SIGNALS: void destinationChanged() const; void wheelMoved(QPoint delta) const; protected: - void wheelEvent(QWheelEvent *event); + void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; private: QPointer m_destination; }; #endif diff --git a/windowsystem.h b/windowsystem.h index a1aea44a2..387b8997e 100644 --- a/windowsystem.h +++ b/windowsystem.h @@ -1,54 +1,54 @@ /*************************************************************************** * Copyright (C) 2014 by Eike Hein * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 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 WINDOWSYSTEM_H #define WINDOWSYSTEM_H #include class QQuickItem; class QQuickWindow; class WindowSystem : public QObject { Q_OBJECT public: WindowSystem(QObject *parent = 0); ~WindowSystem(); - bool eventFilter(QObject *watched, QEvent *event); + bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; Q_INVOKABLE void forceActive(QQuickItem *item); Q_INVOKABLE bool isActive(QQuickItem *item); Q_INVOKABLE void monitorWindowFocus(QQuickItem *item); Q_INVOKABLE void monitorWindowVisibility(QQuickItem *item); Q_SIGNALS: void focusOut(QQuickWindow *window) const; void hidden(QQuickWindow *window) const; private Q_SLOTS: void monitoredWindowVisibilityChanged(bool visible) const; }; #endif