summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebookweeklst.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/datebookweeklst.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebookweeklst.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index 771aa00..0555bc7 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -1,16 +1,17 @@
1#include "namespace_hack.h" 1#include "namespace_hack.h"
2#include "datebookweeklst.h" 2#include "datebookweeklst.h"
3 3
4#include "datebook.h" 4#include "datebook.h"
5#include "datebooktypes.h"
5 6
6#include <opie2/odebug.h> 7#include <opie2/odebug.h>
7 8
8#include <qpe/datebookmonth.h> 9#include <qpe/datebookmonth.h>
9#include <qpe/config.h> 10#include <qpe/config.h>
10#include <qpe/ir.h> 11#include <qpe/ir.h>
11#include <qpe/resource.h> 12#include <qpe/resource.h>
12 13
13#include <qlayout.h> 14#include <qlayout.h>
14#include <qtoolbutton.h> 15#include <qtoolbutton.h>
15#include <qtl.h> 16#include <qtl.h>
16 17
@@ -308,25 +309,25 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
308 w=new DateBookWeekLstView(ev2,d.addDays(7),onM,this); 309 w=new DateBookWeekLstView(ev2,d.addDays(7),onM,this);
309 layout->addWidget(w); 310 layout->addWidget(w);
310 connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); 311 connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
311 connect (w, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); 312 connect (w, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
312 connect (w, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); 313 connect (w, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
313 connect (w, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); 314 connect (w, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
314 connect (w, SIGNAL(redraw()), this, SIGNAL(redraw())); 315 connect (w, SIGNAL(redraw()), this, SIGNAL(redraw()));
315 connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); 316 connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
316 connect (w, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), 317 connect (w, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)),
317 this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); 318 this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)));
318} 319}
319 320
320DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, 321DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDBHoliday *newDB,
321 QWidget *parent, 322 QWidget *parent,
322 const char *name ) 323 const char *name )
323 : QWidget( parent, name ), 324 : QWidget( parent, name ),
324 db( newDB ), 325 db( newDB ),
325 startTime( 0 ), 326 startTime( 0 ),
326 ampm( ap ), 327 ampm( ap ),
327 bStartOnMonday(onM) 328 bStartOnMonday(onM)
328{ 329{
329 setFocusPolicy(StrongFocus); 330 setFocusPolicy(StrongFocus);
330 layout = new QVBoxLayout( this ); 331 layout = new QVBoxLayout( this );
331 layout->setMargin(0); 332 layout->setMargin(0);
332 333
@@ -374,31 +375,31 @@ QDate DateBookWeekLst::weekDate() const
374 375
375 // Calculate offset to first day of week. 376 // Calculate offset to first day of week.
376 int dayoffset=d.dayOfWeek(); 377 int dayoffset=d.dayOfWeek();
377 if(bStartOnMonday) dayoffset--; 378 if(bStartOnMonday) dayoffset--;
378 else if( dayoffset == 7 ) 379 else if( dayoffset == 7 )
379 dayoffset = 0; 380 dayoffset = 0;
380 381
381 return d.addDays(-dayoffset); 382 return d.addDays(-dayoffset);
382} 383}
383 384
384void DateBookWeekLst::getEvents() { 385void DateBookWeekLst::getEvents() {
385 QDate start = weekDate(); //date(); 386 QDate start = weekDate(); //date();
386 QDate stop = start.addDays(6); 387 QDate stop = start.addDays(7);
387 QValueList<EffectiveEvent> el = db->getEffectiveEvents(start, stop); 388 QValueList<EffectiveEvent> el = db->getEffectiveEvents(start, stop);
388 389
389 if (view) delete view; 390 if (view) delete view;
390 if (dbl) { 391 if (dbl) {
391 QDate start2=start.addDays(7); 392 QDate start2=start.addDays(8);
392 stop=start2.addDays(6); 393 stop=start2.addDays(7);
393 QValueList<EffectiveEvent> el2 = db->getEffectiveEvents(start2, stop); 394 QValueList<EffectiveEvent> el2 = db->getEffectiveEvents(start2, stop);
394 view=new DateBookWeekLstDblView(el,el2,start,bStartOnMonday,scroll); 395 view=new DateBookWeekLstDblView(el,el2,start,bStartOnMonday,scroll);
395 } else { 396 } else {
396 view=new DateBookWeekLstView(el,start,bStartOnMonday,scroll); 397 view=new DateBookWeekLstView(el,start,bStartOnMonday,scroll);
397 } 398 }
398 399
399 connect (view, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); 400 connect (view, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
400 connect (view, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); 401 connect (view, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
401 connect (view, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); 402 connect (view, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
402 connect (view, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); 403 connect (view, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
403 connect (view, SIGNAL(redraw()), this, SLOT(redraw())); 404 connect (view, SIGNAL(redraw()), this, SLOT(redraw()));
404 connect (view, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); 405 connect (view, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));