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

Modernize code

parent 0d9426cc
......@@ -260,7 +260,7 @@ AlarmDialog::AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *par
QWidget *suspendBox = new QWidget(topBox);
QHBoxLayout *suspendBoxHBoxLayout = new QHBoxLayout(suspendBox);
suspendBoxHBoxLayout->setContentsMargins(0, 0, 0, 0);
suspendBoxHBoxLayout->setContentsMargins({});
topLayout->addWidget(suspendBox);
QLabel *l = new QLabel(i18nc("@label:spinbox", "Suspend &duration:"), suspendBox);
......
......@@ -221,7 +221,6 @@ void ActionManager::createCalendarAkonadi()
void ActionManager::initActions()
{
QAction *action = nullptr;
/*************************** FILE MENU **********************************/
......@@ -257,6 +256,7 @@ void ActionManager::initActions()
mACollection->addAction(QStringLiteral("import_icalendar"), mImportAction);
connect(mImportAction, &QAction::triggered, this, &ActionManager::file_import);
QAction *action = nullptr;
/** Get Hot New Stuff Action **/
//TODO: Icon
if (KAuthorized::authorize(QStringLiteral("ghns"))) {
......
......@@ -111,7 +111,7 @@ private Q_SLOTS:
}
private:
QAbstractItemModel *mCheckableProxy = nullptr;
QAbstractItemModel *const mCheckableProxy;
};
/**
......@@ -409,7 +409,7 @@ AkonadiCollectionView::AkonadiCollectionView(CalendarView *view, bool hasContext
mManagerShowCollectionProperties = new ManageShowCollectionProperties(this, this);
QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setContentsMargins({});
QLineEdit *searchCol = new QLineEdit(this);
searchCol->setToolTip(i18nc("@info:tooltip", "Set search keyword"));
......
......@@ -135,7 +135,7 @@ CalendarView::CalendarView(QWidget *parent)
mDateChecker = new DateChecker(this);
QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setContentsMargins({});
// create the main layout frames.
mPanner = new QSplitter(Qt::Horizontal, this);
......@@ -157,15 +157,15 @@ CalendarView::CalendarView(QWidget *parent)
mEventViewerBox = new QWidget(mLeftSplitter);
QVBoxLayout *mEventViewerBoxVBoxLayout = new QVBoxLayout(mEventViewerBox);
mEventViewerBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
mEventViewerBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
mEventViewerBoxVBoxLayout->setContentsMargins({});
mEventViewerBoxVBoxLayout->setContentsMargins({});
mEventViewer = new CalendarSupport::IncidenceViewer(mCalendar.data(), mEventViewerBox);
mEventViewer->setObjectName(QStringLiteral("EventViewer"));
mEventViewerBoxVBoxLayout->addWidget(mEventViewer);
QWidget *rightBox = new QWidget(mPanner);
QVBoxLayout *rightBoxVBoxLayout = new QVBoxLayout(rightBox);
rightBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
rightBoxVBoxLayout->setContentsMargins({});
mNavigatorBar = new NavigatorBar(rightBox);
rightBoxVBoxLayout->addWidget(mNavigatorBar);
mRightFrame = new QStackedWidget(rightBox);
......
......@@ -45,7 +45,7 @@ SearchDialog::SearchDialog(CalendarView *calendarview)
// Results list view
QVBoxLayout *layout = new QVBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins({});
listView = new EventViews::ListView(m_calendarview->calendar(), this);
layout->addWidget(listView);
m_ui->listViewFrame->setLayout(layout);
......
......@@ -277,7 +277,7 @@ void KCMDesignerFields::defaults()
void KCMDesignerFields::initGUI()
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins({});
bool noDesigner = QStandardPaths::findExecutable(QStringLiteral("designer")).isEmpty();
......
......@@ -60,7 +60,7 @@ KOrganizerPart::KOrganizerPart(QWidget *parentWidget, QObject *parent, const QVa
QVBoxLayout *topLayout = new QVBoxLayout(canvas);
topLayout->addWidget(mView);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setContentsMargins({});
connect(mView, &CalendarView::incidenceSelected, this, &KOrganizerPart::slotChangeInfo);
......
......@@ -26,7 +26,7 @@ KOPrefsDialogGroupScheduling::KOPrefsDialogGroupScheduling(QWidget *parent)
topTopLayout->addWidget(topFrame);
QGridLayout *topLayout = new QGridLayout(topFrame);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setContentsMargins({});
Korganizer::KPrefsWidBool *useGroupwareBool
= addWidBool(
......@@ -43,7 +43,7 @@ KOPrefsDialogGroupScheduling::KOPrefsDialogGroupScheduling(QWidget *parent)
MailTransport::TransportManagementWidget *tmw
= new MailTransport::TransportManagementWidget(topFrame);
tmw->layout()->setContentsMargins(0, 0, 0, 0);
tmw->layout()->setContentsMargins({});
topLayout->addWidget(tmw, 3, 0, 1, 2);
load();
}
......
......@@ -73,7 +73,7 @@ KOPrefsDialogPlugins::KOPrefsDialogPlugins(QWidget *parent)
QWidget *buttonRow = new QWidget(this);
QBoxLayout *buttonRowLayout = new QHBoxLayout(buttonRow);
buttonRowLayout->setContentsMargins(0, 0, 0, 0);
buttonRowLayout->setContentsMargins({});
mConfigureButton = new QPushButton(buttonRow);
KGuiItem::assign(mConfigureButton, KGuiItem(i18nc("@action:button", "Configure &Plugin..."),
QStringLiteral("configure"), QString(),
......
......@@ -66,7 +66,7 @@ KOPrefsDialogTime::KOPrefsDialogTime(QWidget *parent)
// holiday region selection
QWidget *holidayRegBox = new QWidget(regionalPage);
QHBoxLayout *holidayRegBoxHBoxLayout = new QHBoxLayout(holidayRegBox);
holidayRegBoxHBoxLayout->setContentsMargins(0, 0, 0, 0);
holidayRegBoxHBoxLayout->setContentsMargins({});
holidaysLayout->addWidget(holidayRegBox, 1, 0, 1, 2);
QLabel *holidayLabel = new QLabel(i18nc("@label", "Use holiday region:"), holidayRegBox);
......
......@@ -38,7 +38,7 @@ KOPrefsUserFeedBack::KOPrefsUserFeedBack(QWidget *parent, const QVariantList &ar
about->addAuthor(i18n("Laurent Montel"), QString(), QStringLiteral("montel@kde.org"));
setAboutData(about);
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins({});
mUserFeedbackWidget = new KUserFeedback::FeedbackConfigWidget(this);
connect(mUserFeedbackWidget, &KUserFeedback::FeedbackConfigWidget::configurationChanged, this, &KOPrefsUserFeedBack::markAsChanged);
......
......@@ -46,7 +46,7 @@ KOAgendaView::KOAgendaView(QWidget *parent, bool isSideBySide)
, d(new Private(isSideBySide, this))
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins({});
layout->addWidget(d->mAgendaView);
connect(d->mAgendaView, &EventViews::AgendaView::zoomViewHorizontally,
......
......@@ -16,9 +16,7 @@
*/
ReparentingModel::Node::Node(ReparentingModel &model)
: parent(nullptr)
, personModel(model)
, mIsSourceNode(false)
: personModel(model)
{
}
......
......@@ -47,7 +47,7 @@ public:
QVector<Ptr> children;
Node *parent = nullptr;
ReparentingModel &personModel;
bool mIsSourceNode;
bool mIsSourceNode = false;
};
struct NodeManager {
......
......@@ -21,7 +21,7 @@ MonthView::MonthView(QWidget *parent)
: KOEventView(parent)
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins({});
mMonthView = new EventViews::MonthView(EventViews::MonthView::Visible, this);
mMonthView->setPreferences(KOPrefs::instance()->eventViewsPreferences());
layout->addWidget(mMonthView);
......
......@@ -20,7 +20,7 @@ KOTimelineView::KOTimelineView(QWidget *parent)
: KOEventView(parent)
{
QVBoxLayout *vbox = new QVBoxLayout(this);
vbox->setContentsMargins(0, 0, 0, 0);
vbox->setContentsMargins({});
mTimeLineView = new EventViews::TimelineView(this);
vbox->addWidget(mTimeLineView);
mEventPopup = eventPopup();
......
......@@ -25,7 +25,7 @@ KDateNavigator::KDateNavigator(QWidget *parent)
, mBaseDate(1970, 1, 1)
{
QGridLayout *topLayout = new QGridLayout(this);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setContentsMargins({});
topLayout->setSpacing(0);
mNavigatorBar = new NavigatorBar(this);
......
......@@ -64,7 +64,7 @@ NavigatorBar::NavigatorBar(QWidget *parent) : QWidget(parent)
// set up control frame layout
QHBoxLayout *ctrlLayout = new QHBoxLayout(this);
ctrlLayout->setContentsMargins(0, 0, 0, 0);
ctrlLayout->setContentsMargins({});
ctrlLayout->addWidget(mPrevYear);
ctrlLayout->addWidget(mPrevMonth);
ctrlLayout->addStretch();
......
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