Apply the astyle-kdelibs script

This commit is contained in:
Kevin Ottens 2014-04-26 01:45:47 +02:00
parent c2aa81e2d4
commit 72ba7b4146
210 changed files with 4821 additions and 4923 deletions

View File

@ -206,7 +206,5 @@ void ConfigLoaderTest::ulongLongDefaultValue()
QVERIFY(typeItem->isEqual(Q_UINT64_C(9223372036854775806)));
}
QTEST_MAIN(ConfigLoaderTest)

View File

@ -45,7 +45,6 @@
#include <QtCore/QList>
#include <QtCore/QTimer>
DynamicTreeModel::DynamicTreeModel(QObject *parent)
: QAbstractItemModel(parent),
nextId(1)
@ -57,9 +56,9 @@ QModelIndex DynamicTreeModel::index(int row, int column, const QModelIndex &pare
// if (column != 0)
// return QModelIndex();
if ( column < 0 || row < 0 )
if (column < 0 || row < 0) {
return QModelIndex();
}
QList<QList<qint64> > childIdColumns = m_childItems.value(parent.internalId());
@ -71,16 +70,19 @@ QModelIndex DynamicTreeModel::index(int row, int column, const QModelIndex &pare
Q_ASSERT(parent.row() < parentSiblings.size());
}
if (childIdColumns.size() == 0)
if (childIdColumns.size() == 0) {
return QModelIndex();
}
if (column >= childIdColumns.size())
if (column >= childIdColumns.size()) {
return QModelIndex();
}
QList<qint64> rowIds = childIdColumns.at(column);
if ( row >= rowIds.size())
if (row >= rowIds.size()) {
return QModelIndex();
}
qint64 id = rowIds.at(row);
@ -90,19 +92,17 @@ QModelIndex DynamicTreeModel::index(int row, int column, const QModelIndex &pare
qint64 DynamicTreeModel::findParentId(qint64 searchId) const
{
if (searchId <= 0)
if (searchId <= 0) {
return -1;
}
QHashIterator<qint64, QList<QList<qint64> > > i(m_childItems);
while (i.hasNext())
{
while (i.hasNext()) {
i.next();
QListIterator<QList<qint64> > j(i.value());
while (j.hasNext())
{
while (j.hasNext()) {
QList<qint64> l = j.next();
if (l.contains(searchId))
{
if (l.contains(searchId)) {
return i.key();
}
}
@ -112,18 +112,21 @@ qint64 DynamicTreeModel::findParentId(qint64 searchId) const
QModelIndex DynamicTreeModel::parent(const QModelIndex &index) const
{
if (!index.isValid())
if (!index.isValid()) {
return QModelIndex();
}
qint64 searchId = index.internalId();
qint64 parentId = findParentId(searchId);
// Will never happen for valid index, but what the hey...
if (parentId <= 0)
if (parentId <= 0) {
return QModelIndex();
}
qint64 grandParentId = findParentId(parentId);
if (grandParentId < 0)
if (grandParentId < 0) {
grandParentId = 0;
}
int column = 0;
QList<qint64> childList = m_childItems.value(grandParentId).at(column);
@ -138,11 +141,13 @@ int DynamicTreeModel::rowCount(const QModelIndex &index ) const
{
QList<QList<qint64> > cols = m_childItems.value(index.internalId());
if (cols.size() == 0 )
if (cols.size() == 0) {
return 0;
}
if (index.column() > 0)
if (index.column() > 0) {
return 0;
}
return cols.at(0).size();
}
@ -155,11 +160,11 @@ int DynamicTreeModel::columnCount(const QModelIndex &index ) const
QVariant DynamicTreeModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid())
if (!index.isValid()) {
return QVariant();
}
if (Qt::DisplayRole == role)
{
if (Qt::DisplayRole == role) {
return m_items.value(index.internalId());
}
return QVariant();
@ -174,7 +179,6 @@ void DynamicTreeModel::clear()
endResetModel();
}
ModelChangeCommand::ModelChangeCommand(DynamicTreeModel *model, QObject *parent)
: QObject(parent), m_model(model), m_numCols(1), m_startRow(-1), m_endRow(-1)
{
@ -186,8 +190,7 @@ QModelIndex ModelChangeCommand::findIndex(QList<int> rows)
const int col = 0;
QModelIndex parent = QModelIndex();
QListIterator<int> i(rows);
while (i.hasNext())
{
while (i.hasNext()) {
parent = m_model->index(i.next(), col, parent);
Q_ASSERT(parent.isValid());
}
@ -205,12 +208,9 @@ void ModelInsertCommand::doCommand()
QModelIndex parent = findIndex(m_rowNumbers);
m_model->beginInsertRows(parent, m_startRow, m_endRow);
qint64 parentId = parent.internalId();
for (int row = m_startRow; row <= m_endRow; row++)
{
for(int col = 0; col < m_numCols; col++ )
{
if (m_model->m_childItems[parentId].size() <= col)
{
for (int row = m_startRow; row <= m_endRow; row++) {
for (int col = 0; col < m_numCols; col++) {
if (m_model->m_childItems[parentId].size() <= col) {
m_model->m_childItems[parentId].append(QList<qint64>());
}
// QString name = QUuid::createUuid().toString();
@ -225,7 +225,6 @@ void ModelInsertCommand::doCommand()
m_model->endInsertRows();
}
ModelMoveCommand::ModelMoveCommand(DynamicTreeModel *model, QObject *parent)
: ModelChangeCommand(model, parent)
{
@ -241,32 +240,28 @@ void ModelMoveCommand::doCommand()
QModelIndex srcParent = findIndex(m_rowNumbers);
QModelIndex destParent = findIndex(m_destRowNumbers);
if (!emitPreSignal(srcParent, m_startRow, m_endRow, destParent, m_destRow))
{
if (!emitPreSignal(srcParent, m_startRow, m_endRow, destParent, m_destRow)) {
return;
}
for (int column = 0; column < m_numCols; ++column)
{
for (int column = 0; column < m_numCols; ++column) {
QList<qint64> l = m_model->m_childItems.value(srcParent.internalId())[column].mid(m_startRow, m_endRow - m_startRow + 1);
for (int i = m_startRow; i <= m_endRow ; i++)
{
for (int i = m_startRow; i <= m_endRow; i++) {
m_model->m_childItems[srcParent.internalId()][column].removeAt(m_startRow);
}
int d;
if (m_destRow < m_startRow)
if (m_destRow < m_startRow) {
d = m_destRow;
else
{
if (srcParent == destParent)
} else {
if (srcParent == destParent) {
d = m_destRow - (m_endRow - m_startRow + 1);
else
} else {
d = m_destRow - (m_endRow - m_startRow) + 1;
}
}
foreach(const qint64 id, l)
{
foreach (const qint64 id, l) {
m_model->m_childItems[destParent.internalId()][column].insert(d++, id);
}
}

View File

@ -47,7 +47,6 @@
#include <QtCore/QHash>
#include <QtCore/QList>
class DynamicTreeModel : public QAbstractItemModel
{
Q_OBJECT
@ -77,7 +76,10 @@ private:
QHash<qint64, QString> m_items;
QHash<qint64, QList<QList<qint64> > > m_childItems;
qint64 nextId;
qint64 newId() { return nextId++; };
qint64 newId()
{
return nextId++;
};
QModelIndex m_nextParentIndex;
int m_nextRow;
@ -92,7 +94,6 @@ private:
};
class ModelChangeCommand : public QObject
{
Q_OBJECT
@ -102,15 +103,27 @@ public:
virtual ~ModelChangeCommand() {}
void setAncestorRowNumbers(QList<int> rowNumbers) { m_rowNumbers = rowNumbers; }
void setAncestorRowNumbers(QList<int> rowNumbers)
{
m_rowNumbers = rowNumbers;
}
QModelIndex findIndex(QList<int> rows);
void setStartRow(int row) { m_startRow = row; }
void setStartRow(int row)
{
m_startRow = row;
}
void setEndRow(int row) { m_endRow = row; }
void setEndRow(int row)
{
m_endRow = row;
}
void setNumCols(int cols) { m_numCols = cols; }
void setNumCols(int cols)
{
m_numCols = cols;
}
virtual void doCommand() = 0;
@ -137,7 +150,6 @@ public:
virtual void doCommand();
};
class ModelMoveCommand : public ModelChangeCommand
{
Q_OBJECT
@ -152,9 +164,15 @@ public:
virtual void emitPostSignal();
void setDestAncestors( QList<int> rows ) { m_destRowNumbers = rows; }
void setDestAncestors(QList<int> rows)
{
m_destRowNumbers = rows;
}
void setDestRow(int row) { m_destRow = row; }
void setDestRow(int row)
{
m_destRow = row;
}
protected:
QList<int> m_destRowNumbers;
@ -193,5 +211,4 @@ public:
};
#endif

View File

@ -39,7 +39,6 @@
**
****************************************************************************/
#include <QtGui/QtGui>
#include "modeltest.h"
@ -101,8 +100,9 @@ ModelTest::ModelTest ( QAbstractItemModel *_model, QObject *parent ) : QObject (
void ModelTest::runAllTests()
{
if ( fetchingMore )
if (fetchingMore) {
return;
}
nonDestructiveBasicTest();
rowCount();
columnCount();
@ -159,17 +159,19 @@ void ModelTest::rowCount()
QModelIndex topIndex = model->index(0, 0, QModelIndex());
int rows = model->rowCount(topIndex);
Q_ASSERT(rows >= 0);
if ( rows > 0 )
if (rows > 0) {
Q_ASSERT(model->hasChildren(topIndex) == true);
}
QModelIndex secondLevelIndex = model->index(0, 0, topIndex);
if (secondLevelIndex.isValid()) { // not the top level
// check a row count where parent is valid
rows = model->rowCount(secondLevelIndex);
Q_ASSERT(rows >= 0);
if ( rows > 0 )
if (rows > 0) {
Q_ASSERT(model->hasChildren(secondLevelIndex) == true);
}
}
// The models rowCount() is tested more extensively in checkChildren(),
// but this catches the big mistakes
@ -186,8 +188,9 @@ void ModelTest::columnCount()
// check a column count where parent is valid
QModelIndex childIndex = model->index(0, 0, topIndex);
if ( childIndex.isValid() )
if (childIndex.isValid()) {
Q_ASSERT(model->columnCount(childIndex) >= 0);
}
// columnCount() is tested more extensively in checkChildren(),
// but this catches the big mistakes
@ -211,8 +214,9 @@ void ModelTest::hasIndex()
Q_ASSERT(model->hasIndex(rows, columns) == false);
Q_ASSERT(model->hasIndex(rows + 1, columns + 1) == false);
if ( rows > 0 )
if (rows > 0) {
Q_ASSERT(model->hasIndex(0, 0) == true);
}
// hasIndex() is tested more extensively in checkChildren(),
// but this catches the big mistakes
@ -232,8 +236,9 @@ void ModelTest::index()
int rows = model->rowCount();
int columns = model->columnCount();
if ( rows == 0 )
if (rows == 0) {
return;
}
// Catch off by one errors
Q_ASSERT(model->index(rows, columns) == QModelIndex());
@ -258,8 +263,9 @@ void ModelTest::parent()
// when asked for the parent of an invalid index.
Q_ASSERT(model->parent(QModelIndex()) == QModelIndex());
if ( model->rowCount() == 0 )
if (model->rowCount() == 0) {
return;
}
// Column 0 | Column 1 |
// QModelIndex() | |
@ -311,8 +317,9 @@ void ModelTest::checkChildren ( const QModelIndex &parent, int currentDepth )
{
// First just try walking back up the tree.
QModelIndex p = parent;
while ( p.isValid() )
while (p.isValid()) {
p = p.parent();
}
// For models that are dynamically populated
if (model->canFetchMore(parent)) {
@ -324,14 +331,16 @@ void ModelTest::checkChildren ( const QModelIndex &parent, int currentDepth )
int rows = model->rowCount(parent);
int columns = model->columnCount(parent);
if ( rows > 0 )
if (rows > 0) {
Q_ASSERT(model->hasChildren(parent));
}
// Some further testing against rows(), columns(), and hasChildren()
Q_ASSERT(rows >= 0);
Q_ASSERT(columns >= 0);
if ( rows > 0 )
if (rows > 0) {
Q_ASSERT(model->hasChildren(parent) == true);
}
//qDebug() << "parent:" << model->data(parent).toString() << "rows:" << rows
// << "columns:" << columns << "parent column:" << parent.column();
@ -404,8 +413,9 @@ void ModelTest::data()
// Invalid index should return an invalid qvariant
Q_ASSERT(!model->data(QModelIndex()).isValid());
if ( model->rowCount() == 0 )
if (model->rowCount() == 0) {
return;
}
// A valid index should have a valid QVariant data
Q_ASSERT(model->index(0, 0).isValid());
@ -509,8 +519,9 @@ void ModelTest::rowsInserted ( const QModelIndex & parent, int start, int end )
if (c.next != model->data(model->index(end + 1, 0, c.parent))) {
qDebug() << start << end;
for (int i=0; i < model->rowCount(); ++i)
for (int i = 0; i < model->rowCount(); ++i) {
qDebug() << model->index(i, 0).data().toString();
}
qDebug() << c.next << model->data(model->index(end + 1, 0, c.parent));
}
@ -519,9 +530,10 @@ void ModelTest::rowsInserted ( const QModelIndex & parent, int start, int end )
void ModelTest::layoutAboutToBeChanged()
{
for ( int i = 0; i < qBound ( 0, model->rowCount(), 100 ); ++i )
for (int i = 0; i < qBound(0, model->rowCount(), 100); ++i) {
changing.append(QPersistentModelIndex(model->index(i, 0)));
}
}
void ModelTest::layoutChanged()
{
@ -563,4 +575,3 @@ void ModelTest::rowsRemoved ( const QModelIndex & parent, int start, int end )
Q_ASSERT(c.next == model->data(model->index(start, 0, c.parent)));
}

View File

@ -39,7 +39,6 @@
**
****************************************************************************/
#ifndef MODELTEST_H
#define MODELTEST_H

View File

@ -42,7 +42,6 @@ public:
}
};
void PackageStructureTest::initTestCase()
{
m_packagePath = QFINDTESTDATA("data/testpackage");
@ -181,4 +180,3 @@ void PackageStructureTest::mimeTypes()
QTEST_MAIN(PackageStructureTest)

View File

@ -90,7 +90,6 @@ void PlasmoidPackageTest::createTestPackage(const QString &packageName)
file.flush();
file.close();
qDebug() << "THIS IS A PLASMOID SCRIPT THING";
// Now we have a minimal plasmoid package which is valid. Let's add some
// files to it for test purposes.
@ -293,12 +292,10 @@ void PlasmoidPackageTest::packageInstalled(KJob* j)
connect(jj, SIGNAL(finished(KJob*)), SLOT(packageInstalled(KJob*)));
}
void PlasmoidPackageTest::packageUninstalled(KJob *j)
{
qDebug() << "!!!!!!!!!!!!!!!!!!!!! package uninstalled";
QVERIFY(j->error() == KJob::NoError);
}
QTEST_MAIN(PlasmoidPackageTest)

View File

@ -75,6 +75,5 @@ void PluginTest::loadDataEngine()
}
#include "moc_pluginloadertest.cpp"

View File

@ -34,7 +34,6 @@ private Q_SLOTS:
void retrieve();
void deleteEntry();
private:
QVariantMap m_data;
};

View File

@ -23,7 +23,10 @@
#include <KDE/KDialog>
class QModelIndex;
namespace Ui { class AppletSelector; }
namespace Ui
{
class AppletSelector;
}
class AppletSelector : public KDialog
{

View File

@ -27,7 +27,6 @@
#include <KStandardAction>
#include <KActionCollection>
#include <Plasma/Containment>
#include <QApplication>

View File

@ -19,7 +19,6 @@
#include <QDebug>
#include "calendar.h"
Calendar::Calendar(QObject *parent)
@ -62,8 +61,9 @@ int Calendar::types() const
void Calendar::setTypes(int types)
{
if (m_types == types)
if (m_types == types) {
return;
}
// m_types = static_cast<Types>(types);
// updateTypes();
@ -182,7 +182,6 @@ void Calendar::updateData()
QDate firstDay(m_startDate.year(), m_startDate.month(), 1);
// If the first day is the same as the starting day then we add a complete row before it.
if (m_firstDayOfWeek < firstDay.dayOfWeek()) {
daysBeforeCurrentMonth = firstDay.dayOfWeek() - m_firstDayOfWeek;
@ -245,7 +244,6 @@ void Calendar::updateData()
m_weekList << QDate(data.yearNumber, data.monthNumber, data.dayNumber).weekNumber();
}
m_daysModel->update();
// qDebug() << "---------------------------------------------------------------";

View File

@ -27,7 +27,6 @@
#include "daydata.h"
#include "daysmodel.h"
class Calendar : public QObject
{
Q_OBJECT
@ -124,7 +123,6 @@ public:
};
Q_DECLARE_FLAGS(Types, Type)
explicit Calendar(QObject *parent = 0);
// Start date
@ -158,7 +156,6 @@ public:
QAbstractListModel *daysModel() const;
QList<int> weeksModel() const;
// QML invokables
Q_INVOKABLE void nextMonth();
Q_INVOKABLE void previousMonth();

View File

@ -19,8 +19,6 @@
#include "calendardata.h"
CalendarData::CalendarData(QObject *parent)
: QObject(parent)
, m_types(Holiday | Event | Todo | Journal)
@ -43,8 +41,6 @@ CalendarData::CalendarData(QObject *parent)
// updateTypes();
}
QDate CalendarData::startDate() const
{
return m_startDate;
@ -52,8 +48,9 @@ QDate CalendarData::startDate() const
void CalendarData::setStartDate(const QDate &dateTime)
{
if (m_startDate == dateTime)
if (m_startDate == dateTime) {
return;
}
m_startDate = dateTime;
// m_filteredList->setStartDate(m_startDate);
@ -67,8 +64,9 @@ QDate CalendarData::endDate() const
void CalendarData::setEndDate(const QDate &dateTime)
{
if (m_endDate == dateTime)
if (m_endDate == dateTime) {
return;
}
m_endDate = dateTime;
// m_filteredList->setEndDate(m_endDate);

View File

@ -24,9 +24,6 @@
#include <QFlags>
#include <QDate>
class QAbstractItemModel;
class CalendarData : public QObject

View File

@ -24,9 +24,6 @@
#include <QAbstractItemModel>
#include <QAbstractListModel>
void CalendarPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.calendar"));

View File

@ -20,8 +20,6 @@
#ifndef CALENDARPLUGIN_H
#define CALENDARPLUGIN_H
#include <QQmlExtensionPlugin>
class QQmlEngine;

View File

@ -16,5 +16,4 @@ public:
int yearNumber;
};
#endif // DAYDATA_H

View File

@ -46,7 +46,6 @@
// #include "dataenginebindings_p.h"
#include <QDebug>
void CoreBindingsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
@ -61,7 +60,6 @@ void CoreBindingsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
Units *units = new Units(context);
context->setContextProperty("units", units);
if (!engine->rootContext()->contextObject()) {
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine);
@ -107,6 +105,5 @@ void CoreBindingsPlugin::registerTypes(const char *uri)
qmlRegisterType<Plasma::WindowThumbnail>(uri, 2, 0, "WindowThumbnail");
}
#include "corebindingsplugin.moc"

View File

@ -38,5 +38,4 @@ public:
void registerTypes(const char *uri);
};
#endif

View File

@ -32,9 +32,9 @@ SortFilterModel::SortFilterModel(QObject* parent)
{
setObjectName("SortFilterModel");
setDynamicSortFilter(true);
connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)),
connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(modelReset()),
this, SIGNAL(countChanged()));
@ -176,9 +176,9 @@ DataModel::DataModel(QObject* parent)
++m_maxRoleId;
setObjectName("DataModel");
connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)),
connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(modelReset()),
this, SIGNAL(countChanged()));

View File

@ -34,7 +34,6 @@ namespace Plasma
class DataSource;
class DataModel;
class SortFilterModel : public QSortFilterProxyModel
{
Q_OBJECT
@ -87,7 +86,10 @@ public:
void setSortOrder(const Qt::SortOrder order);
int count() const {return QSortFilterProxyModel::rowCount();}
int count() const
{
return QSortFilterProxyModel::rowCount();
}
/**
* Returns the item at index in the list model.
@ -175,7 +177,10 @@ public:
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
int count() const {return countItems();}
int count() const
{
return countItems();
}
/**
* Returns the item at index in the list model.

View File

@ -128,12 +128,12 @@ void DataSource::setupData()
* recommendations engine.
*/
m_dataEngine = engine;
connect(m_dataEngine, SIGNAL(sourceAdded(const QString&)), this, SIGNAL(sourcesChanged()), Qt::QueuedConnection);
connect(m_dataEngine, SIGNAL(sourceRemoved(const QString&)), this, SIGNAL(sourcesChanged()));
connect(m_dataEngine, SIGNAL(sourceAdded(QString)), this, SIGNAL(sourcesChanged()), Qt::QueuedConnection);
connect(m_dataEngine, SIGNAL(sourceRemoved(QString)), this, SIGNAL(sourcesChanged()));
connect(m_dataEngine, SIGNAL(sourceAdded(const QString&)), this, SIGNAL(sourceAdded(const QString&)), Qt::QueuedConnection);
connect(m_dataEngine, SIGNAL(sourceRemoved(const QString&)), this, SLOT(removeSource(const QString&)));
connect(m_dataEngine, SIGNAL(sourceRemoved(const QString&)), this, SIGNAL(sourceRemoved(const QString&)));
connect(m_dataEngine, SIGNAL(sourceAdded(QString)), this, SIGNAL(sourceAdded(QString)), Qt::QueuedConnection);
connect(m_dataEngine, SIGNAL(sourceRemoved(QString)), this, SLOT(removeSource(QString)));
connect(m_dataEngine, SIGNAL(sourceRemoved(QString)), this, SIGNAL(sourceRemoved(QString)));
}
foreach (const QString &source, m_connectedSources) {

View File

@ -30,10 +30,8 @@
#include <Plasma/DataEngineConsumer>
#include <Plasma/DataEngine>
class QQmlPropertyMap;
namespace Plasma
{
class DataEngine;
@ -57,13 +55,19 @@ public:
* true if the connection to the Plasma DataEngine is valid
*/
Q_PROPERTY(bool valid READ valid)
bool valid() const {return m_dataEngine && m_dataEngine->isValid();}
bool valid() const
{
return m_dataEngine && m_dataEngine->isValid();
}
/**
* Polling interval in milliseconds when the data will be fetched again. If 0 no polling will be done.
*/
Q_PROPERTY(int interval READ interval WRITE setInterval NOTIFY intervalChanged)
int interval() const {return m_interval;}
int interval() const
{
return m_interval;
}
void setInterval(const int interval);
/**
@ -71,28 +75,44 @@ public:
*/
Q_PROPERTY(QString dataEngine READ engine WRITE setEngine NOTIFY engineChanged)
Q_PROPERTY(QString engine READ engine WRITE setEngine NOTIFY engineChanged)
QString engine() const {return m_engine;}
QString engine() const
{
return m_engine;
}
void setEngine(const QString &e);
/**
* String array of all the source names connected to the DataEngine
*/
Q_PROPERTY(QStringList connectedSources READ connectedSources WRITE setConnectedSources NOTIFY connectedSourcesChanged)
QStringList connectedSources() const {return m_connectedSources;}
QStringList connectedSources() const
{
return m_connectedSources;
}
void setConnectedSources(const QStringList &s);
/**
* Read only string array of all the sources available from the DataEngine (connected or not)
*/
Q_PROPERTY(QStringList sources READ sources NOTIFY sourcesChanged)
QStringList sources() const {if (m_dataEngine) return m_dataEngine->sources(); else return QStringList();}
QStringList sources() const
{
if (m_dataEngine) {
return m_dataEngine->sources();
} else {
return QStringList();
}
}
/**
* All the data fetched by this dataengine.
* This is a map of maps. At the first level, there are the source names, at the second, they keys set by the DataEngine
*/
Q_PROPERTY(QQmlPropertyMap *data READ data CONSTANT);
QQmlPropertyMap *data() const {return m_data;}
QQmlPropertyMap *data() const
{
return m_data;
}
/**
* All the models associated to this DataEngine, indexed by source.
@ -100,7 +120,10 @@ public:
* The user has to be connected to its source, so the source name has to be present in the connectedSources property.
*/
Q_PROPERTY(QQmlPropertyMap *models READ models CONSTANT);
QQmlPropertyMap *models() const {return m_models;}
QQmlPropertyMap *models() const
{
return m_models;
}
/**
* @returns a Plasma::Service given a source name

View File

@ -107,7 +107,6 @@ FrameSvgItem::FrameSvgItem(QQuickItem *parent)
connect(&m_units, &Units::devicePixelRatioChanged, this, &FrameSvgItem::updateDevicePixelRatio);
}
FrameSvgItem::~FrameSvgItem()
{
}
@ -145,7 +144,6 @@ QString FrameSvgItem::imagePath() const
return m_frameSvg->imagePath();
}
void FrameSvgItem::setPrefix(const QString &prefix)
{
if (m_prefix == prefix) {
@ -190,8 +188,9 @@ FrameSvgItemMargins *FrameSvgItem::fixedMargins() const
void FrameSvgItem::setEnabledBorders(const Plasma::FrameSvg::EnabledBorders borders)
{
if (m_frameSvg->enabledBorders() == borders)
if (m_frameSvg->enabledBorders() == borders) {
return;
}
m_frameSvg->setEnabledBorders(borders);
emit enabledBordersChanged();
@ -303,7 +302,6 @@ void FrameSvgItem::componentComplete()
m_textureChanged = true;
}
void FrameSvgItem::updateDevicePixelRatio()
{
//devicepixelratio is always set integer in the svg, so needs at least 192dpi to double up.

View File

@ -27,7 +27,8 @@
#include "units.h"
namespace Plasma {
namespace Plasma
{
class FrameSvg;

View File

@ -29,7 +29,6 @@
#include <plasma/svg.h>
QPixmap transition(const QPixmap &from, const QPixmap &to, qreal amount)
{
if (from.isNull() && to.isNull()) {
@ -183,7 +182,6 @@ IconItem::IconItem(QQuickItem *parent)
connect(KIconLoader::global(), SIGNAL(iconLoaderSettingsChanged()),
this, SIGNAL(implicitHeightChanged()));
connect(this, SIGNAL(enabledChanged()),
&m_loadPixmapTimer, SLOT(start()));
@ -192,7 +190,6 @@ IconItem::IconItem(QQuickItem *parent)
setImplicitHeight(KIconLoader::global()->currentSize(KIconLoader::Dialog));
}
IconItem::~IconItem()
{
}

View File

@ -28,7 +28,8 @@
class QPropertyAnimation;
namespace Plasma {
namespace Plasma
{
class Svg;
}

View File

@ -19,8 +19,6 @@
#include "serviceoperationstatus.h"
ServiceOperationStatus::ServiceOperationStatus(QObject *parent)
: QObject(parent),
m_enabled(false)

View File

@ -23,7 +23,8 @@
#include "plasma/service.h"
namespace Plasma {
namespace Plasma
{
class Service;
}
@ -73,5 +74,4 @@ private:
bool m_enabled;
};
#endif

View File

@ -43,7 +43,6 @@ SvgItem::SvgItem(QQuickItem *parent)
connect(&m_units, &Units::devicePixelRatioChanged, this, &SvgItem::updateDevicePixelRatio);
}
SvgItem::~SvgItem()
{
}
@ -85,7 +84,6 @@ QSizeF SvgItem::naturalSize() const
return m_svg.data()->size();
}
void SvgItem::setSvg(Plasma::Svg *svg)
{
if (m_svg) {
@ -100,7 +98,6 @@ void SvgItem::setSvg(Plasma::Svg *svg)
connect(svg, SIGNAL(sizeChanged()), this, SIGNAL(naturalSizeChanged()));
}
if (implicitWidth() <= 0) {
setImplicitWidth(naturalSize().width());
}

View File

@ -24,7 +24,8 @@
#include "units.h"
namespace Plasma {
namespace Plasma
{
class Svg;

View File

@ -22,7 +22,8 @@
#include <QSGSimpleTextureNode>
namespace Plasma {
namespace Plasma
{
/**
* This class wraps QSGSimpleTextureNode
@ -37,7 +38,8 @@ class SVGTextureNode : public QSGSimpleTextureNode
* Set the current texture
* the object takes ownership of the texture
*/
void setTexture(QSGTexture *texture) {
void setTexture(QSGTexture *texture)
{
m_texture.reset(texture);
QSGSimpleTextureNode::setTexture(texture);
}

View File

@ -194,7 +194,6 @@ void Units::updateSpacing()
}
}
int Units::longDuration() const
{
return m_longDuration;

View File

@ -41,7 +41,8 @@ typedef GLvoid(*glEGLImageTargetTexture2DOES_func)(GLenum, GLeglImageOES);
#endif // HAVE_EGL
#endif
namespace Plasma {
namespace Plasma
{
WindowTextureNode::WindowTextureNode()
: QSGSimpleTextureNode()
@ -402,10 +403,11 @@ bool WindowThumbnail::loadGLXTexture()
XVisualInfo *vi = glXGetVisualFromFBConfig(d, fbConfigs[0]);
int textureFormat;
if (window()->openglContext()->format().hasAlpha())
if (window()->openglContext()->format().hasAlpha()) {
textureFormat = bindRgba ? GLX_TEXTURE_FORMAT_RGBA_EXT : GLX_TEXTURE_FORMAT_RGB_EXT;
else
} else {
textureFormat = bindRgb ? GLX_TEXTURE_FORMAT_RGB_EXT : GLX_TEXTURE_FORMAT_RGBA_EXT;
}
XFree(vi);
// we assume that Texture_2D is supported as we have a QtQuick OpenGL context

View File

@ -37,7 +37,8 @@
#endif // HAVE_XCB_COMPOSITE
class KWindowInfo;
namespace Plasma {
namespace Plasma
{
class WindowTextureNode;

View File

@ -19,6 +19,4 @@
#include "enums.h"
#include "moc_enums.cpp"

View File

@ -22,7 +22,6 @@
#include <QObject>
class DialogStatus : public QObject
{
Q_OBJECT
@ -66,5 +65,4 @@ public:
};
};
#endif // ENUMS_H

View File

@ -138,6 +138,5 @@ void FullScreenSheet::open()
}
}
#include "fullscreensheet.moc"

View File

@ -41,7 +41,6 @@
#include <Plasma/Corona>
#include <Plasma/WindowEffects>
uint FullScreenWindow::s_numItems = 0;
class Background : public QWidget
@ -235,7 +234,6 @@ void FullScreenWindow::syncViewToMainItem()
m_view->setScene(scene);
QRectF itemGeometry(QPointF(m_mainItem.data()->x(), m_mainItem.data()->y()),
QSizeF(m_mainItem.data()->boundingRect().size()));
if (m_declarativeItemContainer) {
@ -297,7 +295,6 @@ QGraphicsView *FullScreenWindow::view() const
return m_view;
}
QDeclarativeListProperty<QGraphicsObject> FullScreenWindow::title()
{
if (m_rootObject) {
@ -334,7 +331,6 @@ DialogStatus::Status FullScreenWindow::status() const
}
}
void FullScreenWindow::statusHasChanged()
{
if (status() == DialogStatus::Closed) {
@ -373,9 +369,6 @@ void FullScreenWindow::close()
}
}
bool FullScreenWindow::eventFilter(QObject *watched, QEvent *event)
{
if (watched == m_mainItem.data() &&
@ -388,7 +381,5 @@ bool FullScreenWindow::eventFilter(QObject *watched, QEvent *event)
return false;
}
#include "fullscreenwindow.moc"

View File

@ -43,7 +43,6 @@ class FullScreenWindow : public QDeclarativeItem
Q_PROPERTY(QDeclarativeListProperty<QGraphicsObject> buttons READ buttons DESIGNABLE false)
Q_PROPERTY(DialogStatus::Status status READ status NOTIFY statusChanged)
public:
FullScreenWindow(QDeclarativeItem *parent = 0);
~FullScreenWindow();
@ -73,7 +72,6 @@ Q_SIGNALS:
void clickedOutside();
void statusChanged();
private Q_SLOTS:
void syncViewToMainItem();
void syncMainItemToView();

View File

@ -73,8 +73,6 @@ void EngineBookKeeping::engineDestroyed(QObject *deleted)
m_engines.remove(static_cast<QQmlEngine *>(deleted));
}
void PlasmaComponentsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
{
QQmlExtensionPlugin::initializeEngine(engine, uri);
@ -101,6 +99,5 @@ void PlasmaComponentsPlugin::registerTypes(const char *uri)
qmlRegisterUncreatableType<PageStatus>(uri, 2, 0, "PageStatus", "");
}
#include "moc_plasmacomponentsplugin.cpp"

View File

@ -200,7 +200,6 @@ void QMenuProxy::open(int x, int y)
emit statusChanged();
}
void QMenuProxy::close()
{
m_menu->hide();

View File

@ -20,7 +20,6 @@
#include "qmenuitem.h"
QMenuItem::QMenuItem(QQuickItem *parent)
: QQuickItem(parent),
m_action(0)

View File

@ -104,14 +104,16 @@ qreal QRangeModelPrivate::publicPosition(qreal position) const
const qreal positionValueRatio = valueRange ? (max - min) / valueRange : 0;
const qreal positionStep = stepSize * positionValueRatio;
if (positionStep == 0)
if (positionStep == 0) {
return (min < max) ? qBound(min, position, max) : qBound(max, position, min);
}
const int stepSizeMultiplier = (position - min) / positionStep;
// Test whether value is below minimum range
if (stepSizeMultiplier < 0)
if (stepSizeMultiplier < 0) {
return min;
}
qreal leftEdge = (stepSizeMultiplier * positionStep) + min;
qreal rightEdge = ((stepSizeMultiplier + 1) * positionStep) + min;
@ -124,8 +126,9 @@ qreal QRangeModelPrivate::publicPosition(qreal position) const
rightEdge = qMax(rightEdge, max);
}
if (qAbs(leftEdge - position) <= qAbs(rightEdge - position))
if (qAbs(leftEdge - position) <= qAbs(rightEdge - position)) {
return leftEdge;
}
return rightEdge;
}
@ -143,14 +146,16 @@ qreal QRangeModelPrivate::publicValue(qreal value) const
// QML bindings; a position that is initially invalid because it lays
// outside the range, might become valid later if the range changes.
if (stepSize == 0)
if (stepSize == 0) {
return qBound(minimum, value, maximum);
}
const int stepSizeMultiplier = (value - minimum) / stepSize;
// Test whether value is below minimum range
if (stepSizeMultiplier < 0)
if (stepSizeMultiplier < 0) {
return minimum;
}
const qreal leftEdge = qMin(maximum, (stepSizeMultiplier * stepSize) + minimum);
const qreal rightEdge = qMin(maximum, ((stepSizeMultiplier + 1) * stepSize) + minimum);
@ -172,11 +177,13 @@ void QRangeModelPrivate::emitValueAndPositionIfChanged(const qreal oldValue, con
// unchanged. This will be the case when operating with values outside range:
const qreal newValue = q->value();
const qreal newPosition = q->position();
if (!qFuzzyCompare(newValue, oldValue))
if (!qFuzzyCompare(newValue, oldValue)) {
emit q->valueChanged(newValue);
if (!qFuzzyCompare(newPosition, oldPosition))
}
if (!qFuzzyCompare(newPosition, oldPosition)) {
emit q->positionChanged(newPosition);
}
}
/*!
Constructs a QRangeModel with \a parent
@ -224,8 +231,9 @@ void QRangeModel::setPositionRange(qreal min, qreal max)
bool emitPosAtMinChanged = !qFuzzyCompare(min, d->posatmin);
bool emitPosAtMaxChanged = !qFuzzyCompare(max, d->posatmax);
if (!(emitPosAtMinChanged || emitPosAtMaxChanged))
if (!(emitPosAtMinChanged || emitPosAtMaxChanged)) {
return;
}
const qreal oldPosition = position();
d->posatmin = min;
@ -239,10 +247,12 @@ void QRangeModel::setPositionRange(qreal min, qreal max)
// the positionChanged signal.
d->pos = d->equivalentPosition(d->value);
if (emitPosAtMinChanged)
if (emitPosAtMinChanged) {
emit positionAtMinimumChanged(d->posatmin);
if (emitPosAtMaxChanged)
}
if (emitPosAtMaxChanged) {
emit positionAtMaximumChanged(d->posatmax);
}
d->emitValueAndPositionIfChanged(value(), oldPosition);
}
@ -259,8 +269,9 @@ void QRangeModel::setRange(qreal min, qreal max)
bool emitMinimumChanged = !qFuzzyCompare(min, d->minimum);
bool emitMaximumChanged = !qFuzzyCompare(max, d->maximum);
if (!(emitMinimumChanged || emitMaximumChanged))
if (!(emitMinimumChanged || emitMaximumChanged)) {
return;
}
const qreal oldValue = value();
const qreal oldPosition = position();
@ -271,10 +282,12 @@ void QRangeModel::setRange(qreal min, qreal max)
// Update internal position if it was changed. It can occurs if internal value changes, due to range update
d->pos = d->equivalentPosition(d->value);
if (emitMinimumChanged)
if (emitMinimumChanged) {
emit minimumChanged(d->minimum);
if (emitMaximumChanged)
}
if (emitMaximumChanged) {
emit maximumChanged(d->maximum);
}
d->emitValueAndPositionIfChanged(oldValue, oldPosition);
}
@ -332,8 +345,9 @@ void QRangeModel::setStepSize(qreal stepSize)
Q_D(QRangeModel);
stepSize = qMax(qreal(0.0), stepSize);
if (qFuzzyCompare(stepSize, d->stepSize))
if (qFuzzyCompare(stepSize, d->stepSize)) {
return;
}
const qreal oldValue = value();
const qreal oldPosition = position();
@ -386,8 +400,9 @@ void QRangeModel::setPosition(qreal newPosition)
{
Q_D(QRangeModel);
if (qFuzzyCompare(newPosition, d->pos))
if (qFuzzyCompare(newPosition, d->pos)) {
return;
}
const qreal oldPosition = position();
const qreal oldValue = value();
@ -473,8 +488,9 @@ void QRangeModel::setValue(qreal newValue)
{
Q_D(QRangeModel);
if (qFuzzyCompare(newValue, d->value))
if (qFuzzyCompare(newValue, d->value)) {
return;
}
const qreal oldValue = value();
const qreal oldPosition = position();
@ -497,8 +513,9 @@ void QRangeModel::setValue(qreal newValue)
void QRangeModel::setInverted(bool inverted)
{
Q_D(QRangeModel);
if (inverted == d->inverted)
if (inverted == d->inverted) {
return;
}
d->inverted = inverted;
emit invertedChanged(d->inverted);

View File

@ -59,29 +59,35 @@ public:
QRangeModel *q_ptr;
inline qreal effectivePosAtMin() const {
inline qreal effectivePosAtMin() const
{
return inverted ? posatmax : posatmin;
}
inline qreal effectivePosAtMax() const {
inline qreal effectivePosAtMax() const
{
return inverted ? posatmin : posatmax;
}
inline qreal equivalentPosition(qreal value) const {
inline qreal equivalentPosition(qreal value) const
{
// Return absolute position from absolute value
const qreal valueRange = maximum - minimum;
if (valueRange == 0)
if (valueRange == 0) {
return effectivePosAtMin();
}
const qreal scale = (effectivePosAtMax() - effectivePosAtMin()) / valueRange;
return (value - minimum) * scale + effectivePosAtMin();
}
inline qreal equivalentValue(qreal pos) const {
inline qreal equivalentValue(qreal pos) const
{
// Return absolute value from absolute position
const qreal posRange = effectivePosAtMax() - effectivePosAtMin();
if (posRange == 0)
if (posRange == 0) {
return minimum;
}
const qreal scale = (maximum - minimum) / posRange;
return (pos - effectivePosAtMin()) * scale + minimum;

View File

@ -25,7 +25,6 @@
#include <QDebug>
FallbackComponent::FallbackComponent(QObject *parent)
: QObject(parent)
{

View File

@ -20,7 +20,6 @@
#ifndef FALLBACKCOMPONENT_H
#define FALLBACKCOMPONENT_H
#include <QObject>
#include <QCache>
#include <QStringList>
@ -60,11 +59,9 @@ public:
QString basePath() const;
void setBasePath(const QString &basePath);
QStringList candidates() const;
void setCandidates(const QStringList &candidates);
Q_SIGNALS:
void basePathChanged();
void candidatesChanged();

View File

@ -26,7 +26,6 @@
#include <QtQml>
#include <QQmlEngine>
// #include <KSharedConfig>
// #include <KConfigGroup>
@ -43,6 +42,5 @@ void PlasmaExtraComponentsPlugin::registerTypes(const char *uri)
qmlRegisterType<FallbackComponent>(uri, 2, 0, "FallbackComponent");
}
#include "plasmaextracomponentsplugin.moc"

View File

@ -26,7 +26,6 @@
#include <KActivities/ResourceInstance>
#include <QDebug>
ResourceInstance::ResourceInstance(QQuickItem *parent)
: QQuickItem(parent)
{
@ -129,7 +128,6 @@ void ResourceInstance::notifyFocusedIn()
m_resourceInstance->notifyFocusedIn();
}
void ResourceInstance::notifyFocusedOut()
{
//ensure the resource instance exists

View File

@ -22,7 +22,8 @@
#include <QQuickItem>
#include <QUrl>
namespace KActivities {
namespace KActivities
{
class ResourceInstance;
}

View File

@ -87,11 +87,12 @@ void Application::setRunning(bool run)
qDebug() << "running?" << run;
d->running = run;
if (run)
if (run) {
start();
else
} else {
terminate();
}
}
void Application::start()
{

View File

@ -36,7 +36,8 @@
* }
* </code>
*/
class Application: public QObject {
class Application: public QObject
{
Q_OBJECT
/**

View File

@ -24,7 +24,8 @@
#include <QProcess>
class Application::Private: public QObject {
class Application::Private: public QObject
{
Q_OBJECT
public:
Private(Application *);

View File

@ -31,7 +31,8 @@
/**
*
*/
class IconDialog::Private {
class IconDialog::Private
{
public:
utils::SharedSingleton<KIconDialog> dialog;

View File

@ -39,7 +39,8 @@
* icon = iconDialog.openDialog()
* </code>
*/
class IconDialog: public QObject {
class IconDialog: public QObject
{
Q_OBJECT
public:

View File

@ -24,7 +24,8 @@
#include "application.h"
#include "icondialog.h"
class PlatformComponentsPlugin: public QQmlExtensionPlugin {
class PlatformComponentsPlugin: public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.kde.plasma.platformcomponents")
@ -35,8 +36,7 @@ public:
qDebug() << "instantiated plugin object";
}
void registerTypes(const char * uri) Q_DECL_OVERRIDE
{
void registerTypes(const char *uri) Q_DECL_OVERRIDE {
qDebug() << "plugin loaded, registering types " << uri;
Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.platformcomponents"));

View File

@ -22,10 +22,12 @@
#include <memory>
namespace utils {
namespace utils
{
template <typename T>
class d_ptr {
class d_ptr
{
private:
std::unique_ptr<T> d;

View File

@ -22,7 +22,8 @@
#include <utility>
namespace utils {
namespace utils
{
template <typename T>
d_ptr<T>::d_ptr() : d(new T())

View File

@ -22,10 +22,12 @@
#include <memory>
namespace utils {
namespace utils
{
template <typename Target>
class SharedSingleton {
class SharedSingleton
{
public:
static std::shared_ptr<Target> instance()
{

View File

@ -85,5 +85,4 @@ void PlasmaKPartView::updateGeometry()
}
}
#include "plasmakpartview.moc"

View File

@ -58,8 +58,6 @@
return __ret__; \
}
#define ADD_METHOD(__p__, __f__) \
__p__.setProperty(#__f__, __p__.engine()->newFunction(__f__))
@ -77,7 +75,6 @@ do { \
#define ADD_ENUM_VALUE(__c__, __ns__, __v__) \
__c__.setProperty(#__v__, QScriptValue(__c__.engine(), __ns__::__v__))
#define BEGIN_DECLARE_METHOD(Class, __mtd__) \
static QScriptValue __mtd__(QScriptContext *ctx, QScriptEngine *eng) \
{ \
@ -86,7 +83,6 @@ static QScriptValue __mtd__(QScriptContext *ctx, QScriptEngine *eng) \
#define END_DECLARE_METHOD \
}
#define DECLARE_GET_METHOD(Class, __get__) \
BEGIN_DECLARE_METHOD(Class, __get__) { \
return qScriptValueFromValue(eng, self->__get__()); \
@ -102,8 +98,6 @@ BEGIN_DECLARE_METHOD(Class, __set__) { \
DECLARE_GET_METHOD(Class, /*T,*/ __get__) \
DECLARE_SET_METHOD(Class, T, __set__)
#define DECLARE_SIMPLE_GET_METHOD(Class, __get__) \
BEGIN_DECLARE_METHOD(Class, __get__) { \
return QScriptValue(eng, self->__get__()); \
@ -162,7 +156,6 @@ BEGIN_DECLARE_METHOD(Class, __get__) { \
DECLARE_QOBJECT_GET_METHOD(Class, __get__) \
DECLARE_QOBJECT_SET_METHOD(Class, __set__)
#define DECLARE_VOID_METHOD(Class, __fun__) \
BEGIN_DECLARE_METHOD(Class, __fun__) { \
self->__fun__(); \
@ -198,7 +191,6 @@ BEGIN_DECLARE_METHOD(Class, __fun__) { \
return QScriptValue(eng, self->__fun__(qscriptvalue_cast<ArgType>(ctx->argument(0)))); \
} END_DECLARE_METHOD
#define DECLARE_POINTER_METATYPE(T) \
Q_DECLARE_METATYPE(T*) \
Q_DECLARE_METATYPE(QScript::Pointer<T>::wrapped_pointer_type)
@ -219,9 +211,10 @@ public:
~Pointer()
{
if (!(m_flags & UserOwnership))
if (!(m_flags & UserOwnership)) {
delete m_value;
}
}
operator T *()
{
@ -240,8 +233,9 @@ public:
static QScriptValue toScriptValue(QScriptEngine *engine, T *const &source)
{
if (!source)
if (!source) {
return engine->nullValue();
}
return engine->newVariant(qVariantFromValue(source));
}
@ -284,11 +278,17 @@ public:
}
uint flags() const
{ return m_flags; }
{
return m_flags;
}
void setFlags(uint flags)
{ m_flags = flags; }
{
m_flags = flags;
}
void unsetFlags(uint flags)
{ m_flags &= ~flags; }
{
m_flags &= ~flags;
}
protected:
Pointer(T *value, uint flags)
@ -323,20 +323,22 @@ inline void maybeReleaseOwnership(const QScriptValue &value)
if (value.isVariant()) {
QVariant var = value.toVariant();
QByteArray name = QMetaType::typeName(var.userType());
if (name.startsWith("QScript::Pointer<"))
if (name.startsWith("QScript::Pointer<")) {
(*reinterpret_cast<Pointer<void *>::wrapped_pointer_type *>(var.data()))->setFlags(UserOwnership);
}
}
}
inline void maybeTakeOwnership(const QScriptValue &value)
{
if (value.isVariant()) {
QVariant var = value.toVariant();
QByteArray name = QMetaType::typeName(var.userType());
if (name.startsWith("QScript::Pointer<"))
if (name.startsWith("QScript::Pointer<")) {
(*reinterpret_cast<Pointer<void *>::wrapped_pointer_type *>(var.data()))->unsetFlags(UserOwnership);
}
}
}
template <class T>
inline QScriptValue wrapPointer(QScriptEngine *eng, T *ptr, uint flags = 0)
@ -348,7 +350,8 @@ inline QScriptValue wrapPointer(QScriptEngine *eng, T *ptr, uint flags = 0)
#ifdef QGRAPHICSITEM_H
namespace QScript {
namespace QScript
{
template <class T>
inline QScriptValue wrapGVPointer(QScriptEngine *eng, T *item)

View File

@ -24,8 +24,7 @@ Q_DECLARE_METATYPE(QRectF)
static QScriptValue ctor(QScriptContext *ctx, QScriptEngine *eng)
{
if (ctx->argumentCount() == 4)
{
if (ctx->argumentCount() == 4) {
qreal x = ctx->argument(0).toNumber();
qreal y = ctx->argument(1).toNumber();
qreal width = ctx->argument(2).toNumber();
@ -158,7 +157,6 @@ static QScriptValue moveRight(QScriptContext *ctx, QScriptEngine *)
return QScriptValue();
}
static QScriptValue moveTo(QScriptContext *ctx, QScriptEngine *)
{
DECLARE_SELF(QRectF, moveTo);

View File

@ -56,7 +56,6 @@
#include "private/associatedapplicationmanager_p.h"
#include "private/containment_p.h"
namespace Plasma
{
@ -612,7 +611,6 @@ QKeySequence Applet::globalShortcut() const
}
}
return QKeySequence();
}

View File

@ -47,7 +47,6 @@ class Containment;
class DataEngine;
class Package;
/**
* @class Applet plasma/applet.h <Plasma/Applet>
*
@ -239,7 +238,6 @@ class PLASMA_EXPORT Applet : public QObject
*/
void updateConstraints(Plasma::Types::Constraints constraints = Plasma::Types::AllConstraints);
//METADATA
/**
* @return metadata information about this plugin
@ -293,7 +291,6 @@ class PLASMA_EXPORT Applet : public QObject
*/
void setIcon(const QString &icon);
//ACTIONS
/**
* Returns a list of context-related QAction instances.
@ -406,7 +403,6 @@ class PLASMA_EXPORT Applet : public QObject
*/
void activated();
//TODO: fix usage in containment, port to QObject::destroyed
/**
* Emitted when the applet is deleted
@ -466,7 +462,6 @@ class PLASMA_EXPORT Applet : public QObject
*/
virtual void configChanged();
//UTILS
/**
* Sends all pending constraints updates to the applet. Will usually
@ -486,7 +481,6 @@ class PLASMA_EXPORT Applet : public QObject
**/
virtual void init();
//ASSOCIATED APPLICATION
/**
* Open the application associated to this applet, if it's not set
@ -498,7 +492,6 @@ class PLASMA_EXPORT Applet : public QObject
*/
void runAssociatedApplication();
protected:
//CONSTRUCTORS
/**
@ -576,7 +569,6 @@ class PLASMA_EXPORT Applet : public QObject
*/
void timerEvent(QTimerEvent *event);
private:
/**
* @internal This constructor is to be used with the Package loading system.

View File

@ -181,7 +181,6 @@ void Containment::restore(KConfigGroup &group)
KConfigGroup cfg = KConfigGroup(corona()->config(), "ActionPlugins");
cfg = KConfigGroup(&cfg, QString::number(containmentType()));
//qDebug() << cfg.keyList();
if (cfg.exists()) {
foreach (const QString &key, cfg.keyList()) {
@ -565,6 +564,4 @@ void Containment::reactToScreenChange()
} // Plasma namespace
#include "moc_containment.cpp"

View File

@ -30,7 +30,6 @@
#include <plasma/applet.h>
namespace Plasma
{
@ -197,7 +196,6 @@ class PLASMA_EXPORT Containment : public Applet
*/
QHash<QString, ContainmentActions *> &containmentActions();
/**
* @returns true when the ui of this containment is fully loaded, as well the ui of every applet in it
*/
@ -310,8 +308,6 @@ Q_SIGNALS:
*/
virtual void restoreContents(KConfigGroup &group);
private:
/**
* @internal This constructor is to be used with the Package loading system.

View File

@ -121,8 +121,7 @@ QString ContainmentActions::eventToString(QEvent *event)
switch (event->type()) {
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseButtonDblClick:
{
case QEvent::MouseButtonDblClick: {
QMouseEvent *e = static_cast<QMouseEvent *>(event);
int m = QObject::staticQtMetaObject.indexOfEnumerator("MouseButtons");
QMetaEnum mouse = QObject::staticQtMetaObject.enumerator(m);
@ -130,8 +129,7 @@ QString ContainmentActions::eventToString(QEvent *event)
modifiers = e->modifiers();
break;
}
case QEvent::Wheel:
{
case QEvent::Wheel: {
QWheelEvent *e = static_cast<QWheelEvent *>(event);
int o = QObject::staticQtMetaObject.indexOfEnumerator("Orientations");
QMetaEnum orient = QObject::staticQtMetaObject.enumerator(o);
@ -140,8 +138,7 @@ QString ContainmentActions::eventToString(QEvent *event)
modifiers = e->modifiers();
break;
}
case QEvent::ContextMenu:
{
case QEvent::ContextMenu: {
int m = QObject::staticQtMetaObject.indexOfEnumerator("MouseButtons");
QMetaEnum mouse = QObject::staticQtMetaObject.enumerator(m);
trigger = mouse.valueToKey(Qt::RightButton);
@ -167,5 +164,4 @@ void ContainmentActions::setContainment(Containment *newContainment)
} // Plasma namespace
#include "moc_containmentactions.cpp"

View File

@ -217,7 +217,6 @@ int Corona::screenForContainment(const Containment* containment) const
return -1;
}
int Corona::numScreens() const
{
return 1;
@ -552,6 +551,4 @@ QList<Plasma::Containment *> CoronaPrivate::importLayout(const KConfigGroup &con
} // namespace Plasma
#include "moc_corona.cpp"

View File

@ -204,8 +204,7 @@ DataEngine* DataContainer::getDataEngine()
{
QObject *o = this;
DataEngine *de = NULL;
while (de == NULL)
{
while (de == NULL) {
o = dynamic_cast<QObject *>(o->parent());
if (o == NULL) {
return NULL;
@ -397,6 +396,4 @@ void DataContainer::timerEvent(QTimerEvent * event)
} // Plasma namespace
#include "moc_datacontainer.cpp"

View File

@ -637,5 +637,4 @@ void DataEnginePrivate::scheduleSourcesUpdated()
}
#include "moc_dataengine.cpp"

View File

@ -111,4 +111,3 @@ DataEngine *DataEngineConsumer::dataEngine(const QString &name)
#include "private/moc_dataengineconsumer_p.cpp"

View File

@ -75,4 +75,3 @@ private:
#endif

View File

@ -38,7 +38,6 @@
namespace Plasma
{
QHash<QString, FrameData *> FrameSvgPrivate::s_sharedFrames;
// Any attempt to generate a frame whose width or height is larger than this
@ -797,7 +796,6 @@ void FrameSvgPrivate::generateFrameBackground(FrameData *frame)
const int topOffset = 0;
const int leftOffset = 0;
if (!size.isValid()) {
#ifndef NDEBUG
// qDebug() << "Invalid frame size" << size;
@ -1025,7 +1023,6 @@ void FrameSvgPrivate::updateSizes() const
frame->fixedTopMargin = frame->fixedTopHeight;
}
//The same, but its size depends from the margin being enabled
if (frame->enabledBorders & FrameSvg::TopBorder) {
frame->topHeight = q->elementSize(prefix % "top").height();
@ -1167,5 +1164,4 @@ int FrameData::refcount() const
} // Plasma namespace
#include "moc_framesvg.cpp"

View File

@ -62,6 +62,4 @@ KJob* PackageStructure::uninstall(Package *package, const QString &packageRoot)
}
#include "moc_packagestructure.cpp"

View File

@ -301,8 +301,6 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati
} // Plasma namespace
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::Constraints)
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::Flip)
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::ComponentTypes)

View File

@ -42,7 +42,8 @@
#include "private/service_p.h" // for NullService
#include "private/storage_p.h"
namespace Plasma {
namespace Plasma
{
static PluginLoader *s_pluginLoader = 0;
@ -109,8 +110,6 @@ QString PluginLoaderPrivate::parentAppConstraint(const QString &parentApp)
return QString("[X-KDE-ParentApp] == '%1'").arg(parentApp);
}
PluginLoader::PluginLoader()
: d(new PluginLoaderPrivate)
{
@ -220,7 +219,6 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
return 0;
}
QString error;
applet = offer->createInstance<Plasma::Applet>(0, allArgs, &error);
@ -618,7 +616,6 @@ KPluginInfo::List PluginLoader::listContainments(const QString &category,
return listContainmentsOfType(QString(), category, parentApp);
}
KPluginInfo::List PluginLoader::listContainmentsOfType(const QString &type,
const QString &category,
const QString &parentApp)
@ -683,7 +680,6 @@ QStringList PluginLoader::listContainmentTypes()
return types.toList();
}
KPluginInfo::List PluginLoader::listDataEngineInfo(const QString &parentApp)
{
KPluginInfo::List list;

View File

@ -24,7 +24,8 @@
#include <plasma/plasma.h>
#include <kplugininfo.h>
namespace Plasma {
namespace Plasma
{
class Applet;
class Containment;

View File

@ -70,7 +70,6 @@ class AssociatedApplicationManagerSingleton
Q_GLOBAL_STATIC(AssociatedApplicationManagerSingleton, privateAssociatedApplicationManagerSelf)
AssociatedApplicationManager::AssociatedApplicationManager(QObject *parent)
: QObject(parent),
d(new AssociatedApplicationManagerPrivate())
@ -144,7 +143,6 @@ bool AssociatedApplicationManager::appletHasValidAssociatedApplication(const Pla
return (d->applicationNames.contains(applet) || d->urlLists.contains(applet));
}
} // namespace Plasma
#include <moc_associatedapplicationmanager_p.cpp>

View File

@ -198,7 +198,6 @@ class ConfigLoaderPrivate
return saveDefaults;
}
QList<bool *> bools;
QList<QString *> strings;
QList<QStringList *> stringlists;

View File

@ -22,7 +22,6 @@
#include "private/containment_p.h"
#include <kactioncollection.h>
#include <QDebug>
#include <kiconloader.h>
@ -37,7 +36,6 @@
#include "private/applet_p.h"
namespace Plasma
{

View File

@ -29,7 +29,6 @@
#include "corona.h"
#include "containmentactions.h"
class KJob;
namespace KIO

View File

@ -20,7 +20,6 @@
#ifndef PLASMA_CONTAINMENTACTIONSPRIVATE_H
#define PLASMA_CONTAINMENTACTIONSPRIVATE_H
namespace Plasma
{

View File

@ -166,6 +166,4 @@ void SignalRelay::timerEvent(QTimerEvent *event)
} // Plasma namespace
#include "moc_datacontainer_p.cpp"

View File

@ -212,5 +212,4 @@ void DataEngineManager::timerEvent(QTimerEvent *)
} // namespace Plasma
#include "moc_dataenginemanager_p.cpp"

View File

@ -74,7 +74,6 @@ class PLASMA_EXPORT DataEngineManager: public QObject
*/
void unloadEngine(const QString &name);
protected:
/**
* Reimplemented from QObject

View File

@ -62,12 +62,14 @@ void EffectWatcher::init(const QString &property)
bool EffectWatcher::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
{
Q_UNUSED(result);
if (eventType != "xcb_generic_event_t")
if (eventType != "xcb_generic_event_t") {
return false;
}
xcb_generic_event_t *event = reinterpret_cast<xcb_generic_event_t *>(message);
uint response_type = event->response_type & ~0x80;
if (response_type != XCB_PROPERTY_NOTIFY || m_property == XCB_ATOM_NONE)
if (response_type != XCB_PROPERTY_NOTIFY || m_property == XCB_ATOM_NONE) {
return false;
}
xcb_property_notify_event_t *prop_event = reinterpret_cast<xcb_property_notify_event_t *>(event);
if (prop_event->atom == m_property) {

View File

@ -25,7 +25,8 @@
namespace Plasma
{
class PackageJobPrivate {
class PackageJobPrivate
{
public:
PackageJobThread *thread;
QString installPath;
@ -36,10 +37,10 @@ PackageJob::PackageJob(const QString &servicePrefix, QObject* parent) :
{
d = new PackageJobPrivate;
d->thread = new PackageJobThread(servicePrefix, this);
connect(d->thread, SIGNAL(finished(bool, const QString&)),
SLOT(slotFinished(bool, const QString&)), Qt::QueuedConnection);
connect(d->thread, SIGNAL(installPathChanged(const QString&)),
SIGNAL(installPathChanged(const QString&)), Qt::QueuedConnection);
connect(d->thread, SIGNAL(finished(bool,QString)),
SLOT(slotFinished(bool,QString)), Qt::QueuedConnection);
connect(d->thread, SIGNAL(installPathChanged(QString)),
SIGNAL(installPathChanged(QString)), Qt::QueuedConnection);
}
PackageJob::~PackageJob()

View File

@ -22,7 +22,6 @@
#include "kjob.h"
namespace Plasma
{

View File

@ -20,7 +20,6 @@
#include "private/packagejobthread_p.h"
#include "package.h"
#include "config-plasma.h"
@ -86,8 +85,9 @@ bool copyFolder(QString sourcePath, QString targetPath)
bool removeFolder(QString folderPath)
{
QDir folder(folderPath);
if(!folder.exists())
if (!folder.exists()) {
return false;
}
foreach (const QString &fileName, folder.entryList(QDir::Files)) {
if (!QFile::remove(folderPath + QDir::separator() + fileName)) {
@ -106,16 +106,14 @@ bool removeFolder(QString folderPath)
return folder.rmdir(folderName);
}
class PackageJobThreadPrivate {
class PackageJobThreadPrivate
{
public:
QString installPath;
QString errorMessage;
QString servicePrefix;
};
PackageJobThread::PackageJobThread(const QString &servicePrefix, QObject *parent) :
QThread(parent)
{
@ -336,7 +334,8 @@ bool PackageJobThread::uninstallPackage(const QString& packagePath)
return false;
}
QString pkg;
{ // FIXME: remove, pass in packageroot, type and pluginName separately?
{
// FIXME: remove, pass in packageroot, type and pluginName separately?
QString _path = packagePath;
QStringList ps = packagePath.split('/');
int ix = ps.count() - 1;
@ -367,8 +366,6 @@ bool PackageJobThread::uninstallPackage(const QString& packagePath)
return true;
}
} // namespace Plasma
#include "moc_packagejobthread_p.cpp"

View File

@ -275,7 +275,6 @@ void ShellPackage::initPackage(Plasma::Package *package)
//Widget explorer
package->addFileDefinition("widgetexplorer", "explorer/WidgetExplorer.qml", i18n("Widgets explorer UI"));
//package->setRequired("mainscript", true);
}

View File

@ -78,7 +78,6 @@ public:
void initPackage(Plasma::Package *package);
};
} // namespace Plasma
#endif // LIBS_PLASMA_PACKAGES_P_H

View File

@ -38,7 +38,6 @@
#include "dataengine.h"
#include "storagethread_p.h"
StorageJob::StorageJob(const QString &destination,
const QString &operation,
const QVariantMap &parameters,
@ -71,7 +70,6 @@ QString StorageJob::clientName() const
return m_clientName;
}
void StorageJob::start()
{
//FIXME: QHASH

View File

@ -72,5 +72,4 @@ private:
QString m_clientName;
};
#endif //PLASMA_STORAGE_H

View File

@ -30,7 +30,6 @@
#include <QDebug>
#include <qstandardpaths.h>
namespace Plasma
{

View File

@ -20,7 +20,6 @@
#ifndef STORAGETHREAD_H
#define STORAGETHREAD_H
#include <QThread>
#include <QSqlDatabase>
#include <QWeakPointer>

View File

@ -46,7 +46,6 @@ QAtomicInt ThemePrivate::globalThemeRefCount = QAtomicInt();
QHash<QString, ThemePrivate *> ThemePrivate::themes = QHash<QString, ThemePrivate *>();
QHash<QString, QAtomicInt> ThemePrivate::themesRefCount = QHash<QString, QAtomicInt>();
ThemePrivate::ThemePrivate(QObject *parent)
: QObject(parent),
colorScheme(QPalette::Active, KColorScheme::Window, KSharedConfigPtr(0)),
@ -129,7 +128,6 @@ KConfigGroup &ThemePrivate::config()
return cfg;
}
bool ThemePrivate::useCache()
{
bool cachesTooOld = false;
@ -150,7 +148,6 @@ bool ThemePrivate::useCache()
}
themeMetadataPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal("desktoptheme/") % themeName % QLatin1Literal("/metadata.desktop"));
if (isRegularTheme) {
const QString cacheFileBase = cacheFile + QStringLiteral("*.kcache");

View File

@ -139,5 +139,4 @@ void AppletScript::setContainmentType(Plasma::Types::ContainmentType type)
} // Plasma namespace
#include "moc_appletscript.cpp"

View File

@ -197,5 +197,4 @@ void DataEngineScript::forceImmediateUpdateOfAllVisualizations()
} // Plasma namespace
#include "moc_dataenginescript.cpp"

View File

@ -319,6 +319,4 @@ void Service::registerOperationsScheme()
} // namespace Plasma
#include "moc_service.cpp"

Some files were not shown because too many files have changed in this diff Show More