summaryrefslogtreecommitdiffabout
path: root/microkde
Side-by-side diff
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp10
-rw-r--r--microkde/kcalendarsystemgregorian.cpp8
2 files changed, 9 insertions, 9 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index 60b8bc7..567ae54 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -23,34 +23,34 @@
** information about KDGantt Commercial License Agreements.
**
** 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
+#include "qbitmap.h"
+#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;