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
@@ -101,12 +101,13 @@
#include "koeventviewerdialog.h"
#include "publishdialog.h"
#include "kofilterview.h"
#include "koglobals.h"
#include "koviewmanager.h"
#include "koagendaview.h"
+#include "koagenda.h"
#include "kodialogmanager.h"
#include "outgoingdialog.h"
#include "incomingdialog.h"
#include "datenavigatorcontainer.h"
#include "statusdialog.h"
#include "kdatenavigator.h"
@@ -660,13 +661,17 @@ void CalendarView::nextConflict( bool all, bool allday )
QPtrList<Event> testlist = mCalendar->events();
Event * test = testlist.first();
while ( test ) {
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;
Event * cE = 0;
Event * cE2 = 0;
QPtrList<Event> testlist2 = testlist;
@@ -717,69 +722,12 @@ void CalendarView::nextConflict( bool all, bool allday )
return;
}
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()
{
nextConflict ( true, true );
}
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index b290020..779f12e 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1630,12 +1630,16 @@ QTime KOAgenda::gyToTime(int gy)
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
// return;
KOAgendaItem *item;
for ( item=mUnusedItems.first(); item != 0; item=mUnusedItems.next() ) {
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index 0e3aed8..86cf2f4 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -124,12 +124,13 @@ class KOAgenda : public QScrollView
void finishUpdate();
void printSelection();
void storePosition();
void restorePosition();
void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; }
void shrinkPixmap();
+ QTime getEndTime();
public slots:
void slotContentMove(int,int);
void categoryChanged(Incidence * inc);
void slotClearSelection();
void popupMenu();
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 53bbe28..b5a59af 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1837,15 +1837,18 @@ void KOMonthView::doComputeLayoutWeek()
if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) {
daysToShow = 6;
combinedSatSun = true;
}
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
daysToShow = 3;
}
bool landscape = (daysToShow == 3);