Commit d24a917f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code

parent 2efa4d16
Pipeline #32692 passed with stage
in 37 minutes and 11 seconds
......@@ -53,7 +53,6 @@ static QDBusInterface *searchEkigaDBusInterface()
QEkigaDialer::QEkigaDialer(const QString &applicationName)
: QDialer(applicationName)
, mInterface(nullptr)
{
}
......
......@@ -54,7 +54,6 @@ static QDBusInterface *searchSkypeDBusInterface()
QSkypeDialer::QSkypeDialer(const QString &applicationName)
: QDialer(applicationName)
, mInterface(nullptr)
{
}
......
......@@ -36,8 +36,6 @@ public:
Private(AkonadiContactEditor::Mode mode, AkonadiContactEditor::DisplayMode displayMode, ContactEditor::AbstractContactEditorWidget *editorWidget, AkonadiContactEditor *parent)
: mParent(parent)
, mMode(mode)
, mMonitor(nullptr)
, mReadOnly(false)
{
if (editorWidget) {
mEditorWidget = editorWidget;
......
......@@ -33,7 +33,6 @@ class Q_DECL_HIDDEN ContactEditorDialog::Private
public:
Private(ContactEditorDialog::Mode mode, ContactEditorDialog::DisplayMode displaymode, ContactEditor::AbstractContactEditorWidget *editorWidget, ContactEditorDialog *parent)
: q(parent)
, mAddressBookBox(nullptr)
, mMode(mode)
{
QWidget *mainWidget = new QWidget(q);
......@@ -124,7 +123,7 @@ public:
group.sync();
}
ContactEditorDialog *q;
ContactEditorDialog *const q;
CollectionComboBox *mAddressBookBox = nullptr;
ContactEditorDialog::Mode mMode;
AkonadiContactEditor *mEditor = nullptr;
......
......@@ -33,10 +33,7 @@ class Q_DECL_HIDDEN ContactGroupEditorDialog::Private
public:
Private(ContactGroupEditorDialog *qq, ContactGroupEditorDialog::Mode mode)
: q(qq)
, mAddressBookBox(nullptr)
, mEditor(nullptr)
, mMode(mode)
, okButton(nullptr)
{
}
......@@ -65,7 +62,7 @@ public:
group.sync();
}
ContactGroupEditorDialog *q;
ContactGroupEditorDialog *const q;
CollectionComboBox *mAddressBookBox = nullptr;
ContactGroupEditor *mEditor = nullptr;
ContactGroupEditorDialog::Mode mMode;
......
......@@ -20,17 +20,11 @@
using namespace Akonadi;
struct GroupMember {
GroupMember()
: isReference(false)
, loadingError(false)
{
}
KContacts::ContactGroup::ContactReference reference;
KContacts::ContactGroup::Data data;
KContacts::Addressee referencedContact;
bool isReference;
bool loadingError;
bool isReference = false;
bool loadingError = false;
};
class Q_DECL_HIDDEN ContactGroupModel::Private
......
......@@ -34,8 +34,6 @@ class Q_DECL_HIDDEN ContactGroupViewer::Private
public:
Private(ContactGroupViewer *parent)
: mParent(parent)
, mExpandJob(nullptr)
, mParentCollectionFetchJob(nullptr)
{
mBrowser = new TextBrowser;
......
......@@ -25,15 +25,13 @@ class Q_DECL_HIDDEN ContactsFilterProxyModel::Private
public:
Private()
: flags({})
, matchFilterFlag(ContactsFilterProxyModel::MatchFilterContactFlag::All)
, mExcludeVirtualCollections(false)
{
}
QString mFilter;
ContactsFilterProxyModel::FilterFlags flags;
ContactsFilterProxyModel::MatchFilterContactFlag matchFilterFlag;
bool mExcludeVirtualCollections;
ContactsFilterProxyModel::MatchFilterContactFlag matchFilterFlag = ContactsFilterProxyModel::MatchFilterContactFlag::All;
bool mExcludeVirtualCollections = false;
};
ContactsFilterProxyModel::ContactsFilterProxyModel(QObject *parent)
......
......@@ -229,7 +229,7 @@ public:
QMetaObject::Connection mCollectionFetchJobConnection;
KContacts::Addressee mCurrentContact;
Item mCurrentItem;
ContactViewer *mParent = nullptr;
ContactViewer *const mParent;
TextBrowser *mBrowser = nullptr;
AbstractContactFormatter *mContactFormatter = nullptr;
AbstractContactFormatter *mStandardContactFormatter = nullptr;
......
......@@ -26,7 +26,6 @@ class Q_DECL_HIDDEN ContactViewerDialog::Private
public:
Private(ContactViewerDialog *parent)
: q(parent)
, mViewer(nullptr)
{
}
......@@ -48,7 +47,7 @@ public:
group.sync();
}
ContactViewerDialog *q = nullptr;
ContactViewerDialog *const q;
ContactViewer *mViewer = nullptr;
};
......
......@@ -22,13 +22,12 @@ class Q_DECL_HIDDEN Akonadi::EmailAddressRequester::Private
public:
Private(EmailAddressRequester *qq)
: q(qq)
, mLineEdit(nullptr)
{
}
void slotAddressBook();
EmailAddressRequester *q = nullptr;
EmailAddressRequester *const q;
KLineEdit *mLineEdit = nullptr;
};
......
......@@ -64,7 +64,7 @@ public:
group.writeEntry("Size", q->size());
}
EmailAddressSelectionDialog *q = nullptr;
EmailAddressSelectionDialog *const q;
RecipientsPickerWidget *mView = nullptr;
};
......
......@@ -59,7 +59,7 @@ protected:
}
private:
QWidget *mReceiver = nullptr;
QWidget *const mReceiver;
};
/**
......
......@@ -122,7 +122,7 @@ public:
q->emitResult();
}
AddContactJob *q = nullptr;
AddContactJob *const q;
KContacts::Addressee mContact;
QWidget *mParentWidget = nullptr;
Akonadi::Collection mCollection;
......
......@@ -264,7 +264,7 @@ public:
}
}
AddEmailAddressJob *q = nullptr;
AddEmailAddressJob *const q;
QString mCompleteAddress;
QString mEmail;
QString mName;
......
......@@ -36,8 +36,6 @@ public:
: q(qq)
, mCompleteAddress(emailString)
, mParentWidget(parentWidget)
, mShowAsHTML(false)
, mRemoteContent(false)
{
KContacts::Addressee::parseEmailAddress(emailString, mName, mEmail);
}
......@@ -251,13 +249,13 @@ public:
q->emitResult();
}
AddEmailDisplayJob *q = nullptr;
AddEmailDisplayJob *const q;
Akonadi::Item contact;
Akonadi::Item::Id messageId;
QString mCompleteAddress;
QString mEmail;
QString mName;
QWidget *mParentWidget = nullptr;
QWidget *const mParentWidget;
bool mShowAsHTML = false;
bool mRemoteContent = false;
};
......
......@@ -80,11 +80,11 @@ public:
q->emitResult();
}
OpenEmailAddressJob *q = nullptr;
OpenEmailAddressJob *const q;
QString mCompleteAddress;
QString mEmail;
QString mName;
QWidget *mParentWidget = nullptr;
QWidget *const mParentWidget;
};
OpenEmailAddressJob::OpenEmailAddressJob(const QString &email, QWidget *parentWidget, QObject *parent)
......
......@@ -18,17 +18,16 @@ class Q_DECL_HIDDEN LeafExtensionProxyModel::Private
public:
Private(LeafExtensionProxyModel *qq)
: q(qq)
, mUniqueKeyCounter(0)
{
}
void sourceRowsInserted(const QModelIndex &parentIndex, int start, int end);
void sourceRowsRemoved(const QModelIndex &parentIndex, int start, int end);
LeafExtensionProxyModel *q = nullptr;
LeafExtensionProxyModel *const q;
QMap<qint64, QModelIndex> mParentIndexes;
QSet<QModelIndex> mOwnIndexes;
qint64 mUniqueKeyCounter;
qint64 mUniqueKeyCounter = 0;
};
void LeafExtensionProxyModel::Private::sourceRowsInserted(const QModelIndex &parentIndex, int start, int end)
......
......@@ -34,7 +34,7 @@ public:
writeConfig();
}
SelectAddressBookDialog *q = nullptr;
SelectAddressBookDialog *const q;
void readConfig();
void writeConfig();
};
......
......@@ -32,8 +32,6 @@ public:
Private(KActionCollection *actionCollection, QWidget *parentWidget, StandardContactActionManager *parent)
: mActionCollection(actionCollection)
, mParentWidget(parentWidget)
, mCollectionSelectionModel(nullptr)
, mItemSelectionModel(nullptr)
, mParent(parent)
{
mGenericManager = new StandardActionManager(actionCollection, parentWidget);
......@@ -515,14 +513,14 @@ public:
KMessageBox::error(mParentWidget, i18n("Contact cannot be stored: %1", error), i18n("Failed to store contact"));
}
KActionCollection *mActionCollection = nullptr;
QWidget *mParentWidget = nullptr;
KActionCollection *const mActionCollection;
QWidget *const mParentWidget;
StandardActionManager *mGenericManager = nullptr;
QItemSelectionModel *mCollectionSelectionModel = nullptr;
QItemSelectionModel *mItemSelectionModel = nullptr;
QHash<StandardContactActionManager::Type, QAction *> mActions;
QSet<StandardContactActionManager::Type> mInterceptedActions;
StandardContactActionManager *mParent = nullptr;
StandardContactActionManager *const mParent;
};
StandardContactActionManager::StandardContactActionManager(KActionCollection *actionCollection, QWidget *parent)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment