Commit 7beb2d61 authored by Laurent Montel's avatar Laurent Montel 😁

Astyle kdelibs

parent 4f612674
......@@ -24,11 +24,13 @@
#include <QWidget>
namespace KContacts {
namespace KContacts
{
class Addressee;
}
namespace Akonadi {
namespace Akonadi
{
class ContactMetaData;
......
......@@ -26,11 +26,13 @@
#include <QtCore/QVariantMap>
namespace KContacts {
namespace KContacts
{
class Addressee;
}
namespace Akonadi {
namespace Akonadi
{
class Item;
/**
......
......@@ -26,11 +26,13 @@
#include <QtCore/QVariant>
namespace KContacts {
namespace KContacts
{
class ContactGroup;
}
namespace Akonadi {
namespace Akonadi
{
class Item;
/**
......
......@@ -22,11 +22,13 @@
#ifndef AKONADI_DIALPHONENUMBERACTION_H
#define AKONADI_DIALPHONENUMBERACTION_H
namespace KContacts {
namespace KContacts
{
class PhoneNumber;
}
namespace Akonadi {
namespace Akonadi
{
/**
* @short An action to dial the phone number of a contact.
......
......@@ -22,7 +22,8 @@
#ifndef SENDSMSACTION_H
#define SENDSMSACTION_H
namespace KContacts {
namespace KContacts
{
class PhoneNumber;
}
......
......@@ -22,11 +22,13 @@
#ifndef AKONADI_SHOWADDRESSACTION_H
#define AKONADI_SHOWADDRESSACTION_H
namespace KContacts {
namespace KContacts
{
class Address;
}
namespace Akonadi {
namespace Akonadi
{
/**
* @short A contact action to show the address of a contact on a map.
......
......@@ -28,7 +28,8 @@ class QLabel;
class KTextEdit;
namespace KContacts {
namespace KContacts
{
class PhoneNumber;
}
......
......@@ -20,4 +20,3 @@
#include "akonadi_contact_debug.h"
Q_LOGGING_CATEGORY(AKONADICONTACT_LOG, "log_akonadi_contact")
......@@ -23,5 +23,5 @@
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(AKONADICONTACT_LOG)
#endif
#endif
......@@ -23,7 +23,8 @@
#include <attributefactory.h>
namespace {
namespace
{
// Anonymous namespace; function is invisible outside this file.
bool dummy()
......
......@@ -24,7 +24,8 @@
#include <entitytreemodel.h>
namespace Akonadi {
namespace Akonadi
{
class ContactCompletionModel : public EntityTreeModel
{
......
......@@ -28,12 +28,14 @@
class QUrl;
namespace KContacts {
namespace KContacts
{
class Address;
class PhoneNumber;
}
namespace Akonadi {
namespace Akonadi
{
/**
* @short A convenience class that handles different contact related actions.
......
......@@ -26,11 +26,13 @@
#include <QWidget>
namespace KContacts {
namespace KContacts
{
class Addressee;
}
namespace Akonadi {
namespace Akonadi
{
class AbstractContactEditorWidget;
class Collection;
......
......@@ -26,7 +26,8 @@
#include <QDialog>
namespace Akonadi {
namespace Akonadi
{
class AbstractContactEditorWidget;
class ContactEditor;
......
......@@ -24,11 +24,13 @@
#include <QWidget>
namespace KContacts {
namespace KContacts
{
class Addressee;
}
namespace Akonadi {
namespace Akonadi
{
/**
* @short The base class for custom ContactEditor page plugins.
......
......@@ -26,11 +26,13 @@
#include <QWidget>
namespace KContacts {
namespace KContacts
{
class ContactGroup;
}
namespace Akonadi {
namespace Akonadi
{
class Collection;
class Item;
......
......@@ -31,7 +31,8 @@
class KJob;
namespace Akonadi {
namespace Akonadi
{
class ContactGroupModel;
class Monitor;
......
......@@ -139,7 +139,7 @@ ContactGroupEditorDelegate::~ContactGroupEditorDelegate()
}
QWidget *ContactGroupEditorDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const
const QModelIndex &index) const
{
Q_UNUSED(option)
if (index.column() == 0) {
......
......@@ -28,7 +28,8 @@
#include <item.h>
namespace Akonadi {
namespace Akonadi
{
class ContactLineEdit : public QLineEdit
{
......
......@@ -107,8 +107,8 @@ ContactGroupEditorDialog::ContactGroupEditorDialog(Mode mode, QWidget *parent)
QGridLayout *layout = new QGridLayout(mainWidget);
d->mEditor = new Akonadi::ContactGroupEditor(mode == CreateMode ?
Akonadi::ContactGroupEditor::CreateMode : Akonadi::ContactGroupEditor::EditMode,
this);
Akonadi::ContactGroupEditor::CreateMode : Akonadi::ContactGroupEditor::EditMode,
this);
if (mode == CreateMode) {
QLabel *label = new QLabel(i18n("Add to:"), mainWidget);
......
......@@ -26,7 +26,8 @@
#include <QDialog>
namespace Akonadi {
namespace Akonadi
{
class Item;
class Collection;
......
......@@ -28,7 +28,8 @@
#include <kcontacts/contactgroup.h>
#include <kjob.h>
namespace Akonadi {
namespace Akonadi
{
/**
* @short Job that expands a ContactGroup to a list of contacts.
......
......@@ -32,8 +32,7 @@
using namespace Akonadi;
struct GroupMember
{
struct GroupMember {
GroupMember()
: isReference(false)
, loadingError(false)
......
......@@ -26,7 +26,8 @@
#include <kcontacts/contactgroup.h>
namespace Akonadi {
namespace Akonadi
{
class ContactGroupModel : public QAbstractItemModel
{
......
......@@ -28,7 +28,8 @@
#include <itemsearchjob.h>
#include <kcontacts/contactgroup.h>
namespace Akonadi {
namespace Akonadi
{
/**
* @short Job that searches for contact groups in the Akonadi storage.
......
......@@ -28,7 +28,8 @@
#include <QWidget>
namespace Akonadi {
namespace Akonadi
{
class AbstractContactGroupFormatter;
......
......@@ -26,7 +26,8 @@
#include <QDialog>
namespace Akonadi {
namespace Akonadi
{
class Item;
......
......@@ -29,9 +29,9 @@ using namespace Akonadi;
class ContactMetaData::Private
{
public:
public:
Private()
: mDisplayNameMode( -1 )
: mDisplayNameMode(-1)
{
}
......@@ -40,65 +40,65 @@ class ContactMetaData::Private
};
ContactMetaData::ContactMetaData()
: d( new Private )
: d(new Private)
{
}
ContactMetaData::~ContactMetaData()
{
delete d;
delete d;
}
void ContactMetaData::load( const Akonadi::Item &contact )
void ContactMetaData::load(const Akonadi::Item &contact)
{
if ( !contact.hasAttribute( "contactmetadata" ) ) {
return;
}
if (!contact.hasAttribute("contactmetadata")) {
return;
}
ContactMetaDataAttribute *attribute = contact.attribute<ContactMetaDataAttribute>();
const QVariantMap metaData = attribute->metaData();
ContactMetaDataAttribute *attribute = contact.attribute<ContactMetaDataAttribute>();
const QVariantMap metaData = attribute->metaData();
if ( metaData.contains( QLatin1String( "DisplayNameMode" ) ) ) {
d->mDisplayNameMode = metaData.value( QLatin1String( "DisplayNameMode" ) ).toInt();
} else {
d->mDisplayNameMode = -1;
}
if (metaData.contains(QLatin1String("DisplayNameMode"))) {
d->mDisplayNameMode = metaData.value(QLatin1String("DisplayNameMode")).toInt();
} else {
d->mDisplayNameMode = -1;
}
d->mCustomFieldDescriptions = metaData.value( QLatin1String( "CustomFieldDescriptions" ) ).toList();
d->mCustomFieldDescriptions = metaData.value(QLatin1String("CustomFieldDescriptions")).toList();
}
void ContactMetaData::store( Akonadi::Item &contact )
void ContactMetaData::store(Akonadi::Item &contact)
{
ContactMetaDataAttribute *attribute = contact.attribute<ContactMetaDataAttribute>( Item::AddIfMissing );
ContactMetaDataAttribute *attribute = contact.attribute<ContactMetaDataAttribute>(Item::AddIfMissing);
QVariantMap metaData;
if ( d->mDisplayNameMode != -1 ) {
metaData.insert( QLatin1String( "DisplayNameMode" ), QVariant( d->mDisplayNameMode ) );
}
QVariantMap metaData;
if (d->mDisplayNameMode != -1) {
metaData.insert(QLatin1String("DisplayNameMode"), QVariant(d->mDisplayNameMode));
}
if ( !d->mCustomFieldDescriptions.isEmpty() ) {
metaData.insert( QLatin1String( "CustomFieldDescriptions" ), d->mCustomFieldDescriptions );
}
if (!d->mCustomFieldDescriptions.isEmpty()) {
metaData.insert(QLatin1String("CustomFieldDescriptions"), d->mCustomFieldDescriptions);
}
attribute->setMetaData( metaData );
attribute->setMetaData(metaData);
}
void ContactMetaData::setDisplayNameMode( int mode )
void ContactMetaData::setDisplayNameMode(int mode)
{
d->mDisplayNameMode = mode;
d->mDisplayNameMode = mode;
}
int ContactMetaData::displayNameMode() const
{
return d->mDisplayNameMode;
return d->mDisplayNameMode;
}
void ContactMetaData::setCustomFieldDescriptions( const QVariantList &descriptions )
void ContactMetaData::setCustomFieldDescriptions(const QVariantList &descriptions)
{
d->mCustomFieldDescriptions = descriptions;
d->mCustomFieldDescriptions = descriptions;
}
QVariantList ContactMetaData::customFieldDescriptions() const
{
return d->mCustomFieldDescriptions;
return d->mCustomFieldDescriptions;
}
......@@ -25,7 +25,8 @@
#include <QtCore/QStringList>
#include <QtCore/QVariant>
namespace Akonadi {
namespace Akonadi
{
class Item;
......
......@@ -53,7 +53,7 @@ QVariantMap ContactMetaDataAttribute::metaData() const
QByteArray ContactMetaDataAttribute::type() const
{
static const QByteArray sType( "contactmetadata" );
static const QByteArray sType("contactmetadata");
return sType;
}
......
......@@ -28,7 +28,8 @@
#include <QtCore/QVariant>
namespace Akonadi {
namespace Akonadi
{
/**
* @short Attribute to store contact specific meta data.
......
......@@ -22,14 +22,16 @@
#include "akonadi-contact_export.h"
namespace Akonadi {
namespace Akonadi
{
/**
* @short Contains predefined part identifiers.
*
* This namespace contains identifiers of item parts that are used for
* handling contact items.
*/
namespace ContactPart {
namespace ContactPart
{
/**
* The part identifier for a small contact version,
* that contains only name and email addresses.
......
......@@ -28,7 +28,8 @@
#include <itemsearchjob.h>
#include <kcontacts/addressee.h>
namespace Akonadi {
namespace Akonadi
{
/**
* @short Job that searches for contacts in the Akonadi storage.
......
......@@ -26,7 +26,8 @@
#include <QSortFilterProxyModel>
namespace Akonadi {
namespace Akonadi
{
/**
* @short A proxy model for \a ContactsTreeModel models.
......
......@@ -27,7 +27,8 @@
#include <entitytreemodel.h>
namespace Akonadi {
namespace Akonadi
{
/**
* @short A model for contacts and contact groups as available in Akonadi.
......
......@@ -77,9 +77,8 @@ public:
void updateView(const QVariantList &localCustomFieldDescriptions = QVariantList(), const QString &addressBookName = QString())
{
static QPixmap defaultPixmap = QIcon::fromTheme(QStringLiteral("user-identity")).pixmap(QSize(100, 100));
static QPixmap defaultMapPixmap = QIcon::fromTheme( QLatin1String( "document-open-remote" ) ).pixmap( QSize( 16, 16 ) );
static QPixmap defaultSmsPixmap = QIcon::fromTheme( IMProtocols::self()->icon( QString::fromLatin1( "messaging/sms" ) ) ).pixmap( QSize( 16, 16 ) );
static QPixmap defaultMapPixmap = QIcon::fromTheme(QLatin1String("document-open-remote")).pixmap(QSize(16, 16));
static QPixmap defaultSmsPixmap = QIcon::fromTheme(IMProtocols::self()->icon(QString::fromLatin1("messaging/sms"))).pixmap(QSize(16, 16));
mParent->setWindowTitle(i18n("Contact %1", mCurrentContact.assembledName()));
......@@ -88,9 +87,9 @@ public:
QUrl(QLatin1String("contact_photo")),
mCurrentContact.photo().data());
} else if (!mCurrentContact.photo().url().isEmpty()) {
mBrowser->document()->addResource( QTextDocument::ImageResource,
QUrl( QLatin1String( "contact_photo" ) ),
defaultPixmap );
mBrowser->document()->addResource(QTextDocument::ImageResource,
QUrl(QLatin1String("contact_photo")),
defaultPixmap);
} else {
mBrowser->document()->addResource(QTextDocument::ImageResource,
QUrl(QLatin1String("contact_photo")),
......@@ -105,7 +104,6 @@ public:
//TODO
}
mBrowser->document()->addResource(QTextDocument::ImageResource,
QUrl(QLatin1String("map_icon")),
defaultMapPixmap);
......@@ -175,7 +173,7 @@ public:
{
const QString urlScheme(url.scheme());
if (urlScheme == QLatin1String("http") ||
urlScheme == QLatin1String("https")) {
urlScheme == QLatin1String("https")) {
emit mParent->urlClicked(url);
} else if (urlScheme == QLatin1String("phone")) {
const int pos = url.queryItemValue(QLatin1String("index")).toInt();
......
......@@ -28,13 +28,15 @@
#include <QWidget>
namespace KContacts {
namespace KContacts
{
class Address;
class Addressee;
class PhoneNumber;
}
namespace Akonadi {
namespace Akonadi
{
class AbstractContactFormatter;
......
......@@ -26,10 +26,12 @@
#include <QDialog>
namespace KContacts {
namespace KContacts
{
}
namespace Akonadi {
namespace Akonadi
{
class Item;