diff --git a/applications/settings/modules/time/timesettings.h b/applications/settings/modules/time/timesettings.h index b530f95f..d9a43c4f 100644 --- a/applications/settings/modules/time/timesettings.h +++ b/applications/settings/modules/time/timesettings.h @@ -1,121 +1,121 @@ /*************************************************************************** * * * Copyright 2011 Sebastian Kügler * * * * 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 TIMESETTINGS_H #define TIMESETTINGS_H #include #include #include #include #include //#include "settingsmodule.h" class TimeSettingsPrivate; /** * @class A class to manage time and date related settings. This class serves two functions: * - Provide a plugin implementation * - Provide a settings module * This is done from one class in order to simplify the code. You can export any QObject-based * class through qmlRegisterType(), however. */ class TimeSettings : public QObject { Q_OBJECT Q_PROPERTY(QString timeFormat READ timeFormat WRITE setTimeFormat NOTIFY timeFormatChanged) Q_PROPERTY(bool twentyFour READ twentyFour WRITE setTwentyFour NOTIFY twentyFourChanged) Q_PROPERTY(QString timeZone READ timeZone WRITE setTimeZone NOTIFY timeZoneChanged) Q_PROPERTY(QList timeZones READ timeZones WRITE setTimeZones NOTIFY timeZonesChanged) Q_PROPERTY(QObject* timeZonesModel READ timeZonesModel WRITE setTimeZonesModel NOTIFY timeZonesModelChanged) Q_PROPERTY(QTime currentTime READ currentTime WRITE setCurrentTime NOTIFY currentTimeChanged) Q_PROPERTY(QDate currentDate READ currentDate WRITE setCurrentDate NOTIFY currentDateChanged) Q_PROPERTY(QString ntpServer READ ntpServer WRITE setNtpServer NOTIFY ntpServerChanged) Q_PROPERTY(QStringList availableNtpServers READ availableNtpServers CONSTANT) Q_PROPERTY(QString currentTimeText READ currentTimeText NOTIFY currentTimeTextChanged) public: /** * @name Plugin Constructor * * @arg parent The parent object * @arg list Arguments, currently unused */ -// TimeSettings(QObject *parent, const QVariantList &list = QVariantList()); +// explicit TimeSettings(QObject *parent, const QVariantList &list = QVariantList()); /** * @name Settings Module Constructor * * @arg parent The parent object * @arg list Arguments, currently unused */ TimeSettings(); virtual ~TimeSettings(); QString currentTimeText(); QTime currentTime() const; void setCurrentTime(const QTime &time); QDate currentDate() const; void setCurrentDate(const QDate &date); QString ntpServer() const; void setNtpServer(const QString &server); QStringList availableNtpServers() const; QString timeFormat(); QString timeZone(); QList timeZones(); QObject* timeZonesModel(); bool twentyFour(); public Q_SLOTS: void setTimeZone(const QString &timezone); void setTimeZones(const QList timezones); void setTimeZonesModel(QObject* timezones); void setTimeFormat(const QString &timeFormat); void setTwentyFour(bool t); void timeout(); void saveTime(); Q_INVOKABLE void timeZoneFilterChanged(const QString &filter); Q_INVOKABLE void saveTimeZone(const QString &newtimezone); Q_SIGNALS: void currentTimeTextChanged(); void currentTimeChanged(); void currentDateChanged(); void twentyFourChanged(); void timeFormatChanged(); void timeZoneChanged(); void timeZonesChanged(); void timeZonesModelChanged(); void ntpServerChanged(); protected: QString findNtpUtility(); private: TimeSettingsPrivate* d; }; #endif // TIMESETTINGS_H diff --git a/applications/settings/modules/time/timesettingsplugin.h b/applications/settings/modules/time/timesettingsplugin.h index acf6efb6..54461802 100644 --- a/applications/settings/modules/time/timesettingsplugin.h +++ b/applications/settings/modules/time/timesettingsplugin.h @@ -1,38 +1,38 @@ /*************************************************************************** * * * Copyright 2011 Sebastian Kügler * * * * 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 TIMESETTINGSPLUGIN_H #define TIMESETTINGSPLUGIN_H #include "timesettingsplugin.h" #include #include class TimeSettingsPlugin : public QObject { Q_OBJECT public: - TimeSettingsPlugin(QObject *parent, const QVariantList &list = QVariantList()); + explicit TimeSettingsPlugin(QObject *parent, const QVariantList &list = QVariantList()); virtual ~TimeSettingsPlugin(); }; #endif // TIMESETTINGSPLUGIN_H diff --git a/applications/settings/modules/time/timezone.h b/applications/settings/modules/time/timezone.h index abdca900..e1af41e0 100644 --- a/applications/settings/modules/time/timezone.h +++ b/applications/settings/modules/time/timezone.h @@ -1,51 +1,51 @@ /*************************************************************************** * * * Copyright 2011 Sebastian Kügler * * * * 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 TIMEZONE_H #define TIMEZONE_H #include #include #include class TimeZonePrivate; class TimeZone : public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) public: - TimeZone(const KTimeZone &zone, QObject *parent = 0); + explicit TimeZone(const KTimeZone &zone, QObject *parent = 0); virtual ~TimeZone(); QString name(); public Q_SLOTS: void setName(const QString &n); Q_SIGNALS: void nameChanged(); private: TimeZonePrivate* d; }; #endif // TIMEZONE_H diff --git a/applications/settings/src/activesettingswindow.h b/applications/settings/src/activesettingswindow.h index e5109f72..7c2a270b 100644 --- a/applications/settings/src/activesettingswindow.h +++ b/applications/settings/src/activesettingswindow.h @@ -1,54 +1,54 @@ /*************************************************************************** * * * Copyright 2011 Sebastian Kügler * * * * 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 ACTIVESETTINGSWINDOW_H #define ACTIVESETTINGSWINDOW_H #include class View; /** * This class serves as the main window for Active Settings. * * @short Active Settings main window class * @author Sebastian Kügler * @version 0.1 */ class ActiveSettingsWindow : public QMainWindow { Q_OBJECT public: - ActiveSettingsWindow(const QString &url, QWidget *parent = 0); + explicit ActiveSettingsWindow(const QString &url, QWidget *parent = 0); virtual ~ActiveSettingsWindow(); QString name(); QIcon icon(); View* view(); protected: void closeEvent(QCloseEvent *); private: View *m_widget; }; #endif // ACTIVESETTINGSWINDOW_H diff --git a/applications/settings/src/view.h b/applications/settings/src/view.h index 8af4292e..036b113d 100644 --- a/applications/settings/src/view.h +++ b/applications/settings/src/view.h @@ -1,51 +1,51 @@ /*************************************************************************** * * * Copyright 2011 Sebastian Kügler * * * * 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 VIEW_H #define VIEW_H #include #include namespace Plasma { class Package; } class View : public QDeclarativeView { Q_OBJECT public: - View(const QString &url, QWidget *parent = 0 ); + explicit View(const QString &url, QWidget *parent = 0 ); ~View(); Q_SIGNALS: void titleChanged(const QString&); private Q_SLOTS: void onStatusChanged(QDeclarativeView::Status status); void updateStatus(); private: Plasma::Package *m_package; QDeclarativeItem* m_settingsRoot; }; #endif // VIEW_H diff --git a/applications/videoplayer/src/view.h b/applications/videoplayer/src/view.h index 03668d46..83029f66 100644 --- a/applications/videoplayer/src/view.h +++ b/applications/videoplayer/src/view.h @@ -1,70 +1,70 @@ /*************************************************************************** * * * Copyright 2011 Sebastian Kügler * * Copyright 2011 Marco Martin * * * * 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 VIEW_H #define VIEW_H #include #include #include #include #include #include #include class KMainWindow; class QDeclarativeItem; class QProgressBar; class QSignalMapper; class Page; class ScriptApi; class VideoPlayer; namespace Plasma { class Package; } class AppView : public QDeclarativeView { Q_OBJECT public: - AppView(const QString &url, QWidget *parent = 0 ); + explicit AppView(const QString &url, QWidget *parent = 0 ); ~AppView(); QString name() const; void setUseGL(const bool on); bool useGL() const; private Q_SLOTS: void onStatusChanged(QDeclarativeView::Status status); private: QDeclarativeItem* m_videoPlayer; Plasma::Package *m_package; bool m_useGL; }; #endif // VIEW_H diff --git a/applications/webbrowser/src/activebrowserwindow.h b/applications/webbrowser/src/activebrowserwindow.h index 0ec4d3e7..95e58c6e 100644 --- a/applications/webbrowser/src/activebrowserwindow.h +++ b/applications/webbrowser/src/activebrowserwindow.h @@ -1,62 +1,62 @@ /*************************************************************************** * * * Copyright 2011 Sebastian Kügler * * * * 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 ACTIVEBROWSERWINDOW_H #define ACTIVEBROWSERWINDOW_H #include class View; /** * This class serves as the main window for the Active Webbrowser. * * @short Active Webbrowser main window class * @author Sebastian Kügler * @version 0.1 */ class ActiveBrowserWindow : public QMainWindow { Q_OBJECT public: - ActiveBrowserWindow(const QString &url, QWidget *parent = 0); + explicit ActiveBrowserWindow(const QString &url, QWidget *parent = 0); virtual ~ActiveBrowserWindow(); QString name(); QIcon icon(); void setUseGL(const bool on); bool useGL() const; View* view(); Q_SIGNALS: void newWindow(const QString &url); protected Q_SLOTS: void setCaption(const QString &caption); protected: void closeEvent(QCloseEvent *); private: View *m_widget; }; #endif // REKONQACTIVE_H diff --git a/applications/webbrowser/src/completionitem.h b/applications/webbrowser/src/completionitem.h index a0770634..eacebc89 100644 --- a/applications/webbrowser/src/completionitem.h +++ b/applications/webbrowser/src/completionitem.h @@ -1,72 +1,72 @@ /*************************************************************************** * * * Copyright 2011 Sebastian Kügler * * * * 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 COMPLETIONITEM_H #define COMPLETIONITEM_H #include #include #include class CompletionItemPrivate; class CompletionItem : public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged) Q_PROPERTY(QImage preview READ preview WRITE setPreview NOTIFY previewChanged) Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged) public: - CompletionItem(const QString &name = QString(), + explicit CompletionItem(const QString &name = QString(), const QString &url = QString(), const QImage &i = QImage(), QObject *parent = 0 ); CompletionItem(QObject *parent); //CompletionItem(Nepomuk::Resource resource, QObject *parent = 0); ~CompletionItem(); void setResource(Nepomuk::Resource resource); QString name(); QString iconName(); QString url(); QImage preview(); QUrl resourceUri(); public Q_SLOTS: void setName(const QString &name); void setUrl(const QString &url); void setPreview(const QImage &image); void setIconName(const QString &iconName); Q_SIGNALS: void nameChanged(); void urlChanged(); void previewChanged(); void iconNameChanged(); private: CompletionItemPrivate* d; }; #endif // COMPLETIONITEM_H diff --git a/applications/webbrowser/src/view.h b/applications/webbrowser/src/view.h index 9d73b1d4..0c269609 100644 --- a/applications/webbrowser/src/view.h +++ b/applications/webbrowser/src/view.h @@ -1,92 +1,92 @@ /*************************************************************************** * * * Copyright 2011 Sebastian Kügler * * * * 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 VIEW_H #define VIEW_H #include #include #include class QDeclarativeItem; class QProgressBar; class QSignalMapper; class Page; class ScriptApi; class QNetworkRequest; /** Per-website data */ struct WebsiteOptions { QString title; QString url; QString mimetype; QString comment; int rating; }; namespace Plasma { class Package; } class CompletionModel; class View : public QDeclarativeView { Q_OBJECT public: - View(const QString &url, QWidget *parent = 0 ); + explicit View(const QString &url, QWidget *parent = 0 ); ~View(); WebsiteOptions* options() const; QString name() const; void setUseGL(const bool on); bool useGL() const; public Q_SLOTS: void setBookmarks(); Q_SIGNALS: void titleChanged(const QString&); void newWindow(const QString &url); private: WebsiteOptions *m_options; QDeclarativeItem* m_webBrowser; QDeclarativeItem* m_urlInput; private Q_SLOTS: void onStatusChanged(QDeclarativeView::Status status); void urlChanged(); void urlFilterChanged(); void onTitleChanged(); void onUrlEntered(const QString&); private: QString filterUrl(const QString &url); Plasma::Package *m_package; bool m_useGL; CompletionModel* m_completionModel; }; #endif // VIEW_H diff --git a/components/metadatamodel/test/dynamictreemodel.h b/components/metadatamodel/test/dynamictreemodel.h index 96337554..e2f73989 100644 --- a/components/metadatamodel/test/dynamictreemodel.h +++ b/components/metadatamodel/test/dynamictreemodel.h @@ -1,197 +1,197 @@ /**************************************************************************** ** ** Copyright (C) 2009 Stephen Kelly ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef DYNAMICTREEMODEL_H #define DYNAMICTREEMODEL_H #include #include #include class DynamicTreeModel : public QAbstractItemModel { Q_OBJECT public: DynamicTreeModel(QObject *parent = 0); QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QModelIndex parent(const QModelIndex &index) const; int rowCount(const QModelIndex &index = QModelIndex()) const; int columnCount(const QModelIndex &index = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; void clear(); protected slots: /** Finds the parent id of the string with id @p searchId. Returns -1 if not found. */ qint64 findParentId(qint64 searchId) const; private: QHash m_items; QHash > > m_childItems; qint64 nextId; qint64 newId() { return nextId++; }; QModelIndex m_nextParentIndex; int m_nextRow; int m_depth; int maxDepth; friend class ModelInsertCommand; friend class ModelMoveCommand; friend class ModelResetCommand; friend class ModelResetCommandFixed; }; class ModelChangeCommand : public QObject { Q_OBJECT public: - ModelChangeCommand( DynamicTreeModel *model, QObject *parent = 0 ); + explicit ModelChangeCommand( DynamicTreeModel *model, QObject *parent = 0 ); virtual ~ModelChangeCommand() {} void setAncestorRowNumbers(QList rowNumbers) { m_rowNumbers = rowNumbers; } QModelIndex findIndex(QList rows); void setStartRow(int row) { m_startRow = row; } void setEndRow(int row) { m_endRow = row; } void setNumCols(int cols) { m_numCols = cols; } virtual void doCommand() = 0; protected: DynamicTreeModel* m_model; QList m_rowNumbers; int m_numCols; int m_startRow; int m_endRow; }; typedef QList ModelChangeCommandList; class ModelInsertCommand : public ModelChangeCommand { Q_OBJECT public: - ModelInsertCommand(DynamicTreeModel *model, QObject *parent = 0 ); + explicit ModelInsertCommand(DynamicTreeModel *model, QObject *parent = 0 ); virtual ~ModelInsertCommand() {} virtual void doCommand(); }; class ModelMoveCommand : public ModelChangeCommand { Q_OBJECT public: ModelMoveCommand(DynamicTreeModel *model, QObject *parent); virtual ~ModelMoveCommand() {} virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); virtual void doCommand(); virtual void emitPostSignal(); void setDestAncestors( QList rows ) { m_destRowNumbers = rows; } void setDestRow(int row) { m_destRow = row; } protected: QList m_destRowNumbers; int m_destRow; }; /** A command which does a move and emits a reset signal. */ class ModelResetCommand : public ModelMoveCommand { Q_OBJECT public: - ModelResetCommand(DynamicTreeModel* model, QObject* parent = 0); + explicity ModelResetCommand(DynamicTreeModel* model, QObject* parent = 0); virtual ~ModelResetCommand(); virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); virtual void emitPostSignal(); }; /** A command which does a move and emits a beginResetModel and endResetModel signals. */ class ModelResetCommandFixed : public ModelMoveCommand { Q_OBJECT public: - ModelResetCommandFixed(DynamicTreeModel* model, QObject* parent = 0); + explicit ModelResetCommandFixed(DynamicTreeModel* model, QObject* parent = 0); virtual ~ModelResetCommandFixed(); virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); virtual void emitPostSignal(); }; #endif diff --git a/components/metadatamodel/test/modeltest.h b/components/metadatamodel/test/modeltest.h index 53043554..ef45f70f 100644 --- a/components/metadatamodel/test/modeltest.h +++ b/components/metadatamodel/test/modeltest.h @@ -1,98 +1,98 @@ /**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef MODELTEST_H #define MODELTEST_H #include #include #include #include "../metadatamodel.h" class ModelTest : public QObject { Q_OBJECT public: - ModelTest( MetadataModel *model, QObject *parent = 0 ); + explicit ModelTest( MetadataModel *model, QObject *parent = 0 ); private Q_SLOTS: void nonDestructiveBasicTest(); void rowCount(); void columnCount(); void hasIndex(); void index(); void parent(); void data(); protected Q_SLOTS: void setResourceType(const QString type); void runAllTests(); void layoutAboutToBeChanged(); void layoutChanged(); void rowsAboutToBeInserted( const QModelIndex &parent, int start, int end ); void rowsInserted( const QModelIndex & parent, int start, int end ); void rowsAboutToBeRemoved( const QModelIndex &parent, int start, int end ); void rowsRemoved( const QModelIndex & parent, int start, int end ); private: void checkChildren( const QModelIndex &parent, int currentDepth = 0 ); MetadataModel *model; struct Changing { QModelIndex parent; int oldSize; QVariant last; QVariant next; }; QStack insert; QStack remove; bool fetchingMore; QList changing; }; #endif diff --git a/components/runnermodel/test/dynamictreemodel.h b/components/runnermodel/test/dynamictreemodel.h index 96337554..809b76a3 100644 --- a/components/runnermodel/test/dynamictreemodel.h +++ b/components/runnermodel/test/dynamictreemodel.h @@ -1,197 +1,197 @@ /**************************************************************************** ** ** Copyright (C) 2009 Stephen Kelly ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef DYNAMICTREEMODEL_H #define DYNAMICTREEMODEL_H #include #include #include class DynamicTreeModel : public QAbstractItemModel { Q_OBJECT public: DynamicTreeModel(QObject *parent = 0); QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QModelIndex parent(const QModelIndex &index) const; int rowCount(const QModelIndex &index = QModelIndex()) const; int columnCount(const QModelIndex &index = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; void clear(); protected slots: /** Finds the parent id of the string with id @p searchId. Returns -1 if not found. */ qint64 findParentId(qint64 searchId) const; private: QHash m_items; QHash > > m_childItems; qint64 nextId; qint64 newId() { return nextId++; }; QModelIndex m_nextParentIndex; int m_nextRow; int m_depth; int maxDepth; friend class ModelInsertCommand; friend class ModelMoveCommand; friend class ModelResetCommand; friend class ModelResetCommandFixed; }; class ModelChangeCommand : public QObject { Q_OBJECT public: - ModelChangeCommand( DynamicTreeModel *model, QObject *parent = 0 ); + explicit ModelChangeCommand( DynamicTreeModel *model, QObject *parent = 0 ); virtual ~ModelChangeCommand() {} void setAncestorRowNumbers(QList rowNumbers) { m_rowNumbers = rowNumbers; } QModelIndex findIndex(QList rows); void setStartRow(int row) { m_startRow = row; } void setEndRow(int row) { m_endRow = row; } void setNumCols(int cols) { m_numCols = cols; } virtual void doCommand() = 0; protected: DynamicTreeModel* m_model; QList m_rowNumbers; int m_numCols; int m_startRow; int m_endRow; }; typedef QList ModelChangeCommandList; class ModelInsertCommand : public ModelChangeCommand { Q_OBJECT public: - ModelInsertCommand(DynamicTreeModel *model, QObject *parent = 0 ); + explicit ModelInsertCommand(DynamicTreeModel *model, QObject *parent = 0 ); virtual ~ModelInsertCommand() {} virtual void doCommand(); }; class ModelMoveCommand : public ModelChangeCommand { Q_OBJECT public: ModelMoveCommand(DynamicTreeModel *model, QObject *parent); virtual ~ModelMoveCommand() {} virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); virtual void doCommand(); virtual void emitPostSignal(); void setDestAncestors( QList rows ) { m_destRowNumbers = rows; } void setDestRow(int row) { m_destRow = row; } protected: QList m_destRowNumbers; int m_destRow; }; /** A command which does a move and emits a reset signal. */ class ModelResetCommand : public ModelMoveCommand { Q_OBJECT public: - ModelResetCommand(DynamicTreeModel* model, QObject* parent = 0); + explicit ModelResetCommand(DynamicTreeModel* model, QObject* parent = 0); virtual ~ModelResetCommand(); virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); virtual void emitPostSignal(); }; /** A command which does a move and emits a beginResetModel and endResetModel signals. */ class ModelResetCommandFixed : public ModelMoveCommand { Q_OBJECT public: - ModelResetCommandFixed(DynamicTreeModel* model, QObject* parent = 0); + explicit ModelResetCommandFixed(DynamicTreeModel* model, QObject* parent = 0); virtual ~ModelResetCommandFixed(); virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); virtual void emitPostSignal(); }; #endif diff --git a/components/runnermodel/test/modeltest.h b/components/runnermodel/test/modeltest.h index 52b45d9d..f042ed2c 100644 --- a/components/runnermodel/test/modeltest.h +++ b/components/runnermodel/test/modeltest.h @@ -1,94 +1,94 @@ /**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef MODELTEST_H #define MODELTEST_H #include #include #include class ModelTest : public QObject { Q_OBJECT public: - ModelTest( QAbstractItemModel *model, QObject *parent = 0 ); + explicit ModelTest( QAbstractItemModel *model, QObject *parent = 0 ); private Q_SLOTS: void nonDestructiveBasicTest(); void rowCount(); void columnCount(); void hasIndex(); void index(); void parent(); void data(); protected Q_SLOTS: void runAllTests(); void layoutAboutToBeChanged(); void layoutChanged(); void rowsAboutToBeInserted( const QModelIndex &parent, int start, int end ); void rowsInserted( const QModelIndex & parent, int start, int end ); void rowsAboutToBeRemoved( const QModelIndex &parent, int start, int end ); void rowsRemoved( const QModelIndex & parent, int start, int end ); private: void checkChildren( const QModelIndex &parent, int currentDepth = 0 ); QAbstractItemModel *model; struct Changing { QModelIndex parent; int oldSize; QVariant last; QVariant next; }; QStack insert; QStack remove; bool fetchingMore; QList changing; }; #endif diff --git a/components/settings/settingsmodule.h b/components/settings/settingsmodule.h index 6a44bbc1..9f5bbd6f 100644 --- a/components/settings/settingsmodule.h +++ b/components/settings/settingsmodule.h @@ -1,72 +1,72 @@ /* * Copyright 2011 Sebastian Kügler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SETTINGSMODULE_H #define SETTINGSMODULE_H #include #include #include class SettingsModulePrivate; /** * @class SettingsModule A class to manage settings from declarative UIs. * This class serves two functions: * - Provide a plugin implementation * - Provide a settings module * This is done from one class in order to simplify the code. You can export * any QObject-based class through qmlRegisterType(), however. */ class KDE_EXPORT SettingsModule : public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) Q_PROPERTY(QString description READ description WRITE setDescription NOTIFY descriptionChanged) Q_PROPERTY(QString module READ module WRITE setModule NOTIFY moduleChanged) Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged) public: - SettingsModule(QObject *parent = 0, const QVariantList &v = QVariantList()); + explicit SettingsModule(QObject *parent = 0, const QVariantList &v = QVariantList()); virtual ~SettingsModule(); QString name(); QString description(); QString iconName(); QString module(); public Q_SLOTS: void setName(const QString &name); void setDescription(const QString &description); void setModule(const QString &module); void setIconName(const QString &iconName); Q_SIGNALS: void nameChanged(); void descriptionChanged(); void moduleChanged(); void iconNameChanged(); private: SettingsModulePrivate *d; }; #endif diff --git a/dataengines/apps/appsource.h b/dataengines/apps/appsource.h index 10a6ed78..6e3a055e 100644 --- a/dataengines/apps/appsource.h +++ b/dataengines/apps/appsource.h @@ -1,52 +1,52 @@ /* * Copyright 2009 Chani Armitage * Copyright 2011 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License version 2 as * published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef APPSOURCE_H #define APPSOURCE_H // plasma #include #include #include /** * App categories Source */ class AppSource : public Plasma::DataContainer { Q_OBJECT public: - AppSource(const QString &name, QObject *parent = 0); + explicit AppSource(const QString &name, QObject *parent = 0); ~AppSource(); protected: Plasma::Service *createService(); void populate(); private Q_SLOTS: void sycocaChanged(const QStringList &changes); private: QStringList m_categories; QStringList m_blackList; }; #endif // APPSOURCE_H diff --git a/dataengines/apps/categoriessource.h b/dataengines/apps/categoriessource.h index 84101759..7d386bc3 100644 --- a/dataengines/apps/categoriessource.h +++ b/dataengines/apps/categoriessource.h @@ -1,50 +1,50 @@ /* * Copyright 2009 Chani Armitage * Copyright 2011 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License version 2 as * published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CATEGORIESSOURCE_H #define CATEGORIESSOURCE_H // plasma #include #include #include /** * App Source */ class CategoriesSource : public Plasma::DataContainer { Q_OBJECT public: - CategoriesSource(const QString &name, QObject *parent = 0); + explicit CategoriesSource(const QString &name, QObject *parent = 0); ~CategoriesSource(); protected: void populate(); private Q_SLOTS: void sycocaChanged(const QStringList &changes); private: QStringList m_categories; }; #endif // CATEGORIESSOURCE_H diff --git a/dataengines/apps/groupsource.h b/dataengines/apps/groupsource.h index d2530a94..487f7e94 100644 --- a/dataengines/apps/groupsource.h +++ b/dataengines/apps/groupsource.h @@ -1,52 +1,52 @@ /* * Copyright 2009 Chani Armitage * Copyright 2011 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License version 2 as * published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GROUPSOURCE_H #define GROUPSOURCE_H // plasma #include #include #include /** * App group Source */ class GroupSource : public Plasma::DataContainer { Q_OBJECT public: - GroupSource(const QString &name, QObject *parent = 0); + explicit GroupSource(const QString &name, QObject *parent = 0); ~GroupSource(); protected: Plasma::Service *createService(); void populate(); void loadGroup(KServiceGroup::Ptr group); private Q_SLOTS: void sycocaChanged(const QStringList &changes); private: QString m_group; }; #endif // GROUPSOURCE_H diff --git a/dataengines/apps/groupssource.h b/dataengines/apps/groupssource.h index ac468240..d1995d1e 100644 --- a/dataengines/apps/groupssource.h +++ b/dataengines/apps/groupssource.h @@ -1,53 +1,53 @@ /* * Copyright 2009 Chani Armitage * Copyright 2011 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License version 2 as * published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GROUPSSOURCE_H #define GROUPSSOURCE_H // plasma #include #include #include /** * App groups listing Source */ class GroupsSource : public Plasma::DataContainer { Q_OBJECT public: - GroupsSource(const QString &name, QObject *parent = 0); + explicit GroupsSource(const QString &name, QObject *parent = 0); ~GroupsSource(); protected: void populate(); void loadGroup(KServiceGroup::Ptr group); private Q_SLOTS: void sycocaChanged(const QStringList &changes); private: QString m_group; int m_maxDepth; static int s_depth; }; #endif // GROUPSSOURCE_H diff --git a/shell/activity.h b/shell/activity.h index 45b45880..88653351 100644 --- a/shell/activity.h +++ b/shell/activity.h @@ -1,158 +1,158 @@ /* * Copyright 2010 Chani Armitage * * 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, * 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 ACTIVITY_H #define ACTIVITY_H #include #include #include class QSize; class QString; class QPixmap; class KConfig; namespace KActivities { class Consumer; } namespace Plasma { class Containment; class Context; } // namespace Plasma class DesktopCorona; /** * This class represents one activity. * an activity has an ID and a name, from nepomuk. * it also is associated with one or more containments. * * do NOT construct these yourself; use DesktopCorona::activity() */ class Activity : public QObject { Q_OBJECT public: - Activity(const QString &id, QObject *parent = 0); + explicit Activity(const QString &id, QObject *parent = 0); ~Activity(); QString id(); QString name(); QPixmap pixmap(const QSize &size); //FIXME do we want diff. sizes? updates? /** * whether this is the currently active activity */ bool isCurrent(); /** * state of the activity */ KActivities::Info::State state(); /** * save (copy) the activity out to an @p external config */ void save(KConfig &external); /** * return the containment that belongs on @p screen and @p desktop * or null if none exists */ Plasma::Containment* containmentForScreen(int screen, int desktop = -1); /** * make this activity's containments the active ones, loading them if necessary */ void ensureActive(); /** * set the plugin to use when creating new containments */ void setDefaultPlugin(const QString &plugin); /** * @returns the info object for this activity */ const KActivities::Info * info() const; signals: void infoChanged(); void stateChanged(); void currentStatusChanged(); public slots: void setName(const QString &name); void setIcon(const QString &icon); /** * delete the activity forever */ void remove(); /** * make this activity the current activity */ void activate(); /** * save and remove all our containments */ void close(); /** * load the saved containment(s) for this activity */ void open(); /** * forcibly insert a containment, replacing the one on its screen/desktop */ void replaceContainment(Plasma::Containment* containment); private slots: void updateActivityName(Plasma::Context *context); void containmentDestroyed(QObject *object); void activityChanged(); void activityStateChanged(KActivities::Info::State); void checkIfCurrent(); void removed(); void opened(); void closed(); private: void insertContainment(Plasma::Containment* cont, bool force=false); void insertContainment(Plasma::Containment* containment, int screen, int desktop); void checkScreens(); QString m_id; QString m_name; QString m_icon; QString m_plugin; QHash, Plasma::Containment*> m_containments; KActivities::Info *m_info; KActivities::Consumer *m_activityConsumer; bool m_current; }; #endif diff --git a/shell/activityconfiguration/backgroundlistmodel.h b/shell/activityconfiguration/backgroundlistmodel.h index 3b717ad1..fa5f725f 100644 --- a/shell/activityconfiguration/backgroundlistmodel.h +++ b/shell/activityconfiguration/backgroundlistmodel.h @@ -1,125 +1,125 @@ /* Copyright (c) 2007 Paolo Capriotti 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 BACKGROUNDLISTMODEL_H #define BACKGROUNDLISTMODEL_H #include #include #include #include #include #include #include class QEventLoop; class KProgressDialog; namespace Plasma { class Package; } // namespace Plasma class ImageSizeFinder : public QObject, public QRunnable { Q_OBJECT public: - ImageSizeFinder(const QString &path, QObject *parent = 0); + explicit ImageSizeFinder(const QString &path, QObject *parent = 0); void run(); Q_SIGNALS: void sizeFound(const QString &path, const QSize &size); private: QString m_path; }; class BackgroundListModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(int count READ count NOTIFY countChanged) public: enum { AuthorRole = Qt::UserRole, ScreenshotRole, ResolutionRole }; static const int BLUR_INCREMENT = 9; static const int MARGIN = 6; BackgroundListModel(Plasma::Wallpaper *listener, QObject *parent); virtual ~BackgroundListModel(); virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; Plasma::Package *package(int index) const; void reload(); void reload(const QStringList &selected); void addBackground(const QString &path); QModelIndex indexOf(const QString &path) const; virtual bool contains(const QString &bg) const; void setScreenshotSize(const QSize &size); QSize screenshotSize() const; int count() const {return m_packages.size();} void setTargetSizeHint(const QSize &size); Q_SIGNALS: void countChanged(); protected Q_SLOTS: void removeBackground(const QString &path); void showPreview(const KFileItem &item, const QPixmap &preview); void previewFailed(const KFileItem &item); void sizeFound(const QString &path, const QSize &s); void backgroundsFound(const QStringList &paths, const QString &token); void processPaths(const QStringList &paths); private: QSize bestSize(Plasma::Package *package) const; QWeakPointer m_structureParent; QList m_packages; QHash m_sizeCache; QHash m_previews; QHash m_previewJobs; KDirWatch m_dirwatch; QSize m_screenshotSize; QString m_findToken; QPixmap m_previewUnavailablePix; }; class BackgroundFinder : public QThread { Q_OBJECT public: BackgroundFinder(Plasma::Wallpaper *structureParent, const QStringList &p); ~BackgroundFinder(); QString token() const; signals: void backgroundsFound(const QStringList &paths, const QString &token); protected: void run(); private: Plasma::PackageStructure::Ptr m_structure; QStringList m_paths; QString m_token; }; #endif // BACKGROUNDLISTMODEL_H diff --git a/wallpapers/mobileimage/backgroundlistmodel.h b/wallpapers/mobileimage/backgroundlistmodel.h index 3525d63d..30736665 100644 --- a/wallpapers/mobileimage/backgroundlistmodel.h +++ b/wallpapers/mobileimage/backgroundlistmodel.h @@ -1,112 +1,112 @@ /* Copyright (c) 2007 Paolo Capriotti 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 BACKGROUNDLISTMODEL_H #define BACKGROUNDLISTMODEL_H #include #include #include #include #include #include #include class QEventLoop; class KProgressDialog; namespace Plasma { class Package; } // namespace Plasma class ImageSizeFinder : public QObject, public QRunnable { Q_OBJECT public: - ImageSizeFinder(const QString &path, QObject *parent = 0); + explicit ImageSizeFinder(const QString &path, QObject *parent = 0); void run(); Q_SIGNALS: void sizeFound(const QString &path, const QSize &size); private: QString m_path; }; class BackgroundListModel : public QAbstractListModel { Q_OBJECT public: BackgroundListModel(Plasma::Wallpaper *listener, QObject *parent); virtual ~BackgroundListModel(); virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; Plasma::Package *package(int index) const; void reload(); void reload(const QStringList &selected); void addBackground(const QString &path); QModelIndex indexOf(const QString &path) const; virtual bool contains(const QString &bg) const; void setWallpaperSize(const QSize& size); void setResizeMethod(Plasma::Wallpaper::ResizeMethod resizeMethod); protected Q_SLOTS: void removeBackground(const QString &path); void showPreview(const KFileItem &item, const QPixmap &preview); void previewFailed(const KFileItem &item); void sizeFound(const QString &path, const QSize &s); void backgroundsFound(const QStringList &paths, const QString &token); void processPaths(const QStringList &paths); private: QSize bestSize(Plasma::Package *package) const; Plasma::Wallpaper *m_structureParent; QList m_packages; QHash m_sizeCache; QHash m_previews; QHash m_previewJobs; KDirWatch m_dirwatch; QSize m_size; Plasma::Wallpaper::ResizeMethod m_resizeMethod; QString m_findToken; QPixmap m_previewUnavailablePix; }; class BackgroundFinder : public QThread { Q_OBJECT public: BackgroundFinder(Plasma::Wallpaper *structureParent, const QStringList &p); ~BackgroundFinder(); QString token() const; signals: void backgroundsFound(const QStringList &paths, const QString &token); protected: void run(); private: Plasma::PackageStructure::Ptr m_structure; QStringList m_paths; QString m_token; }; #endif // BACKGROUNDLISTMODEL_H diff --git a/widgetstrip-shell/singleview.h b/widgetstrip-shell/singleview.h index 6954b797..f33edf9a 100644 --- a/widgetstrip-shell/singleview.h +++ b/widgetstrip-shell/singleview.h @@ -1,59 +1,59 @@ /* * Copyright 2007-2008 Aaron Seigo * Copyright 2009 Marco Martin * * 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, * or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SINGLEVIEW_H #define SINGLEVIEW_H #include #include namespace Plasma { class Containment; class Applet; class Corona; } // namespace Plasma class SingleView; class SingleView : public Plasma::View { Q_OBJECT public: - SingleView(Plasma::Corona *corona, QWidget *parent=0); + explicit SingleView(Plasma::Corona *corona, QWidget *parent=0); ~SingleView(); void setUseGL(const bool on); bool useGL() const; Q_SIGNALS: void geometryChanged(); protected: void resizeEvent(QResizeEvent *event); private: Plasma::Corona *m_corona; bool m_useGL; }; #endif // multiple inclusion guard