author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/calendarview.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-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 @@ -33,20 +33,26 @@ #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 @@ -129,5 +135,5 @@ #include <unistd.h> #else -#include <qprocess.h> +#include <q3process.h> #endif @@ -141,5 +147,5 @@ 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) { @@ -278,11 +284,11 @@ class KOBeamPrefs : public QDialog { 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 ); @@ -313,10 +319,10 @@ class KOCatPrefs : public QDialog { 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 ) ; @@ -374,5 +380,5 @@ void CalendarView::init() flag_clearallviewsupdateView = false; mNextAlarmDateTime = QDateTime::currentDateTime(); - setFocusPolicy (NoFocus ); + setFocusPolicy (Qt::NoFocus ); mViewerCallerIsSearchDialog = false; mBlockShowDates = false; @@ -395,5 +401,5 @@ void CalendarView::init() mNavigator = new DateNavigator( this, "datevav", mViewManager ); - QBoxLayout *topLayout = (QBoxLayout*)layout(); + Q3BoxLayout *topLayout = (Q3BoxLayout*)layout(); #ifndef KORG_NOSPLITTER // create the main layout frames. @@ -426,7 +432,7 @@ 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 ); @@ -455,5 +461,5 @@ void CalendarView::init() 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 )) ); @@ -502,6 +508,6 @@ void CalendarView::init() 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 ); @@ -617,7 +623,7 @@ 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(); @@ -670,5 +676,5 @@ 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 ) { @@ -686,5 +692,5 @@ void CalendarView::nextConflict( bool all, bool allday ) Event * cE = 0; Event * cE2 = 0; - QPtrList<Event> testlist2 = testlist; + Q3PtrList<Event> testlist2 = testlist; test = testlist.first(); bool skip = false; @@ -836,5 +842,5 @@ void CalendarView::checkFiles() { QString message; - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); while ( cal ) { @@ -858,5 +864,5 @@ void CalendarView::checkAlarms() 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 ); @@ -868,6 +874,6 @@ void CalendarView::checkAlarms() 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); @@ -887,7 +893,7 @@ void CalendarView::checkAlarms() } 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 ); @@ -1217,5 +1223,5 @@ void CalendarView::computeAlarm( QString msg ) } #else - QProcess* p = new QProcess(); + Q3Process* p = new Q3Process(); p->addArgument( tempfilename.latin1() ); p->start(); @@ -1267,8 +1273,8 @@ void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) 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(); @@ -1295,8 +1301,8 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) 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(); @@ -1571,5 +1577,5 @@ 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<Event> lastSync , Incidence* toDelete ) +void CalendarView::checkExternSyncEvent( Q3PtrList<Event> lastSync , Incidence* toDelete ) { if ( lastSync.count() == 0 ) { @@ -1601,5 +1607,5 @@ void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* t void CalendarView::checkExternalId( Incidence * inc ) { - QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; + Q3PtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; checkExternSyncEvent( lastSync, inc ); @@ -1625,6 +1631,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int 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(); @@ -1685,8 +1691,8 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int //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!") ); @@ -1832,5 +1838,5 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int inR = er.next(); } - QPtrList<Incidence> el = local->rawIncidences(); + Q3PtrList<Incidence> el = local->rawIncidences(); inL = el.first(); modulo = (el.count()/10)+1; @@ -2049,5 +2055,5 @@ void CalendarView::syncExternal( int mode ) if ( mSyncManager->mWriteBackFile ) { - QPtrList<Incidence> iL = mCalendar->rawIncidences(); + Q3PtrList<Incidence> iL = mCalendar->rawIncidences(); Incidence* inc = iL.first(); if ( phoneFormat ) { @@ -2116,5 +2122,5 @@ bool CalendarView::importBday() ++count; } - QProgressBar bar(count,0 ); + Q3ProgressBar bar(count,0 ); int w = 300; if ( QApplication::desktop()->width() < 320 ) @@ -2187,5 +2193,5 @@ 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 ) @@ -2351,5 +2357,5 @@ void CalendarView::setSyncEventsReadOnly() bool CalendarView::loadCalendars() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); @@ -2365,5 +2371,5 @@ bool CalendarView::loadCalendars() bool CalendarView::restoreCalendarSettings() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); while ( cal ) { @@ -2530,5 +2536,5 @@ void CalendarView::watchSavedFile() bool CalendarView::checkAllFileVersions() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); @@ -2592,5 +2598,5 @@ bool CalendarView::checkFileVersion(QString fn) bool CalendarView::saveCalendars() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); @@ -2696,5 +2702,5 @@ void CalendarView::readSettings() config->setGroup("KOrganizer Geometry"); - QValueList<int> sizes = config->readIntListEntry("Separator1"); + Q3ValueList<int> sizes = config->readIntListEntry("Separator1"); if (sizes.count() != 2) { sizes << mDateNavigator->minimumSizeHint().width(); @@ -2764,5 +2770,5 @@ void CalendarView::readSettings() 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; @@ -2843,5 +2849,5 @@ void CalendarView::writeSettings() 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() ); @@ -2870,7 +2876,7 @@ void CalendarView::writeSettings() #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 @@ -3167,5 +3173,5 @@ void CalendarView::checkConflictForEvent() } } - QPtrList<Event> testlist = mCalendar->events(); + Q3PtrList<Event> testlist = mCalendar->events(); Event * test = testlist.first(); QDateTime conflict; @@ -3429,5 +3435,5 @@ void CalendarView::slotSelectPickerDate( QDate d) void CalendarView::removeCategories() { - QPtrList<Incidence> incList = mCalendar->rawIncidences(); + Q3PtrList<Incidence> incList = mCalendar->rawIncidences(); QStringList catList = KOPrefs::instance()->mCustomCategories; QStringList catIncList; @@ -3450,5 +3456,5 @@ void CalendarView::removeCategories() int CalendarView::addCategories() { - QPtrList<Incidence> incList = mCalendar->rawIncidences(); + Q3PtrList<Incidence> incList = mCalendar->rawIncidences(); QStringList catList = KOPrefs::instance()->mCustomCategories; QStringList catIncList; @@ -3508,5 +3514,5 @@ void CalendarView::manageCategories() void CalendarView::beamIncidence(Incidence * Inc) { - QPtrList<Incidence> delSel ; + Q3PtrList<Incidence> delSel ; delSel.append(Inc); beamIncidenceList( delSel ); @@ -3514,5 +3520,5 @@ void CalendarView::beamIncidence(Incidence * Inc) void CalendarView::beamCalendar() { - QPtrList<Incidence> delSel = mCalendar->rawIncidences(); + Q3PtrList<Incidence> delSel = mCalendar->rawIncidences(); //qDebug("beamCalendar() "); beamIncidenceList( delSel ); @@ -3520,9 +3526,9 @@ void CalendarView::beamCalendar() 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 ) { @@ -4316,5 +4322,5 @@ void CalendarView::schedule_publish(Incidence *incidence) PublishDialog *publishdlg = new PublishDialog(); if (incidence->attendeeCount()>0) { - QPtrList<Attendee> attendees = incidence->attendees(); + Q3PtrList<Attendee> attendees = incidence->attendees(); attendees.first(); while ( attendees.current()!=0 ) { @@ -4725,5 +4731,5 @@ void CalendarView::showDates(const DateList &selectedDates) } -QPtrList<CalFilter> CalendarView::filters() +Q3PtrList<CalFilter> CalendarView::filters() { return mFilters; @@ -4766,5 +4772,5 @@ void CalendarView::showFilter(bool visible) mCalEditView->readConfig(); mCalEditView->show(); - QValueList<int> sizes; + Q3ValueList<int> sizes; sizes = mLeftFrame->sizes(); if ( sizes.count() == 4 && sizes[3] < 20 ) { @@ -4847,5 +4853,5 @@ void CalendarView::takeOverCalendar() 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()); @@ -4854,5 +4860,5 @@ void CalendarView::takeOverCalendar() } - 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()); @@ -4861,5 +4867,5 @@ void CalendarView::takeOverCalendar() } - 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()); @@ -4876,5 +4882,5 @@ void CalendarView::showIntro() } -QWidgetStack *CalendarView::viewStack() +Q3WidgetStack *CalendarView::viewStack() { return mRightFrame; @@ -5061,5 +5067,5 @@ bool CalendarView::removeCompletedSubTodos( Todo* t ) { bool deleteTodo = true; - QPtrList<Incidence> subTodos; + Q3PtrList<Incidence> subTodos; Incidence *aTodo; subTodos = t->relations(); @@ -5087,6 +5093,6 @@ void CalendarView::purgeCompleted() if (result == KMessageBox::Continue) { - QPtrList<Todo> todoCal; - QPtrList<Todo> rootTodos; + Q3PtrList<Todo> todoCal; + Q3PtrList<Todo> rootTodos; //QPtrList<Incidence> rel; Todo *aTodo; |