summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/views/kaddressbookcardview.cpp4
-rw-r--r--kaddressbook/views/kaddressbookiconview.cpp4
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp4
-rw-r--r--korganizer/kotodoviewitem.cpp2
-rw-r--r--korganizer/kotodoviewitem.h2
-rw-r--r--korganizer/koviewmanager.cpp2
-rw-r--r--korganizer/searchdialog.cpp22
-rw-r--r--korganizer/timespanview.cpp2
-rw-r--r--libkcal/icalformatimpl.cpp6
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp8
-rw-r--r--microkde/kcalendarsystemgregorian.cpp8
11 files changed, 30 insertions, 34 deletions
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp
index 6fcd73f..9d8c5ce 100644
--- a/kaddressbook/views/kaddressbookcardview.cpp
+++ b/kaddressbook/views/kaddressbookcardview.cpp
@@ -301,49 +301,49 @@ void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field )
return;
}
QString pattern = s.lower()+"*";
QRegExp re;
re.setWildcard(true); // most people understand these better.
re.setCaseSensitive(false);
re.setPattern( pattern );
if (!re.isValid())
return;
mCardView->viewport()->setUpdatesEnabled( false );
KABC::Addressee::List addresseeList = addressees();
KABC::Addressee::List::Iterator it;
if ( field ) {
for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
continue;
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(field->value( *it ).lower()) != -1)
#else
if (re.match(field->value( *it ).lower()) != -1)
#endif
new AddresseeCardViewItem(fields(), mShowEmptyFields,
addressBook(), *it, mCardView);
}
} else {
KABC::Field::List fieldList = allFields();
KABC::Field::List::ConstIterator fieldIt;
for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
continue;
for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search((*fieldIt)->value( *it ).lower()) != -1)
#else
if (re.match((*fieldIt)->value( *it ).lower()) != -1)
#endif
{
new AddresseeCardViewItem(fields(), mShowEmptyFields,
addressBook(), *it, mCardView);
break;
}
}
}
}
mCardView->viewport()->setUpdatesEnabled( true );
mCardView->viewport()->update();
if ( mCardView->firstItem() ) {
mCardView->setCurrentItem ( mCardView->firstItem() );
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp
index ef0a23a..fb53215 100644
--- a/kaddressbook/views/kaddressbookiconview.cpp
+++ b/kaddressbook/views/kaddressbookiconview.cpp
@@ -259,49 +259,49 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field )
refresh();
return;
}
QString pattern = s.lower()+"*";
QRegExp re;
re.setWildcard(true); // most people understand these better.
re.setCaseSensitive(false);
re.setPattern( pattern );
if (!re.isValid())
return;
KABC::Addressee::List addresseeList = addressees();
KABC::Addressee::List::Iterator it;
if ( field ) {
for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
continue;
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(field->value( *it ).lower()) != -1)
#else
if (re.match(field->value( *it ).lower()) != -1)
#endif
mIconList.append(new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView ));
}
} else {
KABC::Field::List fieldList = allFields();
KABC::Field::List::ConstIterator fieldIt;
for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
continue;
for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search((*fieldIt)->value( *it ).lower()) != -1)
#else
if (re.match((*fieldIt)->value( *it ).lower()) != -1)
#endif
{
mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView ));
break;
}
}
}
}
mIconView->arrangeItemsInGrid( true );
if ( mIconView->firstItem() ) {
mIconView->setCurrentItem ( mIconView->firstItem() );
mIconView->setSelected ( mIconView->firstItem() , true );
}
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp
index 7022dcb..69802a4 100644
--- a/kaddressbook/views/kaddressbooktableview.cpp
+++ b/kaddressbook/views/kaddressbooktableview.cpp
@@ -143,48 +143,48 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field )
refresh();
return;
}
QString pattern = s.lower()+"*";
QRegExp re;
re.setWildcard(true); // most people understand these better.
re.setCaseSensitive(false);
re.setPattern( pattern );
if (!re.isValid())
return;
KABC::Addressee::List addresseeList = addressees();
KABC::Addressee::List::Iterator it;
if ( field ) {
for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
continue;
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(field->value( *it ).lower()) == 0)
#else
if (re.match(field->value( *it ).lower()) != -1)
#endif
ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields());
}
} else {
KABC::Field::List fieldList = allFields();
KABC::Field::List::ConstIterator fieldIt;
for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
continue;
for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search((*fieldIt)->value( *it ).lower()) != -1)
#else
if (re.match((*fieldIt)->value( *it ).lower()) != -1)
#endif
{
ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields());
break;
}
}
}
}
// Sometimes the background pixmap gets messed up when we add lots
// of items.
mListView->repaint();
if ( mListView->firstChild() ) {
mListView->setCurrentItem ( mListView->firstChild() );
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index ead8628..21ecb73 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -51,33 +51,33 @@ QString KOTodoViewItem::key(int column,bool) const
void KOTodoViewItem:: setup()
{
int h = 20;
if ( listView () ) {
QFontMetrics fm ( listView ()->font () );
h = fm.height();
}
setHeight( h );
}
void KOTodoViewItem::setSortKey(int column,const QString &key)
{
mKeyMap.insert(column,key);
}
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w,
int y,int h)
{
QListViewItem::paintBranches(p,cg,w,y,h);
}
#else
#endif
void KOTodoViewItem::construct()
{
// qDebug("KOTodoViewItem::construct() ");
m_init = true;
QString keyd = "==";
QString keyt = "==";
QString skeyd = "==";
QString skeyt = "==";
diff --git a/korganizer/kotodoviewitem.h b/korganizer/kotodoviewitem.h
index 74dbe98..bd024c8 100644
--- a/korganizer/kotodoviewitem.h
+++ b/korganizer/kotodoviewitem.h
@@ -59,33 +59,33 @@ class KOTodoViewItem : public QCheckListItem
//~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );}
void construct();
Todo *todo() { return mTodo; }
QString key(int, bool) const;
void setSortKey(int column,const QString &key);
bool isAlternate();
virtual void paintCell(QPainter *p, const QColorGroup &cg,
int column, int width, int alignment);
virtual void setup();
protected:
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
void paintBranches(QPainter *p,const QColorGroup & cg,int w,int y,int h);
#else
#endif
virtual void stateChange(bool);
void setMyPixmap();
private:
Todo *mTodo;
KOTodoView *mTodoView;
QMap<int,QString> mKeyMap;
uint m_odd : 1;
uint m_known : 1;
uint m_unused : 30;
bool m_init;
};
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index f6b7718..e255b83 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -562,27 +562,27 @@ Incidence *KOViewManager::currentSelection()
}
return mCurrentView->selectedIncidences().first();
}
QDate KOViewManager::currentSelectionDate()
{
QDate qd;
if (mCurrentView) {
DateList qvl = mCurrentView->selectedDates();
if (!qvl.isEmpty()) qd = qvl.first();
}
return qd;
}
void KOViewManager::addView(KOrg::BaseView *view)
{
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
mMainView->viewStack()->addWidget( view );
#else
mMainView->viewStack()->addWidget( view, 1 );
#endif
}
void KOViewManager::setDocumentId( const QString &id )
{
if (mTodoView) mTodoView->setDocumentId( id );
}
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 72ee1d2..39966b5 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -221,171 +221,171 @@ void SearchDialog::updateView()
listView->showEvents(mMatchedEvents);
listView->addTodos(mMatchedTodos);
listView->addJournals(mMatchedJournals);
}
void SearchDialog::search(const QRegExp &re)
{
QPtrList<Event> events = mCalendar->events( mStartDate->date(),
mEndDate->date(),
false /*mInclusiveCheck->isChecked()*/ );
mMatchedEvents.clear();
if ( mSearchEvent->isChecked() ) {
Event *ev;
for(ev=events.first();ev;ev=events.next()) {
if (mSummaryCheck->isChecked()) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(ev->summary()) != -1)
#else
if (re.match(ev->summary()) != -1)
#endif
{
mMatchedEvents.append(ev);
continue;
}
}
if (mDescriptionCheck->isChecked()) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(ev->description()) != -1)
#else
if (re.match(ev->description()) != -1)
#endif
{
mMatchedEvents.append(ev);
continue;
}
}
if (mCategoryCheck->isChecked()) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(ev->categoriesStr()) != -1)
#else
if (re.match(ev->categoriesStr()) != -1)
#endif
{
mMatchedEvents.append(ev);
continue;
}
}
if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
QPtrList<Attendee> tmpAList = ev->attendees();
Attendee *a;
for (a = tmpAList.first(); a; a = tmpAList.next()) {
if (mSearchAName->isChecked()) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(a->name()) != -1)
#else
if (re.match(a->name()) != -1)
#endif
{
mMatchedEvents.append(ev);
break;
}
}
if (mSearchAEmail->isChecked()) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(a->email()) != -1)
#else
if (re.match(a->email()) != -1)
#endif
{
mMatchedEvents.append(ev);
break;
}
}
}
}
}
}
QPtrList<Todo> todos = mCalendar->todos( );
mMatchedTodos.clear();
if ( mSearchTodo->isChecked() ) {
Todo *tod;
for(tod=todos.first();tod;tod=todos.next()) {
if (mSummaryCheck->isChecked()) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(tod->summary()) != -1)
#else
if (re.match(tod->summary()) != -1)
#endif
{
mMatchedTodos.append(tod);
continue;
}
}
if (mDescriptionCheck->isChecked()) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(tod->description()) != -1)
#else
if (re.match(tod->description()) != -1)
#endif
{
mMatchedTodos.append(tod);
continue;
}
}
if (mCategoryCheck->isChecked()) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(tod->categoriesStr()) != -1)
#else
if (re.match(tod->categoriesStr()) != -1)
#endif
{
mMatchedTodos.append(tod);
continue;
}
}
if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
QPtrList<Attendee> tmpAList = tod->attendees();
Attendee *a;
for (a = tmpAList.first(); a; a = tmpAList.next()) {
if (mSearchAName->isChecked()) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(a->name()) != -1)
#else
if (re.match(a->name()) != -1)
#endif
{
mMatchedTodos.append(tod);
break;
}
}
if (mSearchAEmail->isChecked()) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(a->email()) != -1)
#else
if (re.match(a->email()) != -1)
#endif
{
mMatchedTodos.append(tod);
break;
}
}
}
}
}
}
mMatchedJournals.clear();
if (mSearchJournal->isChecked() ) {
QPtrList<Journal> journals = mCalendar->journals( );
Journal* journ;
for(journ=journals.first();journ;journ=journals.next()) {
if ( journ->dtStart().date() <= mEndDate->date()
&&journ->dtStart().date() >= mStartDate->date()) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
if (re.search(journ->description()) != -1)
#else
if (re.match(journ->description()) != -1)
#endif
{
mMatchedJournals.append(journ);
continue;
}
}
}
}
}
/*
void SearchDialog::keyPressEvent ( QKeyEvent *e)
{
diff --git a/korganizer/timespanview.cpp b/korganizer/timespanview.cpp
index 67a3811..df8ff88 100644
--- a/korganizer/timespanview.cpp
+++ b/korganizer/timespanview.cpp
@@ -92,33 +92,33 @@ void TimeSpanView::addItem( KCal::Event *event )
int startX = mStartDate.secsTo( startDt ) / mSecsPerPixel;
int endX = startX + startDt.secsTo( endDt ) / mSecsPerPixel;
// kdDebug() << "TimeSpanView::addItem(): s: " << startX << " e: " << endX << endl;
mLineView->addLine( startX, endX );
}
void TimeSpanView::clear()
{
mList->clear();
mLineView->clear();
}
void TimeSpanView::updateView()
{
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
mLineView->updateContents();
mTimeLine->updateContents();
#else
#endif
}
void TimeSpanView::setDateRange( const QDateTime &start, const QDateTime &end )
{
mStartDate = start;
mEndDate = end;
mTimeLine->setDateRange( start, end );
mSecsPerPixel = mStartDate.secsTo( mEndDate ) / mLineView->pixelWidth();
}
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index c23978d..bd13132 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -190,37 +190,33 @@ icalcomponent *ICalFormatImpl::writeEvent(Event *event)
// Transparency
switch( event->transparency() ) {
case Event::Transparent:
icalcomponent_add_property(vevent, icalproperty_new_transp(ICAL_TRANSP_TRANSPARENT));
break;
case Event::Opaque:
icalcomponent_add_property(vevent, icalproperty_new_transp(ICAL_TRANSP_OPAQUE));
break;
}
return vevent;
}
icalcomponent *ICalFormatImpl::writeFreeBusy(FreeBusy *freebusy,
Scheduler::Method method)
{
-#if QT_VERSION >= 300
- kdDebug(5800) << "icalformatimpl: writeFreeBusy: startDate: "
- << freebusy->dtStart().toString("ddd MMMM d yyyy: h:m:s ap") << " End Date: "
- << freebusy->dtEnd().toString("ddd MMMM d yyyy: h:m:s ap") << endl;
-#endif
+
icalcomponent *vfreebusy = icalcomponent_new(ICAL_VFREEBUSY_COMPONENT);
writeIncidenceBase(vfreebusy,freebusy);
icalcomponent_add_property(vfreebusy, icalproperty_new_dtstart(
writeICalDateTime(freebusy->dtStart())));
icalcomponent_add_property(vfreebusy, icalproperty_new_dtend(
writeICalDateTime(freebusy->dtEnd())));
if (method == Scheduler::Request) {
icalcomponent_add_property(vfreebusy,icalproperty_new_uid(
freebusy->uid().utf8()));
}
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index 60b8bc7..567ae54 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -24,33 +24,33 @@
**
** Contact info@klaralvdalens-datakonsult.se if any conditions of this
** licensing are not clear to you.
**
** As a special exception, permission is given to link this program
** with any edition of Qt, and distribute the resulting executable,
** without including the source code for Qt in the source distribution.
**
**********************************************************************/
#include "KDGanttMinimizeSplitter.h"
#ifndef QT_NO_SPLITTER___
#include "qpainter.h"
#include "qdrawutil.h"
#include "qbitmap.h"
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
#include "qptrlist.h"
#include "qmemarray.h"
#else
#include <qlist.h>
#include <qarray.h>
#define QPtrList QList
#define QMemArray QArray
#endif
#include "qlayoutengine_p.h"
#include "qobjectlist.h"
#include "qstyle.h"
#include "qapplication.h" //sendPostedEvents
#include <qvaluelist.h>
#include <qcursor.h>
#ifndef KDGANTT_MASTER_CVS
//#include "KDGanttMinimizeSplitter.moc"
@@ -614,33 +614,33 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c )
}
}
/*!
Shows a rubber band at position \a p. If \a p is negative, the
rubber band is removed.
*/
void KDGanttMinimizeSplitter::setRubberband( int p )
{
QPainter paint( this );
paint.setPen( gray );
paint.setBrush( gray );
paint.setRasterOp( XorROP );
QRect r = contentsRect();
const int rBord = 3; //Themable????
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this);
#else
int sw = style().splitterWidth();
#endif
if ( orient == Horizontal ) {
if ( opaqueOldPos >= 0 )
paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(),
2*rBord, r.height() );
if ( p >= 0 )
paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() );
} else {
if ( opaqueOldPos >= 0 )
paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord,
r.width(), 2*rBord );
if ( p >= 0 )
paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );
@@ -896,33 +896,33 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max )
}
}
for ( i = id; i < n; i++ ) {
QSplitterLayoutStruct *s = data->list.at(i);
if ( s->wid->isHidden() ) {
//ignore
} else if ( s->isSplitter ) {
minA += s->sizer;
maxA += s->sizer;
} else {
minA += pick( minSize(s->wid) );
maxA += pick( s->wid->maximumSize() );
}
}
QRect r = contentsRect();
if ( orient == Horizontal && false ) {
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
int splitterWidth = style().pixelMetric(QStyle::PM_SplitterWidth, this);
#else
int splitterWidth = style().splitterWidth();
#endif
if ( min )
*min = pick(r.topRight()) - QMIN( maxB, pick(r.size())-minA ) - splitterWidth;
if ( max )
*max = pick(r.topRight()) - QMAX( minB, pick(r.size())-maxA ) - splitterWidth;
} else {
if ( min )
*min = pick(r.topLeft()) + QMAX( minB, pick(r.size())-maxA );
if ( max )
*max = pick(r.topLeft()) + QMIN( maxB, pick(r.size())-minA );
}
}
@@ -1374,33 +1374,33 @@ void KDGanttMinimizeSplitter::setSizes( QValueList<int> list )
the splitter is consistent.
*/
void KDGanttMinimizeSplitter::processChildEvents()
{
QApplication::sendPostedEvents( this, QEvent::ChildInserted );
}
/*!
\reimp
*/
void KDGanttMinimizeSplitter::styleChange( QStyle& old )
{
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this);
#else
int sw = style().splitterWidth();
#endif
QSplitterLayoutStruct *s = data->list.first();
while ( s ) {
if ( s->isSplitter )
s->sizer = sw;
s = data->list.next();
}
doResize();
QFrame::styleChange( old );
}
#endif
diff --git a/microkde/kcalendarsystemgregorian.cpp b/microkde/kcalendarsystemgregorian.cpp
index 7c5b62a..cc12b9f 100644
--- a/microkde/kcalendarsystemgregorian.cpp
+++ b/microkde/kcalendarsystemgregorian.cpp
@@ -41,51 +41,51 @@ KCalendarSystemGregorian::~KCalendarSystemGregorian()
int KCalendarSystemGregorian::year(const QDate& date) const
{
// kdDebug(5400) << "Gregorian year..." << endl;
return date.year();
}
int KCalendarSystemGregorian::monthsInYear( const QDate & ) const
{
// kdDebug(5400) << "Gregorian monthsInYear" << endl;
return 12;
}
int KCalendarSystemGregorian::weeksInYear(int year) const
{
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
QDate temp;
temp.setYMD(year, 12, 31);
// If the last day of the year is in the first week, we have to check the
// week before
if ( temp.weekNumber() == 1 )
temp.addDays(-7);
return temp.weekNumber();
#else
return 52;
#endif
}
int KCalendarSystemGregorian::weekNumber(const QDate& date,
int * yearNum) const
{
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
return date.weekNumber(yearNum);
#else
return 1;
#endif
}
QString KCalendarSystemGregorian::monthName(const QDate& date,
bool shortName) const
{
return monthName(month(date), shortName);
}
QString KCalendarSystemGregorian::monthNamePossessive(const QDate& date, bool shortName) const
{
return monthNamePossessive(month(date), shortName);
}
@@ -218,47 +218,47 @@ QString KCalendarSystemGregorian::monthNamePossessive(int month,
return QString::null;
}
bool KCalendarSystemGregorian::setYMD(QDate & date, int y, int m, int d) const
{
// We don't want Qt to add 1900 to them
if ( y >= 0 && y <= 99 )
return false;
// QDate supports gregorian internally
return date.setYMD(y, m, d);
}
QDate KCalendarSystemGregorian::addYears(const QDate & date, int nyears) const
{
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
return date.addYears(nyears);
#else
int year = date.year() + nyears;
int month = date.month();
int day = date.day();
QDate newDate( year, month, 1 );
if ( day > newDate.daysInMonth() ) day = newDate.daysInMonth();
return QDate( year, month, day );
#endif
}
QDate KCalendarSystemGregorian::addMonths(const QDate & date, int nmonths) const
{
-#if QT_VERSION >= 300
+#if QT_VERSION >= 0x030000
return date.addMonths(nmonths);
#else
int month = date.month();
int nyears;
if ( nmonths >= 0 ) {
month += nmonths;
nyears = ( month - 1 ) / 12;
month = ( ( month - 1 ) % 12 ) + 1;
} else {
nyears = nmonths / 12;
// nmonths += nyears * 12;
nmonths = nmonths % 12;
month += nmonths;
if ( month <= 0 ) {
month += 12;
--nyears;