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
@@ -305,41 +305,41 @@ void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field )
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;
}
}
}
}
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
@@ -263,41 +263,41 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field )
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 );
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
@@ -147,40 +147,40 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field )
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
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index ead8628..21ecb73 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -55,25 +55,25 @@ void KOTodoViewItem:: setup()
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;
diff --git a/korganizer/kotodoviewitem.h b/korganizer/kotodoviewitem.h
index 74dbe98..bd024c8 100644
--- a/korganizer/kotodoviewitem.h
+++ b/korganizer/kotodoviewitem.h
@@ -63,25 +63,25 @@ class KOTodoViewItem : public QCheckListItem
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;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index f6b7718..e255b83 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -566,23 +566,23 @@ Incidence *KOViewManager::currentSelection()
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
@@ -225,163 +225,163 @@ void SearchDialog::updateView()
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;
}
}
}
}
diff --git a/korganizer/timespanview.cpp b/korganizer/timespanview.cpp
index 67a3811..df8ff88 100644
--- a/korganizer/timespanview.cpp
+++ b/korganizer/timespanview.cpp
@@ -96,25 +96,25 @@ void TimeSpanView::addItem( KCal::Event *event )
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 );
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index c23978d..bd13132 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -194,29 +194,25 @@ icalcomponent *ICalFormatImpl::writeEvent(Event *event)
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) {
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index 60b8bc7..567ae54 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -28,25 +28,25 @@
** 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
@@ -618,25 +618,25 @@ 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 )
@@ -900,25 +900,25 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max )
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 );
@@ -1378,25 +1378,25 @@ 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 );
diff --git a/microkde/kcalendarsystemgregorian.cpp b/microkde/kcalendarsystemgregorian.cpp
index 7c5b62a..cc12b9f 100644
--- a/microkde/kcalendarsystemgregorian.cpp
+++ b/microkde/kcalendarsystemgregorian.cpp
@@ -45,43 +45,43 @@ int KCalendarSystemGregorian::year(const QDate& date) const
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);
}
@@ -222,39 +222,39 @@ QString KCalendarSystemGregorian::monthNamePossessive(int month,
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;