summaryrefslogtreecommitdiff
path: root/core/pim
authorsimon <simon>2002-04-30 14:28:04 (UTC)
committer simon <simon>2002-04-30 14:28:04 (UTC)
commitb7b0040f0a8069d36e3f5ad0bed0ce992dd30780 (patch) (unidiff)
tree39ac29f14f3e2e153af816b7a9f0f2d821bb075a /core/pim
parent972fbb128294c821ff0f13ea59a83edb015d571e (diff)
downloadopie-b7b0040f0a8069d36e3f5ad0bed0ce992dd30780.zip
opie-b7b0040f0a8069d36e3f5ad0bed0ce992dd30780.tar.gz
opie-b7b0040f0a8069d36e3f5ad0bed0ce992dd30780.tar.bz2
- no default args in method impls
- resolved parameter shadowing problem
Diffstat (limited to 'core/pim') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/clickablelabel.cpp6
-rw-r--r--core/pim/datebook/datebookday.cpp8
-rw-r--r--core/pim/datebook/datebookweek.cpp2
-rw-r--r--core/pim/datebook/datebookweeklst.cpp12
-rw-r--r--core/pim/datebook/timepicker.cpp4
5 files changed, 16 insertions, 16 deletions
diff --git a/core/pim/datebook/clickablelabel.cpp b/core/pim/datebook/clickablelabel.cpp
index 1dd0d15..128bebb 100644
--- a/core/pim/datebook/clickablelabel.cpp
+++ b/core/pim/datebook/clickablelabel.cpp
@@ -1,18 +1,18 @@
1#include "clickablelabel.h" 1#include "clickablelabel.h"
2#include <stdio.h> 2#include <stdio.h>
3 3
4ClickableLabel::ClickableLabel(QWidget* parent = 0, 4ClickableLabel::ClickableLabel(QWidget* parent,
5 const char* name = 0, 5 const char* name,
6 WFlags fl = 0) : 6 WFlags fl) :
7 QLabel(parent,name,fl) 7 QLabel(parent,name,fl)
8{ 8{
9 textInverted=false; 9 textInverted=false;
10 isToggle=false; 10 isToggle=false;
11 isDown=false; 11 isDown=false;
12 showState(false); 12 showState(false);
13 setFrameShadow(Sunken); 13 setFrameShadow(Sunken);
14} 14}
15 15
16void ClickableLabel::setToggleButton(bool t) { 16void ClickableLabel::setToggleButton(bool t) {
17 isToggle=t; 17 isToggle=t;
18} 18}
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp
index d5daab2..67a88e9 100644
--- a/core/pim/datebook/datebookday.cpp
+++ b/core/pim/datebook/datebookday.cpp
@@ -476,28 +476,28 @@ DateBookDayWidget::DateBookDayWidget( const EffectiveEvent &e,
476 476
477 text += "<br><b>" + tr("End") + "</b>: "; 477 text += "<br><b>" + tr("End") + "</b>: ";
478 if ( e.endDate() != ev.date() ) { 478 if ( e.endDate() != ev.date() ) {
479 // multi-day event. Show end date 479 // multi-day event. Show end date
480 text += TimeString::longDateString( e.endDate() ); 480 text += TimeString::longDateString( e.endDate() );
481 } else { 481 } else {
482 // Show end time. 482 // Show end time.
483 text += TimeString::timeString( ev.end(), whichClock, FALSE ); 483 text += TimeString::timeString( ev.end(), whichClock, FALSE );
484 } 484 }
485 text += "<br><br>" + strNote; 485 text += "<br><br>" + strNote;
486 setBackgroundMode( PaletteBase ); 486 setBackgroundMode( PaletteBase );
487 487
488 QTime s = ev.start(); 488 QTime start = ev.start();
489 QTime e = ev.end(); 489 QTime end = ev.end();
490 int y = s.hour()*60+s.minute(); 490 int y = start.hour()*60+start.minute();
491 int h = e.hour()*60+e.minute()-y; 491 int h = end.hour()*60+end.minute()-y;
492 int rh = dateBook->dayView()->rowHeight(0); 492 int rh = dateBook->dayView()->rowHeight(0);
493 y = y*rh/60; 493 y = y*rh/60;
494 h = h*rh/60; 494 h = h*rh/60;
495 if ( h < 3 ) 495 if ( h < 3 )
496 h = 3; 496 h = 3;
497 geom.setY( y ); 497 geom.setY( y );
498 geom.setHeight( h ); 498 geom.setHeight( h );
499} 499}
500 500
501DateBookDayWidget::~DateBookDayWidget() 501DateBookDayWidget::~DateBookDayWidget()
502{ 502{
503} 503}
diff --git a/core/pim/datebook/datebookweek.cpp b/core/pim/datebook/datebookweek.cpp
index e9fcc39..6532ba4 100644
--- a/core/pim/datebook/datebookweek.cpp
+++ b/core/pim/datebook/datebookweek.cpp
@@ -603,25 +603,25 @@ QDate DateBookWeek::weekDate() const
603// http://personal.ecu.edu/mccartyr/ISOwdALG.txt 603// http://personal.ecu.edu/mccartyr/ISOwdALG.txt
604// the week number is return, and the year number is returned in year 604// the week number is return, and the year number is returned in year
605// for Instance 2001/12/31 is actually the first week in 2002. 605// for Instance 2001/12/31 is actually the first week in 2002.
606// There is a more mathematical definition, but I will implement it when 606// There is a more mathematical definition, but I will implement it when
607// we are pass our deadline. 607// we are pass our deadline.
608 608
609// For Weeks that start on Sunday... (ahh... home rolled) 609// For Weeks that start on Sunday... (ahh... home rolled)
610// okay, if Jan 1 is on Friday or Saturday, 610// okay, if Jan 1 is on Friday or Saturday,
611// it will go to the pervious 611// it will go to the pervious
612// week... 612// week...
613 613
614bool calcWeek( const QDate &d, int &week, int &year, 614bool calcWeek( const QDate &d, int &week, int &year,
615 bool startOnMonday = false ) 615 bool startOnMonday )
616{ 616{
617 int weekNumber; 617 int weekNumber;
618 int yearNumber; 618 int yearNumber;
619 619
620 // remove a pesky warning, (Optimizations on g++) 620 // remove a pesky warning, (Optimizations on g++)
621 weekNumber = -1; 621 weekNumber = -1;
622 int jan1WeekDay = QDate(d.year(), 1, 1).dayOfWeek(); 622 int jan1WeekDay = QDate(d.year(), 1, 1).dayOfWeek();
623 int dayOfWeek = d.dayOfWeek(); 623 int dayOfWeek = d.dayOfWeek();
624 624
625 if ( !d.isValid() ) 625 if ( !d.isValid() )
626 return false; 626 return false;
627 627
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index 7083bc5..85c745a 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -83,27 +83,27 @@ void DateBookWeekLstHeader::setDate(int y, int m, int d) {
83 QDate new_date(y,m,d); 83 QDate new_date(y,m,d);
84 setDate(new_date); 84 setDate(new_date);
85} 85}
86 86
87void DateBookWeekLstHeader::nextWeek() { 87void DateBookWeekLstHeader::nextWeek() {
88 setDate(date.addDays(7)); 88 setDate(date.addDays(7));
89} 89}
90void DateBookWeekLstHeader::prevWeek() { 90void DateBookWeekLstHeader::prevWeek() {
91 setDate(date.addDays(-7)); 91 setDate(date.addDays(-7));
92} 92}
93 93
94DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM, 94DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM,
95 QWidget* parent = 0, 95 QWidget* parent,
96 const char* name = 0, 96 const char* name,
97 WFlags fl = 0 ) 97 WFlags fl )
98 : DateBookWeekLstDayHdrBase(parent, name, fl) { 98 : DateBookWeekLstDayHdrBase(parent, name, fl) {
99 99
100 date=d; 100 date=d;
101 101
102 static const char *wdays="MTWTFSS"; 102 static const char *wdays="MTWTFSS";
103 char day=wdays[d.dayOfWeek()-1]; 103 char day=wdays[d.dayOfWeek()-1];
104 104
105 label->setText( QString(QChar(day)) + " " + 105 label->setText( QString(QChar(day)) + " " +
106 QString::number(d.day()) ); 106 QString::number(d.day()) );
107 add->setText("+"); 107 add->setText("+");
108 108
109 if (d == QDate::currentDate()) { 109 if (d == QDate::currentDate()) {
@@ -131,27 +131,27 @@ DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM,
131void DateBookWeekLstDayHdr::showDay() { 131void DateBookWeekLstDayHdr::showDay() {
132 emit showDate(date.year(), date.month(), date.day()); 132 emit showDate(date.year(), date.month(), date.day());
133} 133}
134void DateBookWeekLstDayHdr::newEvent() { 134void DateBookWeekLstDayHdr::newEvent() {
135 QDateTime start, stop; 135 QDateTime start, stop;
136 start=stop=date; 136 start=stop=date;
137 start.setTime(QTime(10,0)); 137 start.setTime(QTime(10,0));
138 stop.setTime(QTime(12,0)); 138 stop.setTime(QTime(12,0));
139 139
140 emit addEvent(start,stop,""); 140 emit addEvent(start,stop,"");
141} 141}
142DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, 142DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev,
143 QWidget* parent = 0, 143 QWidget* parent,
144 const char* name = 0, 144 const char* name,
145 WFlags fl = 0) : 145 WFlags fl) :
146 ClickableLabel(parent,name,fl), 146 ClickableLabel(parent,name,fl),
147 event(ev) 147 event(ev)
148{ 148{
149 char s[10]; 149 char s[10];
150 if ( ev.startDate() != ev.date() ) { // multiday event (not first day) 150 if ( ev.startDate() != ev.date() ) { // multiday event (not first day)
151 if ( ev.endDate() == ev.date() ) { // last day 151 if ( ev.endDate() == ev.date() ) { // last day
152 strcpy(s, "__|__"); 152 strcpy(s, "__|__");
153 } else { 153 } else {
154 strcpy(s, " |---"); 154 strcpy(s, " |---");
155 } 155 }
156 } else { 156 } else {
157 sprintf(s,"%.2d:%.2d",ev.start().hour(),ev.start().minute()); 157 sprintf(s,"%.2d:%.2d",ev.start().hour(),ev.start().minute());
diff --git a/core/pim/datebook/timepicker.cpp b/core/pim/datebook/timepicker.cpp
index 9097e1b..43e05ad 100644
--- a/core/pim/datebook/timepicker.cpp
+++ b/core/pim/datebook/timepicker.cpp
@@ -1,23 +1,23 @@
1#include "timepicker.h" 1#include "timepicker.h"
2 2
3#include <qbuttongroup.h> 3#include <qbuttongroup.h>
4#include <qtoolbutton.h> 4#include <qtoolbutton.h>
5#include <qlayout.h> 5#include <qlayout.h>
6#include "clickablelabel.h" 6#include "clickablelabel.h"
7#include <qstring.h> 7#include <qstring.h>
8#include <stdio.h> 8#include <stdio.h>
9 9
10TimePicker::TimePicker(QWidget* parent = 0, const char* name = 0, 10TimePicker::TimePicker(QWidget* parent, const char* name,
11 WFlags fl = 0) : 11 WFlags fl) :
12 QWidget(parent,name,fl) 12 QWidget(parent,name,fl)
13{ 13{
14 QVBoxLayout *vbox=new QVBoxLayout(this); 14 QVBoxLayout *vbox=new QVBoxLayout(this);
15 15
16 ClickableLabel *r; 16 ClickableLabel *r;
17 QString s; 17 QString s;
18 18
19 // Hour Row 19 // Hour Row
20 QWidget *row=new QWidget(this); 20 QWidget *row=new QWidget(this);
21 QHBoxLayout *l=new QHBoxLayout(row); 21 QHBoxLayout *l=new QHBoxLayout(row);
22 vbox->addWidget(row); 22 vbox->addWidget(row);
23 23