diff --git a/Modules/about-distro/src/Module.h b/Modules/about-distro/src/Module.h index d3a22af..55337b0 100644 --- a/Modules/about-distro/src/Module.h +++ b/Modules/about-distro/src/Module.h @@ -1,75 +1,75 @@ /* Copyright (C) 2012 Harald Sitter 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) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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, see . */ #ifndef MODULE_H #define MODULE_H #include namespace Ui { class Module; } class Module : public KCModule { Q_OBJECT public: /** * Constructor. * * @param parent Parent widget of the module * @param args Arguments for the module */ explicit Module(QWidget *parent, const QVariantList &args = QVariantList()); /** * Destructor. */ ~Module(); /** * Overloading the KCModule load() function. */ - void load(); + void load() Q_DECL_OVERRIDE; /** * Overloading the KCModule save() function. */ - void save(); + void save() Q_DECL_OVERRIDE; /** * Overloading the KCModule defaults() function. */ - void defaults(); + void defaults() Q_DECL_OVERRIDE; private: void loadSoftware(); void loadHardware(); /** * UI */ Ui::Module *ui; /** \returns Version of plasmashell or an empty string when none was found */ QString plasmaVersion() const; }; #endif // MODULE_H diff --git a/Modules/devinfo/devicelisting.h b/Modules/devinfo/devicelisting.h index 6689733..80211b7 100644 --- a/Modules/devinfo/devicelisting.h +++ b/Modules/devinfo/devicelisting.h @@ -1,98 +1,98 @@ /* * devicelisting.h * * Copyright (C) 2009 David Hubner * * 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 DEVICELISTING #define DEVICELISTING //Solid #include #include #include #include //QT #include #include #include #include #include //Local #include "infopanel.h" #include "soldevice.h" #include "soldevicetypes.h" #include "devinfo.h" #include "solidhelper.h" //#include "nicsignals.h" //Kde class InfoPanel; class DevInfoPlugin; //class NicSignals; class DeviceListing : public QTreeWidget { Q_OBJECT private: enum show { ALL=0, RELEVANT }; public: DeviceListing(QWidget *, InfoPanel *, DevInfoPlugin *); ~DeviceListing(); static QTreeWidgetItem *getTreeWidgetItemFromUdi(QTreeWidget *widget, QString udi) { QTreeWidgetItemIterator treeWidget(widget); while (*treeWidget) { SolDevice *item = static_cast(*treeWidget); if(item->udi() == udi) return *treeWidget; ++treeWidget; } return NULL; } private: void populateListing(const show=RELEVANT); QTreeWidgetItem *createListItems(const Solid::DeviceInterface::Type &); - void contextMenuEvent(QContextMenuEvent *); + void contextMenuEvent(QContextMenuEvent *) Q_DECL_OVERRIDE; void createMenuActions(); QMap deviceMap; InfoPanel *iPanel; QAction *colAct, *expAct, *allAct, *relAct; DevInfoPlugin *status; //NicSignals *nicSig; public Q_SLOTS: void itemActivatedSlot(QTreeWidgetItem *,const int); void deviceAddedSlot(const QString); void deviceRemovedSlot(const QString); void collapseAllDevicesSlot(); void expandAllDevicesSlot(); void showAllDevicesSlot(); void showRelevantDevicesSlot(); }; #endif //DEVICELISTING diff --git a/Modules/devinfo/soldevicetypes.h b/Modules/devinfo/soldevicetypes.h index 05cf1cc..66d56f7 100644 --- a/Modules/devinfo/soldevicetypes.h +++ b/Modules/devinfo/soldevicetypes.h @@ -1,111 +1,111 @@ /* * soldevicetypes.h * * Copyright (C) 2009 David Hubner * * 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 SOLDEVICETYPES #define SOLDEVICETYPES //kde #include #include "soldevice.h" #include "infopanel.h" class QVListLayout; class SolProcessorDevice : public SolDevice { public: SolProcessorDevice(const Solid::DeviceInterface::Type &); SolProcessorDevice(QTreeWidgetItem *, const Solid::Device &); - QVListLayout *infoPanelLayout(); + QVListLayout *infoPanelLayout() Q_DECL_OVERRIDE; private: - void setDefaultDeviceText(); - void setDefaultListing(const Solid::DeviceInterface::Type &); + void setDefaultDeviceText() Q_DECL_OVERRIDE; + void setDefaultListing(const Solid::DeviceInterface::Type &) Q_DECL_OVERRIDE; }; class SolStorageDevice : public SolDevice { public: enum storageChildren { CREATECHILDREN , NOCHILDREN }; SolStorageDevice(const Solid::DeviceInterface::Type &); SolStorageDevice(QTreeWidgetItem *, const Solid::Device &, const storageChildren & = CREATECHILDREN); - QVListLayout *infoPanelLayout(); + QVListLayout *infoPanelLayout() Q_DECL_OVERRIDE; private: - void setDefaultDeviceText(); - void setDefaultListing(const Solid::DeviceInterface::Type &); + void setDefaultDeviceText() Q_DECL_OVERRIDE; + void setDefaultListing(const Solid::DeviceInterface::Type &) Q_DECL_OVERRIDE; }; class SolVolumeDevice : public SolDevice { public: SolVolumeDevice(const Solid::DeviceInterface::Type &); SolVolumeDevice(QTreeWidgetItem *, const Solid::Device &); - QVListLayout *infoPanelLayout(); + QVListLayout *infoPanelLayout() Q_DECL_OVERRIDE; private: - void setDefaultListing(const Solid::DeviceInterface::Type &); + void setDefaultListing(const Solid::DeviceInterface::Type &) Q_DECL_OVERRIDE; }; class SolMediaPlayerDevice : public SolDevice { public: SolMediaPlayerDevice(const Solid::DeviceInterface::Type &); SolMediaPlayerDevice(QTreeWidgetItem *, const Solid::Device &); - QVListLayout *infoPanelLayout(); + QVListLayout *infoPanelLayout() Q_DECL_OVERRIDE; private: - void setDefaultListing(const Solid::DeviceInterface::Type &); + void setDefaultListing(const Solid::DeviceInterface::Type &) Q_DECL_OVERRIDE; }; class SolCameraDevice : public SolDevice { public: SolCameraDevice(const Solid::DeviceInterface::Type &); SolCameraDevice(QTreeWidgetItem *, const Solid::Device &); - QVListLayout *infoPanelLayout(); + QVListLayout *infoPanelLayout() Q_DECL_OVERRIDE; private: - void setDefaultListing(const Solid::DeviceInterface::Type &); + void setDefaultListing(const Solid::DeviceInterface::Type &) Q_DECL_OVERRIDE; }; class SolBatteryDevice : public SolDevice { public: SolBatteryDevice(const Solid::DeviceInterface::Type &); SolBatteryDevice(QTreeWidgetItem *, const Solid::Device &); - QVListLayout *infoPanelLayout(); + QVListLayout *infoPanelLayout() Q_DECL_OVERRIDE; private: - void setDefaultListing(const Solid::DeviceInterface::Type &); + void setDefaultListing(const Solid::DeviceInterface::Type &) Q_DECL_OVERRIDE; }; #endif //SOLDEVICETYPES diff --git a/Modules/energy/batterymodel.h b/Modules/energy/batterymodel.h index 2518d89..ffff8e9 100644 --- a/Modules/energy/batterymodel.h +++ b/Modules/energy/batterymodel.h @@ -1,58 +1,58 @@ /*************************************************************************** * Copyright (C) 2015 Kai Uwe Broulik * * * * 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 KCM_ENERGYINFO_BATTERYMODEL_H #define KCM_ENERGYINFO_BATTERYMODEL_H #include #include #include #include class BatteryModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(int count READ rowCount NOTIFY countChanged) public: explicit BatteryModel(QObject *parent); virtual ~BatteryModel() = default; enum Roles { BatteryRole = Qt::UserRole, UdiRole }; Q_INVOKABLE Solid::Battery *get(int index) const; Q_INVOKABLE QString udi(int index) const; - QVariant data(const QModelIndex &index, int role) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - QHash roleNames() const; + QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QHash roleNames() const Q_DECL_OVERRIDE; signals: void countChanged(); private: QList m_batteries; }; #endif // KCM_ENERGYINFO_BATTERYMODEL_H diff --git a/Modules/info/info.h b/Modules/info/info.h index 39ceb04..f0344d1 100644 --- a/Modules/info/info.h +++ b/Modules/info/info.h @@ -1,54 +1,54 @@ /* Copyright 1998 Helge Deller deller@gmx.de 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) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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, see . */ #ifndef _INFO_H_ #define _INFO_H_ #include #include #include #include #include #include #include #include "os_current.h" class KInfoListWidget : public KCModule { public: KInfoListWidget(const QString &_title, QWidget *parent, bool _getlistbox (QTreeWidget*) = NULL); - virtual void load(); - virtual QString quickHelp() const; + void load() Q_DECL_OVERRIDE; + QString quickHelp() const Q_DECL_OVERRIDE; private: QTreeWidget* tree; bool (*getlistbox) (QTreeWidget*); QString title; QLabel *noInfoText; QString errorString; QStackedWidget *widgetStack; }; #endif diff --git a/Modules/memory/memory.h b/Modules/memory/memory.h index 85c4878..e1a3cfc 100644 --- a/Modules/memory/memory.h +++ b/Modules/memory/memory.h @@ -1,69 +1,69 @@ /* Copyright 2010 Nicolas Ternisien 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.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef KCONTROL_MEMORY_H #define KCONTROL_MEMORY_H #include #include #include #include #include #include "base.h" class QGroupBox; class QPushButton; class ChartWidget; class KCMMemory : public KCModule { Q_OBJECT public: explicit KCMMemory(QWidget *parent = NULL, const QVariantList &list = QVariantList()); ~KCMMemory(); - QString quickHelp() const; + QString quickHelp() const Q_DECL_OVERRIDE; private Q_SLOTS: void updateMemoryText(); void updateMemoryGraphics(); void updateDatas(); private: QGroupBox* initializeText(); QGroupBox* initializeCharts(); QTimer *timer; ChartWidget* totalMemory; ChartWidget* physicalMemory; ChartWidget* swapMemory; void fetchValues(); }; #endif diff --git a/Modules/memory/physicalMemoryChart.h b/Modules/memory/physicalMemoryChart.h index 6e2cbe0..1b1592b 100644 --- a/Modules/memory/physicalMemoryChart.h +++ b/Modules/memory/physicalMemoryChart.h @@ -1,52 +1,52 @@ /* Copyright 2010 Nicolas Ternisien 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.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef PHYSICAL_MEMORY_CHART_H #define PHYSICAL_MEMORY_CHART_H #include #include "chartWidget.h" class QWidget; class QPaintEvent; class PhysicalMemoryChart : public Chart { public: /** * Initialize the list view item and task. */ PhysicalMemoryChart(QWidget* parent = NULL); protected: - virtual void paintEvent(QPaintEvent* event); + void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE; private: bool colorsInitialized; QList colors; QList texts; }; #endif // PHYSICAL_MEMORY_CHART_H diff --git a/Modules/memory/swapMemoryChart.h b/Modules/memory/swapMemoryChart.h index 4ac5a45..a1e28fa 100644 --- a/Modules/memory/swapMemoryChart.h +++ b/Modules/memory/swapMemoryChart.h @@ -1,52 +1,52 @@ /* Copyright 2010 Nicolas Ternisien 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.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef SWAP_MEMORY_CHART_H #define SWAP_MEMORY_CHART_H #include #include "chartWidget.h" class QWidget; class QPaintEvent; class SwapMemoryChart : public Chart { public: /** * Initialize the list view item and task. */ SwapMemoryChart(QWidget* parent = NULL); protected: - virtual void paintEvent(QPaintEvent* event); + void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE; private: bool colorsInitialized; QList colors; QList texts; }; #endif // SWAP_MEMORY_CHART_H diff --git a/Modules/memory/totalMemoryChart.h b/Modules/memory/totalMemoryChart.h index 4a8f7d8..5eb16c3 100644 --- a/Modules/memory/totalMemoryChart.h +++ b/Modules/memory/totalMemoryChart.h @@ -1,52 +1,52 @@ /* Copyright 2010 Nicolas Ternisien 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.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef TOTAL_MEMORY_CHART_H #define TOTAL_MEMORY_CHART_H #include #include "chartWidget.h" class QWidget; class QPaintEvent; class TotalMemoryChart : public Chart { public: /** * Initialize the list view item and task. */ TotalMemoryChart(QWidget* parent = NULL); protected: - virtual void paintEvent(QPaintEvent* event); + void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE; private: bool colorsInitialized; QList colors; QList texts; }; #endif // TOTAL_MEMORY_CHART_H diff --git a/Modules/pci/kcm_pci.h b/Modules/pci/kcm_pci.h index e5f014b..f848923 100644 --- a/Modules/pci/kcm_pci.h +++ b/Modules/pci/kcm_pci.h @@ -1,45 +1,45 @@ /* * memory.h * * Copyright (C) 2008 Nicolas Ternisien * * 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 KCONTROL_KCM_PCI_H #define KCONTROL_KCM_PCI_H #include #include "os_current.h" class QTreeWidget; class KCMPci : public KCModule { Q_OBJECT public: explicit KCMPci(QWidget *parent = NULL, const QVariantList &list = QVariantList()); ~KCMPci(); - virtual void load(); - virtual QString quickHelp() const; + void load() Q_DECL_OVERRIDE; + QString quickHelp() const Q_DECL_OVERRIDE; private: QTreeWidget* tree; }; #endif diff --git a/Modules/samba/main.cpp b/Modules/samba/main.cpp index bb27767..fac18c6 100644 --- a/Modules/samba/main.cpp +++ b/Modules/samba/main.cpp @@ -1,105 +1,105 @@ /* * main.cpp for the samba kcontrol module * * 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. */ #include #include #include #include #include #include "kcmsambaimports.h" #include "kcmsambalog.h" #include "kcmsambastatistics.h" #include "ksmbstatus.h" #include class SambaContainer : public KCModule { Q_OBJECT public: SambaContainer(QWidget *parent=0, const QVariantList &list = QVariantList()); virtual ~SambaContainer(); - virtual void load(); - virtual void save(); + void load() Q_DECL_OVERRIDE; + void save() Q_DECL_OVERRIDE; private: KConfig config; QTabWidget tabs; NetMon status; ImportsView imports; LogView logView; StatisticsView statisticsView; }; K_PLUGIN_FACTORY(SambaFactory, registerPlugin(); ) SambaContainer::SambaContainer(QWidget *parent, const QVariantList&) : KCModule(parent), config(QStringLiteral("kcmsambarc")), tabs(this), status(&tabs, &config), imports(&tabs, &config), logView(&tabs, &config), statisticsView(&tabs, &config) { QVBoxLayout *layout = new QVBoxLayout( this ); layout->setMargin(0); layout->setSpacing(0); layout->addWidget(&tabs); tabs.addTab(&status, i18n("&Exports")); tabs.addTab(&imports, i18n("&Imports")); tabs.addTab(&logView, i18n("&Log")); tabs.addTab(&statisticsView, i18n("&Statistics")); connect(&logView, &LogView::contentsChanged, &statisticsView, &StatisticsView::setListInfo); setButtons(Help); setQuickHelp(i18n("

