From a08aff328d4393031d5ba7d622c2b05705a89d73 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 04 Jul 2007 11:23:42 +0000 Subject: initial public commit of qt4 port --- (limited to 'korganizer') diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8385bcc..c1a2f76 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -32,22 +32,28 @@ #include #include -#include +#include #include #include #include #include -#include -#include +#include +#include #include -#include -#include +#include +#include #include -#include +#include #include #include #ifndef KORG_NOSPLITTER #include +//Added by qt3to4: +#include +#include +#include +#include +#include #endif #include @@ -128,7 +134,7 @@ #include #include #else -#include +#include #endif #ifdef DESKTOP_VERSION @@ -140,7 +146,7 @@ extern int globalFlagBlockAgenda; extern int globalFlagBlockStartup; -MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList alarms,QDateTime start ) : QTextBrowser(parent) +MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, Q3PtrList alarms,QDateTime start ) : Q3TextBrowser(parent) { mAlarms = alarms; @@ -277,13 +283,13 @@ class KOBeamPrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Beam Options") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("File format"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; - QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); + Q3ButtonGroup* time = new Q3ButtonGroup(1, Qt::Horizontal, i18n("Time format"), this ); lay->addWidget( time ); time->setExclusive ( true ) ; vcal = new QRadioButton(" vCalendar ", format ); ical = new QRadioButton(" iCalendar ", format ); @@ -312,12 +318,12 @@ class KOCatPrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Manage new Categories") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do now:"), this ); lay->addWidget( lab ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("New categories not in list:"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; addCatBut = new QRadioButton(i18n("Add to category list"), format ); @@ -373,7 +379,7 @@ void CalendarView::init() flag_clearallviewsEventDisplay = false; flag_clearallviewsupdateView = false; mNextAlarmDateTime = QDateTime::currentDateTime(); - setFocusPolicy (NoFocus ); + setFocusPolicy (Qt::NoFocus ); mViewerCallerIsSearchDialog = false; mBlockShowDates = false; mConflictingEvent = 0; @@ -394,7 +400,7 @@ void CalendarView::init() mStorage = new FileStorage( mCalendar ); mNavigator = new DateNavigator( this, "datevav", mViewManager ); - QBoxLayout *topLayout = (QBoxLayout*)layout(); + Q3BoxLayout *topLayout = (Q3BoxLayout*)layout(); #ifndef KORG_NOSPLITTER // create the main layout frames. mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); @@ -425,9 +431,9 @@ void CalendarView::init() } #endif QWidget *rightBox = new QWidget( mPanner ); - QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); + Q3BoxLayout *rightLayout = new Q3VBoxLayout( rightBox ); - mRightFrame = new QWidgetStack( rightBox ); + mRightFrame = new Q3WidgetStack( rightBox ); rightLayout->addWidget( mRightFrame, 1 ); mLeftFrame = mLeftSplitter; @@ -454,7 +460,7 @@ void CalendarView::init() //QBoxLayout * leftFrameLayout; topLayout->addWidget( mMainFrame ); #ifdef DESKTOP_VERSION - mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this ); + mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,Qt::Horizontal, this ); topLayout->addWidget( mDateScrollBar ); connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); if ( QApplication::desktop()->width() < 800 ) @@ -501,8 +507,8 @@ void CalendarView::init() mCalEditView->hide(); QWidget *rightBox = new QWidget( mMainFrame ); //mainBoxLayout->addWidget ( rightBox, 10 ); - QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); - mRightFrame = new QWidgetStack( rightBox ); + Q3BoxLayout *rightLayout = new Q3VBoxLayout( rightBox ); + mRightFrame = new Q3WidgetStack( rightBox ); rightLayout->addWidget( mRightFrame, 10 ); //mLeftFrame = (QWidget *)leftFrame; @@ -616,9 +622,9 @@ void CalendarView::init() // kdDebug() << "CalendarView::CalendarView() done" << endl; - mDateFrame = new QVBox(0,0,WType_Popup); + mDateFrame = new Q3VBox(0,0,Qt::WType_Popup); //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); - mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); + mDateFrame->setFrameStyle( Q3Frame::WinPanel |Q3Frame::Raised ); mDateFrame->setLineWidth(3); mDateFrame->hide(); mDateFrame->setCaption( i18n( "Pick a date to display")); @@ -669,7 +675,7 @@ void CalendarView::nextConflict( bool all, bool allday ) { if ( flag_blockConflict ) return; flag_blockConflict = true; - QPtrList testlist = mCalendar->events(); + Q3PtrList testlist = mCalendar->events(); Event * test = testlist.first(); while ( test ) { test->setTagged( false ); @@ -685,7 +691,7 @@ void CalendarView::nextConflict( bool all, bool allday ) bool found = false; Event * cE = 0; Event * cE2 = 0; - QPtrList testlist2 = testlist; + Q3PtrList testlist2 = testlist; test = testlist.first(); bool skip = false; topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); @@ -835,7 +841,7 @@ void CalendarView::updateView(const QDate &start, const QDate &end) void CalendarView::checkFiles() { QString message; - QPtrList calendars = KOPrefs::instance()->mCalendars; + Q3PtrList calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); while ( cal ) { if ( cal->mErrorOnLoad ) { @@ -857,7 +863,7 @@ void CalendarView::checkAlarms() KConfig *config = KOGlobals::config(); config->setGroup( "AppRun" ); QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); - int daysto = dt.daysTo( QDate::currentDate() ); + int daysto = dt.daysTo( (QDateTime)QDate::currentDate() ); int days = config->readNumEntry( "LatestProgramStopDays" , daysto); dt = dt.addDays( days ); int secto = dt.secsTo( QDateTime::currentDateTime() ); @@ -867,8 +873,8 @@ void CalendarView::checkAlarms() QDateTime latest = dt.addSecs ( secs ); qDebug("KO: Last termination on %s ", latest.toString().latin1()); //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); - QPtrList el = mCalendar->rawIncidences(); - QPtrList al; + Q3PtrList el = mCalendar->rawIncidences(); + Q3PtrList al; Incidence* inL = el.first(); QDateTime cur = QDateTime::currentDateTime().addSecs(-59); qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); @@ -886,9 +892,9 @@ void CalendarView::checkAlarms() inL = el.next(); } if ( al.count() ) { - QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); + QDialog* dia = new QDialog( this, "huhu", false, Qt::WDestructiveClose | Qt::WStyle_StaysOnTop ); dia->setCaption( i18n("KO/Pi: Missing alarms!") ); - QVBoxLayout* lay = new QVBoxLayout( dia ); + Q3VBoxLayout* lay = new Q3VBoxLayout( dia ); lay->setSpacing( 0 ); lay->setMargin( 0 ); MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); @@ -1216,7 +1222,7 @@ void CalendarView::computeAlarm( QString msg ) return; } #else - QProcess* p = new QProcess(); + Q3Process* p = new Q3Process(); p->addArgument( tempfilename.latin1() ); p->start(); return; @@ -1266,10 +1272,10 @@ void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) //qDebug("nextsuspendalarm = \n%s ",mess.latin1() ); QString fn = QDir::homeDirPath() + "/.kopi_suspend_alarm"; QFile file( fn ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { qDebug("KO: Error writing next suspend alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); } else { - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts << mess; file.close(); } @@ -1294,10 +1300,10 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) //qDebug("nextalarm = \n%s ",mess.latin1() ); QString fn = QDir::homeDirPath() + "/.kopi_next_alarm"; QFile file( fn ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { qDebug("KO: Error writing next alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); } else { - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts << mess; file.close(); } @@ -1570,7 +1576,7 @@ Event* CalendarView::getLastSyncEvent() // we check, if the to delete event has a id for a profile // if yes, we set this id in the profile to delete -void CalendarView::checkExternSyncEvent( QPtrList lastSync , Incidence* toDelete ) +void CalendarView::checkExternSyncEvent( Q3PtrList lastSync , Incidence* toDelete ) { if ( lastSync.count() == 0 ) { //qDebug(" lastSync.count() == 0"); @@ -1600,7 +1606,7 @@ void CalendarView::checkExternSyncEvent( QPtrList lastSync , Incidence* t } void CalendarView::checkExternalId( Incidence * inc ) { - QPtrList lastSync = mCalendar->getExternLastSyncEvents() ; + Q3PtrList lastSync = mCalendar->getExternLastSyncEvents() ; checkExternSyncEvent( lastSync, inc ); } @@ -1624,8 +1630,8 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int Event* eventRSync; Event* eventLSync; clearAllViews(); - QPtrList eventRSyncSharp = remote->getExternLastSyncEvents(); - QPtrList eventLSyncSharp = local->getExternLastSyncEvents(); + Q3PtrList eventRSyncSharp = remote->getExternLastSyncEvents(); + Q3PtrList eventLSyncSharp = local->getExternLastSyncEvents(); bool fullDateRange = false; local->resetTempSyncStat(); mLastCalendarSync = QDateTime::currentDateTime(); @@ -1684,10 +1690,10 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int } //qDebug("*************************** "); qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); - QPtrList er = remote->rawIncidences(); + Q3PtrList er = remote->rawIncidences(); Incidence* inR = er.first(); Incidence* inL; - QProgressBar bar( er.count(),0 ); + Q3ProgressBar bar( er.count(),0 ); bar.setCaption (i18n("Syncing - close to abort!") ); // ************** setting up filter ************* @@ -1831,7 +1837,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int } inR = er.next(); } - QPtrList el = local->rawIncidences(); + Q3PtrList el = local->rawIncidences(); inL = el.first(); modulo = (el.count()/10)+1; bar.setCaption (i18n("Add / remove events") ); @@ -2048,7 +2054,7 @@ void CalendarView::syncExternal( int mode ) if ( syncOK ) { if ( mSyncManager->mWriteBackFile ) { - QPtrList iL = mCalendar->rawIncidences(); + Q3PtrList iL = mCalendar->rawIncidences(); Incidence* inc = iL.first(); if ( phoneFormat ) { while ( inc ) { @@ -2115,7 +2121,7 @@ bool CalendarView::importBday() for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { ++count; } - QProgressBar bar(count,0 ); + Q3ProgressBar bar(count,0 ); int w = 300; if ( QApplication::desktop()->width() < 320 ) w = 220; @@ -2186,7 +2192,7 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd //qDebug("CalView 1 %i", count); - QProgressBar bar(count,0 ); + Q3ProgressBar bar(count,0 ); int w = 300; if ( QApplication::desktop()->width() < 320 ) w = 220; @@ -2350,7 +2356,7 @@ void CalendarView::setSyncEventsReadOnly() bool CalendarView::loadCalendars() { - QPtrList calendars = KOPrefs::instance()->mCalendars; + Q3PtrList calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); openCalendar( MainWindow::defaultFileName(), false ); @@ -2364,7 +2370,7 @@ bool CalendarView::loadCalendars() } bool CalendarView::restoreCalendarSettings() { - QPtrList calendars = KOPrefs::instance()->mCalendars; + Q3PtrList calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); while ( cal ) { mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); @@ -2529,7 +2535,7 @@ void CalendarView::watchSavedFile() } bool CalendarView::checkAllFileVersions() { - QPtrList calendars = KOPrefs::instance()->mCalendars; + Q3PtrList calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); mCalendar->setDefaultCalendarEnabledOnly(); @@ -2591,7 +2597,7 @@ bool CalendarView::checkFileVersion(QString fn) } bool CalendarView::saveCalendars() { - QPtrList calendars = KOPrefs::instance()->mCalendars; + Q3PtrList calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); mCalendar->setDefaultCalendarEnabledOnly(); @@ -2695,7 +2701,7 @@ void CalendarView::readSettings() #ifndef KORG_NOSPLITTER config->setGroup("KOrganizer Geometry"); - QValueList sizes = config->readIntListEntry("Separator1"); + Q3ValueList sizes = config->readIntListEntry("Separator1"); if (sizes.count() != 2) { sizes << mDateNavigator->minimumSizeHint().width(); sizes << 300; @@ -2763,7 +2769,7 @@ void CalendarView::readSettings() config->setGroup( "Views" ); int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); - QValueList sizes = config->readIntListEntry("Left Splitter Frame"); + Q3ValueList sizes = config->readIntListEntry("Left Splitter Frame"); int resetval = 0; int maxVal = 0; @@ -2842,7 +2848,7 @@ void CalendarView::writeSettings() writeFilterSettings(config); config->setGroup( "AppRun" ); QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); - int days = dt.daysTo( QDate::currentDate() ); + int days = dt.daysTo( (QDateTime)QDate::currentDate() ); dt = dt.addDays( days ); int secs = dt.secsTo( QDateTime::currentDateTime() ); config->writeEntry( "LatestProgramStopDays", days ); @@ -2869,9 +2875,9 @@ void CalendarView::writeSettings() #endif - QValueList listINT = mLeftFrame->sizes(); + Q3ValueList listINT = mLeftFrame->sizes(); config->writeEntry("Left Splitter Frame",listINT); - QValueList listINT2 = mMainFrame->sizes(); + Q3ValueList listINT2 = mMainFrame->sizes(); config->writeEntry("Main Splitter Frame",listINT2); #ifdef DESKTOP_VERSION config->setGroup("WidgetLayout"); @@ -3166,7 +3172,7 @@ void CalendarView::checkConflictForEvent() return; } } - QPtrList testlist = mCalendar->events(); + Q3PtrList testlist = mCalendar->events(); Event * test = testlist.first(); QDateTime conflict; QDateTime retVal; @@ -3428,7 +3434,7 @@ void CalendarView::slotSelectPickerDate( QDate d) void CalendarView::removeCategories() { - QPtrList incList = mCalendar->rawIncidences(); + Q3PtrList incList = mCalendar->rawIncidences(); QStringList catList = KOPrefs::instance()->mCustomCategories; QStringList catIncList; QStringList newCatList; @@ -3449,7 +3455,7 @@ void CalendarView::removeCategories() int CalendarView::addCategories() { - QPtrList incList = mCalendar->rawIncidences(); + Q3PtrList incList = mCalendar->rawIncidences(); QStringList catList = KOPrefs::instance()->mCustomCategories; QStringList catIncList; Incidence* inc = incList.first(); @@ -3507,23 +3513,23 @@ void CalendarView::manageCategories() void CalendarView::beamIncidence(Incidence * Inc) { - QPtrList delSel ; + Q3PtrList delSel ; delSel.append(Inc); beamIncidenceList( delSel ); } void CalendarView::beamCalendar() { - QPtrList delSel = mCalendar->rawIncidences(); + Q3PtrList delSel = mCalendar->rawIncidences(); //qDebug("beamCalendar() "); beamIncidenceList( delSel ); } void CalendarView::beamFilteredCalendar() { - QPtrList delSel = mCalendar->incidences(); + Q3PtrList delSel = mCalendar->incidences(); //qDebug("beamFilteredCalendar() "); beamIncidenceList( delSel ); } -void CalendarView::beamIncidenceList(QPtrList delSel ) +void CalendarView::beamIncidenceList(Q3PtrList delSel ) { KOBeamPrefs beamDialog; @@ -4315,7 +4321,7 @@ void CalendarView::schedule_publish(Incidence *incidence) PublishDialog *publishdlg = new PublishDialog(); if (incidence->attendeeCount()>0) { - QPtrList attendees = incidence->attendees(); + Q3PtrList attendees = incidence->attendees(); attendees.first(); while ( attendees.current()!=0 ) { publishdlg->addAttendee(attendees.current()); @@ -4724,7 +4730,7 @@ void CalendarView::showDates(const DateList &selectedDates) } -QPtrList CalendarView::filters() +Q3PtrList CalendarView::filters() { return mFilters; @@ -4765,7 +4771,7 @@ void CalendarView::showFilter(bool visible) if (visible) { mCalEditView->readConfig(); mCalEditView->show(); - QValueList sizes; + Q3ValueList sizes; sizes = mLeftFrame->sizes(); if ( sizes.count() == 4 && sizes[3] < 20 ) { sizes.clear(); @@ -4846,21 +4852,21 @@ void CalendarView::takeOverCalendar() // TODO: Create Calendar::allIncidences() function and use it here clearAllViews(); - QPtrList events = mCalendar->events(); + Q3PtrList events = mCalendar->events(); for(uint i=0; isetOrganizer(KOPrefs::instance()->email()); events.at(i)->recreate(); events.at(i)->setReadOnly(false); } - QPtrList todos = mCalendar->todos(); + Q3PtrList todos = mCalendar->todos(); for(uint i=0; isetOrganizer(KOPrefs::instance()->email()); todos.at(i)->recreate(); todos.at(i)->setReadOnly(false); } - QPtrList journals = mCalendar->journals(); + Q3PtrList journals = mCalendar->journals(); for(uint i=0; isetOrganizer(KOPrefs::instance()->email()); journals.at(i)->recreate(); @@ -4875,7 +4881,7 @@ void CalendarView::showIntro() kdDebug() << "To be implemented." << endl; } -QWidgetStack *CalendarView::viewStack() +Q3WidgetStack *CalendarView::viewStack() { return mRightFrame; } @@ -5060,7 +5066,7 @@ void CalendarView::lookForIncomingMessages() bool CalendarView::removeCompletedSubTodos( Todo* t ) { bool deleteTodo = true; - QPtrList subTodos; + Q3PtrList subTodos; Incidence *aTodo; subTodos = t->relations(); for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { @@ -5086,8 +5092,8 @@ void CalendarView::purgeCompleted() if (result == KMessageBox::Continue) { - QPtrList todoCal; - QPtrList rootTodos; + Q3PtrList todoCal; + Q3PtrList rootTodos; //QPtrList rel; Todo *aTodo; todoCal = calendar()->todos(); diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 60b1276..b4eada7 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -24,13 +24,15 @@ #ifndef CALENDARVIEW_H #define CALENDARVIEW_H -#include +#include #include #include -#include -#include +#include +#include #include #include +//Added by qt3to4: +#include #ifndef DESKTOP_VERSION #include #else @@ -47,7 +49,7 @@ #include //#include -class QWidgetStack; +class Q3WidgetStack; class QSplitter; class KopiCalendarFile; class CalPrinter; @@ -84,19 +86,19 @@ using namespace KCal; @author Cornelius Schumacher */ -#include +#include #include -class MissedAlarmTextBrowser : public QTextBrowser { +class MissedAlarmTextBrowser : public Q3TextBrowser { Q_OBJECT public: - MissedAlarmTextBrowser(QWidget *parent, QPtrList alarms ,QDateTime start); + MissedAlarmTextBrowser(QWidget *parent, Q3PtrList alarms ,QDateTime start); ~MissedAlarmTextBrowser(); void setSource(const QString & n); private: Incidence * getNextInc(QDateTime start ); - QPtrList mAlarms; + Q3PtrList mAlarms; signals: void showIncidence( QString uid); }; @@ -127,7 +129,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser QDate startDate(); QDate endDate(); - QWidgetStack *viewStack(); + Q3WidgetStack *viewStack(); QWidget *leftFrame(); DateNavigator *dateNavigator(); @@ -441,7 +443,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void editFilters(); void toggleFilerEnabled(); - QPtrList filters(); + Q3PtrList filters(); void toggleFilter(); void showFilter(bool visible); void updateFilter(); @@ -495,7 +497,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void beamIncidence(Incidence *) ; void beamCalendar() ; void beamFilteredCalendar() ; - void beamIncidenceList(QPtrList) ; + void beamIncidenceList(Q3PtrList) ; void manageCategories(); void editCategories(); int addCategories(); @@ -575,7 +577,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void setSyncEventsReadOnly(); QDateTime loadedFileVersion; - void checkExternSyncEvent( QPtrList lastSync , Incidence* toDelete ); + void checkExternSyncEvent( Q3PtrList lastSync , Incidence* toDelete ); void checkExternalId( Incidence * inc ); int mGlobalSyncMode; QString mCurrentSyncDevice; @@ -593,10 +595,10 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser QSplitter *mPanner; QSplitter *mLeftSplitter; KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame; - QWidgetStack *mRightFrame; + Q3WidgetStack *mRightFrame; KDatePicker* mDatePicker; - QVBox* mDateFrame; + Q3VBox* mDateFrame; DateNavigatorContainer *mDateNavigator; // widget showing small month view. @@ -618,7 +620,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser KODialogManager *mDialogManager; // Calendar filters - QPtrList mFilters; + Q3PtrList mFilters; // various housekeeping variables. bool mModified; // flag indicating if calendar is modified diff --git a/korganizer/calprintbase.cpp b/korganizer/calprintbase.cpp index 7b7d54c..ecb9e03 100644 --- a/korganizer/calprintbase.cpp +++ b/korganizer/calprintbase.cpp @@ -25,11 +25,13 @@ #include #include -#include +#include #include -#include -#include +#include +#include #include +//Added by qt3to4: +#include #include #include @@ -145,8 +147,8 @@ CalPrintBase::~CalPrintBase() QWidget *CalPrintBase::configWidget( QWidget *w ) { - QFrame *wdg = new QFrame( w ); - QVBoxLayout *layout = new QVBoxLayout( wdg ); + Q3Frame *wdg = new Q3Frame( w ); + Q3VBoxLayout *layout = new Q3VBoxLayout( wdg ); QLabel *title = new QLabel( description(), wdg ); QFont titleFont( title->font() ); @@ -285,7 +287,7 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, p.setFont(QFont("helvetica", 7, QFont::Bold)); // int lineSpacing = p.fontMetrics().lineSpacing(); const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem(); - p.drawText(x, y, width, height/4, AlignCenter, calSys->monthName( qd ) ); + p.drawText(x, y, width, height/4, Qt::AlignCenter, calSys->monthName( qd ) ); int cellWidth = width/7; int cellHeight = height/8; @@ -301,7 +303,7 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, // tmpStr.sprintf("%c",(const char*)monthDate2.dayName(monthDate2.dayOfWeek())); tmpStr=calSys->weekDayName( monthDate2 )[0].upper(); p.drawText(x+col*cellWidth, y+height/4, cellWidth, cellHeight, - AlignCenter, tmpStr); + Qt::AlignCenter, tmpStr); monthDate2 = monthDate2.addDays(1); } @@ -318,7 +320,7 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, } p.drawText( x+col*cellWidth, y+height/4+cellHeight+(row*cellHeight), - cellWidth, cellHeight, AlignCenter, + cellWidth, cellHeight, Qt::AlignCenter, tmpStr.setNum(monthDate.day()) ); monthDate = monthDate.addDays(1); } @@ -358,7 +360,7 @@ void CalPrintBase::drawDaysOfWeekBox(QPainter &p, const QDate &qd, // p.fillRect( x+1, y+1, // width-2, height-2, // QBrush( Dense7Pattern ) ); - p.drawText( x+5, y, width-10, height, AlignCenter | AlignVCenter, + p.drawText( x+5, y, width-10, height, Qt::AlignCenter | Qt::AlignVCenter, calSys->weekDayName( qd ) ); } @@ -401,16 +403,16 @@ void CalPrintBase::drawTimeLine(QPainter &p, p.setFont(QFont("helvetica", 12, QFont::Bold)); } p.drawText(x+2, (int)currY+2, width/2-2, (int)cellHeight, - AlignTop|AlignRight, numStr); + Qt::AlignTop|Qt::AlignRight, numStr); p.setFont(QFont("helvetica", 10, QFont::Normal)); p.drawText(x+width/2, (int)currY+2, width/2+2, (int)(cellHeight/2)-3, - AlignTop | AlignLeft, "00"); + Qt::AlignTop | Qt::AlignLeft, "00"); } else { QTime time( curTime.hour(), 0 ); numStr = KGlobal::locale()->formatTime( time ); p.setFont(QFont("helvetica", 14, QFont::Bold)); p.drawText(x+2, (int)currY+2, width-4, (int)cellHeight/2-3, - AlignTop|AlignLeft, numStr); + Qt::AlignTop|Qt::AlignLeft, numStr); } currY+=cellHeight; } // enough space for half-hour line and time @@ -472,7 +474,7 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList, p.drawRect( x, offset, width, height ); p.drawText( x+5, offset+5, width-10, height-10, - AlignCenter | AlignVCenter | AlignJustify | WordBreak, + Qt::AlignCenter | Qt::AlignVCenter | Qt::AlignJustify | Qt::WordBreak, text ); // reset the colors p.setBrush( oldBrush ); @@ -493,7 +495,7 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList, if (!multiDayStr.isEmpty()) { // p.fillRect(x+1, offset+1, width-2, height-2, QBrush(Dense5Pattern) ); p.drawText( x+5, offset+5, width-10, height-10, - AlignLeft | AlignTop | AlignJustify , + Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify , multiDayStr); } } else { @@ -560,7 +562,7 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, // Calculate horizontal positions and widths of events taking into account // overlapping events - QPtrList cells; + Q3PtrList cells; cells.setAutoDelete( true ); Event::List::ConstIterator itEvents; @@ -568,7 +570,7 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, cells.append( new PrintCellItem( *itEvents, qd ) ); } - QPtrListIterator it1( cells ); + Q3PtrListIterator it1( cells ); for( it1.toFirst(); it1.current(); ++it1 ) { KOrg::CellItem *placeItem = it1.current(); @@ -593,7 +595,7 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, p.setBackgroundColor( oldBgColor ); } - p.setBrush( QBrush( NoBrush ) ); + p.setBrush( QBrush( Qt::NoBrush ) ); } @@ -635,7 +637,7 @@ void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p, p.setPen( pe ); p.drawRect( currentX, currentyPos+1, currentWidth+1, eventLength+1 ); p.drawText( currentX+3, currentyPos+2, currentWidth-5, eventLength-3, - AlignLeft | AlignTop | AlignJustify | WordBreak, + Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify | Qt::TextWordWrap, text); // p.restore(); } @@ -670,7 +672,7 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, if (!hstring.isEmpty()) { p.setFont( QFont( "helvetica", 8, QFont::Bold, true ) ); - p.drawText( x+5, y, width-25, mSubHeaderHeight, AlignLeft | AlignVCenter, + p.drawText( x+5, y, width-25, mSubHeaderHeight, Qt::AlignLeft | Qt::AlignVCenter, hstring ); } p.setFont(QFont("helvetica", 10, QFont::Bold)); @@ -680,7 +682,7 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, if ( fm.width( dayNumStr ) > width -10 ) dayNumStr = local->formatDate(qd, true); } - p.drawText(x+5, y, width-10, mSubHeaderHeight, AlignRight | AlignVCenter, + p.drawText(x+5, y, width-10, mSubHeaderHeight, Qt::AlignRight | Qt::AlignVCenter, dayNumStr); Event::List eventList; eventList.fill( mCalendar->events( qd, true )); @@ -724,7 +726,7 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, } // doesFloat p.drawText(x+5, y+textY, width-10, lineSpacing, - AlignLeft|AlignBottom, outStr); + Qt::AlignLeft|Qt::AlignBottom, outStr); textY+=lineSpacing; } @@ -743,7 +745,7 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, text += i18n("To-Do: %1").arg(todo->summary()); p.drawText(x+5, y+textY, width-10, lineSpacing, - AlignLeft|AlignBottom, text); + Qt::AlignLeft|Qt::AlignBottom, text); textY+=lineSpacing; } } @@ -849,7 +851,7 @@ void CalPrintBase::drawMonth(QPainter &p, const QDate &qd, bool weeknumbers, for (int row = 0; row startPoints; + static Q3PtrList startPoints; if (level<1) { startPoints.clear(); } @@ -910,12 +912,12 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & outStr += " [" +local->formatDate(item->dtDue().date(),true)+"]"; } int left = possummary+(level*10); - rect = p.boundingRect(left, y, (posdue-left-5),-1, WordBreak, outStr); + rect = p.boundingRect(left, y, (posdue-left-5),-1, Qt::WordBreak, outStr); //qDebug("bottom1 %d ", rect.bottom() ); if ( !item->description().isEmpty() && desc ) { outStr = item->description(); rect = p.boundingRect( left+20, rect.bottom()+5, width-(left+10-x), -1, - WordBreak, outStr ); + Qt::WordBreak, outStr ); } //qDebug("bottom2 %d y+h %d y %d ph %d", rect.bottom(), y+height, y , pageHeight ); // if too big make new page @@ -933,8 +935,7 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & start = rct->mRect.bottom() + 1; else start = p.viewport().top(); - p.moveTo( center, start ); - p.lineTo( center, to ); + p.drawLine( center, start, center, to ); rct->mSamePage=false; } } @@ -951,12 +952,12 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & // Priority outStr.setNum(priority); - rect = p.boundingRect(pospriority, y + 10, 5, -1, AlignCenter, outStr); + rect = p.boundingRect(pospriority, y + 10, 5, -1, Qt::AlignCenter, outStr); // Make it a more reasonable size rect.setWidth(19); rect.setHeight(19); if ( priority > 0 && pospriority>=0 ) { - p.drawText(rect, AlignCenter, outStr); + p.drawText(rect, Qt::AlignCenter, outStr); p.drawRect(rect); // cross out the rectangle for completed items if ( item->isCompleted() ) { @@ -964,7 +965,7 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & p.drawLine( rect.topRight(), rect.bottomLeft() ); } else if (item->cancelled() ) { QPen pen = p.pen(); - p.setPen ( QPen ( black, 2) ); + p.setPen ( QPen ( Qt::black, 2) ); p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 ); p.setPen( pen ); } @@ -981,9 +982,8 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & bottom = 0; int to( rect.top() + (rect.height()/2)+1 ); int endx( rect.left() ); - p.moveTo(center, bottom); - p.lineTo(center, to); - p.lineTo(endx, to); + p.drawLine(center,bottom, center,to); + p.drawLine(center,to, endx,to); } // if completed, use strike out font @@ -999,9 +999,9 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & outStr += " [" +item->dtDueStr(true)+"]"; } rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)), - -1, WordBreak, outStr); + -1, Qt::WordBreak, outStr); QRect newrect; - p.drawText( rect, WordBreak, outStr, -1, &newrect ); + p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect ); //ft.setStrikeOut(false); // p.setFont(ft); @@ -1016,8 +1016,8 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & y=newrect.bottom() + 5; outStr = item->description(); rect = p.boundingRect( left+20, y, x+width-(left+10), -1, - WordBreak, outStr ); - p.drawText( rect, WordBreak, outStr, -1, &newrect ); + Qt::WordBreak, outStr ); + p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect ); } // Set the new line position @@ -1138,8 +1138,8 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, mSubHeaderHeight+= mSubHeaderHeight; KLocale *local = KGlobal::locale(); QFont font("helvetica", 18, QFont::Bold); - QPen penA( black,0); - QPen penB( black,3); + QPen penA( Qt::black,0); + QPen penB( Qt::black,3); p.setFont(font); int lineSpacing = p.fontMetrics().lineSpacing(); QString title; @@ -1161,7 +1161,7 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, QFontInfo info(p.font()); lineSpacing = p.fontMetrics().lineSpacing(); - p.drawText(0, lineSpacing * 0, width, lineSpacing, AlignRight |AlignTop, title ); + p.drawText(0, lineSpacing * 0, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title ); title.truncate(0); @@ -1171,7 +1171,7 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, p.setFont(QFont("Helvetica", 20, QFont::Bold, TRUE)); title += QString::number(fd.year()); - p.drawText(0, lineSpacing * 1, width, lineSpacing, AlignRight |AlignTop, title ); + p.drawText(0, lineSpacing * 1, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title ); mSubHeaderHeight = tempStore ; } @@ -1197,7 +1197,7 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width, p.setPen( Qt::black); p.setFont(QFont("helvetica", 12, QFont::Bold, true)); p.drawText(offsetLeft, mHeaderHeight + 5, - width, mSubHeaderHeight, AlignHCenter | AlignVCenter, + width, mSubHeaderHeight, Qt::AlignHCenter | Qt::AlignVCenter, dayName); p.setPen( QPen(Qt::black,2)); @@ -1254,10 +1254,10 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width, p.drawRect(offsetLeft+2, 1+offset+startMinuteOff+startTime*cellHeight, width-4, cheight); p.drawText(offsetLeft+12, offset+startMinuteOff+startTime*cellHeight+5, width-24, - cheight-10, AlignHCenter | AlignTop, text); + cheight-10, Qt::AlignHCenter | Qt::AlignTop, text); } } - p.setBrush(QBrush(NoBrush)); + p.setBrush(QBrush(Qt::NoBrush)); mSubHeaderHeight = tempStore ; } @@ -1274,12 +1274,12 @@ void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth, QString numStr; for (int i = 0; i < hours; i++) { - p.setPen(QPen(black,1)); + p.setPen(QPen(Qt::black,1)); p.drawLine(0, offset+i*cellHeight, width, offset+i*cellHeight); - p.setPen(QPen(gray,0)); + p.setPen(QPen(Qt::gray,0)); p.drawLine(37, offset+i*cellHeight+(cellHeight/2), width, offset+i*cellHeight+(cellHeight/2)); - p.setPen(QPen(black,0)); + p.setPen(QPen(Qt::black,0)); if ( !KGlobal::locale()->use12Clock() ) { numStr.setNum(i+startHour); @@ -1289,16 +1289,16 @@ void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth, p.setFont(QFont("helvetica", 14, QFont::Bold)); } p.drawText(0, offset+i*cellHeight, 33, cellHeight/2, - AlignTop|AlignRight, numStr); + Qt::AlignTop|Qt::AlignRight, numStr); p.setFont(QFont("helvetica", 12, QFont::Bold)); p.drawText(37, offset+i*cellHeight, 45, cellHeight/2, - AlignTop | AlignLeft, "00"); + Qt::AlignTop | Qt::AlignLeft, "00"); } else { QTime time( i + startHour, 0 ); numStr = KGlobal::locale()->formatTime( time ); p.setFont(QFont("helvetica", 12, QFont::Bold)); p.drawText(4, offset+i*cellHeight, 70, cellHeight/2, - AlignTop|AlignLeft, numStr); + Qt::AlignTop|Qt::AlignLeft, numStr); } } mSubHeaderHeight = tempStore ; } diff --git a/korganizer/calprinter.cpp b/korganizer/calprinter.cpp index 0cdf28e..d4bf988 100644 --- a/korganizer/calprinter.cpp +++ b/korganizer/calprinter.cpp @@ -21,15 +21,18 @@ without including the source code for Qt in the source distribution. */ -#include -#include +// #include +#include #include #include #include #include #include -#include +#include #include +//Added by qt3to4: +#include +#include #include #include @@ -174,14 +177,14 @@ void CalPrinter::updateConfig() /****************************************************************************/ -CalPrintDialog::CalPrintDialog( QPtrList plugins, KPrinter *p, +CalPrintDialog::CalPrintDialog( Q3PtrList plugins, KPrinter *p, QWidget *parent, const char *name ) : KDialogBase( parent, name, /*modal*/true, i18n("Print"), Ok | Cancel ), mPrinter( p ), mPrintPlugins( plugins ) { - QVBox *page = new QVBox(this);//makeVBoxMainWidget(); + Q3VBox *page = new Q3VBox(this);//makeVBoxMainWidget(); setMainWidget( page ); - QHBox *printerLayout = new QHBox( page ); + Q3HBox *printerLayout = new Q3HBox( page ); mPrinterLabel = new QLabel( printerLayout ); QPushButton *setupButton = new QPushButton( i18n("&Setup Printer..."), @@ -191,20 +194,20 @@ CalPrintDialog::CalPrintDialog( QPtrList plugins, KPrinter *p, 0, 0, setupButton->sizePolicy().hasHeightForWidth() ) ); QSplitter *splitter = new QSplitter( page ); - splitter->setOrientation( QSplitter::Horizontal ); + splitter->setOrientation( Qt::Horizontal ); - mTypeGroup = new QVButtonGroup( i18n("View Type"), splitter, "buttonGroup" ); + mTypeGroup = new Q3VButtonGroup( i18n("View Type"), splitter, "buttonGroup" ); // use the minimal width possible = max width of the radio buttons, not extensible /* mTypeGroup->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, mTypeGroup->sizePolicy().hasHeightForWidth() ) );*/ QWidget *splitterRight = new QWidget( splitter, "splitterRight" ); - QGridLayout *splitterRightLayout = new QGridLayout( splitterRight ); + Q3GridLayout *splitterRightLayout = new Q3GridLayout( splitterRight ); splitterRightLayout->setMargin( marginHint() ); splitterRightLayout->setSpacing( spacingHint() ); - mConfigArea = new QWidgetStack( splitterRight, "configWidgetStack" ); + mConfigArea = new Q3WidgetStack( splitterRight, "configWidgetStack" ); splitterRightLayout->addMultiCellWidget( mConfigArea, 0,0, 0,1 ); QLabel *orientationLabel = new QLabel( i18n("Page &orientation:"), diff --git a/korganizer/calprinter.h b/korganizer/calprinter.h index 7b58f4f..e065779 100644 --- a/korganizer/calprinter.h +++ b/korganizer/calprinter.h @@ -1,3 +1,5 @@ +//Added by qt3to4: +#include /* This file is part of KOrganizer. @@ -28,7 +30,7 @@ #ifndef KORG_NOPRINTER -#include +#include #include @@ -38,8 +40,8 @@ using namespace KCal; -class QVButtonGroup; -class QWidgetStack; +class Q3VButtonGroup; +class Q3WidgetStack; class KPrinter; class CalPrintDialog; class KConfig; @@ -94,7 +96,7 @@ class CalPrinter : public QObject, public KOrg::CalPrinterBase void print( PrintType type, const QDate &fd, const QDate &td ); protected: - QPtrList mPrintPlugins; + Q3PtrList mPrintPlugins; private: KPrinter *mPrinter; @@ -109,7 +111,7 @@ class CalPrintDialog : public KDialogBase { Q_OBJECT public: - CalPrintDialog( QPtrList plugins, KPrinter *p, + CalPrintDialog( Q3PtrList plugins, KPrinter *p, QWidget *parent = 0, const char *name = 0 ); virtual ~CalPrintDialog(); CalPrintBase *selectedPlugin(); @@ -127,9 +129,9 @@ signals: void okClicked(); private: KPrinter *mPrinter; - QVButtonGroup *mTypeGroup; - QWidgetStack *mConfigArea; - QPtrList mPrintPlugins; + Q3VButtonGroup *mTypeGroup; + Q3WidgetStack *mConfigArea; + Q3PtrList mPrintPlugins; QLabel *mPrinterLabel; QString mPreviewText; QComboBox *mOrientationSelection; diff --git a/korganizer/calprintplugins.cpp b/korganizer/calprintplugins.cpp index bc35ca4..9b6dc6e 100644 --- a/korganizer/calprintplugins.cpp +++ b/korganizer/calprintplugins.cpp @@ -25,11 +25,11 @@ */ #include -#include +#include #include #include #include -#include +#include #include #include diff --git a/korganizer/cellitem.cpp b/korganizer/cellitem.cpp index 61d06ac..1fd703c 100644 --- a/korganizer/cellitem.cpp +++ b/korganizer/cellitem.cpp @@ -27,7 +27,9 @@ #include #include -#include +#include +//Added by qt3to4: +#include using namespace KOrg; @@ -36,17 +38,17 @@ QString CellItem::label() const return i18n(""); } -QPtrList CellItem::placeItem( QPtrList cells, +Q3PtrList CellItem::placeItem( Q3PtrList cells, CellItem *placeItem ) { kdDebug(5855) << "Placing " << placeItem->label() << endl; - QPtrList conflictItems; + Q3PtrList conflictItems; int maxSubCells = 0; - QIntDict subCellDict; + Q3IntDict subCellDict; // Find all items which are in same cell - QPtrListIterator it2( cells ); + Q3PtrListIterator it2( cells ); for( it2.toFirst(); it2.current(); ++it2 ) { KOrg::CellItem *item = it2.current(); if ( item == placeItem ) continue; @@ -83,7 +85,7 @@ QPtrList CellItem::placeItem( QPtrList cells, conflictItems.append( placeItem ); placeItem->setSubCells( maxSubCells ); - QPtrListIterator it3( conflictItems ); + Q3PtrListIterator it3( conflictItems ); for( it3.toFirst(); it3.current(); ++it3 ) { (*it3)->setSubCells( maxSubCells ); } diff --git a/korganizer/cellitem.h b/korganizer/cellitem.h index 72773d0..b917bd5 100644 --- a/korganizer/cellitem.h +++ b/korganizer/cellitem.h @@ -25,7 +25,7 @@ #define KORG_CELLITEM_H #include -#include +#include namespace KOrg { @@ -53,7 +53,7 @@ class CellItem \return Placed items */ - static QPtrList placeItem( QPtrList cells, + static Q3PtrList placeItem( Q3PtrList cells, CellItem *placeItem ); private: diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index ea510f1..53507d3 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp @@ -34,6 +34,8 @@ #include "datenavigatorcontainer.h" #include "koprefs.h" +//Added by qt3to4: +#include DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, const char *name ) diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h index 87cc59f..75d387c 100644 --- a/korganizer/datenavigatorcontainer.h +++ b/korganizer/datenavigatorcontainer.h @@ -1,3 +1,6 @@ +//Added by qt3to4: +#include +#include /* This file is part of KOrganizer. @@ -100,7 +103,7 @@ class DateNavigatorContainer: public QWidget KCal::Calendar *mCalendar; - QPtrList mExtraViews; + Q3PtrList mExtraViews; int mHorizontalCount; int mVerticalCount; diff --git a/korganizer/filteredit_base.cpp b/korganizer/filteredit_base.cpp index 505edf6..9425963 100644 --- a/korganizer/filteredit_base.cpp +++ b/korganizer/filteredit_base.cpp @@ -11,42 +11,47 @@ #include #include -#include -#include +#include +#include #include +#include #include -#include +#include #include #include #include #include -#include +#include +//Added by qt3to4: +#include +#include +#include #include "tr.h" /* * Constructs a FilterEdit_base as a child of 'parent', with the * name 'name' and widget flags set to 'f'. */ -FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) +FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, Qt::WFlags fl ) : QWidget( parent, name, fl ) { if ( !name ) setName( "FilterEdit_base" ); - FilterEdit_baseLayout = new QVBoxLayout( this, 0, 0, "FilterEdit_baseLayout"); + FilterEdit_baseLayout = new Q3VBoxLayout( this, 0, 0, "FilterEdit_baseLayout"); - mCriteriaFrame = new QFrame( this, "mCriteriaFrame" ); - mCriteriaFrame->setFrameShape( QFrame::StyledPanel ); - mCriteriaFrame->setFrameShadow( QFrame::Raised ); - mCriteriaFrameLayout = new QVBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout"); + mCriteriaFrame = new Q3Frame( this, "mCriteriaFrame" ); + mCriteriaFrame->setFrameShape( Q3Frame::StyledPanel ); + mCriteriaFrame->setFrameShadow( Q3Frame::Raised ); + mCriteriaFrameLayout = new Q3VBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout"); - ButtonGroup1 = new QButtonGroup( mCriteriaFrame, "ButtonGroup1" ); + ButtonGroup1 = new Q3ButtonGroup( mCriteriaFrame, "ButtonGroup1" ); ButtonGroup1->setColumnLayout(0, Qt::Vertical ); ButtonGroup1->layout()->setSpacing( 6 ); ButtonGroup1->layout()->setMargin( 6 ); - ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() ); + ButtonGroup1Layout = new Q3GridLayout( ButtonGroup1->layout() ); ButtonGroup1Layout->setAlignment( Qt::AlignTop ); - layout4 = new QHBoxLayout( 0, 0, 6, "layout4"); + layout4 = new Q3HBoxLayout( 0, 0, 6, "layout4"); mCatShowCheck = new QRadioButton( ButtonGroup1, "mCatShowCheck" ); layout4->addWidget( mCatShowCheck ); @@ -59,12 +64,12 @@ FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) ButtonGroup1Layout->addLayout( layout4, 0, 0 ); - mCatList = new QListBox( ButtonGroup1, "mCatList" ); + mCatList = new Q3ListBox( ButtonGroup1, "mCatList" ); ButtonGroup1Layout->addWidget( mCatList, 1, 0 ); mCriteriaFrameLayout->addWidget( ButtonGroup1 ); - layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); + layout7 = new Q3HBoxLayout( 0, 0, 6, "layout7"); textLabel1 = new QLabel( mCriteriaFrame, "textLabel1" ); layout7->addWidget( textLabel1 ); @@ -76,7 +81,7 @@ FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) layout7->addWidget( mCompletedCheck ); mCriteriaFrameLayout->addLayout( layout7 ); - layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); + layout9 = new Q3HBoxLayout( 0, 0, 6, "layout9"); textLabel1_2 = new QLabel( mCriteriaFrame, "textLabel1_2" ); layout9->addWidget( textLabel1_2 ); @@ -91,7 +96,7 @@ FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) layout9->addWidget( mJournalCheck ); mCriteriaFrameLayout->addLayout( layout9 ); - layout2 = new QHBoxLayout( 0, 0, 0, "layout2"); + layout2 = new Q3HBoxLayout( 0, 0, 0, "layout2"); textLabel2 = new QLabel( mCriteriaFrame, "textLabel2" ); layout2->addWidget( textLabel2 ); @@ -109,7 +114,6 @@ FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) FilterEdit_baseLayout->addWidget( mCriteriaFrame ); languageChange(); resize( QSize(300, 200).expandedTo(minimumSizeHint()) ); - clearWState( WState_Polished ); } /* diff --git a/korganizer/filteredit_base.h b/korganizer/filteredit_base.h index 13a02c3..135f6fa 100644 --- a/korganizer/filteredit_base.h +++ b/korganizer/filteredit_base.h @@ -12,17 +12,23 @@ #include #include +//Added by qt3to4: +#include +#include +#include +#include +#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; class QSpacerItem; -class QFrame; -class QButtonGroup; +class Q3Frame; +class Q3ButtonGroup; class QRadioButton; class QPushButton; -class QListBox; -class QListBoxItem; +class Q3ListBox; +class Q3ListBoxItem; class QLabel; class QCheckBox; @@ -31,15 +37,15 @@ class FilterEdit_base : public QWidget Q_OBJECT public: - FilterEdit_base( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + FilterEdit_base( QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0 ); ~FilterEdit_base(); - QFrame* mCriteriaFrame; - QButtonGroup* ButtonGroup1; + Q3Frame* mCriteriaFrame; + Q3ButtonGroup* ButtonGroup1; QRadioButton* mCatShowCheck; QRadioButton* mCatHideCheck; QPushButton* mCatEditButton; - QListBox* mCatList; + Q3ListBox* mCatList; QLabel* textLabel1; QCheckBox* mRecurringCheck; QCheckBox* mCompletedCheck; @@ -53,13 +59,13 @@ public: QCheckBox* mConfidentialCheck; protected: - QVBoxLayout* FilterEdit_baseLayout; - QVBoxLayout* mCriteriaFrameLayout; - QGridLayout* ButtonGroup1Layout; - QHBoxLayout* layout4; - QHBoxLayout* layout7; - QHBoxLayout* layout9; - QHBoxLayout* layout2; + Q3VBoxLayout* FilterEdit_baseLayout; + Q3VBoxLayout* mCriteriaFrameLayout; + Q3GridLayout* ButtonGroup1Layout; + Q3HBoxLayout* layout4; + Q3HBoxLayout* layout7; + Q3HBoxLayout* layout9; + Q3HBoxLayout* layout2; protected slots: virtual void languageChange(); diff --git a/korganizer/filtereditdialog.cpp b/korganizer/filtereditdialog.cpp index df84911..a3cff49 100644 --- a/korganizer/filtereditdialog.cpp +++ b/korganizer/filtereditdialog.cpp @@ -26,8 +26,13 @@ #include #include #include -#include +#include #include +//Added by qt3to4: +#include +#include + +#include #include #include @@ -53,7 +58,7 @@ public: }; -FilterEditDialog::FilterEditDialog(QPtrList *filters,QWidget *parent, +FilterEditDialog::FilterEditDialog(Q3PtrList *filters,QWidget *parent, const char *name) : KDialogBase(parent,name,true,i18n("Edit Calendar Filters"), Ok|Apply|Cancel) @@ -80,7 +85,7 @@ FilterEditDialog::FilterEditDialog(QPtrList *filters,QWidget *parent, mEditor = new FilterEdit_base(mainWidget); - QGridLayout *topLayout = new QGridLayout(mainWidget,2,2); + Q3GridLayout *topLayout = new Q3GridLayout(mainWidget,2,2); topLayout->setSpacing(spacingHint()); topLayout->addWidget(mSelectionCombo,0,0); topLayout->addWidget(upButton,0,1); diff --git a/korganizer/filtereditdialog.h b/korganizer/filtereditdialog.h index 42aa3da..c1a52ed 100644 --- a/korganizer/filtereditdialog.h +++ b/korganizer/filtereditdialog.h @@ -23,7 +23,7 @@ #ifndef _FILTEREDITDIALOG_H #define _FILTEREDITDIALOG_H -#include +#include #include @@ -46,7 +46,7 @@ class FilterEditDialog : public KDialogBase { Q_OBJECT public: - FilterEditDialog(QPtrList *,QWidget *parent=0, const char *name=0); + FilterEditDialog(Q3PtrList *,QWidget *parent=0, const char *name=0); virtual ~FilterEditDialog(); public slots: @@ -74,7 +74,7 @@ class FilterEditDialog : public KDialogBase void writeFilter(CalFilter *); private: - QPtrList *mFilters; + Q3PtrList *mFilters; ComboFilterBox *mSelectionCombo; QPushButton *mRemoveButton; diff --git a/korganizer/incomingdialog.cpp b/korganizer/incomingdialog.cpp index fe78356..c2402d4 100644 --- a/korganizer/incomingdialog.cpp +++ b/korganizer/incomingdialog.cpp @@ -17,10 +17,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include #include #include #include +//Added by qt3to4: +#include #include #include @@ -56,9 +58,9 @@ #endif -ScheduleItemIn::ScheduleItemIn(QListView *parent,IncidenceBase *ev, +ScheduleItemIn::ScheduleItemIn(Q3ListView *parent,IncidenceBase *ev, Scheduler::Method method,ScheduleMessage::Status status) - : QListViewItem(parent) + : Q3ListViewItem(parent) { mIncidence = ev; mMethod = method; @@ -135,7 +137,7 @@ bool ScheduleItemVisitor::visit(Journal *) * TRUE to construct a modal dialog. */ IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, - QWidget* parent,const char* name,bool modal,WFlags fl) : + QWidget* parent,const char* name,bool modal,Qt::WFlags fl) : IncomingDialog_base(parent,name,modal,fl) { mCalendar = calendar; @@ -145,12 +147,12 @@ IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, #else mScheduler = new DummyScheduler(mCalendar); #endif - mMessageListView->setColumnAlignment(1,AlignHCenter); - mMessageListView->setColumnAlignment(2,AlignHCenter); - mMessageListView->setColumnAlignment(3,AlignHCenter); - mMessageListView->setColumnAlignment(4,AlignHCenter); - QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)), - this,SLOT(showEvent(QListViewItem *))); + mMessageListView->setColumnAlignment(1,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(2,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(3,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(4,Qt::AlignHCenter); + QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)), + this,SLOT(showEvent(Q3ListViewItem *))); retrieve(); } @@ -169,7 +171,7 @@ void IncomingDialog::setOutgoingDialog(OutgoingDialog *outgoing) void IncomingDialog::retrieve() { - QPtrList messages = mScheduler->retrieveTransactions(); + Q3PtrList messages = mScheduler->retrieveTransactions(); ScheduleMessage *message; for(message = messages.first();message;message = messages.next()) { @@ -252,7 +254,7 @@ void IncomingDialog::rejectMessage() } } -void IncomingDialog::showEvent(QListViewItem *item) +void IncomingDialog::showEvent(Q3ListViewItem *item) { IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); if( incidence && incidence->typeID() == eventID ) { @@ -269,7 +271,7 @@ bool IncomingDialog::incomeRefresh(ScheduleItemIn *item) if (ev) { //user interaction before?? Attendee *att; - QPtrList attlist = ev->attendees(); + Q3PtrList attlist = ev->attendees(); for (att=attlist.first(); att; att=attlist.next()) { Event *event = new Event(*ev); mOutgoing->addMessage(event,Scheduler::Request,att->email()); @@ -514,7 +516,7 @@ bool IncomingDialog::checkAttendeesInAddressbook(IncidenceBase *inc) #ifndef KORG_NOKABC KABC::AddressBook *add_book = KABC::StdAddressBook::self(); KABC::Addressee::List addressList; - QPtrList attendees; + Q3PtrList attendees; Attendee *att; attendees = inc->attendees(); for (att=attendees.first();att;att=attendees.next()) { diff --git a/korganizer/incomingdialog.h b/korganizer/incomingdialog.h index 413ce6a..e002b25 100644 --- a/korganizer/incomingdialog.h +++ b/korganizer/incomingdialog.h @@ -19,7 +19,7 @@ #ifndef INCOMINGDIALOG_H #define INCOMINGDIALOG_H -#include +#include #include #include @@ -29,10 +29,10 @@ using namespace KCal; -class ScheduleItemIn : public QListViewItem +class ScheduleItemIn : public Q3ListViewItem { public: - ScheduleItemIn(QListView *parent,IncidenceBase *ev,Scheduler::Method method, + ScheduleItemIn(Q3ListView *parent,IncidenceBase *ev,Scheduler::Method method, ScheduleMessage::Status status); virtual ~ScheduleItemIn() {} @@ -72,7 +72,7 @@ class IncomingDialog : public IncomingDialog_base Q_OBJECT public: IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, - QWidget* parent=0,const char* name=0,bool modal=false,WFlags fl=0); + QWidget* parent=0,const char* name=0,bool modal=false,Qt::WFlags fl=0); ~IncomingDialog(); void setOutgoingDialog(OutgoingDialog *outgoing); @@ -87,7 +87,7 @@ class IncomingDialog : public IncomingDialog_base void acceptAllMessages(); void acceptMessage(); void rejectMessage(); - void showEvent(QListViewItem *); + void showEvent(Q3ListViewItem *); protected: bool acceptMessage(ScheduleItemIn *item); diff --git a/korganizer/incomingdialog_base.cpp b/korganizer/incomingdialog_base.cpp index 8589803..5c5ace4 100644 --- a/korganizer/incomingdialog_base.cpp +++ b/korganizer/incomingdialog_base.cpp @@ -11,12 +11,14 @@ #include "incomingdialog_base.h" #include -#include -#include +#include +#include #include #include #include -#include +#include +//Added by qt3to4: +#include /* * Constructs a IncomingDialog_base as a child of 'parent', with the @@ -25,13 +27,13 @@ * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) +IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "IncomingDialog_base" ); - IncomingDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "IncomingDialog_baseLayout"); + IncomingDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "IncomingDialog_baseLayout"); PushButton4 = new QPushButton( this, "PushButton4" ); @@ -42,7 +44,7 @@ IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, boo IncomingDialog_baseLayout->addWidget( PushButton7, 5, 1 ); - mMessageListView = new QListView( this, "mMessageListView" ); + mMessageListView = new Q3ListView( this, "mMessageListView" ); mMessageListView->addColumn( tr2i18n( "Summary" ) ); mMessageListView->addColumn( tr2i18n( "Start Date" ) ); mMessageListView->addColumn( tr2i18n( "Start Time" ) ); diff --git a/korganizer/incomingdialog_base.h b/korganizer/incomingdialog_base.h index 7732384..537ef86 100644 --- a/korganizer/incomingdialog_base.h +++ b/korganizer/incomingdialog_base.h @@ -12,12 +12,16 @@ #include #include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QListView; -class QListViewItem; +//Added by qt3to4: +#include +#include +#include + +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; +class Q3ListView; +class Q3ListViewItem; class QPushButton; class IncomingDialog_base : public QDialog @@ -25,18 +29,18 @@ class IncomingDialog_base : public QDialog Q_OBJECT public: - IncomingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + IncomingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~IncomingDialog_base(); QPushButton* PushButton4; QPushButton* PushButton7; - QListView* mMessageListView; + Q3ListView* mMessageListView; QPushButton* PushButton7_2; QPushButton* PushButton8; QPushButton* PushButton9; protected: - QGridLayout* IncomingDialog_baseLayout; + Q3GridLayout* IncomingDialog_baseLayout; protected slots: virtual void languageChange(); diff --git a/korganizer/interfaces/korganizer/baseview.h b/korganizer/interfaces/korganizer/baseview.h index 2ac9de1..c828573 100644 --- a/korganizer/interfaces/korganizer/baseview.h +++ b/korganizer/interfaces/korganizer/baseview.h @@ -24,8 +24,8 @@ // KOBaseView is the abstract base class of all calendar views. #include -#include -#include +#include +#include #include #include @@ -88,7 +88,7 @@ class BaseView : public QWidget select a single event at a time, but some may be able to select more than one. */ - virtual QPtrList selectedIncidences() = 0; + virtual Q3PtrList selectedIncidences() = 0; /** @return a list of the dates of selected events. Most views can probably only @@ -153,7 +153,7 @@ class BaseView : public QWidget @param eventList a list of events to show. */ - virtual void showEvents(QPtrList eventList) = 0; + virtual void showEvents(Q3PtrList eventList) = 0; /** Updates the current display to reflect changes that may have happened diff --git a/korganizer/interfaces/korganizer/calendarviewbase.h b/korganizer/interfaces/korganizer/calendarviewbase.h index 3c715b1..1f49357 100644 --- a/korganizer/interfaces/korganizer/calendarviewbase.h +++ b/korganizer/interfaces/korganizer/calendarviewbase.h @@ -23,6 +23,8 @@ #include #include +//Added by qt3to4: +#include #include @@ -40,7 +42,7 @@ class CalendarViewBase : public QWidget Q_OBJECT public: CalendarViewBase(QWidget *parent, const char *name) : - QWidget(parent,name) {new QVBoxLayout(this);} + QWidget(parent,name) {new Q3VBoxLayout(this);} virtual ~CalendarViewBase() {}; virtual KCal::Calendar *calendar() = 0; diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 5269af7..2814c61 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp @@ -26,14 +26,21 @@ #include #include -#include +#include #include #include -#include +#include #include #include #include #include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include #include #include @@ -57,7 +64,7 @@ #include #endif JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : - QFrame(parent) + Q3Frame(parent) { int fac = 5; @@ -70,7 +77,7 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : mCalendar = calendar; mJournal = 0; visibleMode = true; - QHBox * vb = new QHBox ( this ); + Q3HBox * vb = new Q3HBox ( this ); QPixmap iconp; vb->setMargin ( KDialog::marginHint()-1 ); QPushButton * toggleJournal = new QPushButton( vb ); @@ -129,13 +136,13 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : } //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); mEditor->setWordWrap( KTextEdit::WidgetWidth ); - QBoxLayout *topLayout = new QVBoxLayout(this); + Q3BoxLayout *topLayout = new Q3VBoxLayout(this); topLayout->addWidget(vb); topLayout->addWidget(mEditor); mEditor->installEventFilter(this); installEventFilter(this); mTitle->installEventFilter(this); - setFocusPolicy (QWidget::NoFocus); + setFocusPolicy (Qt::NoFocus); connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); @@ -168,7 +175,7 @@ void JournalEntry::resizeEvent(QResizeEvent* e ) //setMaximumWidth( QApplication::desktop()->width() ); //qDebug("MAXXX %d ", QApplication::desktop()->width()); #endif - QFrame::resizeEvent( e ); + Q3Frame::resizeEvent( e ); } QSize JournalEntry::sizeHint() const { @@ -186,13 +193,13 @@ void JournalEntry::slotSaveTemplate() return; QFile fileIn( fileName ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { KMessageBox::error( this, i18n("Error saving template file\n '%1'.") .arg( fileName ) ); return; } // QString text; - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << mEditor->text(); fileIn.close(); @@ -208,12 +215,12 @@ void JournalEntry::slotLoadTemplate() if ( fileName.length() == 0 ) return; QFile fileIn( fileName ); - if (!fileIn.open( IO_ReadOnly ) ) { + if (!fileIn.open( QIODevice::ReadOnly ) ) { KMessageBox::error( this, i18n("Error loading template file\n '%1'.") .arg( fileName ) ); return; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); QString text = tsIn.read(); fileIn.close(); @@ -316,11 +323,11 @@ bool JournalEntry::eventFilter( QObject *o, QEvent *e ) { // kdDebug() << "JournalEntry::event received " << e->type() << endl; if ( isVisible() ) { - mEditor->setFocusPolicy (QWidget::StrongFocus); - mTitle->setFocusPolicy (QWidget::StrongFocus); + mEditor->setFocusPolicy (Qt::StrongFocus); + mTitle->setFocusPolicy (Qt::StrongFocus); } else { - mEditor->setFocusPolicy (QWidget::NoFocus); - mTitle->setFocusPolicy (QWidget::NoFocus); + mEditor->setFocusPolicy (Qt::NoFocus); + mTitle->setFocusPolicy (Qt::NoFocus); } if ( e->type() == QEvent::FocusOut ) { writeJournal(); @@ -335,7 +342,7 @@ bool JournalEntry::eventFilter( QObject *o, QEvent *e ) } } - return QFrame::eventFilter( o, e ); // standard event processing + return Q3Frame::eventFilter( o, e ); // standard event processing } void JournalEntry::writeJournal() diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index ee17da8..0adebe9 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h @@ -25,7 +25,12 @@ // // Widget showing one Journal entry -#include +#include +//Added by qt3to4: +#include +#include +#include +#include #include @@ -37,7 +42,7 @@ class KOLocationBox; using namespace KCal; -class JournalEntry : public QFrame { +class JournalEntry : public Q3Frame { Q_OBJECT public: JournalEntry(Calendar *,QWidget *parent); diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index 6697602..ecc7a2f 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -22,12 +22,16 @@ */ #include -#include +#include #include #include -#include +#include #include #include +//Added by qt3to4: +#include +#include +#include #include #include @@ -46,12 +50,12 @@ #include "kdatenavigator.h" KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) - : QFrame(parent, name), + : Q3Frame(parent, name), updateTimer(0L) { - setFrameStyle(QFrame::NoFrame); + setFrameStyle(Q3Frame::NoFrame); QDate startDate = QDate::currentDate(); - QGridLayout *topLayout = new QGridLayout(this,8,8); + Q3GridLayout *topLayout = new Q3GridLayout(this,8,8); if (! startDate.isValid()) { qDebug("KDateNavigator::invalid startdate "); @@ -81,7 +85,7 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) for( i = 0; i < 7; i++ ) { headings[i] = new QLabel("",this); //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); - headings[i]->setAlignment(AlignCenter); + headings[i]->setAlignment(Qt::AlignCenter); headings[i]->installEventFilter(this); topLayout->addWidget(headings[i],1,i+1); @@ -90,7 +94,7 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) // Create the weeknumber labels for( i = 0; i < 6; i++ ) { weeknos[i] = new QLabel(this); - weeknos[i]->setAlignment(AlignCenter ); + weeknos[i]->setAlignment(Qt::AlignCenter ); //weeknos[i]->setFont(QFont("Arial", 10)); if(!m_bShowWeekNums) { weeknos[i]->hide(); @@ -101,7 +105,7 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) } daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); - daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); + daymatrix->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken); daymatrix->setLineWidth(1); connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h index 780ebb8..2cbca76 100644 --- a/korganizer/kdatenavigator.h +++ b/korganizer/kdatenavigator.h @@ -23,9 +23,12 @@ #ifndef KDATENAVIGATOR_H #define KDATENAVIGATOR_H -#include +#include #include #include +//Added by qt3to4: +#include +#include #include @@ -38,7 +41,7 @@ class KCalendarSystem; class NavigatorBar; -class KDateNavigator: public QFrame +class KDateNavigator: public Q3Frame { Q_OBJECT public: @@ -133,8 +136,8 @@ class KDateNavigator: public QFrame int mMonthSignalOffset; NavigatorBar *mNavigatorBar; - QFrame *headingSep; - QFrame *weeknumSep; + Q3Frame *headingSep; + Q3Frame *weeknumSep; QLabel *headings[7]; QLabel *weeknos[7]; KODayMatrix *daymatrix; diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 1d4d6de..fe59787 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -29,12 +29,23 @@ #include #undef protected #endif -#include +#include #include #include -#include +#include #include #include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -63,7 +74,7 @@ extern int globalFlagBlockStartup; //////////////////////////////////////////////////////////////////////////// MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) - : QFrame(_agenda->viewport(),name), agenda(_agenda) + : Q3Frame(_agenda->viewport(),name), agenda(_agenda) { setLineWidth(0); setMargin(0); @@ -169,8 +180,8 @@ void MarcusBains::updateLocation(bool recalculate) Create an agenda widget with rows rows and columns columns. */ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, - const char *name,WFlags f) : - QScrollView(parent,name,f) + const char *name,Qt::WFlags f) : + Q3ScrollView(parent,name,f) { mAllAgendaPopup = 0; @@ -190,8 +201,8 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, Create an agenda widget with columns columns and one row. This is used for all-day events. */ -KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : - QScrollView(parent,name,f) +KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,Qt::WFlags f) : + Q3ScrollView(parent,name,f) { mAllAgendaPopup = 0; blockResize = false; @@ -231,7 +242,7 @@ void KOAgenda::init() mPopupTimer = new QTimer(this); connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); - mNewItemPopup = new QPopupMenu( this ); + mNewItemPopup = new Q3PopupMenu( this ); connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); QString pathString = ""; if ( !KOPrefs::instance()->mToolBarMiniIcons ) { @@ -240,18 +251,18 @@ void KOAgenda::init() } else pathString += "iconsmini/"; - mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); mNewItemPopup->insertSeparator ( ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("This month"),6 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"day" ), i18n("Day view"),3 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next week"),4 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"month" ), i18n("This month"),6 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); #ifndef _WIN32_ - int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase - viewport()->setWFlags ( wflags); + Qt::WindowFlags wflags = viewport()-> windowFlags() |Qt::WRepaintNoErase;//WResizeNoErase + viewport()->setWindowFlags ( wflags); #endif mGridSpacingX = 80; mResizeBorderWidth = 8; @@ -263,7 +274,7 @@ void KOAgenda::init() // Grab key strokes for keyboard navigation of agenda. Seems to have no // effect. Has to be fixed. - setFocusPolicy(WheelFocus); + setFocusPolicy(Qt::WheelFocus); connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); @@ -395,11 +406,11 @@ bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) case (QEvent::Leave): if (!mActionItem) - setCursor(arrowCursor); + setCursor(Qt::arrowCursor); return true; default: - return QScrollView::eventFilter(object,event); + return Q3ScrollView::eventFilter(object,event); } } void KOAgenda::popupMenu() @@ -505,11 +516,11 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) bool objIsNotViewport = (object != viewport()); bool leftButt = false; #ifdef DESKTOP_VERSION - leftButt = (me->button() == LeftButton); + leftButt = (me->button() == Qt::LeftButton); #endif switch (me->type()) { case QEvent::MouseButtonPress: - if (me->button() == LeftButton) { + if (me->button() == Qt::LeftButton) { mPopupTimer->start( 600 ); mLeftMouseDown = true; } @@ -578,10 +589,10 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) if ( objIsNotViewport ) { mPopupItem = (KOAgendaItem *)object; mPopupKind = 1; - if (me->button() == RightButton) { + if (me->button() == Qt::RightButton) { mPopupKind = 3; popupMenu(); - } else if (me->button() == LeftButton) { + } else if (me->button() == Qt::LeftButton) { mActionItem = (KOAgendaItem *)object; if (mActionItem) { emit signalClearSelection(); @@ -600,7 +611,7 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) mPopupKind = 2; selectItem(0); mActionItem = 0; - if (me->button() == RightButton) { + if (me->button() == Qt::RightButton) { int x,y; viewportToContents(viewportPos.x(),viewportPos.y(),x,y); int gx,gy; @@ -611,19 +622,19 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) mStartCellY = gy; mPopupKind = 4; popupMenu(); - } else if (me->button() == LeftButton) { - setCursor(arrowCursor); + } else if (me->button() == Qt::LeftButton) { + setCursor(Qt::arrowCursor); startSelectAction(viewportPos); } } break; case QEvent::MouseButtonRelease: - if (me->button() == LeftButton ) { + if (me->button() == Qt::LeftButton ) { mPopupTimer->stop(); } if (object != viewport()) { - if (me->button() == LeftButton && mLeftMouseDown) { + if (me->button() == Qt::LeftButton && mLeftMouseDown) { if (mActionItem) { QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); @@ -633,7 +644,7 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) mActionItem->resetMove(); placeSubCells( mActionItem ); // emit startDragSignal( mActionItem->incidence() ); - setCursor( arrowCursor ); + setCursor( Qt::arrowCursor ); mActionItem = 0; mActionType = NOP; mItemMoved = 0; @@ -645,11 +656,11 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) } } else { // ---------- viewport() - if (me->button() == LeftButton && mLeftMouseDown ) { //left click + if (me->button() == Qt::LeftButton && mLeftMouseDown ) { //left click endSelectAction( true ); // emit new event signal } } - if (me->button() == LeftButton) + if (me->button() == Qt::LeftButton) mLeftMouseDown = false; break; @@ -850,15 +861,15 @@ void KOAgenda::startItemAction(QPoint viewportPos) if ( allowResize && gridDistanceX < mResizeBorderWidth && mActionItem->cellX() == mCurrentCellX) { mActionType = RESIZELEFT; - setCursor(sizeHorCursor); + setCursor(Qt::sizeHorCursor); } else if ( allowResize && (mGridSpacingX - gridDistanceX) < mResizeBorderWidth && mActionItem->cellXWidth() == mCurrentCellX) { mActionType = RESIZERIGHT; - setCursor(sizeHorCursor); + setCursor(Qt::sizeHorCursor); } else { mActionType = MOVE; mActionItem->startMove(); - setCursor(sizeAllCursor); + setCursor(Qt::sizeAllCursor); } } else { int gridDistanceY = (y - gy * mGridSpacingY); @@ -866,16 +877,16 @@ void KOAgenda::startItemAction(QPoint viewportPos) mActionItem->cellYTop() == mCurrentCellY && !mActionItem->firstMultiItem()) { mActionType = RESIZETOP; - setCursor(sizeVerCursor); + setCursor(Qt::sizeVerCursor); } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && mActionItem->cellYBottom() == mCurrentCellY && !mActionItem->lastMultiItem()) { mActionType = RESIZEBOTTOM; - setCursor(sizeVerCursor); + setCursor(Qt::sizeVerCursor); } else { mActionType = MOVE; mActionItem->startMove(); - setCursor(sizeAllCursor); + setCursor(Qt::sizeAllCursor); } } } @@ -906,7 +917,7 @@ void KOAgenda::performItemAction(QPoint viewportPos) mActionItem->resetMove(); placeSubCells( mActionItem ); // emit startDragSignal( mActionItem->incidence() ); - setCursor( arrowCursor ); + setCursor( Qt::arrowCursor ); mActionItem = 0; mActionType = NOP; mItemMoved = 0; @@ -915,18 +926,18 @@ void KOAgenda::performItemAction(QPoint viewportPos) } else { switch ( mActionType ) { case MOVE: - setCursor( sizeAllCursor ); + setCursor( Qt::sizeAllCursor ); break; case RESIZETOP: case RESIZEBOTTOM: - setCursor( sizeVerCursor ); + setCursor( Qt::sizeVerCursor ); break; case RESIZELEFT: case RESIZERIGHT: - setCursor( sizeHorCursor ); + setCursor( Qt::sizeHorCursor ); break; default: - setCursor( arrowCursor ); + setCursor( Qt::arrowCursor ); } } @@ -971,7 +982,7 @@ void KOAgenda::performItemAction(QPoint viewportPos) int x,y; gridToContents(mCurrentCellX,mActionItem->cellYTop(),x,y); //moveChild(mActionItem,childX(mActionItem),y); - QScrollView::moveChild( mActionItem,childX(mActionItem),y ); + Q3ScrollView::moveChild( mActionItem,childX(mActionItem),y ); } } else if (mActionType == RESIZEBOTTOM) { if (mCurrentCellY >= mActionItem->cellYTop()) { @@ -1019,7 +1030,7 @@ void KOAgenda::endItemAction() type = -1; KOAgendaItem *modifiedItem = placeItem; //emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */); - QPtrList oldconflictItems ;//= placeItem->conflictItems(); + Q3PtrList oldconflictItems ;//= placeItem->conflictItems(); KOAgendaItem *item; if ( placeItem->incidence()->typeID() == todoID ) { @@ -1110,7 +1121,7 @@ void KOAgenda::endItemAction() emit incidenceSelected( mActionItem->incidence() ); mScrollUpTimer.stop(); mScrollDownTimer.stop(); - setCursor( arrowCursor ); + setCursor( Qt::arrowCursor ); mActionItem = 0; mActionType = NOP; mItemMoved = 0; @@ -1136,25 +1147,25 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos) int gridDistanceX = (x - gx * mGridSpacingX); if (gridDistanceX < mResizeBorderWidth && moveItem->cellX() == gx) { - setCursor(sizeHorCursor); + setCursor(Qt::sizeHorCursor); } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && moveItem->cellXWidth() == gx) { - setCursor(sizeHorCursor); + setCursor(Qt::sizeHorCursor); } else { - setCursor(arrowCursor); + setCursor(Qt::arrowCursor); } } else { int gridDistanceY = (y - gy * mGridSpacingY); if (gridDistanceY < mResizeBorderWidth && moveItem->cellYTop() == gy && !moveItem->firstMultiItem()) { - setCursor(sizeVerCursor); + setCursor(Qt::sizeVerCursor); } else if ((mGridSpacingY - gridDistanceY) < mResizeBorderWidth && moveItem->cellYBottom() == gy && !moveItem->lastMultiItem()) { - setCursor(sizeVerCursor); + setCursor(Qt::sizeVerCursor); } else { - setCursor(arrowCursor); + setCursor(Qt::arrowCursor); } } } @@ -1173,9 +1184,9 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos) void KOAgenda::placeSubCells(KOAgendaItem *placeItem) { - QPtrList conflictItems; + Q3PtrList conflictItems; int maxSubCells = 0; - QIntDict subCellDict(7); + Q3IntDict subCellDict(7); KOAgendaItem *item; for ( item=mItems.first(); item != 0; item=mItems.next() ) { @@ -1240,7 +1251,7 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) item=conflictItems.next() ) { if ( placeItem != item ) { KOAgendaItem *item2; - QPtrList conflictItems2 = item->conflictItems(); + Q3PtrList conflictItems2 = item->conflictItems(); for ( item2=conflictItems2.first(); item2 != 0; item2=conflictItems2.next() ) { if ( item2->subCells() != maxSubCells) { @@ -1325,9 +1336,9 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) if ( vySel < 0 ) off += vySel; //qDebug("OFF %d %d %d", off,vySel, vy ); - bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP); + bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,QPainter::CompositionMode_Source); } else { - bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); + bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source); } } if ( mSelectionHeight > 0 ) { @@ -1342,7 +1353,7 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) int p_hei = 5; if ( hei < 5 ) p_hei = hei; hei -= 5; - bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP); + bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source); offset += 5; } } @@ -1365,7 +1376,7 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) contentsToViewport ( cx, cy, vx,vy); // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) - bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); + bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source); if ( mSelectionHeight > 0 ) { //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); @@ -1379,7 +1390,7 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) int p_hei = 5; if ( hei < 5 ) p_hei = hei; hei -= 5; - bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP); + bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source); offset += 5; } } @@ -1576,14 +1587,14 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i int y = ((int)(cy/lGridSpacingY))*lGridSpacingY; if ( lGridSpacingY > 0 ) { while (y < cy + ch) { - p->setPen( SolidLine ); + p->setPen( Qt::SolidLine ); p->drawLine(cx,y,cx+cw,y); y+=lGridSpacingY; - p->setPen( DotLine ); + p->setPen( Qt::DotLine ); p->drawLine(cx,y,cx+cw,y); y+=lGridSpacingY; } - p->setPen( SolidLine ); + p->setPen( Qt::SolidLine ); } mPixPainter.end() ; } @@ -1717,7 +1728,7 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) item->select(false); mUnusedItems.append( item ); mItems.remove( item ); - QPtrList oldconflictItems = item->conflictItems(); + Q3PtrList oldconflictItems = item->conflictItems(); KOAgendaItem *itemit; //globalFlagBlockAgendaItemPaint = 1; for ( itemit=oldconflictItems.first(); itemit != 0; @@ -1747,7 +1758,7 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) return; //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); QDate currentDate = QDate::currentDate(); - bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); + bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); QDateTime dt; if ( todo->hasCompletedDate() ) dt = todo->completed(); @@ -1779,7 +1790,7 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) } qApp->processEvents(); globalFlagBlockAgendaItemPaint = 0; - QPtrList oldconflictItems = item->conflictItems(); + Q3PtrList oldconflictItems = item->conflictItems(); KOAgendaItem *itemit; for ( itemit=oldconflictItems.first(); itemit != 0; itemit=oldconflictItems.next() ) { @@ -1867,7 +1878,7 @@ void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, int width = XEnd - XBegin + 1; int count = 0; KOAgendaItem *current = 0; - QPtrList multiItems; + Q3PtrList multiItems; for (cellX = XBegin;cellX <= XEnd;++cellX) { if (cellX == XBegin) cellYTop = YTop; else cellYTop = 0; @@ -1927,7 +1938,7 @@ void KOAgenda::resizeEvent ( QResizeEvent *ev ) mSelectionHeight = 0; mResizeTimer.start( 150 , true ); computeSizes(); - QScrollView::resizeEvent( ev ); + Q3ScrollView::resizeEvent( ev ); return; } @@ -2016,7 +2027,7 @@ void KOAgenda::popupAlarm() } // TODO: deal correctly with multiple alarms Alarm* alarm; - QPtrList list(mClickedItem->incidence()->alarms()); + Q3PtrList list(mClickedItem->incidence()->alarms()); for(alarm=list.first();alarm;alarm=list.next()) { alarm->toggleAlarm(); } @@ -2107,16 +2118,16 @@ void KOAgenda::selectItem(KOAgendaItem *item) void KOAgenda::keyPressEvent( QKeyEvent *kev ) { switch(kev->key()) { - case Key_PageDown: + case Qt::Key_PageDown: verticalScrollBar()->addPage(); break; - case Key_PageUp: + case Qt::Key_PageUp: verticalScrollBar()->subtractPage(); break; - case Key_Down: + case Qt::Key_Down: verticalScrollBar()->addLine(); break; - case Key_Up: + case Qt::Key_Up: verticalScrollBar()->subtractLine(); break; default: @@ -2146,7 +2157,7 @@ void KOAgenda::setDateList(const DateList &selectedDates) mSelectedDates = selectedDates; } -void KOAgenda::setHolidayMask(QMemArray *mask) +void KOAgenda::setHolidayMask(Q3MemArray *mask) { mHolidayMask = mask; @@ -2162,7 +2173,7 @@ void KOAgenda::setHolidayMask(QMemArray *mask) void KOAgenda::contentsMousePressEvent ( QMouseEvent *event ) { - QScrollView::contentsMousePressEvent(event); + Q3ScrollView::contentsMousePressEvent(event); } void KOAgenda::storePosition() @@ -2196,13 +2207,13 @@ void KOAgenda::restorePosition() void KOAgenda::moveChild( QWidget *w, int x , int y ) { ++x; - QScrollView::moveChild( w, x , y ); + Q3ScrollView::moveChild( w, x , y ); } #include #ifdef DESKTOP_VERSION #include #include -#include +#include #endif void KOAgenda::printSelection() @@ -2231,7 +2242,7 @@ void KOAgenda::printSelection() return; } QPainter p( printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( printer ); QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() ); //date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true ); int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height(); diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h index 380ce62..0708341 100644 --- a/korganizer/koagenda.h +++ b/korganizer/koagenda.h @@ -23,27 +23,36 @@ #ifndef KOAGENDA_H #define KOAGENDA_H -#include +#include #include -#include +#include #include #include -#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include #include "koagendaitem.h" #include "koeventview.h" -class QPopupMenu; +class Q3PopupMenu; class QTime; class KConfig; -class QFrame; +class Q3Frame; class KOAgenda; class KCal::Event; class KCal::Todo; using namespace KCal; -class MarcusBains : public QFrame { +class MarcusBains : public Q3Frame { Q_OBJECT public: MarcusBains(KOAgenda *agenda=0,const char *name=0); @@ -63,7 +72,7 @@ class MarcusBains : public QFrame { }; -class KOAgenda : public QScrollView +class KOAgenda : public Q3ScrollView { Q_OBJECT public: @@ -71,9 +80,9 @@ class KOAgenda : public QScrollView RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, - const char * name=0, WFlags f=0 ); + const char * name=0, Qt::WFlags f=0 ); KOAgenda ( int columns, QWidget * parent=0, - const char * name=0, WFlags f=0 ); + const char * name=0, Qt::WFlags f=0 ); virtual ~KOAgenda(); bool mInvalidPixmap; @@ -117,7 +126,7 @@ class KOAgenda : public QScrollView void checkScrollBoundaries(); - void setHolidayMask(QMemArray *); + void setHolidayMask(Q3MemArray *); void setDateList(const DateList &selectedDates); DateList dateList() const; void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); @@ -277,10 +286,10 @@ class KOAgenda : public QScrollView KOAgendaItem *mClickedItem; // The KOAgendaItem, which is being moved/resized - QGuardedPtr mActionItem; + QPointer mActionItem; // Currently selected item - QGuardedPtr mSelectedItem; + QPointer mSelectedItem; // The Marcus Bains Line widget. MarcusBains *mMarcusBains; @@ -291,16 +300,16 @@ class KOAgenda : public QScrollView bool mItemMoved; // List of all Items contained in agenda - QPtrList mItems; - QPtrList mUnusedItems; + Q3PtrList mItems; + Q3PtrList mUnusedItems; KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport); - QPopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems - QPopupMenu *mNewItemPopup; + Q3PopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems + Q3PopupMenu *mNewItemPopup; int mOldLowerScrollValue; int mOldUpperScrollValue; KOAgendaItem * getItemForTodo ( Todo * todo ); - QMemArray *mHolidayMask; + Q3MemArray *mHolidayMask; int mCurPixWid; int mCurPixHei; }; diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 407424d..0f9a38f 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -19,13 +19,23 @@ #include #include -#include -#include +#include +#include #include -#include -#include +#include +#include #include #include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -57,10 +67,10 @@ QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; //-------------------------------------------------------------------------- -class KOAgendaItemWhatsThis :public QWhatsThis +class KOAgendaItemWhatsThis :public Q3WhatsThis { public: - KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; + KOAgendaItemWhatsThis( KOAgendaItem* view ) : Q3WhatsThis( view ),_view (view) { }; protected: virtual QString text( const QPoint& ) @@ -72,15 +82,15 @@ private: }; KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, - const char *name,WFlags) : + const char *name,Qt::WFlags) : QWidget(parent, name), mIncidence(incidence), mDate(qd) { #ifndef DESKTOP_VERSION //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); #endif mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this); - int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase - setWFlags ( wflags); + Qt::WindowFlags wflags = windowFlags() |Qt::WRepaintNoErase;// WResizeNoErase + setWindowFlags ( wflags); mAllDay = allday; init ( incidence, qd ); //setMouseTracking(true); @@ -103,7 +113,7 @@ void KOAgendaItem::initColor () if ( (mIncidence->typeID() == todoID ) && ( !((static_cast(mIncidence))->isCompleted()) && ((static_cast(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) { - if ( (static_cast(mIncidence))->dtDue() < QDateTime::currentDateTime().date()) + if ( (static_cast(mIncidence))->dtDue() < (QDateTime)QDateTime::currentDateTime().date()) mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; else mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; @@ -132,7 +142,7 @@ void KOAgendaItem::initColor () } mColorGroup = QColorGroup( BackgroundColor.light(), BackgroundColor.dark(),BackgroundColor.light(), - BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; + BackgroundColor.dark(),BackgroundColor, Qt::black, BackgroundColor) ; setBackgroundColor( mBackgroundColor ); mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); } @@ -228,28 +238,28 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) ++yOff; } if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::red ); if ( horLayout ) ++xOff; else ++yOff; } if (mIncidence->doesRecur()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::blue ); if ( horLayout ) ++xOff; else ++yOff; } if (mIncidence->description().length() > 0) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkGreen ); if ( horLayout ) ++xOff; else ++yOff; } if (mIncidence->isReadOnly()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::white ); if ( horLayout ) ++xOff; else @@ -259,7 +269,7 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) if (mIncidence->attendeeCount()>0) { if (mIncidence->organizer() == KOPrefs::instance()->email()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::black ); if ( horLayout ) ++xOff; else @@ -270,14 +280,14 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) } else { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::yellow ); if ( horLayout ) ++xOff; else ++yOff; } - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkYellow ); if ( horLayout ) ++xOff; else @@ -420,9 +430,9 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) } int align; #ifndef DESKTOP_VERSION - align = ( AlignLeft|WordBreak|AlignTop); + align = ( Qt::AlignLeft|Qt::TextWordWrap|Qt::AlignTop); #else - align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); + align = ( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); #endif if ( addIcon ) { if ( ! horLayout ) { @@ -435,7 +445,7 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) } } if ( mWhiteText ) - paint->setPen ( white); + paint->setPen ( Qt::white); if ( x < 0 ) { w = w+x-3; x = 3; @@ -444,9 +454,9 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) if ( w > parentWidget()->width() ){ w = parentWidget()->width() - 6; #ifndef DESKTOP_VERSION - align = ( AlignHCenter|WordBreak|AlignTop); + align = ( Qt::AlignHCenter|Qt::TextWordWrap|Qt::AlignTop); #else - align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); + align = ( Qt::AlignHCenter|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); #endif } @@ -561,7 +571,7 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) } } //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); - bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); + bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,QPainter::CompositionMode_Source); } void KOAgendaItem::computeText() { @@ -628,7 +638,7 @@ void KOAgendaItem::computeText() if (!mIncidence->location().isEmpty()) { tipText += "\n"+i18n("Location: ")+mIncidence->location(); } - QToolTip::add(this,tipText,toolTipGroup(),""); + QToolTip::add(this,tipText /*TODO:hacker: ,toolTipGroup(),"" */); #endif } void KOAgendaItem::updateItem() @@ -795,7 +805,7 @@ void KOAgendaItem::expandRight(int dx) QToolTipGroup *KOAgendaItem::toolTipGroup() { - if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); + /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */ return mToolTipGroup; } @@ -803,7 +813,7 @@ void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) { #ifndef KORG_NODND if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || - !QTextDrag::canDecode( e ) ) { + !Q3TextDrag::canDecode( e ) ) { e->ignore(); return; } @@ -815,7 +825,7 @@ void KOAgendaItem::dropEvent( QDropEvent *e ) { #ifndef KORG_NODND QString text; - if(QTextDrag::decode(e,text)) + if(Q3TextDrag::decode(e,text)) { kdDebug() << "Dropped : " << text << endl; QStringList emails = QStringList::split(",",text); @@ -833,12 +843,12 @@ void KOAgendaItem::dropEvent( QDropEvent *e ) } -QPtrList KOAgendaItem::conflictItems() +Q3PtrList KOAgendaItem::conflictItems() { return mConflictItems; } -void KOAgendaItem::setConflictItems(QPtrList ci) +void KOAgendaItem::setConflictItems(Q3PtrList ci) { mConflictItems = ci; KOAgendaItem *item; diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index 27ee720..17cf975 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h @@ -19,11 +19,18 @@ #ifndef KOAGENDAITEM_H #define KOAGENDAITEM_H -#include +#include #include #include #include #include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include #include @@ -45,7 +52,7 @@ class KOAgendaItem : public QWidget Q_OBJECT public: KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0, - WFlags f=0 ); + Qt::WFlags f=0 ); ~KOAgendaItem(); QString getWhatsThisText(); void init ( Incidence *incidence, QDate qd ); @@ -96,8 +103,8 @@ class KOAgendaItem : public QWidget static QToolTipGroup *toolTipGroup(); - QPtrList conflictItems(); - void setConflictItems(QPtrList); + Q3PtrList conflictItems(); + void setConflictItems(Q3PtrList); void addConflictItem(KOAgendaItem *ci); void paintMe( bool, QPainter* painter = 0 ); void repaintMe(); @@ -161,7 +168,7 @@ class KOAgendaItem : public QWidget QColorGroup mColorGroup; QString mDisplayedText; bool mSelected; - QPtrList mConflictItems; + Q3PtrList mConflictItems; }; #endif // KOAGENDAITEM_H diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 6e65a03..87993ae 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -21,21 +21,33 @@ without including the source code for Qt in the source distribution. */ -#include -#include +#include +#include #include -#include +#include #include #ifndef KORG_NOSPLITTER #include #endif #include #include -#include +#include #include #include #include #include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -78,8 +90,8 @@ using namespace KOrg; #define IDLETIMEOUT 45 -TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : - QScrollView(parent,name,f) +TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,Qt::WFlags f) : + Q3ScrollView(parent,name,f) { myPix.resize( 1, 1 ); mRows = rows; @@ -95,7 +107,7 @@ TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : resizeContents(50,mRows * mCellHeight); - viewport()->setBackgroundMode( PaletteBackground ); + viewport()->setBackgroundMode( Qt::PaletteBackground ); } void TimeLabels::setCellHeight(int height) @@ -283,7 +295,7 @@ void TimeLabels::paintEvent(QPaintEvent*) //////////////////////////////////////////////////////////////////////////// EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) - : QFrame(parent,name) + : Q3Frame(parent,name) { mColumns = 1; mTopBox = 0; @@ -393,7 +405,7 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : expandPix = SmallIcon("1leftrightarrow" ); } - QBoxLayout *topLayout = new QVBoxLayout(this); + Q3BoxLayout *topLayout = new Q3VBoxLayout(this); // Create day name labels for agenda columns // Create agenda splitter @@ -401,13 +413,13 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); topLayout->addWidget( mSplitterAgenda ); - mAllDayFrame = new QHBox(mSplitterAgenda); - mAllDayFrame->setFocusPolicy(NoFocus); + mAllDayFrame = new Q3HBox(mSplitterAgenda); + mAllDayFrame->setFocusPolicy(Qt::NoFocus); QWidget *agendaFrame = new QWidget(mSplitterAgenda); - agendaFrame->setFocusPolicy(NoFocus); + agendaFrame->setFocusPolicy(Qt::NoFocus); // Create all-day agenda widget - mDummyAllDayLeft = new QVBox( mAllDayFrame ); + mDummyAllDayLeft = new Q3VBox( mAllDayFrame ); mExpandButton = new QPushButton(mDummyAllDayLeft); mExpandButton->setPixmap( expandPix ); @@ -420,16 +432,16 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : // QSizePolicy::Fixed ) ); mExpandButton->setFixedSize( widebut, widebut); connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); - mExpandButton->setFocusPolicy(NoFocus); + mExpandButton->setFocusPolicy(Qt::NoFocus); mAllDayAgenda = new KOAgenda(1,mAllDayFrame); - mAllDayAgenda->setFocusPolicy(NoFocus); + mAllDayAgenda->setFocusPolicy(Qt::NoFocus); QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); // Create event context menu for all day agenda //mAllDayAgendaPopup = eventPopup(); // Create agenda frame - QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); + Q3GridLayout *agendaLayout = new Q3GridLayout(agendaFrame,4,3); // QHBox *agendaFrame = new QHBox(splitterAgenda); // create event indicator bars @@ -437,10 +449,10 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : #ifndef DESKTOP_VERSION mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); #endif - mDayLabelsFrame = new QHBox(agendaFrame); + mDayLabelsFrame = new Q3HBox(agendaFrame); //topLayout->addWidget(mDayLabelsFrame); - mDayLabels = new QFrame (mDayLabelsFrame); - mLayoutDayLabels = new QHBoxLayout(mDayLabels); + mDayLabels = new Q3Frame (mDayLabelsFrame); + mLayoutDayLabels = new Q3HBoxLayout(mDayLabels); agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); agendaLayout->addWidget(mEventIndicatorTop,1,1); @@ -460,12 +472,12 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); agendaLayout->setColStretch(1,1); - mAgenda->setFocusPolicy(NoFocus); + mAgenda->setFocusPolicy(Qt::NoFocus); // Create event context menu for agenda mAllAgendaPopup = eventPopup(); #if 0 - mAllAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), + mAllAgendaPopup->addAdditionalItem(QIcon(SmallIcon("bell")), i18n("Toggle Alarm"),mAgenda, SLOT(popupAlarm()),true); @@ -918,9 +930,9 @@ int KOAgendaView::currentDateCount() return mSelectedDates.count(); } -QPtrList KOAgendaView::selectedIncidences() +Q3PtrList KOAgendaView::selectedIncidences() { - QPtrList selected; + Q3PtrList selected; Incidence *incidence; incidence = mAgenda->selectedIncidence(); @@ -987,8 +999,8 @@ void KOAgendaView::updateConfig() mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); // ToolTips displaying summary of events - KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() - ->mEnableToolTips); + /* TODO:hacker: KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() + ->mEnableToolTips); */ //setHolidayMasks(); @@ -1117,7 +1129,7 @@ void KOAgendaView::showDates( const QDate &start, const QDate &end ) } -void KOAgendaView::showEvents(QPtrList) +void KOAgendaView::showEvents(Q3PtrList) { kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; } @@ -1165,11 +1177,11 @@ void KOAgendaView::fillAgenda() mMinY.resize(mSelectedDates.count()); mMaxY.resize(mSelectedDates.count()); - QPtrList dayEvents; + Q3PtrList dayEvents; // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. // Therefore, gtodoset all of them. - QPtrList todos = calendar()->todos(); + Q3PtrList todos = calendar()->todos(); mAgenda->setDateList(mSelectedDates); @@ -1300,7 +1312,7 @@ void KOAgendaView::fillAgenda() // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. // Already completed items can be displayed on their original due date //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda - bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; + bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)today) && KOPrefs::instance()->mShowTodoInAgenda; bool fillIn = false; if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) fillIn = true; @@ -1503,7 +1515,7 @@ void KOAgendaView::readSettings(KConfig *config) config->setGroup("Views"); //#ifndef KORG_NOSPLITTER - QValueList sizes = config->readIntListEntry("Separator AgendaView"); + Q3ValueList sizes = config->readIntListEntry("Separator AgendaView"); if (sizes.count() == 2) { if ( sizes[0] < 20 ) { sizes[1] = sizes[1] +20 - sizes[0]; @@ -1524,7 +1536,7 @@ void KOAgendaView::writeSettings(KConfig *config) config->setGroup("Views"); //#ifndef KORG_NOSPLITTER - QValueList list = mSplitterAgenda->sizes(); + Q3ValueList list = mSplitterAgenda->sizes(); config->writeEntry("Separator AgendaView",list); //qDebug("write %d %d ", list[0],list[1] ); //#endif @@ -1541,7 +1553,7 @@ void KOAgendaView::setHolidayMasks() bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); bool showHoliday = false; if ( KOPrefs::instance()->mExcludeHolidays ) { - QPtrList events = calendar()->events( date, true ); + Q3PtrList events = calendar()->events( date, true ); Event *event; for( event = events.first(); event; event = events.next() ) { if ( event->isHoliday()) { @@ -1663,7 +1675,7 @@ void KOAgendaView::updateTodo( Todo * t, int ) removeAD = true; } else { - bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; + bool overdue = (!t->isCompleted()) && (t->dtDue() < (QDateTime)QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; if ( overdue && QDate::currentDate() >= mSelectedDates.first() && QDate::currentDate() <= mSelectedDates.last()) { diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 5e68146..3b871d9 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h @@ -23,21 +23,31 @@ #ifndef KOAGENDAVIEW_H #define KOAGENDAVIEW_H -#include +#include #include #include #include +#include #ifndef DESKTOP_VERSION #include #else #include #endif -#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include #include "koeventview.h" -class QHBox; -class QFrame; +class Q3HBox; +class Q3Frame; class QLabel; class QPushButton; class CalendarView; @@ -55,7 +65,7 @@ class KOAgendaButton : public QPushButton { mNum = -3; setFlat( true ); - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); connect( this, SIGNAL( clicked() ), this, SLOT ( bClicked() ) ); }; @@ -70,10 +80,10 @@ private: int mNum; }; -class TimeLabels : public QScrollView { +class TimeLabels : public Q3ScrollView { Q_OBJECT public: - TimeLabels(int rows,QWidget *parent=0,const char *name=0,WFlags f=0); + TimeLabels(int rows,QWidget *parent=0,const char *name=0,Qt::WFlags f=0); void setCellHeight(int height); @@ -113,7 +123,7 @@ class TimeLabels : public QScrollView { KOAgenda* mAgenda; }; -class EventIndicator : public QFrame { +class EventIndicator : public Q3Frame { Q_OBJECT public: enum Location { Top, Bottom }; @@ -132,11 +142,11 @@ class EventIndicator : public QFrame { int mXOffset; KDGanttMinimizeSplitter* mPaintWidget; int mColumns; - QHBox *mTopBox; - QBoxLayout *mTopLayout; + Q3HBox *mTopBox; + Q3BoxLayout *mTopLayout; Location mLocation; QPixmap mPixmap; - QMemArray mEnabled; + Q3MemArray mEnabled; }; /** @@ -159,7 +169,7 @@ class KOAgendaView : public KOEventView { virtual int currentDateCount(); /** returns the currently selected events */ - virtual QPtrList selectedIncidences(); + virtual Q3PtrList selectedIncidences(); /** returns the currently selected events */ virtual DateList selectedDates(); @@ -185,7 +195,7 @@ class KOAgendaView : public KOEventView { virtual void updateView(); virtual void updateConfig(); virtual void showDates(const QDate &start, const QDate &end); - virtual void showEvents(QPtrList eventList); + virtual void showEvents(Q3PtrList eventList); void updateTodo( Todo *, int ); void changeEventDisplay(Event *, int); @@ -260,10 +270,10 @@ class KOAgendaView : public KOEventView { QTimer* mIdleTimer; QDateTime mIdleStart; // view widgets - QFrame *mDayLabels; - QHBox *mDayLabelsFrame; - QBoxLayout *mLayoutDayLabels; - QFrame *mAllDayFrame; + Q3Frame *mDayLabels; + Q3HBox *mDayLabelsFrame; + Q3BoxLayout *mLayoutDayLabels; + Q3Frame *mAllDayFrame; KOAgenda *mAllDayAgenda; KOAgenda *mAgenda; TimeLabels *mTimeLabels; @@ -284,12 +294,12 @@ class KOAgendaView : public KOEventView { EventIndicator *mEventIndicatorTop; EventIndicator *mEventIndicatorBottom; - QMemArray mMinY; - QMemArray mMaxY; + Q3MemArray mMinY; + Q3MemArray mMaxY; - QMemArray mHolidayMask; + Q3MemArray mHolidayMask; - QPtrList mDayLabelsList; + Q3PtrList mDayLabelsList; QDateTime mTimeSpanBegin; QDateTime mTimeSpanEnd; bool mTimeSpanInAllDay; diff --git a/korganizer/kocounterdialog.h b/korganizer/kocounterdialog.h index c8dcf45..493d9e1 100644 --- a/korganizer/kocounterdialog.h +++ b/korganizer/kocounterdialog.h @@ -22,7 +22,7 @@ // Viewer dialog for counter events. // -#include +#include #include diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 52fd1e8..4f681b3 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -24,9 +24,18 @@ #include #include -#include +#include #include -#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -54,15 +63,15 @@ // ============================================================================ DynamicTip::DynamicTip( QWidget * parent ) - : QToolTip( parent ) + /* TODO:hacker: : QToolTip( parent ) */ { matrix = (KODayMatrix*)parent; } -class KODaymatrixWhatsThis :public QWhatsThis +class KODaymatrixWhatsThis :public Q3WhatsThis { public: - KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;}; + KODaymatrixWhatsThis( KODayMatrix* view ) : Q3WhatsThis( view ),_view (view) { ;}; ~KODaymatrixWhatsThis() { ; }; protected: @@ -91,7 +100,7 @@ void DynamicTip::maybeTip( const QPoint &pos ) //show holiday names only QString str = matrix->getHolidayLabel(col+row*7); if (str.isEmpty()) return; - tip(rct, str); + /* TODO:hacker: tip(rct, str);*/ } @@ -103,7 +112,7 @@ const int KODayMatrix::NOSELECTION = -1000; const int KODayMatrix::NUMDAYS = 42; KODayMatrix::KODayMatrix( QWidget *parent, const char *name ) - : QFrame( parent, name , Qt::WRepaintNoErase ), mCalendar( 0 ) + : Q3Frame( parent, name , Qt::WNoAutoErase ), mCalendar( 0 ) { @@ -151,7 +160,7 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar ) return QString(); QDate mDate = days[tmp]; - QPtrList eventlist = mCalendar->events(mDate); + Q3PtrList eventlist = mCalendar->events(mDate); Event *event; QStringList mToolTip; for(event=eventlist.first();event != 0;event=eventlist.next()) { @@ -205,7 +214,7 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) } mToolTip.sort(); if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { - QPtrList todolist = mCalendar->todos(mDate); + Q3PtrList todolist = mCalendar->todos(mDate); Todo *todo; for(todo=todolist.first();todo != 0;todo=todolist.next()) { QString mToolTipText; @@ -220,7 +229,7 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) } } if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { - QPtrList j_list = mCalendar->journals4Date( mDate ); + Q3PtrList j_list = mCalendar->journals4Date( mDate ); Journal *j = j_list.first(); while ( j ) { QString mToolTipText; @@ -441,7 +450,7 @@ void KODayMatrix::updateViewTimed() int i; int timeSpan = NUMDAYS-1; - QPtrList events = mCalendar->events(); + Q3PtrList events = mCalendar->events(); Event *event; QDateTime dt; bool ok; @@ -526,7 +535,7 @@ void KODayMatrix::updateViewTimed() if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { bDays.fill( false); // insert due todos - QPtrList todos = mCalendar->todos( ); + Q3PtrList todos = mCalendar->todos( ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { //insertTodo( todo ); @@ -551,7 +560,7 @@ void KODayMatrix::updateViewTimed() if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { bDays.fill( false); // insert due todos - QPtrList todos = mCalendar->journals( ); + Q3PtrList todos = mCalendar->journals( ); Journal *todo; for(todo = todos.first(); todo; todo = todos.next()) { int day = mStartDate.daysTo( todo->dtStart().date() ); @@ -575,7 +584,7 @@ void KODayMatrix::updateViewTimed() //qDebug("KODayMatrix::updateViewTimed "); for(int i = 0; i < NUMDAYS; i++) { // if events are set for the day then remember to draw it bold - QPtrList eventlist = mCalendar->events(days[i]); + Q3PtrList eventlist = mCalendar->events(days[i]); Event *event; int numEvents = eventlist.count(); QString holiStr = ""; @@ -675,7 +684,7 @@ void KODayMatrix::updateEvents() for( int i = 0; i < NUMDAYS; i++ ) { // if events are set for the day then remember to draw it bold - QPtrList eventlist = mCalendar->events( days[ i ] ); + Q3PtrList eventlist = mCalendar->events( days[ i ] ); int numEvents = eventlist.count(); Event *event; for( event = eventlist.first(); event != 0;event=eventlist.next()) { @@ -739,7 +748,7 @@ int KODayMatrix::getDayIndexFrom(int x, int y) void KODayMatrix::mousePressEvent (QMouseEvent* e) { - if ( e->button() == LeftButton ) + if ( e->button() == Qt::LeftButton ) mouseDown = true; mSelStart = getDayIndexFrom(e->x(), e->y()); if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1; @@ -752,7 +761,7 @@ void KODayMatrix::mousePressEvent (QMouseEvent* e) void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) { mRedrawNeeded = true; - if ( e->button() == LeftButton ) + if ( e->button() == Qt::LeftButton ) if ( ! mouseDown ) { return; } @@ -1195,7 +1204,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) //qDebug("NO redraw "); } - bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,CopyROP); + bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,QPainter::CompositionMode_Source); mRedrawNeeded = false; } @@ -1208,7 +1217,7 @@ void KODayMatrix::resizeEvent(QResizeEvent * e) QRect sz = frameRect(); daysize.setHeight(sz.height()*7 / NUMDAYS); daysize.setWidth(sz.width() / 7); - QFrame::resizeEvent( e ); + Q3Frame::resizeEvent( e ); } QSize KODayMatrix::sizeHint() const diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index b96e08f..6edf7cd 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include @@ -34,6 +34,14 @@ #include #include #include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include class QDragEnterEvent; class QDragMoveEvent; @@ -51,7 +59,7 @@ using namespace KCal; * This class asks the day matrix object for a appropriate label which * is in our special case the name of the holiday or null if this day is no holiday. */ -class DynamicTip : public QToolTip +class DynamicTip /* TODO:hacker: : public QToolTip */ { public: @@ -103,7 +111,7 @@ private: * * @author Eitzenberger Thomas */ -class KODayMatrix: public QFrame { +class KODayMatrix: public Q3Frame { Q_OBJECT diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index ea30fac..deb1e46 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp @@ -41,6 +41,8 @@ #include "kconfig.h" #include "kodialogmanager.h" #include +//Added by qt3to4: +#include KODialogManager::KODialogManager( CalendarView *mainView ) : QObject(), mMainView( mainView ) @@ -188,8 +190,8 @@ void KODialogManager::showSearchDialog() mMainView, SLOT(beamIncidence(Incidence *))); connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), mMainView, SLOT(moveIncidence(Incidence *))); - connect(lview, SIGNAL(beamIncidenceList(QPtrList )), - mMainView, SLOT(beamIncidenceList(QPtrList ))); + connect(lview, SIGNAL(beamIncidenceList(Q3PtrList )), + mMainView, SLOT(beamIncidenceList(Q3PtrList ))); connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); @@ -246,7 +248,7 @@ void KODialogManager::showArchiveDialog() #endif } -void KODialogManager::showFilterEditDialog(QPtrList *filters) +void KODialogManager::showFilterEditDialog(Q3PtrList *filters) { if (!mFilterEditDialog) { mFilterEditDialog = new FilterEditDialog(filters,mMainView); diff --git a/korganizer/kodialogmanager.h b/korganizer/kodialogmanager.h index b68ddc2..00ad1df 100644 --- a/korganizer/kodialogmanager.h +++ b/korganizer/kodialogmanager.h @@ -25,7 +25,7 @@ #define KODIALOGMANAGER_H #include -#include +#include #include @@ -78,7 +78,7 @@ class KODialogManager : public QObject // void showCategoryEditDialog(); void showSearchDialog(); void showArchiveDialog(); - void showFilterEditDialog(QPtrList *filters); + void showFilterEditDialog(Q3PtrList *filters); void showPluginDialog(); void hideSearchDialog(); diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp index 9a4b4ec..a01c838 100644 --- a/korganizer/koeditordetails.cpp +++ b/korganizer/koeditordetails.cpp @@ -22,14 +22,20 @@ */ #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include +#include +//Added by qt3to4: +#include +#include +#include +#include #include #include @@ -80,7 +86,7 @@ void CustomListViewItem::updateItem() KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) : QWidget( parent, name), mDisableItemUpdate( false ) { - QGridLayout *topLayout = new QGridLayout(this); + Q3GridLayout *topLayout = new Q3GridLayout(this); topLayout->setSpacing(spacing); topLayout->setMargin(KDialog::marginHint()-2); @@ -101,11 +107,11 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) } mListView->setAllColumnsShowFocus (true ); //mListView->setSingleClick( true ); - connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), + connect(mListView,SIGNAL(selectionChanged(Q3ListViewItem *)), SLOT(updateAttendeeInput())); - connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), - SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); + connect(mListView,SIGNAL(executed(Q3ListViewItem * ,const QPoint&, int )), + SLOT(itemClicked(Q3ListViewItem * ,const QPoint& , int ))); mRsvpButton = new QCheckBox(this); mRsvpButton->setText(i18n("Request response")); @@ -140,7 +146,7 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); QWidget *buttonBox = new QWidget(this); - QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); + Q3VBoxLayout *buttonLayout = new Q3VBoxLayout(buttonBox); QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); buttonLayout->addWidget(newButton); @@ -365,7 +371,7 @@ void KOEditorDetails::readEvent(Incidence *event) setDefaults(); //mListView->clear(); //mdelAttendees.clear(); - QPtrList tmpAList = event->attendees(); + Q3PtrList tmpAList = event->attendees(); Attendee *a; for (a = tmpAList.first(); a; a = tmpAList.next()) insertAttendee(new Attendee(*a)); @@ -377,7 +383,7 @@ void KOEditorDetails::readEvent(Incidence *event) void KOEditorDetails::writeEvent(Incidence *event) { event->clearAttendees(); - QListViewItem *item; + Q3ListViewItem *item; AttendeeListItem *a; for (item = mListView->firstChild(); item; item = item->nextSibling()) { @@ -404,7 +410,7 @@ bool KOEditorDetails::validateInput() void KOEditorDetails::updateAttendeeInput() { - QListViewItem *item = mListView->selectedItem(); + Q3ListViewItem *item = mListView->selectedItem(); AttendeeListItem *aItem = static_cast( item ); if (aItem) { fillAttendeeInput( aItem ); @@ -451,7 +457,7 @@ void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) mRemoveButton->setEnabled( enabled ); } -void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c ) +void KOEditorDetails::itemClicked(Q3ListViewItem * item ,const QPoint & pnt, int c ) { if ( item && c == 4 ) { mRsvpButton->setChecked( !mRsvpButton->isChecked() ); @@ -462,7 +468,7 @@ void KOEditorDetails::updateAttendeeItem() { if (mDisableItemUpdate) return; - QListViewItem *item = mListView->selectedItem(); + Q3ListViewItem *item = mListView->selectedItem(); AttendeeListItem *aItem = static_cast( item ); if ( !aItem ) return; diff --git a/korganizer/koeditordetails.h b/korganizer/koeditordetails.h index 5f8f6f2..40e896c 100644 --- a/korganizer/koeditordetails.h +++ b/korganizer/koeditordetails.h @@ -24,17 +24,17 @@ #define _KOEDITORDETAILS_H #include -#include +#include #include #include #include -#include +#include #include #include -#include +#include #include #include -#include +#include #include @@ -83,7 +83,7 @@ class KOEditorDetails : public QWidget void updateAttendeeInput(); void clearAttendeeInput(); void fillAttendeeInput(AttendeeListItem *); - void itemClicked(QListViewItem *,const QPoint & pnt, int c); + void itemClicked(Q3ListViewItem *,const QPoint & pnt, int c); void updateAttendeeItem(); void setEnabledAttendeeInput(bool); @@ -103,7 +103,7 @@ class KOEditorDetails : public QWidget QPushButton* mRemoveButton; QPushButton* mAddressBookButton; - QPtrList mdelAttendees; + Q3PtrList mdelAttendees; }; #endif diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 21f220c..8105432 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp @@ -24,15 +24,22 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include #include #include @@ -69,9 +76,9 @@ KOEditorGeneral::~KOEditorGeneral() { } -void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneral::initHeader(QWidget *parent,Q3BoxLayout *topLayout) { - QGridLayout *headerLayout = new QGridLayout(topLayout); + Q3GridLayout *headerLayout = new Q3GridLayout(topLayout); #if 0 mOwnerLabel = new QLabel(i18n("Owner:"),parent); @@ -195,10 +202,10 @@ void KOEditorGeneral::selectedCatPopup( int index ) setCategories( categories.join(",") ); } -void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) +void KOEditorGeneral::initCategories(QWidget *parent, Q3BoxLayout *topLayout) { - QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); - mCatPopup = new QPopupMenu ( parent ); + Q3BoxLayout *categoriesLayout = new Q3HBoxLayout( topLayout ); + mCatPopup = new Q3PopupMenu ( parent ); mCatPopup->setCheckable (true); connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); @@ -214,9 +221,9 @@ void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) categoriesLayout->addWidget(mCategoriesLabel,1); } -void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) +void KOEditorGeneral::initSecrecy(QWidget *parent, Q3BoxLayout *topLayout) { - QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *secrecyLayout = new Q3HBoxLayout( topLayout ); QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); @@ -228,7 +235,7 @@ void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) secrecyLayout->addWidget(mSecrecyCombo); } -void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneral::initDescription(QWidget *parent,Q3BoxLayout *topLayout) { mDescriptionEdit = new KTextEdit(parent); mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); @@ -243,9 +250,9 @@ void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) } -void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneral::initAlarm(QWidget *parent,Q3BoxLayout *topLayout) { - QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *alarmLayout = new Q3HBoxLayout(topLayout); //mAlarmBell = new QLabel(parent); //mAlarmBell->setPixmap(SmallIcon("bell")); @@ -528,7 +535,7 @@ void KOEditorGeneral::readIncidence(Incidence *event) mAlarmSoundButton->setOn(false); // set up alarm stuff - QPtrList alarms = event->alarms(); + Q3PtrList alarms = event->alarms(); Alarm* alarm; mAlarmIncrCombo->setCurrentItem(0); for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { @@ -590,7 +597,7 @@ void KOEditorGeneral::writeIncidence(Incidence *event) if (mAlarmButton->isChecked()) { if (event->alarms().count() == 0) event->newAlarm(); - QPtrList alarms = event->alarms(); + Q3PtrList alarms = event->alarms(); Alarm *alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { alarm->setEnabled(true); diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h index b10a5d4..45f26fd 100644 --- a/korganizer/koeditorgeneral.h +++ b/korganizer/koeditorgeneral.h @@ -23,19 +23,20 @@ #ifndef KOEDITORGENERAL_H #define KOEDITORGENERAL_H -#include +#include #include #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include #include +#include #include #include @@ -55,11 +56,11 @@ class KOEditorGeneral : public QObject KOEditorGeneral (QObject* parent=0,const char* name=0); virtual ~KOEditorGeneral(); void setFocusOn( int i ); - void initHeader(QWidget *,QBoxLayout *); - void initDescription(QWidget *,QBoxLayout *); - void initSecrecy(QWidget *,QBoxLayout *); - void initCategories(QWidget *,QBoxLayout *); - void initAlarm(QWidget *,QBoxLayout *); + void initHeader(QWidget *,Q3BoxLayout *); + void initDescription(QWidget *,Q3BoxLayout *); + void initSecrecy(QWidget *,Q3BoxLayout *); + void initCategories(QWidget *,Q3BoxLayout *); + void initAlarm(QWidget *,Q3BoxLayout *); /** Set widgets to default values */ void setDefaults(bool allDay); @@ -115,7 +116,7 @@ class KOEditorGeneral : public QObject QPushButton *mCategoriesLabel; private: - QPopupMenu * mCatPopup; + Q3PopupMenu * mCatPopup; QString getFittingPath( const QString &) ; QString mAlarmSound; QString mAlarmProgram; diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index 2c6ed9f..73a4139 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp @@ -23,11 +23,17 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include +//Added by qt3to4: +#include +#include +#include +#include +#include #include #include @@ -84,19 +90,19 @@ void KOEditorGeneralEvent::finishSetup() mSummaryEdit->setFocus(); } -void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneralEvent::initTime(QWidget *parent,Q3BoxLayout *topLayout) { - QBoxLayout *timeLayout = new QVBoxLayout(topLayout); + Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout); - QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, + Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal, i18n("Date && Time"),parent); timeLayout->addWidget(timeGroupBox); timeGroupBox->layout()->setSpacing( KDialog::spacingHintSmall() ); timeGroupBox->layout()->setMargin( KDialog::marginHint() ); - QFrame *timeBoxFrame = new QFrame(timeGroupBox); + Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox); - QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,2,3); + Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,2,3); layoutTimeBox->setSpacing(topLayout->spacing()); mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame); @@ -118,7 +124,7 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) mEndTimeEdit = new KOTimeEdit(timeBoxFrame); layoutTimeBox->addWidget(mEndTimeEdit,1,2); QWidget* duration = new QWidget( timeBoxFrame ); - QHBoxLayout *flagsBox = new QHBoxLayout( duration ); + Q3HBoxLayout *flagsBox = new Q3HBoxLayout( duration ); mNoTimeButton = new QCheckBox(i18n("All day event"),duration); flagsBox->addWidget(mNoTimeButton); connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool))); @@ -129,7 +135,7 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) flagsBox->addWidget( mDurationLabel ); //} flagsBox->setStretchFactor(mDurationLabel, 10 ); - mDurationLabel->setAlignment( AlignRight | AlignVCenter); + mDurationLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter); layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 ); // time widgets are checked if they contain a valid time @@ -147,9 +153,9 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime))); } -void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneralEvent::initClass(QWidget *parent,Q3BoxLayout *topLayout) { - QBoxLayout *classLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *classLayout = new Q3HBoxLayout(topLayout); QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent); classLayout->addWidget(freeTimeLabel); diff --git a/korganizer/koeditorgeneralevent.h b/korganizer/koeditorgeneralevent.h index d798905..5d97a5c 100644 --- a/korganizer/koeditorgeneralevent.h +++ b/korganizer/koeditorgeneralevent.h @@ -23,15 +23,15 @@ #ifndef _KOEDITORGENERALEVENT_H #define _KOEDITORGENERALEVENT_H -#include +#include #include #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include @@ -51,8 +51,8 @@ class KOEditorGeneralEvent : public KOEditorGeneral KOEditorGeneralEvent (QObject* parent=0,const char* name=0); virtual ~KOEditorGeneralEvent(); - void initTime(QWidget *,QBoxLayout *); - void initClass(QWidget *,QBoxLayout *); + void initTime(QWidget *,Q3BoxLayout *); + void initClass(QWidget *,Q3BoxLayout *); void finishSetup(); diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index d32d5a5..baee9fc 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp @@ -22,14 +22,21 @@ */ #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include #include #include @@ -82,18 +89,18 @@ void KOEditorGeneralTodo::finishSetup() mSummaryEdit->setFocus(); } -void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneralTodo::initTime(QWidget *parent,Q3BoxLayout *topLayout) { - QBoxLayout *timeLayout = new QVBoxLayout(topLayout); + Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout); - QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, + Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal, i18n("Date && Time"),parent); timeLayout->addWidget(timeGroupBox); timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); timeGroupBox->layout()->setMargin( KDialog::marginHint() ); - QFrame *timeBoxFrame = new QFrame(timeGroupBox); + Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox); - QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); + Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,3,3); layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); layoutTimeBox->setColStretch( 1, 1 ); @@ -133,7 +140,7 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) } -void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) +void KOEditorGeneralTodo::initCompletion(QWidget *parent, Q3BoxLayout *topLayout) { mCompletedCombo = new QComboBox(parent); // xgettext:no-c-format @@ -173,10 +180,10 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) } } -void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) +void KOEditorGeneralTodo::initPriority(QWidget *parent, Q3BoxLayout *topLayout) { - QHBox* h = new QHBox ( parent ); + Q3HBox* h = new Q3HBox ( parent ); topLayout->addWidget( h ); QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); // topLayout->addWidget(priorityLabel); @@ -189,9 +196,9 @@ void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) //topLayout->addWidget(mPriorityCombo); } -void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneralTodo::initStatus(QWidget *parent,Q3BoxLayout *topLayout) { - QBoxLayout *statusLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *statusLayout = new Q3HBoxLayout(topLayout); initCompletion( parent, statusLayout ); @@ -396,7 +403,7 @@ void KOEditorGeneralTodo::enableStartEdit( bool enable ) void KOEditorGeneralTodo::startDateChanged(QDate newdate) { if ( mDueCheck->isChecked() ) - emit dateTimesChanged(newdate,mDueDateEdit->date()); + emit dateTimesChanged((QDateTime)newdate,(QDateTime)mDueDateEdit->date()); } void KOEditorGeneralTodo::enableTimeEdits(bool enable) { diff --git a/korganizer/koeditorgeneraltodo.h b/korganizer/koeditorgeneraltodo.h index 2e56a7a..2e97ff5 100644 --- a/korganizer/koeditorgeneraltodo.h +++ b/korganizer/koeditorgeneraltodo.h @@ -23,15 +23,15 @@ #ifndef _KOEDITORGENERALTODO_H #define _KOEDITORGENERALTODO_H -#include +#include #include #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include "koeditorgeneral.h" @@ -50,10 +50,10 @@ class KOEditorGeneralTodo : public KOEditorGeneral KOEditorGeneralTodo (QObject* parent=0,const char* name=0); virtual ~KOEditorGeneralTodo(); - void initTime(QWidget *, QBoxLayout *); - void initStatus(QWidget *, QBoxLayout *); - void initCompletion(QWidget *, QBoxLayout *); - void initPriority(QWidget *, QBoxLayout *); + void initTime(QWidget *, Q3BoxLayout *); + void initStatus(QWidget *, Q3BoxLayout *); + void initCompletion(QWidget *, Q3BoxLayout *); + void initPriority(QWidget *, Q3BoxLayout *); void finishSetup(); diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp index e0380c4..e0ae3a0 100644 --- a/korganizer/koeditorrecurrence.cpp +++ b/korganizer/koeditorrecurrence.cpp @@ -22,17 +22,25 @@ */ #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include #include #include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include #include #include @@ -81,7 +89,7 @@ int RecurBase::frequency() RecurDaily::RecurDaily( QWidget *parent, const char *name ) : RecurBase( parent, name ) { - QBoxLayout *topLayout = new QHBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3HBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHintSmall() ); @@ -100,13 +108,13 @@ RecurDaily::RecurDaily( QWidget *parent, const char *name ) : RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) : RecurBase( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHintSmall() ); //topLayout->addStretch( 1 ); - QBoxLayout *weeksLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *weeksLayout = new Q3HBoxLayout( topLayout ); QLabel *preLabel = new QLabel( i18n("Recur every"), this ); weeksLayout->addWidget( preLabel ); @@ -116,8 +124,8 @@ RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) : QLabel *postLabel = new QLabel( i18n("week(s) on:"), this ); weeksLayout->addWidget( postLabel ); - QHBox *dayBox = new QHBox( this ); - topLayout->addWidget( dayBox, 1, AlignVCenter ); + Q3HBox *dayBox = new Q3HBox( this ); + topLayout->addWidget( dayBox, 1, Qt::AlignVCenter ); // TODO: Respect start of week setting for ( int i = 0; i < 7; ++i ) { QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true ); @@ -156,12 +164,12 @@ QBitArray RecurWeekly::days() RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : RecurBase( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHintSmall() ); - QBoxLayout *freqLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout ); QLabel *preLabel = new QLabel( i18n("every"), this ); freqLayout->addWidget( preLabel ); @@ -172,11 +180,11 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : freqLayout->addWidget( postLabel ); - QButtonGroup *buttonGroup = new QButtonGroup( this ); - buttonGroup->setFrameStyle( QFrame::NoFrame ); - topLayout->addWidget( buttonGroup, 1, AlignVCenter ); + Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this ); + buttonGroup->setFrameStyle( Q3Frame::NoFrame ); + topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter ); - QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 3, 2 ); + Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 3, 2 ); buttonLayout->setSpacing( KDialog::spacingHint() ); buttonLayout->setMargin( KDialog::marginHintSmall() ); @@ -189,7 +197,7 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : mByDayRadio = new QRadioButton( recurOnText, buttonGroup ); buttonLayout->addWidget( mByDayRadio, 0, 0 ); - mByDayCombo = new QComboBox( buttonGroup ); + mByDayCombo = new Q3ComboBox( buttonGroup ); mByDayCombo->setSizeLimit( 7 ); mByDayCombo->insertItem( i18n("1st") ); mByDayCombo->insertItem( i18n("2nd") ); @@ -293,12 +301,12 @@ int RecurMonthly::weekday() RecurYearly::RecurYearly( QWidget *parent, const char *name ) : RecurBase( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHintSmall() ); - QBoxLayout *freqLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout ); QLabel *preLabel = new QLabel( i18n("every"), this ); freqLayout->addWidget( preLabel ); @@ -309,18 +317,18 @@ RecurYearly::RecurYearly( QWidget *parent, const char *name ) : freqLayout->addWidget( postLabel ); - QButtonGroup *buttonGroup = new QButtonGroup( this ); - buttonGroup->setFrameStyle( QFrame::NoFrame ); - topLayout->addWidget( buttonGroup, 1, AlignVCenter ); + Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this ); + buttonGroup->setFrameStyle( Q3Frame::NoFrame ); + topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter ); - QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 2, 3 ); + Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 2, 3 ); mByMonthRadio = new QRadioButton( i18n("On day "), buttonGroup); buttonLayout->addWidget( mByMonthRadio, 0, 0 , Qt::AlignRight); mByDayLabel = new QLabel( i18n("%1 of ").arg(1), buttonGroup ); buttonLayout->addWidget( mByDayLabel, 0, 1 ); - mByMonthCombo = new QComboBox( buttonGroup ); + mByMonthCombo = new Q3ComboBox( buttonGroup ); mByMonthCombo->insertItem( i18n("January") ); mByMonthCombo->insertItem( i18n("February") ); mByMonthCombo->insertItem( i18n("March") ); @@ -383,15 +391,15 @@ int RecurYearly::day() ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); - QGroupBox *groupBox = new QGroupBox( 1, Horizontal, i18n("Exceptions"), + Q3GroupBox *groupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Exceptions"), this ); topLayout->addWidget( groupBox ); QWidget *box = new QWidget( groupBox ); - QGridLayout *boxLayout = new QGridLayout( box ); + Q3GridLayout *boxLayout = new Q3GridLayout( box ); mExceptionDateEdit = new KDateEdit( box ); boxLayout->addWidget( mExceptionDateEdit, 0, 0 ); @@ -403,7 +411,7 @@ ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) : QPushButton *deleteExceptionButton = new QPushButton( i18n("Delete"), box ); boxLayout->addWidget( deleteExceptionButton, 3, 0 ); - mExceptionList = new QListBox( box ); + mExceptionList = new Q3ListBox( box ); boxLayout->addMultiCellWidget( mExceptionList, 0, 3, 1, 1 ); boxLayout->setRowStretch( 4, 1 ); @@ -506,27 +514,27 @@ RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); - mRangeGroupBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Range"), + mRangeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Range"), this ); topLayout->addWidget( mRangeGroupBox ); QWidget *rangeBox = new QWidget( mRangeGroupBox ); - QVBoxLayout *rangeLayout = new QVBoxLayout( rangeBox ); + Q3VBoxLayout *rangeLayout = new Q3VBoxLayout( rangeBox ); rangeLayout->setSpacing( KDialog::spacingHint() ); rangeLayout->setMargin( KDialog::marginHintSmall() ); mStartDateLabel = new QLabel( i18n("Begin on:"), rangeBox ); rangeLayout->addWidget( mStartDateLabel ); - mRangeButtonGroup = new QButtonGroup; + mRangeButtonGroup = new Q3ButtonGroup; mNoEndDateButton = new QRadioButton( i18n("No ending date"), rangeBox ); mRangeButtonGroup->insert( mNoEndDateButton ); rangeLayout->addWidget( mNoEndDateButton ); - QBoxLayout *durationLayout = new QHBoxLayout( rangeLayout ); + Q3BoxLayout *durationLayout = new Q3HBoxLayout( rangeLayout ); durationLayout->setSpacing( KDialog::spacingHint() ); mEndDurationButton = new QRadioButton( i18n("End after"), rangeBox ); @@ -539,7 +547,7 @@ RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent, QLabel *endDurationLabel = new QLabel( i18n("occurrence(s)"), rangeBox ); durationLayout ->addWidget( endDurationLabel ); - QBoxLayout *endDateLayout = new QHBoxLayout( rangeLayout ); + Q3BoxLayout *endDateLayout = new Q3HBoxLayout( rangeLayout ); endDateLayout->setSpacing( KDialog::spacingHint() ); mEndDateButton = new QRadioButton( i18n("End by:"), rangeBox ); @@ -666,7 +674,7 @@ void RecurrenceRangeDialog::setDateTimes( const QDateTime &start, RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); mTypeCombo = new QComboBox( this ); mTypeCombo->insertItem( i18n("Daily") ); @@ -725,7 +733,7 @@ void RecurrenceChooser::emitChoice() KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *topLayout = new QGridLayout( this, 2,2 ); + Q3GridLayout *topLayout = new Q3GridLayout( this, 2,2 ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHintSmall() ); @@ -735,7 +743,7 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : topLayout->addMultiCellWidget( mEnabledCheck, 0, 0, 0, 1 ); - mTimeGroupBox = new QGroupBox( 1, Horizontal, i18n("Time"), + mTimeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Time"), this ); topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 ); @@ -752,14 +760,14 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : // layoutTimeFrame->addWidget( mDateTimeLabel ); //mTimeGroupBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) ); //mDateTimeLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum) ); - mRuleBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Rule"), this ); + mRuleBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Rule"), this ); topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 ); mRecurrenceChooser = new RecurrenceChooser( mRuleBox ); connect( mRecurrenceChooser, SIGNAL( chosen( int ) ), SLOT( showCurrentRule( int ) ) ); - mRuleStack = new QWidgetStack( mRuleBox ); + mRuleStack = new Q3WidgetStack( mRuleBox ); mDaily = new RecurDaily( mRuleStack ); mRuleStack->addWidget( mDaily, 0 ); @@ -896,8 +904,8 @@ void KOEditorRecurrence::readEvent(Incidence *event) setDefaults( event->dtStart(), dtEnd ); QBitArray rDays( 7 ); - QPtrList rmp; - QPtrList rmd; + Q3PtrList rmp; + Q3PtrList rmd; int day = 0; int count = 0; int month = 0; @@ -968,7 +976,7 @@ void KOEditorRecurrence::readEvent(Incidence *event) mYearly->setByMonth( month, day ); #if 0 //qDebug("2day = %d ",day ); - QPtrList monthlist = r->yearMonthPositions(); + Q3PtrList monthlist = r->yearMonthPositions(); int month; if ( !monthlist.isEmpty() ) { month = monthlist.first()->rPos ; diff --git a/korganizer/koeditorrecurrence.h b/korganizer/koeditorrecurrence.h index 75e0c73..6c012bd 100644 --- a/korganizer/koeditorrecurrence.h +++ b/korganizer/koeditorrecurrence.h @@ -23,17 +23,19 @@ #ifndef _KOEDITORRECURRENCE_H #define _KOEDITORRECURRENCE_H -#include +#include #include #include #include -#include +#include #include #include -#include -#include +#include +#include #include -#include +#include +#include +#include #include @@ -41,7 +43,7 @@ #include "ktimeedit.h" -class QWidgetStack; +class Q3WidgetStack; class QSpinBox; class KDateEdit; @@ -98,7 +100,7 @@ class RecurMonthly : public RecurBase private: QRadioButton *mByDayRadio; - QComboBox *mByDayCombo; + Q3ComboBox *mByDayCombo; QRadioButton *mByPosRadio; QComboBox *mByPosCountCombo; @@ -122,7 +124,7 @@ class RecurYearly : public RecurBase private: int mDay; QRadioButton *mByMonthRadio; - QComboBox *mByMonthCombo; + Q3ComboBox *mByMonthCombo; QLabel* mByDayLabel; QLabel* mDayOfLabel; QRadioButton *mByDayRadio; @@ -180,7 +182,7 @@ class ExceptionsWidget : public QWidget, public ExceptionsBase private: KDateEdit *mExceptionDateEdit; - QListBox *mExceptionList; + Q3ListBox *mExceptionList; DateList mExceptionDates; }; @@ -235,8 +237,8 @@ class RecurrenceRangeWidget : public QWidget, public RecurrenceRangeBase void showCurrentRange(); private: - QButtonGroup *mRangeButtonGroup; - QGroupBox *mRangeGroupBox; + Q3ButtonGroup *mRangeButtonGroup; + Q3GroupBox *mRangeGroupBox; QLabel *mStartDateLabel; QRadioButton *mNoEndDateButton; QRadioButton *mEndDurationButton; @@ -300,11 +302,11 @@ class KOEditorRecurrence : public QWidget private: QCheckBox *mEnabledCheck; - QGroupBox *mTimeGroupBox; + Q3GroupBox *mTimeGroupBox; QLabel *mDateTimeLabel; - QGroupBox *mRuleBox; - QWidgetStack *mRuleStack; + Q3GroupBox *mRuleBox; + Q3WidgetStack *mRuleStack; RecurrenceChooser *mRecurrenceChooser; RecurDaily *mDaily; diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp index 3e87197..62ad250 100644 --- a/korganizer/koeventeditor.cpp +++ b/korganizer/koeventeditor.cpp @@ -22,14 +22,19 @@ */ #include -#include +#include #include -#include +#include #include #include #include -#include +#include #include +#include +//Added by qt3to4: +#include +#include +#include #include #include @@ -105,8 +110,8 @@ void KOEventEditor::setupGeneral() connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); if( KOPrefs::instance()->mCompactDialogs ) { - QFrame *topFrame = addPage(i18n("General")); - QBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3Frame *topFrame = addPage(i18n("General")); + Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); topLayout->setSpacing(spacingHint()-1); topLayout->setMargin(marginHint()-1); topLayout->addStretch ( 1 ); @@ -119,13 +124,13 @@ void KOEventEditor::setupGeneral() topLayout->addStretch ( 1 ); mGeneral->enableAlarm( false ); - QBoxLayout *buttonLayout; + Q3BoxLayout *buttonLayout; if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 ) - buttonLayout = new QVBoxLayout( topLayout ); + buttonLayout = new Q3VBoxLayout( topLayout ); else - buttonLayout = new QHBoxLayout( topLayout ); - QHBox* buttonWidget = new QHBox (topFrame); - QIconSet icon; + buttonLayout = new Q3HBoxLayout( topLayout ); + Q3HBox* buttonWidget = new Q3HBox (topFrame); + QIcon icon; if ( QApplication::desktop()->width() < 321 ) icon = SmallIcon("fileexport16"); else @@ -146,9 +151,9 @@ void KOEventEditor::setupGeneral() topLayout->addStretch( 1 ); - QFrame *topFrame2 = addPage(i18n("Details")); + Q3Frame *topFrame2 = addPage(i18n("Details")); - QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); + Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2); topLayout2->setSpacing(spacingHint()-1); topLayout2->setMargin(marginHint()-1); topLayout2->setSpacing(spacingHint()); @@ -160,18 +165,18 @@ void KOEventEditor::setupGeneral() connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); } else { - QFrame *topFrame = addPage(i18n("General")); + Q3Frame *topFrame = addPage(i18n("General")); - QBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); topLayout->setSpacing(spacingHint()); mGeneral->initHeader(topFrame,topLayout); mGeneral->initTime(topFrame,topLayout); - QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout); mGeneral->initAlarm(topFrame,alarmLineLayout); mGeneral->initClass(topFrame,alarmLineLayout); mGeneral->initDescription(topFrame,topLayout); - QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout); mGeneral->initCategories( topFrame, detailsLayout ); mGeneral->initSecrecy( topFrame, detailsLayout ); } @@ -182,8 +187,8 @@ void KOEventEditor::setupGeneral() void KOEventEditor::setupRecurrence() { - QFrame *topFrame = addPage( i18n("Recurrence") ); - QBoxLayout *topLayout = new QVBoxLayout( topFrame ); + Q3Frame *topFrame = addPage( i18n("Recurrence") ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); mRecurrence = new KOEditorRecurrence( topFrame ); topLayout->addWidget( mRecurrence ); @@ -356,7 +361,7 @@ void KOEventEditor::slotLoadTemplate() .arg( fileName ) ); return ; } - QPtrList events = cal.events(); + Q3PtrList events = cal.events(); Event* event = events.first(); if ( !event ) { KMessageBox::error( this, diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp index fc4d9a4..81047c1 100644 --- a/korganizer/koeventpopupmenu.cpp +++ b/korganizer/koeventpopupmenu.cpp @@ -22,6 +22,9 @@ */ #include +//Added by qt3to4: +#include +#include #include #include @@ -32,7 +35,7 @@ #include "koeventpopupmenu.h" #include "koprefs.h" -KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() +KOEventPopupMenu::KOEventPopupMenu(): Q3PopupMenu() { mCurrentIncidence = 0; mHasAdditionalItems = false; @@ -53,11 +56,11 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), this,SLOT(popupCancel()))); isDisabled = false; - mCatPopup = new QPopupMenu ( this ); + mCatPopup = new Q3PopupMenu ( this ); mCatPopup->setCheckable (true); connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup())); connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int ))); - mCalPopup = new QPopupMenu ( this ); + mCalPopup = new Q3PopupMenu ( this ); mCalPopup->setCheckable (true); connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup())); connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int ))); @@ -65,7 +68,7 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup )); insertItem (i18n("Categories"),mCatPopup ); insertItem (i18n("Calendar"),mCalPopup ); - QValueList::Iterator it; + Q3ValueList::Iterator it; for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { mSingleOnlyItems.append(*it); } @@ -74,7 +77,7 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() void KOEventPopupMenu::enableDefault( bool enable ) { isDisabled = !enable; - QValueList::Iterator it; + Q3ValueList::Iterator it; for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) { setItemEnabled(*it,enable); } @@ -146,7 +149,7 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) if (mCurrentIncidence) { // Enable/Disabled menu items only valid for editable events. if ( !isDisabled ) { - QValueList::Iterator it; + Q3ValueList::Iterator it; for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); } @@ -155,7 +158,7 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) } } -void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text, +void KOEventPopupMenu::addAdditionalItem(const QIcon &icon,const QString &text, const QObject *receiver, const char *member, bool editOnly) { diff --git a/korganizer/koeventpopupmenu.h b/korganizer/koeventpopupmenu.h index e28745b..de5220b 100644 --- a/korganizer/koeventpopupmenu.h +++ b/korganizer/koeventpopupmenu.h @@ -26,18 +26,20 @@ // Context menu for event views with standard event actions // -#include +#include +//Added by qt3to4: +#include #include using namespace KCal; -class KOEventPopupMenu : public QPopupMenu { +class KOEventPopupMenu : public Q3PopupMenu { Q_OBJECT public: KOEventPopupMenu(); - void addAdditionalItem(const QIconSet &icon,const QString &text, + void addAdditionalItem(const QIcon &icon,const QString &text, const QObject *receiver, const char *member, bool editOnly=false); @@ -73,11 +75,11 @@ class KOEventPopupMenu : public QPopupMenu { Incidence *mCurrentIncidence; bool mHasAdditionalItems; - QValueList mEditOnlyItems; - QValueList mSingleOnlyItems; + Q3ValueList mEditOnlyItems; + Q3ValueList mSingleOnlyItems; bool isDisabled; - QPopupMenu *mCatPopup; - QPopupMenu *mCalPopup; + Q3PopupMenu *mCatPopup; + Q3PopupMenu *mCalPopup; }; #endif diff --git a/korganizer/koeventview.cpp b/korganizer/koeventview.cpp index 1d26930..a4ba85e 100644 --- a/korganizer/koeventview.cpp +++ b/korganizer/koeventview.cpp @@ -21,7 +21,7 @@ without including the source code for Qt in the source distribution. */ -#include +#include #include #include @@ -73,7 +73,7 @@ KOEventPopupMenu *KOEventView::eventPopup() //--------------------------------------------------------------------------- -void KOEventView::showIncidencePopup(QPopupMenu *popup,Incidence *event) +void KOEventView::showIncidencePopup(Q3PopupMenu *popup,Incidence *event) { mCurrentIncidence = event; if (event) popup->popup(QCursor::pos()); diff --git a/korganizer/koeventview.h b/korganizer/koeventview.h index 77ec111..f28e68b 100644 --- a/korganizer/koeventview.h +++ b/korganizer/koeventview.h @@ -30,6 +30,8 @@ #include #include "koeventpopupmenu.h" +//Added by qt3to4: +#include using namespace KCal; @@ -87,7 +89,7 @@ class KOEventView : public KOrg::BaseView * @param event event, which is to be manipulated by the menu actions * @param popup a popop menu created with eventPopup() */ - void showIncidencePopup(QPopupMenu *popup, Incidence *event); + void showIncidencePopup(Q3PopupMenu *popup, Incidence *event); /** Perform the default action for an incidence, e.g. open the event editor, diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index c0acf34..4df26a9 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -17,12 +17,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include +#include +#include #include #include +#include #include #include +//Added by qt3to4: +#include +#include +#include #include #include @@ -55,14 +60,14 @@ #include #include #include -#include +#include #else //DESKTOP_VERSION #include #endif //DESKTOP_VERSION #include KOEventViewer::KOEventViewer(QWidget *parent,const char *name) - : QTextBrowser(parent,name) + : Q3TextBrowser(parent,name) { mSyncMode = false; mColorMode = 0; @@ -86,7 +91,7 @@ void KOEventViewer::printMe() return; QPainter p; p.begin ( &printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); @@ -134,7 +139,7 @@ void KOEventViewer::setSource(const QString& n) //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); QDialog dia( this,"dia123", true ); dia.setCaption( i18n("Details of attendee") ); - QVBoxLayout lay ( &dia ); + Q3VBoxLayout lay ( &dia ); KABC::AddresseeView av ( &dia ); av.setAddressee( (*it) ); lay.addWidget( &av ); @@ -155,7 +160,7 @@ void KOEventViewer::setSource(const QString& n) ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); return; } - QPtrList attendees = mCurrentIncidence->attendees(); + Q3PtrList attendees = mCurrentIncidence->attendees(); if (attendees.count()) { Attendee *a; for(a=attendees.first();a;a=attendees.next()) { @@ -200,14 +205,14 @@ void KOEventViewer::setSource(const QString& n) const QByteArray noParamData; const QByteArray paramData; QByteArray replyData; - QCString replyTypeStr; + Q3CString replyTypeStr; #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) bool foundAbbrowser = PING_ABBROWSER; if (foundAbbrowser) { //KAddressbook is already running, so just DCOP to it to bring up the contact editor //client->send("kaddressbook","KAddressBookIface", - QDataStream arg(paramData, IO_WriteOnly); + QDataStream arg(paramData, QIODevice::WriteOnly); arg << n.mid(6); client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); return; @@ -231,7 +236,7 @@ void KOEventViewer::setSource(const QString& n) } void KOEventViewer::mailToAttendees( bool all ) { - QPtrList attendees = mCurrentIncidence->attendees(); + Q3PtrList attendees = mCurrentIncidence->attendees(); if (attendees.count() == 0) return; QStringList nameList; QStringList emailList; @@ -260,7 +265,7 @@ void KOEventViewer::mailToAttendees( bool all ) } void KOEventViewer::addTag(const QString & tag,const QString & text) { - int number=text.contains("\n"); + int number=text.count("\n"); QString str = "<" + tag + ">"; QString tmpText=text; QString tmpStr=str; @@ -587,7 +592,7 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) // mText.append(deTag("[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] " +event->relatedTo()->summary()) +"
"); } - QPtrList Relations = event->relations(); + Q3PtrList Relations = event->relations(); Incidence *to; if ( Relations.first() ) addTag("b",i18n("Sub todos:
")); @@ -621,7 +626,7 @@ void KOEventViewer::formatCategories(Incidence *event) } void KOEventViewer::formatAttendees(Incidence *event) { - QPtrList attendees = event->attendees(); + Q3PtrList attendees = event->attendees(); if (attendees.count()) { @@ -654,7 +659,7 @@ void KOEventViewer::formatAttendees(Incidence *event) mText.append(event->organizer()); #endif - if (iconPath) { + if (!iconPath.isEmpty()) { mText += " organizer() + "\">"; mText += ""; mText += "\n"; @@ -704,7 +709,7 @@ void KOEventViewer::formatAttendees(Incidence *event) if (!a->email().isEmpty()) { - if (iconPath) { + if (!iconPath.isEmpty()) { mText += "realName() +" <" + a->email() + ">:" + mMailSubject + "\">"; if ( a->RSVP() ) { ++a_count_nr; @@ -862,7 +867,7 @@ void KOEventViewer::keyPressEvent ( QKeyEvent * e ) e->ignore(); break; default: - QTextBrowser::keyPressEvent ( e ); + Q3TextBrowser::keyPressEvent ( e ); break; } } diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 64eb4ff..3df667f 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h @@ -22,7 +22,10 @@ // Viewer widget for events. // -#include +#include +//Added by qt3to4: +#include +#include #include #include @@ -37,7 +40,7 @@ using namespace KCal; #include #include #include -#include +#include #include class KOPrintPrefs : public QDialog @@ -47,13 +50,13 @@ class KOPrintPrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("KO/Pi Printout") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 9 ); lay->setMargin( 9 ); QLabel * lab = new QLabel( i18n("This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n"), this ); lay->addWidget( lab ); - lab->setAlignment( AlignCenter ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Printout Mode"), this ); + lab->setAlignment( Qt::AlignCenter ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Printout Mode"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; pmNo = new QRadioButton(i18n("Print unscaled"), format ); @@ -83,7 +86,7 @@ private: #endif -class KOEventViewer : public QTextBrowser { +class KOEventViewer : public Q3TextBrowser { Q_OBJECT public: KOEventViewer(QWidget *parent=0,const char *name=0); @@ -117,7 +120,7 @@ class KOEventViewer : public QTextBrowser { void keyPressEvent ( QKeyEvent * e ); private: - QTextBrowser *mEventTextView; + Q3TextBrowser *mEventTextView; bool mSyncMode; QString deTag(QString text); diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index 2e936f3..3a37852 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp @@ -22,12 +22,15 @@ #include #include #include +//Added by qt3to4: +#include +#include #include "koeventviewer.h" #include #include "koprefs.h" #include -#include "qapp.h" +#include "qapplication.h" #include "koeventviewerdialog.h" extern int globalFlagBlockAgenda; diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h index 71696f4..947c10b 100644 --- a/korganizer/koeventviewerdialog.h +++ b/korganizer/koeventviewerdialog.h @@ -22,7 +22,10 @@ // Viewer dialog for events. // -#include +#include +//Added by qt3to4: +#include +#include #include diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index ee9c9f6..8335ba9 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -27,10 +27,14 @@ #include #include #include -#include +#include #include -#include +#include #include +//Added by qt3to4: +#include +#include +#include #include @@ -47,8 +51,8 @@ -KOFilterView::KOFilterView(QPtrList *filterList,QWidget* parent, - const char* name,WFlags fl ) +KOFilterView::KOFilterView(Q3PtrList *filterList,QWidget* parent, + const char* name,Qt::WFlags fl ) : KOFilterView_base(parent,name,fl) { mFilters = filterList; @@ -114,14 +118,14 @@ void KOFilterView::setSelectedFilter( int fil ) KOCalEditView::KOCalEditView(QWidget* parent, const char* name ) - : QScrollView(parent,name) + : Q3ScrollView(parent,name) { mw = 0; setResizePolicy( AutoOneFit ); - setFrameStyle ( QFrame::Panel | QFrame::Plain ); + setFrameStyle ( Q3Frame::Panel | Q3Frame::Plain ); setLineWidth ( 1 ); setMidLineWidth ( 1 ); - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); } KOCalEditView::~KOCalEditView() @@ -247,55 +251,55 @@ void KOCalEditView::readConfig() mw = new QWidget ( viewport() ); addChild(mw); int ii = 0; - mainLayout = new QGridLayout ( mw , 2, 8 ); + mainLayout = new Q3GridLayout ( mw , 2, 8 ); mainLayout->setMargin( 2 ); mainLayout->setSpacing( 2 ); QPushButton * addButT = new QPushButton ( mw ); - addButT->setFocusPolicy(NoFocus); + addButT->setFocusPolicy(Qt::NoFocus); mainLayout->addWidget( addButT,0,0 ); addButT->setText( "D"); connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo())); - QWhatsThis::add( addButT, i18n("Please choose the default calendar in this column. Newly created or imported items are added to the default calendar.") ); + Q3WhatsThis::add( addButT, i18n("Please choose the default calendar in this column. Newly created or imported items are added to the default calendar.") ); //addBut->setPixmap ( SmallIcon("greenhook16")); QPushButton *addBut = new QPushButton ( mw ); - addBut->setFocusPolicy(NoFocus); + addBut->setFocusPolicy(Qt::NoFocus); mainLayout->addWidget( addBut,0,++ii ); addBut->setPixmap ( SmallIcon("eye")); - QWhatsThis::add( addBut, i18n("In this column you can set a calendar to be visible. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.") ); + Q3WhatsThis::add( addBut, i18n("In this column you can set a calendar to be visible. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.") ); connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); int max = addBut->sizeHint().height(); addBut->setMaximumWidth( max ); addButT->setFixedSize( QSize( max, max ) ); QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); mainLayout->addWidget( lab,0,++ii ); - QWhatsThis::add( lab, i18n("In this column you can see the name of the calendar. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.") ); + Q3WhatsThis::add( lab, i18n("In this column you can see the name of the calendar. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.") ); //lab = new QLabel ( i18n(" "), mw ); //mainLayout->addWidget( lab,0,++ii ); //lab->setFixedWidth( 1 ); addBut = new QPushButton ( mw ); - addBut->setFocusPolicy(NoFocus); + addBut->setFocusPolicy(Qt::NoFocus); mainLayout->addWidget( addBut,0,++ii ); addBut->setPixmap ( SmallIcon("bell")); - QWhatsThis::add( addBut, i18n("In this column you can disable the alarms of a calendar all together. The alarm data in the calendar itself is not changed, the alarms are marked internally as \"do not use\". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.") ); + Q3WhatsThis::add( addBut, i18n("In this column you can disable the alarms of a calendar all together. The alarm data in the calendar itself is not changed, the alarms are marked internally as \"do not use\". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.") ); connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); addBut->setMaximumWidth( addBut->sizeHint().height() ); addBut = new QPushButton ( mw ); - addBut->setFocusPolicy(NoFocus); + addBut->setFocusPolicy(Qt::NoFocus); mainLayout->addWidget( addBut,0,++ii ); addBut->setPixmap ( SmallIcon("pencil")); - QWhatsThis::add( addBut, i18n("In this column you can set a calendar and all entries of the calendar to read only. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.") ); + Q3WhatsThis::add( addBut, i18n("In this column you can set a calendar and all entries of the calendar to read only. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.") ); connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); addBut->setMaximumWidth( addBut->sizeHint().height() ); lab = new QLabel ( "", mw ); mainLayout->addWidget( lab,0,++ii ); addBut = new QPushButton ( mw ); - addBut->setFocusPolicy(NoFocus); + addBut->setFocusPolicy(Qt::NoFocus); mainLayout->addWidget( addBut,0,++ii ); addBut->setPixmap ( SmallIcon("plus")); connect(addBut,SIGNAL(clicked()),SLOT(addCal())); - QWhatsThis::add( addBut, i18n("Click this button to add a calendar. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.") ); + Q3WhatsThis::add( addBut, i18n("Click this button to add a calendar. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.") ); lab = new QLabel ( " ", mw ); mainLayout->addWidget( lab,0,++ii ); @@ -431,11 +435,11 @@ int KOCalEditView::addCalendar( QString name, QString file, bool ask ) if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( KGlobal::formatMessage (absFile,0) ) )== KMessageBox::No ) return 0; QFile fileIn( absFile ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); return 0; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n"; fileIn.close(); @@ -475,7 +479,7 @@ void KOCalEditView::disableRO() { toggleList( mROB, false ); } -void KOCalEditView::toggleList ( QPtrList list , bool enable ) +void KOCalEditView::toggleList ( Q3PtrList list , bool enable ) { bool dis = !enable; KOCalCheckButton* it = list.first(); diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index 0dd423a..f1bbab4 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h @@ -26,12 +26,18 @@ #include #include #include +#include #include #include #include #include -#include +#include #include +//Added by qt3to4: +#include +#include +#include +#include #include #include "kofilterview_base.h" @@ -42,7 +48,7 @@ #include #include -class QGridLayout; +class Q3GridLayout; using namespace KCal; @@ -54,7 +60,7 @@ class KONewCalPrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Add new Calendar") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("Name of new calendar:"), this ); @@ -110,7 +116,7 @@ class KOCalButton : public QPushButton connect( this, SIGNAL( clicked() ), SLOT( bottonClicked() )); mNumber = -1; - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); } void setNum ( int num ) {mNumber = num; } signals: @@ -135,7 +141,7 @@ class KOCalCheckButton : public QCheckBox connect( this, SIGNAL( toggled ( bool ) ), SLOT( bottonClicked( bool ) )); mNumber = -1; - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); //setMaximumWidth( 10 ); } @@ -163,7 +169,7 @@ class KOCalRadioButton : public QRadioButton connect( this, SIGNAL( toggled ( bool ) ), SLOT( bottonClicked( bool ) )); mNumber = -1; - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); //setMaximumWidth( 10 ); } @@ -188,7 +194,7 @@ class KOFilterView : public KOFilterView_base { Q_OBJECT public: - KOFilterView(QPtrList *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); + KOFilterView(Q3PtrList *filterList,QWidget* parent=0,const char* name=0, Qt::WFlags fl=0); ~KOFilterView(); void updateFilters(); @@ -204,10 +210,10 @@ class KOFilterView : public KOFilterView_base void editFilters(); private: - QPtrList *mFilters; + Q3PtrList *mFilters; }; -class KOCalEditView : public QScrollView +class KOCalEditView : public Q3ScrollView { Q_OBJECT public: @@ -244,12 +250,12 @@ class KOCalEditView : public QScrollView private: QWidget *mw; - void toggleList ( QPtrList , bool b = true ); - QPtrList mStdandardB; - QPtrList mEnabledB; - QPtrList mAlarmB; - QPtrList mROB; - QGridLayout* mainLayout; + void toggleList ( Q3PtrList , bool b = true ); + Q3PtrList mStdandardB; + Q3PtrList mEnabledB; + Q3PtrList mAlarmB; + Q3PtrList mROB; + Q3GridLayout* mainLayout; }; diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp index 79b97e8..63d044c 100644 --- a/korganizer/koimportoldialog.cpp +++ b/korganizer/koimportoldialog.cpp @@ -22,20 +22,20 @@ */ #include -#include +#include #include #include -#include -#include -#include +#include +#include +#include #include #include #include -#include +#include #include -#include +#include #include -#include +#include #include #include @@ -70,13 +70,13 @@ QDateTime mDdate2Qdtr( DATE dt) return qdt; } -class OLEListViewItem : public QCheckListItem +class OLEListViewItem : public Q3CheckListItem { public: - OLEListViewItem( QListView *parent, QString text ) : - QCheckListItem( parent, text, QCheckListItem::CheckBox ) { mData = 0; }; - OLEListViewItem( QListViewItem *after, QString text ) : - QCheckListItem( after, text, QCheckListItem::CheckBox ) { mData = 0; }; + OLEListViewItem( Q3ListView *parent, QString text ) : + Q3CheckListItem( parent, text, Q3CheckListItem::CheckBox ) { mData = 0; }; + OLEListViewItem( Q3ListViewItem *after, QString text ) : + Q3CheckListItem( after, text, Q3CheckListItem::CheckBox ) { mData = 0; }; ~OLEListViewItem() {}; void setData( DWORD data ) {mData= data; }; DWORD data() { return mData ;}; @@ -89,9 +89,9 @@ KOImportOLdialog::KOImportOLdialog( const QString &caption, KDialogBase( Plain, caption, User1 | Close, Ok, parent, caption, true, false, i18n("Import!") ) { - QHBox * mw = new QHBox( this ); + Q3HBox * mw = new Q3HBox( this ); setMainWidget( mw ); - mListView = new QListView( mw ); + mListView = new Q3ListView( mw ); mListView->addColumn(i18n("Select Folder to import")); mListView->addColumn(i18n("Content Type")); mCalendar = calendar; @@ -212,7 +212,7 @@ void KOImportOLdialog::readCalendarData( DWORD folder ) LPDISPATCH itm; int i; folderItems = mf.GetItems(); - QProgressDialog bar( i18n("Importing calendar data"),i18n("Abort"), folderItems.GetCount(),this ); + Q3ProgressDialog bar( i18n("Importing calendar data"),i18n("Abort"), folderItems.GetCount(),this ); bar.setCaption (i18n("Importing!") ); int h = bar.sizeHint().height() ; int w = 300; diff --git a/korganizer/koimportoldialog.h b/korganizer/koimportoldialog.h index c8847c5..d66f099 100644 --- a/korganizer/koimportoldialog.h +++ b/korganizer/koimportoldialog.h @@ -31,7 +31,7 @@ class QDateTime; -class QListView; +class Q3ListView; class OLEListViewItem; class _AppointmentItem; namespace KPIM { class CategorySelectDialog; } @@ -72,7 +72,7 @@ class KOImportOLdialog : public KDialogBase void ol2kopiCalendar( _AppointmentItem * , bool computeRecurrence = true ); Calendar *mCalendar; - QListView * mListView; + Q3ListView * mListView; QString getUidByEmail( QString email ); private: diff --git a/korganizer/koincidenceeditor.cpp b/korganizer/koincidenceeditor.cpp index 236f6f9..2060ea1 100644 --- a/korganizer/koincidenceeditor.cpp +++ b/korganizer/koincidenceeditor.cpp @@ -22,12 +22,14 @@ */ #include -#include +#include #include #include -#include +#include #include #include +//Added by qt3to4: +#include #include #include @@ -82,9 +84,9 @@ KOIncidenceEditor::~KOIncidenceEditor() void KOIncidenceEditor::setupAttendeesTab() { - QFrame *topFrame = addPage(i18n("Attendees")); + Q3Frame *topFrame = addPage(i18n("Attendees")); - QBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); mDetails = new KOEditorDetails(spacingHint()-2,topFrame); topLayout->addWidget(mDetails); diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index 406df5a..51594ff 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp @@ -25,13 +25,19 @@ // View of Journal entries #include -#include -#include -#include +#include +#include +#include #include #include #include #include +#include +//Added by qt3to4: +#include +#include +#include +#include #include #include @@ -51,7 +57,7 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, : KOrg::BaseView(calendar, parent, name) { mCalendar = calendar; - QHBox * vb = new QHBox ( this ); + Q3HBox * vb = new Q3HBox ( this ); QPushButton * newJournal = new QPushButton( vb ); QPixmap icon; if ( QApplication::desktop()->width() < 321 ) @@ -63,15 +69,15 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, newJournal->setFixedSize( size, size ); mDateLabel = new QLabel ( vb ); mDateLabel->setMargin(1); - mDateLabel->setAlignment(AlignCenter); - QScrollView * sv = new QScrollView( this ); - QVBoxLayout * hbl = new QVBoxLayout( this ); + mDateLabel->setAlignment(Qt::AlignCenter); + Q3ScrollView * sv = new Q3ScrollView( this ); + Q3VBoxLayout * hbl = new Q3VBoxLayout( this ); hbl->addWidget( vb ); hbl->addWidget( sv ); parWid = new QWidget( sv->viewport() ); sv->addChild(parWid); - sv->setResizePolicy( QScrollView:: AutoOneFit ); - mTopLayout = new QVBoxLayout(parWid); + sv->setResizePolicy( Q3ScrollView:: AutoOneFit ); + mTopLayout = new Q3VBoxLayout(parWid); connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) ); getNewEntry(); } @@ -96,9 +102,9 @@ JournalEntry* KOJournalView::getNewEntry() return Entry; } -QPtrList KOJournalView::selectedIncidences() +Q3PtrList KOJournalView::selectedIncidences() { - QPtrList eventList; + Q3PtrList eventList; return eventList; } @@ -162,13 +168,13 @@ void KOJournalView::showOnly ( Journal* j ) showDates( mDate, QDate() ); return; } - QPtrList jl; + Q3PtrList jl; jl.append ( j ); showList( jl ); JournalEntry* mEntry = jEntries.first(); mEntry->setShowOnly(); } -void KOJournalView::showList(QPtrList jl) +void KOJournalView::showList(Q3PtrList jl) { static bool ff = false; if ( ff ) return; @@ -225,11 +231,11 @@ void KOJournalView::showDates(const QDate &start, const QDate &) { mDate = start; mDateLabel->setText(KGlobal::locale()->formatDate(mDate)); - QPtrList jl = calendar()->journals4Date( start ); + Q3PtrList jl = calendar()->journals4Date( start ); showList( jl ); } -void KOJournalView::showEvents(QPtrList) +void KOJournalView::showEvents(Q3PtrList) { // After new creation of list view no events are selected. // emit incidenceSelected( 0 ); diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h index 7fa94ae..22f26cd 100644 --- a/korganizer/kojournalview.h +++ b/korganizer/kojournalview.h @@ -25,6 +25,11 @@ #include #include +//Added by qt3to4: +#include +#include +#include +#include class JournalEntry; class QLabel; @@ -46,7 +51,7 @@ class KOJournalView : public KOrg::BaseView virtual int currentDateCount(); void clearList(); - virtual QPtrList selectedIncidences(); + virtual Q3PtrList selectedIncidences(); DateList selectedDates() {DateList q; return q;}; @@ -60,17 +65,17 @@ class KOJournalView : public KOrg::BaseView void flushView(); void updateConfig(); void showDates( const QDate &start, const QDate &end ); - void showEvents(QPtrList eventList); + void showEvents(Q3PtrList eventList); void changeEventDisplay(Event *, int); private: - void showList(QPtrList jl); + void showList(Q3PtrList jl); Calendar *mCalendar; JournalEntry* getNewEntry(); - QPtrList jEntries; + Q3PtrList jEntries; void keyPressEvent ( QKeyEvent * ) ; - QBoxLayout *mTopLayout; + Q3BoxLayout *mTopLayout; QWidget *parWid; QLabel * mDateLabel; QDate mDate; diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 192f8c0..0ea1d50 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -22,20 +22,29 @@ without including the source code for Qt in the source distribution. */ -#include +#include #include #include -#include -#include +#include +#include #include #include #include -#include +#include #include -#include +#include #include #include -#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include + +#include #include #include @@ -70,10 +79,10 @@ extern QPixmap* sgListViewCompletedPix[6]; extern QPixmap* sgListViewJournalPix; -class KOListViewWhatsThis :public QWhatsThis +class KOListViewWhatsThis :public Q3WhatsThis { public: - KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; + KOListViewWhatsThis( QWidget *wid, KOListView* view ) : Q3WhatsThis( wid ), _wid(wid),_view (view) { }; protected: virtual QString text( const QPoint& p) @@ -274,29 +283,29 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, mListView->addColumn(i18n("Calendar")); mListView->addColumn(i18n("Last Modified")); - mListView->setColumnAlignment(0,AlignLeft); - mListView->setColumnAlignment(1,AlignLeft); - mListView->setColumnAlignment(2,AlignHCenter); - mListView->setColumnAlignment(3,AlignLeft); - mListView->setColumnAlignment(4,AlignHCenter); - mListView->setColumnAlignment(5,AlignLeft); - mListView->setColumnAlignment(6,AlignLeft); - mListView->setColumnAlignment(7,AlignLeft); - mListView->setColumnAlignment(8,AlignLeft); - mListView->setColumnAlignment(9,AlignLeft); - mListView->setColumnAlignment(10,AlignLeft); - mListView->setColumnAlignment(11,AlignLeft); + mListView->setColumnAlignment(0,Qt::AlignLeft); + mListView->setColumnAlignment(1,Qt::AlignLeft); + mListView->setColumnAlignment(2,Qt::AlignHCenter); + mListView->setColumnAlignment(3,Qt::AlignLeft); + mListView->setColumnAlignment(4,Qt::AlignHCenter); + mListView->setColumnAlignment(5,Qt::AlignLeft); + mListView->setColumnAlignment(6,Qt::AlignLeft); + mListView->setColumnAlignment(7,Qt::AlignLeft); + mListView->setColumnAlignment(8,Qt::AlignLeft); + mListView->setColumnAlignment(9,Qt::AlignLeft); + mListView->setColumnAlignment(10,Qt::AlignLeft); + mListView->setColumnAlignment(11,Qt::AlignLeft); mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); int iii = 0; for ( iii = 0; iii< 12 ; ++iii ) - mListView->setColumnWidthMode( iii, QListView::Manual ); + mListView->setColumnWidthMode( iii, Q3ListView::Manual ); - QBoxLayout *layoutTop = new QVBoxLayout(this); + Q3BoxLayout *layoutTop = new Q3VBoxLayout(this); layoutTop->addWidget(mListView); mListView->setFont ( KOPrefs::instance()->mListViewFont ); mPopupMenu = eventPopup(); - QPopupMenu* selPopup = new QPopupMenu ( this ); + Q3PopupMenu* selPopup = new Q3PopupMenu ( this ); mPopupMenu->insertSeparator(); selPopup->insertItem(i18n("All"),this, @@ -306,20 +315,20 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, selPopup->insertItem(i18n("Delete selected..."),this, SLOT(deleteAll())); mPopupMenu->insertItem(i18n("Selection"), selPopup ); - mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + mPopupMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Hide all selected"),this, SLOT(hideAll()),true); selPopup->insertSeparator(); - QPopupMenu * exportPO = new QPopupMenu ( this ); + Q3PopupMenu * exportPO = new Q3PopupMenu ( this ); selPopup->insertItem( i18n("Export"), exportPO ); #ifdef DESKTOP_VERSION mPopupMenu->insertSeparator(); - mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + mPopupMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Print complete list..."),this, SLOT(printList()),true); #endif - mCalPopup = new QPopupMenu ( this ); + mCalPopup = new Q3PopupMenu ( this ); selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); selPopup->insertItem(i18n("Set categories")+"...",this, @@ -327,10 +336,10 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, selPopup->insertItem( i18n("Set alarm..."),this, SLOT(setAlarm())); #if 0 - mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + mPopupMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Set categories")+"...",this, SLOT(setCat()),true); - mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + mPopupMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Set alarm..."),this, SLOT(setAlarm()),true); #endif @@ -356,7 +365,7 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, selPopup->insertItem( i18n("Beam via IR..."),this, SLOT(beamSelected())); #if 0 - mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + mPopupMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Beam via IR"),this, SLOT(beamSelected()),true); #endif @@ -375,13 +384,13 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, */ QObject::connect(mListView,SIGNAL( newEvent()), this,SIGNAL(signalNewEvent())); - QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), - this,SLOT(defaultItemAction(QListViewItem *))); - QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, + QObject::connect(mListView,SIGNAL(doubleClicked(Q3ListViewItem *)), + this,SLOT(defaultItemAction(Q3ListViewItem *))); + QObject::connect(mListView,SIGNAL(rightButtonPressed( Q3ListViewItem *, const QPoint &, int )), - this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); - QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), - SLOT(processSelectionChange(QListViewItem *))); + this,SLOT(popupMenu(Q3ListViewItem *,const QPoint &,int))); + QObject::connect(mListView,SIGNAL(currentChanged(Q3ListViewItem *)), + SLOT(processSelectionChange(Q3ListViewItem *))); QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), SIGNAL(showIncidenceSignal(Incidence *)) ); @@ -428,7 +437,7 @@ void KOListView::setCalendar( int c ) return; } - QPtrList delSel = getSelectedIncidences() ; + Q3PtrList delSel = getSelectedIncidences() ; int icount = delSel.count(); if ( icount ) { Incidence *incidence = delSel.first(); @@ -442,7 +451,7 @@ void KOListView::setCalendar( int c ) incidence = delSel.next(); } } - QPtrList calendars = KOPrefs::instance()->mCalendars; + Q3PtrList calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); while ( cal ) { mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); @@ -497,7 +506,7 @@ void KOListView::setAlarm() KOAlarmPrefs kap( this); if ( !kap.exec() ) return; - QPtrList delSel = getSelectedIncidences( true, true, false, true ); // no journals, only due todos + Q3PtrList delSel = getSelectedIncidences( true, true, false, true ); // no journals, only due todos Incidence* inc = delSel.first(); int count = 0; while ( inc ) { @@ -522,7 +531,7 @@ void KOListView::setAlarm() else alarm->setType(Alarm::Invalid); } else { - QPtrList alarms = inc->alarms(); + Q3PtrList alarms = inc->alarms(); Alarm *alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { alarm->setEnabled(false); @@ -552,7 +561,7 @@ void KOListView::setCategories( bool removeOld ) } QStringList catList = csd->selectedCategories(); delete csd; - QPtrList delSel = getSelectedIncidences(); // all inc allowed; + Q3PtrList delSel = getSelectedIncidences(); // all inc allowed; Incidence* inc = delSel.first(); while ( inc ) { if ( removeOld ) { @@ -572,7 +581,7 @@ void KOListView::setCategories( bool removeOld ) void KOListView::beamSelected() { - QPtrList delSel = getSelectedIncidences() ; + Q3PtrList delSel = getSelectedIncidences() ; if ( delSel.count() ) emit beamIncidenceList( delSel ); } @@ -587,7 +596,7 @@ void KOListView::saveDescriptionToFile() if ( result != 0 ) { return; } - QPtrList delSel = getSelectedIncidences() ; + Q3PtrList delSel = getSelectedIncidences() ; int icount = delSel.count(); if ( icount ) { QString fn = KOPrefs::instance()->mLastSaveFile; @@ -645,11 +654,11 @@ void KOListView::saveDescriptionToFile() incidence = delSel.next(); } QFile file( fn ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); return; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts << text; file.close(); //qDebug("%s ", text.latin1()); @@ -667,12 +676,12 @@ void KOListView::saveToFile() { writeToFile( true ); } -QPtrList KOListView::getSelectedIncidences( bool includeEvents, bool includeTodos, bool includeJournals, bool onlyDueTodos ) +Q3PtrList KOListView::getSelectedIncidences( bool includeEvents, bool includeTodos, bool includeJournals, bool onlyDueTodos ) { - QPtrList delSel ; + Q3PtrList delSel ; bool addSubTodos = false; bool askSubTodos = true; - QListViewItem *item = mListView->firstChild (); + Q3ListViewItem *item = mListView->firstChild (); while ( item ) { if ( item->isSelected() ) { Incidence* inc = ((KOListViewItem *)item)->data(); @@ -706,7 +715,7 @@ QPtrList KOListView::getSelectedIncidences( bool includeEvents, bool askSubTodos = false; } if ( addSubTodos ) { - QPtrList tempSel ; + Q3PtrList tempSel ; inc->addRelationsToList( &tempSel ); Incidence* tempinc = tempSel.first(); while ( tempinc ) { @@ -730,7 +739,7 @@ QPtrList KOListView::getSelectedIncidences( bool includeEvents, bool void KOListView::writeToFile( bool iCal ) { - QPtrList delSel = getSelectedIncidences(); // all inc allowed; + Q3PtrList delSel = getSelectedIncidences(); // all inc allowed; if ( !iCal ) { bool journal = false; Incidence *incidence = delSel.first(); @@ -803,8 +812,8 @@ void KOListView::writeToFile( bool iCal ) } void KOListView::hideAll() { - QPtrList delSel ; - QListViewItem *item = mListView->firstChild (); + Q3PtrList delSel ; + Q3ListViewItem *item = mListView->firstChild (); while ( item ) { if ( item->isSelected() ) { delSel.append(item); @@ -813,7 +822,7 @@ void KOListView::hideAll() } item = delSel.first() ; while ( item ) { - QListViewItem * del = item; + Q3ListViewItem * del = item; item = delSel.next(); delete del; } @@ -824,7 +833,7 @@ void KOListView::printList() } void KOListView::deleteAll() { - QPtrList delSel = getSelectedIncidences(); // all inc allowed;; + Q3PtrList delSel = getSelectedIncidences(); // all inc allowed;; if ( delSel.count() ) { int icount = delSel.count(); Incidence *incidence = delSel.first(); @@ -838,11 +847,11 @@ void KOListView::deleteAll() int delCounter = 0; QDialog dia ( this, "p-dialog", true ); QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); - QVBoxLayout lay( &dia ); + Q3VBoxLayout lay( &dia ); lay.setMargin(7); lay.setSpacing(7); lay.addWidget( &lab); - QProgressBar bar( icount, &dia ); + Q3ProgressBar bar( icount, &dia ); lay.addWidget( &bar); int w = 220; int h = 50; @@ -884,10 +893,10 @@ int KOListView::currentDateCount() return 0; } -QPtrList KOListView::selectedIncidences() +Q3PtrList KOListView::selectedIncidences() { - QPtrList eventList; - QListViewItem *item = mListView->firstChild (); + Q3PtrList eventList; + Q3ListViewItem *item = mListView->firstChild (); while ( item ) { if ( item->isSelected() ) { eventList.append(((KOListViewItem *)item)->data()); @@ -987,7 +996,7 @@ void KOListView::showDates(const QDate &start, const QDate &end) } -void KOListView::addEvents(QPtrList eventList) +void KOListView::addEvents(Q3PtrList eventList) { Event *ev; @@ -999,7 +1008,7 @@ void KOListView::addEvents(QPtrList eventList) } } -void KOListView::addTodos(QPtrList eventList) +void KOListView::addTodos(Q3PtrList eventList) { Todo *ev; for(ev = eventList.first(); ev; ev = eventList.next()) { @@ -1009,7 +1018,7 @@ void KOListView::addTodos(QPtrList eventList) updateView(); } } -void KOListView::addJournals(QPtrList eventList) +void KOListView::addJournals(Q3PtrList eventList) { Journal *ev; for(ev = eventList.first(); ev; ev = eventList.next()) { @@ -1044,7 +1053,7 @@ void KOListView::addIncidence(Incidence *incidence) else delete item; } -void KOListView::showEvents(QPtrList eventList) +void KOListView::showEvents(Q3PtrList eventList) { clear(); @@ -1095,14 +1104,14 @@ KOListViewItem *KOListView::getItemForEvent(Incidence *event) return 0; } -void KOListView::defaultItemAction(QListViewItem *i) +void KOListView::defaultItemAction(Q3ListViewItem *i) { KOListViewItem *item = static_cast( i ); if ( item ) defaultAction( item->data() ); } -void KOListView::popupMenu(QListViewItem *item,const QPoint &,int) +void KOListView::popupMenu(Q3ListViewItem *item,const QPoint &,int) { mActiveItem = (KOListViewItem *)item; if (mActiveItem) { @@ -1131,7 +1140,7 @@ void KOListView::writeSettings(KConfig *config, QString setting) mListView->saveLayout(config, setting); } -void KOListView::processSelectionChange(QListViewItem *) +void KOListView::processSelectionChange(Q3ListViewItem *) { KOListViewItem *item = @@ -1180,8 +1189,8 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) switch ( e->key() ) { case Qt::Key_Down: - if ( e->state() == ShiftButton ) { - QListViewItem* cn = currentItem(); + if ( e->state() == Qt::ShiftButton ) { + Q3ListViewItem* cn = currentItem(); if ( !cn ) cn = firstChild(); if ( !cn ) @@ -1194,10 +1203,10 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) e->accept(); return; } - if ( e->state() == ControlButton ) { + if ( e->state() == Qt::ControlButton ) { int count = childCount (); int jump = count / 5; - QListViewItem* cn; + Q3ListViewItem* cn; cn = currentItem(); if ( ! cn ) return; @@ -1211,13 +1220,13 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) ensureItemVisible ( cn ); } else - QListView::keyPressEvent ( e ) ; + Q3ListView::keyPressEvent ( e ) ; e->accept(); break; case Qt::Key_Up: - if ( e->state() == ShiftButton ) { - QListViewItem* cn = firstChild(); + if ( e->state() == Qt::ShiftButton ) { + Q3ListViewItem* cn = firstChild(); if ( cn ) { setCurrentItem ( cn ); ensureItemVisible ( cn ); @@ -1225,10 +1234,10 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) e->accept(); return; } - if ( e->state() == ControlButton ) { + if ( e->state() == Qt::ControlButton ) { int count = childCount (); int jump = count / 5; - QListViewItem* cn; + Q3ListViewItem* cn; cn = currentItem(); if ( ! cn ) return; @@ -1241,11 +1250,11 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) setCurrentItem ( cn ); ensureItemVisible ( cn ); } else - QListView::keyPressEvent ( e ) ; + Q3ListView::keyPressEvent ( e ) ; e->accept(); break; case Qt::Key_I: { - QListViewItem* cn; + Q3ListViewItem* cn; cn = currentItem(); if ( cn ) { KOListViewItem* ci = (KOListViewItem*)( cn ); @@ -1265,12 +1274,12 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) case Qt::Key_Return: case Qt::Key_Enter: { - QListViewItem* cn; + Q3ListViewItem* cn; cn = currentItem(); if ( cn ) { KOListViewItem* ci = (KOListViewItem*)( cn ); if ( ci ){ - if ( e->state() == ShiftButton ) + if ( e->state() == Qt::ShiftButton ) ci->setSelected( false ); else ci->setSelected( true ); @@ -1300,12 +1309,12 @@ KOListViewListView::KOListViewListView(KOListView * lv ) #ifndef DESKTOP_VERSION //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); #endif - setSelectionMode( QListView::Multi ); + setSelectionMode( Q3ListView::Multi ); setMultiSelection( true); } -bool KOListViewListView::hasMultiSelection(QListViewItem* item) +bool KOListViewListView::hasMultiSelection(Q3ListViewItem* item) { - QListViewItem *qitem = firstChild (); + Q3ListViewItem *qitem = firstChild (); while ( qitem ) { if ( qitem->isSelected() && item != qitem ) return true; @@ -1317,7 +1326,7 @@ void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) { if (!e) return; QPoint vp = contentsToViewport(e->pos()); - QListViewItem *item = itemAt(vp); + Q3ListViewItem *item = itemAt(vp); if (!item) { emit newEvent(); return; @@ -1329,8 +1338,8 @@ void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) { //qDebug("contentsMousePressEvent++++ "); KListView::contentsMousePressEvent( e ); - if ( e->button() == RightButton ) { - QListViewItem* ci = currentItem(); + if ( e->button() == Qt::RightButton ) { + Q3ListViewItem* ci = currentItem(); clearSelection () ; if ( ci ) ci->setSelected( true ); @@ -1348,7 +1357,7 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) void KOListViewListView::popupMenu() { mPopupTimer->stop(); - QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton ); + QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, Qt::RightButton , Qt::RightButton ); QApplication::postEvent( this->viewport(), e ); } @@ -1356,14 +1365,14 @@ void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) { //qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y()); mYMousePos = mapToGlobal( (e->pos())).y(); - if ( e->button() == LeftButton ) { + if ( e->button() == Qt::LeftButton ) { mPopupTimer->start( 600 ); mEventPos = contentsToViewport(e->pos()); mEventGlobalPos = e->globalPos(); } KListView::contentsMousePressEvent( e ); - if ( e->button() == RightButton ) { - QListViewItem* ci = currentItem(); + if ( e->button() == Qt::RightButton ) { + Q3ListViewItem* ci = currentItem(); //clearSelection(); if ( ci ) ci->setSelected( true ); @@ -1390,7 +1399,7 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) } #define protected public -#include +#include #undef protected void KOListViewListView::printList() { @@ -1407,7 +1416,7 @@ void KOListViewListView::printList() QPainter p; p.begin ( &printer ); p.setFont(font()); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); @@ -1443,7 +1452,7 @@ void KOListViewListView::printList() p.save(); for ( iii = 0; iii < cou; ++iii ) { int align = columnAlignment( iii ); - if ( align == AlignAuto ) align = AlignLeft; + if ( align == Qt::AlignLeft ) align = Qt::AlignLeft; p.restore(); p.save(); p.translate( header()->sectionPos( iii ), 0); diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h index 99d0561..9fb0b00 100644 --- a/korganizer/kolistview.h +++ b/korganizer/kolistview.h @@ -24,9 +24,15 @@ #ifndef _KOLISTVIEW_H #define _KOLISTVIEW_H -#include +#include #include -#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include #include @@ -47,7 +53,7 @@ class KOListViewWhatsThis; #include #include #include -#include +#include #include #include #include "kfiledialog.h" @@ -60,7 +66,7 @@ class KOAlarmPrefs : public QDialog QDialog( par, name, true ) { setCaption( i18n("Alarm Options") ); - QVBoxLayout* alarmLayout = new QVBoxLayout( this ); + Q3VBoxLayout* alarmLayout = new Q3VBoxLayout( this ); alarmLayout->setSpacing( 3 ); alarmLayout->setMargin( 3 ); QWidget *parent = this; @@ -74,7 +80,7 @@ class KOAlarmPrefs : public QDialog mAlarmIncrCombo->insertItem(i18n("hour(s)")); mAlarmIncrCombo->insertItem(i18n("day(s)")); alarmLayout->addWidget(mAlarmIncrCombo); - QHBox * hb = new QHBox ( parent ); + Q3HBox * hb = new Q3HBox ( parent ); alarmLayout->addWidget(hb); mAlarmSoundButton = new QPushButton(hb); mAlarmSoundButton->setPixmap(SmallIcon("playsound")); @@ -210,7 +216,7 @@ class KOListViewListView : public KListView Q_OBJECT public: KOListViewListView(KOListView * lv ); - bool hasMultiSelection(QListViewItem*); + bool hasMultiSelection(Q3ListViewItem*); void printList(); signals: void newEvent(); @@ -240,13 +246,13 @@ class KOListView : public KOEventView virtual int maxDatesHint(); virtual int currentDateCount(); - virtual QPtrList selectedIncidences(); + virtual Q3PtrList selectedIncidences(); virtual DateList selectedDates(); void showDates(bool show); Incidence* currentItem(); - void addTodos(QPtrList eventList); - void addJournals(QPtrList eventList); + void addTodos(Q3PtrList eventList); + void addJournals(Q3PtrList eventList); virtual void printPreview(CalPrinter *calPrinter, const QDate &, const QDate &); @@ -257,11 +263,11 @@ class KOListView : public KOEventView void setStartDate(const QDate &start); int count(); QString getWhatsThisText(QPoint p); - QPtrList KOListView::getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false ); + Q3PtrList getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false ); void showCompletedTodos(); signals: void signalNewEvent(); - void beamIncidenceList(QPtrList); + void beamIncidenceList(Q3PtrList); public slots: void hideAll(); @@ -269,7 +275,7 @@ class KOListView : public KOEventView void resetFocus(); virtual void updateView(); virtual void showDates(const QDate &start, const QDate &end); - virtual void showEvents(QPtrList eventList); + virtual void showEvents(Q3PtrList eventList); void clearSelection(); void allSelection(); @@ -287,29 +293,29 @@ class KOListView : public KOEventView void setCategories( bool removeOld ); void changeEventDisplay(Event *, int); - void defaultItemAction(QListViewItem *item); - void popupMenu(QListViewItem *item,const QPoint &,int); + void defaultItemAction(Q3ListViewItem *item); + void popupMenu(Q3ListViewItem *item,const QPoint &,int); void setCalendar( int c ); void populateCalPopup(); protected slots: - void processSelectionChange(QListViewItem *); + void processSelectionChange(Q3ListViewItem *); void catChanged( Incidence* ); protected: void writeToFile( bool iCal ); - void addEvents(QPtrList eventList); + void addEvents(Q3PtrList eventList); void addIncidence(Incidence *); KOListViewItem *getItemForEvent(Incidence *event); private: bool mForceShowCompletedTodos; - QPopupMenu* mCalPopup; + Q3PopupMenu* mCalPopup; KOListViewWhatsThis *mKOListViewWhatsThis; KOListViewListView *mListView; KOEventPopupMenu *mPopupMenu; KOListViewItem *mActiveItem; - QDict mUidDict; + Q3Dict mUidDict; QDate mStartDate; void keyPressEvent ( QKeyEvent * ) ; }; diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 85e9166..ca55c43 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -17,22 +17,34 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include -#include +#include #ifndef DESKTOP_VERSION #include #else #include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif #include @@ -59,10 +71,10 @@ #ifdef DESKTOP_VERSION QToolTipGroup *MonthViewCell::mToolTipGroup = 0; #endif -class KNOWhatsThis :public QWhatsThis +class KNOWhatsThis :public Q3WhatsThis { public: - KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; + KNOWhatsThis( KNoScrollListBox* sbox ) : Q3WhatsThis( sbox ), _wid( sbox) { }; //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; protected: @@ -77,7 +89,7 @@ private: KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) - : QListBox(parent, name, WRepaintNoErase) + : Q3ListBox(parent, name, Qt::WNoAutoErase) { #ifndef DESKTOP_VERSION QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); @@ -85,8 +97,8 @@ KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) mBlockDeselect = false; mWT = new KNOWhatsThis(this); resetOnFocusIn = true; - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } KNoScrollListBox::~KNoScrollListBox() { @@ -100,7 +112,7 @@ KNoScrollListBox::~KNoScrollListBox() void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) { - QListBox::focusInEvent ( e ); + Q3ListBox::focusInEvent ( e ); if ( count() ){ int ci = currentItem(); if ( ci < 0 ) ci = 0; @@ -112,24 +124,24 @@ void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) resetOnFocusIn = true; if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) { - QListBoxItem *fi = firstItem (); + Q3ListBoxItem *fi = firstItem (); if (fi ) { int ihei = fi->height( this ); int hei = numRows () * ihei; if ( hei < height() - horizontalScrollBar()->height () ) { - setVScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); } else - setVScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); if ( ihei *3 > height() ) { - setHScrollBarMode(QScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } else { - setHScrollBarMode(QScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } else { - setVScrollBarMode(QScrollView::Auto); - setHScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } } @@ -141,10 +153,10 @@ void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) if ( i >= 0 ) { setSelected ( i, false ); } - QListBox::focusOutEvent ( e ); + Q3ListBox::focusOutEvent ( e ); } - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); if ( ! mBlockDeselect ) emit highlightIncidence( 0, (MonthViewCell*)this, 0 ); mBlockDeselect = false; @@ -152,7 +164,7 @@ void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) QString KNoScrollListBox::getWhatsThisText(QPoint p) { - QListBoxItem* item = itemAt ( p ); + Q3ListBoxItem* item = itemAt ( p ); if ( ! item ) { return i18n("Click in the cell\nto add an event!"); } @@ -165,7 +177,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) { //qDebug("KNoScrollListBox::keyPressEvent "); switch(e->key()) { - case Key_Right: + case Qt::Key_Right: if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { e->ignore(); @@ -173,7 +185,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } scrollBy(10,0); break; - case Key_Left: + case Qt::Key_Left: if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { e->ignore(); @@ -181,7 +193,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } scrollBy(-10,0); break; - case Key_Up: + case Qt::Key_Up: if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { e->ignore(); break; @@ -201,7 +213,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } } break; - case Key_Down: + case Qt::Key_Down: if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { e->ignore(); break; @@ -221,12 +233,12 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } } break; - case Key_I: + case Qt::Key_I: QTimer::singleShot( 1, this, SLOT ( oneDown() ) ); e->ignore(); break; - case Key_Return: - case Key_Enter: + case Qt::Key_Return: + case Qt::Key_Enter: { if ( currentItem() >= 0 ) { emit doubleClicked( item( currentItem() ) ); @@ -236,7 +248,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } } break; - case Key_Shift: + case Qt::Key_Shift: emit shiftDown(); break; default: @@ -266,7 +278,7 @@ void KNoScrollListBox::oneDown() void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) { switch(e->key()) { - case Key_Shift: + case Qt::Key_Shift: emit shiftUp(); break; default: @@ -276,15 +288,15 @@ void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) void KNoScrollListBox::mousePressEvent(QMouseEvent *e) { - QListBox::mousePressEvent(e); + Q3ListBox::mousePressEvent(e); - if(e->button() == RightButton) { + if(e->button() == Qt::RightButton) { emit rightClick(); } } MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s) - : QListBoxItem() + : Q3ListBoxItem() { mblockRepaint = true; isWeekItem = KOPrefs::instance()->mMonthViewWeek; @@ -395,14 +407,14 @@ void MonthViewItem::paint(QPainter *p) p->setBrush( QBrush( textColor ) ); p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; if ( mMultiday == 2 || mMultiday == 3 ) { - QPointArray pa ( 3 ); + Q3PointArray pa ( 3 ); pa.setPoint (0, x, yyy ); pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 ); pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 ); p->drawPolygon( pa ); } if ( mMultiday == 2 || mMultiday == 1 ) { - QPointArray pa ( 3 ); + Q3PointArray pa ( 3 ); pa.setPoint (0, x+sizeM +sizeM/2, yyy ); pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); @@ -462,7 +474,7 @@ void MonthViewItem::paint(QPainter *p) } } -int MonthViewItem::height(const QListBox *lb) const +int MonthViewItem::height(const Q3ListBox *lb) const { int ret = 10; if ( lb ) @@ -470,7 +482,7 @@ int MonthViewItem::height(const QListBox *lb) const return ret; } -int MonthViewItem::width(const QListBox *lb) const +int MonthViewItem::width(const Q3ListBox *lb) const { if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) { int size = PIXMAP_SIZE; @@ -514,10 +526,10 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) //mLabel->setLineWidth( 1 ); //mLabel->setAlignment( AlignCenter ); mLabel->setFlat( true ); - mLabel->setFocusPolicy(NoFocus); + mLabel->setFocusPolicy(Qt::NoFocus); //mItemList = new KNoScrollListBox( this ); setMinimumSize( 10, 10 ); - setFrameStyle( QFrame::Panel | QFrame::Plain ); + setFrameStyle( Q3Frame::Panel | Q3Frame::Plain ); setLineWidth( 1 ); //topLayout->addWidget( mItemList ); mLabel->raise(); @@ -529,13 +541,13 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) updateConfig(); //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); - connect( this , SIGNAL( doubleClicked( QListBoxItem *) ), - SLOT( defaultAction( QListBoxItem * ) ) ); - connect( this, SIGNAL( rightButtonPressed( QListBoxItem *, + connect( this , SIGNAL( doubleClicked( Q3ListBoxItem *) ), + SLOT( defaultAction( Q3ListBoxItem * ) ) ); + connect( this, SIGNAL( rightButtonPressed( Q3ListBoxItem *, const QPoint &) ), - SLOT( contextMenu( QListBoxItem * ) ) ); - connect( this, SIGNAL( highlighted( QListBoxItem *) ), - SLOT( selection( QListBoxItem * ) ) ); + SLOT( contextMenu( Q3ListBoxItem * ) ) ); + connect( this, SIGNAL( highlighted( Q3ListBoxItem *) ), + SLOT( selection( Q3ListBoxItem * ) ) ); /* connect( this, SIGNAL( clicked( QListBoxItem * ) ), @@ -545,7 +557,7 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) #ifdef DESKTOP_VERSION QToolTipGroup *MonthViewCell::toolTipGroup() { - if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); + /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */ return mToolTipGroup; } #endif @@ -637,7 +649,7 @@ void MonthViewCell::startUpdateCell() { blockSignals( true ); mdayCount = 0; - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); if ( !mMonthView->isUpdatePossible() ) return; MonthViewItem *mitem = (MonthViewItem*) firstItem (); @@ -692,7 +704,7 @@ int MonthViewCell::insertEvent(Event *event) useToolTips = false; #endif QString mToolTipText; - setFocusPolicy(WheelFocus); + setFocusPolicy(Qt::WheelFocus); if ( !(event->doesRecur() == Recurrence::rNone) ) { if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) return mdayCount; @@ -834,7 +846,7 @@ int MonthViewCell::insertEvent(Event *event) } for ( i = pos; i < itcount;++i ) { // qDebug("i %d mday %u count %d ",i,itcount,mdayCount ); - QListBoxItem* it = this->item ( i ); + Q3ListBoxItem* it = this->item ( i ); if ( it && text < it->text() ) { pos = i; break; @@ -850,7 +862,7 @@ int MonthViewCell::insertEvent(Event *event) } void MonthViewCell::insertTodo(Todo *todo) { - setFocusPolicy(WheelFocus); + setFocusPolicy(Qt::WheelFocus); QString text; if (todo->hasDueDate()) { if (!todo->doesFloat()) { @@ -922,7 +934,7 @@ void MonthViewCell::finishUpdateCell() #ifdef DESKTOP_VERSION if (mToolTip.count() > 0 ) { mToolTip.sort(); - QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); + /* TODO: hacker: QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); */ } #endif //sort(); @@ -938,13 +950,13 @@ void MonthViewCell::updateCell() return; startUpdateCell(); //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); - QPtrList events = mMonthView->calendar()->events( mDate, true ); + Q3PtrList events = mMonthView->calendar()->events( mDate, true ); Event *event; for( event = events.first(); event; event = events.next() ) { // for event insertEvent(event); } // insert due todos - QPtrList todos = mMonthView->calendar()->todos( mDate ); + Q3PtrList todos = mMonthView->calendar()->todos( mDate ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { insertTodo( todo ); @@ -992,28 +1004,28 @@ void MonthViewCell::enableScrollBars( bool enabled ) return; if ( enabled ) { - QListBoxItem *fi = firstItem (); + Q3ListBoxItem *fi = firstItem (); if (fi ) { int ihei = fi->height( this ); int hei = numRows () * ihei; if ( hei < height() - horizontalScrollBar()->height () ) { - setVScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); } else - setVScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); if ( ihei *3 > height() ) { - setHScrollBarMode(QScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } else { - setHScrollBarMode(QScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } else { - setVScrollBarMode(QScrollView::Auto); - setHScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } else { - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } } @@ -1083,7 +1095,7 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e ) KNoScrollListBox::resizeEvent ( e ); } -void MonthViewCell::defaultAction( QListBoxItem *item ) +void MonthViewCell::defaultAction( Q3ListBoxItem *item ) { if ( !item ) { @@ -1105,7 +1117,7 @@ void MonthViewCell::newEvent() QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); emit newEventSignal( dt ); } -void MonthViewCell::cellClicked( QListBoxItem *item ) +void MonthViewCell::cellClicked( Q3ListBoxItem *item ) { mMonthView->setSelectedCell( this ); if ( item == 0 ) { @@ -1116,7 +1128,7 @@ void MonthViewCell::cellClicked( QListBoxItem *item ) } -void MonthViewCell::contextMenu( QListBoxItem *item ) +void MonthViewCell::contextMenu( Q3ListBoxItem *item ) { mMonthView->setPopupCell( this ); if ( !item ) { @@ -1133,7 +1145,7 @@ void MonthViewCell::contextMenu( QListBoxItem *item ) } } -void MonthViewCell::selection( QListBoxItem *item ) +void MonthViewCell::selection( Q3ListBoxItem *item ) { if ( !item ) { emit highlightIncidence( 0 , this, 0 ); @@ -1185,8 +1197,8 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) clPending = true; mPopupCell = 0; mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); - mWidStack = new QWidgetStack( this ); - QVBoxLayout* hb = new QVBoxLayout( this ); + mWidStack = new Q3WidgetStack( this ); + Q3VBoxLayout* hb = new Q3VBoxLayout( this ); mMonthView = new QWidget( mWidStack ); mWeekView = new QWidget( mWidStack ); #if QT_VERSION >= 0x030000 @@ -1215,15 +1227,15 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) for( i = 0; i < mDaysPerWeek; i++ ) { QLabel *label = new QLabel( mMonthView ); label->setFont(bfont); - label->setFrameStyle(QFrame::Panel|QFrame::Raised); + label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised); label->setLineWidth(1); - label->setAlignment(AlignCenter); + label->setAlignment(Qt::AlignCenter); mDayLabels.insert( i, label ); label = new QLabel( mWeekView ); label->setFont(bfont); - label->setFrameStyle(QFrame::Panel|QFrame::Raised); + label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised); label->setLineWidth(1); - label->setAlignment(AlignCenter); + label->setAlignment(Qt::AlignCenter); mDayLabelsW.insert( i, label ); } @@ -1232,34 +1244,34 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mWeekLabelsW.resize( 2 ); for( i = 0; i < mNumWeeks+1; i++ ) { KOWeekButton *label = new KOWeekButton( mMonthView ); - label->setFocusPolicy(NoFocus); + label->setFocusPolicy(Qt::NoFocus); label->setFont(bfont); connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); label->setFlat(true); - QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); + Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); //label->setFrameStyle(QFrame::Panel|QFrame::Raised); //label->setLineWidth(1); //label->setAlignment(AlignCenter); mWeekLabels.insert( i, label ); } mWeekLabels[mNumWeeks]->setText( i18n("W")); - mWeekLabels[mNumWeeks]->setFocusPolicy(WheelFocus); - QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); + mWeekLabels[mNumWeeks]->setFocusPolicy(Qt::WheelFocus); + Q3WhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); for( i = 0; i < 1+1; i++ ) { KOWeekButton *label = new KOWeekButton( mWeekView ); - label->setFocusPolicy(NoFocus); + label->setFocusPolicy(Qt::NoFocus); label->setFont(bfont); connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); label->setFlat(true); - QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); + Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); //label->setFrameStyle(QFrame::Panel|QFrame::Raised); //label->setLineWidth(1); //label->setAlignment(AlignCenter); mWeekLabelsW.insert( i, label ); } mWeekLabelsW[1]->setText( i18n("W")); - mWeekLabelsW[1]->setFocusPolicy(WheelFocus); + mWeekLabelsW[1]->setFocusPolicy(Qt::WheelFocus); int row, col; @@ -1305,13 +1317,13 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); mContextMenu = eventPopup(); - mContextMenu->addAdditionalItem(QIconSet(QPixmap()), + mContextMenu->addAdditionalItem(QIcon(QPixmap()), i18n("New Event..."),this, SLOT(slotNewEvent()),false); - mContextMenu->addAdditionalItem(QIconSet(QPixmap()), + mContextMenu->addAdditionalItem(QIcon(QPixmap()), i18n("New Todo..."),this, SLOT(slotNewTodo()),false); - mContextMenu->addAdditionalItem(QIconSet(QPixmap()), + mContextMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Journal"),this, SLOT(slotEditJournal()),false); @@ -1325,7 +1337,7 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) pathString += "icons16/"; } else pathString += "iconsmini/"; - mNewItemMenu = new QPopupMenu( this ); + mNewItemMenu = new Q3PopupMenu( this ); mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent())); mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false); mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false); @@ -1397,7 +1409,7 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int break; } } - QPtrVector *cells; + Q3PtrVector *cells; if ( weekview ) cells = &mCellsW; else { @@ -1495,9 +1507,9 @@ int KOMonthView::currentDateCount() return mNumCells; } -QPtrList KOMonthView::selectedIncidences() +Q3PtrList KOMonthView::selectedIncidences() { - QPtrList selected; + Q3PtrList selected; if ( mSelectedCell ) { Incidence *incidence = mSelectedCell->selectedIncidence(); @@ -1561,7 +1573,7 @@ void KOMonthView::updateConfig() mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); } #ifdef DESKTOP_VERSION - MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); + /* TODO:hacker: MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); */ #endif updateView(); } @@ -1569,7 +1581,7 @@ void KOMonthView::updateConfig() void KOMonthView::updateDayLabels() { - QPtrVector *mDayLabelsT; + Q3PtrVector *mDayLabelsT; mDayLabelsT = &mDayLabelsW; for (int i = 0; i < 7; i++) { @@ -1610,9 +1622,9 @@ void KOMonthView::showDates(const QDate &start, const QDate &) { // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; - QPtrVector *cells; - QPtrVector *dayLabels; - QPtrVector *weekLabels; + Q3PtrVector *cells; + Q3PtrVector *dayLabels; + Q3PtrVector *weekLabels; uint weekNum = 6; mStartDate = start; if ( mShowWeekView ) { @@ -1668,7 +1680,7 @@ void KOMonthView::showDates(const QDate &start, const QDate &) updateView(); } -void KOMonthView::showEvents(QPtrList) +void KOMonthView::showEvents(Q3PtrList) { qDebug("KOMonthView::selectEvents is not implemented yet. "); } @@ -1690,7 +1702,7 @@ void KOMonthView::updateView() //QTime ti; //ti.start(); clearSelection(); - QPtrVector *cells; + Q3PtrVector *cells; if ( mShowWeekView ) { cells = &mCellsW; } else { @@ -1705,7 +1717,7 @@ void KOMonthView::updateView() (*cells)[i]->startUpdateCell(); } - QPtrList events = calendar()->events(); + Q3PtrList events = calendar()->events(); Event *event; QDateTime dt; QDate endDate = mStartDate.addDays( timeSpan ); @@ -1769,7 +1781,7 @@ void KOMonthView::updateView() } } // insert due todos - QPtrList todos = calendar()->todos( ); + Q3PtrList todos = calendar()->todos( ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { //insertTodo( todo ); @@ -2225,7 +2237,7 @@ void KOMonthView::setSelectedCell( MonthViewCell *cell ) void KOMonthView::processSelectionChange() { - QPtrList incidences = selectedIncidences(); + Q3PtrList incidences = selectedIncidences(); if (incidences.count() > 0) { emit incidenceSelected( incidences.first() ); } else { @@ -2261,7 +2273,7 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) if (! e->isAutoRepeat() ) mFlagKeyPressed = true; switch(e->key()) { - case Key_Up: + case Qt::Key_Up: { if ( mShowWeekView ) { emit selectWeekNum ( currentWeek() - 1 ); @@ -2272,7 +2284,7 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) } e->accept(); break; - case Key_Down: + case Qt::Key_Down: { if ( mShowWeekView ) { emit selectWeekNum ( currentWeek() +1); @@ -2284,14 +2296,14 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) } e->accept(); break; - case Key_Return: - case Key_Enter: + case Qt::Key_Return: + case Qt::Key_Enter: { selectInternalWeekNum ( currentWeek() ); } e->accept(); break; - case Key_D: + case Qt::Key_D: if ( mSelectedCell ) { mSelectedCell->showDay(); e->accept(); diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 1a9d16d..bca76e5 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -21,17 +21,24 @@ #define _KOMONTHVIEW_H #include -#include +#include #include -#include +#include #include -#include +#include #include #include -#include +#include #include -#include -#include +#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include #include #include @@ -72,7 +79,7 @@ private slots : void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } }; -class KNoScrollListBox: public QListBox +class KNoScrollListBox: public Q3ListBox { Q_OBJECT public: @@ -103,7 +110,7 @@ class KNoScrollListBox: public QListBox }; -class MonthViewItem: public QListBoxItem +class MonthViewItem: public Q3ListBoxItem { public: MonthViewItem( Incidence *,const QString & title ); @@ -126,8 +133,8 @@ class MonthViewItem: public QListBoxItem protected: virtual void paint(QPainter *); - virtual int height(const QListBox *) const; - virtual int width(const QListBox *) const; + virtual int height(const Q3ListBox *) const; + virtual int width(const Q3ListBox *) const; private: int mdayPos; @@ -198,15 +205,15 @@ public slots: void deHighLight(); void repaintfinishUpdateCell(); protected slots: - void defaultAction( QListBoxItem * ); - void contextMenu( QListBoxItem * ); - void selection( QListBoxItem * ); - void cellClicked( QListBoxItem * ); + void defaultAction( Q3ListBoxItem * ); + void contextMenu( Q3ListBoxItem * ); + void selection( Q3ListBoxItem * ); + void cellClicked( Q3ListBoxItem * ); void newEvent(); private: int mdayCount; - QPtrList mAvailItemList; + Q3PtrList mAvailItemList; KOMonthView *mMonthView; int currentPalette; @@ -247,7 +254,7 @@ class KOMonthView: public KOEventView virtual int currentDateCount(); /** returns the currently selected events */ - virtual QPtrList selectedIncidences(); + virtual Q3PtrList selectedIncidences(); /** returns dates of the currently selected events */ virtual DateList selectedDates(); @@ -269,7 +276,7 @@ class KOMonthView: public KOEventView virtual void updateView(); virtual void updateConfig(); virtual void showDates(const QDate &start, const QDate &end); - virtual void showEvents(QPtrList eventList); + virtual void showEvents(Q3PtrList eventList); void changeEventDisplay(Event *, int); @@ -311,7 +318,7 @@ class KOMonthView: public KOEventView NavigatorBar* mNavigatorBar; int currentWeek(); bool clPending; - QWidgetStack * mWidStack; + Q3WidgetStack * mWidStack; QWidget* mMonthView; QWidget* mWeekView; bool mShowWeekView; @@ -325,12 +332,12 @@ class KOMonthView: public KOEventView void computeLayoutWeek(); void doComputeLayoutWeek(); - QPtrVector mCells; - QPtrVector mDayLabels; - QPtrVector mWeekLabels; - QPtrVector mCellsW; - QPtrVector mDayLabelsW; - QPtrVector mWeekLabelsW; + Q3PtrVector mCells; + Q3PtrVector mDayLabels; + Q3PtrVector mWeekLabels; + Q3PtrVector mCellsW; + Q3PtrVector mDayLabelsW; + Q3PtrVector mWeekLabelsW; bool mShortDayLabelsM; bool mShortDayLabelsW; @@ -342,7 +349,7 @@ class KOMonthView: public KOEventView MonthViewCell *mPopupCell; bool mFlagKeyPressed; KOEventPopupMenu *mContextMenu; - QPopupMenu *mNewItemMenu; + Q3PopupMenu *mNewItemMenu; void keyPressEvent ( QKeyEvent * ) ; void keyReleaseEvent ( QKeyEvent * ) ; diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 5078c57..0bd46ea 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -26,7 +26,7 @@ #include #endif #include -#include +#include #include #include #include @@ -305,13 +305,13 @@ KOPrefs::KOPrefs() : KPrefs::setCurrentGroup("KOrganizer Plugins"); - addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); + addItemStringList("SelectedPlugins",&mSelectedPlugins,QStringList("holidays")); KPrefs::setCurrentGroup("Group Scheduling"); addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); - addItemStringList("AdditionalMails",&mAdditionalMails,""); + addItemStringList("AdditionalMails",&mAdditionalMails,QStringList()); addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); @@ -566,7 +566,7 @@ void KOPrefs::usrWriteConfig() config()->writeEntry("user_email",mEmail); config()->setGroup("Category Colors"); - QDictIterator it(mCategoryColors); + Q3DictIterator it(mCategoryColors); while (it.current()) { config()->writeEntry(it.currentKey(),*(it.current())); ++it; diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 94bdd33..35c6110 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -25,9 +25,12 @@ #include -#include +#include #include #include +#include +//Added by qt3to4: +#include class KConfig; class QFont; @@ -347,7 +350,7 @@ class KOPrefs : public KPimPrefs bool mWTshowChanged; int mCurrentDisplayedView; - QPtrList mCalendars; + Q3PtrList mCalendars; int mNextAvailableCalendar; bool mGlobalUpdateDisabled; @@ -362,8 +365,8 @@ class KOPrefs : public KPimPrefs QString mFilterConflictAllItem; private: - QDict mCategoryColors; - QArray mDefCalColors; + Q3Dict mCategoryColors; + QVector mDefCalColors; QColor mDefaultCategoryColor; QFont mDefaultTimeBarFont; diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index f1a6c3d..43c488f 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -23,24 +23,30 @@ #include #include -#include -#include +#include +#include #include #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include #include #include #include -#include +#include #include +#include +//Added by qt3to4: +#include +#include +#include +#include #include #include @@ -116,8 +122,8 @@ void KOPrefsDialog::setupGlobalTab() void KOPrefsDialog::setupLocaleDateTab() { #if 0 -QFrame *topFrame = addPage(i18n("Date Format"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,3,2); +Q3Frame *topFrame = addPage(i18n("Date Format"),0,0); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); int iii = 0; @@ -172,8 +178,8 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0); void KOPrefsDialog::setupLocaleTab() { #if 0 - QFrame *topFrame = addPage(i18n("Locale"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3Frame *topFrame = addPage(i18n("Locale"),0,0); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); int iii = 0; @@ -211,7 +217,7 @@ void KOPrefsDialog::setupLocaleTab() } else { QWidget * hb = new QWidget( topFrame ); - QHBoxLayout *hbLayout = new QHBoxLayout(hb); + Q3HBoxLayout *hbLayout = new Q3HBoxLayout(hb); sb = addWidBool(i18n("Week starts on Sunday"), &(KOPrefs::instance()->mWeekStartsOnSunday),hb); @@ -236,10 +242,10 @@ void KOPrefsDialog::setupLocaleTab() void KOPrefsDialog::setupMainTab() { - QFrame *topFrame = addPage(i18n("General"),0,0); + Q3Frame *topFrame = addPage(i18n("General"),0,0); // DesktopIcon("identity",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); @@ -287,12 +293,12 @@ void KOPrefsDialog::setupMainTab() ++iii; if ( QApplication::desktop()->height() <= 240 ) { topFrame = addPage(i18n("General") +" 2",0,0); - topLayout = new QGridLayout(topFrame,4,2); + topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(2); topLayout->setMargin(3); iii = 0; } - QHBox *dummy = new QHBox(topFrame); + Q3HBox *dummy = new Q3HBox(topFrame); new QLabel(i18n("Days in Next-X-Days:"),dummy); mNextXDaysSpin = new QSpinBox(2,14,1,dummy); @@ -313,7 +319,7 @@ void KOPrefsDialog::setupMainTab() // addWidBool(i18n("Enable automatic saving of calendar"), // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); - QHBox *intervalBox = new QHBox(topFrame); + Q3HBox *intervalBox = new Q3HBox(topFrame); // intervalBox->setSpacing(mSpacingHint); topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); ++iii; @@ -402,14 +408,14 @@ void KOPrefsDialog::setupMainTab() void KOPrefsDialog::setupTimeTab() { - QFrame *topFrame = addPage(i18n("Time"),0,0); + Q3Frame *topFrame = addPage(i18n("Time"),0,0); // DesktopIcon("clock",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); - QHBox *dummy = new QHBox(topFrame); + Q3HBox *dummy = new Q3HBox(topFrame); KPrefsDialogWidTime *dayBegins = addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), dummy); @@ -441,28 +447,28 @@ void KOPrefsDialog::setupTimeTab() int iii = 4; if ( QApplication::desktop()->height() <= 240 ) { topFrame = addPage(i18n("Time") +" 2",0,0); - topLayout = new QGridLayout(topFrame,1,2); + topLayout = new Q3GridLayout(topFrame,1,2); topLayout->setSpacing(2); topLayout->setMargin(3); iii = 0; } - QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, + Q3GroupBox *workingHoursGroup = new Q3GroupBox(1,Qt::Horizontal, i18n("Working Hours"), topFrame); topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1); workingHoursGroup->layout()->setSpacing( 0 ); workingHoursGroup->layout()->setMargin( 4 ); - QHBox *workStartBox = new QHBox(workingHoursGroup); + Q3HBox *workStartBox = new Q3HBox(workingHoursGroup); // workStartBox->setMargin( 0 ); addWidTime(i18n("Daily starting hour:"), &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); - QHBox *workEndBox = new QHBox(workingHoursGroup); + Q3HBox *workEndBox = new Q3HBox(workingHoursGroup); //workEndBox->setMargin( 0 ); addWidTime(i18n("Daily ending hour:"), &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); - QVBox *excludeBox = new QVBox(workingHoursGroup); + Q3VBox *excludeBox = new Q3VBox(workingHoursGroup); //excludeBox->setMargin( 0 ); addWidBool(i18n("Exclude holidays"), &(KOPrefs::instance()->mExcludeHolidays),excludeBox); @@ -482,10 +488,10 @@ void KOPrefsDialog::setupTimeTab() void KOPrefsDialog::setupViewsTab() { - QFrame *topFrame = addPage(i18n("Views"),0,0); + Q3Frame *topFrame = addPage(i18n("Views"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,6,1); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); @@ -530,7 +536,7 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("ViewChange"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,6,1); + topLayout = new Q3GridLayout(topFrame,6,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; @@ -594,7 +600,7 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("Agenda View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,5,1); + topLayout = new Q3GridLayout(topFrame,5,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; @@ -652,12 +658,12 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("Month View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,5,1); + topLayout = new Q3GridLayout(topFrame,5,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; QLabel *lab; - QHBox *habo = new QHBox( topFrame ); + Q3HBox *habo = new Q3HBox( topFrame ); if ( QApplication::desktop()->width() <= 480 ) { lab = new QLabel ( i18n("Show events that recur "), topFrame ); topLayout->addMultiCellWidget(lab,ii, ii,0,1); @@ -677,7 +683,7 @@ void KOPrefsDialog::setupViewsTab() ii++; - habo = new QHBox( topFrame ); + habo = new Q3HBox( topFrame ); if ( QApplication::desktop()->width() <= 480 ) { lab = new QLabel (i18n("Show in every cell ") , topFrame ); topLayout->addMultiCellWidget(lab,ii, ii,0,1); @@ -730,7 +736,7 @@ void KOPrefsDialog::setupViewsTab() if ( QApplication::desktop()->height() <= 240 ) { topFrame = addPage(i18n("Month View") +" 2",0,0); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); topLayout->setSpacing(2); topLayout->setMargin(1); ii = 0; @@ -764,19 +770,19 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("What's Next View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; - QHBox* hdummy = new QHBox(topFrame); + Q3HBox* hdummy = new Q3HBox(topFrame); new QLabel(i18n("Days in What's Next:"),hdummy); mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); topLayout->addWidget(hdummy,ii++,0); - QHBox *prioBox = new QHBox(topFrame); + Q3HBox *prioBox = new Q3HBox(topFrame); // intervalBox->setSpacing(mSpacingHint); topLayout->addWidget(prioBox,ii++,0); @@ -818,7 +824,7 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("Todo View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; @@ -855,7 +861,7 @@ dummy = KPrefsDialogWidColor *todoRunColor = addWidColor(i18n("Color for running todos:"), &(KOPrefs::instance()->mTodoRunColor),wid); - QHBoxLayout *widLayout = new QHBoxLayout(wid); + Q3HBoxLayout *widLayout = new Q3HBoxLayout(wid); widLayout->addWidget( todoRunColor->label() ); widLayout->addWidget( todoRunColor->button() ); topLayout->addWidget(wid,ii++,0); @@ -865,7 +871,7 @@ dummy = KPrefsDialogWidColor *todoDueTodayColor = addWidColor(i18n("Todo due today color:"), &(KOPrefs::instance()->mTodoDueTodayColor),wid); - widLayout = new QHBoxLayout(wid); + widLayout = new Q3HBoxLayout(wid); widLayout->addWidget( todoDueTodayColor->label() ); widLayout->addWidget( todoDueTodayColor->button() ); topLayout->addWidget(wid,ii++,0); @@ -873,7 +879,7 @@ dummy = // Todo overdue color wid = new QWidget( topFrame ); - widLayout = new QHBoxLayout(wid); + widLayout = new Q3HBoxLayout(wid); KPrefsDialogWidColor *todoOverdueColor = addWidColor(i18n("Todo overdue color:"), &(KOPrefs::instance()->mTodoOverdueColor),wid); @@ -890,7 +896,7 @@ dummy = topFrame = addPage(i18n("View Options"),0,0); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; @@ -929,16 +935,16 @@ dummy = topFrame = addPage(i18n("Conflict detection"),0,0); - topLayout = new QGridLayout(topFrame,2,1); + topLayout = new Q3GridLayout(topFrame,2,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; dummy = addWidBool(i18n("Enable conflict detection"), &(KOPrefs::instance()->mDetectConflicts),topFrame); topLayout->addWidget(dummy->checkBox(), ii++,0); - topFrame = new QFrame( topFrame ); + topFrame = new Q3Frame( topFrame ); topLayout->addWidget(topFrame ,ii++,0); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) ); dummy = addWidBool(i18n("Include events which \"show as free\""), &(KOPrefs::instance()->mIncludeFree),topFrame); @@ -970,7 +976,7 @@ dummy = topFrame = addPage(i18n("Alarm"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,2,1); + topLayout = new Q3GridLayout(topFrame,2,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); int iii = 0; @@ -989,33 +995,33 @@ dummy = #ifndef DESKTOP_VERSION lab->setAlignment( AlignLeft|WordBreak|AlignTop); #else - lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); + lab->setAlignment( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); #endif - QHBox* dummyBox = new QHBox(topFrame); + Q3HBox* dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Play beeps count:"),dummyBox); mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Beeps interval in sec:"),dummyBox); mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Default suspend time in min:"),dummyBox); mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Auto suspend count:"),dummyBox); mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - QHBox* hbo = new QHBox ( topFrame ); + Q3HBox* hbo = new Q3HBox ( topFrame ); mDefaultAlarmFile = new QLineEdit(hbo); QPushButton * loadTemplate = new QPushButton(hbo); QPixmap icon; @@ -1055,10 +1061,10 @@ void KOPrefsDialog::selectSoundFile() void KOPrefsDialog::setupFontsTab() { - QFrame *topFrame = addPage(i18n("Fonts"),0,0); + Q3Frame *topFrame = addPage(i18n("Fonts"),0,0); // DesktopIcon("fonts",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,7,3); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,7,3); topLayout->setSpacing(1); topLayout->setMargin(3); KPrefsDialogWidFont * tVFont; @@ -1125,7 +1131,7 @@ void KOPrefsDialog::setupFontsTab() topFrame = addPage(i18n("View Fonts"),0, DesktopIcon("fonts",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,7,3); + topLayout = new Q3GridLayout(topFrame,7,3); topLayout->setSpacing(1); topLayout->setMargin(3); @@ -1193,10 +1199,10 @@ void KOPrefsDialog::setupFontsTab() void KOPrefsDialog::setupColorsTab() { - QFrame *topFrame = addPage(i18n("Colors"),0,0); + Q3Frame *topFrame = addPage(i18n("Colors"),0,0); // DesktopIcon("colorize",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2); // topLayout->setSpacing(mSpacingHint); // topLayout->setMargin(mMarginHint); @@ -1204,9 +1210,9 @@ void KOPrefsDialog::setupColorsTab() topLayout->setMargin(3); int ii = 1; - QGroupBox *categoryGroup ; + Q3GroupBox *categoryGroup ; - categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), + categoryGroup = new Q3GroupBox(1,Qt::Vertical,i18n("Categories"), topFrame); topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); @@ -1250,7 +1256,7 @@ void KOPrefsDialog::setupColorsTab() topFrame = addPage(i18n("Colors") +" 2",0,0); // DesktopIcon("colorize",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,5,2); + topLayout = new Q3GridLayout(topFrame,5,2); // topLayout->setSpacing(mSpacingHint); // topLayout->setMargin(mMarginHint); @@ -1317,7 +1323,7 @@ void KOPrefsDialog::setupPrinterTab() mPrinterTab = addPage(i18n("Printing"),0, DesktopIcon("fileprint",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(mPrinterTab,5,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); @@ -1327,10 +1333,10 @@ void KOPrefsDialog::setupPrinterTab() void KOPrefsDialog::setupGroupSchedulingTab() { #if 0 - QFrame *topFrame = addPage(i18n("Group Scheduling"),0, + Q3Frame *topFrame = addPage(i18n("Group Scheduling"),0, DesktopIcon("personal",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); @@ -1353,7 +1359,7 @@ void KOPrefsDialog::setupGroupSchedulingTab() topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); - mAMails = new QListView(topFrame); + mAMails = new Q3ListView(topFrame); mAMails->addColumn(i18n("Email"),300); topLayout->addMultiCellWidget(mAMails,3,3,0,1); @@ -1371,17 +1377,17 @@ void KOPrefsDialog::setupGroupSchedulingTab() connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); - connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); + connect(mAMails,SIGNAL(selectionChanged(Q3ListViewItem *)),SLOT(updateInput())); #endif } void KOPrefsDialog::setupGroupAutomationTab() { return; - QFrame *topFrame = addPage(i18n("Group Automation"),0, + Q3Frame *topFrame = addPage(i18n("Group Automation"),0, DesktopIcon("personal",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,1); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); @@ -1515,7 +1521,7 @@ void KOPrefsDialog::usrWriteConfig() ++iii; } } - QDictIterator it(mCategoryDict); + Q3DictIterator it(mCategoryDict); while (it.current()) { KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); ++it; diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h index ee7a7aa..ccc1726 100644 --- a/korganizer/koprefsdialog.h +++ b/korganizer/koprefsdialog.h @@ -23,10 +23,12 @@ #ifndef _KOPREFSDIALOG_H #define _KOPREFSDIALOG_H -#include -#include +#include +#include #include -#include +#include +//Added by qt3to4: +#include #include @@ -94,7 +96,7 @@ class KOPrefsDialog : public KPrefsDialog KPrefsDialogWidBool *mEnableGroupScheduling; KPrefsDialogWidBool *mEnableProjectView; - QFrame *mPrinterTab; + Q3Frame *mPrinterTab; QLineEdit *nameEdit; QLineEdit *emailEdit; @@ -121,7 +123,7 @@ class KOPrefsDialog : public KPrefsDialog QComboBox *mCategoryCombo; KColorButton *mCategoryButton; - QDict mCategoryDict; + Q3Dict mCategoryDict; QSlider *mHourSizeSlider; diff --git a/korganizer/korganizer.pro b/korganizer/korganizer.pro index df8f8d7..0f3b328 100644 --- a/korganizer/korganizer.pro +++ b/korganizer/korganizer.pro @@ -1,5 +1,5 @@ TEMPLATE = app -CONFIG = qt warn_on +CONFIG += qt warn_on TARGET = kopi OBJECTS_DIR = _obj/ MOC_DIR = _moc @@ -17,27 +17,27 @@ DEFINES += DESKTOP_VERSION unix : { staticlib: { TARGET = kopi_linux -LIBS += ../bin/libmicrokabc_qtopia.a -LIBS += ../bin/libmicrokabc_file.a -LIBS += ../bin/libmicrokabc_dir.a -LIBS += ../bin/libmicrokdepim.a -LIBS += ../bin/libmicrokcal.a -LIBS += ../bin/libmicrokabc.a -LIBS += ../bin/libmicrokde.a -LIBS += ../bin/libmicrokabc_qtopia.a -LIBS += ../bin/libmicrokabc_file.a -LIBS += ../bin/libmicrokabc_dir.a -LIBS += ../bin/libmicrokdepim.a -LIBS += ../bin/libmicrokcal.a -LIBS += ../bin/libmicrokabc.a -LIBS += ../bin/libmicrokde.a +LIBS += ../bin/libxmicrokabc_qtopia.a +LIBS += ../bin/libxmicrokabc_file.a +LIBS += ../bin/libxmicrokabc_dir.a +LIBS += ../bin/libxmicrokdepim.a +LIBS += ../bin/libxmicrokcal.a +LIBS += ../bin/libxmicrokabc.a +LIBS += ../bin/libxmicrokde.a +LIBS += ../bin/libxmicrokabc_qtopia.a +LIBS += ../bin/libxmicrokabc_file.a +LIBS += ../bin/libxmicrokabc_dir.a +LIBS += ../bin/libxmicrokdepim.a +LIBS += ../bin/libxmicrokcal.a +LIBS += ../bin/libxmicrokabc.a +LIBS += ../bin/libxmicrokde.a LIBS += ../libical/lib/libical.a LIBS += ../libical/lib/libicalss.a } else { -LIBS += ../bin/libmicrokdepim.so -LIBS += ../bin/libmicrokcal.so -LIBS += ../bin/libmicrokde.so -LIBS += ../bin/libmicrokabc.so +LIBS += ../bin/libxmicrokdepim.so +LIBS += ../bin/libxmicrokcal.so +LIBS += ../bin/libxmicrokde.so +LIBS += ../bin/libxmicrokabc.so #LIBS += -lbluetooth #LIBS += -lsdp @@ -49,10 +49,10 @@ MOC_DIR = moc/unix win32: { RC_FILE = winicons.rc DEFINES += _WIN32_ -LIBS += ../bin/microkdepim.lib -LIBS += ../bin/microkcal.lib -LIBS += ../bin/microkde.lib -LIBS += ../bin/microkabc.lib +LIBS += ../bin/xmicrokdepim.lib +LIBS += ../bin/xmicrokcal.lib +LIBS += ../bin/xmicrokde.lib +LIBS += ../bin/xmicrokabc.lib LIBS += ../libical/lib/ical.lib LIBS += ../libical/lib/icalss.lib #LIBS += atls.lib @@ -85,7 +85,8 @@ TARGET = kopi_me } -INTERFACES = kofilterview_base.ui +#The following line was changed from INTERFACES to FORMS3 by qt3to4 +FORMS3 = kofilterview_base.ui #filteredit_base.ui # kdateedit.h \ @@ -210,9 +211,15 @@ filteredit_base.cpp \ ../kalarmd/alarmdialog.cpp HEADERS += calprintbase.h calprinter.h calprintplugins.h cellitem.h -INTERFACES += calprintdayconfig_base.ui \ +#The following line was changed from INTERFACES to FORMS3 by qt3to4 +FORMS3 += calprintdayconfig_base.ui \ calprintmonthconfig_base.ui \ calprinttodoconfig_base.ui \ calprintweekconfig_base.ui SOURCES += calprintbase.cpp calprinter.cpp calprintplugins.cpp cellitem.cpp +#The following line was inserted by qt3to4 +QT += xml qt3support +#The following line was inserted by qt3to4 +CONFIG += uic3 + diff --git a/korganizer/korganizerE.pro b/korganizer/korganizerE.pro index 553c265..2c1cd42 100644 --- a/korganizer/korganizerE.pro +++ b/korganizer/korganizerE.pro @@ -11,9 +11,9 @@ DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER DEFINES += KORG_NOLVALTERNATION #KORG_NOKABC -LIBS += -lmicrokdepim -LIBS += -lmicrokcal -LIBS += -lmicrokde +LIBS += -lxmicrokdepim +LIBS += -lxmicrokcal +LIBS += -lxmicrokde LIBS += -lmicroqtcompat LIBS += $(GCC3EXTRALIB1) diff --git a/korganizer/kotimespanview.cpp b/korganizer/kotimespanview.cpp index 3265a3a..a214720 100644 --- a/korganizer/kotimespanview.cpp +++ b/korganizer/kotimespanview.cpp @@ -1,4 +1,8 @@ #include +//Added by qt3to4: +#include +#include +#include #include @@ -11,7 +15,7 @@ KOTimeSpanView::KOTimeSpanView(Calendar *calendar, QWidget *parent, const char *name) : KOEventView( calendar, parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); mTimeSpanView = new TimeSpanView( this ); topLayout->addWidget( mTimeSpanView ); @@ -34,7 +38,7 @@ void KOTimeSpanView::readSettings(KConfig *config) config->setGroup("Views"); - QValueList sizes = config->readIntListEntry("Separator TimeSpanView"); + Q3ValueList sizes = config->readIntListEntry("Separator TimeSpanView"); if (sizes.count() == 2) { mTimeSpanView->setSplitterSizes(sizes); } @@ -46,7 +50,7 @@ void KOTimeSpanView::writeSettings(KConfig *config) config->setGroup("Views"); - QValueList list = mTimeSpanView->splitterSizes(); + Q3ValueList list = mTimeSpanView->splitterSizes(); config->writeEntry("Separator TimeSpanView",list); } @@ -60,9 +64,9 @@ int KOTimeSpanView::currentDateCount() return 0; } -QPtrList KOTimeSpanView::selectedIncidences() +Q3PtrList KOTimeSpanView::selectedIncidences() { - QPtrList selected; + Q3PtrList selected; return selected; } @@ -84,9 +88,9 @@ void KOTimeSpanView::showDates(const QDate &start, const QDate &end) void KOTimeSpanView::insertItems(const QDate &start, const QDate &end) { mTimeSpanView->clear(); - mTimeSpanView->setDateRange( start, end ); + mTimeSpanView->setDateRange( (QDateTime)start, (QDateTime)end ); - QPtrList events = calendar()->events( start, end ); + Q3PtrList events = calendar()->events( start, end ); Event *event = events.first(); while( event ) { // kdDebug() << "KOTimeSpanView::showDates() add event: " << event->summary() @@ -100,7 +104,7 @@ void KOTimeSpanView::insertItems(const QDate &start, const QDate &end) mTimeSpanView->updateView(); } -void KOTimeSpanView::showEvents(QPtrList eventList) +void KOTimeSpanView::showEvents(Q3PtrList eventList) { } diff --git a/korganizer/kotimespanview.h b/korganizer/kotimespanview.h index c682ed8..c3e4b41 100644 --- a/korganizer/kotimespanview.h +++ b/korganizer/kotimespanview.h @@ -2,6 +2,8 @@ #define KOTIMESPANVIEW_H #include "koeventview.h" +//Added by qt3to4: +#include class KConfig; class TimeSpanView; @@ -16,7 +18,7 @@ class KOTimeSpanView : public KOEventView virtual int maxDatesHint(); virtual int currentDateCount(); - virtual QPtrList selectedIncidences(); + virtual Q3PtrList selectedIncidences(); DateList selectedDates() {DateList q; return q;} @@ -28,7 +30,7 @@ class KOTimeSpanView : public KOEventView public slots: virtual void updateView(); virtual void showDates(const QDate &start, const QDate &end); - virtual void showEvents(QPtrList eventList); + virtual void showEvents(Q3PtrList eventList); void changeEventDisplay(Event *, int); diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index 20a35d2..aeab92a 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp @@ -23,15 +23,20 @@ */ #include -#include +#include #include #include -#include +#include #include #include #include #include +#include #include +//Added by qt3to4: +#include +#include +#include #include #include @@ -81,8 +86,8 @@ void KOTodoEditor::init() } void KOTodoEditor::setupRecurrence() { - QFrame *topFrame = addPage( i18n("Recurrence") ); - QBoxLayout *topLayout = new QVBoxLayout( topFrame ); + Q3Frame *topFrame = addPage( i18n("Recurrence") ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); mRecurrence = new KOEditorRecurrence( topFrame ); topLayout->addWidget( mRecurrence ); @@ -111,9 +116,9 @@ void KOTodoEditor::setupGeneral() // mGeneral,SLOT(setCategories(const QString &))); if (KOPrefs::instance()->mCompactDialogs) { - QFrame *topFrame = addPage(i18n("General")); + Q3Frame *topFrame = addPage(i18n("General")); - QBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); if ( QApplication::desktop()->width() < 480 ) { topLayout->setMargin(marginHintSmall()); topLayout->setSpacing(spacingHintSmall()); @@ -131,17 +136,17 @@ void KOTodoEditor::setupGeneral() mGeneral->enableAlarm( false ); - QBoxLayout *priorityLayout; + Q3BoxLayout *priorityLayout; if ( QApplication::desktop()->width() < 500 ) - priorityLayout = new QVBoxLayout( topLayout ); + priorityLayout = new Q3VBoxLayout( topLayout ); else - priorityLayout = new QHBoxLayout( topLayout ); + priorityLayout = new Q3HBoxLayout( topLayout ); QWidget* prioWidget = new QWidget (topFrame); priorityLayout->addWidget( prioWidget ); - QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget); + Q3HBoxLayout* priorityLayout2 = new Q3HBoxLayout( prioWidget); - QIconSet icon; + QIcon icon; if ( QApplication::desktop()->width() < 321 ) icon = SmallIcon("fileimport16"); else @@ -164,13 +169,13 @@ void KOTodoEditor::setupGeneral() mGeneral->initCategories( topFrame, priorityLayout ); topLayout->addStretch(1); - QFrame *topFrame2 = addPage(i18n("Details")); + Q3Frame *topFrame2 = addPage(i18n("Details")); - QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); + Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2); topLayout2->setMargin(marginHint()); topLayout2->setSpacing(spacingHint()); - QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 ); + Q3HBoxLayout *completionLayout = new Q3HBoxLayout( topLayout2 ); mGeneral->initCompletion(topFrame2,completionLayout); @@ -185,18 +190,18 @@ void KOTodoEditor::setupGeneral() connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); } else { - QFrame *topFrame = addPage(i18n("General")); + Q3Frame *topFrame = addPage(i18n("General")); - QBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); topLayout->setSpacing(spacingHint()); mGeneral->initHeader(topFrame,topLayout); mGeneral->initTime(topFrame,topLayout); mGeneral->initStatus(topFrame,topLayout); - QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout); mGeneral->initAlarm(topFrame,alarmLineLayout); mGeneral->initDescription(topFrame,topLayout); - QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout); mGeneral->initCategories( topFrame, detailsLayout ); mGeneral->initSecrecy( topFrame, detailsLayout ); } @@ -427,7 +432,7 @@ void KOTodoEditor::slotLoadTemplate() .arg( fileName ) ); return ; } - QPtrList todos = cal.todos(); + Q3PtrList todos = cal.todos(); Todo * todo = todos.first(); if ( !todo ) { KMessageBox::error( this, diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index ba94057..2b8fbd3 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -21,17 +21,33 @@ without including the source code for Qt in the source distribution. */ +#include + #include -#include +#include #include -#include +#include #include #include #include #include -#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include "koprefs.h" #include @@ -68,12 +84,12 @@ KOStartTodoPrefs::KOStartTodoPrefs( QString sum, QWidget *parent, const char *na { mStopAll = true; setCaption( i18n("Start todo") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("%1\n").arg( sum ), this ); lay->addWidget( lab ); - lab->setAlignment( AlignCenter ); + lab->setAlignment( Qt::AlignCenter ); QPushButton * ok = new QPushButton( i18n("Start this todo\nand stop all running"), this ); lay->addWidget( ok ); @@ -98,20 +114,20 @@ KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name { mTodo = todo; setCaption( i18n("Stop todo") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("%1\n").arg( todo->summary() ), this ); lay->addWidget( lab ); - lab->setAlignment( AlignHCenter ); + lab->setAlignment( Qt::AlignHCenter ); lab = new QLabel( i18n("Additional Comment:"), this ); lay->addWidget( lab ); mComment = new QLineEdit( this ); lay->addWidget( mComment ); - QHBox * start = new QHBox ( this ); + Q3HBox * start = new Q3HBox ( this ); lay->addWidget( start ); lab = new QLabel( i18n("Start:"), start ); - QHBox * end = new QHBox ( this ); + Q3HBox * end = new Q3HBox ( this ); lay->addWidget( end ); lab = new QLabel( i18n("End:"), end ); sde = new KDateEdit( start ); @@ -173,10 +189,10 @@ void KOStopTodoPrefs::doNotSave() } -class KOTodoViewWhatsThis :public QWhatsThis +class KOTodoViewWhatsThis :public Q3WhatsThis { public: - KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; + KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : Q3WhatsThis( wid ), _wid(wid),_view (view) { }; protected: virtual QString text( const QPoint& p) @@ -214,7 +230,7 @@ void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) #ifndef KORG_NODND // kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && - !QTextDrag::canDecode( e ) ) { + !Q3TextDrag::canDecode( e ) ) { e->ignore(); return; } @@ -230,7 +246,7 @@ void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) // kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && - !QTextDrag::canDecode( e ) ) { + !Q3TextDrag::canDecode( e ) ) { e->ignore(); return; } @@ -255,7 +271,7 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) // kdDebug() << "KOTodoListView::contentsDropEvent" << endl; if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && - !QTextDrag::canDecode( e ) ) { + !Q3TextDrag::canDecode( e ) ) { e->ignore(); return; } @@ -300,7 +316,7 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) } else { QString text; - if (QTextDrag::decode(e,text)) { + if (Q3TextDrag::decode(e,text)) { //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); KOTodoViewItem *todoi = static_cast(itemAt( contentsToViewport(e->pos()) )); qDebug("Dropped : " + text); @@ -323,14 +339,14 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) } void KOTodoListView::wheelEvent (QWheelEvent *e) { - QListView::wheelEvent (e); + Q3ListView::wheelEvent (e); } void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) { QPoint p(contentsToViewport(e->pos())); - QListViewItem *i = itemAt(p); + Q3ListViewItem *i = itemAt(p); bool rootClicked = true; if (i) { // if the user clicked into the root decoration of the item, don't @@ -348,7 +364,7 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) } #ifndef KORG_NODND mMousePressed = false; - if (! rootClicked && !( e->button() == RightButton) ) { + if (! rootClicked && !( e->button() == Qt::RightButton) ) { mPressPos = e->pos(); mMousePressed = true; } else { @@ -358,15 +374,15 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); #ifndef DESKTOP_VERSION if (!( e->button() == RightButton && rootClicked) ) - QListView::contentsMousePressEvent(e); + Q3ListView::contentsMousePressEvent(e); #else - QListView::contentsMousePressEvent(e); + Q3ListView::contentsMousePressEvent(e); #endif } void KOTodoListView::paintEvent(QPaintEvent* e) { emit paintNeeded(); - QListView::paintEvent( e); + Q3ListView::paintEvent( e); } void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) { @@ -376,7 +392,7 @@ void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()*3) { mMousePressed = false; - QListViewItem *item = itemAt(contentsToViewport(mPressPos)); + Q3ListViewItem *item = itemAt(contentsToViewport(mPressPos)); if (item) { DndFactory factory( mCalendar ); ICalDrag *vd = factory.createDrag( @@ -422,13 +438,13 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) } if (! e->isAutoRepeat() ) mFlagKeyPressed = true; - QListViewItem* cn; + Q3ListViewItem* cn; if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") { cn = currentItem(); if ( cn ) { KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); if ( ci ){ - if ( e->state() == ShiftButton ) + if ( e->state() == Qt::ShiftButton ) ci->setOn( false ); else ci->setOn( true ); @@ -449,12 +465,12 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) switch ( e->key() ) { case Qt::Key_Down: case Qt::Key_Up: - QListView::keyPressEvent ( e ); + Q3ListView::keyPressEvent ( e ); e->accept(); break; case Qt::Key_Left: case Qt::Key_Right: - QListView::keyPressEvent ( e ); + Q3ListView::keyPressEvent ( e ); e->accept(); return; break; @@ -468,7 +484,7 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) } void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) { - QListView::contentsMouseReleaseEvent(e); + Q3ListView::contentsMouseReleaseEvent(e); mMousePressed = false; } @@ -478,7 +494,7 @@ void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) QPoint vp = contentsToViewport(e->pos()); - QListViewItem *item = itemAt(vp); + Q3ListViewItem *item = itemAt(vp); emit double_Clicked(item); if (!item) return; @@ -492,7 +508,7 @@ KOQuickTodo::KOQuickTodo(QWidget *parent) : QLineEdit(parent) { setText(i18n("Click to add new Todo")); - setFocusPolicy ( QWidget::ClickFocus ); + setFocusPolicy ( Qt::ClickFocus ); } void KOQuickTodo::focusInEvent(QFocusEvent *ev) @@ -523,14 +539,14 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mPendingUpdateBeforeRepaint = false; isFlatDisplay = false; mNavigator = 0; - QBoxLayout *topLayout = new QVBoxLayout(this); + Q3BoxLayout *topLayout = new Q3VBoxLayout(this); mName = QString ( name ); mBlockUpdate = false; mQuickBar = new QWidget( this ); topLayout->addWidget(mQuickBar); mQuickAdd = new KOQuickTodo(mQuickBar); - QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); + Q3BoxLayout *quickLayout = new Q3HBoxLayout(mQuickBar); quickLayout->addWidget( mQuickAdd ); mNewSubBut = new QPushButton( "sub",mQuickBar ); QPushButton * s_done = new QPushButton( "D",mQuickBar ); @@ -568,19 +584,19 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : s_run->setFixedHeight(fixhei ); mNewSubBut->setFixedHeight(fixhei ); - flat->setFocusPolicy( NoFocus ); - s_done->setFocusPolicy( NoFocus ); - allopen->setFocusPolicy( NoFocus ); - allclose->setFocusPolicy( NoFocus ); - s_run->setFocusPolicy( NoFocus ); - mNewSubBut->setFocusPolicy( NoFocus ); + flat->setFocusPolicy( Qt::NoFocus ); + s_done->setFocusPolicy( Qt::NoFocus ); + allopen->setFocusPolicy( Qt::NoFocus ); + allclose->setFocusPolicy( Qt::NoFocus ); + s_run->setFocusPolicy( Qt::NoFocus ); + mNewSubBut->setFocusPolicy( Qt::NoFocus ); - QWhatsThis::add( flat, i18n("Click this button to display all todos in a flat hierarchy" ) ); - QWhatsThis::add( allopen, i18n("Click this button to display all todos openend" ) ); - QWhatsThis::add( allclose, i18n("Click this button to display all todos closed" ) ); - QWhatsThis::add( s_run, i18n("Click this button to toggle show/hide running todos" ) ); - QWhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) ); - QWhatsThis::add( s_done, i18n("Click this button to toggle show/hide completed todos" ) ); + Q3WhatsThis::add( flat, i18n("Click this button to display all todos in a flat hierarchy" ) ); + Q3WhatsThis::add( allopen, i18n("Click this button to display all todos openend" ) ); + Q3WhatsThis::add( allclose, i18n("Click this button to display all todos closed" ) ); + Q3WhatsThis::add( s_run, i18n("Click this button to toggle show/hide running todos" ) ); + Q3WhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) ); + Q3WhatsThis::add( s_done, i18n("Click this button to toggle show/hide completed todos" ) ); quickLayout->addWidget( mNewSubBut ); quickLayout->addWidget( s_done ); @@ -601,19 +617,19 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->addColumn(i18n("Todo")); mTodoListView->addColumn(i18n("Prio")); - mTodoListView->setColumnAlignment(1,AlignHCenter); + mTodoListView->setColumnAlignment(1,Qt::AlignHCenter); mTodoListView->addColumn(i18n("Complete")); - mTodoListView->setColumnAlignment(2,AlignCenter); + mTodoListView->setColumnAlignment(2,Qt::AlignCenter); mTodoListView->addColumn(i18n("Due Date")); - mTodoListView->setColumnAlignment(3,AlignLeft); + mTodoListView->setColumnAlignment(3,Qt::AlignLeft); mTodoListView->addColumn(i18n("Due Time")); - mTodoListView->setColumnAlignment(4,AlignHCenter); + mTodoListView->setColumnAlignment(4,Qt::AlignHCenter); mTodoListView->addColumn(i18n("Start Date")); - mTodoListView->setColumnAlignment(5,AlignLeft); + mTodoListView->setColumnAlignment(5,Qt::AlignLeft); mTodoListView->addColumn(i18n("Start Time")); - mTodoListView->setColumnAlignment(6,AlignHCenter); + mTodoListView->setColumnAlignment(6,Qt::AlignHCenter); //mTodoListView->addColumn(i18n("Cancelled")); mTodoListView->addColumn(i18n("Categories")); @@ -623,7 +639,7 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->addColumn(i18n("Last Modified Sub")); #if 0 mTodoListView->addColumn(i18n("Sort Id")); - mTodoListView->setColumnAlignment(4,AlignHCenter); + mTodoListView->setColumnAlignment(4,Qt::AlignHCenter); #endif mTodoListView->setMinimumHeight( 60 ); @@ -632,19 +648,19 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->setColumnWidth( 0, 120 ); int iii = 0; for ( iii = 0; iii< 12 ; ++iii ) - mTodoListView->setColumnWidthMode( iii, QListView::Manual ); + mTodoListView->setColumnWidthMode( iii, Q3ListView::Manual ); mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); - mPriorityPopupMenu = new QPopupMenu(this); + mPriorityPopupMenu = new Q3PopupMenu(this); for (int i = 1; i <= 5; i++) { QString label = QString ("%1").arg (i); mPriority[mPriorityPopupMenu->insertItem (label)] = i; } connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); - mPercentageCompletedPopupMenu = new QPopupMenu(this); + mPercentageCompletedPopupMenu = new Q3PopupMenu(this); for (int i = 0; i <= 100; i+=20) { QString label = QString ("%1 %").arg (i); mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; @@ -652,12 +668,12 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); - mCategoryPopupMenu = new QPopupMenu (this); + mCategoryPopupMenu = new Q3PopupMenu (this); mCategoryPopupMenu->setCheckable (true); connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); - mCalPopupMenu = new QPopupMenu (this); + mCalPopupMenu = new Q3PopupMenu (this); mCalPopupMenu->setCheckable (true); connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); @@ -665,7 +681,7 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : - mItemPopupMenu = new QPopupMenu(this); + mItemPopupMenu = new Q3PopupMenu(this); mItemPopupMenu->insertItem(i18n("Show"), this, SLOT (showTodo())); mItemPopupMenu->insertItem(i18n("Edit..."), this, @@ -710,7 +726,7 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : this, SLOT( toggleRunning() ),0, 35 ); #endif - mPopupMenu = new QPopupMenu(this); + mPopupMenu = new Q3PopupMenu(this); mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, SLOT (newTodo()),0,1); mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), @@ -746,38 +762,38 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : // Double clicking conflicts with opening/closing the subtree - connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), - SLOT( editItem( QListViewItem *) ) ); + connect( mTodoListView, SIGNAL( doubleClicked( Q3ListViewItem *) ), + SLOT( editItem( Q3ListViewItem *) ) ); /* connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, const QPoint &,int ) ), SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); */ - connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, + connect( mTodoListView, SIGNAL( contextRequest ( Q3ListViewItem *, const QPoint &,int ) ), - SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); - connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), - SLOT( itemClicked( QListViewItem * ) ) ); - connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), - SLOT( itemDoubleClicked( QListViewItem * ) ) ); + SLOT( popupMenu( Q3ListViewItem *, const QPoint & ,int) ) ); + connect( mTodoListView, SIGNAL( clicked( Q3ListViewItem * ) ), + SLOT( itemClicked( Q3ListViewItem * ) ) ); + connect( mTodoListView, SIGNAL( double_Clicked( Q3ListViewItem * ) ), + SLOT( itemDoubleClicked( Q3ListViewItem * ) ) ); connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), SLOT( updateView() ) ); connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), SLOT( todoModified(Todo *, int) ) ); - connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), - SLOT( itemStateChanged( QListViewItem * ) ) ); - connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), - SLOT( itemStateChanged( QListViewItem * ) ) ); + connect( mTodoListView, SIGNAL( expanded( Q3ListViewItem * ) ), + SLOT( itemStateChanged( Q3ListViewItem * ) ) ); + connect( mTodoListView, SIGNAL( collapsed( Q3ListViewItem * ) ), + SLOT( itemStateChanged( Q3ListViewItem * ) ) ); connect( mTodoListView, SIGNAL( paintNeeded() ), SLOT( paintNeeded()) ); #if 0 - connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), - SLOT(selectionChanged(QListViewItem *))); - connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), - SLOT(selectionChanged(QListViewItem *))); - connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), - SLOT(selectionChanged(QListViewItem *))); + connect(mTodoListView,SIGNAL(selectionChanged(Q3ListViewItem *)), + SLOT(selectionChanged(Q3ListViewItem *))); + connect(mTodoListView,SIGNAL(clicked(Q3ListViewItem *)), + SLOT(selectionChanged(Q3ListViewItem *))); + connect(mTodoListView,SIGNAL(pressed(Q3ListViewItem *)), + SLOT(selectionChanged(Q3ListViewItem *))); #endif connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); @@ -881,7 +897,7 @@ void KOTodoView::updateView() mTodoListView->setFont( fo ); // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); //mTodoListView->header()->setMaximumHeight(fm.height()); - QPtrList todoList = calendar()->todos(); + Q3PtrList todoList = calendar()->todos(); /* kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; @@ -1044,7 +1060,7 @@ bool KOTodoView::checkTodo( Todo * todo ) return true; } -void KOTodoView::restoreItemState( QListViewItem *item ) +void KOTodoView::restoreItemState( Q3ListViewItem *item ) { pendingSubtodo = 0; while( item ) { @@ -1096,9 +1112,9 @@ void KOTodoView::updateConfig() mTodoListView->repaintContents(); } -QPtrList KOTodoView::selectedIncidences() +Q3PtrList KOTodoView::selectedIncidences() { - QPtrList selected; + Q3PtrList selected; KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); // if (!item) item = mActiveItem; @@ -1107,9 +1123,9 @@ QPtrList KOTodoView::selectedIncidences() return selected; } -QPtrList KOTodoView::selectedTodos() +Q3PtrList KOTodoView::selectedTodos() { - QPtrList selected; + Q3PtrList selected; KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); // if (!item) item = mActiveItem; @@ -1127,7 +1143,7 @@ void KOTodoView::showDates(const QDate &, const QDate &) { } -void KOTodoView::showEvents(QPtrList) +void KOTodoView::showEvents(Q3PtrList) { kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; } @@ -1140,19 +1156,19 @@ void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, #endif } -void KOTodoView::editItem(QListViewItem *item ) +void KOTodoView::editItem(Q3ListViewItem *item ) { if ( item ) emit editTodoSignal(((KOTodoViewItem *)item)->todo()); } -void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) +void KOTodoView::showItem(Q3ListViewItem *item,const QPoint &,int) { if ( item ) emit showTodoSignal(((KOTodoViewItem *)item)->todo()); } -void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) +void KOTodoView::popupMenu(Q3ListViewItem *item,const QPoint &p,int column) { pendingSubtodo = 0; mActiveItem = (KOTodoViewItem *)item; @@ -1361,7 +1377,7 @@ void KOTodoView::toggleRunningItemQuick() topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); } } -void KOTodoView::itemDoubleClicked(QListViewItem *item) +void KOTodoView::itemDoubleClicked(Q3ListViewItem *item) { if ( pendingSubtodo != 0 ) { topLevelWidget()->setCaption(i18n("Reparenting aborted!")); @@ -1428,7 +1444,7 @@ void KOTodoView::toggleRunningItem() } } -void KOTodoView::itemClicked(QListViewItem *item) +void KOTodoView::itemClicked(Q3ListViewItem *item) { //qDebug("KOTodoView::itemClicked %d", item); if (!item) { @@ -1441,7 +1457,7 @@ void KOTodoView::itemClicked(QListViewItem *item) KOTodoViewItem *todoItem = (KOTodoViewItem *)item; if ( pendingSubtodo != 0 ) { bool allowReparent = true; - QListViewItem *par = item; + Q3ListViewItem *par = item; while ( par ) { if ( par == pendingSubtodo ) { allowReparent = false; @@ -1469,7 +1485,7 @@ void KOTodoView::setDocumentId( const QString &id ) mDocPrefs->setDoc( id ); } -void KOTodoView::itemStateChanged( QListViewItem *item ) +void KOTodoView::itemStateChanged( Q3ListViewItem *item ) { if (!item) return; @@ -1542,7 +1558,7 @@ void KOTodoView::setAllClose() setOpen(mTodoListView->firstChild(), false); resetCurrentItem(); } -void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) +void KOTodoView::setOpen( Q3ListViewItem* item, bool setOpenI) { while ( item ) { @@ -1563,7 +1579,7 @@ void KOTodoView::displayAllFlat() clearList (); mPopupMenu->setItemChecked( 8,true ); isFlatDisplay = true; - QPtrList todoList = calendar()->todos(); + Q3PtrList todoList = calendar()->todos(); Todo *todo; for(todo = todoList.first(); todo; todo = todoList.next()) { if ( checkTodo( todo ) ) { diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 0cbc087..a9e7f30 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -26,15 +26,25 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include -#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -101,7 +111,7 @@ class KOTodoListView : public KListView signals: void paintNeeded(); void todoDropped(Todo *, int); - void double_Clicked(QListViewItem *item); + void double_Clicked(Q3ListViewItem *item); void reparentTodoSignal( Todo *,Todo * ); void unparentTodoSignal(Todo *); void deleteTodo( Todo * ); @@ -124,7 +134,7 @@ class KOTodoListView : public KListView Calendar *mCalendar; QPoint mPressPos; bool mMousePressed; - QListViewItem *mOldCurrent; + Q3ListViewItem *mOldCurrent; bool mFlagKeyPressed; void keyPressEvent ( QKeyEvent * ) ; void keyReleaseEvent ( QKeyEvent * ) ; @@ -157,8 +167,8 @@ class KOTodoView : public KOrg::BaseView KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); ~KOTodoView(); - QPtrList selectedIncidences(); - QPtrList selectedTodos(); + Q3PtrList selectedIncidences(); + Q3PtrList selectedTodos(); DateList selectedDates() {DateList q; @@ -184,14 +194,14 @@ class KOTodoView : public KOrg::BaseView void changeEventDisplay(Event *, int); void showDates(const QDate &start, const QDate &end); - void showEvents(QPtrList eventList); + void showEvents(Q3PtrList eventList); void clearSelection(); void jumpToDate (); - void editItem(QListViewItem *item); - void showItem(QListViewItem *item,const QPoint &,int); - void popupMenu(QListViewItem *item,const QPoint &,int); + void editItem(Q3ListViewItem *item); + void showItem(Q3ListViewItem *item,const QPoint &,int); + void popupMenu(Q3ListViewItem *item,const QPoint &,int); void newTodo(); void newSubTodo(); void unparentTodo(); @@ -219,10 +229,10 @@ class KOTodoView : public KOrg::BaseView void toggleQuickTodo(); void updateTodo( Todo *, int ); - void itemClicked(QListViewItem *); - void itemStateChanged(QListViewItem *); + void itemClicked(Q3ListViewItem *); + void itemStateChanged(Q3ListViewItem *); void modified(bool); - void itemDoubleClicked(QListViewItem *item); + void itemDoubleClicked(Q3ListViewItem *item); void resetFocusToList(); void fillCategories (); void fillCal (); @@ -273,18 +283,18 @@ class KOTodoView : public KOrg::BaseView bool mPendingUpdateBeforeRepaint; friend class KOTodoViewItem; QMap::ConstIterator insertTodoItem(Todo *todo); - void restoreItemState( QListViewItem * ); + void restoreItemState( Q3ListViewItem * ); bool checkTodo( Todo * ); bool isFlatDisplay; - void setOpen( QListViewItem*, bool setOpen); + void setOpen( Q3ListViewItem*, bool setOpen); KOTodoListView *mTodoListView; - QPopupMenu *mItemPopupMenu; - QPopupMenu *mPopupMenu; - QPopupMenu *mPriorityPopupMenu; - QPopupMenu *mPercentageCompletedPopupMenu; - QPopupMenu *mCategoryPopupMenu; - QPopupMenu *mCalPopupMenu; + Q3PopupMenu *mItemPopupMenu; + Q3PopupMenu *mPopupMenu; + Q3PopupMenu *mPriorityPopupMenu; + Q3PopupMenu *mPercentageCompletedPopupMenu; + Q3PopupMenu *mCategoryPopupMenu; + Q3PopupMenu *mCalPopupMenu; QMap mPercentage; QMap mPriority; diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 519bb16..c21816d 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -19,7 +19,11 @@ #include #include -#include +#include +#include +//Added by qt3to4: +#include +#include #include #include @@ -27,14 +31,14 @@ #include "kotodoview.h" #include "koprefs.h" -KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) - : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) +KOTodoViewItem::KOTodoViewItem( Q3ListView *parent, Todo *todo, KOTodoView *kotodo) + : Q3CheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) { construct(); } KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) - : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) + : Q3CheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) { construct(); } @@ -80,7 +84,7 @@ void KOTodoViewItem::setSortKey(int column,const QString &key) void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, int y,int h) { - QListViewItem::paintBranches(p,cg,w,y,h); + Q3ListViewItem::paintBranches(p,cg,w,y,h); } #else #endif @@ -316,7 +320,7 @@ void KOTodoViewItem::stateChange(bool state) else setSortKey(2,QString::number(99)); } if ( state ) { - QListViewItem * myChild = firstChild(); + Q3ListViewItem * myChild = firstChild(); KOTodoViewItem *item; while( myChild ) { //qDebug("stateCH "); @@ -325,7 +329,7 @@ void KOTodoViewItem::stateChange(bool state) myChild = myChild->nextSibling(); } } else { - QListViewItem * myChild = parent(); + Q3ListViewItem * myChild = parent(); if ( myChild ) (static_cast(myChild))->stateChange(state); } @@ -383,12 +387,12 @@ bool KOTodoViewItem::isAlternate() { KOTodoViewItem *item; bool previous = true; - if (QListViewItem::parent()) + if (Q3ListViewItem::parent()) { - item = static_cast(QListViewItem::parent()); + item = static_cast(Q3ListViewItem::parent()); if (item) previous = item->m_odd; - item = static_cast(QListViewItem::parent()->firstChild()); + item = static_cast(Q3ListViewItem::parent()->firstChild()); } else { @@ -476,13 +480,13 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling QColor fc = KOPrefs::instance()->mHighlightColor; if ( mTodo->percentComplete() == 100 ) - fc = darkGreen; + fc = Qt::darkGreen; p->drawRect( 2, 2, width-4, height()-4); p->fillRect( 3, 3, progress, height()-6, fc ); p->restore(); } else { - QCheckListItem::paintCell(p, _cg, column, width, alignment); + Q3CheckListItem::paintCell(p, _cg, column, width, alignment); } return; } @@ -494,12 +498,12 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); - QListView *lv = listView(); + Q3ListView *lv = listView(); if ( !lv ) return; int marg = 2;//lv->itemMargin(); int r = 0; - QCheckListItem::Type myType = QCheckListItem::CheckBox; + Q3CheckListItem::Type myType = Q3CheckListItem::CheckBox; int BoxSize = 20; int boxOffset = 2; int xOffset = 2; @@ -522,7 +526,7 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i if ( !pixmap( 0 ) ) r += BoxSize + 4; } else { - ASSERT( lv ); //### + Q_ASSERT( lv ); //### // QFontMetrics fm( lv->font() ); // int d = fm.height(); int x = 0; @@ -539,7 +543,7 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i x++; y++; if ( isOn() ) { - QPointArray a( 7*2 ); + Q3PointArray a( 7*2 ); int i, xx, yy; xx = x+xOffset+marg+(boxOffset/2); yy = y+5+boxOffset; @@ -555,7 +559,7 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i a.setPoint( 2*i+1, xx, yy+2 ); xx++; yy--; } - p->setPen( darkGreen ); + p->setPen( Qt::darkGreen ); p->drawLineSegments( a ); } //////////////////////// @@ -565,9 +569,9 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i p->translate( r, 0 ); p->setPen( QPen( _cg.text() ) ); - QListViewItem::paintCell( p, _cg, column, width - r, align ); + Q3ListViewItem::paintCell( p, _cg, column, width - r, align ); if ( mTodo->cancelled () ) { - p->setPen( black ); + p->setPen( Qt::black ); QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); int wid = br.width() +lineStart; if ( wid > width-3 ) diff --git a/korganizer/kotodoviewitem.h b/korganizer/kotodoviewitem.h index bd024c8..62a635c 100644 --- a/korganizer/kotodoviewitem.h +++ b/korganizer/kotodoviewitem.h @@ -22,13 +22,13 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include +#include #include #include @@ -45,7 +45,7 @@ class KOTodoView; @author Cornelius Schumacher @see KOTodoView */ -class KOTodoViewItem : public QCheckListItem +class KOTodoViewItem : public Q3CheckListItem { public: /** @@ -54,7 +54,7 @@ class KOTodoViewItem : public QCheckListItem @param parent is the list view to which this item belongs. @param ev is the event to have the item display information for. */ - KOTodoViewItem(QListView *parent, Todo *todo, KOTodoView *kotodo); + KOTodoViewItem(Q3ListView *parent, Todo *todo, KOTodoView *kotodo); KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo); //~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );} diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 4057ae0..07c4295 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -23,7 +23,9 @@ without including the source code for Qt in the source distribution. */ -#include +#include +//Added by qt3to4: +#include #include #include @@ -457,8 +459,8 @@ void KOViewManager::showListView() mMainView, SLOT ( moveIncidence( Incidence * ) ) ); connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), mMainView, SLOT ( beamIncidence( Incidence * ) ) ); - connect( mListView, SIGNAL( beamIncidenceList( QPtrList ) ), - mMainView, SLOT ( beamIncidenceList( QPtrList ) ) ); + connect( mListView, SIGNAL( beamIncidenceList( Q3PtrList ) ), + mMainView, SLOT ( beamIncidenceList( Q3PtrList ) ) ); } // bool temp = mFlagShowNextxDays; //globalFlagBlockPainting = true; diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index f88403c..bfe930f 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -18,14 +18,20 @@ */ #include -#include +#include #include #include #include #include +#include #ifdef DESKTOP_VERSION -#include +#include +//Added by qt3to4: +#include +#include +#include +#include #endif #include #include @@ -42,7 +48,7 @@ #include "koprefs.h" #include "koeventviewerdialog.h" #include "koeventviewer.h" -#include +#include #include "kowhatsnextview.h" using namespace KOrg; @@ -56,7 +62,7 @@ void WhatsNextTextBrowser::setSource(const QString& n) emit showIncidence(n); return; } else { - QTextBrowser::setSource(n); + Q3TextBrowser::setSource(n); } } void WhatsNextTextBrowser::printMe() @@ -72,7 +78,7 @@ void WhatsNextTextBrowser::printMe() return; QPainter p; p.begin ( &printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); @@ -103,19 +109,19 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, setFont( KOPrefs::instance()->mWhatsNextFont ); mView = new WhatsNextTextBrowser(this); connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); - QStyleSheet* stsh = mView->styleSheet(); - QStyleSheetItem * style ; + Q3StyleSheet* stsh = mView->styleSheet(); + Q3StyleSheetItem * style ; style = stsh->item ("h2" ); if ( style ) { - style->setMargin(QStyleSheetItem::MarginAll,0); + style->setMargin(Q3StyleSheetItem::MarginAll,0); } style = stsh->item ("h3" ); if ( style ) { - style->setMargin(QStyleSheetItem::MarginAll,0); + style->setMargin(Q3StyleSheetItem::MarginAll,0); } mEventViewer = 0; - QBoxLayout *topLayout = new QVBoxLayout(this); + Q3BoxLayout *topLayout = new Q3VBoxLayout(this); // topLayout->addWidget(mDateLabel); topLayout->addWidget(mView); mTimer = new QTimer( this ); @@ -144,9 +150,9 @@ void KOWhatsNextView::clearList() mTimer->stop(); mView->setText(" "); } -QPtrList KOWhatsNextView::selectedIncidences() +Q3PtrList KOWhatsNextView::selectedIncidences() { - QPtrList eventList; + Q3PtrList eventList; return eventList; } @@ -219,8 +225,8 @@ void KOWhatsNextView::updateView() mText += "\n"; int iii; mTodos.clear(); - QPtrList events; - QPtrList todos = calendar()->todos(); + Q3PtrList events; + Q3PtrList todos = calendar()->todos(); Todo * todo; //mText += "

" + i18n("Events: ") + "

\n"; int daysToShow = KOPrefs::instance()->mWhatsNextDays ; @@ -454,7 +460,7 @@ void KOWhatsNextView::showDates(const QDate &, const QDate &) updateView(); } -void KOWhatsNextView::showEvents(QPtrList) +void KOWhatsNextView::showEvents(Q3PtrList) { } @@ -741,7 +747,7 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) ind += "-"; mText += "\n"; } - QPtrList Relations = ev->relations(); + Q3PtrList Relations = ev->relations(); Incidence *to; for (to=Relations.first();to;to=Relations.next()) { if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio ) diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h index 93574ef..49fc448 100644 --- a/korganizer/kowhatsnextview.h +++ b/korganizer/kowhatsnextview.h @@ -19,22 +19,28 @@ #ifndef KOWHATSNEXTVIEW_H #define KOWHATSNEXTVIEW_H -#include +#include #include +//Added by qt3to4: +#include +#include +#include +#include +#include #include -class QListView; +class Q3ListView; class QLabel; class KOEventViewerDialog; #include #include -class WhatsNextTextBrowser : public QTextBrowser { +class WhatsNextTextBrowser : public Q3TextBrowser { Q_OBJECT public: - WhatsNextTextBrowser(QWidget *parent) : QTextBrowser(parent) {}; + WhatsNextTextBrowser(QWidget *parent) : Q3TextBrowser(parent) {}; void setSource(const QString &); void printMe(); @@ -58,7 +64,7 @@ class KOWhatsNextView : public KOrg::BaseView virtual int maxDatesHint(); virtual int currentDateCount(); void setEventViewer(KOEventViewerDialog* v ); - virtual QPtrList selectedIncidences(); + virtual Q3PtrList selectedIncidences(); void clearList(); DateList selectedDates() {DateList q; @@ -70,7 +76,7 @@ class KOWhatsNextView : public KOrg::BaseView virtual void updateView(); void printMe(); virtual void showDates(const QDate &start, const QDate &end); - virtual void showEvents(QPtrList eventList); + virtual void showEvents(Q3PtrList eventList); void updateConfig(); void changeEventDisplay(Event *, int); @@ -96,7 +102,7 @@ class KOWhatsNextView : public KOrg::BaseView // QLabel *mDateLabel; KOEventViewerDialog *mEventViewer; - QValueList mTodos; + Q3ValueList mTodos; }; #endif diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp index df9b2fc..e2ae4a6 100644 --- a/korganizer/ktimeedit.cpp +++ b/korganizer/ktimeedit.cpp @@ -21,12 +21,15 @@ without including the source code for Qt in the source distribution. */ -#include +#include #include #include #include -#include +#include #include +#include +//Added by qt3to4: +#include #include #include @@ -45,7 +48,7 @@ // Difficult to get all in one... // But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help. KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) - : QComboBox(TRUE, parent, name) + : Q3ComboBox(TRUE, parent, name) { setInsertionPolicy(NoInsertion); mFlagKeyPressed = false; @@ -64,12 +67,12 @@ KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) do { insertItem(KGlobal::locale()->formatTime(timeEntry)); timeEntry = timeEntry.addSecs(60*15); - } while (!timeEntry.isNull()); + } while ( !( timeEntry.hour() || timeEntry.minute() ) ); // Add end of day. insertItem( KGlobal::locale()->formatTime( QTime( 23, 59, 59 ) ) ); updateText(); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(Qt::StrongFocus); connect(this, SIGNAL(activated(int)), this, SLOT(activ(int))); connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int))); @@ -208,8 +211,8 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) mFlagKeyPressed = true; } // Tap -> Focus Next Widget - if ( e->key() == Key_Tab ) { - QComboBox::keyPressEvent(e); + if ( e->key() == Qt::Key_Tab ) { + Q3ComboBox::keyPressEvent(e); return; } @@ -220,12 +223,12 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) // Switch for arrows, backspace and escape switch(e->key()) { - case Key_Escape: + case Qt::Key_Escape: lineEdit()->deselect(); - case Key_Tab: - QComboBox::keyPressEvent(e); + case Qt::Key_Tab: + Q3ComboBox::keyPressEvent(e); break; - case Key_Up: + case Qt::Key_Up: if ( e->state () == Qt::ControlButton ) { addTime(QTime(0,15,0), false ); lineEdit()->setCursorPosition(3); @@ -267,7 +270,7 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) break; } break; - case Key_Down: + case Qt::Key_Down: if ( e->state () == Qt::ControlButton ) { subTime(QTime(0,15,0), false ); lineEdit()->setCursorPosition(3); @@ -310,7 +313,7 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) } break; // set cursor to correct place - case Key_Left: + case Qt::Key_Left: if ( cpos == 3 ) --cpos; if ( cpos > 0) { @@ -321,7 +324,7 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) setSelect ( 0 , 1 ); break; // set cursor to correct place - case Key_Right: + case Qt::Key_Right: if ( cpos == 1 ) ++cpos; if ( cpos < maxpos ) { @@ -330,19 +333,19 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) } break; // rest - case Key_Prior: + case Qt::Key_Prior: subTime(QTime(1,0,0)); break; - case Key_Next: + case Qt::Key_Next: addTime(QTime(1,0,0)); break; - case Key_Backspace: + case Qt::Key_Backspace: if ( cpos > 0) { if ( cpos == 3 ) --cpos; if ( cpos > 5) cpos = 5; - text.at( cpos-1 ) = '0'; + text[ cpos-1 ] = '0'; lineEdit()->setText( text ); lineEdit()->setCursorPosition(--cpos); setSelect ( cpos , 1 ); @@ -352,7 +355,7 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) } // switch arrows // if cursor at string end, alltext market and keyEvent don't ArrowLeft -> deselect and cpos - if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Key_Left ) { + if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Qt::Key_Left ) { lineEdit()->deselect(); cpos = 0; lineEdit()->setCursorPosition(cpos); @@ -367,42 +370,42 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) if ( cpos < 5 ) { // switch another keys switch(e->key()) { - case Key_Delete: - text.at( cpos ) = '0'; + case Qt::Key_Delete: + text[ cpos ] = '0'; lineEdit()->setText( text ); lineEdit()->setCursorPosition(cpos); setSelect ( cpos , 1 ); changedText(); break; - case Key_9: - case Key_8: - case Key_7: - case Key_6: + case Qt::Key_9: + case Qt::Key_8: + case Qt::Key_7: + case Qt::Key_6: if ( !(cpos == 1 || cpos == 4) ) return; if ( cpos == 1 && text.at( 0 ) > '1') - text.at( 0 ) = '1'; - case Key_5: - case Key_4: - case Key_3: + text[ 0 ] = '1'; + case Qt::Key_5: + case Qt::Key_4: + case Qt::Key_3: if ( cpos < 1 ) return; if ( hour12Format && cpos == 1 ) return; - case Key_2: + case Qt::Key_2: if ( hour12Format && cpos == 0 ) return; if ( cpos == 0 && text.at( 1 ) > '3') - text.at( 1 ) = '3'; - case Key_1: - case Key_0: + text[ 1 ] = '3'; + case Qt::Key_1: + case Qt::Key_0: if ( hour12Format ) { - if ( e->key() == Key_0 && cpos == 1 && text.at( 0 ) == '0' ) + if ( e->key() == Qt::Key_0 && cpos == 1 && text.at( 0 ) == '0' ) return; - if ( e->key() == Key_0 && cpos == 0 && text.at( 1 ) == '0' ) - text.at( 1 ) = '1'; + if ( e->key() == Qt::Key_0 && cpos == 0 && text.at( 1 ) == '0' ) + text[ 1 ] = '1'; } - text.at( cpos ) = QChar ( e->key() ); + text[ cpos ] = QChar ( e->key() ); lineEdit()->setText( text ); if ( cpos == 1 ) ++cpos; @@ -411,11 +414,11 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) setSelect( cpos , 1 ); changedText(); break; - case Key_Home: + case Qt::Key_Home: lineEdit()->setCursorPosition(0); setSelect( cpos , 1 ); break; - case Key_End: + case Qt::Key_End: lineEdit()->setCursorPosition(5); lineEdit()->deselect(); break; @@ -425,13 +428,13 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) } // switch num keys } else if ( cpos == 5 ) {// if cpos < 5 if ( hour12Format ) { - if ( e->key() == Key_A ) { - text.at( 5 ) = 'a'; + if ( e->key() == Qt::Key_A ) { + text[ 5 ] = 'a'; lineEdit()->setText( text ); lineEdit()->setCursorPosition(5); - } else if ( e->key() == Key_P ) { - text.at( 5 ) = 'p'; + } else if ( e->key() == Qt::Key_P ) { + text[ 5 ] = 'p'; lineEdit()->setText( text ); lineEdit()->setCursorPosition(5); diff --git a/korganizer/ktimeedit.h b/korganizer/ktimeedit.h index b3d842d..1c7d18d 100644 --- a/korganizer/ktimeedit.h +++ b/korganizer/ktimeedit.h @@ -24,10 +24,13 @@ #define _KTIMEEDIT_H #include -#include +#include #include #include #include +#include +//Added by qt3to4: +#include #include @@ -38,7 +41,7 @@ @short Provides a way to edit times in a user-friendly manner. @author Preston Brown, Ian Dawes */ -class KOTimeEdit : public QComboBox +class KOTimeEdit : public Q3ComboBox { Q_OBJECT public: diff --git a/korganizer/lineview.cpp b/korganizer/lineview.cpp index e72e41c..012455e 100644 --- a/korganizer/lineview.cpp +++ b/korganizer/lineview.cpp @@ -7,7 +7,7 @@ #include "lineview.h" LineView::LineView( QWidget *parent, const char *name ) : - QScrollView( parent, name ) + Q3ScrollView( parent, name ) { mPixelWidth = 1000; diff --git a/korganizer/lineview.h b/korganizer/lineview.h index aa34dbc..52ae9cf 100644 --- a/korganizer/lineview.h +++ b/korganizer/lineview.h @@ -1,10 +1,10 @@ #ifndef LINEVIEW_H #define LINEVIEW_H -#include -#include +#include +#include -class LineView : public QScrollView +class LineView : public Q3ScrollView { Q_OBJECT public: @@ -28,7 +28,7 @@ class LineView : public QScrollView int end; }; - QPtrList mLines; + Q3PtrList mLines; int mPixelWidth; }; diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 4a0e24f..211fde6 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp @@ -4,13 +4,13 @@ #include #include #include +//Added by qt3to4: +#include #include #else #include #include #include -#include -#include #include #endif #include @@ -26,12 +26,12 @@ void dumpMissing(); int main( int argc, char **argv ) { + if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi"); #ifndef DESKTOP_VERSION QPEApplication a( argc, argv ); a.setKeepRunning (); #else QApplication a( argc, argv ); - QApplication::setStyle( new QPlatinumStyle ()); #ifdef _WIN32_ QString hdir ( getenv( "HOME") ); if ( hdir.isEmpty() ) { @@ -89,7 +89,7 @@ int main( int argc, char **argv ) MainWindow m; #ifndef DESKTOP_VERSION - QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(receiveStart( const QCString&, const QByteArray& ))); + QObject::connect( &a, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )),&m, SLOT(receiveStart( const Q3CString&, const QByteArray& ))); a.showMainWidget(&m ); #else a.setMainWidget(&m ); @@ -98,7 +98,7 @@ int main( int argc, char **argv ) //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); #endif if ( argc > 1 ) { - QCString command = argv[1]; + Q3CString command = argv[1]; if ( argc > 2 ) command += argv[2]; m.recieve(command, QByteArray() ); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 69ccde1..2004939 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1,24 +1,25 @@ #include #include -#include +#include +#include #include -#include +#include #include #include #include #include #include #include -#include +#include #include #include #include #include #include -#include -#include -#include +#include +#include +#include #ifndef DESKTOP_VERSION #include #include @@ -28,8 +29,17 @@ #include //#include // for sleep #else -#include +#include #include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include //#include #endif @@ -80,35 +90,35 @@ class KOex2phonePrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Export to phone options") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel *lab; lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); - lab->setAlignment (AlignHCenter ); - QHBox* temphb; - temphb = new QHBox( this ); + lab->setAlignment (Qt::AlignHCenter ); + Q3HBox* temphb; + temphb = new Q3HBox( this ); new QLabel( i18n("I/O device: "), temphb ); mPhoneDevice = new QLineEdit( temphb); lay->addWidget( temphb ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Connection: "), temphb ); mPhoneConnection = new QLineEdit( temphb); lay->addWidget( temphb ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Model(opt.): "), temphb ); mPhoneModel = new QLineEdit( temphb); lay->addWidget( temphb ); mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); mWriteBackFuture->setChecked( true ); lay->addWidget( mWriteBackFuture ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Max. weeks in future: ") , temphb ); mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); mWriteBackFutureWeeks->setValue( 8 ); lay->addWidget( temphb ); lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); - lab->setAlignment (AlignHCenter ); + lab->setAlignment (Qt::AlignHCenter ); QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); lay->addWidget( ok ); QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); @@ -134,7 +144,7 @@ QPixmap* sgListViewJournalPix; int globalFlagBlockStartup; MainWindow::MainWindow( QWidget *parent, const char *name ) : - QMainWindow( parent, name ) + Q3MainWindow( parent, name ) { sgListViewCompletedPix[5] = &listviewPix; sgListViewCompletedPix[0] = &listviewPix0; @@ -185,18 +195,18 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : p->mCurrentDisplayedView = 0; if ( p->mHourSize > 22 ) p->mHourSize = 22; - QMainWindow::ToolBarDock tbd; + Qt::ToolBarDock tbd; if ( p->mToolBarHor ) { if ( p->mToolBarUp ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUp ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } if ( KOPrefs::instance()->mUseAppColors ) QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); @@ -213,15 +223,15 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : { if ( p->mToolBarHorF ) { if ( p->mToolBarUpF ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUpF ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } filterToolBar = new QPEToolBar ( this ); filterMenubar = new KMenuBar( 0 ); @@ -230,7 +240,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : filterToolBar->setFocusPolicy( NoFocus ); filterMenubar->setFocusPolicy( NoFocus ); #endif - filterPopupMenu = new QPopupMenu( this ); + filterPopupMenu = new Q3PopupMenu( this ); filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); QString addTest = "A"; filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); @@ -259,29 +269,29 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : #endif if ( p->mToolBarHorV ) { if ( p->mToolBarUpV ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUpV ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } viewToolBar = new QPEToolBar( this ); addToolBar (viewToolBar , tbd ); if ( p->mToolBarHorN ) { if ( p->mToolBarUpN ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUpN ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } navigatorToolBar = new QPEToolBar( this ); addToolBar (navigatorToolBar , tbd ); @@ -440,9 +450,9 @@ void MainWindow::loadDataAfterStart() connect( mView, SIGNAL( modifiedChanged( bool ) ), SLOT( slotModifiedChanged( bool ) ) ); #ifndef DESKTOP_VERSION - connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); - connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& ))); - disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& ))); + connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & ))); + connect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(recieve( const Q3CString&, const QByteArray& ))); + disconnect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(receiveStart( const Q3CString&, const QByteArray& ))); if ( !mCStringMess.isEmpty() ) recieve( mCStringMess, mByteData ); #endif @@ -509,7 +519,7 @@ void MainWindow::toggleBeamReceive() qDebug("KO: Enable BeamReceive "); brAction->setOn(true); infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; - QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); + QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(recieve( const Q3CString&, const QByteArray& ))); #endif } void MainWindow::showMaximized () @@ -600,22 +610,22 @@ void MainWindow::closeEvent( QCloseEvent* ce ) } -void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) +void MainWindow::receiveStart( const Q3CString& cmsg, const QByteArray& data ) { qDebug("KO: QCOP start message received: %s ", cmsg.data() ); mCStringMess = cmsg; mByteData = data; } -void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) +void MainWindow::recieve( const Q3CString& cmsg, const QByteArray& data ) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast(&data), QIODevice::ReadOnly ); // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); //QString datamess; //qDebug("message "); qDebug("KO: QCOP message received: %s ", cmsg.data() ); if ( cmsg == "setDocument(QString)" ) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast(&data), QIODevice::ReadOnly ); QString fileName; stream >> fileName; //qDebug("filename %s ", fileName.latin1()); @@ -744,21 +754,21 @@ void MainWindow::initActions() KOPrefs *p = KOPrefs::instance(); //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); - QPopupMenu *viewMenu = new QPopupMenu( this ); - QPopupMenu *actionMenu = new QPopupMenu( this ); - mCurrentItemMenu = new QPopupMenu ( this ); - QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); - QPopupMenu *importMenu = new QPopupMenu( this ); - QPopupMenu *importMenu_X = new QPopupMenu( this ); - QPopupMenu *exportMenu_X = new QPopupMenu( this ); - QPopupMenu *beamMenu_X = new QPopupMenu( this ); - selectFilterMenu = new QPopupMenu( this ); + Q3PopupMenu *viewMenu = new Q3PopupMenu( this ); + Q3PopupMenu *actionMenu = new Q3PopupMenu( this ); + mCurrentItemMenu = new Q3PopupMenu ( this ); + Q3PopupMenu *nextConflictMenu = new Q3PopupMenu ( this ); + Q3PopupMenu *importMenu = new Q3PopupMenu( this ); + Q3PopupMenu *importMenu_X = new Q3PopupMenu( this ); + Q3PopupMenu *exportMenu_X = new Q3PopupMenu( this ); + Q3PopupMenu *beamMenu_X = new Q3PopupMenu( this ); + selectFilterMenu = new Q3PopupMenu( this ); selectFilterMenu->setCheckable( true ); - syncMenu = new QPopupMenu( this ); - configureAgendaMenu = new QPopupMenu( this ); - configureToolBarMenu = new QPopupMenu( this ); - QPopupMenu *helpMenu = new QPopupMenu( this ); - QIconSet icon; + syncMenu = new Q3PopupMenu( this ); + configureAgendaMenu = new Q3PopupMenu( this ); + configureToolBarMenu = new Q3PopupMenu( this ); + Q3PopupMenu *helpMenu = new Q3PopupMenu( this ); + QIcon icon; int pixWid = 22, pixHei = 22; QString pathString = ""; if ( !p->mToolBarMiniIcons ) { @@ -791,7 +801,7 @@ void MainWindow::initActions() menuBar1->insertItem( i18n("Help"), helpMenu ); } else { menuBar1 = new KMenuBar( iconToolBar ); - QPopupMenu *menuBar = new QPopupMenu( this ); + Q3PopupMenu *menuBar = new Q3PopupMenu( this ); icon = loadPixmap( pathString + "z_menu" ); menuBar1->insertItem( icon.pixmap(), menuBar); //menuBar1->insertItem( i18n("ME"), menuBar); @@ -818,7 +828,7 @@ void MainWindow::initActions() mWeekPixmap.resize( pixWid , pixHei ); mWeekPixmap.fill( mWeekBgColor ); icon = mWeekPixmap; - mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); + mWeekAction = new Q3Action( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); if ( p-> mShowIconWeekNum ) mWeekAction->addTo( iconToolBar ); mWeekFont = font(); @@ -840,18 +850,18 @@ void MainWindow::initActions() connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); if ( p->mShowIconFilterview ) { icon = loadPixmap( pathString + "filter" ); - actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); + actionFilterMenuTB = new Q3Action( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); connect( actionFilterMenuTB, SIGNAL( activated() ), this, SLOT( fillFilterMenuTB() ) ); actionFilterMenuTB->addTo( iconToolBar ); - selectFilterMenuTB = new QPopupMenu( this ); + selectFilterMenuTB = new Q3PopupMenu( this ); selectFilterMenuTB->setCheckable( true ); connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); } //#endif // ****************** - QAction *action; + Q3Action *action; // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); configureToolBarMenu->setCheckable( true ); @@ -866,35 +876,35 @@ void MainWindow::initActions() connect( configureAgendaMenu, SIGNAL( aboutToShow()), this, SLOT( showConfigureAgenda( ) ) ); icon = loadPixmap( pathString + "today" ); - QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); + Q3Action* today_action = new Q3Action( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); today_action->addTo( actionMenu ); connect( today_action, SIGNAL( activated() ), mView, SLOT( goToday() ) ); icon = loadPixmap( pathString + "picker" ); - QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); + Q3Action* dPickerAction = new Q3Action( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); dPickerAction->addTo( actionMenu ); connect( dPickerAction, SIGNAL( activated() ), mView, SLOT( showDatePicker() ) ); icon = loadPixmap( pathString + "search" ); - QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); + Q3Action* search_action = new Q3Action( i18n("Search"), icon, i18n("Search..."), 0, this ); search_action->addTo( actionMenu ); connect( search_action, SIGNAL( activated() ), mView->dialogManager(), SLOT( showSearchDialog() ) ); actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); - action = new QAction( "Undo Delete", i18n("All events"), 0, this ); + action = new Q3Action( "Undo Delete", i18n("All events"), 0, this ); action->addTo( nextConflictMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( conflictAll() ) ); - action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); + action = new Q3Action( "Undo Delete", i18n("Allday events"), 0, this ); action->addTo( nextConflictMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( conflictAllday() ) ); - action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); + action = new Q3Action( "Undo Delete", i18n("Events with time"), 0, this ); action->addTo( nextConflictMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( conflictNotAll() ) ); @@ -902,16 +912,16 @@ void MainWindow::initActions() actionMenu->insertSeparator(); icon = loadPixmap( pathString + "newevent" ); - QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); + Q3Action* ne_action = new Q3Action( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); ne_action->addTo( mCurrentItemMenu ); connect( ne_action, SIGNAL( activated() ), mView, SLOT( newEvent() ) ); icon = loadPixmap( pathString + "newtodo" ); - QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); + Q3Action* nt_action = new Q3Action( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); nt_action->addTo( mCurrentItemMenu ); connect( nt_action, SIGNAL( activated() ), mView, SLOT( newTodo() ) ); - mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, + mNewSubTodoAction = new Q3Action( "new_subtodo", i18n("New Sub-Todo..."), 0, this ); mNewSubTodoAction->addTo( mCurrentItemMenu ); connect( mNewSubTodoAction, SIGNAL( activated() ), @@ -930,44 +940,44 @@ void MainWindow::initActions() configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); - mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); + mShowAction = new Q3Action( "show_incidence", i18n("Show"), 0, this ); mShowAction->addTo( mCurrentItemMenu ); connect( mShowAction, SIGNAL( activated() ), mView, SLOT( showIncidence() ) ); - mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); + mEditAction = new Q3Action( "edit_incidence", i18n("Edit..."), 0, this ); mEditAction->addTo( mCurrentItemMenu ); connect( mEditAction, SIGNAL( activated() ), mView, SLOT( editIncidence() ) ); - mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); + mDeleteAction = new Q3Action( "delete_incidence", i18n("Delete..."), 0, this ); mDeleteAction->addTo( mCurrentItemMenu ); connect( mDeleteAction, SIGNAL( activated() ), mView, SLOT( deleteIncidence() ) ); - mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); + mCloneAction = new Q3Action( "clone_incidence", i18n("Clone..."), 0, this ); mCloneAction->addTo( mCurrentItemMenu ); connect( mCloneAction, SIGNAL( activated() ), mView, SLOT( cloneIncidence() ) ); - mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); + mMoveAction = new Q3Action( "Move_incidence", i18n("Move..."), 0, this ); mMoveAction->addTo( mCurrentItemMenu ); connect( mMoveAction, SIGNAL( activated() ), mView, SLOT( moveIncidence() ) ); #ifndef DESKTOP_VERSION - mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); + mBeamAction = new Q3Action( "Beam_incidence", i18n("Beam..."), 0, this ); mBeamAction->addTo(mCurrentItemMenu ); connect( mBeamAction, SIGNAL( activated() ), mView, SLOT( beamIncidence() ) ); #endif - mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); + mCancelAction = new Q3Action( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); mCancelAction->addTo( mCurrentItemMenu ); connect( mCancelAction, SIGNAL( activated() ), mView, SLOT( toggleCancelIncidence() ) ); mCurrentItemMenu->insertSeparator(); - action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); + action = new Q3Action( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); action->addTo( mCurrentItemMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( undo_delete() ) ); @@ -979,7 +989,7 @@ void MainWindow::initActions() icon = SmallIcon("1leftrightarrow" ); } configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); - QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); + Q3Action* FSaction = new Q3Action( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); FSaction->addTo( viewMenu ); connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); @@ -987,21 +997,21 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "filter" ); configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); icon = loadPixmap( pathString + "configure" ); - action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); + action = new Q3Action( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleFilter() ) ); mToggleFilter = action; icon = loadPixmap( pathString + "navi" ); configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); - action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); + action = new Q3Action( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleDateNavigatorWidget() ) ); mToggleNav = action ; icon = loadPixmap( pathString + "allday" ); configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); - action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); + action = new Q3Action( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleAllDaySize() ) ); @@ -1031,14 +1041,14 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "whatsnext" ); configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); - QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); + Q3Action* whatsnext_action = new Q3Action( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); whatsnext_action->addTo( viewMenu ); connect( whatsnext_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWhatsNextView() ) ); icon = loadPixmap( pathString + "xdays" ); configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); - QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); + Q3Action* xdays_action = new Q3Action( i18n("Next days"), icon, i18n("Next days"), 0, this ); xdays_action->addTo( viewMenu ); connect( xdays_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showNextXView() ) ); @@ -1046,7 +1056,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "journal" ); configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); - QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); + Q3Action* viewjournal_action = new Q3Action( i18n("Journal"), icon, i18n("Journal"), 0, this ); viewjournal_action->addTo( viewMenu ); connect( viewjournal_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showJournalView() ) ); @@ -1054,7 +1064,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "day" ); configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); - QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); + Q3Action* day1_action = new Q3Action( i18n("Day View"), icon, i18n("Day View"), 0, this ); day1_action->addTo( viewMenu ); // action->addTo( toolBar ); connect( day1_action, SIGNAL( activated() ), @@ -1062,42 +1072,42 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "workweek" ); configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); - QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); + Q3Action* day5_action = new Q3Action( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); day5_action->addTo( viewMenu ); connect( day5_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWorkWeekView() ) ); icon = loadPixmap( pathString + "week" ); configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); - QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); + Q3Action* day7_action = new Q3Action( i18n("Week"), icon, i18n("Week"), 0, this ); day7_action->addTo( viewMenu ); connect( day7_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWeekView() ) ); icon = loadPixmap( pathString + "workweek2" ); configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); - QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); + Q3Action* day6_action = new Q3Action( i18n("List week"), icon, i18n("List week"), 0, this ); day6_action->addTo( viewMenu ); connect( day6_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showMonthViewWeek() ) ); icon = loadPixmap( pathString + "month" ); configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); - QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); + Q3Action* month_action = new Q3Action( i18n("Month"), icon, i18n("Month"), 0, this ); month_action->addTo( viewMenu ); connect( month_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showMonthView() ) ); icon = loadPixmap( pathString + "list" ); configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); - QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); + Q3Action* showlist_action = new Q3Action( i18n("List View"), icon, i18n("List View"), 0, this ); showlist_action->addTo( viewMenu ); connect( showlist_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showListView() ) ); icon = loadPixmap( pathString + "todo" ); configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); - QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); + Q3Action* todoview_action = new Q3Action( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); todoview_action->addTo( viewMenu ); connect( todoview_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showTodoView() ) ); @@ -1105,7 +1115,7 @@ void MainWindow::initActions() #if 0 - action = new QAction( "view_timespan", "Time Span", 0, this ); + action = new Q3Action( "view_timespan", "Time Span", 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView->viewManager(), SLOT( showTimeSpanView() ) ); @@ -1113,7 +1123,7 @@ void MainWindow::initActions() - action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, + action = new Q3Action( "purge_completed", i18n("Purge Completed..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); @@ -1125,12 +1135,12 @@ void MainWindow::initActions() actionMenu->insertSeparator(); - action = new QAction( "manage cat", i18n("Edit category list..."), 0, + action = new Q3Action( "manage cat", i18n("Edit category list..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); - action = new QAction( "manage cat", i18n("Manage new categories..."), 0, + action = new Q3Action( "manage cat", i18n("Manage new categories..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); @@ -1138,15 +1148,15 @@ void MainWindow::initActions() actionMenu->insertSeparator(); icon = loadPixmap( pathString + "configure" ); - action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); + action = new Q3Action( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( edit_options() ) ); - action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); + action = new Q3Action( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), this, SLOT( calHint() ) ); - action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); + action = new Q3Action( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( edit_global_options() ) ); @@ -1155,29 +1165,29 @@ void MainWindow::initActions() } // actionMenu->insertSeparator(); - action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, + action = new Q3Action( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); - action = new QAction( "import_quick", i18n("Import last file"), 0, + action = new Q3Action( "import_quick", i18n("Import last file"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); importMenu_X->insertSeparator(); - action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, + action = new Q3Action( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); //#ifndef DESKTOP_VERSION importMenu_X->insertSeparator(); - action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, + action = new Q3Action( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); //#else #ifdef _OL_IMPORT_ importMenu_X->insertSeparator(); - action = new QAction( "import_ol", i18n("Import from OL"), 0, + action = new Q3Action( "import_ol", i18n("Import from OL"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); @@ -1186,30 +1196,30 @@ void MainWindow::initActions() //importMenu->insertSeparator(); #if 0 - action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, + action = new Q3Action( "load_cal", i18n("Load Calendar Backup"), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); #endif - action = new QAction( "save_cal", i18n("Save Backup..."), 0, + action = new Q3Action( "save_cal", i18n("Save Backup..."), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); importMenu->insertSeparator(); importMenu->insertItem( i18n("Import"), importMenu_X ); //importMenu->insertSeparator(); - action = new QAction( "export ical", i18n("Export All Data"), 0, + action = new Q3Action( "export ical", i18n("Export All Data"), 0, this ); action->addTo( exportMenu_X ); connect( action, SIGNAL( activated() ), SLOT( exportICalendar() ) ); - action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, + action = new Q3Action( "import_qtopia", i18n("Export VCalendar"), 0, this ); action->addTo( exportMenu_X ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); //LR - QPopupMenu *ex2phone = new QPopupMenu( this ); + Q3PopupMenu *ex2phone = new Q3PopupMenu( this ); ex2phone->insertItem(i18n("Complete calendar..."), 1 ); ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); @@ -1219,18 +1229,18 @@ void MainWindow::initActions() mPrintSelAction = 0; #ifndef DESKTOP_VERSION //importMenu->insertSeparator(); - brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, + brAction = new Q3Action( "beam toggle", i18n("Beam receive enabled"), 0, this ); brAction->addTo( beamMenu_X ); brAction->setToggleAction (true ) ; connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); - action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, + action = new Q3Action( "beam all", i18n("Beam complete calendar..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); - action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, + action = new Q3Action( "beam all", i18n("Beam filtered calendar..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); @@ -1238,31 +1248,31 @@ void MainWindow::initActions() #else //importMenu->insertSeparator(); icon = loadPixmap( pathString + "print" ); - action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); + action = new Q3Action( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), this, SLOT( printCal() ) ); icon = loadPixmap( pathString + "week" ); - action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); + action = new Q3Action( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), this, SLOT( printSel() ) ); icon = loadPixmap( pathString + "whatsnext" ); - action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); + action = new Q3Action( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView->viewManager(), SLOT( slotprintWNV() ) ); icon = loadPixmap( pathString + "list" ); - action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); + action = new Q3Action( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), this, SLOT( printListView() ) ); icon = loadPixmap( pathString + "newevent" ); - action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); + action = new Q3Action( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView, SLOT( slotprintSelInc() ) ); @@ -1271,11 +1281,11 @@ void MainWindow::initActions() #endif importMenu->insertSeparator(); - action = new QAction( "beam all", i18n("Save"), 0, + action = new Q3Action( "beam all", i18n("Save"), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); - action = new QAction( "beam all", i18n("Exit (+save)"), 0, + action = new Q3Action( "beam all", i18n("Exit (+save)"), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); @@ -1284,59 +1294,59 @@ void MainWindow::initActions() //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); icon = loadPixmap( "korganizer/korganizer" ); - action = new QAction( "Whats New", i18n("What's new?"), 0,this ); + action = new Q3Action( "Whats New", i18n("What's new?"), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( whatsNew() ) ); - action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); + action = new Q3Action( "featureHowto", i18n("Features + hints..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( features() ) ); - action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); + action = new Q3Action( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( keyBindings() ) ); - action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); + action = new Q3Action( "Storage Howto", i18n("Storage HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( storagehowto() ) ); - action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); + action = new Q3Action( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( timetrackinghowto() ) ); - action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); + action = new Q3Action( "Sync Howto", i18n("Sync HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( synchowto() ) ); - action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); + action = new Q3Action( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( kdesynchowto() ) ); - action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); + action = new Q3Action( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( multisynchowto() ) ); - action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); + action = new Q3Action( "Auto saving", i18n("Auto saving..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( aboutAutoSaving() ) ); - action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); + action = new Q3Action( "Problemd", i18n("Known Problems..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( aboutKnownBugs() ) ); - action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); + action = new Q3Action( "Translate Howto", i18n("User translation..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( usertrans() ) ); - action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); + action = new Q3Action( "Frequently asked questions", i18n("FAQ..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( faq() ) ); - action = new QAction( "licence", i18n("Licence..."), 0, this ); + action = new Q3Action( "licence", i18n("Licence..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( licence() ) ); - action = new QAction( "about", i18n("About..."), 0, this ); + action = new Q3Action( "about", i18n("About..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( about() ) ); @@ -1356,7 +1366,7 @@ void MainWindow::initActions() if (p-> mShowIconSearch) search_action->addTo( iconToolBar ); if (p-> mShowIconWhatsThis) - QWhatsThis::whatsThisButton ( iconToolBar ); + Q3WhatsThis::whatsThisButton ( iconToolBar ); if (p-> mShowIconNext) whatsnext_action->addTo( viewToolBar ); if (p-> mShowIconNextDays) @@ -1381,7 +1391,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "2leftarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); if (p-> mShowIconBackFast) { - action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); + action = new Q3Action( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goPreviousMonth() ) ); action->addTo( navigatorToolBar ); @@ -1389,7 +1399,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "1leftarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); if (p-> mShowIconBack) { - action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); + action = new Q3Action( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goPrevious() ) ); action->addTo( navigatorToolBar ); @@ -1401,7 +1411,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "1rightarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); if (p-> mShowIconForward) { - action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); + action = new Q3Action( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goNext() ) ); action->addTo( navigatorToolBar ); @@ -1409,7 +1419,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "2rightarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); if (p-> mShowIconForwardFast) { - action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); + action = new Q3Action( i18n("Next month"), icon, i18n("Next month"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goNextMonth() ) ); action->addTo( navigatorToolBar ); @@ -1524,7 +1534,7 @@ void MainWindow::exportToPhone( int mode ) int inFuture = 0; if ( ex2phone.mWriteBackFuture->isChecked() ) inFuture = ex2phone.mWriteBackFutureWeeks->value(); - QPtrList delSel; + Q3PtrList delSel; if ( mode == 1 ) delSel = mCalendar->rawIncidences(); if ( mode == 2 ) @@ -1595,10 +1605,10 @@ void MainWindow::displayText( QString text ,QString cap ) { QDialog dia( this, "name", true ); ; dia.setCaption( cap ); - QVBoxLayout* lay = new QVBoxLayout( &dia ); + Q3VBoxLayout* lay = new Q3VBoxLayout( &dia ); lay->setSpacing( 3 ); lay->setMargin( 3 ); - QTextBrowser tb ( &dia ); + Q3TextBrowser tb ( &dia ); lay->addWidget( &tb ); tb.setText( text ); #ifdef DESKTOP_VERSION @@ -1777,9 +1787,9 @@ void MainWindow::updateWeek(QDate seda) mWeekPixmap.fill( mWeekBgColor ); QPainter p ( &mWeekPixmap ); p.setFont( mWeekFont ); - p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); + p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),Qt::AlignCenter, QString::number( weekNum) ); p.end(); - QIconSet icon3 ( mWeekPixmap ); + QIcon icon3 ( mWeekPixmap ); mWeekAction->setIconSet ( icon3 ); } @@ -1812,7 +1822,7 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); if ( incidence->isBirthday() || incidence->isAnniversary() ) { bool ok; - QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); + QDateTime noc = incidence->getNextOccurence( (QDateTime)mView->startDate().addDays(-1), &ok ); if ( ok ) { int years = noc.date().year() - incidence->dtStart().date().year(); startString += i18n(" (%1 y.)"). arg( years ); @@ -1846,13 +1856,13 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) static QPixmap jP = SmallIcon( "journal" ); static QPixmap eP = SmallIcon( "newevent" ); static QPixmap tP = SmallIcon( "newtodo" ); - QIconSet icon; + QIcon icon; if ( incidence->typeID() == todoID ) - icon = QIconSet ( tP ); + icon = QIcon ( tP ); else if ( incidence->typeID() == eventID ) - icon = QIconSet ( eP ); + icon = QIcon ( eP ); else if ( incidence->typeID() == journalID ) - icon = QIconSet ( jP ); + icon = QIcon ( jP ); mPrintSelAction->setIconSet ( icon ); #endif } @@ -2045,7 +2055,7 @@ void MainWindow::backupAllFiles() } else if ( retval == 1 ){ qDebug("KO: Backup created."); // backup ok - QPtrList calendars = KOPrefs::instance()->mCalendars; + Q3PtrList calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); cal = calendars.next(); while ( cal ) { @@ -2341,7 +2351,7 @@ void MainWindow::fillFilterMenuTB() selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); selectFilterMenuTB->insertSeparator(); - QPtrList fili = mView->filters(); + Q3PtrList fili = mView->filters(); CalFilter *curfilter = mView->filterView()->selectedFilter(); CalFilter *filter = fili.first(); int iii = 2; @@ -2386,7 +2396,7 @@ void MainWindow::fillFilterMenu() selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); selectFilterMenu->insertSeparator(); - QPtrList fili = mView->filters(); + Q3PtrList fili = mView->filters(); CalFilter *curfilter = mView->filterView()->selectedFilter(); CalFilter *filter = fili.first(); int iii = 2; @@ -2407,7 +2417,7 @@ void MainWindow::fillFilterMenuPopup() filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); filterPopupMenu->insertSeparator(); - QPtrList fili = mView->filters(); + Q3PtrList fili = mView->filters(); CalFilter *curfilter = mView->filterView()->selectedFilter(); CalFilter *filter = fili.first(); int iii = 1; @@ -2819,5 +2829,5 @@ void MainWindow::resizeEvent( QResizeEvent* e) } } #endif - QMainWindow::resizeEvent( e); + Q3MainWindow::resizeEvent( e); } diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index a533d8b..6756216 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h @@ -1,13 +1,21 @@ #ifndef KORGE_MAINWINDOW_H #define KORGE_MAINWINDOW_H -#include +#include #include -#include +#include #include #include -#include +#include #include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include #include #include @@ -15,12 +23,12 @@ #ifndef DESKTOP_VERSION #include #endif -class QAction; +class Q3Action; class CalendarView; class KSyncProfile; #ifdef DESKTOP_VERSION -#define QPEToolBar QToolBar +#define QPEToolBar Q3ToolBar #endif class QPEToolBar; @@ -31,7 +39,7 @@ class CalendarLocal; using namespace KCal; -class MainWindow : public QMainWindow +class MainWindow : public Q3MainWindow { Q_OBJECT public: @@ -49,8 +57,8 @@ class MainWindow : public QMainWindow void updateFilterToolbar(); virtual void showMaximized (); void configureAgenda( int ); - void recieve( const QCString& msg, const QByteArray& data ); - void receiveStart( const QCString& msg, const QByteArray& data ); + void recieve( const Q3CString& msg, const QByteArray& data ); + void receiveStart( const Q3CString& msg, const QByteArray& data ); protected slots: void autoSaveWarning(); void loadDataAfterStart(); @@ -124,7 +132,7 @@ class MainWindow : public QMainWindow private: bool mAutoSaveDisabled; bool checkAutosave(); - QCString mCStringMess; + Q3CString mCStringMess; QByteArray mByteData; //void setMenuBar( QMenuBar * ); @@ -132,7 +140,7 @@ class MainWindow : public QMainWindow #ifndef DESKTOP_VERSION QCopChannel* infrared; #endif - QAction* brAction; + Q3Action* brAction; KSyncManager* mSyncManager; bool mClosed; void saveOnClose(); @@ -144,38 +152,38 @@ class MainWindow : public QMainWindow QPEToolBar *navigatorToolBar; QPEToolBar *filterToolBar; KMenuBar *filterMenubar; - QPopupMenu * filterPopupMenu; - QPopupMenu * mCurrentItemMenu; + Q3PopupMenu * filterPopupMenu; + Q3PopupMenu * mCurrentItemMenu; void initActions(); void setDefaultPreferences(); void resizeEvent( QResizeEvent* e); void keyPressEvent ( QKeyEvent * ) ; void keyReleaseEvent ( QKeyEvent * ) ; - QPopupMenu *configureToolBarMenu; - QPopupMenu *selectFilterMenu; - QPopupMenu *selectFilterMenuTB; - QPopupMenu *configureAgendaMenu, *syncMenu; + Q3PopupMenu *configureToolBarMenu; + Q3PopupMenu *selectFilterMenu; + Q3PopupMenu *selectFilterMenuTB; + Q3PopupMenu *configureAgendaMenu, *syncMenu; CalendarLocal *mCalendar; CalendarView *mView; - QAction *mNewSubTodoAction; - QAction *mWeekAction; + Q3Action *mNewSubTodoAction; + Q3Action *mWeekAction; QFont mWeekFont; QPixmap mWeekPixmap; QColor mWeekBgColor; - QAction *mShowAction; - QAction *mEditAction; - QAction *mDeleteAction; - QAction *mCloneAction; - QAction *mMoveAction; - QAction *mBeamAction; - QAction *mCancelAction; - QAction *mPrintSelAction; + Q3Action *mShowAction; + Q3Action *mEditAction; + Q3Action *mDeleteAction; + Q3Action *mCloneAction; + Q3Action *mMoveAction; + Q3Action *mBeamAction; + Q3Action *mCancelAction; + Q3Action *mPrintSelAction; - QAction *mToggleNav; - QAction *mToggleFilter; - QAction *mToggleAllday; - QAction *actionFilterMenuTB; + Q3Action *mToggleNav; + Q3Action *mToggleFilter; + Q3Action *mToggleAllday; + Q3Action *actionFilterMenuTB; void closeEvent( QCloseEvent* ce ); QTimer mSaveTimer; diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index f6a1a6a..59c3e45 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -26,10 +26,13 @@ #include #include #include -#include +#include #include -#include +#include #include +#include +//Added by qt3to4: +#include #include #include @@ -53,11 +56,11 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QHBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3HBoxLayout( this ); // Set up the control buttons and date label - mCtrlFrame = new QFrame( this ); - mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised); + mCtrlFrame = new Q3Frame( this ); + mCtrlFrame->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised); mCtrlFrame->setLineWidth(1); topLayout->addWidget( mCtrlFrame ); @@ -129,7 +132,7 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam // set up control frame layout - QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); + Q3BoxLayout *ctrlLayout = new Q3HBoxLayout( mCtrlFrame, 1 ); ctrlLayout->addWidget( mPrevYear, 3 ); ctrlLayout->addWidget( mPrevMonth, 3 ); ctrlLayout->addWidget( mPrevWeek, 3 ); @@ -150,13 +153,13 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); - mPrevYear->setFocusPolicy(NoFocus); - mPrevMonth->setFocusPolicy(NoFocus); - mNextMonth->setFocusPolicy(NoFocus); - mPrevWeek->setFocusPolicy(NoFocus); - mNextWeek->setFocusPolicy(NoFocus); - mNextYear->setFocusPolicy(NoFocus); - mSelectMonth->setFocusPolicy(NoFocus); + mPrevYear->setFocusPolicy(Qt::NoFocus); + mPrevMonth->setFocusPolicy(Qt::NoFocus); + mNextMonth->setFocusPolicy(Qt::NoFocus); + mPrevWeek->setFocusPolicy(Qt::NoFocus); + mNextWeek->setFocusPolicy(Qt::NoFocus); + mNextYear->setFocusPolicy(Qt::NoFocus); + mSelectMonth->setFocusPolicy(Qt::NoFocus); setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); } diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h index 9ccef14..a1880f5 100644 --- a/korganizer/navigatorbar.h +++ b/korganizer/navigatorbar.h @@ -27,9 +27,12 @@ #include #include +//Added by qt3to4: +#include +#include class QPushButton; -class QFrame; +class Q3Frame; class QLabel; class NavigatorBar: public QWidget @@ -60,7 +63,7 @@ class NavigatorBar: public QWidget int mCurrentHei; int mCurrentMinWid; int mCurrentButtonMinWid; - QFrame *mCtrlFrame; + Q3Frame *mCtrlFrame; QPushButton *mPrevYear; QPushButton *mPrevMonth; diff --git a/korganizer/outgoingdialog.cpp b/korganizer/outgoingdialog.cpp index 7253c8e..ab31274 100644 --- a/korganizer/outgoingdialog.cpp +++ b/korganizer/outgoingdialog.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -44,10 +44,10 @@ #include "koeventviewerdialog.h" #include "docprefs.h" -ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, +ScheduleItemOut::ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev, Scheduler::Method method, const QString &recipients) - : QListViewItem(parent) + : Q3ListViewItem(parent) { mIncidence = ev; mMethod = method; @@ -123,7 +123,7 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, const char* name,bool modal, - WFlags fl) + Qt::WFlags fl) : OutgoingDialog_base(parent,name,modal,fl) { mCalendar = calendar; @@ -139,12 +139,12 @@ OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, mScheduler = new DummyScheduler(mCalendar); #endif } - mMessageListView->setColumnAlignment(1,AlignHCenter); - mMessageListView->setColumnAlignment(2,AlignHCenter); - mMessageListView->setColumnAlignment(3,AlignHCenter); - mMessageListView->setColumnAlignment(4,AlignHCenter); - QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)), - this,SLOT(showEvent(QListViewItem *))); + mMessageListView->setColumnAlignment(1,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(2,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(3,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(4,Qt::AlignHCenter); + QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)), + this,SLOT(showEvent(Q3ListViewItem *))); mDocPrefs = new DocPrefs("groupschedule"); loadMessages(); } @@ -236,7 +236,7 @@ void OutgoingDialog::deleteItem() emit numMessagesChanged(mMessageListView->childCount()); } -void OutgoingDialog::showEvent(QListViewItem *qitem) +void OutgoingDialog::showEvent(Q3ListViewItem *qitem) { ScheduleItemOut *item = (ScheduleItemOut *)qitem; Event *event = 0; @@ -294,7 +294,7 @@ bool OutgoingDialog::saveMessage(IncidenceBase *incidence,Scheduler::Method meth { KTempFile ktfile(locateLocal("data","korganizer/outgoing/"),"ics"); QString messageText = mFormat->createScheduleMessage(incidence,method); - QTextStream *qts = ktfile.textStream(); + Q3TextStream *qts = ktfile.textStream(); *qts << messageText; *qts << "METHOD-BEGIN:" << endl << method << endl << ":METHOD-END" << endl; *qts << "RECIPIENTS-BEGIN:" << endl << recipients << endl << ":RECIPIENTS-END" << endl; @@ -330,11 +330,11 @@ void OutgoingDialog::loadMessages() if (iter.data() == outgoingDirName + "/" + (*it)) inserted = true; } if (!inserted) { - if (!f.open(IO_ReadOnly)) { + if (!f.open(QIODevice::ReadOnly)) { kdDebug() << "OutgoingDialog::loadMessage(): Can't open file'" << (*it) << "'" << endl; } else { - QTextStream t(&f); + Q3TextStream t(&f); QString messageString = t.read(); ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar, messageString); diff --git a/korganizer/outgoingdialog.h b/korganizer/outgoingdialog.h index a3d561a..e727087 100644 --- a/korganizer/outgoingdialog.h +++ b/korganizer/outgoingdialog.h @@ -23,7 +23,7 @@ #ifndef OUTGOINGDIALOG_H #define OUTGOINGDIALOG_H -#include +#include #include #include @@ -34,10 +34,10 @@ using namespace KCal; -class ScheduleItemOut : public QListViewItem +class ScheduleItemOut : public Q3ListViewItem { public: - ScheduleItemOut(QListView *parent,IncidenceBase *ev, + ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev, Scheduler::Method method, const QString &recipients=QString::null); virtual ~ScheduleItemOut() {} @@ -56,7 +56,7 @@ class OutgoingDialog : public OutgoingDialog_base Q_OBJECT public: OutgoingDialog(Calendar *,QWidget* parent=0,const char* name=0, - bool modal=false,WFlags fl=0); + bool modal=false,Qt::WFlags fl=0); ~OutgoingDialog(); bool addMessage(IncidenceBase *,Scheduler::Method); @@ -72,7 +72,7 @@ class OutgoingDialog : public OutgoingDialog_base protected slots: void send(); void deleteItem(); - void showEvent(QListViewItem *); + void showEvent(Q3ListViewItem *); private: bool saveMessage(IncidenceBase *,Scheduler::Method,const QString &recipients=0); diff --git a/korganizer/outgoingdialog_base.cpp b/korganizer/outgoingdialog_base.cpp index 1873b44..be8a870 100644 --- a/korganizer/outgoingdialog_base.cpp +++ b/korganizer/outgoingdialog_base.cpp @@ -11,12 +11,14 @@ #include "outgoingdialog_base.h" #include -#include -#include +#include +#include #include #include #include -#include +#include +//Added by qt3to4: +#include /* * Constructs a OutgoingDialog_base as a child of 'parent', with the @@ -25,23 +27,23 @@ * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -OutgoingDialog_base::OutgoingDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) +OutgoingDialog_base::OutgoingDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "OutgoingDialog_base" ); - OutgoingDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "OutgoingDialog_baseLayout"); + OutgoingDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "OutgoingDialog_baseLayout"); - mMessageListView = new QListView( this, "mMessageListView" ); + mMessageListView = new Q3ListView( this, "mMessageListView" ); mMessageListView->addColumn( tr2i18n( "Summary" ) ); mMessageListView->addColumn( tr2i18n( "Start Date" ) ); mMessageListView->addColumn( tr2i18n( "Start Time" ) ); mMessageListView->addColumn( tr2i18n( "End Date" ) ); mMessageListView->addColumn( tr2i18n( "End Time" ) ); mMessageListView->addColumn( tr2i18n( "Method" ) ); - mMessageListView->setFrameShape( QListView::StyledPanel ); - mMessageListView->setFrameShadow( QListView::Sunken ); + mMessageListView->setFrameShape( Q3ListView::StyledPanel ); + mMessageListView->setFrameShadow( Q3ListView::Sunken ); mMessageListView->setAllColumnsShowFocus( TRUE ); OutgoingDialog_baseLayout->addMultiCellWidget( mMessageListView, 0, 3, 0, 0 ); diff --git a/korganizer/outgoingdialog_base.h b/korganizer/outgoingdialog_base.h index af71bb1..5e81725 100644 --- a/korganizer/outgoingdialog_base.h +++ b/korganizer/outgoingdialog_base.h @@ -12,12 +12,16 @@ #include #include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QListView; -class QListViewItem; +//Added by qt3to4: +#include +#include +#include + +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; +class Q3ListView; +class Q3ListViewItem; class QPushButton; class OutgoingDialog_base : public QDialog @@ -25,16 +29,16 @@ class OutgoingDialog_base : public QDialog Q_OBJECT public: - OutgoingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + OutgoingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~OutgoingDialog_base(); - QListView* mMessageListView; + Q3ListView* mMessageListView; QPushButton* PushButton5; QPushButton* PushButton7; QPushButton* PushButton6; protected: - QGridLayout* OutgoingDialog_baseLayout; + Q3GridLayout* OutgoingDialog_baseLayout; protected slots: virtual void languageChange(); diff --git a/korganizer/publishdialog.cpp b/korganizer/publishdialog.cpp index 2ae6720..ede9840 100644 --- a/korganizer/publishdialog.cpp +++ b/korganizer/publishdialog.cpp @@ -35,13 +35,13 @@ #include "publishdialog.h" PublishDialog::PublishDialog(QWidget* parent, const char* name, - bool modal, WFlags fl) + bool modal, Qt::WFlags fl) : PublishDialog_base(parent,name,modal,fl) { setCaption(i18n("Select Addresses")); mNameLineEdit->setEnabled(false); mEmailLineEdit->setEnabled(false); - connect(mAddressListView,SIGNAL(selectionChanged(QListViewItem *)), + connect(mAddressListView,SIGNAL(selectionChanged(Q3ListViewItem *)), SLOT(updateInput())); } @@ -53,7 +53,7 @@ void PublishDialog::addAttendee(Attendee *attendee) { mNameLineEdit->setEnabled(true); mEmailLineEdit->setEnabled(true); - QListViewItem *item = new QListViewItem(mAddressListView); + Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); item->setText(0,attendee->name()); item->setText(1,attendee->email()); mAddressListView->insertItem(item); @@ -62,7 +62,7 @@ void PublishDialog::addAttendee(Attendee *attendee) QString PublishDialog::addresses() { QString to = ""; - QListViewItem *item; + Q3ListViewItem *item; int i, count; count = mAddressListView->childCount(); for (i=0;isetEnabled(true); mEmailLineEdit->setEnabled(true); - QListViewItem *item = new QListViewItem(mAddressListView); + Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); mAddressListView->insertItem(item); mAddressListView->setSelected(item,true); mNameLineEdit->setText(i18n("(EmptyName)")); @@ -89,7 +89,7 @@ void PublishDialog::addItem() void PublishDialog::removeItem() { - QListViewItem *item; + Q3ListViewItem *item; item = mAddressListView->selectedItem(); if (!item) return; mAddressListView->takeItem(item); @@ -119,7 +119,7 @@ void PublishDialog::openAddressbook() a = addressList[i]; mNameLineEdit->setEnabled(true); mEmailLineEdit->setEnabled(true); - QListViewItem *item = new QListViewItem(mAddressListView); + Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); mAddressListView->setSelected(item,true); mNameLineEdit->setText(a.realName()); mEmailLineEdit->setText(a.preferredEmail()); @@ -131,7 +131,7 @@ void PublishDialog::openAddressbook() void PublishDialog::updateItem() { - QListViewItem *item; + Q3ListViewItem *item; item = mAddressListView->selectedItem(); if (!item) return; item->setText(0,mNameLineEdit->text()); @@ -140,7 +140,7 @@ void PublishDialog::updateItem() void PublishDialog::updateInput() { - QListViewItem *item; + Q3ListViewItem *item; item = mAddressListView->selectedItem(); if (!item) return; mNameLineEdit->setEnabled(true); diff --git a/korganizer/publishdialog.h b/korganizer/publishdialog.h index 338603c..3ffeec4 100644 --- a/korganizer/publishdialog.h +++ b/korganizer/publishdialog.h @@ -23,7 +23,7 @@ #ifndef PUBLISHDIALOG_H #define PUBLISHDIALOG_H -#include +#include #include #include "publishdialog_base.h" @@ -35,7 +35,7 @@ class PublishDialog : public PublishDialog_base Q_OBJECT public: PublishDialog(QWidget* parent=0,const char* name=0, - bool modal=true,WFlags fl=0); + bool modal=true,Qt::WFlags fl=0); ~PublishDialog(); void addAttendee(Attendee *attendee); diff --git a/korganizer/publishdialog_base.cpp b/korganizer/publishdialog_base.cpp index 683f7e9..ce5c542 100644 --- a/korganizer/publishdialog_base.cpp +++ b/korganizer/publishdialog_base.cpp @@ -11,15 +11,18 @@ #include "publishdialog_base.h" #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include -#include +#include +//Added by qt3to4: +#include +#include /* * Constructs a PublishDialog_base as a child of 'parent', with the @@ -28,15 +31,15 @@ * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) +PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "PublishDialog_base" ); - PublishDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "PublishDialog_baseLayout"); + PublishDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "PublishDialog_baseLayout"); - mAddressListView = new QListView( this, "mAddressListView" ); + mAddressListView = new Q3ListView( this, "mAddressListView" ); mAddressListView->addColumn( tr2i18n( "Name" ) ); mAddressListView->addColumn( tr2i18n( "Email" ) ); @@ -72,14 +75,14 @@ PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool QSpacerItem* spacer = new QSpacerItem( 20, 241, QSizePolicy::Minimum, QSizePolicy::Expanding ); PublishDialog_baseLayout->addMultiCell( spacer, 3, 5, 2, 2 ); - Line2 = new QFrame( this, "Line2" ); - Line2->setFrameShape( QFrame::HLine ); - Line2->setFrameShadow( QFrame::Sunken ); - Line2->setFrameShape( QFrame::HLine ); + Line2 = new Q3Frame( this, "Line2" ); + Line2->setFrameShape( Q3Frame::HLine ); + Line2->setFrameShadow( Q3Frame::Sunken ); + Line2->setFrameShape( Q3Frame::HLine ); PublishDialog_baseLayout->addMultiCellWidget( Line2, 6, 6, 0, 2 ); - layout95 = new QHBoxLayout( 0, 0, 6, "layout95"); + layout95 = new Q3HBoxLayout( 0, 0, 6, "layout95"); QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); layout95->addItem( spacer_2 ); diff --git a/korganizer/publishdialog_base.h b/korganizer/publishdialog_base.h index 932474e..d1b40ae 100644 --- a/korganizer/publishdialog_base.h +++ b/korganizer/publishdialog_base.h @@ -12,15 +12,21 @@ #include #include +//Added by qt3to4: +#include +#include +#include +#include +#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QFrame; +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; +class Q3Frame; class QLabel; class QLineEdit; -class QListView; -class QListViewItem; +class Q3ListView; +class Q3ListViewItem; class QPushButton; class PublishDialog_base : public QDialog @@ -28,10 +34,10 @@ class PublishDialog_base : public QDialog Q_OBJECT public: - PublishDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + PublishDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~PublishDialog_base(); - QListView* mAddressListView; + Q3ListView* mAddressListView; QLabel* TextLabel1; QLabel* TextLabel2; QLineEdit* mEmailLineEdit; @@ -39,13 +45,13 @@ public: QPushButton* PushButton10; QPushButton* PushButton12; QPushButton* PushButton11; - QFrame* Line2; + Q3Frame* Line2; QPushButton* PushButton9; QPushButton* PushButton8; protected: - QGridLayout* PublishDialog_baseLayout; - QHBoxLayout* layout95; + Q3GridLayout* PublishDialog_baseLayout; + Q3HBoxLayout* layout95; protected slots: virtual void languageChange(); diff --git a/korganizer/savetemplatedialog.cpp b/korganizer/savetemplatedialog.cpp index 3544081..35bedba 100644 --- a/korganizer/savetemplatedialog.cpp +++ b/korganizer/savetemplatedialog.cpp @@ -22,6 +22,9 @@ */ #include +//Added by qt3to4: +#include +#include #include #include @@ -35,8 +38,8 @@ SaveTemplateDialog::SaveTemplateDialog( IncidenceType type, QWidget *parent ) true, false ), mType( type ) { - QFrame *topFrame = plainPage(); - QVBoxLayout *topLayout = new QVBoxLayout( topFrame, 0, spacingHint() ); + Q3Frame *topFrame = plainPage(); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( topFrame, 0, spacingHint() ); mEditListBox = new KEditListBox( i18n("Select Template Name"), topFrame, 0, false, KEditListBox::Add | diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 9cfdc35..105b844 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp @@ -24,14 +24,21 @@ #include #include -#include +#include #include +#include #include -#include -#include +#include +#include #include #include -#include +//#include +//Added by qt3to4: +#include +#include +#include +#include +#include #include #include @@ -46,15 +53,15 @@ #include "searchdialog.h" SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) - : QVBox( 0 ) + : Q3VBox( 0 ) { mCalendar = calendar; - QFrame *topFrame = new QFrame( this ) ;//plainPage(); - QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); + Q3Frame *topFrame = new Q3Frame( this ) ;//plainPage(); + Q3VBoxLayout *layout = new Q3VBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); // Search expression - QHBoxLayout *subLayout = new QHBoxLayout(); + Q3HBoxLayout *subLayout = new Q3HBoxLayout(); layout->addLayout(subLayout); /* searchLabel = new QLabel(topFrame); @@ -98,7 +105,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), // topFrame); - incidenceGroup = new QHBox( topFrame ); + incidenceGroup = new Q3HBox( topFrame ); layout->addWidget(incidenceGroup); mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); @@ -106,7 +113,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); - subjectGroup = new QHBox( topFrame ); + subjectGroup = new Q3HBox( topFrame ); layout->addWidget(subjectGroup); mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); @@ -114,7 +121,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); - attendeeGroup = new QHBox( topFrame ); + attendeeGroup = new Q3HBox( topFrame ); layout->addWidget(attendeeGroup ); new QLabel( i18n("Attendee:"),attendeeGroup ); mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); @@ -127,7 +134,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) QWidget *rangeWidget = new QWidget(topFrame); int space = KDialog::spacingHint(); if ( QApplication::desktop()->width() <= 240 ) space = 1; - QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,space); + Q3HBoxLayout *rangeLayout = new Q3HBoxLayout(rangeWidget,0,space); rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); mStartDate = new KDateEdit(rangeWidget); rangeLayout->addWidget(mStartDate); @@ -135,7 +142,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) mEndDate = new KDateEdit(rangeWidget); mEndDate->setDate(QDate::currentDate().addDays(365)); rangeLayout->addWidget(mEndDate); - QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); + QToolButton *wt = Q3WhatsThis::whatsThisButton ( rangeWidget ); rangeLayout->addWidget( (QWidget*)wt ); layout->addWidget(rangeWidget); // Results list view @@ -341,7 +348,7 @@ void SearchDialog::updateView() void SearchDialog::search(const QRegExp &re) { - QPtrList events; + Q3PtrList events; if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { if ( mRefineItems->isChecked() ) events = mMatchedEvents; mMatchedEvents.clear(); @@ -419,7 +426,7 @@ void SearchDialog::search(const QRegExp &re) } } if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { - QPtrList tmpAList = ev->attendees(); + Q3PtrList tmpAList = ev->attendees(); Attendee *a; for (a = tmpAList.first(); a; a = tmpAList.next()) { if (mSearchAName->isChecked()) { @@ -458,7 +465,7 @@ void SearchDialog::search(const QRegExp &re) } } } - QPtrList todos; + Q3PtrList todos; if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { if ( mRefineItems->isChecked() ) todos = mMatchedTodos ; @@ -512,7 +519,7 @@ void SearchDialog::search(const QRegExp &re) } } if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { - QPtrList tmpAList = tod->attendees(); + Q3PtrList tmpAList = tod->attendees(); Attendee *a; for (a = tmpAList.first(); a; a = tmpAList.next()) { if (mSearchAName->isChecked()) { @@ -548,7 +555,7 @@ void SearchDialog::search(const QRegExp &re) } } - QPtrList journals; + Q3PtrList journals; if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; mMatchedJournals.clear(); diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h index 945ff65..5df6116 100644 --- a/korganizer/searchdialog.h +++ b/korganizer/searchdialog.h @@ -26,8 +26,12 @@ #include #include +//Added by qt3to4: +#include +#include +#include #include -#include +#include #include @@ -41,7 +45,7 @@ class QLabel; class CalendarView; using namespace KCal; -class SearchDialog : public QVBox +class SearchDialog : public Q3VBox { Q_OBJECT public: @@ -72,14 +76,14 @@ class SearchDialog : public QVBox private: - QHBox *incidenceGroup ,*subjectGroup ,*attendeeGroup; + Q3HBox *incidenceGroup ,*subjectGroup ,*attendeeGroup; void search(const QRegExp &); Calendar *mCalendar; - QPtrList mMatchedEvents; - QPtrList mMatchedTodos; - QPtrList mMatchedJournals; + Q3PtrList mMatchedEvents; + Q3PtrList mMatchedTodos; + Q3PtrList mMatchedJournals; QLabel *searchLabel; KLineEdit *searchEdit; diff --git a/korganizer/statusdialog.cpp b/korganizer/statusdialog.cpp index 7137c49..8186ebb 100644 --- a/korganizer/statusdialog.cpp +++ b/korganizer/statusdialog.cpp @@ -21,6 +21,9 @@ #include #include #include +//Added by qt3to4: +#include +#include #include #include @@ -32,11 +35,11 @@ StatusDialog::StatusDialog(QWidget* parent, const char* name) : { setCaption(i18n("Set Your Status")); - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); topLayout->setSpacing( spacingHint() ); topLayout->setMargin( marginHint() ); - QBoxLayout *statusLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *statusLayout = new Q3HBoxLayout( topLayout ); QLabel *text = new QLabel(i18n("Set your status"),this); statusLayout->addWidget( text ); @@ -45,7 +48,7 @@ StatusDialog::StatusDialog(QWidget* parent, const char* name) : mStatus->insertStringList(Attendee::statusList()); statusLayout->addWidget( mStatus ); - QBoxLayout *buttonLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *buttonLayout = new Q3HBoxLayout( topLayout ); QPushButton *ok = new QPushButton(i18n("&OK"), this); connect ( ok,SIGNAL(clicked()), this,SLOT(accept()) ); diff --git a/korganizer/timeline.cpp b/korganizer/timeline.cpp index 11be432..a6c3cdc 100644 --- a/korganizer/timeline.cpp +++ b/korganizer/timeline.cpp @@ -5,13 +5,13 @@ #include "timeline.h" TimeLine::TimeLine( QWidget *parent, const char *name ) : - QScrollView( parent, name ) + Q3ScrollView( parent, name ) { mPixelWidth = 1000; resizeContents( mPixelWidth, 20 ); - viewport()->setBackgroundMode( PaletteBackground ); + viewport()->setBackgroundMode( Qt::PaletteBackground ); setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); @@ -58,5 +58,5 @@ void TimeLine::setDateRange( const QDateTime &start, const QDateTime &end ) void TimeLine::setContentsPos( int pos ) { - QScrollView::setContentsPos ( pos, 0 ); + Q3ScrollView::setContentsPos ( pos, 0 ); } diff --git a/korganizer/timeline.h b/korganizer/timeline.h index ab3e5d3..bf301fa 100644 --- a/korganizer/timeline.h +++ b/korganizer/timeline.h @@ -1,10 +1,10 @@ #ifndef TIMELINE_H #define TIMELINE_H -#include +#include #include -class TimeLine : public QScrollView +class TimeLine : public Q3ScrollView { Q_OBJECT public: diff --git a/korganizer/timespanview.cpp b/korganizer/timespanview.cpp index df8ff88..0908056 100644 --- a/korganizer/timespanview.cpp +++ b/korganizer/timespanview.cpp @@ -4,10 +4,14 @@ #else #include #endif -#include +#include #include -#include +#include #include +//Added by qt3to4: +#include +#include +#include #include #include @@ -21,7 +25,7 @@ TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); #ifndef DESKTOP_VERSION mSplitter = new QKSplitter( this ); #else @@ -29,11 +33,11 @@ TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) : #endif topLayout->addWidget( mSplitter ); - mList = new QListView( mSplitter ); + mList = new Q3ListView( mSplitter ); mList->addColumn( i18n("Summary") ); QWidget *rightPane = new QWidget( mSplitter ); - QBoxLayout *rightPaneLayout = new QVBoxLayout( rightPane ); + Q3BoxLayout *rightPaneLayout = new Q3VBoxLayout( rightPane ); mTimeLine = new TimeLine( rightPane ); mTimeLine->setFixedHeight( mList->header()->height() ); @@ -42,7 +46,7 @@ TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) : mLineView = new LineView( rightPane ); rightPaneLayout->addWidget( mLineView ); - QBoxLayout *buttonLayout = new QHBoxLayout( rightPaneLayout ); + Q3BoxLayout *buttonLayout = new Q3HBoxLayout( rightPaneLayout ); QPushButton *zoomInButton = new QPushButton( i18n("Zoom In"), rightPane ); connect( zoomInButton, SIGNAL( clicked() ), SLOT( zoomIn() ) ); @@ -64,19 +68,19 @@ TimeSpanView::~TimeSpanView() { } -QValueList TimeSpanView::splitterSizes() +Q3ValueList TimeSpanView::splitterSizes() { return mSplitter->sizes(); } -void TimeSpanView::setSplitterSizes( QValueList sizes ) +void TimeSpanView::setSplitterSizes( Q3ValueList sizes ) { mSplitter->setSizes( sizes ); } void TimeSpanView::addItem( KCal::Event *event ) { - new QListViewItem( mList, event->summary() ); + new Q3ListViewItem( mList, event->summary() ); QDateTime startDt = event->dtStart(); QDateTime endDt = event->dtEnd(); diff --git a/korganizer/timespanview.h b/korganizer/timespanview.h index 34cb1f7..f652374 100644 --- a/korganizer/timespanview.h +++ b/korganizer/timespanview.h @@ -2,6 +2,8 @@ #define TIMESPANVIEW_H #include +//Added by qt3to4: +#include #include @@ -12,7 +14,7 @@ class QKSplitter; class QSplitter; #define QKSplitter QSplitter #endif -class QListView; +class Q3ListView; class LineView; class TimeLine; @@ -26,8 +28,8 @@ class TimeSpanView : public QWidget void addItem( KCal::Event * ); - QValueList splitterSizes(); - void setSplitterSizes( QValueList ); + Q3ValueList splitterSizes(); + void setSplitterSizes( Q3ValueList ); void clear(); @@ -48,7 +50,7 @@ class TimeSpanView : public QWidget private: QKSplitter *mSplitter; - QListView *mList; + Q3ListView *mList; TimeLine *mTimeLine; LineView *mLineView; -- cgit v0.9.0.2