Commit 19f95843 authored by Laurent Montel's avatar Laurent Montel 😁

coding style

parent 241e3449
......@@ -38,7 +38,6 @@ AbstractAddressBook::AbstractAddressBook()
AbstractAddressBook::~AbstractAddressBook()
{
}
bool AbstractAddressBook::selectAddressBook()
......@@ -135,4 +134,3 @@ void AbstractAddressBook::cleanUp()
{
mCollection = Akonadi::Collection();
}
......@@ -24,18 +24,15 @@
#include "abstractbase.h"
#include "libimportwizard_export.h"
namespace KContacts
{
namespace KContacts {
class Addressee;
class ContactGroup;
}
class KJob;
namespace LibImportWizard
{
namespace LibImportWizard {
class AbstractDisplayInfo;
class LIBIMPORTWIZARD_EXPORT AbstractAddressBook: public LibImportWizard::AbstractBase
class LIBIMPORTWIZARD_EXPORT AbstractAddressBook : public LibImportWizard::AbstractBase
{
Q_OBJECT
public:
......
......@@ -62,4 +62,3 @@ void AbstractBase::slotCreateResourceInfo(const QString &msg)
{
addImportInfo(msg);
}
......@@ -26,13 +26,11 @@
#include <QMap>
#include <QVariant>
namespace PimCommon
{
namespace PimCommon {
class CreateResource;
}
namespace LibImportWizard
{
namespace LibImportWizard {
class AbstractDisplayInfo;
class LIBIMPORTWIZARD_EXPORT AbstractBase : public QObject
{
......
......@@ -23,8 +23,7 @@
#include "abstractbase.h"
#include "libimportwizard_export.h"
#include <QString>
namespace LibImportWizard
{
namespace LibImportWizard {
class LIBIMPORTWIZARD_EXPORT AbstractCalendar : public LibImportWizard::AbstractBase
{
Q_OBJECT
......
......@@ -19,12 +19,10 @@
#include "abstractdisplayinfo.h"
using namespace LibImportWizard;
AbstractDisplayInfo::AbstractDisplayInfo()
{
}
void AbstractDisplayInfo::calendarImportError(const QString &log)
......
......@@ -24,13 +24,11 @@
#include <QString>
class QWidget;
namespace MailImporter
{
namespace MailImporter {
class Filter;
}
namespace LibImportWizard
{
namespace LibImportWizard {
class LIBIMPORTWIZARD_EXPORT AbstractDisplayInfo
{
public:
......
......@@ -34,9 +34,9 @@
using namespace LibImportWizard;
AbstractImporter::AbstractImporter(QObject *parent)
: QObject(parent),
mAbstractDisplayInfo(nullptr),
mParentWidget(nullptr)
: QObject(parent)
, mAbstractDisplayInfo(nullptr)
, mParentWidget(nullptr)
{
}
......
......@@ -22,14 +22,12 @@
#include <MailCommon/FilterImporterExporter>
#include "libimportwizard_export.h"
namespace MailImporter
{
namespace MailImporter {
class FilterInfo;
class Filter;
}
namespace MailCommon
{
namespace MailCommon {
class MailFilter;
class FilterImporterExporter;
}
......@@ -79,7 +77,6 @@ public:
void setAbstractDisplayInfo(AbstractDisplayInfo *info);
protected:
void initializeFilter(MailImporter::Filter &filter);
......@@ -97,4 +94,3 @@ protected:
}
#endif /* AbstractImporter_H */
......@@ -20,7 +20,6 @@
#include "abstract/abstractdisplayinfo.h"
#include "importsettingpage.h"
#include <KIdentityManagement/kidentitymanagement/identitymanager.h>
#include <KIdentityManagement/kidentitymanagement/identity.h>
#include <mailtransport/transportmanager.h>
......
......@@ -25,15 +25,12 @@
#include <KSharedConfig>
#include <QMap>
namespace KIdentityManagement
{
namespace KIdentityManagement {
class Identity;
class IdentityManager;
}
namespace MailTransport
{
namespace MailTransport {
class Transport;
}
......
......@@ -20,9 +20,9 @@
#include "importaddressbookpage.h"
#include "ui_importaddressbookpage.h"
ImportAddressbookPage::ImportAddressbookPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::ImportAddressbookPage)
ImportAddressbookPage::ImportAddressbookPage(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ImportAddressbookPage)
{
ui->setupUi(this);
connect(ui->importAddressBook, &QPushButton::clicked, this, &ImportAddressbookPage::importAddressbookClicked);
......@@ -47,4 +47,3 @@ void ImportAddressbookPage::setImportButtonEnabled(bool enabled)
{
ui->importAddressBook->setEnabled(enabled);
}
......@@ -22,8 +22,7 @@
#include <QWidget>
namespace Ui
{
namespace Ui {
class ImportAddressbookPage;
}
......
......@@ -20,9 +20,9 @@
#include "importcalendarpage.h"
#include "ui_importcalendarpage.h"
ImportCalendarPage::ImportCalendarPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::ImportCalendarPage)
ImportCalendarPage::ImportCalendarPage(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ImportCalendarPage)
{
ui->setupUi(this);
connect(ui->importCalendar, &QPushButton::clicked, this, &ImportCalendarPage::importCalendarClicked);
......@@ -47,4 +47,3 @@ void ImportCalendarPage::setImportButtonEnabled(bool enabled)
{
ui->importCalendar->setEnabled(enabled);
}
......@@ -22,8 +22,7 @@
#include <QWidget>
namespace Ui
{
namespace Ui {
class ImportCalendarPage;
}
......
......@@ -28,8 +28,8 @@
#include <QListWidgetItem>
ImportFilterInfoGui::ImportFilterInfoGui(ImportMailPage *parent)
: MailImporter::FilterInfoGui(),
m_parent(parent)
: MailImporter::FilterInfoGui()
, m_parent(parent)
{
}
......@@ -58,13 +58,13 @@ void ImportFilterInfoGui::setCurrent(const QString &current)
qApp->processEvents();
}
void ImportFilterInfoGui::setCurrent(int percent)
void ImportFilterInfoGui::setCurrent(int percent)
{
m_parent->mailWidget()->setCurrent(percent);
qApp->processEvents(); // Be careful - back & finish buttons disabled, so only user event that can happen is cancel/close button
}
void ImportFilterInfoGui::setOverall(int percent)
void ImportFilterInfoGui::setOverall(int percent)
{
m_parent->mailWidget()->setOverall(percent);
}
......@@ -101,4 +101,3 @@ QWidget *ImportFilterInfoGui::parent() const
{
return m_parent;
}
......@@ -39,11 +39,10 @@ public:
void addInfoLogEntry(const QString &log) Q_DECL_OVERRIDE;
void clear() Q_DECL_OVERRIDE;
void alert(const QString &message) Q_DECL_OVERRIDE;
QWidget *parent() const Q_DECL_OVERRIDE;
QWidget *parent() const Q_DECL_OVERRIDE;
private:
ImportMailPage *m_parent;
};
#endif /* IMPORTFILTERINFOGUI_H */
......@@ -19,9 +19,9 @@
#include "importfilterpage.h"
#include "ui_importfilterpage.h"
ImportFilterPage::ImportFilterPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::ImportFilterPage)
ImportFilterPage::ImportFilterPage(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ImportFilterPage)
{
ui->setupUi(this);
connect(ui->importFilters, &QPushButton::clicked, this, &ImportFilterPage::importFiltersClicked);
......@@ -46,4 +46,3 @@ void ImportFilterPage::setImportButtonEnabled(bool enabled)
{
ui->importFilters->setEnabled(enabled);
}
......@@ -22,8 +22,7 @@
#include <QWidget>
namespace Ui
{
namespace Ui {
class ImportFilterPage;
}
......
......@@ -20,9 +20,9 @@
#include "importfinishpage.h"
#include "ui_importfinishpage.h"
ImportFinishPage::ImportFinishPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::ImportFinishPage)
ImportFinishPage::ImportFinishPage(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ImportFinishPage)
{
ui->setupUi(this);
}
......@@ -41,4 +41,3 @@ void ImportFinishPage::addImportError(const QString &log)
{
ui->logFinish->addErrorLogEntry(log);
}
......@@ -21,8 +21,7 @@
#include <QWidget>
namespace Ui
{
namespace Ui {
class ImportFinishPage;
}
......
......@@ -20,9 +20,9 @@
#include "importmailpage.h"
#include "ui_importmailpage.h"
ImportMailPage::ImportMailPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::ImportMailPage)
ImportMailPage::ImportMailPage(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ImportMailPage)
{
ui->setupUi(this);
connect(ui->importMails, &QPushButton::clicked, this, &ImportMailPage::importMailsClicked);
......@@ -53,4 +53,3 @@ void ImportMailPage::setImportButtonEnabled(bool enabled)
{
ui->importMails->setEnabled(enabled);
}
......@@ -22,18 +22,15 @@
#include <QWidget>
namespace Ui
{
namespace Ui {
class ImportMailPage;
}
namespace Akonadi
{
namespace Akonadi {
class Collection;
}
namespace MailImporter
{
namespace MailImporter {
class ImportMailsWidget;
}
......
......@@ -20,9 +20,9 @@
#include "importsettingpage.h"
#include "ui_importsettingpage.h"
ImportSettingPage::ImportSettingPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::ImportSettingPage)
ImportSettingPage::ImportSettingPage(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ImportSettingPage)
{
ui->setupUi(this);
connect(ui->importSettings, &QPushButton::clicked, this, &ImportSettingPage::importSettingsClicked);
......@@ -47,4 +47,3 @@ void ImportSettingPage::setImportButtonEnabled(bool enabled)
{
ui->importSettings->setEnabled(enabled);
}
......@@ -22,8 +22,7 @@
#include <QWidget>
namespace Ui
{
namespace Ui {
class ImportSettingPage;
}
......
......@@ -126,5 +126,4 @@ void ImportWizardUtil::storeInKWallet(const QString &name, ImportWizardUtil::Res
}
}
delete wallet;
}
......@@ -27,12 +27,12 @@
struct LIBIMPORTWIZARD_EXPORT ldapStruct {
ldapStruct()
: maxHint(-1),
port(-1),
limit(-1),
timeout(-1),
useSSL(false),
useTLS(false)
: maxHint(-1)
, port(-1)
, limit(-1)
, timeout(-1)
, useSSL(false)
, useTLS(false)
{
}
......@@ -48,7 +48,6 @@ struct LIBIMPORTWIZARD_EXPORT ldapStruct {
int timeout;
bool useSSL;
bool useTLS;
};
struct tagStruct {
......@@ -57,8 +56,7 @@ struct tagStruct {
};
Q_DECLARE_TYPEINFO(tagStruct, Q_MOVABLE_TYPE);
namespace ImportWizardUtil
{
namespace ImportWizardUtil {
enum ResourceType {
Imap,
Pop3,
......
......@@ -19,9 +19,9 @@
#include "selectcomponentpage.h"
#include "ui_selectcomponentpage.h"
SelectComponentPage::SelectComponentPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::SelectComponentPage)
SelectComponentPage::SelectComponentPage(QWidget *parent)
: QWidget(parent)
, ui(new Ui::SelectComponentPage)
{
ui->setupUi(this);
connect(ui->everything, &QCheckBox::clicked, this, &SelectComponentPage::slotEverythingClicked);
......@@ -39,7 +39,8 @@ SelectComponentPage::~SelectComponentPage()
void SelectComponentPage::slotComponentClicked()
{
const bool componentSelected = (ui->addressbooks->isChecked() || ui->filters->isChecked() || ui->mails->isChecked() || ui->settings->isChecked() || ui->calendars->isChecked() || ui->everything->isChecked());
const bool componentSelected
= (ui->addressbooks->isChecked() || ui->filters->isChecked() || ui->mails->isChecked() || ui->settings->isChecked() || ui->calendars->isChecked() || ui->everything->isChecked());
Q_EMIT atLeastOneComponentSelected(componentSelected);
}
......@@ -84,4 +85,3 @@ LibImportWizard::AbstractImporter::TypeSupportedOptions SelectComponentPage::sel
return newOptions;
}
}
......@@ -22,8 +22,7 @@
#include <QWidget>
#include "abstract/abstractimporter.h"
namespace Ui
{
namespace Ui {
class SelectComponentPage;
}
......
......@@ -20,9 +20,9 @@
#include "selectprogrampage.h"
#include "ui_selectprogrampage.h"
SelectProgramPage::SelectProgramPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::SelectProgramPage)
SelectProgramPage::SelectProgramPage(QWidget *parent)
: QWidget(parent)
, ui(new Ui::SelectProgramPage)
{
ui->setupUi(this);
connect(ui->listProgramFound, &QListWidget::itemSelectionChanged, this, &SelectProgramPage::slotItemSelectionChanged);
......
......@@ -24,8 +24,7 @@
class QListWidgetItem;
namespace Ui
{
namespace Ui {
class SelectProgramPage;
}
......
......@@ -23,16 +23,15 @@
#include <QPainter>
SelectProgramListWidget::SelectProgramListWidget(QWidget *parent)
: QListWidget(parent),
mNoProgramFound(false)
: QListWidget(parent)
, mNoProgramFound(false)
{
}
SelectProgramListWidget::~SelectProgramListWidget()
{
}
void SelectProgramListWidget::setNoProgramFound(bool noProgramFound)
{
mNoProgramFound = noProgramFound;
......@@ -48,7 +47,7 @@ void SelectProgramListWidget::generalPaletteChanged()
void SelectProgramListWidget::paintEvent(QPaintEvent *event)
{
if (mNoProgramFound && (!model() || model()->rowCount() == 0)) {
if (mNoProgramFound && (!model() || model()->rowCount() == 0)) {
QPainter p(viewport());
QFont font = p.font();
......@@ -65,4 +64,3 @@ void SelectProgramListWidget::paintEvent(QPaintEvent *event)
QListWidget::paintEvent(event);
}
}
......@@ -21,60 +21,73 @@
#define _HELPER_H
#include <qglobal.h>
#if QT_VERSION < QT_VERSION_CHECK(5,7,0)
template <typename... Args>
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
template<typename ... Args>
struct QNonConstOverload
{
template <typename R, typename T>
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...)) const Q_DECL_NOTHROW -> decltype(ptr)
{ return ptr; }
template<typename R, typename T>
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args ...)) const Q_DECL_NOTHROW->decltype(ptr)
{
return ptr;
}
template <typename R, typename T>
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
{ return ptr; }
template<typename R, typename T>
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args ...)) Q_DECL_NOTHROW->decltype(ptr)
{
return ptr;
}
};
template <typename... Args>
template<typename ... Args>
struct QConstOverload
{
template <typename R, typename T>
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...) const) const Q_DECL_NOTHROW -> decltype(ptr)
{ return ptr; }
template<typename R, typename T>
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args ...) const) const Q_DECL_NOTHROW->decltype(ptr)
{
return ptr;
}
template <typename R, typename T>
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...) const) Q_DECL_NOTHROW -> decltype(ptr)
{ return ptr; }
template<typename R, typename T>
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args ...) const) Q_DECL_NOTHROW->decltype(ptr)
{
return ptr;
}
};
template <typename... Args>
struct QOverload : QConstOverload<Args...>, QNonConstOverload<Args...>
template<typename ... Args>
struct QOverload : QConstOverload<Args ...>, QNonConstOverload<Args ...>
{
using QConstOverload<Args...>::of;
using QConstOverload<Args...>::operator();
using QNonConstOverload<Args...>::of;
using QNonConstOverload<Args...>::operator();
using QConstOverload<Args ...>::of;
using QConstOverload<Args ...>::operator();
using QNonConstOverload<Args ...>::of;
using QNonConstOverload<Args ...>::operator();
template <typename R>
Q_DECL_CONSTEXPR auto operator()(R (*ptr)(Args...)) const Q_DECL_NOTHROW -> decltype(ptr)
{ return ptr; }
template<typename R>
Q_DECL_CONSTEXPR auto operator()(R (*ptr)(Args ...)) const Q_DECL_NOTHROW->decltype(ptr)
{
return ptr;
}
template <typename R>