[korganizer] /: Remove the long dysfunctional timespent view

Volker Krause null at kde.org
Thu Sep 14 07:58:31 UTC 2017


Git commit a5db618d9d30b4cce54f7371634e72526dce963a by Volker Krause.
Committed on 14/09/2017 at 07:58.
Pushed by vkrause into branch 'master'.

Remove the long dysfunctional timespent view

Approved by Laurent on IRC.

M  +2    -4    doc/index.docbook
M  +0    -1    src/CMakeLists.txt
M  +0    -5    src/actionmanager.cpp
M  +1    -2    src/data/korganizer_part.rc
M  +1    -2    src/data/korganizerui.rc
M  +1    -1    src/kodaymatrix.cpp
M  +0    -1    src/kontactplugin/korganizer/journalplugin.cpp
M  +0    -1    src/kontactplugin/korganizer/todoplugin.cpp
M  +0    -18   src/koviewmanager.cpp
M  +0    -3    src/koviewmanager.h
D  +0    -148  src/views/timespentview/kotimespentview.cpp
D  +0    -71   src/views/timespentview/kotimespentview.h

https://commits.kde.org/korganizer/a5db618d9d30b4cce54f7371634e72526dce963a

diff --git a/doc/index.docbook b/doc/index.docbook
index c8a98339..2244c8fb 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -917,7 +917,7 @@ in the toolbar.</para>
 
 </sect2>
 
-<!-- Timespent View-->
+<!-- Timeline View-->
 
 <sect2 id="timeline-view">
 <title>Timeline View</title>
@@ -2761,7 +2761,7 @@ Chol HaMoed.
 <chapter id="reference">
 <title>Reference</title>
 
-<sect1 id="reference-menus"><!--updated to 5.4.40, missing Timespent, Send as iCalendar-->
+<sect1 id="reference-menus"><!--updated to 5.4.40, Send as iCalendar-->
 <title>Menus</title>
 
 <para>When &korganizer; starts, the main &korganizer; window
@@ -3188,8 +3188,6 @@ displayed one per line.</para>
 </listitem>
 </varlistentry>
 
-<!-- missing Timespent-->
-
 <varlistentry id="menu-view-journal">
 <term><inlinemediaobject><imageobject><imagedata
  fileref="journal-new.png"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 98ed15bb..5790cc47 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -191,7 +191,6 @@ set(korganizerprivate_LIB_SRCS
     views/monthview/monthview.cpp
     views/multiagendaview/multiagendaview.cpp
     views/timelineview/kotimelineview.cpp
-    views/timespentview/kotimespentview.cpp
     views/todoview/kotodoview.cpp
     views/whatsnextview/kowhatsnextview.cpp
     )
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index d92a7ba1..7ff830b0 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -382,11 +382,6 @@ void ActionManager::initActions()
     connect(action, &QAction::triggered, mCalendarView->viewManager(),
             &KOViewManager::showTimeLineView);
 
-    action = new QAction(QIcon::fromTheme(QStringLiteral("view-calendar-time-spent")), i18n("Time&spent"), this);
-    mACollection->addAction(QStringLiteral("view_timespent"), action);
-    connect(action, &QAction::triggered, mCalendarView->viewManager(),
-            &KOViewManager::showTimeSpentView);
-
     //~~~~~~~~~~~~~~~~~~~~~~~~~~~ REFRESH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     action = new QAction(i18n("&Refresh"), this);
     mACollection->addAction(QStringLiteral("update"), action);
diff --git a/src/data/korganizer_part.rc b/src/data/korganizer_part.rc
index fa2f5dd7..23dda7d3 100644
--- a/src/data/korganizer_part.rc
+++ b/src/data/korganizer_part.rc
@@ -1,5 +1,5 @@
 <!DOCTYPE gui>
-<gui name="korganizer" version="428" translationDomain="korganizer">
+<gui name="korganizer" version="429" translationDomain="korganizer">
   <MenuBar>
     <Menu name="file"><text>&File</text>
       <Merge/>
@@ -47,7 +47,6 @@
       <Action name="view_todo"/>
       <Action name="view_list"/>
       <Action name="view_whatsnext"/>
-      <Action name="view_timespent"/>
       <Action name="view_journal"/>
       <Merge/>
       <Separator/>
diff --git a/src/data/korganizerui.rc b/src/data/korganizerui.rc
index 1dc3187e..a800169c 100644
--- a/src/data/korganizerui.rc
+++ b/src/data/korganizerui.rc
@@ -1,5 +1,5 @@
 <!DOCTYPE gui>
