Diffstat (limited to 'core/pim/datebook/datebookday.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookday.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp index 4d64099..751a1da 100644 --- a/core/pim/datebook/datebookday.cpp +++ b/core/pim/datebook/datebookday.cpp | |||
@@ -774,63 +774,65 @@ QDate DateBookDay::findRealStart( int uid, const QDate& isIncluded , DateBookDB | |||
774 | dt = dt.addDays( -1 ); | 774 | dt = dt.addDays( -1 ); |
775 | QValueList<EffectiveEvent> events = db->getEffectiveEvents( dt, dt ); | 775 | QValueList<EffectiveEvent> events = db->getEffectiveEvents( dt, dt ); |
776 | for (QValueList<EffectiveEvent>::Iterator it = events.begin(); it != events.end(); ++it ) { | 776 | for (QValueList<EffectiveEvent>::Iterator it = events.begin(); it != events.end(); ++it ) { |
777 | EffectiveEvent ev = (*it); | 777 | EffectiveEvent ev = (*it); |
778 | if ( uid == ev.event().uid() && ev.start() != QTime(0, 0, 0 ) ) | 778 | if ( uid == ev.event().uid() && ev.start() != QTime(0, 0, 0 ) ) |
779 | return ev.date(); | 779 | return ev.date(); |
780 | } | 780 | } |
781 | }while (doAgain ); | 781 | }while (doAgain ); |
782 | 782 | ||
783 | return fnd; | 783 | return fnd; |
784 | } | 784 | } |
785 | 785 | ||
786 | void DateBookDayWidget::mousePressEvent( QMouseEvent *e ) | 786 | void DateBookDayWidget::mousePressEvent( QMouseEvent *e ) |
787 | { | 787 | { |
788 | DateBookDayWidget *item; | 788 | DateBookDayWidget *item; |
789 | 789 | ||
790 | item = dateBook->getSelectedWidget(); | 790 | item = dateBook->getSelectedWidget(); |
791 | if (item) | 791 | if (item) |
792 | item->update(); | 792 | item->update(); |
793 | 793 | ||
794 | dateBook->setSelectedWidget(this); | 794 | dateBook->setSelectedWidget(this); |
795 | update(); | 795 | update(); |
796 | dateBook->repaint(); | 796 | dateBook->repaint(); |
797 | 797 | ||
798 | Event eve = ev.event(); | ||
799 | |||
798 | QPopupMenu m; | 800 | QPopupMenu m; |
799 | m.insertItem( tr( "Edit" ), 1 ); | 801 | m.insertItem( tr( "Edit" ), 1 ); |
800 | m.insertItem( tr( "Duplicate" ), 4 ); | 802 | m.insertItem( tr( "Duplicate" ), 4 ); |
801 | m.insertItem( tr( "Delete" ), 2 ); | 803 | m.insertItem( tr( "Delete" ), 2 ); |
802 | if(Ir::supported()) m.insertItem( tr( "Beam" ), 3 ); | 804 | if(Ir::supported()) m.insertItem( tr( "Beam" ), 3 ); |
803 | if(Ir::supported() && ev.event().doRepeat() ) m.insertItem( tr( "Beam this occurence"), 5 ); | 805 | if(Ir::supported() && ev.event().doRepeat() ) m.insertItem( tr( "Beam this occurence"), 5 ); |
804 | int r = m.exec( e->globalPos() ); | 806 | int r = m.exec( e->globalPos() ); |
805 | if ( r == 1 ) { | 807 | if ( r == 1 ) { |
806 | emit editMe( ev.event() ); | 808 | emit editMe( eve ); |
807 | } else if ( r == 2 ) { | 809 | } else if ( r == 2 ) { |
808 | emit deleteMe( ev.event() ); | 810 | emit deleteMe( eve ); |
809 | } else if ( r == 3 ) { | 811 | } else if ( r == 3 ) { |
810 | emit beamMe( ev.event() ); | 812 | emit beamMe( eve ); |
811 | } else if ( r == 4 ) { | 813 | } else if ( r == 4 ) { |
812 | emit duplicateMe( ev.event() ); | 814 | emit duplicateMe( eve ); |
813 | } else if ( r == 5 ) { | 815 | } else if ( r == 5 ) { |
814 | // create an Event and beam it... | 816 | // create an Event and beam it... |
815 | /* | 817 | /* |
816 | * Start with the easy stuff. If start and end date is the same we can just use | 818 | * Start with the easy stuff. If start and end date is the same we can just use |
817 | * the values of effective events | 819 | * the values of effective events |
818 | * If it is a multi day event we need to find the real start and end date... | 820 | * If it is a multi day event we need to find the real start and end date... |
819 | */ | 821 | */ |
820 | if ( ev.event().start().date() == ev.event().end().date() ) { | 822 | if ( ev.event().start().date() == ev.event().end().date() ) { |
821 | Event event( ev.event() ); | 823 | Event event( ev.event() ); |
822 | 824 | ||
823 | QDateTime dt( ev.date(), ev.start() ); | 825 | QDateTime dt( ev.date(), ev.start() ); |
824 | event.setStart( dt ); | 826 | event.setStart( dt ); |
825 | 827 | ||
826 | dt.setTime( ev.end() ); | 828 | dt.setTime( ev.end() ); |
827 | event.setEnd( dt ); | 829 | event.setEnd( dt ); |
828 | emit beamMe( event ); | 830 | emit beamMe( event ); |
829 | }else { | 831 | }else { |
830 | /* | 832 | /* |
831 | * at least the the Times are right now | 833 | * at least the the Times are right now |
832 | */ | 834 | */ |
833 | QDateTime start( ev.event().start() ); | 835 | QDateTime start( ev.event().start() ); |
834 | QDateTime end ( ev.event().end () ); | 836 | QDateTime end ( ev.event().end () ); |
835 | 837 | ||
836 | 838 | ||