Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a5db618d authored by Volker Krause's avatar Volker Krause

Remove the long dysfunctional timespent view

Approved by Laurent on IRC.
parent a12f1854
......@@ -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"
......
......@@ -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
)
......
......@@ -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);
......
<!DOCTYPE gui>
<gui name="korganizer" version="428" translationDomain="korganizer">
<gui name="korganizer" version="429" translationDomain="korganizer">
<MenuBar>
<Menu name="file"><text>&amp;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/>
......
<!DOCTYPE gui>
<gui name="korganizer" version="430" translationDomain="korganizer">
<gui name="korganizer" version="431" translationDomain="korganizer">
<MenuBar>
<Menu name="file"><text>&amp;File</text>
<Menu name="import"><text>&amp;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/>
......
......@@ -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.
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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) {
......
......@@ -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;
......
/*
This file is part of KOrganizer.
Copyright (c) 2007 Bruno Virlet <bruno.virlet@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);
}
/*
This file is part of KOrganizer.
Copyright (c) 2007 Bruno Virlet <bruno.virlet@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
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