author | simon <simon> | 2002-04-30 14:28:04 (UTC) |
---|---|---|
committer | simon <simon> | 2002-04-30 14:28:04 (UTC) |
commit | b7b0040f0a8069d36e3f5ad0bed0ce992dd30780 (patch) (unidiff) | |
tree | 39ac29f14f3e2e153af816b7a9f0f2d821bb075a | |
parent | 972fbb128294c821ff0f13ea59a83edb015d571e (diff) | |
download | opie-b7b0040f0a8069d36e3f5ad0bed0ce992dd30780.zip opie-b7b0040f0a8069d36e3f5ad0bed0ce992dd30780.tar.gz opie-b7b0040f0a8069d36e3f5ad0bed0ce992dd30780.tar.bz2 |
- no default args in method impls
- resolved parameter shadowing problem
-rw-r--r-- | core/pim/datebook/clickablelabel.cpp | 6 | ||||
-rw-r--r-- | core/pim/datebook/datebookday.cpp | 8 | ||||
-rw-r--r-- | core/pim/datebook/datebookweek.cpp | 2 | ||||
-rw-r--r-- | core/pim/datebook/datebookweeklst.cpp | 12 | ||||
-rw-r--r-- | core/pim/datebook/timepicker.cpp | 4 |
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,22 +1,22 @@ | |||
1 | #include "clickablelabel.h" | 1 | #include "clickablelabel.h" |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | 3 | ||
4 | ClickableLabel::ClickableLabel(QWidget* parent = 0, | 4 | ClickableLabel::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 | ||
16 | void ClickableLabel::setToggleButton(bool t) { | 16 | void ClickableLabel::setToggleButton(bool t) { |
17 | isToggle=t; | 17 | isToggle=t; |
18 | } | 18 | } |
19 | 19 | ||
20 | void ClickableLabel::mousePressEvent( QMouseEvent *e ) { | 20 | void ClickableLabel::mousePressEvent( QMouseEvent *e ) { |
21 | if (isToggle && isDown) { | 21 | if (isToggle && isDown) { |
22 | showState(false); | 22 | showState(false); |
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 | |||
@@ -472,36 +472,36 @@ DateBookDayWidget::DateBookDayWidget( const EffectiveEvent &e, | |||
472 | } else { | 472 | } else { |
473 | // Show start time. | 473 | // Show start time. |
474 | text += TimeString::timeString( ev.start(), whichClock, FALSE ); | 474 | text += TimeString::timeString( ev.start(), whichClock, FALSE ); |
475 | } | 475 | } |
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 | ||
501 | DateBookDayWidget::~DateBookDayWidget() | 501 | DateBookDayWidget::~DateBookDayWidget() |
502 | { | 502 | { |
503 | } | 503 | } |
504 | 504 | ||
505 | void DateBookDayWidget::paintEvent( QPaintEvent *e ) | 505 | void DateBookDayWidget::paintEvent( QPaintEvent *e ) |
506 | { | 506 | { |
507 | QPainter p( this ); | 507 | QPainter p( this ); |
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 | |||
@@ -599,33 +599,33 @@ QDate DateBookWeek::weekDate() const | |||
599 | // the week. Granted, other countries use other methods, | 599 | // the week. Granted, other countries use other methods, |
600 | // bet we aren't doing any Locale stuff at the moment. So, | 600 | // bet we aren't doing any Locale stuff at the moment. So, |
601 | // this should pass. This Algorithim is public domain and | 601 | // this should pass. This Algorithim is public domain and |
602 | // available at: | 602 | // available at: |
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 | ||
614 | bool calcWeek( const QDate &d, int &week, int &year, | 614 | bool 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 | ||
628 | if ( startOnMonday ) { | 628 | if ( startOnMonday ) { |
629 | // find the Jan1Weekday; | 629 | // find the Jan1Weekday; |
630 | if ( d.dayOfYear() <= ( 8 - jan1WeekDay) && jan1WeekDay > 4 ) { | 630 | if ( d.dayOfYear() <= ( 8 - jan1WeekDay) && jan1WeekDay > 4 ) { |
631 | yearNumber = d.year() - 1; | 631 | yearNumber = d.year() - 1; |
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 | |||
@@ -79,35 +79,35 @@ void DateBookWeekLstHeader::pickDate() { | |||
79 | m1->popup(mapToGlobal(labelWeek->pos()+QPoint(0,labelWeek->height()))); | 79 | m1->popup(mapToGlobal(labelWeek->pos()+QPoint(0,labelWeek->height()))); |
80 | picker->setFocus(); | 80 | picker->setFocus(); |
81 | } | 81 | } |
82 | void DateBookWeekLstHeader::setDate(int y, int m, int d) { | 82 | 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 | ||
87 | void DateBookWeekLstHeader::nextWeek() { | 87 | void DateBookWeekLstHeader::nextWeek() { |
88 | setDate(date.addDays(7)); | 88 | setDate(date.addDays(7)); |
89 | } | 89 | } |
90 | void DateBookWeekLstHeader::prevWeek() { | 90 | void DateBookWeekLstHeader::prevWeek() { |
91 | setDate(date.addDays(-7)); | 91 | setDate(date.addDays(-7)); |
92 | } | 92 | } |
93 | 93 | ||
94 | DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM, | 94 | DateBookWeekLstDayHdr::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()) { |
110 | QPalette pal=label->palette(); | 110 | QPalette pal=label->palette(); |
111 | pal.setColor(QColorGroup::Foreground, QColor(0,0,255)); | 111 | pal.setColor(QColorGroup::Foreground, QColor(0,0,255)); |
112 | label->setPalette(pal); | 112 | label->setPalette(pal); |
113 | 113 | ||
@@ -127,35 +127,35 @@ DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM, | |||
127 | connect (label, SIGNAL(clicked()), this, SLOT(showDay())); | 127 | connect (label, SIGNAL(clicked()), this, SLOT(showDay())); |
128 | connect (add, SIGNAL(clicked()), this, SLOT(newEvent())); | 128 | connect (add, SIGNAL(clicked()), this, SLOT(newEvent())); |
129 | } | 129 | } |
130 | 130 | ||
131 | void DateBookWeekLstDayHdr::showDay() { | 131 | void DateBookWeekLstDayHdr::showDay() { |
132 | emit showDate(date.year(), date.month(), date.day()); | 132 | emit showDate(date.year(), date.month(), date.day()); |
133 | } | 133 | } |
134 | void DateBookWeekLstDayHdr::newEvent() { | 134 | void 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 | } |
142 | DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, | 142 | DateBookWeekLstEvent::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()); |
158 | } | 158 | } |
159 | setText(QString(s) + " " + ev.description()); | 159 | setText(QString(s) + " " + ev.description()); |
160 | connect(this, SIGNAL(clicked()), this, SLOT(editMe())); | 160 | connect(this, SIGNAL(clicked()), this, SLOT(editMe())); |
161 | setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); | 161 | setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); |
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,27 +1,27 @@ | |||
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 | ||
10 | TimePicker::TimePicker(QWidget* parent = 0, const char* name = 0, | 10 | TimePicker::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 | ||
24 | 24 | ||
25 | for (int i=0; i<24; i++) { | 25 | for (int i=0; i<24; i++) { |
26 | r=new ClickableLabel(row); | 26 | r=new ClickableLabel(row); |
27 | hourLst.append(r); | 27 | hourLst.append(r); |