Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
kdepim4
r893494.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File r893494.diff of Package kdepim4
Subject: korganizer: make paste work on actual selection From: wstephenson@suse.de Bug: kde#175814,kde#132863 Patch-upstream: 893494 --- korganizer/views/monthview/monthview.cpp (revision 893493) +++ korganizer/views/monthview/monthview.cpp (revision 893494) @@ -259,6 +259,25 @@ void MonthView::setStartDate( const QDat reloadIncidences(); } +Incidence::List MonthView::selectedIncidences() +{ + Incidence *incidenceSelected = 0; + Incidence::List selected; + + if ( mScene->selectedItem() ) { + IncidenceMonthItem *tmp = dynamic_cast<IncidenceMonthItem *>( mScene->selectedItem() ); + if ( tmp ) { + incidenceSelected = tmp->incidence(); + + if ( incidenceSelected ) { + selected.append( incidenceSelected ); + } + } + } + + return selected; +} + void MonthView::reloadIncidences() { // keep selection if it exists --- korganizer/views/monthview/monthview.h (revision 893493) +++ korganizer/views/monthview/monthview.h (revision 893494) @@ -48,8 +48,7 @@ class MonthView : public KOEventView ~MonthView(); virtual int currentDateCount(); - virtual Incidence::List selectedIncidences() - { return Incidence::List(); } + Incidence::List selectedIncidences(); /** Returns dates of the currently selected events */ virtual DateList selectedDates(); --- korganizer/calendarview.cpp (revision 893493) +++ korganizer/calendarview.cpp (revision 893494) @@ -833,7 +833,7 @@ void CalendarView::edit_copy() void CalendarView::edit_paste() { -// If in agenda view, use the selected time and date from there. +// If in agenda and month view, use the selected time and date from there. // In all other cases, paste the event on the first day of the // selection in the day matrix on the left @@ -852,7 +852,14 @@ void CalendarView::edit_paste() if ( !aView->selectedIsAllDay() ) { time = aView->selectionStart().time(); } - } else { + } + + MonthView *mView = mViewManager->monthView(); + if ( mView && !mView->selectedDates().isEmpty() ) { + date = mView->selectedDates().first(); + } + + if ( !date.isValid() ) { date = mNavigator->selectedDates().first(); } @@ -1786,9 +1793,10 @@ void CalendarView::showLeftFrame( bool s mLeftFrame->show(); emit calendarViewExpanded( false ); } else { - // splitter sizes of mPanner are useless if mLeftFrame is hidden, so remember them before we hide it - if ( mMainSplitterSizes.isEmpty() ) + // mPanner splitter sizes are useless if mLeftFrame is hidden, so remember them beforehand. + if ( mMainSplitterSizes.isEmpty() ) { mMainSplitterSizes = mPanner->sizes(); + } mLeftFrame->hide(); emit calendarViewExpanded( true ); @@ -2348,7 +2356,7 @@ void CalendarView::moveIncidenceTo( Inci delete oldIncidence; } -bool CalendarView::eventFilter(QObject * watched, QEvent * event) +bool CalendarView::eventFilter( QObject *watched, QEvent *event ) { if ( watched == mLeftFrame && event->type() == QEvent::Show ) { mSplitterSizesValid = true; --- korganizer/koviewmanager.h (revision 893493) +++ korganizer/koviewmanager.h (revision 893494) @@ -89,7 +89,8 @@ class KOViewManager : public QObject QDate currentSelectionDate(); KOAgendaView *agendaView() const { return mAgendaView; } - KOTodoView *todoView() const { return mTodoView; } + KOTodoView *todoView() const { return mTodoView; } + KOrg::MonthView *monthView() const { return mMonthView; } signals: void configChanged(); Index: korganizer/views/monthview/monthview.cpp =================================================================== Index: korganizer/views/monthview/monthview.h =================================================================== Index: korganizer/calendarview.cpp =================================================================== Index: korganizer/koviewmanager.h ===================================================================
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor