Commit f58209e5 authored by Martin Klapetek's avatar Martin Klapetek
Browse files

Style consistency++

parent b1999452
......@@ -22,12 +22,12 @@
#include <KConfigGroup>
#include <KSharedConfig>
AkonadiAccounts::AkonadiAccounts(const QString& configName)
AkonadiAccounts::AkonadiAccounts(const QString &configName)
{
m_config = KSharedConfig::openConfig(configName);
}
bool AkonadiAccounts::hasService(const Accounts::AccountId accId, const QString& serviceName)
bool AkonadiAccounts::hasService(const Accounts::AccountId accId, const QString &serviceName)
{
qDebug() << accId;
KConfigGroup account = group(accId);
......@@ -49,12 +49,12 @@ QStringList AkonadiAccounts::services(const Accounts::AccountId accId)
return account.keyList();
}
void AkonadiAccounts::addService(const Accounts::AccountId accId, const QString& serviceName, const QString& resourceId)
void AkonadiAccounts::addService(const Accounts::AccountId accId, const QString &serviceName, const QString &resourceId)
{
addService(accId, QStringList() << serviceName, resourceId);
}
void AkonadiAccounts::addService(const Accounts::AccountId accId, const QStringList& serviceNames, const QString& resourceId)
void AkonadiAccounts::addService(const Accounts::AccountId accId, const QStringList &serviceNames, const QString &resourceId)
{
qDebug() << accId << serviceNames << resourceId;
......@@ -66,7 +66,7 @@ void AkonadiAccounts::addService(const Accounts::AccountId accId, const QStringL
account.sync();
}
void AkonadiAccounts::addService(const Accounts::AccountId accId, const Accounts::ServiceList& services, const QString& resourceId)
void AkonadiAccounts::addService(const Accounts::AccountId accId, const Accounts::ServiceList &services, const QString &resourceId)
{
QStringList servicesToStore;
......@@ -77,12 +77,12 @@ void AkonadiAccounts::addService(const Accounts::AccountId accId, const Accounts
addService(accId, servicesToStore, resourceId);
}
void AkonadiAccounts::removeService(const Accounts::AccountId accId, const QString& serviceName)
void AkonadiAccounts::removeService(const Accounts::AccountId accId, const QString &serviceName)
{
removeService(accId, QStringList() << serviceName);
}
void AkonadiAccounts::removeService(const Accounts::AccountId accId, const QStringList& serviceNames)
void AkonadiAccounts::removeService(const Accounts::AccountId accId, const QStringList &serviceNames)
{
qDebug() << accId << serviceNames;
......@@ -129,7 +129,7 @@ QStringList AkonadiAccounts::resources(const Accounts::AccountId accId)
return cleaned;
}
QString AkonadiAccounts::resource(const Accounts::AccountId accId, const QString& serviceName) const
QString AkonadiAccounts::resource(const Accounts::AccountId accId, const QString &serviceName) const
{
qDebug() << accId << serviceName;
......@@ -137,7 +137,7 @@ QString AkonadiAccounts::resource(const Accounts::AccountId accId, const QString
return account.readEntry(serviceName, QString());
}
QString AkonadiAccounts::resourceFromType(const Accounts::AccountId accId, const QString& resourceType) const
QString AkonadiAccounts::resourceFromType(const Accounts::AccountId accId, const QString &resourceType) const
{
qDebug() << accId << resourceType;
KConfigGroup cGroup = group(accId);
......@@ -165,4 +165,4 @@ KConfigGroup AkonadiAccounts::group(const Accounts::AccountId accId) const
QString group("Account_" + QString::number(accId));
return m_config->group(group);
}
\ No newline at end of file
}
......@@ -26,27 +26,27 @@
class AkonadiAccounts
{
public:
AkonadiAccounts(const QString& configName = QLatin1String("accounts-akonadi"));
public:
AkonadiAccounts(const QString &configName = QLatin1String("accounts-akonadi"));
bool hasService(const Accounts::AccountId accId, const QString &serviceName);
bool hasServices(const Accounts::AccountId accId);
QStringList services(const Accounts::AccountId accId);
void addService(const Accounts::AccountId accId, const QString &serviceName, const QString &resourceId);
void addService(const Accounts::AccountId accId, const QStringList &serviceNames, const QString &resourceId);
void addService(const Accounts::AccountId accId, const Accounts::ServiceList &services, const QString &resourceId);
void removeService(const Accounts::AccountId accId, const QString &serviceName);
void removeService(const Accounts::AccountId accId, const QStringList &serviceNames);
void removeService(const Accounts::AccountId accId, const Accounts::ServiceList &services);
bool hasService(const Accounts::AccountId accId, const QString &serviceName);
bool hasServices(const Accounts::AccountId accId);
QStringList services(const Accounts::AccountId accId);
void addService(const Accounts::AccountId accId, const QString &serviceName, const QString &resourceId);
void addService(const Accounts::AccountId accId, const QStringList &serviceNames, const QString &resourceId);
void addService(const Accounts::AccountId accId, const Accounts::ServiceList &services, const QString &resourceId);
void removeService(const Accounts::AccountId accId, const QString &serviceName);
void removeService(const Accounts::AccountId accId, const QStringList &serviceNames);
void removeService(const Accounts::AccountId accId, const Accounts::ServiceList &services);
QStringList resources(const Accounts::AccountId accId);
QString resource(const Accounts::AccountId accId, const QString &serviceName) const;
QString resourceFromType(const Accounts::AccountId accId, const QString &resourceType) const;
QStringList resources(const Accounts::AccountId accId);
QString resource(const Accounts::AccountId accId, const QString &serviceName) const;
QString resourceFromType(const Accounts::AccountId accId, const QString &resourceType) const;
void removeAccount(const Accounts::AccountId accId);
private:
KSharedConfig::Ptr m_config;
KConfigGroup group(const Accounts::AccountId accId) const;
void removeAccount(const Accounts::AccountId accId);
private:
KSharedConfig::Ptr m_config;
KConfigGroup group(const Accounts::AccountId accId) const;
};
#endif //ACCOUNTS_AKONADI_DAEMON_H
\ No newline at end of file
#endif //ACCOUNTS_AKONADI_DAEMON_H
......@@ -18,7 +18,8 @@
#include "abstractakonadijob.h"
AbstractAkonadiJob::AbstractAkonadiJob(QObject* parent): KJob(parent)
AbstractAkonadiJob::AbstractAkonadiJob(QObject *parent)
: KJob(parent)
{
}
......@@ -28,7 +29,7 @@ QString AbstractAkonadiJob::resourceId() const
return m_resourceId;
}
void AbstractAkonadiJob::setResourceId(const QString& resourceId)
void AbstractAkonadiJob::setResourceId(const QString &resourceId)
{
m_resourceId = resourceId;
}
......@@ -38,7 +39,7 @@ QString AbstractAkonadiJob::interface() const
return m_interface;
}
void AbstractAkonadiJob::setInterface(const QString& interface)
void AbstractAkonadiJob::setInterface(const QString &interface)
{
m_interface = interface;
}
......@@ -48,7 +49,7 @@ Accounts::AccountId AbstractAkonadiJob::accountId() const
return m_accountId;
}
void AbstractAkonadiJob::setAccountId(const Accounts::AccountId& accountId)
void AbstractAkonadiJob::setAccountId(const Accounts::AccountId accountId)
{
m_accountId = accountId;
}
......@@ -61,4 +62,4 @@ uint qHash(const Accounts::Service &key, uint seed)
uint qHash(const Accounts::Service &key)
{
return qHash(key.name() + key.provider() + key.serviceType());
}
\ No newline at end of file
}
......@@ -35,7 +35,7 @@ class AbstractAkonadiJob : public KJob
{
Q_OBJECT
public:
explicit AbstractAkonadiJob(QObject* parent = 0);
explicit AbstractAkonadiJob(QObject *parent = 0);
QString resourceId() const;
void setResourceId(const QString &resourceId);
......@@ -44,7 +44,7 @@ class AbstractAkonadiJob : public KJob
void setInterface(const QString &interface);
Accounts::AccountId accountId() const;
void setAccountId(const Accounts::AccountId &accountId);
void setAccountId(const Accounts::AccountId accountId);
protected:
QString m_resourceId;
......
......@@ -25,7 +25,8 @@
#include <QDBusPendingReply>
#include <QDebug>
ChangeSettingsJob::ChangeSettingsJob(QObject* parent) : AbstractAkonadiJob(parent)
ChangeSettingsJob::ChangeSettingsJob(QObject *parent)
: AbstractAkonadiJob(parent)
{
}
......@@ -53,7 +54,7 @@ void ChangeSettingsJob::init()
setConfiguration();
}
void ChangeSettingsJob::dbusSettingsPath(KJob* job)
void ChangeSettingsJob::dbusSettingsPath(KJob *job)
{
DBusSettingsInterfaceJob *dbusJob = qobject_cast<DBusSettingsInterfaceJob*>(job);
m_interface = dbusJob->interface();
......@@ -61,7 +62,7 @@ void ChangeSettingsJob::dbusSettingsPath(KJob* job)
setConfiguration();
}
void ChangeSettingsJob::setSetting(const QString& key, const QVariant& value)
void ChangeSettingsJob::setSetting(const QString &key, const QVariant &value)
{
m_key = key;
m_value = value;
......@@ -117,7 +118,7 @@ void ChangeSettingsJob::configWritten(QDBusPendingCallWatcher* watcher)
emitResult();
}
QDBusMessage ChangeSettingsJob::createCall(const QString& method)
QDBusMessage ChangeSettingsJob::createCall(const QString &method)
{
QString service = "org.freedesktop.Akonadi.Resource." + m_resourceId;
QString path = "/Settings";
......
......@@ -31,7 +31,7 @@ class ChangeSettingsJob : public AbstractAkonadiJob
{
Q_OBJECT
public:
explicit ChangeSettingsJob(QObject* parent = 0);
explicit ChangeSettingsJob(QObject *parent = 0);
virtual ~ChangeSettingsJob();
virtual void start();
......@@ -41,8 +41,8 @@ class ChangeSettingsJob : public AbstractAkonadiJob
private Q_SLOTS:
void init();
void dbusSettingsPath(KJob *job);
void accountSet(QDBusPendingCallWatcher* watcher);
void configWritten(QDBusPendingCallWatcher* watcher);
void accountSet(QDBusPendingCallWatcher *watcher);
void configWritten(QDBusPendingCallWatcher *watcher);
private:
QDBusMessage createCall(const QString &method);
......
......@@ -28,7 +28,7 @@
using namespace Akonadi;
CreateResourceJob::CreateResourceJob(QObject* parent)
CreateResourceJob::CreateResourceJob(QObject *parent)
: AbstractAkonadiJob(parent)
{
}
......@@ -47,7 +47,7 @@ void CreateResourceJob::start()
job->start();
}
void CreateResourceJob::setAgentType(const AgentType& type)
void CreateResourceJob::setAgentType(const AgentType &type)
{
m_type = type;
}
......@@ -62,7 +62,7 @@ Accounts::ServiceList CreateResourceJob::services() const
return m_services;
}
void CreateResourceJob::resourceCreated(KJob* job)
void CreateResourceJob::resourceCreated(KJob *job)
{
qDebug();
if (job->error()) {
......@@ -84,7 +84,7 @@ void CreateResourceJob::resourceCreated(KJob* job)
setAccJob->start();
}
void CreateResourceJob::setAccountDone(KJob* job)
void CreateResourceJob::setAccountDone(KJob *job)
{
qDebug();
if (job->error()) {
......
......@@ -32,7 +32,7 @@ class CreateResourceJob : public AbstractAkonadiJob
Q_OBJECT
public:
explicit CreateResourceJob(QObject* parent = 0);
explicit CreateResourceJob(QObject *parent = 0);
virtual ~CreateResourceJob();
virtual void start();
......@@ -42,8 +42,8 @@ class CreateResourceJob : public AbstractAkonadiJob
Accounts::ServiceList services() const;
private Q_SLOTS:
void resourceCreated(KJob* job);
void setAccountDone(KJob* job);
void resourceCreated(KJob *job);
void setAccountDone(KJob *job);
private:
Akonadi::AgentType m_type;
......
......@@ -26,7 +26,8 @@
#include <QDomDocument>
#include <QDebug>
DBusSettingsInterfaceJob::DBusSettingsInterfaceJob(QObject* parent) : AbstractAkonadiJob(parent)
DBusSettingsInterfaceJob::DBusSettingsInterfaceJob(QObject *parent)
: AbstractAkonadiJob(parent)
{
}
......@@ -51,7 +52,7 @@ void DBusSettingsInterfaceJob::init()
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(introspectDone(QDBusPendingCallWatcher*)));
}
void DBusSettingsInterfaceJob::introspectDone(QDBusPendingCallWatcher* watcher)
void DBusSettingsInterfaceJob::introspectDone(QDBusPendingCallWatcher *watcher)
{
qDebug();
watcher->deleteLater();
......@@ -98,4 +99,4 @@ void DBusSettingsInterfaceJob::introspectDone(QDBusPendingCallWatcher* watcher)
qDebug() << "Interface: " << m_interface;
emitResult();
}
\ No newline at end of file
}
......@@ -21,7 +21,7 @@
#include "abstractakonadijob.h"
#include <kjob.h>
#include <KJob>
class QDBusPendingCallWatcher;
class DBusSettingsInterfaceJob : public AbstractAkonadiJob
......@@ -29,13 +29,13 @@ class DBusSettingsInterfaceJob : public AbstractAkonadiJob
Q_OBJECT
public:
explicit DBusSettingsInterfaceJob(QObject* parent = 0);
explicit DBusSettingsInterfaceJob(QObject *parent = 0);
virtual void start();
private Q_SLOTS:
void init();
void introspectDone(QDBusPendingCallWatcher* watcher);
void introspectDone(QDBusPendingCallWatcher *watcher);
};
#endif //DBUS_SETTINGS_PATH_JOB_H
......@@ -22,7 +22,8 @@
#include <QDebug>
EnableServiceJob::EnableServiceJob(QObject* parent): AbstractAkonadiJob(parent)
EnableServiceJob::EnableServiceJob(QObject *parent)
: AbstractAkonadiJob(parent)
{
}
......@@ -45,7 +46,7 @@ void EnableServiceJob::init()
job->start();
}
void EnableServiceJob::fetchSettingsJobDone(KJob* job)
void EnableServiceJob::fetchSettingsJobDone(KJob *job)
{
if (job->error()) {
qDebug() << "Error fetching the settings" << job->errorText();
......@@ -89,7 +90,7 @@ void EnableServiceJob::fetchSettingsJobDone(KJob* job)
changeJob->start();
}
void EnableServiceJob::changeSettingsDone(KJob* job)
void EnableServiceJob::changeSettingsDone(KJob *job)
{
if (job->error()) {
qDebug() << "Error changing the settings" << job->errorText();
......
......@@ -21,29 +21,32 @@
#include "abstractakonadijob.h"
#include <Accounts/Service>
class EnableServiceJob : public AbstractAkonadiJob
{
Q_OBJECT
public:
enum Status {
Enable = 1,
Disable
};
explicit EnableServiceJob(QObject* parent = 0);
virtual void start();
void addService(const Accounts::Service &service, Status status);
Accounts::ServiceList services() const;
public Q_SLOTS:
void init();
void fetchSettingsJobDone(KJob* job);
void changeSettingsDone(KJob* job);
private:
Status m_serviceStatus;
QHash<Accounts::Service, Status> m_services;
public:
enum Status {
Enable = 1,
Disable
};
explicit EnableServiceJob(QObject *parent = 0);
virtual void start();
void addService(const Accounts::Service &service, Status status);
Accounts::ServiceList services() const;
public Q_SLOTS:
void init();
void fetchSettingsJobDone(KJob *job);
void changeSettingsDone(KJob *job);
private:
Status m_serviceStatus;
QHash<Accounts::Service, Status> m_services;
};
#endif //ENABLE_SERVICE_JOB_H
......@@ -25,12 +25,11 @@
#include <QDBusPendingCall>
#include <QDBusPendingCallWatcher>
#include <QDomDocument>
#include <QDebug>
FetchSettingsJob::FetchSettingsJob(QObject* parent)
: AbstractAkonadiJob(parent)
, m_watcher(0)
FetchSettingsJob::FetchSettingsJob(QObject *parent)
: AbstractAkonadiJob(parent)
, m_watcher(0)
{
}
......@@ -61,7 +60,7 @@ void FetchSettingsJob::init()
fetchSettings();
}
void FetchSettingsJob::dbusSettingsPathDone(KJob* job)
void FetchSettingsJob::dbusSettingsPathDone(KJob *job)
{
if (job->error()) {
setError(job->error());
......@@ -94,7 +93,7 @@ void FetchSettingsJob::fetchSettings()
connect(m_watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(fetchDone(QDBusPendingCallWatcher*)));
}
void FetchSettingsJob::fetchDone(QDBusPendingCallWatcher* watcher)
void FetchSettingsJob::fetchDone(QDBusPendingCallWatcher *watcher)
{
if (watcher->isError()) {
setError(-1);
......@@ -108,7 +107,7 @@ QString FetchSettingsJob::key() const
return m_key;
}
void FetchSettingsJob::setKey(const QString& key)
void FetchSettingsJob::setKey(const QString &key)
{
m_key = key;
}
\ No newline at end of file
}
......@@ -29,37 +29,38 @@
class FetchSettingsJob : public AbstractAkonadiJob
{
Q_OBJECT
public:
explicit FetchSettingsJob(QObject* parent = 0);
virtual ~FetchSettingsJob();
virtual void start();
public:
explicit FetchSettingsJob(QObject *parent = 0);
virtual ~FetchSettingsJob();
template< typename T>
T value() const
{
QDBusPendingReply<T> reply = *m_watcher;
if (reply.isError()) {
qDebug() << reply.error().message();
return T();
}
virtual void start();
return reply.value();
template< typename T>
T value() const
{
QDBusPendingReply<T> reply = *m_watcher;
if (reply.isError()) {
qDebug() << reply.error().message();
return T();
}
QString key() const;
void setKey(const QString &key);
return reply.value();
}
private Q_SLOTS:
void init();
void dbusSettingsPathDone(KJob *job);
void fetchDone(QDBusPendingCallWatcher*);
QString key() const;
void setKey(const QString &key);
private:
void fetchSettings();
private Q_SLOTS:
void init();
void dbusSettingsPathDone(KJob *job);
void fetchDone(QDBusPendingCallWatcher*);
QString m_key;
QDBusPendingCallWatcher *m_watcher;
private:
void fetchSettings();
QString m_key;
QDBusPendingCallWatcher *m_watcher;
};
#endif //FETCH_SETTINGS_JOB_H
......@@ -114,7 +114,7 @@ void LookupAkonadiServices::findResource()
qDebug() << "No resource found";
}
void LookupAkonadiServices::createResourceJobDone(KJob* job)
void LookupAkonadiServices::createResourceJobDone(KJob *job)
{
qDebug();
CreateResourceJob *cJob = qobject_cast<CreateResourceJob*>(job);
......@@ -136,7 +136,7 @@ void LookupAkonadiServices::createResourceJobDone(KJob* job)
servicesJob->start();
}
void LookupAkonadiServices::enableServiceJobDone(KJob* job)
void LookupAkonadiServices::enableServiceJobDone(KJob *job)
{
qDebug();
EnableServiceJob *servicesJob = qobject_cast<EnableServiceJob*>(job);
......
......@@ -25,9 +25,9 @@
using namespace Akonadi;
RemoveAkonadiServicesJob::RemoveAkonadiServicesJob(AkonadiAccounts *accounts, QObject* parent)
: KJob(parent)
, m_accounts(accounts)
RemoveAkonadiServicesJob::RemoveAkonadiServicesJob(AkonadiAccounts *accounts, QObject *parent)
: KJob(parent)
, m_accounts(accounts)
{
}
......@@ -59,7 +59,7 @@ void RemoveAkonadiServicesJob::removeResource()
job->start();
}
void RemoveAkonadiServicesJob::setAccountId(const Accounts::AccountId& accId)
void RemoveAkonadiServicesJob::setAccountId(const Accounts::AccountId accId)
{
m_accountId = accId;
}
......@@ -27,22 +27,23 @@ class AkonadiAccounts;
class RemoveAkonadiServicesJob : public KJob
{
Q_OBJECT
public:
explicit RemoveAkonadiServicesJob(AkonadiAccounts *accounts, QObject* parent = 0);
virtual void start();
public:
explicit RemoveAkonadiServicesJob(AkonadiAccounts *accounts, QObject *parent = 0);
void setAccountId(const Accounts::AccountId &accId);
virtual void start();
private Q_SLOTS:
void init();
void setAccountId(const Accounts::AccountId accId);
void removeResource();
private Q_SLOTS:
void init();
private:
AkonadiAccounts *m_accounts;
Accounts::AccountId m_accountId;
QStringList m_resources;
void removeResource();
private:
AkonadiAccounts *m_accounts;
Accounts::AccountId m_accountId;
QStringList m_resources;