Commit 44959d49 authored by Laurent Montel's avatar Laurent Montel 😁

Modernize code

parent d4907a86
Pipeline #33649 canceled with stage
......@@ -25,7 +25,7 @@ private Q_SLOTS:
private:
Ui::AgentConfigDialog ui;
AgentConfigModel *m_model = nullptr;
AgentConfigModel *const m_model;
Akonadi::AgentInstance m_instance;
};
......
......@@ -201,8 +201,7 @@ public:
};
AkonadiBrowserModel::AkonadiBrowserModel(ChangeRecorder *monitor, QObject *parent)
: EntityTreeModel(monitor, parent),
m_itemDisplayMode(GenericMode)
: EntityTreeModel(monitor, parent)
{
m_genericState = new GenericState();
......
......@@ -50,7 +50,7 @@ private:
State *m_contactsState = nullptr;
State *m_calendarState = nullptr;
ItemDisplayMode m_itemDisplayMode;
ItemDisplayMode m_itemDisplayMode = GenericMode;
};
class AkonadiBrowserSortModel : public QSortFilterProxyModel
......
......@@ -81,11 +81,7 @@ AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionAclPageFactory, CollectionA
Q_DECLARE_METATYPE(QSet<QByteArray>)
BrowserWidget::BrowserWidget(KXmlGuiWindow *xmlGuiWindow, QWidget *parent) :
QWidget(parent),
mAttrModel(nullptr),
mStdActionManager(nullptr),
mMonitor(nullptr),
mCacheOnlyAction(nullptr)
QWidget(parent)
{
Q_ASSERT(xmlGuiWindow);
QVBoxLayout *layout = new QVBoxLayout(this);
......
......@@ -15,8 +15,7 @@
using namespace Akonadi;
CollectionAttributePage::CollectionAttributePage(QWidget *parent) :
CollectionPropertiesPage(parent),
mModel(nullptr)
CollectionPropertiesPage(parent)
{
setPageTitle(QStringLiteral("Attributes"));
ui.setupUi(this);
......
......@@ -12,8 +12,7 @@
#include <QIcon>
DbBrowser::DbBrowser(QWidget *parent) :
QWidget(parent),
mTableModel(nullptr)
QWidget(parent)
{
ui.setupUi(this);
......
......@@ -24,7 +24,6 @@
DbConsole::DbConsole(QWidget *parent)
: QWidget(parent)
, mTabCounter(0)
{
auto l = new QVBoxLayout(this);
......
......@@ -26,7 +26,7 @@ private Q_SLOTS:
void saveQueries();
private:
int mTabCounter;
int mTabCounter = 0;
QTabWidget *mTabWidget = nullptr;
};
......
......@@ -26,8 +26,7 @@
InstanceSelector::InstanceSelector(const QString &remoteHost, QWidget *parent, Qt::WindowFlags flags)
: QDialog(parent, flags),
ui(new Ui::InstanceSelector),
m_remoteHost(remoteHost),
mWindow(nullptr)
m_remoteHost(remoteHost)
{
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
......
......@@ -10,9 +10,7 @@
#include <QDebug>
JobTrackerFilterProxyModel::JobTrackerFilterProxyModel(QObject *parent)
: QSortFilterProxyModel(parent),
mSearchColumn(-1),
mShowOnlyFailed(false)
: QSortFilterProxyModel(parent)
{
setRecursiveFilteringEnabled(true);
setDynamicSortFilter(true);
......
......@@ -24,8 +24,8 @@ protected:
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
private:
int mSearchColumn;
bool mShowOnlyFailed;
int mSearchColumn = -1;
bool mShowOnlyFailed = false;
};
#endif // JOBTRACKERFILTERPROXYMODEL_H
......@@ -16,8 +16,7 @@
Q_DECLARE_METATYPE(Akonadi::NotificationSubscriber)
MonitorsModel::MonitorsModel(QObject *parent):
QAbstractItemModel(parent),
mMonitor(nullptr)
QAbstractItemModel(parent)
{
QTimer::singleShot(0, this, &MonitorsModel::init);
}
......
......@@ -21,8 +21,7 @@ Q_DECLARE_METATYPE(Akonadi::ChangeNotification)
using namespace Akonadi;
NotificationModel::NotificationModel(QObject *parent) :
QAbstractItemModel(parent),
m_monitor(nullptr)
QAbstractItemModel(parent)
{
}
......
......@@ -50,7 +50,7 @@ public:
Akonadi::Protocol::ChangeNotificationPtr notification(const QModelIndex &index) const;
bool isEnabled() const
Q_REQUIRED_RESULT bool isEnabled() const
{
return m_monitor;
}
......
......@@ -38,7 +38,6 @@
SearchWidget::SearchWidget(QWidget *parent)
: QWidget(parent)
, mDatabase(nullptr)
{
Akonadi::ControlGui::widgetNeedsAkonadi(this);
......
......@@ -18,7 +18,6 @@ using namespace Akonadi;
TagPropertiesDialog::TagPropertiesDialog(QWidget *parent)
: QDialog(parent)
, mChanged(false)
{
setupUi();
}
......
......@@ -48,7 +48,7 @@ private:
QStandardItemModel *mAttributesModel = nullptr;
QStandardItemModel *mRemoteIdsModel = nullptr;
bool mChanged;
bool mChanged = false;
QSet<QString> mChangedAttrs;
QSet<QString> mRemovedAttrs;
QSet<QString> mChangedRIDs;
......
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