Commit 242079f0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code

parent 451874ac
Pipeline #100381 passed with stage
in 3 minutes and 52 seconds
......@@ -61,9 +61,7 @@ public:
{
}
~ReminderTreeItem() override
{
}
~ReminderTreeItem() override = default;
bool operator<(const QTreeWidgetItem &other) const override;
......
......@@ -92,9 +92,7 @@ AlarmDockWindow::AlarmDockWindow()
mAutostartSet = autostartSet;
}
AlarmDockWindow::~AlarmDockWindow()
{
}
AlarmDockWindow::~AlarmDockWindow() = default;
void AlarmDockWindow::slotUpdate(int reminders)
{
......
......@@ -711,7 +711,7 @@ void ActionManager::initActions()
void ActionManager::updateHamburgerMenu()
{
QMenu *menu = new QMenu;
auto menu = new QMenu;
menu->addAction(mACollection->action(QStringLiteral("conf_datetime")));
menu->addSeparator();
......@@ -1203,9 +1203,7 @@ QString ActionManager::localFileName() const
class ActionManager::ActionStringsVisitor : public KCalendarCore::Visitor
{
public:
ActionStringsVisitor()
{
}
ActionStringsVisitor() = default;
bool act(KCalendarCore::IncidenceBase::Ptr incidence, QAction *show, QAction *edit, QAction *del)
{
......@@ -1322,7 +1320,7 @@ Akonadi::Collection ActionManager::selectedCollection() const
{
const QModelIndex index = mCollectionView->view()->currentIndex();
if (!index.isValid()) {
return Akonadi::Collection();
return {};
}
return index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
......
......@@ -252,7 +252,7 @@ public:
QVariant data(const QModelIndex &index, int role) const override
{
if (!index.isValid()) {
return QVariant();
return {};
}
if (role == Qt::DecorationRole) {
const Akonadi::Collection collection = CalendarSupport::collectionFromIndex(index);
......
......@@ -1971,7 +1971,7 @@ Akonadi::Item CalendarView::selectedTodo()
if (const KCalendarCore::Todo::Ptr t = CalendarSupport::todo(item)) {
return item;
}
return Akonadi::Item();
return {};
}
void CalendarView::dialogClosing(const Akonadi::Item &)
......@@ -2502,7 +2502,7 @@ Akonadi::Collection CalendarView::defaultCollection(const QLatin1String &mimeTyp
}
// 5. Return a invalid collection, the editor will use the first one in the combo
return Akonadi::Collection();
return {};
}
IncidenceEditorNG::IncidenceDialog *CalendarView::createIncidenceEditor(const Akonadi::Item &item, const Akonadi::Collection &collection)
......
......@@ -68,9 +68,7 @@ public:
class Factory
{
public:
virtual ~Factory()
{
}
virtual ~Factory() = default;
virtual CalendarViewExtension *create(QWidget *parent) = 0;
};
......@@ -99,9 +97,7 @@ public:
class CalendarViewVisitor : public KCalendarCore::Visitor
{
public:
CalendarViewVisitor()
{
}
CalendarViewVisitor() = default;
bool act(KCalendarCore::IncidenceBase::Ptr &incidence, CalendarView *view)
{
......
......@@ -80,9 +80,7 @@ void CollectionGeneralPage::init(const Akonadi::Collection &collection)
}
}
CollectionGeneralPage::~CollectionGeneralPage()
{
}
CollectionGeneralPage::~CollectionGeneralPage() = default;
void CollectionGeneralPage::load(const Akonadi::Collection &collection)
{
......
......@@ -17,9 +17,7 @@ DateChecker::DateChecker(QObject *parent)
enableRollover(FollowMonth);
}
DateChecker::~DateChecker()
{
}
DateChecker::~DateChecker() = default;
void DateChecker::enableRollover(RolloverType r)
{
......
......@@ -19,9 +19,7 @@ DateNavigator::DateNavigator(QObject *parent)
mSelectedDates.append(QDate::currentDate());
}
DateNavigator::~DateNavigator()
{
}
DateNavigator::~DateNavigator() = default;
KCalendarCore::DateList DateNavigator::selectedDates() const
{
......
......@@ -96,9 +96,7 @@ FilterEdit::FilterEdit(QList<KCalendarCore::CalFilter *> *filters, QWidget *pare
connect(mCompletedCheck, &QCheckBox::toggled, mCompletedTimeSpan, &QSpinBox::setEnabled);
}
FilterEdit::~FilterEdit()
{
}
FilterEdit::~FilterEdit() = default;
void FilterEdit::updateFilterList()
{
......
......@@ -21,9 +21,7 @@ KOrganizerIfaceImpl::KOrganizerIfaceImpl(ActionManager *actionManager, QObject *
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Korganizer"), this, QDBusConnection::ExportAdaptors);
}
KOrganizerIfaceImpl::~KOrganizerIfaceImpl()
{
}
KOrganizerIfaceImpl::~KOrganizerIfaceImpl() = default;
bool KOrganizerIfaceImpl::openURL(const QString &url)
{
......
......@@ -28,9 +28,7 @@ public:
identifier = cname + '_' + KRandom::randomString(8).toLatin1();
}
~BaseViewPrivate()
{
}
~BaseViewPrivate() = default;
EventViews::EventView::Changes mChanges;
Akonadi::ETMCalendar::Ptr calendar;
......@@ -66,12 +64,12 @@ Akonadi::ETMCalendar::Ptr BaseView::calendar()
QDateTime BaseView::selectionStart()
{
return QDateTime();
return {};
}
QDateTime BaseView::selectionEnd()
{
return QDateTime();
return {};
}
bool BaseView::isEventView()
......
......@@ -26,9 +26,7 @@ public:
{
}
~CalendarViewBase() override
{
}
~CalendarViewBase() override = default;
virtual Akonadi::ETMCalendar::Ptr calendar() const = 0;
virtual Akonadi::IncidenceChanger *incidenceChanger() const = 0;
......
......@@ -17,13 +17,9 @@ namespace KOrg
class CoreHelper
{
public:
CoreHelper()
{
}
CoreHelper() = default;
virtual ~CoreHelper()
{
}
virtual ~CoreHelper() = default;
virtual QColor categoryColor(const QStringList &cats) = 0;
virtual QString holidayString(const QDate &dt) = 0;
......
......@@ -10,13 +10,9 @@
namespace KOrg
{
MainWindow::MainWindow()
{
}
MainWindow::MainWindow() = default;
MainWindow::~MainWindow()
{
}
MainWindow::~MainWindow() = default;
void MainWindow::init(bool hasDocument)
{
......
......@@ -39,9 +39,7 @@ public:
{
}
~Part() override
{
}
~Part() override = default;
virtual QString info() = 0;
......
......@@ -34,9 +34,7 @@ KOrganizerApp::KOrganizerApp(int &argc, char **argv[])
KCalendarCore::CalFormat::setApplication(QStringLiteral("KOrganizer"), prodId.arg(QStringLiteral(KORGANIZER_VERSION)));
}
KOrganizerApp::~KOrganizerApp()
{
}
KOrganizerApp::~KOrganizerApp() = default;
int KOrganizerApp::activate(const QStringList &args, const QString &workingDir)
{
......
......@@ -27,9 +27,7 @@ KOCore *KOCore::self()
return mSelf;
}
KOCore::KOCore()
{
}
KOCore::KOCore() = default;
KOCore::~KOCore()
{
......
......@@ -18,13 +18,9 @@
class KOCoreHelper : public KOrg::CoreHelper
{
public:
KOCoreHelper()
{
}
KOCoreHelper() = default;
~KOCoreHelper() override
{
}
~KOCoreHelper() override = default;
Q_REQUIRED_RESULT QColor categoryColor(const QStringList &cats) override;
......
......@@ -391,7 +391,7 @@ const QDate &KODayMatrix::getDate(int offset) const
QString KODayMatrix::getHolidayLabel(int offset) const
{
if (offset < 0 || offset > NUMDAYS - 1) {
return QString();
return {};
}
return mHolidays[offset];
}
......
Supports Markdown
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