The Samba and NFS Status Monitor is a front end to the programs" " smbstatus and showmount. Smbstatus reports on current" " Samba connections, and is part of the suite of Samba tools, which" " implements the SMB (Session Message Block) protocol, also called the" " NetBIOS or LanManager protocol. This protocol can be used to provide" " printer sharing or drive sharing services on a network including" " machines running the various flavors of Microsoft Windows.

")); KAboutData *about = new KAboutData(i18n("kcmsamba"), i18n("System Information Control Module"), QString(), QString(), KAboutLicense::GPL, i18n("(c) 2002 KDE Information Control Module Samba Team")); about->addAuthor(i18n("Michael Glauche"), QString(), QStringLiteral("glauche@isa.rwth-aachen.de")); about->addAuthor(i18n("Matthias Hoelzer"), QString(), QStringLiteral("hoelzer@kde.org")); about->addAuthor(i18n("David Faure"), QString(), QStringLiteral("faure@kde.org")); about->addAuthor(i18n("Harald Koschinski"), QString(), QStringLiteral("Harald.Koschinski@arcormail.de")); about->addAuthor(i18n("Wilco Greven"), QString(), QStringLiteral("greven@kde.org")); about->addAuthor(i18n("Alexander Neundorf"), QString(), QStringLiteral("neundorf@kde.org")); setAboutData(about); } SambaContainer::~SambaContainer() { save(); } void SambaContainer::load() { status.loadSettings(); imports.loadSettings(); logView.loadSettings(); statisticsView.loadSettings(); } void SambaContainer::save() { status.saveSettings(); imports.saveSettings(); logView.saveSettings(); statisticsView.saveSettings(); config.sync(); } #include "main.moc" diff --git a/Modules/usbview/kcmusb.h b/Modules/usbview/kcmusb.h index 2bca751..41a43ac 100644 --- a/Modules/usbview/kcmusb.h +++ b/Modules/usbview/kcmusb.h @@ -1,43 +1,43 @@ /*************************************************************************** * Copyright (C) 2001 by Matthias Hoelzer-Kluepfel * * * * 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. * * * ***************************************************************************/ #ifndef _KCMUSB_H #define _KCMUSB_H #include #include class QTreeWidget; class QTreeWidgetItem; class QTextEdit; class USBViewer : public KCModule { Q_OBJECT public: explicit USBViewer(QWidget *parent = 0L, const QVariantList &list=QVariantList()); - void load(); + void load() Q_DECL_OVERRIDE; protected Q_SLOTS: void selectionChanged(QTreeWidgetItem *item); void refresh(); private: QMap _items; QTreeWidget *_devices; QTextEdit *_details; }; #endif diff --git a/ToolTips/tooltipmanager.h b/ToolTips/tooltipmanager.h index 65630a0..f9e2186 100644 --- a/ToolTips/tooltipmanager.h +++ b/ToolTips/tooltipmanager.h @@ -1,82 +1,82 @@ /******************************************************************************* * Copyright (C) 2008 by Konstantin Heil * * * * 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 TOOLTIPMANAGER_H #define TOOLTIPMANAGER_H #include #include class QLayout; class QAbstractItemView; /** * @brief Manages the tooltips for an item view. * * When hovering an item, a tooltip is shown after * a short timeout. The tooltip is hidden again when the * viewport is hovered or the item view has been left. */ class ToolTipManager : public QObject { Q_OBJECT public: /** * Standard constructor. The ToolTipManager will start handling ToolTip events on the provided * view immediately. * * @param parent The view which will have the tooltips displayed for. */ explicit ToolTipManager(QAbstractItemView* parent); virtual ~ToolTipManager(); public Q_SLOTS: /** * Hides the currently shown tooltip. Invoking this method is * only needed when the tooltip should be hidden although * an item is hovered. */ void hideToolTip(); protected: /** * Please see the Qt documentation for more details. * * @param watched The object that was being watched. * @param event The event object. * @returns true if the event was handled in this filter, or false if it was not. */ - virtual bool eventFilter( QObject* watched, QEvent* event ); + bool eventFilter( QObject* watched, QEvent* event ) Q_DECL_OVERRIDE; private Q_SLOTS: void prepareToolTip(); void requestToolTip(const QModelIndex& index); private: void showToolTip( const QModelIndex& menuItem ); QWidget * createTipContent( const QModelIndex& item ); QLayout * generateToolTipLine( const QModelIndex& item, QWidget * toolTip, const QSize& iconSize, bool comment ); class Private; ToolTipManager::Private* d; }; #endif diff --git a/infocenter.h b/infocenter.h index 55a10a2..689b3e6 100644 --- a/infocenter.h +++ b/infocenter.h @@ -1,157 +1,157 @@ /* * infocenter.h * * Copyright (C) 2010 David Hubner * * 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 INFOCENTER #define INFOCENTER //KDE #include #include #include #include #include //QT #include #include #include #include #include //Local #include "sidepanel.h" #include "kcmcontainer.h" #include "infokcmmodel.h" #include "kcmtreeitem.h" #include "tooltipmanager.h" class KcmContainer; class ToolTipManager; class KcmTreeItem; class KInfoCenter : public KXmlGuiWindow { Q_OBJECT public: /** * Create KInfoCenter main window */ KInfoCenter(); /** * Destory KInfoCenter object */ ~KInfoCenter(); /** * Event filter to move KCMContainer to be level with * the side menu. * * @param watched object being watched * @param event event object containing event information */ - bool eventFilter(QObject *watched, QEvent *event); + bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; public Q_SLOTS: /** * Triggered when mouse is clicked on a treeview item * * @param item item selected via mouse */ void itemClickedSlot(const KcmTreeItem *item); /** * Triggered when help toolbar action is used. */ void helpClickedSlot(); /** * Triggered when the about KCM action is used * in the help menu. */ void aboutKcmSlot(); /** * Show a error message box * * @param parent parent object * @param errorMessage error message text */ static void showError(QWidget *parent, const QString& errorMessage); private: /** * Create main window and splitter */ void createMainFrame(); /** * Create top toolbar on main window and setup toolbar * actions. */ void createToolBar(); /** * Create side menu frame including search bar */ void createMenuFrame(); /** * Detect if export and help buttons should be enabled * * @param buttons buttons to check */ void setButtons(const KCModule::Buttons buttons); /** * Load KCM into KCMContainer * * @param kcmItem KCM to be loaded */ void setKcm(const KcmTreeItem *kcmItem); /** * Set enable state on KCM About menu action, * export toolbar action and help toolbar action. */ void resetCondition(); KcmContainer *m_contain; QSplitter *m_splitter; QAction *m_aboutKcm; QAction *m_searchAction; QAction *m_moduleHelpAction; KActionMenu *m_helpAction; QWidget *m_cWidget; KLineEdit *m_searchText; SidePanel *m_sideMenu; ToolTipManager *m_toolTips; }; #endif //INFOCENTER diff --git a/infokcmmodel.h b/infokcmmodel.h index 4a26203..cb02c11 100644 --- a/infokcmmodel.h +++ b/infokcmmodel.h @@ -1,136 +1,136 @@ /* * infokcmmodel.h * * Copyright (C) 2010 David Hubner * * 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 INFOKCMMODEL #define INFOKCMMODEL //KDE #include //QT #include #include #include #include #include #include //Local #include "kcmtreeitem.h" class KcmTreeItem; class InfoKcmModel : public QAbstractItemModel { Q_OBJECT public: /** * Create InfoKcmModel object. * Abstract data model to display KCM's for a tree view * * @param parent objects parent */ InfoKcmModel(QObject *parent); ~InfoKcmModel(); /** * Get index of item in model * * @param row row position * @param column column position * @param parent parent of object * @return index of object */ - QModelIndex index(int row, int column, const QModelIndex& parent) const; + QModelIndex index(int row, int column, const QModelIndex& parent) const Q_DECL_OVERRIDE; QModelIndex index(int row, int column, KcmTreeItem *parent) const; /** * Get parent of item in model */ - QModelIndex parent(const QModelIndex& index) const; + QModelIndex parent(const QModelIndex& index) const Q_DECL_OVERRIDE; /** * Get amount of rows under parent */ - int rowCount(const QModelIndex& parent) const; + int rowCount(const QModelIndex& parent) const Q_DECL_OVERRIDE; /** * Get amount of columns under parent */ - int columnCount(const QModelIndex& parent) const; + int columnCount(const QModelIndex& parent) const Q_DECL_OVERRIDE; /** * Get the stored data for a role * * @param index objects index * @param role role to retrieve data about */ - QVariant data(const QModelIndex& index, int role) const; + QVariant data(const QModelIndex& index, int role) const Q_DECL_OVERRIDE; /** * Get header information */ - QVariant headerData(int, Qt::Orientation, int) const; + QVariant headerData(int, Qt::Orientation, int) const Q_DECL_OVERRIDE; /** * Get set flags for a treeitem */ - Qt::ItemFlags flags(const QModelIndex &) const; + Qt::ItemFlags flags(const QModelIndex &) const Q_DECL_OVERRIDE; /** * Get the first valid item on the treeview * Checks main root items only * * @return index of valid item */ QModelIndex firstValid() const; /** * Get all KCM keywords for all KCMs stored in the model */ QStringList allChildrenKeywords(); /** * Get QModelIndex of a KcmTreeItem */ QModelIndex indexOf(KcmTreeItem *item); private: /** * Init tree items */ void createTreeItems(); /** * Get a certain KCM's keywords */ QStringList childrenKeywords(KcmTreeItem *kcmItem); KService::List m_moduleList; KcmTreeItem *m_root; }; #endif // INFOKCMMODEL diff --git a/infokcmproxymodel.h b/infokcmproxymodel.h index d90de48..b67fa20 100644 --- a/infokcmproxymodel.h +++ b/infokcmproxymodel.h @@ -1,61 +1,61 @@ /* * infokcmproxymodel.h * * Copyright (C) 2010 David Hubner * * 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 INFOKCMPROXYMODEL #define INFOKCMPROXYMODEL //QT #include #include #include //Local #include "kcmtreeitem.h" class InfoKcmProxyModel : public QSortFilterProxyModel { public: /** * Create InfoKcMProxyModel object. Used to filter out * and sort a tree view. * * @param parent objects parent */ InfoKcmProxyModel(QObject *parent); /** * Check if left item is less than right item * Uses X-KDE-Weight for measurements */ - bool lessThan(const QModelIndex &, const QModelIndex &) const; + bool lessThan(const QModelIndex &, const QModelIndex &) const Q_DECL_OVERRIDE; private: /** * Filter out rows * Used in search implementation */ - bool filterAcceptsRow(int, const QModelIndex &) const; + bool filterAcceptsRow(int, const QModelIndex &) const Q_DECL_OVERRIDE; }; #endif // INFOKCMPROXYMODEL diff --git a/kcmcategoryitem.h b/kcmcategoryitem.h index efe7fd7..d03cada 100644 --- a/kcmcategoryitem.h +++ b/kcmcategoryitem.h @@ -1,98 +1,98 @@ /* * kcmcategoryitem.h * * Copyright (C) 2010 David Hubner * * 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 KCMCATEGORYITEM #define KCMCATEGORYITEM #include "kcmtreeitem.h" //KDE #include #include class KcmCategoryItem : public KcmTreeItem { public: /** * Category Tree Item for InfoKcmModel. Holds information about a Category * * @param module pointer to KCM module * @param parent objects parent */ explicit KcmCategoryItem(const KService::Ptr module, KcmTreeItem *parent=0); /** * Category Tree Item for InfoKcmModel. Holds information about a Category * * @note Used for root folder objects */ explicit KcmCategoryItem(const QString& category); /** * Get data of tree item */ - QString data() const; + QString data() const Q_DECL_OVERRIDE; /** * Get category of tree item. * Set in X-KDE-KInfoCenter-Category */ - QString category() const; + QString category() const Q_DECL_OVERRIDE; /** * Gets the item type. */ - itemType type() const; + itemType type() const Q_DECL_OVERRIDE; /** * Get tree item KCMs Data */ - KCModuleInfo kcm() const; + KCModuleInfo kcm() const Q_DECL_OVERRIDE; /** * Get tree items KCM's weight */ - int weight(); + int weight() Q_DECL_OVERRIDE; /** * Get icon tied to KCM */ - QIcon icon() const; + QIcon icon() const Q_DECL_OVERRIDE; /** * Get whatsThis information from KCM */ - QString whatsThis() const; + QString whatsThis() const Q_DECL_OVERRIDE; /** * Get KCM tree item keywords */ - QStringList keywords() const; + QStringList keywords() const Q_DECL_OVERRIDE; private: const QString m_category; }; #endif //KCMCATEGORYITEM diff --git a/sidepanel.h b/sidepanel.h index ae15a3e..5b2bea3 100644 --- a/sidepanel.h +++ b/sidepanel.h @@ -1,138 +1,138 @@ /* * sidepanel.h * * Copyright (C) 2010 David Hubner * * 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 SIDEPANEL #define SIDEPANEL //QT #include #include #include #include #include #include //Local #include "infokcmmodel.h" #include "infokcmproxymodel.h" class InfoKcmModel; class InfoKcmProxyModel; class SidePanel : public QTreeView { Q_OBJECT public: /** * Create Side Panel Widget, including search line edit. * * @param parent objects parent */ SidePanel(QWidget *parent); /** * Destory SidePanel object */ ~SidePanel(); /** * Select the first valid item in TreeView */ void changeToFirstValidItem(); /** * Map a QAbstractItemModel index to a QSortFilterProxyModel index */ QModelIndex mapToProxySource(const QModelIndex&); /** * Get all the treeview items keywords */ QStringList allChildKeywords(); /** * Expand and collapse an Item ( if an expandable item ) */ void toggleExpand(const KcmTreeItem *); Q_SIGNALS: /** * Emitted when menu item is clicked */ void clicked(const KcmTreeItem *); private Q_SLOTS: /** * Triggered when treeview item is clicked */ void clickedSlot(const QModelIndex &index); public Q_SLOTS: /** * Triggered when collapseAll is selected from tree view * item menu */ void collapseAllSlot(); /** * Triggered when ExpandAll is selected from tree view * item menu */ void expandAllSlot(); /** * Filter out all but menu items that fit certain keywords */ void filterSideMenuSlot(const QString &); /** * Triggered when Reset Search is selected from tree view * item menu */ void resetSearchSlot(); private: /** * Created actions for the tree view item menu */ void createMenuActions(); /** * Create treeview item menu */ - void contextMenuEvent(QContextMenuEvent *event); + void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE; InfoKcmModel *m_model; InfoKcmProxyModel *m_proxyModel; QAction *colAct; QAction *expAct; QAction *resetAct; }; #endif //SIDEPANEL