-rw-r--r-- | korganizer/kolistview.cpp | 193 |
1 files changed, 101 insertions, 92 deletions
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 @@ | |||
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qlistview.h> | 25 | #include <q3listview.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qpopupmenu.h> | 28 | #include <q3popupmenu.h> |
29 | #include <qprogressbar.h> | 29 | #include <q3progressbar.h> |
30 | #include <qfileinfo.h> | 30 | #include <qfileinfo.h> |
31 | #include <qmessagebox.h> | 31 | #include <qmessagebox.h> |
32 | #include <qdialog.h> | 32 | #include <qdialog.h> |
33 | #include <qtextstream.h> | 33 | #include <q3textstream.h> |
34 | #include <qdir.h> | 34 | #include <qdir.h> |
35 | #include <qwhatsthis.h> | 35 | #include <q3whatsthis.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | #include <qpainter.h> | 37 | #include <qpainter.h> |
38 | #include <qpaintdevicemetrics.h> | 38 | #include <q3paintdevicemetrics.h> |
39 | //Added by qt3to4: | ||
40 | #include <QPixmap> | ||
41 | #include <QMouseEvent> | ||
42 | #include <QKeyEvent> | ||
43 | #include <QEvent> | ||
44 | #include <Q3VBoxLayout> | ||
45 | #include <Q3PtrList> | ||
46 | |||
47 | #include<QDesktopWidget> | ||
39 | 48 | ||
40 | #include <klocale.h> | 49 | #include <klocale.h> |
41 | #include <kdebug.h> | 50 | #include <kdebug.h> |
@@ -70,10 +79,10 @@ | |||
70 | extern QPixmap* sgListViewCompletedPix[6]; | 79 | extern QPixmap* sgListViewCompletedPix[6]; |
71 | extern QPixmap* sgListViewJournalPix; | 80 | extern QPixmap* sgListViewJournalPix; |
72 | 81 | ||
73 | class KOListViewWhatsThis :public QWhatsThis | 82 | class KOListViewWhatsThis :public Q3WhatsThis |
74 | { | 83 | { |
75 | public: | 84 | public: |
76 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | 85 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : Q3WhatsThis( wid ), _wid(wid),_view (view) { }; |
77 | 86 | ||
78 | protected: | 87 | protected: |
79 | virtual QString text( const QPoint& p) | 88 | virtual QString text( const QPoint& p) |
@@ -274,29 +283,29 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
274 | mListView->addColumn(i18n("Calendar")); | 283 | mListView->addColumn(i18n("Calendar")); |
275 | mListView->addColumn(i18n("Last Modified")); | 284 | mListView->addColumn(i18n("Last Modified")); |
276 | 285 | ||
277 | mListView->setColumnAlignment(0,AlignLeft); | 286 | mListView->setColumnAlignment(0,Qt::AlignLeft); |
278 | mListView->setColumnAlignment(1,AlignLeft); | 287 | mListView->setColumnAlignment(1,Qt::AlignLeft); |
279 | mListView->setColumnAlignment(2,AlignHCenter); | 288 | mListView->setColumnAlignment(2,Qt::AlignHCenter); |
280 | mListView->setColumnAlignment(3,AlignLeft); | 289 | mListView->setColumnAlignment(3,Qt::AlignLeft); |
281 | mListView->setColumnAlignment(4,AlignHCenter); | 290 | mListView->setColumnAlignment(4,Qt::AlignHCenter); |
282 | mListView->setColumnAlignment(5,AlignLeft); | 291 | mListView->setColumnAlignment(5,Qt::AlignLeft); |
283 | mListView->setColumnAlignment(6,AlignLeft); | 292 | mListView->setColumnAlignment(6,Qt::AlignLeft); |
284 | mListView->setColumnAlignment(7,AlignLeft); | 293 | mListView->setColumnAlignment(7,Qt::AlignLeft); |
285 | mListView->setColumnAlignment(8,AlignLeft); | 294 | mListView->setColumnAlignment(8,Qt::AlignLeft); |
286 | mListView->setColumnAlignment(9,AlignLeft); | 295 | mListView->setColumnAlignment(9,Qt::AlignLeft); |
287 | mListView->setColumnAlignment(10,AlignLeft); | 296 | mListView->setColumnAlignment(10,Qt::AlignLeft); |
288 | mListView->setColumnAlignment(11,AlignLeft); | 297 | mListView->setColumnAlignment(11,Qt::AlignLeft); |
289 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); | 298 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); |
290 | 299 | ||
291 | int iii = 0; | 300 | int iii = 0; |
292 | for ( iii = 0; iii< 12 ; ++iii ) | 301 | for ( iii = 0; iii< 12 ; ++iii ) |
293 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 302 | mListView->setColumnWidthMode( iii, Q3ListView::Manual ); |
294 | 303 | ||
295 | QBoxLayout *layoutTop = new QVBoxLayout(this); | 304 | Q3BoxLayout *layoutTop = new Q3VBoxLayout(this); |
296 | layoutTop->addWidget(mListView); | 305 | layoutTop->addWidget(mListView); |
297 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 306 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
298 | mPopupMenu = eventPopup(); | 307 | mPopupMenu = eventPopup(); |
299 | QPopupMenu* selPopup = new QPopupMenu ( this ); | 308 | Q3PopupMenu* selPopup = new Q3PopupMenu ( this ); |
300 | mPopupMenu->insertSeparator(); | 309 | mPopupMenu->insertSeparator(); |
301 | 310 | ||
302 | selPopup->insertItem(i18n("All"),this, | 311 | selPopup->insertItem(i18n("All"),this, |
@@ -306,20 +315,20 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
306 | selPopup->insertItem(i18n("Delete selected..."),this, | 315 | selPopup->insertItem(i18n("Delete selected..."),this, |
307 | SLOT(deleteAll())); | 316 | SLOT(deleteAll())); |
308 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); | 317 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); |
309 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 318 | mPopupMenu->addAdditionalItem(QIcon(QPixmap()), |
310 | i18n("Hide all selected"),this, | 319 | i18n("Hide all selected"),this, |
311 | SLOT(hideAll()),true); | 320 | SLOT(hideAll()),true); |
312 | 321 | ||
313 | selPopup->insertSeparator(); | 322 | selPopup->insertSeparator(); |
314 | QPopupMenu * exportPO = new QPopupMenu ( this ); | 323 | Q3PopupMenu * exportPO = new Q3PopupMenu ( this ); |
315 | selPopup->insertItem( i18n("Export"), exportPO ); | 324 | selPopup->insertItem( i18n("Export"), exportPO ); |
316 | #ifdef DESKTOP_VERSION | 325 | #ifdef DESKTOP_VERSION |
317 | mPopupMenu->insertSeparator(); | 326 | mPopupMenu->insertSeparator(); |
318 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 327 | mPopupMenu->addAdditionalItem(QIcon(QPixmap()), |
319 | i18n("Print complete list..."),this, | 328 | i18n("Print complete list..."),this, |
320 | SLOT(printList()),true); | 329 | SLOT(printList()),true); |
321 | #endif | 330 | #endif |
322 | mCalPopup = new QPopupMenu ( this ); | 331 | mCalPopup = new Q3PopupMenu ( this ); |
323 | selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); | 332 | selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); |
324 | 333 | ||
325 | selPopup->insertItem(i18n("Set categories")+"...",this, | 334 | selPopup->insertItem(i18n("Set categories")+"...",this, |
@@ -327,10 +336,10 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
327 | selPopup->insertItem( i18n("Set alarm..."),this, | 336 | selPopup->insertItem( i18n("Set alarm..."),this, |
328 | SLOT(setAlarm())); | 337 | SLOT(setAlarm())); |
329 | #if 0 | 338 | #if 0 |
330 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 339 | mPopupMenu->addAdditionalItem(QIcon(QPixmap()), |
331 | i18n("Set categories")+"...",this, | 340 | i18n("Set categories")+"...",this, |
332 | SLOT(setCat()),true); | 341 | SLOT(setCat()),true); |
333 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 342 | mPopupMenu->addAdditionalItem(QIcon(QPixmap()), |
334 | i18n("Set alarm..."),this, | 343 | i18n("Set alarm..."),this, |
335 | SLOT(setAlarm()),true); | 344 | SLOT(setAlarm()),true); |
336 | #endif | 345 | #endif |
@@ -356,7 +365,7 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
356 | selPopup->insertItem( i18n("Beam via IR..."),this, | 365 | selPopup->insertItem( i18n("Beam via IR..."),this, |
357 | SLOT(beamSelected())); | 366 | SLOT(beamSelected())); |
358 | #if 0 | 367 | #if 0 |
359 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 368 | mPopupMenu->addAdditionalItem(QIcon(QPixmap()), |
360 | i18n("Beam via IR"),this, | 369 | i18n("Beam via IR"),this, |
361 | SLOT(beamSelected()),true); | 370 | SLOT(beamSelected()),true); |
362 | #endif | 371 | #endif |
@@ -375,13 +384,13 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
375 | */ | 384 | */ |
376 | QObject::connect(mListView,SIGNAL( newEvent()), | 385 | QObject::connect(mListView,SIGNAL( newEvent()), |
377 | this,SIGNAL(signalNewEvent())); | 386 | this,SIGNAL(signalNewEvent())); |
378 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), | 387 | QObject::connect(mListView,SIGNAL(doubleClicked(Q3ListViewItem *)), |
379 | this,SLOT(defaultItemAction(QListViewItem *))); | 388 | this,SLOT(defaultItemAction(Q3ListViewItem *))); |
380 | QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, | 389 | QObject::connect(mListView,SIGNAL(rightButtonPressed( Q3ListViewItem *, |
381 | const QPoint &, int )), | 390 | const QPoint &, int )), |
382 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); | 391 | this,SLOT(popupMenu(Q3ListViewItem *,const QPoint &,int))); |
383 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), | 392 | QObject::connect(mListView,SIGNAL(currentChanged(Q3ListViewItem *)), |
384 | SLOT(processSelectionChange(QListViewItem *))); | 393 | SLOT(processSelectionChange(Q3ListViewItem *))); |
385 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), | 394 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), |
386 | SIGNAL(showIncidenceSignal(Incidence *)) ); | 395 | SIGNAL(showIncidenceSignal(Incidence *)) ); |
387 | 396 | ||
@@ -428,7 +437,7 @@ void KOListView::setCalendar( int c ) | |||
428 | return; | 437 | return; |
429 | } | 438 | } |
430 | 439 | ||
431 | QPtrList<Incidence> delSel = getSelectedIncidences() ; | 440 | Q3PtrList<Incidence> delSel = getSelectedIncidences() ; |
432 | int icount = delSel.count(); | 441 | int icount = delSel.count(); |
433 | if ( icount ) { | 442 | if ( icount ) { |
434 | Incidence *incidence = delSel.first(); | 443 | Incidence *incidence = delSel.first(); |
@@ -442,7 +451,7 @@ void KOListView::setCalendar( int c ) | |||
442 | incidence = delSel.next(); | 451 | incidence = delSel.next(); |
443 | } | 452 | } |
444 | } | 453 | } |
445 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 454 | Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
446 | KopiCalendarFile * cal = calendars.first(); | 455 | KopiCalendarFile * cal = calendars.first(); |
447 | while ( cal ) { | 456 | while ( cal ) { |
448 | mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); | 457 | mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); |
@@ -497,7 +506,7 @@ void KOListView::setAlarm() | |||
497 | KOAlarmPrefs kap( this); | 506 | KOAlarmPrefs kap( this); |
498 | if ( !kap.exec() ) | 507 | if ( !kap.exec() ) |
499 | return; | 508 | return; |
500 | QPtrList<Incidence> delSel = getSelectedIncidences( true, true, false, true ); // no journals, only due todos | 509 | Q3PtrList<Incidence> delSel = getSelectedIncidences( true, true, false, true ); // no journals, only due todos |
501 | Incidence* inc = delSel.first(); | 510 | Incidence* inc = delSel.first(); |
502 | int count = 0; | 511 | int count = 0; |
503 | while ( inc ) { | 512 | while ( inc ) { |
@@ -522,7 +531,7 @@ void KOListView::setAlarm() | |||
522 | else | 531 | else |
523 | alarm->setType(Alarm::Invalid); | 532 | alarm->setType(Alarm::Invalid); |
524 | } else { | 533 | } else { |
525 | QPtrList<Alarm> alarms = inc->alarms(); | 534 | Q3PtrList<Alarm> alarms = inc->alarms(); |
526 | Alarm *alarm; | 535 | Alarm *alarm; |
527 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 536 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
528 | alarm->setEnabled(false); | 537 | alarm->setEnabled(false); |
@@ -552,7 +561,7 @@ void KOListView::setCategories( bool removeOld ) | |||
552 | } | 561 | } |
553 | QStringList catList = csd->selectedCategories(); | 562 | QStringList catList = csd->selectedCategories(); |
554 | delete csd; | 563 | delete csd; |
555 | QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; | 564 | Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; |
556 | Incidence* inc = delSel.first(); | 565 | Incidence* inc = delSel.first(); |
557 | while ( inc ) { | 566 | while ( inc ) { |
558 | if ( removeOld ) { | 567 | if ( removeOld ) { |
@@ -572,7 +581,7 @@ void KOListView::setCategories( bool removeOld ) | |||
572 | 581 | ||
573 | void KOListView::beamSelected() | 582 | void KOListView::beamSelected() |
574 | { | 583 | { |
575 | QPtrList<Incidence> delSel = getSelectedIncidences() ; | 584 | Q3PtrList<Incidence> delSel = getSelectedIncidences() ; |
576 | if ( delSel.count() ) | 585 | if ( delSel.count() ) |
577 | emit beamIncidenceList( delSel ); | 586 | emit beamIncidenceList( delSel ); |
578 | } | 587 | } |
@@ -587,7 +596,7 @@ void KOListView::saveDescriptionToFile() | |||
587 | if ( result != 0 ) { | 596 | if ( result != 0 ) { |
588 | return; | 597 | return; |
589 | } | 598 | } |
590 | QPtrList<Incidence> delSel = getSelectedIncidences() ; | 599 | Q3PtrList<Incidence> delSel = getSelectedIncidences() ; |
591 | int icount = delSel.count(); | 600 | int icount = delSel.count(); |
592 | if ( icount ) { | 601 | if ( icount ) { |
593 | QString fn = KOPrefs::instance()->mLastSaveFile; | 602 | QString fn = KOPrefs::instance()->mLastSaveFile; |
@@ -645,11 +654,11 @@ void KOListView::saveDescriptionToFile() | |||
645 | incidence = delSel.next(); | 654 | incidence = delSel.next(); |
646 | } | 655 | } |
647 | QFile file( fn ); | 656 | QFile file( fn ); |
648 | if (!file.open( IO_WriteOnly ) ) { | 657 | if (!file.open( QIODevice::WriteOnly ) ) { |
649 | topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); | 658 | topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); |
650 | return; | 659 | return; |
651 | } | 660 | } |
652 | QTextStream ts( &file ); | 661 | Q3TextStream ts( &file ); |
653 | ts << text; | 662 | ts << text; |
654 | file.close(); | 663 | file.close(); |
655 | //qDebug("%s ", text.latin1()); | 664 | //qDebug("%s ", text.latin1()); |
@@ -667,12 +676,12 @@ void KOListView::saveToFile() | |||
667 | { | 676 | { |
668 | writeToFile( true ); | 677 | writeToFile( true ); |
669 | } | 678 | } |
670 | QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool includeTodos, bool includeJournals, bool onlyDueTodos ) | 679 | Q3PtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool includeTodos, bool includeJournals, bool onlyDueTodos ) |
671 | { | 680 | { |
672 | QPtrList<Incidence> delSel ; | 681 | Q3PtrList<Incidence> delSel ; |
673 | bool addSubTodos = false; | 682 | bool addSubTodos = false; |
674 | bool askSubTodos = true; | 683 | bool askSubTodos = true; |
675 | QListViewItem *item = mListView->firstChild (); | 684 | Q3ListViewItem *item = mListView->firstChild (); |
676 | while ( item ) { | 685 | while ( item ) { |
677 | if ( item->isSelected() ) { | 686 | if ( item->isSelected() ) { |
678 | Incidence* inc = ((KOListViewItem *)item)->data(); | 687 | Incidence* inc = ((KOListViewItem *)item)->data(); |
@@ -706,7 +715,7 @@ QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool | |||
706 | askSubTodos = false; | 715 | askSubTodos = false; |
707 | } | 716 | } |
708 | if ( addSubTodos ) { | 717 | if ( addSubTodos ) { |
709 | QPtrList<Incidence> tempSel ; | 718 | Q3PtrList<Incidence> tempSel ; |
710 | inc->addRelationsToList( &tempSel ); | 719 | inc->addRelationsToList( &tempSel ); |
711 | Incidence* tempinc = tempSel.first(); | 720 | Incidence* tempinc = tempSel.first(); |
712 | while ( tempinc ) { | 721 | while ( tempinc ) { |
@@ -730,7 +739,7 @@ QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool | |||
730 | 739 | ||
731 | void KOListView::writeToFile( bool iCal ) | 740 | void KOListView::writeToFile( bool iCal ) |
732 | { | 741 | { |
733 | QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; | 742 | Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; |
734 | if ( !iCal ) { | 743 | if ( !iCal ) { |
735 | bool journal = false; | 744 | bool journal = false; |
736 | Incidence *incidence = delSel.first(); | 745 | Incidence *incidence = delSel.first(); |
@@ -803,8 +812,8 @@ void KOListView::writeToFile( bool iCal ) | |||
803 | } | 812 | } |
804 | void KOListView::hideAll() | 813 | void KOListView::hideAll() |
805 | { | 814 | { |
806 | QPtrList<QListViewItem> delSel ; | 815 | Q3PtrList<Q3ListViewItem> delSel ; |
807 | QListViewItem *item = mListView->firstChild (); | 816 | Q3ListViewItem *item = mListView->firstChild (); |
808 | while ( item ) { | 817 | while ( item ) { |
809 | if ( item->isSelected() ) { | 818 | if ( item->isSelected() ) { |
810 | delSel.append(item); | 819 | delSel.append(item); |
@@ -813,7 +822,7 @@ void KOListView::hideAll() | |||
813 | } | 822 | } |
814 | item = delSel.first() ; | 823 | item = delSel.first() ; |
815 | while ( item ) { | 824 | while ( item ) { |
816 | QListViewItem * del = item; | 825 | Q3ListViewItem * del = item; |
817 | item = delSel.next(); | 826 | item = delSel.next(); |
818 | delete del; | 827 | delete del; |
819 | } | 828 | } |
@@ -824,7 +833,7 @@ void KOListView::printList() | |||
824 | } | 833 | } |
825 | void KOListView::deleteAll() | 834 | void KOListView::deleteAll() |
826 | { | 835 | { |
827 | QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;; | 836 | Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;; |
828 | if ( delSel.count() ) { | 837 | if ( delSel.count() ) { |
829 | int icount = delSel.count(); | 838 | int icount = delSel.count(); |
830 | Incidence *incidence = delSel.first(); | 839 | Incidence *incidence = delSel.first(); |
@@ -838,11 +847,11 @@ void KOListView::deleteAll() | |||
838 | int delCounter = 0; | 847 | int delCounter = 0; |
839 | QDialog dia ( this, "p-dialog", true ); | 848 | QDialog dia ( this, "p-dialog", true ); |
840 | QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); | 849 | QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); |
841 | QVBoxLayout lay( &dia ); | 850 | Q3VBoxLayout lay( &dia ); |
842 | lay.setMargin(7); | 851 | lay.setMargin(7); |
843 | lay.setSpacing(7); | 852 | lay.setSpacing(7); |
844 | lay.addWidget( &lab); | 853 | lay.addWidget( &lab); |
845 | QProgressBar bar( icount, &dia ); | 854 | Q3ProgressBar bar( icount, &dia ); |
846 | lay.addWidget( &bar); | 855 | lay.addWidget( &bar); |
847 | int w = 220; | 856 | int w = 220; |
848 | int h = 50; | 857 | int h = 50; |
@@ -884,10 +893,10 @@ int KOListView::currentDateCount() | |||
884 | return 0; | 893 | return 0; |
885 | } | 894 | } |
886 | 895 | ||
887 | QPtrList<Incidence> KOListView::selectedIncidences() | 896 | Q3PtrList<Incidence> KOListView::selectedIncidences() |
888 | { | 897 | { |
889 | QPtrList<Incidence> eventList; | 898 | Q3PtrList<Incidence> eventList; |
890 | QListViewItem *item = mListView->firstChild (); | 899 | Q3ListViewItem *item = mListView->firstChild (); |
891 | while ( item ) { | 900 | while ( item ) { |
892 | if ( item->isSelected() ) { | 901 | if ( item->isSelected() ) { |
893 | eventList.append(((KOListViewItem *)item)->data()); | 902 | eventList.append(((KOListViewItem *)item)->data()); |
@@ -987,7 +996,7 @@ void KOListView::showDates(const QDate &start, const QDate &end) | |||
987 | 996 | ||
988 | } | 997 | } |
989 | 998 | ||
990 | void KOListView::addEvents(QPtrList<Event> eventList) | 999 | void KOListView::addEvents(Q3PtrList<Event> eventList) |
991 | { | 1000 | { |
992 | 1001 | ||
993 | Event *ev; | 1002 | Event *ev; |
@@ -999,7 +1008,7 @@ void KOListView::addEvents(QPtrList<Event> eventList) | |||
999 | } | 1008 | } |
1000 | } | 1009 | } |
1001 | 1010 | ||
1002 | void KOListView::addTodos(QPtrList<Todo> eventList) | 1011 | void KOListView::addTodos(Q3PtrList<Todo> eventList) |
1003 | { | 1012 | { |
1004 | Todo *ev; | 1013 | Todo *ev; |
1005 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 1014 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
@@ -1009,7 +1018,7 @@ void KOListView::addTodos(QPtrList<Todo> eventList) | |||
1009 | updateView(); | 1018 | updateView(); |
1010 | } | 1019 | } |
1011 | } | 1020 | } |
1012 | void KOListView::addJournals(QPtrList<Journal> eventList) | 1021 | void KOListView::addJournals(Q3PtrList<Journal> eventList) |
1013 | { | 1022 | { |
1014 | Journal *ev; | 1023 | Journal *ev; |
1015 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 1024 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
@@ -1044,7 +1053,7 @@ void KOListView::addIncidence(Incidence *incidence) | |||
1044 | else delete item; | 1053 | else delete item; |
1045 | } | 1054 | } |
1046 | 1055 | ||
1047 | void KOListView::showEvents(QPtrList<Event> eventList) | 1056 | void KOListView::showEvents(Q3PtrList<Event> eventList) |
1048 | { | 1057 | { |
1049 | clear(); | 1058 | clear(); |
1050 | 1059 | ||
@@ -1095,14 +1104,14 @@ KOListViewItem *KOListView::getItemForEvent(Incidence *event) | |||
1095 | return 0; | 1104 | return 0; |
1096 | } | 1105 | } |
1097 | 1106 | ||
1098 | void KOListView::defaultItemAction(QListViewItem *i) | 1107 | void KOListView::defaultItemAction(Q3ListViewItem *i) |
1099 | { | 1108 | { |
1100 | KOListViewItem *item = static_cast<KOListViewItem *>( i ); | 1109 | KOListViewItem *item = static_cast<KOListViewItem *>( i ); |
1101 | if ( item ) defaultAction( item->data() ); | 1110 | if ( item ) defaultAction( item->data() ); |
1102 | 1111 | ||
1103 | } | 1112 | } |
1104 | 1113 | ||
1105 | void KOListView::popupMenu(QListViewItem *item,const QPoint &,int) | 1114 | void KOListView::popupMenu(Q3ListViewItem *item,const QPoint &,int) |
1106 | { | 1115 | { |
1107 | mActiveItem = (KOListViewItem *)item; | 1116 | mActiveItem = (KOListViewItem *)item; |
1108 | if (mActiveItem) { | 1117 | if (mActiveItem) { |
@@ -1131,7 +1140,7 @@ void KOListView::writeSettings(KConfig *config, QString setting) | |||
1131 | mListView->saveLayout(config, setting); | 1140 | mListView->saveLayout(config, setting); |
1132 | } | 1141 | } |
1133 | 1142 | ||
1134 | void KOListView::processSelectionChange(QListViewItem *) | 1143 | void KOListView::processSelectionChange(Q3ListViewItem *) |
1135 | { | 1144 | { |
1136 | 1145 | ||
1137 | KOListViewItem *item = | 1146 | KOListViewItem *item = |
@@ -1180,8 +1189,8 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1180 | 1189 | ||
1181 | switch ( e->key() ) { | 1190 | switch ( e->key() ) { |
1182 | case Qt::Key_Down: | 1191 | case Qt::Key_Down: |
1183 | if ( e->state() == ShiftButton ) { | 1192 | if ( e->state() == Qt::ShiftButton ) { |
1184 | QListViewItem* cn = currentItem(); | 1193 | Q3ListViewItem* cn = currentItem(); |
1185 | if ( !cn ) | 1194 | if ( !cn ) |
1186 | cn = firstChild(); | 1195 | cn = firstChild(); |
1187 | if ( !cn ) | 1196 | if ( !cn ) |
@@ -1194,10 +1203,10 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1194 | e->accept(); | 1203 | e->accept(); |
1195 | return; | 1204 | return; |
1196 | } | 1205 | } |
1197 | if ( e->state() == ControlButton ) { | 1206 | if ( e->state() == Qt::ControlButton ) { |
1198 | int count = childCount (); | 1207 | int count = childCount (); |
1199 | int jump = count / 5; | 1208 | int jump = count / 5; |
1200 | QListViewItem* cn; | 1209 | Q3ListViewItem* cn; |
1201 | cn = currentItem(); | 1210 | cn = currentItem(); |
1202 | if ( ! cn ) | 1211 | if ( ! cn ) |
1203 | return; | 1212 | return; |
@@ -1211,13 +1220,13 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1211 | ensureItemVisible ( cn ); | 1220 | ensureItemVisible ( cn ); |
1212 | 1221 | ||
1213 | } else | 1222 | } else |
1214 | QListView::keyPressEvent ( e ) ; | 1223 | Q3ListView::keyPressEvent ( e ) ; |
1215 | e->accept(); | 1224 | e->accept(); |
1216 | break; | 1225 | break; |
1217 | 1226 | ||
1218 | case Qt::Key_Up: | 1227 | case Qt::Key_Up: |
1219 | if ( e->state() == ShiftButton ) { | 1228 | if ( e->state() == Qt::ShiftButton ) { |
1220 | QListViewItem* cn = firstChild(); | 1229 | Q3ListViewItem* cn = firstChild(); |
1221 | if ( cn ) { | 1230 | if ( cn ) { |
1222 | setCurrentItem ( cn ); | 1231 | setCurrentItem ( cn ); |
1223 | ensureItemVisible ( cn ); | 1232 | ensureItemVisible ( cn ); |
@@ -1225,10 +1234,10 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1225 | e->accept(); | 1234 | e->accept(); |
1226 | return; | 1235 | return; |
1227 | } | 1236 | } |
1228 | if ( e->state() == ControlButton ) { | 1237 | if ( e->state() == Qt::ControlButton ) { |
1229 | int count = childCount (); | 1238 | int count = childCount (); |
1230 | int jump = count / 5; | 1239 | int jump = count / 5; |
1231 | QListViewItem* cn; | 1240 | Q3ListViewItem* cn; |
1232 | cn = currentItem(); | 1241 | cn = currentItem(); |
1233 | if ( ! cn ) | 1242 | if ( ! cn ) |
1234 | return; | 1243 | return; |
@@ -1241,11 +1250,11 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1241 | setCurrentItem ( cn ); | 1250 | setCurrentItem ( cn ); |
1242 | ensureItemVisible ( cn ); | 1251 | ensureItemVisible ( cn ); |
1243 | } else | 1252 | } else |
1244 | QListView::keyPressEvent ( e ) ; | 1253 | Q3ListView::keyPressEvent ( e ) ; |
1245 | e->accept(); | 1254 | e->accept(); |
1246 | break; | 1255 | break; |
1247 | case Qt::Key_I: { | 1256 | case Qt::Key_I: { |
1248 | QListViewItem* cn; | 1257 | Q3ListViewItem* cn; |
1249 | cn = currentItem(); | 1258 | cn = currentItem(); |
1250 | if ( cn ) { | 1259 | if ( cn ) { |
1251 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 1260 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
@@ -1265,12 +1274,12 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1265 | case Qt::Key_Return: | 1274 | case Qt::Key_Return: |
1266 | case Qt::Key_Enter: | 1275 | case Qt::Key_Enter: |
1267 | { | 1276 | { |
1268 | QListViewItem* cn; | 1277 | Q3ListViewItem* cn; |
1269 | cn = currentItem(); | 1278 | cn = currentItem(); |
1270 | if ( cn ) { | 1279 | if ( cn ) { |
1271 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 1280 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
1272 | if ( ci ){ | 1281 | if ( ci ){ |
1273 | if ( e->state() == ShiftButton ) | 1282 | if ( e->state() == Qt::ShiftButton ) |
1274 | ci->setSelected( false ); | 1283 | ci->setSelected( false ); |
1275 | else | 1284 | else |
1276 | ci->setSelected( true ); | 1285 | ci->setSelected( true ); |
@@ -1300,12 +1309,12 @@ KOListViewListView::KOListViewListView(KOListView * lv ) | |||
1300 | #ifndef DESKTOP_VERSION | 1309 | #ifndef DESKTOP_VERSION |
1301 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 1310 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
1302 | #endif | 1311 | #endif |
1303 | setSelectionMode( QListView::Multi ); | 1312 | setSelectionMode( Q3ListView::Multi ); |
1304 | setMultiSelection( true); | 1313 | setMultiSelection( true); |
1305 | } | 1314 | } |
1306 | bool KOListViewListView::hasMultiSelection(QListViewItem* item) | 1315 | bool KOListViewListView::hasMultiSelection(Q3ListViewItem* item) |
1307 | { | 1316 | { |
1308 | QListViewItem *qitem = firstChild (); | 1317 | Q3ListViewItem *qitem = firstChild (); |
1309 | while ( qitem ) { | 1318 | while ( qitem ) { |
1310 | if ( qitem->isSelected() && item != qitem ) | 1319 | if ( qitem->isSelected() && item != qitem ) |
1311 | return true; | 1320 | return true; |
@@ -1317,7 +1326,7 @@ void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | |||
1317 | { | 1326 | { |
1318 | if (!e) return; | 1327 | if (!e) return; |
1319 | QPoint vp = contentsToViewport(e->pos()); | 1328 | QPoint vp = contentsToViewport(e->pos()); |
1320 | QListViewItem *item = itemAt(vp); | 1329 | Q3ListViewItem *item = itemAt(vp); |
1321 | if (!item) { | 1330 | if (!item) { |
1322 | emit newEvent(); | 1331 | emit newEvent(); |
1323 | return; | 1332 | return; |
@@ -1329,8 +1338,8 @@ void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | |||
1329 | { | 1338 | { |
1330 | //qDebug("contentsMousePressEvent++++ "); | 1339 | //qDebug("contentsMousePressEvent++++ "); |
1331 | KListView::contentsMousePressEvent( e ); | 1340 | KListView::contentsMousePressEvent( e ); |
1332 | if ( e->button() == RightButton ) { | 1341 | if ( e->button() == Qt::RightButton ) { |
1333 | QListViewItem* ci = currentItem(); | 1342 | Q3ListViewItem* ci = currentItem(); |
1334 | clearSelection () ; | 1343 | clearSelection () ; |
1335 | if ( ci ) | 1344 | if ( ci ) |
1336 | ci->setSelected( true ); | 1345 | ci->setSelected( true ); |
@@ -1348,7 +1357,7 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) | |||
1348 | void KOListViewListView::popupMenu() | 1357 | void KOListViewListView::popupMenu() |
1349 | { | 1358 | { |
1350 | mPopupTimer->stop(); | 1359 | mPopupTimer->stop(); |
1351 | QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton ); | 1360 | QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, Qt::RightButton , Qt::RightButton ); |
1352 | QApplication::postEvent( this->viewport(), e ); | 1361 | QApplication::postEvent( this->viewport(), e ); |
1353 | 1362 | ||
1354 | } | 1363 | } |
@@ -1356,14 +1365,14 @@ void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | |||
1356 | { | 1365 | { |
1357 | //qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y()); | 1366 | //qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y()); |
1358 | mYMousePos = mapToGlobal( (e->pos())).y(); | 1367 | mYMousePos = mapToGlobal( (e->pos())).y(); |
1359 | if ( e->button() == LeftButton ) { | 1368 | if ( e->button() == Qt::LeftButton ) { |
1360 | mPopupTimer->start( 600 ); | 1369 | mPopupTimer->start( 600 ); |
1361 | mEventPos = contentsToViewport(e->pos()); | 1370 | mEventPos = contentsToViewport(e->pos()); |
1362 | mEventGlobalPos = e->globalPos(); | 1371 | mEventGlobalPos = e->globalPos(); |
1363 | } | 1372 | } |
1364 | KListView::contentsMousePressEvent( e ); | 1373 | KListView::contentsMousePressEvent( e ); |
1365 | if ( e->button() == RightButton ) { | 1374 | if ( e->button() == Qt::RightButton ) { |
1366 | QListViewItem* ci = currentItem(); | 1375 | Q3ListViewItem* ci = currentItem(); |
1367 | //clearSelection(); | 1376 | //clearSelection(); |
1368 | if ( ci ) | 1377 | if ( ci ) |
1369 | ci->setSelected( true ); | 1378 | ci->setSelected( true ); |
@@ -1390,7 +1399,7 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) | |||
1390 | } | 1399 | } |
1391 | 1400 | ||
1392 | #define protected public | 1401 | #define protected public |
1393 | #include <qheader.h> | 1402 | #include <q3header.h> |
1394 | #undef protected | 1403 | #undef protected |
1395 | void KOListViewListView::printList() | 1404 | void KOListViewListView::printList() |
1396 | { | 1405 | { |
@@ -1407,7 +1416,7 @@ void KOListViewListView::printList() | |||
1407 | QPainter p; | 1416 | QPainter p; |
1408 | p.begin ( &printer ); | 1417 | p.begin ( &printer ); |
1409 | p.setFont(font()); | 1418 | p.setFont(font()); |
1410 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); | 1419 | Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); |
1411 | float dx, dy; | 1420 | float dx, dy; |
1412 | int wid = (m.width() * 9)/10; | 1421 | int wid = (m.width() * 9)/10; |
1413 | dx = (float) wid/(float)contentsWidth (); | 1422 | dx = (float) wid/(float)contentsWidth (); |
@@ -1443,7 +1452,7 @@ void KOListViewListView::printList() | |||
1443 | p.save(); | 1452 | p.save(); |
1444 | for ( iii = 0; iii < cou; ++iii ) { | 1453 | for ( iii = 0; iii < cou; ++iii ) { |
1445 | int align = columnAlignment( iii ); | 1454 | int align = columnAlignment( iii ); |
1446 | if ( align == AlignAuto ) align = AlignLeft; | 1455 | if ( align == Qt::AlignLeft ) align = Qt::AlignLeft; |
1447 | p.restore(); | 1456 | p.restore(); |
1448 | p.save(); | 1457 | p.save(); |
1449 | p.translate( header()->sectionPos( iii ), 0); | 1458 | p.translate( header()->sectionPos( iii ), 0); |