-<gui name="korganizer" version="430"  translationDomain="korganizer">
+<gui name="korganizer" version="431"  translationDomain="korganizer">
   <MenuBar>
     <Menu name="file"><text>&File</text>
       <Menu name="import"><text>&Import</text>
@@ -33,7 +33,6 @@
       <Action name="view_todo"/>      
       <Action name="view_list"/>
       <Action name="view_whatsnext"/>
-      <Action name="view_timespent"/>
       <Action name="view_journal"/>
       <Merge/>
       <Separator/>
diff --git a/src/kodaymatrix.cpp b/src/kodaymatrix.cpp
index 27bbf4f5..9a23f5f1 100644
--- a/src/kodaymatrix.cpp
+++ b/src/kodaymatrix.cpp
@@ -294,7 +294,7 @@ void KODayMatrix::updateJournals()
   * Although updateTodos() is simpler it has some similarities with updateEvent()
   * but don't bother refactoring them so they share code, there's a bigger fish:
   * Try to refactor updateTodos(), updateEvent(), updateJournals(), monthview,
-  * agenda view, timespent view, timeline view, event list view and todo list view
+  * agenda view, timeline view, event list view and todo list view
   * all these 9 places have incidence listing code in common, maybe it could go
   * to kcal. Ah, and then there's kontact's summary view which still uses
   * the old CPU consuming code.
diff --git a/src/kontactplugin/korganizer/journalplugin.cpp b/src/kontactplugin/korganizer/journalplugin.cpp
index a23db723..cbe50fcb 100644
--- a/src/kontactplugin/korganizer/journalplugin.cpp
+++ b/src/kontactplugin/korganizer/journalplugin.cpp
@@ -104,7 +104,6 @@ QStringList JournalPlugin::invisibleToolbarActions() const
     invisible += QStringLiteral("view_todo");
     invisible += QStringLiteral("view_journal");
     invisible += QStringLiteral("view_timeline");
-    invisible += QStringLiteral("view_timespent");
 
     return invisible;
 }
diff --git a/src/kontactplugin/korganizer/todoplugin.cpp b/src/kontactplugin/korganizer/todoplugin.cpp
index 1ab77961..53a7d03e 100644
--- a/src/kontactplugin/korganizer/todoplugin.cpp
+++ b/src/kontactplugin/korganizer/todoplugin.cpp
@@ -119,7 +119,6 @@ QStringList TodoPlugin::invisibleToolbarActions() const
     invisible += QStringLiteral("view_todo");
     invisible += QStringLiteral("view_journal");
     invisible += QStringLiteral("view_timeline");
-    invisible += QStringLiteral("view_timespent");
 
     return invisible;
 }
diff --git a/src/koviewmanager.cpp b/src/koviewmanager.cpp
index 8259c87a..dc4dac58 100644
--- a/src/koviewmanager.cpp
+++ b/src/koviewmanager.cpp
@@ -37,7 +37,6 @@
 #include "views/monthview/monthview.h"
 #include "views/multiagendaview/multiagendaview.h"
 #include "views/timelineview/kotimelineview.h"
-#include "views/timespentview/kotimespentview.h"
 #include "views/todoview/kotodoview.h"
 #include "views/whatsnextview/kowhatsnextview.h"
 
@@ -63,7 +62,6 @@ KOViewManager::KOViewManager(CalendarView *mainView)
     mTimelineView = nullptr;
     mAgendaViewTabs = nullptr;
     mAgendaViewTabIndex = 0;
-    mTimeSpentView = nullptr;
     mMonthView = nullptr;
     mRangeMode = NO_RANGE;
 }
@@ -96,8 +94,6 @@ void KOViewManager::readSettings(KConfig *config)
         showTodoView();
     } else if (view == QLatin1String("Timeline")) {
         showTimeLineView();
-    } else if (view == QLatin1String("TimeSpent")) {
-        showTimeSpentView();
     } else if (view == QLatin1String("Month")) {
         showMonthView();
     } else {
@@ -140,8 +136,6 @@ void KOViewManager::writeSettings(KConfig *config)
         view = QStringLiteral("Todo");
     } else if (mCurrentView == mTimelineView) {
         view = QStringLiteral("Timeline");
-    } else if (mCurrentView == mTimeSpentView) {
-        view = QStringLiteral("TimeSpent");
     } else if (mCurrentView == mMonthView) {
         view = QStringLiteral("Month");
     } else {
@@ -407,18 +401,6 @@ void KOViewManager::addView(KOrg::BaseView *view, bool isTab)
     }
 }
 
