Commit 70ebf3cc authored by Laurent Montel's avatar Laurent Montel 😁

coding style

parent c7574b24
......@@ -23,7 +23,6 @@
#include "mailimporter/filterinfo.h"
#include "mailimporter/othermailerutil.h"
#include "gearyplugin_debug.h"
#include <kpluginfactory.h>
#include <QDir>
......
......@@ -25,7 +25,6 @@
#include <KIdentityManagement/kidentitymanagement/identity.h>
#include <KIdentityManagement/kidentitymanagement/signature.h>
#include <QSettings>
GearySettings::GearySettings(const QString &filename)
......
......@@ -21,8 +21,6 @@
#include "mailimporter/filtermailapp.h"
#include "mailimporter/filterinfo.h"
#include <KLocalizedString>
#include <kpluginfactory.h>
#include <QDir>
......
......@@ -21,8 +21,6 @@
#include "mailimporter/filteroe.h"
#include "mailimporter/filterinfo.h"
#include <KLocalizedString>
#include <kpluginfactory.h>
......
......@@ -23,8 +23,6 @@
#include "mailimporter/filteropera.h"
#include "mailimporter/filterinfo.h"
#include <KLocalizedString>
#include <kpluginfactory.h>
#include <QDir>
......
......@@ -22,8 +22,6 @@
#include "mailimporter/filterpmail.h"
#include "mailimporter/filterinfo.h"
#include <KLocalizedString>
#include <kpluginfactory.h>
#include <QDir>
......
......@@ -21,8 +21,6 @@
#include "mailimporter/filterthebat.h"
#include "mailimporter/filterinfo.h"
#include <KLocalizedString>
#include <kpluginfactory.h>
......
......@@ -33,7 +33,8 @@
#include <QTextEdit>
#include <QLabel>
K_PLUGIN_FACTORY(CoisceimPartFactory, registerPlugin<CoisceimPart>();)
K_PLUGIN_FACTORY(CoisceimPartFactory, registerPlugin<CoisceimPart>();
)
CoisceimPart::CoisceimPart(QWidget *parentWidget, QObject *parent, const QVariantList & /*args*/)
: KParts::ReadOnlyPart(parent)
......@@ -47,4 +48,5 @@ CoisceimPart::CoisceimPart(QWidget *parentWidget, QObject *parent, const QVarian
CoisceimPart::~CoisceimPart()
{
}
#include "coisceimpart.moc"
......@@ -68,4 +68,3 @@ void CoisceimWidget::createTrip()
{
qDebug() << "CREATE";
}
......@@ -27,7 +27,9 @@
#include <QIcon>
CreateFolderContentsWidget::CreateFolderContentsWidget(Trip *trip, int role, const QString &type, QWidget *parent)
: QStackedWidget(parent), m_trip(trip), m_role(role)
: QStackedWidget(parent)
, m_trip(trip)
, m_role(role)
{
QPushButton *button = new QPushButton(QLatin1String("Select ") + type);
......
......@@ -41,7 +41,9 @@
using namespace Akonadi;
CreateTripWidget::CreateTripWidget(Trip *trip, Akonadi::Monitor *monitor, QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f), m_trip(trip), m_monitor(monitor)
: QWidget(parent, f)
, m_trip(trip)
, m_monitor(monitor)
{
QVBoxLayout *layout = new QVBoxLayout(this);
......
......@@ -26,8 +26,7 @@
#include <AkonadiCore/Item>
namespace Akonadi
{
namespace Akonadi {
class Monitor;
}
......
......@@ -67,7 +67,6 @@ EventSelectorDialog::EventSelectorDialog(QWidget *parent, Qt::WindowFlags f)
model->setCollectionFetchStrategy(MixedTreeModel::InvisibleCollectionFetch);
m_view->setModel(model);
}
Item EventSelectorDialog::selectedItem()
......@@ -112,4 +111,3 @@ void EventSelectorWidget::clear()
{
m_browser->setItem(Item());
}
......@@ -27,8 +27,7 @@
class QTreeView;
namespace CalendarSupport
{
namespace CalendarSupport {
class IncidenceViewer;
}
......
......@@ -42,7 +42,10 @@
using namespace Akonadi;
FolderContentsWidget::FolderContentsWidget(Trip *trip, int role, const QString &type, QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f), m_type(type), m_trip(trip), m_role(role)
: QWidget(parent, f)
, m_type(type)
, m_trip(trip)
, m_role(role)
{
QVBoxLayout *layout = new QVBoxLayout(this);
......@@ -74,9 +77,12 @@ QItemSelectionModel *FolderContentsWidget::selectionModel() const
static QString getMimeType(int role)
{
switch (role) {
case Trip::MailCollectionRole: return KMime::Message::mimeType();
case Trip::TodoCollectionRole: return KCalCore::Todo::todoMimeType();
case Trip::NotesCollectionRole: return Akonotes::Note::mimeType();
case Trip::MailCollectionRole:
return KMime::Message::mimeType();
case Trip::TodoCollectionRole:
return KCalCore::Todo::todoMimeType();
case Trip::NotesCollectionRole:
return Akonotes::Note::mimeType();
}
return QString();
}
......@@ -96,4 +102,3 @@ Trip *FolderContentsWidget::trip() const
{
return m_trip;
}
......@@ -26,8 +26,7 @@
class QItemSelectionModel;
namespace Akonadi
{
namespace Akonadi {
class EntityTreeView;
}
......
......@@ -29,7 +29,11 @@
#include "note.h"
ItemSelection::ItemSelection(QItemSelectionModel *selModel1, QItemSelectionModel *selModel2, QItemSelectionModel *selModel3, QObject *parent)
: QObject(parent), m_selModel1(selModel1), m_selModel2(selModel2), m_selModel3(selModel3), m_id(-1)
: QObject(parent)
, m_selModel1(selModel1)
, m_selModel2(selModel2)
, m_selModel3(selModel3)
, m_id(-1)
{
connectSignals();
}
......@@ -77,10 +81,11 @@ static QModelIndexList selectedRows(const QItemSelection &selection, int column
{
QModelIndexList list;
foreach (const QModelIndex &idx, selection.indexes())
foreach (const QModelIndex &idx, selection.indexes()) {
if (idx.column() == column) {
list << idx;
}
}
return list;
}
......@@ -142,4 +147,3 @@ QString ItemSelection::noteTitle() const
{
return m_index.data().toString();
}
......@@ -42,7 +42,9 @@
using namespace Akonadi;
ItemViewerWidget::ItemViewerWidget(ItemSelection *itemSelection, QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f), m_itemSelection(itemSelection), m_widgetStack(new QStackedWidget(this))
: QWidget(parent, f)
, m_itemSelection(itemSelection)
, m_widgetStack(new QStackedWidget(this))
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(m_widgetStack);
......@@ -92,4 +94,3 @@ void ItemViewerWidget::selectionChanged(const QModelIndex &selectedIndex)
m_widgetStack->setCurrentIndex(0);
}
......@@ -32,18 +32,15 @@ class NoteViewer;
class ItemSelection;
class QStackedWidget;
namespace MessageViewer
{
namespace MessageViewer {
class Viewer;
}
namespace Akonadi
{
namespace Akonadi {
class ContactViewer;
}
namespace CalendarSupport
{
namespace CalendarSupport {
class IncidenceViewer;
}
......@@ -66,4 +63,3 @@ private:
};
#endif
......@@ -33,13 +33,14 @@
EXPORT_KONTACT_PLUGIN(CoisceimPlugin, coisceim)
CoisceimPlugin::CoisceimPlugin(KontactInterface::Core *core, const QVariantList &)
: KontactInterface::Plugin(core, core, "coisceim"), m_interface(0)
: KontactInterface::Plugin(core, core, "coisceim")
, m_interface(0)
{
setComponentData(KontactPluginFactory::componentData());
QAction *action =
new QAction(QIcon::fromTheme("byobu"),
i18nc("@action:inmenu", "New Trip"), this);
QAction *action
= new QAction(QIcon::fromTheme("byobu"),
i18nc("@action:inmenu", "New Trip"), this);
actionCollection()->addAction("new_trip", action);
//action->setHelpText(
// i18nc( "@info:status", "Create a new trip" ) );
......@@ -102,4 +103,3 @@ int CoisceimUniqueAppHandler::newInstance()
(void)plugin()->part();
return KontactInterface::UniqueAppHandler::newInstance();
}
......@@ -26,8 +26,7 @@
#include <KontactInterface/UniqueAppHandler>
namespace KontactInterface
{
namespace KontactInterface {
class Plugin;
}
......@@ -35,7 +34,10 @@ class CoisceimUniqueAppHandler : public KontactInterface::UniqueAppHandler
{
public:
CoisceimUniqueAppHandler(KontactInterface::Plugin *plugin)
: KontactInterface::UniqueAppHandler(plugin) {}
: KontactInterface::UniqueAppHandler(plugin)
{
}
virtual void loadCommandLineOptions();
virtual int newInstance();
};
......@@ -51,6 +53,7 @@ public:
{
return 600;
}
virtual bool isRunningStandalone() const;
private Q_SLOTS:
......@@ -64,4 +67,3 @@ protected:
};
#endif
......@@ -32,7 +32,6 @@
MixedTreeModel::MixedTreeModel(Akonadi::Monitor *monitor, QObject *parent)
: EntityTreeModel(monitor, parent)
{
}
int MixedTreeModel::entityColumnCount(Akonadi::EntityTreeModel::HeaderGroup headerGroup) const
......@@ -71,13 +70,12 @@ QVariant MixedTreeModel::entityData(const Akonadi::Item &item, int column, int r
switch (column) {
case 0:
return message->subject()->asUnicodeString();
case 1: {
case 1:
if (item.mimeType() == KMime::Message::mimeType()) {
return message->from()->asUnicodeString();
} else {
return QString(message->mainBodyPart()->decodedText().mid(0, 30) + QLatin1String("..."));
}
}
default:
return QVariant();
}
......@@ -114,4 +112,3 @@ QVariant MixedTreeModel::entityData(const Akonadi::Collection &collection, int c
{
return Akonadi::EntityTreeModel::entityData(collection, column, role);
}
......@@ -26,8 +26,7 @@
#include <AkonadiCore/entitytreemodel.h>
namespace Akonadi
{
namespace Akonadi {
class Monitor;
}
......@@ -42,7 +41,6 @@ public:
/* reimp */ QVariant entityData(const Akonadi::Item &item, int column, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
/* reimp */ QVariant entityData(const Akonadi::Collection &collection, int column, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
};
#endif