[pim/korganizer] src: Rename monthview to komonthview

Allen Winter <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 134097810689f896692be7403a43443de7fa7fdd by Allen Winter.
Committed on 18/07/2026 at 10:21.
Pushed by winterz into branch 'master'.

Rename monthview to komonthview

for the sake of consistency, to follow the naming convention
of the other KOrganizer view classes.

M  +2    -2    src/CMakeLists.txt
M  +4    -4    src/calendarview.cpp
M  +2    -2    src/koviewmanager.cpp
M  +3    -3    src/koviewmanager.h
R  +33   -38   src/views/monthview/komonthview.cpp [from: src/views/monthview/monthview.cpp - 069% similarity]
R  +3    -6    src/views/monthview/komonthview.h [from: src/views/monthview/monthview.h - 094% similarity]

https://invent.kde.org/pim/korganizer/-/commit/134097810689f896692be7403a43443de7fa7fdd

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7a6811f0e..1eda3dacd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -332,7 +332,7 @@ set(korganizerprivate_LIB_SRCS
     views/agendaview/koagendaview.cpp
     views/journalview/kojournalview.cpp
     views/listview/kolistview.cpp
-    views/monthview/monthview.cpp
+    views/monthview/komonthview.cpp
     views/multiagendaview/multiagendaview.cpp
     views/timelineview/kotimelineview.cpp
     views/todoview/kotodoview.cpp
@@ -370,7 +370,7 @@ set(korganizerprivate_LIB_SRCS
     views/agendaview/koagendaview.h
     views/journalview/kojournalview.h
     views/listview/kolistview.h
-    views/monthview/monthview.h
+    views/monthview/komonthview.h
     views/multiagendaview/multiagendaview.h
     views/timelineview/kotimelineview.h
     views/todoview/kotodoview.h
diff --git a/src/calendarview.cpp b/src/calendarview.cpp
index 1a517379b..35731870c 100644
--- a/src/calendarview.cpp
+++ b/src/calendarview.cpp
@@ -29,7 +29,7 @@
 #include "pimmessagebox.h"
 #include "prefs/koprefs.h"
 #include "views/agendaview/koagendaview.h"
-#include "views/monthview/monthview.h"
+#include "views/monthview/komonthview.h"
 #include "views/todoview/kotodoview.h"
 #include "widgets/navigatorbar.h"
 
@@ -618,7 +618,7 @@ void CalendarView::goSelectADate()
 
 void CalendarView::goNext()
 {
-    if (qobject_cast<MonthView *>(mViewManager->currentView())) {
+    if (qobject_cast<KOMonthView *>(mViewManager->currentView())) {
         const QDate month = mDateNavigatorContainer->monthOfNavigator(0);
         KODayMatrix::MatrixRange const limits = KODayMatrix::matrixLimits(month);
         mDateNavigator->selectNextMonth(month, limits.start, limits.end);
@@ -629,7 +629,7 @@ void CalendarView::goNext()
 
 void CalendarView::goPrevious()
 {
-    if (qobject_cast<MonthView *>(mViewManager->currentView())) {
+    if (qobject_cast<KOMonthView *>(mViewManager->currentView())) {
         const QDate month = mDateNavigatorContainer->monthOfNavigator(0);
         KODayMatrix::MatrixRange const limits = KODayMatrix::matrixLimits(month);
         mDateNavigator->selectPreviousMonth(month, limits.start, limits.end);
@@ -888,7 +888,7 @@ void CalendarView::edit_paste()
 
     const KOrg::BaseView *curView = mViewManager->currentView();
     KOAgendaView *agendaView = mViewManager->agendaView();
-    MonthView *monthView = mViewManager->monthView();
+    KOMonthView *monthView = mViewManager->monthView();
 
     if (!curView) {
         qCWarning(KORGANIZER_LOG) << "No view is selected, can't paste";
diff --git a/src/koviewmanager.cpp b/src/koviewmanager.cpp
index e5be2e696..139fc2ea2 100644
--- a/src/koviewmanager.cpp
+++ b/src/koviewmanager.cpp
@@ -18,7 +18,7 @@
 #include "views/agendaview/koagendaview.h"
 #include "views/journalview/kojournalview.h"
 #include "views/listview/kolistview.h"
-#include "views/monthview/monthview.h"
+#include "views/monthview/komonthview.h"
 #include "views/multiagendaview/multiagendaview.h"
 #include "views/timelineview/kotimelineview.h"
 #include "views/todoview/kotodoview.h"
@@ -447,7 +447,7 @@ void KOViewManager::viewActionEnable(QAction *action)
 void KOViewManager::showMonthView()
 {
     if (!mMonthView) {
-        mMonthView = new KOrg::MonthView(mMainView->viewStack());
+        mMonthView = new KOMonthView(mMainView->viewStack());
         mMonthView->setIdentifier("DefaultMonthView");
         addView(mMonthView);
     }
diff --git a/src/koviewmanager.h b/src/koviewmanager.h
index 959072c6e..3889f9120 100644
--- a/src/koviewmanager.h
+++ b/src/koviewmanager.h
@@ -21,6 +21,7 @@ class CalendarView;
 class KOAgendaView;
 class KOJournalView;
 class KOListView;
+class KOMonthView;
 class KOTimelineView;
 class KOTodoView;
 class KOWhatsNextView;
@@ -28,7 +29,6 @@ namespace KOrg
 {
 class BaseView;
 class MultiAgendaView;
-class MonthView;
 }
 
 namespace Akonadi
@@ -92,7 +92,7 @@ public:
         return mAgendaView;
     }
 
-    KOrg::MonthView *monthView() const
+    KOMonthView *monthView() const
     {
         return mMonthView;
     }
@@ -175,7 +175,7 @@ private:
     KOWhatsNextView *mWhatsNextView = nullptr;
     KOJournalView *mJournalView = nullptr;
     KOTimelineView *mTimelineView = nullptr;
-    KOrg::MonthView *mMonthView = nullptr;
+    KOMonthView *mMonthView = nullptr;
     KOrg::BaseView *mCurrentView = nullptr;
 
     KOrg::BaseView *mLastEventView = nullptr;
diff --git a/src/views/monthview/monthview.cpp b/src/views/monthview/komonthview.cpp
similarity index 69%
rename from src/views/monthview/monthview.cpp
rename to src/views/monthview/komonthview.cpp
index 938f734a0..0fc160cf5 100644
--- a/src/views/monthview/monthview.cpp
+++ b/src/views/monthview/komonthview.cpp
@@ -7,7 +7,7 @@
   SPDX-License-Identifier: GPL-2.0-or-later WITH LicenseRef-Qt-Commercial-exception-1.0
 */
 
-#include "monthview.h"
+#include "komonthview.h"
 #include "koeventpopupmenu.h"
 #include "prefs/koprefs.h"
 
@@ -15,9 +15,7 @@
 
 #include <QVBoxLayout>
 
-using namespace KOrg;
-
-MonthView::MonthView(QWidget *parent)
+KOMonthView::KOMonthView(QWidget *parent)
     : KOEventView(parent)
 {
     auto layout = new QVBoxLayout(this);
@@ -30,7 +28,7 @@ MonthView::MonthView(QWidget *parent)
 
     connect(mMonthView, &EventViews::MonthView::showIncidencePopupSignal, mPopup, &KOEventPopupMenu::showIncidencePopup);
 
-    connect(mMonthView, &EventViews::MonthView::showNewEventPopupSignal, this, &MonthView::showNewEventPopup);
+    connect(mMonthView, &EventViews::MonthView::showNewEventPopupSignal, this, &KOMonthView::showNewEventPopup);
 
     connect(mMonthView, &EventViews::EventView::datesSelected, this, &KOEventView::datesSelected);
 
@@ -60,19 +58,16 @@ MonthView::MonthView(QWidget *parent)
 
     connect(mMonthView, &EventViews::EventView::dissociateOccurrencesSignal, this, &BaseView::dissociateOccurrencesSignal);
 
-    connect(mMonthView, qOverload<>(&EventViews::MonthView::newEventSignal), this, qOverload<>(&KOrg::MonthView::newEventSignal));
+    connect(mMonthView, qOverload<>(&EventViews::MonthView::newEventSignal), this, qOverload<>(&KOMonthView::newEventSignal));
 
-    connect(mMonthView, qOverload<const QDate &>(&EventViews::MonthView::newEventSignal), this, qOverload<const QDate &>(&KOrg::MonthView::newEventSignal));
+    connect(mMonthView, qOverload<const QDate &>(&EventViews::MonthView::newEventSignal), this, qOverload<const QDate &>(&KOMonthView::newEventSignal));
 
-    connect(mMonthView,
-            qOverload<const QDateTime &>(&EventViews::MonthView::newEventSignal),
-            this,
-            qOverload<const QDateTime &>(&KOrg::MonthView::newEventSignal));
+    connect(mMonthView, qOverload<const QDateTime &>(&EventViews::MonthView::newEventSignal), this, qOverload<const QDateTime &>(&KOMonthView::newEventSignal));
 
     connect(mMonthView,
             qOverload<const QDateTime &, const QDateTime &>(&EventViews::MonthView::newEventSignal),
             this,
-            qOverload<const QDateTime &, const QDateTime &>(&KOrg::MonthView::newEventSignal));
+            qOverload<const QDateTime &, const QDateTime &>(&KOMonthView::newEventSignal));
 
     connect(mMonthView, &EventViews::EventView::newTodoSignal, this, &BaseView::newTodoSignal);
 
@@ -81,132 +76,132 @@ MonthView::MonthView(QWidget *parent)
     connect(mMonthView, &EventViews::EventView::newJournalSignal, this, &BaseView::newJournalSignal);
 }
 
-MonthView::~MonthView() = default;
+KOMonthView::~KOMonthView() = default;
 
-CalendarSupport::CalPrinterBase::PrintType MonthView::printType() const
+CalendarSupport::CalPrinterBase::PrintType KOMonthView::printType() const
 {
     return CalendarSupport::CalPrinterBase::Month;
 }
 
-int MonthView::currentDateCount() const
+int KOMonthView::currentDateCount() const
 {
     return mMonthView->currentDateCount();
 }
 
-int MonthView::currentMonth() const
+int KOMonthView::currentMonth() const
 {
     return mMonthView->currentMonth();
 }
 
-KCalendarCore::DateList MonthView::selectedIncidenceDates()
+KCalendarCore::DateList KOMonthView::selectedIncidenceDates()
 {
     return mMonthView->selectedIncidenceDates();
 }
 
-QDateTime MonthView::selectionStart()
+QDateTime KOMonthView::selectionStart()
 {
     return mMonthView->selectionStart();
 }
 
-QDateTime MonthView::selectionEnd()
+QDateTime KOMonthView::selectionEnd()
 {
     return mMonthView->selectionEnd();
 }
 
-bool MonthView::eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay)
+bool KOMonthView::eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay)
 {
     return mMonthView->eventDurationHint(startDt, endDt, allDay);
 }
 
-QDate MonthView::averageDate() const
+QDate KOMonthView::averageDate() const
 {
     return mMonthView->averageDate();
 }
 
-bool MonthView::showSideBar()
+bool KOMonthView::showSideBar()
 {
     return KOPrefs::instance()->monthViewShowSidebar();
 }
 
-void MonthView::setShowSideBar(bool show)
+void KOMonthView::setShowSideBar(bool show)
 {
     KOPrefs::instance()->setMonthViewShowSidebar(show);
 }
 
-bool MonthView::supportsDateRangeSelection()
+bool KOMonthView::supportsDateRangeSelection()
 {
     return mMonthView->supportsDateRangeSelection();
 }
 
-void MonthView::updateView()
+void KOMonthView::updateView()
 {
     mMonthView->updateView();
 }
 
-void MonthView::showIncidences(const Akonadi::Item::List &incidenceList, const QDate &date)
+void KOMonthView::showIncidences(const Akonadi::Item::List &incidenceList, const QDate &date)
 {
     mMonthView->showIncidences(incidenceList, date);
 }
 
-void MonthView::changeIncidenceDisplay(const Akonadi::Item &item, Akonadi::IncidenceChanger::ChangeType changeType)
+void KOMonthView::changeIncidenceDisplay(const Akonadi::Item &item, Akonadi::IncidenceChanger::ChangeType changeType)
 {
     mMonthView->changeIncidenceDisplay(item, changeType);
 }
 
-void MonthView::updateConfig()
+void KOMonthView::updateConfig()
 {
     mMonthView->updateConfig();
 }
 
-int MonthView::maxDatesHint() const
+int KOMonthView::maxDatesHint() const
 {
     return 6 * 7;
 }
 
-Akonadi::Item::List MonthView::selectedIncidences()
+Akonadi::Item::List KOMonthView::selectedIncidences()
 {
     return mMonthView->selectedIncidences();
 }
 
-void MonthView::setTypeAheadReceiver(QObject *o)
+void KOMonthView::setTypeAheadReceiver(QObject *o)
 {
     mMonthView->setTypeAheadReceiver(o);
 }
 
-void MonthView::setDateRange(const QDateTime &start, const QDateTime &end, const QDate &preferredMonth)
+void KOMonthView::setDateRange(const QDateTime &start, const QDateTime &end, const QDate &preferredMonth)
 {
     mMonthView->setDateRange(start, end, preferredMonth);
 }
 
-void MonthView::setModel(QAbstractItemModel *model)
+void KOMonthView::setModel(QAbstractItemModel *model)
 {
     KOEventView::setModel(model);
     mMonthView->setModel(model);
 }
 
-void MonthView::setIncidenceChanger(Akonadi::IncidenceChanger *changer)
+void KOMonthView::setIncidenceChanger(Akonadi::IncidenceChanger *changer)
 {
     mMonthView->setIncidenceChanger(changer);
 }
 
-void MonthView::showDates(const QDate &start, const QDate &end, const QDate &preferredMonth)
+void KOMonthView::showDates(const QDate &start, const QDate &end, const QDate &preferredMonth)
 {
     Q_UNUSED(start)
     Q_UNUSED(end)
     Q_UNUSED(preferredMonth)
 }
 
-void MonthView::calendarAdded(const Akonadi::CollectionCalendar::Ptr &calendar)
+void KOMonthView::calendarAdded(const Akonadi::CollectionCalendar::Ptr &calendar)
 {
     if (calendar && calendar->collection().isValid()) {
         mMonthView->addCalendar(calendar);
     }
 }
 
-void MonthView::calendarRemoved(const Akonadi::CollectionCalendar::Ptr &calendar)
+void KOMonthView::calendarRemoved(const Akonadi::CollectionCalendar::Ptr &calendar)
 {
     if (calendar && calendar->collection().isValid()) {
         mMonthView->removeCalendar(calendar);
     }
 }
-#include "moc_monthview.cpp"
+#include "moc_komonthview.cpp"
diff --git a/src/views/monthview/monthview.h b/src/views/monthview/komonthview.h
similarity index 94%
rename from src/views/monthview/monthview.h
rename to src/views/monthview/komonthview.h
index 62edaa256..23960ad58 100644
--- a/src/views/monthview/monthview.h
+++ b/src/views/monthview/komonthview.h
@@ -15,14 +15,12 @@ namespace EventViews
 {
 class MonthView;
 }
-namespace KOrg
-{
-class MonthView : public KOEventView
+class KOMonthView : public KOEventView
 {
     Q_OBJECT
 public:
-    explicit MonthView(QWidget *parent = nullptr);
-    ~MonthView() override;
+    explicit KOMonthView(QWidget *parent = nullptr);
+    ~KOMonthView() override;
 
     [[nodiscard]] int currentDateCount() const override;
     [[nodiscard]] int currentMonth() const;
@@ -81,4 +79,3 @@ private:
     EventViews::MonthView *mMonthView = nullptr;
     KOEventPopupMenu *mPopup = nullptr;
 };
-}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.