-void KOViewManager::showTimeSpentView()
-{
-    if (!mTimeSpentView) {
-        mTimeSpentView = new KOTimeSpentView(mMainView->viewStack());
-        mTimeSpentView->setCalendar(mMainView->calendar());
-        mTimeSpentView->setIdentifier("DefaultTimeSpentView");
-        addView(mTimeSpentView);
-    }
-    goMenu(true);
-    showView(mTimeSpentView);
-}
-
 void KOViewManager::showMonthView()
 {
     if (!mMonthView) {
diff --git a/src/koviewmanager.h b/src/koviewmanager.h
index 71973e5c..9b854c97 100644
--- a/src/koviewmanager.h
+++ b/src/koviewmanager.h
@@ -38,7 +38,6 @@ class KOAgendaView;
 class KOJournalView;
 class KOListView;
 class KOTimelineView;
-class KOTimeSpentView;
 class KOTodoView;
 class KOWhatsNextView;
 namespace KOrg
@@ -157,7 +156,6 @@ public Q_SLOTS:
     void showAgendaView();
     void showTodoView();
     void showTimeLineView();
-    void showTimeSpentView();
     void showMonthView();
     void showJournalView();
     void showEventView();
@@ -196,7 +194,6 @@ private:
     KOWhatsNextView *mWhatsNextView = nullptr;
     KOJournalView *mJournalView = nullptr;
     KOTimelineView *mTimelineView = nullptr;
-    KOTimeSpentView *mTimeSpentView = nullptr;
     KOrg::MonthView *mMonthView = nullptr;
     KOrg::BaseView *mCurrentView = nullptr;
 
diff --git a/src/views/timespentview/kotimespentview.cpp b/src/views/timespentview/kotimespentview.cpp
deleted file mode 100644
index 5e18261c..00000000
--- a/src/views/timespentview/kotimespentview.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
-  This file is part of KOrganizer.
-
-  Copyright (c) 2007 Bruno Virlet <bruno.virlet at gmail.com>
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License along
-  with this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-  As a special exception, permission is given to link this program
-  with any edition of Qt, and distribute the resulting executable,
-  without including the source code for Qt in the source distribution.
-*/
-
-#include "kotimespentview.h"
-
-#include <EventViews/TimeSpentView>
-#include <Akonadi/Calendar/ETMCalendar>
-#include <CalendarSupport/KCalPrefs>
-#include <CalendarSupport/Utils>
-
-#include <KCalCore/Event>
-
-#include <QVBoxLayout>
-
-KOTimeSpentView::KOTimeSpentView(QWidget *parent)
-    : KOrg::BaseView(parent)
-{
-    mView = new EventViews::TimeSpentView(this);
-    QBoxLayout *topLayout = new QVBoxLayout(this);
-    topLayout->addWidget(mView);
-
-    connect(mView, &EventViews::EventView::incidenceSelected,
-            this, &KOrg::BaseView::incidenceSelected);
-
-    connect(mView, &EventViews::EventView::showIncidenceSignal,
-            this, &KOrg::BaseView::showIncidenceSignal);
-
-    connect(mView, &EventViews::EventView::editIncidenceSignal,
-            this, &KOrg::BaseView::editIncidenceSignal);
-
-    connect(mView, &EventViews::EventView::deleteIncidenceSignal,
-            this, &KOrg::BaseView::deleteIncidenceSignal);
-
-    connect(mView, &EventViews::EventView::cutIncidenceSignal,
-            this, &KOrg::BaseView::cutIncidenceSignal);
-
-    connect(mView, &EventViews::EventView::copyIncidenceSignal,
-            this, &KOrg::BaseView::copyIncidenceSignal);
-
-    connect(mView, &EventViews::EventView::pasteIncidenceSignal,
-            this, &KOrg::BaseView::pasteIncidenceSignal);
-
-    connect(mView, &EventViews::EventView::toggleAlarmSignal,
-            this, &KOrg::BaseView::toggleAlarmSignal);
-
-    connect(mView, &EventViews::EventView::toggleTodoCompletedSignal,
-            this, &KOrg::BaseView::toggleTodoCompletedSignal);
-
-    connect(mView, &EventViews::EventView::copyIncidenceToResourceSignal,
-            this, &KOrg::BaseView::copyIncidenceToResourceSignal);
-
-    connect(mView, &EventViews::EventView::moveIncidenceToResourceSignal,
-            this, &KOrg::BaseView::moveIncidenceToResourceSignal);
-
-    connect(mView, &EventViews::EventView::dissociateOccurrencesSignal,
-            this, &KOrg::BaseView::dissociateOccurrencesSignal);
-
-    connect(mView, SIGNAL(newEventSignal()),
-            SIGNAL(newEventSignal()));
-
-    connect(mView, SIGNAL(newEventSignal(QDate)),
-            SIGNAL(newEventSignal(QDate)));
-
-    connect(mView, SIGNAL(newEventSignal(QDateTime)),
-            SIGNAL(newEventSignal(QDateTime)));
-
-    connect(mView, SIGNAL(newEventSignal(QDateTime,QDateTime)),
-            SIGNAL(newEventSignal(QDateTime,QDateTime)));
-
-    connect(mView, &EventViews::EventView::newTodoSignal,
-            this, &KOrg::BaseView::newTodoSignal);
-
-    connect(mView, &EventViews::EventView::newSubTodoSignal,
-            this, &KOrg::BaseView::newSubTodoSignal);
-
-    connect(mView, &EventViews::EventView::newJournalSignal,
-            this, &KOrg::BaseView::newJournalSignal);
-}
-
-KOTimeSpentView::~KOTimeSpentView()
-{
-}
-
-int KOTimeSpentView::currentDateCount() const
-{
-    return mView->currentDateCount();
-}
-
-void KOTimeSpentView::showDates(const QDate &start, const QDate &end,
-                                const QDate &dummy)
-{
-    return mView->showDates(start, end, dummy);
-}
-
-void KOTimeSpentView::showIncidences(const Akonadi::Item::List &incidenceList, const QDate &date)
-{
-    Q_UNUSED(incidenceList);
-    Q_UNUSED(date);
-}
-
-void KOTimeSpentView::changeIncidenceDisplay(const Akonadi::Item &,
-        Akonadi::IncidenceChanger::ChangeType)
-{
-    mView->updateView();
-}
-
-void KOTimeSpentView::updateView()
-{
-    mView->updateView();
-}
-
-CalendarSupport::CalPrinterBase::PrintType KOTimeSpentView::printType() const
-{
-    // If up to three days are selected, use day style, otherwise week
-    if (currentDateCount() <= 3) {
-        return CalendarSupport::CalPrinterBase::Day;
-    } else {
-        return CalendarSupport::CalPrinterBase::Week;
-    }
-}
-
-void KOTimeSpentView::setCalendar(const Akonadi::ETMCalendar::Ptr &cal)
-{
-    KOrg::BaseView::setCalendar(cal);
-    mView->setCalendar(cal);
-}
-
diff --git a/src/views/timespentview/kotimespentview.h b/src/views/timespentview/kotimespentview.h
deleted file mode 100644
index 34484a2e..00000000
--- a/src/views/timespentview/kotimespentview.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-  This file is part of KOrganizer.
-
-  Copyright (c) 2007 Bruno Virlet <bruno.virlet at gmail.com>
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License along
-  with this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-  As a special exception, permission is given to link this program
-  with any edition of Qt, and distribute the resulting executable,
-  without including the source code for Qt in the source distribution.
-*/
-
-#ifndef KORG_VIEWS_KOTIMESPENTVIEW_H
-#define KORG_VIEWS_KOTIMESPENTVIEW_H
-
-#include "baseview.h"
-#include <Akonadi/Calendar/ETMCalendar>
-
-namespace EventViews
-{
-class TimeSpentView;
-}
-
-/**
-  This view show the time spent on each category.
-*/
-class KOTimeSpentView : public KOrg::BaseView
-{
-    Q_OBJECT
-public:
-    explicit KOTimeSpentView(QWidget *parent = nullptr);
-    ~KOTimeSpentView();
-
-    int currentDateCount() const override;
-
-    Akonadi::Item::List selectedIncidences() override {
-        return Akonadi::Item::List();
-    }
-
-    KCalCore::DateList selectedIncidenceDates() override {
-        return KCalCore::DateList();
-    }
-
-    void setCalendar(const Akonadi::ETMCalendar::Ptr &cal) override;
-
-public Q_SLOTS:
-    void updateView() override;
-    void showDates(const QDate &start, const QDate &end,
-                   const QDate &preferredMonth = QDate()) override;
-    void showIncidences(const Akonadi::Item::List &incidenceList, const QDate &date) override;
-
-    void changeIncidenceDisplay(const Akonadi::Item &, Akonadi::IncidenceChanger::ChangeType) override;
-    CalendarSupport::CalPrinterBase::PrintType printType() const override;
-
-private:
-    EventViews::TimeSpentView *mView = nullptr;
-};
-
-#endif


More information about the kde-doc-english mailing list