-rw-r--r-- | korganizer/calendarview.cpp | 148 |
1 files changed, 77 insertions, 71 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8385bcc..c1a2f76 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -29,28 +29,34 @@ */ #include <stdlib.h> #include <qapplication.h> #include <qradiobutton.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qlayout.h> #include <qclipboard.h> #include <qcursor.h> #include <qmessagebox.h> -#include <qprogressbar.h> -#include <qmultilineedit.h> +#include <q3progressbar.h> +#include <q3multilineedit.h> #include <qtimer.h> -#include <qwidgetstack.h> -#include <qptrlist.h> +#include <q3widgetstack.h> +#include <q3ptrlist.h> #include <qregexp.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qfile.h> #include <qdir.h> #ifndef KORG_NOSPLITTER #include <qsplitter.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <QKeyEvent> +#include <Q3Frame> +#include <QLabel> +#include <Q3ValueList> #endif #include <kglobal.h> #include <kdebug.h> #include <kstandarddirs.h> #include <kfiledialog.h> @@ -125,25 +131,25 @@ #endif #ifndef _WIN32_ #include <stdlib.h> #include <stdio.h> #include <unistd.h> #else -#include <qprocess.h> +#include <q3process.h> #endif #ifdef DESKTOP_VERSION #include <kabc/stdaddressbook.h> #endif using namespace KOrg; using namespace KCal; extern int globalFlagBlockAgenda; extern int globalFlagBlockStartup; -MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent) +MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, Q3PtrList<Incidence> alarms,QDateTime start ) : Q3TextBrowser(parent) { mAlarms = alarms; viewport()->setBackgroundColor( QColor( 255, 255, 255 ) ); QString mText = "<table width=\"100%\">\n"; //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; @@ -274,19 +280,19 @@ class KOBeamPrefs : public QDialog { public: KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : 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 ); vcal->setChecked( true ); tz = new QRadioButton(i18n(" With timezone "), time ); local = new QRadioButton(i18n(" Local time "), time ); @@ -309,18 +315,18 @@ class KOCatPrefs : public QDialog { public: KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 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 <b>now</b>:"), 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 ); new QRadioButton(i18n("Remove from Events/Todos"), format ); addCatBut->setChecked( true ); QPushButton * ok = new QPushButton( i18n("Change category list now!"), this ); @@ -370,13 +376,13 @@ void CalendarView::init() flag_blockConflict = false; flag_blockScrollBar = false; flag_checkFileFirsttime = true; flag_clearallviewsEventDisplay = false; flag_clearallviewsupdateView = false; mNextAlarmDateTime = QDateTime::currentDateTime(); - setFocusPolicy (NoFocus ); + setFocusPolicy (Qt::NoFocus ); mViewerCallerIsSearchDialog = false; mBlockShowDates = false; mConflictingEvent = 0; mDatePickerMode = 0; mCurrentSyncDevice = ""; mViewManager = new KOViewManager( this ); @@ -391,13 +397,13 @@ void CalendarView::init() mCalendar->registerObserver( this ); // TODO: Make sure that view is updated, when calendar is changed. 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"); topLayout->addWidget(mPanner); mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, @@ -422,15 +428,15 @@ void CalendarView::init() SLOT( updateView() ) ); } else { mResourceView = 0; } #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; #else //QWidget *mainBox = new QWidget( this ); //QWidget *leftFrame = new QWidget( mainBox ); @@ -451,13 +457,13 @@ void CalendarView::init() mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); } mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); //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 ) mDateScrollBar->hide(); #endif //mainBoxLayout->addWidget (mLeftFrame); @@ -498,14 +504,14 @@ void CalendarView::init() } #endif mFilterView->hide(); 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; if ( KOPrefs::instance()->mVerticalScreen ) { //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); @@ -613,15 +619,15 @@ void CalendarView::init() connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), SLOT( processTodoListSelection( Incidence * ) ) ); connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); // 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")); mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); @@ -666,13 +672,13 @@ CalendarView::~CalendarView() void CalendarView::nextConflict( bool all, bool allday ) { if ( flag_blockConflict ) return; flag_blockConflict = true; - QPtrList<Event> testlist = mCalendar->events(); + Q3PtrList<Event> testlist = mCalendar->events(); Event * test = testlist.first(); while ( test ) { test->setTagged( false ); test = testlist.next(); } QTime st ( 0,0,0); @@ -682,13 +688,13 @@ void CalendarView::nextConflict( bool all, bool allday ) QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); QDateTime conflict; QDateTime retVal; bool found = false; Event * cE = 0; Event * cE2 = 0; - QPtrList<Event> testlist2 = testlist; + Q3PtrList<Event> testlist2 = testlist; test = testlist.first(); bool skip = false; topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); //QTime tm; //tm.start(); while ( test ) { @@ -832,13 +838,13 @@ void CalendarView::updateView(const QDate &start, const QDate &end) void CalendarView::checkFiles() { QString message; - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); while ( cal ) { if ( cal->mErrorOnLoad ) { message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; } cal = calendars.next(); @@ -854,24 +860,24 @@ void CalendarView::checkFiles() } 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() ); int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; //qDebug("KO: Reading program stop %d ", secs); //secs -= ( 3600 * 24*3 ); // debug only QDateTime latest = dt.addSecs ( secs ); qDebug("KO: Last termination on %s ", latest.toString().latin1()); //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); - QPtrList<Incidence> el = mCalendar->rawIncidences(); - QPtrList<Incidence> al; + Q3PtrList<Incidence> el = mCalendar->rawIncidences(); + Q3PtrList<Incidence> al; Incidence* inL = el.first(); QDateTime cur = QDateTime::currentDateTime().addSecs(-59); qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); while ( inL ) { bool ok = false; int offset = 0; @@ -883,15 +889,15 @@ void CalendarView::checkAlarms() //qDebug("found missed alarm: %s ", inL->summary().latin1() ); } } 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 ); connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); lay->addWidget( matb ); if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { @@ -1213,13 +1219,13 @@ void CalendarView::computeAlarm( QString msg ) #ifndef _WIN32_ if ( vfork () == 0 ) { execl ( tempfilename.latin1(), 0 ); return; } #else - QProcess* p = new QProcess(); + Q3Process* p = new Q3Process(); p->addArgument( tempfilename.latin1() ); p->start(); return; #endif return; @@ -1263,16 +1269,16 @@ void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) #ifdef DESKTOP_VERSION if ( QApplication::desktop()->width() < 1024 ) { QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti; //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(); } } #endif @@ -1291,16 +1297,16 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) #ifdef DESKTOP_VERSION if ( QApplication::desktop()->width() < 1024 ) { QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti; //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(); } } #endif int maxSec; @@ -1567,13 +1573,13 @@ Event* CalendarView::getLastSyncEvent() return lse; } // 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<Event> lastSync , Incidence* toDelete ) +void CalendarView::checkExternSyncEvent( Q3PtrList<Event> lastSync , Incidence* toDelete ) { if ( lastSync.count() == 0 ) { //qDebug(" lastSync.count() == 0"); return; } if ( toDelete->typeID() == journalID ) @@ -1597,13 +1603,13 @@ void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* t eve = lastSync.next(); } } void CalendarView::checkExternalId( Incidence * inc ) { - QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; + Q3PtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; checkExternSyncEvent( lastSync, inc ); } // SSSSSSSSSSSSSSSSSSSSSS bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) { @@ -1621,14 +1627,14 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int Event* eventR; QString uid; int take; Event* eventRSync; Event* eventLSync; clearAllViews(); - QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); - QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); + Q3PtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); + Q3PtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); bool fullDateRange = false; local->resetTempSyncStat(); mLastCalendarSync = QDateTime::currentDateTime(); if ( mSyncManager->syncWithDesktop() ) { remote->resetPilotStat(1); if ( KSyncManager::mRequestedSyncEvent.isValid() ) { @@ -1681,16 +1687,16 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int if ( mCurrentSyncDevice == "deleteaftersync" ) { mLastCalendarSync = loadedFileVersion; //qDebug("setting mLastCalendarSync "); } //qDebug("*************************** "); qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); - QPtrList<Incidence> er = remote->rawIncidences(); + Q3PtrList<Incidence> 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 ************* CalFilter *filterIN = 0; CalFilter *filterOUT = 0; CalFilter *filter = mFilters.first(); @@ -1828,13 +1834,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int ++filteredIN; } } } inR = er.next(); } - QPtrList<Incidence> el = local->rawIncidences(); + Q3PtrList<Incidence> el = local->rawIncidences(); inL = el.first(); modulo = (el.count()/10)+1; bar.setCaption (i18n("Add / remove events") ); bar.setTotalSteps ( el.count() ) ; bar.show(); incCounter = 0; @@ -2045,13 +2051,13 @@ void CalendarView::syncExternal( int mode ) syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); getEventViewerDialog()->setSyncMode( false ); qApp->processEvents(); if ( syncOK ) { if ( mSyncManager->mWriteBackFile ) { - QPtrList<Incidence> iL = mCalendar->rawIncidences(); + Q3PtrList<Incidence> iL = mCalendar->rawIncidences(); Incidence* inc = iL.first(); if ( phoneFormat ) { while ( inc ) { inc->removeID(mCurrentSyncDevice); inc = iL.next(); } @@ -2112,13 +2118,13 @@ bool CalendarView::importBday() KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); KABC::AddressBook::Iterator it; int count = 0; 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; int h = bar.sizeHint().height() ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); @@ -2183,13 +2189,13 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd int count = birthdayList.count(); int addCount = 0; KCal::Attendee* a = 0; //qDebug("CalView 1 %i", count); - QProgressBar bar(count,0 ); + Q3ProgressBar bar(count,0 ); int w = 300; if ( QApplication::desktop()->width() < 320 ) w = 220; int h = bar.sizeHint().height() ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); @@ -2347,13 +2353,13 @@ void CalendarView::setSyncEventsReadOnly() { mCalendar->setSyncEventsReadOnly(); } bool CalendarView::loadCalendars() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); openCalendar( MainWindow::defaultFileName(), false ); cal = calendars.next(); while ( cal ) { addCalendar( cal ); @@ -2361,13 +2367,13 @@ bool CalendarView::loadCalendars() } restoreCalendarSettings(); return true; } bool CalendarView::restoreCalendarSettings() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); while ( cal ) { mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); if ( cal->isStandard ) @@ -2526,13 +2532,13 @@ void CalendarView::watchSavedFile() return; } loadedFileVersion = dt; } bool CalendarView::checkAllFileVersions() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); mCalendar->setDefaultCalendarEnabledOnly(); if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { if ( !checkFileVersion(MainWindow::defaultFileName())) { restoreCalendarSettings(); @@ -2588,13 +2594,13 @@ bool CalendarView::checkFileVersion(QString fn) if ( e ) mCalendar->deleteEvent( e ); return true; } bool CalendarView::saveCalendars() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); mCalendar->setDefaultCalendarEnabledOnly(); QString saveError; if ( !saveCalendar( MainWindow::defaultFileName() ) ) saveError = cal->mName +"\n"; @@ -2692,13 +2698,13 @@ void CalendarView::readSettings() // read settings from the KConfig, supplying reasonable // defaults where none are to be found KConfig *config = KOGlobals::config(); #ifndef KORG_NOSPLITTER config->setGroup("KOrganizer Geometry"); - QValueList<int> sizes = config->readIntListEntry("Separator1"); + Q3ValueList<int> sizes = config->readIntListEntry("Separator1"); if (sizes.count() != 2) { sizes << mDateNavigator->minimumSizeHint().width(); sizes << 300; } mPanner->setSizes(sizes); @@ -2760,13 +2766,13 @@ void CalendarView::readSettings() getEventViewerDialog()->setGeometry(x,y,w,h); } #endif config->setGroup( "Views" ); int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); - QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); + Q3ValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); int resetval = 0; int maxVal = 0; if (sizes.count() != 3) { if ( KOPrefs::instance()->mVerticalScreen ) { resetval = mDateNavigator->sizeHint().width()+2; @@ -2839,13 +2845,13 @@ void CalendarView::writeSettings() //KOPrefs::instance()->usrWriteConfig(); KOPrefs::instance()->writeConfig(); 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 ); config->writeEntry( "LatestProgramStopSecs", secs ); //qDebug("KO: Writing stop time: %d ", secs); //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); @@ -2866,15 +2872,15 @@ void CalendarView::writeSettings() qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); qDebug("********************* testcode end"); #endif - QValueList<int> listINT = mLeftFrame->sizes(); + Q3ValueList<int> listINT = mLeftFrame->sizes(); config->writeEntry("Left Splitter Frame",listINT); - QValueList<int> listINT2 = mMainFrame->sizes(); + Q3ValueList<int> listINT2 = mMainFrame->sizes(); config->writeEntry("Main Splitter Frame",listINT2); #ifdef DESKTOP_VERSION config->setGroup("WidgetLayout"); QStringList list ;//= config->readListEntry("MainLayout"); int x,y,w,h; QWidget* wid; @@ -3163,13 +3169,13 @@ void CalendarView::checkConflictForEvent() } if ( filterIN ) { if ( !filterIN->filterCalendarItem( conflictingEvent ) ) { return; } } - QPtrList<Event> testlist = mCalendar->events(); + Q3PtrList<Event> testlist = mCalendar->events(); Event * test = testlist.first(); QDateTime conflict; QDateTime retVal; bool found = false; Event * cE = 0; bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay; @@ -3425,13 +3431,13 @@ void CalendarView::slotSelectPickerDate( QDate d) mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); } } void CalendarView::removeCategories() { - QPtrList<Incidence> incList = mCalendar->rawIncidences(); + Q3PtrList<Incidence> incList = mCalendar->rawIncidences(); QStringList catList = KOPrefs::instance()->mCustomCategories; QStringList catIncList; QStringList newCatList; Incidence* inc = incList.first(); uint i; while ( inc ) { @@ -3446,13 +3452,13 @@ void CalendarView::removeCategories() inc = incList.next(); } } int CalendarView::addCategories() { - QPtrList<Incidence> incList = mCalendar->rawIncidences(); + Q3PtrList<Incidence> incList = mCalendar->rawIncidences(); QStringList catList = KOPrefs::instance()->mCustomCategories; QStringList catIncList; Incidence* inc = incList.first(); uint i; int count = 0; while ( inc ) { @@ -3504,29 +3510,29 @@ void CalendarView::manageCategories() } delete cp; } void CalendarView::beamIncidence(Incidence * Inc) { - QPtrList<Incidence> delSel ; + Q3PtrList<Incidence> delSel ; delSel.append(Inc); beamIncidenceList( delSel ); } void CalendarView::beamCalendar() { - QPtrList<Incidence> delSel = mCalendar->rawIncidences(); + Q3PtrList<Incidence> delSel = mCalendar->rawIncidences(); //qDebug("beamCalendar() "); beamIncidenceList( delSel ); } void CalendarView::beamFilteredCalendar() { - QPtrList<Incidence> delSel = mCalendar->incidences(); + Q3PtrList<Incidence> delSel = mCalendar->incidences(); //qDebug("beamFilteredCalendar() "); beamIncidenceList( delSel ); } -void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) +void CalendarView::beamIncidenceList(Q3PtrList<Incidence> delSel ) { KOBeamPrefs beamDialog; if ( beamDialog.exec () == QDialog::Rejected ) return; #ifdef DESKTOP_VERSION @@ -4312,13 +4318,13 @@ void CalendarView::schedule_publish(Incidence *incidence) KMessageBox::sorry(this,i18n("No event selected.")); return; } PublishDialog *publishdlg = new PublishDialog(); if (incidence->attendeeCount()>0) { - QPtrList<Attendee> attendees = incidence->attendees(); + Q3PtrList<Attendee> attendees = incidence->attendees(); attendees.first(); while ( attendees.current()!=0 ) { publishdlg->addAttendee(attendees.current()); attendees.next(); } } @@ -4721,13 +4727,13 @@ void CalendarView::showDates(const DateList &selectedDates) } } topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); } -QPtrList<CalFilter> CalendarView::filters() +Q3PtrList<CalFilter> CalendarView::filters() { return mFilters; } void CalendarView::editFilters() { @@ -4762,13 +4768,13 @@ void CalendarView::selectFilter( int fil ) void CalendarView::showFilter(bool visible) { #if 1 if (visible) { mCalEditView->readConfig(); mCalEditView->show(); - QValueList<int> sizes; + Q3ValueList<int> sizes; sizes = mLeftFrame->sizes(); if ( sizes.count() == 4 && sizes[3] < 20 ) { sizes.clear(); sizes << 100; sizes << 0; sizes << 0; @@ -4843,27 +4849,27 @@ void CalendarView::takeOverEvent() void CalendarView::takeOverCalendar() { // TODO: Create Calendar::allIncidences() function and use it here clearAllViews(); - QPtrList<Event> events = mCalendar->events(); + Q3PtrList<Event> events = mCalendar->events(); for(uint i=0; i<events.count(); ++i) { events.at(i)->setOrganizer(KOPrefs::instance()->email()); events.at(i)->recreate(); events.at(i)->setReadOnly(false); } - QPtrList<Todo> todos = mCalendar->todos(); + Q3PtrList<Todo> todos = mCalendar->todos(); for(uint i=0; i<todos.count(); ++i) { todos.at(i)->setOrganizer(KOPrefs::instance()->email()); todos.at(i)->recreate(); todos.at(i)->setReadOnly(false); } - QPtrList<Journal> journals = mCalendar->journals(); + Q3PtrList<Journal> journals = mCalendar->journals(); for(uint i=0; i<journals.count(); ++i) { journals.at(i)->setOrganizer(KOPrefs::instance()->email()); journals.at(i)->recreate(); journals.at(i)->setReadOnly(false); } @@ -4872,13 +4878,13 @@ void CalendarView::takeOverCalendar() void CalendarView::showIntro() { kdDebug() << "To be implemented." << endl; } -QWidgetStack *CalendarView::viewStack() +Q3WidgetStack *CalendarView::viewStack() { return mRightFrame; } QWidget *CalendarView::leftFrame() { @@ -5057,13 +5063,13 @@ void CalendarView::lookForIncomingMessages() icd->retrieve(); } bool CalendarView::removeCompletedSubTodos( Todo* t ) { bool deleteTodo = true; - QPtrList<Incidence> subTodos; + Q3PtrList<Incidence> subTodos; Incidence *aTodo; subTodos = t->relations(); for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { if (! removeCompletedSubTodos( (Todo*) aTodo )) deleteTodo = false; } @@ -5083,14 +5089,14 @@ void CalendarView::purgeCompleted() { int result = KMessageBox::warningContinueCancel(this, i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); if (result == KMessageBox::Continue) { - QPtrList<Todo> todoCal; - QPtrList<Todo> rootTodos; + Q3PtrList<Todo> todoCal; + Q3PtrList<Todo> rootTodos; //QPtrList<Incidence> rel; Todo *aTodo; todoCal = calendar()->todos(); for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { if ( !aTodo->relatedTo() ) rootTodos.append( aTodo ); |