aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Luc Lamadon <jean-luc.lamadon@nokia.com>2010-01-12 13:15:05 +0200
committerJean-Luc Lamadon <jean-luc.lamadon@nokia.com>2010-01-12 13:15:05 +0200
commit75524ad81e2c74842cfd336200fe9f6d61145c9a (patch)
treef3cc8cb701cc0e22fe2d0aa65c2c2f12dbc19a3a
parent1dbd308ec178d7a84fbb26716b8d561e101e959d (diff)
parentb9eea16a2cc509ecf9b2a00a8aef37efa1067969 (diff)
Merge branch 'master' of git@gitorious.org:maemo-af/contextkit
-rw-r--r--common/logging.cpp8
-rw-r--r--libcontextprovider/context-provide/commandwatcher.cpp14
-rw-r--r--libcontextprovider/context-provide/commandwatcher.h2
-rw-r--r--libcontextprovider/context-provide/propertyproxy.h2
-rw-r--r--libcontextprovider/customer-tests/client/commandwatcher.cpp6
-rw-r--r--libcontextprovider/customer-tests/client/commandwatcher.h2
-rw-r--r--libcontextprovider/customer-tests/service/servicetest.h4
-rw-r--r--libcontextprovider/customer-tests/subscription/subscriptiontests.h4
-rw-r--r--libcontextprovider/customer-tests/types/typestests.h4
-rw-r--r--libcontextprovider/customer-tests/value-changes/valuechangestests.h4
-rw-r--r--libcontextprovider/src/contextc.cpp2
-rw-r--r--libcontextprovider/src/group.cpp4
-rw-r--r--libcontextprovider/src/group.h4
-rw-r--r--libcontextprovider/src/listeners.cpp4
-rw-r--r--libcontextprovider/src/listeners.h2
-rw-r--r--libcontextprovider/src/property.h2
-rw-r--r--libcontextprovider/src/propertyadaptor.h6
-rw-r--r--libcontextprovider/src/propertyprivate.cpp6
-rw-r--r--libcontextprovider/src/propertyprivate.h2
-rw-r--r--libcontextprovider/src/servicebackend.cpp4
-rw-r--r--libcontextprovider/unit-tests/contextc/contextcunittest.cpp18
-rw-r--r--libcontextprovider/unit-tests/contextc/group.h2
-rw-r--r--libcontextprovider/unit-tests/contextc/property.h2
-rw-r--r--libcontextprovider/unit-tests/contextgroup/contextgroupunittest.cpp14
-rw-r--r--libcontextprovider/unit-tests/contextgroup/property.h2
-rw-r--r--libcontextprovider/unit-tests/property/manager.h2
-rw-r--r--libcontextprovider/unit-tests/property/property.h2
-rw-r--r--libcontextprovider/unit-tests/property/propertyprivate.h2
-rw-r--r--libcontextprovider/unit-tests/property/propertyunittest.cpp6
-rw-r--r--libcontextprovider/unit-tests/service/serviceunittest.cpp2
-rw-r--r--libcontextprovider/unit-tests/servicebackend/servicebackendunittest.cpp2
-rw-r--r--libcontextsubscriber/cli/commandwatcher.cpp14
-rw-r--r--libcontextsubscriber/cli/commandwatcher.h2
-rw-r--r--libcontextsubscriber/cli/context-listen.cpp4
-rw-r--r--libcontextsubscriber/cli/propertylistener.h2
-rw-r--r--libcontextsubscriber/cls/context-ls.cpp4
-rw-r--r--libcontextsubscriber/customer-tests/testplugins/timeplugin.cpp6
-rw-r--r--libcontextsubscriber/customer-tests/testplugins/timeplugin.h2
-rw-r--r--libcontextsubscriber/src/assoctree.cpp8
-rw-r--r--libcontextsubscriber/src/contextkitplugin.cpp32
-rw-r--r--libcontextsubscriber/src/contextkitplugin.h8
-rw-r--r--libcontextsubscriber/src/contextproperty.cpp2
-rw-r--r--libcontextsubscriber/src/contextproperty.h4
-rw-r--r--libcontextsubscriber/src/contextpropertyinfo.cpp16
-rw-r--r--libcontextsubscriber/src/contextpropertyinfo.h4
-rw-r--r--libcontextsubscriber/src/contextregistryinfo.cpp24
-rw-r--r--libcontextsubscriber/src/contextregistryinfo.h4
-rw-r--r--libcontextsubscriber/src/contexttypeinfo.cpp12
-rw-r--r--libcontextsubscriber/src/contexttyperegistryinfo.cpp2
-rw-r--r--libcontextsubscriber/src/dbusnamelistener.cpp4
-rw-r--r--libcontextsubscriber/src/dbusnamelistener.h4
-rw-r--r--libcontextsubscriber/src/handlesignalrouter.h2
-rw-r--r--libcontextsubscriber/src/infobackend.cpp16
-rw-r--r--libcontextsubscriber/src/infobackend.h2
-rw-r--r--libcontextsubscriber/src/infocdbbackend.cpp8
-rw-r--r--libcontextsubscriber/src/infocdbbackend.h2
-rw-r--r--libcontextsubscriber/src/infoxmlbackend.cpp16
-rw-r--r--libcontextsubscriber/src/infoxmlbackend.h2
-rw-r--r--libcontextsubscriber/src/iproviderplugin.h2
-rw-r--r--libcontextsubscriber/src/propertyhandle.cpp14
-rw-r--r--libcontextsubscriber/src/propertyhandle.h4
-rw-r--r--libcontextsubscriber/src/provider.cpp10
-rw-r--r--libcontextsubscriber/src/provider.h4
-rw-r--r--libcontextsubscriber/src/queuedinvoker.cpp2
-rw-r--r--libcontextsubscriber/src/queuedinvoker.h4
-rw-r--r--libcontextsubscriber/src/subscriberinterface.cpp14
-rw-r--r--libcontextsubscriber/src/subscriberinterface.h4
-rw-r--r--libcontextsubscriber/unit-tests/assoctree/assoctreeunittest.cpp4
-rw-r--r--libcontextsubscriber/unit-tests/cdb/cdbunittest.cpp2
-rw-r--r--libcontextsubscriber/unit-tests/contextpropertyinfo/contextpropertyinfounittest.cpp10
-rw-r--r--libcontextsubscriber/unit-tests/contextpropertyinfo/infobackend.h2
-rw-r--r--libcontextsubscriber/unit-tests/contextregistryinfo/contextregistryinfounittest.cpp10
-rw-r--r--libcontextsubscriber/unit-tests/contextregistryinfo/infobackend.h2
-rw-r--r--libcontextsubscriber/unit-tests/contexttypeinfo/contexttypeinfounittest.cpp2
-rw-r--r--libcontextsubscriber/unit-tests/contexttyperegistryinfo/contexttyperegistryinfounittest.cpp2
-rw-r--r--libcontextsubscriber/unit-tests/duration/testduration.cpp2
-rw-r--r--libcontextsubscriber/unit-tests/handlesignalrouter/propertyhandle.h2
-rw-r--r--libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.cpp4
-rw-r--r--libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.h2
-rw-r--r--libcontextsubscriber/unit-tests/infobackend/infobackendunittest.cpp2
-rw-r--r--libcontextsubscriber/unit-tests/infocdbbackend/infocdbbackendunittest.cpp4
-rw-r--r--libcontextsubscriber/unit-tests/infoxmlbackend/infoxmlbackendunittest.cpp6
-rw-r--r--libcontextsubscriber/unit-tests/nanoxml/nanoxmlunittest.cpp2
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/contextpropertyinfo.h2
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/contextregistryinfo.h2
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/dbusnamelistener.h2
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/provider.h2
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp8
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.h2
-rw-r--r--libcontextsubscriber/unit-tests/provider/contextkitplugin.h2
-rw-r--r--libcontextsubscriber/unit-tests/provider/handlesignalrouter.h2
-rw-r--r--libcontextsubscriber/unit-tests/provider/testprovider.cpp20
-rw-r--r--libcontextsubscriber/unit-tests/provider/testprovider.h2
-rw-r--r--libcontextsubscriber/update-contextkit-providers/update-contextkit-providers.cpp4
-rw-r--r--sandbox/messaging-to-self/queuedinvoker.cpp2
-rw-r--r--sandbox/messaging-to-self/queuedinvoker.h4
-rw-r--r--sandbox/multithreading-tests/new-property-in-thread/thread.h2
-rw-r--r--sandbox/multithreading-tests/old-property-in-thread/thread.h2
-rw-r--r--sandbox/multithreading-tests/single-thread/listener.h2
-rw-r--r--sandbox/multithreading-tests/stress-test/thread.h2
-rw-r--r--sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h2
-rw-r--r--sandbox/multithreading-tests/wait-for-subscription-thread/thread.h2
-rw-r--r--sandbox/wait-test/main.cpp4
103 files changed, 266 insertions, 266 deletions
diff --git a/common/logging.cpp b/common/logging.cpp
index 80854b7b..bad377b4 100644
--- a/common/logging.cpp
+++ b/common/logging.cpp
@@ -249,14 +249,14 @@ void ContextRealLogger::initialize()
// Check feature enablers (showFeatures)
const char *showFeaturesStr = getenv("CONTEXT_LOG_SHOW_FEATURES");
if (showFeaturesStr) {
- foreach (QString f, QString(showFeaturesStr).split(','))
+ Q_FOREACH (QString f, QString(showFeaturesStr).split(','))
showFeatures << f.trimmed();
}
// Check feature hide (hideFeatures)
const char *hideFeaturesStr = getenv("CONTEXT_LOG_HIDE_FEATURES");
if (hideFeaturesStr) {
- foreach (QString f, QString(hideFeaturesStr).split(','))
+ Q_FOREACH (QString f, QString(hideFeaturesStr).split(','))
hideFeatures << f.trimmed();
}
@@ -363,13 +363,13 @@ bool ContextRealLogger::shouldPrint()
return false;
// Now try to eliminate by feature name
- foreach(QString feature, features) {
+ Q_FOREACH(QString feature, features) {
if (hideFeatures.contains(feature))
return false;
}
if (showFeatures.length() > 0) {
- foreach(QString feature, showFeatures) {
+ Q_FOREACH(QString feature, showFeatures) {
if (features.contains(feature))
return true;
}
diff --git a/libcontextprovider/context-provide/commandwatcher.cpp b/libcontextprovider/context-provide/commandwatcher.cpp
index 8c9ce950..6f2537d8 100644
--- a/libcontextprovider/context-provide/commandwatcher.cpp
+++ b/libcontextprovider/context-provide/commandwatcher.cpp
@@ -64,19 +64,19 @@ CommandWatcher::CommandWatcher(QString bn, QDBusConnection::BusType bt, int comm
CommandWatcher::~CommandWatcher()
{
- foreach(Property *p, properties)
+ Q_FOREACH(Property *p, properties)
delete p;
- foreach(PropertyProxy *p, proxies)
+ Q_FOREACH(PropertyProxy *p, proxies)
delete p;
}
void CommandWatcher::onRegistryChanged()
{
- foreach (PropertyProxy *p, proxies)
+ Q_FOREACH (PropertyProxy *p, proxies)
delete p;
proxies.clear();
// (Re)create the proxies and restore the user's will of overriding.
- foreach (QString key, registryInfo->listKeys()) {
+ Q_FOREACH (QString key, registryInfo->listKeys()) {
if (ContextPropertyInfo(key).provided()) {
qDebug() << "creating proxy for" << key;
proxies.insert(key, new PropertyProxy(key, !properties.contains(key),
@@ -100,7 +100,7 @@ void CommandWatcher::onActivated()
while ((nextSeparator = commandBuffer.indexOf('\n')) != -1) {
// split lines to separate commands by semicolons
QStringList commands = QString::fromUtf8(commandBuffer.constData()).left(nextSeparator).split(";");
- foreach (QString command, commands)
+ Q_FOREACH (QString command, commands)
interpret(command.trimmed());
commandBuffer.remove(0, nextSeparator + 1);
}
@@ -269,7 +269,7 @@ void CommandWatcher::delCommand(const QStringList &args)
void CommandWatcher::listCommand()
{
- foreach (QString key,
+ Q_FOREACH (QString key,
QSet<QString>::fromList(properties.keys()) +
QSet<QString>::fromList(proxies.keys()))
infoCommand(QStringList(key));
@@ -349,7 +349,7 @@ void CommandWatcher::dumpCommand(const QStringList &args)
QString bType = (busType == QDBusConnection::SystemBus) ? "system" : "session";
xml << "<?xml version=\"1.0\"?>\n";
xml << QString("<provider bus=\"%1\" service=\"%2\">\n").arg(bType).arg(busName);
- foreach(QString key, properties.keys()) {
+ Q_FOREACH(QString key, properties.keys()) {
xml << QString(" <key name=\"%1\">\n").arg(key);
xml << " <type>\n";
xml << types[key].dumpXML(3);
diff --git a/libcontextprovider/context-provide/commandwatcher.h b/libcontextprovider/context-provide/commandwatcher.h
index 9b5422f9..9f194c7c 100644
--- a/libcontextprovider/context-provide/commandwatcher.h
+++ b/libcontextprovider/context-provide/commandwatcher.h
@@ -73,7 +73,7 @@ private:
QDBusConnection::BusType busType;
bool started;
-private slots:
+private Q_SLOTS:
void onActivated();
void onRegistryChanged();
};
diff --git a/libcontextprovider/context-provide/propertyproxy.h b/libcontextprovider/context-provide/propertyproxy.h
index f185f2ad..7e93542a 100644
--- a/libcontextprovider/context-provide/propertyproxy.h
+++ b/libcontextprovider/context-provide/propertyproxy.h
@@ -33,7 +33,7 @@ public:
void enable(bool enable);
QVariant realValue() const;
QString type() const;
-private slots:
+private Q_SLOTS:
void onValueChanged();
private:
ContextProvider::Property *provider;
diff --git a/libcontextprovider/customer-tests/client/commandwatcher.cpp b/libcontextprovider/customer-tests/client/commandwatcher.cpp
index 72b95ceb..27d7a6eb 100644
--- a/libcontextprovider/customer-tests/client/commandwatcher.cpp
+++ b/libcontextprovider/customer-tests/client/commandwatcher.cpp
@@ -38,7 +38,7 @@ void CommandWatcher::onActivated()
while ((nextSeparator = commandBuffer.indexOf('\n')) != -1) {
// split lines to separate commands by semicolons
QStringList commands = QString::fromUtf8(commandBuffer.constData()).left(nextSeparator).split(";");
- foreach (QString command, commands)
+ Q_FOREACH (QString command, commands)
interpret(command.trimmed());
commandBuffer.remove(0, nextSeparator + 1);
}
@@ -230,7 +230,7 @@ void CommandWatcher::waitForChanged(int timeout)
if (changedSignalReceived) {
out << "ValueChanged: ";
- foreach (QString param, changedSignalParameters)
+ Q_FOREACH (QString param, changedSignalParameters)
out << param << " ";
out << endl;
}
@@ -245,7 +245,7 @@ void CommandWatcher::onValueChanged(QList<QVariant> value, quint64 timestamp, QD
{
changedSignalReceived = true;
QPair<QString, QString> connData;
- foreach (connData, connectionMap)
+ Q_FOREACH (connData, connectionMap)
{
QDBusReply<QString> reply = QDBusConnection::sessionBus().interface()->serviceOwner(connData.second);
if (reply.value() == msg.service())
diff --git a/libcontextprovider/customer-tests/client/commandwatcher.h b/libcontextprovider/customer-tests/client/commandwatcher.h
index 2b251c79..7f5e515a 100644
--- a/libcontextprovider/customer-tests/client/commandwatcher.h
+++ b/libcontextprovider/customer-tests/client/commandwatcher.h
@@ -36,7 +36,7 @@ private:
bool listenToChanged(const QString& name);
QString keyToPath(QString key);
-private slots:
+private Q_SLOTS:
void onActivated();
void onValueChanged(QList<QVariant> value, quint64 timestamp, QDBusMessage msg);
diff --git a/libcontextprovider/customer-tests/service/servicetest.h b/libcontextprovider/customer-tests/service/servicetest.h
index 6756cf61..6fccee70 100644
--- a/libcontextprovider/customer-tests/service/servicetest.h
+++ b/libcontextprovider/customer-tests/service/servicetest.h
@@ -11,7 +11,7 @@ class ServiceTest : public QObject
QProcess *client;
bool isReadyToRead;
-private slots:
+private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void init();
@@ -23,7 +23,7 @@ private slots:
void defaultService();
void recreateProperty();
-public slots:
+public Q_SLOTS:
void readStandardOutput();
private:
diff --git a/libcontextprovider/customer-tests/subscription/subscriptiontests.h b/libcontextprovider/customer-tests/subscription/subscriptiontests.h
index ce558978..2f568936 100644
--- a/libcontextprovider/customer-tests/subscription/subscriptiontests.h
+++ b/libcontextprovider/customer-tests/subscription/subscriptiontests.h
@@ -23,7 +23,7 @@ private:
QProcess *client;
bool isReadyToRead;
-private slots:
+private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void init();
@@ -37,7 +37,7 @@ private slots:
void multiSubscribe();
void illegalUnsubscribe();
-public slots:
+public Q_SLOTS:
void readStandardOutput();
private:
diff --git a/libcontextprovider/customer-tests/types/typestests.h b/libcontextprovider/customer-tests/types/typestests.h
index 64e67406..4defdd62 100644
--- a/libcontextprovider/customer-tests/types/typestests.h
+++ b/libcontextprovider/customer-tests/types/typestests.h
@@ -28,7 +28,7 @@ private:
QProcess *client;
bool isReadyToRead;
-private slots:
+private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void init();
@@ -37,7 +37,7 @@ private slots:
void typesInReturnValueOfSubscribe();
void typesInChangeSignal();
-public slots:
+public Q_SLOTS:
void readStandardOutput();
private:
diff --git a/libcontextprovider/customer-tests/value-changes/valuechangestests.h b/libcontextprovider/customer-tests/value-changes/valuechangestests.h
index 63746f20..92b5df32 100644
--- a/libcontextprovider/customer-tests/value-changes/valuechangestests.h
+++ b/libcontextprovider/customer-tests/value-changes/valuechangestests.h
@@ -23,7 +23,7 @@ private:
QString writeToClient(const char* input);
-private slots:
+private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void init();
@@ -37,7 +37,7 @@ private slots:
void changesBetweenZeroAndUnknown();
-public slots:
+public Q_SLOTS:
void readStandardOutput();
};
diff --git a/libcontextprovider/src/contextc.cpp b/libcontextprovider/src/contextc.cpp
index 2125479a..71592286 100644
--- a/libcontextprovider/src/contextc.cpp
+++ b/libcontextprovider/src/contextc.cpp
@@ -130,7 +130,7 @@ void context_provider_stop (void)
// Delete all listeners
if (listeners) {
- foreach (Listener *listener, *listeners)
+ Q_FOREACH (Listener *listener, *listeners)
delete listener;
}
delete listeners; listeners = NULL;
diff --git a/libcontextprovider/src/group.cpp b/libcontextprovider/src/group.cpp
index 16fe8166..63542d09 100644
--- a/libcontextprovider/src/group.cpp
+++ b/libcontextprovider/src/group.cpp
@@ -102,7 +102,7 @@ void Group::onFirstSubscriberAppeared()
++(priv->propertiesSubscribedTo);
if (priv->propertiesSubscribedTo == 1) {
contextDebug() << F_GROUP << F_SIGNALS << "First subscriber appeared for group";
- emit firstSubscriberAppeared();
+ Q_EMIT firstSubscriberAppeared();
}
}
@@ -112,7 +112,7 @@ void Group::onLastSubscriberDisappeared()
--(priv->propertiesSubscribedTo);
if (priv->propertiesSubscribedTo == 0) {
contextDebug() << F_GROUP << F_SIGNALS << "Last subscriber gone for group";
- emit lastSubscriberDisappeared();
+ Q_EMIT lastSubscriberDisappeared();
}
}
diff --git a/libcontextprovider/src/group.h b/libcontextprovider/src/group.h
index 9969a6e7..a6ab38e2 100644
--- a/libcontextprovider/src/group.h
+++ b/libcontextprovider/src/group.h
@@ -52,7 +52,7 @@ public:
inline Group &operator<<(const Property *prop)
{ add(*prop); return *this; }
-signals:
+Q_SIGNALS:
/// Emitted when the group of Context objects is subscribed
/// to. I.e., when none of them were subscribed to and now some of
/// them were subscribed to.
@@ -63,7 +63,7 @@ signals:
/// them were unsubscribed from.
void lastSubscriberDisappeared();
-private slots:
+private Q_SLOTS:
void onFirstSubscriberAppeared();
void onLastSubscriberDisappeared();
diff --git a/libcontextprovider/src/listeners.cpp b/libcontextprovider/src/listeners.cpp
index 8c200b7c..8a04a474 100644
--- a/libcontextprovider/src/listeners.cpp
+++ b/libcontextprovider/src/listeners.cpp
@@ -61,7 +61,7 @@ GroupListener::GroupListener(Service &service, const QStringList &keys,
bool clears, ContextProviderSubscriptionChangedCallback cb, void *dt)
: Listener(clears, cb, dt)
{
- foreach (const QString &key, keys)
+ Q_FOREACH (const QString &key, keys)
group << new Property(service, key, this);
sconnect(&group, SIGNAL(firstSubscriberAppeared()), this, SLOT(onFirstSubscriberAppeared()));
sconnect(&group, SIGNAL(lastSubscriberDisappeared()), this, SLOT(onLastSubscriberDisappeared()));
@@ -69,7 +69,7 @@ GroupListener::GroupListener(Service &service, const QStringList &keys,
void GroupListener::clear()
{
- foreach(const Property *p, group.getProperties())
+ Q_FOREACH(const Property *p, group.getProperties())
((Property *)p)->unsetValue();
}
diff --git a/libcontextprovider/src/listeners.h b/libcontextprovider/src/listeners.h
index db561eb8..95416846 100644
--- a/libcontextprovider/src/listeners.h
+++ b/libcontextprovider/src/listeners.h
@@ -44,7 +44,7 @@ class Listener : public QObject
public:
Listener(bool clears, ContextProviderSubscriptionChangedCallback cb, void *dt);
-private slots:
+private Q_SLOTS:
void onFirstSubscriberAppeared();
void onLastSubscriberDisappeared();
diff --git a/libcontextprovider/src/property.h b/libcontextprovider/src/property.h
index 788a270d..40e9e001 100644
--- a/libcontextprovider/src/property.h
+++ b/libcontextprovider/src/property.h
@@ -56,7 +56,7 @@ private:
PropertyPrivate *priv; ///< Private implementation
void init(ServiceBackend *serviceBackend, const QString &key);
-signals:
+Q_SIGNALS:
/// This is emitted when the first subscriber appears for this
/// Property. It can be used e.g. to start the actual process of
/// harvesting the data needed for this Property.
diff --git a/libcontextprovider/src/propertyadaptor.h b/libcontextprovider/src/propertyadaptor.h
index 60d741ab..cb0743bb 100644
--- a/libcontextprovider/src/propertyadaptor.h
+++ b/libcontextprovider/src/propertyadaptor.h
@@ -44,15 +44,15 @@ public:
QString objectPath() const;
void forgetClients();
-public slots:
+public Q_SLOTS:
void Subscribe(const QDBusMessage& msg, QVariantList& values, quint64& timestamp);
void Unsubscribe(const QDBusMessage& msg);
void Get(QVariantList& values, quint64& timestamp);
-signals:
+Q_SIGNALS:
void ValueChanged(const QVariantList &values, const quint64& timestamp);
-private slots:
+private Q_SLOTS:
void onServiceOwnerChanged(const QString&, const QString&, const QString&);
void onValueChanged(QVariantList values, quint64 timestamp);
diff --git a/libcontextprovider/src/propertyprivate.cpp b/libcontextprovider/src/propertyprivate.cpp
index 57d6cf3e..a59566d6 100644
--- a/libcontextprovider/src/propertyprivate.cpp
+++ b/libcontextprovider/src/propertyprivate.cpp
@@ -107,7 +107,7 @@ void PropertyPrivate::emitValue()
if (value.isNull() == false) {
values << value;
}
- emit valueChanged(values, timestamp);
+ Q_EMIT valueChanged(values, timestamp);
}
/// Set the PropertyPrivate to subscribed state. If it was in the
@@ -117,7 +117,7 @@ void PropertyPrivate::setSubscribed()
{
if (subscribed == false) {
subscribed = true;
- emit firstSubscriberAppeared(key);
+ Q_EMIT firstSubscriberAppeared(key);
}
}
@@ -128,7 +128,7 @@ void PropertyPrivate::setUnsubscribed()
{
if (subscribed == true) {
subscribed = false;
- emit lastSubscriberDisappeared(key);
+ Q_EMIT lastSubscriberDisappeared(key);
}
}
diff --git a/libcontextprovider/src/propertyprivate.h b/libcontextprovider/src/propertyprivate.h
index f8bb7c97..efe6807b 100644
--- a/libcontextprovider/src/propertyprivate.h
+++ b/libcontextprovider/src/propertyprivate.h
@@ -44,7 +44,7 @@ public:
void setSubscribed();
void setUnsubscribed();
-signals:
+Q_SIGNALS:
void valueChanged(const QVariantList& values, const quint64& timestamp);
void firstSubscriberAppeared(const QString& key);
void lastSubscriberDisappeared(const QString& key);
diff --git a/libcontextprovider/src/servicebackend.cpp b/libcontextprovider/src/servicebackend.cpp
index caa2e4d2..9b59de93 100644
--- a/libcontextprovider/src/servicebackend.cpp
+++ b/libcontextprovider/src/servicebackend.cpp
@@ -139,7 +139,7 @@ bool ServiceBackend::start()
contextDebug() << F_SERVICE_BACKEND << "Starting service for bus:" << busName;
// Re-register existing Property objects on D-Bus
- foreach (const QString& key, properties.keys()) {
+ Q_FOREACH (const QString& key, properties.keys()) {
contextDebug() << F_SERVICE_BACKEND << "Re-registering" << key;
if (!registerProperty(key, properties[key])) {
return false;
@@ -173,7 +173,7 @@ void ServiceBackend::stop()
// PropertyAdaptor objects to forget their subscriptions (if the
// service is started again, clients will resubscribe).
- foreach (PropertyAdaptor* adaptor, createdAdaptors) {
+ Q_FOREACH (PropertyAdaptor* adaptor, createdAdaptors) {
adaptor->forgetClients();
connection.unregisterObject(adaptor->objectPath());
}
diff --git a/libcontextprovider/unit-tests/contextc/contextcunittest.cpp b/libcontextprovider/unit-tests/contextc/contextcunittest.cpp
index 11d1bbde..c04fad72 100644
--- a/libcontextprovider/unit-tests/contextc/contextcunittest.cpp
+++ b/libcontextprovider/unit-tests/contextc/contextcunittest.cpp
@@ -64,12 +64,12 @@ QSet<const Property *> Group::getProperties()
void Group::fakeFirst()
{
- emit firstSubscriberAppeared();
+ Q_EMIT firstSubscriberAppeared();
}
void Group::fakeLast()
{
- emit lastSubscriberDisappeared();
+ Q_EMIT lastSubscriberDisappeared();
}
/* Mocked implementation of Property */
@@ -82,12 +82,12 @@ void resetVariants()
void emitFirstOn(const QString &k)
{
- foreach (Property* c, propertyList) {
+ Q_FOREACH (Property* c, propertyList) {
if (c->getKey() == k)
c->fakeFirst();
}
- foreach (Group* cg, groupList) {
+ Q_FOREACH (Group* cg, groupList) {
if (cg->keyList.contains(k))
cg->fakeFirst();
}
@@ -95,12 +95,12 @@ void emitFirstOn(const QString &k)
void emitLastOn(const QString &k)
{
- foreach (Property* c, propertyList) {
+ Q_FOREACH (Property* c, propertyList) {
if (c->getKey() == k)
c->fakeLast();
}
- foreach (Group* cg, groupList) {
+ Q_FOREACH (Group* cg, groupList) {
if (cg->keyList.contains(k))
cg->fakeLast();
}
@@ -174,19 +174,19 @@ const QString Property::getKey() const
void Property::fakeFirst()
{
- emit firstSubscriberAppeared(key);
+ Q_EMIT firstSubscriberAppeared(key);
}
void Property::fakeLast()
{
- emit lastSubscriberDisappeared(key);
+ Q_EMIT lastSubscriberDisappeared(key);
}
class ContextCUnitTest : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void init();
void startStopStart();
void installKey();
diff --git a/libcontextprovider/unit-tests/contextc/group.h b/libcontextprovider/unit-tests/contextc/group.h
index 1a3e7b5d..278b0171 100644
--- a/libcontextprovider/unit-tests/contextc/group.h
+++ b/libcontextprovider/unit-tests/contextc/group.h
@@ -52,7 +52,7 @@ public:
inline Group &operator<<(const Property *prop)
{ add(*prop); return *this; }
-signals:
+Q_SIGNALS:
void firstSubscriberAppeared();
void lastSubscriberDisappeared();
diff --git a/libcontextprovider/unit-tests/contextc/property.h b/libcontextprovider/unit-tests/contextc/property.h
index 9f0073c8..178cd2d4 100644
--- a/libcontextprovider/unit-tests/contextc/property.h
+++ b/libcontextprovider/unit-tests/contextc/property.h
@@ -52,7 +52,7 @@ public:
void fakeFirst();
void fakeLast();
-signals:
+Q_SIGNALS:
void firstSubscriberAppeared(const QString &key);
void lastSubscriberDisappeared(const QString &key);
diff --git a/libcontextprovider/unit-tests/contextgroup/contextgroupunittest.cpp b/libcontextprovider/unit-tests/contextgroup/contextgroupunittest.cpp
index 01fb034a..fce9cf4f 100644
--- a/libcontextprovider/unit-tests/contextgroup/contextgroupunittest.cpp
+++ b/libcontextprovider/unit-tests/contextgroup/contextgroupunittest.cpp
@@ -56,7 +56,7 @@ class ContextGroupUnitTest : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void init();
void cleanup();
@@ -105,7 +105,7 @@ void ContextGroupUnitTest::oneProperty()
QCOMPARE(contextGroup->isSubscribedTo(), false);
// Test: property is subscribed to
- emit property1->firstSubscriberAppeared("test.key.1");
+ Q_EMIT property1->firstSubscriberAppeared("test.key.1");
// Expected result: the Group emits the firstSubscriberAppeared signal
QCOMPARE(firstSpy.count(), 1);
@@ -114,7 +114,7 @@ void ContextGroupUnitTest::oneProperty()
QCOMPARE(contextGroup->isSubscribedTo(), true);
// Test: property is unsubscribed from
- emit property1->lastSubscriberDisappeared("test.key.1");
+ Q_EMIT property1->lastSubscriberDisappeared("test.key.1");
// Expected result: the Group emits the lastSubscriberDisappeared signal
QCOMPARE(firstSpy.count(), 1);
@@ -134,7 +134,7 @@ void ContextGroupUnitTest::twoProperties()
QSignalSpy lastSpy(contextGroup, SIGNAL(lastSubscriberDisappeared()));
// Test: property 1 is subscribed to
- emit property1->firstSubscriberAppeared("test.key.1");
+ Q_EMIT property1->firstSubscriberAppeared("test.key.1");
// Expected result: the Group emits the firstSubscriberAppeared signal
QCOMPARE(firstSpy.count(), 1);
@@ -143,7 +143,7 @@ void ContextGroupUnitTest::twoProperties()
QCOMPARE(contextGroup->isSubscribedTo(), true);
// Test: property 2 is subscribed to
- emit property2->firstSubscriberAppeared("test.key.2");
+ Q_EMIT property2->firstSubscriberAppeared("test.key.2");
// Expected result: the Group doesn't emit anything
QCOMPARE(firstSpy.count(), 1);
@@ -152,7 +152,7 @@ void ContextGroupUnitTest::twoProperties()
QCOMPARE(contextGroup->isSubscribedTo(), true);
// Test: property 1 is unsubscribed from
- emit property1->lastSubscriberDisappeared("test.key.1");
+ Q_EMIT property1->lastSubscriberDisappeared("test.key.1");
// Expected result: the Group doesn't emit anything
QCOMPARE(firstSpy.count(), 1);
@@ -161,7 +161,7 @@ void ContextGroupUnitTest::twoProperties()
QCOMPARE(contextGroup->isSubscribedTo(), true);
// Test: property 2 is unsubscribed from
- emit property2->lastSubscriberDisappeared("test.key.2");
+ Q_EMIT property2->lastSubscriberDisappeared("test.key.2");
// Expected result: the Group emits the lastSubscriberDisappeared signal
QCOMPARE(firstSpy.count(), 1);
diff --git a/libcontextprovider/unit-tests/contextgroup/property.h b/libcontextprovider/unit-tests/contextgroup/property.h
index 90c784f5..47b57e2a 100644
--- a/libcontextprovider/unit-tests/contextgroup/property.h
+++ b/libcontextprovider/unit-tests/contextgroup/property.h
@@ -39,7 +39,7 @@ public:
QString myKey;
-signals:
+Q_SIGNALS:
void firstSubscriberAppeared(const QString &key);
void lastSubscriberDisappeared(const QString &key);
diff --git a/libcontextprovider/unit-tests/property/manager.h b/libcontextprovider/unit-tests/property/manager.h
index 9aed0020..e9d4e365 100644
--- a/libcontextprovider/unit-tests/property/manager.h
+++ b/libcontextprovider/unit-tests/property/manager.h
@@ -50,7 +50,7 @@ public:
void fakeLast(const QString &key);
QStringList getKeys();
-signals:
+Q_SIGNALS:
void firstSubscriberAppeared(const QString &key);
void lastSubscriberDisappeared(const QString &key);
diff --git a/libcontextprovider/unit-tests/property/property.h b/libcontextprovider/unit-tests/property/property.h
index e887444d..1399e508 100644
--- a/libcontextprovider/unit-tests/property/property.h
+++ b/libcontextprovider/unit-tests/property/property.h
@@ -59,7 +59,7 @@ private:
PropertyPrivate *priv;
void init(ServiceBackend *serviceBackend, const QString &key);
-signals:
+Q_SIGNALS:
/// This is emitted when the first subscriber appears for this
/// Property. It can be used e.g. to start the actual process of
/// harvesting the data needed for this Property.
diff --git a/libcontextprovider/unit-tests/property/propertyprivate.h b/libcontextprovider/unit-tests/property/propertyprivate.h
index 591045e9..15e72825 100644
--- a/libcontextprovider/unit-tests/property/propertyprivate.h
+++ b/libcontextprovider/unit-tests/property/propertyprivate.h
@@ -45,7 +45,7 @@ public:
void setSubscribed();
void setUnsubscribed();
-signals:
+Q_SIGNALS:
void valueChanged(const QVariantList& values, const qlonglong& timestamp);
void firstSubscriberAppeared(const QString& key);
void lastSubscriberDisappeared(const QString& key);
diff --git a/libcontextprovider/unit-tests/property/propertyunittest.cpp b/libcontextprovider/unit-tests/property/propertyunittest.cpp
index 9ba2de78..6c920300 100644
--- a/libcontextprovider/unit-tests/property/propertyunittest.cpp
+++ b/libcontextprovider/unit-tests/property/propertyunittest.cpp
@@ -55,7 +55,7 @@ class PropertyUnitTest : public QObject
Property* battery_voltage;
Property* battery_is_charging;
-private slots:
+private Q_SLOTS:
void initTestCase();
void init();
void cleanup();
@@ -97,13 +97,13 @@ void PropertyUnitTest::checkSignals()
QSignalSpy spy2(battery_voltage, SIGNAL(lastSubscriberDisappeared(QString)));
QVERIFY(battery_voltage->priv);
- emit battery_voltage->priv->firstSubscriberAppeared("Battery.Voltage");
+ Q_EMIT battery_voltage->priv->firstSubscriberAppeared("Battery.Voltage");
QCOMPARE(spy1.count(), 1);
QList<QVariant> args1 = spy1.takeFirst();
QCOMPARE(args1.at(0).toString(), QString("Battery.Voltage"));
- emit battery_voltage->priv->lastSubscriberDisappeared("Battery.Voltage");
+ Q_EMIT battery_voltage->priv->lastSubscriberDisappeared("Battery.Voltage");
QCOMPARE(spy2.count(), 1);
QList<QVariant> args2 = spy2.takeFirst();
diff --git a/libcontextprovider/unit-tests/service/serviceunittest.cpp b/libcontextprovider/unit-tests/service/serviceunittest.cpp
index 7659367f..626b06c6 100644
--- a/libcontextprovider/unit-tests/service/serviceunittest.cpp
+++ b/libcontextprovider/unit-tests/service/serviceunittest.cpp
@@ -109,7 +109,7 @@ class ServiceUnitTest : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void init();
void cleanup();
void sanityCheck();
diff --git a/libcontextprovider/unit-tests/servicebackend/servicebackendunittest.cpp b/libcontextprovider/unit-tests/servicebackend/servicebackendunittest.cpp
index 22cfcc35..ade99678 100644
--- a/libcontextprovider/unit-tests/servicebackend/servicebackendunittest.cpp
+++ b/libcontextprovider/unit-tests/servicebackend/servicebackendunittest.cpp
@@ -58,7 +58,7 @@ class ServiceBackendUnitTest : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void init();
void sanity();
void defaults();
diff --git a/libcontextsubscriber/cli/commandwatcher.cpp b/libcontextsubscriber/cli/commandwatcher.cpp
index 94e0bb31..ca2fbf0d 100644
--- a/libcontextsubscriber/cli/commandwatcher.cpp
+++ b/libcontextsubscriber/cli/commandwatcher.cpp
@@ -58,7 +58,7 @@ void CommandWatcher::onActivated()
while ((nextSeparator = commandBuffer.indexOf('\n')) != -1) {
// split lines to separate commands by semicolons
QStringList commands = QString::fromUtf8(commandBuffer.constData()).left(nextSeparator).split(";");
- foreach (QString command, commands)
+ Q_FOREACH (QString command, commands)
interpret(command.trimmed());
commandBuffer.remove(0, nextSeparator + 1);
}
@@ -94,32 +94,32 @@ void CommandWatcher::interpret(const QString& command) const
args.pop_front();
if (QString("new").startsWith(commandName)) {
- foreach (QString key, args)
+ Q_FOREACH (QString key, args)
if (properties->contains(key))
qDebug() << "key already exists: " << key;
else
properties->insert(key, new PropertyListener(key));
} else if (QString("delete").startsWith(commandName)) {
- foreach (QString key, args)
+ Q_FOREACH (QString key, args)
if (properties->contains(key))
delete properties->take(key);
else
qDebug() << "no such key:" << key;
} else if (QString("subscribe").startsWith(commandName)) {
- foreach (QString key, args)
+ Q_FOREACH (QString key, args)
if (properties->contains(key))
properties->value(key)->prop->subscribe();
else
qDebug() << "no such key:" << key;
} else if (QString("waitforsubscription").startsWith(commandName)) {
- foreach (QString key, args)
+ Q_FOREACH (QString key, args)
if (properties->contains(key)) {
properties->value(key)->prop->waitForSubscription();
out << "wait finished for " << key << endl;
} else
qDebug() << "no such key:" << key;
} else if (QString("unsubscribe").startsWith(commandName)) {
- foreach (QString key, args)
+ Q_FOREACH (QString key, args)
if (properties->contains(key))
properties->value(key)->prop->unsubscribe();
else
@@ -184,7 +184,7 @@ void CommandWatcher::interpret(const QString& command) const
out << "providers: ";
QList<ContextProviderInfo> providers = properties->value(key)->prop->info()->providers();
- foreach(ContextProviderInfo info, providers)
+ Q_FOREACH(ContextProviderInfo info, providers)
out << info.constructionString << "@" << info.plugin << " ";
out << endl;
diff --git a/libcontextsubscriber/cli/commandwatcher.h b/libcontextsubscriber/cli/commandwatcher.h
index 3eaa55b6..eccd55f5 100644
--- a/libcontextsubscriber/cli/commandwatcher.h
+++ b/libcontextsubscriber/cli/commandwatcher.h
@@ -43,7 +43,7 @@ private:
QMap<QString, PropertyListener*> *properties;
static void help();
-private slots:
+private Q_SLOTS:
void onActivated();
};
#endif
diff --git a/libcontextsubscriber/cli/context-listen.cpp b/libcontextsubscriber/cli/context-listen.cpp
index df3d809f..5013f0e6 100644
--- a/libcontextsubscriber/cli/context-listen.cpp
+++ b/libcontextsubscriber/cli/context-listen.cpp
@@ -48,7 +48,7 @@ int main(int argc, char **argv)
QSet<QString> propertiesToCreate;
args.pop_front();
- foreach (QString key, args) {
+ Q_FOREACH (QString key, args) {
if (key.startsWith("-")) {
QTextStream(stdout) << "Usage: " << argv[0] << " [KEYNAME]..." << endl;
exit(1);
@@ -59,7 +59,7 @@ int main(int argc, char **argv)
QMap<QString, PropertyListener*> properties;
new CommandWatcher(STDIN_FILENO, &properties, QCoreApplication::instance());
- foreach (QString key, propertiesToCreate)
+ Q_FOREACH (QString key, propertiesToCreate)
properties.insert(key, new PropertyListener(key));
diff --git a/libcontextsubscriber/cli/propertylistener.h b/libcontextsubscriber/cli/propertylistener.h
index b15594b5..419805f6 100644
--- a/libcontextsubscriber/cli/propertylistener.h
+++ b/libcontextsubscriber/cli/propertylistener.h
@@ -32,7 +32,7 @@ class PropertyListener : public QObject
public:
PropertyListener(const QString &key);
QString valueToString(QString defaultValue = QString()) const;
-private slots:
+private Q_SLOTS:
void onValueChanged();
public:
ContextProperty *prop;
diff --git a/libcontextsubscriber/cls/context-ls.cpp b/libcontextsubscriber/cls/context-ls.cpp
index 69ad5776..17a51860 100644
--- a/libcontextsubscriber/cls/context-ls.cpp
+++ b/libcontextsubscriber/cls/context-ls.cpp
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
QString filter = "*";
args.pop_front();
- foreach (QString arg, args) {
+ Q_FOREACH (QString arg, args) {
if (arg == "--xml" || arg == "-x") {
backendName = "xml";
} else if (arg == "--cdb" || arg == "-c") {
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
QRegExp rx(filter, Qt::CaseSensitive, QRegExp::Wildcard);
QTextStream out(stdout);
- foreach (QString key, keys) {
+ Q_FOREACH (QString key, keys) {
if (!rx.exactMatch(key))
continue;
ContextPropertyInfo info(key);
diff --git a/libcontextsubscriber/customer-tests/testplugins/timeplugin.cpp b/libcontextsubscriber/customer-tests/testplugins/timeplugin.cpp
index 6e3c4df0..b4df1c4d 100644
--- a/libcontextsubscriber/customer-tests/testplugins/timeplugin.cpp
+++ b/libcontextsubscriber/customer-tests/testplugins/timeplugin.cpp
@@ -48,8 +48,8 @@ TimePlugin::TimePlugin()
void TimePlugin::subscribe(QSet<QString> keys)
{
contextDebug() << keys;
- foreach(const QString& key, keys) {
- emit subscribeFinished(key);
+ Q_FOREACH(const QString& key, keys) {
+ Q_EMIT subscribeFinished(key);
}
timer.start();
}
@@ -62,7 +62,7 @@ void TimePlugin::unsubscribe(QSet<QString> keys)
void TimePlugin::onTimeout()
{
contextDebug() << "Timeout";
- emit valueChanged("Test.Time", QDateTime::currentDateTime().toString().prepend(prefix));
+ Q_EMIT valueChanged("Test.Time", QDateTime::currentDateTime().toString().prepend(prefix));
}
} // end namespace
diff --git a/libcontextsubscriber/customer-tests/testplugins/timeplugin.h b/libcontextsubscriber/customer-tests/testplugins/timeplugin.h
index 3a51fb5a..cd4f044c 100644
--- a/libcontextsubscriber/customer-tests/testplugins/timeplugin.h
+++ b/libcontextsubscriber/customer-tests/testplugins/timeplugin.h
@@ -47,7 +47,7 @@ public:
virtual void subscribe(QSet<QString> keys);
virtual void unsubscribe(QSet<QString> keys);
-private slots:
+private Q_SLOTS:
void onTimeout();
private:
diff --git a/libcontextsubscriber/src/assoctree.cpp b/libcontextsubscriber/src/assoctree.cpp
index 6d6c32a7..3cb062de 100644
--- a/libcontextsubscriber/src/assoctree.cpp
+++ b/libcontextsubscriber/src/assoctree.cpp
@@ -34,7 +34,7 @@ QString AssocTree::dump(int level) const
else if (type() == QVariant::List) {
s += "[\n";
- foreach(QVariant v, toList())
+ Q_FOREACH(QVariant v, toList())
s += AssocTree(v).dump(level + 1);
for (int i = 0; i < level; i++)
@@ -61,7 +61,7 @@ QString AssocTree::dumpXML(int level) const
s += "<" + name() + "/>\n";
} else {
s += "<" + name() + ">\n";
- foreach(QVariant v, children)
+ Q_FOREACH(QVariant v, children)
s += AssocTree(v).dumpXML(level + 1);
for (int i = 0; i < level; i++)
s += " ";
@@ -92,7 +92,7 @@ AssocTree AssocTree::node(const QString &name) const
if (type() != QVariant::List)
return AssocTree();
- foreach(const QVariant &child, nodes())
+ Q_FOREACH(const QVariant &child, nodes())
{
if (child.type() == QVariant::List
&& child.toList().count() >= 1
@@ -200,7 +200,7 @@ AssocTree AssocTree::filterOut(const QString &name) const
const QVariant nameVariant(name);
QVariantList newTree;
newTree << this->name();
- foreach (QVariant node, nodes()) {
+ Q_FOREACH (QVariant node, nodes()) {
if (node.type() == QVariant::String &&
node == nameVariant)
continue;
diff --git a/libcontextsubscriber/src/contextkitplugin.cpp b/libcontextsubscriber/src/contextkitplugin.cpp
index 37398c3c..5b14d893 100644
--- a/libcontextsubscriber/src/contextkitplugin.cpp
+++ b/libcontextsubscriber/src/contextkitplugin.cpp
@@ -144,7 +144,7 @@ void ContextKitPlugin::onProviderDisappeared()
{
contextDebug() << "Provider disappeared:" << busName;
reset();
- emit failed("Provider went away " + busName);
+ Q_EMIT failed("Provider went away " + busName);
}
/// Starts using the fresh subscriber interface when it is returned by
@@ -166,7 +166,7 @@ void ContextKitPlugin::onDBusGetSubscriberFinished(QDBusObjectPath objectPath)
this,
SLOT(onDBusSubscribeFailed(QList<QString>, QString)));
- emit ready();
+ Q_EMIT ready();
}
void ContextKitPlugin::onDBusGetSubscriberFailed(QDBusError err)
@@ -175,7 +175,7 @@ void ContextKitPlugin::onDBusGetSubscriberFailed(QDBusError err)
contextWarning() <<
"D-Bus failed for: " + busName + ", error: " +
err.message();
- emit failed("D-Bus error while trying old protocol " + busName);
+ Q_EMIT failed("D-Bus error while trying old protocol " + busName);
return;
}
contextWarning() <<
@@ -199,28 +199,28 @@ void ContextKitPlugin::useNewProtocol()
// Ready to try out new protocol. Ready should not be queued,
// because otherwise ready and failed might get reordered.
- emit ready();
+ Q_EMIT ready();
}
/// Signals the Provider that the subscribe is finished.
void ContextKitPlugin::onDBusSubscribeFinished(QList<QString> keys)
{
- foreach (const QString& key, keys)
- emit subscribeFinished(key);
+ Q_FOREACH (const QString& key, keys)
+ Q_EMIT subscribeFinished(key);
}
/// Signals the Provider that the subscribe is failed.
void ContextKitPlugin::onDBusSubscribeFailed(QList<QString> keys, QString error)
{
- foreach (const QString& key, keys)
- emit subscribeFailed(key, error);
+ Q_FOREACH (const QString& key, keys)
+ Q_EMIT subscribeFailed(key, error);
}
/// Forwards the subscribe request to the wire.
void ContextKitPlugin::subscribe(QSet<QString> keys)
{
if (newProtocol)
- foreach (const QString& key, keys) {
+ Q_FOREACH (const QString& key, keys) {
// Queue calling the Subscribe asynchronously. Don't
// create the async call here: Qt will deadlock if we
// create an async call while handling the results of the
@@ -267,7 +267,7 @@ void ContextKitPlugin::newSubscribe(const QString& key)
void ContextKitPlugin::unsubscribe(QSet<QString> keys)
{
if (newProtocol)
- foreach (QString key, keys) {
+ Q_FOREACH (QString key, keys) {
QString objectPath = keyToPath(key);
objectPathToKey.remove(objectPath);
connection->asyncCall(QDBusMessage::createMethodCall(busName,
@@ -282,8 +282,8 @@ void ContextKitPlugin::unsubscribe(QSet<QString> keys)
/// Forwards value changes from the wire to the upper layer (Provider).
void ContextKitPlugin::onDBusValuesChanged(QMap<QString, QVariant> values)
{
- foreach (const QString& key, values.keys())
- emit valueChanged(key, values[key]);
+ Q_FOREACH (const QString& key, values.keys())
+ Q_EMIT valueChanged(key, values[key]);
}
// QDBus doesn't unmarshall non-basic types inside QVariants (since it cannot
@@ -344,7 +344,7 @@ void ContextKitPlugin::onNewValueChanged(QList<QVariant> value,
QDBusMessage message)
{
if (objectPathToKey.contains(message.path())) {
- emit valueChanged(objectPathToKey[message.path()],
+ Q_EMIT valueChanged(objectPathToKey[message.path()],
createTimedValue(value, timestamp));
}
else {
@@ -367,13 +367,13 @@ void PendingSubscribeWatcher::onFinished()
{
QDBusPendingReply<QList<QVariant>, quint64> reply = *this;
if (reply.isError()) {
- emit subscribeFailed(key, reply.error().message());
+ Q_EMIT subscribeFailed(key, reply.error().message());
return;
}
- emit valueChanged(key, createTimedValue(reply.argumentAt<0>(),
+ Q_EMIT valueChanged(key, createTimedValue(reply.argumentAt<0>(),
reply.argumentAt<1>()));
- emit subscribeFinished(key);
+ Q_EMIT subscribeFinished(key);
}
}
diff --git a/libcontextsubscriber/src/contextkitplugin.h b/libcontextsubscriber/src/contextkitplugin.h
index 81557dc7..077a027c 100644
--- a/libcontextsubscriber/src/contextkitplugin.h
+++ b/libcontextsubscriber/src/contextkitplugin.h
@@ -50,10 +50,10 @@ public:
PendingSubscribeWatcher(const QDBusPendingCall &call,
const QString &key,
QObject * parent = 0);
-private slots:
+private Q_SLOTS:
void onFinished();
-signals:
+Q_SIGNALS:
void subscribeFailed(QString, QString);
void valueChanged(QString, TimedValue);
void subscribeFinished(QString);
@@ -72,7 +72,7 @@ public:
void unsubscribe(QSet<QString> keys);
void setDefaultNewProtocol(bool s);
-signals:
+Q_SIGNALS:
#ifdef DOXYGEN_ONLY
void ready(); ///< Emitted when the GetSubscriber call returns successfully.
void failed(QString error); ///< Emitted when the GetSubscriber call fails or provider not on D-Bus at all.
@@ -81,7 +81,7 @@ signals:
void valueChanged(QString key, QVariant value); ///< Emitted when ValueChanged signal comes on D-Bus
#endif
-private slots:
+private Q_SLOTS:
void onNewValueChanged(QList<QVariant> value,
quint64 timestamp,
QDBusMessage message);
diff --git a/libcontextsubscriber/src/contextproperty.cpp b/libcontextsubscriber/src/contextproperty.cpp
index 30f29b45..7b42d064 100644
--- a/libcontextsubscriber/src/contextproperty.cpp
+++ b/libcontextsubscriber/src/contextproperty.cpp
@@ -249,7 +249,7 @@ void ContextProperty::onValueChanged()
priv->value.type() != newValue.type())
{
priv->value = newValue;
- emit valueChanged();
+ Q_EMIT valueChanged();
}
}
diff --git a/libcontextsubscriber/src/contextproperty.h b/libcontextsubscriber/src/contextproperty.h
index d354d853..e4848177 100644
--- a/libcontextsubscriber/src/contextproperty.h
+++ b/libcontextsubscriber/src/contextproperty.h
@@ -52,12 +52,12 @@ public:
static void ignoreCommander();
static void setTypeCheck(bool typeCheck);
-signals:
+Q_SIGNALS:
void valueChanged(); ///< Emitted whenever the value of the property changes and the property is subscribed.
private:
ContextPropertyPrivate *priv;
-private slots:
+private Q_SLOTS:
void onValueChanged();
};
diff --git a/libcontextsubscriber/src/contextpropertyinfo.cpp b/libcontextsubscriber/src/contextpropertyinfo.cpp
index ce4d91e1..f76eb9e3 100644
--- a/libcontextsubscriber/src/contextpropertyinfo.cpp
+++ b/libcontextsubscriber/src/contextpropertyinfo.cpp
@@ -391,14 +391,14 @@ void ContextPropertyInfo::onKeyChanged(const QString& key)
lock.unlock();
// Emit the needed signals
- emit changed(keyName);
- emit typeChanged(type());
- emit existsChanged(cachedDeclared);
- emit providedChanged((cachedProviders.size() > 0));
-
- emit providerChanged(providerDBusName_i());
- emit providerDBusTypeChanged(providerDBusType_i());
- emit pluginChanged(plugin_i(), constructionString_i());
+ Q_EMIT changed(keyName);
+ Q_EMIT typeChanged(type());
+ Q_EMIT existsChanged(cachedDeclared);
+ Q_EMIT providedChanged((cachedProviders.size() > 0));
+
+ Q_EMIT providerChanged(providerDBusName_i());
+ Q_EMIT providerDBusTypeChanged(providerDBusType_i());
+ Q_EMIT pluginChanged(plugin_i(), constructionString_i());
}
/// Returns a list of providers that provide this key.
diff --git a/libcontextsubscriber/src/contextpropertyinfo.h b/libcontextsubscriber/src/contextpropertyinfo.h
index cd8f9327..d3ebffb8 100644
--- a/libcontextsubscriber/src/contextpropertyinfo.h
+++ b/libcontextsubscriber/src/contextpropertyinfo.h
@@ -74,10 +74,10 @@ private:
QString plugin_i() const;
QString constructionString_i() const;
-private slots:
+private Q_SLOTS:
void onKeyChanged(const QString& key);
-signals:
+Q_SIGNALS:
/// DEPRECATED, use changed() signal.
/// Emitted when the provider of the key changes. The \a newProvider
/// contains the name of the new provider. This is a strict signal -
diff --git a/libcontextsubscriber/src/contextregistryinfo.cpp b/libcontextsubscriber/src/contextregistryinfo.cpp
index 561631f0..08cab37d 100644
--- a/libcontextsubscriber/src/contextregistryinfo.cpp
+++ b/libcontextsubscriber/src/contextregistryinfo.cpp
@@ -90,8 +90,8 @@ QStringList ContextRegistryInfo::listKeys(QString providerName) const
QSet<QString> keys;
- foreach (QString key, listKeys()) {
- foreach (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
+ Q_FOREACH (QString key, listKeys()) {
+ Q_FOREACH (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
if (info.plugin == "contextkit-dbus" &&
info.constructionString.split(":").last() == providerName) {
keys.insert(key);
@@ -109,8 +109,8 @@ QStringList ContextRegistryInfo::listKeysForPlugin(QString plugin) const
QSet<QString> keys;
- foreach (QString key, listKeys()) {
- foreach (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
+ Q_FOREACH (QString key, listKeys()) {
+ Q_FOREACH (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
if (info.plugin == plugin) {
keys.insert(key);
}
@@ -129,8 +129,8 @@ QStringList ContextRegistryInfo::listProviders() const
QSet<QString> providers;
- foreach (QString key, listKeys()) {
- foreach (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
+ Q_FOREACH (QString key, listKeys()) {
+ Q_FOREACH (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
if (info.plugin == "contextkit-dbus") {
providers.insert(info.constructionString.split(":").last());
}
@@ -147,8 +147,8 @@ QStringList ContextRegistryInfo::listPlugins() const
QSet<QString> plugins;
- foreach (QString key, listKeys()) {
- foreach (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
+ Q_FOREACH (QString key, listKeys()) {
+ Q_FOREACH (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
plugins.insert(info.plugin);
}
}
@@ -168,21 +168,21 @@ QString ContextRegistryInfo::backendName() const
/// Will be removed when deprecated keysChanged() signal is removed.
void ContextRegistryInfo::onKeysChanged(const QStringList& currentKeys)
{
- emit(keysChanged(currentKeys));
+ Q_EMIT keysChanged(currentKeys);
}
/// This is connected to the \a keysAdded of the actual info backend instance.
/// Will be removed when deprecated keysAdded() signal is removed.
void ContextRegistryInfo::onKeysAdded(const QStringList& newKeys)
{
- emit(keysAdded(newKeys));
+ Q_EMIT keysAdded(newKeys);
}
/// This is connected to the \a keysRemoved of the actual info backend instance.
/// Will be removed when deprecated keysRemoved() signal is removed.
void ContextRegistryInfo::onKeysRemoved(const QStringList& removedKeys)
{
- emit(keysRemoved(removedKeys));
+ Q_EMIT keysRemoved(removedKeys);
}
/// Called when people connect to signals. Used to emit deprecation warnings
@@ -203,5 +203,5 @@ void ContextRegistryInfo::connectNotify(const char *signal)
/// Gets called when the list of keys changes.
void ContextRegistryInfo::onListChanged()
{
- emit changed();
+ Q_EMIT changed();
}
diff --git a/libcontextsubscriber/src/contextregistryinfo.h b/libcontextsubscriber/src/contextregistryinfo.h
index 55a5fb2a..103e8bd0 100644
--- a/libcontextsubscriber/src/contextregistryinfo.h
+++ b/libcontextsubscriber/src/contextregistryinfo.h
@@ -53,13 +53,13 @@ private:
protected:
void connectNotify(const char *signal);
-private slots:
+private Q_SLOTS:
void onKeysChanged(const QStringList& currentKeys);
void onKeysAdded(const QStringList& newKeys);
void onKeysRemoved(const QStringList& removedKeys);
void onListChanged();
-signals:
+Q_SIGNALS:
/// DEPRECATED use changed signal instead.
/// Emitted when the registry changes. For performance reasons
/// this is not a strict signal - it's emitted also even when no actual
diff --git a/libcontextsubscriber/src/contexttypeinfo.cpp b/libcontextsubscriber/src/contexttypeinfo.cpp
index df72e22d..0c914a22 100644
--- a/libcontextsubscriber/src/contexttypeinfo.cpp
+++ b/libcontextsubscriber/src/contexttypeinfo.cpp
@@ -107,7 +107,7 @@ bool ContextTypeInfo::typeCheck(const QVariant &value) const
// base type. (Suboptimal.)
if (baseType.type() != QVariant::List)
baseType = AssocTree(QVariantList() << baseType.name());
- foreach (AssocTree p, parameters()) {
+ Q_FOREACH (AssocTree p, parameters()) {
baseType = baseType.filterOut(p.name());
baseType = AssocTree(baseType.toList() << p);
}
@@ -177,7 +177,7 @@ bool ContextTypeInfo::typeCheck(const QVariant &value) const
return false;
}
if (!eltype.isNull())
- foreach (QVariant el, vl)
+ Q_FOREACH (QVariant el, vl)
if (!eltype.typeCheck(el)) {
contextWarning() << F_TYPES << "element" << el
<< "is of incorrect type";
@@ -192,7 +192,7 @@ bool ContextTypeInfo::typeCheck(const QVariant &value) const
}
QHash<QString, ContextTypeInfo> allowedKeys;
bool othersAllowed = false;
- foreach (ContextTypeInfo keyInfo, parameters()) {
+ Q_FOREACH (ContextTypeInfo keyInfo, parameters()) {
QString keyname = keyInfo.name();
if (keyname == "allow-other-keys") {
othersAllowed = true;
@@ -224,7 +224,7 @@ bool ContextTypeInfo::typeCheck(const QVariant &value) const
}
else if (me == "string-enum") {
QSet<QString> enumerators;
- foreach (AssocTree enumerator, parameters())
+ Q_FOREACH (AssocTree enumerator, parameters())
enumerators.insert(enumerator.name());
bool ok = enumerators.contains(value.toString());
if (!ok)
@@ -234,7 +234,7 @@ bool ContextTypeInfo::typeCheck(const QVariant &value) const
}
else if (me == "int-enum") {
QSet<int> enumerators;
- foreach (AssocTree enumerator, parameters())
+ Q_FOREACH (AssocTree enumerator, parameters())
enumerators.insert(enumerator.value("value").toInt());
bool ok = enumerators.contains(value.toInt());
if (!ok)
@@ -323,7 +323,7 @@ QString ContextStringEnumInfo::choiceDoc(const QString &choice) const
QStringList ContextStringEnumInfo::choices() const
{
QStringList result;
- foreach (const AssocTree &p, parameters()) {
+ Q_FOREACH (const AssocTree &p, parameters()) {
result.append (p.name());
}
return result;
diff --git a/libcontextsubscriber/src/contexttyperegistryinfo.cpp b/libcontextsubscriber/src/contexttyperegistryinfo.cpp
index 02c63dea..912aeab6 100644
--- a/libcontextsubscriber/src/contexttyperegistryinfo.cpp
+++ b/libcontextsubscriber/src/contexttyperegistryinfo.cpp
@@ -114,7 +114,7 @@ AssocTree ContextTypeRegistryInfo::typeDefinitionForName(QString name)
return typeCache.value(name);
// No type in cache? Find it in the assoc tree and put in cache.
- foreach (AssocTree typeTree, coreTree.nodes()) {
+ Q_FOREACH (AssocTree typeTree, coreTree.nodes()) {
if (typeTree.name() == "type" && typeTree.value("name") == name) {
typeCache.insert(name, typeTree);
return typeTree;
diff --git a/libcontextsubscriber/src/dbusnamelistener.cpp b/libcontextsubscriber/src/dbusnamelistener.cpp
index 2d7ae96e..53e26296 100644
--- a/libcontextsubscriber/src/dbusnamelistener.cpp
+++ b/libcontextsubscriber/src/dbusnamelistener.cpp
@@ -130,7 +130,7 @@ void DBusNameListener::setServicePresent()
{
if (servicePresent != Present) {
servicePresent = Present;
- emit nameAppeared();
+ Q_EMIT nameAppeared();
}
}
@@ -138,7 +138,7 @@ void DBusNameListener::setServiceGone()
{
if (servicePresent != NotPresent) {
servicePresent = NotPresent;
- emit nameDisappeared();
+ Q_EMIT nameDisappeared();
}
}
diff --git a/libcontextsubscriber/src/dbusnamelistener.h b/libcontextsubscriber/src/dbusnamelistener.h
index 5efcf9c2..af6477bd 100644
--- a/libcontextsubscriber/src/dbusnamelistener.h
+++ b/libcontextsubscriber/src/dbusnamelistener.h
@@ -45,7 +45,7 @@ public:
ServicePresence isServicePresent() const;
-private slots:
+private Q_SLOTS:
void onServiceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
void onNameHasOwnerFinished(QDBusPendingCallWatcher* watcher);
@@ -59,7 +59,7 @@ private:
void setServicePresent();
void setServiceGone();
-signals:
+Q_SIGNALS:
void nameAppeared();
void nameDisappeared();
};
diff --git a/libcontextsubscriber/src/handlesignalrouter.h b/libcontextsubscriber/src/handlesignalrouter.h
index 59a45c6e..307650d0 100644
--- a/libcontextsubscriber/src/handlesignalrouter.h
+++ b/libcontextsubscriber/src/handlesignalrouter.h
@@ -36,7 +36,7 @@ class HandleSignalRouter : public QObject
public:
static HandleSignalRouter* instance();
-public slots:
+public Q_SLOTS:
void onValueChanged(QString key);
void onSubscribeFinished(Provider *provider, QString key);
diff --git a/libcontextsubscriber/src/infobackend.cpp b/libcontextsubscriber/src/infobackend.cpp
index 6b5e0e50..9853b949 100644
--- a/libcontextsubscriber/src/infobackend.cpp
+++ b/libcontextsubscriber/src/infobackend.cpp
@@ -85,13 +85,13 @@ void InfoBackend::checkAndEmitKeysAdded(const QStringList &currentKeys,
const QStringList &oldKeys)
{
QStringList addedKeys;
- foreach (QString key, currentKeys) {
+ Q_FOREACH (QString key, currentKeys) {
if (! oldKeys.contains(key))
addedKeys << key;
}
if (addedKeys.size() > 0)
- emit keysAdded(addedKeys);
+ Q_EMIT keysAdded(addedKeys);
}
/// Given the \a currentKeys list of keys and the \a oldKeys list of keys,
@@ -101,13 +101,13 @@ void InfoBackend::checkAndEmitKeysRemoved(const QStringList &currentKeys,
const QStringList &oldKeys)
{
QStringList removedKeys;
- foreach (QString key, oldKeys) {
+ Q_FOREACH (QString key, oldKeys) {
if (! currentKeys.contains(key))
removedKeys << key;
}
if (removedKeys.size() > 0)
- emit keysRemoved(removedKeys);
+ Q_EMIT keysRemoved(removedKeys);
}
/// Given the \a currentKeys list of keys and the \a oldKeys list of keys,
@@ -115,13 +115,13 @@ void InfoBackend::checkAndEmitKeysRemoved(const QStringList &currentKeys,
void InfoBackend::checkAndEmitKeyChanged(const QStringList &currentKeys,
const QStringList &oldKeys)
{
- foreach(QString key, oldKeys) {
- emit keyChanged(key);
+ Q_FOREACH(QString key, oldKeys) {
+ Q_EMIT keyChanged(key);
}
- foreach(QString key, currentKeys) {
+ Q_FOREACH(QString key, currentKeys) {
if (! oldKeys.contains(key))
- emit keyChanged(key);
+ Q_EMIT keyChanged(key);
}
}
diff --git a/libcontextsubscriber/src/infobackend.h b/libcontextsubscriber/src/infobackend.h
index a28cda59..1a340232 100644
--- a/libcontextsubscriber/src/infobackend.h
+++ b/libcontextsubscriber/src/infobackend.h
@@ -56,7 +56,7 @@ public:
/// Returns a list of providers for the given key.
virtual const QList<ContextProviderInfo> providersForKey(QString key) const = 0;
-signals:
+Q_SIGNALS:
/// Emitted when key list changes. ContextRegistryInfo listens on that.
void keysChanged(const QStringList& currentKeys);
diff --git a/libcontextsubscriber/src/infocdbbackend.cpp b/libcontextsubscriber/src/infocdbbackend.cpp
index 145c2387..46be1341 100644
--- a/libcontextsubscriber/src/infocdbbackend.cpp
+++ b/libcontextsubscriber/src/infocdbbackend.cpp
@@ -63,7 +63,7 @@ QString InfoCdbBackend::name() const
QStringList InfoCdbBackend::variantListToStringList(const QVariantList &l)
{
QStringList ret;
- foreach (QVariant v, l)
+ Q_FOREACH (QVariant v, l)
ret << v.toString();
return ret;
@@ -182,9 +182,9 @@ void InfoCdbBackend::onDatabaseFileChanged(const QString &path)
// Emissions
checkAndEmitKeysAdded(currentKeys, oldKeys); // DEPRECATED emission
checkAndEmitKeysRemoved(currentKeys, oldKeys); // DEPRECATED emission
- emit keysChanged(listKeys()); // DEPRECATED emission
+ Q_EMIT keysChanged(listKeys()); // DEPRECATED emission
- emit listChanged();
+ Q_EMIT listChanged();
checkAndEmitKeyChanged(currentKeys, oldKeys);
}
@@ -204,7 +204,7 @@ const QList<ContextProviderInfo> InfoCdbBackend::providersForKey(QString key) co
if (!databaseCompatible)
return lst;
- foreach (QVariant variant, providers.toList())
+ Q_FOREACH (QVariant variant, providers.toList())
lst << ContextProviderInfo(variant.toHash().value("plugin").toString(),
variant.toHash().value("constructionString").toString());
diff --git a/libcontextsubscriber/src/infocdbbackend.h b/libcontextsubscriber/src/infocdbbackend.h
index 167f0ed1..d29b498f 100644
--- a/libcontextsubscriber/src/infocdbbackend.h
+++ b/libcontextsubscriber/src/infocdbbackend.h
@@ -56,7 +56,7 @@ private:
static QStringList variantListToStringList(const QVariantList &l);
void checkCompatibility();
-private slots:
+private Q_SLOTS:
void onDatabaseFileChanged(const QString &path);
void onDatabaseDirectoryChanged(const QString &path);
};
diff --git a/libcontextsubscriber/src/infoxmlbackend.cpp b/libcontextsubscriber/src/infoxmlbackend.cpp
index 732213ad..3ea75903 100644
--- a/libcontextsubscriber/src/infoxmlbackend.cpp
+++ b/libcontextsubscriber/src/infoxmlbackend.cpp
@@ -78,7 +78,7 @@ QStringList InfoXmlBackend::listKeys() const
QStringList list;
// FIXME Hmm, we could return just the keyDataHash.keys itself here...
- foreach (QString key, keyDataHash.keys()) {
+ Q_FOREACH (QString key, keyDataHash.keys()) {
list << keyDataHash.value(key).name;
}
@@ -145,9 +145,9 @@ void InfoXmlBackend::onFileChanged(const QString &path)
// Emissions
checkAndEmitKeysAdded(currentKeys, oldKeys); // DEPRECATED emission
checkAndEmitKeysRemoved(currentKeys, oldKeys); // DEPRECATED emission
- emit keysChanged(listKeys()); // DEPRECATED emission
+ Q_EMIT keysChanged(listKeys()); // DEPRECATED emission
- emit listChanged();
+ Q_EMIT listChanged();
checkAndEmitKeyChanged(currentKeys, oldKeys);
}
@@ -182,9 +182,9 @@ void InfoXmlBackend::onDirectoryChanged(const QString &path)
// Emissions
checkAndEmitKeysAdded(currentKeys, oldKeys); // DEPRECATED emission
checkAndEmitKeysRemoved(currentKeys, oldKeys); // DEPRECATED emission
- emit keysChanged(listKeys()); // DEPRECATED emission
+ Q_EMIT keysChanged(listKeys()); // DEPRECATED emission
- emit listChanged();
+ Q_EMIT listChanged();
checkAndEmitKeyChanged(currentKeys, oldKeys);
}
@@ -319,15 +319,15 @@ void InfoXmlBackend::readKeyDataFromXml(const QString &path)
if (rootTree.toList().at(0).toString() == "provider" ||
rootTree.toList().at(0).toString() == "properties") {
// One provider. Iterate over each key.
- foreach (AssocTree keyTree, rootTree.nodes()) {
+ Q_FOREACH (AssocTree keyTree, rootTree.nodes()) {
if (keyTree.name() == "key")
parseKey(keyTree, rootTree);
}
} else {
// Multiple providers... iterate over providers and keys
- foreach (AssocTree providerTree, rootTree.nodes())
+ Q_FOREACH (AssocTree providerTree, rootTree.nodes())
if (providerTree.name() == "provider")
- foreach (AssocTree keyTree, providerTree.nodes())
+ Q_FOREACH (AssocTree keyTree, providerTree.nodes())
if (keyTree.name() == "key")
parseKey(keyTree, providerTree);
}
diff --git a/libcontextsubscriber/src/infoxmlbackend.h b/libcontextsubscriber/src/infoxmlbackend.h
index b04630b6..d8446edc 100644
--- a/libcontextsubscriber/src/infoxmlbackend.h
+++ b/libcontextsubscriber/src/infoxmlbackend.h
@@ -50,7 +50,7 @@ public:
static QString registryPath();
static QString coreDeclPath();
-private slots:
+private Q_SLOTS:
void onDirectoryChanged(const QString &path);
void onFileChanged(const QString &path);
diff --git a/libcontextsubscriber/src/iproviderplugin.h b/libcontextsubscriber/src/iproviderplugin.h
index d14ad48e..811af127 100644
--- a/libcontextsubscriber/src/iproviderplugin.h
+++ b/libcontextsubscriber/src/iproviderplugin.h
@@ -41,7 +41,7 @@ public:
virtual void subscribe(QSet<QString> keys) = 0;
virtual void unsubscribe(QSet<QString> keys) = 0;
-signals:
+Q_SIGNALS:
void ready();
void failed(QString error);
void subscribeFinished(QString key);
diff --git a/libcontextsubscriber/src/propertyhandle.cpp b/libcontextsubscriber/src/propertyhandle.cpp
index 145a66f6..e795af29 100644
--- a/libcontextsubscriber/src/propertyhandle.cpp
+++ b/libcontextsubscriber/src/propertyhandle.cpp
@@ -139,16 +139,16 @@ void PropertyHandle::updateProvider()
// The myInfo object doesn't have to be re-created, because it
// just routes the function calls to a registry backend.
- foreach (ContextProviderInfo info, myInfo->providers())
+ Q_FOREACH (ContextProviderInfo info, myInfo->providers())
newProviders << Provider::instance(info);
contextDebug() << newProviders.size() << "providers for" << myKey;
}
if (subscribeCount > 0) {
// Unsubscribe from old providers and subscribe to the new ones.
- foreach (Provider *oldprovider, myProviders)
+ Q_FOREACH (Provider *oldprovider, myProviders)
oldprovider->unsubscribe(myKey);
pendingSubscriptions.clear();
- foreach (Provider *newprovider, newProviders)
+ Q_FOREACH (Provider *newprovider, newProviders)
if (newprovider->subscribe(myKey))
pendingSubscriptions << newprovider;
}
@@ -176,7 +176,7 @@ void PropertyHandle::subscribe()
++subscribeCount;
if (subscribeCount == 1) {
pendingSubscriptions.clear();
- foreach (Provider *provider, myProviders)
+ Q_FOREACH (Provider *provider, myProviders)
if (provider->subscribe(myKey))
pendingSubscriptions << provider;
}
@@ -191,7 +191,7 @@ void PropertyHandle::unsubscribe()
--subscribeCount;
if (subscribeCount == 0) {
pendingSubscriptions.clear();
- foreach (Provider *provider, myProviders)
+ Q_FOREACH (Provider *provider, myProviders)
provider->unsubscribe(myKey);
}
}
@@ -229,7 +229,7 @@ void PropertyHandle::onValueChanged()
bool found = false;
TimedValue latest = QVariant();
- foreach (Provider *provider, myProviders) {
+ Q_FOREACH (Provider *provider, myProviders) {
TimedValue current = provider->get(myKey);
if (current.value.isNull())
continue;
@@ -261,7 +261,7 @@ void PropertyHandle::onValueChanged()
myValue.type() != newValue.type())
{
myValue = newValue;
- emit valueChanged();
+ Q_EMIT valueChanged();
}
}
diff --git a/libcontextsubscriber/src/propertyhandle.h b/libcontextsubscriber/src/propertyhandle.h
index 9f1ad86f..b74fcc7b 100644
--- a/libcontextsubscriber/src/propertyhandle.h
+++ b/libcontextsubscriber/src/propertyhandle.h
@@ -58,10 +58,10 @@ public:
static void ignoreCommander();
static void setTypeCheck(bool typeCheck);
-signals:
+Q_SIGNALS:
void valueChanged();
-private slots:
+private Q_SLOTS:
void updateProvider();
private:
diff --git a/libcontextsubscriber/src/provider.cpp b/libcontextsubscriber/src/provider.cpp
index d04b3ea4..03c039c3 100644
--- a/libcontextsubscriber/src/provider.cpp
+++ b/libcontextsubscriber/src/provider.cpp
@@ -242,7 +242,7 @@ void Provider::signalSubscribeFinished(QString key)
{
QMutexLocker lock(&subscribeLock);
if (subscribedKeys.contains(key))
- emit subscribeFinished(this, key);
+ Q_EMIT subscribeFinished(this, key);
}
/// Forwards the call to \c signalSubscribeFinished.
@@ -337,8 +337,8 @@ void Provider::handleSubscribes()
// it failed for good.
contextDebug() << "Plugin init has failed";
if (toSubscribe.size() > 0)
- foreach (QString key, toSubscribe)
- emit subscribeFinished(this, key);
+ Q_FOREACH (QString key, toSubscribe)
+ Q_EMIT subscribeFinished(this, key);
toSubscribe.clear();
toUnsubscribe.clear();
break;
@@ -358,7 +358,7 @@ void Provider::onPluginValueChanged(QString key, TimedValue newValue)
if (subscribedKeys.contains(key)) {
// FIXME: try out if everything works with lock.unlock() here
values.insert(key, newValue);
- emit valueChanged(key);
+ Q_EMIT valueChanged(key);
}
else
contextWarning() << "Received a property not subscribed to:" << key;
@@ -373,7 +373,7 @@ void Provider::onPluginValueChanged(QString key, QVariant newValue)
if (subscribedKeys.contains(key)) {
// FIXME: try out if everything works with lock.unlock() here
values.insert(key, TimedValue(newValue));
- emit valueChanged(key);
+ Q_EMIT valueChanged(key);
}
else
contextWarning() << "Received a property not subscribed to:" << key;
diff --git a/libcontextsubscriber/src/provider.h b/libcontextsubscriber/src/provider.h
index 482d678b..6722ef94 100644
--- a/libcontextsubscriber/src/provider.h
+++ b/libcontextsubscriber/src/provider.h
@@ -52,11 +52,11 @@ public:
TimedValue get(const QString &key) const;
void clearValues();
-signals:
+Q_SIGNALS:
void subscribeFinished(Provider *provider, QString key);
void valueChanged(QString key);
-private slots:
+private Q_SLOTS:
void onPluginReady();
void onPluginFailed(QString error);
void onPluginSubscribeFinished(QString key);
diff --git a/libcontextsubscriber/src/queuedinvoker.cpp b/libcontextsubscriber/src/queuedinvoker.cpp
index ac7373de..d62faafc 100644
--- a/libcontextsubscriber/src/queuedinvoker.cpp
+++ b/libcontextsubscriber/src/queuedinvoker.cpp
@@ -69,7 +69,7 @@ void QueuedInvoker::queueOnce(const char *method)
{
QMutexLocker locker(&callQueueLock);
if (!callQueue.contains(method)) {
- emit queuedCall(method);
+ Q_EMIT queuedCall(method);
callQueue.insert(method);
}
}
diff --git a/libcontextsubscriber/src/queuedinvoker.h b/libcontextsubscriber/src/queuedinvoker.h
index 6fdcbdfc..e396ad3d 100644
--- a/libcontextsubscriber/src/queuedinvoker.h
+++ b/libcontextsubscriber/src/queuedinvoker.h
@@ -36,10 +36,10 @@ class QueuedInvoker : public QObject
public:
QueuedInvoker();
-private slots:
+private Q_SLOTS:
void onQueuedCall(const char *method);
-signals:
+Q_SIGNALS:
void queuedCall(const char *method);
protected:
diff --git a/libcontextsubscriber/src/subscriberinterface.cpp b/libcontextsubscriber/src/subscriberinterface.cpp
index 9cac82b8..c9aafdd6 100644
--- a/libcontextsubscriber/src/subscriberinterface.cpp
+++ b/libcontextsubscriber/src/subscriberinterface.cpp
@@ -75,7 +75,7 @@ void SubscriberInterface::subscribe(QSet<QString> keys)
// FIXME contextDebug() << "SubscriberInterface::subscribe " << keys;
if (isValid() == false || keys.size() == 0) {
contextDebug() << "Subscriber cannot subscribe -> emitting subscribeFinished()";
- emit subscribeFinished(keys.toList());
+ Q_EMIT subscribeFinished(keys.toList());
return;
}
@@ -113,13 +113,13 @@ void SubscriberInterface::onChanged(const QMap<QString, QVariant> &values, const
it.next();
copy.insert(it.key(), demarshallValue(it.value()));
}
- emit valuesChanged(mergeNullsWithMap(copy, unknownKeys));
+ Q_EMIT valuesChanged(mergeNullsWithMap(copy, unknownKeys));
}
/// A helper function. Sets the values of given keys to a null QVariant in a QMap.
QMap<QString, QVariant>& SubscriberInterface::mergeNullsWithMap(QMap<QString, QVariant> &map, QStringList nulls) const
{
- foreach (QString null, nulls) {
+ Q_FOREACH (QString null, nulls) {
if (map.contains(null))
contextWarning() << "Provider error, provided unknown and a value for" << null;
else
@@ -142,16 +142,16 @@ void SubscriberInterface::onSubscribeFinished(QDBusPendingCallWatcher* watcher)
// The provider didn't implement the needed interface + function
// The function resulted in an error
contextWarning() << "Provider error while subscribing:" << reply.error().message();
- emit subscribeFailed(requestedKeys, "Provider error");
+ Q_EMIT subscribeFailed(requestedKeys, "Provider error");
} else {
QMap<QString, QVariant> subscribeTimeValues = reply.argumentAt<0>();
QStringList unknowns = reply.argumentAt<1>();
// TODO: the protocol should be better, this is just a workaround
QMap<QString, QVariant> okMap = mergeNullsWithMap(subscribeTimeValues, unknowns);
- emit subscribeFinished(okMap.keys());
- emit valuesChanged(okMap);
- emit subscribeFailed((requestedKeys.toSet() - okMap.keys().toSet()).toList(), "Not provided");
+ Q_EMIT subscribeFinished(okMap.keys());
+ Q_EMIT valuesChanged(okMap);
+ Q_EMIT subscribeFailed((requestedKeys.toSet() - okMap.keys().toSet()).toList(), "Not provided");
}
}
diff --git a/libcontextsubscriber/src/subscriberinterface.h b/libcontextsubscriber/src/subscriberinterface.h
index dba17cc1..005b8ed2 100644
--- a/libcontextsubscriber/src/subscriberinterface.h
+++ b/libcontextsubscriber/src/subscriberinterface.h
@@ -44,13 +44,13 @@ public:
void subscribe(QSet<QString> keys);
void unsubscribe(QSet<QString> keys);
-signals:
+Q_SIGNALS:
void valuesChanged(QMap<QString, QVariant> values);
void subscribeFinished(QList<QString> keys);
void subscribeFailed(QList<QString> keys, QString error);
void Changed(const QMap<QString, QVariant> &values, const QStringList &unknownKeys);
-private slots:
+private Q_SLOTS:
void onSubscribeFinished(QDBusPendingCallWatcher* watcher);
void onChanged(const QMap<QString, QVariant> &values, const QStringList &unknownKeys);
diff --git a/libcontextsubscriber/unit-tests/assoctree/assoctreeunittest.cpp b/libcontextsubscriber/unit-tests/assoctree/assoctreeunittest.cpp
index c73dfcb9..44345fe5 100644
--- a/libcontextsubscriber/unit-tests/assoctree/assoctreeunittest.cpp
+++ b/libcontextsubscriber/unit-tests/assoctree/assoctreeunittest.cpp
@@ -32,7 +32,7 @@ private:
AssocTree buildComplex();
AssocTree buildMulti();
-private slots:
+private Q_SLOTS:
void dump();
void value1();
void value2();
@@ -159,7 +159,7 @@ void AssocTreeUnitTest::nodes()
AssocTree tree1 = buildBasic();
int i = 0;
- foreach (QVariant sub, tree1.nodes())
+ Q_FOREACH (QVariant sub, tree1.nodes())
{
QVERIFY(i < 2);
switch (i) {
diff --git a/libcontextsubscriber/unit-tests/cdb/cdbunittest.cpp b/libcontextsubscriber/unit-tests/cdb/cdbunittest.cpp
index d201fd7e..7afe5cd8 100644
--- a/libcontextsubscriber/unit-tests/cdb/cdbunittest.cpp
+++ b/libcontextsubscriber/unit-tests/cdb/cdbunittest.cpp
@@ -30,7 +30,7 @@ class CDBUnitTest : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void creation();
void cleanupTestCase();
void writingToBad();
diff --git a/libcontextsubscriber/unit-tests/contextpropertyinfo/contextpropertyinfounittest.cpp b/libcontextsubscriber/unit-tests/contextpropertyinfo/contextpropertyinfounittest.cpp
index 280dedbd..3ecc8519 100644
--- a/libcontextsubscriber/unit-tests/contextpropertyinfo/contextpropertyinfounittest.cpp
+++ b/libcontextsubscriber/unit-tests/contextpropertyinfo/contextpropertyinfounittest.cpp
@@ -105,22 +105,22 @@ void InfoBackend::disconnectNotify(const char *signal)
void InfoBackend::fireKeysChanged(const QStringList& keys)
{
- emit keysChanged(keys);
+ Q_EMIT keysChanged(keys);
}
void InfoBackend::fireKeysAdded(const QStringList& keys)
{
- emit keysAdded(keys);
+ Q_EMIT keysAdded(keys);
}
void InfoBackend::fireKeysRemoved(const QStringList& keys)
{
- emit keysRemoved(keys);
+ Q_EMIT keysRemoved(keys);
}
void InfoBackend::fireKeyChanged(const QString& key)
{
- emit keyChanged(key);
+ Q_EMIT keyChanged(key);
}
/* ContextRegistryInfoUnitTest */
@@ -129,7 +129,7 @@ class ContextPropertyInfoUnitTest : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void initTestCase();
void key();
void doc();
diff --git a/libcontextsubscriber/unit-tests/contextpropertyinfo/infobackend.h b/libcontextsubscriber/unit-tests/contextpropertyinfo/infobackend.h
index 15fb3c99..ebe272d0 100644
--- a/libcontextsubscriber/unit-tests/contextpropertyinfo/infobackend.h
+++ b/libcontextsubscriber/unit-tests/contextpropertyinfo/infobackend.h
@@ -48,7 +48,7 @@ public:
void fireKeysRemoved(const QStringList& keys);
void fireKeyChanged(const QString& key);
-signals:
+Q_SIGNALS:
void keysChanged(const QStringList& currentKeys);
void keysAdded(const QStringList& newKeys);
void keysRemoved(const QStringList& removedKeys);
diff --git a/libcontextsubscriber/unit-tests/contextregistryinfo/contextregistryinfounittest.cpp b/libcontextsubscriber/unit-tests/contextregistryinfo/contextregistryinfounittest.cpp
index 0c725401..cc52b973 100644
--- a/libcontextsubscriber/unit-tests/contextregistryinfo/contextregistryinfounittest.cpp
+++ b/libcontextsubscriber/unit-tests/contextregistryinfo/contextregistryinfounittest.cpp
@@ -70,22 +70,22 @@ const QList<ContextProviderInfo> InfoBackend::providersForKey(QString key)
void InfoBackend::fireKeysChanged(const QStringList& keys)
{
- emit keysChanged(keys);
+ Q_EMIT keysChanged(keys);
}
void InfoBackend::fireKeysAdded(const QStringList& keys)
{
- emit keysAdded(keys);
+ Q_EMIT keysAdded(keys);
}
void InfoBackend::fireKeysRemoved(const QStringList& keys)
{
- emit keysRemoved(keys);
+ Q_EMIT keysRemoved(keys);
}
void InfoBackend::fireListChanged()
{
- emit listChanged();
+ Q_EMIT listChanged();
}
/* ContextRegistryInfoUnitTest */
@@ -97,7 +97,7 @@ class ContextRegistryInfoUnitTest : public QObject
private:
ContextRegistryInfo *registry;
-private slots:
+private Q_SLOTS:
void initTestCase();
void listKeys();
void listKeysForPlugin();
diff --git a/libcontextsubscriber/unit-tests/contextregistryinfo/infobackend.h b/libcontextsubscriber/unit-tests/contextregistryinfo/infobackend.h
index 41fce0a7..22b8bbbd 100644
--- a/libcontextsubscriber/unit-tests/contextregistryinfo/infobackend.h
+++ b/libcontextsubscriber/unit-tests/contextregistryinfo/infobackend.h
@@ -43,7 +43,7 @@ public:
void fireKeysRemoved(const QStringList& keys);
void fireListChanged();
-signals:
+Q_SIGNALS:
void keysChanged(const QStringList& currentKeys);
void keysAdded(const QStringList& newKeys);
void keysRemoved(const QStringList& removedKeys);
diff --git a/libcontextsubscriber/unit-tests/contexttypeinfo/contexttypeinfounittest.cpp b/libcontextsubscriber/unit-tests/contexttypeinfo/contexttypeinfounittest.cpp
index aaebd64d..3d57e538 100644
--- a/libcontextsubscriber/unit-tests/contexttypeinfo/contexttypeinfounittest.cpp
+++ b/libcontextsubscriber/unit-tests/contexttypeinfo/contexttypeinfounittest.cpp
@@ -29,7 +29,7 @@ class ContextTypeInfoUnitTest : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void initTestCase();
void name();
void doc();
diff --git a/libcontextsubscriber/unit-tests/contexttyperegistryinfo/contexttyperegistryinfounittest.cpp b/libcontextsubscriber/unit-tests/contexttyperegistryinfo/contexttyperegistryinfounittest.cpp
index ee2b3f55..f29b97ce 100644
--- a/libcontextsubscriber/unit-tests/contexttyperegistryinfo/contexttyperegistryinfounittest.cpp
+++ b/libcontextsubscriber/unit-tests/contexttyperegistryinfo/contexttyperegistryinfounittest.cpp
@@ -33,7 +33,7 @@ class ContextTypeRegistryInfoUnitTest : public QObject
private:
ContextTypeRegistryInfo *registry;
-private slots:
+private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void stringDef();
diff --git a/libcontextsubscriber/unit-tests/duration/testduration.cpp b/libcontextsubscriber/unit-tests/duration/testduration.cpp
index 9f065dd3..b30b3945 100644
--- a/libcontextsubscriber/unit-tests/duration/testduration.cpp
+++ b/libcontextsubscriber/unit-tests/duration/testduration.cpp
@@ -26,7 +26,7 @@ class DurationUnitTest : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void init();
// Tests
diff --git a/libcontextsubscriber/unit-tests/handlesignalrouter/propertyhandle.h b/libcontextsubscriber/unit-tests/handlesignalrouter/propertyhandle.h
index 24e243e2..8fb98f6b 100644
--- a/libcontextsubscriber/unit-tests/handlesignalrouter/propertyhandle.h
+++ b/libcontextsubscriber/unit-tests/handlesignalrouter/propertyhandle.h
@@ -42,7 +42,7 @@ public:
void onValueChanged();
void setSubscribeFinished(Provider *);
-signals:
+Q_SIGNALS:
// For tests
void onValueChangedCalled(QString);
void setSubscribeFinishedCalled(Provider *,QString);
diff --git a/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.cpp b/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.cpp
index 3f674634..7a5303c3 100644
--- a/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.cpp
+++ b/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.cpp
@@ -75,12 +75,12 @@ PropertyHandle::PropertyHandle(const QString& key)
void PropertyHandle::onValueChanged()
{
- emit onValueChangedCalled(myKey);
+ Q_EMIT onValueChangedCalled(myKey);
}
void PropertyHandle::setSubscribeFinished(Provider *prov)
{
- emit setSubscribeFinishedCalled(prov, myKey);
+ Q_EMIT setSubscribeFinishedCalled(prov, myKey);
}
PropertyHandle* PropertyHandle::instance(const QString& key)
diff --git a/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.h b/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.h
index 2a0f33dd..98deb198 100644
--- a/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.h
+++ b/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.h
@@ -35,7 +35,7 @@ private:
HandleSignalRouter *handleSignalRouter;
// Tests
-private slots:
+private Q_SLOTS:
// Init and cleanup helper functions
void initTestCase();
void cleanupTestCase();
diff --git a/libcontextsubscriber/unit-tests/infobackend/infobackendunittest.cpp b/libcontextsubscriber/unit-tests/infobackend/infobackendunittest.cpp
index 6a251228..72520cb1 100644
--- a/libcontextsubscriber/unit-tests/infobackend/infobackendunittest.cpp
+++ b/libcontextsubscriber/unit-tests/infobackend/infobackendunittest.cpp
@@ -93,7 +93,7 @@ class InfoBackendUnitTest : public QObject
InfoBackend *backend;
-private slots:
+private Q_SLOTS:
void initTestCase();
void checkAndEmitKeysAdded();
void checkAndEmitKeysRemoved();
diff --git a/libcontextsubscriber/unit-tests/infocdbbackend/infocdbbackendunittest.cpp b/libcontextsubscriber/unit-tests/infocdbbackend/infocdbbackendunittest.cpp
index c52d95e7..d294690b 100644
--- a/libcontextsubscriber/unit-tests/infocdbbackend/infocdbbackendunittest.cpp
+++ b/libcontextsubscriber/unit-tests/infocdbbackend/infocdbbackendunittest.cpp
@@ -55,7 +55,7 @@ private:
void createAlternateDatabase(QString path);
void createIncompatibleDatabase(QString path);
-private slots:
+private Q_SLOTS:
void initTestCase();
void name();
void databaseExists();
@@ -208,7 +208,7 @@ void InfoCdbBackendUnitTest::docForKey()
void InfoCdbBackendUnitTest::keyDeclared()
{
- foreach (QString key, backend->listKeys())
+ Q_FOREACH (QString key, backend->listKeys())
QCOMPARE(backend->keyDeclared(key), true);
QCOMPARE(backend->keyDeclared("Does.Not.Exist"), false);
diff --git a/libcontextsubscriber/unit-tests/infoxmlbackend/infoxmlbackendunittest.cpp b/libcontextsubscriber/unit-tests/infoxmlbackend/infoxmlbackendunittest.cpp
index 4b7957df..2a70b616 100644
--- a/libcontextsubscriber/unit-tests/infoxmlbackend/infoxmlbackendunittest.cpp
+++ b/libcontextsubscriber/unit-tests/infoxmlbackend/infoxmlbackendunittest.cpp
@@ -51,7 +51,7 @@ class InfoXmlBackendUnitTest : public QObject
private:
bool inSpyHasOneInList(QSignalSpy &spy, const QString &v);
-private slots:
+private Q_SLOTS:
void initTestCase();
void paths();
void name();
@@ -71,7 +71,7 @@ bool InfoXmlBackendUnitTest::inSpyHasOneInList(QSignalSpy &spy, const QString &v
while (spy.count() > 0) {
QList<QVariant> args = spy.takeFirst();
- foreach (QString s, args.at(0).toStringList()) {
+ Q_FOREACH (QString s, args.at(0).toStringList()) {
if (s == v)
return true;
}
@@ -148,7 +148,7 @@ void InfoXmlBackendUnitTest::docForKey()
void InfoXmlBackendUnitTest::keyDeclared()
{
- foreach (QString key, backend->listKeys())
+ Q_FOREACH (QString key, backend->listKeys())
QCOMPARE(backend->keyDeclared(key), true);
QCOMPARE(backend->keyDeclared("Does.Not.Exist"), false);
diff --git a/libcontextsubscriber/unit-tests/nanoxml/nanoxmlunittest.cpp b/libcontextsubscriber/unit-tests/nanoxml/nanoxmlunittest.cpp
index 24ad1085..01137338 100644
--- a/libcontextsubscriber/unit-tests/nanoxml/nanoxmlunittest.cpp
+++ b/libcontextsubscriber/unit-tests/nanoxml/nanoxmlunittest.cpp
@@ -28,7 +28,7 @@ class NanoXmlUnitTest : public QObject
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void broken();
void doesNotExist();
void test1();
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/contextpropertyinfo.h b/libcontextsubscriber/unit-tests/propertyhandle/contextpropertyinfo.h
index 0b8b5d9c..612c692d 100644
--- a/libcontextsubscriber/unit-tests/propertyhandle/contextpropertyinfo.h
+++ b/libcontextsubscriber/unit-tests/propertyhandle/contextpropertyinfo.h
@@ -45,7 +45,7 @@ public:
bool declared() const;
QList<ContextProviderInfo> providers() const;
-signals:
+Q_SIGNALS:
void changed(QString);
public:
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/contextregistryinfo.h b/libcontextsubscriber/unit-tests/propertyhandle/contextregistryinfo.h
index b76404ba..faa493f1 100644
--- a/libcontextsubscriber/unit-tests/propertyhandle/contextregistryinfo.h
+++ b/libcontextsubscriber/unit-tests/propertyhandle/contextregistryinfo.h
@@ -35,7 +35,7 @@ class ContextRegistryInfo : public QObject
public:
static ContextRegistryInfo* instance(const QString &backendName = "");
-signals:
+Q_SIGNALS:
void keysChanged(QStringList currentKeys);
void keysAdded(QStringList newKeys);
void keysRemoved(QStringList removedKeys);
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/dbusnamelistener.h b/libcontextsubscriber/unit-tests/propertyhandle/dbusnamelistener.h
index 29362202..198e1bfc 100644
--- a/libcontextsubscriber/unit-tests/propertyhandle/dbusnamelistener.h
+++ b/libcontextsubscriber/unit-tests/propertyhandle/dbusnamelistener.h
@@ -45,7 +45,7 @@ public:
ServicePresence isServicePresent() const;
void startListening(bool nameHasOwnerCheck);
-signals:
+Q_SIGNALS:
void nameAppeared();
void nameDisappeared();
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/provider.h b/libcontextsubscriber/unit-tests/propertyhandle/provider.h
index 15da4f8c..64380996 100644
--- a/libcontextsubscriber/unit-tests/propertyhandle/provider.h
+++ b/libcontextsubscriber/unit-tests/propertyhandle/provider.h
@@ -45,7 +45,7 @@ public:
TimedValue get(const QString &key) const;
void clearValues();
-signals:
+Q_SIGNALS:
void subscribeFinished(QString key);
void valueChanged(QString key);
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp b/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp
index 253e5695..836d4d49 100644
--- a/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp
+++ b/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp
@@ -665,7 +665,7 @@ void PropertyHandleUnitTests::commanderAppearsAndDisappears()
// Test:
// Command the DBusNameListener to tell that the Commander has appeared
mockDBusNameListener->servicePresent = DBusNameListener::Present;
- emit mockDBusNameListener->nameAppeared();
+ Q_EMIT mockDBusNameListener->nameAppeared();
// Expected results:
// The handle unsubscribes from the real provider
@@ -684,7 +684,7 @@ void PropertyHandleUnitTests::commanderAppearsAndDisappears()
// Test:
// Command the DBusNameListener to tell that the Commander has disappeared
mockDBusNameListener->servicePresent = DBusNameListener::NotPresent;
- emit mockDBusNameListener->nameDisappeared();
+ Q_EMIT mockDBusNameListener->nameDisappeared();
// Expected results:
// The PropertyHandle unsubscribes from the commander
@@ -718,7 +718,7 @@ void PropertyHandleUnitTests::commandingDisabled()
// Command the DBusNameListener to tell that the Commander has appeared
mockDBusNameListener->servicePresent = DBusNameListener::Present;
- emit mockDBusNameListener->nameAppeared();
+ Q_EMIT mockDBusNameListener->nameAppeared();
// Expected results:
// The PropertyHandle unsubscribes from and resubscribes to the same key,
@@ -735,7 +735,7 @@ void PropertyHandleUnitTests::commandingDisabled()
// Test:
// Command the DBusNameListener to tell that the Commander has disappeared
mockDBusNameListener->servicePresent = DBusNameListener::NotPresent;
- emit mockDBusNameListener->nameDisappeared();
+ Q_EMIT mockDBusNameListener->nameDisappeared();
// Expected results:
// Same thing as above.
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.h b/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.h
index f7ef3557..07d03dd9 100644
--- a/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.h
+++ b/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.h
@@ -35,7 +35,7 @@ private:
PropertyHandle *propertyHandle;
// Tests
-private slots:
+private Q_SLOTS:
// Init and cleanup helper functions
void initTestCase();
void cleanupTestCase();
diff --git a/libcontextsubscriber/unit-tests/provider/contextkitplugin.h b/libcontextsubscriber/unit-tests/provider/contextkitplugin.h
index 5d91b360..5b491db9 100644
--- a/libcontextsubscriber/unit-tests/provider/contextkitplugin.h
+++ b/libcontextsubscriber/unit-tests/provider/contextkitplugin.h
@@ -45,7 +45,7 @@ public:
void subscribe(QSet<QString> keys);
void unsubscribe(QSet<QString> keys);
-signals:
+Q_SIGNALS:
void ready();
void failed(QString error);
void subscribeFinished(QString key);
diff --git a/libcontextsubscriber/unit-tests/provider/handlesignalrouter.h b/libcontextsubscriber/unit-tests/provider/handlesignalrouter.h
index 75ae2628..b688e2db 100644
--- a/libcontextsubscriber/unit-tests/provider/handlesignalrouter.h
+++ b/libcontextsubscriber/unit-tests/provider/handlesignalrouter.h
@@ -36,7 +36,7 @@ class HandleSignalRouter : public QObject
public:
static HandleSignalRouter* instance();
-public slots:
+public Q_SLOTS:
void onValueChanged(QString key);
void onSubscribeFinished(Provider *provider, QString key);
};
diff --git a/libcontextsubscriber/unit-tests/provider/testprovider.cpp b/libcontextsubscriber/unit-tests/provider/testprovider.cpp
index c39d45cc..09c7a071 100644
--- a/libcontextsubscriber/unit-tests/provider/testprovider.cpp
+++ b/libcontextsubscriber/unit-tests/provider/testprovider.cpp
@@ -200,7 +200,7 @@ void ProviderUnitTests::pluginReadyHandled()
QCOMPARE(pluginInstances[conStr]->subscribeRequested, QSet<QString>()); // nothing yet
// but after ready, the pending subscriptions are requested from the plugin
- emit pluginInstances[conStr]->ready();
+ Q_EMIT pluginInstances[conStr]->ready();
provider->callAllMethodsInQueue();
QCOMPARE(pluginInstances[conStr]->subscribeRequested, QSet<QString>() << "test.key1" << "test.key3");
}
@@ -221,7 +221,7 @@ void ProviderUnitTests::pluginFailedHandled()
QCOMPARE(pluginInstances[conStr]->subscribeRequested, QSet<QString>()); // nothing yet
// but after ready, the pending subscriptions are requested from the plugin
- emit pluginInstances[conStr]->failed("error");
+ Q_EMIT pluginInstances[conStr]->failed("error");
provider->callAllMethodsInQueue();
QCOMPARE(pluginInstances[conStr]->subscribeRequested, QSet<QString>()); // we failed, no requests
}
@@ -245,7 +245,7 @@ void ProviderUnitTests::unsubscribe()
QString conStr = "session:Fake.Bus.Name." + QString(__FUNCTION__);
Provider *provider = Provider::instance(ContextProviderInfo("contextkit-dbus", conStr));
provider->callAllMethodsInQueue();
- emit pluginInstances[conStr]->ready(); // set the plugin to ready
+ Q_EMIT pluginInstances[conStr]->ready(); // set the plugin to ready
provider->callAllMethodsInQueue();
provider->subscribe("test.key1");
@@ -280,15 +280,15 @@ void ProviderUnitTests::pluginSubscriptionFinishes()
QString conStr = "session:Fake.Bus.Name." + QString(__FUNCTION__);
Provider *provider = Provider::instance(ContextProviderInfo("contextkit-dbus", conStr));
provider->callAllMethodsInQueue();
- emit pluginInstances[conStr]->ready(); // set the plugin to ready
+ Q_EMIT pluginInstances[conStr]->ready(); // set the plugin to ready
provider->callAllMethodsInQueue();
QSignalSpy spy(provider, SIGNAL(subscribeFinished(Provider *, QString)));
provider->subscribe("test.key1");
provider->subscribe("test.key2");
provider->callAllMethodsInQueue();
- emit pluginInstances[conStr]->subscribeFinished("test.key1");
- emit pluginInstances[conStr]->subscribeFailed("test.key2", "error");
+ Q_EMIT pluginInstances[conStr]->subscribeFinished("test.key1");
+ Q_EMIT pluginInstances[conStr]->subscribeFailed("test.key2", "error");
QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents); // signal delivery is queued
QCOMPARE(spy.size(), 2);
QCOMPARE(spy[0].size(), 2);
@@ -308,17 +308,17 @@ void ProviderUnitTests::pluginValueChanges()
QString conStr = "session:Fake.Bus.Name." + QString(__FUNCTION__);
Provider *provider = Provider::instance(ContextProviderInfo("contextkit-dbus", conStr));
provider->callAllMethodsInQueue();
- emit pluginInstances[conStr]->ready(); // set the plugin to ready
+ Q_EMIT pluginInstances[conStr]->ready(); // set the plugin to ready
provider->callAllMethodsInQueue();
provider->subscribe("test.key1");
provider->callAllMethodsInQueue();
- emit pluginInstances[conStr]->subscribeFinished("test.key1");
+ Q_EMIT pluginInstances[conStr]->subscribeFinished("test.key1");
QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents); // signal delivery is queued
QSignalSpy spy(provider, SIGNAL(valueChanged(QString)));
- emit pluginInstances[conStr]->valueChanged("test.key1", QVariant(42));
- emit pluginInstances[conStr]->valueChanged("test.key2", QVariant(4242));
+ Q_EMIT pluginInstances[conStr]->valueChanged("test.key1", QVariant(42));
+ Q_EMIT pluginInstances[conStr]->valueChanged("test.key2", QVariant(4242));
QCOMPARE(spy.size(), 1);
QCOMPARE(spy.at(0).size(), 1);
diff --git a/libcontextsubscriber/unit-tests/provider/testprovider.h b/libcontextsubscriber/unit-tests/provider/testprovider.h
index 591d1113..c7f2d93d 100644
--- a/libcontextsubscriber/unit-tests/provider/testprovider.h
+++ b/libcontextsubscriber/unit-tests/provider/testprovider.h
@@ -33,7 +33,7 @@ class ProviderUnitTests : public QObject
private:
// Tests
-private slots:
+private Q_SLOTS:
// Init and cleanup helper functions
void initTestCase();
void cleanupTestCase();
diff --git a/libcontextsubscriber/update-contextkit-providers/update-contextkit-providers.cpp b/libcontextsubscriber/update-contextkit-providers/update-contextkit-providers.cpp
index 20d75fa3..2c90c8b7 100644
--- a/libcontextsubscriber/update-contextkit-providers/update-contextkit-providers.cpp
+++ b/libcontextsubscriber/update-contextkit-providers/update-contextkit-providers.cpp
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
// Write the compatibility string
writer.add("VERSION", BACKEND_COMPATIBILITY_NAMESPACE);
- foreach(const QString& key, context->listKeys()) {
+ Q_FOREACH(const QString& key, context->listKeys()) {
ContextPropertyInfo keyInfo(key);
// Write value to list key
@@ -142,7 +142,7 @@ int main(int argc, char **argv)
// Write the providers
QVariantList providers;
- foreach(const ContextProviderInfo info, keyInfo.providers()) {
+ Q_FOREACH(const ContextProviderInfo info, keyInfo.providers()) {
QHash <QString, QVariant> provider;
provider.insert("plugin", info.plugin);
provider.insert("constructionString", info.constructionString);
diff --git a/sandbox/messaging-to-self/queuedinvoker.cpp b/sandbox/messaging-to-self/queuedinvoker.cpp
index 85dbb7d1..5c6fa3ef 100644
--- a/sandbox/messaging-to-self/queuedinvoker.cpp
+++ b/sandbox/messaging-to-self/queuedinvoker.cpp
@@ -29,7 +29,7 @@ void QueuedInvoker::queueOnce(const char *method)
{
QMutexLocker locker(&callQueueLock);
if (!callQueue.contains(method)) {
- emit queuedCall(method);
+ Q_EMIT queuedCall(method);
callQueue.insert(method);
}
}
diff --git a/sandbox/messaging-to-self/queuedinvoker.h b/sandbox/messaging-to-self/queuedinvoker.h
index 8f81f26e..aae05e45 100644
--- a/sandbox/messaging-to-self/queuedinvoker.h
+++ b/sandbox/messaging-to-self/queuedinvoker.h
@@ -13,10 +13,10 @@ class QueuedInvoker : public QObject
public:
QueuedInvoker();
-private slots:
+private Q_SLOTS:
void onQueuedCall(const char *method);
-signals:
+Q_SIGNALS:
void queuedCall(const char *method);
public:
diff --git a/sandbox/multithreading-tests/new-property-in-thread/thread.h b/sandbox/multithreading-tests/new-property-in-thread/thread.h
index dd9951b3..3fd5a7e9 100644
--- a/sandbox/multithreading-tests/new-property-in-thread/thread.h
+++ b/sandbox/multithreading-tests/new-property-in-thread/thread.h
@@ -19,7 +19,7 @@ public:
ContextProperty* cp;
-public slots:
+public Q_SLOTS:
void onValueChanged()
{
qDebug() << "Listener::valueChanged(), and current thread is" << QThread::currentThread();
diff --git a/sandbox/multithreading-tests/old-property-in-thread/thread.h b/sandbox/multithreading-tests/old-property-in-thread/thread.h
index ec84afdf..79994141 100644
--- a/sandbox/multithreading-tests/old-property-in-thread/thread.h
+++ b/sandbox/multithreading-tests/old-property-in-thread/thread.h
@@ -19,7 +19,7 @@ public:
ContextProperty* cp;
-public slots:
+public Q_SLOTS:
void onValueChanged()
{
qDebug() << "Listener::valueChanged(), and current thread is" << QThread::currentThread();
diff --git a/sandbox/multithreading-tests/single-thread/listener.h b/sandbox/multithreading-tests/single-thread/listener.h
index 9980f62a..8c3cf07d 100644
--- a/sandbox/multithreading-tests/single-thread/listener.h
+++ b/sandbox/multithreading-tests/single-thread/listener.h
@@ -18,7 +18,7 @@ public:
ContextProperty* cp;
-public slots:
+public Q_SLOTS:
void onValueChanged()
{
qDebug() << "Listener::valueChanged()";
diff --git a/sandbox/multithreading-tests/stress-test/thread.h b/sandbox/multithreading-tests/stress-test/thread.h
index 44cbf7c8..5a616f69 100644
--- a/sandbox/multithreading-tests/stress-test/thread.h
+++ b/sandbox/multithreading-tests/stress-test/thread.h
@@ -122,7 +122,7 @@ public:
t->start();
}
-public slots:
+public Q_SLOTS:
void onThreadFinished() {
Thread* t = (Thread*) QObject::sender();
if (threads.remove(t)) {
diff --git a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h b/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h
index e92af6f2..1edb6b42 100644
--- a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h
+++ b/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h
@@ -26,7 +26,7 @@ public:
ContextProperty* cp;
-public slots:
+public Q_SLOTS:
void onValueChanged()
{
qDebug() << "Listener::valueChanged(), and current thread is" << QThread::currentThread();
diff --git a/sandbox/multithreading-tests/wait-for-subscription-thread/thread.h b/sandbox/multithreading-tests/wait-for-subscription-thread/thread.h
index 7766fe68..8ec5ba9a 100644
--- a/sandbox/multithreading-tests/wait-for-subscription-thread/thread.h
+++ b/sandbox/multithreading-tests/wait-for-subscription-thread/thread.h
@@ -21,7 +21,7 @@ public:
ContextProperty* cp;
-public slots:
+public Q_SLOTS:
void onValueChanged()
{
qDebug() << "Listener::valueChanged(), and current thread is" << QThread::currentThread();
diff --git a/sandbox/wait-test/main.cpp b/sandbox/wait-test/main.cpp
index 9f4e748f..e2c1a4ce 100644
--- a/sandbox/wait-test/main.cpp
+++ b/sandbox/wait-test/main.cpp
@@ -17,7 +17,7 @@ public:
start(10000);
setSingleShot(true);
}
-public slots:
+public Q_SLOTS:
void timedout()
{
qDebug() << "timed out, wake up everyone";
@@ -35,7 +35,7 @@ public:
this, SLOT(timedout()));
start(0);
}
-public slots:
+public Q_SLOTS:
void timedout()
{
qDebug() << "timed out, so starting to wait";