Commit ae9ad9dd authored by Laurent Montel's avatar Laurent Montel 😁

Remove deprecated method + use nullptr

parent e24cb1af
......@@ -43,14 +43,14 @@ void AlarmListView::setModel(QAbstractItemModel* model)
QByteArray settings = config.readEntry("ListHead", QByteArray());
if (!settings.isEmpty())
header()->restoreState(settings);
header()->setMovable(true);
header()->setSectionsMovable(true);
header()->setStretchLastSection(false);
header()->setResizeMode(AlarmListModel::TimeColumn, QHeaderView::ResizeToContents);
header()->setResizeMode(AlarmListModel::TimeToColumn, QHeaderView::ResizeToContents);
header()->setResizeMode(AlarmListModel::RepeatColumn, QHeaderView::ResizeToContents);
header()->setResizeMode(AlarmListModel::ColourColumn, QHeaderView::Fixed);
header()->setResizeMode(AlarmListModel::TypeColumn, QHeaderView::Fixed);
header()->setResizeMode(AlarmListModel::TextColumn, QHeaderView::Stretch);
header()->setSectionResizeMode(AlarmListModel::TimeColumn, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(AlarmListModel::TimeToColumn, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(AlarmListModel::RepeatColumn, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(AlarmListModel::ColourColumn, QHeaderView::Fixed);
header()->setSectionResizeMode(AlarmListModel::TypeColumn, QHeaderView::Fixed);
header()->setSectionResizeMode(AlarmListModel::TextColumn, QHeaderView::Stretch);
header()->setStretchLastSection(true); // necessary to ensure ResizeToContents columns do resize to contents!
const int margin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin);
header()->resizeSection(AlarmListModel::ColourColumn, viewOptions().fontMetrics.lineSpacing() * 3 / 4);
......
......@@ -137,8 +137,8 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
mListView->setSelectionMode(QAbstractItemView::ExtendedSelection);
mListView->setSelectionBehavior(QAbstractItemView::SelectRows);
mListView->setTextElideMode(Qt::ElideRight);
mListView->header()->setResizeMode(BirthdayModel::NameColumn, QHeaderView::Stretch);
mListView->header()->setResizeMode(BirthdayModel::DateColumn, QHeaderView::ResizeToContents);
mListView->header()->setSectionResizeMode(BirthdayModel::NameColumn, QHeaderView::Stretch);
mListView->header()->setSectionResizeMode(BirthdayModel::DateColumn, QHeaderView::ResizeToContents);
connect(mListView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &BirthdayDlg::slotSelectionChanged);
mListView->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Select birthdays to set alarms for.<nl/>"
......
......@@ -475,7 +475,7 @@ KADateTime DBusHandler::convertDateTime(const QString& dateTime, const KADateTim
*/
KAEvent::Flags DBusHandler::convertStartFlags(const KADateTime& start, unsigned flags)
{
KAEvent::Flags kaEventFlags = 0;
KAEvent::Flags kaEventFlags = nullptr;
if (flags & REPEAT_AT_LOGIN) kaEventFlags |= KAEvent::REPEAT_AT_LOGIN;
if (flags & BEEP) kaEventFlags |= KAEvent::BEEP;
if (flags & SPEAK) kaEventFlags |= KAEvent::SPEAK;
......
......@@ -603,7 +603,7 @@ void ResourceSelector::showInfo()
name, id, calType, alarmTypeString, storage, location, perms, enabled, std);
// Display the collection information. Because the user requested
// the information, don't raise a KNotify event.
KAMessageBox::information(this, text, QString(), QString(), 0);
KAMessageBox::information(this, text, QString(), QString(), nullptr);
}
}
......
......@@ -246,7 +246,7 @@ QString SpecialActions::postAction() const
KAEvent::ExtraActionOptions SpecialActions::options() const
{
KAEvent::ExtraActionOptions opts = 0;
KAEvent::ExtraActionOptions opts = nullptr;
if (mExecOnDeferral->isChecked()) opts |= KAEvent::ExecPreActOnDeferral;
if (mCancelOnError->isChecked()) opts |= KAEvent::CancelOnPreActError;
if (mDontShowError->isChecked()) opts |= KAEvent::DontShowPreActError;
......
......@@ -40,9 +40,9 @@ TemplateListView::TemplateListView(QWidget* parent)
void TemplateListView::setModel(QAbstractItemModel* model)
{
EventListView::setModel(model);
header()->setMovable(false);
header()->setSectionsMovable(false);
header()->setStretchLastSection(true);
header()->setResizeMode(TEMPLATE_LIST_MODEL::TypeColumn, QHeaderView::Fixed);
header()->setSectionResizeMode(TEMPLATE_LIST_MODEL::TypeColumn, QHeaderView::Fixed);
const int margin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin);
header()->resizeSection(TEMPLATE_LIST_MODEL::TypeColumn, ItemListModel::iconWidth() + 2*margin + 2);
}
......
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