summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-07-07 22:22:20 (UTC)
committer zautrix <zautrix>2005-07-07 22:22:20 (UTC)
commit876816e6582299d527610e847d259d2be6de403c (patch) (side-by-side diff)
tree6683baf2835672d0d9b28b3cbbf90e84c398b835 /korganizer
parent3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc (diff)
downloadkdepimpi-876816e6582299d527610e847d259d2be6de403c.zip
kdepimpi-876816e6582299d527610e847d259d2be6de403c.tar.gz
kdepimpi-876816e6582299d527610e847d259d2be6de403c.tar.bz2
fixxx
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp64
-rw-r--r--korganizer/koagenda.cpp4
-rw-r--r--korganizer/koagenda.h1
-rw-r--r--korganizer/komonthview.cpp5
4 files changed, 15 insertions, 59 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 426e8f9..2582931 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -104,6 +104,7 @@
#include "koglobals.h"
#include "koviewmanager.h"
#include "koagendaview.h"
+#include "koagenda.h"
#include "kodialogmanager.h"
#include "outgoingdialog.h"
#include "incomingdialog.h"
@@ -663,7 +664,11 @@ void CalendarView::nextConflict( bool all, bool allday )
test->setTagged( false );
test = testlist.next();
}
- QDateTime startDT = QDateTime (mNavigator->selectedDates().first().addDays(1), QTime ( 0,0,0));
+ QTime st ( 0,0,0);
+ if ( mViewManager->currentView() == mViewManager->agendaView() )
+ st = mViewManager->agendaView()->agenda()->getEndTime();
+ //qDebug("time %s ", st.toString().latin1());
+ QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st);
QDateTime conflict;
QDateTime retVal;
bool found = false;
@@ -720,63 +725,6 @@ void CalendarView::nextConflict( bool all, bool allday )
topLevelWidget()->setCaption( i18n("No conflict found") );
qDebug("No conflict found ");
return;
-
-
-
-
-
-#if 0
-
-
- QDate end = start.addDays( 365*2);
- while ( start < end ) {
- QPtrList<Event> eventList = calendar()->events( start );
- Event * ev = eventList.first();
- QPtrList<Event> test = eventList;
- while ( ev ) {
- //qDebug("found %d on %s ", eventList.count(), start.toString().latin1());
- Event * t_ev = test.first();
- QDateTime es = ev->dtStart();
- QDateTime ee = ev->dtEnd();
- if ( ev->doesFloat() )
- ee = ee.addDays( 1 );
- if ( ! all ) {
- if ( ev->doesFloat() != allday )
- t_ev = 0;
- }
- while ( t_ev ) {
- bool skip = false;
- if ( ! all ) {
- if ( t_ev->doesFloat() != allday )
- skip = true;
- }
- if ( !skip && ev != t_ev ) {
- QDateTime ets = t_ev->dtStart();
- QDateTime ete = t_ev->dtEnd();
- if ( t_ev->doesFloat() )
- ete = ete.addDays( 1 );
- //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() );
- if ( es < ete && ets < ee ) {
- if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
- mViewManager->showDayView();
- mNavigator->slotDaySelect( start );
- int hour = es.time().hour();
- if ( ets > es )
- hour = ets.time().hour();
- mViewManager->agendaView()->setStartHour( hour );
- topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) );
- return;
- }
- }
- t_ev = test.next();
- }
- ev = eventList.next();
- }
- start = start.addDays( 1 );
- }
- topLevelWidget()->setCaption( i18n("No conflict found within the next two years") );
- qDebug("No conflict found ");
-#endif
}
void CalendarView::conflictAll()
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index b290020..779f12e 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1633,6 +1633,10 @@ void KOAgenda::setStartHour(int startHour)
int startCell = startHour * mRows / 24;
setContentsPos(0,startCell * gridSpacingY());
}
+QTime KOAgenda::getEndTime()
+{
+ return QTime ( (contentsY ()+viewport()->height())*24/contentsHeight ()+1,0,0);
+}
void KOAgenda::hideUnused()
{
// experimental only
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index 0e3aed8..86cf2f4 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -127,6 +127,7 @@ class KOAgenda : public QScrollView
void restorePosition();
void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; }
void shrinkPixmap();
+ QTime getEndTime();
public slots:
void slotContentMove(int,int);
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 53bbe28..b5a59af 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1840,9 +1840,12 @@ void KOMonthView::doComputeLayoutWeek()
}
int wid = width();//e
int hei = height()-1-mNavigatorBar->height();
+#ifdef DESKTOP_VERSION
if ( !KOPrefs::instance()->mMonthViewWeekRowlayout ) {
daysToShow = 2;
- } else {
+ } else
+#endif
+ {
if ( wid < hei )
daysToShow = 2;
else