summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile385
-rw-r--r--gammu/emb/common/common.pro4
-rw-r--r--gammu/emb/common/device/bluetoth/blue_w32.c4
-rw-r--r--gammu/emb/common/device/bluetoth/blue_w32.h4
-rw-r--r--gammu/emb/common/device/serial/ser_w32.h2
-rw-r--r--gammu/emb/gammu/gammu.pro4
-rw-r--r--kabc/address.h6
-rw-r--r--kabc/addressbook.cpp30
-rw-r--r--kabc/addressbook.h4
-rw-r--r--kabc/addressee.cpp2
-rw-r--r--kabc/addressee.h4
-rw-r--r--kabc/addresseedialog.cpp51
-rw-r--r--kabc/addresseedialog.h18
-rw-r--r--kabc/addresseelist.cpp12
-rw-r--r--kabc/addresseelist.h6
-rw-r--r--kabc/addresseeview.cpp47
-rw-r--r--kabc/addresseeview.h4
-rw-r--r--kabc/distributionlist.cpp6
-rw-r--r--kabc/distributionlist.h7
-rw-r--r--kabc/distributionlistdialog.cpp36
-rw-r--r--kabc/distributionlistdialog.h12
-rw-r--r--kabc/distributionlisteditor.cpp30
-rw-r--r--kabc/distributionlisteditor.h10
-rw-r--r--kabc/field.cpp10
-rw-r--r--kabc/field.h4
-rw-r--r--kabc/formatfactory.cpp2
-rw-r--r--kabc/formatfactory.h4
-rw-r--r--kabc/formats/binary/kabcformat_binaryE.pro2
-rw-r--r--kabc/formats/vcardformatplugin2.cpp20
-rw-r--r--kabc/kabc.pro8
-rw-r--r--kabc/kabcE.pro8
-rw-r--r--kabc/key.h6
-rw-r--r--kabc/phonenumber.h6
-rw-r--r--kabc/picture.cpp2
-rw-r--r--kabc/picture.h2
-rw-r--r--kabc/plugins/dir/dir.pro14
-rw-r--r--kabc/plugins/dir/dirE.pro4
-rw-r--r--kabc/plugins/dir/resourcedir.cpp8
-rw-r--r--kabc/plugins/dir/resourcedirconfig.cpp4
-rw-r--r--kabc/plugins/file/file.pro14
-rw-r--r--kabc/plugins/file/fileE.pro4
-rw-r--r--kabc/plugins/file/resourcefile.cpp10
-rw-r--r--kabc/plugins/file/resourcefileconfig.cpp4
-rw-r--r--kabc/plugins/ldap/ldapE.pro4
-rw-r--r--kabc/plugins/olaccess/olaccess.pro8
-rw-r--r--kabc/plugins/opie/opieE.pro6
-rw-r--r--kabc/plugins/qtopia/qtopia.pro16
-rw-r--r--kabc/plugins/qtopia/qtopiaE.pro6
-rw-r--r--kabc/plugins/qtopia/qtopiaconverter.cpp24
-rw-r--r--kabc/plugins/qtopia/qtopiaconverter.h9
-rw-r--r--kabc/plugins/qtopia/resourceqtopia.cpp14
-rw-r--r--kabc/plugins/qtopia/resourceqtopiaconfig.cpp4
-rw-r--r--kabc/plugins/sharpdtm/sharpdtmE.pro8
-rw-r--r--kabc/secrecy.h4
-rw-r--r--kabc/sound.h2
-rw-r--r--kabc/tmpaddressbook.cpp2
-rw-r--r--kabc/vcard/AdrParam.cpp10
-rw-r--r--kabc/vcard/AdrValue.cpp9
-rw-r--r--kabc/vcard/AgentParam.cpp6
-rw-r--r--kabc/vcard/AgentValue.cpp6
-rw-r--r--kabc/vcard/ClassValue.cpp6
-rw-r--r--kabc/vcard/ContentLine.cpp36
-rw-r--r--kabc/vcard/DateParam.cpp6
-rw-r--r--kabc/vcard/DateValue.cpp30
-rw-r--r--kabc/vcard/EmailParam.cpp6
-rw-r--r--kabc/vcard/Entity.cpp12
-rw-r--r--kabc/vcard/Enum.cpp8
-rw-r--r--kabc/vcard/FloatValue.cpp8
-rw-r--r--kabc/vcard/GeoValue.cpp6
-rw-r--r--kabc/vcard/ImageParam.cpp6
-rw-r--r--kabc/vcard/ImageValue.cpp6
-rw-r--r--kabc/vcard/ImgValue.cpp6
-rw-r--r--kabc/vcard/LangValue.cpp24
-rw-r--r--kabc/vcard/NValue.cpp10
-rw-r--r--kabc/vcard/OrgValue.cpp10
-rw-r--r--kabc/vcard/Param.cpp16
-rw-r--r--kabc/vcard/PhoneNumberValue.cpp6
-rw-r--r--kabc/vcard/RToken.cpp6
-rw-r--r--kabc/vcard/SoundValue.cpp6
-rw-r--r--kabc/vcard/SourceParam.cpp6
-rw-r--r--kabc/vcard/TelParam.cpp6
-rw-r--r--kabc/vcard/TelValue.cpp6
-rw-r--r--kabc/vcard/TextBinParam.cpp6
-rw-r--r--kabc/vcard/TextBinValue.cpp6
-rw-r--r--kabc/vcard/TextListValue.cpp10
-rw-r--r--kabc/vcard/TextParam.cpp6
-rw-r--r--kabc/vcard/TextValue.cpp8
-rw-r--r--kabc/vcard/URIValue.cpp16
-rw-r--r--kabc/vcard/UTCValue.cpp6
-rw-r--r--kabc/vcard/VCardEntity.cpp12
-rw-r--r--kabc/vcard/VCardv.cpp33
-rw-r--r--kabc/vcard/Value.cpp6
-rw-r--r--kabc/vcard/include/VCardAdrParam.h16
-rw-r--r--kabc/vcard/include/VCardAdrValue.h46
-rw-r--r--kabc/vcard/include/VCardAgentParam.h4
-rw-r--r--kabc/vcard/include/VCardAgentValue.h2
-rw-r--r--kabc/vcard/include/VCardClassValue.h2
-rw-r--r--kabc/vcard/include/VCardContentLine.h18
-rw-r--r--kabc/vcard/include/VCardDateParam.h2
-rw-r--r--kabc/vcard/include/VCardDateValue.h2
-rw-r--r--kabc/vcard/include/VCardDefines.h6
-rw-r--r--kabc/vcard/include/VCardEmailParam.h8
-rw-r--r--kabc/vcard/include/VCardEntity.h14
-rw-r--r--kabc/vcard/include/VCardEnum.h8
-rw-r--r--kabc/vcard/include/VCardFloatValue.h2
-rw-r--r--kabc/vcard/include/VCardImageParam.h2
-rw-r--r--kabc/vcard/include/VCardImageValue.h2
-rw-r--r--kabc/vcard/include/VCardLangValue.h16
-rw-r--r--kabc/vcard/include/VCardNValue.h26
-rw-r--r--kabc/vcard/include/VCardOrgValue.h8
-rw-r--r--kabc/vcard/include/VCardParam.h22
-rw-r--r--kabc/vcard/include/VCardRToken.h4
-rw-r--r--kabc/vcard/include/VCardSoundValue.h2
-rw-r--r--kabc/vcard/include/VCardSourceParam.h12
-rw-r--r--kabc/vcard/include/VCardTelParam.h6
-rw-r--r--kabc/vcard/include/VCardTelValue.h2
-rw-r--r--kabc/vcard/include/VCardTextBinParam.h2
-rw-r--r--kabc/vcard/include/VCardTextBinValue.h2
-rw-r--r--kabc/vcard/include/VCardTextListValue.h8
-rw-r--r--kabc/vcard/include/VCardTextParam.h2
-rw-r--r--kabc/vcard/include/VCardURIValue.h16
-rw-r--r--kabc/vcard/include/VCardUTCValue.h2
-rw-r--r--kabc/vcard/include/VCardVCard.h18
-rw-r--r--kabc/vcard/include/VCardVCardEntity.h6
-rw-r--r--kabc/vcard/include/VCardValue.h6
-rw-r--r--kabc/vcard/include/generated/AdrParam-generated.h10
-rw-r--r--kabc/vcard/include/generated/AdrValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/AgentParam-generated.h10
-rw-r--r--kabc/vcard/include/generated/AgentValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/ClassValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/ContentLine-generated.h10
-rw-r--r--kabc/vcard/include/generated/DateParam-generated.h10
-rw-r--r--kabc/vcard/include/generated/DateValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/EmailParam-generated.h10
-rw-r--r--kabc/vcard/include/generated/FloatValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/GeoValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/Group-generated.h10
-rw-r--r--kabc/vcard/include/generated/ImageParam-generated.h10
-rw-r--r--kabc/vcard/include/generated/ImageValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/ImgParam-generated.h10
-rw-r--r--kabc/vcard/include/generated/ImgValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/LangValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/NValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/Name-generated.h10
-rw-r--r--kabc/vcard/include/generated/OrgValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/Param-generated.h10
-rw-r--r--kabc/vcard/include/generated/ParamName-generated.h10
-rw-r--r--kabc/vcard/include/generated/ParamValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/PhoneNumberValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/SoundValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/SourceParam-generated.h10
-rw-r--r--kabc/vcard/include/generated/TelParam-generated.h10
-rw-r--r--kabc/vcard/include/generated/TelValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/TextBinParam-generated.h10
-rw-r--r--kabc/vcard/include/generated/TextBinValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/TextListValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/TextNSParam-generated.h10
-rw-r--r--kabc/vcard/include/generated/TextParam-generated.h10
-rw-r--r--kabc/vcard/include/generated/TextValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/URIValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/UTCValue-generated.h10
-rw-r--r--kabc/vcard/include/generated/VCard-generated.h10
-rw-r--r--kabc/vcard/include/generated/VCardEntity-generated.h10
-rw-r--r--kabc/vcard/include/generated/Value-generated.h10
-rw-r--r--kabc/vcard/testread.cpp12
-rw-r--r--kabc/vcard/testwrite.cpp4
-rw-r--r--kabc/vcard21parser.cpp40
-rw-r--r--kabc/vcard21parser.h10
-rw-r--r--kabc/vcardformatimpl.cpp25
-rw-r--r--kabc/vcardformatplugin.cpp2
-rw-r--r--kabc/vcardparser/vcard.h4
-rw-r--r--kabc/vcardparser/vcardline.cpp6
-rw-r--r--kabc/vcardparser/vcardline.h8
-rw-r--r--kabc/vcardparser/vcardparser.cpp2
-rw-r--r--kabc/vcardparser/vcardtool.cpp2
-rw-r--r--kaddressbook/addresseditwidget.cpp55
-rw-r--r--kaddressbook/addresseditwidget.h18
-rw-r--r--kaddressbook/addresseeconfig.cpp6
-rw-r--r--kaddressbook/addresseeconfig.h6
-rw-r--r--kaddressbook/addresseeeditordialog.cpp9
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp46
-rw-r--r--kaddressbook/addresseeeditorwidget.h12
-rw-r--r--kaddressbook/addresseeutil.cpp2
-rw-r--r--kaddressbook/addviewdialog.cpp16
-rw-r--r--kaddressbook/addviewdialog.h10
-rw-r--r--kaddressbook/details/detailsviewcontainer.cpp19
-rw-r--r--kaddressbook/details/detailsviewcontainer.h8
-rw-r--r--kaddressbook/details/look_basic.cpp6
-rw-r--r--kaddressbook/details/look_basic.h4
-rw-r--r--kaddressbook/details/look_details.cpp12
-rw-r--r--kaddressbook/details/look_details.h4
-rw-r--r--kaddressbook/details/look_html.cpp6
-rw-r--r--kaddressbook/emaileditwidget.cpp16
-rw-r--r--kaddressbook/emaileditwidget.h10
-rw-r--r--kaddressbook/extensionmanager.cpp14
-rw-r--r--kaddressbook/extensionmanager.h10
-rw-r--r--kaddressbook/extensionwidget.cpp5
-rw-r--r--kaddressbook/extensionwidget.h4
-rw-r--r--kaddressbook/features/distributionlistwidget.cpp39
-rw-r--r--kaddressbook/features/distributionlistwidget.h13
-rw-r--r--kaddressbook/features/mergewidget.cpp14
-rw-r--r--kaddressbook/features/mergewidget.h2
-rw-r--r--kaddressbook/filter.cpp2
-rw-r--r--kaddressbook/filter.h4
-rw-r--r--kaddressbook/filtereditdialog.cpp38
-rw-r--r--kaddressbook/filtereditdialog.h9
-rw-r--r--kaddressbook/geowidget.cpp35
-rw-r--r--kaddressbook/geowidget.h4
-rw-r--r--kaddressbook/imagewidget.cpp32
-rw-r--r--kaddressbook/imagewidget.h3
-rw-r--r--kaddressbook/incsearchwidget.cpp14
-rw-r--r--kaddressbook/jumpbuttonbar.cpp13
-rw-r--r--kaddressbook/jumpbuttonbar.h11
-rw-r--r--kaddressbook/kabcore.cpp146
-rw-r--r--kaddressbook/kabcore.h40
-rw-r--r--kaddressbook/kabprefs.cpp4
-rw-r--r--kaddressbook/kabprefs.h8
-rw-r--r--kaddressbook/kaddressbook.pro46
-rw-r--r--kaddressbook/kaddressbookE.pro6
-rw-r--r--kaddressbook/kaddressbookmain.cpp22
-rw-r--r--kaddressbook/kaddressbookmain.h14
-rw-r--r--kaddressbook/kaddressbookview.cpp8
-rw-r--r--kaddressbook/kaddressbookview.h12
-rw-r--r--kaddressbook/kcmconfigs/addresseewidget.cpp36
-rw-r--r--kaddressbook/kcmconfigs/addresseewidget.h8
-rw-r--r--kaddressbook/kcmconfigs/extensionconfigdialog.cpp11
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp59
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.h6
-rw-r--r--kaddressbook/kcmconfigs/kcmkabconfig.cpp8
-rw-r--r--kaddressbook/keywidget.cpp28
-rw-r--r--kaddressbook/mainembedded.cpp5
-rw-r--r--kaddressbook/nameeditdialog.cpp12
-rw-r--r--kaddressbook/old_mainwindow.cpp12
-rw-r--r--kaddressbook/phoneeditwidget.cpp60
-rw-r--r--kaddressbook/phoneeditwidget.h24
-rw-r--r--kaddressbook/secrecywidget.cpp8
-rw-r--r--kaddressbook/undo.cpp4
-rw-r--r--kaddressbook/undo.h4
-rw-r--r--kaddressbook/undocmds.cpp2
-rw-r--r--kaddressbook/viewconfigurefieldspage.cpp54
-rw-r--r--kaddressbook/viewconfigurefieldspage.h8
-rw-r--r--kaddressbook/viewconfigurefilterpage.cpp15
-rw-r--r--kaddressbook/viewconfigurefilterpage.h4
-rw-r--r--kaddressbook/viewconfigurewidget.cpp19
-rw-r--r--kaddressbook/viewconfigurewidget.h4
-rw-r--r--kaddressbook/viewmanager.cpp30
-rw-r--r--kaddressbook/viewmanager.h12
-rw-r--r--kaddressbook/views/cardview.cpp114
-rw-r--r--kaddressbook/views/cardview.h14
-rw-r--r--kaddressbook/views/colorlistbox.cpp25
-rw-r--r--kaddressbook/views/colorlistbox.h15
-rw-r--r--kaddressbook/views/configurecardviewdialog.cpp57
-rw-r--r--kaddressbook/views/configurecardviewdialog.h6
-rw-r--r--kaddressbook/views/configuretableviewdialog.cpp35
-rw-r--r--kaddressbook/views/configuretableviewdialog.h6
-rw-r--r--kaddressbook/views/contactlistview.cpp32
-rw-r--r--kaddressbook/views/contactlistview.h6
-rw-r--r--kaddressbook/views/kaddressbookcardview.cpp19
-rw-r--r--kaddressbook/views/kaddressbookcardview.h3
-rw-r--r--kaddressbook/views/kaddressbookiconview.cpp60
-rw-r--r--kaddressbook/views/kaddressbookiconview.h29
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp56
-rw-r--r--kaddressbook/views/kaddressbooktableview.h18
-rw-r--r--kaddressbook/xxport/csv_xxport.cpp14
-rw-r--r--kaddressbook/xxport/csvimportdialog.cpp66
-rw-r--r--kaddressbook/xxport/csvimportdialog.h12
-rw-r--r--kaddressbook/xxport/kde2_xxport.cpp4
-rw-r--r--kaddressbook/xxport/vcard_xxport.cpp20
-rw-r--r--kaddressbook/xxportmanager.cpp17
-rw-r--r--kaddressbook/xxportmanager.h4
-rw-r--r--kaddressbook/xxportobject.cpp4
-rw-r--r--kaddressbook/xxportselectdialog.cpp59
-rw-r--r--kaddressbook/xxportselectdialog.h12
-rw-r--r--kalarmd/alarmdialog.cpp26
-rw-r--r--kalarmd/alarmdialog.h2
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp16
-rw-r--r--kalarmd/simplealarmdaemonimpl.h3
-rw-r--r--kdepim-desktop.pro4
-rw-r--r--kmicromail/accountitem.cpp128
-rw-r--r--kmicromail/accountitem.h63
-rw-r--r--kmicromail/accountview.cpp30
-rw-r--r--kmicromail/accountview.h22
-rw-r--r--kmicromail/composemail.cpp14
-rw-r--r--kmicromail/composemail.h6
-rw-r--r--kmicromail/editaccounts.cpp40
-rw-r--r--kmicromail/editaccounts.h18
-rw-r--r--kmicromail/kmicromail.pro10
-rw-r--r--kmicromail/kmicromailE.pro2
-rw-r--r--kmicromail/koprefs.cpp2
-rw-r--r--kmicromail/koprefsdialog.cpp149
-rw-r--r--kmicromail/koprefsdialog.h12
-rw-r--r--kmicromail/libetpan/libetpan.pro2
-rw-r--r--kmicromail/libetpan/libetpanE.pro2
-rw-r--r--kmicromail/libmailwrapper/abstractmail.cpp30
-rw-r--r--kmicromail/libmailwrapper/abstractmail.h12
-rw-r--r--kmicromail/libmailwrapper/generatemail.cpp6
-rw-r--r--kmicromail/libmailwrapper/genericwrapper.cpp14
-rw-r--r--kmicromail/libmailwrapper/genericwrapper.h6
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp28
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.h14
-rw-r--r--kmicromail/libmailwrapper/libmailwrapper.pro8
-rw-r--r--kmicromail/libmailwrapper/logindialog.cpp2
-rw-r--r--kmicromail/libmailwrapper/logindialog.h2
-rw-r--r--kmicromail/libmailwrapper/mailtypes.cpp10
-rw-r--r--kmicromail/libmailwrapper/mailtypes.h14
-rw-r--r--kmicromail/libmailwrapper/mailwrapper.cpp14
-rw-r--r--kmicromail/libmailwrapper/mailwrapper.h6
-rw-r--r--kmicromail/libmailwrapper/mboxwrapper.cpp14
-rw-r--r--kmicromail/libmailwrapper/mboxwrapper.h10
-rw-r--r--kmicromail/libmailwrapper/mhwrapper.cpp12
-rw-r--r--kmicromail/libmailwrapper/mhwrapper.h8
-rw-r--r--kmicromail/libmailwrapper/nntpwrapper.cpp12
-rw-r--r--kmicromail/libmailwrapper/nntpwrapper.h6
-rw-r--r--kmicromail/libmailwrapper/pop3wrapper.cpp20
-rw-r--r--kmicromail/libmailwrapper/pop3wrapper.h8
-rw-r--r--kmicromail/libmailwrapper/sendmailprogress.cpp2
-rw-r--r--kmicromail/libmailwrapper/settings.cpp10
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.cpp6
-rw-r--r--kmicromail/mailistviewitem.cpp4
-rw-r--r--kmicromail/mailistviewitem.h2
-rw-r--r--kmicromail/main.cpp5
-rw-r--r--kmicromail/mainwindow.cpp74
-rw-r--r--kmicromail/mainwindow.h26
-rw-r--r--kmicromail/nntpgroups.cpp16
-rw-r--r--kmicromail/nntpgroups.h2
-rw-r--r--kmicromail/nntpgroupsdlg.cpp4
-rw-r--r--kmicromail/opiemail.cpp47
-rw-r--r--kmicromail/opiemail.h17
-rw-r--r--kmicromail/qpe/qdialog.h2
-rw-r--r--kmicromail/qpe/qdialog_hacked.cpp6
-rw-r--r--kmicromail/selectsmtp.cpp4
-rw-r--r--kmicromail/selectsmtp.h2
-rw-r--r--kmicromail/selectstore.h2
-rw-r--r--kmicromail/settingsdialog.cpp6
-rw-r--r--kmicromail/settingsdialog.h2
-rw-r--r--kmicromail/statuswidget.cpp4
-rw-r--r--kmicromail/statuswidget.h2
-rw-r--r--kmicromail/viewmail.cpp47
-rw-r--r--kmicromail/viewmail.h26
-rw-r--r--kmicromail/viewmailbase.cpp25
-rw-r--r--kmicromail/viewmailbase.h25
-rw-r--r--korganizer/calendarview.cpp148
-rw-r--r--korganizer/calendarview.h32
-rw-r--r--korganizer/calprintbase.cpp102
-rw-r--r--korganizer/calprinter.cpp23
-rw-r--r--korganizer/calprinter.h18
-rw-r--r--korganizer/calprintplugins.cpp4
-rw-r--r--korganizer/cellitem.cpp14
-rw-r--r--korganizer/cellitem.h4
-rw-r--r--korganizer/datenavigatorcontainer.cpp2
-rw-r--r--korganizer/datenavigatorcontainer.h5
-rw-r--r--korganizer/filteredit_base.cpp40
-rw-r--r--korganizer/filteredit_base.h42
-rw-r--r--korganizer/filtereditdialog.cpp11
-rw-r--r--korganizer/filtereditdialog.h6
-rw-r--r--korganizer/incomingdialog.cpp30
-rw-r--r--korganizer/incomingdialog.h10
-rw-r--r--korganizer/incomingdialog_base.cpp14
-rw-r--r--korganizer/incomingdialog_base.h22
-rw-r--r--korganizer/interfaces/korganizer/baseview.h8
-rw-r--r--korganizer/interfaces/korganizer/calendarviewbase.h4
-rw-r--r--korganizer/journalentry.cpp39
-rw-r--r--korganizer/journalentry.h9
-rw-r--r--korganizer/kdatenavigator.cpp20
-rw-r--r--korganizer/kdatenavigator.h11
-rw-r--r--korganizer/koagenda.cpp169
-rw-r--r--korganizer/koagenda.h43
-rw-r--r--korganizer/koagendaitem.cpp70
-rw-r--r--korganizer/koagendaitem.h17
-rw-r--r--korganizer/koagendaview.cpp78
-rw-r--r--korganizer/koagendaview.h52
-rw-r--r--korganizer/kocounterdialog.h2
-rw-r--r--korganizer/kodaymatrix.cpp47
-rw-r--r--korganizer/kodaymatrix.h14
-rw-r--r--korganizer/kodialogmanager.cpp8
-rw-r--r--korganizer/kodialogmanager.h4
-rw-r--r--korganizer/koeditordetails.cpp38
-rw-r--r--korganizer/koeditordetails.h12
-rw-r--r--korganizer/koeditorgeneral.cpp39
-rw-r--r--korganizer/koeditorgeneral.h21
-rw-r--r--korganizer/koeditorgeneralevent.cpp32
-rw-r--r--korganizer/koeditorgeneralevent.h12
-rw-r--r--korganizer/koeditorgeneraltodo.cpp39
-rw-r--r--korganizer/koeditorgeneraltodo.h16
-rw-r--r--korganizer/koeditorrecurrence.cpp94
-rw-r--r--korganizer/koeditorrecurrence.h30
-rw-r--r--korganizer/koeventeditor.cpp43
-rw-r--r--korganizer/koeventpopupmenu.cpp17
-rw-r--r--korganizer/koeventpopupmenu.h16
-rw-r--r--korganizer/koeventview.cpp4
-rw-r--r--korganizer/koeventview.h4
-rw-r--r--korganizer/koeventviewer.cpp37
-rw-r--r--korganizer/koeventviewer.h17
-rw-r--r--korganizer/koeventviewerdialog.cpp5
-rw-r--r--korganizer/koeventviewerdialog.h5
-rw-r--r--korganizer/kofilterview.cpp48
-rw-r--r--korganizer/kofilterview.h36
-rw-r--r--korganizer/koimportoldialog.cpp30
-rw-r--r--korganizer/koimportoldialog.h4
-rw-r--r--korganizer/koincidenceeditor.cpp10
-rw-r--r--korganizer/kojournalview.cpp36
-rw-r--r--korganizer/kojournalview.h15
-rw-r--r--korganizer/kolistview.cpp193
-rw-r--r--korganizer/kolistview.h42
-rw-r--r--korganizer/komonthview.cpp218
-rw-r--r--korganizer/komonthview.h57
-rw-r--r--korganizer/koprefs.cpp8
-rw-r--r--korganizer/koprefs.h11
-rw-r--r--korganizer/koprefsdialog.cpp138
-rw-r--r--korganizer/koprefsdialog.h12
-rw-r--r--korganizer/korganizer.pro57
-rw-r--r--korganizer/korganizerE.pro6
-rw-r--r--korganizer/kotimespanview.cpp20
-rw-r--r--korganizer/kotimespanview.h6
-rw-r--r--korganizer/kotodoeditor.cpp43
-rw-r--r--korganizer/kotodoview.cpp198
-rw-r--r--korganizer/kotodoview.h58
-rw-r--r--korganizer/kotodoviewitem.cpp42
-rw-r--r--korganizer/kotodoviewitem.h14
-rw-r--r--korganizer/koviewmanager.cpp8
-rw-r--r--korganizer/kowhatsnextview.cpp38
-rw-r--r--korganizer/kowhatsnextview.h20
-rw-r--r--korganizer/ktimeedit.cpp89
-rw-r--r--korganizer/ktimeedit.h7
-rw-r--r--korganizer/lineview.cpp2
-rw-r--r--korganizer/lineview.h8
-rw-r--r--korganizer/main.cpp10
-rw-r--r--korganizer/mainwindow.cpp316
-rw-r--r--korganizer/mainwindow.h68
-rw-r--r--korganizer/navigatorbar.cpp29
-rw-r--r--korganizer/navigatorbar.h7
-rw-r--r--korganizer/outgoingdialog.cpp28
-rw-r--r--korganizer/outgoingdialog.h10
-rw-r--r--korganizer/outgoingdialog_base.cpp18
-rw-r--r--korganizer/outgoingdialog_base.h22
-rw-r--r--korganizer/publishdialog.cpp18
-rw-r--r--korganizer/publishdialog.h4
-rw-r--r--korganizer/publishdialog_base.cpp27
-rw-r--r--korganizer/publishdialog_base.h28
-rw-r--r--korganizer/savetemplatedialog.cpp7
-rw-r--r--korganizer/searchdialog.cpp43
-rw-r--r--korganizer/searchdialog.h16
-rw-r--r--korganizer/statusdialog.cpp9
-rw-r--r--korganizer/timeline.cpp6
-rw-r--r--korganizer/timeline.h4
-rw-r--r--korganizer/timespanview.cpp22
-rw-r--r--korganizer/timespanview.h10
-rw-r--r--libetpan/libetpan.pro5
-rw-r--r--libetpan/libetpanE.pro2
-rw-r--r--libical/src/libical/libical.pro2
-rw-r--r--libical/src/libicalss/libicalss.pro2
-rw-r--r--libkcal/alarm.cpp10
-rw-r--r--libkcal/alarm.h12
-rw-r--r--libkcal/calendar.cpp66
-rw-r--r--libkcal/calendar.h40
-rw-r--r--libkcal/calendarlocal.cpp66
-rw-r--r--libkcal/calendarlocal.h28
-rw-r--r--libkcal/calfilter.cpp6
-rw-r--r--libkcal/calfilter.h10
-rw-r--r--libkcal/customproperties.cpp32
-rw-r--r--libkcal/customproperties.h22
-rw-r--r--libkcal/dndfactory.cpp9
-rw-r--r--libkcal/dndfactory.h2
-rw-r--r--libkcal/dndfactory_dummy.h2
-rw-r--r--libkcal/dummyscheduler.cpp16
-rw-r--r--libkcal/dummyscheduler.h4
-rw-r--r--libkcal/event.cpp2
-rw-r--r--libkcal/event.h4
-rw-r--r--libkcal/filestorage.cpp2
-rw-r--r--libkcal/freebusy.cpp11
-rw-r--r--libkcal/freebusy.h14
-rw-r--r--libkcal/icaldrag.cpp2
-rw-r--r--libkcal/icaldrag.h4
-rw-r--r--libkcal/icalformat.cpp32
-rw-r--r--libkcal/icalformat.h4
-rw-r--r--libkcal/icalformatimpl.cpp35
-rw-r--r--libkcal/icalformatimpl.h6
-rw-r--r--libkcal/imipscheduler.cpp6
-rw-r--r--libkcal/imipscheduler.h4
-rw-r--r--libkcal/incidence.cpp38
-rw-r--r--libkcal/incidence.h20
-rw-r--r--libkcal/incidencebase.cpp14
-rw-r--r--libkcal/incidencebase.h16
-rw-r--r--libkcal/journal.h4
-rw-r--r--libkcal/kincidenceformatter.cpp10
-rw-r--r--libkcal/libkcal.pro6
-rw-r--r--libkcal/libkcalE.pro2
-rw-r--r--libkcal/listbase.h24
-rw-r--r--libkcal/phoneformat.cpp23
-rw-r--r--libkcal/qtopiaformat.cpp8
-rw-r--r--libkcal/recurrence.cpp187
-rw-r--r--libkcal/recurrence.h26
-rw-r--r--libkcal/scheduler.cpp12
-rw-r--r--libkcal/scheduler.h4
-rw-r--r--libkcal/sharpformat.cpp48
-rw-r--r--libkcal/todo.cpp2
-rw-r--r--libkcal/todo.h4
-rw-r--r--libkcal/vcaldrag.cpp2
-rw-r--r--libkcal/vcaldrag.h4
-rw-r--r--libkcal/vcalformat.cpp52
-rw-r--r--libkcal/vcalformat.h13
-rw-r--r--libkdepim/categoryeditdialog.cpp19
-rw-r--r--libkdepim/categoryeditdialog.h18
-rw-r--r--libkdepim/categoryeditdialog_base.cpp20
-rw-r--r--libkdepim/categoryeditdialog_base.h26
-rw-r--r--libkdepim/categoryselectdialog.cpp43
-rw-r--r--libkdepim/categoryselectdialog.h10
-rw-r--r--libkdepim/categoryselectdialog_base.cpp19
-rw-r--r--libkdepim/categoryselectdialog_base.h26
-rw-r--r--libkdepim/externalapphandler.cpp30
-rw-r--r--libkdepim/externalapphandler.h15
-rw-r--r--libkdepim/kcmconfigs/kcmkdepimconfig.cpp4
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp53
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.h6
-rw-r--r--libkdepim/kdateedit.cpp40
-rw-r--r--libkdepim/kdateedit.h11
-rw-r--r--libkdepim/kdatepicker.cpp8
-rw-r--r--libkdepim/kdatepicker.h7
-rw-r--r--libkdepim/kpimglobalprefs.cpp10
-rw-r--r--libkdepim/kpimglobalprefs.h4
-rw-r--r--libkdepim/kprefsdialog.cpp19
-rw-r--r--libkdepim/kprefsdialog.h12
-rw-r--r--libkdepim/kprefswidget.cpp19
-rw-r--r--libkdepim/kprefswidget.h12
-rw-r--r--libkdepim/ksyncmanager.cpp97
-rw-r--r--libkdepim/ksyncmanager.h26
-rw-r--r--libkdepim/ksyncprefsdialog.cpp130
-rw-r--r--libkdepim/ksyncprefsdialog.h30
-rw-r--r--libkdepim/ksyncprofile.h2
-rw-r--r--libkdepim/libkdepim.pro4
-rw-r--r--libkdepim/libkdepimE.pro6
-rwxr-xr-xlibkdepim/ol_access.cpp52
-rwxr-xr-xlibkdepim/ol_access.h4
-rw-r--r--libkdepim/phoneaccess.cpp15
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp194
-rw-r--r--microkde/KDGanttMinimizeSplitter.h35
-rwxr-xr-xmicrokde/fncolordialog.h16
-rw-r--r--microkde/kapplication.cpp33
-rw-r--r--microkde/kcolorbutton.cpp3
-rw-r--r--microkde/kconfig.cpp30
-rw-r--r--microkde/kconfig.h6
-rw-r--r--microkde/kdatepickernew.cpp2
-rw-r--r--microkde/kdatetbl.cpp99
-rw-r--r--microkde/kdatetbl.h20
-rw-r--r--microkde/kdebug.h4
-rw-r--r--microkde/kdecore/kcatalogue.cpp4
-rw-r--r--microkde/kdecore/kconfigbase.h4
-rw-r--r--microkde/kdecore/klibloader.cpp29
-rw-r--r--microkde/kdecore/klibloader.h10
-rw-r--r--microkde/kdecore/klocale.cpp23
-rw-r--r--microkde/kdecore/klocale.h4
-rw-r--r--microkde/kdecore/kmdcodec.cpp139
-rw-r--r--microkde/kdecore/kmdcodec.h38
-rw-r--r--microkde/kdecore/kprefs.cpp16
-rw-r--r--microkde/kdecore/kprefs.h10
-rw-r--r--microkde/kdecore/kshortcut.h8
-rw-r--r--microkde/kdecore/kstandarddirs.cpp24
-rw-r--r--microkde/kdecore/kstandarddirs.h10
-rw-r--r--microkde/kdeui/kaction.cpp75
-rw-r--r--microkde/kdeui/kaction.h26
-rw-r--r--microkde/kdeui/kactionclasses.cpp111
-rw-r--r--microkde/kdeui/kactionclasses.h51
-rw-r--r--microkde/kdeui/kactioncollection.cpp50
-rw-r--r--microkde/kdeui/kactioncollection.h4
-rw-r--r--microkde/kdeui/kbuttonbox.cpp18
-rw-r--r--microkde/kdeui/kbuttonbox.h4
-rw-r--r--microkde/kdeui/kguiitem.cpp14
-rw-r--r--microkde/kdeui/kguiitem.h12
-rw-r--r--microkde/kdeui/kjanuswidget.cpp140
-rw-r--r--microkde/kdeui/kjanuswidget.h56
-rw-r--r--microkde/kdeui/klistbox.cpp56
-rw-r--r--microkde/kdeui/klistbox.h25
-rw-r--r--microkde/kdeui/klistview.cpp337
-rw-r--r--microkde/kdeui/klistview.h121
-rw-r--r--microkde/kdeui/kmainwindow.cpp97
-rw-r--r--microkde/kdeui/kmainwindow.h19
-rw-r--r--microkde/kdeui/knuminput.cpp61
-rw-r--r--microkde/kdeui/knuminput.h15
-rw-r--r--microkde/kdeui/kpopupmenu.cpp5
-rw-r--r--microkde/kdeui/kpopupmenu.h6
-rw-r--r--microkde/kdeui/kseparator.cpp18
-rw-r--r--microkde/kdeui/kseparator.h8
-rw-r--r--microkde/kdeui/ksqueezedtextlabel.cpp3
-rw-r--r--microkde/kdeui/ksqueezedtextlabel.h2
-rw-r--r--microkde/kdeui/kstdaction.cpp2
-rw-r--r--microkde/kdeui/ktoolbar.cpp185
-rw-r--r--microkde/kdeui/ktoolbar.h68
-rw-r--r--microkde/kdeui/ktoolbarbutton.cpp106
-rw-r--r--microkde/kdeui/ktoolbarbutton.h17
-rw-r--r--microkde/kdeui/ktoolbarhandler.cpp26
-rw-r--r--microkde/kdeui/ktoolbarhandler.h10
-rw-r--r--microkde/kdeui/kxmlguiclient.cpp12
-rw-r--r--microkde/kdeui/kxmlguiclient.h6
-rw-r--r--microkde/kdialog.cpp10
-rw-r--r--microkde/kdialog.h6
-rw-r--r--microkde/kdialogbase.cpp20
-rw-r--r--microkde/kdialogbase.h16
-rw-r--r--microkde/keditlistbox.cpp33
-rw-r--r--microkde/keditlistbox.h16
-rw-r--r--microkde/kfiledialog.cpp14
-rw-r--r--microkde/kfontdialog.cpp4
-rw-r--r--microkde/kglobal.cpp5
-rw-r--r--microkde/kglobalsettings.cpp1
-rw-r--r--microkde/kiconloader.cpp12
-rw-r--r--microkde/kiconloader.h4
-rw-r--r--microkde/kio/kfile/kurlrequester.cpp10
-rw-r--r--microkde/kio/kfile/kurlrequester.h4
-rw-r--r--microkde/kio/kio/kdirwatch.cpp12
-rw-r--r--microkde/kio/kio/kdirwatch_p.h10
-rw-r--r--microkde/klineedit.h2
-rw-r--r--microkde/klineeditdlg.h4
-rw-r--r--microkde/kresources/configdialog.cpp17
-rw-r--r--microkde/kresources/configpage.cpp38
-rw-r--r--microkde/kresources/configpage.h10
-rw-r--r--microkde/kresources/factory.cpp6
-rw-r--r--microkde/kresources/factory.h4
-rw-r--r--microkde/kresources/kcmkresources.cpp7
-rw-r--r--microkde/kresources/manager.h8
-rw-r--r--microkde/kresources/managerimpl.cpp10
-rw-r--r--microkde/kresources/managerimpl.h8
-rw-r--r--microkde/kresources/resource.h4
-rw-r--r--microkde/kresources/selectdialog.cpp22
-rw-r--r--microkde/kresources/selectdialog.h10
-rw-r--r--microkde/ksystemtray.cpp3
-rw-r--r--microkde/ksystemtray.h2
-rw-r--r--microkde/ktempfile.cpp4
-rw-r--r--microkde/ktempfile.h4
-rw-r--r--microkde/ktextedit.cpp16
-rw-r--r--microkde/ktextedit.h6
-rw-r--r--microkde/kurl.cpp30
-rw-r--r--microkde/kurl.h14
-rw-r--r--microkde/kutils/kcmultidialog.cpp16
-rw-r--r--microkde/kutils/kcmultidialog.h8
-rw-r--r--microkde/microkde.pro4
-rw-r--r--microkde/microkdeE.pro2
-rw-r--r--microkde/ofileselector_p.cpp2
-rw-r--r--microkde/ofileselector_p.h2
-rw-r--r--microkde/qlayoutengine_p.h8
-rw-r--r--pwmanager/libcrypt/cipher/cipher.pro2
-rw-r--r--pwmanager/libcrypt/error/error.pro4
-rw-r--r--pwmanager/libcrypt/mpi/mpi.pro2
-rw-r--r--pwmanager/libcrypt/zlib/zlib.pro2
-rw-r--r--pwmanager/pwmanager/addentrywnd_emb.cpp19
-rw-r--r--pwmanager/pwmanager/addentrywnd_emb.h17
-rw-r--r--pwmanager/pwmanager/addentrywndimpl.cpp6
-rw-r--r--pwmanager/pwmanager/addentrywndimpl.h10
-rw-r--r--pwmanager/pwmanager/binentrygen.h2
-rw-r--r--pwmanager/pwmanager/commentbox.cpp12
-rw-r--r--pwmanager/pwmanager/commentbox.h8
-rw-r--r--pwmanager/pwmanager/csv.cpp36
-rw-r--r--pwmanager/pwmanager/csv.h6
-rw-r--r--pwmanager/pwmanager/editcategory.cpp8
-rw-r--r--pwmanager/pwmanager/editcategory.h15
-rw-r--r--pwmanager/pwmanager/findwnd_emb.cpp8
-rw-r--r--pwmanager/pwmanager/findwndimpl.cpp4
-rw-r--r--pwmanager/pwmanager/genpasswd.cpp4
-rw-r--r--pwmanager/pwmanager/genpasswd.h4
-rw-r--r--pwmanager/pwmanager/getkeycardwnd.cpp13
-rw-r--r--pwmanager/pwmanager/getkeycardwnd.h12
-rw-r--r--pwmanager/pwmanager/getmasterpwwnd_emb.cpp9
-rw-r--r--pwmanager/pwmanager/getmasterpwwndimpl.cpp4
-rw-r--r--pwmanager/pwmanager/globalstuff.h4
-rw-r--r--pwmanager/pwmanager/htmlgen.cpp2
-rw-r--r--pwmanager/pwmanager/ipc.cpp12
-rw-r--r--pwmanager/pwmanager/ipc.h4
-rw-r--r--pwmanager/pwmanager/kcmconfigs/kcmpwmconfig.cpp4
-rw-r--r--pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp27
-rw-r--r--pwmanager/pwmanager/listobjselectwnd.cpp19
-rw-r--r--pwmanager/pwmanager/listobjselectwnd.h18
-rw-r--r--pwmanager/pwmanager/listviewpwm.cpp17
-rw-r--r--pwmanager/pwmanager/listviewpwm.h7
-rw-r--r--pwmanager/pwmanager/main.cpp1
-rw-r--r--pwmanager/pwmanager/printtext.h4
-rw-r--r--pwmanager/pwmanager/pwgenwnd_emb.cpp15
-rw-r--r--pwmanager/pwmanager/pwgenwndimpl.cpp2
-rw-r--r--pwmanager/pwmanager/pwgenwndimpl.h2
-rw-r--r--pwmanager/pwmanager/pwm.cpp68
-rw-r--r--pwmanager/pwmanager/pwm.h11
-rw-r--r--pwmanager/pwmanager/pwmanager.pro6
-rw-r--r--pwmanager/pwmanager/pwmanagerE.pro4
-rw-r--r--pwmanager/pwmanager/pwmdoc.cpp26
-rw-r--r--pwmanager/pwmanager/pwmdoc.h4
-rw-r--r--pwmanager/pwmanager/pwmdocui.cpp4
-rw-r--r--pwmanager/pwmanager/pwminit.cpp21
-rw-r--r--pwmanager/pwmanager/pwminit.h11
-rw-r--r--pwmanager/pwmanager/pwmprefs.h6
-rw-r--r--pwmanager/pwmanager/pwmtray.cpp23
-rw-r--r--pwmanager/pwmanager/pwmtray.h36
-rw-r--r--pwmanager/pwmanager/pwmview.cpp48
-rw-r--r--pwmanager/pwmanager/pwmview.h18
-rw-r--r--pwmanager/pwmanager/pwmviewstyle.cpp26
-rw-r--r--pwmanager/pwmanager/pwmviewstyle.h16
-rw-r--r--pwmanager/pwmanager/pwmviewstyle_0.cpp15
-rw-r--r--pwmanager/pwmanager/pwmviewstyle_0.h12
-rw-r--r--pwmanager/pwmanager/pwmviewstyle_1.cpp30
-rw-r--r--pwmanager/pwmanager/pwmviewstyle_1.h18
-rw-r--r--pwmanager/pwmanager/randomizer.cpp6
-rw-r--r--pwmanager/pwmanager/rencatwnd.cpp13
-rw-r--r--pwmanager/pwmanager/rencatwnd.h12
-rw-r--r--pwmanager/pwmanager/serializer.cpp18
-rw-r--r--pwmanager/pwmanager/serializer.h8
-rw-r--r--pwmanager/pwmanager/setmasterpwwnd_emb.cpp15
-rw-r--r--pwmanager/pwmanager/setmasterpwwnd_emb.h2
-rw-r--r--pwmanager/pwmanager/setmasterpwwndimpl.cpp4
-rw-r--r--pwmanager/pwmanager/waitwnd.cpp12
-rw-r--r--pwmanager/pwmanager/waitwnd.h9
-rw-r--r--qtcompat/qptrlist.h4
-rw-r--r--qtcompat/qptrstack.h4
708 files changed, 7875 insertions, 6766 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 594d47d..0000000
--- a/Makefile
+++ b/dev/null
@@ -1,385 +0,0 @@
1export KDEPIMDIR = $(shell pwd)
2
3export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version)
4
5ifeq ($(PLATFORM) , zaurus)
6 BUILD_NO_LDAP_PLUGIN=1
7endif
8
9ifneq ($(PLATFORM) , zaurus)
10 BUILD_NO_SHARP_PLUGIN=1
11endif
12
13#opie plugin is deprecated. The qtopia plugin handles the task from now on.
14BUILD_NO_OPIE_PLUGIN=1
15
16SUBDIRS_MICROKDE = \
17 libical/src/libical \
18 libical/src/libicalss \
19 qtcompat \
20 microkde \
21 libkcal \
22 libkdepim \
23 kabc \
24 kabc/formats/binary \
25 kabc/plugins/file \
26 kabc/plugins/dir \
27 korganizer \
28 kalarmd \
29 kaddressbook
30
31SUBDIRS_QTOPIA_PLUGIN = \
32 kabc/plugins/qtopia
33
34SUBDIRS_OPIE_PLUGIN = \
35 kabc/plugins/opie
36
37SUBDIRS_SHARP_PLUGIN = \
38 kabc/plugins/sharpdtm
39
40SUBDIRS_LDAP_PLUGIN = \
41 kabc/plugins/ldap
42
43SUBDIRS_MICROMAIL = \
44 libetpan \
45 kmicromail/libmailwrapper \
46 kmicromail
47
48SUBDIRS_GAMMU = \
49 gammu/emb/common \
50 gammu/emb/gammu
51
52SUBDIRS_PWMANAGER = \
53 pwmanager/libcrypt/mpi \
54 pwmanager/libcrypt/error \
55 pwmanager/libcrypt/cipher \
56 pwmanager/libcrypt/zlib \
57 pwmanager/pwmanager
58
59SUBDIRS = \
60 $(SUBDIRS_MICROKDE) \
61 $(SUBDIRS_QTOPIA_PLUGIN) \
62 $(SUBDIRS_OPIE_PLUGIN) \
63 $(SUBDIRS_SHARP_PLUGIN) \
64 $(SUBDIRS_LDAP_PLUGIN) \
65 $(SUBDIRS_MICROMAIL) \
66 $(SUBDIRS_GAMMU) \
67 $(SUBDIRS_PWMANAGER)
68
69
70all: build_microkde \
71 build_qtopia_plugin \
72 build_opie_plugin \
73 build_sharp_plugin \
74 build_ldap_plugin \
75 build_micromail \
76 build_gammu \
77 build_pwmanager
78
79
80build_microkde: variable_test tmake
81 for i in $(SUBDIRS_MICROKDE); do pushd $$i; \
82 make -f Makefile$(PLATFORM) || exit 1; popd; \
83 done
84
85build_qtopia_plugin: build_microkde
86 ifdef BUILD_NO_QTOPIA_PLUGIN
87 @echo == qtopia plugin not build.
88 else
89 for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \
90 make -f Makefile$(PLATFORM) || exit 1; popd; \
91 done
92 endif
93
94build_opie_plugin: build_microkde
95 ifdef BUILD_NO_OPIE_PLUGIN
96 @echo == opie plugin not build.
97 else
98 for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \
99 make -f Makefile$(PLATFORM) || exit 1; popd; \
100 done
101 endif
102
103build_sharp_plugin: build_microkde
104 ifdef BUILD_NO_SHARP_PLUGIN
105 @echo == ldap plugin not build.
106 else
107 for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \
108 make -f Makefile$(PLATFORM) || exit 1; popd; \
109 done
110 endif
111
112build_ldap_plugin: build_microkde
113 ifdef BUILD_NO_LDAP_PLUGIN
114 @echo == ldap plugin not build.
115 else
116 for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \
117 make -f Makefile$(PLATFORM) || exit 1; popd; \
118 done
119 endif
120
121
122build_micromail: build_microkde
123 ifdef BUILD_NO_MICROMAIL
124 @echo == kmicromail not build.
125 else
126 for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \
127 make -f Makefile$(PLATFORM) || exit 1; popd; \
128 done
129 endif
130
131build_gammu: variable_test tmake
132 ifdef BUILD_NO_GAMMU
133 @echo == gammu not build.
134 else
135 for i in $(SUBDIRS_GAMMU); do pushd $$i; \
136 make -f Makefile$(PLATFORM) || exit 1; popd; \
137 done
138 endif
139
140build_pwmanager: build_microkde
141 ifdef BUILD_NO_PWMANAGER
142 @echo == pwmanager not build.
143 else
144 for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \
145 make -f Makefile$(PLATFORM) || exit 1; popd; \
146 done
147 endif
148
149
150variable_info:
151 @echo --------------------------------------
152 @echo KDEPIM buildsystem, variableinfo...
153 @echo KDEPIMDIR=$(KDEPIMDIR)
154 @echo QTDIR=$(QTDIR)
155 @echo QPEDIR=$(QPEDIR)
156 @echo OPIEDIR=$(OPIEDIR)
157 @echo PLATFORM=$(PLATFORM)
158 @echo RELEASE_DEBUG=$(RELEASE_DEBUG)
159 @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL)
160 @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN)
161 @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN)
162 @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN)
163 @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN)
164 ifndef BUILD_NO_SHARP_PLUGIN
165 @echo SHARPDTMSDK=$(SHARPDTMSDK)
166 endif
167 @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU)
168 @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER)
169 @echo --------------------------------------
170
171variable_test: variable_info
172 @echo KDEPIM buildsystem, variablecheck...
173 ifndef KDEPIMDIR
174 @echo KDEPIMDIR is not defined.
175 $(error KDEPIMDIR is not defined)
176 endif
177 ifndef PLATFORM
178 @echo PLATFORM is not defined.
179 $(error PLATFORM is not defined)
180 endif
181 ifdef BUILD_NO_LDAP_PLUGIN
182 @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN)
183 endif
184 ifdef BUILD_NO_OPIE_PLUGIN
185 @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN)
186 endif
187 ifdef BUILD_NO_QTOPIA_PLUGIN
188 @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN)
189 endif
190 ifdef BUILD_NO_MICROMAIL
191 @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL)
192 endif
193 ifdef BUILD_NO_SHARP_PLUGIN
194 @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN)
195 else
196 ifndef SHARPDTMSDK
197 @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK)
198 $(error SHARPDTMSDK is not defined)
199 endif
200 endif
201 ifdef BUILD_NO_GAMMU
202 @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU)
203 endif
204 ifdef BUILD_NO_PWMANAGER
205 @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER)
206 endif
207 @echo --------------------------------------
208
209
210objects:
211 for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done
212 for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done
213 mkdir -p libical/lib/$(PLATFORM)
214 mkdir -p dest
215 mkdir -p dest$(LIBICAL_PATH)
216 mkdir -p pwmanager/libcrypt/$(PLATFORM)
217
218clean:
219 rm -rf libical/lib/$(PLATFORM)/*;
220 rm -rf pwmanager/libcrypt/$(PLATFORM)/*;
221 for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\
222 rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \
223 done
224
225pac:
226 rm -f $(QPEDIR)/lib/libmicro*
227 rm -f $(QPEDIR)/plugins/applets/libkopi*
228 make
229 make install
230 make dist
231install:
232
233 cd bin/kdepim; make install
234 cp -r Pim $(QPEDIR)/apps
235 cp db2file/db2file $(QPEDIR)/bin/db2file
236 chmod ugo+x $(QPEDIR)/bin/db2file
237 cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop
238 cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop
239 cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop
240 cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop
241
242dist:
243 @echo Dont forget to do "make install" before "make dist"
244 rm -f *arm.ipk
245 rm -f *ipk.zip
246 rm -rf ../kdepimpi_$(KDEPIM_VERSION)/*
247 rm -f *~
248 cd ..;mkdir -p kdepimpi_$(KDEPIM_VERSION)
249 cd ../kdepimpi_$(KDEPIM_VERSION);mkdir -p ipk
250 cd ..; tar czf kdepimpi-$(KDEPIM_VERSION).tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim
251 mkipks kmicrokdelibs.control
252 mkipks korganizer.control
253 mkipks kaddressbook.control
254 ifndef BUILD_NO_MICROMAIL
255 mkipks kopiemail.control
256 endif
257 ifndef BUILD_NO_SHARP_PLUGIN
258 mkipks ksharpPIM-DTMaccess.control
259 endif
260 mkipks korganizer-alarm.control
261 ifndef BUILD_NO_GAMMU
262 mkipks kmobilephoneaccess.control
263 endif
264 ifndef BUILD_NO_PWMANAGER
265 mkipks pwmanager.control
266 endif
267 mkipks pimTABicon.control
268 zip kdepim_$(KDEPIM_VERSION)_for_SharpRom.ipk.zip *.ipk ReleaseNotes.txt
269 mv *.ipk ../kdepimpi_$(KDEPIM_VERSION)/ipk/
270 mv *for_SharpRom.ipk.zip ../kdepimpi_$(KDEPIM_VERSION)/
271 mv ../kdepimpi-$(KDEPIM_VERSION).tar.gz ../kdepimpi_$(KDEPIM_VERSION)/
272
273tmake: objects \
274 qtcompat/Makefile$(PLATFORM) \
275 microkde/Makefile$(PLATFORM) \
276 libkcal/Makefile$(PLATFORM) \
277 libkdepim/Makefile$(PLATFORM) \
278 korganizer/Makefile$(PLATFORM) \
279 kalarmd/Makefile$(PLATFORM) \
280 libical/src/libical/Makefile$(PLATFORM) \
281 libical/src/libicalss/Makefile$(PLATFORM) \
282 kabc/Makefile$(PLATFORM) \
283 kabc/formats/binary/Makefile$(PLATFORM) \
284 kabc/plugins/file/Makefile$(PLATFORM) \
285 kabc/plugins/dir/Makefile$(PLATFORM) \
286 kabc/plugins/ldap/Makefile$(PLATFORM) \
287 kabc/plugins/opie/Makefile$(PLATFORM) \
288 kabc/plugins/qtopia/Makefile$(PLATFORM) \
289 kabc/plugins/sharpdtm/Makefile$(PLATFORM) \
290 kaddressbook/Makefile$(PLATFORM) \
291 kmicromail/Makefile$(PLATFORM) \
292 libetpan/Makefile$(PLATFORM) \
293 kmicromail/libmailwrapper/Makefile$(PLATFORM) \
294 gammu/emb/common/Makefile$(PLATFORM) \
295 gammu/emb/gammu/Makefile$(PLATFORM) \
296 pwmanager/pwmanager/Makefile$(PLATFORM) \
297 pwmanager/libcrypt/mpi/Makefile$(PLATFORM) \
298 pwmanager/libcrypt/error/Makefile$(PLATFORM) \
299 pwmanager/libcrypt/cipher/Makefile$(PLATFORM) \
300 pwmanager/libcrypt/zlib/Makefile$(PLATFORM)
301
302qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro
303 cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM)
304
305microkde/Makefile$(PLATFORM): microkde/microkdeE.pro
306 cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM)
307
308libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro
309 cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM)
310
311
312libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro
313 cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM)
314
315kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro
316 cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM)
317
318korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro
319 cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM)
320
321libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro
322 cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM)
323
324libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro
325 cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM)
326
327kabc/Makefile$(PLATFORM): kabc/kabcE.pro
328 cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM)
329
330kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro
331 cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM)
332
333kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro
334 cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM)
335
336kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro
337 cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM)
338
339kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro
340 cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM)
341
342kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro
343 cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM)
344
345kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro
346 cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM)
347
348kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro
349 cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM)
350
351kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro
352 cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM)
353
354kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro
355 cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM)
356
357libetpan/Makefile$(PLATFORM): libetpan/libetpanE.pro
358 cd libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM)
359
360kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro
361 cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM)
362
363gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro
364 cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM)
365
366gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro
367 cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM)
368
369pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro
370 cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM)
371
372
373pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro
374 cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM)
375
376pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro
377 cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM)
378
379pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro
380 cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM)
381
382pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro
383 cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM)
384
385
diff --git a/gammu/emb/common/common.pro b/gammu/emb/common/common.pro
index af45382..65fd303 100644
--- a/gammu/emb/common/common.pro
+++ b/gammu/emb/common/common.pro
@@ -161,34 +161,36 @@ phone/nokia/dct3/n9210.c \
161phone/nokia/dct3/dct3func.c \ 161phone/nokia/dct3/dct3func.c \
162phone/nokia/dct4/n3320.c \ 162phone/nokia/dct4/n3320.c \
163phone/nokia/dct4/n3650.c \ 163phone/nokia/dct4/n3650.c \
164phone/nokia/dct4/n6510.c \ 164phone/nokia/dct4/n6510.c \
165phone/nokia/dct4/dct4func.c \ 165phone/nokia/dct4/dct4func.c \
166phone/nokia/nauto.c \ 166phone/nokia/nauto.c \
167phone/nokia/nfunc.c \ 167phone/nokia/nfunc.c \
168phone/nokia/nfuncold.c \ 168phone/nokia/nfuncold.c \
169phone/obex/obexgen.c \ 169phone/obex/obexgen.c \
170phone/symbian/mroutgen.c 170phone/symbian/mroutgen.c
171 171
172DEFINES += DESKTOP_VERSION 172DEFINES += DESKTOP_VERSION
173TARGET = microgammu 173TARGET = xmicrogammu
174CONFIG = warn_off release console 174CONFIG = warn_off release console
175DESTDIR = ../../../bin 175DESTDIR = ../../../bin
176OBJECTS_DIR = obj/unix 176OBJECTS_DIR = obj/unix
177MOC_DIR = moc/unix 177MOC_DIR = moc/unix
178 178
179unix: { 179unix: {
180HEADERS += device/serial/ser_unx.h \ 180HEADERS += device/serial/ser_unx.h \
181 device/irda/irda_unx.h 181 device/irda/irda_unx.h
182 182
183SOURCES += device/serial/ser_unx.c \ 183SOURCES += device/serial/ser_unx.c \
184 184
185} 185}
186win32:{ 186win32:{
187 187
188HEADERS += device/serial/ser_w32.h \ 188HEADERS += device/serial/ser_w32.h \
189 device/irda/irda_w32.h \ 189 device/irda/irda_w32.h \
190 device/bluetoth/blue_w32.h 190 device/bluetoth/blue_w32.h
191 191
192SOURCES += device/serial/ser_w32.c \ 192SOURCES += device/serial/ser_w32.c \
193 device/bluetoth/blue_w32.c 193 device/bluetoth/blue_w32.c
194} 194}
195#The following line was inserted by qt3to4
196QT += xml qt3support
diff --git a/gammu/emb/common/device/bluetoth/blue_w32.c b/gammu/emb/common/device/bluetoth/blue_w32.c
index a631c9f..8a367f4 100644
--- a/gammu/emb/common/device/bluetoth/blue_w32.c
+++ b/gammu/emb/common/device/bluetoth/blue_w32.c
@@ -79,25 +79,25 @@ GSM_Error bluetooth_connect(GSM_StateMachine *s, int port, char *device)
79 79
80static GSM_Error bluetooth_checkdevice(GSM_StateMachine *s, char *address, WSAPROTOCOL_INFO *protocolInfo) 80static GSM_Error bluetooth_checkdevice(GSM_StateMachine *s, char *address, WSAPROTOCOL_INFO *protocolInfo)
81{ 81{
82 GSM_Device_BlueToothData *d = &s->Device.Data.BlueTooth; 82 GSM_Device_BlueToothData *d = &s->Device.Data.BlueTooth;
83 WSAQUERYSET querySet; 83 WSAQUERYSET querySet;
84 DWORD flags; 84 DWORD flags;
85 GUID protocol; 85 GUID protocol;
86 int i, result; 86 int i, result;
87 BYTE buffer[2000]; 87 BYTE buffer[2000];
88 char addressAsString[1000]; 88 char addressAsString[1000];
89 DWORD bufferLength, addressSize; 89 DWORD bufferLength, addressSize;
90 WSAQUERYSET *pResults = (WSAQUERYSET*)&buffer; 90 WSAQUERYSET *pResults = (WSAQUERYSET*)&buffer;
91 HANDLE handle; 91 Qt::HANDLE handle;
92 GSM_Error error; 92 GSM_Error error;
93 93
94 memset(&querySet, 0, sizeof(querySet)); 94 memset(&querySet, 0, sizeof(querySet));
95 querySet.dwSize = sizeof(querySet); 95 querySet.dwSize = sizeof(querySet);
96 protocol = L2CAP_PROTOCOL_UUID; 96 protocol = L2CAP_PROTOCOL_UUID;
97 querySet.lpServiceClassId = &protocol; 97 querySet.lpServiceClassId = &protocol;
98 querySet.dwNameSpace = NS_BTH; 98 querySet.dwNameSpace = NS_BTH;
99 querySet.lpszContext = address; 99 querySet.lpszContext = address;
100 100
101 flags = LUP_FLUSHCACHE | LUP_RETURN_NAME | 101 flags = LUP_FLUSHCACHE | LUP_RETURN_NAME |
102 LUP_RETURN_TYPE | LUP_RETURN_ADDR | 102 LUP_RETURN_TYPE | LUP_RETURN_ADDR |
103 LUP_RETURN_BLOB | LUP_RETURN_COMMENT; 103 LUP_RETURN_BLOB | LUP_RETURN_COMMENT;
@@ -129,25 +129,25 @@ static GSM_Error bluetooth_checkdevice(GSM_StateMachine *s, char *address, WSAPR
129 } 129 }
130 } 130 }
131 result = WSALookupServiceEnd(handle); 131 result = WSALookupServiceEnd(handle);
132 return ERR_NOTSUPPORTED; 132 return ERR_NOTSUPPORTED;
133} 133}
134 134
135GSM_Error bluetooth_findchannel(GSM_StateMachine *s) 135GSM_Error bluetooth_findchannel(GSM_StateMachine *s)
136{ 136{
137 GSM_Device_BlueToothData *d = &s->Device.Data.BlueTooth; 137 GSM_Device_BlueToothData *d = &s->Device.Data.BlueTooth;
138 WSADATA wsaData; 138 WSADATA wsaData;
139 int i, protocolInfoSize, result; 139 int i, protocolInfoSize, result;
140 WSAPROTOCOL_INFO protocolInfo; 140 WSAPROTOCOL_INFO protocolInfo;
141 HANDLE handle; 141 Qt::HANDLE handle;
142 DWORD flags; 142 DWORD flags;
143 WSAQUERYSET querySet; 143 WSAQUERYSET querySet;
144 BYTE buffer[2000]; 144 BYTE buffer[2000];
145 char addressAsString[1000]; 145 char addressAsString[1000];
146 DWORD bufferLength, addressSize; 146 DWORD bufferLength, addressSize;
147 WSAQUERYSET *pResults = (WSAQUERYSET*)&buffer; 147 WSAQUERYSET *pResults = (WSAQUERYSET*)&buffer;
148 GSM_Error error; 148 GSM_Error error;
149 149
150 if (WSAStartup(MAKEWORD(2,2), &wsaData)!=0x00) return ERR_DEVICENODRIVER; 150 if (WSAStartup(MAKEWORD(2,2), &wsaData)!=0x00) return ERR_DEVICENODRIVER;
151 151
152 d->hPhone = socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM); 152 d->hPhone = socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
153 if (d->hPhone == INVALID_SOCKET) { 153 if (d->hPhone == INVALID_SOCKET) {
diff --git a/gammu/emb/common/device/bluetoth/blue_w32.h b/gammu/emb/common/device/bluetoth/blue_w32.h
index e457c92..409f4b1 100644
--- a/gammu/emb/common/device/bluetoth/blue_w32.h
+++ b/gammu/emb/common/device/bluetoth/blue_w32.h
@@ -110,33 +110,33 @@ DEFINE_GUID(L2CAP_PROTOCOL_UUID, 0x00000100, 0x0000, 0x1000, 0x80, 0x00, 0x00,
110 110
111WINSOCK_API_LINKAGE INT WSAAPI 111WINSOCK_API_LINKAGE INT WSAAPI
112WSALookupServiceBeginA( 112WSALookupServiceBeginA(
113 IN LPWSAQUERYSETA lpqsRestrictions, 113 IN LPWSAQUERYSETA lpqsRestrictions,
114 IN DWORD dwControlFlags, 114 IN DWORD dwControlFlags,
115 OUT LPHANDLE lphLookup 115 OUT LPHANDLE lphLookup
116 ); 116 );
117 117
118#define WSALookupServiceBegin WSALookupServiceBeginA 118#define WSALookupServiceBegin WSALookupServiceBeginA
119 119
120WINSOCK_API_LINKAGE INT WSAAPI 120WINSOCK_API_LINKAGE INT WSAAPI
121WSALookupServiceNextA( 121WSALookupServiceNextA(
122 IN HANDLE hLookup, 122 IN Qt::HANDLE hLookup,
123 IN DWORD dwControlFlags, 123 IN DWORD dwControlFlags,
124 IN OUT LPDWORD lpdwBufferLength, 124 IN OUT LPDWORD lpdwBufferLength,
125 OUT LPWSAQUERYSETA lpqsResults 125 OUT LPWSAQUERYSETA lpqsResults
126 ); 126 );
127 127
128#define WSALookupServiceNext WSALookupServiceNextA 128#define WSALookupServiceNext WSALookupServiceNextA
129 129
130WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceEnd(IN HANDLE hLookup); 130WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceEnd(IN Qt::HANDLE hLookup);
131 131
132#define MAX_PROTOCOL_CHAIN 7 132#define MAX_PROTOCOL_CHAIN 7
133 133
134typedef struct _WSAPROTOCOLCHAIN { 134typedef struct _WSAPROTOCOLCHAIN {
135 int ChainLen; /* the length of the chain, */ 135 int ChainLen; /* the length of the chain, */
136 /* length = 0 means layered protocol, */ 136 /* length = 0 means layered protocol, */
137 /* length = 1 means base protocol, */ 137 /* length = 1 means base protocol, */
138 /* length > 1 means protocol chain */ 138 /* length > 1 means protocol chain */
139 DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; /* a list of dwCatalogEntryIds */ 139 DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; /* a list of dwCatalogEntryIds */
140} WSAPROTOCOLCHAIN, FAR * LPWSAPROTOCOLCHAIN; 140} WSAPROTOCOLCHAIN, FAR * LPWSAPROTOCOLCHAIN;
141 141
142#define WSAPROTOCOL_LEN 255 142#define WSAPROTOCOL_LEN 255
diff --git a/gammu/emb/common/device/serial/ser_w32.h b/gammu/emb/common/device/serial/ser_w32.h
index d226f32..d1aa37a 100644
--- a/gammu/emb/common/device/serial/ser_w32.h
+++ b/gammu/emb/common/device/serial/ser_w32.h
@@ -1,19 +1,19 @@
1 1
2#ifdef WIN32 2#ifdef WIN32
3#ifndef winserial_h 3#ifndef winserial_h
4#define winserial_h 4#define winserial_h
5 5
6#include <windows.h> 6#include <windows.h>
7 7
8typedef struct { 8typedef struct {
9 HANDLE hPhone; 9 Qt::HANDLE hPhone;
10 DCB old_settings; 10 DCB old_settings;
11 OVERLAPPED osWrite,osRead; 11 OVERLAPPED osWrite,osRead;
12} GSM_Device_SerialData; 12} GSM_Device_SerialData;
13 13
14#endif 14#endif
15#endif 15#endif
16 16
17/* How should editor hadle tabs in this file? Add editor commands here. 17/* How should editor hadle tabs in this file? Add editor commands here.
18 * vim: noexpandtab sw=8 ts=8 sts=8: 18 * vim: noexpandtab sw=8 ts=8 sts=8:
19 */ 19 */
diff --git a/gammu/emb/gammu/gammu.pro b/gammu/emb/gammu/gammu.pro
index c8aa3f0..e8ccac3 100644
--- a/gammu/emb/gammu/gammu.pro
+++ b/gammu/emb/gammu/gammu.pro
@@ -38,28 +38,30 @@ SOURCES += gammu.c \
38 smsd/s_files.c \ 38 smsd/s_files.c \
39 smsd/smsdcore.c \ 39 smsd/smsdcore.c \
40 depend/nokia/dct3.c \ 40 depend/nokia/dct3.c \
41 depend/nokia/dct4.c \ 41 depend/nokia/dct4.c \
42 depend/siemens/chiffre.c \ 42 depend/siemens/chiffre.c \
43 depend/siemens/dsiemens.c \ 43 depend/siemens/dsiemens.c \
44 depend/nokia/dct3trac/wmx-gsm.c \ 44 depend/nokia/dct3trac/wmx-gsm.c \
45 depend/nokia/dct3trac/wmx-list.c \ 45 depend/nokia/dct3trac/wmx-list.c \
46 depend/nokia/dct3trac/wmx-sim.c \ 46 depend/nokia/dct3trac/wmx-sim.c \
47 depend/nokia/dct3trac/wmx-util.c \ 47 depend/nokia/dct3trac/wmx-util.c \
48 depend/nokia/dct3trac/wmx.c 48 depend/nokia/dct3trac/wmx.c
49unix : { 49unix : {
50LIBS += ../../../bin/libmicrogammu.so /usr/lib/libpthread.so 50LIBS += ../../../bin/libxmicrogammu.so -lpthread
51# bluetooth disabled for now 51# bluetooth disabled for now
52#/usr/lib/libbluetooth.so /usr/lib/libsdp.so 52#/usr/lib/libbluetooth.so /usr/lib/libsdp.so
53OBJECTS_DIR = obj/unix 53OBJECTS_DIR = obj/unix
54} 54}
55win32 : { 55win32 : {
56 CONFIG += qt warn_on 56 CONFIG += qt warn_on
57#LIBS += mfc71u.lib 57#LIBS += mfc71u.lib
58LIBS += libc.lib 58LIBS += libc.lib
59#LIBS += msvcrt.lib 59#LIBS += msvcrt.lib
60QMAKE_LINK += /NODEFAULTLIB:msvcrt 60QMAKE_LINK += /NODEFAULTLIB:msvcrt
61LIBS += ../../../bin/microgammu.lib 61LIBS += ../../../bin/microgammu.lib
62OBJECTS_DIR = obj/win 62OBJECTS_DIR = obj/win
63} 63}
64DESTDIR = ../../../bin 64DESTDIR = ../../../bin
65TARGET = kammu 65TARGET = kammu
66#The following line was inserted by qt3to4
67QT += xml qt3support
diff --git a/kabc/address.h b/kabc/address.h
index 38ad20b..41794fe 100644
--- a/kabc/address.h
+++ b/kabc/address.h
@@ -23,25 +23,25 @@ Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#ifndef KABC_ADDRESS_H 28#ifndef KABC_ADDRESS_H
29#define KABC_ADDRESS_H 29#define KABC_ADDRESS_H
30 30
31#include <qmap.h> 31#include <qmap.h>
32#include <qstring.h> 32#include <qstring.h>
33#include <qregexp.h> 33#include <qregexp.h>
34#include <qstringlist.h> 34#include <qstringlist.h>
35#include <qvaluelist.h> 35#include <q3valuelist.h>
36 36
37// template tags for address formatting localization 37// template tags for address formatting localization
38#define KABC_FMTTAG_realname QString("%n") 38#define KABC_FMTTAG_realname QString("%n")
39#define KABC_FMTTAG_REALNAME QString("%N") 39#define KABC_FMTTAG_REALNAME QString("%N")
40#define KABC_FMTTAG_company QString("%cm") 40#define KABC_FMTTAG_company QString("%cm")
41#define KABC_FMTTAG_COMPANY QString("%CM") 41#define KABC_FMTTAG_COMPANY QString("%CM")
42#define KABC_FMTTAG_pobox QString("%p") 42#define KABC_FMTTAG_pobox QString("%p")
43#define KABC_FMTTAG_street QString("%s") 43#define KABC_FMTTAG_street QString("%s")
44#define KABC_FMTTAG_STREET QString("%S") 44#define KABC_FMTTAG_STREET QString("%S")
45#define KABC_FMTTAG_zipcode QString("%z") 45#define KABC_FMTTAG_zipcode QString("%z")
46#define KABC_FMTTAG_location QString("%l") 46#define KABC_FMTTAG_location QString("%l")
47#define KABC_FMTTAG_LOCATION QString("%L") 47#define KABC_FMTTAG_LOCATION QString("%L")
@@ -59,26 +59,26 @@ namespace KABC {
59 59
60 This class represents information about a postal address. 60 This class represents information about a postal address.
61*/ 61*/
62class Address 62class Address
63{ 63{
64 friend QDataStream &operator<<( QDataStream &, const Address & ); 64 friend QDataStream &operator<<( QDataStream &, const Address & );
65 friend QDataStream &operator>>( QDataStream &, Address & ); 65 friend QDataStream &operator>>( QDataStream &, Address & );
66 66
67 public: 67 public:
68 /** 68 /**
69 List of addresses. 69 List of addresses.
70 */ 70 */
71 typedef QValueList<Address> List; 71 typedef Q3ValueList<Address> List;
72 typedef QValueList<int> TypeList; 72 typedef Q3ValueList<int> TypeList;
73 73
74 /** 74 /**
75 Address types: 75 Address types:
76 76
77 @li @p Dom - domestic 77 @li @p Dom - domestic
78 @li @p Intl - international 78 @li @p Intl - international
79 @li @p Postal - postal 79 @li @p Postal - postal
80 @li @p Parcel - parcel 80 @li @p Parcel - parcel
81 @li @p Home - home address 81 @li @p Home - home address
82 @li @p Work - address at work 82 @li @p Work - address at work
83 @li @p Pref - preferred address 83 @li @p Pref - preferred address
84 */ 84 */
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index fe59fcb..c700897 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -28,26 +28,26 @@ $Id$
28/*US 28/*US
29 29
30#include <qfile.h> 30#include <qfile.h>
31#include <qregexp.h> 31#include <qregexp.h>
32#include <qtimer.h> 32#include <qtimer.h>
33 33
34#include <kapplication.h> 34#include <kapplication.h>
35#include <kinstance.h> 35#include <kinstance.h>
36#include <kstandarddirs.h> 36#include <kstandarddirs.h>
37 37
38#include "errorhandler.h" 38#include "errorhandler.h"
39*/ 39*/
40#include <qptrlist.h> 40#include <q3ptrlist.h>
41#include <qtextstream.h> 41#include <q3textstream.h>
42#include <qfile.h> 42#include <qfile.h>
43#include <qregexp.h> 43#include <qregexp.h>
44 44
45#include <kglobal.h> 45#include <kglobal.h>
46#include <klocale.h> 46#include <klocale.h>
47#include <kmessagebox.h> 47#include <kmessagebox.h>
48#include <kdebug.h> 48#include <kdebug.h>
49#include <libkcal/syncdefines.h> 49#include <libkcal/syncdefines.h>
50#include <libkdepim/phoneaccess.h> 50#include <libkdepim/phoneaccess.h>
51#include "addressbook.h" 51#include "addressbook.h"
52#include "resource.h" 52#include "resource.h"
53#include "vcardconverter.h" 53#include "vcardconverter.h"
@@ -235,25 +235,25 @@ AddressBook::AddressBook( const QString &config )
235AddressBook::AddressBook( const QString &config, const QString &family ) 235AddressBook::AddressBook( const QString &config, const QString &family )
236{ 236{
237 init(config, family); 237 init(config, family);
238 238
239} 239}
240 240
241// the default family is "contact" 241// the default family is "contact"
242void AddressBook::init(const QString &config, const QString &family ) 242void AddressBook::init(const QString &config, const QString &family )
243{ 243{
244 blockLSEchange = false; 244 blockLSEchange = false;
245 d = new AddressBookData; 245 d = new AddressBookData;
246 QString fami = family; 246 QString fami = family;
247 if (config != 0) { 247 if (!config.isEmpty()) {
248 if ( family == "syncContact" ) { 248 if ( family == "syncContact" ) {
249 qDebug("creating sync config "); 249 qDebug("creating sync config ");
250 fami = "contact"; 250 fami = "contact";
251 KConfig* con = new KConfig( locateLocal("config", "syncContactrc") ); 251 KConfig* con = new KConfig( locateLocal("config", "syncContactrc") );
252 con->setGroup( "General" ); 252 con->setGroup( "General" );
253 con->writeEntry( "ResourceKeys", QString("sync") ); 253 con->writeEntry( "ResourceKeys", QString("sync") );
254 con->writeEntry( "Standard", QString("sync") ); 254 con->writeEntry( "Standard", QString("sync") );
255 con->setGroup( "Resource_sync" ); 255 con->setGroup( "Resource_sync" );
256 con->writeEntry( "FileName", config ); 256 con->writeEntry( "FileName", config );
257 con->writeEntry( "FileFormat", QString("vcard") ); 257 con->writeEntry( "FileFormat", QString("vcard") );
258 con->writeEntry( "ResourceIdentifier", QString("sync") ); 258 con->writeEntry( "ResourceIdentifier", QString("sync") );
259 con->writeEntry( "ResourceName", QString("sync_res") ); 259 con->writeEntry( "ResourceName", QString("sync_res") );
@@ -372,31 +372,31 @@ bool AddressBook::save( Ticket *ticket )
372 if ( ticket->resource() ) { 372 if ( ticket->resource() ) {
373 deleteRemovedAddressees(); 373 deleteRemovedAddressees();
374 return ticket->resource()->save( ticket ); 374 return ticket->resource()->save( ticket );
375 } 375 }
376 376
377 return false; 377 return false;
378} 378}
379// exports all Addressees, which are syncable 379// exports all Addressees, which are syncable
380void AddressBook::export2File( QString fileName, QString resourceName ) 380void AddressBook::export2File( QString fileName, QString resourceName )
381{ 381{
382 382
383 QFile outFile( fileName ); 383 QFile outFile( fileName );
384 if ( !outFile.open( IO_WriteOnly ) ) { 384 if ( !outFile.open( QIODevice::WriteOnly ) ) {
385 QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" ); 385 QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" );
386 KMessageBox::error( 0, text.arg( fileName ) ); 386 KMessageBox::error( 0, text.arg( fileName ) );
387 return ; 387 return ;
388 } 388 }
389 QTextStream t( &outFile ); 389 Q3TextStream t( &outFile );
390 t.setEncoding( QTextStream::UnicodeUTF8 ); 390 t.setEncoding( Q3TextStream::UnicodeUTF8 );
391 Iterator it; 391 Iterator it;
392 KABC::VCardConverter::Version version; 392 KABC::VCardConverter::Version version;
393 version = KABC::VCardConverter::v3_0; 393 version = KABC::VCardConverter::v3_0;
394 for ( it = begin(); it != end(); ++it ) { 394 for ( it = begin(); it != end(); ++it ) {
395 if ( (*it).resource() ) { 395 if ( (*it).resource() ) {
396 bool include = (*it).resource()->includeInSync(); 396 bool include = (*it).resource()->includeInSync();
397 if ( !resourceName.isEmpty() ) 397 if ( !resourceName.isEmpty() )
398 include = (resourceName == (*it).resource()->resourceName() ); 398 include = (resourceName == (*it).resource()->resourceName() );
399 if ( include ) { 399 if ( include ) {
400 //qDebug(QString ("Exporting resource %1 to file %2").arg( (*it).resource()->resourceName() ).arg( fileName ) ); 400 //qDebug(QString ("Exporting resource %1 to file %2").arg( (*it).resource()->resourceName() ).arg( fileName ) );
401 if ( !(*it).IDStr().isEmpty() ) { 401 if ( !(*it).IDStr().isEmpty() ) {
402 (*it).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*it).IDStr() ); 402 (*it).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*it).IDStr() );
@@ -459,47 +459,47 @@ bool AddressBook::export2PhoneFormat( QStringList uids ,QString fileName )
459 int sep = vcardnew.find(":", next); 459 int sep = vcardnew.find(":", next);
460 vcard +=vcardnew.mid( start, next - start+3); 460 vcard +=vcardnew.mid( start, next - start+3);
461 start = sep; 461 start = sep;
462 } 462 }
463 vcard += vcardnew.mid( start,vcardnew.length() ); 463 vcard += vcardnew.mid( start,vcardnew.length() );
464 vcard.replace ( QRegExp(";;;") , "" ); 464 vcard.replace ( QRegExp(";;;") , "" );
465 vcard.replace ( QRegExp(";;") , "" ); 465 vcard.replace ( QRegExp(";;") , "" );
466 datastream += vcard; 466 datastream += vcard;
467 467
468 } 468 }
469 469
470 QFile outFile(fileName); 470 QFile outFile(fileName);
471 if ( outFile.open(IO_WriteOnly) ) { 471 if ( outFile.open(QIODevice::WriteOnly) ) {
472 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 472 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
473 QTextStream t( &outFile ); // use a text stream 473 Q3TextStream t( &outFile ); // use a text stream
474 t.setEncoding( QTextStream::UnicodeUTF8 ); 474 t.setEncoding( Q3TextStream::UnicodeUTF8 );
475 t <<datastream; 475 t <<datastream;
476 t << "\r\n\r\n"; 476 t << "\r\n\r\n";
477 outFile.close(); 477 outFile.close();
478 478
479 } else { 479 } else {
480 qDebug("Error open temp file "); 480 qDebug("Error open temp file ");
481 return false; 481 return false;
482 } 482 }
483 return true; 483 return true;
484 484
485} 485}
486int AddressBook::importFromFile( QString fileName, bool replaceLabel, bool removeOld, QString resource ) 486int AddressBook::importFromFile( QString fileName, bool replaceLabel, bool removeOld, QString resource )
487{ 487{
488 488
489 if ( removeOld ) 489 if ( removeOld )
490 setUntagged( true, resource ); 490 setUntagged( true, resource );
491 KABC::Addressee::List list; 491 KABC::Addressee::List list;
492 QFile file( fileName ); 492 QFile file( fileName );
493 file.open( IO_ReadOnly ); 493 file.open( QIODevice::ReadOnly );
494 QByteArray rawData = file.readAll(); 494 QByteArray rawData = file.readAll();
495 file.close(); 495 file.close();
496 QString data; 496 QString data;
497 if ( replaceLabel ) { 497 if ( replaceLabel ) {
498 data = QString::fromLatin1( rawData.data(), rawData.size() + 1 ); 498 data = QString::fromLatin1( rawData.data(), rawData.size() + 1 );
499 data.replace ( QRegExp("LABEL") , "ADR" ); 499 data.replace ( QRegExp("LABEL") , "ADR" );
500 data.replace ( QRegExp("CHARSET=ISO-8859-1") , "" ); 500 data.replace ( QRegExp("CHARSET=ISO-8859-1") , "" );
501 } else 501 } else
502 data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); 502 data = QString::fromUtf8( rawData.data(), rawData.size() + 1 );
503 KABC::VCardTool tool; 503 KABC::VCardTool tool;
504 list = tool.parseVCards( data ); 504 list = tool.parseVCards( data );
505 KABC::Addressee::List::Iterator it; 505 KABC::Addressee::List::Iterator it;
@@ -625,25 +625,25 @@ void AddressBook::preparePhoneSync( QString currentSyncDevice, bool isPreSync )
625 (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); 625 (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
626 (*ait).setID( currentSyncDevice,id ); 626 (*ait).setID( currentSyncDevice,id );
627 627
628 } 628 }
629 } 629 }
630} 630}
631void AddressBook::findNewExtIds( QString fileName, QString currentSyncDevice ) 631void AddressBook::findNewExtIds( QString fileName, QString currentSyncDevice )
632{ 632{
633 633
634 setUntagged(); 634 setUntagged();
635 KABC::Addressee::List list; 635 KABC::Addressee::List list;
636 QFile file( fileName ); 636 QFile file( fileName );
637 file.open( IO_ReadOnly ); 637 file.open( QIODevice::ReadOnly );
638 QByteArray rawData = file.readAll(); 638 QByteArray rawData = file.readAll();
639 file.close(); 639 file.close();
640 QString data; 640 QString data;
641 641
642 data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); 642 data = QString::fromUtf8( rawData.data(), rawData.size() + 1 );
643 KABC::VCardTool tool; 643 KABC::VCardTool tool;
644 list = tool.parseVCards( data ); 644 list = tool.parseVCards( data );
645 KABC::Addressee::List::Iterator it; 645 KABC::Addressee::List::Iterator it;
646 for ( it = list.begin(); it != list.end(); ++it ) { 646 for ( it = list.begin(); it != list.end(); ++it ) {
647 Iterator ait; 647 Iterator ait;
648 for ( ait = begin(); ait != end(); ++ait ) { 648 for ( ait = begin(); ait != end(); ++ait ) {
649 if ( !(*ait).tagged() ) { 649 if ( !(*ait).tagged() ) {
@@ -1209,49 +1209,49 @@ bool AddressBook::addResource( Resource *resource )
1209 kdDebug(5700) << "AddressBook::addResource(): can't add resource" << endl; 1209 kdDebug(5700) << "AddressBook::addResource(): can't add resource" << endl;
1210 return false; 1210 return false;
1211 } 1211 }
1212 1212
1213 resource->setAddressBook( this ); 1213 resource->setAddressBook( this );
1214 1214
1215 d->mManager->add( resource ); 1215 d->mManager->add( resource );
1216 return true; 1216 return true;
1217} 1217}
1218void AddressBook::removeResources() 1218void AddressBook::removeResources()
1219{ 1219{
1220 //remove all possible resources. This should cleanup the configfile. 1220 //remove all possible resources. This should cleanup the configfile.
1221 QPtrList<KABC::Resource> mResources = resources(); 1221 Q3PtrList<KABC::Resource> mResources = resources();
1222 1222
1223 QPtrListIterator<KABC::Resource> it(mResources); 1223 Q3PtrListIterator<KABC::Resource> it(mResources);
1224 for ( ; it.current(); ++it ) { 1224 for ( ; it.current(); ++it ) {
1225 KABC::Resource *res = it.current(); 1225 KABC::Resource *res = it.current();
1226 removeResource(res); 1226 removeResource(res);
1227 } 1227 }
1228} 1228}
1229 1229
1230bool AddressBook::removeResource( Resource *resource ) 1230bool AddressBook::removeResource( Resource *resource )
1231{ 1231{
1232 resource->close(); 1232 resource->close();
1233 1233
1234 if ( resource == standardResource() ) 1234 if ( resource == standardResource() )
1235 d->mManager->setStandardResource( 0 ); 1235 d->mManager->setStandardResource( 0 );
1236 1236
1237 resource->setAddressBook( 0 ); 1237 resource->setAddressBook( 0 );
1238 1238
1239 d->mManager->remove( resource ); 1239 d->mManager->remove( resource );
1240 return true; 1240 return true;
1241} 1241}
1242 1242
1243QPtrList<Resource> AddressBook::resources() 1243Q3PtrList<Resource> AddressBook::resources()
1244{ 1244{
1245 QPtrList<Resource> list; 1245 Q3PtrList<Resource> list;
1246 1246
1247// qDebug("AddressBook::resources() 1"); 1247// qDebug("AddressBook::resources() 1");
1248 1248
1249 KRES::Manager<Resource>::ActiveIterator it; 1249 KRES::Manager<Resource>::ActiveIterator it;
1250 for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) 1250 for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it )
1251 list.append( *it ); 1251 list.append( *it );
1252 1252
1253 return list; 1253 return list;
1254} 1254}
1255 1255
1256/*US 1256/*US
1257void AddressBook::setErrorHandler( ErrorHandler *handler ) 1257void AddressBook::setErrorHandler( ErrorHandler *handler )
diff --git a/kabc/addressbook.h b/kabc/addressbook.h
index a8a9fc1..56fce4d 100644
--- a/kabc/addressbook.h
+++ b/kabc/addressbook.h
@@ -22,25 +22,25 @@
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#ifndef KABC_ADDRESSBOOK_H 28#ifndef KABC_ADDRESSBOOK_H
29#define KABC_ADDRESSBOOK_H 29#define KABC_ADDRESSBOOK_H
30 30
31#include <qobject.h> 31#include <qobject.h>
32 32
33#include <kresources/manager.h> 33#include <kresources/manager.h>
34#include <qptrlist.h> 34#include <q3ptrlist.h>
35 35
36#include "addressee.h" 36#include "addressee.h"
37#include "field.h" 37#include "field.h"
38 38
39namespace KABC { 39namespace KABC {
40 40
41class ErrorHandler; 41class ErrorHandler;
42class Resource; 42class Resource;
43class Ticket; 43class Ticket;
44 44
45/** 45/**
46 @short Address Book 46 @short Address Book
@@ -271,25 +271,25 @@ class AddressBook : public QObject
271 */ 271 */
272 bool addResource( Resource * ); 272 bool addResource( Resource * );
273 273
274 /** 274 /**
275 Remove address book resource. 275 Remove address book resource.
276 */ 276 */
277 void removeResources(); 277 void removeResources();
278 bool removeResource( Resource * ); 278 bool removeResource( Resource * );
279 279
280 /** 280 /**
281 Return pointer list of all resources. 281 Return pointer list of all resources.
282 */ 282 */
283 QPtrList<Resource> resources(); 283 Q3PtrList<Resource> resources();
284 284
285 /** 285 /**
286 Set the @p ErrorHandler, that is used by @ref error() to 286 Set the @p ErrorHandler, that is used by @ref error() to
287 provide gui-independend error messages. 287 provide gui-independend error messages.
288 */ 288 */
289 void setErrorHandler( ErrorHandler * ); 289 void setErrorHandler( ErrorHandler * );
290 290
291 /** 291 /**
292 Shows gui independend error messages. 292 Shows gui independend error messages.
293 */ 293 */
294 void error( const QString& ); 294 void error( const QString& );
295 295
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index e8e440c..9994e29 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -382,25 +382,25 @@ void Addressee::mergeOLContact( const Addressee& ad )
382 382
383void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) 383void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false)
384{ 384{
385 // merge all standard non-outlook fields. 385 // merge all standard non-outlook fields.
386 //if isSubSet (e.g. mobile phone sync) merge all fields 386 //if isSubSet (e.g. mobile phone sync) merge all fields
387 387
388 detach(); 388 detach();
389 if ( isSubSet ) { 389 if ( isSubSet ) {
390 if ( mData->name.isEmpty() ) mData->name = ad.mData->name; 390 if ( mData->name.isEmpty() ) mData->name = ad.mData->name;
391 if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; 391 if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName;
392 if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; 392 if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName;
393 if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; 393 if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ;
394 if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; 394 if ( mData->additionalName.isEmpty() ) mData->additionalName = ad.mData->additionalName;
395 if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; 395 if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix;
396 if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; 396 if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix;
397 if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; 397 if ( mData->title .isEmpty() ) mData->title = ad.mData->title ;
398 if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; 398 if ( mData->role.isEmpty() ) mData->role = ad.mData->role ;
399 if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; 399 if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName;
400 if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; 400 if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ;
401 if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; 401 if ( mData->note.isEmpty() ) mData->note = ad.mData->note ;
402 if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; 402 if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy;
403 if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; 403 if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ;
404 if ( !mData->birthday.isValid() ) 404 if ( !mData->birthday.isValid() )
405 if ( ad.mData->birthday.isValid()) 405 if ( ad.mData->birthday.isValid())
406 mData->birthday = ad.mData->birthday; 406 mData->birthday = ad.mData->birthday;
diff --git a/kabc/addressee.h b/kabc/addressee.h
index 0ea1803..30dcd5d 100644
--- a/kabc/addressee.h
+++ b/kabc/addressee.h
@@ -24,25 +24,25 @@ Enhanced Version of the file for platform independent KDE tools.
24Copyright (c) 2004 Ulf Schenk 24Copyright (c) 2004 Ulf Schenk
25 25
26$Id$ 26$Id$
27*/ 27*/
28 28
29#ifndef KABC_ADDRESSEE_H 29#ifndef KABC_ADDRESSEE_H
30#define KABC_ADDRESSEE_H 30#define KABC_ADDRESSEE_H
31 31
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <qstring.h> 33#include <qstring.h>
34#include <qregexp.h> 34#include <qregexp.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <qvaluelist.h> 36#include <q3valuelist.h>
37 37
38#include <ksharedptr.h> 38#include <ksharedptr.h>
39#include <kurl.h> 39#include <kurl.h>
40 40
41#include "address.h" 41#include "address.h"
42#include "agent.h" 42#include "agent.h"
43#include "geo.h" 43#include "geo.h"
44#include "key.h" 44#include "key.h"
45#include "phonenumber.h" 45#include "phonenumber.h"
46#include "picture.h" 46#include "picture.h"
47#include "secrecy.h" 47#include "secrecy.h"
48#include "sound.h" 48#include "sound.h"
@@ -75,25 +75,25 @@ class Resource;
75 otherwise it constucts the name from the name fields. As fallback, if 75 otherwise it constucts the name from the name fields. As fallback, if
76 nothing else is set it uses name(). 76 nothing else is set it uses name().
77 77
78 name() is the NAME type of RFC2426. It can be used as internal name for the 78 name() is the NAME type of RFC2426. It can be used as internal name for the
79 data enty, but shouldn't be used for displaying the data to the user. 79 data enty, but shouldn't be used for displaying the data to the user.
80 */ 80 */
81class Addressee 81class Addressee
82{ 82{
83 friend QDataStream &operator<<( QDataStream &, const Addressee & ); 83 friend QDataStream &operator<<( QDataStream &, const Addressee & );
84 friend QDataStream &operator>>( QDataStream &, Addressee & ); 84 friend QDataStream &operator>>( QDataStream &, Addressee & );
85 85
86 public: 86 public:
87 typedef QValueList<Addressee> List; 87 typedef Q3ValueList<Addressee> List;
88 88
89 /** 89 /**
90 Construct an empty address book entry. 90 Construct an empty address book entry.
91 */ 91 */
92 Addressee(); 92 Addressee();
93 ~Addressee(); 93 ~Addressee();
94 94
95 Addressee( const Addressee & ); 95 Addressee( const Addressee & );
96 Addressee &operator=( const Addressee & ); 96 Addressee &operator=( const Addressee & );
97 97
98 bool operator==( const Addressee & ) const; 98 bool operator==( const Addressee & ) const;
99 bool operator!=( const Addressee & ) const; 99 bool operator!=( const Addressee & ) const;
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp
index 671787e..bda1b9e 100644
--- a/kabc/addresseedialog.cpp
+++ b/kabc/addresseedialog.cpp
@@ -11,44 +11,47 @@
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qlayout.h> 21#include <qlayout.h>
22#include <qpushbutton.h> 22#include <qpushbutton.h>
23#include <qgroupbox.h> 23#include <q3groupbox.h>
24#include <qapplication.h> 24#include <qapplication.h>
25#include <qregexp.h> 25#include <qregexp.h>
26#include <qvbox.h> 26#include <q3vbox.h>
27#include <qlabel.h> 27#include <qlabel.h>
28//Added by qt3to4:
29#include <Q3ValueList>
30#include <Q3VBoxLayout>
28 31
29#include <klocale.h> 32#include <klocale.h>
30#include <kdebug.h> 33#include <kdebug.h>
31#include <kglobalsettings.h> 34#include <kglobalsettings.h>
32 35
33#include "stdaddressbook.h" 36#include "stdaddressbook.h"
34 37
35#include "addresseedialog.h" 38#include "addresseedialog.h"
36#include "KDGanttMinimizeSplitter.h" 39#include "KDGanttMinimizeSplitter.h"
37//#include "addresseedialog.moc" 40//#include "addresseedialog.moc"
38 41
39using namespace KABC; 42using namespace KABC;
40 43
41AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : 44AddresseeItem::AddresseeItem( Q3ListView *parent, const Addressee &addressee ) :
42 QListViewItem( parent ), 45 Q3ListViewItem( parent ),
43 mAddressee( addressee ) 46 mAddressee( addressee )
44{ 47{
45 setText( Name,addressee.realName()); 48 setText( Name,addressee.realName());
46 setText( Email, addressee.preferredEmail() ); 49 setText( Email, addressee.preferredEmail() );
47 setText( Category, addressee.categories().join(";") ); 50 setText( Category, addressee.categories().join(";") );
48} 51}
49 52
50QString AddresseeItem::key( int column, bool ) const 53QString AddresseeItem::key( int column, bool ) const
51{ 54{
52 55
53 if (column == Email) { 56 if (column == Email) {
54 QString value = text(Email); 57 QString value = text(Email);
@@ -62,80 +65,80 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
62 KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), 65 KDialogBase( KDialogBase::Plain, i18n("Select Addressee"),
63 Ok|Cancel, No, parent ), mMultiple( multiple ) 66 Ok|Cancel, No, parent ), mMultiple( multiple )
64{ 67{
65 qDebug("NEW AddresseeDialog "); 68 qDebug("NEW AddresseeDialog ");
66 69
67 70
68 KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this ); 71 KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this );
69 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 72 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
70 setMainWidget( mMiniSplitter ); 73 setMainWidget( mMiniSplitter );
71 74
72 QWidget *listWidget = new QWidget( mMiniSplitter ); 75 QWidget *listWidget = new QWidget( mMiniSplitter );
73 76
74 QVBoxLayout *listLayout = new QVBoxLayout (listWidget) ; 77 Q3VBoxLayout *listLayout = new Q3VBoxLayout (listWidget) ;
75 //topLayout->addLayout( listLayout ); 78 //topLayout->addLayout( listLayout );
76 79
77 mAddresseeList = new KListView( listWidget ); 80 mAddresseeList = new KListView( listWidget );
78 mAddresseeList->addColumn( i18n("Name") ); 81 mAddresseeList->addColumn( i18n("Name") );
79 mAddresseeList->addColumn( i18n("Email") ); 82 mAddresseeList->addColumn( i18n("Email") );
80 mAddresseeList->addColumn( i18n("Category") ); 83 mAddresseeList->addColumn( i18n("Category") );
81 mAddresseeList->setAllColumnsShowFocus( true ); 84 mAddresseeList->setAllColumnsShowFocus( true );
82 mAddresseeList->setFullWidth( true ); 85 mAddresseeList->setFullWidth( true );
83 listLayout->addWidget( mAddresseeList ); 86 listLayout->addWidget( mAddresseeList );
84 connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), 87 connect( mAddresseeList, SIGNAL( doubleClicked( Q3ListViewItem * ) ),
85 SLOT( slotOk() ) ); 88 SLOT( slotOk() ) );
86 //QHBox* searchBox = new QHBox ( listWidget ); 89 //QHBox* searchBox = new QHBox ( listWidget );
87 QHBox * hb = new QHBox ( listWidget ); 90 Q3HBox * hb = new Q3HBox ( listWidget );
88 listLayout->addWidget ( hb ); 91 listLayout->addWidget ( hb );
89 mAddresseeEdit = new QLineEdit( hb ); 92 mAddresseeEdit = new QLineEdit( hb );
90 connect( mAddresseeEdit, SIGNAL( returnPressed() ), 93 connect( mAddresseeEdit, SIGNAL( returnPressed() ),
91 SLOT( loadAddressBook() ) ); 94 SLOT( loadAddressBook() ) );
92 mAddresseeEdit->setFocus(); 95 mAddresseeEdit->setFocus();
93 QPushButton *searchButton = new QPushButton( i18n("Search!"), hb ); 96 QPushButton *searchButton = new QPushButton( i18n("Search!"), hb );
94 connect ( searchButton, SIGNAL( clicked() ), SLOT( loadAddressBook() ) ); 97 connect ( searchButton, SIGNAL( clicked() ), SLOT( loadAddressBook() ) );
95 if ( mMultiple ) { 98 if ( mMultiple ) {
96 99
97 mSelectedList = new KListView( mMiniSplitter ); 100 mSelectedList = new KListView( mMiniSplitter );
98 mSelectedList->addColumn( i18n("Selected Name") ); 101 mSelectedList->addColumn( i18n("Selected Name") );
99 mSelectedList->addColumn( i18n("Email") ); 102 mSelectedList->addColumn( i18n("Email") );
100 mSelectedList->setAllColumnsShowFocus( true ); 103 mSelectedList->setAllColumnsShowFocus( true );
101 mSelectedList->setFullWidth( true ); 104 mSelectedList->setFullWidth( true );
102 //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), 105 //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ),
103 // SLOT( removeSelected() ) ); 106 // SLOT( removeSelected() ) );
104 connect( mSelectedList, SIGNAL( clicked( QListViewItem * ) ), 107 connect( mSelectedList, SIGNAL( clicked( Q3ListViewItem * ) ),
105 SLOT( removeSelected() ) ); 108 SLOT( removeSelected() ) );
106 connect( mSelectedList, SIGNAL( returnPressed( QListViewItem *) ), 109 connect( mSelectedList, SIGNAL( returnPressed( Q3ListViewItem *) ),
107 SLOT( removeSelected() ) ); 110 SLOT( removeSelected() ) );
108 111
109#if 0 112#if 0
110 QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); 113 QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup );
111 connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); 114 connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) );
112 115
113#endif 116#endif
114 connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), 117 connect( mAddresseeList, SIGNAL( clicked( Q3ListViewItem * ) ),
115 SLOT( addSelected( QListViewItem * ) ) ); 118 SLOT( addSelected( Q3ListViewItem * ) ) );
116 connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), 119 connect( mAddresseeList, SIGNAL( returnPressed( Q3ListViewItem * ) ),
117 SLOT( selectNextItem( QListViewItem * ) ) ); 120 SLOT( selectNextItem( Q3ListViewItem * ) ) );
118 121
119 } 122 }
120 123
121 mAddressBook = StdAddressBook::self( true ); 124 mAddressBook = StdAddressBook::self( true );
122 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), 125 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ),
123 SLOT( addressBookChanged() ) ); 126 SLOT( addressBookChanged() ) );
124#if 0 127#if 0
125 connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), 128 connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ),
126 SLOT( addressBookChanged() ) ); 129 SLOT( addressBookChanged() ) );
127#endif 130#endif
128 loadAddressBook(); 131 loadAddressBook();
129 QValueList<int> splitterSize; 132 Q3ValueList<int> splitterSize;
130 splitterSize.append( ( width() / 5 ) * 3 ); 133 splitterSize.append( ( width() / 5 ) * 3 );
131 splitterSize.append( ( width() / 5 ) *2 ); 134 splitterSize.append( ( width() / 5 ) *2 );
132 mMiniSplitter->setSizes( splitterSize ); 135 mMiniSplitter->setSizes( splitterSize );
133} 136}
134 137
135AddresseeDialog::~AddresseeDialog() 138AddresseeDialog::~AddresseeDialog()
136{ 139{
137 qDebug("DELETE AddresseeDialog "); 140 qDebug("DELETE AddresseeDialog ");
138} 141}
139 142
140void AddresseeDialog::loadAddressBook() 143void AddresseeDialog::loadAddressBook()
141{ 144{
@@ -163,82 +166,82 @@ void AddresseeDialog::loadAddressBook()
163 QString name = (*it).realName(); 166 QString name = (*it).realName();
164 name += (*it).preferredEmail(); 167 name += (*it).preferredEmail();
165 name += (*it).categories().join(";"); 168 name += (*it).categories().join(";");
166#if QT_VERSION >= 0x030000 169#if QT_VERSION >= 0x030000
167 if (re.search(name) != -1) 170 if (re.search(name) != -1)
168#else 171#else
169 if (re.match(name) != -1) 172 if (re.match(name) != -1)
170#endif 173#endif
171 AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); 174 AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) );
172 } 175 }
173} 176}
174 177
175void AddresseeDialog::addCompletionItem( const QString &str, QListViewItem *item ) 178void AddresseeDialog::addCompletionItem( const QString &str, Q3ListViewItem *item )
176{ 179{
177 if ( str.isEmpty() ) return; 180 if ( str.isEmpty() ) return;
178 181
179 mItemDict.insert( str, item ); 182 mItemDict.insert( str, item );
180 //mAddresseeEdit->completionObject()->addItem( str ); 183 //mAddresseeEdit->completionObject()->addItem( str );
181} 184}
182 185
183void AddresseeDialog::selectItem( const QString &str ) 186void AddresseeDialog::selectItem( const QString &str )
184{ 187{
185 if ( str.isEmpty() ) return; 188 if ( str.isEmpty() ) return;
186 189
187 QListViewItem *item = mItemDict.find( str ); 190 Q3ListViewItem *item = mItemDict.find( str );
188 if ( item ) { 191 if ( item ) {
189 mAddresseeList->blockSignals( true ); 192 mAddresseeList->blockSignals( true );
190 mAddresseeList->setSelected( item, true ); 193 mAddresseeList->setSelected( item, true );
191 mAddresseeList->ensureItemVisible( item ); 194 mAddresseeList->ensureItemVisible( item );
192 mAddresseeList->blockSignals( false ); 195 mAddresseeList->blockSignals( false );
193 } 196 }
194} 197}
195 198
196void AddresseeDialog::updateEdit( QListViewItem *item ) 199void AddresseeDialog::updateEdit( Q3ListViewItem *item )
197{ 200{
198 mAddresseeEdit->setText( item->text( 0 ) ); 201 mAddresseeEdit->setText( item->text( 0 ) );
199 mAddresseeEdit->setSelection( 0, item->text( 0 ).length() ); 202 mAddresseeEdit->setSelection( 0, item->text( 0 ).length() );
200} 203}
201 204
202void AddresseeDialog::selectNextItem( QListViewItem *item ) 205void AddresseeDialog::selectNextItem( Q3ListViewItem *item )
203{ 206{
204 addSelected( item ); 207 addSelected( item );
205 QListViewItem *next = item->nextSibling(); 208 Q3ListViewItem *next = item->nextSibling();
206 if ( next ) { 209 if ( next ) {
207 next->setSelected( true ); 210 next->setSelected( true );
208 item->setSelected( false ); 211 item->setSelected( false );
209 mAddresseeList->setCurrentItem( next ); 212 mAddresseeList->setCurrentItem( next );
210 } 213 }
211} 214}
212void AddresseeDialog::addSelected( QListViewItem *item ) 215void AddresseeDialog::addSelected( Q3ListViewItem *item )
213{ 216{
214 AddresseeItem *addrItem = (AddresseeItem *)( item ); 217 AddresseeItem *addrItem = (AddresseeItem *)( item );
215 if ( !addrItem ) return; 218 if ( !addrItem ) return;
216 219
217 Addressee a = addrItem->addressee(); 220 Addressee a = addrItem->addressee();
218 221
219 QListViewItem *selectedItem = mSelectedDict.find( a.uid() ); 222 Q3ListViewItem *selectedItem = mSelectedDict.find( a.uid() );
220 if ( !selectedItem ) { 223 if ( !selectedItem ) {
221 selectedItem = new AddresseeItem( mSelectedList, a ); 224 selectedItem = new AddresseeItem( mSelectedList, a );
222 mSelectedDict.insert( a.uid(), selectedItem ); 225 mSelectedDict.insert( a.uid(), selectedItem );
223 } 226 }
224 227
225} 228}
226 229
227void AddresseeDialog::removeSelected() 230void AddresseeDialog::removeSelected()
228{ 231{
229 QListViewItem *item = mSelectedList->selectedItem(); 232 Q3ListViewItem *item = mSelectedList->selectedItem();
230 AddresseeItem *addrItem = (AddresseeItem *)( item ); 233 AddresseeItem *addrItem = (AddresseeItem *)( item );
231 if ( !addrItem ) return; 234 if ( !addrItem ) return;
232 QListViewItem *next = item->nextSibling(); 235 Q3ListViewItem *next = item->nextSibling();
233 mSelectedDict.remove( addrItem->addressee().uid() ); 236 mSelectedDict.remove( addrItem->addressee().uid() );
234 delete addrItem; 237 delete addrItem;
235 if ( next ) 238 if ( next )
236 next->setSelected( true ); 239 next->setSelected( true );
237} 240}
238 241
239Addressee AddresseeDialog::addressee() 242Addressee AddresseeDialog::addressee()
240{ 243{
241 AddresseeItem *aItem = 0; 244 AddresseeItem *aItem = 0;
242 245
243 if ( mMultiple ) 246 if ( mMultiple )
244 aItem = (AddresseeItem *)( mSelectedList->firstChild() ); 247 aItem = (AddresseeItem *)( mSelectedList->firstChild() );
@@ -246,25 +249,25 @@ Addressee AddresseeDialog::addressee()
246 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); 249 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() );
247 250
248 if (aItem) return aItem->addressee(); 251 if (aItem) return aItem->addressee();
249 return Addressee(); 252 return Addressee();
250} 253}
251 254
252Addressee::List AddresseeDialog::addressees() 255Addressee::List AddresseeDialog::addressees()
253{ 256{
254 Addressee::List al; 257 Addressee::List al;
255 AddresseeItem *aItem = 0; 258 AddresseeItem *aItem = 0;
256 259
257 if ( mMultiple ) { 260 if ( mMultiple ) {
258 QListViewItem *item = mSelectedList->firstChild(); 261 Q3ListViewItem *item = mSelectedList->firstChild();
259 while( item ) { 262 while( item ) {
260 aItem = (AddresseeItem *)( item ); 263 aItem = (AddresseeItem *)( item );
261 if ( aItem ) al.append( aItem->addressee() ); 264 if ( aItem ) al.append( aItem->addressee() );
262 item = item->nextSibling(); 265 item = item->nextSibling();
263 } 266 }
264 } 267 }
265 else 268 else
266 { 269 {
267 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); 270 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() );
268 if (aItem) al.append( aItem->addressee() ); 271 if (aItem) al.append( aItem->addressee() );
269 } 272 }
270 273
diff --git a/kabc/addresseedialog.h b/kabc/addresseedialog.h
index 6fab62d..be7bbb4 100644
--- a/kabc/addresseedialog.h
+++ b/kabc/addresseedialog.h
@@ -12,55 +12,55 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#ifndef KABC_ADDRESSEEDIALOG_H 21#ifndef KABC_ADDRESSEEDIALOG_H
22#define KABC_ADDRESSEEDIALOG_H 22#define KABC_ADDRESSEEDIALOG_H
23 23
24#include <qdict.h> 24#include <q3dict.h>
25 25
26#include <kdialogbase.h> 26#include <kdialogbase.h>
27#include <klineedit.h> 27#include <klineedit.h>
28#include <klistview.h> 28#include <klistview.h>
29 29
30#include "addressbook.h" 30#include "addressbook.h"
31 31
32namespace KABC { 32namespace KABC {
33 33
34/** 34/**
35 @short Special ListViewItem, that is used by the AddresseeDialog. 35 @short Special ListViewItem, that is used by the AddresseeDialog.
36*/ 36*/
37class AddresseeItem : public QListViewItem 37class AddresseeItem : public Q3ListViewItem
38{ 38{
39 public: 39 public:
40 40
41 /** 41 /**
42 Type of column 42 Type of column
43 @li @p Name - Name in Addressee 43 @li @p Name - Name in Addressee
44 @li @p Email - Email in Addressee 44 @li @p Email - Email in Addressee
45 */ 45 */
46 enum columns { Name = 0, Email = 1,Category = 2 }; 46 enum columns { Name = 0, Email = 1,Category = 2 };
47 47
48 /** 48 /**
49 Constructor. 49 Constructor.
50 50
51 @param parent The parent listview. 51 @param parent The parent listview.
52 @param addressee The associated addressee. 52 @param addressee The associated addressee.
53 */ 53 */
54 AddresseeItem( QListView *parent, const Addressee &addressee ); 54 AddresseeItem( Q3ListView *parent, const Addressee &addressee );
55 55
56 /** 56 /**
57 Returns the addressee. 57 Returns the addressee.
58 */ 58 */
59 Addressee addressee() const { return mAddressee; } 59 Addressee addressee() const { return mAddressee; }
60 60
61 /** 61 /**
62 Method used by QListView to sort the items. 62 Method used by QListView to sort the items.
63 */ 63 */
64 virtual QString key( int column, bool ascending ) const; 64 virtual QString key( int column, bool ascending ) const;
65 65
66 private: 66 private:
@@ -120,42 +120,42 @@ class AddresseeDialog : public KDialogBase
120 120
121 /** 121 /**
122 Select multiple address book entries. 122 Select multiple address book entries.
123 123
124 Open addressee select dialog and return the entries selected by the user. 124 Open addressee select dialog and return the entries selected by the user.
125 If the user doesn't select an entry or presses cancel, the returned 125 If the user doesn't select an entry or presses cancel, the returned
126 addressee list is empty. 126 addressee list is empty.
127 */ 127 */
128 static Addressee::List getAddressees( QWidget *parent ); 128 static Addressee::List getAddressees( QWidget *parent );
129 129
130 private slots: 130 private slots:
131 void selectItem( const QString & ); 131 void selectItem( const QString & );
132 void selectNextItem( QListViewItem *item ); 132 void selectNextItem( Q3ListViewItem *item );
133 void updateEdit( QListViewItem *item ); 133 void updateEdit( Q3ListViewItem *item );
134 void addSelected( QListViewItem *item ); 134 void addSelected( Q3ListViewItem *item );
135 void removeSelected(); 135 void removeSelected();
136 void loadAddressBook(); 136 void loadAddressBook();
137 137
138 protected slots: 138 protected slots:
139 void addressBookChanged(); 139 void addressBookChanged();
140 140
141 private: 141 private:
142 void addCompletionItem( const QString &str, QListViewItem *item ); 142 void addCompletionItem( const QString &str, Q3ListViewItem *item );
143 143
144 bool mMultiple; 144 bool mMultiple;
145 145
146 KListView *mAddresseeList; 146 KListView *mAddresseeList;
147 QLineEdit *mAddresseeEdit; 147 QLineEdit *mAddresseeEdit;
148 148
149 KListView *mSelectedList; 149 KListView *mSelectedList;
150 150
151 AddressBook *mAddressBook; 151 AddressBook *mAddressBook;
152 152
153 QDict<QListViewItem> mItemDict; 153 Q3Dict<Q3ListViewItem> mItemDict;
154 QDict<QListViewItem> mSelectedDict; 154 Q3Dict<Q3ListViewItem> mSelectedDict;
155 155
156 class AddresseeDialogPrivate; 156 class AddresseeDialogPrivate;
157 AddresseeDialogPrivate *d; 157 AddresseeDialogPrivate *d;
158}; 158};
159 159
160} 160}
161#endif 161#endif
diff --git a/kabc/addresseelist.cpp b/kabc/addresseelist.cpp
index 097e162..e1ba1ce 100644
--- a/kabc/addresseelist.cpp
+++ b/kabc/addresseelist.cpp
@@ -19,25 +19,27 @@
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22/* 22/*
23Enhanced Version of the file for platform independent KDE tools. 23Enhanced Version of the file for platform independent KDE tools.
24Copyright (c) 2004 Ulf Schenk 24Copyright (c) 2004 Ulf Schenk
25 25
26$Id$ 26$Id$
27*/ 27*/
28 28
29#include <kdebug.h> 29#include <kdebug.h>
30//US 30//US
31#include <qtl.h> 31#include <q3tl.h>
32//Added by qt3to4:
33#include <Q3ValueList>
32 34
33 35
34#include "addresseelist.h" 36#include "addresseelist.h"
35#include "field.h" 37#include "field.h"
36 38
37using namespace KABC; 39using namespace KABC;
38 40
39// 41//
40// 42//
41// Traits 43// Traits
42// 44//
43// 45//
@@ -112,44 +114,44 @@ bool SortingTraits::GivenName::lt( const Addressee &a1, const Addressee &a2 )
112 } else { 114 } else {
113 return given < 0; 115 return given < 0;
114 } 116 }
115} 117}
116 118
117// 119//
118// 120//
119// AddresseeList 121// AddresseeList
120// 122//
121// 123//
122 124
123AddresseeList::AddresseeList() 125AddresseeList::AddresseeList()
124 : QValueList<Addressee>() 126 : Q3ValueList<Addressee>()
125{ 127{
126 mReverseSorting = false; 128 mReverseSorting = false;
127 mActiveSortingCriterion = FormattedName; 129 mActiveSortingCriterion = FormattedName;
128 mActiveSortingField = 0; 130 mActiveSortingField = 0;
129} 131}
130 132
131AddresseeList::~AddresseeList() 133AddresseeList::~AddresseeList()
132{ 134{
133} 135}
134 136
135AddresseeList::AddresseeList( const AddresseeList &l ) 137AddresseeList::AddresseeList( const AddresseeList &l )
136 : QValueList<Addressee>( l ) 138 : Q3ValueList<Addressee>( l )
137{ 139{
138 mReverseSorting = l.reverseSorting(); 140 mReverseSorting = l.reverseSorting();
139 mActiveSortingCriterion = l.sortingCriterion(); 141 mActiveSortingCriterion = l.sortingCriterion();
140} 142}
141 143
142AddresseeList::AddresseeList( const QValueList<Addressee> &l ) 144AddresseeList::AddresseeList( const Q3ValueList<Addressee> &l )
143 : QValueList<Addressee>( l ) 145 : Q3ValueList<Addressee>( l )
144{ 146{
145 mReverseSorting = false; 147 mReverseSorting = false;
146} 148}
147 149
148void AddresseeList::dump() const 150void AddresseeList::dump() const
149{ 151{
150 kdDebug(5700) << "AddresseeList {" << endl; 152 kdDebug(5700) << "AddresseeList {" << endl;
151 kdDebug(5700) << "reverse order: " << ( mReverseSorting ? "true" : "false" ) << endl; 153 kdDebug(5700) << "reverse order: " << ( mReverseSorting ? "true" : "false" ) << endl;
152 154
153 QString crit; 155 QString crit;
154 if ( Uid == mActiveSortingCriterion ) { 156 if ( Uid == mActiveSortingCriterion ) {
155 crit = "Uid"; 157 crit = "Uid";
diff --git a/kabc/addresseelist.h b/kabc/addresseelist.h
index 2df252c..6106804 100644
--- a/kabc/addresseelist.h
+++ b/kabc/addresseelist.h
@@ -20,25 +20,25 @@
20*/ 20*/
21 21
22/* 22/*
23Enhanced Version of the file for platform independent KDE tools. 23Enhanced Version of the file for platform independent KDE tools.
24Copyright (c) 2004 Ulf Schenk 24Copyright (c) 2004 Ulf Schenk
25 25
26$Id$ 26$Id$
27*/ 27*/
28 28
29#ifndef KABC_ADDRESSEELIST_H 29#ifndef KABC_ADDRESSEELIST_H
30#define KABC_ADDRESSEELIST_H 30#define KABC_ADDRESSEELIST_H
31 31
32#include <qvaluelist.h> 32#include <q3valuelist.h>
33 33
34#include "addressee.h" 34#include "addressee.h"
35 35
36namespace KABC { 36namespace KABC {
37 37
38class Field; 38class Field;
39 39
40/** 40/**
41 * Each trait must implement one static function for equality, one for "less 41 * Each trait must implement one static function for equality, one for "less
42 * than". Class name should be the field name. A trait does not necessarily 42 * than". Class name should be the field name. A trait does not necessarily
43 * have to stick to just one field: a trait sorting by family name can e.g. 43 * have to stick to just one field: a trait sorting by family name can e.g.
44 * sort addressees with equal family name by given name. 44 * sort addressees with equal family name by given name.
@@ -105,31 +105,31 @@ typedef enum { Uid, Name, FormattedName, FamilyName, GivenName } SortingCriterio
105 * create a defined order again. 105 * create a defined order again.
106 * 106 *
107 * Iterator usage is inherited by QValueList and extensively documented 107 * Iterator usage is inherited by QValueList and extensively documented
108 * there. Please remember that the state of an iterator is undefined 108 * there. Please remember that the state of an iterator is undefined
109 * after any sorting operation. 109 * after any sorting operation.
110 * 110 *
111 * For the enumeration Type SortingCriterion, which specifies the 111 * For the enumeration Type SortingCriterion, which specifies the
112 * field by the collection will be sorted, the following values exist: 112 * field by the collection will be sorted, the following values exist:
113 * Uid, Name, FormattedName, FamilyName, GivenName. 113 * Uid, Name, FormattedName, FamilyName, GivenName.
114 * 114 *
115 * @author Jost Schenck jost@schenck.de 115 * @author Jost Schenck jost@schenck.de
116 */ 116 */
117class AddresseeList : public QValueList<Addressee> 117class AddresseeList : public Q3ValueList<Addressee>
118{ 118{
119 public: 119 public:
120 AddresseeList(); 120 AddresseeList();
121 ~AddresseeList(); 121 ~AddresseeList();
122 AddresseeList( const AddresseeList & ); 122 AddresseeList( const AddresseeList & );
123 AddresseeList( const QValueList<Addressee> & ); 123 AddresseeList( const Q3ValueList<Addressee> & );
124 124
125 /** 125 /**
126 * Debug output. 126 * Debug output.
127 */ 127 */
128 void dump() const; 128 void dump() const;
129 129
130 /** 130 /**
131 * Determines the direction of sorting. On change, the list 131 * Determines the direction of sorting. On change, the list
132 * will <em>not</em> automatically be resorted. 132 * will <em>not</em> automatically be resorted.
133 * @param r <tt>true</tt> if sorting should be done reverse, <tt>false</tt> otherwise 133 * @param r <tt>true</tt> if sorting should be done reverse, <tt>false</tt> otherwise
134 */ 134 */
135 void setReverseSorting( bool r = true ) { mReverseSorting = r; } 135 void setReverseSorting( bool r = true ) { mReverseSorting = r; }
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp
index cde19a1..425e67c 100644
--- a/kabc/addresseeview.cpp
+++ b/kabc/addresseeview.cpp
@@ -18,80 +18,85 @@
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <kabc/address.h> 22#include <kabc/address.h>
23#include <kabc/addressee.h> 23#include <kabc/addressee.h>
24#include <kabc/phonenumber.h> 24#include <kabc/phonenumber.h>
25#include <kglobal.h> 25#include <kglobal.h>
26//US#include <kglobalsettings.h> 26//US#include <kglobalsettings.h>
27#include <kiconloader.h> 27#include <kiconloader.h>
28#include <klocale.h> 28#include <klocale.h>
29//US #include <kstringhandler.h> 29//US #include <kstringhandler.h>
30#include <qscrollview.h> 30#include <q3scrollview.h>
31#include <qregexp.h> 31#include <qregexp.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qvbox.h> 33#include <q3vbox.h>
34#include <qlabel.h> 34#include <qlabel.h>
35#include <qwidget.h> 35#include <qwidget.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qapplication.h> 37#include <qapplication.h>
38#include <qpushbutton.h> 38#include <qpushbutton.h>
39#ifdef DESKTOP_VERSION 39#ifdef DESKTOP_VERSION
40#include <qpaintdevicemetrics.h> 40#include <q3paintdevicemetrics.h>
41#include <qprinter.h> 41#include <qprinter.h>
42#include <qpainter.h> 42#include <qpainter.h>
43#endif 43#endif
44#include <QDesktopWidget>
44 45
45 46
46#include <qstylesheet.h> 47#include <q3stylesheet.h>
48//Added by qt3to4:
49#include <Q3HBoxLayout>
50#include <QPixmap>
51#include <Q3VBoxLayout>
47#include "externalapphandler.h" 52#include "externalapphandler.h"
48#include <kabc/addresseeview.h> 53#include <kabc/addresseeview.h>
49 54
50 55
51//US #ifndef DESKTOP_VERSION 56//US #ifndef DESKTOP_VERSION
52//US #include <qtopia/qcopenvelope_qws.h> 57//US #include <qtopia/qcopenvelope_qws.h>
53//US #include <qpe/qpeapplication.h> 58//US #include <qpe/qpeapplication.h>
54//US #endif 59//US #endif
55 60
56//US static int kphoneInstalled = 0; 61//US static int kphoneInstalled = 0;
57 62
58using namespace KABC; 63using namespace KABC;
59bool AddresseeView::sFullDetailsMode = false; 64bool AddresseeView::sFullDetailsMode = false;
60 65
61AddresseeView::AddresseeView( QWidget *parent, const char *name ) 66AddresseeView::AddresseeView( QWidget *parent, const char *name )
62 : QTextBrowser( parent, name ) 67 : Q3TextBrowser( parent, name )
63 68
64 69
65{ 70{
66//US setWrapPolicy( QTextEdit::AtWordBoundary ); 71//US setWrapPolicy( QTextEdit::AtWordBoundary );
67 setLinkUnderline( false ); 72 setLinkUnderline( false );
68 // setVScrollBarMode( QScrollView::AlwaysOff ); 73 // setVScrollBarMode( QScrollView::AlwaysOff );
69 //setHScrollBarMode( QScrollView::AlwaysOff ); 74 //setHScrollBarMode( QScrollView::AlwaysOff );
70 75
71//US QStyleSheet *sheet = styleSheet(); 76//US QStyleSheet *sheet = styleSheet();
72//US QStyleSheetItem *link = sheet->item( "a" ); 77//US QStyleSheetItem *link = sheet->item( "a" );
73//US link->setColor( KGlobalSettings::linkColor() ); 78//US link->setColor( KGlobalSettings::linkColor() );
74 79
75 80
76} 81}
77void AddresseeView::printMe() 82void AddresseeView::printMe()
78{ 83{
79#ifdef DESKTOP_VERSION 84#ifdef DESKTOP_VERSION
80 QPrinter printer; 85 QPrinter printer;
81 if (!printer.setup() ) 86 if (!printer.setup() )
82 return; 87 return;
83 QPainter p; 88 QPainter p;
84 p.begin ( &printer ); 89 p.begin ( &printer );
85 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 90 Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
86 float dx, dy; 91 float dx, dy;
87 int wid = (m.width() * 9)/10; 92 int wid = (m.width() * 9)/10;
88 dx = (float) wid/(float)contentsWidth (); 93 dx = (float) wid/(float)contentsWidth ();
89 dy = (float)(m.height()) / (float)contentsHeight (); 94 dy = (float)(m.height()) / (float)contentsHeight ();
90 float scale; 95 float scale;
91 // scale to fit the width or height of the paper 96 // scale to fit the width or height of the paper
92 if ( dx < dy ) 97 if ( dx < dy )
93 scale = dx; 98 scale = dx;
94 else 99 else
95 scale = dy; 100 scale = dy;
96 p.translate( m.width()/10,0 ); 101 p.translate( m.width()/10,0 );
97 p.scale( scale, scale ); 102 p.scale( scale, scale );
@@ -393,92 +398,92 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee )
393 QString picString = ""; 398 QString picString = "";
394 KABC::Picture picture = mAddressee.photo(); 399 KABC::Picture picture = mAddressee.photo();
395 if (picture.undefined() ) picture = mAddressee.logo(); 400 if (picture.undefined() ) picture = mAddressee.logo();
396 bool picAvailintern = false; 401 bool picAvailintern = false;
397 bool picAvailUrl = false; 402 bool picAvailUrl = false;
398 if (! picture.undefined() ) { 403 if (! picture.undefined() ) {
399 picAvailintern = (picture.isIntern() && !picture.data().isNull()); 404 picAvailintern = (picture.isIntern() && !picture.data().isNull());
400 picAvailUrl = !picture.isIntern() && QFile::exists(picture.url() ); 405 picAvailUrl = !picture.isIntern() && QFile::exists(picture.url() );
401 } 406 }
402 if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) { 407 if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) {
403 picString = "<img src=\"myimage\" width=\"50\" height=\"70\">"; 408 picString = "<img src=\"myimage\" width=\"50\" height=\"70\">";
404 if ( picAvailintern ) { 409 if ( picAvailintern ) {
405 QMimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() ); 410 Q3MimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() );
406 int wid = picture.data().width(); 411 int wid = picture.data().width();
407 int hei = picture.data().height(); 412 int hei = picture.data().height();
408 if ( wid > 128 || hei > 128 ) { 413 if ( wid > 128 || hei > 128 ) {
409 if ( wid > hei ) { 414 if ( wid > hei ) {
410 hei = (hei*128)/wid; 415 hei = (hei*128)/wid;
411 wid = 128; 416 wid = 128;
412 } else { 417 } else {
413 wid = (wid*128)/hei; 418 wid = (wid*128)/hei;
414 hei = 128; 419 hei = 128;
415 } 420 }
416 } 421 }
417 picString = QString("<img src=\"myimage\" width=\"%1\" height=\"%2\">").arg(wid).arg(hei); 422 picString = QString("<img src=\"myimage\" width=\"%1\" height=\"%2\">").arg(wid).arg(hei);
418 } else { 423 } else {
419 if ( picAvailUrl ) { 424 if ( picAvailUrl ) {
420 QPixmap picPix( picture.url() ); 425 QPixmap picPix( picture.url() );
421 QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", picPix ); 426 Q3MimeSourceFactory::defaultFactory()->setPixmap( "myimage", picPix );
422 int wid = picPix.width(); 427 int wid = picPix.width();
423 int hei = picPix.height(); 428 int hei = picPix.height();
424 if ( wid > 128 || hei > 128 ) { 429 if ( wid > 128 || hei > 128 ) {
425 if ( wid > hei ) { 430 if ( wid > hei ) {
426 hei = (hei*128)/wid; 431 hei = (hei*128)/wid;
427 wid = 128; 432 wid = 128;
428 } else { 433 } else {
429 wid = (wid*128)/hei; 434 wid = (wid*128)/hei;
430 hei = 128; 435 hei = 128;
431 } 436 }
432 } 437 }
433 picString = QString("<img src=\"myimage\" width=\"%1\" height=\"%2\">").arg(wid).arg(hei); 438 picString = QString("<img src=\"myimage\" width=\"%1\" height=\"%2\">").arg(wid).arg(hei);
434 } else { 439 } else {
435 if ( !mAddressee.custom( "KADDRESSBOOK", "X-Children" ).isEmpty() ) { 440 if ( !mAddressee.custom( "KADDRESSBOOK", "X-Children" ).isEmpty() ) {
436 static bool setDefaultImageChildren = false; 441 static bool setDefaultImageChildren = false;
437 if ( !setDefaultImageChildren ) { 442 if ( !setDefaultImageChildren ) {
438 QMimeSourceFactory::defaultFactory()->setPixmap( "familyIcon", KGlobal::iconLoader()->loadIcon( "ic_kids", KIcon::Desktop, 128 ) ); 443 Q3MimeSourceFactory::defaultFactory()->setPixmap( "familyIcon", KGlobal::iconLoader()->loadIcon( "ic_kids", KIcon::Desktop, 128 ) );
439 setDefaultImageChildren = true; 444 setDefaultImageChildren = true;
440 } 445 }
441 picString = "<img src=\"familyIcon\" width=\"64\" height=\"64\">"; 446 picString = "<img src=\"familyIcon\" width=\"64\" height=\"64\">";
442 447
443 } else if ( !mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ).isEmpty() ) { 448 } else if ( !mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ).isEmpty() ) {
444 static bool setDefaultImagepouses = false; 449 static bool setDefaultImagepouses = false;
445 if ( !setDefaultImagepouses ) { 450 if ( !setDefaultImagepouses ) {
446 QMimeSourceFactory::defaultFactory()->setPixmap( "SpousesIcon", KGlobal::iconLoader()->loadIcon( "ic_family", KIcon::Desktop, 128 ) ); 451 Q3MimeSourceFactory::defaultFactory()->setPixmap( "SpousesIcon", KGlobal::iconLoader()->loadIcon( "ic_family", KIcon::Desktop, 128 ) );
447 setDefaultImagepouses = true; 452 setDefaultImagepouses = true;
448 } 453 }
449 picString = "<img src=\"SpousesIcon\" width=\"64\" height=\"64\">"; 454 picString = "<img src=\"SpousesIcon\" width=\"64\" height=\"64\">";
450 } else { 455 } else {
451 QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" ); 456 QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" );
452 if ( gen == "male" ) { 457 if ( gen == "male" ) {
453 static bool setDefaultImageMale = false; 458 static bool setDefaultImageMale = false;
454 if ( !setDefaultImageMale ) { 459 if ( !setDefaultImageMale ) {
455 QMimeSourceFactory::defaultFactory()->setPixmap( "MaleIcon", KGlobal::iconLoader()->loadIcon( "ic_male", KIcon::Desktop, 128 ) ); 460 Q3MimeSourceFactory::defaultFactory()->setPixmap( "MaleIcon", KGlobal::iconLoader()->loadIcon( "ic_male", KIcon::Desktop, 128 ) );
456 setDefaultImageMale = true; 461 setDefaultImageMale = true;
457 } 462 }
458 picString = "<img src=\"MaleIcon\" width=\"64\" height=\"64\">"; 463 picString = "<img src=\"MaleIcon\" width=\"64\" height=\"64\">";
459 464
460 } else if ( gen == "female" ) { 465 } else if ( gen == "female" ) {
461 static bool setDefaultImageFemale = false; 466 static bool setDefaultImageFemale = false;
462 if ( !setDefaultImageFemale ) { 467 if ( !setDefaultImageFemale ) {
463 QMimeSourceFactory::defaultFactory()->setPixmap( "FemaleIcon", KGlobal::iconLoader()->loadIcon( "ic_female", KIcon::Desktop, 128 ) ); 468 Q3MimeSourceFactory::defaultFactory()->setPixmap( "FemaleIcon", KGlobal::iconLoader()->loadIcon( "ic_female", KIcon::Desktop, 128 ) );
464 setDefaultImageFemale = true; 469 setDefaultImageFemale = true;
465 } 470 }
466 picString = "<img src=\"FemaleIcon\" width=\"64\" height=\"64\">"; 471 picString = "<img src=\"FemaleIcon\" width=\"64\" height=\"64\">";
467 472
468 } else { 473 } else {
469 static bool setDefaultImage = false; 474 static bool setDefaultImage = false;
470 if ( !setDefaultImage ) { 475 if ( !setDefaultImage ) {
471 //qDebug("Setting default pixmap "); 476 //qDebug("Setting default pixmap ");
472 QMimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) ); 477 Q3MimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) );
473 setDefaultImage = true; 478 setDefaultImage = true;
474 } 479 }
475 picString = "<img src=\"defaultIcon\" width=\"64\" height=\"64\">"; 480 picString = "<img src=\"defaultIcon\" width=\"64\" height=\"64\">";
476 } 481 }
477 } 482 }
478 } 483 }
479 } 484 }
480 mText = QString::fromLatin1( 485 mText = QString::fromLatin1(
481 "<html>" 486 "<html>"
482 "<body text=\"%1\" bgcolor=\"%2\">" // text and background color 487 "<body text=\"%1\" bgcolor=\"%2\">" // text and background color
483 "<table>" 488 "<table>"
484 "<tr>" 489 "<tr>"
@@ -644,25 +649,25 @@ QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones_unsorted
644 return dynamicPart; 649 return dynamicPart;
645} 650}
646/* 651/*
647KABC::Addressee AddresseeView::addressee() const 652KABC::Addressee AddresseeView::addressee() const
648{ 653{
649 return mAddressee; 654 return mAddressee;
650} 655}
651*/ 656*/
652void AddresseeView::addTag(const QString & tag,const QString & text) 657void AddresseeView::addTag(const QString & tag,const QString & text)
653{ 658{
654 if ( text.isEmpty() ) 659 if ( text.isEmpty() )
655 return; 660 return;
656 int number=text.contains("\n"); 661 int number=text.count("\n");
657 QString str = "<" + tag + ">"; 662 QString str = "<" + tag + ">";
658 QString tmpText=text; 663 QString tmpText=text;
659 QString tmpStr=str; 664 QString tmpStr=str;
660 if(number !=-1) 665 if(number !=-1)
661 { 666 {
662 if (number > 0) { 667 if (number > 0) {
663 int pos=0; 668 int pos=0;
664 QString tmp; 669 QString tmp;
665 for(int i=0;i<=number;i++) { 670 for(int i=0;i<=number;i++) {
666 pos=tmpText.find("\n"); 671 pos=tmpText.find("\n");
667 tmp=tmpText.left(pos); 672 tmp=tmpText.left(pos);
668 tmpText=tmpText.right(tmpText.length()-pos-1); 673 tmpText=tmpText.right(tmpText.length()-pos-1);
@@ -679,42 +684,42 @@ void AddresseeView::addTag(const QString & tag,const QString & text)
679 mText.append(str); 684 mText.append(str);
680 } 685 }
681} 686}
682 687
683AddresseeChooser::AddresseeChooser( KABC::Addressee loc, KABC::Addressee rem, bool takeloc, QWidget *parent, const char *name ) : KDialogBase(parent,name, 688AddresseeChooser::AddresseeChooser( KABC::Addressee loc, KABC::Addressee rem, bool takeloc, QWidget *parent, const char *name ) : KDialogBase(parent,name,
684 true ,i18n("Conflict! Please choose Adressee!"),Ok|User1|Close,Close, false) 689 true ,i18n("Conflict! Please choose Adressee!"),Ok|User1|Close,Close, false)
685{ 690{
686 findButton( Close )->setText( i18n("Cancel Sync")); 691 findButton( Close )->setText( i18n("Cancel Sync"));
687 findButton( Ok )->setText( i18n("Remote")); 692 findButton( Ok )->setText( i18n("Remote"));
688 findButton( User1 )->setText( i18n("Local")); 693 findButton( User1 )->setText( i18n("Local"));
689 QWidget* topframe = new QWidget( this ); 694 QWidget* topframe = new QWidget( this );
690 setMainWidget( topframe ); 695 setMainWidget( topframe );
691 QBoxLayout* bl; 696 Q3BoxLayout* bl;
692 if ( QApplication::desktop()->width() < 640 ) { 697 if ( QApplication::desktop()->width() < 640 ) {
693 bl = new QVBoxLayout( topframe ); 698 bl = new Q3VBoxLayout( topframe );
694 } else { 699 } else {
695 bl = new QHBoxLayout( topframe ); 700 bl = new Q3HBoxLayout( topframe );
696 } 701 }
697 QVBox* subframe = new QVBox( topframe ); 702 Q3VBox* subframe = new Q3VBox( topframe );
698 bl->addWidget(subframe ); 703 bl->addWidget(subframe );
699 QLabel* lab = new QLabel( i18n("Local Addressee"), subframe ); 704 QLabel* lab = new QLabel( i18n("Local Addressee"), subframe );
700 if ( takeloc ) 705 if ( takeloc )
701 lab->setBackgroundColor(Qt::green.light() ); 706 lab->setBackgroundColor(QColor(Qt::green).light() );
702 AddresseeView * av = new AddresseeView( subframe ); 707 AddresseeView * av = new AddresseeView( subframe );
703 av->setAddressee( loc ); 708 av->setAddressee( loc );
704 subframe = new QVBox( topframe ); 709 subframe = new Q3VBox( topframe );
705 bl->addWidget(subframe ); 710 bl->addWidget(subframe );
706 lab = new QLabel( i18n("Remote Addressee"), subframe ); 711 lab = new QLabel( i18n("Remote Addressee"), subframe );
707 if ( !takeloc ) 712 if ( !takeloc )
708 lab->setBackgroundColor(Qt::green.light() ); 713 lab->setBackgroundColor(QColor(Qt::green).light() );
709 av = new AddresseeView( subframe ); 714 av = new AddresseeView( subframe );
710 av->setAddressee( rem ); 715 av->setAddressee( rem );
711 QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); 716 QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote()));
712 QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local())); 717 QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local()));
713#ifndef DESKTOP_VERSION 718#ifndef DESKTOP_VERSION
714 showMaximized(); 719 showMaximized();
715#else 720#else
716 resize ( 640, 400 ); 721 resize ( 640, 400 );
717#endif 722#endif
718} 723}
719 724
720int AddresseeChooser::executeD( bool local ) 725int AddresseeChooser::executeD( bool local )
diff --git a/kabc/addresseeview.h b/kabc/addresseeview.h
index a4de085..f7ce2e0 100644
--- a/kabc/addresseeview.h
+++ b/kabc/addresseeview.h
@@ -17,30 +17,30 @@
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#ifndef KPIM_ADDRESSEEVIEW_H 22#ifndef KPIM_ADDRESSEEVIEW_H
23#define KPIM_ADDRESSEEVIEW_H 23#define KPIM_ADDRESSEEVIEW_H
24 24
25#include <kabc/addressee.h> 25#include <kabc/addressee.h>
26#include <kdialogbase.h> 26#include <kdialogbase.h>
27 27
28//US #include <ktextbrowser.h> 28//US #include <ktextbrowser.h>
29#include <qtextbrowser.h> 29#include <q3textbrowser.h>
30 30
31namespace KABC { 31namespace KABC {
32 32
33//US class AddresseeView : public KTextBrowser 33//US class AddresseeView : public KTextBrowser
34class AddresseeView : public QTextBrowser 34class AddresseeView : public Q3TextBrowser
35{ 35{
36 36
37 public: 37 public:
38 AddresseeView( QWidget *parent = 0, const char *name = 0 ); 38 AddresseeView( QWidget *parent = 0, const char *name = 0 );
39 39
40 /** 40 /**
41 Sets the addressee object. The addressee is displayed immediately. 41 Sets the addressee object. The addressee is displayed immediately.
42 42
43 @param addr The addressee object. 43 @param addr The addressee object.
44 */ 44 */
45 void setAddressee( const KABC::Addressee& addr ); 45 void setAddressee( const KABC::Addressee& addr );
46 void setSource(const QString& n); 46 void setSource(const QString& n);
diff --git a/kabc/distributionlist.cpp b/kabc/distributionlist.cpp
index d34ba0b..cf5afa6 100644
--- a/kabc/distributionlist.cpp
+++ b/kabc/distributionlist.cpp
@@ -14,24 +14,26 @@
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <ksimpleconfig.h> 21#include <ksimpleconfig.h>
22#include <kstandarddirs.h> 22#include <kstandarddirs.h>
23#include <kdebug.h> 23#include <kdebug.h>
24 24
25#include "distributionlist.h" 25#include "distributionlist.h"
26//Added by qt3to4:
27#include <Q3ValueList>
26 28
27using namespace KABC; 29using namespace KABC;
28 30
29DistributionList::DistributionList( DistributionListManager *manager, 31DistributionList::DistributionList( DistributionListManager *manager,
30 const QString &name ) : 32 const QString &name ) :
31 mManager( manager ), mName( name ) 33 mManager( manager ), mName( name )
32{ 34{
33 mManager->insert( this ); 35 mManager->insert( this );
34} 36}
35 37
36DistributionList::~DistributionList() 38DistributionList::~DistributionList()
37{ 39{
@@ -45,45 +47,45 @@ void DistributionList::setName( const QString &name )
45 47
46QString DistributionList::name() const 48QString DistributionList::name() const
47{ 49{
48 return mName; 50 return mName;
49} 51}
50 52
51void DistributionList::insertEntry( const Addressee &a, const QString &email ) 53void DistributionList::insertEntry( const Addressee &a, const QString &email )
52{ 54{
53 QString em = email; 55 QString em = email;
54 if (em.isNull() ) 56 if (em.isNull() )
55 em = a.preferredEmail(); 57 em = a.preferredEmail();
56 Entry e( a, em ); 58 Entry e( a, em );
57 QValueList<Entry>::Iterator it; 59 Q3ValueList<Entry>::Iterator it;
58 for( it = mEntries.begin(); it != mEntries.end(); ++it ) { 60 for( it = mEntries.begin(); it != mEntries.end(); ++it ) {
59 if ( (*it).addressee.uid() == a.uid() ) { 61 if ( (*it).addressee.uid() == a.uid() ) {
60 /** 62 /**
61 We have to check if both email addresses contains no data, 63 We have to check if both email addresses contains no data,
62 a simple 'email1 == email2' wont work here 64 a simple 'email1 == email2' wont work here
63 */ 65 */
64 if ( ( (*it).email.isNull() && em.isEmpty() ) || 66 if ( ( (*it).email.isNull() && em.isEmpty() ) ||
65 ( (*it).email.isEmpty() && em.isNull() ) || 67 ( (*it).email.isEmpty() && em.isNull() ) ||
66 ( (*it).email == em ) ) { 68 ( (*it).email == em ) ) {
67 //*it = e; 69 //*it = e;
68 return; 70 return;
69 } 71 }
70 } 72 }
71 } 73 }
72 mEntries.append( e ); 74 mEntries.append( e );
73} 75}
74 76
75void DistributionList::removeEntry( const Addressee &a, const QString &email ) 77void DistributionList::removeEntry( const Addressee &a, const QString &email )
76{ 78{
77 QValueList<Entry>::Iterator it; 79 Q3ValueList<Entry>::Iterator it;
78 for( it = mEntries.begin(); it != mEntries.end(); ++it ) { 80 for( it = mEntries.begin(); it != mEntries.end(); ++it ) {
79 if ( (*it).addressee.uid() == a.uid() && (*it).email == email ) { 81 if ( (*it).addressee.uid() == a.uid() && (*it).email == email ) {
80 mEntries.remove( it ); 82 mEntries.remove( it );
81 return; 83 return;
82 } 84 }
83 } 85 }
84} 86}
85 87
86QStringList DistributionList::emails() const 88QStringList DistributionList::emails() const
87{ 89{
88 QStringList emails; 90 QStringList emails;
89 91
diff --git a/kabc/distributionlist.h b/kabc/distributionlist.h
index c81e543..8d21a17 100644
--- a/kabc/distributionlist.h
+++ b/kabc/distributionlist.h
@@ -15,49 +15,52 @@
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#ifndef KABC_DISTRIBUTIONLIST_H 21#ifndef KABC_DISTRIBUTIONLIST_H
22#define KABC_DISTRIBUTIONLIST_H 22#define KABC_DISTRIBUTIONLIST_H
23 23
24//#include <kdirwatch.h> 24//#include <kdirwatch.h>
25 25
26#include "addressbook.h" 26#include "addressbook.h"
27//Added by qt3to4:
28#include <Q3ValueList>
29#include <Q3PtrList>
27 30
28namespace KABC { 31namespace KABC {
29 32
30class DistributionListManager; 33class DistributionListManager;
31 34
32/** 35/**
33 @short Distribution list of email addresses 36 @short Distribution list of email addresses
34 37
35 This class represents a list of email addresses. Each email address is 38 This class represents a list of email addresses. Each email address is
36 associated with an address book entry. If the address book entry changes, the 39 associated with an address book entry. If the address book entry changes, the
37 entry in the distribution list is automatically updated. 40 entry in the distribution list is automatically updated.
38*/ 41*/
39class DistributionList 42class DistributionList
40{ 43{
41 public: 44 public:
42 /** 45 /**
43 @short Distribution List Entry 46 @short Distribution List Entry
44 47
45 This class represents an entry of a distribution list. It consists of an 48 This class represents an entry of a distribution list. It consists of an
46 addressee and an email address. If the email address is null, the 49 addressee and an email address. If the email address is null, the
47 preferred email address of the addressee is used. 50 preferred email address of the addressee is used.
48 */ 51 */
49 struct Entry 52 struct Entry
50 { 53 {
51 typedef QValueList<Entry> List; 54 typedef Q3ValueList<Entry> List;
52 55
53 Entry() {} 56 Entry() {}
54 Entry( const Addressee &_addressee, const QString &_email ) : 57 Entry( const Addressee &_addressee, const QString &_email ) :
55 addressee( _addressee ), email( _email ) {} 58 addressee( _addressee ), email( _email ) {}
56 59
57 Addressee addressee; 60 Addressee addressee;
58 QString email; 61 QString email;
59 }; 62 };
60 63
61 /** 64 /**
62 Create distribution list object. 65 Create distribution list object.
63 66
@@ -158,25 +161,25 @@ class DistributionListManager
158 Load distribution lists form disk. 161 Load distribution lists form disk.
159 */ 162 */
160 bool load(); 163 bool load();
161 164
162 /** 165 /**
163 Save distribution lists to disk. 166 Save distribution lists to disk.
164 */ 167 */
165 bool save(); 168 bool save();
166 169
167 private: 170 private:
168 AddressBook *mAddressBook; 171 AddressBook *mAddressBook;
169 172
170 QPtrList<DistributionList> mLists; 173 Q3PtrList<DistributionList> mLists;
171}; 174};
172 175
173/** 176/**
174 @short Watchdog for distribution lists 177 @short Watchdog for distribution lists
175 178
176 This class provides a @ref changed() signal that i emitted when the 179 This class provides a @ref changed() signal that i emitted when the
177 distribution lists has changed in some way. 180 distribution lists has changed in some way.
178 181
179 Exapmle: 182 Exapmle:
180 183
181 <pre> 184 <pre>
182 KABC::DistributionListWatcher *watchdog = KABC::DistributionListWatcher::self() 185 KABC::DistributionListWatcher *watchdog = KABC::DistributionListWatcher::self()
diff --git a/kabc/distributionlistdialog.cpp b/kabc/distributionlistdialog.cpp
index d2e1144..82883e6 100644
--- a/kabc/distributionlistdialog.cpp
+++ b/kabc/distributionlistdialog.cpp
@@ -9,31 +9,37 @@
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qlistview.h> 21#include <q3listview.h>
22#include <qlayout.h> 22#include <qlayout.h>
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qpushbutton.h> 24#include <qpushbutton.h>
25#include <qcombobox.h> 25#include <qcombobox.h>
26//Added by qt3to4:
27#include <Q3HBoxLayout>
28#include <Q3GridLayout>
29#include <Q3Frame>
30#include <Q3VBoxLayout>
26#include <klineeditdlg.h> 31#include <klineeditdlg.h>
27#include <qbuttongroup.h> 32#include <q3buttongroup.h>
33#include <Q3Button>
28#include <qradiobutton.h> 34#include <qradiobutton.h>
29 35
30#include <klocale.h> 36#include <klocale.h>
31#include <kdebug.h> 37#include <kdebug.h>
32#include <kmessagebox.h> 38#include <kmessagebox.h>
33 39
34#include "addressbook.h" 40#include "addressbook.h"
35#include "addresseedialog.h" 41#include "addresseedialog.h"
36#include "distributionlist.h" 42#include "distributionlist.h"
37 43
38#include "distributionlistdialog.h" 44#include "distributionlistdialog.h"
39 45
@@ -51,66 +57,66 @@ DistributionListDialog::DistributionListDialog( AddressBook *addressBook, QWidge
51} 57}
52 58
53DistributionListDialog::~DistributionListDialog() 59DistributionListDialog::~DistributionListDialog()
54{ 60{
55} 61}
56 62
57 63
58EmailSelector::EmailSelector( const QStringList &emails, const QString &current, 64EmailSelector::EmailSelector( const QStringList &emails, const QString &current,
59 QWidget *parent ) : 65 QWidget *parent ) :
60 KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, 66 KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok,
61 parent ) 67 parent )
62{ 68{
63 QFrame *topFrame = plainPage(); 69 Q3Frame *topFrame = plainPage();
64 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 70 Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame );
65 71
66 mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), 72 mButtonGroup = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"),
67 topFrame ); 73 topFrame );
68 topLayout->addWidget( mButtonGroup ); 74 topLayout->addWidget( mButtonGroup );
69 75
70 QStringList::ConstIterator it; 76 QStringList::ConstIterator it;
71 for( it = emails.begin(); it != emails.end(); ++it ) { 77 for( it = emails.begin(); it != emails.end(); ++it ) {
72 QRadioButton *button = new QRadioButton( *it, mButtonGroup ); 78 QRadioButton *button = new QRadioButton( *it, mButtonGroup );
73 if ( (*it) == current ) { 79 if ( (*it) == current ) {
74 button->setDown( true ); 80 button->setDown( true );
75 } 81 }
76 } 82 }
77} 83}
78 84
79QString EmailSelector::selected() 85QString EmailSelector::selected()
80{ 86{
81 QButton *button = mButtonGroup->selected(); 87 QAbstractButton *button = mButtonGroup->selected();
82 if ( button ) return button->text(); 88 if ( button ) return button->text();
83 return QString::null; 89 return QString::null;
84} 90}
85 91
86QString EmailSelector::getEmail( const QStringList &emails, const QString &current, 92QString EmailSelector::getEmail( const QStringList &emails, const QString &current,
87 QWidget *parent ) 93 QWidget *parent )
88{ 94{
89 EmailSelector *dlg = new EmailSelector( emails, current, parent ); 95 EmailSelector *dlg = new EmailSelector( emails, current, parent );
90 dlg->exec(); 96 dlg->exec();
91 97
92 QString result = dlg->selected(); 98 QString result = dlg->selected();
93 99
94 delete dlg; 100 delete dlg;
95 101
96 return result; 102 return result;
97} 103}
98 104
99class EntryItem : public QListViewItem 105class EntryItem : public Q3ListViewItem
100{ 106{
101 public: 107 public:
102 EntryItem( QListView *parent, const Addressee &addressee, 108 EntryItem( Q3ListView *parent, const Addressee &addressee,
103 const QString &email=QString::null ) : 109 const QString &email=QString::null ) :
104 QListViewItem( parent ), 110 Q3ListViewItem( parent ),
105 mAddressee( addressee ), 111 mAddressee( addressee ),
106 mEmail( email ) 112 mEmail( email )
107 { 113 {
108 setText( 0, addressee.realName() ); 114 setText( 0, addressee.realName() );
109 if( email.isEmpty() ) { 115 if( email.isEmpty() ) {
110 setText( 1, addressee.preferredEmail() ); 116 setText( 1, addressee.preferredEmail() );
111 setText( 2, i18n("Yes") ); 117 setText( 2, i18n("Yes") );
112 } else { 118 } else {
113 setText( 1, email ); 119 setText( 1, email );
114 setText( 2, i18n("No") ); 120 setText( 2, i18n("No") );
115 } 121 }
116 } 122 }
@@ -127,70 +133,70 @@ class EntryItem : public QListViewItem
127 133
128 private: 134 private:
129 Addressee mAddressee; 135 Addressee mAddressee;
130 QString mEmail; 136 QString mEmail;
131}; 137};
132 138
133DistributionListEditorWidget::DistributionListEditorWidget( AddressBook *addressBook, QWidget *parent) : 139DistributionListEditorWidget::DistributionListEditorWidget( AddressBook *addressBook, QWidget *parent) :
134 QWidget( parent ), 140 QWidget( parent ),
135 mAddressBook( addressBook ) 141 mAddressBook( addressBook )
136{ 142{
137 kdDebug(5700) << "DistributionListEditor()" << endl; 143 kdDebug(5700) << "DistributionListEditor()" << endl;
138 144
139 QBoxLayout *topLayout = new QVBoxLayout( this ); 145 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
140 topLayout->setSpacing( KDialog::spacingHint() ); 146 topLayout->setSpacing( KDialog::spacingHint() );
141 147
142 QBoxLayout *nameLayout = new QHBoxLayout( topLayout) ; 148 Q3BoxLayout *nameLayout = new Q3HBoxLayout( topLayout) ;
143 149
144 mNameCombo = new QComboBox( this ); 150 mNameCombo = new QComboBox( this );
145 nameLayout->addWidget( mNameCombo ); 151 nameLayout->addWidget( mNameCombo );
146 connect( mNameCombo, SIGNAL( activated( int ) ), SLOT( updateEntryView() ) ); 152 connect( mNameCombo, SIGNAL( activated( int ) ), SLOT( updateEntryView() ) );
147 153
148 mNewButton = new QPushButton( i18n("New List..."), this ); 154 mNewButton = new QPushButton( i18n("New List..."), this );
149 nameLayout->addWidget( mNewButton ); 155 nameLayout->addWidget( mNewButton );
150 connect( mNewButton, SIGNAL( clicked() ), SLOT( newList() ) ); 156 connect( mNewButton, SIGNAL( clicked() ), SLOT( newList() ) );
151 157
152 mEditButton = new QPushButton( i18n("Rename List..."), this ); 158 mEditButton = new QPushButton( i18n("Rename List..."), this );
153 nameLayout->addWidget( mEditButton ); 159 nameLayout->addWidget( mEditButton );
154 connect( mEditButton, SIGNAL( clicked() ), SLOT( editList() ) ); 160 connect( mEditButton, SIGNAL( clicked() ), SLOT( editList() ) );
155 161
156 mRemoveButton = new QPushButton( i18n("Remove List"), this ); 162 mRemoveButton = new QPushButton( i18n("Remove List"), this );
157 nameLayout->addWidget( mRemoveButton ); 163 nameLayout->addWidget( mRemoveButton );
158 connect( mRemoveButton, SIGNAL( clicked() ), SLOT( removeList() ) ); 164 connect( mRemoveButton, SIGNAL( clicked() ), SLOT( removeList() ) );
159 165
160 QGridLayout *gridLayout = new QGridLayout( topLayout, 3, 3 ); 166 Q3GridLayout *gridLayout = new Q3GridLayout( topLayout, 3, 3 );
161 gridLayout->setColStretch(1, 1); 167 gridLayout->setColStretch(1, 1);
162 168
163 QLabel *listLabel = new QLabel( i18n("Available addresses:"), this ); 169 QLabel *listLabel = new QLabel( i18n("Available addresses:"), this );
164 gridLayout->addWidget( listLabel, 0, 0 ); 170 gridLayout->addWidget( listLabel, 0, 0 );
165 171
166 mListLabel = new QLabel( this ); 172 mListLabel = new QLabel( this );
167 gridLayout->addMultiCellWidget( mListLabel, 0, 0, 1, 2 ); 173 gridLayout->addMultiCellWidget( mListLabel, 0, 0, 1, 2 );
168 174
169 mAddresseeView = new QListView( this ); 175 mAddresseeView = new Q3ListView( this );
170 mAddresseeView->addColumn( i18n("Name") ); 176 mAddresseeView->addColumn( i18n("Name") );
171 mAddresseeView->addColumn( i18n("Preferred Email") ); 177 mAddresseeView->addColumn( i18n("Preferred Email") );
172 mAddresseeView->setAllColumnsShowFocus( true ); 178 mAddresseeView->setAllColumnsShowFocus( true );
173 gridLayout->addWidget( mAddresseeView, 1, 0 ); 179 gridLayout->addWidget( mAddresseeView, 1, 0 );
174 connect( mAddresseeView, SIGNAL( selectionChanged() ), 180 connect( mAddresseeView, SIGNAL( selectionChanged() ),
175 SLOT( slotSelectionAddresseeViewChanged() ) ); 181 SLOT( slotSelectionAddresseeViewChanged() ) );
176 connect( mAddresseeView, SIGNAL( doubleClicked( QListViewItem * ) ), 182 connect( mAddresseeView, SIGNAL( doubleClicked( Q3ListViewItem * ) ),
177 SLOT( addEntry() ) ); 183 SLOT( addEntry() ) );
178 184
179 mAddEntryButton = new QPushButton( i18n("Add Entry"), this ); 185 mAddEntryButton = new QPushButton( i18n("Add Entry"), this );
180 mAddEntryButton->setEnabled(false); 186 mAddEntryButton->setEnabled(false);
181 gridLayout->addWidget( mAddEntryButton, 2, 0 ); 187 gridLayout->addWidget( mAddEntryButton, 2, 0 );
182 connect( mAddEntryButton, SIGNAL( clicked() ), SLOT( addEntry() ) ); 188 connect( mAddEntryButton, SIGNAL( clicked() ), SLOT( addEntry() ) );
183 189
184 mEntryView = new QListView( this ); 190 mEntryView = new Q3ListView( this );
185 mEntryView->addColumn( i18n("Name") ); 191 mEntryView->addColumn( i18n("Name") );
186 mEntryView->addColumn( i18n("Email") ); 192 mEntryView->addColumn( i18n("Email") );
187 mEntryView->addColumn( i18n("Use Preferred") ); 193 mEntryView->addColumn( i18n("Use Preferred") );
188 mEntryView->setEnabled(false); 194 mEntryView->setEnabled(false);
189 mEntryView->setAllColumnsShowFocus( true ); 195 mEntryView->setAllColumnsShowFocus( true );
190 gridLayout->addMultiCellWidget( mEntryView, 1, 1, 1, 2 ); 196 gridLayout->addMultiCellWidget( mEntryView, 1, 1, 1, 2 );
191 connect( mEntryView, SIGNAL( selectionChanged() ), 197 connect( mEntryView, SIGNAL( selectionChanged() ),
192 SLOT( slotSelectionEntryViewChanged() ) ); 198 SLOT( slotSelectionEntryViewChanged() ) );
193 199
194 mChangeEmailButton = new QPushButton( i18n("Change Email..."), this ); 200 mChangeEmailButton = new QPushButton( i18n("Change Email..."), this );
195 gridLayout->addWidget( mChangeEmailButton, 2, 1 ); 201 gridLayout->addWidget( mChangeEmailButton, 2, 1 );
196 connect( mChangeEmailButton, SIGNAL( clicked() ), SLOT( changeEmail() ) ); 202 connect( mChangeEmailButton, SIGNAL( clicked() ), SLOT( changeEmail() ) );
diff --git a/kabc/distributionlistdialog.h b/kabc/distributionlistdialog.h
index b6d3c80..3627431 100644
--- a/kabc/distributionlistdialog.h
+++ b/kabc/distributionlistdialog.h
@@ -13,31 +13,33 @@
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#ifndef KABC_DISTRIBUTIONLISTDIALOG_H 21#ifndef KABC_DISTRIBUTIONLISTDIALOG_H
22#define KABC_DISTRIBUTIONLISTDIALOG_H 22#define KABC_DISTRIBUTIONLISTDIALOG_H
23 23
24#include <qwidget.h> 24#include <qwidget.h>
25//Added by qt3to4:
26#include <QLabel>
25 27
26#include <kdialogbase.h> 28#include <kdialogbase.h>
27 29
28class QListView; 30class Q3ListView;
29class QLabel; 31class QLabel;
30class QComboBox; 32class QComboBox;
31class QButtonGroup; 33class Q3ButtonGroup;
32 34
33namespace KABC { 35namespace KABC {
34 36
35class AddressBook; 37class AddressBook;
36class DistributionListEditorWidget; 38class DistributionListEditorWidget;
37class DistributionListManager; 39class DistributionListManager;
38 40
39/** 41/**
40 @short Frontend to create distribution lists 42 @short Frontend to create distribution lists
41 43
42 Creating a new DistributionListDialog does automatically 44 Creating a new DistributionListDialog does automatically
43 load all addressees and distribution lists from the config 45 load all addressees and distribution lists from the config
@@ -84,25 +86,25 @@ class DistributionListDialog : public KDialogBase
84class EmailSelector : public KDialogBase 86class EmailSelector : public KDialogBase
85{ 87{
86 public: 88 public:
87 EmailSelector( const QStringList &emails, const QString &current, 89 EmailSelector( const QStringList &emails, const QString &current,
88 QWidget *parent ); 90 QWidget *parent );
89 91
90 QString selected(); 92 QString selected();
91 93
92 static QString getEmail( const QStringList &emails, const QString &current, 94 static QString getEmail( const QStringList &emails, const QString &current,
93 QWidget *parent ); 95 QWidget *parent );
94 96
95 private: 97 private:
96 QButtonGroup *mButtonGroup; 98 Q3ButtonGroup *mButtonGroup;
97}; 99};
98 100
99/** 101/**
100 @short Helper class 102 @short Helper class
101*/ 103*/
102class DistributionListEditorWidget : public QWidget 104class DistributionListEditorWidget : public QWidget
103{ 105{
104 Q_OBJECT 106 Q_OBJECT
105 107
106 public: 108 public:
107 DistributionListEditorWidget( AddressBook *, QWidget *parent ); 109 DistributionListEditorWidget( AddressBook *, QWidget *parent );
108 virtual ~DistributionListEditorWidget(); 110 virtual ~DistributionListEditorWidget();
@@ -115,26 +117,26 @@ class DistributionListEditorWidget : public QWidget
115 void removeEntry(); 117 void removeEntry();
116 void changeEmail(); 118 void changeEmail();
117 void updateEntryView(); 119 void updateEntryView();
118 void updateAddresseeView(); 120 void updateAddresseeView();
119 void updateNameCombo(); 121 void updateNameCombo();
120 void slotSelectionEntryViewChanged(); 122 void slotSelectionEntryViewChanged();
121 void slotSelectionAddresseeViewChanged(); 123 void slotSelectionAddresseeViewChanged();
122 void save(); 124 void save();
123 125
124 private: 126 private:
125 QComboBox *mNameCombo; 127 QComboBox *mNameCombo;
126 QLabel *mListLabel; 128 QLabel *mListLabel;
127 QListView *mEntryView; 129 Q3ListView *mEntryView;
128 QListView *mAddresseeView; 130 Q3ListView *mAddresseeView;
129 131
130 AddressBook *mAddressBook; 132 AddressBook *mAddressBook;
131 DistributionListManager *mManager; 133 DistributionListManager *mManager;
132 QPushButton *mNewButton, *mEditButton, *mRemoveButton; 134 QPushButton *mNewButton, *mEditButton, *mRemoveButton;
133 QPushButton *mChangeEmailButton, *mRemoveEntryButton, *mAddEntryButton; 135 QPushButton *mChangeEmailButton, *mRemoveEntryButton, *mAddEntryButton;
134 136
135 struct Data; 137 struct Data;
136 Data *d; 138 Data *d;
137}; 139};
138 140
139} 141}
140#endif 142#endif
diff --git a/kabc/distributionlisteditor.cpp b/kabc/distributionlisteditor.cpp
index 9f5840b..ca5ecb7 100644
--- a/kabc/distributionlisteditor.cpp
+++ b/kabc/distributionlisteditor.cpp
@@ -9,97 +9,101 @@
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qlistview.h> 21#include <q3listview.h>
22#include <qlayout.h> 22#include <qlayout.h>
23#include <qpushbutton.h> 23#include <qpushbutton.h>
24#include <qcombobox.h> 24#include <qcombobox.h>
25#ifdef DESKTOP_VERSION 25#ifdef DESKTOP_VERSION
26#include <qinputdialog.h> 26#include <qinputdialog.h>
27#else 27#else
28#include <qtcompat/qinputdialog.h> 28#include <qtcompat/qinputdialog.h>
29#endif 29#endif
30#include <qbuttongroup.h> 30#include <q3buttongroup.h>
31#include <qradiobutton.h> 31#include <qradiobutton.h>
32//Added by qt3to4:
33#include <Q3HBoxLayout>
34#include <Q3Frame>
35#include <Q3VBoxLayout>
32 36
33#include <klocale.h> 37#include <klocale.h>
34#include <kdebug.h> 38#include <kdebug.h>
35 39
36#include "addressbook.h" 40#include "addressbook.h"
37#include "addresseedialog.h" 41#include "addresseedialog.h"
38#include "distributionlist.h" 42#include "distributionlist.h"
39 43
40#include "distributionlisteditor.h" 44#include "distributionlisteditor.h"
41 45
42//US #include "distributionlisteditor.moc" 46//US #include "distributionlisteditor.moc"
43 47
44using namespace KABC; 48using namespace KABC;
45 49
46EmailSelectDialog::EmailSelectDialog( const QStringList &emails, const QString &current, 50EmailSelectDialog::EmailSelectDialog( const QStringList &emails, const QString &current,
47 QWidget *parent ) : 51 QWidget *parent ) :
48 KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, 52 KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok,
49 parent ) 53 parent )
50{ 54{
51 QFrame *topFrame = plainPage(); 55 Q3Frame *topFrame = plainPage();
52 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 56 Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame );
53 57
54 mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), 58 mButtonGroup = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"),
55 topFrame ); 59 topFrame );
56 topLayout->addWidget( mButtonGroup ); 60 topLayout->addWidget( mButtonGroup );
57 61
58 QStringList::ConstIterator it; 62 QStringList::ConstIterator it;
59 for( it = emails.begin(); it != emails.end(); ++it ) { 63 for( it = emails.begin(); it != emails.end(); ++it ) {
60 QRadioButton *button = new QRadioButton( *it, mButtonGroup ); 64 QRadioButton *button = new QRadioButton( *it, mButtonGroup );
61 if ( (*it) == current ) { 65 if ( (*it) == current ) {
62 button->setDown( true ); 66 button->setDown( true );
63 } 67 }
64 } 68 }
65} 69}
66 70
67QString EmailSelectDialog::selected() 71QString EmailSelectDialog::selected()
68{ 72{
69 QButton *button = mButtonGroup->selected(); 73 QAbstractButton *button = mButtonGroup->selected();
70 if ( button ) return button->text(); 74 if ( button ) return button->text();
71 return QString::null; 75 return QString::null;
72} 76}
73 77
74QString EmailSelectDialog::getEmail( const QStringList &emails, const QString &current, 78QString EmailSelectDialog::getEmail( const QStringList &emails, const QString &current,
75 QWidget *parent ) 79 QWidget *parent )
76{ 80{
77 81
78 EmailSelectDialog *dlg = new EmailSelectDialog( emails, current, parent ); 82 EmailSelectDialog *dlg = new EmailSelectDialog( emails, current, parent );
79 dlg->exec(); 83 dlg->exec();
80 84
81 QString result = dlg->selected(); 85 QString result = dlg->selected();
82 86
83 delete dlg; 87 delete dlg;
84 88
85 return result; 89 return result;
86} 90}
87 91
88class EditEntryItem : public QListViewItem 92class EditEntryItem : public Q3ListViewItem
89{ 93{
90 public: 94 public:
91 EditEntryItem( QListView *parent, const Addressee &addressee, 95 EditEntryItem( Q3ListView *parent, const Addressee &addressee,
92 const QString &email=QString::null ) : 96 const QString &email=QString::null ) :
93 QListViewItem( parent ), 97 Q3ListViewItem( parent ),
94 mAddressee( addressee ), 98 mAddressee( addressee ),
95 mEmail( email ) 99 mEmail( email )
96 { 100 {
97 setText( 0, addressee.realName() ); 101 setText( 0, addressee.realName() );
98 if( email.isEmpty() ) { 102 if( email.isEmpty() ) {
99 setText( 1, addressee.preferredEmail() ); 103 setText( 1, addressee.preferredEmail() );
100 setText( 2, i18n("Yes") ); 104 setText( 2, i18n("Yes") );
101 } else { 105 } else {
102 setText( 1, email ); 106 setText( 1, email );
103 setText( 2, i18n("No") ); 107 setText( 2, i18n("No") );
104 } 108 }
105 } 109 }
@@ -116,62 +120,62 @@ class EditEntryItem : public QListViewItem
116 120
117 private: 121 private:
118 Addressee mAddressee; 122 Addressee mAddressee;
119 QString mEmail; 123 QString mEmail;
120}; 124};
121 125
122DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidget *parent) : 126DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidget *parent) :
123 QWidget( parent ), 127 QWidget( parent ),
124 mAddressBook( addressBook ) 128 mAddressBook( addressBook )
125{ 129{
126 kdDebug(5700) << "DistributionListEditor()" << endl; 130 kdDebug(5700) << "DistributionListEditor()" << endl;
127 131
128 QBoxLayout *topLayout = new QVBoxLayout( this ); 132 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
129 topLayout->setMargin( KDialog::marginHint() ); 133 topLayout->setMargin( KDialog::marginHint() );
130 topLayout->setSpacing( KDialog::spacingHint() ); 134 topLayout->setSpacing( KDialog::spacingHint() );
131 135
132 QBoxLayout *nameLayout = new QHBoxLayout( topLayout) ; 136 Q3BoxLayout *nameLayout = new Q3HBoxLayout( topLayout) ;
133 137
134 mNameCombo = new QComboBox( this ); 138 mNameCombo = new QComboBox( this );
135 nameLayout->addWidget( mNameCombo ); 139 nameLayout->addWidget( mNameCombo );
136 connect( mNameCombo, SIGNAL( activated( int ) ), SLOT( updateEntryView() ) ); 140 connect( mNameCombo, SIGNAL( activated( int ) ), SLOT( updateEntryView() ) );
137 141
138 newButton = new QPushButton( i18n("New List"), this ); 142 newButton = new QPushButton( i18n("New List"), this );
139 nameLayout->addWidget( newButton ); 143 nameLayout->addWidget( newButton );
140 connect( newButton, SIGNAL( clicked() ), SLOT( newList() ) ); 144 connect( newButton, SIGNAL( clicked() ), SLOT( newList() ) );
141 145
142 removeButton = new QPushButton( i18n("Remove List"), this ); 146 removeButton = new QPushButton( i18n("Remove List"), this );
143 nameLayout->addWidget( removeButton ); 147 nameLayout->addWidget( removeButton );
144 connect( removeButton, SIGNAL( clicked() ), SLOT( removeList() ) ); 148 connect( removeButton, SIGNAL( clicked() ), SLOT( removeList() ) );
145 149
146 mEntryView = new QListView( this ); 150 mEntryView = new Q3ListView( this );
147 mEntryView->addColumn( i18n("Name") ); 151 mEntryView->addColumn( i18n("Name") );
148 mEntryView->addColumn( i18n("Email") ); 152 mEntryView->addColumn( i18n("Email") );
149 mEntryView->addColumn( i18n("Use Preferred") ); 153 mEntryView->addColumn( i18n("Use Preferred") );
150 topLayout->addWidget( mEntryView ); 154 topLayout->addWidget( mEntryView );
151 connect(mEntryView,SIGNAL(selectionChanged ()),this, SLOT(slotSelectionEntryViewChanged())); 155 connect(mEntryView,SIGNAL(selectionChanged ()),this, SLOT(slotSelectionEntryViewChanged()));
152 156
153 changeEmailButton = new QPushButton( i18n("Change Email"), this ); 157 changeEmailButton = new QPushButton( i18n("Change Email"), this );
154 topLayout->addWidget( changeEmailButton ); 158 topLayout->addWidget( changeEmailButton );
155 connect( changeEmailButton, SIGNAL( clicked() ), SLOT( changeEmail() ) ); 159 connect( changeEmailButton, SIGNAL( clicked() ), SLOT( changeEmail() ) );
156 160
157 removeEntryButton = new QPushButton( i18n("Remove Entry"), this ); 161 removeEntryButton = new QPushButton( i18n("Remove Entry"), this );
158 topLayout->addWidget( removeEntryButton ); 162 topLayout->addWidget( removeEntryButton );
159 connect( removeEntryButton, SIGNAL( clicked() ), SLOT( removeEntry() ) ); 163 connect( removeEntryButton, SIGNAL( clicked() ), SLOT( removeEntry() ) );
160 164
161 addEntryButton = new QPushButton( i18n("Add Entry"), this ); 165 addEntryButton = new QPushButton( i18n("Add Entry"), this );
162 topLayout->addWidget( addEntryButton ); 166 topLayout->addWidget( addEntryButton );
163 connect( addEntryButton, SIGNAL( clicked() ), SLOT( addEntry() ) ); 167 connect( addEntryButton, SIGNAL( clicked() ), SLOT( addEntry() ) );
164 168
165 mAddresseeView = new QListView( this ); 169 mAddresseeView = new Q3ListView( this );
166 mAddresseeView->addColumn( i18n("Name") ); 170 mAddresseeView->addColumn( i18n("Name") );
167 mAddresseeView->addColumn( i18n("Preferred Email") ); 171 mAddresseeView->addColumn( i18n("Preferred Email") );
168 topLayout->addWidget( mAddresseeView ); 172 topLayout->addWidget( mAddresseeView );
169 173
170 174
171 connect(mAddresseeView,SIGNAL(selectionChanged ()),this, SLOT(slotSelectionAddresseeViewChanged())); 175 connect(mAddresseeView,SIGNAL(selectionChanged ()),this, SLOT(slotSelectionAddresseeViewChanged()));
172 176
173 mManager = new DistributionListManager( mAddressBook ); 177 mManager = new DistributionListManager( mAddressBook );
174 mManager->load(); 178 mManager->load();
175 179
176 updateAddresseeView(); 180 updateAddresseeView();
177 updateNameCombo(); 181 updateNameCombo();
diff --git a/kabc/distributionlisteditor.h b/kabc/distributionlisteditor.h
index e0b4221..e672a14 100644
--- a/kabc/distributionlisteditor.h
+++ b/kabc/distributionlisteditor.h
@@ -15,46 +15,46 @@
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef KABC_DISTRIBUTIONLISTEDITOR_H 20#ifndef KABC_DISTRIBUTIONLISTEDITOR_H
21#define KABC_DISTRIBUTIONLISTEDITOR_H 21#define KABC_DISTRIBUTIONLISTEDITOR_H
22 22
23#include <qwidget.h> 23#include <qwidget.h>
24 24
25#include <kdialogbase.h> 25#include <kdialogbase.h>
26 26
27class QListView; 27class Q3ListView;
28class QComboBox; 28class QComboBox;
29class QButtonGroup; 29class Q3ButtonGroup;
30 30
31namespace KABC { 31namespace KABC {
32 32
33class AddressBook; 33class AddressBook;
34class DistributionListManager; 34class DistributionListManager;
35 35
36class EmailSelectDialog : public KDialogBase 36class EmailSelectDialog : public KDialogBase
37{ 37{
38 public: 38 public:
39 EmailSelectDialog( const QStringList &emails, const QString &current, 39 EmailSelectDialog( const QStringList &emails, const QString &current,
40 QWidget *parent ); 40 QWidget *parent );
41 41
42 QString selected(); 42 QString selected();
43 43
44 static QString getEmail( const QStringList &emails, const QString &current, 44 static QString getEmail( const QStringList &emails, const QString &current,
45 QWidget *parent ); 45 QWidget *parent );
46 46
47 private: 47 private:
48 QButtonGroup *mButtonGroup; 48 Q3ButtonGroup *mButtonGroup;
49}; 49};
50 50
51/** 51/**
52 @obsolete 52 @obsolete
53*/ 53*/
54class DistributionListEditor : public QWidget 54class DistributionListEditor : public QWidget
55{ 55{
56 Q_OBJECT 56 Q_OBJECT
57 public: 57 public:
58 DistributionListEditor( AddressBook *, QWidget *parent ); 58 DistributionListEditor( AddressBook *, QWidget *parent );
59 virtual ~DistributionListEditor(); 59 virtual ~DistributionListEditor();
60 60
@@ -63,24 +63,24 @@ class DistributionListEditor : public QWidget
63 void removeList(); 63 void removeList();
64 void addEntry(); 64 void addEntry();
65 void removeEntry(); 65 void removeEntry();
66 void changeEmail(); 66 void changeEmail();
67 void updateEntryView(); 67 void updateEntryView();
68 void updateAddresseeView(); 68 void updateAddresseeView();
69 void updateNameCombo(); 69 void updateNameCombo();
70 void slotSelectionEntryViewChanged(); 70 void slotSelectionEntryViewChanged();
71 void slotSelectionAddresseeViewChanged(); 71 void slotSelectionAddresseeViewChanged();
72 72
73 private: 73 private:
74 QComboBox *mNameCombo; 74 QComboBox *mNameCombo;
75 QListView *mEntryView; 75 Q3ListView *mEntryView;
76 QListView *mAddresseeView; 76 Q3ListView *mAddresseeView;
77 77
78 AddressBook *mAddressBook; 78 AddressBook *mAddressBook;
79 DistributionListManager *mManager; 79 DistributionListManager *mManager;
80 QPushButton *newButton, *removeButton; 80 QPushButton *newButton, *removeButton;
81 QPushButton *changeEmailButton,*removeEntryButton,*addEntryButton; 81 QPushButton *changeEmailButton,*removeEntryButton,*addEntryButton;
82}; 82};
83 83
84} 84}
85 85
86#endif 86#endif
diff --git a/kabc/field.cpp b/kabc/field.cpp
index 7c6d7a9..203f696 100644
--- a/kabc/field.cpp
+++ b/kabc/field.cpp
@@ -24,24 +24,26 @@ Enhanced Version of the file for platform independent KDE tools.
24Copyright (c) 2004 Ulf Schenk 24Copyright (c) 2004 Ulf Schenk
25 25
26$Id$ 26$Id$
27*/ 27*/
28 28
29#include <klocale.h> 29#include <klocale.h>
30#include <kconfig.h> 30#include <kconfig.h>
31#include <kconfigbase.h> 31#include <kconfigbase.h>
32#include <kglobal.h> 32#include <kglobal.h>
33 33
34#include "field.h" 34#include "field.h"
35#include "resource.h" 35#include "resource.h"
36//Added by qt3to4:
37#include <Q3ValueList>
36 38
37using namespace KABC; 39using namespace KABC;
38 40
39class Field::FieldImpl 41class Field::FieldImpl
40{ 42{
41 public: 43 public:
42 FieldImpl( int fieldId, int category = 0, 44 FieldImpl( int fieldId, int category = 0,
43 const QString &label = QString::null, 45 const QString &label = QString::null,
44 const QString &key = QString::null, 46 const QString &key = QString::null,
45 const QString &app = QString::null ) 47 const QString &app = QString::null )
46 : mFieldId( fieldId ), mCategory( category ), mLabel( label ), 48 : mFieldId( fieldId ), mCategory( category ), mLabel( label ),
47 mKey( key ), mApp( app ) {} 49 mKey( key ), mApp( app ) {}
@@ -368,25 +370,25 @@ bool Field::setValue( KABC::Addressee &a, const QString &value )
368 case FieldImpl::Organization: 370 case FieldImpl::Organization:
369 a.setOrganization( value ); 371 a.setOrganization( value );
370 return true; 372 return true;
371 case FieldImpl::Note: 373 case FieldImpl::Note:
372 a.setNote( value ); 374 a.setNote( value );
373 return true; 375 return true;
374 case FieldImpl::Birthday: 376 case FieldImpl::Birthday:
375//US 377//US
376//the generated code had the following format: return a.setBirthday( QDate::fromString( value, Qt::ISODate ) ); 378//the generated code had the following format: return a.setBirthday( QDate::fromString( value, Qt::ISODate ) );
377// But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? 379// But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ?
378 { 380 {
379 QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate 381 QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate
380 a.setBirthday(dt); 382 a.setBirthday((QDateTime)dt);
381 } 383 }
382 return true; 384 return true;
383 case FieldImpl::CustomField: 385 case FieldImpl::CustomField:
384 a.insertCustom( mImpl->app(), mImpl->key(), value ); 386 a.insertCustom( mImpl->app(), mImpl->key(), value );
385//US never copy the resourcename back to the adressee. 387//US never copy the resourcename back to the adressee.
386 case FieldImpl::Resource: 388 case FieldImpl::Resource:
387 default: 389 default:
388 return false; 390 return false;
389 } 391 }
390} 392}
391 393
392bool Field::isCustom() 394bool Field::isCustom()
@@ -484,25 +486,25 @@ void Field::deleteFields()
484 486
485void Field::saveFields( const QString &identifier, 487void Field::saveFields( const QString &identifier,
486 const Field::List &fields ) 488 const Field::List &fields )
487{ 489{
488 KConfig *cfg = KGlobal::config(); 490 KConfig *cfg = KGlobal::config();
489 KConfigGroupSaver( cfg, "KABCFields" ); 491 KConfigGroupSaver( cfg, "KABCFields" );
490 saveFields( cfg, identifier, fields ); 492 saveFields( cfg, identifier, fields );
491} 493}
492 494
493void Field::saveFields( KConfig *cfg, const QString &identifier, 495void Field::saveFields( KConfig *cfg, const QString &identifier,
494 const Field::List &fields ) 496 const Field::List &fields )
495{ 497{
496 QValueList<int> fieldIds; 498 Q3ValueList<int> fieldIds;
497 499
498//US 500//US
499// qDebug("Field::saveFields to %s %s", cfg->getFileName().latin1(), identifier.latin1()); 501// qDebug("Field::saveFields to %s %s", cfg->getFileName().latin1(), identifier.latin1());
500 502
501 int custom = 0; 503 int custom = 0;
502 Field::List::ConstIterator it; 504 Field::List::ConstIterator it;
503 for( it = fields.begin(); it != fields.end(); ++it ) { 505 for( it = fields.begin(); it != fields.end(); ++it ) {
504//US 506//US
505// qDebug("Field::saveFields field:%i", (*it)->mImpl->fieldId()); 507// qDebug("Field::saveFields field:%i", (*it)->mImpl->fieldId());
506 508
507 fieldIds.append( (*it)->mImpl->fieldId() ); 509 fieldIds.append( (*it)->mImpl->fieldId() );
508 if( (*it)->isCustom() ) { 510 if( (*it)->isCustom() ) {
@@ -524,32 +526,32 @@ Field::List Field::restoreFields( const QString &identifier )
524 526
525 KConfig *cfg = KGlobal::config(); 527 KConfig *cfg = KGlobal::config();
526 KConfigGroupSaver( cfg, "KABCFields" ); 528 KConfigGroupSaver( cfg, "KABCFields" );
527 cfg->setGroup( "KABCFields" ); 529 cfg->setGroup( "KABCFields" );
528 530
529 Field::List l = restoreFields( cfg, identifier ); 531 Field::List l = restoreFields( cfg, identifier );
530 532
531 return l; 533 return l;
532} 534}
533 535
534Field::List Field::restoreFields( KConfig *cfg, const QString &identifier ) 536Field::List Field::restoreFields( KConfig *cfg, const QString &identifier )
535{ 537{
536 QValueList<int> fieldIds = cfg->readIntListEntry( identifier); 538 Q3ValueList<int> fieldIds = cfg->readIntListEntry( identifier);
537//US 539//US
538// qDebug("Field::restoreFields from %s, identifier: %s", cfg->getFileName().latin1(), identifier.latin1()); 540// qDebug("Field::restoreFields from %s, identifier: %s", cfg->getFileName().latin1(), identifier.latin1());
539 541
540 Field::List fields; 542 Field::List fields;
541 543
542 int custom = 0; 544 int custom = 0;
543 QValueList<int>::ConstIterator it; 545 Q3ValueList<int>::ConstIterator it;
544 for( it = fieldIds.begin(); it != fieldIds.end(); ++it ) { 546 for( it = fieldIds.begin(); it != fieldIds.end(); ++it ) {
545 FieldImpl *f = 0; 547 FieldImpl *f = 0;
546 if ( (*it) == FieldImpl::CustomField ) { 548 if ( (*it) == FieldImpl::CustomField ) {
547 QStringList customEntry = cfg->readListEntry( "KABC_CustomEntry_" + 549 QStringList customEntry = cfg->readListEntry( "KABC_CustomEntry_" +
548 identifier + "_" + 550 identifier + "_" +
549 QString::number( custom++ ) ); 551 QString::number( custom++ ) );
550 f = new FieldImpl( *it, CustomCategory, customEntry[ 0 ], 552 f = new FieldImpl( *it, CustomCategory, customEntry[ 0 ],
551 customEntry[ 1 ], customEntry[ 2 ] ); 553 customEntry[ 1 ], customEntry[ 2 ] );
552 } else { 554 } else {
553 f = new FieldImpl( *it ); 555 f = new FieldImpl( *it );
554 } 556 }
555 fields.append( new Field( f ) ); 557 fields.append( new Field( f ) );
diff --git a/kabc/field.h b/kabc/field.h
index 9e06597..55cc705 100644
--- a/kabc/field.h
+++ b/kabc/field.h
@@ -20,39 +20,39 @@
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#ifndef KABC_FIELD_H 28#ifndef KABC_FIELD_H
29#define KABC_FIELD_H 29#define KABC_FIELD_H
30 30
31#include <qstring.h> 31#include <qstring.h>
32#include <qvaluelist.h> 32#include <q3valuelist.h>
33 33
34#include "addressee.h" 34#include "addressee.h"
35 35
36class KConfig; 36class KConfig;
37 37
38namespace KABC { 38namespace KABC {
39 39
40class Field 40class Field
41{ 41{
42 class FieldImpl; 42 class FieldImpl;
43 friend class FieldImpl; 43 friend class FieldImpl;
44 44
45public: 45public:
46 typedef QValueList<Field *> List; 46 typedef Q3ValueList<Field *> List;
47 47
48 /** 48 /**
49 * @li @p All - 49 * @li @p All -
50 * @li @p Frequent - 50 * @li @p Frequent -
51 * @li @p Address - 51 * @li @p Address -
52 * @li @p Email - 52 * @li @p Email -
53 * @li @p Personal - 53 * @li @p Personal -
54 * @li @p Organization - 54 * @li @p Organization -
55 * @li @p CustomCategory - 55 * @li @p CustomCategory -
56 */ 56 */
57 enum FieldCategory 57 enum FieldCategory
58 { 58 {
diff --git a/kabc/formatfactory.cpp b/kabc/formatfactory.cpp
index 3ae1c27..cbb97a2 100644
--- a/kabc/formatfactory.cpp
+++ b/kabc/formatfactory.cpp
@@ -93,25 +93,25 @@ US lets enter all resources directly instead of using teh desktopfiles.
93FormatFactory::~FormatFactory() 93FormatFactory::~FormatFactory()
94{ 94{
95 mFormatList.clear(); 95 mFormatList.clear();
96} 96}
97 97
98QStringList FormatFactory::formats() 98QStringList FormatFactory::formats()
99{ 99{
100 QStringList retval; 100 QStringList retval;
101 101
102 // make sure 'vcard' is the first entry 102 // make sure 'vcard' is the first entry
103 retval << "vcard"; 103 retval << "vcard";
104 104
105 QDictIterator<FormatInfo> it( mFormatList ); 105 Q3DictIterator<FormatInfo> it( mFormatList );
106 for ( ; it.current(); ++it ) 106 for ( ; it.current(); ++it )
107 if ( it.currentKey() != "vcard" ) 107 if ( it.currentKey() != "vcard" )
108 retval << it.currentKey(); 108 retval << it.currentKey();
109 109
110 return retval; 110 return retval;
111} 111}
112 112
113FormatInfo *FormatFactory::info( const QString &type ) 113FormatInfo *FormatFactory::info( const QString &type )
114{ 114{
115 if ( type.isEmpty() ) 115 if ( type.isEmpty() )
116 return 0; 116 return 0;
117 else 117 else
diff --git a/kabc/formatfactory.h b/kabc/formatfactory.h
index 9612374..de15b17 100644
--- a/kabc/formatfactory.h
+++ b/kabc/formatfactory.h
@@ -12,25 +12,25 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#ifndef KABC_FORMATFACTORY_H 21#ifndef KABC_FORMATFACTORY_H
22#define KABC_FORMATFACTORY_H 22#define KABC_FORMATFACTORY_H
23 23
24#include <qdict.h> 24#include <q3dict.h>
25#include <qstring.h> 25#include <qstring.h>
26 26
27#include <kconfig.h> 27#include <kconfig.h>
28#ifndef DESKTOP_VERSION 28#ifndef DESKTOP_VERSION
29#include <klibloader.h> 29#include <klibloader.h>
30#endif 30#endif
31 31
32#include "formatplugin.h" 32#include "formatplugin.h"
33 33
34namespace KABC { 34namespace KABC {
35 35
36struct FormatInfo 36struct FormatInfo
@@ -88,17 +88,17 @@ class FormatFactory
88 */ 88 */
89 FormatInfo *info( const QString &type ); 89 FormatInfo *info( const QString &type );
90 90
91 protected: 91 protected:
92 FormatFactory(); 92 FormatFactory();
93 93
94 private: 94 private:
95#ifndef DESKTOP_VERSION 95#ifndef DESKTOP_VERSION
96 KLibrary *openLibrary( const QString& libName ); 96 KLibrary *openLibrary( const QString& libName );
97#endif 97#endif
98 static FormatFactory *mSelf; 98 static FormatFactory *mSelf;
99 99
100 QDict<FormatInfo> mFormatList; 100 Q3Dict<FormatInfo> mFormatList;
101}; 101};
102 102
103} 103}
104#endif 104#endif
diff --git a/kabc/formats/binary/kabcformat_binaryE.pro b/kabc/formats/binary/kabcformat_binaryE.pro
index 2d9594d..c71197e 100644
--- a/kabc/formats/binary/kabcformat_binaryE.pro
+++ b/kabc/formats/binary/kabcformat_binaryE.pro
@@ -1,21 +1,21 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3#release debug 3#release debug
4 4
5TARGET = microkabcformat_binary 5TARGET = microkabcformat_binary
6#INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../qtcompat 6#INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../qtcompat
7INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../qtcompat 7INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../qtcompat
8OBJECTS_DIR = obj/$(PLATFORM) 8OBJECTS_DIR = obj/$(PLATFORM)
9MOC_DIR = moc 9MOC_DIR = moc
10DESTDIR = $(QPEDIR)/lib 10DESTDIR = $(QPEDIR)/lib
11LIBS += -lmicrokde -lmicrokabc 11LIBS += -lxmicrokde -lxmicrokabc
12LIBS += -L$(QPEDIR)/lib 12LIBS += -L$(QPEDIR)/lib
13DEFINES += KAB_EMBEDDED 13DEFINES += KAB_EMBEDDED
14 14
15INTERFACES = \ 15INTERFACES = \
16 16
17HEADERS = \ 17HEADERS = \
18 binaryformat.h 18 binaryformat.h
19 19
20SOURCES = \ 20SOURCES = \
21 binaryformat.cpp 21 binaryformat.cpp
diff --git a/kabc/formats/vcardformatplugin2.cpp b/kabc/formats/vcardformatplugin2.cpp
index 41b0c9a..fbebe92 100644
--- a/kabc/formats/vcardformatplugin2.cpp
+++ b/kabc/formats/vcardformatplugin2.cpp
@@ -2,25 +2,25 @@
2Enhanced Version of the file for platform independent KDE tools. 2Enhanced Version of the file for platform independent KDE tools.
3Copyright (c) 2004 Ulf Schenk 3Copyright (c) 2004 Ulf Schenk
4 4
5$Id$ 5$Id$
6*/ 6*/
7 7
8#include "vcardformatplugin2.h" 8#include "vcardformatplugin2.h"
9 9
10#include "address.h" 10#include "address.h"
11#include "addressee.h" 11#include "addressee.h"
12#include "vcardparser/vcardtool.h" 12#include "vcardparser/vcardtool.h"
13 13
14#include <qtextstream.h> 14#include <q3textstream.h>
15#include <qfile.h> 15#include <qfile.h>
16 16
17using namespace KABC; 17using namespace KABC;
18 18
19extern "C" 19extern "C"
20{ 20{
21 FormatPlugin *format() 21 FormatPlugin *format()
22 { 22 {
23 return new VCardFormatPlugin2(); 23 return new VCardFormatPlugin2();
24 } 24 }
25} 25}
26 26
@@ -28,47 +28,47 @@ VCardFormatPlugin2::VCardFormatPlugin2()
28{ 28{
29} 29}
30 30
31VCardFormatPlugin2::~VCardFormatPlugin2() 31VCardFormatPlugin2::~VCardFormatPlugin2()
32{ 32{
33} 33}
34 34
35bool VCardFormatPlugin2::load( Addressee &addressee, QFile *file ) 35bool VCardFormatPlugin2::load( Addressee &addressee, QFile *file )
36{ 36{
37 qDebug("VCardFormatPlugin2::load"); 37 qDebug("VCardFormatPlugin2::load");
38 QString data; 38 QString data;
39 39
40 QTextStream t( file ); 40 Q3TextStream t( file );
41 t.setEncoding( QTextStream::UnicodeUTF8 ); 41 t.setEncoding( Q3TextStream::UnicodeUTF8 );
42 data = t.read(); 42 data = t.read();
43 43
44 VCardTool tool; 44 VCardTool tool;
45 45
46 Addressee::List l = tool.parseVCards( data ); 46 Addressee::List l = tool.parseVCards( data );
47 47
48 if ( ! l.first().isEmpty() ) { 48 if ( ! l.first().isEmpty() ) {
49 addressee = l.first(); 49 addressee = l.first();
50 return true; 50 return true;
51 } 51 }
52 52
53 return false; 53 return false;
54} 54}
55 55
56bool VCardFormatPlugin2::loadAll( AddressBook *addressBook, Resource *resource, QFile *file ) 56bool VCardFormatPlugin2::loadAll( AddressBook *addressBook, Resource *resource, QFile *file )
57{ 57{
58 qDebug("VCardFormatPlugin2::loadAll"); 58 qDebug("VCardFormatPlugin2::loadAll");
59 QString data; 59 QString data;
60 60
61 QTextStream t( file ); 61 Q3TextStream t( file );
62 t.setEncoding( QTextStream::UnicodeUTF8 ); 62 t.setEncoding( Q3TextStream::UnicodeUTF8 );
63 data = t.read(); 63 data = t.read();
64 64
65 VCardTool tool; 65 VCardTool tool;
66 66
67 Addressee::List l = tool.parseVCards( data ); 67 Addressee::List l = tool.parseVCards( data );
68 68
69 Addressee::List::Iterator itr; 69 Addressee::List::Iterator itr;
70 70
71 for ( itr = l.begin(); itr != l.end(); ++itr) { 71 for ( itr = l.begin(); itr != l.end(); ++itr) {
72 Addressee addressee = *itr; 72 Addressee addressee = *itr;
73 addressee.setResource( resource ); 73 addressee.setResource( resource );
74 addressBook->insertAddressee( addressee ); 74 addressBook->insertAddressee( addressee );
@@ -77,48 +77,48 @@ bool VCardFormatPlugin2::loadAll( AddressBook *addressBook, Resource *resource,
77 return true; 77 return true;
78} 78}
79 79
80void VCardFormatPlugin2::save( const Addressee &addressee, QFile *file ) 80void VCardFormatPlugin2::save( const Addressee &addressee, QFile *file )
81{ 81{
82 qDebug("VCardFormatPlugin2::save"); 82 qDebug("VCardFormatPlugin2::save");
83 VCardTool tool; 83 VCardTool tool;
84 Addressee::List vcardlist; 84 Addressee::List vcardlist;
85 85
86 86
87 vcardlist.append( addressee ); 87 vcardlist.append( addressee );
88 88
89 QTextStream t( file ); 89 Q3TextStream t( file );
90 t.setEncoding( QTextStream::UnicodeUTF8 ); 90 t.setEncoding( Q3TextStream::UnicodeUTF8 );
91 t << tool.createVCards( vcardlist ); 91 t << tool.createVCards( vcardlist );
92} 92}
93 93
94void VCardFormatPlugin2::saveAll( AddressBook *ab, Resource *resource, QFile *file ) 94void VCardFormatPlugin2::saveAll( AddressBook *ab, Resource *resource, QFile *file )
95{ 95{
96 qDebug("VCardFormatPlugin2::saveAll"); 96 qDebug("VCardFormatPlugin2::saveAll");
97 VCardTool tool; 97 VCardTool tool;
98 Addressee::List vcardlist; 98 Addressee::List vcardlist;
99 99
100 AddressBook::Iterator it; 100 AddressBook::Iterator it;
101 for ( it = ab->begin(); it != ab->end(); ++it ) { 101 for ( it = ab->begin(); it != ab->end(); ++it ) {
102 if ( (*it).resource() == resource ) { 102 if ( (*it).resource() == resource ) {
103 (*it).setChanged( false ); 103 (*it).setChanged( false );
104 vcardlist.append( *it ); 104 vcardlist.append( *it );
105 } 105 }
106 } 106 }
107 107
108 QTextStream t( file ); 108 Q3TextStream t( file );
109 t.setEncoding( QTextStream::UnicodeUTF8 ); 109 t.setEncoding( Q3TextStream::UnicodeUTF8 );
110 t << tool.createVCards( vcardlist ); 110 t << tool.createVCards( vcardlist );
111} 111}
112 112
113bool VCardFormatPlugin2::checkFormat( QFile *file ) const 113bool VCardFormatPlugin2::checkFormat( QFile *file ) const
114{ 114{
115 QString line; 115 QString line;
116 116
117 file->readLine( line, 1024 ); 117 char tmp[1024]; file->readLine( tmp, 1024 ); line = tmp;
118 line = line.stripWhiteSpace(); 118 line = line.stripWhiteSpace();
119 if ( line == "BEGIN:VCARD" ) 119 if ( line == "BEGIN:VCARD" )
120 return true; 120 return true;
121 else 121 else
122 return false; 122 return false;
123} 123}
124 124
diff --git a/kabc/kabc.pro b/kabc/kabc.pro
index 17ebff8..846ed8a 100644
--- a/kabc/kabc.pro
+++ b/kabc/kabc.pro
@@ -1,24 +1,24 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3#release debug 3#release debug
4DESTDIR=../bin 4DESTDIR=../bin
5 5
6TARGET = microkabc 6TARGET = xmicrokabc
7 7
8include( ../variables.pri ) 8include( ../variables.pri )
9 9
10INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim ../qtcompat ../microkde/kdeui .. 10INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim ../qtcompat ../microkde/kdeui ..
11 11
12#LIBS += -lmicrokde -lldap 12#LIBS += -lxmicrokde -lldap
13LIBS += -L$(QPEDIR)/lib 13LIBS += -L$(QPEDIR)/lib
14DEFINES += KAB_EMBEDDED DESKTOP_VERSION 14DEFINES += KAB_EMBEDDED DESKTOP_VERSION
15unix : { 15unix : {
16 16
17OBJECTS_DIR = obj/unix 17OBJECTS_DIR = obj/unix
18MOC_DIR = moc/unix 18MOC_DIR = moc/unix
19} 19}
20win32: { 20win32: {
21DEFINES += _WIN32_ 21DEFINES += _WIN32_
22OBJECTS_DIR = obj/win 22OBJECTS_DIR = obj/win
23MOC_DIR = moc/win 23MOC_DIR = moc/win
24} 24}
@@ -207,12 +207,16 @@ vcard/TelValue.cpp \
207vcard/TextBinValue.cpp \ 207vcard/TextBinValue.cpp \
208vcard/OrgValue.cpp \ 208vcard/OrgValue.cpp \
209vcard/UTCValue.cpp \ 209vcard/UTCValue.cpp \
210vcard/ClassValue.cpp \ 210vcard/ClassValue.cpp \
211vcard/FloatValue.cpp \ 211vcard/FloatValue.cpp \
212vcard/TextListValue.cpp 212vcard/TextListValue.cpp
213 213
214 214
215# plugins/ldap/resourceldap.cpp \ 215# plugins/ldap/resourceldap.cpp \
216# plugins/ldap/resourceldapconfig.cpp \ 216# plugins/ldap/resourceldapconfig.cpp \
217 217
218#formats/binary/binaryformat.cpp \ 218#formats/binary/binaryformat.cpp \
219#The following line was inserted by qt3to4
220QT += xml qt3support
221#The following line was inserted by qt3to4
222QT +=
diff --git a/kabc/kabcE.pro b/kabc/kabcE.pro
index 1d28a4d..6045b68 100644
--- a/kabc/kabcE.pro
+++ b/kabc/kabcE.pro
@@ -1,23 +1,23 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3TARGET = microkabc 3TARGET = xmicrokabc
4 4
5 5
6INCLUDEPATH += . $(KDEPIMDIR) vcard/include vcard/include/generated $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/libkdepim $(KDEPIMDIR)/qtcompat $(QPEDIR)/include 6INCLUDEPATH += . $(KDEPIMDIR) vcard/include vcard/include/generated $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/libkdepim $(KDEPIMDIR)/qtcompat $(QPEDIR)/include
7OBJECTS_DIR = obj/$(PLATFORM) 7OBJECTS_DIR = obj/$(PLATFORM)
8MOC_DIR = moc/$(PLATFORM) 8MOC_DIR = moc/$(PLATFORM)
9DESTDIR = $(QPEDIR)/lib 9DESTDIR = $(QPEDIR)/lib
10LIBS += -lmicrokde 10LIBS += -lxmicrokde
11LIBS += -lmicrokdepim 11LIBS += -lxmicrokdepim
12#LIBS += -lldap 12#LIBS += -lldap
13LIBS += -L$(QPEDIR)/lib 13LIBS += -L$(QPEDIR)/lib
14DEFINES += KAB_EMBEDDED 14DEFINES += KAB_EMBEDDED
15 15
16#enable the following line if you want to get debugoutput while loading adresses 16#enable the following line if you want to get debugoutput while loading adresses
17#DEFINES += VCARD_DEBUG 17#DEFINES += VCARD_DEBUG
18 18
19INTERFACES = \ 19INTERFACES = \
20 20
21HEADERS = \ 21HEADERS = \
22 address.h \ 22 address.h \
23 addressbook.h \ 23 addressbook.h \
@@ -185,12 +185,14 @@ vcard/SoundValue.cpp \
185vcard/AgentValue.cpp \ 185vcard/AgentValue.cpp \
186vcard/TelValue.cpp \ 186vcard/TelValue.cpp \
187vcard/TextBinValue.cpp \ 187vcard/TextBinValue.cpp \
188vcard/OrgValue.cpp \ 188vcard/OrgValue.cpp \
189vcard/UTCValue.cpp \ 189vcard/UTCValue.cpp \
190vcard/ClassValue.cpp \ 190vcard/ClassValue.cpp \
191vcard/FloatValue.cpp \ 191vcard/FloatValue.cpp \
192vcard/TextListValue.cpp 192vcard/TextListValue.cpp
193 193
194 194
195# plugins/ldap/resourceldap.cpp \ 195# plugins/ldap/resourceldap.cpp \
196# plugins/ldap/resourceldapconfig.cpp \ 196# plugins/ldap/resourceldapconfig.cpp \
197#The following line was inserted by qt3to4
198QT += qt3support
diff --git a/kabc/key.h b/kabc/key.h
index 6ea5b47..313eb7d 100644
--- a/kabc/key.h
+++ b/kabc/key.h
@@ -19,39 +19,39 @@
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#ifndef KABC_KEY_H 28#ifndef KABC_KEY_H
29#define KABC_KEY_H 29#define KABC_KEY_H
30 30
31#include <qvaluelist.h> 31#include <q3valuelist.h>
32 32
33namespace KABC { 33namespace KABC {
34 34
35/** 35/**
36 * @short A class to store an encryption key. 36 * @short A class to store an encryption key.
37 */ 37 */
38class Key 38class Key
39{ 39{
40 friend QDataStream &operator<<( QDataStream &, const Key & ); 40 friend QDataStream &operator<<( QDataStream &, const Key & );
41 friend QDataStream &operator>>( QDataStream &, Key & ); 41 friend QDataStream &operator>>( QDataStream &, Key & );
42 42
43public: 43public:
44 typedef QValueList<Key> List; 44 typedef Q3ValueList<Key> List;
45 typedef QValueList<int> TypeList; 45 typedef Q3ValueList<int> TypeList;
46 46
47 /** 47 /**
48 * Key types 48 * Key types
49 * 49 *
50 * @li X509 - X509 key 50 * @li X509 - X509 key
51 * @li PGP - Pretty Good Privacy key 51 * @li PGP - Pretty Good Privacy key
52 * @li Custom - Custom or IANA conform key 52 * @li Custom - Custom or IANA conform key
53 */ 53 */
54 enum Types { 54 enum Types {
55 X509, 55 X509,
56 PGP, 56 PGP,
57 Custom 57 Custom
diff --git a/kabc/phonenumber.h b/kabc/phonenumber.h
index feeba6c..6bc89d3 100644
--- a/kabc/phonenumber.h
+++ b/kabc/phonenumber.h
@@ -19,44 +19,44 @@
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#ifndef KABC_PHONENUMBER_H 28#ifndef KABC_PHONENUMBER_H
29#define KABC_PHONENUMBER_H 29#define KABC_PHONENUMBER_H
30 30
31#include <qvaluelist.h> 31#include <q3valuelist.h>
32#include <qstring.h> 32#include <qstring.h>
33 33
34namespace KABC { 34namespace KABC {
35 35
36/** 36/**
37 @short Phonenumber information. 37 @short Phonenumber information.
38 38
39 This class provides phone number information. A phone number is classified by 39 This class provides phone number information. A phone number is classified by
40 a type. The following types are available, it's possible to use multiple types 40 a type. The following types are available, it's possible to use multiple types
41 @ref Types for a number by combining them through a logical or. 41 @ref Types for a number by combining them through a logical or.
42*/ 42*/
43class PhoneNumber 43class PhoneNumber
44{ 44{
45 friend QDataStream &operator<<( QDataStream &, const PhoneNumber & ); 45 friend QDataStream &operator<<( QDataStream &, const PhoneNumber & );
46 friend QDataStream &operator>>( QDataStream &, PhoneNumber & ); 46 friend QDataStream &operator>>( QDataStream &, PhoneNumber & );
47 47
48 public: 48 public:
49 typedef QValueList<PhoneNumber> List; 49 typedef Q3ValueList<PhoneNumber> List;
50 typedef QValueList<int> TypeList; 50 typedef Q3ValueList<int> TypeList;
51 51
52 /** 52 /**
53 @li @p Home - Home number 53 @li @p Home - Home number
54 @li @p Work - Office number 54 @li @p Work - Office number
55 @li @p Msg - Messaging 55 @li @p Msg - Messaging
56 @li @p Pref - Preferred number 56 @li @p Pref - Preferred number
57 @li @p Voice - Voice 57 @li @p Voice - Voice
58 @li @p Fax - Fax machine 58 @li @p Fax - Fax machine
59 @li @p Cell - Cell phone 59 @li @p Cell - Cell phone
60 @li @p Video - Video phone 60 @li @p Video - Video phone
61 @li @p Bbs - Mailbox 61 @li @p Bbs - Mailbox
62 @li @p Modem - Modem 62 @li @p Modem - Modem
diff --git a/kabc/picture.cpp b/kabc/picture.cpp
index 57aa297..0c59937 100644
--- a/kabc/picture.cpp
+++ b/kabc/picture.cpp
@@ -17,24 +17,26 @@
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include "picture.h" 28#include "picture.h"
29//Added by qt3to4:
30#include <QPixmap>
29 31
30using namespace KABC; 32using namespace KABC;
31 33
32Picture::Picture() 34Picture::Picture()
33 : mIntern( false ) 35 : mIntern( false )
34{ 36{
35 mUndefined = true; 37 mUndefined = true;
36} 38}
37 39
38Picture::Picture( const QString &url ) 40Picture::Picture( const QString &url )
39 : mUrl( url ), mIntern( false ) 41 : mUrl( url ), mIntern( false )
40{ 42{
diff --git a/kabc/picture.h b/kabc/picture.h
index 714d1e2..1b63610 100644
--- a/kabc/picture.h
+++ b/kabc/picture.h
@@ -20,24 +20,26 @@
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#ifndef KABC_PICTURE_H 28#ifndef KABC_PICTURE_H
29#define KABC_PICTURE_H 29#define KABC_PICTURE_H
30 30
31#include <qimage.h> 31#include <qimage.h>
32//Added by qt3to4:
33#include <QPixmap>
32 34
33namespace KABC { 35namespace KABC {
34 36
35class Picture 37class Picture
36{ 38{
37 friend QDataStream &operator<<( QDataStream &, const Picture & ); 39 friend QDataStream &operator<<( QDataStream &, const Picture & );
38 friend QDataStream &operator>>( QDataStream &, Picture & ); 40 friend QDataStream &operator>>( QDataStream &, Picture & );
39 41
40public: 42public:
41 43
42 /** 44 /**
43 * Consturctor. Creates an empty object. 45 * Consturctor. Creates an empty object.
diff --git a/kabc/plugins/dir/dir.pro b/kabc/plugins/dir/dir.pro
index 3e18594..9b3b894 100644
--- a/kabc/plugins/dir/dir.pro
+++ b/kabc/plugins/dir/dir.pro
@@ -1,36 +1,40 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3#release debug 3#release debug
4 4
5include( ../../../variables.pri ) 5include( ../../../variables.pri )
6 6
7TARGET = microkabc_dir 7TARGET = xmicrokabc_dir
8INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat 8INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat
9DESTDIR = ../../../bin 9DESTDIR = ../../../bin
10#LIBS += -lmicrokde -lmicrokabc 10#LIBS += -lxmicrokde -lxmicrokabc
11#LIBS += -L$(QPEDIR)/lib 11#LIBS += -L$(QPEDIR)/lib
12 12
13INTERFACES = \ 13INTERFACES = \
14 14
15HEADERS = \ 15HEADERS = \
16 resourcedir.h \ 16 resourcedir.h \
17 resourcedirconfig.h 17 resourcedirconfig.h
18 18
19SOURCES = \ 19SOURCES = \
20 resourcedir.cpp \ 20 resourcedir.cpp \
21 resourcedirconfig.cpp 21 resourcedirconfig.cpp
22 22
23unix : { 23unix : {
24OBJECTS_DIR = obj/unix 24OBJECTS_DIR = obj/unix
25MOC_DIR = moc/unix 25MOC_DIR = moc/unix
26} 26}
27win32: { 27win32: {
28CONFIG += dll 28CONFIG += dll
29DEFINES += _WIN32_ 29DEFINES += _WIN32_
30OBJECTS_DIR = obj/win 30OBJECTS_DIR = obj/win
31MOC_DIR = moc/win 31MOC_DIR = moc/win
32LIBS += ../../../bin/microkdepim.lib 32LIBS += ../../../bin/xmicrokdepim.lib
33LIBS += ../../../bin/microkcal.lib 33LIBS += ../../../bin/xmicrokcal.lib
34LIBS += ../../../bin/microkde.lib 34LIBS += ../../../bin/xmicrokde.lib
35LIBS += ../../../bin/microkabc.lib 35LIBS += ../../../bin/microkabc.lib
36} 36}
37#The following line was inserted by qt3to4
38QT += qt3support
39#The following line was inserted by qt3to4
40QT += xml
diff --git a/kabc/plugins/dir/dirE.pro b/kabc/plugins/dir/dirE.pro
index cda4e2f..75332a0 100644
--- a/kabc/plugins/dir/dirE.pro
+++ b/kabc/plugins/dir/dirE.pro
@@ -1,21 +1,21 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3#release debug 3#release debug
4 4
5TARGET = microkabc_dir 5TARGET = xmicrokabc_dir
6INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat 6INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat
7OBJECTS_DIR = obj/$(PLATFORM) 7OBJECTS_DIR = obj/$(PLATFORM)
8MOC_DIR = moc/$(PLATFORM) 8MOC_DIR = moc/$(PLATFORM)
9DESTDIR = $(QPEDIR)/lib 9DESTDIR = $(QPEDIR)/lib
10LIBS += -lmicrokde -lmicrokabc 10LIBS += -lxmicrokde -lxmicrokabc
11LIBS += -L$(QPEDIR)/lib 11LIBS += -L$(QPEDIR)/lib
12 12
13INTERFACES = \ 13INTERFACES = \
14 14
15HEADERS = \ 15HEADERS = \
16 resourcedir.h \ 16 resourcedir.h \
17 resourcedirconfig.h 17 resourcedirconfig.h
18 18
19SOURCES = \ 19SOURCES = \
20 resourcedir.cpp \ 20 resourcedir.cpp \
21 resourcedirconfig.cpp 21 resourcedirconfig.cpp
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp
index c61664b..cc4afee 100644
--- a/kabc/plugins/dir/resourcedir.cpp
+++ b/kabc/plugins/dir/resourcedir.cpp
@@ -161,25 +161,25 @@ Ticket *ResourceDir::requestSaveTicket()
161 161
162bool ResourceDir::doOpen() 162bool ResourceDir::doOpen()
163{ 163{
164 QDir dir( mPath ); 164 QDir dir( mPath );
165 if ( !dir.exists() ) { // no directory available 165 if ( !dir.exists() ) { // no directory available
166 return dir.mkdir( dir.path() ); 166 return dir.mkdir( dir.path() );
167 } else { 167 } else {
168 QString testName = dir.entryList( QDir::Files )[0]; 168 QString testName = dir.entryList( QDir::Files )[0];
169 if ( testName.isNull() || testName.isEmpty() ) // no file in directory 169 if ( testName.isNull() || testName.isEmpty() ) // no file in directory
170 return true; 170 return true;
171 171
172 QFile file( mPath + "/" + testName ); 172 QFile file( mPath + "/" + testName );
173 if ( file.open( IO_ReadOnly ) ) 173 if ( file.open( QIODevice::ReadOnly ) )
174 return true; 174 return true;
175 175
176 if ( file.size() == 0 ) 176 if ( file.size() == 0 )
177 return true; 177 return true;
178 178
179 bool ok = mFormat->checkFormat( &file ); 179 bool ok = mFormat->checkFormat( &file );
180 file.close(); 180 file.close();
181 return ok; 181 return ok;
182 } 182 }
183} 183}
184 184
185void ResourceDir::doClose() 185void ResourceDir::doClose()
@@ -187,25 +187,25 @@ void ResourceDir::doClose()
187} 187}
188 188
189bool ResourceDir::load() 189bool ResourceDir::load()
190{ 190{
191 QDir dir( mPath ); 191 QDir dir( mPath );
192 QStringList files = dir.entryList( QDir::Files ); 192 QStringList files = dir.entryList( QDir::Files );
193 193
194 QStringList::Iterator it; 194 QStringList::Iterator it;
195 bool ok = true; 195 bool ok = true;
196 for ( it = files.begin(); it != files.end(); ++it ) { 196 for ( it = files.begin(); it != files.end(); ++it ) {
197 QFile file( mPath + "/" + (*it) ); 197 QFile file( mPath + "/" + (*it) );
198 198
199 if ( !file.open( IO_ReadOnly ) ) { 199 if ( !file.open( QIODevice::ReadOnly ) ) {
200 addressBook()->error( i18n( "Unable to open file '%1' for reading" ).arg( file.name() ) ); 200 addressBook()->error( i18n( "Unable to open file '%1' for reading" ).arg( file.name() ) );
201 ok = false; 201 ok = false;
202 continue; 202 continue;
203 } 203 }
204 204
205 if ( !mFormat->loadAll( addressBook(), this, &file ) ) 205 if ( !mFormat->loadAll( addressBook(), this, &file ) )
206 ok = false; 206 ok = false;
207 207
208 file.close(); 208 file.close();
209 } 209 }
210 210
211 return ok; 211 return ok;
@@ -214,25 +214,25 @@ bool ResourceDir::load()
214bool ResourceDir::save( Ticket *ticket ) 214bool ResourceDir::save( Ticket *ticket )
215{ 215{
216 AddressBook::Iterator it; 216 AddressBook::Iterator it;
217 bool ok = true; 217 bool ok = true;
218#ifndef NO_DIRWATCH 218#ifndef NO_DIRWATCH
219 mDirWatch.stopScan(); 219 mDirWatch.stopScan();
220#endif 220#endif
221 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { 221 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) {
222 if ( (*it).resource() != this || !(*it).changed() ) 222 if ( (*it).resource() != this || !(*it).changed() )
223 continue; 223 continue;
224 224
225 QFile file( mPath + "/" + (*it).uid() ); 225 QFile file( mPath + "/" + (*it).uid() );
226 if ( !file.open( IO_WriteOnly ) ) { 226 if ( !file.open( QIODevice::WriteOnly ) ) {
227 addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) ); 227 addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) );
228 continue; 228 continue;
229 } 229 }
230 230
231 mFormat->save( *it, &file ); 231 mFormat->save( *it, &file );
232 232
233 // mark as unchanged 233 // mark as unchanged
234 (*it).setChanged( false ); 234 (*it).setChanged( false );
235 235
236 file.close(); 236 file.close();
237 } 237 }
238#ifndef NO_DIRWATCH 238#ifndef NO_DIRWATCH
@@ -258,25 +258,25 @@ bool ResourceDir::lock( const QString &path )
258 258
259 if ( QFile::exists( lockName ) ) return false; 259 if ( QFile::exists( lockName ) ) return false;
260 260
261 QString lockUniqueName; 261 QString lockUniqueName;
262 lockUniqueName = p + KApplication::randomString( 8 ); 262 lockUniqueName = p + KApplication::randomString( 8 );
263 263
264 url = lockUniqueName; 264 url = lockUniqueName;
265//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); 265//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName );
266 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() ); 266 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() );
267 267
268 // Create unique file 268 // Create unique file
269 QFile file( mLockUniqueName ); 269 QFile file( mLockUniqueName );
270 file.open( IO_WriteOnly ); 270 file.open( QIODevice::WriteOnly );
271 file.close(); 271 file.close();
272 272
273 // Create lock file 273 // Create lock file
274 int result = 0; 274 int result = 0;
275#ifndef _WIN32_ 275#ifndef _WIN32_
276 result = ::link( QFile::encodeName( mLockUniqueName ), 276 result = ::link( QFile::encodeName( mLockUniqueName ),
277 QFile::encodeName( lockName ) ); 277 QFile::encodeName( lockName ) );
278#endif 278#endif
279 if ( result == 0 ) { 279 if ( result == 0 ) {
280 addressBook()->emitAddressBookLocked(); 280 addressBook()->emitAddressBookLocked();
281 return true; 281 return true;
282 } 282 }
diff --git a/kabc/plugins/dir/resourcedirconfig.cpp b/kabc/plugins/dir/resourcedirconfig.cpp
index 98d18fe..8fa48d0 100644
--- a/kabc/plugins/dir/resourcedirconfig.cpp
+++ b/kabc/plugins/dir/resourcedirconfig.cpp
@@ -18,42 +18,44 @@
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qlayout.h> 29#include <qlayout.h>
30//Added by qt3to4:
31#include <Q3GridLayout>
30 32
31#include <kdebug.h> 33#include <kdebug.h>
32#include <klocale.h> 34#include <klocale.h>
33#include <kstandarddirs.h> 35#include <kstandarddirs.h>
34#include <kdialog.h> 36#include <kdialog.h>
35 37
36//US #include "formatfactory.h" 38//US #include "formatfactory.h"
37#include "resourcedir.h" 39#include "resourcedir.h"
38#include "stdaddressbook.h" 40#include "stdaddressbook.h"
39 41
40#include "resourcedirconfig.h" 42#include "resourcedirconfig.h"
41 43
42using namespace KABC; 44using namespace KABC;
43 45
44ResourceDirConfig::ResourceDirConfig( QWidget* parent, const char* name ) 46ResourceDirConfig::ResourceDirConfig( QWidget* parent, const char* name )
45 : KRES::ConfigWidget( parent, name ) 47 : KRES::ConfigWidget( parent, name )
46{ 48{
47 QGridLayout *mainLayout = new QGridLayout( this, 2, 2, 0, 49 Q3GridLayout *mainLayout = new Q3GridLayout( this, 2, 2, 0,
48 KDialog::spacingHint() ); 50 KDialog::spacingHint() );
49 51
50 QLabel *label = new QLabel( i18n( "Format:" ), this ); 52 QLabel *label = new QLabel( i18n( "Format:" ), this );
51 mFormatBox = new KComboBox( this ); 53 mFormatBox = new KComboBox( this );
52 54
53 mainLayout->addWidget( label, 0, 0 ); 55 mainLayout->addWidget( label, 0, 0 );
54 mainLayout->addWidget( mFormatBox, 0, 1 ); 56 mainLayout->addWidget( mFormatBox, 0, 1 );
55 57
56 label = new QLabel( i18n( "Location:" ), this ); 58 label = new QLabel( i18n( "Location:" ), this );
57 mFileNameEdit = new KURLRequester( this ); 59 mFileNameEdit = new KURLRequester( this );
58//US mFileNameEdit->setMode( KFile::Directory ); 60//US mFileNameEdit->setMode( KFile::Directory );
59 61
diff --git a/kabc/plugins/file/file.pro b/kabc/plugins/file/file.pro
index 2d17313..e4f1270 100644
--- a/kabc/plugins/file/file.pro
+++ b/kabc/plugins/file/file.pro
@@ -1,37 +1,41 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3#release debug 3#release debug
4 4
5include( ../../../variables.pri ) 5include( ../../../variables.pri )
6 6
7TARGET = microkabc_file 7TARGET = xmicrokabc_file
8INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat 8INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat
9 9
10DESTDIR = ../../../bin 10DESTDIR = ../../../bin
11#LIBS += -lmicrokde -lmicrokabc 11#LIBS += -lxmicrokde -lxmicrokabc
12#LIBS += -L$(QPEDIR)/lib 12#LIBS += -L$(QPEDIR)/lib
13 13
14INTERFACES = \ 14INTERFACES = \
15 15
16HEADERS = \ 16HEADERS = \
17 resourcefile.h \ 17 resourcefile.h \
18 resourcefileconfig.h 18 resourcefileconfig.h
19 19
20SOURCES = \ 20SOURCES = \
21 resourcefile.cpp \ 21 resourcefile.cpp \
22 resourcefileconfig.cpp 22 resourcefileconfig.cpp
23 23
24unix : { 24unix : {
25OBJECTS_DIR = obj/unix 25OBJECTS_DIR = obj/unix
26MOC_DIR = moc/unix 26MOC_DIR = moc/unix
27} 27}
28win32: { 28win32: {
29CONFIG += dll 29CONFIG += dll
30DEFINES += _WIN32_ 30DEFINES += _WIN32_
31OBJECTS_DIR = obj/win 31OBJECTS_DIR = obj/win
32MOC_DIR = moc/win 32MOC_DIR = moc/win
33LIBS += ../../../bin/microkdepim.lib 33LIBS += ../../../bin/xmicrokdepim.lib
34LIBS += ../../../bin/microkcal.lib 34LIBS += ../../../bin/xmicrokcal.lib
35LIBS += ../../../bin/microkde.lib 35LIBS += ../../../bin/xmicrokde.lib
36LIBS += ../../../bin/microkabc.lib 36LIBS += ../../../bin/microkabc.lib
37} 37}
38#The following line was inserted by qt3to4
39QT += qt3support
40#The following line was inserted by qt3to4
41QT += xml
diff --git a/kabc/plugins/file/fileE.pro b/kabc/plugins/file/fileE.pro
index 16707e5..5044cd9 100644
--- a/kabc/plugins/file/fileE.pro
+++ b/kabc/plugins/file/fileE.pro
@@ -1,21 +1,21 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3#release debug 3#release debug
4 4
5TARGET = microkabc_file 5TARGET = xmicrokabc_file
6INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat 6INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat
7OBJECTS_DIR = obj/$(PLATFORM) 7OBJECTS_DIR = obj/$(PLATFORM)
8MOC_DIR = moc/$(PLATFORM) 8MOC_DIR = moc/$(PLATFORM)
9DESTDIR = $(QPEDIR)/lib 9DESTDIR = $(QPEDIR)/lib
10LIBS += -lmicrokde -lmicrokabc 10LIBS += -lxmicrokde -lxmicrokabc
11LIBS += -L$(QPEDIR)/lib 11LIBS += -L$(QPEDIR)/lib
12 12
13INTERFACES = \ 13INTERFACES = \
14 14
15HEADERS = \ 15HEADERS = \
16 resourcefile.h \ 16 resourcefile.h \
17 resourcefileconfig.h 17 resourcefileconfig.h
18 18
19SOURCES = \ 19SOURCES = \
20 resourcefile.cpp \ 20 resourcefile.cpp \
21 resourcefileconfig.cpp 21 resourcefileconfig.cpp
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp
index dad4571..3ed850c 100644
--- a/kabc/plugins/file/resourcefile.cpp
+++ b/kabc/plugins/file/resourcefile.cpp
@@ -192,54 +192,54 @@ Ticket *ResourceFile::requestSaveTicket()
192#endif 192#endif
193 return createTicket( this ); 193 return createTicket( this );
194} 194}
195 195
196 196
197bool ResourceFile::doOpen() 197bool ResourceFile::doOpen()
198{ 198{
199 QFile file( fileName() ); 199 QFile file( fileName() );
200 qDebug("ResourceFile::openfile %s ", fileName().latin1()); 200 qDebug("ResourceFile::openfile %s ", fileName().latin1());
201 201
202 if ( !file.exists() ) { 202 if ( !file.exists() ) {
203 // try to create the file 203 // try to create the file
204 bool ok = file.open( IO_WriteOnly ); 204 bool ok = file.open( QIODevice::WriteOnly );
205 if ( ok ) 205 if ( ok )
206 file.close(); 206 file.close();
207 207
208 return ok; 208 return ok;
209 } else { 209 } else {
210 if ( !file.open( IO_ReadWrite ) ) 210 if ( !file.open( QIODevice::ReadWrite ) )
211 return false; 211 return false;
212 212
213 if ( file.size() < 10 ) { 213 if ( file.size() < 10 ) {
214 file.close(); 214 file.close();
215 return true; 215 return true;
216 } 216 }
217 217
218 bool ok = mFormat->checkFormat( &file ); 218 bool ok = mFormat->checkFormat( &file );
219 file.close(); 219 file.close();
220 220
221 return ok; 221 return ok;
222 } 222 }
223} 223}
224 224
225void ResourceFile::doClose() 225void ResourceFile::doClose()
226{ 226{
227} 227}
228 228
229bool ResourceFile::load() 229bool ResourceFile::load()
230{ 230{
231 231
232 QFile file( fileName() ); 232 QFile file( fileName() );
233 if ( !file.open( IO_ReadOnly ) ) { 233 if ( !file.open( QIODevice::ReadOnly ) ) {
234 addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) ); 234 addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) );
235 return false; 235 return false;
236 } 236 }
237 237
238// qDebug("ResourceFile::load format %s, %s", mFileName.latin1(), mFormatName.latin1()); 238// qDebug("ResourceFile::load format %s, %s", mFileName.latin1(), mFormatName.latin1());
239 239
240 return mFormat->loadAll( addressBook(), this, &file ); 240 return mFormat->loadAll( addressBook(), this, &file );
241} 241}
242 242
243bool ResourceFile::save( Ticket *ticket ) 243bool ResourceFile::save( Ticket *ticket )
244{ 244{
245// qDebug("ResourceFile::save format %s, %s", mFileName.latin1(), mFormatName.latin1()); 245// qDebug("ResourceFile::save format %s, %s", mFileName.latin1(), mFormatName.latin1());
@@ -302,25 +302,25 @@ bool ResourceFile::save( Ticket *ticket )
302 conf.writeEntry( "mBackupEnabled", false ); 302 conf.writeEntry( "mBackupEnabled", false );
303 } 303 }
304 if ( saveDate ) { 304 if ( saveDate ) {
305 KConfig config ( locateLocal("config","kabcrc") ); 305 KConfig config ( locateLocal("config","kabcrc") );
306 config.setGroup( "Resource_" + identifier() ); 306 config.setGroup( "Resource_" + identifier() );
307 config.writeEntry( "LastBackupDate", mLastBackupDate ); 307 config.writeEntry( "LastBackupDate", mLastBackupDate );
308 } 308 }
309 } 309 }
310 } 310 }
311 } 311 }
312 QFile info; 312 QFile info;
313 info.setName( fileName() ); 313 info.setName( fileName() );
314 bool ok = info.open( IO_WriteOnly ); 314 bool ok = info.open( QIODevice::WriteOnly );
315 if ( ok ) { 315 if ( ok ) {
316 mFormat->saveAll( addressBook(), this, &info ); 316 mFormat->saveAll( addressBook(), this, &info );
317 317
318 info.close(); 318 info.close();
319 ok = true; 319 ok = true;
320 } 320 }
321 else { 321 else {
322 322
323 } 323 }
324 324
325 if ( !ok ) 325 if ( !ok )
326 addressBook()->error( i18n( "Unable to save file '%1'." ).arg( fileName() ) ); 326 addressBook()->error( i18n( "Unable to save file '%1'." ).arg( fileName() ) );
@@ -354,25 +354,25 @@ bool ResourceFile::lock( const QString &fileName )
354 if (QFile::exists( lockName )) return false; 354 if (QFile::exists( lockName )) return false;
355 355
356 QString lockUniqueName; 356 QString lockUniqueName;
357 lockUniqueName = fn + KApplication::randomString( 8 ); 357 lockUniqueName = fn + KApplication::randomString( 8 );
358 358
359 url = lockUniqueName; 359 url = lockUniqueName;
360//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); 360//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName );
361 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() ); 361 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() );
362 kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl; 362 kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl;
363 363
364 // Create unique file 364 // Create unique file
365 QFile file( mLockUniqueName ); 365 QFile file( mLockUniqueName );
366 file.open( IO_WriteOnly ); 366 file.open( QIODevice::WriteOnly );
367 file.close(); 367 file.close();
368 368
369 // Create lock file 369 // Create lock file
370 int result = 0; 370 int result = 0;
371#ifndef _WIN32_ 371#ifndef _WIN32_
372 result = ::link( QFile::encodeName( mLockUniqueName ), 372 result = ::link( QFile::encodeName( mLockUniqueName ),
373 QFile::encodeName( lockName ) ); 373 QFile::encodeName( lockName ) );
374#endif 374#endif
375 if ( result == 0 ) { 375 if ( result == 0 ) {
376 addressBook()->emitAddressBookLocked(); 376 addressBook()->emitAddressBookLocked();
377 return true; 377 return true;
378 } 378 }
diff --git a/kabc/plugins/file/resourcefileconfig.cpp b/kabc/plugins/file/resourcefileconfig.cpp
index b63775d..70b0bac 100644
--- a/kabc/plugins/file/resourcefileconfig.cpp
+++ b/kabc/plugins/file/resourcefileconfig.cpp
@@ -19,47 +19,49 @@
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qfileinfo.h> 30#include <qfileinfo.h>
31//Added by qt3to4:
32#include <Q3GridLayout>
31 33
32#include <kdebug.h> 34#include <kdebug.h>
33#include <klocale.h> 35#include <klocale.h>
34#include <kstandarddirs.h> 36#include <kstandarddirs.h>
35#include <kdialog.h> 37#include <kdialog.h>
36#ifndef _WIN32_ 38#ifndef _WIN32_
37#include <unistd.h> 39#include <unistd.h>
38#endif 40#endif
39//US #include "formatfactory.h" 41//US #include "formatfactory.h"
40#include <qfile.h> 42#include <qfile.h>
41#include "resourcefile.h" 43#include "resourcefile.h"
42#include "stdaddressbook.h" 44#include "stdaddressbook.h"
43 45
44#include "resourcefileconfig.h" 46#include "resourcefileconfig.h"
45 47
46using namespace KABC; 48using namespace KABC;
47 49
48ResourceFileConfig::ResourceFileConfig( QWidget* parent, const char* name ) 50ResourceFileConfig::ResourceFileConfig( QWidget* parent, const char* name )
49 : ConfigWidget( parent, name ) 51 : ConfigWidget( parent, name )
50{ 52{
51//qDebug("ResourceFileConfig::ResourceFileConfig"); 53//qDebug("ResourceFileConfig::ResourceFileConfig");
52 54
53 QGridLayout *mainLayout = new QGridLayout( this, 2, 2, 0, 55 Q3GridLayout *mainLayout = new Q3GridLayout( this, 2, 2, 0,
54 KDialog::spacingHint() ); 56 KDialog::spacingHint() );
55 57
56 QLabel *label = new QLabel( i18n( "Format:" ), this ); 58 QLabel *label = new QLabel( i18n( "Format:" ), this );
57 mFormatBox = new KComboBox( this ); 59 mFormatBox = new KComboBox( this );
58 60
59 mainLayout->addWidget( label, 0, 0 ); 61 mainLayout->addWidget( label, 0, 0 );
60 mainLayout->addWidget( mFormatBox, 0, 1 ); 62 mainLayout->addWidget( mFormatBox, 0, 1 );
61 63
62 label = new QLabel( i18n( "Location:" ), this ); 64 label = new QLabel( i18n( "Location:" ), this );
63 mFileNameEdit = new KURLRequester( this ); 65 mFileNameEdit = new KURLRequester( this );
64 66
65 connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ), 67 connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ),
diff --git a/kabc/plugins/ldap/ldapE.pro b/kabc/plugins/ldap/ldapE.pro
index 57b6f84..c56d24d 100644
--- a/kabc/plugins/ldap/ldapE.pro
+++ b/kabc/plugins/ldap/ldapE.pro
@@ -1,21 +1,21 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3#release debug 3#release debug
4 4
5TARGET = microkabc_ldap 5TARGET = xmicrokabc_ldap
6INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include 6INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include
7OBJECTS_DIR = obj/$(PLATFORM) 7OBJECTS_DIR = obj/$(PLATFORM)
8MOC_DIR = moc/$(PLATFORM) 8MOC_DIR = moc/$(PLATFORM)
9DESTDIR = $(QPEDIR)/lib 9DESTDIR = $(QPEDIR)/lib
10LIBS += -lmicrokde -lmicrokabc 10LIBS += -lxmicrokde -lxmicrokabc
11LIBS += -L$(QPEDIR)/lib 11LIBS += -L$(QPEDIR)/lib
12 12
13INTERFACES = \ 13INTERFACES = \
14 14
15HEADERS = \ 15HEADERS = \
16 resourceldap.h \ 16 resourceldap.h \
17 resourceldapconfig.h 17 resourceldapconfig.h
18 18
19SOURCES = \ 19SOURCES = \
20 resourceldap.cpp \ 20 resourceldap.cpp \
21 resourceldapconfig.cpp 21 resourceldapconfig.cpp
diff --git a/kabc/plugins/olaccess/olaccess.pro b/kabc/plugins/olaccess/olaccess.pro
index 9b95015..ad7e1ef 100644
--- a/kabc/plugins/olaccess/olaccess.pro
+++ b/kabc/plugins/olaccess/olaccess.pro
@@ -1,15 +1,15 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3TARGET = microkabc_olaccess 3TARGET = xmicrokabc_olaccess
4 4
5include( ../../../variables.pri ) 5include( ../../../variables.pri )
6 6
7INCLUDEPATH += ../../.. ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat 7INCLUDEPATH += ../../.. ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat
8 8
9INTERFACES = \ 9INTERFACES = \
10 10
11DESTDIR = ../../../bin 11DESTDIR = ../../../bin
12HEADERS = \ 12HEADERS = \
13 resourceolaccess.h \ 13 resourceolaccess.h \
14 resourceolaccessconfig.h \ 14 resourceolaccessconfig.h \
15 olaccessconverter.h 15 olaccessconverter.h
@@ -19,17 +19,17 @@ SOURCES = \
19 resourceolaccessconfig.cpp \ 19 resourceolaccessconfig.cpp \
20 olaccessconverter.cpp 20 olaccessconverter.cpp
21 21
22unix : { 22unix : {
23OBJECTS_DIR = obj/unix 23OBJECTS_DIR = obj/unix
24MOC_DIR = moc/unix 24MOC_DIR = moc/unix
25} 25}
26win32: { 26win32: {
27CONFIG += dll 27CONFIG += dll
28DEFINES += _WIN32_ 28DEFINES += _WIN32_
29OBJECTS_DIR = obj/win 29OBJECTS_DIR = obj/win
30MOC_DIR = moc/win 30MOC_DIR = moc/win
31LIBS += ../../../bin/microkdepim.lib 31LIBS += ../../../bin/xmicrokdepim.lib
32LIBS += ../../../bin/microkcal.lib 32LIBS += ../../../bin/xmicrokcal.lib
33LIBS += ../../../bin/microkde.lib 33LIBS += ../../../bin/xmicrokde.lib
34LIBS += ../../../bin/microkabc.lib 34LIBS += ../../../bin/microkabc.lib
35} 35}
diff --git a/kabc/plugins/opie/opieE.pro b/kabc/plugins/opie/opieE.pro
index b7ecbc0..aa6b8ea 100644
--- a/kabc/plugins/opie/opieE.pro
+++ b/kabc/plugins/opie/opieE.pro
@@ -1,25 +1,25 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3#release debug 3#release debug
4TARGET = microkabc_opie 4TARGET = xmicrokabc_opie
5 5
6INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include $(OPIEDIR)/include 6INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include $(OPIEDIR)/include
7 7
8 8
9OBJECTS_DIR = obj/$(PLATFORM) 9OBJECTS_DIR = obj/$(PLATFORM)
10MOC_DIR = moc/$(PLATFORM) 10MOC_DIR = moc/$(PLATFORM)
11DESTDIR = $(QPEDIR)/lib 11DESTDIR = $(QPEDIR)/lib
12LIBS += -lmicrokde 12LIBS += -lxmicrokde
13LIBS += -lmicrokabc 13LIBS += -lxmicrokabc
14LIBS += -L$(QPEDIR)/lib 14LIBS += -L$(QPEDIR)/lib
15LIBS += -L$(OPIEDIR)/lib 15LIBS += -L$(OPIEDIR)/lib
16LIBS += -lopie 16LIBS += -lopie
17LIBS += -lqpe 17LIBS += -lqpe
18LIBS += -lqte 18LIBS += -lqte
19 19
20INTERFACES = \ 20INTERFACES = \
21 21
22HEADERS = \ 22HEADERS = \
23 resourceopie.h \ 23 resourceopie.h \
24 resourceopieconfig.h \ 24 resourceopieconfig.h \
25 opieconverter.h \ 25 opieconverter.h \
diff --git a/kabc/plugins/qtopia/qtopia.pro b/kabc/plugins/qtopia/qtopia.pro
index 64d1abc..d91a2e3 100644
--- a/kabc/plugins/qtopia/qtopia.pro
+++ b/kabc/plugins/qtopia/qtopia.pro
@@ -1,24 +1,24 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3 3
4include( ../../../variables.pri ) 4include( ../../../variables.pri )
5 5
6TARGET = microkabc_qtopia 6TARGET = xmicrokabc_qtopia
7 7
8INCLUDEPATH += ../.. ../../.. ../../../kabc ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources 8INCLUDEPATH += ../.. ../../.. ../../../kabc ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources
9 9
10DESTDIR = ../../../bin 10DESTDIR = ../../../bin
11#LIBS += -lmicrokde 11#LIBS += -lxmicrokde
12#LIBS += -lkamicrokabc 12#LIBS += -lxkamicrokabc
13 13
14DEFINES += KAB_EMBEDDED DESKTOP_VERSION 14DEFINES += KAB_EMBEDDED DESKTOP_VERSION
15 15
16INTERFACES = \ 16INTERFACES = \
17 17
18HEADERS = \ 18HEADERS = \
19 resourceqtopia.h \ 19 resourceqtopia.h \
20 resourceqtopiaconfig.h \ 20 resourceqtopiaconfig.h \
21 qtopiaconverter.h 21 qtopiaconverter.h
22 22
23SOURCES = \ 23SOURCES = \
24 resourceqtopia.cpp \ 24 resourceqtopia.cpp \
@@ -27,17 +27,21 @@ SOURCES = \
27 27
28 28
29 29
30unix : { 30unix : {
31OBJECTS_DIR = obj/unix 31OBJECTS_DIR = obj/unix
32MOC_DIR = moc/unix 32MOC_DIR = moc/unix
33} 33}
34win32: { 34win32: {
35CONFIG += dll 35CONFIG += dll
36DEFINES += _WIN32_ 36DEFINES += _WIN32_
37OBJECTS_DIR = obj/win 37OBJECTS_DIR = obj/win
38MOC_DIR = moc/win 38MOC_DIR = moc/win
39LIBS += ../../../bin/microkdepim.lib 39LIBS += ../../../bin/xmicrokdepim.lib
40LIBS += ../../../bin/microkcal.lib 40LIBS += ../../../bin/xmicrokcal.lib
41LIBS += ../../../bin/microkde.lib 41LIBS += ../../../bin/xmicrokde.lib
42LIBS += ../../../bin/microkabc.lib 42LIBS += ../../../bin/microkabc.lib
43} 43}
44#The following line was inserted by qt3to4
45QT += xml qt3support
46#The following line was inserted by qt3to4
47QT +=
diff --git a/kabc/plugins/qtopia/qtopiaE.pro b/kabc/plugins/qtopia/qtopiaE.pro
index 700057b..4b174b2 100644
--- a/kabc/plugins/qtopia/qtopiaE.pro
+++ b/kabc/plugins/qtopia/qtopiaE.pro
@@ -1,24 +1,24 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3 3
4TARGET = microkabc_qtopia 4TARGET = xmicrokabc_qtopia
5 5
6INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include 6INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include
7 7
8OBJECTS_DIR = obj/$(PLATFORM) 8OBJECTS_DIR = obj/$(PLATFORM)
9MOC_DIR = moc/$(PLATFORM) 9MOC_DIR = moc/$(PLATFORM)
10DESTDIR = $(QPEDIR)/lib 10DESTDIR = $(QPEDIR)/lib
11LIBS += -lmicrokde 11LIBS += -lxmicrokde
12LIBS += -lmicrokabc 12LIBS += -lxmicrokabc
13LIBS += -L$(QPEDIR)/lib 13LIBS += -L$(QPEDIR)/lib
14LIBS += -lqpe 14LIBS += -lqpe
15 15
16INTERFACES = \ 16INTERFACES = \
17 17
18HEADERS = \ 18HEADERS = \
19 resourceqtopia.h \ 19 resourceqtopia.h \
20 resourceqtopiaconfig.h \ 20 resourceqtopiaconfig.h \
21 qtopiaconverter.h 21 qtopiaconverter.h
22 22
23SOURCES = \ 23SOURCES = \
24 resourceqtopia.cpp \ 24 resourceqtopia.cpp \
diff --git a/kabc/plugins/qtopia/qtopiaconverter.cpp b/kabc/plugins/qtopia/qtopiaconverter.cpp
index 9693a68..9b3903b 100644
--- a/kabc/plugins/qtopia/qtopiaconverter.cpp
+++ b/kabc/plugins/qtopia/qtopiaconverter.cpp
@@ -25,25 +25,27 @@ Copyright (c) 2004 Ulf Schenk
25$Id$ 25$Id$
26*/ 26*/
27 27
28//US 28//US
29#include "kglobal.h" 29#include "kglobal.h"
30#include "klocale.h" 30#include "klocale.h"
31 31
32 32
33#include "qtopiaconverter.h" 33#include "qtopiaconverter.h"
34 34
35#include <qfile.h> 35#include <qfile.h>
36#include <qdir.h> 36#include <qdir.h>
37#include <qtextstream.h> 37#include <q3textstream.h>
38//Added by qt3to4:
39#include <Q3ValueList>
38//#include <.h> 40//#include <.h>
39 41
40#include <libkdepim/ksyncprofile.h> 42#include <libkdepim/ksyncprofile.h>
41 43
42 44
43using namespace KABC; 45using namespace KABC;
44 46
45QtopiaConverter::QtopiaConverter() 47QtopiaConverter::QtopiaConverter()
46{ 48{
47 m_edit = 0; 49 m_edit = 0;
48} 50}
49 51
@@ -62,26 +64,26 @@ bool QtopiaConverter::init()
62void QtopiaConverter::deinit() 64void QtopiaConverter::deinit()
63{ 65{
64 if (m_edit) 66 if (m_edit)
65 { 67 {
66 delete m_edit; 68 delete m_edit;
67 m_edit = 0; 69 m_edit = 0;
68 } 70 }
69} 71}
70QString QtopiaConverter::categoriesToNumber( const QStringList &list, const QString &app ) 72QString QtopiaConverter::categoriesToNumber( const QStringList &list, const QString &app )
71{ 73{
72 startover: 74 startover:
73 QStringList dummy; 75 QStringList dummy;
74 QValueList<OpieCategories>::ConstIterator catIt; 76 Q3ValueList<OpieCategories>::ConstIterator catIt;
75 QValueList<OpieCategories> categories = m_edit->categories(); 77 Q3ValueList<OpieCategories> categories = m_edit->categories();
76 bool found = false; 78 bool found = false;
77 for ( QStringList::ConstIterator listIt = list.begin(); listIt != list.end(); ++listIt ) { 79 for ( QStringList::ConstIterator listIt = list.begin(); listIt != list.end(); ++listIt ) {
78 /* skip empty category name */ 80 /* skip empty category name */
79 if ( (*listIt).isEmpty() ) continue; 81 if ( (*listIt).isEmpty() ) continue;
80 82
81 found = false; 83 found = false;
82 for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { 84 for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) {
83 /* 85 /*
84 * We currently do not take app into account 86 * We currently do not take app into account
85 * if name matches and the id isn't already in dummy we'll add it 87 * if name matches and the id isn't already in dummy we'll add it
86 */ 88 */
87 if ( (*catIt).name() == (*listIt) && !dummy.contains(( *catIt).id() ) ) { // the same name 89 if ( (*catIt).name() == (*listIt) && !dummy.contains(( *catIt).id() ) ) { // the same name
@@ -183,25 +185,25 @@ bool QtopiaConverter::qtopiaToAddressee( const QDomElement& el, Addressee &adr )
183{ 185{
184 { //LR 186 { //LR
185 187
186 adr.setUid( el.attribute("Uid" ) ); 188 adr.setUid( el.attribute("Uid" ) );
187 adr.setFamilyName( el.attribute( "LastName" ) ); 189 adr.setFamilyName( el.attribute( "LastName" ) );
188 adr.setGivenName( el.attribute( "FirstName" ) ); 190 adr.setGivenName( el.attribute( "FirstName" ) );
189 adr.setAdditionalName( el.attribute( "MiddleName" ) ); 191 adr.setAdditionalName( el.attribute( "MiddleName" ) );
190 adr.setSuffix( el.attribute( "Suffix" ) ); 192 adr.setSuffix( el.attribute( "Suffix" ) );
191 adr.setNickName( el.attribute( "Nickname" ) ); 193 adr.setNickName( el.attribute( "Nickname" ) );
192 194
193 QDate date = dateFromString( el.attribute( "Birthday" ) ); 195 QDate date = dateFromString( el.attribute( "Birthday" ) );
194 if ( date.isValid() ) 196 if ( date.isValid() )
195 adr.setBirthday( date ); 197 adr.setBirthday( (QDateTime)date );
196 198
197 adr.setRole( el.attribute( "JobTitle" ) ); 199 adr.setRole( el.attribute( "JobTitle" ) );
198 if ( !el.attribute( "FileAs" ).isEmpty() ) 200 if ( !el.attribute( "FileAs" ).isEmpty() )
199 adr.setFormattedName( el.attribute( "FileAs" ) ); 201 adr.setFormattedName( el.attribute( "FileAs" ) );
200 202
201 adr.setOrganization( el.attribute( "Company" ) ); 203 adr.setOrganization( el.attribute( "Company" ) );
202 204
203 KABC::PhoneNumber businessPhoneNum( el.attribute( "BusinessPhone" ), 205 KABC::PhoneNumber businessPhoneNum( el.attribute( "BusinessPhone" ),
204 KABC::PhoneNumber::Work | KABC::PhoneNumber::Pref ); 206 KABC::PhoneNumber::Work | KABC::PhoneNumber::Pref );
205 KABC::PhoneNumber businessFaxNum( el.attribute( "BusinessFax" ), 207 KABC::PhoneNumber businessFaxNum( el.attribute( "BusinessFax" ),
206 KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax ); 208 KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax );
207 KABC::PhoneNumber businessMobile( el.attribute( "BusinessMobile" ), 209 KABC::PhoneNumber businessMobile( el.attribute( "BusinessMobile" ),
@@ -308,25 +310,25 @@ bool QtopiaConverter::qtopiaToAddressee( const QDomElement& el, Addressee &adr )
308 if ( !el.attribute( "Profession" ).isEmpty() ) 310 if ( !el.attribute( "Profession" ).isEmpty() )
309 adr.insertCustom("KADDRESSBOOK", "X-Profession", el.attribute("Profession") ); 311 adr.insertCustom("KADDRESSBOOK", "X-Profession", el.attribute("Profession") );
310 if ( !el.attribute( "Assistant" ).isEmpty() ) 312 if ( !el.attribute( "Assistant" ).isEmpty() )
311 adr.insertCustom("KADDRESSBOOK", "X-AssistantsName", el.attribute("Assistant") ); 313 adr.insertCustom("KADDRESSBOOK", "X-AssistantsName", el.attribute("Assistant") );
312 if ( !el.attribute( "Manager" ).isEmpty() ) 314 if ( !el.attribute( "Manager" ).isEmpty() )
313 adr.insertCustom("KADDRESSBOOK", "X-ManagersName", el.attribute("Manager") ); 315 adr.insertCustom("KADDRESSBOOK", "X-ManagersName", el.attribute("Manager") );
314 316
315 317
316 } 318 }
317 return true; 319 return true;
318} 320}
319 321
320bool QtopiaConverter::addresseeToQtopia( const Addressee &ab, QTextStream *stream ) 322bool QtopiaConverter::addresseeToQtopia( const Addressee &ab, Q3TextStream *stream )
321{ 323{
322 *stream << "<Contact "; 324 *stream << "<Contact ";
323 *stream << "FirstName=\"" << escape(ab.givenName()) << "\" "; 325 *stream << "FirstName=\"" << escape(ab.givenName()) << "\" ";
324 *stream << "MiddleName=\"" << escape(ab.additionalName()) << "\" "; 326 *stream << "MiddleName=\"" << escape(ab.additionalName()) << "\" ";
325 *stream << "LastName=\"" << escape(ab.familyName()) << "\" "; 327 *stream << "LastName=\"" << escape(ab.familyName()) << "\" ";
326 *stream << "Suffix=\"" << escape(ab.suffix()) << "\" "; 328 *stream << "Suffix=\"" << escape(ab.suffix()) << "\" ";
327 329
328 QString sortStr; 330 QString sortStr;
329 sortStr = ab.formattedName(); 331 sortStr = ab.formattedName();
330 /* is formattedName is empty we use the assembled name as fallback */ 332 /* is formattedName is empty we use the assembled name as fallback */
331 if (sortStr.isEmpty() ) 333 if (sortStr.isEmpty() )
332 sortStr = ab.assembledName(); 334 sortStr = ab.assembledName();
@@ -475,31 +477,31 @@ QStringList AddressBook::attributes()const {
475 477
476 478
477CategoryEdit::CategoryEdit(){ 479CategoryEdit::CategoryEdit(){
478} 480}
479CategoryEdit::CategoryEdit(const QString &fileName){ 481CategoryEdit::CategoryEdit(const QString &fileName){
480 parse( fileName ); 482 parse( fileName );
481} 483}
482CategoryEdit::~CategoryEdit(){ 484CategoryEdit::~CategoryEdit(){
483} 485}
484void CategoryEdit::save(const QString& fileName)const{ 486void CategoryEdit::save(const QString& fileName)const{
485 QFile file( fileName ); 487 QFile file( fileName );
486 QString endl = "\n"; 488 QString endl = "\n";
487 if ( file.open( IO_WriteOnly ) ) { 489 if ( file.open( QIODevice::WriteOnly ) ) {
488 QTextStream stream( &file ); 490 Q3TextStream stream( &file );
489 stream.setEncoding( QTextStream::UnicodeUTF8 ); 491 stream.setEncoding( Q3TextStream::UnicodeUTF8 );
490 stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl; 492 stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
491 stream << "<!DOCTYPE CategoryList>" << endl; 493 stream << "<!DOCTYPE CategoryList>" << endl;
492 stream << "<Categories>" << endl; 494 stream << "<Categories>" << endl;
493 for ( QValueList<OpieCategories>::ConstIterator it = m_categories.begin(); 495 for ( Q3ValueList<OpieCategories>::ConstIterator it = m_categories.begin();
494 it != m_categories.end(); ++it ) 496 it != m_categories.end(); ++it )
495 { 497 {
496 stream << "<Category id=\""<< ( (*it).id() ) << "\" "; 498 stream << "<Category id=\""<< ( (*it).id() ) << "\" ";
497 499
498 if ( !(*it).app().isEmpty() ) 500 if ( !(*it).app().isEmpty() )
499 stream << " app=\""<< ( (*it).app() ) << "\" "; 501 stream << " app=\""<< ( (*it).app() ) << "\" ";
500 502
501 stream << "name=\"" << ( (*it).name() ) << "\" "; 503 stream << "name=\"" << ( (*it).name() ) << "\" ";
502 stream << " />" << endl; 504 stream << " />" << endl;
503 } 505 }
504 stream << "</Categories>" << endl; 506 stream << "</Categories>" << endl;
505 file.close(); 507 file.close();
@@ -528,25 +530,25 @@ int CategoryEdit::addCategory( const QString &appName, const QString &name, in
528} 530}
529/* 531/*
530 * we parse the simple Category File here 532 * we parse the simple Category File here
531 * We also keep track of global Cats 533 * We also keep track of global Cats
532 * and Of Organizer and Contact cats and then 534 * and Of Organizer and Contact cats and then
533 * we will add them to the kde side... 535 * we will add them to the kde side...
534 */ 536 */
535void CategoryEdit::parse( const QString &tempFile ){ 537void CategoryEdit::parse( const QString &tempFile ){
536 clear(); 538 clear();
537 539
538 QDomDocument doc( "mydocument" ); 540 QDomDocument doc( "mydocument" );
539 QFile f( tempFile ); 541 QFile f( tempFile );
540 if ( !f.open( IO_ReadOnly ) ) 542 if ( !f.open( QIODevice::ReadOnly ) )
541 return; 543 return;
542 544
543 if ( !doc.setContent( &f ) ) { 545 if ( !doc.setContent( &f ) ) {
544 f.close(); 546 f.close();
545 return; 547 return;
546 } 548 }
547 f.close(); 549 f.close();
548 550
549 QStringList global, contact, organizer; 551 QStringList global, contact, organizer;
550 552
551 // print out the element names of all elements that are a direct child 553 // print out the element names of all elements that are a direct child
552 // of the outermost element. 554 // of the outermost element.
@@ -578,25 +580,25 @@ void CategoryEdit::parse( const QString &tempFile ){
578 } 580 }
579 updateKDE( "kaddressbookrc", global + contact ); 581 updateKDE( "kaddressbookrc", global + contact );
580 updateKDE( "korganizerrc", global + organizer ); 582 updateKDE( "korganizerrc", global + organizer );
581 583
582} 584}
583void CategoryEdit::clear() 585void CategoryEdit::clear()
584{ 586{
585 ids.clear(); 587 ids.clear();
586 m_categories.clear(); 588 m_categories.clear();
587} 589}
588QString CategoryEdit::categoryById( const QString &id, const QString &app )const 590QString CategoryEdit::categoryById( const QString &id, const QString &app )const
589{ 591{
590 QValueList<OpieCategories>::ConstIterator it; 592 Q3ValueList<OpieCategories>::ConstIterator it;
591 QString category; 593 QString category;
592 QString fallback; 594 QString fallback;
593 for( it = m_categories.begin(); it != m_categories.end(); ++it ){ 595 for( it = m_categories.begin(); it != m_categories.end(); ++it ){
594 if( id.stripWhiteSpace() == (*it).id().stripWhiteSpace() ){ 596 if( id.stripWhiteSpace() == (*it).id().stripWhiteSpace() ){
595 if( app == (*it).app() ){ 597 if( app == (*it).app() ){
596 category = (*it).name(); 598 category = (*it).name();
597 break; 599 break;
598 }else{ 600 }else{
599 fallback = (*it).name(); 601 fallback = (*it).name();
600 } 602 }
601 } 603 }
602 } 604 }
diff --git a/kabc/plugins/qtopia/qtopiaconverter.h b/kabc/plugins/qtopia/qtopiaconverter.h
index 744dd41..389926c 100644
--- a/kabc/plugins/qtopia/qtopiaconverter.h
+++ b/kabc/plugins/qtopia/qtopiaconverter.h
@@ -19,24 +19,27 @@
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24$Id$ 24$Id$
25*/ 25*/
26 26
27#ifndef KABC_QTOPIACONVERTER_H 27#ifndef KABC_QTOPIACONVERTER_H
28#define KABC_QTOPIACONVERTER_H 28#define KABC_QTOPIACONVERTER_H
29 29
30#include <qstring.h> 30#include <qstring.h>
31//Added by qt3to4:
32#include <Q3ValueList>
33#include <Q3TextStream>
31 34
32#include "addressee.h" 35#include "addressee.h"
33#ifdef DESKTOP_VERSION 36#ifdef DESKTOP_VERSION
34#include <qdom.h> 37#include <qdom.h>
35#else 38#else
36#include <xml/qdom.h> 39#include <xml/qdom.h>
37#endif 40#endif
38class Categories; 41class Categories;
39 42
40namespace KABC { 43namespace KABC {
41 44
42 45
@@ -67,32 +70,32 @@ class OpieCategories {
67 CategoryEdit(const QString &fileName); 70 CategoryEdit(const QString &fileName);
68 ~CategoryEdit(); 71 ~CategoryEdit();
69 72
70 void save(const QString&) const; 73 void save(const QString&) const;
71 int addCategory( const QString &name, int id = 0 ); 74 int addCategory( const QString &name, int id = 0 );
72 int addCategory(const QString &appName, const QString &name, int id = 0); 75 int addCategory(const QString &appName, const QString &name, int id = 0);
73 void parse( const QString &fileName ); 76 void parse( const QString &fileName );
74 77
75 QString categoryById(const QString &id, const QString &app )const; 78 QString categoryById(const QString &id, const QString &app )const;
76 QStringList categoriesByIds( const QStringList& ids, const QString& app ); 79 QStringList categoriesByIds( const QStringList& ids, const QString& app );
77 80
78 void clear(); 81 void clear();
79 QValueList<OpieCategories> categories()const { return m_categories; }; 82 Q3ValueList<OpieCategories> categories()const { return m_categories; };
80 private: 83 private:
81 /** 84 /**
82 * this function will be used internally to update the kde categories... 85 * this function will be used internally to update the kde categories...
83 */ 86 */
84 void updateKDE( const QString& app, const QStringList& categories ); 87 void updateKDE( const QString& app, const QStringList& categories );
85 QMap<int, bool> ids; // from tt Qtopia::UidGen 88 QMap<int, bool> ids; // from tt Qtopia::UidGen
86 QValueList<OpieCategories> m_categories; 89 Q3ValueList<OpieCategories> m_categories;
87 }; 90 };
88 91
89 92
90class QtopiaConverter 93class QtopiaConverter
91{ 94{
92public: 95public:
93 96
94 /** 97 /**
95 * Constructor. 98 * Constructor.
96 */ 99 */
97 QtopiaConverter(); 100 QtopiaConverter();
98 101
@@ -108,25 +111,25 @@ public:
108 * Converts a vcard string to an addressee. 111 * Converts a vcard string to an addressee.
109 * 112 *
110 * @param contact The qtopia contact. 113 * @param contact The qtopia contact.
111 * @param addr The addressee. 114 * @param addr The addressee.
112 */ 115 */
113 bool qtopiaToAddressee( const QDomElement& el, Addressee &adr ); 116 bool qtopiaToAddressee( const QDomElement& el, Addressee &adr );
114 /** 117 /**
115 * Converts an addressee to a vcard string. 118 * Converts an addressee to a vcard string.
116 * 119 *
117 * @param addr The addressee. 120 * @param addr The addressee.
118 * @param contact The qtopia contact. 121 * @param contact The qtopia contact.
119 */ 122 */
120 bool addresseeToQtopia( const Addressee &ab, QTextStream *stream ); 123 bool addresseeToQtopia( const Addressee &ab, Q3TextStream *stream );
121 124
122 private: 125 private:
123 QString categoriesToNumber( const QStringList &list, const QString &app ); 126 QString categoriesToNumber( const QStringList &list, const QString &app );
124 QString escape( const QString& s){ return s;}; 127 QString escape( const QString& s){ return s;};
125 CategoryEdit *m_edit; 128 CategoryEdit *m_edit;
126 QDate fromString( const QString& ); 129 QDate fromString( const QString& );
127 QDate dateFromString( const QString& ); 130 QDate dateFromString( const QString& );
128 QString dateToString( const QDate& ); 131 QString dateToString( const QDate& );
129 132
130 133
131}; 134};
132} 135}
diff --git a/kabc/plugins/qtopia/resourceqtopia.cpp b/kabc/plugins/qtopia/resourceqtopia.cpp
index 79ddaea..a36eb8f 100644
--- a/kabc/plugins/qtopia/resourceqtopia.cpp
+++ b/kabc/plugins/qtopia/resourceqtopia.cpp
@@ -22,25 +22,25 @@
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27#include <sys/types.h> 27#include <sys/types.h>
28#include <sys/stat.h> 28#include <sys/stat.h>
29#ifndef _WIN32_ 29#ifndef _WIN32_
30#include <unistd.h> 30#include <unistd.h>
31#endif 31#endif
32#include <qdir.h> 32#include <qdir.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qtextstream.h> 34#include <q3textstream.h>
35#include <qfileinfo.h> 35#include <qfileinfo.h>
36#include <qregexp.h> 36#include <qregexp.h>
37//US #include <qtimer.h> 37//US #include <qtimer.h>
38 38
39#include <kapplication.h> 39#include <kapplication.h>
40#include <kconfig.h> 40#include <kconfig.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <klocale.h> 42#include <klocale.h>
43//US #include <ksavefile.h> 43//US #include <ksavefile.h>
44#include <kstandarddirs.h> 44#include <kstandarddirs.h>
45#include <kmessagebox.h> 45#include <kmessagebox.h>
46 46
@@ -147,25 +147,25 @@ void ResourceQtopia::doClose()
147 147
148 148
149 // it seems so, that deletion of access deletes backend as well 149 // it seems so, that deletion of access deletes backend as well
150 //delete backend; 150 //delete backend;
151 151
152 return; 152 return;
153} 153}
154 154
155bool ResourceQtopia::load() 155bool ResourceQtopia::load()
156{ 156{
157 157
158 QFile file( fileName() ); 158 QFile file( fileName() );
159 if ( !file.open(IO_ReadOnly ) ) { 159 if ( !file.open(QIODevice::ReadOnly ) ) {
160 return false; 160 return false;
161 } 161 }
162 162
163 QDomDocument doc("mydocument" ); 163 QDomDocument doc("mydocument" );
164 if ( !doc.setContent( &file ) ) { 164 if ( !doc.setContent( &file ) ) {
165 file.close(); 165 file.close();
166 return false; 166 return false;
167 } 167 }
168 bool res; 168 bool res;
169 QDomElement docElem = doc.documentElement( ); 169 QDomElement docElem = doc.documentElement( );
170 QDomNode n = docElem.firstChild(); 170 QDomNode n = docElem.firstChild();
171 while ( !n.isNull() ) { 171 while ( !n.isNull() ) {
@@ -194,30 +194,30 @@ bool ResourceQtopia::load()
194 } 194 }
195 return true; 195 return true;
196} 196}
197 197
198bool ResourceQtopia::save( Ticket *ticket ) 198bool ResourceQtopia::save( Ticket *ticket )
199{ 199{
200#ifdef _USE_DIRWATCH_ 200#ifdef _USE_DIRWATCH_
201 mDirWatch.stopScan(); 201 mDirWatch.stopScan();
202#endif 202#endif
203 KABC::AddressBook::Iterator it; 203 KABC::AddressBook::Iterator it;
204 bool res; 204 bool res;
205 QFile file( fileName() ); 205 QFile file( fileName() );
206 if (!file.open( IO_WriteOnly ) ) { 206 if (!file.open( QIODevice::WriteOnly ) ) {
207 return false; 207 return false;
208 } 208 }
209 QTextStream ts( &file ); 209 Q3TextStream ts( &file );
210 QTextStream *stream = &ts; 210 Q3TextStream *stream = &ts;
211 stream->setEncoding( QTextStream::UnicodeUTF8 ); 211 stream->setEncoding( Q3TextStream::UnicodeUTF8 );
212 *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE Addressbook ><AddressBook>" << endl; 212 *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE Addressbook ><AddressBook>" << endl;
213 *stream << " <Groups>" << endl; 213 *stream << " <Groups>" << endl;
214 *stream << " </Groups>" << endl; 214 *stream << " </Groups>" << endl;
215 *stream << " <Contacts> " << endl; 215 *stream << " <Contacts> " << endl;
216 // for all entries 216 // for all entries
217 KABC::Addressee ab; 217 KABC::Addressee ab;
218 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { 218 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) {
219 KABC::Addressee addressee = (*it); 219 KABC::Addressee addressee = (*it);
220 res = mConverter->addresseeToQtopia( addressee, stream ); 220 res = mConverter->addresseeToQtopia( addressee, stream );
221 if (!res == true) 221 if (!res == true)
222 { 222 {
223 qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1()); 223 qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1());
@@ -251,25 +251,25 @@ bool ResourceQtopia::lock( const QString &lockfileName )
251 } 251 }
252 252
253 QString lockUniqueName; 253 QString lockUniqueName;
254 lockUniqueName = fn + KApplication::randomString( 8 ); 254 lockUniqueName = fn + KApplication::randomString( 8 );
255 255
256 url = lockUniqueName; 256 url = lockUniqueName;
257//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); 257//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName );
258 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() ); 258 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() );
259 kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl; 259 kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl;
260 260
261 // Create unique file 261 // Create unique file
262 QFile file( mLockUniqueName ); 262 QFile file( mLockUniqueName );
263 file.open( IO_WriteOnly ); 263 file.open( QIODevice::WriteOnly );
264 file.close(); 264 file.close();
265 265
266 // Create lock file 266 // Create lock file
267 int result = 0; 267 int result = 0;
268#ifndef _WIN32_ 268#ifndef _WIN32_
269 result = ::link( QFile::encodeName( mLockUniqueName ), 269 result = ::link( QFile::encodeName( mLockUniqueName ),
270 QFile::encodeName( lockName ) ); 270 QFile::encodeName( lockName ) );
271#endif 271#endif
272 if ( result == 0 ) { 272 if ( result == 0 ) {
273 addressBook()->emitAddressBookLocked(); 273 addressBook()->emitAddressBookLocked();
274 return true; 274 return true;
275 } 275 }
diff --git a/kabc/plugins/qtopia/resourceqtopiaconfig.cpp b/kabc/plugins/qtopia/resourceqtopiaconfig.cpp
index d5d6141..42fd428 100644
--- a/kabc/plugins/qtopia/resourceqtopiaconfig.cpp
+++ b/kabc/plugins/qtopia/resourceqtopiaconfig.cpp
@@ -18,44 +18,46 @@
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qlayout.h> 29#include <qlayout.h>
30//Added by qt3to4:
31#include <Q3GridLayout>
30 32
31#include <kdebug.h> 33#include <kdebug.h>
32#include <klocale.h> 34#include <klocale.h>
33#include <kstandarddirs.h> 35#include <kstandarddirs.h>
34#include <kdialog.h> 36#include <kdialog.h>
35 37
36//#include <unistd.h> 38//#include <unistd.h>
37 39
38#include <qdir.h> 40#include <qdir.h>
39#include <qfile.h> 41#include <qfile.h>
40#include "resourceqtopia.h" 42#include "resourceqtopia.h"
41 43
42#include "resourceqtopiaconfig.h" 44#include "resourceqtopiaconfig.h"
43 45
44using namespace KABC; 46using namespace KABC;
45 47
46ResourceQtopiaConfig::ResourceQtopiaConfig( QWidget* parent, const char* name ) 48ResourceQtopiaConfig::ResourceQtopiaConfig( QWidget* parent, const char* name )
47 : ConfigWidget( parent, name ) 49 : ConfigWidget( parent, name )
48{ 50{
49 QGridLayout *mainLayout = new QGridLayout( this, 1, 2, 0, 51 Q3GridLayout *mainLayout = new Q3GridLayout( this, 1, 2, 0,
50 KDialog::spacingHint() ); 52 KDialog::spacingHint() );
51 53
52 QLabel *label = new QLabel( i18n( "Location:" ), this ); 54 QLabel *label = new QLabel( i18n( "Location:" ), this );
53 mFileNameEdit = new KURLRequester( this ); 55 mFileNameEdit = new KURLRequester( this );
54 56
55 connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ), 57 connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ),
56 SLOT( checkFilePermissions( const QString & ) ) ); 58 SLOT( checkFilePermissions( const QString & ) ) );
57 59
58 mainLayout->addWidget( label, 0, 0 ); 60 mainLayout->addWidget( label, 0, 0 );
59 mainLayout->addWidget( mFileNameEdit, 0, 1 ); 61 mainLayout->addWidget( mFileNameEdit, 0, 1 );
60 62
61} 63}
diff --git a/kabc/plugins/sharpdtm/sharpdtmE.pro b/kabc/plugins/sharpdtm/sharpdtmE.pro
index 23b0b76..7fc8ba8 100644
--- a/kabc/plugins/sharpdtm/sharpdtmE.pro
+++ b/kabc/plugins/sharpdtm/sharpdtmE.pro
@@ -1,25 +1,25 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3TARGET = microkabc_sharpdtm 3TARGET = xmicrokabc_sharpdtm
4 4
5INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/kabc $(SHARPDTMSDK)/include $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include 5INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/kabc $(SHARPDTMSDK)/include $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include
6 6
7 7
8OBJECTS_DIR = obj/$(PLATFORM) 8OBJECTS_DIR = obj/$(PLATFORM)
9MOC_DIR = moc/$(PLATFORM) 9MOC_DIR = moc/$(PLATFORM)
10DESTDIR = $(QPEDIR)/lib 10DESTDIR = $(QPEDIR)/lib
11LIBS += -lmicrokde 11LIBS += -lxmicrokde
12LIBS += -lmicrokabc 12LIBS += -lxmicrokabc
13LIBS += -lmicrokdepim 13LIBS += -lxmicrokdepim
14LIBS += -lmicroqtcompat 14LIBS += -lmicroqtcompat
15LIBS += -L$(QPEDIR)/lib 15LIBS += -L$(QPEDIR)/lib
16LIBS += -ljpeg 16LIBS += -ljpeg
17LIBS += -lqpe 17LIBS += -lqpe
18LIBS += -lqte 18LIBS += -lqte
19LIBS += -lzdtm 19LIBS += -lzdtm
20LIBS += -lsl 20LIBS += -lsl
21 21
22 22
23 23
24INTERFACES = \ 24INTERFACES = \
25 25
diff --git a/kabc/secrecy.h b/kabc/secrecy.h
index b2ff565..0fe956e 100644
--- a/kabc/secrecy.h
+++ b/kabc/secrecy.h
@@ -19,35 +19,35 @@
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#ifndef KABC_SECRECY_H 28#ifndef KABC_SECRECY_H
29#define KABC_SECRECY_H 29#define KABC_SECRECY_H
30 30
31#include <qvaluelist.h> 31#include <q3valuelist.h>
32 32
33namespace KABC { 33namespace KABC {
34 34
35class Secrecy 35class Secrecy
36{ 36{
37 friend QDataStream &operator<<( QDataStream &, const Secrecy & ); 37 friend QDataStream &operator<<( QDataStream &, const Secrecy & );
38 friend QDataStream &operator>>( QDataStream &, Secrecy & ); 38 friend QDataStream &operator>>( QDataStream &, Secrecy & );
39 39
40public: 40public:
41 typedef QValueList<int> TypeList; 41 typedef Q3ValueList<int> TypeList;
42 42
43 /** 43 /**
44 * Secrecy types 44 * Secrecy types
45 * 45 *
46 * @li Public - for public access 46 * @li Public - for public access
47 * @li Private - only private access 47 * @li Private - only private access
48 * @li Confidential - access for confidential persons 48 * @li Confidential - access for confidential persons
49 */ 49 */
50 enum Types { 50 enum Types {
51 Public, 51 Public,
52 Private, 52 Private,
53 Confidential, 53 Confidential,
diff --git a/kabc/sound.h b/kabc/sound.h
index 0ec5ec8..9777054 100644
--- a/kabc/sound.h
+++ b/kabc/sound.h
@@ -19,25 +19,25 @@
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#ifndef KABC_SOUND_H 28#ifndef KABC_SOUND_H
29#define KABC_SOUND_H 29#define KABC_SOUND_H
30 30
31#include <qcstring.h> 31#include <q3cstring.h>
32#include <qstring.h> 32#include <qstring.h>
33 33
34namespace KABC { 34namespace KABC {
35 35
36class Sound 36class Sound
37{ 37{
38 friend QDataStream &operator<<( QDataStream &, const Sound & ); 38 friend QDataStream &operator<<( QDataStream &, const Sound & );
39 friend QDataStream &operator>>( QDataStream &, Sound & ); 39 friend QDataStream &operator>>( QDataStream &, Sound & );
40 40
41public: 41public:
42 42
43 /** 43 /**
diff --git a/kabc/tmpaddressbook.cpp b/kabc/tmpaddressbook.cpp
index cfa57e3..5152e00 100644
--- a/kabc/tmpaddressbook.cpp
+++ b/kabc/tmpaddressbook.cpp
@@ -15,25 +15,25 @@
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27#include <qptrlist.h> 27#include <q3ptrlist.h>
28 28
29#include "tmpaddressbook.h" 29#include "tmpaddressbook.h"
30 30
31using namespace KABC; 31using namespace KABC;
32 32
33#include "resource.h" 33#include "resource.h"
34 34
35TmpAddressBook::TmpAddressBook() 35TmpAddressBook::TmpAddressBook()
36 : AddressBook(0, "tmpcontact") 36 : AddressBook(0, "tmpcontact")
37{ 37{
38} 38}
39 39
diff --git a/kabc/vcard/AdrParam.cpp b/kabc/vcard/AdrParam.cpp
index fa46499..33d358c 100644
--- a/kabc/vcard/AdrParam.cpp
+++ b/kabc/vcard/AdrParam.cpp
@@ -15,78 +15,80 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardRToken.h> 24#include <VCardRToken.h>
25#include <VCardAdrParam.h> 25#include <VCardAdrParam.h>
26#include <VCardParam.h> 26#include <VCardParam.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30AdrParam::AdrParam() 32AdrParam::AdrParam()
31 :Param() 33 :Param()
32{ 34{
33} 35}
34 36
35AdrParam::AdrParam(const AdrParam & x) 37AdrParam::AdrParam(const AdrParam & x)
36 :Param(x), 38 :Param(x),
37 adrTypeList_(x.adrTypeList_) 39 adrTypeList_(x.adrTypeList_)
38{ 40{
39} 41}
40 42
41AdrParam::AdrParam(const QCString & s) 43AdrParam::AdrParam(const Q3CString & s)
42 :Param(s) 44 :Param(s)
43{ 45{
44} 46}
45 47
46 AdrParam & 48 AdrParam &
47AdrParam::operator = (AdrParam & x) 49AdrParam::operator = (AdrParam & x)
48{ 50{
49 if (*this == x) return *this; 51 if (*this == x) return *this;
50 52
51 adrTypeList_= x.adrTypeList(); 53 adrTypeList_= x.adrTypeList();
52 textParam_ = x.textParam(); 54 textParam_ = x.textParam();
53 55
54 Param::operator = (x); 56 Param::operator = (x);
55 return *this; 57 return *this;
56} 58}
57 59
58 AdrParam & 60 AdrParam &
59AdrParam::operator = (const QCString & s) 61AdrParam::operator = (const Q3CString & s)
60{ 62{
61 Param::operator = (s); 63 Param::operator = (s);
62 64
63 adrTypeList_.clear(); 65 adrTypeList_.clear();
64 textParam_.truncate(0); 66 textParam_.truncate(0);
65 67
66 return *this; 68 return *this;
67} 69}
68 70
69 bool 71 bool
70AdrParam::operator == (AdrParam & x) 72AdrParam::operator == (AdrParam & x)
71{ 73{
72 parse(); 74 parse();
73 75
74 if (!x.textParam().isEmpty()) 76 if (!x.textParam().isEmpty())
75 return (x.textParam_ == textParam_); 77 return (x.textParam_ == textParam_);
76 78
77 if (x.adrTypeList().count() != adrTypeList_.count()) 79 if (x.adrTypeList().count() != adrTypeList_.count())
78 return false; 80 return false;
79 81
80 QStrListIterator it(x.adrTypeList_); 82 Q3StrListIterator it(x.adrTypeList_);
81 83
82 for (; it.current(); ++it) 84 for (; it.current(); ++it)
83 if (!adrTypeList_.find(it.current())) 85 if (!adrTypeList_.find(it.current()))
84 return false; 86 return false;
85 87
86 return true; 88 return true;
87} 89}
88 90
89AdrParam::~AdrParam() 91AdrParam::~AdrParam()
90{ 92{
91} 93}
92 94
@@ -105,22 +107,22 @@ AdrParam::_parse()
105 107
106 RTokenise(strRep_, ",", adrTypeList_); 108 RTokenise(strRep_, ",", adrTypeList_);
107} 109}
108 110
109 void 111 void
110AdrParam::_assemble() 112AdrParam::_assemble()
111{ 113{
112 if (!textParam_.isEmpty()) { 114 if (!textParam_.isEmpty()) {
113 strRep_ = textParam_; 115 strRep_ = textParam_;
114 return; 116 return;
115 } 117 }
116 118
117 QStrListIterator it(adrTypeList_); 119 Q3StrListIterator it(adrTypeList_);
118 120
119 for (; it.current(); ++it) { 121 for (; it.current(); ++it) {
120 122
121 strRep_ += it.current(); 123 strRep_ += it.current();
122 124
123 if (it.current() != adrTypeList_.last()) 125 if (it.current() != adrTypeList_.last())
124 strRep_ += ','; 126 strRep_ += ',';
125 } 127 }
126} 128}
diff --git a/kabc/vcard/AdrValue.cpp b/kabc/vcard/AdrValue.cpp
index 7ecef33..51ca12a 100644
--- a/kabc/vcard/AdrValue.cpp
+++ b/kabc/vcard/AdrValue.cpp
@@ -16,68 +16,71 @@
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardRToken.h> 24#include <VCardRToken.h>
25#include <VCardAdrValue.h> 25#include <VCardAdrValue.h>
26#include <VCardValue.h> 26#include <VCardValue.h>
27#include <VCardDefines.h> 27#include <VCardDefines.h>
28//Added by qt3to4:
29#include <Q3StrList>
30#include <Q3CString>
28 31
29using namespace VCARD; 32using namespace VCARD;
30 33
31AdrValue::AdrValue() 34AdrValue::AdrValue()
32 :Value() 35 :Value()
33{ 36{
34} 37}
35 38
36AdrValue::AdrValue(const AdrValue & x) 39AdrValue::AdrValue(const AdrValue & x)
37 :Value(x), 40 :Value(x),
38 poBox_ (x.poBox_), 41 poBox_ (x.poBox_),
39 extAddress_(x.extAddress_), 42 extAddress_(x.extAddress_),
40 street_ (x.street_), 43 street_ (x.street_),
41 locality_(x.locality_), 44 locality_(x.locality_),
42 region_ (x.region_), 45 region_ (x.region_),
43 postCode_(x.postCode_), 46 postCode_(x.postCode_),
44 countryName_(x.countryName_) 47 countryName_(x.countryName_)
45{ 48{
46} 49}
47 50
48AdrValue::AdrValue(const QCString & s) 51AdrValue::AdrValue(const Q3CString & s)
49 :Value(s) 52 :Value(s)
50{ 53{
51} 54}
52 55
53 AdrValue & 56 AdrValue &
54AdrValue::operator = (AdrValue & x) 57AdrValue::operator = (AdrValue & x)
55{ 58{
56 if (*this == x) return *this; 59 if (*this == x) return *this;
57 60
58 poBox_ = x.poBox_; 61 poBox_ = x.poBox_;
59 extAddress_= x.extAddress_; 62 extAddress_= x.extAddress_;
60 street_ = x.street_; 63 street_ = x.street_;
61 locality_= x.locality_; 64 locality_= x.locality_;
62 region_ = x.region_; 65 region_ = x.region_;
63 postCode_= x.postCode_; 66 postCode_= x.postCode_;
64 countryName_= x.countryName_; 67 countryName_= x.countryName_;
65 68
66 Value::operator = (x); 69 Value::operator = (x);
67 return *this; 70 return *this;
68} 71}
69 72
70 AdrValue & 73 AdrValue &
71AdrValue::operator = (const QCString & s) 74AdrValue::operator = (const Q3CString & s)
72{ 75{
73 Value::operator = (s); 76 Value::operator = (s);
74 return *this; 77 return *this;
75} 78}
76 79
77 bool 80 bool
78AdrValue::operator == (AdrValue & x) 81AdrValue::operator == (AdrValue & x)
79{ 82{
80 parse(); 83 parse();
81 x.parse(); 84 x.parse();
82 85
83 return ( 86 return (
@@ -96,25 +99,25 @@ AdrValue::~AdrValue()
96 99
97 AdrValue * 100 AdrValue *
98AdrValue::clone() 101AdrValue::clone()
99{ 102{
100 return new AdrValue( *this ); 103 return new AdrValue( *this );
101} 104}
102 105
103 void 106 void
104AdrValue::_parse() 107AdrValue::_parse()
105{ 108{
106 vDebug("AdrValue::_parse()"); 109 vDebug("AdrValue::_parse()");
107 110
108 QStrList l; 111 Q3StrList l;
109 RTokenise(strRep_, ";", l); 112 RTokenise(strRep_, ";", l);
110 113
111 for (unsigned int i = 0; i < l.count(); i++) { 114 for (unsigned int i = 0; i < l.count(); i++) {
112 115
113 switch (i) { 116 switch (i) {
114 117
115 case 0: poBox_ = l.at(0);break; 118 case 0: poBox_ = l.at(0);break;
116 case 1: extAddress_ = l.at(1);break; 119 case 1: extAddress_ = l.at(1);break;
117 case 2: street_ = l.at(2);break; 120 case 2: street_ = l.at(2);break;
118 case 3: locality_ = l.at(3);break; 121 case 3: locality_ = l.at(3);break;
119 case 4: region_ = l.at(4);break; 122 case 4: region_ = l.at(4);break;
120 case 5: postCode_ = l.at(5);break; 123 case 5: postCode_ = l.at(5);break;
diff --git a/kabc/vcard/AgentParam.cpp b/kabc/vcard/AgentParam.cpp
index 5625e00..aae35ac 100644
--- a/kabc/vcard/AgentParam.cpp
+++ b/kabc/vcard/AgentParam.cpp
@@ -15,58 +15,60 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardAgentParam.h> 24#include <VCardAgentParam.h>
25 25
26#include <VCardParam.h> 26#include <VCardParam.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30AgentParam::AgentParam() 32AgentParam::AgentParam()
31 :Param() 33 :Param()
32{ 34{
33} 35}
34 36
35AgentParam::AgentParam(const AgentParam & x) 37AgentParam::AgentParam(const AgentParam & x)
36 :Param(x), 38 :Param(x),
37 refer_(x.refer_), 39 refer_(x.refer_),
38 uri_(x.uri_) 40 uri_(x.uri_)
39{ 41{
40} 42}
41 43
42AgentParam::AgentParam(const QCString & s) 44AgentParam::AgentParam(const Q3CString & s)
43 :Param(s) 45 :Param(s)
44{ 46{
45} 47}
46 48
47 AgentParam & 49 AgentParam &
48AgentParam::operator = (AgentParam & x) 50AgentParam::operator = (AgentParam & x)
49{ 51{
50 if (*this == x) return *this; 52 if (*this == x) return *this;
51 53
52 refer_= x.refer_; 54 refer_= x.refer_;
53 uri_= x.uri_; 55 uri_= x.uri_;
54 56
55 Param::operator = (x); 57 Param::operator = (x);
56 return *this; 58 return *this;
57} 59}
58 60
59 AgentParam & 61 AgentParam &
60AgentParam::operator = (const QCString & s) 62AgentParam::operator = (const Q3CString & s)
61{ 63{
62 Param::operator = (s); 64 Param::operator = (s);
63 return *this; 65 return *this;
64} 66}
65 67
66 bool 68 bool
67AgentParam::operator == (AgentParam & x) 69AgentParam::operator == (AgentParam & x)
68{ 70{
69 parse(); 71 parse();
70 72
71 if (refer_) 73 if (refer_)
72 return (x.refer() && uri_ == x.uri_); 74 return (x.refer() && uri_ == x.uri_);
diff --git a/kabc/vcard/AgentValue.cpp b/kabc/vcard/AgentValue.cpp
index bccde80..14e73b1 100644
--- a/kabc/vcard/AgentValue.cpp
+++ b/kabc/vcard/AgentValue.cpp
@@ -15,53 +15,55 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardAgentValue.h> 24#include <VCardAgentValue.h>
25 25
26#include <VCardValue.h> 26#include <VCardValue.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30AgentValue::AgentValue() 32AgentValue::AgentValue()
31 :Value() 33 :Value()
32{ 34{
33} 35}
34 36
35AgentValue::AgentValue(const AgentValue & x) 37AgentValue::AgentValue(const AgentValue & x)
36 :Value(x) 38 :Value(x)
37{ 39{
38} 40}
39 41
40AgentValue::AgentValue(const QCString & s) 42AgentValue::AgentValue(const Q3CString & s)
41 :Value(s) 43 :Value(s)
42{ 44{
43} 45}
44 46
45 AgentValue & 47 AgentValue &
46AgentValue::operator = (AgentValue & x) 48AgentValue::operator = (AgentValue & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Value::operator = (x); 52 Value::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 AgentValue & 56 AgentValue &
55AgentValue::operator = (const QCString & s) 57AgentValue::operator = (const Q3CString & s)
56{ 58{
57 Value::operator = (s); 59 Value::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62AgentValue::operator == (AgentValue & x) 64AgentValue::operator == (AgentValue & x)
63{ 65{
64 x.parse(); 66 x.parse();
65 return false; 67 return false;
66} 68}
67 69
diff --git a/kabc/vcard/ClassValue.cpp b/kabc/vcard/ClassValue.cpp
index f01e5a6..c088d7c 100644
--- a/kabc/vcard/ClassValue.cpp
+++ b/kabc/vcard/ClassValue.cpp
@@ -17,57 +17,59 @@
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardClassValue.h> 24#include <VCardClassValue.h>
25 25
26#include <VCardValue.h> 26#include <VCardValue.h>
27 27
28#include <kdebug.h> 28#include <kdebug.h>
29//Added by qt3to4:
30#include <Q3CString>
29 31
30using namespace VCARD; 32using namespace VCARD;
31 33
32ClassValue::ClassValue() 34ClassValue::ClassValue()
33 :Value() 35 :Value()
34{ 36{
35} 37}
36 38
37ClassValue::ClassValue(const ClassValue & x) 39ClassValue::ClassValue(const ClassValue & x)
38 :Value(x), 40 :Value(x),
39 classType_(x.classType_) 41 classType_(x.classType_)
40{ 42{
41} 43}
42 44
43ClassValue::ClassValue(const QCString & s) 45ClassValue::ClassValue(const Q3CString & s)
44 :Value(s) 46 :Value(s)
45{ 47{
46} 48}
47 49
48 ClassValue & 50 ClassValue &
49ClassValue::operator = (ClassValue & x) 51ClassValue::operator = (ClassValue & x)
50{ 52{
51 if (*this == x) return *this; 53 if (*this == x) return *this;
52 x.parse(); 54 x.parse();
53 55
54 classType_ = x.classType_; 56 classType_ = x.classType_;
55 57
56 Value::operator = (x); 58 Value::operator = (x);
57 return *this; 59 return *this;
58} 60}
59 61
60 ClassValue & 62 ClassValue &
61ClassValue::operator = (const QCString & s) 63ClassValue::operator = (const Q3CString & s)
62{ 64{
63 Value::operator = (s); 65 Value::operator = (s);
64 return *this; 66 return *this;
65} 67}
66 68
67 bool 69 bool
68ClassValue::operator == (ClassValue & x) 70ClassValue::operator == (ClassValue & x)
69{ 71{
70 x.parse(); 72 x.parse();
71 return ( classType_ == x.classType_ ); 73 return ( classType_ == x.classType_ );
72} 74}
73 75
diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp
index 0a2f97d..1d4886c 100644
--- a/kabc/vcard/ContentLine.cpp
+++ b/kabc/vcard/ContentLine.cpp
@@ -12,26 +12,26 @@
12 12
13 The above copyright notice and this permission notice shall be included in 13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software. 14 all copies or substantial portions of the Software.
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <qcstring.h> 24#include <q3cstring.h>
25#include <qstrlist.h> 25#include <q3strlist.h>
26#include <qregexp.h> 26#include <qregexp.h>
27 27
28#include <kdebug.h> 28#include <kdebug.h>
29 29
30#include <VCardAdrParam.h> 30#include <VCardAdrParam.h>
31#include <VCardAgentParam.h> 31#include <VCardAgentParam.h>
32#include <VCardDateParam.h> 32#include <VCardDateParam.h>
33#include <VCardEmailParam.h> 33#include <VCardEmailParam.h>
34#include <VCardImageParam.h> 34#include <VCardImageParam.h>
35#include <VCardSourceParam.h> 35#include <VCardSourceParam.h>
36#include <VCardTelParam.h> 36#include <VCardTelParam.h>
37#include <VCardTextBinParam.h> 37#include <VCardTextBinParam.h>
@@ -89,25 +89,25 @@ ContentLine::ContentLine(const ContentLine & x)
89 89
90 ParamListIterator it(x.paramList_); 90 ParamListIterator it(x.paramList_);
91 for (; it.current(); ++it) 91 for (; it.current(); ++it)
92 { 92 {
93 Param *p = new Param; 93 Param *p = new Param;
94 p->setName( it.current()->name() ); 94 p->setName( it.current()->name() );
95 p->setValue( it.current()->value() ); 95 p->setValue( it.current()->value() );
96 paramList_.append(p); 96 paramList_.append(p);
97 } 97 }
98 98
99} 99}
100 100
101ContentLine::ContentLine(const QCString & s) 101ContentLine::ContentLine(const Q3CString & s)
102 :Entity(s), 102 :Entity(s),
103 value_(0), 103 value_(0),
104 paramType_( ParamUnknown ), 104 paramType_( ParamUnknown ),
105 valueType_( ValueUnknown ), 105 valueType_( ValueUnknown ),
106 entityType_( EntityUnknown ) 106 entityType_( EntityUnknown )
107{ 107{
108 paramList_.setAutoDelete( TRUE ); 108 paramList_.setAutoDelete( TRUE );
109} 109}
110 110
111 ContentLine & 111 ContentLine &
112ContentLine::operator = (ContentLine & x) 112ContentLine::operator = (ContentLine & x)
113{ 113{
@@ -120,128 +120,128 @@ ContentLine::operator = (ContentLine & x)
120 p->setName( it.current()->name() ); 120 p->setName( it.current()->name() );
121 p->setValue( it.current()->value() ); 121 p->setValue( it.current()->value() );
122 paramList_.append(p); 122 paramList_.append(p);
123 } 123 }
124 124
125 value_ = x.value_->clone(); 125 value_ = x.value_->clone();
126 126
127 Entity::operator = (x); 127 Entity::operator = (x);
128 return *this; 128 return *this;
129} 129}
130 130
131 ContentLine & 131 ContentLine &
132ContentLine::operator = (const QCString & s) 132ContentLine::operator = (const Q3CString & s)
133{ 133{
134 Entity::operator = (s); 134 Entity::operator = (s);
135 delete value_; 135 delete value_;
136 value_ = 0; 136 value_ = 0;
137 return *this; 137 return *this;
138} 138}
139 139
140 bool 140 bool
141ContentLine::operator == (ContentLine & x) 141ContentLine::operator == (ContentLine & x)
142{ 142{
143 x.parse(); 143 x.parse();
144 144
145 QPtrListIterator<Param> it(x.paramList()); 145 Q3PtrListIterator<Param> it(x.paramList());
146 146
147 if (!paramList_.find(it.current())) 147 if (!paramList_.find(it.current()))
148 return false; 148 return false;
149 149
150 return true; 150 return true;
151} 151}
152 152
153ContentLine::~ContentLine() 153ContentLine::~ContentLine()
154{ 154{
155 delete value_; 155 delete value_;
156 value_ = 0; 156 value_ = 0;
157} 157}
158 158
159 void 159 void
160ContentLine::_parse() 160ContentLine::_parse()
161{ 161{
162 vDebug("parse"); 162 vDebug("parse");
163 163
164 // Unfold folded lines 164 // Unfold folded lines
165 // NLR 165 // NLR
166 strRep_ = strRep_.replace( QRegExp( "\\r" ), "" ); 166 strRep_ = strRep_.replace( "\\r" , "" );
167 // Unqote newlines 167 // Unqote newlines
168 strRep_ = strRep_.replace( QRegExp( "\\\\n" ), "\n" ); 168 strRep_ = strRep_.replace( "\\\\n", "\n" );
169 //NLR 169 //NLR
170 strRep_ = strRep_.replace( QRegExp( "\\\\r" ), "\r" ); 170 strRep_ = strRep_.replace( "\\\\r" , "\r" );
171 171
172 int split = strRep_.find(':'); 172 int split = strRep_.find(':');
173 173
174 if (split == -1) { // invalid content line 174 if (split == -1) { // invalid content line
175 vDebug("No ':'"); 175 vDebug("No ':'");
176 return; 176 return;
177 } 177 }
178 178
179 QCString firstPart(strRep_.left(split)); 179 Q3CString firstPart(strRep_.left(split));
180 QCString valuePart(strRep_.mid(split + 1)); 180 Q3CString valuePart(strRep_.mid(split + 1));
181 181
182 split = firstPart.find('.'); 182 split = firstPart.find('.');
183 183
184 if (split != -1) { 184 if (split != -1) {
185 group_ = firstPart.left(split); 185 group_ = firstPart.left(split);
186 firstPart= firstPart.mid(split + 1); 186 firstPart= firstPart.mid(split + 1);
187 } 187 }
188 188
189 vDebug("Group == " + group_); 189 vDebug("Group == " + group_);
190 vDebug("firstPart == " + firstPart); 190 vDebug("firstPart == " + firstPart);
191 vDebug("valuePart == " + valuePart); 191 vDebug("valuePart == " + valuePart);
192 192
193 // Now we have the group, the name and param list together and the value. 193 // Now we have the group, the name and param list together and the value.
194 194
195 QStrList l; 195 Q3StrList l;
196 196
197 RTokenise(firstPart, ";", l); 197 RTokenise(firstPart, ";", l);
198 198
199 if (l.count() == 0) {// invalid - no name ! 199 if (l.count() == 0) {// invalid - no name !
200 vDebug("No name for this content line !"); 200 vDebug("No name for this content line !");
201 return; 201 return;
202 } 202 }
203 203
204 name_ = l.at(0); 204 name_ = l.at(0);
205 205
206 // Now we have the name, so the rest of 'l' is the params. 206 // Now we have the name, so the rest of 'l' is the params.
207 // Remove the name part. 207 // Remove the name part.
208 l.remove(0u); 208 l.remove(0u);
209 209
210 entityType_= EntityNameToEntityType(name_); 210 entityType_= EntityNameToEntityType(name_);
211 paramType_= EntityTypeToParamType(entityType_); 211 paramType_= EntityTypeToParamType(entityType_);
212 212
213 unsigned int i = 0; 213 unsigned int i = 0;
214 214
215 // For each parameter, create a new parameter of the correct type. 215 // For each parameter, create a new parameter of the correct type.
216 216
217 QStrListIterator it(l); 217 Q3StrListIterator it(l);
218 218
219 for (; it.current(); ++it, i++) { 219 for (; it.current(); ++it, i++) {
220 220
221 QCString str = *it; 221 Q3CString str = *it;
222 222
223 split = str.find("="); 223 split = str.find("=");
224 if (split < 0 ) { 224 if (split < 0 ) {
225 vDebug("No '=' in paramter."); 225 vDebug("No '=' in paramter.");
226 continue; 226 continue;
227 } 227 }
228 228
229 QCString paraName = str.left(split); 229 Q3CString paraName = str.left(split);
230 QCString paraValue = str.mid(split + 1); 230 Q3CString paraValue = str.mid(split + 1);
231 231
232 QStrList paraValues; 232 Q3StrList paraValues;
233 RTokenise(paraValue, ",", paraValues); 233 RTokenise(paraValue, ",", paraValues);
234 234
235 QStrListIterator it2( paraValues ); 235 Q3StrListIterator it2( paraValues );
236 236
237 for(; it2.current(); ++it2) { 237 for(; it2.current(); ++it2) {
238 238
239 Param *p = new Param; 239 Param *p = new Param;
240 p->setName( paraName ); 240 p->setName( paraName );
241 p->setValue( *it2 ); 241 p->setValue( *it2 );
242 242
243 paramList_.append(p); 243 paramList_.append(p);
244 } 244 }
245 } 245 }
246 246
247 // Create a new value of the correct type. 247 // Create a new value of the correct type.
@@ -300,25 +300,25 @@ ContentLine::_assemble()
300 while( line.length() > ( cursor + 1 ) * maxLen ) { 300 while( line.length() > ( cursor + 1 ) * maxLen ) {
301 cut += line.mid( cursor * maxLen, maxLen ); 301 cut += line.mid( cursor * maxLen, maxLen );
302 cut += "\r\n "; 302 cut += "\r\n ";
303 ++cursor; 303 ++cursor;
304 } 304 }
305 cut += line.mid( cursor * maxLen ); 305 cut += line.mid( cursor * maxLen );
306 strRep_ = cut.latin1(); 306 strRep_ = cut.latin1();
307 //qDebug("ContentLine::_assemble()\n%s*****", strRep_.data()); 307 //qDebug("ContentLine::_assemble()\n%s*****", strRep_.data());
308#if 0 308#if 0
309 vDebug("Assemble (argl) - my name is \"" + name_ + "\""); 309 vDebug("Assemble (argl) - my name is \"" + name_ + "\"");
310 strRep_.truncate(0); 310 strRep_.truncate(0);
311 311
312 QCString line; 312 Q3CString line;
313 313
314 if (!group_.isEmpty()) 314 if (!group_.isEmpty())
315 line += group_ + '.'; 315 line += group_ + '.';
316 316
317 line += name_; 317 line += name_;
318 318
319 vDebug("Adding parameters"); 319 vDebug("Adding parameters");
320 ParamListIterator it(paramList_); 320 ParamListIterator it(paramList_);
321 321
322 for (; it.current(); ++it) 322 for (; it.current(); ++it)
323 line += ";" + it.current()->asString(); 323 line += ";" + it.current()->asString();
324 324
diff --git a/kabc/vcard/DateParam.cpp b/kabc/vcard/DateParam.cpp
index 52af089..52fb828 100644
--- a/kabc/vcard/DateParam.cpp
+++ b/kabc/vcard/DateParam.cpp
@@ -15,53 +15,55 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardDateParam.h> 24#include <VCardDateParam.h>
25 25
26#include <VCardParam.h> 26#include <VCardParam.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30DateParam::DateParam() 32DateParam::DateParam()
31 :Param() 33 :Param()
32{ 34{
33} 35}
34 36
35DateParam::DateParam(const DateParam & x) 37DateParam::DateParam(const DateParam & x)
36 :Param(x) 38 :Param(x)
37{ 39{
38} 40}
39 41
40DateParam::DateParam(const QCString & s) 42DateParam::DateParam(const Q3CString & s)
41 :Param(s) 43 :Param(s)
42{ 44{
43} 45}
44 46
45 DateParam & 47 DateParam &
46DateParam::operator = (DateParam & x) 48DateParam::operator = (DateParam & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Param::operator = (x); 52 Param::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 DateParam & 56 DateParam &
55DateParam::operator = (const QCString & s) 57DateParam::operator = (const Q3CString & s)
56{ 58{
57 Param::operator = (s); 59 Param::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62DateParam::operator == (DateParam & x) 64DateParam::operator == (DateParam & x)
63{ 65{
64 x.parse(); 66 x.parse();
65 67
66 return false; 68 return false;
67} 69}
diff --git a/kabc/vcard/DateValue.cpp b/kabc/vcard/DateValue.cpp
index c5c5c85..87c7007 100644
--- a/kabc/vcard/DateValue.cpp
+++ b/kabc/vcard/DateValue.cpp
@@ -13,24 +13,26 @@
13 The above copyright notice and this permission notice shall be included in 13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software. 14 all copies or substantial portions of the Software.
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <qregexp.h> 24#include <qregexp.h>
25//Added by qt3to4:
26#include <Q3CString>
25 27
26#include <kdebug.h> 28#include <kdebug.h>
27 29
28#include <VCardDefines.h> 30#include <VCardDefines.h>
29#include <VCardDateValue.h> 31#include <VCardDateValue.h>
30#include <VCardValue.h> 32#include <VCardValue.h>
31 33
32using namespace VCARD; 34using namespace VCARD;
33 35
34DateValue::DateValue() 36DateValue::DateValue()
35 :Value() 37 :Value()
36{ 38{
@@ -96,40 +98,40 @@ DateValue::DateValue(const DateValue & x)
96 year_ = x.year_; 98 year_ = x.year_;
97 month_ = x.month_; 99 month_ = x.month_;
98 day_ = x.day_; 100 day_ = x.day_;
99 hour_ = x.hour_; 101 hour_ = x.hour_;
100 minute_ = x.minute_; 102 minute_ = x.minute_;
101 second_ = x.second_; 103 second_ = x.second_;
102 zoneHour_ = x.zoneHour_; 104 zoneHour_ = x.zoneHour_;
103 zoneMinute_ = x.zoneMinute_; 105 zoneMinute_ = x.zoneMinute_;
104 secFrac_ = x.secFrac_; 106 secFrac_ = x.secFrac_;
105 hasTime_ = x.hasTime_; 107 hasTime_ = x.hasTime_;
106} 108}
107 109
108DateValue::DateValue(const QCString & s) 110DateValue::DateValue(const Q3CString & s)
109 :Value(s) 111 :Value(s)
110{ 112{
111} 113}
112 114
113 DateValue & 115 DateValue &
114DateValue::operator = (DateValue & x) 116DateValue::operator = (DateValue & x)
115{ 117{
116 if (*this == x) return *this; 118 if (*this == x) return *this;
117 119
118 Value::operator = (x); 120 Value::operator = (x);
119 return *this; 121 return *this;
120} 122}
121 123
122 DateValue & 124 DateValue &
123DateValue::operator = (const QCString & s) 125DateValue::operator = (const Q3CString & s)
124{ 126{
125 Value::operator = (s); 127 Value::operator = (s);
126 return *this; 128 return *this;
127} 129}
128 130
129 bool 131 bool
130DateValue::operator == (DateValue & x) 132DateValue::operator == (DateValue & x)
131{ 133{
132 x.parse(); 134 x.parse();
133 return false; 135 return false;
134} 136}
135 137
@@ -145,116 +147,116 @@ DateValue::clone()
145 147
146 void 148 void
147DateValue::_parse() 149DateValue::_parse()
148{ 150{
149 vDebug("DateValue::_parse()"); 151 vDebug("DateValue::_parse()");
150 152
151 // date = date-full-year ["-"] date-month ["-"] date-mday 153 // date = date-full-year ["-"] date-month ["-"] date-mday
152 // time = time-hour [":"] time-minute [":"] time-second [":"] 154 // time = time-hour [":"] time-minute [":"] time-second [":"]
153 // [time-secfrac] [time-zone] 155 // [time-secfrac] [time-zone]
154 156
155 int timeSep = strRep_.find('T'); 157 int timeSep = strRep_.find('T');
156 158
157 QCString dateStr; 159 Q3CString dateStr;
158 QCString timeStr; 160 Q3CString timeStr;
159 161
160 if (timeSep == -1) { 162 if (timeSep == -1) {
161 163
162 dateStr = strRep_; 164 dateStr = strRep_;
163 vDebug("Has date string \"" + dateStr + "\""); 165 vDebug("Has date string \"" + dateStr + "\"");
164 166
165 } else { 167 } else {
166 168
167 dateStr = strRep_.left(timeSep); 169 dateStr = strRep_.left(timeSep);
168 vDebug("Has date string \"" + dateStr + "\""); 170 vDebug("Has date string \"" + dateStr + "\"");
169 171
170 timeStr = strRep_.mid(timeSep + 1); 172 timeStr = strRep_.mid(timeSep + 1);
171 vDebug("Has time string \"" + timeStr + "\""); 173 vDebug("Has time string \"" + timeStr + "\"");
172 } 174 }
173 175
174 /////////////////////////////////////////////////////////////// DATE 176 /////////////////////////////////////////////////////////////// DATE
175 177
176 dateStr.replace(QRegExp("-"), ""); 178 dateStr.replace("-", "");
177 179
178 kdDebug(5710) << "dateStr: " << dateStr << endl; 180 kdDebug(5710) << "dateStr: " << dateStr << endl;
179 181
180 year_= dateStr.left(4).toInt(); 182 year_= dateStr.left(4).toInt();
181 month_= dateStr.mid(4, 2).toInt(); 183 month_= dateStr.mid(4, 2).toInt();
182 day_= dateStr.right(2).toInt(); 184 day_= dateStr.right(2).toInt();
183 185
184 if (timeSep == -1) { 186 if (timeSep == -1) {
185 hasTime_ = false; 187 hasTime_ = false;
186 return; // No time, done. 188 return; // No time, done.
187 } 189 }
188 else 190 else
189 hasTime_ = true; 191 hasTime_ = true;
190 192
191 /////////////////////////////////////////////////////////////// TIME 193 /////////////////////////////////////////////////////////////// TIME
192 194
193 /////////////////////////////////////////////////////////////// ZONE 195 /////////////////////////////////////////////////////////////// ZONE
194 196
195 int zoneSep = timeStr.find('Z'); 197 int zoneSep = timeStr.find('Z');
196 198
197 if (zoneSep != -1 && timeStr.length() - zoneSep > 3) { 199 if (zoneSep != -1 && timeStr.length() - zoneSep > 3) {
198 200
199 QCString zoneStr(timeStr.mid(zoneSep + 1)); 201 Q3CString zoneStr(timeStr.mid(zoneSep + 1));
200 vDebug("zoneStr == " + zoneStr); 202 vDebug("zoneStr == " + zoneStr);
201 203
202 zonePositive_= (zoneStr[0] == '+'); 204 zonePositive_= (zoneStr[0] == '+');
203 zoneHour_ = zoneStr.mid(1, 2).toInt(); 205 zoneHour_ = zoneStr.mid(1, 2).toInt();
204 zoneMinute_ = zoneStr.right(2).toInt(); 206 zoneMinute_ = zoneStr.right(2).toInt();
205 207
206 timeStr.remove(zoneSep, timeStr.length() - zoneSep); 208 timeStr.remove(zoneSep, timeStr.length() - zoneSep);
207 } 209 }
208 210
209 //////////////////////////////////////////////////// SECOND FRACTION 211 //////////////////////////////////////////////////// SECOND FRACTION
210 212
211 int secFracSep = timeStr.findRev(','); 213 int secFracSep = timeStr.findRev(',');
212 214
213 if (secFracSep != -1 && zoneSep != -1) { // zoneSep checked to avoid errors. 215 if (secFracSep != -1 && zoneSep != -1) { // zoneSep checked to avoid errors.
214 QCString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep); 216 Q3CString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep);
215 secFrac_ = quirkafleeg.toDouble(); 217 secFrac_ = quirkafleeg.toDouble();
216 } 218 }
217 219
218 /////////////////////////////////////////////////////////////// HMS 220 /////////////////////////////////////////////////////////////// HMS
219 221
220 timeStr.replace(QRegExp(":"), ""); 222 timeStr.replace(":", "");
221 223
222 hour_= timeStr.left(2).toInt(); 224 hour_= timeStr.left(2).toInt();
223 minute_= timeStr.mid(2, 2).toInt(); 225 minute_= timeStr.mid(2, 2).toInt();
224 second_= timeStr.mid(4, 2).toInt(); 226 second_= timeStr.mid(4, 2).toInt();
225} 227}
226 228
227 void 229 void
228DateValue::_assemble() 230DateValue::_assemble()
229{ 231{
230 vDebug("DateValue::_assemble"); 232 vDebug("DateValue::_assemble");
231 233
232 QCString year; 234 Q3CString year;
233 QCString month; 235 Q3CString month;
234 QCString day; 236 Q3CString day;
235 237
236 year.setNum( year_ ); 238 year.setNum( year_ );
237 month.setNum( month_ ); 239 month.setNum( month_ );
238 day.setNum( day_ ); 240 day.setNum( day_ );
239 241
240 if ( month.length() < 2 ) month.prepend( "0" ); 242 if ( month.length() < 2 ) month.prepend( "0" );
241 if ( day.length() < 2 ) day.prepend( "0" ); 243 if ( day.length() < 2 ) day.prepend( "0" );
242 244
243 strRep_ = year + '-' + month + '-' + day; 245 strRep_ = year + '-' + month + '-' + day;
244 246
245 if ( hasTime_ ) { 247 if ( hasTime_ ) {
246 QCString hour; 248 Q3CString hour;
247 QCString minute; 249 Q3CString minute;
248 QCString second; 250 Q3CString second;
249 251
250 hour.setNum( hour_ ); 252 hour.setNum( hour_ );
251 minute.setNum( minute_ ); 253 minute.setNum( minute_ );
252 second.setNum( second_ ); 254 second.setNum( second_ );
253 255
254 if ( hour.length() < 2 ) hour.prepend( "0" ); 256 if ( hour.length() < 2 ) hour.prepend( "0" );
255 if ( minute.length() < 2 ) minute.prepend( "0" ); 257 if ( minute.length() < 2 ) minute.prepend( "0" );
256 if ( second.length() < 2 ) second.prepend( "0" ); 258 if ( second.length() < 2 ) second.prepend( "0" );
257 259
258 strRep_ += 'T' + hour + ':' + minute + ':' + second + 'Z'; 260 strRep_ += 'T' + hour + ':' + minute + ':' + second + 'Z';
259 } 261 }
260} 262}
diff --git a/kabc/vcard/EmailParam.cpp b/kabc/vcard/EmailParam.cpp
index 8c87477..877af60 100644
--- a/kabc/vcard/EmailParam.cpp
+++ b/kabc/vcard/EmailParam.cpp
@@ -15,59 +15,61 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardEmailParam.h> 24#include <VCardEmailParam.h>
25#include <VCardParam.h> 25#include <VCardParam.h>
26#include <VCardDefines.h> 26#include <VCardDefines.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30EmailParam::EmailParam() 32EmailParam::EmailParam()
31 :Param() 33 :Param()
32{ 34{
33 vDebug("ctor"); 35 vDebug("ctor");
34} 36}
35 37
36EmailParam::EmailParam(const EmailParam & x) 38EmailParam::EmailParam(const EmailParam & x)
37 :Param(x), 39 :Param(x),
38 emailType_(x.emailType_), 40 emailType_(x.emailType_),
39 pref_ (x.pref_) 41 pref_ (x.pref_)
40{ 42{
41} 43}
42 44
43EmailParam::EmailParam(const QCString & s) 45EmailParam::EmailParam(const Q3CString & s)
44 :Param(s) 46 :Param(s)
45{ 47{
46} 48}
47 49
48 EmailParam & 50 EmailParam &
49EmailParam::operator = (EmailParam & x) 51EmailParam::operator = (EmailParam & x)
50{ 52{
51 if (*this == x) return *this; 53 if (*this == x) return *this;
52 54
53 emailType_= x.emailType(); 55 emailType_= x.emailType();
54 pref_ = x.pref_; 56 pref_ = x.pref_;
55 57
56 Param::operator = (x); 58 Param::operator = (x);
57 return *this; 59 return *this;
58} 60}
59 61
60 EmailParam & 62 EmailParam &
61EmailParam::operator = (const QCString & s) 63EmailParam::operator = (const Q3CString & s)
62{ 64{
63 Param::operator = (s); 65 Param::operator = (s);
64 return *this; 66 return *this;
65} 67}
66 68
67 bool 69 bool
68EmailParam::operator == (EmailParam & x) 70EmailParam::operator == (EmailParam & x)
69{ 71{
70 parse(); 72 parse();
71 73
72 if (pref_) 74 if (pref_)
73 return (x.pref_ && x.emailType() == emailType_); 75 return (x.pref_ && x.emailType() == emailType_);
diff --git a/kabc/vcard/Entity.cpp b/kabc/vcard/Entity.cpp
index b7d09e0..e38fa11 100644
--- a/kabc/vcard/Entity.cpp
+++ b/kabc/vcard/Entity.cpp
@@ -13,102 +13,104 @@
13 The above copyright notice and this permission notice shall be included in 13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software. 14 all copies or substantial portions of the Software.
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardEntity.h> 24#include <VCardEntity.h>
25//Added by qt3to4:
26#include <Q3CString>
25 27
26using namespace VCARD; 28using namespace VCARD;
27 29
28Entity::Entity() 30Entity::Entity()
29 : parsed_ (false), 31 : parsed_ (false),
30 assembled_(true) 32 assembled_(true)
31{ 33{
32 // empty 34 // empty
33} 35}
34 36
35Entity::Entity(const Entity & e) 37Entity::Entity(const Entity & e)
36 : strRep_ (e.strRep_), 38 : strRep_ (e.strRep_),
37 parsed_ (e.parsed_), 39 parsed_ (e.parsed_),
38 assembled_(e.assembled_) 40 assembled_(e.assembled_)
39{ 41{
40 // empty 42 // empty
41} 43}
42 44
43Entity::Entity(const QCString & s) 45Entity::Entity(const Q3CString & s)
44 : strRep_ (s), 46 : strRep_ (s),
45 parsed_ (false), 47 parsed_ (false),
46 assembled_(true) 48 assembled_(true)
47{ 49{
48 // empty 50 // empty
49} 51}
50 52
51 Entity & 53 Entity &
52Entity::operator = (const Entity & e) 54Entity::operator = (const Entity & e)
53{ 55{
54 if (this == &e) return *this; 56 if (this == &e) return *this;
55 57
56 strRep_ = e.strRep_; 58 strRep_ = e.strRep_;
57 parsed_ = e.parsed_; 59 parsed_ = e.parsed_;
58 assembled_= e.assembled_; 60 assembled_= e.assembled_;
59 61
60 return *this; 62 return *this;
61} 63}
62 64
63 Entity & 65 Entity &
64Entity::operator = (const QCString & s) 66Entity::operator = (const Q3CString & s)
65{ 67{
66 strRep_ = s; 68 strRep_ = s;
67 parsed_ = false; 69 parsed_ = false;
68 assembled_= true; 70 assembled_= true;
69 71
70 return *this; 72 return *this;
71} 73}
72 74
73 bool 75 bool
74Entity::operator == (Entity & e) 76Entity::operator == (Entity & e)
75{ 77{
76 return asString() == e.asString(); 78 return asString() == e.asString();
77} 79}
78 80
79 bool 81 bool
80Entity::operator != (Entity & e) 82Entity::operator != (Entity & e)
81{ 83{
82 return !(*this == e); 84 return !(*this == e);
83} 85}
84 86
85 bool 87 bool
86Entity::operator == (const QCString & s) 88Entity::operator == (const Q3CString & s)
87{ 89{
88 return asString() == s; 90 return asString() == s;
89} 91}
90 92
91 bool 93 bool
92Entity::operator != (const QCString & s) 94Entity::operator != (const Q3CString & s)
93{ 95{
94 return !(*this == s); 96 return !(*this == s);
95} 97}
96 98
97Entity::~Entity() 99Entity::~Entity()
98{ 100{
99 // empty 101 // empty
100} 102}
101 103
102 QCString 104 Q3CString
103Entity::asString() 105Entity::asString()
104{ 106{
105 //vDebug("Entity::asString()"); 107 //vDebug("Entity::asString()");
106 assemble(); 108 assemble();
107 109
108 return strRep_; 110 return strRep_;
109} 111}
110 112
111 void 113 void
112Entity::parse() 114Entity::parse()
113{ 115{
114 //vDebug( "Entity::parse()" ); 116 //vDebug( "Entity::parse()" );
diff --git a/kabc/vcard/Enum.cpp b/kabc/vcard/Enum.cpp
index cc48b5a..036324c 100644
--- a/kabc/vcard/Enum.cpp
+++ b/kabc/vcard/Enum.cpp
@@ -12,33 +12,33 @@
12 12
13 The above copyright notice and this permission notice shall be included in 13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software. 14 all copies or substantial portions of the Software.
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <qcstring.h> 24#include <q3cstring.h>
25#include <ctype.h> 25#include <ctype.h>
26 26
27#include <VCardEnum.h> 27#include <VCardEnum.h>
28 28
29using namespace VCARD; 29using namespace VCARD;
30 30
31// There are 31 possible types, not including extensions. 31// There are 31 possible types, not including extensions.
32 const QCString 32 const Q3CString
33VCARD::paramNames [] = 33VCARD::paramNames [] =
34{ 34{
35 "NAME", 35 "NAME",
36 "PROFILE", 36 "PROFILE",
37 "SOURCE", 37 "SOURCE",
38 "FN", 38 "FN",
39 "N", 39 "N",
40 "NICKNAME", 40 "NICKNAME",
41 "PHOTO", 41 "PHOTO",
42 "BDAY", 42 "BDAY",
43 "ADR", 43 "ADR",
44 "LABEL", 44 "LABEL",
@@ -213,33 +213,33 @@ VCARD::EntityTypeToValueType(EntityType e)
213 case EntityVersion: 213 case EntityVersion:
214 case EntityProfile: 214 case EntityProfile:
215 case EntityUID: 215 case EntityUID:
216 case EntityNote: 216 case EntityNote:
217 default: t = ValueText; break; 217 default: t = ValueText; break;
218 //---------------------------------------------------------------// 218 //---------------------------------------------------------------//
219 219
220 } 220 }
221 221
222 return t; 222 return t;
223} 223}
224 224
225 QCString 225 Q3CString
226VCARD::EntityTypeToParamName(EntityType e) 226VCARD::EntityTypeToParamName(EntityType e)
227{ 227{
228 if ( e > EntityUnknown ) e = EntityUnknown; 228 if ( e > EntityUnknown ) e = EntityUnknown;
229 return paramNames[ int( e ) ]; 229 return paramNames[ int( e ) ];
230} 230}
231 231
232 EntityType 232 EntityType
233VCARD::EntityNameToEntityType(const QCString & s) 233VCARD::EntityNameToEntityType(const Q3CString & s)
234{ 234{
235 if (s.isEmpty()) return EntityUnknown; 235 if (s.isEmpty()) return EntityUnknown;
236 236
237 EntityType t(EntityUnknown); 237 EntityType t(EntityUnknown);
238 238
239 switch (s[0]) { 239 switch (s[0]) {
240 240
241 case 'A': 241 case 'A':
242 if (s == "ADR") 242 if (s == "ADR")
243 t = EntityAddress; 243 t = EntityAddress;
244 else if (s == "AGENT") 244 else if (s == "AGENT")
245 t = EntityAgent; 245 t = EntityAgent;
diff --git a/kabc/vcard/FloatValue.cpp b/kabc/vcard/FloatValue.cpp
index 15bb664..7065081 100644
--- a/kabc/vcard/FloatValue.cpp
+++ b/kabc/vcard/FloatValue.cpp
@@ -15,64 +15,66 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardFloatValue.h> 24#include <VCardFloatValue.h>
25 25
26#include <VCardValue.h> 26#include <VCardValue.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30FloatValue::FloatValue() 32FloatValue::FloatValue()
31 :Value() 33 :Value()
32{ 34{
33} 35}
34 36
35FloatValue::FloatValue(float f) 37FloatValue::FloatValue(float f)
36 : Value(), 38 : Value(),
37 value_(f) 39 value_(f)
38{ 40{
39 parsed_ = true; 41 parsed_ = true;
40} 42}
41 43
42FloatValue::FloatValue(const FloatValue & x) 44FloatValue::FloatValue(const FloatValue & x)
43 :Value(x) 45 :Value(x)
44{ 46{
45 value_ = x.value_; 47 value_ = x.value_;
46} 48}
47 49
48FloatValue::FloatValue(const QCString & s) 50FloatValue::FloatValue(const Q3CString & s)
49 :Value(s) 51 :Value(s)
50{ 52{
51} 53}
52 54
53 FloatValue & 55 FloatValue &
54FloatValue::operator = (FloatValue & x) 56FloatValue::operator = (FloatValue & x)
55{ 57{
56 if (*this == x) return *this; 58 if (*this == x) return *this;
57 59
58 x.parse(); 60 x.parse();
59 value_ = x.value_; 61 value_ = x.value_;
60 62
61 Value::operator = (x); 63 Value::operator = (x);
62 return *this; 64 return *this;
63} 65}
64 66
65 FloatValue & 67 FloatValue &
66FloatValue::operator = (const QCString & s) 68FloatValue::operator = (const Q3CString & s)
67{ 69{
68 Value::operator = (s); 70 Value::operator = (s);
69 return *this; 71 return *this;
70} 72}
71 73
72 bool 74 bool
73FloatValue::operator == (FloatValue & x) 75FloatValue::operator == (FloatValue & x)
74{ 76{
75 x.parse(); 77 x.parse();
76 return (value_ == x.value_); 78 return (value_ == x.value_);
77} 79}
78 80
@@ -92,25 +94,25 @@ FloatValue::_parse()
92 94
93 strRep_.remove(0, 1); 95 strRep_.remove(0, 1);
94 } 96 }
95 97
96 value_ = strRep_.toFloat(); 98 value_ = strRep_.toFloat();
97 if (negative) 99 if (negative)
98 value_ = -value_; 100 value_ = -value_;
99} 101}
100 102
101 void 103 void
102FloatValue::_assemble() 104FloatValue::_assemble()
103{ 105{
104 strRep_ = QCString().setNum(value_); 106 strRep_ = Q3CString().setNum(value_);
105} 107}
106 108
107 float 109 float
108FloatValue::value() 110FloatValue::value()
109{ 111{
110 parse(); 112 parse();
111 return value_; 113 return value_;
112} 114}
113 115
114 void 116 void
115FloatValue::setValue(float f) 117FloatValue::setValue(float f)
116{ 118{
diff --git a/kabc/vcard/GeoValue.cpp b/kabc/vcard/GeoValue.cpp
index e02b402..ba57a6b 100644
--- a/kabc/vcard/GeoValue.cpp
+++ b/kabc/vcard/GeoValue.cpp
@@ -14,56 +14,58 @@
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <VCardGeoValue.h> 21#include <VCardGeoValue.h>
22 22
23#include <VCardValue.h> 23#include <VCardValue.h>
24 24
25#include <kdebug.h> 25#include <kdebug.h>
26//Added by qt3to4:
27#include <Q3CString>
26 28
27using namespace VCARD; 29using namespace VCARD;
28 30
29GeoValue::GeoValue() 31GeoValue::GeoValue()
30 :Value() 32 :Value()
31{ 33{
32} 34}
33 35
34GeoValue::GeoValue(const GeoValue & x) 36GeoValue::GeoValue(const GeoValue & x)
35 :Value(x), latitude_(x.latitude_), longitude_(x.longitude_) 37 :Value(x), latitude_(x.latitude_), longitude_(x.longitude_)
36{ 38{
37} 39}
38 40
39GeoValue::GeoValue(const QCString & s) 41GeoValue::GeoValue(const Q3CString & s)
40 :Value(s) 42 :Value(s)
41{ 43{
42} 44}
43 45
44 GeoValue & 46 GeoValue &
45GeoValue::operator = (GeoValue & x) 47GeoValue::operator = (GeoValue & x)
46{ 48{
47 if (*this == x) return *this; 49 if (*this == x) return *this;
48 50
49 latitude_ = x.latitude_; 51 latitude_ = x.latitude_;
50 longitude_ = x.longitude_; 52 longitude_ = x.longitude_;
51 53
52 Value::operator = (x); 54 Value::operator = (x);
53 return *this; 55 return *this;
54} 56}
55 57
56 GeoValue & 58 GeoValue &
57GeoValue::operator = (const QCString & s) 59GeoValue::operator = (const Q3CString & s)
58{ 60{
59 Value::operator = (s); 61 Value::operator = (s);
60 return *this; 62 return *this;
61} 63}
62 64
63 bool 65 bool
64GeoValue::operator == (GeoValue & x) 66GeoValue::operator == (GeoValue & x)
65{ 67{
66 x.parse(); 68 x.parse();
67 69
68 if ( latitude_ != x.latitude_ ) return false; 70 if ( latitude_ != x.latitude_ ) return false;
69 if ( longitude_ != x.longitude_ ) return false; 71 if ( longitude_ != x.longitude_ ) return false;
diff --git a/kabc/vcard/ImageParam.cpp b/kabc/vcard/ImageParam.cpp
index c9cf6fd..6da317d 100644
--- a/kabc/vcard/ImageParam.cpp
+++ b/kabc/vcard/ImageParam.cpp
@@ -15,53 +15,55 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardImageParam.h> 24#include <VCardImageParam.h>
25 25
26#include <VCardParam.h> 26#include <VCardParam.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30ImageParam::ImageParam() 32ImageParam::ImageParam()
31 :Param() 33 :Param()
32{ 34{
33} 35}
34 36
35ImageParam::ImageParam(const ImageParam & x) 37ImageParam::ImageParam(const ImageParam & x)
36 :Param(x) 38 :Param(x)
37{ 39{
38} 40}
39 41
40ImageParam::ImageParam(const QCString & s) 42ImageParam::ImageParam(const Q3CString & s)
41 :Param(s) 43 :Param(s)
42{ 44{
43} 45}
44 46
45 ImageParam & 47 ImageParam &
46ImageParam::operator = (ImageParam & x) 48ImageParam::operator = (ImageParam & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Param::operator = (x); 52 Param::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 ImageParam & 56 ImageParam &
55ImageParam::operator = (const QCString & s) 57ImageParam::operator = (const Q3CString & s)
56{ 58{
57 Param::operator = (s); 59 Param::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62ImageParam::operator == (ImageParam & x) 64ImageParam::operator == (ImageParam & x)
63{ 65{
64 x.parse(); 66 x.parse();
65 return false; 67 return false;
66} 68}
67 69
diff --git a/kabc/vcard/ImageValue.cpp b/kabc/vcard/ImageValue.cpp
index 4630fac..678a81c 100644
--- a/kabc/vcard/ImageValue.cpp
+++ b/kabc/vcard/ImageValue.cpp
@@ -15,53 +15,55 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardImageValue.h> 24#include <VCardImageValue.h>
25 25
26#include <VCardValue.h> 26#include <VCardValue.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30ImageValue::ImageValue() 32ImageValue::ImageValue()
31 :Value() 33 :Value()
32{ 34{
33} 35}
34 36
35ImageValue::ImageValue(const ImageValue & x) 37ImageValue::ImageValue(const ImageValue & x)
36 :Value(x) 38 :Value(x)
37{ 39{
38} 40}
39 41
40ImageValue::ImageValue(const QCString & s) 42ImageValue::ImageValue(const Q3CString & s)
41 :Value(s) 43 :Value(s)
42{ 44{
43} 45}
44 46
45 ImageValue & 47 ImageValue &
46ImageValue::operator = (ImageValue & x) 48ImageValue::operator = (ImageValue & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Value::operator = (x); 52 Value::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 ImageValue & 56 ImageValue &
55ImageValue::operator = (const QCString & s) 57ImageValue::operator = (const Q3CString & s)
56{ 58{
57 Value::operator = (s); 59 Value::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62ImageValue::operator == (ImageValue & x) 64ImageValue::operator == (ImageValue & x)
63{ 65{
64 x.parse(); 66 x.parse();
65 return false; 67 return false;
66} 68}
67 69
diff --git a/kabc/vcard/ImgValue.cpp b/kabc/vcard/ImgValue.cpp
index 7b961f8..1b289df 100644
--- a/kabc/vcard/ImgValue.cpp
+++ b/kabc/vcard/ImgValue.cpp
@@ -15,53 +15,55 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardImgValue.h> 24#include <VCardImgValue.h>
25 25
26#include <VCardValue.h> 26#include <VCardValue.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30ImgValue::ImgValue() 32ImgValue::ImgValue()
31 :Value() 33 :Value()
32{ 34{
33} 35}
34 36
35ImgValue::ImgValue(const ImgValue & x) 37ImgValue::ImgValue(const ImgValue & x)
36 :Value(x) 38 :Value(x)
37{ 39{
38} 40}
39 41
40ImgValue::ImgValue(const QCString & s) 42ImgValue::ImgValue(const Q3CString & s)
41 :Value(s) 43 :Value(s)
42{ 44{
43} 45}
44 46
45 ImgValue & 47 ImgValue &
46ImgValue::operator = (ImgValue & x) 48ImgValue::operator = (ImgValue & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Value::operator = (x); 52 Value::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 ImgValue & 56 ImgValue &
55ImgValue::operator = (const QCString & s) 57ImgValue::operator = (const Q3CString & s)
56{ 58{
57 Value::operator = (s); 59 Value::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62ImgValue::operator == (ImgValue & x) 64ImgValue::operator == (ImgValue & x)
63{ 65{
64 x.parse(); 66 x.parse();
65 return false; 67 return false;
66} 68}
67 69
diff --git a/kabc/vcard/LangValue.cpp b/kabc/vcard/LangValue.cpp
index edf1804..52a0204 100644
--- a/kabc/vcard/LangValue.cpp
+++ b/kabc/vcard/LangValue.cpp
@@ -17,111 +17,115 @@
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardRToken.h> 24#include <VCardRToken.h>
25 25
26#include <VCardLangValue.h> 26#include <VCardLangValue.h>
27 27
28#include <VCardValue.h> 28#include <VCardValue.h>
29//Added by qt3to4:
30#include <Q3CString>
31#include <Q3StrList>
29 32
30using namespace VCARD; 33using namespace VCARD;
31 34
32LangValue::LangValue() 35LangValue::LangValue()
33 :Value() 36 :Value()
34{ 37{
35} 38}
36 39
37LangValue::LangValue(const LangValue & x) 40LangValue::LangValue(const LangValue & x)
38 :Value(x) 41 :Value(x)
39{ 42{
40} 43}
41 44
42LangValue::LangValue(const QCString & s) 45LangValue::LangValue(const Q3CString & s)
43 :Value(s) 46 :Value(s)
44{ 47{
45} 48}
46 49
47 LangValue & 50 LangValue &
48LangValue::operator = (LangValue & x) 51LangValue::operator = (LangValue & x)
49{ 52{
50 if (*this == x) return *this; 53 if (*this == x) return *this;
51 54
52 Value::operator = (x); 55 Value::operator = (x);
53 return *this; 56 return *this;
54} 57}
55 58
56 LangValue & 59 LangValue &
57LangValue::operator = (const QCString & s) 60LangValue::operator = (const Q3CString & s)
58{ 61{
59 Value::operator = (s); 62 Value::operator = (s);
60 return *this; 63 return *this;
61} 64}
62 65
63 bool 66 bool
64LangValue::operator == (LangValue & x) 67LangValue::operator == (LangValue & x)
65{ 68{
66 x.parse(); 69 x.parse();
67 return false; 70 return false;
68} 71}
69 72
70LangValue::~LangValue() 73LangValue::~LangValue()
71{ 74{
72} 75}
73 76
74 void 77 void
75LangValue::_parse() 78LangValue::_parse()
76{ 79{
77 QStrList l; 80 Q3StrList l;
78 RTokenise(strRep_, "-", l); 81 RTokenise(strRep_, "-", l);
79 82
80 if (l.count() == 0) return; 83 if (l.count() == 0) return;
81 84
82 primary_ = l.at(0); 85 primary_ = l.at(0);
83 86
84 l.remove(0u); 87 l.remove(0u);
85 88
86 subtags_ = l; 89 subtags_ = l;
87} 90}
88 91
89 void 92 void
90LangValue::_assemble() 93LangValue::_assemble()
91{ 94{
92 strRep_ = primary_; 95 strRep_ = primary_;
93 96
94 QStrListIterator it(subtags_); 97 Q3StrListIterator it(subtags_);
95 98
96 for (; it.current(); ++it) 99 for (; it.current(); ++it) {
97 strRep_ += QCString('-') + it.current(); 100 strRep_ += Q3CString('-'); strRep_ += it.current();
101 }
98} 102}
99 103
100 QCString 104 Q3CString
101LangValue::primary() 105LangValue::primary()
102{ 106{
103 parse(); 107 parse();
104 return primary_; 108 return primary_;
105} 109}
106 110
107 QStrList 111 Q3StrList
108LangValue::subtags() 112LangValue::subtags()
109{ 113{
110 parse(); 114 parse();
111 return subtags_; 115 return subtags_;
112} 116}
113 117
114 void 118 void
115LangValue::setPrimary(const QCString & s) 119LangValue::setPrimary(const Q3CString & s)
116{ 120{
117 parse(); 121 parse();
118 primary_ = s; 122 primary_ = s;
119} 123}
120 124
121 void 125 void
122LangValue::setSubTags(const QStrList & l) 126LangValue::setSubTags(const Q3StrList & l)
123{ 127{
124 parse(); 128 parse();
125 subtags_ = l; 129 subtags_ = l;
126} 130}
127 131
diff --git a/kabc/vcard/NValue.cpp b/kabc/vcard/NValue.cpp
index cdec621..6c0f365 100644
--- a/kabc/vcard/NValue.cpp
+++ b/kabc/vcard/NValue.cpp
@@ -12,72 +12,74 @@
12 12
13 The above copyright notice and this permission notice shall be included in 13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software. 14 all copies or substantial portions of the Software.
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <qstrlist.h> 24#include <q3strlist.h>
25//Added by qt3to4:
26#include <Q3CString>
25 27
26#include <VCardRToken.h> 28#include <VCardRToken.h>
27#include <VCardNValue.h> 29#include <VCardNValue.h>
28#include <VCardValue.h> 30#include <VCardValue.h>
29#include <VCardDefines.h> 31#include <VCardDefines.h>
30 32
31using namespace VCARD; 33using namespace VCARD;
32 34
33NValue::NValue() 35NValue::NValue()
34 :Value() 36 :Value()
35{ 37{
36 vDebug("ctor"); 38 vDebug("ctor");
37} 39}
38 40
39NValue::NValue(const NValue & x) 41NValue::NValue(const NValue & x)
40 :Value(x), 42 :Value(x),
41 family_(x.family_), 43 family_(x.family_),
42 given_(x.given_), 44 given_(x.given_),
43 middle_(x.middle_), 45 middle_(x.middle_),
44 prefix_(x.prefix_), 46 prefix_(x.prefix_),
45 suffix_(x.suffix_) 47 suffix_(x.suffix_)
46{ 48{
47} 49}
48 50
49NValue::NValue(const QCString & s) 51NValue::NValue(const Q3CString & s)
50 :Value(s) 52 :Value(s)
51{ 53{
52 vDebug("ctor"); 54 vDebug("ctor");
53} 55}
54 56
55 NValue & 57 NValue &
56NValue::operator = (NValue & x) 58NValue::operator = (NValue & x)
57{ 59{
58 if (*this == x) return *this; 60 if (*this == x) return *this;
59 61
60 family_= x.family_; 62 family_= x.family_;
61 given_= x.given_; 63 given_= x.given_;
62 middle_= x.middle_; 64 middle_= x.middle_;
63 prefix_= x.prefix_; 65 prefix_= x.prefix_;
64 suffix_= x.suffix_; 66 suffix_= x.suffix_;
65 67
66 Value::operator = (x); 68 Value::operator = (x);
67 return *this; 69 return *this;
68} 70}
69 71
70 NValue & 72 NValue &
71NValue::operator = (const QCString & s) 73NValue::operator = (const Q3CString & s)
72{ 74{
73 Value::operator = (s); 75 Value::operator = (s);
74 return *this; 76 return *this;
75} 77}
76 78
77 bool 79 bool
78NValue::operator == (NValue & x) 80NValue::operator == (NValue & x)
79{ 81{
80 x.parse(); 82 x.parse();
81 83
82 return ( 84 return (
83 family_ == x.family_&& 85 family_ == x.family_&&
@@ -91,25 +93,25 @@ NValue::~NValue()
91{ 93{
92} 94}
93 95
94 NValue * 96 NValue *
95NValue::clone() 97NValue::clone()
96{ 98{
97 return new NValue( *this ); 99 return new NValue( *this );
98} 100}
99 101
100 void 102 void
101NValue::_parse() 103NValue::_parse()
102{ 104{
103 QStrList l; 105 Q3StrList l;
104 RTokenise(strRep_, ";", l); 106 RTokenise(strRep_, ";", l);
105 107
106 for (unsigned int i = 0; i < l.count(); i++) { 108 for (unsigned int i = 0; i < l.count(); i++) {
107 109
108 switch (i) { 110 switch (i) {
109 case 0: family_ = l.at(0);break; 111 case 0: family_ = l.at(0);break;
110 case 1: given_ = l.at(1);break; 112 case 1: given_ = l.at(1);break;
111 case 2: middle_ = l.at(2);break; 113 case 2: middle_ = l.at(2);break;
112 case 3: prefix_ = l.at(3);break; 114 case 3: prefix_ = l.at(3);break;
113 case 4: suffix_ = l.at(4);break; 115 case 4: suffix_ = l.at(4);break;
114 default: break; 116 default: break;
115 } 117 }
diff --git a/kabc/vcard/OrgValue.cpp b/kabc/vcard/OrgValue.cpp
index c3134c8..a6a32dd 100644
--- a/kabc/vcard/OrgValue.cpp
+++ b/kabc/vcard/OrgValue.cpp
@@ -17,53 +17,55 @@
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardRToken.h> 24#include <VCardRToken.h>
25 25
26#include <VCardOrgValue.h> 26#include <VCardOrgValue.h>
27 27
28#include <VCardValue.h> 28#include <VCardValue.h>
29//Added by qt3to4:
30#include <Q3CString>
29 31
30using namespace VCARD; 32using namespace VCARD;
31 33
32OrgValue::OrgValue() 34OrgValue::OrgValue()
33 :Value() 35 :Value()
34{ 36{
35} 37}
36 38
37OrgValue::OrgValue(const OrgValue & x) 39OrgValue::OrgValue(const OrgValue & x)
38 :Value(x) 40 :Value(x)
39{ 41{
40} 42}
41 43
42OrgValue::OrgValue(const QCString & s) 44OrgValue::OrgValue(const Q3CString & s)
43 :Value(s) 45 :Value(s)
44{ 46{
45} 47}
46 48
47 OrgValue & 49 OrgValue &
48OrgValue::operator = (OrgValue & x) 50OrgValue::operator = (OrgValue & x)
49{ 51{
50 if (*this == x) return *this; 52 if (*this == x) return *this;
51 53
52 Value::operator = (x); 54 Value::operator = (x);
53 return *this; 55 return *this;
54} 56}
55 57
56 OrgValue & 58 OrgValue &
57OrgValue::operator = (const QCString & s) 59OrgValue::operator = (const Q3CString & s)
58{ 60{
59 Value::operator = (s); 61 Value::operator = (s);
60 return *this; 62 return *this;
61} 63}
62 64
63 bool 65 bool
64OrgValue::operator == (OrgValue & x) 66OrgValue::operator == (OrgValue & x)
65{ 67{
66 x.parse(); 68 x.parse();
67 return false; 69 return false;
68} 70}
69 71
@@ -73,35 +75,35 @@ OrgValue::~OrgValue()
73 75
74 void 76 void
75OrgValue::_parse() 77OrgValue::_parse()
76{ 78{
77 RTokenise(strRep_, ";", valueList_); 79 RTokenise(strRep_, ";", valueList_);
78} 80}
79 81
80 void 82 void
81OrgValue::_assemble() 83OrgValue::_assemble()
82{ 84{
83 bool first(true); 85 bool first(true);
84 86
85 QStrListIterator it(valueList_); 87 Q3StrListIterator it(valueList_);
86 88
87 for (; it.current(); ++it) { 89 for (; it.current(); ++it) {
88 if (!first) strRep_ += ';'; 90 if (!first) strRep_ += ';';
89 strRep_ += it.current(); 91 strRep_ += it.current();
90 first = false; 92 first = false;
91 } 93 }
92} 94}
93 95
94 unsigned int 96 unsigned int
95OrgValue::numValues() 97OrgValue::numValues()
96{ 98{
97 parse(); 99 parse();
98 return valueList_.count(); 100 return valueList_.count();
99} 101}
100 102
101 QCString 103 Q3CString
102OrgValue::value(unsigned int i) 104OrgValue::value(unsigned int i)
103{ 105{
104 parse(); 106 parse();
105 return valueList_.at(i); 107 return valueList_.at(i);
106} 108}
107 109
diff --git a/kabc/vcard/Param.cpp b/kabc/vcard/Param.cpp
index c513613..bd6b299 100644
--- a/kabc/vcard/Param.cpp
+++ b/kabc/vcard/Param.cpp
@@ -17,62 +17,64 @@
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardParam.h> 24#include <VCardParam.h>
25 25
26#include <VCardEntity.h> 26#include <VCardEntity.h>
27 27
28#include <VCardRToken.h> 28#include <VCardRToken.h>
29//Added by qt3to4:
30#include <Q3CString>
29 31
30using namespace VCARD; 32using namespace VCARD;
31 33
32Param::Param() 34Param::Param()
33 :Entity(), 35 :Entity(),
34 name_(""), 36 name_(""),
35 value_("") 37 value_("")
36{ 38{
37} 39}
38 40
39Param::Param(const Param & x) 41Param::Param(const Param & x)
40 :Entity(x), 42 :Entity(x),
41 name_(x.name_), 43 name_(x.name_),
42 value_(x.value_) 44 value_(x.value_)
43{ 45{
44} 46}
45 47
46Param::Param(const QCString & s) 48Param::Param(const Q3CString & s)
47 :Entity(s), 49 :Entity(s),
48 name_(""), 50 name_(""),
49 value_("") 51 value_("")
50{ 52{
51} 53}
52 54
53 Param & 55 Param &
54Param::operator = (Param & x) 56Param::operator = (Param & x)
55{ 57{
56 if (*this == x) return *this; 58 if (*this == x) return *this;
57 59
58 Entity::operator = (x); 60 Entity::operator = (x);
59 name_ = x.name_; 61 name_ = x.name_;
60 value_ = x.value_; 62 value_ = x.value_;
61 63
62 return *this; 64 return *this;
63} 65}
64 66
65 Param & 67 Param &
66Param::operator = (const QCString & s) 68Param::operator = (const Q3CString & s)
67{ 69{
68 Entity::operator = (s); 70 Entity::operator = (s);
69 return *this; 71 return *this;
70} 72}
71 73
72 bool 74 bool
73Param::operator == (Param & x) 75Param::operator == (Param & x)
74{ 76{
75 x.parse(); 77 x.parse();
76 return false; 78 return false;
77} 79}
78 80
@@ -82,48 +84,48 @@ Param::~Param()
82 84
83 void 85 void
84Param::_parse() 86Param::_parse()
85{ 87{
86} 88}
87 89
88 void 90 void
89Param::_assemble() 91Param::_assemble()
90{ 92{
91 strRep_ = name_ + "=" + value_; 93 strRep_ = name_ + "=" + value_;
92} 94}
93 95
94Param::Param(const QCString &name, const QCString &value) 96Param::Param(const Q3CString &name, const Q3CString &value)
95 :Entity(), 97 :Entity(),
96 name_(name), 98 name_(name),
97 value_(value) 99 value_(value)
98{ 100{
99 parsed_ = true; 101 parsed_ = true;
100 assembled_ = false; 102 assembled_ = false;
101} 103}
102 104
103 void 105 void
104Param::setName(const QCString & name) 106Param::setName(const Q3CString & name)
105{ 107{
106 name_ = name; 108 name_ = name;
107 109
108 assembled_ = false; 110 assembled_ = false;
109} 111}
110 112
111 void 113 void
112Param::setValue(const QCString & value) 114Param::setValue(const Q3CString & value)
113{ 115{
114 value_ = value; 116 value_ = value;
115 117
116 assembled_ = false; 118 assembled_ = false;
117} 119}
118 120
119 QCString 121 Q3CString
120Param::name() 122Param::name()
121{ 123{
122 return name_; 124 return name_;
123} 125}
124 126
125 QCString 127 Q3CString
126Param::value() 128Param::value()
127{ 129{
128 return value_; 130 return value_;
129} 131}
diff --git a/kabc/vcard/PhoneNumberValue.cpp b/kabc/vcard/PhoneNumberValue.cpp
index 17b1400..57aa336 100644
--- a/kabc/vcard/PhoneNumberValue.cpp
+++ b/kabc/vcard/PhoneNumberValue.cpp
@@ -15,53 +15,55 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardPhoneNumberValue.h> 24#include <VCardPhoneNumberValue.h>
25 25
26#include <VCardValue.h> 26#include <VCardValue.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30PhoneNumberValue::PhoneNumberValue() 32PhoneNumberValue::PhoneNumberValue()
31 :Value() 33 :Value()
32{ 34{
33} 35}
34 36
35PhoneNumberValue::PhoneNumberValue(const PhoneNumberValue & x) 37PhoneNumberValue::PhoneNumberValue(const PhoneNumberValue & x)
36 :Value(x) 38 :Value(x)
37{ 39{
38} 40}
39 41
40PhoneNumberValue::PhoneNumberValue(const QCString & s) 42PhoneNumberValue::PhoneNumberValue(const Q3CString & s)
41 :Value(s) 43 :Value(s)
42{ 44{
43} 45}
44 46
45 PhoneNumberValue & 47 PhoneNumberValue &
46PhoneNumberValue::operator = (PhoneNumberValue & x) 48PhoneNumberValue::operator = (PhoneNumberValue & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Value::operator = (x); 52 Value::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 PhoneNumberValue & 56 PhoneNumberValue &
55PhoneNumberValue::operator = (const QCString & s) 57PhoneNumberValue::operator = (const Q3CString & s)
56{ 58{
57 Value::operator = (s); 59 Value::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62PhoneNumberValue::operator == (PhoneNumberValue & x) 64PhoneNumberValue::operator == (PhoneNumberValue & x)
63{ 65{
64 x.parse(); 66 x.parse();
65 return false; 67 return false;
66} 68}
67 69
diff --git a/kabc/vcard/RToken.cpp b/kabc/vcard/RToken.cpp
index 2a85820..8fc0558 100644
--- a/kabc/vcard/RToken.cpp
+++ b/kabc/vcard/RToken.cpp
@@ -15,32 +15,32 @@
15 all copies or substantial portions of the Software. 15 all copies or substantial portions of the Software.
16 16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23*/ 23*/
24 24
25#include <string.h> 25#include <string.h>
26#include <stddef.h> 26#include <stddef.h>
27#include <qcstring.h> 27#include <q3cstring.h>
28#include <qstrlist.h> 28#include <q3strlist.h>
29 29
30namespace VCARD 30namespace VCARD
31{ 31{
32 32
33 Q_UINT32 33 Q_UINT32
34RTokenise(const char * str, const char * delim, QStrList & l) 34RTokenise(const char * str, const char * delim, Q3StrList & l)
35{ 35{
36 // FIXME no stderr ! 36 // FIXME no stderr !
37 l.clear(); 37 l.clear();
38 38
39 if (!delim || !str || strlen(delim) == 0 || strlen(str) == 0) return 0; 39 if (!delim || !str || strlen(delim) == 0 || strlen(str) == 0) return 0;
40 40
41 char * len = (char *)(str + strlen(str));// End of string. 41 char * len = (char *)(str + strlen(str));// End of string.
42 42
43 register char * rstart = new char[strlen(str) + 1]; 43 register char * rstart = new char[strlen(str) + 1];
44 register char * r = rstart; 44 register char * r = rstart;
45 45
46 46
diff --git a/kabc/vcard/SoundValue.cpp b/kabc/vcard/SoundValue.cpp
index 81040d1..4d098d2 100644
--- a/kabc/vcard/SoundValue.cpp
+++ b/kabc/vcard/SoundValue.cpp
@@ -15,53 +15,55 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardSoundValue.h> 24#include <VCardSoundValue.h>
25 25
26#include <VCardValue.h> 26#include <VCardValue.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30SoundValue::SoundValue() 32SoundValue::SoundValue()
31 :Value() 33 :Value()
32{ 34{
33} 35}
34 36
35SoundValue::SoundValue(const SoundValue & x) 37SoundValue::SoundValue(const SoundValue & x)
36 :Value(x) 38 :Value(x)
37{ 39{
38} 40}
39 41
40SoundValue::SoundValue(const QCString & s) 42SoundValue::SoundValue(const Q3CString & s)
41 :Value(s) 43 :Value(s)
42{ 44{
43} 45}
44 46
45 SoundValue & 47 SoundValue &
46SoundValue::operator = (SoundValue & x) 48SoundValue::operator = (SoundValue & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Value::operator = (x); 52 Value::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 SoundValue & 56 SoundValue &
55SoundValue::operator = (const QCString & s) 57SoundValue::operator = (const Q3CString & s)
56{ 58{
57 Value::operator = (s); 59 Value::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62SoundValue::operator == (SoundValue & x) 64SoundValue::operator == (SoundValue & x)
63{ 65{
64 x.parse(); 66 x.parse();
65 return false; 67 return false;
66} 68}
67 69
diff --git a/kabc/vcard/SourceParam.cpp b/kabc/vcard/SourceParam.cpp
index cd51cbd..8f02113 100644
--- a/kabc/vcard/SourceParam.cpp
+++ b/kabc/vcard/SourceParam.cpp
@@ -15,61 +15,63 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardSourceParam.h> 24#include <VCardSourceParam.h>
25 25
26#include <VCardParam.h> 26#include <VCardParam.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30SourceParam::SourceParam() 32SourceParam::SourceParam()
31 :Param(), 33 :Param(),
32 type_(SourceParam::TypeUnknown) 34 type_(SourceParam::TypeUnknown)
33{ 35{
34} 36}
35 37
36SourceParam::SourceParam(const SourceParam & x) 38SourceParam::SourceParam(const SourceParam & x)
37 :Param(x), 39 :Param(x),
38 type_(x.type_), 40 type_(x.type_),
39 par_(x.par_), 41 par_(x.par_),
40 val_(x.val_) 42 val_(x.val_)
41{ 43{
42} 44}
43 45
44SourceParam::SourceParam(const QCString & s) 46SourceParam::SourceParam(const Q3CString & s)
45 :Param(s), 47 :Param(s),
46 type_(SourceParam::TypeUnknown) 48 type_(SourceParam::TypeUnknown)
47{ 49{
48} 50}
49 51
50 SourceParam & 52 SourceParam &
51SourceParam::operator = (SourceParam & x) 53SourceParam::operator = (SourceParam & x)
52{ 54{
53 if (*this == x) return *this; 55 if (*this == x) return *this;
54 type_= x.type(); 56 type_= x.type();
55 par_= x.par(); 57 par_= x.par();
56 val_= x.val(); 58 val_= x.val();
57 59
58 Param::operator = (x); 60 Param::operator = (x);
59 return *this; 61 return *this;
60} 62}
61 63
62 SourceParam & 64 SourceParam &
63SourceParam::operator = (const QCString & s) 65SourceParam::operator = (const Q3CString & s)
64{ 66{
65 Param::operator = (s); 67 Param::operator = (s);
66 return *this; 68 return *this;
67} 69}
68 70
69 bool 71 bool
70SourceParam::operator == (SourceParam & x) 72SourceParam::operator == (SourceParam & x)
71{ 73{
72 x.parse(); 74 x.parse();
73 return false; 75 return false;
74} 76}
75 77
diff --git a/kabc/vcard/TelParam.cpp b/kabc/vcard/TelParam.cpp
index 9d9fe4d..4bc8b6a 100644
--- a/kabc/vcard/TelParam.cpp
+++ b/kabc/vcard/TelParam.cpp
@@ -15,53 +15,55 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardTelParam.h> 24#include <VCardTelParam.h>
25 25
26#include <VCardParam.h> 26#include <VCardParam.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30TelParam::TelParam() 32TelParam::TelParam()
31 :Param() 33 :Param()
32{ 34{
33} 35}
34 36
35TelParam::TelParam(const TelParam & x) 37TelParam::TelParam(const TelParam & x)
36 :Param(x) 38 :Param(x)
37{ 39{
38} 40}
39 41
40TelParam::TelParam(const QCString & s) 42TelParam::TelParam(const Q3CString & s)
41 :Param(s) 43 :Param(s)
42{ 44{
43} 45}
44 46
45 TelParam & 47 TelParam &
46TelParam::operator = (TelParam & x) 48TelParam::operator = (TelParam & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Param::operator = (x); 52 Param::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 TelParam & 56 TelParam &
55TelParam::operator = (const QCString & s) 57TelParam::operator = (const Q3CString & s)
56{ 58{
57 Param::operator = (s); 59 Param::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62TelParam::operator == (TelParam & x) 64TelParam::operator == (TelParam & x)
63{ 65{
64 x.parse(); 66 x.parse();
65 return false; 67 return false;
66} 68}
67 69
diff --git a/kabc/vcard/TelValue.cpp b/kabc/vcard/TelValue.cpp
index 349f99a..d9cbf3e 100644
--- a/kabc/vcard/TelValue.cpp
+++ b/kabc/vcard/TelValue.cpp
@@ -15,53 +15,55 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardTelValue.h> 24#include <VCardTelValue.h>
25 25
26#include <VCardValue.h> 26#include <VCardValue.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30TelValue::TelValue() 32TelValue::TelValue()
31 :Value() 33 :Value()
32{ 34{
33} 35}
34 36
35TelValue::TelValue(const TelValue & x) 37TelValue::TelValue(const TelValue & x)
36 :Value(x) 38 :Value(x)
37{ 39{
38} 40}
39 41
40TelValue::TelValue(const QCString & s) 42TelValue::TelValue(const Q3CString & s)
41 :Value(s) 43 :Value(s)
42{ 44{
43} 45}
44 46
45 TelValue & 47 TelValue &
46TelValue::operator = (TelValue & x) 48TelValue::operator = (TelValue & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Value::operator = (x); 52 Value::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 TelValue & 56 TelValue &
55TelValue::operator = (const QCString & s) 57TelValue::operator = (const Q3CString & s)
56{ 58{
57 Value::operator = (s); 59 Value::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62TelValue::operator == (TelValue & x) 64TelValue::operator == (TelValue & x)
63{ 65{
64 x.parse(); 66 x.parse();
65 return false; 67 return false;
66} 68}
67 69
diff --git a/kabc/vcard/TextBinParam.cpp b/kabc/vcard/TextBinParam.cpp
index 66f2946..2866c12 100644
--- a/kabc/vcard/TextBinParam.cpp
+++ b/kabc/vcard/TextBinParam.cpp
@@ -15,53 +15,55 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardTextBinParam.h> 24#include <VCardTextBinParam.h>
25 25
26#include <VCardParam.h> 26#include <VCardParam.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30TextBinParam::TextBinParam() 32TextBinParam::TextBinParam()
31 :Param() 33 :Param()
32{ 34{
33} 35}
34 36
35TextBinParam::TextBinParam(const TextBinParam & x) 37TextBinParam::TextBinParam(const TextBinParam & x)
36 :Param(x) 38 :Param(x)
37{ 39{
38} 40}
39 41
40TextBinParam::TextBinParam(const QCString & s) 42TextBinParam::TextBinParam(const Q3CString & s)
41 :Param(s) 43 :Param(s)
42{ 44{
43} 45}
44 46
45 TextBinParam & 47 TextBinParam &
46TextBinParam::operator = (TextBinParam & x) 48TextBinParam::operator = (TextBinParam & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Param::operator = (x); 52 Param::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 TextBinParam & 56 TextBinParam &
55TextBinParam::operator = (const QCString & s) 57TextBinParam::operator = (const Q3CString & s)
56{ 58{
57 Param::operator = (s); 59 Param::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62TextBinParam::operator == (TextBinParam & x) 64TextBinParam::operator == (TextBinParam & x)
63{ 65{
64 x.parse(); 66 x.parse();
65 return false; 67 return false;
66} 68}
67 69
diff --git a/kabc/vcard/TextBinValue.cpp b/kabc/vcard/TextBinValue.cpp
index c584009..a3a96ae 100644
--- a/kabc/vcard/TextBinValue.cpp
+++ b/kabc/vcard/TextBinValue.cpp
@@ -16,60 +16,62 @@
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <kmdcodec.h> 24#include <kmdcodec.h>
25 25
26#include <VCardTextBinValue.h> 26#include <VCardTextBinValue.h>
27#include <VCardValue.h> 27#include <VCardValue.h>
28//Added by qt3to4:
29#include <Q3CString>
28 30
29using namespace VCARD; 31using namespace VCARD;
30 32
31TextBinValue::TextBinValue() 33TextBinValue::TextBinValue()
32 :Value() 34 :Value()
33{ 35{
34} 36}
35 37
36TextBinValue::TextBinValue(const TextBinValue & x) 38TextBinValue::TextBinValue(const TextBinValue & x)
37 :Value(x) 39 :Value(x)
38{ 40{
39 mIsBinary_ = x.mIsBinary_; 41 mIsBinary_ = x.mIsBinary_;
40 mData_ = x.mData_; 42 mData_ = x.mData_;
41 mUrl_ = x.mUrl_; 43 mUrl_ = x.mUrl_;
42} 44}
43 45
44TextBinValue::TextBinValue(const QCString & s) 46TextBinValue::TextBinValue(const Q3CString & s)
45 :Value(s) 47 :Value(s)
46{ 48{
47} 49}
48 50
49 TextBinValue & 51 TextBinValue &
50TextBinValue::operator = (TextBinValue & x) 52TextBinValue::operator = (TextBinValue & x)
51{ 53{
52 if (*this == x) return *this; 54 if (*this == x) return *this;
53 55
54 mIsBinary_ = x.mIsBinary_; 56 mIsBinary_ = x.mIsBinary_;
55 mData_ = x.mData_; 57 mData_ = x.mData_;
56 mUrl_ = x.mUrl_; 58 mUrl_ = x.mUrl_;
57 59
58 Value::operator = (x); 60 Value::operator = (x);
59 return *this; 61 return *this;
60} 62}
61 63
62 TextBinValue & 64 TextBinValue &
63TextBinValue::operator = (const QCString & s) 65TextBinValue::operator = (const Q3CString & s)
64{ 66{
65 Value::operator = (s); 67 Value::operator = (s);
66 return *this; 68 return *this;
67} 69}
68 70
69 bool 71 bool
70TextBinValue::operator == (TextBinValue & x) 72TextBinValue::operator == (TextBinValue & x)
71{ 73{
72 x.parse(); 74 x.parse();
73 75
74 if ( mIsBinary_ != x.mIsBinary_ ) return false; 76 if ( mIsBinary_ != x.mIsBinary_ ) return false;
75 if ( mData_ != x.mData_ ) return false; 77 if ( mData_ != x.mData_ ) return false;
diff --git a/kabc/vcard/TextListValue.cpp b/kabc/vcard/TextListValue.cpp
index c4ac1e3..919f4f7 100644
--- a/kabc/vcard/TextListValue.cpp
+++ b/kabc/vcard/TextListValue.cpp
@@ -17,53 +17,55 @@
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardRToken.h> 24#include <VCardRToken.h>
25 25
26#include <VCardTextListValue.h> 26#include <VCardTextListValue.h>
27 27
28#include <VCardValue.h> 28#include <VCardValue.h>
29//Added by qt3to4:
30#include <Q3CString>
29 31
30using namespace VCARD; 32using namespace VCARD;
31 33
32TextListValue::TextListValue() 34TextListValue::TextListValue()
33 :Value() 35 :Value()
34{ 36{
35} 37}
36 38
37TextListValue::TextListValue(const TextListValue & x) 39TextListValue::TextListValue(const TextListValue & x)
38 :Value(x) 40 :Value(x)
39{ 41{
40} 42}
41 43
42TextListValue::TextListValue(const QCString & s) 44TextListValue::TextListValue(const Q3CString & s)
43 :Value(s) 45 :Value(s)
44{ 46{
45} 47}
46 48
47 TextListValue & 49 TextListValue &
48TextListValue::operator = (TextListValue & x) 50TextListValue::operator = (TextListValue & x)
49{ 51{
50 if (*this == x) return *this; 52 if (*this == x) return *this;
51 53
52 Value::operator = (x); 54 Value::operator = (x);
53 return *this; 55 return *this;
54} 56}
55 57
56 TextListValue & 58 TextListValue &
57TextListValue::operator = (const QCString & s) 59TextListValue::operator = (const Q3CString & s)
58{ 60{
59 Value::operator = (s); 61 Value::operator = (s);
60 return *this; 62 return *this;
61} 63}
62 64
63 bool 65 bool
64TextListValue::operator == (TextListValue & x) 66TextListValue::operator == (TextListValue & x)
65{ 67{
66 x.parse(); 68 x.parse();
67 return false; 69 return false;
68} 70}
69 71
@@ -73,35 +75,35 @@ TextListValue::~TextListValue()
73 75
74 void 76 void
75TextListValue::_parse() 77TextListValue::_parse()
76{ 78{
77 RTokenise(strRep_, ";", valueList_); 79 RTokenise(strRep_, ";", valueList_);
78} 80}
79 81
80 void 82 void
81TextListValue::_assemble() 83TextListValue::_assemble()
82{ 84{
83 bool first(true); 85 bool first(true);
84 86
85 QStrListIterator it(valueList_); 87 Q3StrListIterator it(valueList_);
86 88
87 for (; it.current(); ++it) { 89 for (; it.current(); ++it) {
88 if (!first) strRep_ += ';'; 90 if (!first) strRep_ += ';';
89 strRep_ += it.current(); 91 strRep_ += it.current();
90 first = false; 92 first = false;
91 } 93 }
92} 94}
93 95
94 unsigned int 96 unsigned int
95TextListValue::numValues() 97TextListValue::numValues()
96{ 98{
97 parse(); 99 parse();
98 return valueList_.count(); 100 return valueList_.count();
99} 101}
100 102
101 QCString 103 Q3CString
102TextListValue::value(unsigned int i) 104TextListValue::value(unsigned int i)
103{ 105{
104 parse(); 106 parse();
105 return valueList_.at(i); 107 return valueList_.at(i);
106} 108}
107 109
diff --git a/kabc/vcard/TextParam.cpp b/kabc/vcard/TextParam.cpp
index 7c68700..ce6661f 100644
--- a/kabc/vcard/TextParam.cpp
+++ b/kabc/vcard/TextParam.cpp
@@ -15,53 +15,55 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardTextParam.h> 24#include <VCardTextParam.h>
25 25
26#include <VCardParam.h> 26#include <VCardParam.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30TextParam::TextParam() 32TextParam::TextParam()
31 :Param() 33 :Param()
32{ 34{
33} 35}
34 36
35TextParam::TextParam(const TextParam & x) 37TextParam::TextParam(const TextParam & x)
36 :Param(x) 38 :Param(x)
37{ 39{
38} 40}
39 41
40TextParam::TextParam(const QCString & s) 42TextParam::TextParam(const Q3CString & s)
41 :Param(s) 43 :Param(s)
42{ 44{
43} 45}
44 46
45 TextParam & 47 TextParam &
46TextParam::operator = (TextParam & x) 48TextParam::operator = (TextParam & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Param::operator = (x); 52 Param::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 TextParam & 56 TextParam &
55TextParam::operator = (const QCString & s) 57TextParam::operator = (const Q3CString & s)
56{ 58{
57 Param::operator = (s); 59 Param::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62TextParam::operator == (TextParam & x) 64TextParam::operator == (TextParam & x)
63{ 65{
64 x.parse(); 66 x.parse();
65 67
66 return false; 68 return false;
67} 69}
diff --git a/kabc/vcard/TextValue.cpp b/kabc/vcard/TextValue.cpp
index 09934fa..d0d2996 100644
--- a/kabc/vcard/TextValue.cpp
+++ b/kabc/vcard/TextValue.cpp
@@ -15,62 +15,64 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardTextValue.h> 24#include <VCardTextValue.h>
25 25
26#include <VCardValue.h> 26#include <VCardValue.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30TextValue::TextValue() 32TextValue::TextValue()
31 :Value() 33 :Value()
32{ 34{
33} 35}
34 36
35TextValue::TextValue(const TextValue & x) 37TextValue::TextValue(const TextValue & x)
36 :Value(x) 38 :Value(x)
37{ 39{
38} 40}
39 41
40TextValue::TextValue(const QCString & s) 42TextValue::TextValue(const Q3CString & s)
41 :Value(s) 43 :Value(s)
42{ 44{
43} 45}
44 46
45 TextValue & 47 TextValue &
46TextValue::operator = (TextValue & x) 48TextValue::operator = (TextValue & x)
47{ 49{
48 if (*this == x) return *this; 50 if (*this == x) return *this;
49 51
50 Value::operator = (x); 52 Value::operator = (x);
51 return *this; 53 return *this;
52} 54}
53 55
54 TextValue & 56 TextValue &
55TextValue::operator = (const QCString & s) 57TextValue::operator = (const Q3CString & s)
56{ 58{
57 Value::operator = (s); 59 Value::operator = (s);
58 return *this; 60 return *this;
59} 61}
60 62
61 bool 63 bool
62TextValue::operator == (TextValue & x) 64TextValue::operator == (TextValue & x)
63{ 65{
64 return strRep_ = x.strRep_; 66 return strRep_ == x.strRep_;
65} 67}
66 68
67TextValue::~TextValue() 69TextValue::~TextValue()
68{ 70{
69} 71}
70 72
71 TextValue * 73 TextValue *
72TextValue::clone() 74TextValue::clone()
73{ 75{
74 return new TextValue( *this ); 76 return new TextValue( *this );
75} 77}
76 78
diff --git a/kabc/vcard/URIValue.cpp b/kabc/vcard/URIValue.cpp
index c1d1022..26da7f4 100644
--- a/kabc/vcard/URIValue.cpp
+++ b/kabc/vcard/URIValue.cpp
@@ -15,66 +15,68 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardURIValue.h> 24#include <VCardURIValue.h>
25 25
26#include <VCardValue.h> 26#include <VCardValue.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30URIValue::URIValue() 32URIValue::URIValue()
31 :Value() 33 :Value()
32{ 34{
33} 35}
34 36
35URIValue::URIValue(const QCString & scheme, const QCString & schemeSpecificPart) 37URIValue::URIValue(const Q3CString & scheme, const Q3CString & schemeSpecificPart)
36 :Value(), 38 :Value(),
37 scheme_ (scheme), 39 scheme_ (scheme),
38 schemeSpecificPart_(schemeSpecificPart) 40 schemeSpecificPart_(schemeSpecificPart)
39{ 41{
40 parsed_ = true; 42 parsed_ = true;
41} 43}
42 44
43URIValue::URIValue(const URIValue & x) 45URIValue::URIValue(const URIValue & x)
44 : Value (x), 46 : Value (x),
45 scheme_ (x.scheme_), 47 scheme_ (x.scheme_),
46 schemeSpecificPart_(x.schemeSpecificPart_) 48 schemeSpecificPart_(x.schemeSpecificPart_)
47{ 49{
48} 50}
49 51
50URIValue::URIValue(const QCString & s) 52URIValue::URIValue(const Q3CString & s)
51 :Value(s) 53 :Value(s)
52{ 54{
53} 55}
54 56
55 URIValue & 57 URIValue &
56URIValue::operator = (URIValue & x) 58URIValue::operator = (URIValue & x)
57{ 59{
58 if (*this == x) return *this; 60 if (*this == x) return *this;
59 61
60 scheme_ = x.scheme_; 62 scheme_ = x.scheme_;
61 schemeSpecificPart_= x.schemeSpecificPart_; 63 schemeSpecificPart_= x.schemeSpecificPart_;
62 64
63 Value::operator = (x); 65 Value::operator = (x);
64 return *this; 66 return *this;
65} 67}
66 68
67 URIValue & 69 URIValue &
68URIValue::operator = (const QCString & s) 70URIValue::operator = (const Q3CString & s)
69{ 71{
70 Value::operator = (s); 72 Value::operator = (s);
71 return *this; 73 return *this;
72} 74}
73 75
74 bool 76 bool
75URIValue::operator == (URIValue & x) 77URIValue::operator == (URIValue & x)
76{ 78{
77 x.parse(); 79 x.parse();
78 return ( 80 return (
79 (scheme_ == x.scheme_) && 81 (scheme_ == x.scheme_) &&
80 (schemeSpecificPart_== x.schemeSpecificPart_)); 82 (schemeSpecificPart_== x.schemeSpecificPart_));
@@ -94,40 +96,40 @@ URIValue::_parse()
94 return; 96 return;
95 97
96 scheme_ = strRep_.left(split); 98 scheme_ = strRep_.left(split);
97 schemeSpecificPart_ = strRep_.mid(split + 1); 99 schemeSpecificPart_ = strRep_.mid(split + 1);
98} 100}
99 101
100 void 102 void
101URIValue::_assemble() 103URIValue::_assemble()
102{ 104{
103 strRep_ = scheme_ + ':' + schemeSpecificPart_; 105 strRep_ = scheme_ + ':' + schemeSpecificPart_;
104} 106}
105 107
106 QCString 108 Q3CString
107URIValue::scheme() 109URIValue::scheme()
108{ 110{
109 parse(); 111 parse();
110 return scheme_; 112 return scheme_;
111} 113}
112 114
113 QCString 115 Q3CString
114URIValue::schemeSpecificPart() 116URIValue::schemeSpecificPart()
115{ 117{
116 parse(); 118 parse();
117 return schemeSpecificPart_; 119 return schemeSpecificPart_;
118} 120}
119 121
120 void 122 void
121URIValue::setScheme(const QCString & s) 123URIValue::setScheme(const Q3CString & s)
122{ 124{
123 parse(); 125 parse();
124 scheme_ = s; 126 scheme_ = s;
125} 127}
126 128
127 void 129 void
128URIValue::setSchemeSpecificPart(const QCString & s) 130URIValue::setSchemeSpecificPart(const Q3CString & s)
129{ 131{
130 parse(); 132 parse();
131 schemeSpecificPart_ = s; 133 schemeSpecificPart_ = s;
132} 134}
133 135
diff --git a/kabc/vcard/UTCValue.cpp b/kabc/vcard/UTCValue.cpp
index 374306c..f35d986 100644
--- a/kabc/vcard/UTCValue.cpp
+++ b/kabc/vcard/UTCValue.cpp
@@ -15,58 +15,60 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardUTCValue.h> 24#include <VCardUTCValue.h>
25 25
26#include <VCardValue.h> 26#include <VCardValue.h>
27//Added by qt3to4:
28#include <Q3CString>
27 29
28using namespace VCARD; 30using namespace VCARD;
29 31
30UTCValue::UTCValue() 32UTCValue::UTCValue()
31 :Value() 33 :Value()
32{ 34{
33} 35}
34 36
35UTCValue::UTCValue(const UTCValue & x) 37UTCValue::UTCValue(const UTCValue & x)
36 : Value(x),positive_(x.positive_), hour_(x.hour_), minute_(x.minute_) 38 : Value(x),positive_(x.positive_), hour_(x.hour_), minute_(x.minute_)
37 39
38{ 40{
39} 41}
40 42
41UTCValue::UTCValue(const QCString & s) 43UTCValue::UTCValue(const Q3CString & s)
42 :Value(s) 44 :Value(s)
43{ 45{
44} 46}
45 47
46 UTCValue & 48 UTCValue &
47UTCValue::operator = (UTCValue & x) 49UTCValue::operator = (UTCValue & x)
48{ 50{
49 if (*this == x) return *this; 51 if (*this == x) return *this;
50 52
51 positive_ = x.positive_; 53 positive_ = x.positive_;
52 hour_ = x.hour_; 54 hour_ = x.hour_;
53 minute_ = x.minute_; 55 minute_ = x.minute_;
54 56
55 Value::operator = (x); 57 Value::operator = (x);
56 return *this; 58 return *this;
57} 59}
58 60
59 UTCValue & 61 UTCValue &
60UTCValue::operator = (const QCString & s) 62UTCValue::operator = (const Q3CString & s)
61{ 63{
62 Value::operator = (s); 64 Value::operator = (s);
63 return *this; 65 return *this;
64} 66}
65 67
66 bool 68 bool
67UTCValue::operator == (UTCValue & x) 69UTCValue::operator == (UTCValue & x)
68{ 70{
69 x.parse(); 71 x.parse();
70 72
71 if (positive_ != x.positive_) return false; 73 if (positive_ != x.positive_) return false;
72 if (hour_ != x.hour_) return false; 74 if (hour_ != x.hour_) return false;
diff --git a/kabc/vcard/VCardEntity.cpp b/kabc/vcard/VCardEntity.cpp
index a2ff327..bae5385 100644
--- a/kabc/vcard/VCardEntity.cpp
+++ b/kabc/vcard/VCardEntity.cpp
@@ -14,59 +14,61 @@
14 all copies or substantial portions of the Software. 14 all copies or substantial portions of the Software.
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <qregexp.h> 24#include <qregexp.h>
25#include <qdatetime.h> 25#include <qdatetime.h>
26//Added by qt3to4:
27#include <Q3CString>
26 28
27#include <VCardDefines.h> 29#include <VCardDefines.h>
28#include <VCardVCardEntity.h> 30#include <VCardVCardEntity.h>
29 31
30using namespace VCARD; 32using namespace VCARD;
31 33
32VCardEntity::VCardEntity() 34VCardEntity::VCardEntity()
33 :Entity() 35 :Entity()
34{ 36{
35 cardList_.setAutoDelete( TRUE ); 37 cardList_.setAutoDelete( TRUE );
36} 38}
37 39
38VCardEntity::VCardEntity(const VCardEntity & x) 40VCardEntity::VCardEntity(const VCardEntity & x)
39 :Entity(x) 41 :Entity(x)
40{ 42{
41 cardList_.setAutoDelete( TRUE ); 43 cardList_.setAutoDelete( TRUE );
42} 44}
43 45
44VCardEntity::VCardEntity(const QCString & s) 46VCardEntity::VCardEntity(const Q3CString & s)
45 :Entity(s) 47 :Entity(s)
46{ 48{
47 cardList_.setAutoDelete( TRUE ); 49 cardList_.setAutoDelete( TRUE );
48} 50}
49 51
50 VCardEntity & 52 VCardEntity &
51VCardEntity::operator = (VCardEntity & x) 53VCardEntity::operator = (VCardEntity & x)
52{ 54{
53 if (*this == x) return *this; 55 if (*this == x) return *this;
54 56
55 Entity::operator = (x); 57 Entity::operator = (x);
56 return *this; 58 return *this;
57} 59}
58 60
59 VCardEntity & 61 VCardEntity &
60VCardEntity::operator = (const QCString & s) 62VCardEntity::operator = (const Q3CString & s)
61{ 63{
62 Entity::operator = (s); 64 Entity::operator = (s);
63 return *this; 65 return *this;
64} 66}
65 67
66 bool 68 bool
67VCardEntity::operator == (VCardEntity & x) 69VCardEntity::operator == (VCardEntity & x)
68{ 70{
69 x.parse(); 71 x.parse();
70 return false; 72 return false;
71} 73}
72 74
@@ -74,33 +76,33 @@ VCardEntity::~VCardEntity()
74{ 76{
75} 77}
76 78
77 void 79 void
78VCardEntity::_parse() 80VCardEntity::_parse()
79{ 81{
80#if 0 82#if 0
81 QTime tim; 83 QTime tim;
82 tim.start(); 84 tim.start();
83 int num = 0; 85 int num = 0;
84 // old code 86 // old code
85 vDebug("parse"); 87 vDebug("parse");
86 QCString s(strRep_); 88 Q3CString s(strRep_);
87 89
88 int i = s.find(QRegExp("BEGIN:VCARD", false)); 90 int i = s.find(QRegExp("BEGIN:VCARD", false));
89 91
90 while (i != -1) { 92 while (i != -1) {
91 93
92 i = s.find(QRegExp("BEGIN:VCARD", false), 11); 94 i = s.find(QRegExp("BEGIN:VCARD", false), 11);
93 95
94 QCString cardStr(s.left(i)); 96 Q3CString cardStr(s.left(i));
95 97
96 VCard * v = new VCard(cardStr); 98 VCard * v = new VCard(cardStr);
97 99
98 cardList_.append(v); 100 cardList_.append(v);
99 101
100 v->parse(); 102 v->parse();
101 103
102 s.remove(0, i); 104 s.remove(0, i);
103 } 105 }
104 106
105#else 107#else
106 // this code is up to 17 (!) times faster 108 // this code is up to 17 (!) times faster
@@ -123,25 +125,25 @@ VCardEntity::_parse()
123 if ( i+add < len && strRep_.at(i+add++) == 'C') 125 if ( i+add < len && strRep_.at(i+add++) == 'C')
124 if ( i+add < len && strRep_.at(i+add++) == 'A') 126 if ( i+add < len && strRep_.at(i+add++) == 'A')
125 if ( i+add < len && strRep_.at(i+add++) == 'R') 127 if ( i+add < len && strRep_.at(i+add++) == 'R')
126 if ( i+add < len && strRep_.at(i+add++) == 'D') 128 if ( i+add < len && strRep_.at(i+add++) == 'D')
127 if ( i+add < len && (strRep_.at(i+add) == '\r' || strRep_.at(i+add) == '\n' )) 129 if ( i+add < len && (strRep_.at(i+add) == '\r' || strRep_.at(i+add) == '\n' ))
128 break; 130 break;
129 } 131 }
130 ++i; 132 ++i;
131 } 133 }
132 if ( i <= len ) { 134 if ( i <= len ) {
133 ++num; 135 ++num;
134 char* dat = strRep_.data()+start; 136 char* dat = strRep_.data()+start;
135 VCard * v = new VCard( QCString ( dat,i-start ) ); 137 VCard * v = new VCard( Q3CString ( dat,i-start ) );
136 start = i; 138 start = i;
137 cardList_.append(v); 139 cardList_.append(v);
138 v->parse(); 140 v->parse();
139 } 141 }
140 i+= 11; 142 i+= 11;
141 } 143 }
142#endif 144#endif
143 //qDebug("***time %d found %d", tim.elapsed(), num); 145 //qDebug("***time %d found %d", tim.elapsed(), num);
144} 146}
145 147
146 void 148 void
147VCardEntity::_assemble() 149VCardEntity::_assemble()
diff --git a/kabc/vcard/VCardv.cpp b/kabc/vcard/VCardv.cpp
index bad2ef1..5dd675d 100644
--- a/kabc/vcard/VCardv.cpp
+++ b/kabc/vcard/VCardv.cpp
@@ -12,113 +12,114 @@
12 12
13 The above copyright notice and this permission notice shall be included in 13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software. 14 all copies or substantial portions of the Software.
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <qcstring.h> 24#include <q3cstring.h>
25#include <qstrlist.h> 25#include <q3strlist.h>
26#include <qstringlist.h> 26#include <qstringlist.h>
27#include <qstring.h> 27#include <qstring.h>
28#include <qvaluelist.h> 28#include <q3valuelist.h>
29 29
30#include <VCardEntity.h> 30#include <VCardEntity.h>
31#include <VCardVCard.h> 31#include <VCardVCard.h>
32#include <VCardContentLine.h> 32#include <VCardContentLine.h>
33#include <VCardRToken.h> 33#include <VCardRToken.h>
34 34
35#include <VCardDefines.h> 35#include <VCardDefines.h>
36 36
37using namespace VCARD; 37using namespace VCARD;
38 38
39VCard::VCard() 39VCard::VCard()
40 :Entity() 40 :Entity()
41{ 41{
42 contentLineList_.setAutoDelete( TRUE ); 42 contentLineList_.setAutoDelete( TRUE );
43} 43}
44 44
45VCard::VCard(const VCard & x) 45VCard::VCard(const VCard & x)
46 :Entity(x), 46 :Entity(x),
47 group_(x.group_) 47 group_(x.group_)
48{ 48{
49 contentLineList_.setAutoDelete( TRUE ); 49 contentLineList_.setAutoDelete( TRUE );
50 50
51 QPtrListIterator<ContentLine> it(x.contentLineList_); 51 Q3PtrListIterator<ContentLine> it(x.contentLineList_);
52 for (; it.current(); ++it) { 52 for (; it.current(); ++it) {
53 ContentLine * c = new ContentLine(*it.current()); 53 ContentLine * c = new ContentLine(*it.current());
54 contentLineList_.append(c); 54 contentLineList_.append(c);
55 } 55 }
56 56
57} 57}
58 58
59VCard::VCard(const QCString & s) 59VCard::VCard(const Q3CString & s)
60 :Entity(s) 60 :Entity(s)
61{ 61{
62 contentLineList_.setAutoDelete( TRUE ); 62 contentLineList_.setAutoDelete( TRUE );
63} 63}
64 64
65 VCard & 65 VCard &
66VCard::operator = (VCard & x) 66VCard::operator = (VCard & x)
67{ 67{
68 if (*this == x) return *this; 68 if (*this == x) return *this;
69 69
70 group_ = x.group(); 70 group_ = x.group();
71 QPtrListIterator<ContentLine> it(x.contentLineList_); 71 Q3PtrListIterator<ContentLine> it(x.contentLineList_);
72 for (; it.current(); ++it) { 72 for (; it.current(); ++it) {
73 ContentLine * c = new ContentLine(*it.current()); 73 ContentLine * c = new ContentLine(*it.current());
74 contentLineList_.append(c); 74 contentLineList_.append(c);
75 } 75 }
76 76
77 Entity::operator = (x); 77 Entity::operator = (x);
78 return *this; 78 return *this;
79} 79}
80 80
81 VCard & 81 VCard &
82VCard::operator = (const QCString & s) 82VCard::operator = (const Q3CString & s)
83{ 83{
84 Entity::operator = (s); 84 Entity::operator = (s);
85 return *this; 85 return *this;
86} 86}
87 87
88 bool 88 bool
89VCard::operator == (VCard & x) 89VCard::operator == (VCard & x)
90{ 90{
91 x.parse(); 91 x.parse();
92 return false; 92 return false;
93} 93}
94 94
95VCard::~VCard() 95VCard::~VCard()
96{ 96{
97} 97}
98 98
99 void 99 void
100VCard::_parse() 100VCard::_parse()
101{ 101{
102 102
103 QStringList l; 103 QStringList l;
104 QStrList sl; 104 Q3StrList sl;
105 105
106 RTokenise(strRep_, "\r\n", sl); 106 RTokenise(strRep_, "\r\n", sl);
107 107
108 if (sl.count() < 3) { // Invalid VCARD ! 108 if (sl.count() < 3) { // Invalid VCARD !
109 //qDebug("invalid vcard "); 109 //qDebug("invalid vcard ");
110 return; 110 return;
111 } 111 }
112 l = QStringList::fromStrList( sl ); 112 for(Q3StrList::iterator i=sl.begin();i!=sl.end();++i)
113 l.push_back(*i);
113 // Get the first line 114 // Get the first line
114 QString beginLine = l[0].stripWhiteSpace(); 115 QString beginLine = l[0].stripWhiteSpace();
115 116
116 // Remove extra blank lines 117 // Remove extra blank lines
117 while (l.last().isEmpty()) 118 while (l.last().isEmpty())
118 l.remove(l.last()); 119 l.remove(l.last());
119 120
120 // Now we know this is the last line 121 // Now we know this is the last line
121 QString endLine = l.last(); 122 QString endLine = l.last();
122 123
123 // Trash the first and last lines as we have seen them. 124 // Trash the first and last lines as we have seen them.
124 l.remove(l.begin()); 125 l.remove(l.begin());
@@ -171,25 +172,25 @@ VCard::_parse()
171 for (; it != l.end(); ++it) { 172 for (; it != l.end(); ++it) {
172 cur = (*it); 173 cur = (*it);
173 ++it; 174 ++it;
174 while ( it!= l.end() && (*it).at(0) == ' '&& (*it).length()!= 1) { 175 while ( it!= l.end() && (*it).at(0) == ' '&& (*it).length()!= 1) {
175 cur += (*it).mid(1) ; 176 cur += (*it).mid(1) ;
176 ++it; 177 ++it;
177 } 178 }
178 --it; 179 --it;
179 refolded.append(cur); 180 refolded.append(cur);
180 } 181 }
181 QStringList::Iterator it2 = refolded.begin(); 182 QStringList::Iterator it2 = refolded.begin();
182 for (; it2 != refolded.end(); ++it2) { 183 for (; it2 != refolded.end(); ++it2) {
183 ContentLine * cl = new ContentLine(QCString((*it2).latin1())); 184 ContentLine * cl = new ContentLine(Q3CString((*it2).latin1()));
184 cl->parse(); 185 cl->parse();
185 if (cl->value() == 0) 186 if (cl->value() == 0)
186 { 187 {
187 qDebug("Content line could not be parsed. Discarded: %s", (*it2).latin1()); 188 qDebug("Content line could not be parsed. Discarded: %s", (*it2).latin1());
188 delete cl; 189 delete cl;
189 } 190 }
190 else 191 else
191 contentLineList_.append(cl); 192 contentLineList_.append(cl);
192 } 193 }
193 194
194 /////////////////////////////////////////////////////////////// 195 ///////////////////////////////////////////////////////////////
195 // LAST LINE 196 // LAST LINE
@@ -219,76 +220,76 @@ VCard::_parse()
219 if (qstricmp(valuePart, "VCARD") != 0) // Not a vcard ! 220 if (qstricmp(valuePart, "VCARD") != 0) // Not a vcard !
220 return; 221 return;
221#endif 222#endif
222} 223}
223 224
224 void 225 void
225VCard::_assemble() 226VCard::_assemble()
226{ 227{
227 vDebug("Assembling vcard"); 228 vDebug("Assembling vcard");
228 strRep_ = "BEGIN:VCARD\r\n"; 229 strRep_ = "BEGIN:VCARD\r\n";
229 strRep_ += "VERSION:3.0\r\n"; 230 strRep_ += "VERSION:3.0\r\n";
230 231
231 QPtrListIterator<ContentLine> it(contentLineList_); 232 Q3PtrListIterator<ContentLine> it(contentLineList_);
232 233
233 for (; it.current(); ++it) 234 for (; it.current(); ++it)
234 strRep_ += it.current()->asString() + "\r\n"; 235 strRep_ += it.current()->asString() + "\r\n";
235 236
236 strRep_ += "END:VCARD\r\n"; 237 strRep_ += "END:VCARD\r\n";
237} 238}
238 239
239 bool 240 bool
240VCard::has(EntityType t) 241VCard::has(EntityType t)
241{ 242{
242 parse(); 243 parse();
243 return contentLine(t) == 0 ? false : true; 244 return contentLine(t) == 0 ? false : true;
244} 245}
245 246
246 bool 247 bool
247VCard::has(const QCString & s) 248VCard::has(const Q3CString & s)
248{ 249{
249 parse(); 250 parse();
250 return contentLine(s) == 0 ? false : true; 251 return contentLine(s) == 0 ? false : true;
251} 252}
252 253
253 void 254 void
254VCard::add(const ContentLine & cl) 255VCard::add(const ContentLine & cl)
255{ 256{
256 parse(); 257 parse();
257 ContentLine * c = new ContentLine(cl); 258 ContentLine * c = new ContentLine(cl);
258 contentLineList_.append(c); 259 contentLineList_.append(c);
259} 260}
260 261
261 void 262 void
262VCard::add(const QCString & s) 263VCard::add(const Q3CString & s)
263{ 264{
264 parse(); 265 parse();
265 ContentLine * c = new ContentLine(s); 266 ContentLine * c = new ContentLine(s);
266 contentLineList_.append(c); 267 contentLineList_.append(c);
267} 268}
268 269
269 ContentLine * 270 ContentLine *
270VCard::contentLine(EntityType t) 271VCard::contentLine(EntityType t)
271{ 272{
272 parse(); 273 parse();
273 QPtrListIterator<ContentLine> it(contentLineList_); 274 Q3PtrListIterator<ContentLine> it(contentLineList_);
274 275
275 for (; it.current(); ++it) 276 for (; it.current(); ++it)
276 if (it.current()->entityType() == t) 277 if (it.current()->entityType() == t)
277 return it.current(); 278 return it.current();
278 279
279 return 0; 280 return 0;
280} 281}
281 282
282 ContentLine * 283 ContentLine *
283VCard::contentLine(const QCString & s) 284VCard::contentLine(const Q3CString & s)
284{ 285{
285 parse(); 286 parse();
286 QPtrListIterator<ContentLine> it(contentLineList_); 287 Q3PtrListIterator<ContentLine> it(contentLineList_);
287 288
288 for (; it.current(); ++it) 289 for (; it.current(); ++it)
289 if (it.current()->entityType() == EntityNameToEntityType(s)) 290 if (it.current()->entityType() == EntityNameToEntityType(s))
290 return it.current(); 291 return it.current();
291 292
292 return 0; 293 return 0;
293} 294}
294 295
diff --git a/kabc/vcard/Value.cpp b/kabc/vcard/Value.cpp
index 1978af2..3a4d406 100644
--- a/kabc/vcard/Value.cpp
+++ b/kabc/vcard/Value.cpp
@@ -14,53 +14,55 @@
14 all copies or substantial portions of the Software. 14 all copies or substantial portions of the Software.
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardEntity.h> 24#include <VCardEntity.h>
25#include <VCardValue.h> 25#include <VCardValue.h>
26//Added by qt3to4:
27#include <Q3CString>
26 28
27using namespace VCARD; 29using namespace VCARD;
28 30
29Value::Value() 31Value::Value()
30 :Entity() 32 :Entity()
31{ 33{
32} 34}
33 35
34Value::Value(const Value & x) 36Value::Value(const Value & x)
35 :Entity(x) 37 :Entity(x)
36{ 38{
37} 39}
38 40
39Value::Value(const QCString & s) 41Value::Value(const Q3CString & s)
40 :Entity(s) 42 :Entity(s)
41{ 43{
42} 44}
43 45
44 Value & 46 Value &
45Value::operator = (Value & x) 47Value::operator = (Value & x)
46{ 48{
47 if (*this == x) return *this; 49 if (*this == x) return *this;
48 50
49 Entity::operator = (x); 51 Entity::operator = (x);
50 return *this; 52 return *this;
51} 53}
52 54
53 Value & 55 Value &
54Value::operator = (const QCString & s) 56Value::operator = (const Q3CString & s)
55{ 57{
56 Entity::operator = (s); 58 Entity::operator = (s);
57 return *this; 59 return *this;
58} 60}
59 61
60 bool 62 bool
61Value::operator == (Value & x) 63Value::operator == (Value & x)
62{ 64{
63 x.parse(); 65 x.parse();
64 return false; 66 return false;
65} 67}
66 68
diff --git a/kabc/vcard/include/VCardAdrParam.h b/kabc/vcard/include/VCardAdrParam.h
index 89dcb64..6456624 100644
--- a/kabc/vcard/include/VCardAdrParam.h
+++ b/kabc/vcard/include/VCardAdrParam.h
@@ -15,50 +15,50 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef ADRPARAM_H 24#ifndef ADRPARAM_H
25#define ADRPARAM_H 25#define ADRPARAM_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28#include <qstrlist.h> 28#include <q3strlist.h>
29 29
30#include <VCardParam.h> 30#include <VCardParam.h>
31 31
32namespace VCARD 32namespace VCARD
33{ 33{
34 34
35class AdrParam : public Param 35class AdrParam : public Param
36{ 36{
37 37
38#include "AdrParam-generated.h" 38#include "AdrParam-generated.h"
39 39
40 QStrList adrTypeList() 40 Q3StrList adrTypeList()
41 { parse(); return adrTypeList_; } 41 { parse(); return adrTypeList_; }
42 42
43 QCString textParam() 43 Q3CString textParam()
44 { parse(); return textParam_; } 44 { parse(); return textParam_; }
45 45
46 void setAdrTypeList(const QStrList & l) 46 void setAdrTypeList(const Q3StrList & l)
47 { adrTypeList_ = l; assembled_ = false; } 47 { adrTypeList_ = l; assembled_ = false; }
48 48
49 void setTextParam(const QCString & s) 49 void setTextParam(const Q3CString & s)
50 { textParam_ = s; assembled_ = false; } 50 { textParam_ = s; assembled_ = false; }
51 51
52 enum AdrType { 52 enum AdrType {
53 AdrDom, AdrIntl, AdrPostal, AdrParcel, AdrHome, AdrWork, AdrPref, 53 AdrDom, AdrIntl, AdrPostal, AdrParcel, AdrHome, AdrWork, AdrPref,
54 AdrIANA, AdrX 54 AdrIANA, AdrX
55 }; 55 };
56 56
57 private: 57 private:
58 58
59 QStrListadrTypeList_; 59 Q3StrListadrTypeList_;
60 QCStringtextParam_; 60 Q3CStringtextParam_;
61}; 61};
62} 62}
63 63
64#endif 64#endif
diff --git a/kabc/vcard/include/VCardAdrValue.h b/kabc/vcard/include/VCardAdrValue.h
index 0731924..14ddb02 100644
--- a/kabc/vcard/include/VCardAdrValue.h
+++ b/kabc/vcard/include/VCardAdrValue.h
@@ -15,69 +15,71 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef ADRVALUE_H 24#ifndef ADRVALUE_H
25#define ADRVALUE_H 25#define ADRVALUE_H
26 26
27#include <qstrlist.h> 27#include <q3strlist.h>
28//Added by qt3to4:
29#include <Q3CString>
28#include <VCardValue.h> 30#include <VCardValue.h>
29 31
30namespace VCARD 32namespace VCARD
31{ 33{
32 34
33class AdrValue : public Value 35class AdrValue : public Value
34{ 36{
35 37
36#include "AdrValue-generated.h" 38#include "AdrValue-generated.h"
37 39
38 AdrValue *clone(); 40 AdrValue *clone();
39 41
40 void setPOBox(const QCString & s) 42 void setPOBox(const Q3CString & s)
41 { poBox_ = s; assembled_ = false; } 43 { poBox_ = s; assembled_ = false; }
42 44
43 void setExtAddress(const QCString & s) 45 void setExtAddress(const Q3CString & s)
44 { extAddress_ = s; assembled_ = false; } 46 { extAddress_ = s; assembled_ = false; }
45 47
46 void setStreet(const QCString & s) 48 void setStreet(const Q3CString & s)
47 { street_ = s; assembled_ = false; } 49 { street_ = s; assembled_ = false; }
48 50
49 void setLocality(const QCString & s) 51 void setLocality(const Q3CString & s)
50 { locality_ = s; assembled_ = false; } 52 { locality_ = s; assembled_ = false; }
51 53
52 void setRegion(const QCString & s) 54 void setRegion(const Q3CString & s)
53 { region_ = s; assembled_ = false; } 55 { region_ = s; assembled_ = false; }
54 56
55 void setPostCode(const QCString & s) 57 void setPostCode(const Q3CString & s)
56 { postCode_ = s; assembled_ = false; } 58 { postCode_ = s; assembled_ = false; }
57 59
58 void setCountryName(const QCString & s) 60 void setCountryName(const Q3CString & s)
59 { countryName_ = s; assembled_ = false; } 61 { countryName_ = s; assembled_ = false; }
60 62
61 QCString poBox() { parse(); return poBox_;} 63 Q3CString poBox() { parse(); return poBox_;}
62 QCString extAddress() { parse(); return extAddress_;} 64 Q3CString extAddress() { parse(); return extAddress_;}
63 QCString street() { parse(); return street_;} 65 Q3CString street() { parse(); return street_;}
64 QCString locality() { parse(); return locality_;} 66 Q3CString locality() { parse(); return locality_;}
65 QCString region() { parse(); return region_;} 67 Q3CString region() { parse(); return region_;}
66 QCString postCode() { parse(); return postCode_;} 68 Q3CString postCode() { parse(); return postCode_;}
67 QCString countryName() { parse(); return countryName_;} 69 Q3CString countryName() { parse(); return countryName_;}
68 70
69 private: 71 private:
70 72
71 QCString poBox_; 73 Q3CString poBox_;
72 QCString extAddress_; 74 Q3CString extAddress_;
73 QCString street_; 75 Q3CString street_;
74 QCString locality_; 76 Q3CString locality_;
75 QCString region_; 77 Q3CString region_;
76 QCString postCode_; 78 Q3CString postCode_;
77 QCString countryName_; 79 Q3CString countryName_;
78}; 80};
79 81
80} 82}
81 83
82#endif 84#endif
83 85
diff --git a/kabc/vcard/include/VCardAgentParam.h b/kabc/vcard/include/VCardAgentParam.h
index 72a05db..5733540 100644
--- a/kabc/vcard/include/VCardAgentParam.h
+++ b/kabc/vcard/include/VCardAgentParam.h
@@ -15,46 +15,46 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef AGENTPARAM_H 24#ifndef AGENTPARAM_H
25#define AGENTPARAM_H 25#define AGENTPARAM_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardParam.h> 29#include <VCardParam.h>
30#include <VCardURIValue.h> 30#include <VCardURIValue.h>
31 31
32namespace VCARD 32namespace VCARD
33{ 33{
34 34
35class AgentParam : public Param 35class AgentParam : public Param
36{ 36{
37 37
38#include "AgentParam-generated.h" 38#include "AgentParam-generated.h"
39 39
40 bool refer() 40 bool refer()
41 { parse(); return refer_; } 41 { parse(); return refer_; }
42 42
43 URIValue uri() 43 URIValue uri()
44 { parse(); return uri_; } 44 { parse(); return uri_; }
45 45
46 void setRefer(bool b) 46 void setRefer(bool b)
47 { refer_ = b; assembled_ = false; } 47 { refer_ = b; assembled_ = false; }
48 48
49 void setURI(const QCString & s) 49 void setURI(const Q3CString & s)
50 { uri_ = s; assembled_ = false; } 50 { uri_ = s; assembled_ = false; }
51 51
52 private: 52 private:
53 53
54 bool refer_; 54 bool refer_;
55 URIValueuri_; 55 URIValueuri_;
56}; 56};
57 57
58} 58}
59 59
60#endif 60#endif
diff --git a/kabc/vcard/include/VCardAgentValue.h b/kabc/vcard/include/VCardAgentValue.h
index f655836..b0d883b 100644
--- a/kabc/vcard/include/VCardAgentValue.h
+++ b/kabc/vcard/include/VCardAgentValue.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef AGENTVALUE_H 24#ifndef AGENTVALUE_H
25#define AGENTVALUE_H 25#define AGENTVALUE_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardValue.h> 29#include <VCardValue.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class AgentValue : public Value 34class AgentValue : public Value
35{ 35{
36 36
37#include "AgentValue-generated.h" 37#include "AgentValue-generated.h"
38 38
39 private: 39 private:
diff --git a/kabc/vcard/include/VCardClassValue.h b/kabc/vcard/include/VCardClassValue.h
index ff133c2..c450169 100644
--- a/kabc/vcard/include/VCardClassValue.h
+++ b/kabc/vcard/include/VCardClassValue.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef CLASSVALUE_H 24#ifndef CLASSVALUE_H
25#define CLASSVALUE_H 25#define CLASSVALUE_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardValue.h> 29#include <VCardValue.h>
30 30
31#include <kdebug.h> 31#include <kdebug.h>
32 32
33namespace VCARD 33namespace VCARD
34{ 34{
35 35
36class ClassValue : public Value 36class ClassValue : public Value
37{ 37{
38 38
39#include "ClassValue-generated.h" 39#include "ClassValue-generated.h"
diff --git a/kabc/vcard/include/VCardContentLine.h b/kabc/vcard/include/VCardContentLine.h
index 1c5f5be..c3c5253 100644
--- a/kabc/vcard/include/VCardContentLine.h
+++ b/kabc/vcard/include/VCardContentLine.h
@@ -15,63 +15,65 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef CONTENTLINE_H 24#ifndef CONTENTLINE_H
25#define CONTENTLINE_H 25#define CONTENTLINE_H
26 26
27#include <qptrlist.h> 27#include <q3ptrlist.h>
28//Added by qt3to4:
29#include <Q3CString>
28 30
29#include "VCardEnum.h" 31#include "VCardEnum.h"
30#include "VCardEntity.h" 32#include "VCardEntity.h"
31#include "VCardParam.h" 33#include "VCardParam.h"
32#include "VCardValue.h" 34#include "VCardValue.h"
33 35
34namespace VCARD 36namespace VCARD
35{ 37{
36 38
37class ContentLine : public Entity 39class ContentLine : public Entity
38{ 40{
39 41
40#include "ContentLine-generated.h" 42#include "ContentLine-generated.h"
41 43
42 QCString group() { parse(); return group_;} 44 Q3CString group() { parse(); return group_;}
43 QCString name() { parse(); return name_;} 45 Q3CString name() { parse(); return name_;}
44 Value * value() { parse(); return value_;} 46 Value * value() { parse(); return value_;}
45 ParamList paramList() { parse(); return paramList_;} 47 ParamList paramList() { parse(); return paramList_;}
46 ParamType paramType() { parse(); return paramType_;} 48 ParamType paramType() { parse(); return paramType_;}
47 ValueType valueType() { parse(); return valueType_;} 49 ValueType valueType() { parse(); return valueType_;}
48 EntityType entityType() { parse(); return entityType_;} 50 EntityType entityType() { parse(); return entityType_;}
49 51
50 void setGroup (const QCString & s) 52 void setGroup (const Q3CString & s)
51 { group_ = s; assembled_ = false; } 53 { group_ = s; assembled_ = false; }
52 54
53 void setName (const QCString & s) 55 void setName (const Q3CString & s)
54 { name_ = s; assembled_ = false; } 56 { name_ = s; assembled_ = false; }
55 57
56 void setValue (Value *s) 58 void setValue (Value *s)
57 { value_ = s; assembled_ = false; } 59 { value_ = s; assembled_ = false; }
58 60
59 void setParamList(const ParamList & l) 61 void setParamList(const ParamList & l)
60 { paramList_ = l; assembled_ = false; } 62 { paramList_ = l; assembled_ = false; }
61 63
62 void clear (); 64 void clear ();
63 65
64 private: 66 private:
65 67
66 QCString group_; 68 Q3CString group_;
67 QCString name_; 69 Q3CString name_;
68 QPtrList<Param> paramList_; 70 Q3PtrList<Param> paramList_;
69 Value * value_; 71 Value * value_;
70 72
71 ParamType paramType_; 73 ParamType paramType_;
72 ValueType valueType_; 74 ValueType valueType_;
73 EntityType entityType_; 75 EntityType entityType_;
74}; 76};
75} 77}
76 78
77#endif 79#endif
diff --git a/kabc/vcard/include/VCardDateParam.h b/kabc/vcard/include/VCardDateParam.h
index 21ac1f1..959b75b 100644
--- a/kabc/vcard/include/VCardDateParam.h
+++ b/kabc/vcard/include/VCardDateParam.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef DATEPARAM_H 24#ifndef DATEPARAM_H
25#define DATEPARAM_H 25#define DATEPARAM_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardParam.h> 29#include <VCardParam.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class DateParam : public Param 34class DateParam : public Param
35{ 35{
36 36
37#include "DateParam-generated.h" 37#include "DateParam-generated.h"
38 38
39 private: 39 private:
diff --git a/kabc/vcard/include/VCardDateValue.h b/kabc/vcard/include/VCardDateValue.h
index c248966..fc216c0 100644
--- a/kabc/vcard/include/VCardDateValue.h
+++ b/kabc/vcard/include/VCardDateValue.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef DATEVALUE_H 24#ifndef DATEVALUE_H
25#define DATEVALUE_H 25#define DATEVALUE_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28#include <qdatetime.h> 28#include <qdatetime.h>
29 29
30#include <VCardValue.h> 30#include <VCardValue.h>
31 31
32namespace VCARD 32namespace VCARD
33{ 33{
34 34
35class DateValue : public Value 35class DateValue : public Value
36{ 36{
37#include "DateValue-generated.h" 37#include "DateValue-generated.h"
38 38
39 DateValue( 39 DateValue(
diff --git a/kabc/vcard/include/VCardDefines.h b/kabc/vcard/include/VCardDefines.h
index 557410f..5d4f2f4 100644
--- a/kabc/vcard/include/VCardDefines.h
+++ b/kabc/vcard/include/VCardDefines.h
@@ -26,28 +26,28 @@
26 26
27#include <kdebug.h> 27#include <kdebug.h>
28 28
29#ifdef VCARD_DEBUG 29#ifdef VCARD_DEBUG
30//US #define vDebug(a) kdDebug(5710) << a << endl; 30//US #define vDebug(a) kdDebug(5710) << a << endl;
31#define vDebug(a) qDebug(a); 31#define vDebug(a) qDebug(a);
32#else 32#else
33#define vDebug(a) 33#define vDebug(a)
34#endif 34#endif
35 35
36#if 0 36#if 0
37#ifndef NDEBUG 37#ifndef NDEBUG
38 #include <qcstring.h> 38 #include <q3cstring.h>
39 #include <iostream> 39 #include <iostream>
40 #ifdef __GNUG__ 40 #ifdef __GNUG__
41 # define vDebug(a) cerr << className() << ":" << __FUNCTION__ << " (" \ 41 # define vDebug(a) cerr << className() << ":" << __FUNCTION__ << " (" \
42 << __LINE__ << "): " << QCString((a)).data() << endl; 42 << __LINE__ << "): " << Q3CString((a)).data() << endl;
43 #else 43 #else
44 # define vDebug(a) cerr << className() << ": " \ 44 # define vDebug(a) cerr << className() << ": " \
45 << QCString((a)).data() << endl; 45 << Q3CString((a)).data() << endl;
46 #endif 46 #endif
47#else 47#else
48 #define vDebug(a) 48 #define vDebug(a)
49#endif 49#endif
50#endif 50#endif
51 51
52#endif // Included this file 52#endif // Included this file
53 53
diff --git a/kabc/vcard/include/VCardEmailParam.h b/kabc/vcard/include/VCardEmailParam.h
index 98d1b30..ff07324 100644
--- a/kabc/vcard/include/VCardEmailParam.h
+++ b/kabc/vcard/include/VCardEmailParam.h
@@ -15,42 +15,42 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef EMAILPARAM_H 24#ifndef EMAILPARAM_H
25#define EMAILPARAM_H 25#define EMAILPARAM_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardParam.h> 29#include <VCardParam.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class EmailParam : public Param 34class EmailParam : public Param
35{ 35{
36 36
37#include "EmailParam-generated.h" 37#include "EmailParam-generated.h"
38 38
39 QCString emailType() { parse(); return emailType_;} 39 Q3CString emailType() { parse(); return emailType_;}
40 bool pref() { parse(); return pref_; } 40 bool pref() { parse(); return pref_; }
41 41
42 void setEmailType(const QCString & s) 42 void setEmailType(const Q3CString & s)
43 { emailType_ = s; assembled_ = false; } 43 { emailType_ = s; assembled_ = false; }
44 44
45 void setPref(bool b) 45 void setPref(bool b)
46 { pref_ = b; assembled_ = false; } 46 { pref_ = b; assembled_ = false; }
47 47
48 private: 48 private:
49 49
50 QCStringemailType_; 50 Q3CStringemailType_;
51 bool pref_; 51 bool pref_;
52}; 52};
53 53
54} 54}
55 55
56#endif 56#endif
diff --git a/kabc/vcard/include/VCardEntity.h b/kabc/vcard/include/VCardEntity.h
index 3c945b5..1a3d20f 100644
--- a/kabc/vcard/include/VCardEntity.h
+++ b/kabc/vcard/include/VCardEntity.h
@@ -15,53 +15,53 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef ENTITY_H 24#ifndef ENTITY_H
25#define ENTITY_H 25#define ENTITY_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29namespace VCARD 29namespace VCARD
30{ 30{
31 31
32class Entity 32class Entity
33{ 33{
34 public: 34 public:
35 35
36 Entity(); 36 Entity();
37 Entity(const Entity & e); 37 Entity(const Entity & e);
38 Entity(const QCString & s); 38 Entity(const Q3CString & s);
39 39
40 virtual Entity & operator = (const Entity & e); 40 virtual Entity & operator = (const Entity & e);
41 virtual Entity & operator = (const QCString & s); 41 virtual Entity & operator = (const Q3CString & s);
42 42
43 virtual bool operator == (Entity & e); 43 virtual bool operator == (Entity & e);
44 virtual bool operator != (Entity & e); 44 virtual bool operator != (Entity & e);
45 virtual bool operator == (const QCString & s); 45 virtual bool operator == (const Q3CString & s);
46 virtual bool operator != (const QCString & s); 46 virtual bool operator != (const Q3CString & s);
47 47
48 virtual ~Entity(); 48 virtual ~Entity();
49 49
50 QCString asString(); 50 Q3CString asString();
51 51
52 virtual void parse(); 52 virtual void parse();
53 virtual void assemble(); 53 virtual void assemble();
54 54
55 virtual void _parse() = 0; 55 virtual void _parse() = 0;
56 virtual void _assemble() = 0; 56 virtual void _assemble() = 0;
57 57
58 protected: 58 protected:
59 59
60 QCString strRep_; 60 Q3CString strRep_;
61 bool parsed_; 61 bool parsed_;
62 bool assembled_; 62 bool assembled_;
63}; 63};
64 64
65} 65}
66 66
67#endif 67#endif
diff --git a/kabc/vcard/include/VCardEnum.h b/kabc/vcard/include/VCardEnum.h
index b4e4094..0c35e5e 100644
--- a/kabc/vcard/include/VCardEnum.h
+++ b/kabc/vcard/include/VCardEnum.h
@@ -15,30 +15,30 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef ENUM_H 24#ifndef ENUM_H
25#define ENUM_H 25#define ENUM_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29namespace VCARD 29namespace VCARD
30{ 30{
31 31
32extern const QCString paramNames []; 32extern const Q3CString paramNames [];
33 33
34enum EntityType { 34enum EntityType {
35 EntityName, 35 EntityName,
36 EntityProfile, 36 EntityProfile,
37 EntitySource, 37 EntitySource,
38 EntityFullName, 38 EntityFullName,
39 EntityN, 39 EntityN,
40 EntityNickname, 40 EntityNickname,
41 EntityPhoto, 41 EntityPhoto,
42 EntityBirthday, 42 EntityBirthday,
43 EntityAddress, 43 EntityAddress,
44 EntityLabel, 44 EntityLabel,
@@ -99,22 +99,22 @@ enum ParamType {
99 ParamEmail, 99 ParamEmail,
100 ParamMailer, 100 ParamMailer,
101 ParamAgent, 101 ParamAgent,
102 ParamTextBin, 102 ParamTextBin,
103 ParamTextNS, 103 ParamTextNS,
104 ParamSound 104 ParamSound
105}; 105};
106 106
107extern const ParamType paramTypesTable[]; 107extern const ParamType paramTypesTable[];
108 108
109ParamType EntityTypeToParamType(EntityType); 109ParamType EntityTypeToParamType(EntityType);
110ValueType EntityTypeToValueType(EntityType); 110ValueType EntityTypeToValueType(EntityType);
111QCString EntityTypeToParamName(EntityType); 111Q3CString EntityTypeToParamName(EntityType);
112EntityType EntityNameToEntityType(const QCString &); 112EntityType EntityNameToEntityType(const Q3CString &);
113 113
114char * encodeBase64(const char *, unsigned long, unsigned long &); 114char * encodeBase64(const char *, unsigned long, unsigned long &);
115char * decodeBase64(const char *, unsigned long, unsigned long &); 115char * decodeBase64(const char *, unsigned long, unsigned long &);
116 116
117} 117}
118 118
119#endif 119#endif
120 120
diff --git a/kabc/vcard/include/VCardFloatValue.h b/kabc/vcard/include/VCardFloatValue.h
index 69fdc22..cac7a91 100644
--- a/kabc/vcard/include/VCardFloatValue.h
+++ b/kabc/vcard/include/VCardFloatValue.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef FLOATVALUE_H 24#ifndef FLOATVALUE_H
25#define FLOATVALUE_H 25#define FLOATVALUE_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardValue.h> 29#include <VCardValue.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class FloatValue : public Value 34class FloatValue : public Value
35{ 35{
36 36
37#include "FloatValue-generated.h" 37#include "FloatValue-generated.h"
38 38
39 FloatValue(float); 39 FloatValue(float);
diff --git a/kabc/vcard/include/VCardImageParam.h b/kabc/vcard/include/VCardImageParam.h
index ce99ccc..2785331 100644
--- a/kabc/vcard/include/VCardImageParam.h
+++ b/kabc/vcard/include/VCardImageParam.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef IMGPARAM_H 24#ifndef IMGPARAM_H
25#define IMGPARAM_H 25#define IMGPARAM_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardParam.h> 29#include <VCardParam.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class ImageParam : public Param 34class ImageParam : public Param
35{ 35{
36 36
37#include "ImageParam-generated.h" 37#include "ImageParam-generated.h"
38 38
39 private: 39 private:
diff --git a/kabc/vcard/include/VCardImageValue.h b/kabc/vcard/include/VCardImageValue.h
index 6ce0371..3b64731 100644
--- a/kabc/vcard/include/VCardImageValue.h
+++ b/kabc/vcard/include/VCardImageValue.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef IMAGEVALUE_H 24#ifndef IMAGEVALUE_H
25#define IMAGEVALUE_H 25#define IMAGEVALUE_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardValue.h> 29#include <VCardValue.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class ImageValue : public Value 34class ImageValue : public Value
35{ 35{
36 36
37#include "ImageValue-generated.h" 37#include "ImageValue-generated.h"
38 38
39 private: 39 private:
diff --git a/kabc/vcard/include/VCardLangValue.h b/kabc/vcard/include/VCardLangValue.h
index 991ceed..319de76 100644
--- a/kabc/vcard/include/VCardLangValue.h
+++ b/kabc/vcard/include/VCardLangValue.h
@@ -15,37 +15,37 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef LANGVALUE_H 24#ifndef LANGVALUE_H
25#define LANGVALUE_H 25#define LANGVALUE_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28#include <qstrlist.h> 28#include <q3strlist.h>
29 29
30#include <VCardValue.h> 30#include <VCardValue.h>
31 31
32namespace VCARD 32namespace VCARD
33{ 33{
34 34
35class LangValue : public Value 35class LangValue : public Value
36{ 36{
37#include "LangValue-generated.h" 37#include "LangValue-generated.h"
38 38
39 QCString primary(); 39 Q3CString primary();
40 QStrList subtags(); 40 Q3StrList subtags();
41 41
42 void setPrimary(const QCString &); 42 void setPrimary(const Q3CString &);
43 void setSubTags(const QStrList &); 43 void setSubTags(const Q3StrList &);
44 44
45 QCString primary_; 45 Q3CString primary_;
46 QStrList subtags_; 46 Q3StrList subtags_;
47}; 47};
48 48
49} 49}
50 50
51#endif 51#endif
diff --git a/kabc/vcard/include/VCardNValue.h b/kabc/vcard/include/VCardNValue.h
index 306821b..ffc5355 100644
--- a/kabc/vcard/include/VCardNValue.h
+++ b/kabc/vcard/include/VCardNValue.h
@@ -16,41 +16,43 @@
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef NVALUE_H 24#ifndef NVALUE_H
25#define NVALUE_H 25#define NVALUE_H
26 26
27#include <VCardValue.h> 27#include <VCardValue.h>
28//Added by qt3to4:
29#include <Q3CString>
28 30
29namespace VCARD 31namespace VCARD
30{ 32{
31 33
32class NValue : public Value 34class NValue : public Value
33{ 35{
34#include "NValue-generated.h" 36#include "NValue-generated.h"
35 NValue *clone(); 37 NValue *clone();
36 38
37 QCString family() { parse(); return family_;} 39 Q3CString family() { parse(); return family_;}
38 QCString given() { parse(); return given_;} 40 Q3CString given() { parse(); return given_;}
39 QCString middle() { parse(); return middle_;} 41 Q3CString middle() { parse(); return middle_;}
40 QCString prefix() { parse(); return prefix_;} 42 Q3CString prefix() { parse(); return prefix_;}
41 QCString suffix() { parse(); return suffix_;} 43 Q3CString suffix() { parse(); return suffix_;}
42 44
43 void setFamily (const QCString & s) { family_= s; assembled_ = false; } 45 void setFamily (const Q3CString & s) { family_= s; assembled_ = false; }
44 void setGiven (const QCString & s) { given_= s; assembled_ = false; } 46 void setGiven (const Q3CString & s) { given_= s; assembled_ = false; }
45 void setMiddle (const QCString & s) { middle_= s; assembled_ = false; } 47 void setMiddle (const Q3CString & s) { middle_= s; assembled_ = false; }
46 void setPrefix (const QCString & s) { prefix_= s; assembled_ = false; } 48 void setPrefix (const Q3CString & s) { prefix_= s; assembled_ = false; }
47 void setSuffix (const QCString & s) { suffix_= s; assembled_ = false; } 49 void setSuffix (const Q3CString & s) { suffix_= s; assembled_ = false; }
48 50
49 private: 51 private:
50 52
51 QCString family_, given_, middle_, prefix_, suffix_; 53 Q3CString family_, given_, middle_, prefix_, suffix_;
52}; 54};
53 55
54} 56}
55 57
56#endif 58#endif
diff --git a/kabc/vcard/include/VCardOrgValue.h b/kabc/vcard/include/VCardOrgValue.h
index c4f3f25..2e5d32f 100644
--- a/kabc/vcard/include/VCardOrgValue.h
+++ b/kabc/vcard/include/VCardOrgValue.h
@@ -15,36 +15,36 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef ORGVALUE_H 24#ifndef ORGVALUE_H
25#define ORGVALUE_H 25#define ORGVALUE_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28#include <qstrlist.h> 28#include <q3strlist.h>
29 29
30#include <VCardValue.h> 30#include <VCardValue.h>
31 31
32namespace VCARD 32namespace VCARD
33{ 33{
34 34
35class OrgValue : public Value 35class OrgValue : public Value
36{ 36{
37 37
38#include "OrgValue-generated.h" 38#include "OrgValue-generated.h"
39 39
40 unsigned int numValues(); 40 unsigned int numValues();
41 QCString value(unsigned int); 41 Q3CString value(unsigned int);
42 42
43 private: 43 private:
44 44
45 QStrList valueList_; 45 Q3StrList valueList_;
46}; 46};
47 47
48} 48}
49 49
50#endif 50#endif
diff --git a/kabc/vcard/include/VCardParam.h b/kabc/vcard/include/VCardParam.h
index b61ce5c..b83fde1 100644
--- a/kabc/vcard/include/VCardParam.h
+++ b/kabc/vcard/include/VCardParam.h
@@ -15,45 +15,45 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef PARAM_H 24#ifndef PARAM_H
25#define PARAM_H 25#define PARAM_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28#include <qptrlist.h> 28#include <q3ptrlist.h>
29 29
30#include <VCardEntity.h> 30#include <VCardEntity.h>
31 31
32namespace VCARD 32namespace VCARD
33{ 33{
34 34
35class Param : public Entity 35class Param : public Entity
36{ 36{
37 37
38#include "Param-generated.h" 38#include "Param-generated.h"
39 39
40 Param(const QCString &name, const QCString &value); 40 Param(const Q3CString &name, const Q3CString &value);
41 41
42 void setName(const QCString &); 42 void setName(const Q3CString &);
43 void setValue(const QCString &); 43 void setValue(const Q3CString &);
44 44
45 QCString name(); 45 Q3CString name();
46 QCString value(); 46 Q3CString value();
47 47
48 private: 48 private:
49 49
50 QCString name_; 50 Q3CString name_;
51 QCString value_; 51 Q3CString value_;
52}; 52};
53 53
54typedef QPtrList<Param> ParamList; 54typedef Q3PtrList<Param> ParamList;
55typedef QPtrListIterator<Param> ParamListIterator; 55typedef Q3PtrListIterator<Param> ParamListIterator;
56 56
57} 57}
58 58
59#endif 59#endif
diff --git a/kabc/vcard/include/VCardRToken.h b/kabc/vcard/include/VCardRToken.h
index 2f95f1b..4a5adb2 100644
--- a/kabc/vcard/include/VCardRToken.h
+++ b/kabc/vcard/include/VCardRToken.h
@@ -16,23 +16,23 @@
16 16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23*/ 23*/
24 24
25#ifndef RTOKEN_H 25#ifndef RTOKEN_H
26#define RTOKEN_H 26#define RTOKEN_H
27 27
28#include <qstrlist.h> 28#include <q3strlist.h>
29 29
30namespace VCARD 30namespace VCARD
31{ 31{
32 32
33Q_UINT32 RTokenise(const char * str, const char * delim, QStrList & l); 33Q_UINT32 RTokenise(const char * str, const char * delim, Q3StrList & l);
34 34
35} 35}
36 36
37#endif 37#endif
38 38
diff --git a/kabc/vcard/include/VCardSoundValue.h b/kabc/vcard/include/VCardSoundValue.h
index 994f55e..26f750b 100644
--- a/kabc/vcard/include/VCardSoundValue.h
+++ b/kabc/vcard/include/VCardSoundValue.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef SOUNDVALUE_H 24#ifndef SOUNDVALUE_H
25#define SOUNDVALUE_H 25#define SOUNDVALUE_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardValue.h> 29#include <VCardValue.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class SoundValue : public Value 34class SoundValue : public Value
35{ 35{
36 36
37#include "SoundValue-generated.h" 37#include "SoundValue-generated.h"
38 38
39 private: 39 private:
diff --git a/kabc/vcard/include/VCardSourceParam.h b/kabc/vcard/include/VCardSourceParam.h
index 887ea20..5218864 100644
--- a/kabc/vcard/include/VCardSourceParam.h
+++ b/kabc/vcard/include/VCardSourceParam.h
@@ -15,44 +15,44 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef SOURCEPARAM_H 24#ifndef SOURCEPARAM_H
25#define SOURCEPARAM_H 25#define SOURCEPARAM_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardParam.h> 29#include <VCardParam.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class SourceParam : public Param 34class SourceParam : public Param
35{ 35{
36 36
37#include "SourceParam-generated.h" 37#include "SourceParam-generated.h"
38 38
39 enum SourceParamType { TypeUnknown, TypeValue, TypeContext, TypeX }; 39 enum SourceParamType { TypeUnknown, TypeValue, TypeContext, TypeX };
40 40
41 SourceParamType type(){ parse(); return type_;} 41 SourceParamType type(){ parse(); return type_;}
42 QCString par() { parse(); return par_; } 42 Q3CString par() { parse(); return par_; }
43 QCString val() { parse(); return val_; } 43 Q3CString val() { parse(); return val_; }
44 44
45 void setType(SourceParamType t) { type_= t; assembled_ = false; } 45 void setType(SourceParamType t) { type_= t; assembled_ = false; }
46 void setPar(const QCString & s) { par_= s; assembled_ = false; } 46 void setPar(const Q3CString & s) { par_= s; assembled_ = false; }
47 void setVal(const QCString & s) { val_= s; assembled_ = false; } 47 void setVal(const Q3CString & s) { val_= s; assembled_ = false; }
48 48
49 private: 49 private:
50 50
51 SourceParamType type_; 51 SourceParamType type_;
52 // May be "VALUE = uri" or "CONTEXT = word" or "x-name = *SAFE-CHAR" 52 // May be "VALUE = uri" or "CONTEXT = word" or "x-name = *SAFE-CHAR"
53 QCString par_, val_; // Sub-parameter, value 53 Q3CString par_, val_; // Sub-parameter, value
54}; 54};
55 55
56} 56}
57 57
58#endif 58#endif
diff --git a/kabc/vcard/include/VCardTelParam.h b/kabc/vcard/include/VCardTelParam.h
index 27d7dcc..0c45a3a 100644
--- a/kabc/vcard/include/VCardTelParam.h
+++ b/kabc/vcard/include/VCardTelParam.h
@@ -15,37 +15,39 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef TELPARAM_H 24#ifndef TELPARAM_H
25#define TELPARAM_H 25#define TELPARAM_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28//Added by qt3to4:
29#include <Q3PtrList>
28 30
29#include <VCardParam.h> 31#include <VCardParam.h>
30 32
31namespace VCARD 33namespace VCARD
32{ 34{
33 35
34class TelParam : public Param 36class TelParam : public Param
35{ 37{
36#include "TelParam-generated.h" 38#include "TelParam-generated.h"
37 39
38 enum TelType { 40 enum TelType {
39 TelHome, TelWork, TelPref, TelVoice, TelFex, TelMsg, TelCell, 41 TelHome, TelWork, TelPref, TelVoice, TelFex, TelMsg, TelCell,
40 TelPager, TelBBS, TelModem, TelCar, TelISDN, TelVideo, TelPCS, 42 TelPager, TelBBS, TelModem, TelCar, TelISDN, TelVideo, TelPCS,
41 TelIANA, TelX 43 TelIANA, TelX
42 }; 44 };
43 45
44 private: 46 private:
45 47
46 QPtrList<TelType> types_; 48 Q3PtrList<TelType> types_;
47}; 49};
48 50
49} 51}
50 52
51#endif 53#endif
diff --git a/kabc/vcard/include/VCardTelValue.h b/kabc/vcard/include/VCardTelValue.h
index 9cf5a98..a119e4a 100644
--- a/kabc/vcard/include/VCardTelValue.h
+++ b/kabc/vcard/include/VCardTelValue.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef TELVALUE_H 24#ifndef TELVALUE_H
25#define TELVALUE_H 25#define TELVALUE_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardValue.h> 29#include <VCardValue.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class TelValue : public Value 34class TelValue : public Value
35{ 35{
36 36
37#include "TelValue-generated.h" 37#include "TelValue-generated.h"
38 38
39 private: 39 private:
diff --git a/kabc/vcard/include/VCardTextBinParam.h b/kabc/vcard/include/VCardTextBinParam.h
index 31dec86..d186995 100644
--- a/kabc/vcard/include/VCardTextBinParam.h
+++ b/kabc/vcard/include/VCardTextBinParam.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef TEXTBINPARAM_H 24#ifndef TEXTBINPARAM_H
25#define TEXTBINPARAM_H 25#define TEXTBINPARAM_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardParam.h> 29#include <VCardParam.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class TextBinParam : public Param 34class TextBinParam : public Param
35{ 35{
36 36
37#include "TextBinParam-generated.h" 37#include "TextBinParam-generated.h"
38 38
39 private: 39 private:
diff --git a/kabc/vcard/include/VCardTextBinValue.h b/kabc/vcard/include/VCardTextBinValue.h
index 8d44fdf..3924f2a 100644
--- a/kabc/vcard/include/VCardTextBinValue.h
+++ b/kabc/vcard/include/VCardTextBinValue.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef TEXTBINVALUE_H 24#ifndef TEXTBINVALUE_H
25#define TEXTBINVALUE_H 25#define TEXTBINVALUE_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardValue.h> 29#include <VCardValue.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class TextBinValue : public Value 34class TextBinValue : public Value
35{ 35{
36 36
37#include "TextBinValue-generated.h" 37#include "TextBinValue-generated.h"
38 38
39 TextBinValue *clone(); 39 TextBinValue *clone();
diff --git a/kabc/vcard/include/VCardTextListValue.h b/kabc/vcard/include/VCardTextListValue.h
index 8e47af5..ac42a29 100644
--- a/kabc/vcard/include/VCardTextListValue.h
+++ b/kabc/vcard/include/VCardTextListValue.h
@@ -15,37 +15,37 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef TEXTLISTVALUE_H 24#ifndef TEXTLISTVALUE_H
25#define TEXTLISTVALUE_H 25#define TEXTLISTVALUE_H
26 26
27#include <qstrlist.h> 27#include <q3strlist.h>
28 28
29#include <qcstring.h> 29#include <q3cstring.h>
30 30
31#include <VCardValue.h> 31#include <VCardValue.h>
32 32
33namespace VCARD 33namespace VCARD
34{ 34{
35 35
36class TextListValue : public Value 36class TextListValue : public Value
37{ 37{
38 38
39#include "TextListValue-generated.h" 39#include "TextListValue-generated.h"
40 40
41 unsigned int numValues(); 41 unsigned int numValues();
42 QCString value(unsigned int); 42 Q3CString value(unsigned int);
43 43
44 private: 44 private:
45 45
46 QStrList valueList_; 46 Q3StrList valueList_;
47}; 47};
48 48
49} 49}
50 50
51#endif 51#endif
diff --git a/kabc/vcard/include/VCardTextParam.h b/kabc/vcard/include/VCardTextParam.h
index 08b5f57..2503337 100644
--- a/kabc/vcard/include/VCardTextParam.h
+++ b/kabc/vcard/include/VCardTextParam.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef TEXTPARAM_H 24#ifndef TEXTPARAM_H
25#define TEXTPARAM_H 25#define TEXTPARAM_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardParam.h> 29#include <VCardParam.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class TextParam : public Param 34class TextParam : public Param
35{ 35{
36 36
37#include "TextParam-generated.h" 37#include "TextParam-generated.h"
38 38
39 private: 39 private:
diff --git a/kabc/vcard/include/VCardURIValue.h b/kabc/vcard/include/VCardURIValue.h
index 5fd7184..116e4c8 100644
--- a/kabc/vcard/include/VCardURIValue.h
+++ b/kabc/vcard/include/VCardURIValue.h
@@ -16,37 +16,39 @@
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef URIVALUE_H 24#ifndef URIVALUE_H
25#define URIVALUE_H 25#define URIVALUE_H
26 26
27#include <VCardValue.h> 27#include <VCardValue.h>
28//Added by qt3to4:
29#include <Q3CString>
28 30
29namespace VCARD 31namespace VCARD
30{ 32{
31 33
32class URIValue : public Value 34class URIValue : public Value
33{ 35{
34#include "URIValue-generated.h" 36#include "URIValue-generated.h"
35 37
36 URIValue(const QCString & scheme, const QCString & schemeSpecificPart); 38 URIValue(const Q3CString & scheme, const Q3CString & schemeSpecificPart);
37 39
38 QCString scheme(); 40 Q3CString scheme();
39 QCString schemeSpecificPart(); 41 Q3CString schemeSpecificPart();
40 42
41 void setScheme (const QCString &); 43 void setScheme (const Q3CString &);
42 void setSchemeSpecificPart(const QCString &); 44 void setSchemeSpecificPart(const Q3CString &);
43 45
44 private: 46 private:
45 47
46 QCString scheme_; 48 Q3CString scheme_;
47 QCString schemeSpecificPart_; 49 Q3CString schemeSpecificPart_;
48}; 50};
49 51
50} 52}
51 53
52#endif 54#endif
diff --git a/kabc/vcard/include/VCardUTCValue.h b/kabc/vcard/include/VCardUTCValue.h
index ff695e0..eb69829 100644
--- a/kabc/vcard/include/VCardUTCValue.h
+++ b/kabc/vcard/include/VCardUTCValue.h
@@ -15,25 +15,25 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef UTCVALUE_H 24#ifndef UTCVALUE_H
25#define UTCVALUE_H 25#define UTCVALUE_H
26 26
27#include <qcstring.h> 27#include <q3cstring.h>
28 28
29#include <VCardValue.h> 29#include <VCardValue.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class UTCValue : public Value 34class UTCValue : public Value
35{ 35{
36 36
37#include "UTCValue-generated.h" 37#include "UTCValue-generated.h"
38 38
39 UTCValue *clone(); 39 UTCValue *clone();
diff --git a/kabc/vcard/include/VCardVCard.h b/kabc/vcard/include/VCardVCard.h
index 5dec166..5b66074 100644
--- a/kabc/vcard/include/VCardVCard.h
+++ b/kabc/vcard/include/VCardVCard.h
@@ -16,48 +16,50 @@
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef VCARD_VCARD_H 24#ifndef VCARD_VCARD_H
25#define VCARD_VCARD_H 25#define VCARD_VCARD_H
26 26
27#include <qstring.h> 27#include <qstring.h>
28#include <qptrlist.h> 28#include <q3ptrlist.h>
29//Added by qt3to4:
30#include <Q3CString>
29 31
30#include <VCardEnum.h> 32#include <VCardEnum.h>
31#include <VCardEntity.h> 33#include <VCardEntity.h>
32#include <VCardContentLine.h> 34#include <VCardContentLine.h>
33 35
34namespace VCARD 36namespace VCARD
35{ 37{
36 38
37class VCard : public Entity 39class VCard : public Entity
38{ 40{
39 41
40#include "VCard-generated.h" 42#include "VCard-generated.h"
41 43
42 bool has(EntityType); 44 bool has(EntityType);
43 bool has(const QCString &); 45 bool has(const Q3CString &);
44 46
45 void add(const ContentLine &); 47 void add(const ContentLine &);
46 void add(const QCString &); 48 void add(const Q3CString &);
47 49
48 ContentLine * contentLine(EntityType); 50 ContentLine * contentLine(EntityType);
49 ContentLine * contentLine(const QCString &); 51 ContentLine * contentLine(const Q3CString &);
50 52
51 QCString group() { parse(); return group_; } 53 Q3CString group() { parse(); return group_; }
52 54
53 QPtrList<ContentLine>contentLineList() { parse(); return contentLineList_; } 55 Q3PtrList<ContentLine>contentLineList() { parse(); return contentLineList_; }
54 56
55 private: 57 private:
56 58
57 QCString group_; 59 Q3CString group_;
58 QPtrList<ContentLine>contentLineList_; 60 Q3PtrList<ContentLine>contentLineList_;
59}; 61};
60 62
61} 63}
62 64
63#endif 65#endif
diff --git a/kabc/vcard/include/VCardVCardEntity.h b/kabc/vcard/include/VCardVCardEntity.h
index 47ba370..8c824e7 100644
--- a/kabc/vcard/include/VCardVCardEntity.h
+++ b/kabc/vcard/include/VCardVCardEntity.h
@@ -16,35 +16,35 @@
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef VCARD_ENTITY_H 24#ifndef VCARD_ENTITY_H
25#define VCARD_ENTITY_H 25#define VCARD_ENTITY_H
26 26
27#include <qstring.h> 27#include <qstring.h>
28#include <qptrlist.h> 28#include <q3ptrlist.h>
29 29
30#include <VCardEnum.h> 30#include <VCardEnum.h>
31#include <VCardVCard.h> 31#include <VCardVCard.h>
32#include <VCardEntity.h> 32#include <VCardEntity.h>
33 33
34namespace VCARD 34namespace VCARD
35{ 35{
36 36
37typedef QPtrList<VCard> VCardList; 37typedef Q3PtrList<VCard> VCardList;
38typedef QPtrListIterator<VCard> VCardListIterator; 38typedef Q3PtrListIterator<VCard> VCardListIterator;
39 39
40class VCardEntity : public Entity 40class VCardEntity : public Entity
41{ 41{
42 42
43#include "VCardEntity-generated.h" 43#include "VCardEntity-generated.h"
44 44
45 void setCardList(const VCardList & l); 45 void setCardList(const VCardList & l);
46 VCardList & cardList(); 46 VCardList & cardList();
47 47
48 private: 48 private:
49 49
50 VCardList cardList_; 50 VCardList cardList_;
diff --git a/kabc/vcard/include/VCardValue.h b/kabc/vcard/include/VCardValue.h
index 7cfe4a0..024397c 100644
--- a/kabc/vcard/include/VCardValue.h
+++ b/kabc/vcard/include/VCardValue.h
@@ -15,32 +15,32 @@
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef VALUE_H 24#ifndef VALUE_H
25#define VALUE_H 25#define VALUE_H
26 26
27#include <qptrlist.h> 27#include <q3ptrlist.h>
28 28
29#include <VCardEntity.h> 29#include <VCardEntity.h>
30 30
31namespace VCARD 31namespace VCARD
32{ 32{
33 33
34class Value : public Entity 34class Value : public Entity
35{ 35{
36#include "Value-generated.h" 36#include "Value-generated.h"
37 37
38 virtual Value *clone() { return new Value( *this ); } 38 virtual Value *clone() { return new Value( *this ); }
39}; 39};
40 40
41typedef QPtrList<Value> ValueList; 41typedef Q3PtrList<Value> ValueList;
42typedef QPtrListIterator<Value> ValueListIterator; 42typedef Q3PtrListIterator<Value> ValueListIterator;
43 43
44} 44}
45 45
46#endif 46#endif
diff --git a/kabc/vcard/include/generated/AdrParam-generated.h b/kabc/vcard/include/generated/AdrParam-generated.h
index 3e265d8..a11d142 100644
--- a/kabc/vcard/include/generated/AdrParam-generated.h
+++ b/kabc/vcard/include/generated/AdrParam-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4AdrParam(); 6AdrParam();
5AdrParam(const AdrParam&); 7AdrParam(const AdrParam&);
6AdrParam(const QCString&); 8AdrParam(const Q3CString&);
7AdrParam & operator = (AdrParam&); 9AdrParam & operator = (AdrParam&);
8AdrParam & operator = (const QCString&); 10AdrParam & operator = (const Q3CString&);
9bool operator ==(AdrParam&); 11bool operator ==(AdrParam&);
10bool operator !=(AdrParam& x) {return !(*this==x);} 12bool operator !=(AdrParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {AdrParam a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {AdrParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~AdrParam(); 16virtual ~AdrParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "AdrParam"; } 23const char * className() const { return "AdrParam"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/AdrValue-generated.h b/kabc/vcard/include/generated/AdrValue-generated.h
index e1d93e4..c0a33a3 100644
--- a/kabc/vcard/include/generated/AdrValue-generated.h
+++ b/kabc/vcard/include/generated/AdrValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4AdrValue(); 6AdrValue();
5AdrValue(const AdrValue&); 7AdrValue(const AdrValue&);
6AdrValue(const QCString&); 8AdrValue(const Q3CString&);
7AdrValue & operator = (AdrValue&); 9AdrValue & operator = (AdrValue&);
8AdrValue & operator = (const QCString&); 10AdrValue & operator = (const Q3CString&);
9bool operator ==(AdrValue&); 11bool operator ==(AdrValue&);
10bool operator !=(AdrValue& x) {return !(*this==x);} 12bool operator !=(AdrValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {AdrValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {AdrValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~AdrValue(); 16virtual ~AdrValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "AdrValue"; } 23const char * className() const { return "AdrValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/AgentParam-generated.h b/kabc/vcard/include/generated/AgentParam-generated.h
index 6423867..d5ed988 100644
--- a/kabc/vcard/include/generated/AgentParam-generated.h
+++ b/kabc/vcard/include/generated/AgentParam-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4AgentParam(); 6AgentParam();
5AgentParam(const AgentParam&); 7AgentParam(const AgentParam&);
6AgentParam(const QCString&); 8AgentParam(const Q3CString&);
7AgentParam & operator = (AgentParam&); 9AgentParam & operator = (AgentParam&);
8AgentParam & operator = (const QCString&); 10AgentParam & operator = (const Q3CString&);
9bool operator ==(AgentParam&); 11bool operator ==(AgentParam&);
10bool operator !=(AgentParam& x) {return !(*this==x);} 12bool operator !=(AgentParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {AgentParam a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {AgentParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~AgentParam(); 16virtual ~AgentParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "AgentParam"; } 23const char * className() const { return "AgentParam"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/AgentValue-generated.h b/kabc/vcard/include/generated/AgentValue-generated.h
index 76bb81c..eef5277 100644
--- a/kabc/vcard/include/generated/AgentValue-generated.h
+++ b/kabc/vcard/include/generated/AgentValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4AgentValue(); 6AgentValue();
5AgentValue(const AgentValue&); 7AgentValue(const AgentValue&);
6AgentValue(const QCString&); 8AgentValue(const Q3CString&);
7AgentValue & operator = (AgentValue&); 9AgentValue & operator = (AgentValue&);
8AgentValue & operator = (const QCString&); 10AgentValue & operator = (const Q3CString&);
9bool operator ==(AgentValue&); 11bool operator ==(AgentValue&);
10bool operator !=(AgentValue& x) {return !(*this==x);} 12bool operator !=(AgentValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {AgentValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {AgentValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~AgentValue(); 16virtual ~AgentValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "AgentValue"; } 23const char * className() const { return "AgentValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ClassValue-generated.h b/kabc/vcard/include/generated/ClassValue-generated.h
index df4ed5f..b84c98f 100644
--- a/kabc/vcard/include/generated/ClassValue-generated.h
+++ b/kabc/vcard/include/generated/ClassValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4ClassValue(); 6ClassValue();
5ClassValue(const ClassValue&); 7ClassValue(const ClassValue&);
6ClassValue(const QCString&); 8ClassValue(const Q3CString&);
7ClassValue & operator = (ClassValue&); 9ClassValue & operator = (ClassValue&);
8ClassValue & operator = (const QCString&); 10ClassValue & operator = (const Q3CString&);
9bool operator ==(ClassValue&); 11bool operator ==(ClassValue&);
10bool operator !=(ClassValue& x) {return !(*this==x);} 12bool operator !=(ClassValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ClassValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {ClassValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~ClassValue(); 16virtual ~ClassValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "ClassValue"; } 23const char * className() const { return "ClassValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ContentLine-generated.h b/kabc/vcard/include/generated/ContentLine-generated.h
index 9efe273..84d0822 100644
--- a/kabc/vcard/include/generated/ContentLine-generated.h
+++ b/kabc/vcard/include/generated/ContentLine-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4ContentLine(); 6ContentLine();
5ContentLine(const ContentLine&); 7ContentLine(const ContentLine&);
6ContentLine(const QCString&); 8ContentLine(const Q3CString&);
7ContentLine & operator = (ContentLine&); 9ContentLine & operator = (ContentLine&);
8ContentLine & operator = (const QCString&); 10ContentLine & operator = (const Q3CString&);
9bool operator ==(ContentLine&); 11bool operator ==(ContentLine&);
10bool operator !=(ContentLine& x) {return !(*this==x);} 12bool operator !=(ContentLine& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ContentLine a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {ContentLine a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~ContentLine(); 16virtual ~ContentLine();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "ContentLine"; } 23const char * className() const { return "ContentLine"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/DateParam-generated.h b/kabc/vcard/include/generated/DateParam-generated.h
index ff1da58..029c1da 100644
--- a/kabc/vcard/include/generated/DateParam-generated.h
+++ b/kabc/vcard/include/generated/DateParam-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4DateParam(); 6DateParam();
5DateParam(const DateParam&); 7DateParam(const DateParam&);
6DateParam(const QCString&); 8DateParam(const Q3CString&);
7DateParam & operator = (DateParam&); 9DateParam & operator = (DateParam&);
8DateParam & operator = (const QCString&); 10DateParam & operator = (const Q3CString&);
9bool operator ==(DateParam&); 11bool operator ==(DateParam&);
10bool operator !=(DateParam& x) {return !(*this==x);} 12bool operator !=(DateParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {DateParam a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {DateParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~DateParam(); 16virtual ~DateParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "DateParam"; } 23const char * className() const { return "DateParam"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/DateValue-generated.h b/kabc/vcard/include/generated/DateValue-generated.h
index a382823..70eecce 100644
--- a/kabc/vcard/include/generated/DateValue-generated.h
+++ b/kabc/vcard/include/generated/DateValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4DateValue(); 6DateValue();
5DateValue(const DateValue&); 7DateValue(const DateValue&);
6DateValue(const QCString&); 8DateValue(const Q3CString&);
7DateValue & operator = (DateValue&); 9DateValue & operator = (DateValue&);
8DateValue & operator = (const QCString&); 10DateValue & operator = (const Q3CString&);
9bool operator ==(DateValue&); 11bool operator ==(DateValue&);
10bool operator !=(DateValue& x) {return !(*this==x);} 12bool operator !=(DateValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {DateValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {DateValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~DateValue(); 16virtual ~DateValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "DateValue"; } 23const char * className() const { return "DateValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/EmailParam-generated.h b/kabc/vcard/include/generated/EmailParam-generated.h
index 428a6fc..f498931 100644
--- a/kabc/vcard/include/generated/EmailParam-generated.h
+++ b/kabc/vcard/include/generated/EmailParam-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4EmailParam(); 6EmailParam();
5EmailParam(const EmailParam&); 7EmailParam(const EmailParam&);
6EmailParam(const QCString&); 8EmailParam(const Q3CString&);
7EmailParam & operator = (EmailParam&); 9EmailParam & operator = (EmailParam&);
8EmailParam & operator = (const QCString&); 10EmailParam & operator = (const Q3CString&);
9bool operator ==(EmailParam&); 11bool operator ==(EmailParam&);
10bool operator !=(EmailParam& x) {return !(*this==x);} 12bool operator !=(EmailParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {EmailParam a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {EmailParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~EmailParam(); 16virtual ~EmailParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "EmailParam"; } 23const char * className() const { return "EmailParam"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/FloatValue-generated.h b/kabc/vcard/include/generated/FloatValue-generated.h
index cac55cf..c04b85f 100644
--- a/kabc/vcard/include/generated/FloatValue-generated.h
+++ b/kabc/vcard/include/generated/FloatValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4FloatValue(); 6FloatValue();
5FloatValue(const FloatValue&); 7FloatValue(const FloatValue&);
6FloatValue(const QCString&); 8FloatValue(const Q3CString&);
7FloatValue & operator = (FloatValue&); 9FloatValue & operator = (FloatValue&);
8FloatValue & operator = (const QCString&); 10FloatValue & operator = (const Q3CString&);
9bool operator ==(FloatValue&); 11bool operator ==(FloatValue&);
10bool operator !=(FloatValue& x) {return !(*this==x);} 12bool operator !=(FloatValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {FloatValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {FloatValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~FloatValue(); 16virtual ~FloatValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "FloatValue"; } 23const char * className() const { return "FloatValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/GeoValue-generated.h b/kabc/vcard/include/generated/GeoValue-generated.h
index 594f3ad..ab659bf 100644
--- a/kabc/vcard/include/generated/GeoValue-generated.h
+++ b/kabc/vcard/include/generated/GeoValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4GeoValue(); 6GeoValue();
5GeoValue(const GeoValue&); 7GeoValue(const GeoValue&);
6GeoValue(const QCString&); 8GeoValue(const Q3CString&);
7GeoValue & operator = (GeoValue&); 9GeoValue & operator = (GeoValue&);
8GeoValue & operator = (const QCString&); 10GeoValue & operator = (const Q3CString&);
9bool operator ==(GeoValue&); 11bool operator ==(GeoValue&);
10bool operator !=(GeoValue& x) {return !(*this==x);} 12bool operator !=(GeoValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {GeoValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {GeoValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~GeoValue(); 16virtual ~GeoValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "GeoValue"; } 23const char * className() const { return "GeoValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/Group-generated.h b/kabc/vcard/include/generated/Group-generated.h
index f39302d..ae16e3d 100644
--- a/kabc/vcard/include/generated/Group-generated.h
+++ b/kabc/vcard/include/generated/Group-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4Group(); 6Group();
5Group(const Group&); 7Group(const Group&);
6Group(const QCString&); 8Group(const Q3CString&);
7Group & operator = (Group&); 9Group & operator = (Group&);
8Group & operator = (const QCString&); 10Group & operator = (const Q3CString&);
9bool operator ==(Group&); 11bool operator ==(Group&);
10bool operator !=(Group& x) {return !(*this==x);} 12bool operator !=(Group& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {Group a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {Group a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~Group(); 16virtual ~Group();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "Group"; } 23const char * className() const { return "Group"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ImageParam-generated.h b/kabc/vcard/include/generated/ImageParam-generated.h
index 81edfd2..91b09a4 100644
--- a/kabc/vcard/include/generated/ImageParam-generated.h
+++ b/kabc/vcard/include/generated/ImageParam-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4ImageParam(); 6ImageParam();
5ImageParam(const ImageParam&); 7ImageParam(const ImageParam&);
6ImageParam(const QCString&); 8ImageParam(const Q3CString&);
7ImageParam & operator = (ImageParam&); 9ImageParam & operator = (ImageParam&);
8ImageParam & operator = (const QCString&); 10ImageParam & operator = (const Q3CString&);
9bool operator ==(ImageParam&); 11bool operator ==(ImageParam&);
10bool operator !=(ImageParam& x) {return !(*this==x);} 12bool operator !=(ImageParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ImageParam a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {ImageParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~ImageParam(); 16virtual ~ImageParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "ImageParam"; } 23const char * className() const { return "ImageParam"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ImageValue-generated.h b/kabc/vcard/include/generated/ImageValue-generated.h
index 5a2c493..d71282e 100644
--- a/kabc/vcard/include/generated/ImageValue-generated.h
+++ b/kabc/vcard/include/generated/ImageValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4ImageValue(); 6ImageValue();
5ImageValue(const ImageValue&); 7ImageValue(const ImageValue&);
6ImageValue(const QCString&); 8ImageValue(const Q3CString&);
7ImageValue & operator = (ImageValue&); 9ImageValue & operator = (ImageValue&);
8ImageValue & operator = (const QCString&); 10ImageValue & operator = (const Q3CString&);
9bool operator ==(ImageValue&); 11bool operator ==(ImageValue&);
10bool operator !=(ImageValue& x) {return !(*this==x);} 12bool operator !=(ImageValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ImageValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {ImageValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~ImageValue(); 16virtual ~ImageValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "ImageValue"; } 23const char * className() const { return "ImageValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ImgParam-generated.h b/kabc/vcard/include/generated/ImgParam-generated.h
index 46a6ca0..461ca6d 100644
--- a/kabc/vcard/include/generated/ImgParam-generated.h
+++ b/kabc/vcard/include/generated/ImgParam-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4ImgParam(); 6ImgParam();
5ImgParam(const ImgParam&); 7ImgParam(const ImgParam&);
6ImgParam(const QCString&); 8ImgParam(const Q3CString&);
7ImgParam & operator = (ImgParam&); 9ImgParam & operator = (ImgParam&);
8ImgParam & operator = (const QCString&); 10ImgParam & operator = (const Q3CString&);
9bool operator ==(ImgParam&); 11bool operator ==(ImgParam&);
10bool operator !=(ImgParam& x) {return !(*this==x);} 12bool operator !=(ImgParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ImgParam a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {ImgParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~ImgParam(); 16virtual ~ImgParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21virtual const char * className() const { return "ImgParam"; } 23virtual const char * className() const { return "ImgParam"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ImgValue-generated.h b/kabc/vcard/include/generated/ImgValue-generated.h
index d75d545..80ee646 100644
--- a/kabc/vcard/include/generated/ImgValue-generated.h
+++ b/kabc/vcard/include/generated/ImgValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4ImgValue(); 6ImgValue();
5ImgValue(const ImgValue&); 7ImgValue(const ImgValue&);
6ImgValue(const QCString&); 8ImgValue(const Q3CString&);
7ImgValue & operator = (ImgValue&); 9ImgValue & operator = (ImgValue&);
8ImgValue & operator = (const QCString&); 10ImgValue & operator = (const Q3CString&);
9bool operator ==(ImgValue&); 11bool operator ==(ImgValue&);
10bool operator !=(ImgValue& x) {return !(*this==x);} 12bool operator !=(ImgValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {ImgValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {ImgValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~ImgValue(); 16virtual ~ImgValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21virtual const char * className() const { return "ImgValue"; } 23virtual const char * className() const { return "ImgValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/LangValue-generated.h b/kabc/vcard/include/generated/LangValue-generated.h
index 23e138b..434f762 100644
--- a/kabc/vcard/include/generated/LangValue-generated.h
+++ b/kabc/vcard/include/generated/LangValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4LangValue(); 6LangValue();
5LangValue(const LangValue&); 7LangValue(const LangValue&);
6LangValue(const QCString&); 8LangValue(const Q3CString&);
7LangValue & operator = (LangValue&); 9LangValue & operator = (LangValue&);
8LangValue & operator = (const QCString&); 10LangValue & operator = (const Q3CString&);
9bool operator ==(LangValue&); 11bool operator ==(LangValue&);
10bool operator !=(LangValue& x) {return !(*this==x);} 12bool operator !=(LangValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {LangValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {LangValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~LangValue(); 16virtual ~LangValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "LangValue"; } 23const char * className() const { return "LangValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/NValue-generated.h b/kabc/vcard/include/generated/NValue-generated.h
index 082c253..086810f 100644
--- a/kabc/vcard/include/generated/NValue-generated.h
+++ b/kabc/vcard/include/generated/NValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4NValue(); 6NValue();
5NValue(const NValue&); 7NValue(const NValue&);
6NValue(const QCString&); 8NValue(const Q3CString&);
7NValue & operator = (NValue&); 9NValue & operator = (NValue&);
8NValue & operator = (const QCString&); 10NValue & operator = (const Q3CString&);
9bool operator ==(NValue&); 11bool operator ==(NValue&);
10bool operator !=(NValue& x) {return !(*this==x);} 12bool operator !=(NValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {NValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {NValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~NValue(); 16virtual ~NValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "NValue"; } 23const char * className() const { return "NValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/Name-generated.h b/kabc/vcard/include/generated/Name-generated.h
index 0e69abd..a3bcb25 100644
--- a/kabc/vcard/include/generated/Name-generated.h
+++ b/kabc/vcard/include/generated/Name-generated.h
@@ -1,22 +1,24 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4V_Name(); 6V_Name();
5V_Name(const V_Name&); 7V_Name(const V_Name&);
6V_Name(const QCString&); 8V_Name(const Q3CString&);
7V_Name & operator = (V_Name&); 9V_Name & operator = (V_Name&);
8V_Name & operator = (const QCString&); 10V_Name & operator = (const Q3CString&);
9bool operator ==(V_Name&); 11bool operator ==(V_Name&);
10bool operator !=(V_Name& x) {return !(*this==x);} 12bool operator !=(V_Name& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {V_Name a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {V_Name a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~V_Name(); 16virtual ~V_Name();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21 23
22// End of automatically generated code // 24// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/OrgValue-generated.h b/kabc/vcard/include/generated/OrgValue-generated.h
index 51eb1b7..275f56f 100644
--- a/kabc/vcard/include/generated/OrgValue-generated.h
+++ b/kabc/vcard/include/generated/OrgValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4OrgValue(); 6OrgValue();
5OrgValue(const OrgValue&); 7OrgValue(const OrgValue&);
6OrgValue(const QCString&); 8OrgValue(const Q3CString&);
7OrgValue & operator = (OrgValue&); 9OrgValue & operator = (OrgValue&);
8OrgValue & operator = (const QCString&); 10OrgValue & operator = (const Q3CString&);
9bool operator ==(OrgValue&); 11bool operator ==(OrgValue&);
10bool operator !=(OrgValue& x) {return !(*this==x);} 12bool operator !=(OrgValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {OrgValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {OrgValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~OrgValue(); 16virtual ~OrgValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "OrgValue"; } 23const char * className() const { return "OrgValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/Param-generated.h b/kabc/vcard/include/generated/Param-generated.h
index cf4666a..1a35166 100644
--- a/kabc/vcard/include/generated/Param-generated.h
+++ b/kabc/vcard/include/generated/Param-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4Param(); 6Param();
5Param(const Param&); 7Param(const Param&);
6Param(const QCString&); 8Param(const Q3CString&);
7Param & operator = (Param&); 9Param & operator = (Param&);
8Param & operator = (const QCString&); 10Param & operator = (const Q3CString&);
9bool operator ==(Param&); 11bool operator ==(Param&);
10bool operator !=(Param& x) {return !(*this==x);} 12bool operator !=(Param& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {Param a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {Param a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~Param(); 16virtual ~Param();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "Param"; } 23const char * className() const { return "Param"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ParamName-generated.h b/kabc/vcard/include/generated/ParamName-generated.h
index ef673c3..b45022e 100644
--- a/kabc/vcard/include/generated/ParamName-generated.h
+++ b/kabc/vcard/include/generated/ParamName-generated.h
@@ -1,22 +1,24 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4V_ParamName(); 6V_ParamName();
5V_ParamName(const V_ParamName&); 7V_ParamName(const V_ParamName&);
6V_ParamName(const QCString&); 8V_ParamName(const Q3CString&);
7V_ParamName & operator = (V_ParamName&); 9V_ParamName & operator = (V_ParamName&);
8V_ParamName & operator = (const QCString&); 10V_ParamName & operator = (const Q3CString&);
9bool operator ==(V_ParamName&); 11bool operator ==(V_ParamName&);
10bool operator !=(V_ParamName& x) {return !(*this==x);} 12bool operator !=(V_ParamName& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {V_ParamName a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {V_ParamName a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~V_ParamName(); 16virtual ~V_ParamName();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21 23
22// End of automatically generated code // 24// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/ParamValue-generated.h b/kabc/vcard/include/generated/ParamValue-generated.h
index e73500f..956c8da 100644
--- a/kabc/vcard/include/generated/ParamValue-generated.h
+++ b/kabc/vcard/include/generated/ParamValue-generated.h
@@ -1,22 +1,24 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4V_ParamValue(); 6V_ParamValue();
5V_ParamValue(const V_ParamValue&); 7V_ParamValue(const V_ParamValue&);
6V_ParamValue(const QCString&); 8V_ParamValue(const Q3CString&);
7V_ParamValue & operator = (V_ParamValue&); 9V_ParamValue & operator = (V_ParamValue&);
8V_ParamValue & operator = (const QCString&); 10V_ParamValue & operator = (const Q3CString&);
9bool operator ==(V_ParamValue&); 11bool operator ==(V_ParamValue&);
10bool operator !=(V_ParamValue& x) {return !(*this==x);} 12bool operator !=(V_ParamValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {V_ParamValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {V_ParamValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~V_ParamValue(); 16virtual ~V_ParamValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21 23
22// End of automatically generated code // 24// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/PhoneNumberValue-generated.h b/kabc/vcard/include/generated/PhoneNumberValue-generated.h
index 1320f18..0d206f4 100644
--- a/kabc/vcard/include/generated/PhoneNumberValue-generated.h
+++ b/kabc/vcard/include/generated/PhoneNumberValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4PhoneNumberValue(); 6PhoneNumberValue();
5PhoneNumberValue(const PhoneNumberValue&); 7PhoneNumberValue(const PhoneNumberValue&);
6PhoneNumberValue(const QCString&); 8PhoneNumberValue(const Q3CString&);
7PhoneNumberValue & operator = (PhoneNumberValue&); 9PhoneNumberValue & operator = (PhoneNumberValue&);
8PhoneNumberValue & operator = (const QCString&); 10PhoneNumberValue & operator = (const Q3CString&);
9bool operator ==(PhoneNumberValue&); 11bool operator ==(PhoneNumberValue&);
10bool operator !=(PhoneNumberValue& x) {return !(*this==x);} 12bool operator !=(PhoneNumberValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {PhoneNumberValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {PhoneNumberValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~PhoneNumberValue(); 16virtual ~PhoneNumberValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "PhoneNumberValue"; } 23const char * className() const { return "PhoneNumberValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/SoundValue-generated.h b/kabc/vcard/include/generated/SoundValue-generated.h
index a9ab2e8..2cc9c0d 100644
--- a/kabc/vcard/include/generated/SoundValue-generated.h
+++ b/kabc/vcard/include/generated/SoundValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4SoundValue(); 6SoundValue();
5SoundValue(const SoundValue&); 7SoundValue(const SoundValue&);
6SoundValue(const QCString&); 8SoundValue(const Q3CString&);
7SoundValue & operator = (SoundValue&); 9SoundValue & operator = (SoundValue&);
8SoundValue & operator = (const QCString&); 10SoundValue & operator = (const Q3CString&);
9bool operator ==(SoundValue&); 11bool operator ==(SoundValue&);
10bool operator !=(SoundValue& x) {return !(*this==x);} 12bool operator !=(SoundValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {SoundValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {SoundValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~SoundValue(); 16virtual ~SoundValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "SoundValue"; } 23const char * className() const { return "SoundValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/SourceParam-generated.h b/kabc/vcard/include/generated/SourceParam-generated.h
index 75fefb8..537e093 100644
--- a/kabc/vcard/include/generated/SourceParam-generated.h
+++ b/kabc/vcard/include/generated/SourceParam-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4SourceParam(); 6SourceParam();
5SourceParam(const SourceParam&); 7SourceParam(const SourceParam&);
6SourceParam(const QCString&); 8SourceParam(const Q3CString&);
7SourceParam & operator = (SourceParam&); 9SourceParam & operator = (SourceParam&);
8SourceParam & operator = (const QCString&); 10SourceParam & operator = (const Q3CString&);
9bool operator ==(SourceParam&); 11bool operator ==(SourceParam&);
10bool operator !=(SourceParam& x) {return !(*this==x);} 12bool operator !=(SourceParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {SourceParam a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {SourceParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~SourceParam(); 16virtual ~SourceParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "SourceParam"; } 23const char * className() const { return "SourceParam"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TelParam-generated.h b/kabc/vcard/include/generated/TelParam-generated.h
index 3ee77cc..8d9ba0f 100644
--- a/kabc/vcard/include/generated/TelParam-generated.h
+++ b/kabc/vcard/include/generated/TelParam-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4TelParam(); 6TelParam();
5TelParam(const TelParam&); 7TelParam(const TelParam&);
6TelParam(const QCString&); 8TelParam(const Q3CString&);
7TelParam & operator = (TelParam&); 9TelParam & operator = (TelParam&);
8TelParam & operator = (const QCString&); 10TelParam & operator = (const Q3CString&);
9bool operator ==(TelParam&); 11bool operator ==(TelParam&);
10bool operator !=(TelParam& x) {return !(*this==x);} 12bool operator !=(TelParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TelParam a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {TelParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~TelParam(); 16virtual ~TelParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "TelParam"; } 23const char * className() const { return "TelParam"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TelValue-generated.h b/kabc/vcard/include/generated/TelValue-generated.h
index 3213e1c..b72fa7d 100644
--- a/kabc/vcard/include/generated/TelValue-generated.h
+++ b/kabc/vcard/include/generated/TelValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4TelValue(); 6TelValue();
5TelValue(const TelValue&); 7TelValue(const TelValue&);
6TelValue(const QCString&); 8TelValue(const Q3CString&);
7TelValue & operator = (TelValue&); 9TelValue & operator = (TelValue&);
8TelValue & operator = (const QCString&); 10TelValue & operator = (const Q3CString&);
9bool operator ==(TelValue&); 11bool operator ==(TelValue&);
10bool operator !=(TelValue& x) {return !(*this==x);} 12bool operator !=(TelValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TelValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {TelValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~TelValue(); 16virtual ~TelValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "TelValue"; } 23const char * className() const { return "TelValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextBinParam-generated.h b/kabc/vcard/include/generated/TextBinParam-generated.h
index d075c10..2e433b0 100644
--- a/kabc/vcard/include/generated/TextBinParam-generated.h
+++ b/kabc/vcard/include/generated/TextBinParam-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4TextBinParam(); 6TextBinParam();
5TextBinParam(const TextBinParam&); 7TextBinParam(const TextBinParam&);
6TextBinParam(const QCString&); 8TextBinParam(const Q3CString&);
7TextBinParam & operator = (TextBinParam&); 9TextBinParam & operator = (TextBinParam&);
8TextBinParam & operator = (const QCString&); 10TextBinParam & operator = (const Q3CString&);
9bool operator ==(TextBinParam&); 11bool operator ==(TextBinParam&);
10bool operator !=(TextBinParam& x) {return !(*this==x);} 12bool operator !=(TextBinParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextBinParam a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {TextBinParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~TextBinParam(); 16virtual ~TextBinParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "TextBinParam"; } 23const char * className() const { return "TextBinParam"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextBinValue-generated.h b/kabc/vcard/include/generated/TextBinValue-generated.h
index e9553ac..bc3ad61 100644
--- a/kabc/vcard/include/generated/TextBinValue-generated.h
+++ b/kabc/vcard/include/generated/TextBinValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4TextBinValue(); 6TextBinValue();
5TextBinValue(const TextBinValue&); 7TextBinValue(const TextBinValue&);
6TextBinValue(const QCString&); 8TextBinValue(const Q3CString&);
7TextBinValue & operator = (TextBinValue&); 9TextBinValue & operator = (TextBinValue&);
8TextBinValue & operator = (const QCString&); 10TextBinValue & operator = (const Q3CString&);
9bool operator ==(TextBinValue&); 11bool operator ==(TextBinValue&);
10bool operator !=(TextBinValue& x) {return !(*this==x);} 12bool operator !=(TextBinValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextBinValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {TextBinValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~TextBinValue(); 16virtual ~TextBinValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "TextBinValue"; } 23const char * className() const { return "TextBinValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextListValue-generated.h b/kabc/vcard/include/generated/TextListValue-generated.h
index 9f46124..9df8a46 100644
--- a/kabc/vcard/include/generated/TextListValue-generated.h
+++ b/kabc/vcard/include/generated/TextListValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4TextListValue(); 6TextListValue();
5TextListValue(const TextListValue&); 7TextListValue(const TextListValue&);
6TextListValue(const QCString&); 8TextListValue(const Q3CString&);
7TextListValue & operator = (TextListValue&); 9TextListValue & operator = (TextListValue&);
8TextListValue & operator = (const QCString&); 10TextListValue & operator = (const Q3CString&);
9bool operator ==(TextListValue&); 11bool operator ==(TextListValue&);
10bool operator !=(TextListValue& x) {return !(*this==x);} 12bool operator !=(TextListValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextListValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {TextListValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~TextListValue(); 16virtual ~TextListValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "TextListValue"; } 23const char * className() const { return "TextListValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextNSParam-generated.h b/kabc/vcard/include/generated/TextNSParam-generated.h
index d7f58ca..8842bd6 100644
--- a/kabc/vcard/include/generated/TextNSParam-generated.h
+++ b/kabc/vcard/include/generated/TextNSParam-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4TextNSParam(); 6TextNSParam();
5TextNSParam(const TextNSParam&); 7TextNSParam(const TextNSParam&);
6TextNSParam(const QCString&); 8TextNSParam(const Q3CString&);
7TextNSParam & operator = (TextNSParam&); 9TextNSParam & operator = (TextNSParam&);
8TextNSParam & operator = (const QCString&); 10TextNSParam & operator = (const Q3CString&);
9bool operator ==(TextNSParam&); 11bool operator ==(TextNSParam&);
10bool operator !=(TextNSParam& x) {return !(*this==x);} 12bool operator !=(TextNSParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextNSParam a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {TextNSParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~TextNSParam(); 16virtual ~TextNSParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "TextNSParam"; } 23const char * className() const { return "TextNSParam"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextParam-generated.h b/kabc/vcard/include/generated/TextParam-generated.h
index 154e1bf..e56a8a5 100644
--- a/kabc/vcard/include/generated/TextParam-generated.h
+++ b/kabc/vcard/include/generated/TextParam-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4TextParam(); 6TextParam();
5TextParam(const TextParam&); 7TextParam(const TextParam&);
6TextParam(const QCString&); 8TextParam(const Q3CString&);
7TextParam & operator = (TextParam&); 9TextParam & operator = (TextParam&);
8TextParam & operator = (const QCString&); 10TextParam & operator = (const Q3CString&);
9bool operator ==(TextParam&); 11bool operator ==(TextParam&);
10bool operator !=(TextParam& x) {return !(*this==x);} 12bool operator !=(TextParam& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextParam a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {TextParam a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~TextParam(); 16virtual ~TextParam();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "TextParam"; } 23const char * className() const { return "TextParam"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/TextValue-generated.h b/kabc/vcard/include/generated/TextValue-generated.h
index e1c4dcc..3f205e0 100644
--- a/kabc/vcard/include/generated/TextValue-generated.h
+++ b/kabc/vcard/include/generated/TextValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4TextValue(); 6TextValue();
5TextValue(const TextValue&); 7TextValue(const TextValue&);
6TextValue(const QCString&); 8TextValue(const Q3CString&);
7TextValue & operator = (TextValue&); 9TextValue & operator = (TextValue&);
8TextValue & operator = (const QCString&); 10TextValue & operator = (const Q3CString&);
9bool operator ==(TextValue&); 11bool operator ==(TextValue&);
10bool operator !=(TextValue& x) {return !(*this==x);} 12bool operator !=(TextValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {TextValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {TextValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~TextValue(); 16virtual ~TextValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "TextValue"; } 23const char * className() const { return "TextValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/URIValue-generated.h b/kabc/vcard/include/generated/URIValue-generated.h
index dbcb5c1..464178f 100644
--- a/kabc/vcard/include/generated/URIValue-generated.h
+++ b/kabc/vcard/include/generated/URIValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4URIValue(); 6URIValue();
5URIValue(const URIValue&); 7URIValue(const URIValue&);
6URIValue(const QCString&); 8URIValue(const Q3CString&);
7URIValue & operator = (URIValue&); 9URIValue & operator = (URIValue&);
8URIValue & operator = (const QCString&); 10URIValue & operator = (const Q3CString&);
9bool operator ==(URIValue&); 11bool operator ==(URIValue&);
10bool operator !=(URIValue& x) {return !(*this==x);} 12bool operator !=(URIValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {URIValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {URIValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~URIValue(); 16virtual ~URIValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "URIValue"; } 23const char * className() const { return "URIValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/UTCValue-generated.h b/kabc/vcard/include/generated/UTCValue-generated.h
index 46e447b..1a34b5c 100644
--- a/kabc/vcard/include/generated/UTCValue-generated.h
+++ b/kabc/vcard/include/generated/UTCValue-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4UTCValue(); 6UTCValue();
5UTCValue(const UTCValue&); 7UTCValue(const UTCValue&);
6UTCValue(const QCString&); 8UTCValue(const Q3CString&);
7UTCValue & operator = (UTCValue&); 9UTCValue & operator = (UTCValue&);
8UTCValue & operator = (const QCString&); 10UTCValue & operator = (const Q3CString&);
9bool operator ==(UTCValue&); 11bool operator ==(UTCValue&);
10bool operator !=(UTCValue& x) {return !(*this==x);} 12bool operator !=(UTCValue& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {UTCValue a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {UTCValue a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~UTCValue(); 16virtual ~UTCValue();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "UTCValue"; } 23const char * className() const { return "UTCValue"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/VCard-generated.h b/kabc/vcard/include/generated/VCard-generated.h
index 4d7d96d..d09c789 100644
--- a/kabc/vcard/include/generated/VCard-generated.h
+++ b/kabc/vcard/include/generated/VCard-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4VCard(); 6VCard();
5VCard(const VCard&); 7VCard(const VCard&);
6VCard(const QCString&); 8VCard(const Q3CString&);
7VCard & operator = (VCard&); 9VCard & operator = (VCard&);
8VCard & operator = (const QCString&); 10VCard & operator = (const Q3CString&);
9bool operator ==(VCard&); 11bool operator ==(VCard&);
10bool operator !=(VCard& x) {return !(*this==x);} 12bool operator !=(VCard& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {VCard a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {VCard a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~VCard(); 16virtual ~VCard();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "VCard"; } 23const char * className() const { return "VCard"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/VCardEntity-generated.h b/kabc/vcard/include/generated/VCardEntity-generated.h
index 9f2dfbc..cbbe8e1 100644
--- a/kabc/vcard/include/generated/VCardEntity-generated.h
+++ b/kabc/vcard/include/generated/VCardEntity-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4VCardEntity(); 6VCardEntity();
5VCardEntity(const VCardEntity&); 7VCardEntity(const VCardEntity&);
6VCardEntity(const QCString&); 8VCardEntity(const Q3CString&);
7VCardEntity & operator = (VCardEntity&); 9VCardEntity & operator = (VCardEntity&);
8VCardEntity & operator = (const QCString&); 10VCardEntity & operator = (const Q3CString&);
9bool operator ==(VCardEntity&); 11bool operator ==(VCardEntity&);
10bool operator !=(VCardEntity& x) {return !(*this==x);} 12bool operator !=(VCardEntity& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {VCardEntity a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {VCardEntity a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~VCardEntity(); 16virtual ~VCardEntity();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "VCardEntity"; } 23const char * className() const { return "VCardEntity"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/include/generated/Value-generated.h b/kabc/vcard/include/generated/Value-generated.h
index 7afac34..142e720 100644
--- a/kabc/vcard/include/generated/Value-generated.h
+++ b/kabc/vcard/include/generated/Value-generated.h
@@ -1,23 +1,25 @@
1//Added by qt3to4:
2#include <Q3CString>
1// XXX Automatically generated. DO NOT EDIT! XXX // 3// XXX Automatically generated. DO NOT EDIT! XXX //
2 4
3public: 5public:
4Value(); 6Value();
5Value(const Value&); 7Value(const Value&);
6Value(const QCString&); 8Value(const Q3CString&);
7Value & operator = (Value&); 9Value & operator = (Value&);
8Value & operator = (const QCString&); 10Value & operator = (const Q3CString&);
9bool operator ==(Value&); 11bool operator ==(Value&);
10bool operator !=(Value& x) {return !(*this==x);} 12bool operator !=(Value& x) {return !(*this==x);}
11bool operator ==(const QCString& s) {Value a(s);return(*this==a);} 13bool operator ==(const Q3CString& s) {Value a(s);return(*this==a);}
12bool operator != (const QCString& s) {return !(*this == s);} 14bool operator != (const Q3CString& s) {return !(*this == s);}
13 15
14virtual ~Value(); 16virtual ~Value();
15void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 17void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;}
16 18
17void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 19void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;}
18 20
19void _parse(); 21void _parse();
20void _assemble(); 22void _assemble();
21const char * className() const { return "Value"; } 23const char * className() const { return "Value"; }
22 24
23// End of automatically generated code // 25// End of automatically generated code //
diff --git a/kabc/vcard/testread.cpp b/kabc/vcard/testread.cpp
index 919c661..4d66aaf 100644
--- a/kabc/vcard/testread.cpp
+++ b/kabc/vcard/testread.cpp
@@ -1,40 +1,42 @@
1#include <iostream> 1#include <iostream>
2#include <stdlib.h> 2#include <stdlib.h>
3#include <assert.h> 3#include <assert.h>
4 4
5#include <qfile.h> 5#include <qfile.h>
6#include <qtextstream.h> 6#include <q3textstream.h>
7//Added by qt3to4:
8#include <Q3CString>
7 9
8#include <VCard.h> 10#include <VCard.h>
9 11
10using namespace std; 12using namespace std;
11 13
12int main(int argc, char * argv[]) 14int main(int argc, char * argv[])
13{ 15{
14 if (argc != 2) { 16 if (argc != 2) {
15 cerr << "Usage: " << argv[0] << " <filename>" << endl; 17 cerr << "Usage: " << argv[0] << " <filename>" << endl;
16 exit(1); 18 exit(1);
17 } 19 }
18 20
19 QFile f(argv[1]); 21 QFile f(argv[1]);
20 22
21 QCString str; 23 Q3CString str;
22 24
23 if (!f.open(IO_ReadOnly)) { 25 if (!f.open(QIODevice::ReadOnly)) {
24 cerr << "Couldn't open file \"" << argv[1] << endl; 26 cerr << "Couldn't open file \"" << argv[1] << endl;
25 exit(1); 27 exit(1);
26 } 28 }
27 29
28 QTextStream t(&f); 30 Q3TextStream t(&f);
29 31
30 while (!t.eof()) 32 while (!t.eof())
31 str += t.readLine().utf8() + '\n'; 33 str += t.readLine().utf8() + '\n';
32 34
33 using namespace VCARD; 35 using namespace VCARD;
34 36
35 // Iterate through all vCards in the file. 37 // Iterate through all vCards in the file.
36 38
37 cout << "--------- begin ----------" << endl; 39 cout << "--------- begin ----------" << endl;
38 cout << str.data(); 40 cout << str.data();
39 cout << "--------- end ----------" << endl; 41 cout << "--------- end ----------" << endl;
40 42
@@ -43,25 +45,25 @@ int main(int argc, char * argv[])
43 VCardListIterator it(e.cardList()); 45 VCardListIterator it(e.cardList());
44 46
45 for (; it.current(); ++it) { 47 for (; it.current(); ++it) {
46 48
47 cerr << "****************** VCARD ********************" << endl; 49 cerr << "****************** VCARD ********************" << endl;
48 50
49 // Create a vcard using the string representation. 51 // Create a vcard using the string representation.
50 VCard & v (*it.current()); 52 VCard & v (*it.current());
51 53
52 if (v.has(EntityEmail)) { 54 if (v.has(EntityEmail)) {
53 cerr << "Email parameter found" << endl; 55 cerr << "Email parameter found" << endl;
54 56
55 QCString s = v.contentLine(EntityEmail)->value()->asString(); 57 Q3CString s = v.contentLine(EntityEmail)->value()->asString();
56 58
57 cerr << "Email value == " << s << endl; 59 cerr << "Email value == " << s << endl;
58 } 60 }
59 61
60 if (v.has(EntityNickname)) { 62 if (v.has(EntityNickname)) {
61 cerr << "Nickname parameter found" << endl; 63 cerr << "Nickname parameter found" << endl;
62 64
63 cerr << "Nickname value == " << 65 cerr << "Nickname value == " <<
64 v.contentLine(EntityNickname)->value()->asString() << 66 v.contentLine(EntityNickname)->value()->asString() <<
65 endl; 67 endl;
66 } 68 }
67 69
diff --git a/kabc/vcard/testwrite.cpp b/kabc/vcard/testwrite.cpp
index e4bbe7b..846e51a 100644
--- a/kabc/vcard/testwrite.cpp
+++ b/kabc/vcard/testwrite.cpp
@@ -1,19 +1,21 @@
1#include <kaboutdata.h> 1#include <kaboutdata.h>
2#include <kapplication.h> 2#include <kapplication.h>
3#include <kdebug.h> 3#include <kdebug.h>
4#include <klocale.h> 4#include <klocale.h>
5#include <kcmdlineargs.h> 5#include <kcmdlineargs.h>
6 6
7#include <VCard.h> 7#include <VCard.h>
8//Added by qt3to4:
9#include <Q3CString>
8 10
9int main(int argc,char **argv) 11int main(int argc,char **argv)
10{ 12{
11 KAboutData aboutData("testwrite",I18N_NOOP("TestWritevCard"),"0.1"); 13 KAboutData aboutData("testwrite",I18N_NOOP("TestWritevCard"),"0.1");
12 KCmdLineArgs::init(argc,argv,&aboutData); 14 KCmdLineArgs::init(argc,argv,&aboutData);
13 15
14 KApplication app; 16 KApplication app;
15 17
16 kdDebug() << "Test Write VCard" << endl; 18 kdDebug() << "Test Write VCard" << endl;
17 19
18 using namespace VCARD; 20 using namespace VCARD;
19 21
@@ -24,18 +26,18 @@ int main(int argc,char **argv)
24 cl1.setValue(new TextValue("Hans Wurst")); 26 cl1.setValue(new TextValue("Hans Wurst"));
25 v.add(cl1); 27 v.add(cl1);
26 28
27 ContentLine cl2; 29 ContentLine cl2;
28 cl2.setName(EntityTypeToParamName(EntityTelephone)); 30 cl2.setName(EntityTypeToParamName(EntityTelephone));
29 cl2.setValue(new TelValue("12345")); 31 cl2.setValue(new TelValue("12345"));
30 ParamList p; 32 ParamList p;
31 p.append( new TelParam("home") ); 33 p.append( new TelParam("home") );
32 p.append( new TelParam("fax") ); 34 p.append( new TelParam("fax") );
33 cl2.setParamList( p ); 35 cl2.setParamList( p );
34 v.add(cl2); 36 v.add(cl2);
35 37
36 QCString str = v.asString(); 38 Q3CString str = v.asString();
37 39
38 kdDebug() << "--- VCard begin ---" << endl 40 kdDebug() << "--- VCard begin ---" << endl
39 << str 41 << str
40 << "--- VCard end ---" << endl; 42 << "--- VCard end ---" << endl;
41} 43}
diff --git a/kabc/vcard21parser.cpp b/kabc/vcard21parser.cpp
index 60d02b8..e24a9dc 100644
--- a/kabc/vcard21parser.cpp
+++ b/kabc/vcard21parser.cpp
@@ -18,43 +18,45 @@
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <qmap.h> 28#include <qmap.h>
29#include <qregexp.h> 29#include <qregexp.h>
30//Added by qt3to4:
31#include <Q3ValueList>
30#include <kmdcodec.h> 32#include <kmdcodec.h>
31 33
32#include "vcard21parser.h" 34#include "vcard21parser.h"
33#include "vcardconverter.h" 35#include "vcardconverter.h"
34 36
35using namespace KABC; 37using namespace KABC;
36 38
37bool VCardLineX::isValid() const 39bool VCardLineX::isValid() const
38{ 40{
39 // Invalid: if it is "begin:vcard" or "end:vcard" 41 // Invalid: if it is "begin:vcard" or "end:vcard"
40 if ( name == VCARD_BEGIN_N || name == VCARD_END_N ) 42 if ( name == VCARD_BEGIN_N || name == VCARD_END_N )
41 return false; 43 return false;
42 44
43 if ( name[0] == 'x' && name[1] == '-' ) // A custom x- line 45 if ( name[0] == 'x' && name[1] == '-' ) // A custom x- line
44 return true; 46 return true;
45 47
46 // This is long but it makes it a bit faster (and saves me from using 48 // This is long but it makes it a bit faster (and saves me from using
47 // a tree which is probably the ideal situation, but a bit memory heavy) 49 // a tree which is probably the ideal situation, but a bit memory heavy)
48 switch( name[0] ) { 50 switch( name[0].unicode() ) {
49 case 'a': 51 case 'a':
50 if ( name == VCARD_ADR && qualified && 52 if ( name == VCARD_ADR && qualified &&
51 (qualifiers.contains(VCARD_ADR_DOM) || 53 (qualifiers.contains(VCARD_ADR_DOM) ||
52 qualifiers.contains(VCARD_ADR_INTL) || 54 qualifiers.contains(VCARD_ADR_INTL) ||
53 qualifiers.contains(VCARD_ADR_POSTAL) || 55 qualifiers.contains(VCARD_ADR_POSTAL) ||
54 qualifiers.contains(VCARD_ADR_HOME) || 56 qualifiers.contains(VCARD_ADR_HOME) ||
55 qualifiers.contains(VCARD_ADR_WORK) || 57 qualifiers.contains(VCARD_ADR_WORK) ||
56 qualifiers.contains(VCARD_ADR_PREF) 58 qualifiers.contains(VCARD_ADR_PREF)
57 ) ) 59 ) )
58 return true; 60 return true;
59 61
60 if ( name == VCARD_AGENT ) 62 if ( name == VCARD_AGENT )
@@ -260,25 +262,25 @@ KABC::Addressee VCard21Parser::readFromString( const QString &data)
260 tmpStr = mVCard->getValue(VCARD_URL); 262 tmpStr = mVCard->getValue(VCARD_URL);
261 if (tmpStr.isEmpty()) tmpStr = mVCard->getValue(VCARD_URL, VCARD_ADR_WORK); 263 if (tmpStr.isEmpty()) tmpStr = mVCard->getValue(VCARD_URL, VCARD_ADR_WORK);
262 if (tmpStr.isEmpty()) tmpStr = mVCard->getValue(VCARD_URL, VCARD_ADR_HOME); 264 if (tmpStr.isEmpty()) tmpStr = mVCard->getValue(VCARD_URL, VCARD_ADR_HOME);
263 if (!tmpStr.isEmpty()) { 265 if (!tmpStr.isEmpty()) {
264 addressee.setUrl(KURL(tmpStr)); 266 addressee.setUrl(KURL(tmpStr));
265 } 267 }
266 268
267 //set the addressee's birthday 269 //set the addressee's birthday
268 tmpStr = mVCard->getValue(VCARD_BDAY); 270 tmpStr = mVCard->getValue(VCARD_BDAY);
269 addressee.setBirthday(VCardStringToDate(tmpStr)); 271 addressee.setBirthday(VCardStringToDate(tmpStr));
270 272
271 //set the addressee's phone numbers 273 //set the addressee's phone numbers
272 for ( QValueListIterator<VCardLineX> i = mVCard->_vcdata->begin();i != mVCard->_vcdata->end(); ++i ) { 274 for ( Q3ValueListIterator<VCardLineX> i = mVCard->_vcdata->begin();i != mVCard->_vcdata->end(); ++i ) {
273 if ( (*i).name == VCARD_TEL ) { 275 if ( (*i).name == VCARD_TEL ) {
274 int type = 0; 276 int type = 0;
275 if ( (*i).qualified ) { 277 if ( (*i).qualified ) {
276 if ( (*i).qualifiers.contains( VCARD_TEL_HOME ) ) 278 if ( (*i).qualifiers.contains( VCARD_TEL_HOME ) )
277 type |= PhoneNumber::Home; 279 type |= PhoneNumber::Home;
278 if ( (*i).qualifiers.contains( VCARD_TEL_WORK ) ) 280 if ( (*i).qualifiers.contains( VCARD_TEL_WORK ) )
279 type |= PhoneNumber::Work; 281 type |= PhoneNumber::Work;
280 if ( (*i).qualifiers.contains( VCARD_TEL_PREF ) ) 282 if ( (*i).qualifiers.contains( VCARD_TEL_PREF ) )
281 type |= PhoneNumber::Pref; 283 type |= PhoneNumber::Pref;
282 if ( (*i).qualifiers.contains( VCARD_TEL_VOICE ) ) 284 if ( (*i).qualifiers.contains( VCARD_TEL_VOICE ) )
283 type |= PhoneNumber::Voice; 285 type |= PhoneNumber::Voice;
284 if ( (*i).qualifiers.contains( VCARD_TEL_FAX ) ) 286 if ( (*i).qualifiers.contains( VCARD_TEL_FAX ) )
@@ -299,44 +301,47 @@ KABC::Addressee VCard21Parser::readFromString( const QString &data)
299 type |= PhoneNumber::Isdn; 301 type |= PhoneNumber::Isdn;
300 if ( (*i).qualifiers.contains( VCARD_TEL_VIDEO ) ) 302 if ( (*i).qualifiers.contains( VCARD_TEL_VIDEO ) )
301 type |= PhoneNumber::Video; 303 type |= PhoneNumber::Video;
302 if ( (*i).qualifiers.contains( VCARD_TEL_PCS ) ) 304 if ( (*i).qualifiers.contains( VCARD_TEL_PCS ) )
303 type |= PhoneNumber::Pcs; 305 type |= PhoneNumber::Pcs;
304 306
305 } 307 }
306 addressee.insertPhoneNumber( PhoneNumber( (*i).parameters[ 0 ], type ) ); 308 addressee.insertPhoneNumber( PhoneNumber( (*i).parameters[ 0 ], type ) );
307 } 309 }
308 } 310 }
309 addressee.makePhoneNumbersOLcompatible(); 311 addressee.makePhoneNumbersOLcompatible();
310 //set the addressee's addresses 312 //set the addressee's addresses
311 for ( QValueListIterator<VCardLineX> i = mVCard->_vcdata->begin();i != mVCard->_vcdata->end(); ++i ) { 313 for ( Q3ValueListIterator<VCardLineX> i = mVCard->_vcdata->begin();i != mVCard->_vcdata->end(); ++i ) {
312 if ( (*i).name == VCARD_ADR ) { 314 if ( (*i).name == VCARD_ADR ) {
313 int type = 0; 315 int type = 0;
314 if ( (*i).qualified ) { 316 if ( (*i).qualified ) {
315 if ( (*i).qualifiers.contains( VCARD_ADR_DOM ) ) 317 if ( (*i).qualifiers.contains( VCARD_ADR_DOM ) )
316 type |= Address::Dom; 318 type |= Address::Dom;
317 if ( (*i).qualifiers.contains( VCARD_ADR_INTL ) ) 319 if ( (*i).qualifiers.contains( VCARD_ADR_INTL ) )
318 type |= Address::Intl; 320 type |= Address::Intl;
319 if ( (*i).qualifiers.contains( VCARD_ADR_POSTAL ) ) 321 if ( (*i).qualifiers.contains( VCARD_ADR_POSTAL ) )
320 type |= Address::Postal; 322 type |= Address::Postal;
321 if ( (*i).qualifiers.contains( VCARD_ADR_PARCEL ) ) 323 if ( (*i).qualifiers.contains( VCARD_ADR_PARCEL ) )
322 type |= Address::Parcel; 324 type |= Address::Parcel;
323 if ( (*i).qualifiers.contains( VCARD_ADR_HOME ) ) 325 if ( (*i).qualifiers.contains( VCARD_ADR_HOME ) )
324 type |= Address::Home; 326 type |= Address::Home;
325 if ( (*i).qualifiers.contains( VCARD_ADR_WORK ) ) 327 if ( (*i).qualifiers.contains( VCARD_ADR_WORK ) )
326 type |= Address::Work; 328 type |= Address::Work;
327 if ( (*i).qualifiers.contains( VCARD_ADR_PREF ) ) 329 if ( (*i).qualifiers.contains( VCARD_ADR_PREF ) )
328 type |= Address::Pref; 330 type |= Address::Pref;
329 } 331 }
330 addressee.insertAddress( readAddressFromQStringList( (*i).parameters, type ) ); 332 QStringList tmp;
333 for(Q3ValueList<QString>::const_iterator ii=(*i).parameters.begin();ii!=(*i).parameters.end();++ii)
334 tmp.push_back(*ii);
335 addressee.insertAddress( readAddressFromQStringList( tmp, type ) );
331 } 336 }
332 } 337 }
333 338
334 //set the addressee's delivery label 339 //set the addressee's delivery label
335 tmpStr = mVCard->getValue(VCARD_LABEL); 340 tmpStr = mVCard->getValue(VCARD_LABEL);
336 if (!tmpStr.isEmpty()) { 341 if (!tmpStr.isEmpty()) {
337qDebug("VCard21Parser::readFromString please verify if replace is correct"); 342qDebug("VCard21Parser::readFromString please verify if replace is correct");
338//US tmpStr.replace("\r\n","\n"); 343//US tmpStr.replace("\r\n","\n");
339 tmpStr.replace( QRegExp("\r\n"), "\n" ); 344 tmpStr.replace( QRegExp("\r\n"), "\n" );
340 Address tmpAddress; 345 Address tmpAddress;
341 tmpAddress.setLabel(tmpStr); 346 tmpAddress.setLabel(tmpStr);
342 addressee.insertAddress(tmpAddress); 347 addressee.insertAddress(tmpAddress);
@@ -399,28 +404,28 @@ KABC::Address VCard21Parser::readAddressFromQStringList ( const QStringList &dat
399 if ( data.count() > 6 ) 404 if ( data.count() > 6 )
400 mAddress.setCountry( data[6] ); 405 mAddress.setCountry( data[6] );
401 406
402 return mAddress; 407 return mAddress;
403} 408}
404 409
405 410
406VCard21ParserImpl *VCard21ParserImpl::parseVCard( const QString& vc, int *err ) 411VCard21ParserImpl *VCard21ParserImpl::parseVCard( const QString& vc, int *err )
407{ 412{
408 int _err = 0; 413 int _err = 0;
409 int _state = VC_STATE_BEGIN; 414 int _state = VC_STATE_BEGIN;
410 415
411 QValueList<VCardLineX> *_vcdata; 416 Q3ValueList<VCardLineX> *_vcdata;
412 QValueList<QString> lines; 417 QStringList lines;
413 418
414 _vcdata = new QValueList<VCardLineX>; 419 _vcdata = new Q3ValueList<VCardLineX>;
415 420
416 lines = QStringList::split( QRegExp( "[\x0d\x0a]" ), vc ); 421 lines = QStringList::split( QRegExp( "[\x0d\x0a]" ), vc );
417 422
418 // for each line in the vCard 423 // for each line in the vCard
419 for ( QStringList::Iterator j = lines.begin(); j != lines.end(); ++j ) { 424 for ( QStringList::Iterator j = lines.begin(); j != lines.end(); ++j ) {
420 VCardLineX _vcl; 425 VCardLineX _vcl;
421 426
422 // take spaces off the end - ugly but necessary hack 427 // take spaces off the end - ugly but necessary hack
423 for ( int g = (*j).length()-1; g > 0 && (*j)[g].isSpace(); --g ) 428 for ( int g = (*j).length()-1; g > 0 && (*j)[g].isSpace(); --g )
424 (*j)[g] = 0; 429 (*j)[g] = 0;
425 430
426 // first token: 431 // first token:
@@ -492,26 +497,26 @@ VCard21ParserImpl *VCard21ParserImpl::parseVCard( const QString& vc, int *err )
492 do { 497 do {
493 value += *( ++j ); 498 value += *( ++j );
494 } while ( (*j).at( (*j).length() - 1 ) != '=' ); 499 } while ( (*j).at( (*j).length() - 1 ) != '=' );
495 } else { 500 } else {
496 if ( qp ) { // join any split lines 501 if ( qp ) { // join any split lines
497 while ( value.at( value.length() - 1 ) == '=' ) { 502 while ( value.at( value.length() - 1 ) == '=' ) {
498 value.remove( value.length() - 1, 1 ); 503 value.remove( value.length() - 1, 1 );
499 value.append(*( ++j )); 504 value.append(*( ++j ));
500 } 505 }
501 } 506 }
502 _vcl.parameters = QStringList::split( ';', value, true ); 507 _vcl.parameters = QStringList::split( ';', value, true );
503 if ( qp ) { // decode the quoted printable 508 if ( qp ) { // decode the quoted printable
504 for ( QStringList::Iterator z = _vcl.parameters.begin(); z != _vcl.parameters.end(); ++z ) 509 for ( QLinkedList<QString>::Iterator z = _vcl.parameters.begin(); z != _vcl.parameters.end(); ++z )
505 *z = KCodecs::quotedPrintableDecode( (*z).latin1() ); 510 *z = KCodecs::quotedPrintableDecode( (Q3CString)(*z).latin1() );
506 } 511 }
507 } 512 }
508 } else { 513 } else {
509 _err = VC_ERR_INTERNAL; 514 _err = VC_ERR_INTERNAL;
510 break; 515 break;
511 } 516 }
512 517
513 // validate VCardLineX 518 // validate VCardLineX
514 if ( !_vcl.isValid() ) { 519 if ( !_vcl.isValid() ) {
515 _err = VC_ERR_INVALID_LINE; 520 _err = VC_ERR_INVALID_LINE;
516 break; 521 break;
517 } 522 }
@@ -534,74 +539,75 @@ VCard21ParserImpl *VCard21ParserImpl::parseVCard( const QString& vc, int *err )
534 // if the vCard was valid. 539 // if the vCard was valid.
535 if ( err ) 540 if ( err )
536 *err = _err; 541 *err = _err;
537 542
538 if ( _err != 0 ) { 543 if ( _err != 0 ) {
539 delete _vcdata; 544 delete _vcdata;
540 return 0; 545 return 0;
541 } 546 }
542 547
543 return new VCard21ParserImpl( _vcdata ); 548 return new VCard21ParserImpl( _vcdata );
544} 549}
545 550
546VCard21ParserImpl::VCard21ParserImpl(QValueList<VCardLineX> *_vcd) : _vcdata(_vcd) 551VCard21ParserImpl::VCard21ParserImpl(Q3ValueList<VCardLineX> *_vcd) : _vcdata(_vcd)
547{ 552{
548} 553}
549 554
550 555
551QString VCard21ParserImpl::getValue(const QString& name, const QString& qualifier) 556QString VCard21ParserImpl::getValue(const QString& name, const QString& qualifier)
552{ 557{
553 QString failed; 558 QString failed;
554 const QString lowname = name.lower(); 559 const QString lowname = name.lower();
555 const QString lowqualifier = qualifier.lower(); 560 const QString lowqualifier = qualifier.lower();
556 561
557 for (QValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { 562 for (Q3ValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) {
558 if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) { 563 if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) {
559 if ((*i).parameters.count() > 0) 564 if ((*i).parameters.count() > 0)
560 return (*i).parameters[0]; 565 return (*i).parameters[0];
561 else return failed; 566 else return failed;
562 } 567 }
563 } 568 }
564 return failed; 569 return failed;
565} 570}
566 571
567 572
568QString VCard21ParserImpl::getValue(const QString& name) 573QString VCard21ParserImpl::getValue(const QString& name)
569{ 574{
570 QString failed; 575 QString failed;
571 const QString lowname = name.lower(); 576 const QString lowname = name.lower();
572 577
573 for (QValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { 578 for (Q3ValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) {
574 if ((*i).name == lowname && !(*i).qualified) { 579 if ((*i).name == lowname && !(*i).qualified) {
575 if ((*i).parameters.count() > 0) 580 if ((*i).parameters.count() > 0)
576 return (*i).parameters[0]; 581 return (*i).parameters[0];
577 else return failed; 582 else return failed;
578 } 583 }
579 } 584 }
580 return failed; 585 return failed;
581} 586}
582 587
583 588
584QStringList VCard21ParserImpl::getValues(const QString& name) 589QStringList VCard21ParserImpl::getValues(const QString& name)
585{ 590{
586 const QString lowname = name.lower(); 591 const QString lowname = name.lower();
587 for (QValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { 592 for (Q3ValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) {
588 if ((*i).name == lowname && !(*i).qualified) 593 if ((*i).name == lowname && !(*i).qualified) {
589 return (*i).parameters; 594 return QStringList( (*i).parameters );
595 }
590 } 596 }
591 // failed. 597 // failed.
592 return QStringList(); 598 return QStringList();
593} 599}
594 600
595QStringList VCard21ParserImpl::getValues(const QString& name, const QString& qualifier) 601QStringList VCard21ParserImpl::getValues(const QString& name, const QString& qualifier)
596{ 602{
597 const QString lowname = name.lower(); 603 const QString lowname = name.lower();
598 const QString lowqualifier = qualifier.lower(); 604 const QString lowqualifier = qualifier.lower();
599 for (QValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { 605 for (Q3ValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) {
600 if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) 606 if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier))
601 return (*i).parameters; 607 return QStringList( (*i).parameters );
602 } 608 }
603 // failed. 609 // failed.
604 return QStringList(); 610 return QStringList();
605} 611}
606 612
607 613
diff --git a/kabc/vcard21parser.h b/kabc/vcard21parser.h
index 77e69b6..80ba6ef 100644
--- a/kabc/vcard21parser.h
+++ b/kabc/vcard21parser.h
@@ -25,25 +25,25 @@ Copyright (c) 2004 Ulf Schenk
25 25
26$Id$ 26$Id$
27*/ 27*/
28 28
29#ifndef KABC_VCARD21FORMAT_H 29#ifndef KABC_VCARD21FORMAT_H
30#define KABC_VCARD21FORMAT_H 30#define KABC_VCARD21FORMAT_H
31 31
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <kdebug.h> 33#include <kdebug.h>
34#include <qregexp.h> 34#include <qregexp.h>
35#include <qstring.h> 35#include <qstring.h>
36#include <kurl.h> 36#include <kurl.h>
37#include <qvaluelist.h> 37#include <q3valuelist.h>
38 38
39#include "addressee.h" 39#include "addressee.h"
40#include "addressbook.h" 40#include "addressbook.h"
41#include "phonenumber.h" 41#include "phonenumber.h"
42 42
43 43
44#define VCARD_BEGIN "begin:vcard" 44#define VCARD_BEGIN "begin:vcard"
45#define VCARD_END "end:vcard" 45#define VCARD_END "end:vcard"
46#define VCARD_BEGIN_N "begin" 46#define VCARD_BEGIN_N "begin"
47#define VCARD_END_N "end" 47#define VCARD_END_N "end"
48#define VCARD_VERSION "version" 48#define VCARD_VERSION "version"
49 49
@@ -187,40 +187,40 @@ public:
187}; 187};
188 188
189} 189}
190 190
191/** 191/**
192 * @short Helper class 192 * @short Helper class
193 */ 193 */
194class VCardLineX 194class VCardLineX
195{ 195{
196public: 196public:
197 QString name; 197 QString name;
198 bool qualified; 198 bool qualified;
199 QValueList<QString> qualifiers; 199 Q3ValueList<QString> qualifiers;
200 QValueList<QString> parameters; 200 Q3ValueList<QString> parameters;
201 bool isValid() const; 201 bool isValid() const;
202}; 202};
203 203
204/** 204/**
205 * @short Helper class 205 * @short Helper class
206 */ 206 */
207class VCard21ParserImpl 207class VCard21ParserImpl
208{ 208{
209 friend class VCardLineX; 209 friend class VCardLineX;
210 210
211public: 211public:
212 VCard21ParserImpl() { }; 212 VCard21ParserImpl() { };
213 virtual ~VCard21ParserImpl() { }; 213 virtual ~VCard21ParserImpl() { };
214 static VCard21ParserImpl *parseVCard(const QString& vc, int *err = NULL); 214 static VCard21ParserImpl *parseVCard(const QString& vc, int *err = NULL);
215 QString getValue(const QString& name, const QString& qualifier); 215 QString getValue(const QString& name, const QString& qualifier);
216 QString getValue(const QString& name); 216 QString getValue(const QString& name);
217 QStringList getValues(const QString& name, const QString& qualifier); 217 QStringList getValues(const QString& name, const QString& qualifier);
218 QStringList getValues(const QString& name); 218 QStringList getValues(const QString& name);
219 219
220 QValueList<VCardLineX> *_vcdata; 220 Q3ValueList<VCardLineX> *_vcdata;
221 221
222private: 222private:
223 VCard21ParserImpl (QValueList<VCardLineX> *_vcd); 223 VCard21ParserImpl (Q3ValueList<VCardLineX> *_vcd);
224}; 224};
225 225
226#endif 226#endif
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp
index 580c28b..2417874 100644
--- a/kabc/vcardformatimpl.cpp
+++ b/kabc/vcardformatimpl.cpp
@@ -19,24 +19,27 @@
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <qfile.h> 28#include <qfile.h>
29#include <qregexp.h> 29#include <qregexp.h>
30#include <qapplication.h> 30#include <qapplication.h>
31//Added by qt3to4:
32#include <Q3CString>
33#include <Q3PtrList>
31 34
32#include <kdebug.h> 35#include <kdebug.h>
33#include <kmdcodec.h> 36#include <kmdcodec.h>
34#include <kstandarddirs.h> 37#include <kstandarddirs.h>
35#include <ktempfile.h> 38#include <ktempfile.h>
36 39
37#include <VCard.h> 40#include <VCard.h>
38 41
39#include "addressbook.h" 42#include "addressbook.h"
40#include "vcardformatimpl.h" 43#include "vcardformatimpl.h"
41 44
42using namespace KABC; 45using namespace KABC;
@@ -45,46 +48,46 @@ using namespace VCARD;
45int VCardFormatImpl::debug = -1; 48int VCardFormatImpl::debug = -1;
46 49
47VCardFormatImpl::VCardFormatImpl() 50VCardFormatImpl::VCardFormatImpl()
48{ 51{
49 debug = (getenv("KABC_DEBUG") != 0); 52 debug = (getenv("KABC_DEBUG") != 0);
50} 53}
51 54
52bool VCardFormatImpl::load( Addressee &addressee, QFile *file ) 55bool VCardFormatImpl::load( Addressee &addressee, QFile *file )
53{ 56{
54 kdDebug(5700) << "VCardFormat::load()" << endl; 57 kdDebug(5700) << "VCardFormat::load()" << endl;
55 58
56 QByteArray fdata = file->readAll(); 59 QByteArray fdata = file->readAll();
57 QCString data(fdata.data(), fdata.size()+1); 60 Q3CString data(fdata.data(), fdata.size()+1);
58 61
59 VCardEntity e( data ); 62 VCardEntity e( data );
60 63
61 VCardListIterator it( e.cardList() ); 64 VCardListIterator it( e.cardList() );
62 65
63 if ( it.current() ) { 66 if ( it.current() ) {
64//US VCard v(*it.current()); 67//US VCard v(*it.current());
65//US loadAddressee( addressee, v ); 68//US loadAddressee( addressee, v );
66 loadAddressee( addressee, it.current() ); 69 loadAddressee( addressee, it.current() );
67 return true; 70 return true;
68 } 71 }
69 72
70 return false; 73 return false;
71} 74}
72 75
73 76
74#include <kmessagebox.h> 77#include <kmessagebox.h>
75bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, QFile *file ) 78bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, QFile *file )
76{ 79{
77 80
78 QCString data(file->readAll().data(), file->size()+1); 81 Q3CString data(file->readAll().data(), file->size()+1);
79 VCardEntity e( data ); 82 VCardEntity e( data );
80 83
81 VCardListIterator it( e.cardList() ); 84 VCardListIterator it( e.cardList() );
82 85
83 for (; it.current(); ++it) { 86 for (; it.current(); ++it) {
84//US VCard v(*it.current()); 87//US VCard v(*it.current());
85 Addressee addressee; 88 Addressee addressee;
86//US loadAddressee( addressee, v ); 89//US loadAddressee( addressee, v );
87 loadAddressee( addressee, it.current() ); 90 loadAddressee( addressee, it.current() );
88 addressee.setResource( resource ); 91 addressee.setResource( resource );
89 addressBook->insertAddressee( addressee ); 92 addressBook->insertAddressee( addressee );
90 if (debug == true) 93 if (debug == true)
@@ -99,50 +102,50 @@ void VCardFormatImpl::save( const Addressee &addressee, QFile *file )
99{ 102{
100 VCardEntity vcards; 103 VCardEntity vcards;
101 VCardList vcardlist; 104 VCardList vcardlist;
102 vcardlist.setAutoDelete( true ); 105 vcardlist.setAutoDelete( true );
103 106
104 VCard *v = new VCard; 107 VCard *v = new VCard;
105 108
106 saveAddressee( addressee, v, false ); 109 saveAddressee( addressee, v, false );
107 110
108 vcardlist.append( v ); 111 vcardlist.append( v );
109 vcards.setCardList( vcardlist ); 112 vcards.setCardList( vcardlist );
110 113
111 QCString vcardData = vcards.asString(); 114 Q3CString vcardData = vcards.asString();
112 file->writeBlock( (const char*)vcardData, vcardData.length() ); 115 file->writeBlock( (const char*)vcardData, vcardData.length() );
113} 116}
114 117
115void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, QFile *file ) 118void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, QFile *file )
116{ 119{
117 120
118 AddressBook::Iterator it; 121 AddressBook::Iterator it;
119 for ( it = ab->begin(); it != ab->end(); ++it ) { 122 for ( it = ab->begin(); it != ab->end(); ++it ) {
120 if ( (*it).resource() == resource ) { 123 if ( (*it).resource() == resource ) {
121 save((*it),file); 124 save((*it),file);
122 qApp->processEvents(); 125 qApp->processEvents();
123 (*it).setChanged( false ); 126 (*it).setChanged( false );
124 } 127 }
125 } 128 }
126 // for memory usage status test only 129 // for memory usage status test only
127 // KMessageBox::information ( 0, "Stoppppp", QString("Stop ") ); 130 // KMessageBox::information ( 0, "Stoppppp", QString("Stop ") );
128} 131}
129 132
130bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCard *v ) 133bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCard *v )
131{ 134{
132 QPtrList<ContentLine> contentLines = v->contentLineList(); 135 Q3PtrList<ContentLine> contentLines = v->contentLineList();
133 ContentLine *cl; 136 ContentLine *cl;
134 137
135 for( cl = contentLines.first(); cl; cl = contentLines.next() ) { 138 for( cl = contentLines.first(); cl; cl = contentLines.next() ) {
136 QCString n = cl->name(); 139 Q3CString n = cl->name();
137 if ( n.left( 2 ) == "X-" ) { 140 if ( n.left( 2 ) == "X-" ) {
138 n = n.mid( 2 ); 141 n = n.mid( 2 );
139 int posDash = n.find( "-" ); 142 int posDash = n.find( "-" );
140 addressee.insertCustom( QString::fromUtf8( n.left( posDash ) ), 143 addressee.insertCustom( QString::fromUtf8( n.left( posDash ) ),
141 QString::fromUtf8( n.mid( posDash + 1 ) ), 144 QString::fromUtf8( n.mid( posDash + 1 ) ),
142 QString::fromUtf8( cl->value()->asString() ) ); 145 QString::fromUtf8( cl->value()->asString() ) );
143 continue; 146 continue;
144 } 147 }
145 148
146 EntityType type = cl->entityType(); 149 EntityType type = cl->entityType();
147 switch( type ) { 150 switch( type ) {
148 151
@@ -210,25 +213,25 @@ bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCard *v )
210 addressee.insertAddress( readAddressValue( cl ) ); 213 addressee.insertAddress( readAddressValue( cl ) );
211 break; 214 break;
212 215
213 case EntityTelephone: 216 case EntityTelephone:
214 addressee.insertPhoneNumber( readTelephoneValue( cl ) ); 217 addressee.insertPhoneNumber( readTelephoneValue( cl ) );
215 break; 218 break;
216 219
217 case EntityCategories: 220 case EntityCategories:
218 addressee.setCategories( QStringList::split( ",", readTextValue( cl ) ) ); 221 addressee.setCategories( QStringList::split( ",", readTextValue( cl ) ) );
219 break; 222 break;
220 223
221 case EntityBirthday: 224 case EntityBirthday:
222 addressee.setBirthday( readDateValue( cl ) ); 225 addressee.setBirthday( (QDateTime) readDateValue( cl ) );
223 break; 226 break;
224 227
225 case EntityRevision: 228 case EntityRevision:
226 addressee.setRevision( readDateTimeValue( cl ) ); 229 addressee.setRevision( readDateTimeValue( cl ) );
227 break; 230 break;
228 231
229 case EntityGeo: 232 case EntityGeo:
230 addressee.setGeo( readGeoValue( cl ) ); 233 addressee.setGeo( readGeoValue( cl ) );
231 break; 234 break;
232 235
233 case EntityTimeZone: 236 case EntityTimeZone:
234 addressee.setTimeZone( readUTCValue( cl ) ); 237 addressee.setTimeZone( readUTCValue( cl ) );
@@ -521,25 +524,25 @@ Address VCardFormatImpl::readAddressValue( ContentLine *cl )
521 a.setCountry( QString::fromUtf8( v->countryName() ) ); 524 a.setCountry( QString::fromUtf8( v->countryName() ) );
522 525
523 a.setType( readAddressParam( cl ) ); 526 a.setType( readAddressParam( cl ) );
524 527
525 return a; 528 return a;
526} 529}
527 530
528int VCardFormatImpl::readAddressParam( ContentLine *cl ) 531int VCardFormatImpl::readAddressParam( ContentLine *cl )
529{ 532{
530 int type = 0; 533 int type = 0;
531 ParamList params = cl->paramList(); 534 ParamList params = cl->paramList();
532 ParamListIterator it( params ); 535 ParamListIterator it( params );
533 QCString tmpStr; 536 Q3CString tmpStr;
534 for( ; it.current(); ++it ) { 537 for( ; it.current(); ++it ) {
535 if ( (*it)->name().upper() == "TYPE" ) { 538 if ( (*it)->name().upper() == "TYPE" ) {
536 tmpStr = (*it)->value().lower(); 539 tmpStr = (*it)->value().lower();
537 if ( tmpStr == "dom" ) type |= Address::Dom; 540 if ( tmpStr == "dom" ) type |= Address::Dom;
538 else if ( tmpStr == "intl" ) type |= Address::Intl; 541 else if ( tmpStr == "intl" ) type |= Address::Intl;
539 else if ( tmpStr == "parcel" ) type |= Address::Parcel; 542 else if ( tmpStr == "parcel" ) type |= Address::Parcel;
540 else if ( tmpStr == "postal" ) type |= Address::Postal; 543 else if ( tmpStr == "postal" ) type |= Address::Postal;
541 else if ( tmpStr == "work" ) type |= Address::Work; 544 else if ( tmpStr == "work" ) type |= Address::Work;
542 else if ( tmpStr == "home" ) type |= Address::Home; 545 else if ( tmpStr == "home" ) type |= Address::Home;
543 else if ( tmpStr == "pref" ) type |= Address::Pref; 546 else if ( tmpStr == "pref" ) type |= Address::Pref;
544 } 547 }
545 } 548 }
@@ -600,25 +603,25 @@ void VCardFormatImpl::addTelephoneValue( VCard *v, const PhoneNumber &p )
600 v->add(cl); 603 v->add(cl);
601} 604}
602 605
603PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl ) 606PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl )
604{ 607{
605 PhoneNumber p; 608 PhoneNumber p;
606 TelValue *value = (TelValue *)cl->value(); 609 TelValue *value = (TelValue *)cl->value();
607 p.setNumber( QString::fromUtf8( value->asString() ) ); 610 p.setNumber( QString::fromUtf8( value->asString() ) );
608 611
609 int type = 0; 612 int type = 0;
610 ParamList params = cl->paramList(); 613 ParamList params = cl->paramList();
611 ParamListIterator it( params ); 614 ParamListIterator it( params );
612 QCString tmpStr; 615 Q3CString tmpStr;
613 for( ; it.current(); ++it ) { 616 for( ; it.current(); ++it ) {
614 if ( (*it)->name() == "TYPE" ) { 617 if ( (*it)->name() == "TYPE" ) {
615 tmpStr = (*it)->value().lower(); 618 tmpStr = (*it)->value().lower();
616 if ( tmpStr == "home" ) type |= PhoneNumber::Home; 619 if ( tmpStr == "home" ) type |= PhoneNumber::Home;
617 else if ( tmpStr == "work" ) type |= PhoneNumber::Work; 620 else if ( tmpStr == "work" ) type |= PhoneNumber::Work;
618 else if ( tmpStr == "msg" ) type |= PhoneNumber::Msg; 621 else if ( tmpStr == "msg" ) type |= PhoneNumber::Msg;
619 else if ( tmpStr == "pref" ) type |= PhoneNumber::Pref; 622 else if ( tmpStr == "pref" ) type |= PhoneNumber::Pref;
620 else if ( tmpStr == "voice" ) type |= PhoneNumber::Voice; 623 else if ( tmpStr == "voice" ) type |= PhoneNumber::Voice;
621 else if ( tmpStr == "fax" ) type |= PhoneNumber::Fax; 624 else if ( tmpStr == "fax" ) type |= PhoneNumber::Fax;
622 else if ( tmpStr == "cell" ) type |= PhoneNumber::Cell; 625 else if ( tmpStr == "cell" ) type |= PhoneNumber::Cell;
623 else if ( tmpStr == "video" ) type |= PhoneNumber::Video; 626 else if ( tmpStr == "video" ) type |= PhoneNumber::Video;
624 else if ( tmpStr == "bbs" ) type |= PhoneNumber::Bbs; 627 else if ( tmpStr == "bbs" ) type |= PhoneNumber::Bbs;
@@ -861,25 +864,25 @@ void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType ty
861 // qDebug( "IIIMMMMM %s",QImage::outputFormatList ().join("-").latin1() ); 864 // qDebug( "IIIMMMMM %s",QImage::outputFormatList ().join("-").latin1() );
862 if ( pic.isIntern() && pic.data().isNull() ) 865 if ( pic.isIntern() && pic.data().isNull() )
863 return; 866 return;
864 867
865 if ( !pic.isIntern() && pic.url().isEmpty() ) 868 if ( !pic.isIntern() && pic.url().isEmpty() )
866 return; 869 return;
867 870
868 ParamList params; 871 ParamList params;
869 if ( pic.isIntern() ) { 872 if ( pic.isIntern() ) {
870 QImage img = pic.data(); 873 QImage img = pic.data();
871 if ( intern ) { // only for vCard export we really write the data inline 874 if ( intern ) { // only for vCard export we really write the data inline
872 QByteArray data; 875 QByteArray data;
873 QDataStream s( data, IO_WriteOnly ); 876 QDataStream s( &data, QIODevice::WriteOnly );
874 s.setVersion( 4 ); // to produce valid png files 877 s.setVersion( 4 ); // to produce valid png files
875 s << img; 878 s << img;
876 cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); 879 cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) );
877 params.append( new Param( "ENCODING", "b" ) ); 880 params.append( new Param( "ENCODING", "b" ) );
878 if ( !pic.type().isEmpty() ) 881 if ( !pic.type().isEmpty() )
879 params.append( new Param( "TYPE", pic.type().utf8() ) ); 882 params.append( new Param( "TYPE", pic.type().utf8() ) );
880 } else { // save picture in cache 883 } else { // save picture in cache
881 QString dir; 884 QString dir;
882 if ( type == EntityPhoto ) 885 if ( type == EntityPhoto )
883 dir = "photos"; 886 dir = "photos";
884 if ( type == EntityLogo ) 887 if ( type == EntityLogo )
885 dir = "logos"; 888 dir = "logos";
@@ -950,25 +953,25 @@ void VCardFormatImpl::addSoundValue( VCARD::VCard *vcard, const Sound &sound, co
950 return; 953 return;
951 954
952 if ( !sound.isIntern() && sound.url().isEmpty() ) 955 if ( !sound.isIntern() && sound.url().isEmpty() )
953 return; 956 return;
954 957
955 ParamList params; 958 ParamList params;
956 if ( sound.isIntern() ) { 959 if ( sound.isIntern() ) {
957 QByteArray data = sound.data(); 960 QByteArray data = sound.data();
958 if ( intern ) { // only for vCard export we really write the data inline 961 if ( intern ) { // only for vCard export we really write the data inline
959 cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); 962 cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) );
960 } else { // save sound in cache 963 } else { // save sound in cache
961 QFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) ); 964 QFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) );
962 if ( file.open( IO_WriteOnly ) ) { 965 if ( file.open( QIODevice::WriteOnly ) ) {
963 file.writeBlock( data ); 966 file.writeBlock( data );
964 } 967 }
965 cl.setValue( new TextValue( "<dummy>" ) ); 968 cl.setValue( new TextValue( "<dummy>" ) );
966 } 969 }
967 params.append( new Param( "ENCODING", "b" ) ); 970 params.append( new Param( "ENCODING", "b" ) );
968 } else { 971 } else {
969 cl.setValue( new TextValue( sound.url().utf8() ) ); 972 cl.setValue( new TextValue( sound.url().utf8() ) );
970 params.append( new Param( "VALUE", "uri" ) ); 973 params.append( new Param( "VALUE", "uri" ) );
971 } 974 }
972 975
973 cl.setParamList( params ); 976 cl.setParamList( params );
974 vcard->add( cl ); 977 vcard->add( cl );
@@ -982,25 +985,25 @@ Sound VCardFormatImpl::readSoundValue( VCARD::ContentLine *cl, const Addressee &
982 985
983 ParamList params = cl->paramList(); 986 ParamList params = cl->paramList();
984 ParamListIterator it( params ); 987 ParamListIterator it( params );
985 for( ; it.current(); ++it ) { 988 for( ; it.current(); ++it ) {
986 if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) 989 if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" )
987 isInline = true; 990 isInline = true;
988 } 991 }
989 992
990 if ( isInline ) { 993 if ( isInline ) {
991 QByteArray data; 994 QByteArray data;
992 if ( v->asString() == "<dummy>" ) { // no sound inline stored => sound is in cache 995 if ( v->asString() == "<dummy>" ) { // no sound inline stored => sound is in cache
993 QFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) ); 996 QFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) );
994 if ( file.open( IO_ReadOnly ) ) { 997 if ( file.open( QIODevice::ReadOnly ) ) {
995 data = file.readAll(); 998 data = file.readAll();
996 file.close(); 999 file.close();
997 } 1000 }
998 } else { 1001 } else {
999 KCodecs::base64Decode( v->asString(), data ); 1002 KCodecs::base64Decode( v->asString(), data );
1000 } 1003 }
1001 sound.setData( data ); 1004 sound.setData( data );
1002 } else { 1005 } else {
1003 sound.setUrl( QString::fromUtf8( v->asString() ) ); 1006 sound.setUrl( QString::fromUtf8( v->asString() ) );
1004 } 1007 }
1005 1008
1006 return sound; 1009 return sound;
diff --git a/kabc/vcardformatplugin.cpp b/kabc/vcardformatplugin.cpp
index 8db8c11..0b97a08 100644
--- a/kabc/vcardformatplugin.cpp
+++ b/kabc/vcardformatplugin.cpp
@@ -52,19 +52,19 @@ void VCardFormatPlugin::save( const Addressee &addressee, QFile *file )
52} 52}
53 53
54void VCardFormatPlugin::saveAll( AddressBook *addressBook, Resource *resource, QFile *file ) 54void VCardFormatPlugin::saveAll( AddressBook *addressBook, Resource *resource, QFile *file )
55{ 55{
56 qDebug("VCardFormatPlugin::saveAll"); 56 qDebug("VCardFormatPlugin::saveAll");
57 mImpl->saveAll( addressBook, resource, file ); 57 mImpl->saveAll( addressBook, resource, file );
58} 58}
59 59
60bool VCardFormatPlugin::checkFormat( QFile *file ) const 60bool VCardFormatPlugin::checkFormat( QFile *file ) const
61{ 61{
62 QString line; 62 QString line;
63 63
64 file->readLine( line, 1024 ); 64 char tmp[1024]; file->readLine( tmp, 1024 ); line = tmp;
65 line = line.stripWhiteSpace(); 65 line = line.stripWhiteSpace();
66 if ( line == "BEGIN:VCARD" ) 66 if ( line == "BEGIN:VCARD" )
67 return true; 67 return true;
68 else 68 else
69 return false; 69 return false;
70} 70}
diff --git a/kabc/vcardparser/vcard.h b/kabc/vcardparser/vcard.h
index 0bee441..85b50e4 100644
--- a/kabc/vcardparser/vcard.h
+++ b/kabc/vcardparser/vcard.h
@@ -15,32 +15,32 @@
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#ifndef VCARDPARSER_VCARD_H 21#ifndef VCARDPARSER_VCARD_H
22#define VCARDPARSER_VCARD_H 22#define VCARDPARSER_VCARD_H
23 23
24#include "vcardline.h" 24#include "vcardline.h"
25#include <qmap.h> 25#include <qmap.h>
26#include <qstringlist.h> 26#include <qstringlist.h>
27#include <qvaluelist.h> 27#include <q3valuelist.h>
28 28
29namespace KABC { 29namespace KABC {
30 30
31class VCard 31class VCard
32{ 32{
33 public: 33 public:
34 typedef QValueList<VCard> List; 34 typedef Q3ValueList<VCard> List;
35 typedef QMap< QString, VCardLine::List > LineMap; 35 typedef QMap< QString, VCardLine::List > LineMap;
36 36
37 enum Version { v2_1, v3_0 }; 37 enum Version { v2_1, v3_0 };
38 38
39 VCard(); 39 VCard();
40 VCard( const VCard& ); 40 VCard( const VCard& );
41 41
42 ~VCard(); 42 ~VCard();
43 43
44 VCard& operator=( const VCard& ); 44 VCard& operator=( const VCard& );
45 45
46 /** 46 /**
diff --git a/kabc/vcardparser/vcardline.cpp b/kabc/vcardparser/vcardline.cpp
index 8df2d32..c7254a0 100644
--- a/kabc/vcardparser/vcardline.cpp
+++ b/kabc/vcardparser/vcardline.cpp
@@ -10,49 +10,51 @@
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include "vcardline.h" 21#include "vcardline.h"
22//Added by qt3to4:
23#include <Q3CString>
22 24
23using namespace KABC; 25using namespace KABC;
24 26
25class VCardLine::VCardLinePrivate 27class VCardLine::VCardLinePrivate
26{ 28{
27 public: 29 public:
28 QString mGroup; 30 QString mGroup;
29}; 31};
30 32
31VCardLine::VCardLine() 33VCardLine::VCardLine()
32 : d( 0 ) 34 : d( 0 )
33{ 35{
34} 36}
35 37
36VCardLine::VCardLine( const QString &identifier ) 38VCardLine::VCardLine( const QString &identifier )
37 : d( 0 ) 39 : d( 0 )
38{ 40{
39 mIdentifier = identifier; 41 mIdentifier = identifier;
40} 42}
41 43
42VCardLine::VCardLine( const QString &identifier, const QString &value ) 44VCardLine::VCardLine( const QString &identifier, const QString &value )
43 : d( 0 ) 45 : d( 0 )
44{ 46{
45 mIdentifier = identifier; 47 mIdentifier = identifier;
46 mValue.assign( value.data(), value.length() ); 48 mValue = value;
47} 49}
48 50
49VCardLine::VCardLine( const VCardLine& line ) 51VCardLine::VCardLine( const VCardLine& line )
50 : d( 0 ) 52 : d( 0 )
51{ 53{
52 mParamMap = line.mParamMap; 54 mParamMap = line.mParamMap;
53 mValue = line.mValue; 55 mValue = line.mValue;
54 mIdentifier = line.mIdentifier; 56 mIdentifier = line.mIdentifier;
55} 57}
56 58
57VCardLine::~VCardLine() 59VCardLine::~VCardLine()
58{ 60{
@@ -77,25 +79,25 @@ void VCardLine::setIdentifier( const QString& identifier )
77 mIdentifier = identifier; 79 mIdentifier = identifier;
78} 80}
79 81
80QString VCardLine::identifier() const 82QString VCardLine::identifier() const
81{ 83{
82 return mIdentifier; 84 return mIdentifier;
83} 85}
84 86
85void VCardLine::setValueString( const QString& value ) 87void VCardLine::setValueString( const QString& value )
86{ 88{
87 setValueCString( value.utf8() ); 89 setValueCString( value.utf8() );
88} 90}
89void VCardLine::setValueCString( const QCString& value ) 91void VCardLine::setValueCString( const Q3CString& value )
90{ 92{
91 mValue.duplicate( value.data(), value.length() ); 93 mValue.duplicate( value.data(), value.length() );
92} 94}
93 95
94void VCardLine::setValueBytes( const QByteArray& value ) 96void VCardLine::setValueBytes( const QByteArray& value )
95{ 97{
96 mValue = value; 98 mValue = value;
97} 99}
98 100
99QString VCardLine::valueString() const 101QString VCardLine::valueString() const
100{ 102{
101 return QString::fromUtf8( mValue.data(), mValue.size() ); 103 return QString::fromUtf8( mValue.data(), mValue.size() );
diff --git a/kabc/vcardparser/vcardline.h b/kabc/vcardparser/vcardline.h
index 8dc9322..dc4bdec 100644
--- a/kabc/vcardparser/vcardline.h
+++ b/kabc/vcardparser/vcardline.h
@@ -13,36 +13,36 @@
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#ifndef VCARDLINE_H 21#ifndef VCARDLINE_H
22#define VCARDLINE_H 22#define VCARDLINE_H
23 23
24#include <qstringlist.h> 24#include <qstringlist.h>
25#include <qvaluelist.h> 25#include <q3valuelist.h>
26#include <qcstring.h> 26#include <q3cstring.h>
27#include <qvariant.h> 27#include <qvariant.h>
28#include <qmap.h> 28#include <qmap.h>
29#include <qstring.h> 29#include <qstring.h>
30 30
31namespace KABC { 31namespace KABC {
32 32
33class VCardLine 33class VCardLine
34{ 34{
35 public: 35 public:
36 typedef QValueList<VCardLine> List; 36 typedef Q3ValueList<VCardLine> List;
37 typedef QMap<QString, QStringList> ParamMap; 37 typedef QMap<QString, QStringList> ParamMap;
38 38
39 VCardLine(); 39 VCardLine();
40 VCardLine( const QString &identifier ); 40 VCardLine( const QString &identifier );
41 VCardLine( const QString &identifier, const QString &value ); 41 VCardLine( const QString &identifier, const QString &value );
42 VCardLine( const VCardLine& ); 42 VCardLine( const VCardLine& );
43 43
44 ~VCardLine(); 44 ~VCardLine();
45 45
46 VCardLine& operator=( const VCardLine& ); 46 VCardLine& operator=( const VCardLine& );
47 47
48 /** 48 /**
@@ -50,25 +50,25 @@ class VCardLine
50 */ 50 */
51 void setIdentifier( const QString& identifier ); 51 void setIdentifier( const QString& identifier );
52 52
53 /** 53 /**
54 * Returns the identifier of this line. 54 * Returns the identifier of this line.
55 */ 55 */
56 QString identifier() const; 56 QString identifier() const;
57 57
58 /** 58 /**
59 * Sets the value of of this line. 59 * Sets the value of of this line.
60 */ 60 */
61 void setValueString( const QString& value ); 61 void setValueString( const QString& value );
62 void setValueCString( const QCString& value ); 62 void setValueCString( const Q3CString& value );
63 void setValueBytes( const QByteArray& value ); 63 void setValueBytes( const QByteArray& value );
64 64
65 /** 65 /**
66 * Returns the value of this line. 66 * Returns the value of this line.
67 */ 67 */
68 QString valueString() const; 68 QString valueString() const;
69 QByteArray valueBytes() const; 69 QByteArray valueBytes() const;
70 70
71 /** 71 /**
72 * Sets the group the line belongs to. 72 * Sets the group the line belongs to.
73 */ 73 */
74 void setGroup( const QString& group ); 74 void setGroup( const QString& group );
diff --git a/kabc/vcardparser/vcardparser.cpp b/kabc/vcardparser/vcardparser.cpp
index 11622a0..a319531 100644
--- a/kabc/vcardparser/vcardparser.cpp
+++ b/kabc/vcardparser/vcardparser.cpp
@@ -209,25 +209,25 @@ QString VCardParser::createVCards( const VCard::List& list )
209 if ( !(*valueIt).isEmpty() ) 209 if ( !(*valueIt).isEmpty() )
210 textLine.append( "=" + (*valueIt) ); 210 textLine.append( "=" + (*valueIt) );
211 } 211 }
212 } 212 }
213 } 213 }
214 214
215 if ( hasEncoding ) { // have to encode the data 215 if ( hasEncoding ) { // have to encode the data
216 QByteArray input, output; 216 QByteArray input, output;
217 input = (*lineIt).valueBytes(); 217 input = (*lineIt).valueBytes();
218 if ( encodingType == "b" ) 218 if ( encodingType == "b" )
219 KCodecs::base64Encode( input, output ); 219 KCodecs::base64Encode( input, output );
220 else if ( encodingType == "quoted-printable" ) 220 else if ( encodingType == "quoted-printable" )
221 KCodecs::quotedPrintableEncode( input, output ); 221 KCodecs::quotedPrintableEncode( input, output, true );
222 textLine.append( ":" + QString( output ) ); 222 textLine.append( ":" + QString( output ) );
223 } else 223 } else
224 textLine.append( ":" + (*lineIt).valueString().replace( QRegExp("\n"), "\\n" ) ); 224 textLine.append( ":" + (*lineIt).valueString().replace( QRegExp("\n"), "\\n" ) );
225 225
226 if ( textLine.length() > FOLD_WIDTH ) { // we have to fold the line 226 if ( textLine.length() > FOLD_WIDTH ) { // we have to fold the line
227 for ( uint i = 0; i <= ( textLine.length() / FOLD_WIDTH ); ++i ) 227 for ( uint i = 0; i <= ( textLine.length() / FOLD_WIDTH ); ++i )
228 text.append( ( i == 0 ? "" : " " ) + textLine.mid( i * FOLD_WIDTH, FOLD_WIDTH ) + "\r\n" ); 228 text.append( ( i == 0 ? "" : " " ) + textLine.mid( i * FOLD_WIDTH, FOLD_WIDTH ) + "\r\n" );
229 } else 229 } else
230 text.append( textLine + "\r\n" ); 230 text.append( textLine + "\r\n" );
231 } 231 }
232 } 232 }
233 } 233 }
diff --git a/kabc/vcardparser/vcardtool.cpp b/kabc/vcardparser/vcardtool.cpp
index 204326e..435c3b0 100644
--- a/kabc/vcardparser/vcardtool.cpp
+++ b/kabc/vcardparser/vcardtool.cpp
@@ -643,25 +643,25 @@ Picture VCardTool::parsePicture( const VCardLine &line )
643 pic.setType( line.parameter( "type" ) ); 643 pic.setType( line.parameter( "type" ) );
644 644
645 return pic; 645 return pic;
646} 646}
647 647
648VCardLine VCardTool::createPicture( const QString &identifier, const Picture &pic ) 648VCardLine VCardTool::createPicture( const QString &identifier, const Picture &pic )
649{ 649{
650 VCardLine line( identifier ); 650 VCardLine line( identifier );
651 651
652 if ( pic.isIntern() ) { 652 if ( pic.isIntern() ) {
653 if ( !pic.data().isNull() ) { 653 if ( !pic.data().isNull() ) {
654 QByteArray input; 654 QByteArray input;
655 QDataStream s( input, IO_WriteOnly ); 655 QDataStream s( &input, QIODevice::WriteOnly );
656 s.setVersion( 4 ); 656 s.setVersion( 4 );
657 s << pic.data(); 657 s << pic.data();
658 line.setValueBytes( input ); 658 line.setValueBytes( input );
659 line.addParameter( "encoding", "b" ); 659 line.addParameter( "encoding", "b" );
660 line.addParameter( "type", "image/png" ); 660 line.addParameter( "type", "image/png" );
661 } 661 }
662 } else if ( !pic.url().isEmpty() ) { 662 } else if ( !pic.url().isEmpty() ) {
663 QByteArray ba; 663 QByteArray ba;
664 line.setValueString( pic.url() ); 664 line.setValueString( pic.url() );
665 line.addParameter( "value", "URI" ); 665 line.addParameter( "value", "URI" );
666 } 666 }
667 667
diff --git a/kaddressbook/addresseditwidget.cpp b/kaddressbook/addresseditwidget.cpp
index 3dcd592..83908d0 100644
--- a/kaddressbook/addresseditwidget.cpp
+++ b/kaddressbook/addresseditwidget.cpp
@@ -13,42 +13,49 @@
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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 <qbuttongroup.h> 25#include <q3buttongroup.h>
26#include <qcheckbox.h> 26#include <qcheckbox.h>
27#include <qhbox.h> 27#include <q3hbox.h>
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qlistbox.h> 30#include <q3listbox.h>
31#include <qlistview.h> 31#include <q3listview.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qsignal.h> 33#include <q3signal.h>
34#include <qstring.h> 34#include <qstring.h>
35#include <qapplication.h> 35#include <qapplication.h>
36#include <QDesktopWidget>
37
38#include <Q3VBoxLayout>
39#include <Q3GridLayout>
36 40
37#ifndef KAB_EMBEDDED 41#ifndef KAB_EMBEDDED
38#include <qtextedit.h> 42#include <q3textedit.h>
43//Added by qt3to4:
44#include <Q3ValueList>
45#include <Q3VBoxLayout>
39#include <kaccelmanager.h> 46#include <kaccelmanager.h>
40#include <kbuttonbox.h> 47#include <kbuttonbox.h>
41#else //KAB_EMBEDDED 48#else //KAB_EMBEDDED
42#include <qmultilineedit.h> 49#include <q3multilineedit.h>
43#endif //KAB_EMBEDDED 50#endif //KAB_EMBEDDED
44 51
45#include <qtoolbutton.h> 52#include <qtoolbutton.h>
46#include <qtooltip.h> 53#include <qtooltip.h>
47 54
48#include <kapplication.h> 55#include <kapplication.h>
49#include <kcombobox.h> 56#include <kcombobox.h>
50#include <kconfig.h> 57#include <kconfig.h>
51#include <kdebug.h> 58#include <kdebug.h>
52#include <kdialog.h> 59#include <kdialog.h>
53#include <kiconloader.h> 60#include <kiconloader.h>
54#include <klineedit.h> 61#include <klineedit.h>
@@ -58,46 +65,46 @@
58#include <kmessagebox.h> 65#include <kmessagebox.h>
59#include <kseparator.h> 66#include <kseparator.h>
60 67
61#include "addresseditwidget.h" 68#include "addresseditwidget.h"
62 69
63 70
64 71
65AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name ) 72AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name )
66 : QWidget( parent, name ) 73 : QWidget( parent, name )
67{ 74{
68 75
69 mConfig = AddresseeConfig::instance(); 76 mConfig = AddresseeConfig::instance();
70 QVBoxLayout *layout = new QVBoxLayout( this ); 77 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
71 layout->setSpacing( KDialog::spacingHintSmall() ); 78 layout->setSpacing( KDialog::spacingHintSmall() );
72 QHBox *b1 = new QHBox( this); 79 Q3HBox *b1 = new Q3HBox( this);
73 //QLabel * label = new QLabel( b1 ); 80 //QLabel * label = new QLabel( b1 );
74 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); 81 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) );
75 82
76 83
77 //label->setAlignment( AlignCenter); 84 //label->setAlignment( AlignCenter);
78 layout->addWidget( b1 ); 85 layout->addWidget( b1 );
79 mTypeCombo = new AddressTypeCombo( mAddressList, b1 ); 86 mTypeCombo = new AddressTypeCombo( mAddressList, b1 );
80 QPushButton *editButton = new QPushButton( i18n( "&Edit Addresses..." ), 87 QPushButton *editButton = new QPushButton( i18n( "&Edit Addresses..." ),
81 b1 ); 88 b1 );
82 connect( mTypeCombo, SIGNAL( activated( int ) ), 89 connect( mTypeCombo, SIGNAL( activated( int ) ),
83 SLOT( updateAddressEdit() ) ); 90 SLOT( updateAddressEdit() ) );
84 // layout->addWidget( mTypeCombo ); 91 // layout->addWidget( mTypeCombo );
85 92
86#ifndef KAB_EMBEDDED 93#ifndef KAB_EMBEDDED
87 mAddressTextEdit = new QTextEdit( this ); 94 mAddressTextEdit = new Q3TextEdit( this );
88 mAddressTextEdit->setReadOnly( true ); 95 mAddressTextEdit->setReadOnly( true );
89 mAddressTextEdit->setMinimumHeight( 20 ); 96 mAddressTextEdit->setMinimumHeight( 20 );
90#else //KAB_EMBEDDED 97#else //KAB_EMBEDDED
91 mAddressTextEdit = new QMultiLineEdit( this ); 98 mAddressTextEdit = new Q3MultiLineEdit( this );
92 mAddressTextEdit->setReadOnly( true ); 99 mAddressTextEdit->setReadOnly( true );
93 mAddressTextEdit->setMinimumHeight( 20 ); 100 mAddressTextEdit->setMinimumHeight( 20 );
94#endif //KAB_EMBEDDED 101#endif //KAB_EMBEDDED
95 102
96 layout->addWidget( mAddressTextEdit ); 103 layout->addWidget( mAddressTextEdit );
97 104
98 105
99 connect( editButton, SIGNAL( clicked() ), SLOT( edit() ) ); 106 connect( editButton, SIGNAL( clicked() ), SLOT( edit() ) );
100} 107}
101 108
102AddressEditWidget::~AddressEditWidget() 109AddressEditWidget::~AddressEditWidget()
103{ 110{
@@ -117,31 +124,31 @@ KABC::Address::List AddressEditWidget::addresses()
117} 124}
118 125
119void AddressEditWidget::setAddresses( const KABC::Addressee &addr, 126void AddressEditWidget::setAddresses( const KABC::Addressee &addr,
120 const KABC::Address::List &list ) 127 const KABC::Address::List &list )
121{ 128{
122 mAddressee = addr; 129 mAddressee = addr;
123 130
124 mAddressList.clear(); 131 mAddressList.clear();
125 132
126 // Insert types for existing numbers. 133 // Insert types for existing numbers.
127 mTypeCombo->insertTypeList( list ); 134 mTypeCombo->insertTypeList( list );
128 135
129 QValueList<int> defaultTypes; 136 Q3ValueList<int> defaultTypes;
130 defaultTypes << KABC::Address::Home; 137 defaultTypes << KABC::Address::Home;
131 defaultTypes << KABC::Address::Work; 138 defaultTypes << KABC::Address::Work;
132 139
133 mConfig->setUid( mAddressee.uid() ); 140 mConfig->setUid( mAddressee.uid() );
134 QValueList<int> configList = mConfig->noDefaultAddrTypes(); 141 Q3ValueList<int> configList = mConfig->noDefaultAddrTypes();
135 QValueList<int>::ConstIterator it; 142 Q3ValueList<int>::ConstIterator it;
136 for ( it = configList.begin(); it != configList.end(); ++it ) 143 for ( it = configList.begin(); it != configList.end(); ++it )
137 defaultTypes.remove( *it ); 144 defaultTypes.remove( *it );
138 145
139 // Insert default types. 146 // Insert default types.
140 // Doing this for mPrefCombo is enough because the list is shared by all 147 // Doing this for mPrefCombo is enough because the list is shared by all
141 // combos. 148 // combos.
142 for( it = defaultTypes.begin(); it != defaultTypes.end(); ++it ) { 149 for( it = defaultTypes.begin(); it != defaultTypes.end(); ++it ) {
143 if ( !mTypeCombo->hasType( *it ) ) 150 if ( !mTypeCombo->hasType( *it ) )
144 mTypeCombo->insertType( list, *it, Address( *it ) ); 151 mTypeCombo->insertType( list, *it, Address( *it ) );
145 } 152 }
146 153
147 mTypeCombo->updateTypes(); 154 mTypeCombo->updateTypes();
@@ -172,25 +179,25 @@ void AddressEditWidget::edit()
172 for ( it = mAddressList.begin(); it != mAddressList.end(); ++it ) { 179 for ( it = mAddressList.begin(); it != mAddressList.end(); ++it ) {
173 if ( (*it).type() == KABC::Address::Home ) { 180 if ( (*it).type() == KABC::Address::Home ) {
174 if ( !(*it).isEmpty() ) 181 if ( !(*it).isEmpty() )
175 hasHome = true; 182 hasHome = true;
176 } 183 }
177 if ( (*it).type() == KABC::Address::Work ) { 184 if ( (*it).type() == KABC::Address::Work ) {
178 if ( !(*it).isEmpty() ) 185 if ( !(*it).isEmpty() )
179 hasWork = true; 186 hasWork = true;
180 } 187 }
181 } 188 }
182 189
183 mConfig->setUid( mAddressee.uid() ); 190 mConfig->setUid( mAddressee.uid() );
184 QValueList<int> configList; 191 Q3ValueList<int> configList;
185 if ( !hasHome ) { 192 if ( !hasHome ) {
186 configList << KABC::Address::Home; 193 configList << KABC::Address::Home;
187 } 194 }
188 if ( !hasWork ) { 195 if ( !hasWork ) {
189 configList << KABC::Address::Work; 196 configList << KABC::Address::Work;
190 } 197 }
191 mConfig->setNoDefaultAddrTypes( configList ); 198 mConfig->setNoDefaultAddrTypes( configList );
192 199
193 mTypeCombo->updateTypes(); 200 mTypeCombo->updateTypes();
194 updateAddressEdit(); 201 updateAddressEdit();
195 emit modified(); 202 emit modified();
196 } 203 }
@@ -246,38 +253,38 @@ void AddressEditWidget::updateAddressEdit()
246 253
247AddressEditDialog::AddressEditDialog( const KABC::Address::List &list, 254AddressEditDialog::AddressEditDialog( const KABC::Address::List &list,
248 int selected, QWidget *parent, 255 int selected, QWidget *parent,
249 const char *name ) 256 const char *name )
250 : KDialogBase( Plain, i18n( "Edit Address" ), Ok | Cancel, Ok, 257 : KDialogBase( Plain, i18n( "Edit Address" ), Ok | Cancel, Ok,
251 parent, name, true, true ), 258 parent, name, true, true ),
252 mPreviousAddress( 0 ) 259 mPreviousAddress( 0 )
253{ 260{
254 mAddressList = list; 261 mAddressList = list;
255 262
256 QWidget *page = plainPage(); 263 QWidget *page = plainPage();
257 264
258 QGridLayout *topLayout = new QGridLayout( page, 8, 2 ); 265 Q3GridLayout *topLayout = new Q3GridLayout( page, 8, 2 );
259 topLayout->setSpacing( spacingHintSmall() ); 266 topLayout->setSpacing( spacingHintSmall() );
260 267
261 mTypeCombo = new AddressTypeCombo( mAddressList, page ); 268 mTypeCombo = new AddressTypeCombo( mAddressList, page );
262 topLayout->addMultiCellWidget( mTypeCombo, 0, 0, 0, 1 ); 269 topLayout->addMultiCellWidget( mTypeCombo, 0, 0, 0, 1 );
263 270
264 QLabel *label = new QLabel( i18n( "Street:" ), page ); 271 QLabel *label = new QLabel( i18n( "Street:" ), page );
265 label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); 272 label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
266 topLayout->addWidget( label, 1, 0 ); 273 topLayout->addWidget( label, 1, 0 );
267 274
268#ifndef KAB_EMBEDDED 275#ifndef KAB_EMBEDDED
269 mStreetTextEdit = new QTextEdit( page ); 276 mStreetTextEdit = new Q3TextEdit( page );
270#else //KAB_EMBEDDED 277#else //KAB_EMBEDDED
271 mStreetTextEdit = new QMultiLineEdit( page ); 278 mStreetTextEdit = new Q3MultiLineEdit( page );
272//US qDebug("AddressEditDialog::AddressEditDialog has to be changed"); 279//US qDebug("AddressEditDialog::AddressEditDialog has to be changed");
273#endif //KAB_EMBEDDED 280#endif //KAB_EMBEDDED
274 281
275 label->setBuddy( mStreetTextEdit ); 282 label->setBuddy( mStreetTextEdit );
276 topLayout->addWidget( mStreetTextEdit, 1, 1 ); 283 topLayout->addWidget( mStreetTextEdit, 1, 1 );
277 284
278 label = new QLabel( i18n( "Post office box:" ), page ); 285 label = new QLabel( i18n( "Post office box:" ), page );
279 topLayout->addWidget( label, 2 , 0 ); 286 topLayout->addWidget( label, 2 , 0 );
280 mPOBoxEdit = new KLineEdit( page ); 287 mPOBoxEdit = new KLineEdit( page );
281 label->setBuddy( mPOBoxEdit ); 288 label->setBuddy( mPOBoxEdit );
282 topLayout->addWidget( mPOBoxEdit, 2, 1 ); 289 topLayout->addWidget( mPOBoxEdit, 2, 1 );
283 int maxwid = QApplication::desktop()->width(); 290 int maxwid = QApplication::desktop()->width();
@@ -302,32 +309,32 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list,
302 309
303 label = new QLabel( i18n( "Country:" ), page ); 310 label = new QLabel( i18n( "Country:" ), page );
304 topLayout->addWidget( label, 6, 0 ); 311 topLayout->addWidget( label, 6, 0 );
305 mCountryCombo = new KComboBox( page ); 312 mCountryCombo = new KComboBox( page );
306 313
307 mCountryCombo->setMaximumWidth( maxwid -10 ); 314 mCountryCombo->setMaximumWidth( maxwid -10 );
308 mCountryCombo->setEditable( true ); 315 mCountryCombo->setEditable( true );
309 mCountryCombo->setDuplicatesEnabled( false ); 316 mCountryCombo->setDuplicatesEnabled( false );
310 mCountryCombo->setAutoCompletion( true ); 317 mCountryCombo->setAutoCompletion( true );
311 fillCountryCombo(); 318 fillCountryCombo();
312 label->setBuddy( mCountryCombo ); 319 label->setBuddy( mCountryCombo );
313 topLayout->addWidget( mCountryCombo, 6, 1 ); 320 topLayout->addWidget( mCountryCombo, 6, 1 );
314 mCountryCombo->setSizeLimit( 8); 321 mCountryCombo->setMaxVisibleItems( 8);
315 mPreferredCheckBox = new QCheckBox( i18n( "This is the preferred address" ), page ); 322 mPreferredCheckBox = new QCheckBox( i18n( "This is the preferred address" ), page );
316 topLayout->addMultiCellWidget( mPreferredCheckBox, 7, 7, 0, 1 ); 323 topLayout->addMultiCellWidget( mPreferredCheckBox, 7, 7, 0, 1 );
317 /* 324 /*
318 KSeparator *sep = new KSeparator( KSeparator::HLine, page ); 325 KSeparator *sep = new KSeparator( KSeparator::HLine, page );
319 topLayout->addMultiCellWidget( sep, 8, 8, 0, 1 ); 326 topLayout->addMultiCellWidget( sep, 8, 8, 0, 1 );
320 */ 327 */
321 QHBox *buttonBox = new QHBox( page ); 328 Q3HBox *buttonBox = new Q3HBox( page );
322 buttonBox->setSpacing( spacingHint() ); 329 buttonBox->setSpacing( spacingHint() );
323 topLayout->addMultiCellWidget( buttonBox, 9, 9, 0, 1 ); 330 topLayout->addMultiCellWidget( buttonBox, 9, 9, 0, 1 );
324 331
325 QPushButton *addButton = new QPushButton( i18n( "New..." ), buttonBox ); 332 QPushButton *addButton = new QPushButton( i18n( "New..." ), buttonBox );
326 connect( addButton, SIGNAL( clicked() ), SLOT( addAddress() ) ); 333 connect( addButton, SIGNAL( clicked() ), SLOT( addAddress() ) );
327 334
328 mRemoveButton = new QPushButton( i18n( "Remove" ), buttonBox ); 335 mRemoveButton = new QPushButton( i18n( "Remove" ), buttonBox );
329 connect( mRemoveButton, SIGNAL( clicked() ), SLOT( removeAddress() ) ); 336 connect( mRemoveButton, SIGNAL( clicked() ), SLOT( removeAddress() ) );
330 337
331 mChangeTypeButton = new QPushButton( i18n( "Change Type" ), buttonBox ); 338 mChangeTypeButton = new QPushButton( i18n( "Change Type" ), buttonBox );
332 connect( mChangeTypeButton, SIGNAL( clicked() ), SLOT( changeType() ) ); 339 connect( mChangeTypeButton, SIGNAL( clicked() ), SLOT( changeType() ) );
333 340
@@ -574,27 +581,27 @@ void AddressEditDialog::fillCountryCombo()
574 581
575 countries.sort(); 582 countries.sort();
576 583
577 mCountryCombo->insertStringList( countries ); 584 mCountryCombo->insertStringList( countries );
578} 585}
579 586
580 587
581AddressTypeDialog::AddressTypeDialog( int type, QWidget *parent ) 588AddressTypeDialog::AddressTypeDialog( int type, QWidget *parent )
582 : KDialogBase( Plain, i18n( "Edit Address Type" ), Ok | Cancel, Ok, 589 : KDialogBase( Plain, i18n( "Edit Address Type" ), Ok | Cancel, Ok,
583 parent, "AddressTypeDialog" ) 590 parent, "AddressTypeDialog" )
584{ 591{
585 QWidget *page = plainPage(); 592 QWidget *page = plainPage();
586 QVBoxLayout *layout = new QVBoxLayout( page ); 593 Q3VBoxLayout *layout = new Q3VBoxLayout( page );
587 594
588 mGroup = new QButtonGroup( 2, Horizontal, i18n( "Address Types" ), page ); 595 mGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "Address Types" ), page );
589 layout->addWidget( mGroup ); 596 layout->addWidget( mGroup );
590 597
591 mTypeList = KABC::Address::typeList(); 598 mTypeList = KABC::Address::typeList();
592 mTypeList.remove( KABC::Address::Pref ); 599 mTypeList.remove( KABC::Address::Pref );
593 600
594 KABC::Address::TypeList::Iterator it; 601 KABC::Address::TypeList::Iterator it;
595 for ( it = mTypeList.begin(); it != mTypeList.end(); ++it ) 602 for ( it = mTypeList.begin(); it != mTypeList.end(); ++it )
596 new QCheckBox( KABC::Address::typeLabel( *it ), mGroup ); 603 new QCheckBox( KABC::Address::typeLabel( *it ), mGroup );
597 604
598 for ( int i = 0; i < mGroup->count(); ++i ) { 605 for ( int i = 0; i < mGroup->count(); ++i ) {
599 QCheckBox *box = (QCheckBox*)mGroup->find( i ); 606 QCheckBox *box = (QCheckBox*)mGroup->find( i );
600 box->setChecked( type & mTypeList[ i ] ); 607 box->setChecked( type & mTypeList[ i ] );
@@ -608,15 +615,15 @@ AddressTypeDialog::~AddressTypeDialog()
608int AddressTypeDialog::type() const 615int AddressTypeDialog::type() const
609{ 616{
610 int type = 0; 617 int type = 0;
611 for ( int i = 0; i < mGroup->count(); ++i ) { 618 for ( int i = 0; i < mGroup->count(); ++i ) {
612 QCheckBox *box = (QCheckBox*)mGroup->find( i ); 619 QCheckBox *box = (QCheckBox*)mGroup->find( i );
613 if ( box->isChecked() ) 620 if ( box->isChecked() )
614 type += mTypeList[ i ]; 621 type += mTypeList[ i ];
615 } 622 }
616 623
617 return type; 624 return type;
618} 625}
619 626
620#ifndef KAB_EMBEDDED 627#ifndef KAB_EMBEDDED_
621#include "addresseditwidget.moc" 628#include "moc_addresseditwidget.cpp"
622#endif //KAB_EMBEDDED 629#endif //KAB_EMBEDDED
diff --git a/kaddressbook/addresseditwidget.h b/kaddressbook/addresseditwidget.h
index bc96d74..1d4e138 100644
--- a/kaddressbook/addresseditwidget.h
+++ b/kaddressbook/addresseditwidget.h
@@ -24,31 +24,31 @@
24#ifndef ADDRESSEDITWIDGET_H 24#ifndef ADDRESSEDITWIDGET_H
25#define ADDRESSEDITWIDGET_H 25#define ADDRESSEDITWIDGET_H
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28 28
29#include <kdialogbase.h> 29#include <kdialogbase.h>
30#include <kabc/address.h> 30#include <kabc/address.h>
31#include <kabc/addressee.h> 31#include <kabc/addressee.h>
32 32
33#include "addresseeconfig.h" 33#include "addresseeconfig.h"
34#include "typecombo.h" 34#include "typecombo.h"
35 35
36class QButtonGroup; 36class Q3ButtonGroup;
37class QCheckBox; 37class QCheckBox;
38class QListView; 38class Q3ListView;
39#ifndef KAB_EMBEDDED 39#ifndef KAB_EMBEDDED
40class QTextEdit; 40class Q3TextEdit;
41#else //KAB_EMBEDDED 41#else //KAB_EMBEDDED
42class QMultiLineEdit; 42class Q3MultiLineEdit;
43#endif //KAB_EMBEDDED 43#endif //KAB_EMBEDDED
44class QToolButton; 44class QToolButton;
45 45
46class KComboBox; 46class KComboBox;
47class KLineEdit; 47class KLineEdit;
48class KListView; 48class KListView;
49 49
50typedef TypeCombo<KABC::Address> AddressTypeCombo; 50typedef TypeCombo<KABC::Address> AddressTypeCombo;
51 51
52/** 52/**
53 Editor widget for addresses. 53 Editor widget for addresses.
54 */ 54 */
@@ -72,27 +72,27 @@ class AddressEditWidget : public QWidget
72 72
73 protected slots: 73 protected slots:
74 void updateAddressEdit(); 74 void updateAddressEdit();
75 75
76 void edit(); 76 void edit();
77 77
78 private: 78 private:
79 AddresseeConfig * mConfig; 79 AddresseeConfig * mConfig;
80 AddressTypeCombo *mTypeCombo; 80 AddressTypeCombo *mTypeCombo;
81 81
82 QPushButton *mEditButton; 82 QPushButton *mEditButton;
83#ifndef KAB_EMBEDDED 83#ifndef KAB_EMBEDDED
84 QTextEdit *mAddressTextEdit; 84 Q3TextEdit *mAddressTextEdit;
85#else //KAB_EMBEDDED 85#else //KAB_EMBEDDED
86 QMultiLineEdit *mAddressTextEdit; 86 Q3MultiLineEdit *mAddressTextEdit;
87#endif //KAB_EMBEDDED 87#endif //KAB_EMBEDDED
88 88
89 KABC::Address::List mAddressList; 89 KABC::Address::List mAddressList;
90 KABC::Addressee mAddressee; 90 KABC::Addressee mAddressee;
91 int mIndex; 91 int mIndex;
92}; 92};
93 93
94/** 94/**
95 Dialog for editing address details. 95 Dialog for editing address details.
96 */ 96 */
97class AddressEditDialog : public KDialogBase 97class AddressEditDialog : public KDialogBase
98{ 98{
@@ -111,27 +111,27 @@ class AddressEditDialog : public KDialogBase
111 void removeAddress(); 111 void removeAddress();
112 void changeType(); 112 void changeType();
113 113
114 void updateAddressEdits(); 114 void updateAddressEdits();
115 void modified(); 115 void modified();
116 116
117 private: 117 private:
118 void saveAddress( KABC::Address &addr ); 118 void saveAddress( KABC::Address &addr );
119 void fillCountryCombo(); 119 void fillCountryCombo();
120 120
121 AddressTypeCombo *mTypeCombo; 121 AddressTypeCombo *mTypeCombo;
122#ifndef KAB_EMBEDDED 122#ifndef KAB_EMBEDDED
123 QTextEdit *mStreetTextEdit; 123 Q3TextEdit *mStreetTextEdit;
124#else //KAB_EMBEDDED 124#else //KAB_EMBEDDED
125 QMultiLineEdit *mStreetTextEdit; 125 Q3MultiLineEdit *mStreetTextEdit;
126#endif //KAB_EMBEDDED 126#endif //KAB_EMBEDDED
127 KComboBox *mCountryCombo; 127 KComboBox *mCountryCombo;
128 KLineEdit *mRegionEdit; 128 KLineEdit *mRegionEdit;
129 KLineEdit *mLocalityEdit; 129 KLineEdit *mLocalityEdit;
130 KLineEdit *mPostalCodeEdit; 130 KLineEdit *mPostalCodeEdit;
131 KLineEdit *mPOBoxEdit; 131 KLineEdit *mPOBoxEdit;
132 QCheckBox *mPreferredCheckBox; 132 QCheckBox *mPreferredCheckBox;
133 133
134 QPushButton *mRemoveButton; 134 QPushButton *mRemoveButton;
135 QPushButton *mChangeTypeButton; 135 QPushButton *mChangeTypeButton;
136 136
137 KABC::Address::List mAddressList; 137 KABC::Address::List mAddressList;
@@ -142,18 +142,18 @@ class AddressEditDialog : public KDialogBase
142/** 142/**
143 Dialog for selecting an address type. 143 Dialog for selecting an address type.
144 */ 144 */
145class AddressTypeDialog : public KDialogBase 145class AddressTypeDialog : public KDialogBase
146{ 146{
147 public: 147 public:
148 AddressTypeDialog( int type, QWidget *parent ); 148 AddressTypeDialog( int type, QWidget *parent );
149 ~AddressTypeDialog(); 149 ~AddressTypeDialog();
150 150
151 int type() const; 151 int type() const;
152 152
153 private: 153 private:
154 QButtonGroup *mGroup; 154 Q3ButtonGroup *mGroup;
155 155
156 KABC::Address::TypeList mTypeList; 156 KABC::Address::TypeList mTypeList;
157}; 157};
158 158
159#endif 159#endif
diff --git a/kaddressbook/addresseeconfig.cpp b/kaddressbook/addresseeconfig.cpp
index ea0436f..81b1bf4 100644
--- a/kaddressbook/addresseeconfig.cpp
+++ b/kaddressbook/addresseeconfig.cpp
@@ -17,24 +17,26 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include "addresseeconfig.h" 24#include "addresseeconfig.h"
25#include "kabprefs.h" 25#include "kabprefs.h"
26//US 26//US
27#include <kstandarddirs.h> 27#include <kstandarddirs.h>
28#include <qfileinfo.h> 28#include <qfileinfo.h>
29//Added by qt3to4:
30#include <Q3ValueList>
29 31
30using namespace KABC; 32using namespace KABC;
31 33
32static AddresseeConfig* extern_AddresseeConfig = 0; 34static AddresseeConfig* extern_AddresseeConfig = 0;
33static KConfig * extern_Config = 0; 35static KConfig * extern_Config = 0;
34 36
35AddresseeConfig::AddresseeConfig() 37AddresseeConfig::AddresseeConfig()
36{ 38{
37 39
38 40
39} 41}
40AddresseeConfig::~AddresseeConfig() 42AddresseeConfig::~AddresseeConfig()
@@ -68,27 +70,27 @@ void AddresseeConfig::setUid( const QString & uid )
68void AddresseeConfig::setAutomaticNameParsing( bool value ) 70void AddresseeConfig::setAutomaticNameParsing( bool value )
69{ 71{
70 AddresseeConfig::config()->writeEntry( "AutomaticNameParsing", value ); 72 AddresseeConfig::config()->writeEntry( "AutomaticNameParsing", value );
71} 73}
72 74
73 bool AddresseeConfig::automaticNameParsing() 75 bool AddresseeConfig::automaticNameParsing()
74{ 76{
75 77
76 return AddresseeConfig::config()->readBoolEntry( "AutomaticNameParsing", 78 return AddresseeConfig::config()->readBoolEntry( "AutomaticNameParsing",
77 KABPrefs::instance()->mAutomaticNameParsing ); 79 KABPrefs::instance()->mAutomaticNameParsing );
78} 80}
79 81
80void AddresseeConfig::setNoDefaultAddrTypes( const QValueList<int> &types ) 82void AddresseeConfig::setNoDefaultAddrTypes( const Q3ValueList<int> &types )
81{ 83{
82 AddresseeConfig::config()->writeEntry( "NoDefaultAddrTypes", types ); 84 AddresseeConfig::config()->writeEntry( "NoDefaultAddrTypes", types );
83 AddresseeConfig::config()->sync(); 85 AddresseeConfig::config()->sync();
84} 86}
85 87
86 QValueList<int> AddresseeConfig::noDefaultAddrTypes() const 88 Q3ValueList<int> AddresseeConfig::noDefaultAddrTypes() const
87{ 89{
88 return AddresseeConfig::config()->readIntListEntry( "NoDefaultAddrTypes" ); 90 return AddresseeConfig::config()->readIntListEntry( "NoDefaultAddrTypes" );
89} 91}
90 92
91void AddresseeConfig::remove( const QString & uid ) 93void AddresseeConfig::remove( const QString & uid )
92{ 94{
93 AddresseeConfig::config()->deleteGroup( uid ); 95 AddresseeConfig::config()->deleteGroup( uid );
94} 96}
diff --git a/kaddressbook/addresseeconfig.h b/kaddressbook/addresseeconfig.h
index 47fbdd6..f6bb3e9 100644
--- a/kaddressbook/addresseeconfig.h
+++ b/kaddressbook/addresseeconfig.h
@@ -17,39 +17,41 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef ADDRESSEECONFIG_H 24#ifndef ADDRESSEECONFIG_H
25#define ADDRESSEECONFIG_H 25#define ADDRESSEECONFIG_H
26 26
27#include <kabc/addressee.h> 27#include <kabc/addressee.h>
28#include <kconfig.h> 28#include <kconfig.h>
29//Added by qt3to4:
30#include <Q3ValueList>
29 31
30using namespace KABC; 32using namespace KABC;
31 33
32class AddresseeConfig 34class AddresseeConfig
33{ 35{
34 public: 36 public:
35 AddresseeConfig(); 37 AddresseeConfig();
36 ~AddresseeConfig(); 38 ~AddresseeConfig();
37 static AddresseeConfig* instance(); 39 static AddresseeConfig* instance();
38 static KConfig* config(); 40 static KConfig* config();
39 41
40 Addressee addressee(); 42 Addressee addressee();
41 43
42 void setUid( const QString & uid ); 44 void setUid( const QString & uid );
43 void setAutomaticNameParsing( bool value ); 45 void setAutomaticNameParsing( bool value );
44 bool automaticNameParsing(); 46 bool automaticNameParsing();
45 47
46 void setNoDefaultAddrTypes( const QValueList<int> &types ); 48 void setNoDefaultAddrTypes( const Q3ValueList<int> &types );
47 QValueList<int> noDefaultAddrTypes() const; 49 Q3ValueList<int> noDefaultAddrTypes() const;
48 50
49 void remove( const QString & uid); 51 void remove( const QString & uid);
50 52
51 private: 53 private:
52 QString mUid; 54 QString mUid;
53}; 55};
54 56
55#endif 57#endif
diff --git a/kaddressbook/addresseeeditordialog.cpp b/kaddressbook/addresseeeditordialog.cpp
index b5a60f2..b925a07 100644
--- a/kaddressbook/addresseeeditordialog.cpp
+++ b/kaddressbook/addresseeeditordialog.cpp
@@ -14,45 +14,48 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qapplication.h> 25#include <qapplication.h>
26#include <QDesktopWidget>
27//Added by qt3to4:
28#include <Q3VBoxLayout>
26 29
27#include <kdebug.h> 30#include <kdebug.h>
28#include <klocale.h> 31#include <klocale.h>
29#include <kglobal.h> 32#include <kglobal.h>
30 33
31#include "addresseeeditorwidget.h" 34#include "addresseeeditorwidget.h"
32#include "kabcore.h" 35#include "kabcore.h"
33 36
34#include "addresseeeditordialog.h" 37#include "addresseeeditordialog.h"
35 38
36AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent, 39AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent,
37 const char *name ) 40 const char *name )
38 : KDialogBase( KDialogBase::Plain, i18n( "Edit Contact" ), 41 : KDialogBase( KDialogBase::Plain, i18n( "Edit Contact" ),
39 KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply, 42 KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply,
40 KDialogBase::Ok, parent, name, true ) 43 KDialogBase::Ok, parent, name, true )
41{ 44{
42 45
43 46
44 QWidget *page = plainPage(); 47 QWidget *page = plainPage();
45 48
46 QVBoxLayout *layout = new QVBoxLayout( page ); 49 Q3VBoxLayout *layout = new Q3VBoxLayout( page );
47 50
48 mEditorWidget = new AddresseeEditorWidget( core, false, page ); 51 mEditorWidget = new AddresseeEditorWidget( core, false, page );
49 connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ), 52 connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ),
50 SLOT( widgetModified() ) ); 53 SLOT( widgetModified() ) );
51 layout->addWidget( mEditorWidget ); 54 layout->addWidget( mEditorWidget );
52 55
53 enableButton( KDialogBase::Apply, false ); 56 enableButton( KDialogBase::Apply, false );
54 if ( QApplication::desktop()->width() < 480 ) { 57 if ( QApplication::desktop()->width() < 480 ) {
55 hideButtons(); 58 hideButtons();
56 } 59 }
57} 60}
58 61
@@ -109,15 +112,15 @@ void AddresseeEditorDialog::slotOk()
109void AddresseeEditorDialog::widgetModified() 112void AddresseeEditorDialog::widgetModified()
110{ 113{
111 enableButton( KDialogBase::Apply, true ); 114 enableButton( KDialogBase::Apply, true );
112} 115}
113 116
114void AddresseeEditorDialog::slotCancel() 117void AddresseeEditorDialog::slotCancel()
115{ 118{
116 KDialogBase::slotCancel(); 119 KDialogBase::slotCancel();
117 120
118 121
119} 122}
120 123
121#ifndef KAB_EMBEDDED 124#ifndef KAB_EMBEDDED_
122#include "addresseeeditordialog.moc" 125#include "moc_addresseeeditordialog.cpp"
123#endif //KAB_EMBEDDED 126#endif //KAB_EMBEDDED
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 4313998..a95db03 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -13,41 +13,45 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qhbox.h> 25#include <q3hbox.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qlistbox.h> 28#include <q3listbox.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qtabwidget.h> 30#include <qtabwidget.h>
31#include <qapplication.h> 31#include <qapplication.h>
32 32
33#ifndef KAB_EMBEDDED 33#ifndef KAB_EMBEDDED
34#include <qtextedit.h> 34#include <q3textedit.h>
35//Added by qt3to4:
36#include <Q3GridLayout>
37#include <Q3PopupMenu>
38#include <Q3VBoxLayout>
35 39
36#include <kaccelmanager.h> 40#include <kaccelmanager.h>
37#include "keywidget.h" 41#include "keywidget.h"
38#include "soundwidget.h" 42#include "soundwidget.h"
39 43
40#else //KAB_EMBEDDED 44#else //KAB_EMBEDDED
41#include <qmultilineedit.h> 45#include <q3multilineedit.h>
42#endif //KAB_EMBEDDED 46#endif //KAB_EMBEDDED
43 47
44 48
45#include "keywidget.h" 49#include "keywidget.h"
46#include "geowidget.h" 50#include "geowidget.h"
47#include "imagewidget.h" 51#include "imagewidget.h"
48#include "nameeditdialog.h" 52#include "nameeditdialog.h"
49#include "phoneeditwidget.h" 53#include "phoneeditwidget.h"
50#include "secrecywidget.h" 54#include "secrecywidget.h"
51 55
52 56
53#include <qtoolbutton.h> 57#include <qtoolbutton.h>
@@ -121,25 +125,25 @@ void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr )
121const KABC::Addressee &AddresseeEditorWidget::addressee() 125const KABC::Addressee &AddresseeEditorWidget::addressee()
122{ 126{
123 return mAddressee; 127 return mAddressee;
124} 128}
125 129
126void AddresseeEditorWidget::textChanged( const QString& ) 130void AddresseeEditorWidget::textChanged( const QString& )
127{ 131{
128 emitModified(); 132 emitModified();
129} 133}
130 134
131void AddresseeEditorWidget::initGUI() 135void AddresseeEditorWidget::initGUI()
132{ 136{
133 QVBoxLayout *layout = new QVBoxLayout( this ); 137 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
134 138
135 mTabWidget = new QTabWidget( this ); 139 mTabWidget = new QTabWidget( this );
136 layout->addWidget( mTabWidget ); 140 layout->addWidget( mTabWidget );
137 141
138 setupTab1(); 142 setupTab1();
139 setupTab1_1(); 143 setupTab1_1();
140 setupTab2(); 144 setupTab2();
141 setupTab2_1(); 145 setupTab2_1();
142 setupTab3(); 146 setupTab3();
143 setupTab3_1(); 147 setupTab3_1();
144 148
145 mNameEdit->setFocus(); 149 mNameEdit->setFocus();
@@ -151,25 +155,25 @@ void AddresseeEditorWidget::initGUI()
151void AddresseeEditorWidget::setupTab1() 155void AddresseeEditorWidget::setupTab1()
152{ 156{
153 // This is the General tab 157 // This is the General tab
154 QWidget *tab1 = new QWidget( mTabWidget ); 158 QWidget *tab1 = new QWidget( mTabWidget );
155 159
156//US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); 160//US QGridLayout *layout = new QGridLayout( tab1, 11, 7 );
157 bool horLayout = false; 161 bool horLayout = false;
158 int maxCol = 1; 162 int maxCol = 1;
159 if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) { 163 if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) {
160 horLayout = true; 164 horLayout = true;
161 maxCol = 3; 165 maxCol = 3;
162 } 166 }
163 QGridLayout *layout = new QGridLayout( tab1, 7-maxCol, maxCol ); 167 Q3GridLayout *layout = new Q3GridLayout( tab1, 7-maxCol, maxCol );
164 168
165 layout->setMargin( KDialogBase::marginHintSmall() ); 169 layout->setMargin( KDialogBase::marginHintSmall() );
166 layout->setSpacing( KDialogBase::spacingHintSmall() ); 170 layout->setSpacing( KDialogBase::spacingHintSmall() );
167 171
168 QLabel *label; 172 QLabel *label;
169 KSeparator* bar; 173 KSeparator* bar;
170 QPushButton *button; 174 QPushButton *button;
171 175
172 ////////////////////////////////// 176 //////////////////////////////////
173 // Upper left group (person info) 177 // Upper left group (person info)
174 178
175 // Person icon 179 // Person icon
@@ -318,35 +322,35 @@ void AddresseeEditorWidget::setupTab1()
318 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), 322 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ),
319 SLOT( textChanged( const QString& ) ) ); 323 SLOT( textChanged( const QString& ) ) );
320 label->setBuddy( mIMAddressEdit ); 324 label->setBuddy( mIMAddressEdit );
321 layout->addWidget( label, 9, 4 ); 325 layout->addWidget( label, 9, 4 );
322 layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); 326 layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 );
323 327
324 layout->addColSpacing( 6, 50 ); 328 layout->addColSpacing( 6, 50 );
325 329
326 bar = new KSeparator( KSeparator::HLine, tab1 ); 330 bar = new KSeparator( KSeparator::HLine, tab1 );
327 layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); 331 layout->addMultiCellWidget( bar, 10, 10, 0, 6 );
328*/ 332*/
329 /////////////////////////////////////// 333 ///////////////////////////////////////
330 QHBox *categoryBox = new QHBox( tab1 ,"cato"); 334 Q3HBox *categoryBox = new Q3HBox( tab1 ,"cato");
331 categoryBox->setSpacing( KDialogBase::spacingHint() ); 335 categoryBox->setSpacing( KDialogBase::spacingHint() );
332 categoryBox->setMargin( KDialogBase::marginHintSmall() ); 336 categoryBox->setMargin( KDialogBase::marginHintSmall() );
333 337
334 // Categories 338 // Categories
335 button = new QPushButton( i18n( "Categories" )+":", categoryBox ); 339 button = new QPushButton( i18n( "Categories" )+":", categoryBox );
336 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); 340 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
337 341
338 mCategoryEdit = new QPushButton ( categoryBox ); 342 mCategoryEdit = new QPushButton ( categoryBox );
339 mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); 343 mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
340 mCatPopup = new QPopupMenu ( categoryBox ); 344 mCatPopup = new Q3PopupMenu ( categoryBox );
341 mCategoryEdit->setPopup( mCatPopup ); 345 mCategoryEdit->setPopup( mCatPopup );
342 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); 346 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup()));
343 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); 347 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int )));
344 //connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), 348 //connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
345 // SLOT( textChanged( const QString& ) ) ); 349 // SLOT( textChanged( const QString& ) ) );
346 350
347 mSecrecyWidget = new SecrecyWidget( categoryBox ); 351 mSecrecyWidget = new SecrecyWidget( categoryBox );
348 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 352 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
349 353
350//US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); 354//US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
351 layout->addMultiCellWidget( categoryBox, iii, iii, 0, maxCol ); 355 layout->addMultiCellWidget( categoryBox, iii, iii, 0, maxCol );
352 356
@@ -402,25 +406,25 @@ void AddresseeEditorWidget::setCompany2FN()
402 mFormattedNameType = NameEditDialog::CustomName; 406 mFormattedNameType = NameEditDialog::CustomName;
403 mAddressee.setFormattedName( mOrgEdit->text() ); 407 mAddressee.setFormattedName( mOrgEdit->text() );
404 mFormattedNameLabel->setText( mOrgEdit->text() ); 408 mFormattedNameLabel->setText( mOrgEdit->text() );
405 emitModified(); 409 emitModified();
406} 410}
407 411
408void AddresseeEditorWidget::setupTab1_1() 412void AddresseeEditorWidget::setupTab1_1()
409{ 413{
410 // This is the Address tab 414 // This is the Address tab
411 QWidget *tab1_1 = new QWidget( mTabWidget ); 415 QWidget *tab1_1 = new QWidget( mTabWidget );
412 416
413//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); 417//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 );
414 QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); 418 Q3GridLayout *layout = new Q3GridLayout( tab1_1, 7, 2 );
415 layout->setMargin( KDialogBase::marginHintSmall() ); 419 layout->setMargin( KDialogBase::marginHintSmall() );
416 layout->setSpacing( KDialogBase::spacingHintSmall() ); 420 layout->setSpacing( KDialogBase::spacingHintSmall() );
417 421
418 QLabel *label; 422 QLabel *label;
419 KSeparator* bar; 423 KSeparator* bar;
420 QPushButton *button; 424 QPushButton *button;
421 425
422/*US 426/*US
423 ////////////////////////////////// 427 //////////////////////////////////
424 // Upper left group (person info) 428 // Upper left group (person info)
425 429
426 // Person icon 430 // Person icon
@@ -603,25 +607,25 @@ qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
603 layout->activate(); // required 607 layout->activate(); // required
604 608
605 mTabWidget->addTab( tab1_1, i18n( "&Address" ) ); 609 mTabWidget->addTab( tab1_1, i18n( "&Address" ) );
606} 610}
607 611
608 612
609 613
610void AddresseeEditorWidget::setupTab2() 614void AddresseeEditorWidget::setupTab2()
611{ 615{
612 // This is the Details tab 616 // This is the Details tab
613 QWidget *tab2 = new QWidget( mTabWidget ); 617 QWidget *tab2 = new QWidget( mTabWidget );
614 618
615 QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); 619 Q3GridLayout *layout = new Q3GridLayout( tab2, 8, 3 );
616 layout->setMargin( KDialogBase::marginHintSmall() ); 620 layout->setMargin( KDialogBase::marginHintSmall() );
617 layout->setSpacing( KDialogBase::spacingHintSmall() ); 621 layout->setSpacing( KDialogBase::spacingHintSmall() );
618 622
619 QLabel *label; 623 QLabel *label;
620 KSeparator* bar; 624 KSeparator* bar;
621 625
622 /////////////////////// 626 ///////////////////////
623 // Office info 627 // Office info
624 628
625 // Department 629 // Department
626 label = new QLabel( tab2 ); 630 label = new QLabel( tab2 );
627//US loadIcon call is ambiguous. Add one more parameter 631//US loadIcon call is ambiguous. Add one more parameter
@@ -682,25 +686,25 @@ void AddresseeEditorWidget::setupTab2()
682 686
683 //label = new QLabel( tab2 ); 687 //label = new QLabel( tab2 );
684//US loadIcon call is ambiguous. Add one more parameter 688//US loadIcon call is ambiguous. Add one more parameter
685//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 689//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
686 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 690 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
687//US layout->addMultiCellWidget( label, 4, 5, 0, 0 ); 691//US layout->addMultiCellWidget( label, 4, 5, 0, 0 );
688 //layout->addMultiCellWidget( label, 6, 7, 0, 0 ); 692 //layout->addMultiCellWidget( label, 6, 7, 0, 0 );
689 693
690 694
691 int iii = 6; 695 int iii = 6;
692 696
693 if ( QApplication::desktop()->width() == 640 ) { 697 if ( QApplication::desktop()->width() == 640 ) {
694 QHBox * nbox = new QHBox ( tab2 ); 698 Q3HBox * nbox = new Q3HBox ( tab2 );
695 label = new QLabel( i18n( "Nick name:" )+" ", nbox ); 699 label = new QLabel( i18n( "Nick name:" )+" ", nbox );
696 mNicknameEdit = new KLineEdit( nbox ); 700 mNicknameEdit = new KLineEdit( nbox );
697 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 701 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
698 SLOT( textChanged( const QString& ) ) ); 702 SLOT( textChanged( const QString& ) ) );
699 label->setBuddy( mNicknameEdit ); 703 label->setBuddy( mNicknameEdit );
700 704
701 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox ); 705 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox );
702 mSpouseEdit = new KLineEdit( nbox ); 706 mSpouseEdit = new KLineEdit( nbox );
703 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 707 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
704 SLOT( textChanged( const QString& ) ) ); 708 SLOT( textChanged( const QString& ) ) );
705 label->setBuddy( mSpouseEdit ); 709 label->setBuddy( mSpouseEdit );
706 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); 710 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
@@ -726,25 +730,25 @@ void AddresseeEditorWidget::setupTab2()
726 ++iii; 730 ++iii;
727 } 731 }
728 732
729 label = new QLabel( i18n( "Children's names:" ), tab2 ); 733 label = new QLabel( i18n( "Children's names:" ), tab2 );
730 layout->addWidget( label, iii, 1 ); 734 layout->addWidget( label, iii, 1 );
731 mChildEdit = new KLineEdit( tab2 ); 735 mChildEdit = new KLineEdit( tab2 );
732 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ), 736 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ),
733 SLOT( textChanged( const QString& ) ) ); 737 SLOT( textChanged( const QString& ) ) );
734 label->setBuddy( mChildEdit ); 738 label->setBuddy( mChildEdit );
735 layout->addWidget( mChildEdit, iii, 2 ); 739 layout->addWidget( mChildEdit, iii, 2 );
736 ++iii; 740 ++iii;
737 if ( QApplication::desktop()->width() == 640 ) { 741 if ( QApplication::desktop()->width() == 640 ) {
738 QHBox * nbox = new QHBox ( tab2 ); 742 Q3HBox * nbox = new Q3HBox ( tab2 );
739 label = new QLabel( i18n( "Birthday:" )+" ", nbox ); 743 label = new QLabel( i18n( "Birthday:" )+" ", nbox );
740 mBirthdayPicker = new KDateEdit( nbox ); 744 mBirthdayPicker = new KDateEdit( nbox );
741 //mBirthdayPicker->toggleDateFormat(); 745 //mBirthdayPicker->toggleDateFormat();
742 mBirthdayPicker->setHandleInvalid( true ); 746 mBirthdayPicker->setHandleInvalid( true );
743 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 747 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
744 SLOT( dateChanged( QDate ) ) ); 748 SLOT( dateChanged( QDate ) ) );
745 749
746 label->setBuddy( mBirthdayPicker ); 750 label->setBuddy( mBirthdayPicker );
747 751
748 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox ); 752 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox );
749 mAnniversaryPicker = new KDateEdit( nbox ); 753 mAnniversaryPicker = new KDateEdit( nbox );
750 mAnniversaryPicker->setHandleInvalid( true ); 754 mAnniversaryPicker->setHandleInvalid( true );
@@ -795,25 +799,25 @@ void AddresseeEditorWidget::setupTab2()
795 ++iii; 799 ++iii;
796 // Build the layout and add to the tab widget 800 // Build the layout and add to the tab widget
797 layout->activate(); // required 801 layout->activate(); // required
798 802
799 mTabWidget->addTab( tab2, i18n( "&Details" ) ); 803 mTabWidget->addTab( tab2, i18n( "&Details" ) );
800} 804}
801 805
802void AddresseeEditorWidget::setupTab2_1() 806void AddresseeEditorWidget::setupTab2_1()
803{ 807{
804 // This is the Details tab 808 // This is the Details tab
805 QWidget *tab2_2 = new QWidget( mTabWidget ); 809 QWidget *tab2_2 = new QWidget( mTabWidget );
806 810
807 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); 811 Q3GridLayout *layout = new Q3GridLayout( tab2_2, 1, 2 );
808 layout->setMargin( KDialogBase::marginHintSmall() ); 812 layout->setMargin( KDialogBase::marginHintSmall() );
809 layout->setSpacing( KDialogBase::spacingHintSmall() ); 813 layout->setSpacing( KDialogBase::spacingHintSmall() );
810 814
811 QLabel *label; 815 QLabel *label;
812 KSeparator* bar; 816 KSeparator* bar;
813 817
814/*US 818/*US
815 /////////////////////// 819 ///////////////////////
816 // Office info 820 // Office info
817 821
818 // Department 822 // Department
819 label = new QLabel( tab2 ); 823 label = new QLabel( tab2 );
@@ -917,52 +921,52 @@ void AddresseeEditorWidget::setupTab2_1()
917 layout->addWidget( mAnniversaryPicker, 5, 4 ); 921 layout->addWidget( mAnniversaryPicker, 5, 4 );
918 922
919 bar = new KSeparator( KSeparator::HLine, tab2 ); 923 bar = new KSeparator( KSeparator::HLine, tab2 );
920 layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); 924 layout->addMultiCellWidget( bar, 6, 6, 0, 5 );
921*/ 925*/
922 ////////////////////////////////////// 926 //////////////////////////////////////
923 // Notes 927 // Notes
924 label = new QLabel( i18n( "Note:" ), tab2_2 ); 928 label = new QLabel( i18n( "Note:" ), tab2_2 );
925 label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); 929 label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
926//US layout->addWidget( label, 7, 0 ); 930//US layout->addWidget( label, 7, 0 );
927 layout->addWidget( label, 0, 0 ); 931 layout->addWidget( label, 0, 0 );
928#ifndef KAB_EMBEDDED 932#ifndef KAB_EMBEDDED
929 mNoteEdit = new QTextEdit( tab2_2 ); 933 mNoteEdit = new Q3TextEdit( tab2_2 );
930 mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); 934 mNoteEdit->setWordWrap( Q3TextEdit::WidgetWidth );
931 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 935 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
932#else //KAB_EMBEDDED 936#else //KAB_EMBEDDED
933 mNoteEdit = new QMultiLineEdit( tab2_2 ); 937 mNoteEdit = new Q3MultiLineEdit( tab2_2 );
934 mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); 938 mNoteEdit->setWordWrap( Q3MultiLineEdit::WidgetWidth );
935 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 939 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
936#endif //KAB_EMBEDDED 940#endif //KAB_EMBEDDED
937 941
938 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); 942 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) );
939 label->setBuddy( mNoteEdit ); 943 label->setBuddy( mNoteEdit );
940//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); 944//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 );
941 layout->addWidget( mNoteEdit, 1, 0); 945 layout->addWidget( mNoteEdit, 1, 0);
942 946
943 // Build the layout and add to the tab widget 947 // Build the layout and add to the tab widget
944 layout->activate(); // required 948 layout->activate(); // required
945 949
946 mTabWidget->addTab( tab2_2, i18n( "&Notes" ) ); 950 mTabWidget->addTab( tab2_2, i18n( "&Notes" ) );
947} 951}
948 952
949 953
950 954
951void AddresseeEditorWidget::setupTab3() 955void AddresseeEditorWidget::setupTab3()
952{ 956{
953 // This is the Misc tab 957 // This is the Misc tab
954 QWidget *tab3 = new QWidget( mTabWidget ); 958 QWidget *tab3 = new QWidget( mTabWidget );
955 959
956 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 960 Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 );
957 layout->setMargin( KDialogBase::marginHintSmall() ); 961 layout->setMargin( KDialogBase::marginHintSmall() );
958 layout->setSpacing( KDialogBase::spacingHintSmall() ); 962 layout->setSpacing( KDialogBase::spacingHintSmall() );
959//US layout->setColStretch( 2, 1 ); 963//US layout->setColStretch( 2, 1 );
960 964
961 ////////////////////////////////////// 965 //////////////////////////////////////
962 // Geo 966 // Geo
963 mGeoWidget = new GeoWidget( tab3 ); 967 mGeoWidget = new GeoWidget( tab3 );
964 // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); 968 // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() );
965 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 969 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
966 layout->addWidget( mGeoWidget, 0, 0 ); 970 layout->addWidget( mGeoWidget, 0, 0 );
967/*US 971/*US
968 ////////////////////////////////////// 972 //////////////////////////////////////
@@ -996,25 +1000,25 @@ qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be
996//US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); 1000//US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop );
997 layout->addWidget( mKeyWidget, 1, 0 ); 1001 layout->addWidget( mKeyWidget, 1, 0 );
998 1002
999 mTabWidget->addTab( tab3, i18n( "&Misc" ) ); 1003 mTabWidget->addTab( tab3, i18n( "&Misc" ) );
1000} 1004}
1001 1005
1002void AddresseeEditorWidget::setupTab3_1() 1006void AddresseeEditorWidget::setupTab3_1()
1003{ 1007{
1004 // This is the Misc tab 1008 // This is the Misc tab
1005 QWidget *tab3 = new QWidget( mTabWidget ); 1009 QWidget *tab3 = new QWidget( mTabWidget );
1006 1010
1007//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); 1011//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 );
1008 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 1012 Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 );
1009 layout->setMargin( KDialogBase::marginHint() ); 1013 layout->setMargin( KDialogBase::marginHint() );
1010 layout->setSpacing( KDialogBase::spacingHint() ); 1014 layout->setSpacing( KDialogBase::spacingHint() );
1011//US layout->setColStretch( 2, 1 ); 1015//US layout->setColStretch( 2, 1 );
1012 1016
1013/*US 1017/*US
1014 ////////////////////////////////////// 1018 //////////////////////////////////////
1015 // Geo 1019 // Geo
1016 mGeoWidget = new GeoWidget( tab3 ); 1020 mGeoWidget = new GeoWidget( tab3 );
1017 mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); 1021 mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() );
1018 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 1022 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
1019 layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop ); 1023 layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop );
1020*/ 1024*/
@@ -1421,15 +1425,15 @@ void AddresseeEditorWidget::pageChanged( QWidget *wdg )
1421} 1425}
1422 1426
1423QString AddresseeEditorWidget::title() const 1427QString AddresseeEditorWidget::title() const
1424{ 1428{
1425 return i18n( "Contact Editor" ); 1429 return i18n( "Contact Editor" );
1426} 1430}
1427 1431
1428QString AddresseeEditorWidget::identifier() const 1432QString AddresseeEditorWidget::identifier() const
1429{ 1433{
1430 return i18n( "contact_editor" ); 1434 return i18n( "contact_editor" );
1431} 1435}
1432 1436
1433#ifndef KAB_EMBEDDED 1437#ifndef KAB_EMBEDDED_
1434#include "addresseeeditorwidget.moc" 1438#include "moc_addresseeeditorwidget.cpp"
1435#endif //KAB_EMBEDDED 1439#endif //KAB_EMBEDDED
diff --git a/kaddressbook/addresseeeditorwidget.h b/kaddressbook/addresseeeditorwidget.h
index 816bbb5..aa1207e 100644
--- a/kaddressbook/addresseeeditorwidget.h
+++ b/kaddressbook/addresseeeditorwidget.h
@@ -16,42 +16,42 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef ADDRESSEEEDITORWIDGET_H 24#ifndef ADDRESSEEEDITORWIDGET_H
25#define ADDRESSEEEDITORWIDGET_H 25#define ADDRESSEEEDITORWIDGET_H
26 26
27#include <qdatetime.h> 27#include <qdatetime.h>
28#include <qpopupmenu.h> 28#include <q3popupmenu.h>
29#include <qcombobox.h> 29#include <qcombobox.h>
30 30
31#include <kabc/addressee.h> 31#include <kabc/addressee.h>
32#include <kdialogbase.h> 32#include <kdialogbase.h>
33#include <kjanuswidget.h> 33#include <kjanuswidget.h>
34 34
35#include "extensionwidget.h" 35#include "extensionwidget.h"
36 36
37class AddresseeConfig; 37class AddresseeConfig;
38class QCheckBox; 38class QCheckBox;
39class QSpinBox; 39class QSpinBox;
40class QTabWidget; 40class QTabWidget;
41 41
42#ifndef KAB_EMBEDDED 42#ifndef KAB_EMBEDDED
43class QTextEdit; 43class Q3TextEdit;
44#else //KAB_EMBEDDED 44#else //KAB_EMBEDDED
45class QMultiLineEdit; 45class Q3MultiLineEdit;
46#endif //KAB_EMBEDDED 46#endif //KAB_EMBEDDED
47 47
48class KComboBox; 48class KComboBox;
49class KDateEdit; 49class KDateEdit;
50class KLineEdit; 50class KLineEdit;
51class KSqueezedTextLabel; 51class KSqueezedTextLabel;
52 52
53class AddressEditWidget; 53class AddressEditWidget;
54class EmailEditWidget; 54class EmailEditWidget;
55class GeoWidget; 55class GeoWidget;
56class ImageWidget; 56class ImageWidget;
57class KABCore; 57class KABCore;
@@ -146,44 +146,44 @@ class AddresseeEditorWidget : public ExtensionWidget
146 // Tab1 and Tab1_1 146 // Tab1 and Tab1_1
147 KLineEdit *mNameEdit; 147 KLineEdit *mNameEdit;
148 KLineEdit *mRoleEdit; 148 KLineEdit *mRoleEdit;
149 KLineEdit *mOrgEdit; 149 KLineEdit *mOrgEdit;
150 150
151 KSqueezedTextLabel *mFormattedNameLabel; 151 KSqueezedTextLabel *mFormattedNameLabel;
152 AddressEditWidget *mAddressEditWidget; 152 AddressEditWidget *mAddressEditWidget;
153 EmailEditWidget *mEmailWidget; 153 EmailEditWidget *mEmailWidget;
154 PhoneEditWidget *mPhoneEditWidget; 154 PhoneEditWidget *mPhoneEditWidget;
155 KLineEdit *mURLEdit; 155 KLineEdit *mURLEdit;
156 KLineEdit *mIMAddressEdit; 156 KLineEdit *mIMAddressEdit;
157 QPushButton *mCategoryEdit; 157 QPushButton *mCategoryEdit;
158 QPopupMenu *mCatPopup; 158 Q3PopupMenu *mCatPopup;
159 SecrecyWidget *mSecrecyWidget; 159 SecrecyWidget *mSecrecyWidget;
160 KSqueezedTextLabel *mNameLabel; 160 KSqueezedTextLabel *mNameLabel;
161 161
162 // Tab2 and Tab2_2 162 // Tab2 and Tab2_2
163 KLineEdit *mDepartmentEdit; 163 KLineEdit *mDepartmentEdit;
164 KLineEdit *mOfficeEdit; 164 KLineEdit *mOfficeEdit;
165 KLineEdit *mProfessionEdit; 165 KLineEdit *mProfessionEdit;
166 KLineEdit *mManagerEdit; 166 KLineEdit *mManagerEdit;
167 KLineEdit *mAssistantEdit; 167 KLineEdit *mAssistantEdit;
168 KLineEdit *mNicknameEdit; 168 KLineEdit *mNicknameEdit;
169 KLineEdit *mSpouseEdit; 169 KLineEdit *mSpouseEdit;
170 KLineEdit *mChildEdit; 170 KLineEdit *mChildEdit;
171 QComboBox *mGenderBox; 171 QComboBox *mGenderBox;
172 KDateEdit *mBirthdayPicker; 172 KDateEdit *mBirthdayPicker;
173 KDateEdit *mAnniversaryPicker; 173 KDateEdit *mAnniversaryPicker;
174#ifndef KAB_EMBEDDED 174#ifndef KAB_EMBEDDED
175 QTextEdit *mNoteEdit; 175 Q3TextEdit *mNoteEdit;
176#else //KAB_EMBEDDED 176#else //KAB_EMBEDDED
177 QMultiLineEdit *mNoteEdit; 177 Q3MultiLineEdit *mNoteEdit;
178#endif //KAB_EMBEDDED 178#endif //KAB_EMBEDDED
179 179
180 QSpinBox *mTimeZoneSpin; 180 QSpinBox *mTimeZoneSpin;
181 QSpinBox *mGeoLat; 181 QSpinBox *mGeoLat;
182 QSpinBox *mGeoLon; 182 QSpinBox *mGeoLon;
183 183
184 // Tab3 184 // Tab3
185 GeoWidget *mGeoWidget; 185 GeoWidget *mGeoWidget;
186 ImageWidget *mImageWidget; 186 ImageWidget *mImageWidget;
187#ifndef KAB_EMBEDDED 187#ifndef KAB_EMBEDDED
188 SoundWidget *mSoundWidget; 188 SoundWidget *mSoundWidget;
189#endif //KAB_EMBEDDED 189#endif //KAB_EMBEDDED
diff --git a/kaddressbook/addresseeutil.cpp b/kaddressbook/addresseeutil.cpp
index 366384a..a860f6d 100644
--- a/kaddressbook/addresseeutil.cpp
+++ b/kaddressbook/addresseeutil.cpp
@@ -37,25 +37,25 @@ QString AddresseeUtil::addresseesToClipboard( const KABC::Addressee::List &list
37 KABC::Addressee::List::ConstIterator it; 37 KABC::Addressee::List::ConstIterator it;
38 for ( it = list.begin(); it != list.end(); ++it ) { 38 for ( it = list.begin(); it != list.end(); ++it ) {
39 QString tmp; 39 QString tmp;
40 if ( converter.addresseeToVCard( *it, tmp ) ) 40 if ( converter.addresseeToVCard( *it, tmp ) )
41 vcard += tmp + "\r\n"; 41 vcard += tmp + "\r\n";
42 } 42 }
43 43
44 return vcard; 44 return vcard;
45} 45}
46 46
47KABC::Addressee::List AddresseeUtil::clipboardToAddressees( const QString &data ) 47KABC::Addressee::List AddresseeUtil::clipboardToAddressees( const QString &data )
48{ 48{
49 uint numVCards = data.contains( "BEGIN:VCARD", false ); 49 uint numVCards = data.count( "BEGIN:VCARD", Qt::CaseInsensitive );
50 QStringList dataList = QStringList::split( "\r\n\r\n", data ); 50 QStringList dataList = QStringList::split( "\r\n\r\n", data );
51 51
52 KABC::Addressee::List addrList; 52 KABC::Addressee::List addrList;
53 for ( uint i = 0; i < numVCards && i < dataList.count(); ++i ) { 53 for ( uint i = 0; i < numVCards && i < dataList.count(); ++i ) {
54 KABC::VCardConverter converter; 54 KABC::VCardConverter converter;
55 KABC::Addressee addr; 55 KABC::Addressee addr;
56 56
57 if ( !converter.vCardToAddressee( dataList[ i ].stripWhiteSpace(), addr ) ) { 57 if ( !converter.vCardToAddressee( dataList[ i ].stripWhiteSpace(), addr ) ) {
58 KMessageBox::error( 0, i18n( "Invalid vCard format in clipboard" ) ); 58 KMessageBox::error( 0, i18n( "Invalid vCard format in clipboard" ) );
59 continue; 59 continue;
60 } 60 }
61 61
diff --git a/kaddressbook/addviewdialog.cpp b/kaddressbook/addviewdialog.cpp
index 6def26b..b52a83c 100644
--- a/kaddressbook/addviewdialog.cpp
+++ b/kaddressbook/addviewdialog.cpp
@@ -16,66 +16,68 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KAB_EMBEDDED 24#ifndef KAB_EMBEDDED
25#endif //KAB_EMBEDDED 25#endif //KAB_EMBEDDED
26 26
27#include <qradiobutton.h> 27#include <qradiobutton.h>
28#include <qbuttongroup.h> 28#include <q3buttongroup.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qlineedit.h> 30#include <qlineedit.h>
31#include <qlayout.h> 31#include <qlayout.h>
32//Added by qt3to4:
33#include <Q3GridLayout>
32 34
33#include <klocale.h> 35#include <klocale.h>
34#include <kglobal.h> 36#include <kglobal.h>
35#include "kaddressbookview.h" 37#include "kaddressbookview.h"
36#include "addviewdialog.h" 38#include "addviewdialog.h"
37 39
38AddViewDialog::AddViewDialog( QDict<ViewFactory> *viewFactoryDict, 40AddViewDialog::AddViewDialog( Q3Dict<ViewFactory> *viewFactoryDict,
39 QWidget *parent, const char *name ) 41 QWidget *parent, const char *name )
40 : KDialogBase( KDialogBase::Plain, i18n( "Add View" ), 42 : KDialogBase( KDialogBase::Plain, i18n( "Add View" ),
41 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, 43 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok,
42 parent, name ), 44 parent, name ),
43 mViewFactoryDict( viewFactoryDict ) 45 mViewFactoryDict( viewFactoryDict )
44{ 46{
45//US setMinimumSize( KMIN(KGlobal::getDesktopWidth(), 300), KMIN(KGlobal::getDesktopHeight(), 300)); 47//US setMinimumSize( KMIN(KGlobal::getDesktopWidth(), 300), KMIN(KGlobal::getDesktopHeight(), 300));
46 48
47 mTypeId = 0; 49 mTypeId = 0;
48 50
49 QWidget *page = plainPage(); 51 QWidget *page = plainPage();
50 52
51 QGridLayout *layout = new QGridLayout( page, 2, 2 ); 53 Q3GridLayout *layout = new Q3GridLayout( page, 2, 2 );
52 layout->setSpacing( spacingHint() ); 54 layout->setSpacing( spacingHint() );
53 layout->setRowStretch( 1, 1 ); 55 layout->setRowStretch( 1, 1 );
54 layout->setColStretch( 1, 1 ); 56 layout->setColStretch( 1, 1 );
55 57
56 QLabel *label = new QLabel( i18n( "View name:" ), page ); 58 QLabel *label = new QLabel( i18n( "View name:" ), page );
57 layout->addWidget( label, 0, 0 ); 59 layout->addWidget( label, 0, 0 );
58 60
59 mViewNameEdit = new QLineEdit( page ); 61 mViewNameEdit = new QLineEdit( page );
60 connect( mViewNameEdit, SIGNAL( textChanged( const QString& ) ), 62 connect( mViewNameEdit, SIGNAL( textChanged( const QString& ) ),
61 SLOT( textChanged( const QString& ) ) ); 63 SLOT( textChanged( const QString& ) ) );
62 layout->addWidget( mViewNameEdit, 0, 1 ); 64 layout->addWidget( mViewNameEdit, 0, 1 );
63 65
64 mTypeGroup = new QButtonGroup( 2, Qt::Horizontal, i18n( "View Type" ), page ); 66 mTypeGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "View Type" ), page );
65 connect( mTypeGroup, SIGNAL( clicked( int ) ), this, SLOT( clicked( int ) ) ); 67 connect( mTypeGroup, SIGNAL( clicked( int ) ), this, SLOT( clicked( int ) ) );
66 layout->addMultiCellWidget( mTypeGroup, 1, 1, 0, 1 ); 68 layout->addMultiCellWidget( mTypeGroup, 1, 1, 0, 1 );
67 69
68 // Now create the radio buttons. This needs some layout work. 70 // Now create the radio buttons. This needs some layout work.
69 QDictIterator<ViewFactory> iter( *mViewFactoryDict ); 71 Q3DictIterator<ViewFactory> iter( *mViewFactoryDict );
70 for ( iter.toFirst(); iter.current(); ++iter ) { 72 for ( iter.toFirst(); iter.current(); ++iter ) {
71//US i am not quit sure, why I can nopt use (*iter)-> here 73//US i am not quit sure, why I can nopt use (*iter)-> here
72//US new QRadioButton( (*iter)->type(), mTypeGroup ); 74//US new QRadioButton( (*iter)->type(), mTypeGroup );
73//US label = new QLabel( (*iter)->description(), mTypeGroup ); 75//US label = new QLabel( (*iter)->description(), mTypeGroup );
74#ifdef DESKTOP_VERSION 76#ifdef DESKTOP_VERSION
75 new QRadioButton( (*iter)->type(), mTypeGroup ); 77 new QRadioButton( (*iter)->type(), mTypeGroup );
76 label = new QLabel( (*iter)->description(), mTypeGroup ); 78 label = new QLabel( (*iter)->description(), mTypeGroup );
77#else 79#else
78 new QRadioButton( (*iter).type(), mTypeGroup ); 80 new QRadioButton( (*iter).type(), mTypeGroup );
79 label = new QLabel( (*iter).description(), mTypeGroup ); 81 label = new QLabel( (*iter).description(), mTypeGroup );
80 82
81#endif 83#endif
@@ -104,15 +106,15 @@ QString AddViewDialog::viewType()const
104} 106}
105 107
106void AddViewDialog::clicked( int id ) 108void AddViewDialog::clicked( int id )
107{ 109{
108 mTypeId = id; 110 mTypeId = id;
109} 111}
110 112
111void AddViewDialog::textChanged( const QString &text ) 113void AddViewDialog::textChanged( const QString &text )
112{ 114{
113 enableButton( KDialogBase::Ok, !text.isEmpty() ); 115 enableButton( KDialogBase::Ok, !text.isEmpty() );
114} 116}
115 117
116#ifndef KAB_EMBEDDED 118#ifndef KAB_EMBEDDED_
117#include "addviewdialog.moc" 119#include "moc_addviewdialog.cpp"
118#endif //KAB_EMBEDDED 120#endif //KAB_EMBEDDED
diff --git a/kaddressbook/addviewdialog.h b/kaddressbook/addviewdialog.h
index 8cc12f5..c3e8efd 100644
--- a/kaddressbook/addviewdialog.h
+++ b/kaddressbook/addviewdialog.h
@@ -16,58 +16,58 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef ADDVIEWDIALOG_H 24#ifndef ADDVIEWDIALOG_H
25#define ADDVIEWDIALOG_H 25#define ADDVIEWDIALOG_H
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28#include <qdict.h> 28#include <q3dict.h>
29#include <qstring.h> 29#include <qstring.h>
30 30
31class ViewFactory; 31class ViewFactory;
32class QButtonGroup; 32class Q3ButtonGroup;
33class QLineEdit; 33class QLineEdit;
34 34
35 35
36/** 36/**
37 Modal dialog used for adding a new view. The dialog asks for the name of 37 Modal dialog used for adding a new view. The dialog asks for the name of
38 the view as well as the type. Someday it would be nice for this to be a 38 the view as well as the type. Someday it would be nice for this to be a
39 wizard. 39 wizard.
40 */ 40 */
41class AddViewDialog : public KDialogBase 41class AddViewDialog : public KDialogBase
42{ 42{
43 Q_OBJECT 43 Q_OBJECT
44 44
45 public: 45 public:
46 AddViewDialog( QDict<ViewFactory> *viewFactoryDict, QWidget *parent, 46 AddViewDialog( Q3Dict<ViewFactory> *viewFactoryDict, QWidget *parent,
47 const char *name = 0 ); 47 const char *name = 0 );
48 ~AddViewDialog(); 48 ~AddViewDialog();
49 49
50 QString viewName()const; 50 QString viewName()const;
51 51
52 QString viewType()const ; 52 QString viewType()const ;
53 53
54 protected slots: 54 protected slots:
55 /** 55 /**
56 Called when the user selects a type radio button. 56 Called when the user selects a type radio button.
57 */ 57 */
58 void clicked( int id ); 58 void clicked( int id );
59 59
60 /** 60 /**
61 Called when the user changes the text in the name of the view. 61 Called when the user changes the text in the name of the view.
62 */ 62 */
63 void textChanged( const QString &text ); 63 void textChanged( const QString &text );
64 64
65 private: 65 private:
66 QDict<ViewFactory> *mViewFactoryDict; 66 Q3Dict<ViewFactory> *mViewFactoryDict;
67 QLineEdit *mViewNameEdit; 67 QLineEdit *mViewNameEdit;
68 QButtonGroup *mTypeGroup; 68 Q3ButtonGroup *mTypeGroup;
69 69
70 int mTypeId; 70 int mTypeId;
71}; 71};
72 72
73#endif 73#endif
diff --git a/kaddressbook/details/detailsviewcontainer.cpp b/kaddressbook/details/detailsviewcontainer.cpp
index cee5886..4a86aca 100644
--- a/kaddressbook/details/detailsviewcontainer.cpp
+++ b/kaddressbook/details/detailsviewcontainer.cpp
@@ -13,67 +13,70 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcombobox.h> 24#include <qcombobox.h>
25#include <qframe.h> 25#include <q3frame.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qwidgetstack.h> 28#include <q3widgetstack.h>
29//Added by qt3to4:
30#include <Q3HBoxLayout>
31#include <Q3VBoxLayout>
29 32
30#include <kapplication.h> 33#include <kapplication.h>
31#include <kdebug.h> 34#include <kdebug.h>
32#include <kdialog.h> 35#include <kdialog.h>
33 36
34#include "look_basic.h" 37#include "look_basic.h"
35//#include "look_details.h" 38//#include "look_details.h"
36#include "look_html.h" 39#include "look_html.h"
37 40
38#ifdef KAB_EMBEDDED 41#ifdef KAB_EMBEDDED
39#include "kabprefs.h" 42#include "kabprefs.h"
40#endif //KAB_EMBEDDED 43#endif //KAB_EMBEDDED
41 44
42 45
43#include "detailsviewcontainer.h" 46#include "detailsviewcontainer.h"
44 47
45ViewContainer::ViewContainer( QWidget *parent, const char* name ) 48ViewContainer::ViewContainer( QWidget *parent, const char* name )
46 : QWidget( parent, name ), mCurrentLook( 0 ) 49 : QWidget( parent, name ), mCurrentLook( 0 )
47{ 50{
48 QBoxLayout *topLayout = new QVBoxLayout( this ); 51 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
49 //topLayout->setMargin( KDialog::marginHint() ); 52 //topLayout->setMargin( KDialog::marginHint() );
50 //topLayout->setSpacing( KDialog::spacingHint() ); 53 //topLayout->setSpacing( KDialog::spacingHint() );
51 topLayout->setMargin( 0 ); 54 topLayout->setMargin( 0 );
52 topLayout->setSpacing( 0 ); 55 topLayout->setSpacing( 0 );
53 56
54 QBoxLayout *styleLayout = new QHBoxLayout( topLayout ); 57 Q3BoxLayout *styleLayout = new Q3HBoxLayout( topLayout );
55 58
56 QLabel *label = new QLabel( i18n("Style:"), this ); 59 QLabel *label = new QLabel( i18n("Style:"), this );
57 styleLayout->addWidget( label ); 60 styleLayout->addWidget( label );
58 61
59 mStyleCombo = new QComboBox( this ); 62 mStyleCombo = new QComboBox( this );
60 styleLayout->addWidget( mStyleCombo ); 63 styleLayout->addWidget( mStyleCombo );
61 64
62 QFrame *frameRuler = new QFrame( this ); 65 Q3Frame *frameRuler = new Q3Frame( this );
63//US frameRuler->setFrameShape( QFrame::HLine ); 66//US frameRuler->setFrameShape( QFrame::HLine );
64//US frameRuler->setFrameShadow( QFrame::Sunken ); 67//US frameRuler->setFrameShadow( QFrame::Sunken );
65//US topLayout->addWidget( frameRuler ); 68//US topLayout->addWidget( frameRuler );
66 69
67 mDetailsStack = new QWidgetStack( this ); 70 mDetailsStack = new Q3WidgetStack( this );
68 topLayout->addWidget( mDetailsStack, 1 ); 71 topLayout->addWidget( mDetailsStack, 1 );
69 72
70 registerLooks(); 73 registerLooks();
71 74
72#if 1 75#if 1
73 // Hide detailed view selection combo box, because we currently have 76 // Hide detailed view selection combo box, because we currently have
74 // only one. Reenable it when there are more detailed views. 77 // only one. Reenable it when there are more detailed views.
75 label->hide(); 78 label->hide();
76 mStyleCombo->hide(); 79 mStyleCombo->hide();
77 frameRuler->hide(); 80 frameRuler->hide();
78#endif 81#endif
79} 82}
@@ -150,15 +153,15 @@ KABC::Addressee ViewContainer::addressee()
150 if ( !mCurrentLook ) 153 if ( !mCurrentLook )
151 return empty; 154 return empty;
152 else 155 else
153 return mCurrentLook->addressee(); 156 return mCurrentLook->addressee();
154} 157}
155 158
156void ViewContainer::setReadOnly( bool state ) 159void ViewContainer::setReadOnly( bool state )
157{ 160{
158 if ( mCurrentLook ) 161 if ( mCurrentLook )
159 mCurrentLook->setReadOnly( state ); 162 mCurrentLook->setReadOnly( state );
160} 163}
161 164
162#ifndef KAB_EMBEDDED 165#ifndef KAB_EMBEDDED_
163#include "detailsviewcontainer.moc" 166#include "moc_detailsviewcontainer.cpp"
164#endif //KAB_EMBEDDED 167#endif //KAB_EMBEDDED
diff --git a/kaddressbook/details/detailsviewcontainer.h b/kaddressbook/details/detailsviewcontainer.h
index 9684736..f310a30 100644
--- a/kaddressbook/details/detailsviewcontainer.h
+++ b/kaddressbook/details/detailsviewcontainer.h
@@ -15,30 +15,30 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef DETAILSVIEWCONTAINER_H 24#ifndef DETAILSVIEWCONTAINER_H
25#define DETAILSVIEWCONTAINER_H 25#define DETAILSVIEWCONTAINER_H
26 26
27#include <qptrlist.h> 27#include <q3ptrlist.h>
28 28
29#include "look_basic.h" 29#include "look_basic.h"
30 30
31class QComboBox; 31class QComboBox;
32class QWidgetStack; 32class Q3WidgetStack;
33 33
34class ViewContainer : public QWidget 34class ViewContainer : public QWidget
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37 37
38 public: 38 public:
39 ViewContainer( QWidget *parent = 0, const char* name = 0 ); 39 ViewContainer( QWidget *parent = 0, const char* name = 0 );
40 40
41 /** 41 /**
42 Return the look currently selected. If there is none, it 42 Return the look currently selected. If there is none, it
43 returns zero. Do not use this pointer to store a reference 43 returns zero. Do not use this pointer to store a reference
44 to a look, the user might select another one (e.g., create 44 to a look, the user might select another one (e.g., create
@@ -85,19 +85,19 @@ class ViewContainer : public QWidget
85 A style has been selected. Overloaded from base class. 85 A style has been selected. Overloaded from base class.
86 */ 86 */
87 void slotStyleSelected( int ); 87 void slotStyleSelected( int );
88 88
89 /** 89 /**
90 Register the available looks. 90 Register the available looks.
91 */ 91 */
92 void registerLooks(); 92 void registerLooks();
93 93
94 private: 94 private:
95 KABC::Addressee mCurrentAddressee; 95 KABC::Addressee mCurrentAddressee;
96 KABBasicLook *mCurrentLook; 96 KABBasicLook *mCurrentLook;
97 QPtrList<KABLookFactory> mLookFactories; 97 Q3PtrList<KABLookFactory> mLookFactories;
98 98
99 QComboBox *mStyleCombo; 99 QComboBox *mStyleCombo;
100 QWidgetStack *mDetailsStack; 100 Q3WidgetStack *mDetailsStack;
101}; 101};
102 102
103#endif 103#endif
diff --git a/kaddressbook/details/look_basic.cpp b/kaddressbook/details/look_basic.cpp
index 0245686..48cc42a 100644
--- a/kaddressbook/details/look_basic.cpp
+++ b/kaddressbook/details/look_basic.cpp
@@ -17,25 +17,25 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <kdebug.h> 24#include <kdebug.h>
25 25
26#include "look_basic.h" 26#include "look_basic.h"
27 27
28KABBasicLook::KABBasicLook( QWidget *parent, const char *name ) 28KABBasicLook::KABBasicLook( QWidget *parent, const char *name )
29 : QVBox( parent, name ), mReadOnly( false ) 29 : Q3VBox( parent, name ), mReadOnly( false )
30{ 30{
31} 31}
32 32
33void KABBasicLook::setReadOnly( bool state ) 33void KABBasicLook::setReadOnly( bool state )
34{ 34{
35 mReadOnly = state; 35 mReadOnly = state;
36} 36}
37 37
38bool KABBasicLook::isReadOnly() const 38bool KABBasicLook::isReadOnly() const
39{ 39{
40 return mReadOnly; 40 return mReadOnly;
41} 41}
@@ -61,15 +61,15 @@ void KABBasicLook::restoreSettings( KConfig* )
61void KABBasicLook::saveSettings( KConfig* ) 61void KABBasicLook::saveSettings( KConfig* )
62{ 62{
63} 63}
64 64
65KABLookFactory::KABLookFactory( QWidget *parent, const char *name ) 65KABLookFactory::KABLookFactory( QWidget *parent, const char *name )
66 : mParent( parent ), mName( name ) 66 : mParent( parent ), mName( name )
67{ 67{
68} 68}
69 69
70KABLookFactory::~KABLookFactory() 70KABLookFactory::~KABLookFactory()
71{ 71{
72} 72}
73#ifndef KAB_EMBEDDED 73#ifndef KAB_EMBEDDED_
74#include "look_basic.moc" 74#include "moc_look_basic.cpp"
75#endif //KAB_EMBEDDED 75#endif //KAB_EMBEDDED
diff --git a/kaddressbook/details/look_basic.h b/kaddressbook/details/look_basic.h
index a65c99c..a70e7f7 100644
--- a/kaddressbook/details/look_basic.h
+++ b/kaddressbook/details/look_basic.h
@@ -16,41 +16,41 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef LOOK_KABBASIC_H 24#ifndef LOOK_KABBASIC_H
25#define LOOK_KABBASIC_H 25#define LOOK_KABBASIC_H
26 26
27#include <kabc/addressbook.h> 27#include <kabc/addressbook.h>
28#include <qvbox.h> 28#include <q3vbox.h>
29 29
30class KConfig; 30class KConfig;
31 31
32/** 32/**
33 This is a pure virtual base class that defines the 33 This is a pure virtual base class that defines the
34 interface for how to display and change entries of 34 interface for how to display and change entries of
35 the KDE addressbook. 35 the KDE addressbook.
36 36
37 This basic widget does not show anything in its client space. 37 This basic widget does not show anything in its client space.
38 Derive it and implement its look and how the user may edit the 38 Derive it and implement its look and how the user may edit the
39 entry. 39 entry.
40 40
41 The paintEvent() has to paint the whole widget, since repaint() 41 The paintEvent() has to paint the whole widget, since repaint()
42 calls will not delete the widgets background. 42 calls will not delete the widgets background.
43 */ 43 */
44class KABBasicLook : public QVBox 44class KABBasicLook : public Q3VBox
45{ 45{
46 Q_OBJECT 46 Q_OBJECT
47 47
48 public: 48 public:
49 /** 49 /**
50 The constructor. 50 The constructor.
51 */ 51 */
52 KABBasicLook( QWidget *parent = 0, const char *name = 0 ); 52 KABBasicLook( QWidget *parent = 0, const char *name = 0 );
53 53
54 /** 54 /**
55 Set the entry. It will be displayed automatically. 55 Set the entry. It will be displayed automatically.
56 */ 56 */
diff --git a/kaddressbook/details/look_details.cpp b/kaddressbook/details/look_details.cpp
index 11d06e9..2c3a79d 100644
--- a/kaddressbook/details/look_details.cpp
+++ b/kaddressbook/details/look_details.cpp
@@ -180,28 +180,28 @@ void KABDetailedView::mouseMoveEvent( QMouseEvent *e )
180 hit = true; 180 hit = true;
181 181
182 if ( hit ) { 182 if ( hit ) {
183 if ( cursor().shape() != PointingHandCursor ) 183 if ( cursor().shape() != PointingHandCursor )
184 setCursor( PointingHandCursor ); 184 setCursor( PointingHandCursor );
185 else if( cursor().shape() != ArrowCursor ) 185 else if( cursor().shape() != ArrowCursor )
186 setCursor(ArrowCursor); 186 setCursor(ArrowCursor);
187 } 187 }
188} 188}
189 189
190void KABDetailedView::mousePressEvent( QMouseEvent *e ) 190void KABDetailedView::mousePressEvent( QMouseEvent *e )
191{ 191{
192 QPopupMenu menu( this ); 192 Q3PopupMenu menu( this );
193 QPopupMenu *menuBG = new QPopupMenu( &menu ); 193 Q3PopupMenu *menuBG = new Q3PopupMenu( &menu );
194 mMenuBorderedBG = new QPopupMenu( &menu ); 194 mMenuBorderedBG = new Q3PopupMenu( &menu );
195 mMenuTiledBG = new QPopupMenu( &menu ); 195 mMenuTiledBG = new Q3PopupMenu( &menu );
196 196
197 menu.insertItem( i18n( "Select Background" ), menuBG ); 197 menu.insertItem( i18n( "Select Background" ), menuBG );
198 menuBG->insertItem( i18n( "Bordered Backgrounds" ), mMenuBorderedBG ); 198 menuBG->insertItem( i18n( "Bordered Backgrounds" ), mMenuBorderedBG );
199 menuBG->insertItem( i18n( "Tiled Backgrounds" ), mMenuTiledBG ); 199 menuBG->insertItem( i18n( "Tiled Backgrounds" ), mMenuTiledBG );
200 menu.insertSeparator(); 200 menu.insertSeparator();
201 201
202 QPoint point = e->pos() - QPoint( mGrid, mGrid ); 202 QPoint point = e->pos() - QPoint( mGrid, mGrid );
203 int rc; 203 int rc;
204 QStringList dirsBorderedBG, dirsTiledBG; 204 QStringList dirsBorderedBG, dirsTiledBG;
205 QDir dir; 205 QDir dir;
206 206
207 switch( e->button() ) { 207 switch( e->button() ) {
@@ -405,15 +405,15 @@ void KABDetailedView::restoreSettings( KConfig *config )
405 mPainter->setForegroundColor( black ); 405 mPainter->setForegroundColor( black );
406 mPainter->setHeaderColor( mHeadLineTextColor ); 406 mPainter->setHeaderColor( mHeadLineTextColor );
407 mPainter->setUseHeaderColor( mUseHeadLineBGColor ); 407 mPainter->setUseHeaderColor( mUseHeadLineBGColor );
408 mPainter->setBackgroundColor( mHeadLineBGColor ); 408 mPainter->setBackgroundColor( mHeadLineBGColor );
409 409
410 mPainter->setHeaderFont( QFont( gfont, gpointsize + 4, QFont::Bold, true ) ); 410 mPainter->setHeaderFont( QFont( gfont, gpointsize + 4, QFont::Bold, true ) );
411 mPainter->setHeadLineFont( QFont( gfont, gpointsize + 2, QFont::Bold, true ) ); 411 mPainter->setHeadLineFont( QFont( gfont, gpointsize + 2, QFont::Bold, true ) );
412 mPainter->setBodyFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); 412 mPainter->setBodyFont( QFont( gfont, gpointsize, QFont::Normal, false ) );
413 mPainter->setFixedFont( QFont( ffont, fpointsize, QFont::Normal, false ) ); 413 mPainter->setFixedFont( QFont( ffont, fpointsize, QFont::Normal, false ) );
414 mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); 414 mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) );
415} 415}
416 416
417#ifndef KAB_EMBEDDED 417#ifndef KAB_EMBEDDED_
418#include "look_details.moc" 418#include "moc_look_details.cpp"
419#endif //KAB_EMBEDDED 419#endif //KAB_EMBEDDED
diff --git a/kaddressbook/details/look_details.h b/kaddressbook/details/look_details.h
index e8d50a9..b59d3a7 100644
--- a/kaddressbook/details/look_details.h
+++ b/kaddressbook/details/look_details.h
@@ -121,26 +121,26 @@ class KABDetailedView : public KABBasicLook
121 121
122 QPixmap mDefaultBGImage; 122 QPixmap mDefaultBGImage;
123 123
124 KToggleAction *mActionShowAddresses; 124 KToggleAction *mActionShowAddresses;
125 KToggleAction *mActionShowEmails; 125 KToggleAction *mActionShowEmails;
126 KToggleAction *mActionShowPhones; 126 KToggleAction *mActionShowPhones;
127 KToggleAction *mActionShowURLs; 127 KToggleAction *mActionShowURLs;
128 128
129 const int mGrid; 129 const int mGrid;
130 QStringList mBorders; 130 QStringList mBorders;
131 QStringList mTiles; 131 QStringList mTiles;
132 132
133 QPopupMenu *mMenuBorderedBG; 133 Q3PopupMenu *mMenuBorderedBG;
134 QPopupMenu *mMenuTiledBG; 134 Q3PopupMenu *mMenuTiledBG;
135 135
136 static const QString mBorderedBGDir; 136 static const QString mBorderedBGDir;
137 static const QString mTiledBGDir; 137 static const QString mTiledBGDir;
138}; 138};
139 139
140class KABDetailedViewFactory : public KABLookFactory 140class KABDetailedViewFactory : public KABLookFactory
141{ 141{
142 public: 142 public:
143 KABDetailedViewFactory( QWidget *parent = 0, const char *name = 0 ) 143 KABDetailedViewFactory( QWidget *parent = 0, const char *name = 0 )
144 : KABLookFactory( parent, name ) {} 144 : KABLookFactory( parent, name ) {}
145 145
146 KABBasicLook *create() 146 KABBasicLook *create()
diff --git a/kaddressbook/details/look_html.cpp b/kaddressbook/details/look_html.cpp
index bb30650..4ec1c7d 100644
--- a/kaddressbook/details/look_html.cpp
+++ b/kaddressbook/details/look_html.cpp
@@ -15,25 +15,25 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <addresseeview.h> 24#include <addresseeview.h>
25 25
26#include "look_html.h" 26#include "look_html.h"
27#include <qscrollview.h> 27#include <q3scrollview.h>
28#include "kabprefs.h" 28#include "kabprefs.h"
29#include <kabc/addresseeview.h> 29#include <kabc/addresseeview.h>
30KABHtmlView::KABHtmlView( QWidget *parent, const char *name ) 30KABHtmlView::KABHtmlView( QWidget *parent, const char *name )
31 : KABBasicLook( parent, name ) 31 : KABBasicLook( parent, name )
32{ 32{
33 mView = new KABC::AddresseeView( this ); 33 mView = new KABC::AddresseeView( this );
34 mView->setFont( KABPrefs::instance()->mDetailsFont ); 34 mView->setFont( KABPrefs::instance()->mDetailsFont );
35 connect(this, SIGNAL(printMyView()), 35 connect(this, SIGNAL(printMyView()),
36 this , SLOT(printMe())); 36 this , SLOT(printMe()));
37} 37}
38 38
39KABHtmlView::~KABHtmlView() 39KABHtmlView::~KABHtmlView()
@@ -42,15 +42,15 @@ KABHtmlView::~KABHtmlView()
42void KABHtmlView::printMe() 42void KABHtmlView::printMe()
43{ 43{
44 mView->printMe(); 44 mView->printMe();
45 45
46} 46}
47 47
48void KABHtmlView::setAddressee( const KABC::Addressee &addr ) 48void KABHtmlView::setAddressee( const KABC::Addressee &addr )
49{ 49{
50 mView->setFont( KABPrefs::instance()->mDetailsFont ); 50 mView->setFont( KABPrefs::instance()->mDetailsFont );
51 mView->setAddressee( addr ); 51 mView->setAddressee( addr );
52} 52}
53 53
54#ifndef KAB_EMBEDDED 54#ifndef KAB_EMBEDDED_
55#include "look_html.moc" 55#include "moc_look_html.cpp"
56#endif //KAB_EMBEDDED 56#endif //KAB_EMBEDDED
diff --git a/kaddressbook/emaileditwidget.cpp b/kaddressbook/emaileditwidget.cpp
index e72face..09df47f 100644
--- a/kaddressbook/emaileditwidget.cpp
+++ b/kaddressbook/emaileditwidget.cpp
@@ -19,52 +19,54 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qstring.h> 28#include <qstring.h>
29#include <qtoolbutton.h> 29#include <qtoolbutton.h>
30#include <qtooltip.h> 30#include <qtooltip.h>
31#include <qlistbox.h> 31#include <q3listbox.h>
32//Added by qt3to4:
33#include <Q3GridLayout>
32 34
33#ifndef KAB_EMBEDDED 35#ifndef KAB_EMBEDDED
34#include <kaccelmanager.h> 36#include <kaccelmanager.h>
35#endif //KAB_EMBEDDED 37#endif //KAB_EMBEDDED
36#include <kconfig.h> 38#include <kconfig.h>
37#include <kcombobox.h> 39#include <kcombobox.h>
38#include <kdebug.h> 40#include <kdebug.h>
39#include <kglobal.h> 41#include <kglobal.h>
40#include <kdialog.h> 42#include <kdialog.h>
41#include <kiconloader.h> 43#include <kiconloader.h>
42#include <klineedit.h> 44#include <klineedit.h>
43#include <klocale.h> 45#include <klocale.h>
44#include <kmessagebox.h> 46#include <kmessagebox.h>
45 47
46#include "emaileditwidget.h" 48#include "emaileditwidget.h"
47 49
48EmailEditWidget::EmailEditWidget( QWidget *parent, const char *name ) 50EmailEditWidget::EmailEditWidget( QWidget *parent, const char *name )
49 : QWidget( parent, name ) 51 : QWidget( parent, name )
50{ 52{
51 QGridLayout *topLayout = new QGridLayout( this, 2, 2 ); 53 Q3GridLayout *topLayout = new Q3GridLayout( this, 2, 2 );
52 topLayout->setSpacing( KDialog::spacingHint() ); 54 topLayout->setSpacing( KDialog::spacingHint() );
53 QLabel* label = new QLabel( this ); 55 QLabel* label = new QLabel( this );
54 56
55 label->setPixmap( KGlobal::iconLoader()->loadIcon( "mail_send", KIcon::Desktop, 0) ); 57 label->setPixmap( KGlobal::iconLoader()->loadIcon( "mail_send", KIcon::Desktop, 0) );
56 58
57 topLayout->addWidget( label, 0, 0 ); 59 topLayout->addWidget( label, 0, 0 );
58 label->setAlignment( AlignCenter ); 60 label->setAlignment( Qt::AlignCenter );
59 QPushButton *editButton = new QPushButton( i18n( "Edit Email Addresses..." ), this); 61 QPushButton *editButton = new QPushButton( i18n( "Edit Email Addresses..." ), this);
60 topLayout->addWidget( editButton, 0, 1 ); 62 topLayout->addWidget( editButton, 0, 1 );
61 label = new QLabel( i18n( "Email:" ), this ); 63 label = new QLabel( i18n( "Email:" ), this );
62 topLayout->addWidget( label, 1, 0 ); 64 topLayout->addWidget( label, 1, 0 );
63 65
64 mEmailEdit = new KLineEdit( this ); 66 mEmailEdit = new KLineEdit( this );
65 connect( mEmailEdit, SIGNAL( textChanged( const QString& ) ), 67 connect( mEmailEdit, SIGNAL( textChanged( const QString& ) ),
66 SLOT( textChanged( const QString& ) ) ); 68 SLOT( textChanged( const QString& ) ) );
67 connect( mEmailEdit, SIGNAL( textChanged( const QString& ) ), 69 connect( mEmailEdit, SIGNAL( textChanged( const QString& ) ),
68 SIGNAL( modified() ) ); 70 SIGNAL( modified() ) );
69 label->setBuddy( mEmailEdit ); 71 label->setBuddy( mEmailEdit );
70 topLayout->addWidget( mEmailEdit, 1, 1 ); 72 topLayout->addWidget( mEmailEdit, 1, 1 );
@@ -128,42 +130,42 @@ void EmailEditWidget::textChanged( const QString &text )
128 mEmailList.prepend( text ); 130 mEmailList.prepend( text );
129} 131}
130 132
131 133
132EmailEditDialog::EmailEditDialog( const QStringList &list, QWidget *parent, 134EmailEditDialog::EmailEditDialog( const QStringList &list, QWidget *parent,
133 const char *name ) 135 const char *name )
134 : KDialogBase( KDialogBase::Plain, i18n( "Edit Email Addresses" ), 136 : KDialogBase( KDialogBase::Plain, i18n( "Edit Email Addresses" ),
135 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, 137 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok,
136 parent, name, true ) 138 parent, name, true )
137{ 139{
138 QWidget *page = plainPage(); 140 QWidget *page = plainPage();
139 141
140 QGridLayout *topLayout = new QGridLayout( page, 4, 3 ); 142 Q3GridLayout *topLayout = new Q3GridLayout( page, 4, 3 );
141 143
142 QLabel *label = new QLabel( i18n( "Email address:" ), page ); 144 QLabel *label = new QLabel( i18n( "Email address:" ), page );
143 topLayout->addWidget( label, 0, 0 ); 145 topLayout->addWidget( label, 0, 0 );
144 146
145 mEmailEdit = new KLineEdit( page ); 147 mEmailEdit = new KLineEdit( page );
146 label->setBuddy( mEmailEdit ); 148 label->setBuddy( mEmailEdit );
147 topLayout->addWidget( mEmailEdit, 0, 1 ); 149 topLayout->addWidget( mEmailEdit, 0, 1 );
148 connect( mEmailEdit, SIGNAL( returnPressed() ), SLOT( add() ) ); 150 connect( mEmailEdit, SIGNAL( returnPressed() ), SLOT( add() ) );
149 connect( mEmailEdit, SIGNAL( textChanged( const QString& ) ), 151 connect( mEmailEdit, SIGNAL( textChanged( const QString& ) ),
150 SLOT( emailChanged() ) ); 152 SLOT( emailChanged() ) );
151 153
152 mAddButton = new QPushButton( i18n( "Add" ), page ); 154 mAddButton = new QPushButton( i18n( "Add" ), page );
153 mAddButton->setEnabled( false ); 155 mAddButton->setEnabled( false );
154 connect( mAddButton, SIGNAL( clicked() ), SLOT( add() ) ); 156 connect( mAddButton, SIGNAL( clicked() ), SLOT( add() ) );
155 topLayout->addWidget( mAddButton, 0, 2 ); 157 topLayout->addWidget( mAddButton, 0, 2 );
156 158
157 mEmailListBox = new QListBox( page ); 159 mEmailListBox = new Q3ListBox( page );
158 160
159 // Make sure there is room for the scrollbar 161 // Make sure there is room for the scrollbar
160 mEmailListBox->setMinimumHeight( mEmailListBox->sizeHint().height() + 30 ); 162 mEmailListBox->setMinimumHeight( mEmailListBox->sizeHint().height() + 30 );
161 connect( mEmailListBox, SIGNAL( highlighted( int ) ), 163 connect( mEmailListBox, SIGNAL( highlighted( int ) ),
162 SLOT( selectionChanged( int ) ) ); 164 SLOT( selectionChanged( int ) ) );
163 topLayout->addMultiCellWidget( mEmailListBox, 1, 3, 0, 1 ); 165 topLayout->addMultiCellWidget( mEmailListBox, 1, 3, 0, 1 );
164 166
165 mEditButton = new QPushButton( i18n( "Change" ), page ); 167 mEditButton = new QPushButton( i18n( "Change" ), page );
166 connect( mEditButton, SIGNAL( clicked() ), SLOT( edit() ) ); 168 connect( mEditButton, SIGNAL( clicked() ), SLOT( edit() ) );
167 topLayout->addWidget( mEditButton, 1, 2 ); 169 topLayout->addWidget( mEditButton, 1, 2 );
168 170
169 mRemoveButton = new QPushButton( i18n( "Remove" ), page ); 171 mRemoveButton = new QPushButton( i18n( "Remove" ), page );
@@ -263,15 +265,15 @@ void EmailEditDialog::selectionChanged( int index )
263 bool value = ( index >= 0 ); // An item is selected 265 bool value = ( index >= 0 ); // An item is selected
264 266
265 mRemoveButton->setEnabled( value ); 267 mRemoveButton->setEnabled( value );
266 mEditButton->setEnabled( value ); 268 mEditButton->setEnabled( value );
267 mStandardButton->setEnabled( value ); 269 mStandardButton->setEnabled( value );
268} 270}
269 271
270void EmailEditDialog::emailChanged() 272void EmailEditDialog::emailChanged()
271{ 273{
272 mAddButton->setEnabled( !mEmailEdit->text().isEmpty() ); 274 mAddButton->setEnabled( !mEmailEdit->text().isEmpty() );
273} 275}
274 276
275#ifndef KAB_EMBEDDED 277#ifndef KAB_EMBEDDED_
276#include "emaileditwidget.moc" 278#include "moc_emaileditwidget.cpp"
277#endif //KAB_EMBEDDED 279#endif //KAB_EMBEDDED
diff --git a/kaddressbook/emaileditwidget.h b/kaddressbook/emaileditwidget.h
index acdecaf..618acee 100644
--- a/kaddressbook/emaileditwidget.h
+++ b/kaddressbook/emaileditwidget.h
@@ -20,29 +20,29 @@
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef EMAILEDITWIDGET_H 24#ifndef EMAILEDITWIDGET_H
25#define EMAILEDITWIDGET_H 25#define EMAILEDITWIDGET_H
26 26
27#include <kabc/addressee.h> 27#include <kabc/addressee.h>
28#include <kdialogbase.h> 28#include <kdialogbase.h>
29 29
30#include "addresseeconfig.h" 30#include "addresseeconfig.h"
31 31
32class QButtonGroup; 32class Q3ButtonGroup;
33class QCheckBox; 33class QCheckBox;
34class QListView; 34class Q3ListView;
35class QListBox; 35class Q3ListBox;
36class QTextEdit; 36class Q3TextEdit;
37class QToolButton; 37class QToolButton;
38 38
39class KComboBox; 39class KComboBox;
40class KLineEdit; 40class KLineEdit;
41class KListView; 41class KListView;
42 42
43/** 43/**
44 This widget displays a list box of the email addresses as well as buttons 44 This widget displays a list box of the email addresses as well as buttons
45 to manipulate them (up, down, add, remove). 45 to manipulate them (up, down, add, remove).
46*/ 46*/
47class EmailEditWidget : public QWidget 47class EmailEditWidget : public QWidget
48{ 48{
@@ -80,22 +80,22 @@ class EmailEditDialog : public KDialogBase
80 bool changed() const; 80 bool changed() const;
81 81
82 protected slots: 82 protected slots:
83 void add(); 83 void add();
84 void remove(); 84 void remove();
85 void edit(); 85 void edit();
86 void standard(); 86 void standard();
87 void selectionChanged( int ); 87 void selectionChanged( int );
88 void emailChanged(); 88 void emailChanged();
89 89
90 private: 90 private:
91 KLineEdit *mEmailEdit; 91 KLineEdit *mEmailEdit;
92 QListBox *mEmailListBox; 92 Q3ListBox *mEmailListBox;
93 QPushButton *mAddButton; 93 QPushButton *mAddButton;
94 QPushButton *mRemoveButton; 94 QPushButton *mRemoveButton;
95 QPushButton *mEditButton; 95 QPushButton *mEditButton;
96 QPushButton *mStandardButton; 96 QPushButton *mStandardButton;
97 97
98 bool mChanged; 98 bool mChanged;
99}; 99};
100 100
101#endif 101#endif
diff --git a/kaddressbook/extensionmanager.cpp b/kaddressbook/extensionmanager.cpp
index 46defa1..5356224 100644
--- a/kaddressbook/extensionmanager.cpp
+++ b/kaddressbook/extensionmanager.cpp
@@ -13,61 +13,63 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#include <qlayout.h> 23#include <qlayout.h>
24#include <qapplication.h> 24#include <qapplication.h>
25//Added by qt3to4:
26#include <Q3HBoxLayout>
25#include <kactionclasses.h> 27#include <kactionclasses.h>
26#include <kconfig.h> 28#include <kconfig.h>
27#include <kdebug.h> 29#include <kdebug.h>
28#include <klocale.h> 30#include <klocale.h>
29 31
30#ifndef KAB_EMBEDDED 32#ifndef KAB_EMBEDDED
31#include <ktrader.h> 33#include <ktrader.h>
32#else //KAB_EMBEDDED 34#else //KAB_EMBEDDED
33#include <features/mergewidget.h> 35#include <features/mergewidget.h>
34#include <features/distributionlistwidget.h> 36#include <features/distributionlistwidget.h>
35#endif //KAB_EMBEDDED 37#endif //KAB_EMBEDDED
36 38
37#include "addresseeeditorwidget.h" 39#include "addresseeeditorwidget.h"
38#include "kabcore.h" 40#include "kabcore.h"
39#include "kabprefs.h" 41#include "kabprefs.h"
40 42
41#include "extensionmanager.h" 43#include "extensionmanager.h"
42 44
43ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent, 45ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent,
44 const char *name ) 46 const char *name )
45 : QScrollView( parent, name ), mCore( core ), mCurrentExtensionWidget( 0 ) 47 : Q3ScrollView( parent, name ), mCore( core ), mCurrentExtensionWidget( 0 )
46{ 48{
47#ifdef KAB_EMBEDDED 49#ifdef KAB_EMBEDDED
48//US QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); 50//US QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu();
49 QWidget *settingsmenu = (QWidget*)mCore->getViewMenu(); 51 QWidget *settingsmenu = (QWidget*)mCore->getViewMenu();
50#endif //KAB_EMBEDDED 52#endif //KAB_EMBEDDED
51 53
52 mActionExtensions = new KSelectAction( i18n( "Show Extension Bar" ), 0, 54 mActionExtensions = new KSelectAction( i18n( "Show Extension Bar" ), 0,
53 mCore->actionCollection(), 55 mCore->actionCollection(),
54 "options_show_extensions" ); 56 "options_show_extensions" );
55 57
56 mActionExtensions->plug( settingsmenu ,0); 58 mActionExtensions->plug( settingsmenu ,0);
57 59
58 connect( mActionExtensions, SIGNAL( activated( int ) ), 60 connect( mActionExtensions, SIGNAL( activated( int ) ),
59 SLOT( setActiveExtension( int ) ) ); 61 SLOT( setActiveExtension( int ) ) );
60 mWidgetBox = new QWidget( viewport() ); 62 mWidgetBox = new QWidget( viewport() );
61 new QHBoxLayout (mWidgetBox ); 63 new Q3HBoxLayout (mWidgetBox );
62 addChild( mWidgetBox ); 64 addChild( mWidgetBox );
63 setResizePolicy(AutoOneFit); 65 setResizePolicy(AutoOneFit);
64 createExtensionWidgets(); 66 createExtensionWidgets();
65 hide(); 67 hide();
66} 68}
67 69
68ExtensionManager::~ExtensionManager() 70ExtensionManager::~ExtensionManager()
69{ 71{
70} 72}
71 73
72void ExtensionManager::restoreSettings() 74void ExtensionManager::restoreSettings()
73{ 75{
@@ -139,36 +141,36 @@ void ExtensionManager::setActiveExtension( int id )
139//US mCore->setDetailsToState( ); 141//US mCore->setDetailsToState( );
140#endif //KAB_EMBEDDED 142#endif //KAB_EMBEDDED
141 } 143 }
142 } 144 }
143 145
144 emit changedActiveExtension( id ); 146 emit changedActiveExtension( id );
145} 147}
146 148
147void ExtensionManager::createExtensionWidgets() 149void ExtensionManager::createExtensionWidgets()
148{ 150{
149 // clear extension widget list 151 // clear extension widget list
150 mExtensionWidgetList.setAutoDelete( true ); 152 mExtensionWidgetList.setAutoDelete( true );
151 QPtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList ); 153 Q3PtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList );
152 ExtensionWidget *wdg = 0; 154 ExtensionWidget *wdg = 0;
153 while ( ( wdg = wdgIt.current() ) != 0 ) 155 while ( ( wdg = wdgIt.current() ) != 0 )
154 mExtensionWidgetList.remove( wdg ); 156 mExtensionWidgetList.remove( wdg );
155 157
156 mExtensionWidgetList.setAutoDelete( false ); 158 mExtensionWidgetList.setAutoDelete( false );
157 159
158 QStringList extensionNames( i18n( "None" ) ); 160 QStringList extensionNames( i18n( "None" ) );
159 161
160 // add addressee editor as default 162 // add addressee editor as default
161 163
162 QHBoxLayout *hbl = (QHBoxLayout *) mWidgetBox->layout();; 164 Q3HBoxLayout *hbl = (Q3HBoxLayout *) mWidgetBox->layout();;
163 165
164 wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox ); 166 wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox );
165 hbl->addWidget( wdg ); 167 hbl->addWidget( wdg );
166 //wdg->hide(); 168 //wdg->hide();
167 connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ), 169 connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ),
168 SIGNAL( modified( const KABC::Addressee::List& ) ) ); 170 SIGNAL( modified( const KABC::Addressee::List& ) ) );
169 mExtensionWidgetList.append( wdg ); 171 mExtensionWidgetList.append( wdg );
170 extensionNames.append( wdg->title() ); 172 extensionNames.append( wdg->title() );
171 173
172 // load the other extensions 174 // load the other extensions
173 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; 175 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions;
174 176
@@ -235,15 +237,15 @@ void ExtensionManager::createExtensionWidgets()
235 } 237 }
236 } 238 }
237 239
238 hbl->addStretch(); 240 hbl->addStretch();
239 241
240#endif //KAB_EMBEDDED 242#endif //KAB_EMBEDDED
241 243
242 244
243 mActionExtensions->setItems( extensionNames ); 245 mActionExtensions->setItems( extensionNames );
244 mCurrentExtensionWidget = 0; 246 mCurrentExtensionWidget = 0;
245} 247}
246 248
247#ifndef KAB_EMBEDDED 249#ifndef KAB_EMBEDDED_
248#include "extensionmanager.moc" 250#include "moc_extensionmanager.cpp"
249#endif //KAB_EMBEDDED 251#endif //KAB_EMBEDDED
diff --git a/kaddressbook/extensionmanager.h b/kaddressbook/extensionmanager.h
index 611a037..84c948b 100644
--- a/kaddressbook/extensionmanager.h
+++ b/kaddressbook/extensionmanager.h
@@ -15,35 +15,35 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef EXTENSIONMANAGER_H 24#ifndef EXTENSIONMANAGER_H
25#define EXTENSIONMANAGER_H 25#define EXTENSIONMANAGER_H
26 26
27#include <qhbox.h> 27#include <q3hbox.h>
28#include <qscrollview.h> 28#include <q3scrollview.h>
29#include <qptrlist.h> 29#include <q3ptrlist.h>
30 30
31#include <extensionwidget.h> 31#include <extensionwidget.h>
32 32
33class KABCore; 33class KABCore;
34class KSelectAction; 34class KSelectAction;
35 35
36 36
37class ExtensionManager : public QScrollView 37class ExtensionManager : public Q3ScrollView
38{ 38{
39 Q_OBJECT 39 Q_OBJECT
40 40
41 public: 41 public:
42 ExtensionManager( KABCore *core, QWidget *parent, const char *name = 0 ); 42 ExtensionManager( KABCore *core, QWidget *parent, const char *name = 0 );
43 ~ExtensionManager(); 43 ~ExtensionManager();
44 44
45 /** 45 /**
46 Restores the extension manager specific settings. 46 Restores the extension manager specific settings.
47 */ 47 */
48 void restoreSettings(); 48 void restoreSettings();
49 49
@@ -71,19 +71,19 @@ class ExtensionManager : public QScrollView
71 void changedActiveExtension( int id ); 71 void changedActiveExtension( int id );
72 72
73 private slots: 73 private slots:
74 void setActiveExtension( int id ); 74 void setActiveExtension( int id );
75 75
76 private: 76 private:
77 void createExtensionWidgets(); 77 void createExtensionWidgets();
78 78
79 KABCore *mCore; 79 KABCore *mCore;
80 QWidget *mWidgetBox; 80 QWidget *mWidgetBox;
81 81
82 ExtensionWidget *mCurrentExtensionWidget; 82 ExtensionWidget *mCurrentExtensionWidget;
83 QPtrList<ExtensionWidget> mExtensionWidgetList; 83 Q3PtrList<ExtensionWidget> mExtensionWidgetList;
84 84
85 KSelectAction *mActionExtensions; 85 KSelectAction *mActionExtensions;
86 86
87}; 87};
88 88
89#endif 89#endif
diff --git a/kaddressbook/extensionwidget.cpp b/kaddressbook/extensionwidget.cpp
index 69f4aa8..7c3b415 100644
--- a/kaddressbook/extensionwidget.cpp
+++ b/kaddressbook/extensionwidget.cpp
@@ -69,16 +69,15 @@ QString ExtensionWidget::title() const
69} 69}
70 70
71QString ExtensionWidget::identifier() const 71QString ExtensionWidget::identifier() const
72{ 72{
73 return "<bug!!!>"; 73 return "<bug!!!>";
74} 74}
75 75
76ConfigureWidget *ExtensionFactory::configureWidget( QWidget*, const char* ) 76ConfigureWidget *ExtensionFactory::configureWidget( QWidget*, const char* )
77{ 77{
78 return 0; 78 return 0;
79} 79}
80 80
81#ifndef KAB_EMBEDDED 81#ifndef KAB_EMBEDDED_
82#include "extensionwidget.moc" 82#include "moc_extensionwidget.cpp"
83#endif //KAB_EMBEDDED 83#endif //KAB_EMBEDDED
84
diff --git a/kaddressbook/extensionwidget.h b/kaddressbook/extensionwidget.h
index fc91f21..9fcfba9 100644
--- a/kaddressbook/extensionwidget.h
+++ b/kaddressbook/extensionwidget.h
@@ -77,27 +77,27 @@ class ExtensionWidget : public QWidget
77 77
78 signals: 78 signals:
79 void modified( const KABC::Addressee::List &list ); 79 void modified( const KABC::Addressee::List &list );
80 80
81 private: 81 private:
82 KABCore *mCore; 82 KABCore *mCore;
83 83
84 class ExtensionWidgetPrivate; 84 class ExtensionWidgetPrivate;
85 ExtensionWidgetPrivate *d; 85 ExtensionWidgetPrivate *d;
86}; 86};
87 87
88#ifndef KAB_EMBEDDED 88#ifndef KAB_EMBEDDED
89//MOC_SKIP_BEGIN 89#ifndef Q_MOC_RUN
90class ExtensionFactory : public KLibFactory 90class ExtensionFactory : public KLibFactory
91//MOC_SKIP_END 91#endif
92#else //KAB_EMBEDDED 92#else //KAB_EMBEDDED
93class ExtensionFactory 93class ExtensionFactory
94#endif //KAB_EMBEDDED 94#endif //KAB_EMBEDDED
95{ 95{
96 public: 96 public:
97 virtual ExtensionWidget *extension( KABCore *core, QWidget *parent, 97 virtual ExtensionWidget *extension( KABCore *core, QWidget *parent,
98 const char *name = 0 ) = 0; 98 const char *name = 0 ) = 0;
99 99
100 virtual ConfigureWidget *configureWidget( QWidget *parent, 100 virtual ConfigureWidget *configureWidget( QWidget *parent,
101 const char *name = 0 ); 101 const char *name = 0 );
102 102
103 virtual bool configureWidgetAvailable() { return false; } 103 virtual bool configureWidgetAvailable() { return false; }
diff --git a/kaddressbook/features/distributionlistwidget.cpp b/kaddressbook/features/distributionlistwidget.cpp
index bfcb121..996177b 100644
--- a/kaddressbook/features/distributionlistwidget.cpp
+++ b/kaddressbook/features/distributionlistwidget.cpp
@@ -12,31 +12,38 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qbuttongroup.h> 24#include <q3buttongroup.h>
25#include <qcombobox.h> 25#include <qcombobox.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qlistview.h> 28#include <q3listview.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qradiobutton.h> 30#include <qradiobutton.h>
31//Added by qt3to4:
32#include <QDragMoveEvent>
33#include <QDropEvent>
34#include <Q3GridLayout>
35#include <Q3Frame>
36#include <Q3VBoxLayout>
37#include <QDragEnterEvent>
31 38
32#ifndef KAB_EMBEDDED 39#ifndef KAB_EMBEDDED
33#include <kaccelmanager.h> 40#include <kaccelmanager.h>
34#endif //KAB_EMBEDDED 41#endif //KAB_EMBEDDED
35 42
36 43
37#include <kdebug.h> 44#include <kdebug.h>
38#include <klineeditdlg.h> 45#include <klineeditdlg.h>
39#include <klocale.h> 46#include <klocale.h>
40#include <kglobal.h> 47#include <kglobal.h>
41#include <kmessagebox.h> 48#include <kmessagebox.h>
42 49
@@ -68,30 +75,30 @@ class DistributionListFactory : public ExtensionFactory
68 return "distribution_list_editor"; 75 return "distribution_list_editor";
69 } 76 }
70}; 77};
71 78
72extern "C" { 79extern "C" {
73 void *init_libkaddrbk_distributionlist() 80 void *init_libkaddrbk_distributionlist()
74 { 81 {
75 return ( new DistributionListFactory ); 82 return ( new DistributionListFactory );
76 } 83 }
77} 84}
78#endif //KAB_EMBEDDED 85#endif //KAB_EMBEDDED
79 86
80class ContactItem : public QListViewItem 87class ContactItem : public Q3ListViewItem
81{ 88{
82 public: 89 public:
83 ContactItem( DistributionListView *parent, const KABC::Addressee &addressee, 90 ContactItem( DistributionListView *parent, const KABC::Addressee &addressee,
84 const QString &email = QString::null ) : 91 const QString &email = QString::null ) :
85 QListViewItem( parent ), 92 Q3ListViewItem( parent ),
86 mAddressee( addressee ), 93 mAddressee( addressee ),
87 mEmail( email ) 94 mEmail( email )
88 { 95 {
89 setText( 0, addressee.realName() ); 96 setText( 0, addressee.realName() );
90 if( email.isEmpty() ) { 97 if( email.isEmpty() ) {
91 setText( 1, addressee.preferredEmail() ); 98 setText( 1, addressee.preferredEmail() );
92 setText( 2, i18n( "Yes" ) ); 99 setText( 2, i18n( "Yes" ) );
93 } else { 100 } else {
94 setText( 1, email ); 101 setText( 1, email );
95 setText( 2, i18n( "No" ) ); 102 setText( 2, i18n( "No" ) );
96 } 103 }
97 } 104 }
@@ -112,25 +119,25 @@ class ContactItem : public QListViewItem
112 return true; 119 return true;
113 } 120 }
114 121
115 private: 122 private:
116 KABC::Addressee mAddressee; 123 KABC::Addressee mAddressee;
117 QString mEmail; 124 QString mEmail;
118}; 125};
119 126
120DistributionListWidget::DistributionListWidget( KABCore *core, QWidget *parent, 127DistributionListWidget::DistributionListWidget( KABCore *core, QWidget *parent,
121 const char *name ) 128 const char *name )
122 : ExtensionWidget( core, parent, name ), mManager( 0 ) 129 : ExtensionWidget( core, parent, name ), mManager( 0 )
123{ 130{
124 QGridLayout *topLayout = new QGridLayout( this, 3, 4, KDialog::marginHint(), 131 Q3GridLayout *topLayout = new Q3GridLayout( this, 3, 4, KDialog::marginHint(),
125 KDialog::spacingHint() ); 132 KDialog::spacingHint() );
126 133
127 if (KGlobal::getOrientation() == KGlobal::Portrait) 134 if (KGlobal::getOrientation() == KGlobal::Portrait)
128 { 135 {
129 mCreateListButton = new QPushButton( i18n( "New List" ), this ); 136 mCreateListButton = new QPushButton( i18n( "New List" ), this );
130 mEditListButton = new QPushButton( i18n( "Ren List" ), this ); 137 mEditListButton = new QPushButton( i18n( "Ren List" ), this );
131 mRemoveListButton = new QPushButton( i18n( "Del List" ), this ); 138 mRemoveListButton = new QPushButton( i18n( "Del List" ), this );
132 mAddContactButton = new QPushButton( i18n( "Add Cont." ), this ); 139 mAddContactButton = new QPushButton( i18n( "Add Cont." ), this );
133 mChangeEmailButton = new QPushButton( i18n( "Chge Email" ), this ); 140 mChangeEmailButton = new QPushButton( i18n( "Chge Email" ), this );
134 mRemoveContactButton = new QPushButton( i18n( "Del Cont." ), this ); 141 mRemoveContactButton = new QPushButton( i18n( "Del Cont." ), this );
135 } 142 }
136 else 143 else
@@ -157,26 +164,26 @@ DistributionListWidget::DistributionListWidget( KABCore *core, QWidget *parent,
157 164
158 mContactView = new DistributionListView( this ); 165 mContactView = new DistributionListView( this );
159 mContactView->addColumn( i18n( "Name" ) ); 166 mContactView->addColumn( i18n( "Name" ) );
160 mContactView->addColumn( i18n( "Email" ) ); 167 mContactView->addColumn( i18n( "Email" ) );
161 mContactView->addColumn( i18n( "Use Preferred" ) ); 168 mContactView->addColumn( i18n( "Use Preferred" ) );
162 mContactView->setEnabled( false ); 169 mContactView->setEnabled( false );
163 mContactView->setAllColumnsShowFocus( true ); 170 mContactView->setAllColumnsShowFocus( true );
164 mContactView->setMinimumHeight( 30 ); 171 mContactView->setMinimumHeight( 30 );
165 172
166 topLayout->addMultiCellWidget( mContactView, 1, 1, 0, 3 ); 173 topLayout->addMultiCellWidget( mContactView, 1, 1, 0, 3 );
167 connect( mContactView, SIGNAL( selectionChanged() ), 174 connect( mContactView, SIGNAL( selectionChanged() ),
168 SLOT( selectionContactViewChanged() ) ); 175 SLOT( selectionContactViewChanged() ) );
169 connect( mContactView, SIGNAL( dropped( QDropEvent*, QListViewItem* ) ), 176 connect( mContactView, SIGNAL( dropped( QDropEvent*, Q3ListViewItem* ) ),
170 SLOT( dropped( QDropEvent*, QListViewItem* ) ) ); 177 SLOT( dropped( QDropEvent*, Q3ListViewItem* ) ) );
171 178
172 mAddContactButton->setEnabled( false ); 179 mAddContactButton->setEnabled( false );
173 topLayout->addWidget( mAddContactButton, 2, 0 ); 180 topLayout->addWidget( mAddContactButton, 2, 0 );
174 connect( mAddContactButton, SIGNAL( clicked() ), SLOT( addContact() ) ); 181 connect( mAddContactButton, SIGNAL( clicked() ), SLOT( addContact() ) );
175 182
176 topLayout->addWidget( mChangeEmailButton, 2, 2 ); 183 topLayout->addWidget( mChangeEmailButton, 2, 2 );
177 connect( mChangeEmailButton, SIGNAL( clicked() ), SLOT( changeEmail() ) ); 184 connect( mChangeEmailButton, SIGNAL( clicked() ), SLOT( changeEmail() ) );
178 185
179 topLayout->addWidget( mRemoveContactButton, 2, 3 ); 186 topLayout->addWidget( mRemoveContactButton, 2, 3 );
180 connect( mRemoveContactButton, SIGNAL( clicked() ), SLOT( removeContact() ) ); 187 connect( mRemoveContactButton, SIGNAL( clicked() ), SLOT( removeContact() ) );
181 188
182 mManager = new KABC::DistributionListManager( core->addressBook() ); 189 mManager = new KABC::DistributionListManager( core->addressBook() );
@@ -401,101 +408,101 @@ void DistributionListWidget::contactsSelectionChanged()
401} 408}
402 409
403QString DistributionListWidget::title() const 410QString DistributionListWidget::title() const
404{ 411{
405 return i18n( "Distribution List Editor" ); 412 return i18n( "Distribution List Editor" );
406} 413}
407 414
408QString DistributionListWidget::identifier() const 415QString DistributionListWidget::identifier() const
409{ 416{
410 return "distribution_list_editor"; 417 return "distribution_list_editor";
411} 418}
412 419
413void DistributionListWidget::dropped( QDropEvent *e, QListViewItem* ) 420void DistributionListWidget::dropped( QDropEvent *e, Q3ListViewItem* )
414{ 421{
415 dropEvent( e ); 422 dropEvent( e );
416} 423}
417 424
418void DistributionListWidget::changed() 425void DistributionListWidget::changed()
419{ 426{
420 save(); 427 save();
421} 428}
422 429
423 430
424DistributionListView::DistributionListView( QWidget *parent, const char* name ) 431DistributionListView::DistributionListView( QWidget *parent, const char* name )
425 : KListView( parent, name ) 432 : KListView( parent, name )
426{ 433{
427 setDragEnabled( true ); 434 setDragEnabled( true );
428 setAcceptDrops( true ); 435 setAcceptDrops( true );
429 setAllColumnsShowFocus( true ); 436 setAllColumnsShowFocus( true );
430} 437}
431 438
432void DistributionListView::dragEnterEvent( QDragEnterEvent* e ) 439void DistributionListView::dragEnterEvent( QDragEnterEvent* e )
433{ 440{
434#ifndef KAB_EMBEDDED 441#ifndef KAB_EMBEDDED
435 bool canDecode = QTextDrag::canDecode( e ); 442 bool canDecode = Q3TextDrag::canDecode( e );
436 e->accept( canDecode ); 443 e->accept( canDecode );
437#endif //KAB_EMBEDDED 444#endif //KAB_EMBEDDED
438} 445}
439 446
440void DistributionListView::viewportDragMoveEvent( QDragMoveEvent *e ) 447void DistributionListView::viewportDragMoveEvent( QDragMoveEvent *e )
441{ 448{
442#ifndef KAB_EMBEDDED 449#ifndef KAB_EMBEDDED
443 bool canDecode = QTextDrag::canDecode( e ); 450 bool canDecode = Q3TextDrag::canDecode( e );
444 e->accept( canDecode ); 451 e->accept( canDecode );
445#endif //KAB_EMBEDDED 452#endif //KAB_EMBEDDED
446} 453}
447 454
448void DistributionListView::viewportDropEvent( QDropEvent *e ) 455void DistributionListView::viewportDropEvent( QDropEvent *e )
449{ 456{
450 emit dropped( e, 0 ); 457 emit dropped( e, 0 );
451} 458}
452 459
453void DistributionListView::dropEvent( QDropEvent *e ) 460void DistributionListView::dropEvent( QDropEvent *e )
454{ 461{
455 emit dropped( e, 0 ); 462 emit dropped( e, 0 );
456} 463}
457 464
458 465
459EmailSelector::EmailSelector( const QStringList &emails, 466EmailSelector::EmailSelector( const QStringList &emails,
460 const QString &current, QWidget *parent ) 467 const QString &current, QWidget *parent )
461 : KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, 468 : KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok,
462 parent ) 469 parent )
463{ 470{
464 QFrame *topFrame = plainPage(); 471 Q3Frame *topFrame = plainPage();
465 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 472 Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame );
466 473
467 mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), 474 mButtonGroup = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"),
468 topFrame ); 475 topFrame );
469 topLayout->addWidget( mButtonGroup ); 476 topLayout->addWidget( mButtonGroup );
470 477
471 QStringList::ConstIterator it; 478 QStringList::ConstIterator it;
472 for( it = emails.begin(); it != emails.end(); ++it ) { 479 for( it = emails.begin(); it != emails.end(); ++it ) {
473 QRadioButton *button = new QRadioButton( *it, mButtonGroup ); 480 QRadioButton *button = new QRadioButton( *it, mButtonGroup );
474 if ( (*it) == current ) { 481 if ( (*it) == current ) {
475 button->setDown( true ); 482 button->setDown( true );
476 } 483 }
477 } 484 }
478} 485}
479 486
480QString EmailSelector::selected() 487QString EmailSelector::selected()
481{ 488{
482 QButton *button = mButtonGroup->selected(); 489 QAbstractButton *button = mButtonGroup->selected();
483 if ( button ) 490 if ( button )
484 return button->text(); 491 return button->text();
485 492
486 return QString::null; 493 return QString::null;
487} 494}
488 495
489QString EmailSelector::getEmail( const QStringList &emails, 496QString EmailSelector::getEmail( const QStringList &emails,
490 const QString &current, QWidget *parent ) 497 const QString &current, QWidget *parent )
491{ 498{
492 EmailSelector dlg( emails, current, parent ); 499 EmailSelector dlg( emails, current, parent );
493 dlg.exec(); 500 dlg.exec();
494 501
495 return dlg.selected(); 502 return dlg.selected();
496} 503}
497 504
498 505
499#ifndef KAB_EMBEDDED 506#ifndef KAB_EMBEDDED_
500#include "distributionlistwidget.moc" 507#include "moc_distributionlistwidget.cpp"
501#endif //KAB_EMBEDDED 508#endif //KAB_EMBEDDED
diff --git a/kaddressbook/features/distributionlistwidget.h b/kaddressbook/features/distributionlistwidget.h
index 82bac3d..f619389 100644
--- a/kaddressbook/features/distributionlistwidget.h
+++ b/kaddressbook/features/distributionlistwidget.h
@@ -19,54 +19,59 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef DISTRIBUTIONLISTWIDGET_H 24#ifndef DISTRIBUTIONLISTWIDGET_H
25#define DISTRIBUTIONLISTWIDGET_H 25#define DISTRIBUTIONLISTWIDGET_H
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28#include <klistview.h> 28#include <klistview.h>
29 29
30#include "extensionwidget.h" 30#include "extensionwidget.h"
31//Added by qt3to4:
32#include <QDragEnterEvent>
33#include <QDropEvent>
34#include <QLabel>
35#include <QDragMoveEvent>
31 36
32class QButtonGroup; 37class Q3ButtonGroup;
33class QComboBox; 38class QComboBox;
34class QLabel; 39class QLabel;
35class QListView; 40class Q3ListView;
36 41
37class DistributionListView; 42class DistributionListView;
38class KABCore; 43class KABCore;
39 44
40namespace KABC { 45namespace KABC {
41class AddressBook; 46class AddressBook;
42class DistributionListManager; 47class DistributionListManager;
43} 48}
44 49
45class DistributionListWidget : public ExtensionWidget 50class DistributionListWidget : public ExtensionWidget
46{ 51{
47 Q_OBJECT 52 Q_OBJECT
48 53
49 public: 54 public:
50 DistributionListWidget( KABCore*, QWidget *parent, const char *name = 0 ); 55 DistributionListWidget( KABCore*, QWidget *parent, const char *name = 0 );
51 virtual ~DistributionListWidget(); 56 virtual ~DistributionListWidget();
52 57
53 void contactsSelectionChanged(); 58 void contactsSelectionChanged();
54 59
55 QString title() const; 60 QString title() const;
56 QString identifier() const; 61 QString identifier() const;
57 62
58 public slots: 63 public slots:
59 void save(); 64 void save();
60 void dropped( QDropEvent*, QListViewItem* ); 65 void dropped( QDropEvent*, Q3ListViewItem* );
61 66
62 private slots: 67 private slots:
63 void createList(); 68 void createList();
64 void editList(); 69 void editList();
65 void removeList(); 70 void removeList();
66 void addContact(); 71 void addContact();
67 void removeContact(); 72 void removeContact();
68 void changeEmail(); 73 void changeEmail();
69 void updateNameCombo(); 74 void updateNameCombo();
70 void updateContactView(); 75 void updateContactView();
71 void selectionContactViewChanged(); 76 void selectionContactViewChanged();
72 void changed(); 77 void changed();
@@ -111,25 +116,25 @@ class DistributionListView : public KListView
111class EmailSelector : public KDialogBase 116class EmailSelector : public KDialogBase
112{ 117{
113 public: 118 public:
114 EmailSelector( const QStringList &emails, const QString &current, 119 EmailSelector( const QStringList &emails, const QString &current,
115 QWidget *parent ); 120 QWidget *parent );
116 121
117 QString selected(); 122 QString selected();
118 123
119 static QString getEmail( const QStringList &emails, const QString &current, 124 static QString getEmail( const QStringList &emails, const QString &current,
120 QWidget *parent ); 125 QWidget *parent );
121 126
122 private: 127 private:
123 QButtonGroup *mButtonGroup; 128 Q3ButtonGroup *mButtonGroup;
124}; 129};
125 130
126 131
127#ifdef KAB_EMBEDDED 132#ifdef KAB_EMBEDDED
128class DistributionListFactory : public ExtensionFactory 133class DistributionListFactory : public ExtensionFactory
129{ 134{
130 public: 135 public:
131 ExtensionWidget *extension( KABCore *core, QWidget *parent, const char *name ) 136 ExtensionWidget *extension( KABCore *core, QWidget *parent, const char *name )
132 { 137 {
133 return new DistributionListWidget( core, parent, name ); 138 return new DistributionListWidget( core, parent, name );
134 } 139 }
135 140
diff --git a/kaddressbook/features/mergewidget.cpp b/kaddressbook/features/mergewidget.cpp
index 2476e42..1becc2f 100644
--- a/kaddressbook/features/mergewidget.cpp
+++ b/kaddressbook/features/mergewidget.cpp
@@ -14,24 +14,26 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qpushbutton.h> 25#include <qpushbutton.h>
26//Added by qt3to4:
27#include <Q3GridLayout>
26 28
27#ifndef KAB_EMBEDDED 29#ifndef KAB_EMBEDDED
28#include <kaccelmanager.h> 30#include <kaccelmanager.h>
29#endif //KAB_EMBEDDED 31#endif //KAB_EMBEDDED
30 32
31#include <kdebug.h> 33#include <kdebug.h>
32#include <klistview.h> 34#include <klistview.h>
33#include <klocale.h> 35#include <klocale.h>
34#include <kglobal.h> 36#include <kglobal.h>
35#include <kmessagebox.h> 37#include <kmessagebox.h>
36 38
37#include <kabc/addressbook.h> 39#include <kabc/addressbook.h>
@@ -54,29 +56,29 @@ class MergeFactory : public ExtensionFactory
54 return "merge"; 56 return "merge";
55 } 57 }
56}; 58};
57 59
58extern "C" { 60extern "C" {
59 void *init_libkaddrbk_merge() 61 void *init_libkaddrbk_merge()
60 { 62 {
61 return ( new MergeFactory ); 63 return ( new MergeFactory );
62 } 64 }
63} 65}
64#endif //KAB_EMBEDDED 66#endif //KAB_EMBEDDED
65 67
66class ContactItem : public QListViewItem 68class ContactItem : public Q3ListViewItem
67{ 69{
68 public: 70 public:
69 ContactItem( KListView *parent, const KABC::Addressee &addressee ) 71 ContactItem( KListView *parent, const KABC::Addressee &addressee )
70 : QListViewItem( parent ), mAddressee( addressee ) 72 : Q3ListViewItem( parent ), mAddressee( addressee )
71 { 73 {
72 KABC::Field::List fieldList = KABC::Field::defaultFields(); 74 KABC::Field::List fieldList = KABC::Field::defaultFields();
73 KABC::Field::List::ConstIterator it; 75 KABC::Field::List::ConstIterator it;
74 76
75 int i = 0; 77 int i = 0;
76 for ( it = fieldList.begin(); it != fieldList.end(); ++it ) 78 for ( it = fieldList.begin(); it != fieldList.end(); ++it )
77 setText( i++, (*it)->value( mAddressee ) ); 79 setText( i++, (*it)->value( mAddressee ) );
78 } 80 }
79 81
80 KABC::Addressee addressee() const 82 KABC::Addressee addressee() const
81 { 83 {
82 return mAddressee; 84 return mAddressee;
@@ -85,25 +87,25 @@ class ContactItem : public QListViewItem
85 private: 87 private:
86 KABC::Addressee mAddressee; 88 KABC::Addressee mAddressee;
87}; 89};
88 90
89MergeWidget::MergeWidget( KABCore *core, QWidget *parent, const char *name ) 91MergeWidget::MergeWidget( KABCore *core, QWidget *parent, const char *name )
90 : ExtensionWidget( core, parent, name ), mBlockUpdate( false ) 92 : ExtensionWidget( core, parent, name ), mBlockUpdate( false )
91{ 93{
92#ifdef KAB_EMBEDDED 94#ifdef KAB_EMBEDDED
93 if (KGlobal::getOrientation() == KGlobal::Portrait) 95 if (KGlobal::getOrientation() == KGlobal::Portrait)
94 parent->setMaximumSize( KGlobal::getDesktopWidth() , 180); 96 parent->setMaximumSize( KGlobal::getDesktopWidth() , 180);
95#endif //KAB_EMBEDDED 97#endif //KAB_EMBEDDED
96 98
97 QGridLayout *topLayout = new QGridLayout( this, 3, 2, KDialog::marginHint(), 99 Q3GridLayout *topLayout = new Q3GridLayout( this, 3, 2, KDialog::marginHint(),
98 KDialog::spacingHint() ); 100 KDialog::spacingHint() );
99 101
100 mContactView = new KListView( this ); 102 mContactView = new KListView( this );
101 KABC::Field::List fieldList = KABC::Field::defaultFields(); 103 KABC::Field::List fieldList = KABC::Field::defaultFields();
102 KABC::Field::List::ConstIterator it; 104 KABC::Field::List::ConstIterator it;
103 105
104 for ( it = fieldList.begin(); it != fieldList.end(); ++it ) 106 for ( it = fieldList.begin(); it != fieldList.end(); ++it )
105 mContactView->addColumn( (*it)->label() ); 107 mContactView->addColumn( (*it)->label() );
106 108
107 mContactView->setEnabled( false ); 109 mContactView->setEnabled( false );
108 mContactView->setAllColumnsShowFocus( true ); 110 mContactView->setAllColumnsShowFocus( true );
109 topLayout->addMultiCellWidget( mContactView, 0, 2, 0, 0 ); 111 topLayout->addMultiCellWidget( mContactView, 0, 2, 0, 0 );
@@ -205,25 +207,25 @@ void MergeWidget::mergeAndRemove()
205 if ( !item ) 207 if ( !item )
206 return; 208 return;
207 209
208 QString oldUID = item->addressee().uid(); 210 QString oldUID = item->addressee().uid();
209 211
210 doMerge( item->addressee() ); 212 doMerge( item->addressee() );
211 213
212 KABC::Addressee::List retval; 214 KABC::Addressee::List retval;
213 retval << mMasterAddressee; 215 retval << mMasterAddressee;
214 emit modified( retval ); 216 emit modified( retval );
215 217
216 mBlockUpdate = true; 218 mBlockUpdate = true;
217 core()->deleteContacts( oldUID ); 219 core()->deleteContacts( QStringList(oldUID) );
218 core()->setContactSelected( mMasterAddressee.uid() ); 220 core()->setContactSelected( mMasterAddressee.uid() );
219 mBlockUpdate = false; 221 mBlockUpdate = false;
220 222
221 updateView(); 223 updateView();
222} 224}
223 225
224void MergeWidget::merge() 226void MergeWidget::merge()
225{ 227{
226#ifndef KAB_EMBEDDED 228#ifndef KAB_EMBEDDED
227 ContactItem *item = dynamic_cast<ContactItem*>( mContactView->currentItem() ); 229 ContactItem *item = dynamic_cast<ContactItem*>( mContactView->currentItem() );
228#else //KAB_EMBEDDED 230#else //KAB_EMBEDDED
229 ContactItem *item = (ContactItem*)( mContactView->currentItem() ); 231 ContactItem *item = (ContactItem*)( mContactView->currentItem() );
@@ -360,15 +362,15 @@ void MergeWidget::doMerge( const KABC::Addressee &addr )
360 mMasterAddressee.setUrl( addr.url() ); 362 mMasterAddressee.setUrl( addr.url() );
361 363
362 // X- 364 // X-
363 QStringList customs = addr.customs(); 365 QStringList customs = addr.customs();
364 QStringList masterCustoms = mMasterAddressee.customs(); 366 QStringList masterCustoms = mMasterAddressee.customs();
365 QStringList newCustoms( masterCustoms ); 367 QStringList newCustoms( masterCustoms );
366 for ( it = customs.begin(); it != customs.end(); ++it ) 368 for ( it = customs.begin(); it != customs.end(); ++it )
367 if ( !masterCustoms.contains( *it ) ) 369 if ( !masterCustoms.contains( *it ) )
368 newCustoms.append( *it ); 370 newCustoms.append( *it );
369 mMasterAddressee.setCustoms( newCustoms ); 371 mMasterAddressee.setCustoms( newCustoms );
370} 372}
371 373
372#ifndef KAB_EMBEDDED 374#ifndef KAB_EMBEDDED_
373#include "mergewidget.moc" 375#include "moc_mergewidget.cpp"
374#endif //KAB_EMBEDDED 376#endif //KAB_EMBEDDED
diff --git a/kaddressbook/features/mergewidget.h b/kaddressbook/features/mergewidget.h
index 1063c80..bb16282 100644
--- a/kaddressbook/features/mergewidget.h
+++ b/kaddressbook/features/mergewidget.h
@@ -20,25 +20,25 @@
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef MERGEWIDGET_H 24#ifndef MERGEWIDGET_H
25#define MERGEWIDGET_H 25#define MERGEWIDGET_H
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28#include <klistview.h> 28#include <klistview.h>
29 29
30#include "extensionwidget.h" 30#include "extensionwidget.h"
31 31
32class QListView; 32class Q3ListView;
33 33
34class KABCore; 34class KABCore;
35 35
36namespace KABC { 36namespace KABC {
37class AddressBook; 37class AddressBook;
38} 38}
39 39
40class MergeWidget : public ExtensionWidget 40class MergeWidget : public ExtensionWidget
41{ 41{
42 Q_OBJECT 42 Q_OBJECT
43 43
44 public: 44 public:
diff --git a/kaddressbook/filter.cpp b/kaddressbook/filter.cpp
index 12ab1e3..6462310 100644
--- a/kaddressbook/filter.cpp
+++ b/kaddressbook/filter.cpp
@@ -209,25 +209,25 @@ Filter::List Filter::restore( KConfig *config, QString baseGroup )
209 } 209 }
210 210
211 list.append( f ); 211 list.append( f );
212 } 212 }
213 213
214 if ( list.isEmpty()) { 214 if ( list.isEmpty()) {
215 QStringList cats = KABPrefs::instance()->mCustomCategories; 215 QStringList cats = KABPrefs::instance()->mCustomCategories;
216 for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) { 216 for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) {
217 Filter filter; 217 Filter filter;
218 filter.noName = false; 218 filter.noName = false;
219 filter.mName = *it; 219 filter.mName = *it;
220 filter.mEnabled = true; 220 filter.mEnabled = true;
221 filter.mCategoryList = *it; 221 filter.mCategoryList = QStringList(*it);
222 filter.mMatchRule = Matching; 222 filter.mMatchRule = Matching;
223 filter.mInternal = true; 223 filter.mInternal = true;
224 list.append( filter ); 224 list.append( filter );
225 } 225 }
226 } 226 }
227 return list; 227 return list;
228} 228}
229 229
230void Filter::setMatchRule( MatchRule rule ) 230void Filter::setMatchRule( MatchRule rule )
231{ 231{
232 mMatchRule = rule; 232 mMatchRule = rule;
233} 233}
diff --git a/kaddressbook/filter.h b/kaddressbook/filter.h
index f4ae123..508436d 100644
--- a/kaddressbook/filter.h
+++ b/kaddressbook/filter.h
@@ -17,41 +17,41 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef FILTER_H 24#ifndef FILTER_H
25#define FILTER_H 25#define FILTER_H
26 26
27#include <qstring.h> 27#include <qstring.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29#include <qvaluelist.h> 29#include <q3valuelist.h>
30 30
31#include <kabc/addressee.h> 31#include <kabc/addressee.h>
32#include <kconfig.h> 32#include <kconfig.h>
33 33
34/** 34/**
35 Filter for AddressBook related objects (Addressees) 35 Filter for AddressBook related objects (Addressees)
36 36
37 @todo This class should be switched to use shared data. 37 @todo This class should be switched to use shared data.
38 */ 38 */
39class Filter 39class Filter
40{ 40{
41 public: 41 public:
42 enum { ShowPublic = 1, ShowPrivate = 2, ShowConfidential = 4 }; 42 enum { ShowPublic = 1, ShowPrivate = 2, ShowConfidential = 4 };
43 void setCriteria(int c) { mCriteria = c ;} 43 void setCriteria(int c) { mCriteria = c ;}
44 int criteria() const { return mCriteria;} 44 int criteria() const { return mCriteria;}
45 typedef QValueList<Filter> List; 45 typedef Q3ValueList<Filter> List;
46 46
47 enum MatchRule { Matching = 0, NotMatching = 1 }; 47 enum MatchRule { Matching = 0, NotMatching = 1 };
48 48
49 Filter(); 49 Filter();
50 Filter( const QString& name ); 50 Filter( const QString& name );
51 ~Filter(); 51 ~Filter();
52 52
53 /** 53 /**
54 Set the name of the filter. 54 Set the name of the filter.
55 */ 55 */
56 void setName( const QString &name ); 56 void setName( const QString &name );
57 57
diff --git a/kaddressbook/filtereditdialog.cpp b/kaddressbook/filtereditdialog.cpp
index ef9b979..40698a7 100644
--- a/kaddressbook/filtereditdialog.cpp
+++ b/kaddressbook/filtereditdialog.cpp
@@ -19,104 +19,106 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qbuttongroup.h> 31#include <q3buttongroup.h>
32#include <qhbox.h> 32#include <q3hbox.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qlayout.h> 34#include <qlayout.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qradiobutton.h> 36#include <qradiobutton.h>
37#include <qcheckbox.h> 37#include <qcheckbox.h>
38#include <qregexp.h> 38#include <qregexp.h>
39#include <qstring.h> 39#include <qstring.h>
40#include <qtoolbutton.h> 40#include <qtoolbutton.h>
41#include <qtooltip.h> 41#include <qtooltip.h>
42#include <qwidget.h> 42#include <qwidget.h>
43//Added by qt3to4:
44#include <Q3GridLayout>
43 45
44#include <kapplication.h> 46#include <kapplication.h>
45#include <kbuttonbox.h> 47#include <kbuttonbox.h>
46#include <kdebug.h> 48#include <kdebug.h>
47#include <kiconloader.h> 49#include <kiconloader.h>
48#include <klineedit.h> 50#include <klineedit.h>
49#include <klistbox.h> 51#include <klistbox.h>
50#include <klistview.h> 52#include <klistview.h>
51#include <klocale.h> 53#include <klocale.h>
52#include <kglobal.h> 54#include <kglobal.h>
53 55
54#include "kabprefs.h" 56#include "kabprefs.h"
55#include "filtereditdialog.h" 57#include "filtereditdialog.h"
56 58
57FilterEditDialog::FilterEditDialog( QWidget *parent, const char *name ) 59FilterEditDialog::FilterEditDialog( QWidget *parent, const char *name )
58 : KDialogBase( Plain, i18n( "Edit Address Book Filter" ), 60 : KDialogBase( Plain, i18n( "Edit Address Book Filter" ),
59 Help | Ok | Cancel, Ok, parent, name, /*US false*/ true, true ) 61 Help | Ok | Cancel, Ok, parent, name, /*US false*/ true, true )
60{ 62{
61 initGUI(); 63 initGUI();
62 64
63 QStringList cats = KABPrefs::instance()->mCustomCategories; 65 QStringList cats = KABPrefs::instance()->mCustomCategories;
64 66
65 QStringList::Iterator iter; 67 QStringList::Iterator iter;
66 for ( iter = cats.begin(); iter != cats.end(); ++iter ) 68 for ( iter = cats.begin(); iter != cats.end(); ++iter )
67 mCategoriesView->insertItem( new QCheckListItem( mCategoriesView, (*iter), QCheckListItem::CheckBox ) ); 69 mCategoriesView->insertItem( new Q3CheckListItem( mCategoriesView, (*iter), Q3CheckListItem::CheckBox ) );
68 filterNameTextChanged( mNameEdit->text() ); 70 filterNameTextChanged( mNameEdit->text() );
69} 71}
70 72
71FilterEditDialog::~FilterEditDialog() 73FilterEditDialog::~FilterEditDialog()
72{ 74{
73} 75}
74 76
75void FilterEditDialog::setFilter( const Filter &filter ) 77void FilterEditDialog::setFilter( const Filter &filter )
76{ 78{
77 mNameEdit->setText( filter.name() ); 79 mNameEdit->setText( filter.name() );
78 80
79 QStringList categories = filter.categories(); 81 QStringList categories = filter.categories();
80 QListViewItem *item = mCategoriesView->firstChild(); 82 Q3ListViewItem *item = mCategoriesView->firstChild();
81 while ( item != 0 ) { 83 while ( item != 0 ) {
82 if ( categories.contains( item->text( 0 ) ) ) { 84 if ( categories.contains( item->text( 0 ) ) ) {
83 QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); 85 Q3CheckListItem *checkItem = static_cast<Q3CheckListItem*>( item );
84 checkItem->setOn( true ); 86 checkItem->setOn( true );
85 } 87 }
86 88
87 item = item->nextSibling(); 89 item = item->nextSibling();
88 } 90 }
89 91
90 if ( filter.matchRule() == Filter::Matching ) 92 if ( filter.matchRule() == Filter::Matching )
91 mMatchRuleGroup->setButton( 0 ); 93 mMatchRuleGroup->setButton( 0 );
92 else 94 else
93 mMatchRuleGroup->setButton( 1 ); 95 mMatchRuleGroup->setButton( 1 );
94 96
95 int c = filter.criteria() ; 97 int c = filter.criteria() ;
96 mPublic->setChecked(c &Filter::ShowPublic); 98 mPublic->setChecked(c &Filter::ShowPublic);
97 mPrivate->setChecked(c & Filter::ShowPrivate); 99 mPrivate->setChecked(c & Filter::ShowPrivate);
98 mConfidential->setChecked(c & Filter::ShowConfidential); 100 mConfidential->setChecked(c & Filter::ShowConfidential);
99} 101}
100 102
101Filter FilterEditDialog::filter() 103Filter FilterEditDialog::filter()
102{ 104{
103 Filter filter; 105 Filter filter;
104 106
105 filter.setName( mNameEdit->text() ); 107 filter.setName( mNameEdit->text() );
106 108
107 QStringList categories; 109 QStringList categories;
108 QListViewItem *item = mCategoriesView->firstChild(); 110 Q3ListViewItem *item = mCategoriesView->firstChild();
109 while ( item != 0 ) { 111 while ( item != 0 ) {
110 QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); 112 Q3CheckListItem *checkItem = static_cast<Q3CheckListItem*>( item );
111 if ( checkItem->isOn() ) 113 if ( checkItem->isOn() )
112 categories.append( item->text( 0 ) ); 114 categories.append( item->text( 0 ) );
113 115
114 item = item->nextSibling(); 116 item = item->nextSibling();
115 } 117 }
116 filter.setCategories( categories ); 118 filter.setCategories( categories );
117 119
118 if ( mMatchRuleGroup->find( 0 )->isOn() ) 120 if ( mMatchRuleGroup->find( 0 )->isOn() )
119 filter.setMatchRule( Filter::Matching ); 121 filter.setMatchRule( Filter::Matching );
120 else 122 else
121 filter.setMatchRule( Filter::NotMatching ); 123 filter.setMatchRule( Filter::NotMatching );
122 124
@@ -132,48 +134,48 @@ Filter FilterEditDialog::filter()
132void FilterEditDialog::initGUI() 134void FilterEditDialog::initGUI()
133{ 135{
134#ifndef KAB_EMBEDDED 136#ifndef KAB_EMBEDDED
135 resize( 490, 300 ); 137 resize( 490, 300 );
136#else //KAB_EMBEDDED 138#else //KAB_EMBEDDED
137 resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); 139 resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300));
138#endif //KAB_EMBEDDED 140#endif //KAB_EMBEDDED
139 141
140 142
141 QWidget *page = plainPage(); 143 QWidget *page = plainPage();
142 QLabel *label; 144 QLabel *label;
143 145
144 QGridLayout *topLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); 146 Q3GridLayout *topLayout = new Q3GridLayout( page, 3, 2, 0, spacingHint() );
145 147
146 label = new QLabel( i18n( "Name" ), page ); 148 label = new QLabel( i18n( "Name" ), page );
147 mNameEdit = new KLineEdit( page ); 149 mNameEdit = new KLineEdit( page );
148 mNameEdit->setFocus(); 150 mNameEdit->setFocus();
149 topLayout->addWidget( label, 0, 0 ); 151 topLayout->addWidget( label, 0, 0 );
150 topLayout->addWidget( mNameEdit, 0, 1 ); 152 topLayout->addWidget( mNameEdit, 0, 1 );
151 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), 153 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ),
152 SLOT( filterNameTextChanged( const QString&) ) ); 154 SLOT( filterNameTextChanged( const QString&) ) );
153 155
154 mCategoriesView = new KListView( page ); 156 mCategoriesView = new KListView( page );
155 mCategoriesView->addColumn( i18n( "Categories" ) ); 157 mCategoriesView->addColumn( i18n( "Categories" ) );
156 topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 ); 158 topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 );
157 159
158 mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page ); 160 mMatchRuleGroup = new Q3HButtonGroup( i18n( "Category rule" ), page );
159 mMatchRuleGroup->setExclusive( true ); 161 mMatchRuleGroup->setExclusive( true );
160 QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); 162 QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup );
161 //mMatchRuleGroup->insert( radio ); 163 //mMatchRuleGroup->insert( radio );
162 radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup ); 164 radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup );
163 radio->setChecked( true ); 165 radio->setChecked( true );
164 //mMatchRuleGroup->insert( radio ); 166 //mMatchRuleGroup->insert( radio );
165 topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); 167 topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 );
166 168
167 QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page ); 169 Q3HButtonGroup * mMatchPPCGroup = new Q3HButtonGroup(i18n( "Include contacts, that are:" ), page );
168 mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); 170 mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup );
169 mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); 171 mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup );
170 mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); 172 mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup );
171 mPublic->setChecked( true ); 173 mPublic->setChecked( true );
172 mPrivate->setChecked( true ); 174 mPrivate->setChecked( true );
173 mConfidential->setChecked( true ); 175 mConfidential->setChecked( true );
174 topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 ); 176 topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 );
175 177
176} 178}
177 179
178void FilterEditDialog::filterNameTextChanged( const QString &text ) 180void FilterEditDialog::filterNameTextChanged( const QString &text )
179{ 181{
@@ -263,53 +265,53 @@ void FilterDialog::remove()
263 refresh(); 265 refresh();
264} 266}
265 267
266void FilterDialog::refresh() 268void FilterDialog::refresh()
267{ 269{
268 mFilterListBox->clear(); 270 mFilterListBox->clear();
269 271
270 Filter::List::Iterator iter; 272 Filter::List::Iterator iter;
271 for ( iter = mFilterList.begin(); iter != mFilterList.end(); ++iter ) 273 for ( iter = mFilterList.begin(); iter != mFilterList.end(); ++iter )
272 mFilterListBox->insertItem( (*iter).name() ); 274 mFilterListBox->insertItem( (*iter).name() );
273} 275}
274 276
275void FilterDialog::selectionChanged( QListBoxItem *item ) 277void FilterDialog::selectionChanged( Q3ListBoxItem *item )
276{ 278{
277 bool state = ( item != 0 ); 279 bool state = ( item != 0 );
278 280
279 mEditButton->setEnabled( state ); 281 mEditButton->setEnabled( state );
280 mRemoveButton->setEnabled( state ); 282 mRemoveButton->setEnabled( state );
281} 283}
282 284
283void FilterDialog::initGUI() 285void FilterDialog::initGUI()
284{ 286{
285#ifndef KAB_EMBEDDED 287#ifndef KAB_EMBEDDED
286 resize( 330, 200 ); 288 resize( 330, 200 );
287#else //KAB_EMBEDDED 289#else //KAB_EMBEDDED
288 resize( KMIN(KGlobal::getDesktopWidth()-10, 330), KMIN(KGlobal::getDesktopHeight()-50, 200)); 290 resize( KMIN(KGlobal::getDesktopWidth()-10, 330), KMIN(KGlobal::getDesktopHeight()-50, 200));
289#endif //KAB_EMBEDDED 291#endif //KAB_EMBEDDED
290 292
291 QWidget *page = plainPage(); 293 QWidget *page = plainPage();
292 294
293 QGridLayout *topLayout = new QGridLayout( page, 1, 2, 0, spacingHint() ); 295 Q3GridLayout *topLayout = new Q3GridLayout( page, 1, 2, 0, spacingHint() );
294 296
295 mFilterListBox = new KListBox( page ); 297 mFilterListBox = new KListBox( page );
296 topLayout->addWidget( mFilterListBox, 0, 0 ); 298 topLayout->addWidget( mFilterListBox, 0, 0 );
297 connect( mFilterListBox, SIGNAL( selectionChanged( QListBoxItem * ) ), 299 connect( mFilterListBox, SIGNAL( selectionChanged( Q3ListBoxItem * ) ),
298 SLOT( selectionChanged( QListBoxItem * ) ) ); 300 SLOT( selectionChanged( Q3ListBoxItem * ) ) );
299 connect( mFilterListBox, SIGNAL( doubleClicked ( QListBoxItem * ) ), 301 connect( mFilterListBox, SIGNAL( doubleClicked ( Q3ListBoxItem * ) ),
300 SLOT( edit() ) ); 302 SLOT( edit() ) );
301 303
302 KButtonBox *buttonBox = new KButtonBox( page, Vertical ); 304 KButtonBox *buttonBox = new KButtonBox( page, Qt::Vertical );
303 buttonBox->addButton( i18n( "&Add..." ), this, SLOT( add() ) ); 305 buttonBox->addButton( i18n( "&Add..." ), this, SLOT( add() ) );
304 mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( edit() ) ); 306 mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( edit() ) );
305 mEditButton->setEnabled( false ); 307 mEditButton->setEnabled( false );
306 mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( remove() ) ); 308 mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( remove() ) );
307 mRemoveButton->setEnabled( false ); 309 mRemoveButton->setEnabled( false );
308 310
309 buttonBox->layout(); 311 buttonBox->layout();
310 topLayout->addWidget( buttonBox, 0, 1 ); 312 topLayout->addWidget( buttonBox, 0, 1 );
311} 313}
312 314
313#ifndef KAB_EMBEDDED 315#ifndef KAB_EMBEDDED_
314#include "filtereditdialog.moc" 316#include "moc_filtereditdialog.cpp"
315#endif //KAB_EMBEDDED 317#endif //KAB_EMBEDDED
diff --git a/kaddressbook/filtereditdialog.h b/kaddressbook/filtereditdialog.h
index 5a8bad1..64d2976 100644
--- a/kaddressbook/filtereditdialog.h
+++ b/kaddressbook/filtereditdialog.h
@@ -22,56 +22,55 @@
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#ifndef FILTEREDITDIALOG_H 31#ifndef FILTEREDITDIALOG_H
32#define FILTEREDITDIALOG_H 32#define FILTEREDITDIALOG_H
33 33
34class QButtonGroup; 34#include <Q3HButtonGroup>
35class QString; 35class QString;
36class QToolButton; 36class QToolButton;
37class QWidget; 37class QWidget;
38class QListBoxItem; 38class Q3ListBoxItem;
39class QCheckBox; 39class QCheckBox;
40 40
41class KLineEdit; 41class KLineEdit;
42class KListBox; 42class KListBox;
43class KListView; 43class KListView;
44 44
45#include <kdialogbase.h> 45#include <kdialogbase.h>
46#include <qhbuttongroup.h>
47 46
48#include "filter.h" 47#include "filter.h"
49 48
50class FilterDialog : public KDialogBase 49class FilterDialog : public KDialogBase
51{ 50{
52 Q_OBJECT 51 Q_OBJECT
53 52
54 public: 53 public:
55 FilterDialog( QWidget *parent, const char *name = 0 ); 54 FilterDialog( QWidget *parent, const char *name = 0 );
56 ~FilterDialog(); 55 ~FilterDialog();
57 56
58 void setFilters( const Filter::List &list ); 57 void setFilters( const Filter::List &list );
59 Filter::List filters() const; 58 Filter::List filters() const;
60 59
61 protected slots: 60 protected slots:
62 void add(); 61 void add();
63 void edit(); 62 void edit();
64 void remove(); 63 void remove();
65 void selectionChanged( QListBoxItem* ); 64 void selectionChanged( Q3ListBoxItem* );
66 65
67 private: 66 private:
68 void initGUI(); 67 void initGUI();
69 void refresh(); 68 void refresh();
70 69
71 Filter::List mFilterList; 70 Filter::List mFilterList;
72 Filter::List mInternalFilterList; 71 Filter::List mInternalFilterList;
73 72
74 KListBox *mFilterListBox; 73 KListBox *mFilterListBox;
75 QPushButton *mAddButton; 74 QPushButton *mAddButton;
76 QPushButton *mEditButton; 75 QPushButton *mEditButton;
77 QPushButton *mRemoveButton; 76 QPushButton *mRemoveButton;
@@ -89,21 +88,21 @@ class FilterEditDialog : public KDialogBase
89 88
90 protected slots: 89 protected slots:
91 void filterNameTextChanged( const QString& ); 90 void filterNameTextChanged( const QString& );
92 void slotHelp(); 91 void slotHelp();
93 92
94 private: 93 private:
95 void initGUI(); 94 void initGUI();
96 95
97 Filter mFilter; 96 Filter mFilter;
98 97
99 KLineEdit *mNameEdit; 98 KLineEdit *mNameEdit;
100 KListView *mCategoriesView; 99 KListView *mCategoriesView;
101 QHButtonGroup *mMatchRuleGroup; 100 Q3HButtonGroup *mMatchRuleGroup;
102 QCheckBox *mPrivate; 101 QCheckBox *mPrivate;
103 QCheckBox *mPublic; 102 QCheckBox *mPublic;
104 QCheckBox *mConfidential; 103 QCheckBox *mConfidential;
105 QPushButton *mEditButton; 104 QPushButton *mEditButton;
106 QPushButton *mRemoveButton; 105 QPushButton *mRemoveButton;
107}; 106};
108 107
109#endif 108#endif
diff --git a/kaddressbook/geowidget.cpp b/kaddressbook/geowidget.cpp
index 13cd084..caff3b2 100644
--- a/kaddressbook/geowidget.cpp
+++ b/kaddressbook/geowidget.cpp
@@ -18,67 +18,74 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <kabc/geo.h> 24#include <kabc/geo.h>
25 25
26#ifndef KAB_EMBEDDED 26#ifndef KAB_EMBEDDED
27#include <kaccelmanager.h> 27#include <kaccelmanager.h>
28#else //KAB_EMBEDDED 28#else //KAB_EMBEDDED
29 29
30#include <qtextstream.h> 30#include <q3textstream.h>
31//Added by qt3to4:
32#include <QPaintEvent>
33#include <Q3GridLayout>
34#include <Q3Frame>
35#include <QMouseEvent>
31#include <kglobal.h> 36#include <kglobal.h>
32#endif //KAB_EMBEDDED 37#endif //KAB_EMBEDDED
33 38
39#include <QDesktopWidget>
40
34#include <knuminput.h> 41#include <knuminput.h>
35#include <kcombobox.h> 42#include <kcombobox.h>
36#include <kdebug.h> 43#include <kdebug.h>
37#include <kiconloader.h> 44#include <kiconloader.h>
38#include <klocale.h> 45#include <klocale.h>
39#include <kstandarddirs.h> 46#include <kstandarddirs.h>
40 47
41#include <qcheckbox.h> 48#include <qcheckbox.h>
42#include <qfile.h> 49#include <qfile.h>
43#include <qapplication.h> 50#include <qapplication.h>
44#include <qgroupbox.h> 51#include <q3groupbox.h>
45#include <qlabel.h> 52#include <qlabel.h>
46#include <qlayout.h> 53#include <qlayout.h>
47#include <qlistbox.h> 54#include <q3listbox.h>
48#include <qpainter.h> 55#include <qpainter.h>
49#include <qpixmap.h> 56#include <qpixmap.h>
50#include <qpushbutton.h> 57#include <qpushbutton.h>
51#include <qregexp.h> 58#include <qregexp.h>
52#include <qstring.h> 59#include <qstring.h>
53#include <stdlib.h> 60#include <stdlib.h>
54 61
55#include "geowidget.h" 62#include "geowidget.h"
56 63
57GeoWidget::GeoWidget( QWidget *parent, const char *name ) 64GeoWidget::GeoWidget( QWidget *parent, const char *name )
58 : QWidget( parent, name ) 65 : QWidget( parent, name )
59{ 66{
60 QLabel *label = 0; 67 QLabel *label = 0;
61 68
62 QGridLayout *topLayout = new QGridLayout( this, 4, 3 ); 69 Q3GridLayout *topLayout = new Q3GridLayout( this, 4, 3 );
63 topLayout->setMargin( KDialog::marginHint() ); 70 topLayout->setMargin( KDialog::marginHint() );
64 topLayout->setSpacing( KDialog::spacingHint() ); 71 topLayout->setSpacing( KDialog::spacingHint() );
65 72
66 label = new QLabel( this ); 73 label = new QLabel( this );
67//US ambiguous call to loadIcon. Add an additional parameter 74//US ambiguous call to loadIcon. Add an additional parameter
68//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "package_network", KIcon::Desktop ) ); 75//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "package_network", KIcon::Desktop ) );
69 label->setPixmap( KGlobal::iconLoader()->loadIcon( "package_network", KIcon::Desktop, 0 ) ); 76 label->setPixmap( KGlobal::iconLoader()->loadIcon( "package_network", KIcon::Desktop, 0 ) );
70 label->setAlignment( Qt::AlignTop ); 77 label->setAlignment( Qt::AlignTop );
71 topLayout->addMultiCellWidget( label, 0, 3, 0, 0 ); 78 topLayout->addMultiCellWidget( label, 0, 3, 0, 0 );
72 label->setAlignment( AlignCenter ); 79 label->setAlignment( Qt::AlignCenter );
73 mGeoIsValid = new QCheckBox( i18n( "Use geo data" ), this ); 80 mGeoIsValid = new QCheckBox( i18n( "Use geo data" ), this );
74 topLayout->addMultiCellWidget( mGeoIsValid, 0, 0, 1, 2 ); 81 topLayout->addMultiCellWidget( mGeoIsValid, 0, 0, 1, 2 );
75 82
76 label = new QLabel( i18n( "Latitude:" ), this ); 83 label = new QLabel( i18n( "Latitude:" ), this );
77 topLayout->addWidget( label, 1, 1 ); 84 topLayout->addWidget( label, 1, 1 );
78 85
79 mLatitudeBox = new KDoubleSpinBox( -90, 90, 1, 0, 6, this ); 86 mLatitudeBox = new KDoubleSpinBox( -90, 90, 1, 0, 6, this );
80 mLatitudeBox->setEnabled( false ); 87 mLatitudeBox->setEnabled( false );
81 mLatitudeBox->setSuffix( "" ); 88 mLatitudeBox->setSuffix( "" );
82 topLayout->addWidget( mLatitudeBox, 1, 2 ); 89 topLayout->addWidget( mLatitudeBox, 1, 2 );
83 label->setBuddy( mLatitudeBox ); 90 label->setBuddy( mLatitudeBox );
84 91
@@ -158,34 +165,34 @@ void GeoWidget::editGeoData()
158 165
159 emit changed(); 166 emit changed();
160 } 167 }
161} 168}
162 169
163 170
164 171
165GeoDialog::GeoDialog( QWidget *parent, const char *name ) 172GeoDialog::GeoDialog( QWidget *parent, const char *name )
166 : KDialogBase( Plain, i18n( "Geo Data Input" ), Ok | Cancel, Ok, 173 : KDialogBase( Plain, i18n( "Geo Data Input" ), Ok | Cancel, Ok,
167 parent, name, true, true ), 174 parent, name, true, true ),
168 mUpdateSexagesimalInput( true ) 175 mUpdateSexagesimalInput( true )
169{ 176{
170 QFrame *page = plainPage(); 177 Q3Frame *page = plainPage();
171 178
172 QGridLayout *topLayout = new QGridLayout( page, 1, 1, marginHintSmall(), 179 Q3GridLayout *topLayout = new Q3GridLayout( page, 1, 1, marginHintSmall(),
173 spacingHint() ); 180 spacingHint() );
174 //topLayout->setRowStretch( 1, 1 ); 181 //topLayout->setRowStretch( 1, 1 );
175 182
176 mMapWidget = new GeoMapWidget( page ); 183 mMapWidget = new GeoMapWidget( page );
177 mCityCombo = new KComboBox( page ); 184 mCityCombo = new KComboBox( page );
178 QGroupBox *sexagesimalGroup = new QGroupBox( 0, Vertical, i18n( "Sexagesimal" ), page ); 185 Q3GroupBox *sexagesimalGroup = new Q3GroupBox( 0, Qt::Vertical, i18n( "Sexagesimal" ), page );
179 QGridLayout *sexagesimalLayout = new QGridLayout( sexagesimalGroup->layout(), 186 Q3GridLayout *sexagesimalLayout = new Q3GridLayout( sexagesimalGroup->layout(),
180 2, 5, spacingHint() ); 187 2, 5, spacingHint() );
181 QLabel *label; 188 QLabel *label;
182 if ( QApplication::desktop()->width() < 320 ) { 189 if ( QApplication::desktop()->width() < 320 ) {
183 label = new QLabel( i18n( "La." ), sexagesimalGroup ); 190 label = new QLabel( i18n( "La." ), sexagesimalGroup );
184 sexagesimalLayout->setSpacing ( spacingHintSmall() ); 191 sexagesimalLayout->setSpacing ( spacingHintSmall() );
185 sexagesimalLayout->setMargin ( marginHintSmall() ); 192 sexagesimalLayout->setMargin ( marginHintSmall() );
186 topLayout->setMargin ( 0 ); 193 topLayout->setMargin ( 0 );
187 mCityCombo->setMaximumWidth( 220 ); 194 mCityCombo->setMaximumWidth( 220 );
188 sexagesimalGroup->setMaximumWidth( 220 ); 195 sexagesimalGroup->setMaximumWidth( 220 );
189 } 196 }
190 else 197 else
191 label = new QLabel( i18n( "Latitude:" ), sexagesimalGroup ); 198 label = new QLabel( i18n( "Latitude:" ), sexagesimalGroup );
@@ -420,26 +427,26 @@ void GeoDialog::loadCityList()
420#ifndef _WIN32_ 427#ifndef _WIN32_
421 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/zone.tab"; 428 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/zone.tab";
422#else 429#else
423 fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\zone.tab"; 430 fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\zone.tab";
424#endif 431#endif
425#else 432#else
426 fileName = getenv("QPEDIR"); 433 fileName = getenv("QPEDIR");
427 fileName += "/pics/kdepim/kaddressbook/zone.tab"; 434 fileName += "/pics/kdepim/kaddressbook/zone.tab";
428#endif 435#endif
429 436
430 QFile file( fileName); 437 QFile file( fileName);
431 438
432 if ( file.open( IO_ReadOnly ) ) { 439 if ( file.open( QIODevice::ReadOnly ) ) {
433 QTextStream s( &file ); 440 Q3TextStream s( &file );
434 441
435 QString line, country; 442 QString line, country;
436 QRegExp coord( "[+-]\\d+[+-]\\d+" ); 443 QRegExp coord( "[+-]\\d+[+-]\\d+" );
437 QRegExp name( "[^\\s]+/[^\\s]+" ); 444 QRegExp name( "[^\\s]+/[^\\s]+" );
438 int posc, posn, pos; 445 int posc, posn, pos;
439 446
440 while ( !s.eof() ) { 447 while ( !s.eof() ) {
441 line = s.readLine().stripWhiteSpace(); 448 line = s.readLine().stripWhiteSpace();
442 if ( line.isEmpty() || line[ 0 ] == '#' ) 449 if ( line.isEmpty() || line[ 0 ] == '#' )
443 continue; 450 continue;
444 451
445 country = line.left( 2 ); 452 country = line.left( 2 );
@@ -543,25 +550,25 @@ int GeoDialog::nearestCity( double x, double y )
543 ( (*it).latitude - y ) * ( (*it).latitude - y ); 550 ( (*it).latitude - y ) * ( (*it).latitude - y );
544 if ( dist < 1.5 ) 551 if ( dist < 1.5 )
545 return pos; 552 return pos;
546 } 553 }
547 554
548 return -1; 555 return -1;
549} 556}
550 557
551 558
552GeoMapWidget::GeoMapWidget( QWidget *parent, const char *name ) 559GeoMapWidget::GeoMapWidget( QWidget *parent, const char *name )
553 : QWidget( parent, name ), mLatitude( 0 ), mLongitude( 0 ) 560 : QWidget( parent, name ), mLatitude( 0 ), mLongitude( 0 )
554{ 561{
555 setBackgroundMode( NoBackground ); 562 setBackgroundMode( Qt::NoBackground );
556 563
557 setFixedSize( 240, 120 ); 564 setFixedSize( 240, 120 );
558 565
559 update(); 566 update();
560} 567}
561 568
562GeoMapWidget::~GeoMapWidget() 569GeoMapWidget::~GeoMapWidget()
563{ 570{
564} 571}
565 572
566void GeoMapWidget::setLatitude( double latitude ) 573void GeoMapWidget::setLatitude( double latitude )
567{ 574{
@@ -615,15 +622,15 @@ void GeoMapWidget::paintEvent( QPaintEvent* )
615 622
616 double latOffset = ( mLatitude * latMid ) / 90; 623 double latOffset = ( mLatitude * latMid ) / 90;
617 double longOffset = ( mLongitude * longMid ) / 180; 624 double longOffset = ( mLongitude * longMid ) / 180;
618 625
619 int x = (int)(longMid + longOffset); 626 int x = (int)(longMid + longOffset);
620 int y = (int)(latMid - latOffset); 627 int y = (int)(latMid - latOffset);
621 p.drawEllipse( x, y, 4, 4 ); 628 p.drawEllipse( x, y, 4, 4 );
622 629
623 p.end(); 630 p.end();
624 bitBlt( this, 0, 0, &world ); 631 bitBlt( this, 0, 0, &world );
625} 632}
626 633
627#ifndef KAB_EMBEDDED 634#ifndef KAB_EMBEDDED_
628#include "geowidget.moc" 635#include "moc_geowidget.cpp"
629#endif //KAB_EMBEDDED 636#endif //KAB_EMBEDDED
diff --git a/kaddressbook/geowidget.h b/kaddressbook/geowidget.h
index 3d39691..5b64370 100644
--- a/kaddressbook/geowidget.h
+++ b/kaddressbook/geowidget.h
@@ -18,24 +18,28 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef GEOWIDGET_H 24#ifndef GEOWIDGET_H
25#define GEOWIDGET_H 25#define GEOWIDGET_H
26 26
27#include <qmap.h> 27#include <qmap.h>
28 28
29#include <qwidget.h> 29#include <qwidget.h>
30//Added by qt3to4:
31#include <QLabel>
32#include <QMouseEvent>
33#include <QPaintEvent>
30#include <kdialogbase.h> 34#include <kdialogbase.h>
31 35
32namespace KABC { 36namespace KABC {
33class Geo; 37class Geo;
34} 38}
35 39
36class GeoMapWidget; 40class GeoMapWidget;
37 41
38class KComboBox; 42class KComboBox;
39class KDoubleSpinBox; 43class KDoubleSpinBox;
40 44
41class QCheckBox; 45class QCheckBox;
diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp
index eec5e08..6ecf66d 100644
--- a/kaddressbook/imagewidget.cpp
+++ b/kaddressbook/imagewidget.cpp
@@ -28,92 +28,96 @@
28#include <kio/netaccess.h> 28#include <kio/netaccess.h>
29#include <kimageio.h> 29#include <kimageio.h>
30#endif //KAB_EMBEDDED 30#endif //KAB_EMBEDDED
31 31
32#include <kdebug.h> 32#include <kdebug.h>
33#include <kdialog.h> 33#include <kdialog.h>
34#include <kiconloader.h> 34#include <kiconloader.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kurlrequester.h> 36#include <kurlrequester.h>
37#include <kurl.h> 37#include <kurl.h>
38 38
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qgroupbox.h> 40#include <q3groupbox.h>
41#include <qlabel.h> 41#include <qlabel.h>
42#include <qlayout.h> 42#include <qlayout.h>
43#include <qpixmap.h> 43#include <qpixmap.h>
44#include <qpushbutton.h> 44#include <qpushbutton.h>
45#include <qapplication.h> 45#include <qapplication.h>
46#include <QDesktopWidget>
47//Added by qt3to4:
48#include <Q3GridLayout>
49#include <Q3Frame>
46 50
47#include "imagewidget.h" 51#include "imagewidget.h"
48 52
49ImageWidget::ImageWidget( QWidget *parent, const char *name ) 53ImageWidget::ImageWidget( QWidget *parent, const char *name )
50 : QWidget( parent, name ) 54 : QWidget( parent, name )
51{ 55{
52 QGridLayout *topLayout = new QGridLayout( this, 2, 1, KDialog::marginHint(), 56 Q3GridLayout *topLayout = new Q3GridLayout( this, 2, 1, KDialog::marginHint(),
53 KDialog::spacingHint() ); 57 KDialog::spacingHint() );
54 58
55 QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); 59 Q3GroupBox *photoBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Photo" ), this );
56 QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 3, 2, 60 Q3GridLayout *boxLayout = new Q3GridLayout( photoBox->layout(), 3, 2,
57 KDialog::spacingHint() ); 61 KDialog::spacingHint() );
58 boxLayout->setRowStretch( 2, 1 ); 62 boxLayout->setRowStretch( 2, 1 );
59 63
60 mPhotoLabel = new QLabel( photoBox ); 64 mPhotoLabel = new QLabel( photoBox );
61 int fac = 9; 65 int fac = 9;
62 if ( QApplication::desktop()->width() > 320 ) 66 if ( QApplication::desktop()->width() > 320 )
63 fac = 6; 67 fac = 6;
64 mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac ); 68 mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac );
65 mPhotoLabel->setScaledContents( true ); 69 mPhotoLabel->setScaledContents( true );
66 mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 70 mPhotoLabel->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken );
67 boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 ); 71 boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 );
68 72
69 mPhotoUrl = new KURLRequester( photoBox ); 73 mPhotoUrl = new KURLRequester( photoBox );
70#ifndef KAB_EMBEDDED 74#ifndef KAB_EMBEDDED
71 mPhotoUrl->setFilter( KImageIO::pattern() ); 75 mPhotoUrl->setFilter( KImageIO::pattern() );
72#else //KAB_EMBEDDED 76#else //KAB_EMBEDDED
73//US qDebug("ImageWidget::ImageWidget KImageIO not defined. Does this harm ???"); 77//US qDebug("ImageWidget::ImageWidget KImageIO not defined. Does this harm ???");
74#endif //KAB_EMBEDDED 78#endif //KAB_EMBEDDED
75 79
76 80
77 boxLayout->addWidget( mPhotoUrl, 0, 1 ); 81 boxLayout->addWidget( mPhotoUrl, 0, 1 );
78 QHBox *hb1 = new QHBox ( photoBox ); 82 Q3HBox *hb1 = new Q3HBox ( photoBox );
79 mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), hb1 ); 83 mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), hb1 );
80 mUsePhotoUrl->setEnabled( false ); 84 mUsePhotoUrl->setEnabled( false );
81 boxLayout->addWidget( hb1, 1, 1 ); 85 boxLayout->addWidget( hb1, 1, 1 );
82 86
83 QPushButton * pb = new QPushButton( i18n( "Remove" ), hb1 ); 87 QPushButton * pb = new QPushButton( i18n( "Remove" ), hb1 );
84 connect( pb, SIGNAL( clicked() ),this, SLOT( removePhoto() ) ); 88 connect( pb, SIGNAL( clicked() ),this, SLOT( removePhoto() ) );
85 boxLayout->addWidget( new QLabel( photoBox ), 2, 1 ); 89 boxLayout->addWidget( new QLabel( photoBox ), 2, 1 );
86 90
87 topLayout->addWidget( photoBox, 0, 0 ); 91 topLayout->addWidget( photoBox, 0, 0 );
88 92
89 QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); 93 Q3GroupBox *logoBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Logo" ), this );
90 boxLayout = new QGridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() ); 94 boxLayout = new Q3GridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() );
91 boxLayout->setRowStretch( 2, 1 ); 95 boxLayout->setRowStretch( 2, 1 );
92 96
93 mLogoLabel = new QLabel( logoBox ); 97 mLogoLabel = new QLabel( logoBox );
94 mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac ); 98 mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac );
95 mLogoLabel->setScaledContents( true ); 99 mLogoLabel->setScaledContents( true );
96 mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 100 mLogoLabel->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken );
97 boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 ); 101 boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 );
98 102
99 mLogoUrl = new KURLRequester( logoBox ); 103 mLogoUrl = new KURLRequester( logoBox );
100#ifndef KAB_EMBEDDED 104#ifndef KAB_EMBEDDED
101 mLogoUrl->setFilter( KImageIO::pattern() ); 105 mLogoUrl->setFilter( KImageIO::pattern() );
102#else //KAB_EMBEDDED 106#else //KAB_EMBEDDED
103//US qDebug("ImageWidget::ImageWidget KImageIO not defined 2"); 107//US qDebug("ImageWidget::ImageWidget KImageIO not defined 2");
104#endif //KAB_EMBEDDED 108#endif //KAB_EMBEDDED
105 boxLayout->addWidget( mLogoUrl, 0, 1 ); 109 boxLayout->addWidget( mLogoUrl, 0, 1 );
106 110
107 QHBox *hb2 = new QHBox ( logoBox ); 111 Q3HBox *hb2 = new Q3HBox ( logoBox );
108 mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), hb2 ); 112 mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), hb2 );
109 mUseLogoUrl->setEnabled( false ); 113 mUseLogoUrl->setEnabled( false );
110 boxLayout->addWidget( hb2, 1, 1 ); 114 boxLayout->addWidget( hb2, 1, 1 );
111 115
112 pb = new QPushButton( i18n( "Remove" ), hb2 ); 116 pb = new QPushButton( i18n( "Remove" ), hb2 );
113 connect( pb, SIGNAL( clicked() ),this, SLOT( removeLogo() ) ); 117 connect( pb, SIGNAL( clicked() ),this, SLOT( removeLogo() ) );
114 boxLayout->addWidget( new QLabel( logoBox ), 2, 1 ); 118 boxLayout->addWidget( new QLabel( logoBox ), 2, 1 );
115 topLayout->addWidget( logoBox, 1, 0 ); 119 topLayout->addWidget( logoBox, 1, 0 );
116 120
117 connect( mPhotoUrl, SIGNAL( textChanged( const QString& ) ), 121 connect( mPhotoUrl, SIGNAL( textChanged( const QString& ) ),
118 SIGNAL( changed() ) ); 122 SIGNAL( changed() ) );
119 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), 123 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ),
@@ -171,25 +175,25 @@ void ImageWidget::setPhoto( const KABC::Picture &photo )
171 } 175 }
172 176
173 blockSignals( blocked ); 177 blockSignals( blocked );
174} 178}
175 179
176KABC::Picture ImageWidget::photo() const 180KABC::Picture ImageWidget::photo() const
177{ 181{
178 KABC::Picture photo; 182 KABC::Picture photo;
179 183
180 if ( mUsePhotoUrl->isChecked() ) 184 if ( mUsePhotoUrl->isChecked() )
181 photo.setUrl( mPhotoUrl->url() ); 185 photo.setUrl( mPhotoUrl->url() );
182 else { 186 else {
183 QPixmap *px = mPhotoLabel->pixmap(); 187 const QPixmap *px = mPhotoLabel->pixmap();
184 if ( px ) { 188 if ( px ) {
185#ifndef KAB_EMBEDDED 189#ifndef KAB_EMBEDDED
186 if ( px->height() > px->width() ) 190 if ( px->height() > px->width() )
187 photo.setData( px->convertToImage().scaleHeight( 140 ) ); 191 photo.setData( px->convertToImage().scaleHeight( 140 ) );
188 else 192 else
189 photo.setData( px->convertToImage().scaleWidth( 100 ) ); 193 photo.setData( px->convertToImage().scaleWidth( 100 ) );
190#else //KAB_EMBEDDED 194#else //KAB_EMBEDDED
191//US add teh nullcheck 195//US add teh nullcheck
192 if (px->isNull() != true ) 196 if (px->isNull() != true )
193 photo.setData( px->convertToImage() ); 197 photo.setData( px->convertToImage() );
194#endif //KAB_EMBEDDED 198#endif //KAB_EMBEDDED
195 199
@@ -223,25 +227,25 @@ void ImageWidget::setLogo( const KABC::Picture &logo )
223 } 227 }
224 228
225 blockSignals( blocked ); 229 blockSignals( blocked );
226} 230}
227 231
228KABC::Picture ImageWidget::logo() const 232KABC::Picture ImageWidget::logo() const
229{ 233{
230 KABC::Picture logo; 234 KABC::Picture logo;
231 235
232 if ( mUseLogoUrl->isChecked() ) 236 if ( mUseLogoUrl->isChecked() )
233 logo.setUrl( mLogoUrl->url() ); 237 logo.setUrl( mLogoUrl->url() );
234 else { 238 else {
235 QPixmap *px = mLogoLabel->pixmap(); 239 const QPixmap *px = mLogoLabel->pixmap();
236 if ( px ) { 240 if ( px ) {
237#ifndef KAB_EMBEDDED 241#ifndef KAB_EMBEDDED
238 if ( px->height() > px->width() ) 242 if ( px->height() > px->width() )
239 logo.setData( px->convertToImage().scaleHeight( 140 ) ); 243 logo.setData( px->convertToImage().scaleHeight( 140 ) );
240 else 244 else
241 logo.setData( px->convertToImage().scaleWidth( 100 ) ); 245 logo.setData( px->convertToImage().scaleWidth( 100 ) );
242#else //KAB_EMBEDDED 246#else //KAB_EMBEDDED
243 if (px->isNull() != true ) 247 if (px->isNull() != true )
244 logo.setData( px->convertToImage() ); 248 logo.setData( px->convertToImage() );
245#endif //KAB_EMBEDDED 249#endif //KAB_EMBEDDED
246 250
247 logo.setType( "PNG" ); 251 logo.setType( "PNG" );
@@ -283,15 +287,15 @@ void ImageWidget::updateGUI()
283 287
284QPixmap ImageWidget::loadPixmap( const QString &url ) 288QPixmap ImageWidget::loadPixmap( const QString &url )
285{ 289{
286 290
287 QPixmap pixmap; 291 QPixmap pixmap;
288 292
289 if ( url.isEmpty() ) 293 if ( url.isEmpty() )
290 return pixmap; 294 return pixmap;
291 pixmap.load( url ); 295 pixmap.load( url );
292 return pixmap; 296 return pixmap;
293} 297}
294 298
295#ifndef KAB_EMBEDDED 299#ifndef KAB_EMBEDDED_
296#include "imagewidget.moc" 300#include "moc_imagewidget.cpp"
297#endif //KAB_EMBEDDED 301#endif //KAB_EMBEDDED
diff --git a/kaddressbook/imagewidget.h b/kaddressbook/imagewidget.h
index bbfba58..9320a6b 100644
--- a/kaddressbook/imagewidget.h
+++ b/kaddressbook/imagewidget.h
@@ -16,24 +16,27 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef IMAGEWIDGET_H 24#ifndef IMAGEWIDGET_H
25#define IMAGEWIDGET_H 25#define IMAGEWIDGET_H
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28//Added by qt3to4:
29#include <QPixmap>
30#include <QLabel>
28 31
29#include <kabc/picture.h> 32#include <kabc/picture.h>
30#include <kdialogbase.h> 33#include <kdialogbase.h>
31 34
32class KURL; 35class KURL;
33class KURLRequester; 36class KURLRequester;
34 37
35class QCheckBox; 38class QCheckBox;
36class QLabel; 39class QLabel;
37 40
38class ImageWidget : public QWidget 41class ImageWidget : public QWidget
39{ 42{
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp
index 5f8b83d..a54d1cd 100644
--- a/kaddressbook/incsearchwidget.cpp
+++ b/kaddressbook/incsearchwidget.cpp
@@ -16,47 +16,51 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qapplication.h> 27#include <qapplication.h>
28#include <QDesktopWidget>
28#include <qcombobox.h> 29#include <qcombobox.h>
30//Added by qt3to4:
31#include <Q3HBoxLayout>
29 32
30#include <kdialog.h> 33#include <kdialog.h>
31#include <klineedit.h> 34#include <klineedit.h>
32#include <klocale.h> 35#include <klocale.h>
33#include <kglobal.h> 36#include <kglobal.h>
34#include <kglobal.h> 37#include <kglobal.h>
35#include "kabprefs.h" 38#include "kabprefs.h"
36 39
37#include "incsearchwidget.h" 40#include "incsearchwidget.h"
38 41
39IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) 42IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
40 : QWidget( parent, name )
41{ 43{
44 setObjectName(name);
45 setParent(parent);
42#ifndef KAB_EMBEDDED 46#ifndef KAB_EMBEDDED
43//US setCaption( i18n( "Incremental Search" ) ); 47//US setCaption( i18n( "Incremental Search" ) );
44#endif //KAB_EMBEDDED 48#endif //KAB_EMBEDDED
45 49
46 QHBoxLayout *layout = new QHBoxLayout( this, 2, KDialog::spacingHint() ); 50 Q3HBoxLayout *layout = new Q3HBoxLayout( this, 2, KDialog::spacingHint() );
47 51
48#ifdef DESKTOP_VERSION 52#ifdef DESKTOP_VERSION
49 QLabel *label = new QLabel( i18n( "Search:" ), this ); 53 QLabel *label = new QLabel( i18n( "Search:" ), this );
50 label->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight ); 54 label->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
51 layout->addWidget( label ); 55 layout->addWidget( label );
52#endif //KAB_EMBEDDED 56#endif //KAB_EMBEDDED
53 57
54 mSearchText = new KLineEdit( this ); 58 mSearchText = new KLineEdit( this );
55 layout->addWidget( mSearchText ); 59 layout->addWidget( mSearchText );
56// #ifdef KAB_EMBEDDED 60// #ifdef KAB_EMBEDDED
57// if (KGlobal::getOrientation() == KGlobal::Portrait) 61// if (KGlobal::getOrientation() == KGlobal::Portrait)
58// mSearchText->setMaximumWidth(30); 62// mSearchText->setMaximumWidth(30);
59// #endif //KAB_EMBEDDED 63// #endif //KAB_EMBEDDED
60 //mSearchText->setMaximumWidth(60); 64 //mSearchText->setMaximumWidth(60);
61 65
62 66
@@ -167,15 +171,15 @@ KABC::Field *IncSearchWidget::currentField()const
167 171
168void IncSearchWidget::setCurrentItem( int pos ) 172void IncSearchWidget::setCurrentItem( int pos )
169{ 173{
170 mFieldCombo->setCurrentItem( pos ); 174 mFieldCombo->setCurrentItem( pos );
171 announceFieldChanged(); 175 announceFieldChanged();
172} 176}
173 177
174int IncSearchWidget::currentItem() const 178int IncSearchWidget::currentItem() const
175{ 179{
176 180
177 return mFieldCombo->currentItem(); 181 return mFieldCombo->currentItem();
178} 182}
179#ifndef KAB_EMBEDDED 183#ifndef KAB_EMBEDDED_
180#include "incsearchwidget.moc" 184#include "moc_incsearchwidget.cpp"
181#endif //KAB_EMBEDDED 185#endif //KAB_EMBEDDED
diff --git a/kaddressbook/jumpbuttonbar.cpp b/kaddressbook/jumpbuttonbar.cpp
index aebf8a6..740b7db 100644
--- a/kaddressbook/jumpbuttonbar.cpp
+++ b/kaddressbook/jumpbuttonbar.cpp
@@ -16,26 +16,29 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qevent.h> 24#include <qevent.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qstring.h> 27#include <qstring.h>
28#include <qtl.h> 28#include <q3tl.h>
29#include <qapplication.h> 29#include <qapplication.h>
30#include <QDesktopWidget>
31//Added by qt3to4:
32#include <Q3GridLayout>
30 33
31#include <kabc/addressbook.h> 34#include <kabc/addressbook.h>
32#include <kabc/field.h> 35#include <kabc/field.h>
33#include <kdebug.h> 36#include <kdebug.h>
34#include <klocale.h> 37#include <klocale.h>
35 38
36#include "kabcore.h" 39#include "kabcore.h"
37 40
38#include "jumpbuttonbar.h" 41#include "jumpbuttonbar.h"
39 42
40class JumpButton : public QPushButton 43class JumpButton : public QPushButton
41{ 44{
@@ -64,27 +67,27 @@ void JumpButton::setCharacter( const QString &character )
64} 67}
65 68
66QString JumpButton::character() const 69QString JumpButton::character() const
67{ 70{
68 return mCharacter; 71 return mCharacter;
69} 72}
70 73
71JumpButtonBar::JumpButtonBar( KABCore *core, QWidget *parent, const char *name ) 74JumpButtonBar::JumpButtonBar( KABCore *core, QWidget *parent, const char *name )
72 : QWidget( parent, name ), mCore( core ) 75 : QWidget( parent, name ), mCore( core )
73{ 76{
74 if ( QApplication::desktop()->width() < 480 ) 77 if ( QApplication::desktop()->width() < 480 )
75 78
76 mButtonLayout = new QGridLayout( this, 1, 18 ); 79 mButtonLayout = new Q3GridLayout( this, 1, 18 );
77 else 80 else
78 mButtonLayout = new QGridLayout( this, 1, 20 ); 81 mButtonLayout = new Q3GridLayout( this, 1, 20 );
79 mButtonLayout->setAlignment( Qt::AlignTop ); 82 mButtonLayout->setAlignment( Qt::AlignTop );
80 83
81 recreateButtons(); 84 recreateButtons();
82} 85}
83 86
84JumpButtonBar::~JumpButtonBar() 87JumpButtonBar::~JumpButtonBar()
85{ 88{
86} 89}
87 90
88QSizePolicy JumpButtonBar::sizePolicy() const 91QSizePolicy JumpButtonBar::sizePolicy() const
89{ 92{
90#ifndef KAB_EMBEDDED 93#ifndef KAB_EMBEDDED
@@ -243,15 +246,15 @@ void JumpButtonBar::sortListLocaleAware( QStringList &list )
243 if ( QString::compare( *j2, *j1 ) < 0 ) 246 if ( QString::compare( *j2, *j1 ) < 0 )
244#endif //KAB_EMBEDDED 247#endif //KAB_EMBEDDED
245 qSwap( *j1, *j2 ); 248 qSwap( *j1, *j2 );
246 249
247 ++j1; 250 ++j1;
248 ++j2; 251 ++j2;
249 } 252 }
250 ++beginIt; 253 ++beginIt;
251 --walkBackIt; 254 --walkBackIt;
252 } 255 }
253} 256}
254 257
255#ifndef KAB_EMBEDDED 258#ifndef KAB_EMBEDDED_
256#include "jumpbuttonbar.moc" 259#include "moc_jumpbuttonbar.cpp"
257#endif //KAB_EMBEDDED 260#endif //KAB_EMBEDDED
diff --git a/kaddressbook/jumpbuttonbar.h b/kaddressbook/jumpbuttonbar.h
index d534f2b..0589812 100644
--- a/kaddressbook/jumpbuttonbar.h
+++ b/kaddressbook/jumpbuttonbar.h
@@ -17,29 +17,32 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef JUMPBUTTONBAR_H 24#ifndef JUMPBUTTONBAR_H
25#define JUMPBUTTONBAR_H 25#define JUMPBUTTONBAR_H
26 26
27#include <qsizepolicy.h> 27#include <qsizepolicy.h>
28#include <qwidget.h> 28#include <qwidget.h>
29#include <qptrlist.h> 29#include <q3ptrlist.h>
30#include <qstringlist.h> 30#include <qstringlist.h>
31//Added by qt3to4:
32#include <QResizeEvent>
33#include <Q3GridLayout>
31 34
32class QChar; 35class QChar;
33class QGridLayout; 36class Q3GridLayout;
34class QResizeEvent; 37class QResizeEvent;
35class QPushButton; 38class QPushButton;
36class JumpButton; 39class JumpButton;
37 40
38namespace KABC { 41namespace KABC {
39class Field; 42class Field;
40} 43}
41 44
42class KABCore; 45class KABCore;
43 46
44/** 47/**
45 Used to draw the jump button bar on the right of the view. 48 Used to draw the jump button bar on the right of the view.
@@ -67,18 +70,18 @@ class JumpButtonBar : public QWidget
67 Emitted whenever a letter is selected by the user. 70 Emitted whenever a letter is selected by the user.
68 */ 71 */
69 void jumpToLetter( const QString &character ); 72 void jumpToLetter( const QString &character );
70 73
71 protected slots: 74 protected slots:
72 void letterClicked(); 75 void letterClicked();
73 76
74 private: 77 private:
75 void sortListLocaleAware( QStringList &list ); 78 void sortListLocaleAware( QStringList &list );
76 79
77 KABCore *mCore; 80 KABCore *mCore;
78 81
79 QGridLayout *mButtonLayout; 82 Q3GridLayout *mButtonLayout;
80 QStringList mCharacters; 83 QStringList mCharacters;
81 QPtrList<JumpButton> mButtons; 84 Q3PtrList<JumpButton> mButtons;
82}; 85};
83 86
84#endif 87#endif
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index ab2824c..03b44d1 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -30,36 +30,46 @@ $Id$
30 30
31#include "kabcore.h" 31#include "kabcore.h"
32 32
33#include <stdaddressbook.h> 33#include <stdaddressbook.h>
34#include <klocale.h> 34#include <klocale.h>
35#include <kfiledialog.h> 35#include <kfiledialog.h>
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qlabel.h> 37#include <qlabel.h>
38#include <qregexp.h> 38#include <qregexp.h>
39#include <qlineedit.h> 39#include <qlineedit.h>
40#include <qcheckbox.h> 40#include <qcheckbox.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qprogressbar.h> 42#include <q3progressbar.h>
43#include <QDesktopWidget>
44//Added by qt3to4:
45#include <QResizeEvent>
46#include <QPixmap>
47#include <Q3ValueList>
48#include <Q3HBoxLayout>
49#include <Q3VBoxLayout>
50#include <Q3CString>
51#include <Q3PopupMenu>
52#include <Q3PtrList>
43#include <libkdepim/phoneaccess.h> 53#include <libkdepim/phoneaccess.h>
44 54
45#ifndef KAB_EMBEDDED 55#ifndef KAB_EMBEDDED
46#include <qclipboard.h> 56#include <qclipboard.h>
47#include <qdir.h> 57#include <qdir.h>
48#include <qfile.h> 58#include <qfile.h>
49#include <qapplicaton.h> 59#include <qapplicaton.h>
50#include <qprogressbar.h> 60#include <q3progressbar.h>
51#include <qlayout.h> 61#include <qlayout.h>
52#include <qregexp.h> 62#include <qregexp.h>
53#include <qvbox.h> 63#include <q3vbox.h>
54#include <kabc/addresseelist.h> 64#include <kabc/addresseelist.h>
55#include <kabc/errorhandler.h> 65#include <kabc/errorhandler.h>
56#include <kabc/resource.h> 66#include <kabc/resource.h>
57#include <kabc/vcardconverter.h> 67#include <kabc/vcardconverter.h>
58#include <kapplication.h> 68#include <kapplication.h>
59#include <kactionclasses.h> 69#include <kactionclasses.h>
60#include <kcmultidialog.h> 70#include <kcmultidialog.h>
61#include <kdebug.h> 71#include <kdebug.h>
62#include <kdeversion.h> 72#include <kdeversion.h>
63#include <kkeydialog.h> 73#include <kkeydialog.h>
64#include <kmessagebox.h> 74#include <kmessagebox.h>
65#include <kprinter.h> 75#include <kprinter.h>
@@ -79,25 +89,25 @@ $Id$
79#include "ldapsearchdialog.h" 89#include "ldapsearchdialog.h"
80#include "printing/printingwizard.h" 90#include "printing/printingwizard.h"
81#else // KAB_EMBEDDED 91#else // KAB_EMBEDDED
82 92
83#include <kapplication.h> 93#include <kapplication.h>
84#include "KDGanttMinimizeSplitter.h" 94#include "KDGanttMinimizeSplitter.h"
85#include "kaddressbookmain.h" 95#include "kaddressbookmain.h"
86#include "kactioncollection.h" 96#include "kactioncollection.h"
87#include "addresseedialog.h" 97#include "addresseedialog.h"
88//US 98//US
89#include <addresseeview.h> 99#include <addresseeview.h>
90 100
91#include <qapp.h> 101#include <qapplication.h>
92#include <qmenubar.h> 102#include <qmenubar.h>
93//#include <qtoolbar.h> 103//#include <qtoolbar.h>
94#include <qmessagebox.h> 104#include <qmessagebox.h>
95#include <kdebug.h> 105#include <kdebug.h>
96#include <kiconloader.h> // needed for SmallIcon 106#include <kiconloader.h> // needed for SmallIcon
97#include <kresources/kcmkresources.h> 107#include <kresources/kcmkresources.h>
98#include <ktoolbar.h> 108#include <ktoolbar.h>
99#include <kprefsdialog.h> 109#include <kprefsdialog.h>
100 110
101 111
102//#include <qlabel.h> 112//#include <qlabel.h>
103 113
@@ -120,30 +130,30 @@ $Id$
120 130
121 131
122#include <kresources/selectdialog.h> 132#include <kresources/selectdialog.h>
123#include <kmessagebox.h> 133#include <kmessagebox.h>
124 134
125#include <picture.h> 135#include <picture.h>
126#include <resource.h> 136#include <resource.h>
127 137
128//US#include <qsplitter.h> 138//US#include <qsplitter.h>
129#include <qmap.h> 139#include <qmap.h>
130#include <qdir.h> 140#include <qdir.h>
131#include <qfile.h> 141#include <qfile.h>
132#include <qvbox.h> 142#include <q3vbox.h>
133#include <qlayout.h> 143#include <qlayout.h>
134#include <qclipboard.h> 144#include <qclipboard.h>
135#include <qtextstream.h> 145#include <q3textstream.h>
136#include <qradiobutton.h> 146#include <qradiobutton.h>
137#include <qbuttongroup.h> 147#include <q3buttongroup.h>
138 148
139#include <libkdepim/categoryselectdialog.h> 149#include <libkdepim/categoryselectdialog.h>
140#include <libkdepim/categoryeditdialog.h> 150#include <libkdepim/categoryeditdialog.h>
141#include <kabc/vcardconverter.h> 151#include <kabc/vcardconverter.h>
142 152
143 153
144#include "addresseeutil.h" 154#include "addresseeutil.h"
145#include "undocmds.h" 155#include "undocmds.h"
146#include "addresseeeditordialog.h" 156#include "addresseeeditordialog.h"
147#include "viewmanager.h" 157#include "viewmanager.h"
148#include "details/detailsviewcontainer.h" 158#include "details/detailsviewcontainer.h"
149#include "kabprefs.h" 159#include "kabprefs.h"
@@ -166,30 +176,30 @@ $Id$
166// sync includes 176// sync includes
167#include <libkdepim/ksyncprofile.h> 177#include <libkdepim/ksyncprofile.h>
168#include <libkdepim/ksyncprefsdialog.h> 178#include <libkdepim/ksyncprefsdialog.h>
169 179
170 180
171class KABCatPrefs : public QDialog 181class KABCatPrefs : public QDialog
172{ 182{
173 public: 183 public:
174 KABCatPrefs( QWidget *parent=0, const char *name=0 ) : 184 KABCatPrefs( QWidget *parent=0, const char *name=0 ) :
175 QDialog( parent, name, true ) 185 QDialog( parent, name, true )
176 { 186 {
177 setCaption( i18n("Manage new Categories") ); 187 setCaption( i18n("Manage new Categories") );
178 QVBoxLayout* lay = new QVBoxLayout( this ); 188 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
179 lay->setSpacing( 3 ); 189 lay->setSpacing( 3 );
180 lay->setMargin( 3 ); 190 lay->setMargin( 3 );
181 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 191 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
182 lay->addWidget( lab ); 192 lay->addWidget( lab );
183 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 193 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("New categories not in list:"), this );
184 lay->addWidget( format ); 194 lay->addWidget( format );
185 format->setExclusive ( true ) ; 195 format->setExclusive ( true ) ;
186 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 196 addCatBut = new QRadioButton(i18n("Add to category list"), format );
187 new QRadioButton(i18n("Remove from addressees"), format ); 197 new QRadioButton(i18n("Remove from addressees"), format );
188 addCatBut->setChecked( true ); 198 addCatBut->setChecked( true );
189 QPushButton * ok = new QPushButton( i18n("OK"), this ); 199 QPushButton * ok = new QPushButton( i18n("OK"), this );
190 lay->addWidget( ok ); 200 lay->addWidget( ok );
191 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 201 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
192 lay->addWidget( cancel ); 202 lay->addWidget( cancel );
193 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 203 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
194 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 204 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
195 resize( 200, 200 ); 205 resize( 200, 200 );
@@ -198,30 +208,30 @@ class KABCatPrefs : public QDialog
198 bool addCat() { return addCatBut->isChecked(); } 208 bool addCat() { return addCatBut->isChecked(); }
199private: 209private:
200 QRadioButton* addCatBut; 210 QRadioButton* addCatBut;
201}; 211};
202 212
203class KABFormatPrefs : public QDialog 213class KABFormatPrefs : public QDialog
204{ 214{
205 public: 215 public:
206 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) : 216 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) :
207 QDialog( parent, name, true ) 217 QDialog( parent, name, true )
208 { 218 {
209 setCaption( i18n("Set formatted name") ); 219 setCaption( i18n("Set formatted name") );
210 QVBoxLayout* lay = new QVBoxLayout( this ); 220 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
211 lay->setSpacing( 3 ); 221 lay->setSpacing( 3 );
212 lay->setMargin( 3 ); 222 lay->setMargin( 3 );
213 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); 223 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this );
214 lay->addWidget( lab ); 224 lay->addWidget( lab );
215 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); 225 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Set formatted name to:"), this );
216 lay->addWidget( format ); 226 lay->addWidget( format );
217 format->setExclusive ( true ) ; 227 format->setExclusive ( true ) ;
218 simple = new QRadioButton(i18n("Simple: James Bond"), format ); 228 simple = new QRadioButton(i18n("Simple: James Bond"), format );
219 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format ); 229 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format );
220 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); 230 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format );
221 company = new QRadioButton(i18n("Organization: MI6"), format ); 231 company = new QRadioButton(i18n("Organization: MI6"), format );
222 simple->setChecked( true ); 232 simple->setChecked( true );
223 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); 233 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this);
224 lay->addWidget( setCompany ); 234 lay->addWidget( setCompany );
225 QPushButton * ok = new QPushButton( i18n("Select contact list"), this ); 235 QPushButton * ok = new QPushButton( i18n("Select contact list"), this );
226 lay->addWidget( ok ); 236 lay->addWidget( ok );
227 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 237 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
@@ -236,47 +246,47 @@ public:
236 QCheckBox* setCompany; 246 QCheckBox* setCompany;
237}; 247};
238 248
239 249
240 250
241class KAex2phonePrefs : public QDialog 251class KAex2phonePrefs : public QDialog
242{ 252{
243 public: 253 public:
244 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 254 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
245 QDialog( parent, name, true ) 255 QDialog( parent, name, true )
246 { 256 {
247 setCaption( i18n("Export to phone options") ); 257 setCaption( i18n("Export to phone options") );
248 QVBoxLayout* lay = new QVBoxLayout( this ); 258 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
249 lay->setSpacing( 3 ); 259 lay->setSpacing( 3 );
250 lay->setMargin( 3 ); 260 lay->setMargin( 3 );
251 QLabel *lab; 261 QLabel *lab;
252 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 262 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
253 lab->setAlignment (AlignHCenter ); 263 lab->setAlignment (Qt::AlignHCenter );
254 QHBox* temphb; 264 Q3HBox* temphb;
255 temphb = new QHBox( this ); 265 temphb = new Q3HBox( this );
256 new QLabel( i18n("I/O device: "), temphb ); 266 new QLabel( i18n("I/O device: "), temphb );
257 mPhoneDevice = new QLineEdit( temphb); 267 mPhoneDevice = new QLineEdit( temphb);
258 lay->addWidget( temphb ); 268 lay->addWidget( temphb );
259 temphb = new QHBox( this ); 269 temphb = new Q3HBox( this );
260 new QLabel( i18n("Connection: "), temphb ); 270 new QLabel( i18n("Connection: "), temphb );
261 mPhoneConnection = new QLineEdit( temphb); 271 mPhoneConnection = new QLineEdit( temphb);
262 lay->addWidget( temphb ); 272 lay->addWidget( temphb );
263 temphb = new QHBox( this ); 273 temphb = new Q3HBox( this );
264 new QLabel( i18n("Model(opt.): "), temphb ); 274 new QLabel( i18n("Model(opt.): "), temphb );
265 mPhoneModel = new QLineEdit( temphb); 275 mPhoneModel = new QLineEdit( temphb);
266 lay->addWidget( temphb ); 276 lay->addWidget( temphb );
267 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); 277 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this );
268 // lay->addWidget( mWriteToSim ); 278 // lay->addWidget( mWriteToSim );
269 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); 279 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) );
270 lab->setAlignment (AlignHCenter); 280 lab->setAlignment (Qt::AlignHCenter);
271 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 281 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
272 lay->addWidget( ok ); 282 lay->addWidget( ok );
273 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 283 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
274 lay->addWidget( cancel ); 284 lay->addWidget( cancel );
275 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 285 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
276 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 286 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
277 resize( 220, 240 ); 287 resize( 220, 240 );
278 288
279 } 289 }
280 290
281public: 291public:
282 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 292 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
@@ -398,41 +408,41 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
398 createAddresseeEditorDialog( this ); 408 createAddresseeEditorDialog( this );
399 setModified( false ); 409 setModified( false );
400 mBRdisabled = false; 410 mBRdisabled = false;
401#ifndef DESKTOP_VERSION 411#ifndef DESKTOP_VERSION
402 infrared = 0; 412 infrared = 0;
403#endif 413#endif
404 //toggleBeamReceive( ); 414 //toggleBeamReceive( );
405 mMainWindow->toolBar()->show(); 415 mMainWindow->toolBar()->show();
406 // we have a toolbar repainting error on the Zaurus when starting KA/Pi 416 // we have a toolbar repainting error on the Zaurus when starting KA/Pi
407 //QTimer::singleShot( 10, this , SLOT ( updateToolBar())); 417 //QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
408 QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() )); 418 QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() ));
409} 419}
410void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data ) 420void KABCore::receiveStart( const Q3CString& cmsg, const QByteArray& data )
411{ 421{
412 //qDebug("KO: QCOP start message received: %s ", cmsg.data() ); 422 //qDebug("KO: QCOP start message received: %s ", cmsg.data() );
413 mCStringMess = cmsg; 423 mCStringMess = cmsg;
414 mByteData = data; 424 mByteData = data;
415} 425}
416 426
417void KABCore::loadDataAfterStart() 427void KABCore::loadDataAfterStart()
418{ 428{
419 //qDebug("KABCore::loadDataAfterStart() "); 429 //qDebug("KABCore::loadDataAfterStart() ");
420 ((StdAddressBook*)mAddressBook)->init( true ); 430 ((StdAddressBook*)mAddressBook)->init( true );
421 mViewManager->refreshView(); 431 mViewManager->refreshView();
422 432
423#ifndef DESKTOP_VERSION 433#ifndef DESKTOP_VERSION
424 disconnect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT (receiveStart ( const QCString &, const QByteArray & ))); 434 disconnect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT (receiveStart ( const Q3CString &, const QByteArray & )));
425 435
426 QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 436 QObject::connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & )));
427 if ( !mCStringMess.isEmpty() ) 437 if ( !mCStringMess.isEmpty() )
428 ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData ); 438 ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData );
429#endif 439#endif
430 // QTimer::singleShot( 10, this , SLOT ( updateToolBar())); 440 // QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
431 setCaptionBack(); 441 setCaptionBack();
432} 442}
433void KABCore::updateToolBar() 443void KABCore::updateToolBar()
434{ 444{
435 static int iii = 0; 445 static int iii = 0;
436 ++iii; 446 ++iii;
437 mMainWindow->toolBar()->repaintMe(); 447 mMainWindow->toolBar()->repaintMe();
438 if ( iii < 4 ) 448 if ( iii < 4 )
@@ -444,52 +454,52 @@ KABCore::~KABCore()
444 //saveSettings(); 454 //saveSettings();
445 //KABPrefs::instance()->writeConfig(); 455 //KABPrefs::instance()->writeConfig();
446 delete AddresseeConfig::instance(); 456 delete AddresseeConfig::instance();
447 mAddressBook = 0; 457 mAddressBook = 0;
448 KABC::StdAddressBook::close(); 458 KABC::StdAddressBook::close();
449 459
450 delete syncManager; 460 delete syncManager;
451#ifndef DESKTOP_VERSION 461#ifndef DESKTOP_VERSION
452 if ( infrared ) 462 if ( infrared )
453 delete infrared; 463 delete infrared;
454#endif 464#endif
455} 465}
456void KABCore::receive( const QCString& cmsg, const QByteArray& data ) 466void KABCore::receive( const Q3CString& cmsg, const QByteArray& data )
457{ 467{
458 //qDebug("KA: QCOP message received: %s ", cmsg.data() ); 468 //qDebug("KA: QCOP message received: %s ", cmsg.data() );
459 if ( cmsg == "setDocument(QString)" ) { 469 if ( cmsg == "setDocument(QString)" ) {
460 QDataStream stream( data, IO_ReadOnly ); 470 QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly );
461 QString fileName; 471 QString fileName;
462 stream >> fileName; 472 stream >> fileName;
463 recieve( fileName ); 473 recieve( fileName );
464 return; 474 return;
465 } 475 }
466} 476}
467void KABCore::toggleBeamReceive( ) 477void KABCore::toggleBeamReceive( )
468{ 478{
469 if ( mBRdisabled ) 479 if ( mBRdisabled )
470 return; 480 return;
471#ifndef DESKTOP_VERSION 481#ifndef DESKTOP_VERSION
472 if ( infrared ) { 482 if ( infrared ) {
473 qDebug("KA: AB disable BeamReceive "); 483 qDebug("KA: AB disable BeamReceive ");
474 delete infrared; 484 delete infrared;
475 infrared = 0; 485 infrared = 0;
476 mActionBR->setChecked(false); 486 mActionBR->setChecked(false);
477 return; 487 return;
478 } 488 }
479 qDebug("KA: AB enable BeamReceive "); 489 qDebug("KA: AB enable BeamReceive ");
480 mActionBR->setChecked(true); 490 mActionBR->setChecked(true);
481 491
482 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; 492 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ;
483 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); 493 QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(receive( const Q3CString&, const QByteArray& )));
484#endif 494#endif
485} 495}
486 496
487 497
488void KABCore::disableBR(bool b) 498void KABCore::disableBR(bool b)
489{ 499{
490#ifndef DESKTOP_VERSION 500#ifndef DESKTOP_VERSION
491 if ( b ) { 501 if ( b ) {
492 if ( infrared ) { 502 if ( infrared ) {
493 toggleBeamReceive( ); 503 toggleBeamReceive( );
494 } 504 }
495 mBRdisabled = true; 505 mBRdisabled = true;
@@ -551,25 +561,25 @@ void KABCore::restoreSettings()
551 mViewManager->restoreSettings(); 561 mViewManager->restoreSettings();
552 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); 562 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField );
553 mExtensionManager->restoreSettings(); 563 mExtensionManager->restoreSettings();
554#ifdef DESKTOP_VERSION 564#ifdef DESKTOP_VERSION
555 int wid = width(); 565 int wid = width();
556 if ( wid < 10 ) 566 if ( wid < 10 )
557 wid = 400; 567 wid = 400;
558#else 568#else
559 int wid = QApplication::desktop()->width(); 569 int wid = QApplication::desktop()->width();
560 if ( wid < 640 ) 570 if ( wid < 640 )
561 wid = QApplication::desktop()->height(); 571 wid = QApplication::desktop()->height();
562#endif 572#endif
563 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; 573 Q3ValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter;
564 if ( true /*splitterSize.count() == 0*/ ) { 574 if ( true /*splitterSize.count() == 0*/ ) {
565 splitterSize.append( wid / 2 ); 575 splitterSize.append( wid / 2 );
566 splitterSize.append( wid / 2 ); 576 splitterSize.append( wid / 2 );
567 } 577 }
568 mMiniSplitter->setSizes( splitterSize ); 578 mMiniSplitter->setSizes( splitterSize );
569 if ( mExtensionBarSplitter ) { 579 if ( mExtensionBarSplitter ) {
570 //splitterSize = KABPrefs::instance()->mExtensionsSplitter; 580 //splitterSize = KABPrefs::instance()->mExtensionsSplitter;
571 if ( true /*splitterSize.count() == 0*/ ) { 581 if ( true /*splitterSize.count() == 0*/ ) {
572 splitterSize.append( wid / 2 ); 582 splitterSize.append( wid / 2 );
573 splitterSize.append( wid / 2 ); 583 splitterSize.append( wid / 2 );
574 } 584 }
575 mExtensionBarSplitter->setSizes( splitterSize ); 585 mExtensionBarSplitter->setSizes( splitterSize );
@@ -641,28 +651,28 @@ KABC::Field *KABCore::currentSearchField() const
641 return mIncSearchWidget->currentField(); 651 return mIncSearchWidget->currentField();
642 else 652 else
643 return 0; 653 return 0;
644} 654}
645 655
646QStringList KABCore::selectedUIDs() const 656QStringList KABCore::selectedUIDs() const
647{ 657{
648 return mViewManager->selectedUids(); 658 return mViewManager->selectedUids();
649} 659}
650 660
651KABC::Resource *KABCore::requestResource( QWidget *parent ) 661KABC::Resource *KABCore::requestResource( QWidget *parent )
652{ 662{
653 QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); 663 Q3PtrList<KABC::Resource> kabcResources = addressBook()->resources();
654 664
655 QPtrList<KRES::Resource> kresResources; 665 Q3PtrList<KRES::Resource> kresResources;
656 QPtrListIterator<KABC::Resource> resIt( kabcResources ); 666 Q3PtrListIterator<KABC::Resource> resIt( kabcResources );
657 KABC::Resource *resource; 667 KABC::Resource *resource;
658 while ( ( resource = resIt.current() ) != 0 ) { 668 while ( ( resource = resIt.current() ) != 0 ) {
659 ++resIt; 669 ++resIt;
660 if ( !resource->readOnly() ) { 670 if ( !resource->readOnly() ) {
661 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 671 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
662 if ( res ) 672 if ( res )
663 kresResources.append( res ); 673 kresResources.append( res );
664 } 674 }
665 } 675 }
666 676
667 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); 677 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent );
668 return static_cast<KABC::Resource*>( res ); 678 return static_cast<KABC::Resource*>( res );
@@ -786,32 +796,32 @@ void KABCore::mailVCard( const QStringList& uids )
786 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { 796 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
787 KABC::Addressee a = mAddressBook->findByUid( *it ); 797 KABC::Addressee a = mAddressBook->findByUid( *it );
788 798
789 if ( a.isEmpty() ) 799 if ( a.isEmpty() )
790 continue; 800 continue;
791 801
792 QString name = a.givenName() + "_" + a.familyName() + ".vcf"; 802 QString name = a.givenName() + "_" + a.familyName() + ".vcf";
793 803
794 QString fileName = dirName + "/" + name; 804 QString fileName = dirName + "/" + name;
795 805
796 QFile outFile(fileName); 806 QFile outFile(fileName);
797 807
798 if ( outFile.open(IO_WriteOnly) ) { // file opened successfully 808 if ( outFile.open(QIODevice::WriteOnly) ) { // file opened successfully
799 KABC::VCardConverter converter; 809 KABC::VCardConverter converter;
800 QString vcard; 810 QString vcard;
801 811
802 converter.addresseeToVCard( a, vcard ); 812 converter.addresseeToVCard( a, vcard );
803 813
804 QTextStream t( &outFile ); // use a text stream 814 Q3TextStream t( &outFile ); // use a text stream
805 t.setEncoding( QTextStream::UnicodeUTF8 ); 815 t.setEncoding( Q3TextStream::UnicodeUTF8 );
806 t << vcard; 816 t << vcard;
807 817
808 outFile.close(); 818 outFile.close();
809 819
810 urls.append( fileName ); 820 urls.append( fileName );
811 } 821 }
812 } 822 }
813 823
814 bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); 824 bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") );
815 825
816 826
817/*US 827/*US
@@ -1007,29 +1017,29 @@ void KABCore::beamVCard(const QStringList& uids)
1007 if ( semi < dopp && semi >= 0 ) 1017 if ( semi < dopp && semi >= 0 )
1008 sep = semi ; 1018 sep = semi ;
1009 else 1019 else
1010 sep = dopp; 1020 sep = dopp;
1011 datastream +=vcard.mid( start, next - start); 1021 datastream +=vcard.mid( start, next - start);
1012 datastream +=vcard.mid( next+5,sep -next -5 ).upper(); 1022 datastream +=vcard.mid( next+5,sep -next -5 ).upper();
1013 start = sep; 1023 start = sep;
1014 } 1024 }
1015 datastream += vcard.mid( start,vcard.length() ); 1025 datastream += vcard.mid( start,vcard.length() );
1016 } 1026 }
1017#ifndef DESKTOP_VERSION 1027#ifndef DESKTOP_VERSION
1018 QFile outFile(fileName); 1028 QFile outFile(fileName);
1019 if ( outFile.open(IO_WriteOnly) ) { 1029 if ( outFile.open(QIODevice::WriteOnly) ) {
1020 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 1030 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
1021 QTextStream t( &outFile ); // use a text stream 1031 Q3TextStream t( &outFile ); // use a text stream
1022 //t.setEncoding( QTextStream::UnicodeUTF8 ); 1032 //t.setEncoding( QTextStream::UnicodeUTF8 );
1023 t.setEncoding( QTextStream::Latin1 ); 1033 t.setEncoding( Q3TextStream::Latin1 );
1024 t <<datastream.latin1(); 1034 t <<datastream.latin1();
1025 outFile.close(); 1035 outFile.close();
1026 Ir *ir = new Ir( this ); 1036 Ir *ir = new Ir( this );
1027 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); 1037 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
1028 ir->send( fileName, description, "text/x-vCard" ); 1038 ir->send( fileName, description, "text/x-vCard" );
1029 } else { 1039 } else {
1030 qDebug("KA: Error open temp beam file "); 1040 qDebug("KA: Error open temp beam file ");
1031 return; 1041 return;
1032 } 1042 }
1033#endif 1043#endif
1034 1044
1035} 1045}
@@ -1288,28 +1298,28 @@ void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails )
1288 1298
1289 UndoStack::instance()->push( command ); 1299 UndoStack::instance()->push( command );
1290 RedoStack::instance()->clear(); 1300 RedoStack::instance()->clear();
1291 if ( updateDetails ) 1301 if ( updateDetails )
1292 mDetails->setAddressee( addr ); 1302 mDetails->setAddressee( addr );
1293 setModified( true ); 1303 setModified( true );
1294} 1304}
1295 1305
1296void KABCore::newContact() 1306void KABCore::newContact()
1297{ 1307{
1298 1308
1299 1309
1300 QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); 1310 Q3PtrList<KABC::Resource> kabcResources = mAddressBook->resources();
1301 1311
1302 QPtrList<KRES::Resource> kresResources; 1312 Q3PtrList<KRES::Resource> kresResources;
1303 QPtrListIterator<KABC::Resource> it( kabcResources ); 1313 Q3PtrListIterator<KABC::Resource> it( kabcResources );
1304 KABC::Resource *resource; 1314 KABC::Resource *resource;
1305 while ( ( resource = it.current() ) != 0 ) { 1315 while ( ( resource = it.current() ) != 0 ) {
1306 ++it; 1316 ++it;
1307 if ( !resource->readOnly() ) { 1317 if ( !resource->readOnly() ) {
1308 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 1318 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
1309 if ( res ) 1319 if ( res )
1310 kresResources.append( res ); 1320 kresResources.append( res );
1311 } 1321 }
1312 } 1322 }
1313 1323
1314 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this ); 1324 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this );
1315 resource = static_cast<KABC::Resource*>( res ); 1325 resource = static_cast<KABC::Resource*>( res );
@@ -1847,98 +1857,98 @@ AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1847 1857
1848 return mEditorDialog; 1858 return mEditorDialog;
1849} 1859}
1850 1860
1851void KABCore::slotEditorDestroyed( const QString &uid ) 1861void KABCore::slotEditorDestroyed( const QString &uid )
1852{ 1862{
1853 //mEditorDict.remove( uid ); 1863 //mEditorDict.remove( uid );
1854} 1864}
1855 1865
1856void KABCore::initGUI() 1866void KABCore::initGUI()
1857{ 1867{
1858#ifndef KAB_EMBEDDED 1868#ifndef KAB_EMBEDDED
1859 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1869 Q3HBoxLayout *topLayout = new Q3HBoxLayout( this );
1860 topLayout->setSpacing( KDialogBase::spacingHint() ); 1870 topLayout->setSpacing( KDialogBase::spacingHint() );
1861 1871
1862 mExtensionBarSplitter = new QSplitter( this ); 1872 mExtensionBarSplitter = new QSplitter( this );
1863 mExtensionBarSplitter->setOrientation( Qt::Vertical ); 1873 mExtensionBarSplitter->setOrientation( Qt::Vertical );
1864 1874
1865 mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); 1875 mDetailsSplitter = new QSplitter( mExtensionBarSplitter );
1866 1876
1867 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1877 Q3VBox *viewSpace = new Q3VBox( mDetailsSplitter );
1868 mIncSearchWidget = new IncSearchWidget( viewSpace ); 1878 mIncSearchWidget = new IncSearchWidget( viewSpace );
1869 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1879 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1870 SLOT( incrementalSearch( const QString& ) ) ); 1880 SLOT( incrementalSearch( const QString& ) ) );
1871 1881
1872 mViewManager = new ViewManager( this, viewSpace ); 1882 mViewManager = new ViewManager( this, viewSpace );
1873 viewSpace->setStretchFactor( mViewManager, 1 ); 1883 viewSpace->setStretchFactor( mViewManager, 1 );
1874 1884
1875 mDetails = new ViewContainer( mDetailsSplitter ); 1885 mDetails = new ViewContainer( mDetailsSplitter );
1876 1886
1877 mJumpButtonBar = new JumpButtonBar( this, this ); 1887 mJumpButtonBar = new JumpButtonBar( this, this );
1878 1888
1879 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1889 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1880 1890
1881 topLayout->addWidget( mExtensionBarSplitter ); 1891 topLayout->addWidget( mExtensionBarSplitter );
1882 topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); 1892 topLayout->setStretchFactor( mExtensionBarSplitter, 100 );
1883 topLayout->addWidget( mJumpButtonBar ); 1893 topLayout->addWidget( mJumpButtonBar );
1884 //topLayout->setStretchFactor( mJumpButtonBar, 1 ); 1894 //topLayout->setStretchFactor( mJumpButtonBar, 1 );
1885 1895
1886 mXXPortManager = new XXPortManager( this, this ); 1896 mXXPortManager = new XXPortManager( this, this );
1887 1897
1888#else //KAB_EMBEDDED 1898#else //KAB_EMBEDDED
1889 //US initialize viewMenu before settingup viewmanager. 1899 //US initialize viewMenu before settingup viewmanager.
1890 // Viewmanager needs this menu to plugin submenues. 1900 // Viewmanager needs this menu to plugin submenues.
1891 viewMenu = new QPopupMenu( this ); 1901 viewMenu = new Q3PopupMenu( this );
1892 settingsMenu = new QPopupMenu( this ); 1902 settingsMenu = new Q3PopupMenu( this );
1893 //filterMenu = new QPopupMenu( this ); 1903 //filterMenu = new QPopupMenu( this );
1894 ImportMenu = new QPopupMenu( this ); 1904 ImportMenu = new Q3PopupMenu( this );
1895 ExportMenu = new QPopupMenu( this ); 1905 ExportMenu = new Q3PopupMenu( this );
1896 syncMenu = new QPopupMenu( this ); 1906 syncMenu = new Q3PopupMenu( this );
1897 changeMenu= new QPopupMenu( this ); 1907 changeMenu= new Q3PopupMenu( this );
1898 beamMenu= new QPopupMenu( this ); 1908 beamMenu= new Q3PopupMenu( this );
1899 1909
1900//US since we have no splitter for the embedded system, setup 1910//US since we have no splitter for the embedded system, setup
1901// a layout with two frames. One left and one right. 1911// a layout with two frames. One left and one right.
1902 1912
1903 QBoxLayout *topLayout; 1913 Q3BoxLayout *topLayout;
1904 1914
1905 // = new QHBoxLayout( this ); 1915 // = new QHBoxLayout( this );
1906// QBoxLayout *topLayout = (QBoxLayout*)layout(); 1916// QBoxLayout *topLayout = (QBoxLayout*)layout();
1907 1917
1908// QWidget *mainBox = new QWidget( this ); 1918// QWidget *mainBox = new QWidget( this );
1909// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); 1919// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
1910 1920
1911#ifdef DESKTOP_VERSION 1921#ifdef DESKTOP_VERSION
1912 topLayout = new QHBoxLayout( this ); 1922 topLayout = new Q3HBoxLayout( this );
1913 1923
1914 1924
1915 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1925 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1916 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1926 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1917 1927
1918 topLayout->addWidget(mMiniSplitter ); 1928 topLayout->addWidget(mMiniSplitter );
1919 1929
1920 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); 1930 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter );
1921 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1931 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1922 mViewManager = new ViewManager( this, mExtensionBarSplitter ); 1932 mViewManager = new ViewManager( this, mExtensionBarSplitter );
1923 mDetails = new ViewContainer( mMiniSplitter ); 1933 mDetails = new ViewContainer( mMiniSplitter );
1924 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1934 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1925#else 1935#else
1926 if ( QApplication::desktop()->width() > 480 ) { 1936 if ( QApplication::desktop()->width() > 480 ) {
1927 topLayout = new QHBoxLayout( this ); 1937 topLayout = new Q3HBoxLayout( this );
1928 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1938 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1929 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1939 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1930 } else { 1940 } else {
1931 1941
1932 topLayout = new QHBoxLayout( this ); 1942 topLayout = new Q3HBoxLayout( this );
1933 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); 1943 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
1934 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1944 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1935 } 1945 }
1936 1946
1937 topLayout->addWidget(mMiniSplitter ); 1947 topLayout->addWidget(mMiniSplitter );
1938 mViewManager = new ViewManager( this, mMiniSplitter ); 1948 mViewManager = new ViewManager( this, mMiniSplitter );
1939 mDetails = new ViewContainer( mMiniSplitter ); 1949 mDetails = new ViewContainer( mMiniSplitter );
1940 1950
1941 1951
1942 mExtensionManager = new ExtensionManager( this, mMiniSplitter ); 1952 mExtensionManager = new ExtensionManager( this, mMiniSplitter );
1943#endif 1953#endif
1944 //eh->hide(); 1954 //eh->hide();
@@ -2025,35 +2035,35 @@ void KABCore::initActions()
2025{ 2035{
2026//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 2036//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
2027 2037
2028#ifndef KAB_EMBEDDED 2038#ifndef KAB_EMBEDDED
2029 connect( QApplication::clipboard(), SIGNAL( dataChanged() ), 2039 connect( QApplication::clipboard(), SIGNAL( dataChanged() ),
2030 SLOT( clipboardDataChanged() ) ); 2040 SLOT( clipboardDataChanged() ) );
2031#endif //KAB_EMBEDDED 2041#endif //KAB_EMBEDDED
2032 2042
2033 // file menu 2043 // file menu
2034 2044
2035 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); 2045 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() );
2036 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); 2046 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
2037 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, 2047 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", Qt::CTRL + Qt::Key_P, mViewManager,
2038 SLOT( printView() ), actionCollection(), "kaddressbook_print" ); 2048 SLOT( printView() ), actionCollection(), "kaddressbook_print" );
2039 2049
2040 2050
2041 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails, 2051 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails,
2042 SLOT( printView() ), actionCollection(), "kaddressbook_print2" ); 2052 SLOT( printView() ), actionCollection(), "kaddressbook_print2" );
2043 2053
2044 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, 2054 mActionSave = new KAction( i18n( "&Save" ), "filesave", Qt::CTRL+Qt::Key_S, this,
2045 SLOT( save() ), actionCollection(), "file_sync" ); 2055 SLOT( save() ), actionCollection(), "file_sync" );
2046 2056
2047 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, 2057 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", Qt::CTRL+Qt::Key_N, this,
2048 SLOT( newContact() ), actionCollection(), "file_new_contact" ); 2058 SLOT( newContact() ), actionCollection(), "file_new_contact" );
2049 2059
2050 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, 2060 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0,
2051 this, SLOT( mailVCard() ), 2061 this, SLOT( mailVCard() ),
2052 actionCollection(), "file_mail_vcard"); 2062 actionCollection(), "file_mail_vcard");
2053 2063
2054 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, 2064 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this,
2055 SLOT( export2phone() ), actionCollection(), 2065 SLOT( export2phone() ), actionCollection(),
2056 "kaddressbook_ex2phone" ); 2066 "kaddressbook_ex2phone" );
2057 2067
2058 mActionBeamVCard = 0; 2068 mActionBeamVCard = 0;
2059 mActionBeam = 0; 2069 mActionBeam = 0;
@@ -2074,53 +2084,53 @@ void KABCore::initActions()
2074 this, SLOT( editContact2() ), 2084 this, SLOT( editContact2() ),
2075 actionCollection(), "file_properties" ); 2085 actionCollection(), "file_properties" );
2076 2086
2077#ifdef KAB_EMBEDDED 2087#ifdef KAB_EMBEDDED
2078 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); 2088 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() );
2079 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, 2089 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0,
2080 mMainWindow, SLOT( exit() ), 2090 mMainWindow, SLOT( exit() ),
2081 actionCollection(), "quit" ); 2091 actionCollection(), "quit" );
2082#endif //KAB_EMBEDDED 2092#endif //KAB_EMBEDDED
2083 2093
2084 // edit menu 2094 // edit menu
2085 if ( mIsPart ) { 2095 if ( mIsPart ) {
2086 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, 2096 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", Qt::CTRL + Qt::Key_C, this,
2087 SLOT( copyContacts() ), actionCollection(), 2097 SLOT( copyContacts() ), actionCollection(),
2088 "kaddressbook_copy" ); 2098 "kaddressbook_copy" );
2089 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, 2099 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", Qt::CTRL + Qt::Key_X, this,
2090 SLOT( cutContacts() ), actionCollection(), 2100 SLOT( cutContacts() ), actionCollection(),
2091 "kaddressbook_cut" ); 2101 "kaddressbook_cut" );
2092 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, 2102 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", Qt::CTRL + Qt::Key_V, this,
2093 SLOT( pasteContacts() ), actionCollection(), 2103 SLOT( pasteContacts() ), actionCollection(),
2094 "kaddressbook_paste" ); 2104 "kaddressbook_paste" );
2095 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, 2105 mActionSelectAll = new KAction( i18n( "Select &All" ), Qt::CTRL + Qt::Key_A, this,
2096 SLOT( selectAllContacts() ), actionCollection(), 2106 SLOT( selectAllContacts() ), actionCollection(),
2097 "kaddressbook_select_all" ); 2107 "kaddressbook_select_all" );
2098 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, 2108 mActionUndo = new KAction( i18n( "&Undo" ), "undo", Qt::CTRL + Qt::Key_Z, this,
2099 SLOT( undo() ), actionCollection(), 2109 SLOT( undo() ), actionCollection(),
2100 "kaddressbook_undo" ); 2110 "kaddressbook_undo" );
2101 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 2111 mActionRedo = new KAction( i18n( "Re&do" ), "redo", Qt::CTRL + Qt::SHIFT + Qt::Key_Z,
2102 this, SLOT( redo() ), actionCollection(), 2112 this, SLOT( redo() ), actionCollection(),
2103 "kaddressbook_redo" ); 2113 "kaddressbook_redo" );
2104 } else { 2114 } else {
2105 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); 2115 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() );
2106 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); 2116 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() );
2107 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); 2117 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() );
2108 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); 2118 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() );
2109 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); 2119 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() );
2110 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); 2120 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() );
2111 } 2121 }
2112 2122
2113 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 2123 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
2114 Key_Delete, this, SLOT( deleteContacts() ), 2124 Qt::Key_Delete, this, SLOT( deleteContacts() ),
2115 actionCollection(), "edit_delete" ); 2125 actionCollection(), "edit_delete" );
2116 2126
2117 mActionUndo->setEnabled( false ); 2127 mActionUndo->setEnabled( false );
2118 mActionRedo->setEnabled( false ); 2128 mActionRedo->setEnabled( false );
2119 2129
2120 // settings menu 2130 // settings menu
2121#ifdef KAB_EMBEDDED 2131#ifdef KAB_EMBEDDED
2122//US special menuentry to configure the addressbook resources. On KDE 2132//US special menuentry to configure the addressbook resources. On KDE
2123// you do that through the control center !!! 2133// you do that through the control center !!!
2124 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, 2134 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
2125 SLOT( configureResources() ), actionCollection(), 2135 SLOT( configureResources() ), actionCollection(),
2126 "kaddressbook_configure_resources" ); 2136 "kaddressbook_configure_resources" );
@@ -2237,27 +2247,27 @@ void KABCore::initActions()
2237 clipboardDataChanged(); 2247 clipboardDataChanged();
2238 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2248 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2239 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2249 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2240} 2250}
2241 2251
2242//US we need this function, to plug all actions into the correct menues. 2252//US we need this function, to plug all actions into the correct menues.
2243// KDE uses a XML format to plug the actions, but we work her without this overhead. 2253// KDE uses a XML format to plug the actions, but we work her without this overhead.
2244void KABCore::addActionsManually() 2254void KABCore::addActionsManually()
2245{ 2255{
2246//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 2256//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
2247 2257
2248#ifdef KAB_EMBEDDED 2258#ifdef KAB_EMBEDDED
2249 QPopupMenu *fileMenu = new QPopupMenu( this ); 2259 Q3PopupMenu *fileMenu = new Q3PopupMenu( this );
2250 QPopupMenu *editMenu = new QPopupMenu( this ); 2260 Q3PopupMenu *editMenu = new Q3PopupMenu( this );
2251 QPopupMenu *helpMenu = new QPopupMenu( this ); 2261 Q3PopupMenu *helpMenu = new Q3PopupMenu( this );
2252 2262
2253 KToolBar* tb = mMainWindow->toolBar(); 2263 KToolBar* tb = mMainWindow->toolBar();
2254 mMainWindow->setToolBarsMovable (false ); 2264 mMainWindow->setToolBarsMovable (false );
2255#ifndef DESKTOP_VERSION 2265#ifndef DESKTOP_VERSION
2256 if ( KABPrefs::instance()->mFullMenuBarVisible ) { 2266 if ( KABPrefs::instance()->mFullMenuBarVisible ) {
2257#endif 2267#endif
2258 QMenuBar* mb = mMainWindow->menuBar(); 2268 QMenuBar* mb = mMainWindow->menuBar();
2259 2269
2260 //US setup menubar. 2270 //US setup menubar.
2261 //Disable the following block if you do not want to have a menubar. 2271 //Disable the following block if you do not want to have a menubar.
2262 mb->insertItem( i18n("&File"), fileMenu ); 2272 mb->insertItem( i18n("&File"), fileMenu );
2263 mb->insertItem( i18n("&Edit"), editMenu ); 2273 mb->insertItem( i18n("&Edit"), editMenu );
@@ -2267,25 +2277,25 @@ void KABCore::addActionsManually()
2267 mb->insertItem( i18n("Synchronize"), syncMenu ); 2277 mb->insertItem( i18n("Synchronize"), syncMenu );
2268#else 2278#else
2269 mb->insertItem( i18n("Sync"), syncMenu ); 2279 mb->insertItem( i18n("Sync"), syncMenu );
2270#endif 2280#endif
2271 //mb->insertItem( i18n("&Change"), changeMenu ); 2281 //mb->insertItem( i18n("&Change"), changeMenu );
2272 mb->insertItem( i18n("&Help"), helpMenu ); 2282 mb->insertItem( i18n("&Help"), helpMenu );
2273 mIncSearchWidget = new IncSearchWidget( tb ); 2283 mIncSearchWidget = new IncSearchWidget( tb );
2274 // tb->insertWidget(-1, 0, mIncSearchWidget); 2284 // tb->insertWidget(-1, 0, mIncSearchWidget);
2275#ifndef DESKTOP_VERSION 2285#ifndef DESKTOP_VERSION
2276 } else { 2286 } else {
2277 //US setup toolbar 2287 //US setup toolbar
2278 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 2288 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
2279 QPopupMenu *popupBarTB = new QPopupMenu( this ); 2289 Q3PopupMenu *popupBarTB = new Q3PopupMenu( this );
2280 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); 2290 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB);
2281 tb->insertWidget(-1, 0, menuBarTB); 2291 tb->insertWidget(-1, 0, menuBarTB);
2282 mIncSearchWidget = new IncSearchWidget( tb ); 2292 mIncSearchWidget = new IncSearchWidget( tb );
2283 tb->enableMoving(false); 2293 tb->enableMoving(false);
2284 popupBarTB->insertItem( i18n("&File"), fileMenu ); 2294 popupBarTB->insertItem( i18n("&File"), fileMenu );
2285 popupBarTB->insertItem( i18n("&Edit"), editMenu ); 2295 popupBarTB->insertItem( i18n("&Edit"), editMenu );
2286 popupBarTB->insertItem( i18n("&View"), viewMenu ); 2296 popupBarTB->insertItem( i18n("&View"), viewMenu );
2287 popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); 2297 popupBarTB->insertItem( i18n("&Settings"), settingsMenu );
2288 popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); 2298 popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
2289 mViewManager->getFilterAction()->plug ( popupBarTB); 2299 mViewManager->getFilterAction()->plug ( popupBarTB);
2290 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); 2300 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu );
2291 popupBarTB->insertItem( i18n("&Help"), helpMenu ); 2301 popupBarTB->insertItem( i18n("&Help"), helpMenu );
@@ -2622,25 +2632,25 @@ void KABCore::updateActionMenu()
2622void KABCore::configureKeyBindings() 2632void KABCore::configureKeyBindings()
2623{ 2633{
2624#ifndef KAB_EMBEDDED 2634#ifndef KAB_EMBEDDED
2625 KKeyDialog::configure( actionCollection(), true ); 2635 KKeyDialog::configure( actionCollection(), true );
2626#else //KAB_EMBEDDED 2636#else //KAB_EMBEDDED
2627 qDebug("KABCore::configureKeyBindings() not implemented"); 2637 qDebug("KABCore::configureKeyBindings() not implemented");
2628#endif //KAB_EMBEDDED 2638#endif //KAB_EMBEDDED
2629} 2639}
2630 2640
2631#ifdef KAB_EMBEDDED 2641#ifdef KAB_EMBEDDED
2632void KABCore::configureResources() 2642void KABCore::configureResources()
2633{ 2643{
2634 KRES::KCMKResources dlg( this, "" , 0 ); 2644 KRES::KCMKResources dlg( this, "" , QStringList() );
2635 2645
2636 if ( !dlg.exec() ) 2646 if ( !dlg.exec() )
2637 return; 2647 return;
2638 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2648 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2639} 2649}
2640#endif //KAB_EMBEDDED 2650#endif //KAB_EMBEDDED
2641 2651
2642 2652
2643/* this method will be called through the QCop interface from Ko/Pi to select addresses 2653/* this method will be called through the QCop interface from Ko/Pi to select addresses
2644 * for the attendees list of an event. 2654 * for the attendees list of an event.
2645 */ 2655 */
2646void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2656void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
@@ -2718,25 +2728,25 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString
2718 QStringList anniversaryList; 2728 QStringList anniversaryList;
2719 QStringList realNameList; 2729 QStringList realNameList;
2720 QStringList preferredEmailList; 2730 QStringList preferredEmailList;
2721 QStringList assembledNameList; 2731 QStringList assembledNameList;
2722 QStringList uidList; 2732 QStringList uidList;
2723 2733
2724 KABC::AddressBook::Iterator it; 2734 KABC::AddressBook::Iterator it;
2725 2735
2726 int count = 0; 2736 int count = 0;
2727 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2737 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2728 ++count; 2738 ++count;
2729 } 2739 }
2730 QProgressBar bar(count,0 ); 2740 Q3ProgressBar bar(count,0 );
2731 int w = 300; 2741 int w = 300;
2732 if ( QApplication::desktop()->width() < 320 ) 2742 if ( QApplication::desktop()->width() < 320 )
2733 w = 220; 2743 w = 220;
2734 int h = bar.sizeHint().height() ; 2744 int h = bar.sizeHint().height() ;
2735 int dw = QApplication::desktop()->width(); 2745 int dw = QApplication::desktop()->width();
2736 int dh = QApplication::desktop()->height(); 2746 int dh = QApplication::desktop()->height();
2737 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2747 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2738 bar.show(); 2748 bar.show();
2739 bar.setCaption (i18n("Collecting birthdays - close to abort!") ); 2749 bar.setCaption (i18n("Collecting birthdays - close to abort!") );
2740 qApp->processEvents(); 2750 qApp->processEvents();
2741 2751
2742 QDate bday; 2752 QDate bday;
@@ -2899,25 +2909,25 @@ KABC::Addressee KABCore::getLastSyncAddressee()
2899 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2909 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2900 2910
2901 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); 2911 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
2902 lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); 2912 lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice );
2903 if (lse.isEmpty()) { 2913 if (lse.isEmpty()) {
2904 qDebug("KA: Creating new last-syncAddressee "); 2914 qDebug("KA: Creating new last-syncAddressee ");
2905 lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); 2915 lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice );
2906 QString sum = ""; 2916 QString sum = "";
2907 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 2917 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
2908 sum = "E: "; 2918 sum = "E: ";
2909 lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); 2919 lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event"));
2910 lse.setRevision( mLastAddressbookSync ); 2920 lse.setRevision( mLastAddressbookSync );
2911 lse.setCategories( i18n("SyncEvent") ); 2921 lse.setCategories( QStringList(i18n("SyncEvent")) );
2912 mAddressBook->insertAddressee( lse ); 2922 mAddressBook->insertAddressee( lse );
2913 } 2923 }
2914 return lse; 2924 return lse;
2915} 2925}
2916int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) 2926int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full )
2917{ 2927{
2918 2928
2919 //void setZaurusId(int id); 2929 //void setZaurusId(int id);
2920 // int zaurusId() const; 2930 // int zaurusId() const;
2921 // void setZaurusUid(int id); 2931 // void setZaurusUid(int id);
2922 // int zaurusUid() const; 2932 // int zaurusUid() const;
2923 // void setZaurusStat(int id); 2933 // void setZaurusStat(int id);
@@ -3090,25 +3100,25 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
3090 3100
3091 } else { 3101 } else {
3092 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3102 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3093 addresseeRSync = addresseeLSync ; 3103 addresseeRSync = addresseeLSync ;
3094 } else { 3104 } else {
3095 //qDebug("FULLDATE 1"); 3105 //qDebug("FULLDATE 1");
3096 fullDateRange = true; 3106 fullDateRange = true;
3097 Addressee newAdd; 3107 Addressee newAdd;
3098 addresseeRSync = newAdd; 3108 addresseeRSync = newAdd;
3099 addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); 3109 addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee"));
3100 addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); 3110 addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName );
3101 addresseeRSync.setRevision( mLastAddressbookSync ); 3111 addresseeRSync.setRevision( mLastAddressbookSync );
3102 addresseeRSync.setCategories( i18n("SyncAddressee") ); 3112 addresseeRSync.setCategories( QStringList(i18n("SyncAddressee")) );
3103 } 3113 }
3104 } 3114 }
3105 if ( addresseeLSync.revision() == mLastAddressbookSync ) { 3115 if ( addresseeLSync.revision() == mLastAddressbookSync ) {
3106 // qDebug("FULLDATE 2"); 3116 // qDebug("FULLDATE 2");
3107 fullDateRange = true; 3117 fullDateRange = true;
3108 } 3118 }
3109 if ( ! fullDateRange ) { 3119 if ( ! fullDateRange ) {
3110 if ( addresseeLSync.revision() != addresseeRSync.revision() ) { 3120 if ( addresseeLSync.revision() != addresseeRSync.revision() ) {
3111 3121
3112 // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() ); 3122 // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() );
3113 //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec()); 3123 //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec());
3114 fullDateRange = true; 3124 fullDateRange = true;
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index ec6a9ec..4351720 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -19,29 +19,33 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KABCORE_H 24#ifndef KABCORE_H
25#define KABCORE_H 25#define KABCORE_H
26 26
27#include <kabc/field.h> 27#include <kabc/field.h>
28 28
29#ifndef KAB_EMBEDDED 29#ifndef KAB_EMBEDDED
30#endif //KAB_EMBEDDED 30#endif //KAB_EMBEDDED
31#include <qdict.h> 31#include <q3dict.h>
32#include <qtimer.h> 32#include <qtimer.h>
33 33
34#include <qwidget.h> 34#include <qwidget.h>
35#include <qpopupmenu.h> 35#include <q3popupmenu.h>
36//Added by qt3to4:
37#include <Q3CString>
38#include <QPixmap>
39#include <QResizeEvent>
36#include <ksyncmanager.h> 40#include <ksyncmanager.h>
37#ifndef DESKTOP_VERSION 41#ifndef DESKTOP_VERSION
38#include <qcopchannel_qws.h> 42#include <qcopchannel_qws.h>
39#endif 43#endif
40 44
41namespace KABC { 45namespace KABC {
42class AddressBook; 46class AddressBook;
43} 47}
44 48
45#ifndef KAB_EMBEDDED 49#ifndef KAB_EMBEDDED
46class KAboutData; 50class KAboutData;
47class KConfig; 51class KConfig;
@@ -76,27 +80,27 @@ class KABCore : public QWidget, public KSyncInterface
76{ 80{
77 Q_OBJECT 81 Q_OBJECT
78 82
79 public: 83 public:
80 KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name = 0 ); 84 KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name = 0 );
81 85
82 86
83 ~KABCore(); 87 ~KABCore();
84 88
85 89
86#ifdef KAB_EMBEDDED 90#ifdef KAB_EMBEDDED
87 //US added functionality 91 //US added functionality
88 QPopupMenu* getViewMenu() {return viewMenu;} 92 Q3PopupMenu* getViewMenu() {return viewMenu;}
89 QPopupMenu* getFilterMenu() {return filterMenu;} 93 Q3PopupMenu* getFilterMenu() {return filterMenu;}
90 QPopupMenu* getSettingsMenu() {return settingsMenu;} 94 Q3PopupMenu* getSettingsMenu() {return settingsMenu;}
91 void addActionsManually(); 95 void addActionsManually();
92#endif //KAB_EMBEDDED 96#endif //KAB_EMBEDDED
93 /** 97 /**
94 Restores the global settings. 98 Restores the global settings.
95 */ 99 */
96 void restoreSettings(); 100 void restoreSettings();
97 101
98 102
99 103
100 /** 104 /**
101 Returns a pointer to the StdAddressBook of the application. 105 Returns a pointer to the StdAddressBook of the application.
102 */ 106 */
@@ -126,26 +130,26 @@ class KABCore : public QWidget, public KSyncInterface
126 /** 130 /**
127 Displays the ResourceSelectDialog and returns the selected 131 Displays the ResourceSelectDialog and returns the selected
128 resource or a null pointer if no resource was selected by 132 resource or a null pointer if no resource was selected by
129 the user. 133 the user.
130 */ 134 */
131 KABC::Resource *requestResource( QWidget *parent ); 135 KABC::Resource *requestResource( QWidget *parent );
132 136
133#ifndef KAB_EMBEDDED 137#ifndef KAB_EMBEDDED
134 static KAboutData *createAboutData(); 138 static KAboutData *createAboutData();
135#endif //KAB_EMBEDDED 139#endif //KAB_EMBEDDED
136 140
137#ifdef KAB_EMBEDDED 141#ifdef KAB_EMBEDDED
138 inline QPopupMenu* getImportMenu() { return ImportMenu;} 142 inline Q3PopupMenu* getImportMenu() { return ImportMenu;}
139 inline QPopupMenu* getExportMenu() { return ExportMenu;} 143 inline Q3PopupMenu* getExportMenu() { return ExportMenu;}
140#endif //KAB_EMBEDDED 144#endif //KAB_EMBEDDED
141 145
142 public slots: 146 public slots:
143#ifdef KAB_EMBEDDED 147#ifdef KAB_EMBEDDED
144 void createAboutData(); 148 void createAboutData();
145#endif //KAB_EMBEDDED 149#endif //KAB_EMBEDDED
146 void setDetailsToggle(); 150 void setDetailsToggle();
147 151
148 void showLicence(); 152 void showLicence();
149 void faq(); 153 void faq();
150 void whatsnew() ; 154 void whatsnew() ;
151 void synchowto() ; 155 void synchowto() ;
@@ -357,26 +361,26 @@ class KABCore : public QWidget, public KSyncInterface
357 void loadDataAfterStart(); 361 void loadDataAfterStart();
358 void recieve(QString cmsg ); 362 void recieve(QString cmsg );
359 void getFile( bool success,const QString & ); 363 void getFile( bool success,const QString & );
360 void syncFileRequest(const QString &); 364 void syncFileRequest(const QString &);
361 void setDetailsVisible( bool visible ); 365 void setDetailsVisible( bool visible );
362 void setDetailsToState(); 366 void setDetailsToState();
363 367
364 void saveSettings(); 368 void saveSettings();
365 369
366 private slots: 370 private slots:
367 void updateToolBar(); 371 void updateToolBar();
368 void updateMainWindow(); 372 void updateMainWindow();
369 void receive( const QCString& cmsg, const QByteArray& data ); 373 void receive( const Q3CString& cmsg, const QByteArray& data );
370 void receiveStart( const QCString& cmsg, const QByteArray& data ); 374 void receiveStart( const Q3CString& cmsg, const QByteArray& data );
371 void toggleBeamReceive( ); 375 void toggleBeamReceive( );
372 void disableBR(bool); 376 void disableBR(bool);
373 void setJumpButtonBarVisible( bool visible ); 377 void setJumpButtonBarVisible( bool visible );
374 void setJumpButtonBar( bool visible ); 378 void setJumpButtonBar( bool visible );
375 void setCaptionBack(); 379 void setCaptionBack();
376 void resizeAndCallContactdialog(); 380 void resizeAndCallContactdialog();
377 void callContactdialog(); 381 void callContactdialog();
378 void doRingSync(); 382 void doRingSync();
379 383
380 void importFromOL(); 384 void importFromOL();
381 void extensionModified( const KABC::Addressee::List &list ); 385 void extensionModified( const KABC::Addressee::List &list );
382 void extensionChanged( int id ); 386 void extensionChanged( int id );
@@ -385,25 +389,25 @@ class KABCore : public QWidget, public KSyncInterface
385 void configureKeyBindings(); 389 void configureKeyBindings();
386 void removeVoice(); 390 void removeVoice();
387 void setFormattedName(); 391 void setFormattedName();
388#ifdef KAB_EMBEDDED 392#ifdef KAB_EMBEDDED
389 void configureResources(); 393 void configureResources();
390#endif //KAB_EMBEDDED 394#endif //KAB_EMBEDDED
391 395
392 void slotEditorDestroyed( const QString &uid ); 396 void slotEditorDestroyed( const QString &uid );
393 void configurationChanged(); 397 void configurationChanged();
394 void addressBookChanged(); 398 void addressBookChanged();
395 399
396 private: 400 private:
397 QCString mCStringMess; 401 Q3CString mCStringMess;
398 QByteArray mByteData; 402 QByteArray mByteData;
399 QString mEmailSourceChannel; 403 QString mEmailSourceChannel;
400 QString mEmailSourceUID; 404 QString mEmailSourceUID;
401 void resizeEvent(QResizeEvent* e ); 405 void resizeEvent(QResizeEvent* e );
402 bool mBRdisabled; 406 bool mBRdisabled;
403#ifndef DESKTOP_VERSION 407#ifndef DESKTOP_VERSION
404 QCopChannel* infrared; 408 QCopChannel* infrared;
405#endif 409#endif
406 QTimer *mMessageTimer; 410 QTimer *mMessageTimer;
407 void initGUI(); 411 void initGUI();
408 void initActions(); 412 void initActions();
409 QString getPhoneFile(); 413 QString getPhoneFile();
@@ -477,32 +481,32 @@ class KABCore : public QWidget, public KSyncInterface
477 KAction *mActionManageCategories; 481 KAction *mActionManageCategories;
478 KAction *mActionAboutKAddressbook; 482 KAction *mActionAboutKAddressbook;
479 KAction *mActionLicence; 483 KAction *mActionLicence;
480 KAction *mActionFaq; 484 KAction *mActionFaq;
481 KAction *mActionWN; 485 KAction *mActionWN;
482 KAction *mActionSyncHowto; 486 KAction *mActionSyncHowto;
483 KAction *mActionStorageHowto; 487 KAction *mActionStorageHowto;
484 KAction *mActionKdeSyncHowto; 488 KAction *mActionKdeSyncHowto;
485 KAction *mActionMultiSyncHowto; 489 KAction *mActionMultiSyncHowto;
486 490
487 KAction *mActionDeleteView; 491 KAction *mActionDeleteView;
488 492
489 QPopupMenu *viewMenu; 493 Q3PopupMenu *viewMenu;
490 QPopupMenu *filterMenu; 494 Q3PopupMenu *filterMenu;
491 QPopupMenu *settingsMenu; 495 Q3PopupMenu *settingsMenu;
492 QPopupMenu *changeMenu; 496 Q3PopupMenu *changeMenu;
493 QPopupMenu *beamMenu; 497 Q3PopupMenu *beamMenu;
494//US QAction *mActionSave; 498//US QAction *mActionSave;
495 QPopupMenu *ImportMenu; 499 Q3PopupMenu *ImportMenu;
496 QPopupMenu *ExportMenu; 500 Q3PopupMenu *ExportMenu;
497 //LR additional methods 501 //LR additional methods
498 KAction *mActionRemoveVoice; 502 KAction *mActionRemoveVoice;
499 KAction *mActionSetFormattedName; 503 KAction *mActionSetFormattedName;
500 KAction * mActionImportOL; 504 KAction * mActionImportOL;
501 505
502#ifndef KAB_EMBEDDED 506#ifndef KAB_EMBEDDED
503 KAddressBookService *mAddressBookService; 507 KAddressBookService *mAddressBookService;
504#endif //KAB_EMBEDDED 508#endif //KAB_EMBEDDED
505 509
506 class KABCorePrivate; 510 class KABCorePrivate;
507 KABCorePrivate *d; 511 KABCorePrivate *d;
508 //US bool mBlockSaveFlag; 512 //US bool mBlockSaveFlag;
@@ -515,25 +519,25 @@ class KABCore : public QWidget, public KSyncInterface
515 virtual bool sync(KSyncManager* manager, QString filename, int mode,QString resource); 519 virtual bool sync(KSyncManager* manager, QString filename, int mode,QString resource);
516 virtual bool syncExternal(KSyncManager* manager, QString resource); 520 virtual bool syncExternal(KSyncManager* manager, QString resource);
517 virtual void removeSyncInfo( QString syncProfile); 521 virtual void removeSyncInfo( QString syncProfile);
518 bool readOLdata( KABC::AddressBook* local ); 522 bool readOLdata( KABC::AddressBook* local );
519 bool writeOLdata( KABC::AddressBook* local ); 523 bool writeOLdata( KABC::AddressBook* local );
520 bool syncOL(); 524 bool syncOL();
521 bool syncPhone(); 525 bool syncPhone();
522 void message( QString m , bool startTimer = true); 526 void message( QString m , bool startTimer = true);
523 527
524 // LR ******************************* 528 // LR *******************************
525 // sync stuff! 529 // sync stuff!
526 QString sentSyncFile(); 530 QString sentSyncFile();
527 QPopupMenu *syncMenu; 531 Q3PopupMenu *syncMenu;
528 KSyncManager* syncManager; 532 KSyncManager* syncManager;
529 int mGlobalSyncMode; 533 int mGlobalSyncMode;
530 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); 534 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode);
531 KABC::Addressee getLastSyncAddressee(); 535 KABC::Addressee getLastSyncAddressee();
532 QDateTime mLastAddressbookSync; 536 QDateTime mLastAddressbookSync;
533 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); 537 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full );
534 // ********************* 538 // *********************
535 //OL sync stuff 539 //OL sync stuff
536 QString mOLsyncFolderID; 540 QString mOLsyncFolderID;
537 541
538}; 542};
539 543
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 42d541b..6f9c995 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -16,25 +16,25 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24//US#ifdef KAB_EMBEDDED 24//US#ifdef KAB_EMBEDDED
25//#include <qstring.h> 25//#include <qstring.h>
26//#endif //KAB_EMBEDDED 26//#endif //KAB_EMBEDDED
27 27
28#include <qtextstream.h> 28#include <q3textstream.h>
29#include <qfile.h> 29#include <qfile.h>
30#include <qregexp.h> 30#include <qregexp.h>
31#include <stdlib.h> 31#include <stdlib.h>
32#include <libkdepim/kpimglobalprefs.h> 32#include <libkdepim/kpimglobalprefs.h>
33 33
34#include <kconfig.h> 34#include <kconfig.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kstaticdeleter.h> 36#include <kstaticdeleter.h>
37#include <kglobalsettings.h> 37#include <kglobalsettings.h>
38//US#include <kdebug.h> // defines kdDebug() 38//US#include <kdebug.h> // defines kdDebug()
39 39
40#include "kabprefs.h" 40#include "kabprefs.h"
@@ -82,25 +82,25 @@ KABPrefs::KABPrefs()
82 82
83 83
84 KPrefs::setCurrentGroup( "Extensions_General" ); 84 KPrefs::setCurrentGroup( "Extensions_General" );
85 QStringList defaultExtensions; 85 QStringList defaultExtensions;
86 defaultExtensions << "merge"; 86 defaultExtensions << "merge";
87 defaultExtensions << "distribution_list_editor"; 87 defaultExtensions << "distribution_list_editor";
88 addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); 88 addItemInt( "CurrentExtension", &mCurrentExtension, 0 );
89 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); 89 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions );
90 90
91 KPrefs::setCurrentGroup( "Views" ); 91 KPrefs::setCurrentGroup( "Views" );
92 QString defaultView = i18n( "Default Table View" ); 92 QString defaultView = i18n( "Default Table View" );
93 addItemString( "CurrentView", &mCurrentView, defaultView ); 93 addItemString( "CurrentView", &mCurrentView, defaultView );
94 addItemStringList( "ViewNames", &mViewNames, defaultView ); 94 addItemStringList( "ViewNames", &mViewNames, QStringList(defaultView) );
95 95
96 KPrefs::setCurrentGroup( "Filters" ); 96 KPrefs::setCurrentGroup( "Filters" );
97 addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); 97 addItemInt( "CurrentFilter", &mCurrentFilter, 0 );
98 98
99} 99}
100 100
101KABPrefs::~KABPrefs() 101KABPrefs::~KABPrefs()
102{ 102{
103 //qDebug("KABPrefs::~KABPrefs() "); 103 //qDebug("KABPrefs::~KABPrefs() ");
104 if (sInstance == this) 104 if (sInstance == this)
105 sInstance = staticDeleterAB.setObject(0); 105 sInstance = staticDeleterAB.setObject(0);
106} 106}
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index ddbc0c0..aff725e 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -16,25 +16,27 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KABPREFS_H 24#ifndef KABPREFS_H
25#define KABPREFS_H 25#define KABPREFS_H
26 26
27#include <qstringlist.h> 27#include <qstringlist.h>
28#include <qdict.h> 28#include <q3dict.h>
29//Added by qt3to4:
30#include <Q3ValueList>
29 31
30#include <libkdepim/kpimprefs.h> 32#include <libkdepim/kpimprefs.h>
31 33
32class KConfig; 34class KConfig;
33 35
34class KABPrefs : public KPimPrefs 36class KABPrefs : public KPimPrefs
35{ 37{
36 public: 38 public:
37 virtual ~KABPrefs(); 39 virtual ~KABPrefs();
38 40
39 static KABPrefs *instance(); 41 static KABPrefs *instance();
40 42
@@ -64,26 +66,26 @@ class KABPrefs : public KPimPrefs
64 void usrReadConfig(); 66 void usrReadConfig();
65 67
66 68
67 // GUI 69 // GUI
68 bool mFullMenuBarVisible; 70 bool mFullMenuBarVisible;
69 bool mJumpButtonBarVisible; 71 bool mJumpButtonBarVisible;
70 bool mDetailsPageVisible; 72 bool mDetailsPageVisible;
71 bool mMultipleViewsAtOnce; 73 bool mMultipleViewsAtOnce;
72 bool mSearchWithReturn; 74 bool mSearchWithReturn;
73 bool mAutoSearchWithWildcard; 75 bool mAutoSearchWithWildcard;
74 bool mHideSearchOnSwitch; 76 bool mHideSearchOnSwitch;
75 bool mAskForDelete; 77 bool mAskForDelete;
76 QValueList<int> mExtensionsSplitter; 78 Q3ValueList<int> mExtensionsSplitter;
77 QValueList<int> mDetailsSplitter; 79 Q3ValueList<int> mDetailsSplitter;
78 80
79 // Extensions stuff 81 // Extensions stuff
80 int mCurrentExtension; 82 int mCurrentExtension;
81 QStringList mActiveExtensions; 83 QStringList mActiveExtensions;
82 84
83 // Views stuff 85 // Views stuff
84 QString mCurrentView; 86 QString mCurrentView;
85 QStringList mViewNames; 87 QStringList mViewNames;
86 88
87 // Filter 89 // Filter
88 int mCurrentFilter; 90 int mCurrentFilter;
89 91
diff --git a/kaddressbook/kaddressbook.pro b/kaddressbook/kaddressbook.pro
index cd38e5f..4eb1f7f 100644
--- a/kaddressbook/kaddressbook.pro
+++ b/kaddressbook/kaddressbook.pro
@@ -4,58 +4,58 @@ TARGET = kapi
4DESTDIR= ../bin 4DESTDIR= ../bin
5 5
6include( ../variables.pri ) 6include( ../variables.pri )
7 7
8 8
9INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../ interfaces 9INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../ interfaces
10DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION 10DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION
11 11
12unix : { 12unix : {
13 13
14staticlib: { 14staticlib: {
15 TARGET = kapi_linux 15 TARGET = kapi_linux
16LIBS += ../bin/libmicrokabc_qtopia.a 16LIBS += ../bin/libxmicrokabc_qtopia.a
17LIBS += ../bin/libmicrokabc_file.a 17LIBS += ../bin/libxmicrokabc_file.a
18LIBS += ../bin/libmicrokabc_dir.a 18LIBS += ../bin/libxmicrokabc_dir.a
19LIBS += ../bin/libmicrokdepim.a 19LIBS += ../bin/libxmicrokdepim.a
20LIBS += ../bin/libmicrokcal.a 20LIBS += ../bin/libxmicrokcal.a
21LIBS += ../bin/libmicrokabc.a 21LIBS += ../bin/libxmicrokabc.a
22LIBS += ../bin/libmicrokde.a 22LIBS += ../bin/libxmicrokde.a
23LIBS += ../bin/libmicrokabc_qtopia.a 23LIBS += ../bin/libxmicrokabc_qtopia.a
24LIBS += ../bin/libmicrokabc_file.a 24LIBS += ../bin/libxmicrokabc_file.a
25LIBS += ../bin/libmicrokabc_dir.a 25LIBS += ../bin/libxmicrokabc_dir.a
26LIBS += ../bin/libmicrokdepim.a 26LIBS += ../bin/libxmicrokdepim.a
27LIBS += ../bin/libmicrokcal.a 27LIBS += ../bin/libxmicrokcal.a
28LIBS += ../bin/libmicrokabc.a 28LIBS += ../bin/libxmicrokabc.a
29LIBS += ../bin/libmicrokde.a 29LIBS += ../bin/libxmicrokde.a
30LIBS += ../libical/lib/libical.a 30LIBS += ../libical/lib/libical.a
31LIBS += ../libical/lib/libicalss.a 31LIBS += ../libical/lib/libicalss.a
32 32
33} else { 33} else {
34LIBS += ../bin/libmicrokdepim.so 34LIBS += ../bin/libxmicrokdepim.so
35LIBS += ../bin/libmicrokde.so 35LIBS += ../bin/libxmicrokde.so
36LIBS += ../bin/libmicrokabc.so 36LIBS += ../bin/libxmicrokabc.so
37LIBS += ../bin/libmicrokcal.so 37LIBS += ../bin/libxmicrokcal.so
38#LIBS += -lldap 38#LIBS += -lldap
39} 39}
40OBJECTS_DIR = obj/unix 40OBJECTS_DIR = obj/unix
41MOC_DIR = moc/unix 41MOC_DIR = moc/unix
42} 42}
43win32: { 43win32: {
44RC_FILE = winicons.rc 44RC_FILE = winicons.rc
45DEFINES += _WIN32_ 45DEFINES += _WIN32_
46LIBS += ../bin/microkdepim.lib 46LIBS += ../bin/xmicrokdepim.lib
47LIBS += ../bin/microkcal.lib 47LIBS += ../bin/xmicrokcal.lib
48LIBS += ../bin/microkde.lib 48LIBS += ../bin/xmicrokde.lib
49LIBS += ../bin/microkabc.lib 49LIBS += ../bin/xmicrokabc.lib
50QMAKE_LINK += /NODEFAULTLIB:LIBC 50QMAKE_LINK += /NODEFAULTLIB:LIBC
51OBJECTS_DIR = obj/win 51OBJECTS_DIR = obj/win
52MOC_DIR = moc/win 52MOC_DIR = moc/win
53#olimport section 53#olimport section
54importol { 54importol {
55debug: { 55debug: {
56LIBS += mfc71ud.lib 56LIBS += mfc71ud.lib
57} 57}
58release: { 58release: {
59LIBS += mfc71u.lib 59LIBS += mfc71u.lib
60} 60}
61DEFINES += _OL_IMPORT_ 61DEFINES += _OL_IMPORT_
@@ -195,12 +195,14 @@ views/colorlistbox.cpp \
195xxport/vcard_xxport.cpp \ 195xxport/vcard_xxport.cpp \
196xxport/kde2_xxport.cpp \ 196xxport/kde2_xxport.cpp \
197xxport/csv_xxport.cpp \ 197xxport/csv_xxport.cpp \
198xxport/csvimportdialog.cpp \ 198xxport/csvimportdialog.cpp \
199xxport/opie_xxport.cpp \ 199xxport/opie_xxport.cpp \
200xxport/qtopia_xxport.cpp \ 200xxport/qtopia_xxport.cpp \
201xxport/sharpdtm_xxport.cpp \ 201xxport/sharpdtm_xxport.cpp \
202#details/look_details.cpp \ 202#details/look_details.cpp \
203#mainwindow.cpp \ 203#mainwindow.cpp \
204# calendarview.cpp \ 204# calendarview.cpp \
205# timespanview.cpp 205# timespanview.cpp
206 206
207#The following line was inserted by qt3to4
208QT += xml qt3support
diff --git a/kaddressbook/kaddressbookE.pro b/kaddressbook/kaddressbookE.pro
index 64e3a4a..c4b2499 100644
--- a/kaddressbook/kaddressbookE.pro
+++ b/kaddressbook/kaddressbookE.pro
@@ -3,28 +3,28 @@ CONFIG += qt warn_on
3 3
4 4
5 TARGET = kapi 5 TARGET = kapi
6OBJECTS_DIR = obj/$(PLATFORM) 6OBJECTS_DIR = obj/$(PLATFORM)
7MOC_DIR = moc/$(PLATFORM) 7MOC_DIR = moc/$(PLATFORM)
8DESTDIR=$(QPEDIR)/bin 8DESTDIR=$(QPEDIR)/bin
9 9
10INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include 10INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include
11DEFINES += KAB_EMBEDDED KAB_NOSPLITTER 11DEFINES += KAB_EMBEDDED KAB_NOSPLITTER
12#DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL 12#DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL
13#DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER 13#DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER
14#DEFINES += KORG_NOLVALTERNATION 14#DEFINES += KORG_NOLVALTERNATION
15LIBS += -lmicrokdepim 15LIBS += -lxmicrokdepim
16LIBS += -lmicrokde 16LIBS += -lxmicrokde
17LIBS += -lmicroqtcompat 17LIBS += -lmicroqtcompat
18LIBS += -lmicrokabc 18LIBS += -lxmicrokabc
19LIBS += -lqpe 19LIBS += -lqpe
20LIBS += -ljpeg 20LIBS += -ljpeg
21LIBS += $(QTOPIALIB) 21LIBS += $(QTOPIALIB)
22LIBS += -L$(QPEDIR)/lib 22LIBS += -L$(QPEDIR)/lib
23LIBS += -Wl,-export-dynamic 23LIBS += -Wl,-export-dynamic
24LIBS += $(GCC3EXTRALIB1) 24LIBS += $(GCC3EXTRALIB1)
25LIBS += $(GCC3EXTRALIB2) 25LIBS += $(GCC3EXTRALIB2)
26 26
27INTERFACES = \ 27INTERFACES = \
28# filteredit_base.ui \ 28# filteredit_base.ui \
29# kofilterview_base.ui \ 29# kofilterview_base.ui \
30 30
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp
index c417226..b317974 100644
--- a/kaddressbook/kaddressbookmain.cpp
+++ b/kaddressbook/kaddressbookmain.cpp
@@ -16,53 +16,56 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifdef KAB_EMBEDDED 24#ifdef KAB_EMBEDDED
25#include "kabprefs.h" 25#include "kabprefs.h"
26#include <kglobal.h> 26#include <kglobal.h>
27#include <qmessagebox.h> 27#include <qmessagebox.h>
28#include <qtoolbar.h> 28#include <q3toolbar.h>
29#include <qapplication.h> 29#include <qapplication.h>
30//Added by qt3to4:
31#include <Q3CString>
32#include <QCloseEvent>
30#else //KAB_EMBEDDED 33#else //KAB_EMBEDDED
31#include <kedittoolbar.h> 34#include <kedittoolbar.h>
32#include <kkeydialog.h> 35#include <kkeydialog.h>
33#include <kmessagebox.h> 36#include <kmessagebox.h>
34#include <kstatusbar.h> 37#include <kstatusbar.h>
35#endif //KAB_EMBEDDED 38#endif //KAB_EMBEDDED
36#include <klocale.h> 39#include <klocale.h>
37 40
38#include "kabcore.h" 41#include "kabcore.h"
39#include "kaddressbookmain.h" 42#include "kaddressbookmain.h"
40#include "kactioncollection.h" 43#include "kactioncollection.h"
41 44
42#ifdef KAB_EMBEDDED 45#ifdef KAB_EMBEDDED
43KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" ) 46KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" )
44#else //KAB_EMBEDDED 47#else //KAB_EMBEDDED
45//MOC_SKIP_BEGIN 48#ifndef Q_MOC_RUN
46KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 ) 49KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 )
47//MOC_SKIP_END 50#endif
48#endif //KAB_EMBEDDED 51#endif //KAB_EMBEDDED
49{ 52{
50 setIcon(SmallIcon( "ka24" ) ); 53 setIcon(SmallIcon( "ka24" ) );
51#if 0 54#if 0
52 //US for embedded systems, create the toolbar before we initiate KABCore. 55 //US for embedded systems, create the toolbar before we initiate KABCore.
53 // KABCore will fill the toolbar with menues and icons 56 // KABCore will fill the toolbar with menues and icons
54 QMainWindow::ToolBarDock tbd; 57 Qt::ToolBarDock tbd;
55 tbd = Top; 58 tbd = Qt::DockTop;
56 iconToolBar = new QToolBar( this ); 59 iconToolBar = new Q3ToolBar( this );
57 addToolBar (iconToolBar , tbd ); 60 addToolBar (iconToolBar , tbd );
58 iconToolBar->setHorizontalStretchable(true); 61 iconToolBar->setHorizontalStretchable(true);
59//US iconToolBar->setWidth(300); 62//US iconToolBar->setWidth(300);
60#endif // 0 63#endif // 0
61 64
62 mCore = new KABCore( this, true, this ); 65 mCore = new KABCore( this, true, this );
63 66
64#ifdef KAB_EMBEDDED 67#ifdef KAB_EMBEDDED
65 setCaption( i18n( "KAddressbook/Pi" ) ); 68 setCaption( i18n( "KAddressbook/Pi" ) );
66#else //KAB_EMBEDDED 69#else //KAB_EMBEDDED
67 setCaption( i18n( "Address Book Browser" ) ); 70 setCaption( i18n( "Address Book Browser" ) );
68#endif //KAB_EMBEDDED 71#endif //KAB_EMBEDDED
@@ -76,25 +79,25 @@ KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainW
76//US statusBar()->show(); 79//US statusBar()->show();
77 80
78#ifndef KAB_EMBEDDED 81#ifndef KAB_EMBEDDED
79 setStandardToolBarMenuEnabled(true); 82 setStandardToolBarMenuEnabled(true);
80 83
81 createGUI( "kaddressbookui.rc", false ); 84 createGUI( "kaddressbookui.rc", false );
82 85
83 86
84#endif //KAB_EMBEDDED 87#endif //KAB_EMBEDDED
85 setAutoSaveSettings(); 88 setAutoSaveSettings();
86 mCore->restoreSettings(); 89 mCore->restoreSettings();
87#ifndef DESKTOP_VERSION 90#ifndef DESKTOP_VERSION
88 QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), mCore, SLOT (receiveStart ( const QCString &, const QByteArray & ))); 91 QObject::connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), mCore, SLOT (receiveStart ( const Q3CString &, const QByteArray & )));
89#endif 92#endif
90} 93}
91 94
92KAddressBookMain::~KAddressBookMain() 95KAddressBookMain::~KAddressBookMain()
93{ 96{
94 // mCore->saveSettings(); 97 // mCore->saveSettings();
95} 98}
96 99
97void KAddressBookMain::showMinimized () 100void KAddressBookMain::showMinimized ()
98{ 101{
99 QWidget::showMinimized () ; 102 QWidget::showMinimized () ;
100} 103}
@@ -226,16 +229,15 @@ void KAddressBookMain::closeEvent( QCloseEvent* ce )
226 return; 229 return;
227 230
228 if (mModified == true) 231 if (mModified == true)
229 { 232 {
230 save(); 233 save();
231 mCore->saveSettings(); 234 mCore->saveSettings();
232 //KABPrefs::instance()->writeConfig(); 235 //KABPrefs::instance()->writeConfig();
233 } 236 }
234 237
235 ce->accept(); 238 ce->accept();
236} 239}
237 240
238#ifndef KAB_EMBEDDED 241#ifndef KAB_EMBEDDED_
239#include "kaddressbookmain.moc" 242#include "moc_kaddressbookmain.cpp"
240#endif //KAB_EMBEDDED 243#endif //KAB_EMBEDDED
241
diff --git a/kaddressbook/kaddressbookmain.h b/kaddressbook/kaddressbookmain.h
index b6d9b4b..d3f5cc7 100644
--- a/kaddressbook/kaddressbookmain.h
+++ b/kaddressbook/kaddressbookmain.h
@@ -15,76 +15,78 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KADDRESSBOOKMAIN_H 24#ifndef KADDRESSBOOKMAIN_H
25#define KADDRESSBOOKMAIN_H 25#define KADDRESSBOOKMAIN_H
26 26
27#include <qptrlist.h> 27#include <q3ptrlist.h>
28//Added by qt3to4:
29#include <QCloseEvent>
28 30
29#ifdef KAB_EMBEDDED 31#ifdef KAB_EMBEDDED
30class QToolBar; 32class Q3ToolBar;
31#include <qaction.h> 33#include <qaction.h>
32//#include <qmainwindow.h> 34//#include <qmainwindow.h>
33#include <kmainwindow.h> 35#include <kmainwindow.h>
34#else //KAB_EMBEDDED 36#else //KAB_EMBEDDED
35#include <kaction.h> 37#include <kaction.h>
36#include <kapplication.h> 38#include <kapplication.h>
37#include <kmainwindow.h> 39#include <kmainwindow.h>
38#include "kaddressbookiface.h" 40#include "kaddressbookiface.h"
39#endif //KAB_EMBEDDED 41#endif //KAB_EMBEDDED
40 42
41class KABCore; 43class KABCore;
42class KConfig; 44class KConfig;
43 45
44/** 46/**
45 This class serves as the main window for KAddressBook. It handles the 47 This class serves as the main window for KAddressBook. It handles the
46 menus, toolbars, and status bars. 48 menus, toolbars, and status bars.
47 49
48 @short Main window class 50 @short Main window class
49 @author Don Sanders <dsanders@kde.org> 51 @author Don Sanders <dsanders@kde.org>
50 @version 0.1 52 @version 0.1
51 */ 53 */
52#ifdef KAB_EMBEDDED 54#ifdef KAB_EMBEDDED
53class KAddressBookMain : public KMainWindow 55class KAddressBookMain : public KMainWindow
54#else //KAB_EMBEDDED 56#else //KAB_EMBEDDED
55//MOC_SKIP_BEGIN 57#ifndef Q_MOC_RUN
56class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface 58class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface
57//MOC_SKIP_END 59#endif
58#endif //KAB_EMBEDDED 60#endif //KAB_EMBEDDED
59{ 61{
60 Q_OBJECT 62 Q_OBJECT
61 63
62 public: 64 public:
63 KAddressBookMain(); 65 KAddressBookMain();
64 virtual ~KAddressBookMain(); 66 virtual ~KAddressBookMain();
65 67
66#ifdef KAB_EMBEDDED 68#ifdef KAB_EMBEDDED
67// QPEToolBar * getIconToolBar(); 69// QPEToolBar * getIconToolBar();
68 // QToolBar * getIconToolBar(); 70 // QToolBar * getIconToolBar();
69#endif //KAB_EMBEDDED 71#endif //KAB_EMBEDDED
70 72
71 73
72 public slots: 74 public slots:
73 void showMinimized () ; 75 void showMinimized () ;
74 virtual void addEmail( QString addr ); 76 virtual void addEmail( QString addr );
75#ifndef KAB_EMBEDDED 77#ifndef KAB_EMBEDDED
76//MOC_SKIP_BEGIN 78#ifndef Q_MOC_RUN
77 virtual ASYNC showContactEditor( QString uid ); 79 virtual ASYNC showContactEditor( QString uid );
78//MOC_SKIP_END 80#endif
79#endif //KAB_EMBEDDED 81#endif //KAB_EMBEDDED
80 virtual void newContact(); 82 virtual void newContact();
81 virtual QString getNameByPhone( QString phone ); 83 virtual QString getNameByPhone( QString phone );
82 virtual void save(); 84 virtual void save();
83 virtual void exit(); 85 virtual void exit();
84 protected: 86 protected:
85 void initActions(); 87 void initActions();
86#ifdef KAB_EMBEDDED 88#ifdef KAB_EMBEDDED
87 //US new method to setup menues and toolbars on embedded systems 89 //US new method to setup menues and toolbars on embedded systems
88 void createGUI(); 90 void createGUI();
89#endif //KAB_EMBEDDED 91#endif //KAB_EMBEDDED
90 92
diff --git a/kaddressbook/kaddressbookview.cpp b/kaddressbook/kaddressbookview.cpp
index 86898e2..4823b37 100644
--- a/kaddressbook/kaddressbookview.cpp
+++ b/kaddressbook/kaddressbookview.cpp
@@ -23,24 +23,26 @@
23 23
24#ifndef KAB_EMBEDDED 24#ifndef KAB_EMBEDDED
25#include <qapplication.h> 25#include <qapplication.h>
26 26
27#include <kabc/distributionlistdialog.h> 27#include <kabc/distributionlistdialog.h>
28#include <kconfig.h> 28#include <kconfig.h>
29#include <klocale.h> 29#include <klocale.h>
30 30
31#include "viewmanager.h" 31#include "viewmanager.h"
32 32
33#endif //KAB_EMBEDDED 33#endif //KAB_EMBEDDED
34#include <qlayout.h> 34#include <qlayout.h>
35//Added by qt3to4:
36#include <Q3VBoxLayout>
35 37
36#include <kabc/distributionlistdialog.h> 38#include <kabc/distributionlistdialog.h>
37#include <kabc/addressbook.h> 39#include <kabc/addressbook.h>
38#include <kdebug.h> 40#include <kdebug.h>
39 41
40#include "kaddressbookview.h" 42#include "kaddressbookview.h"
41 43
42KAddressBookView::KAddressBookView( KABC::AddressBook *ab, QWidget *parent, 44KAddressBookView::KAddressBookView( KABC::AddressBook *ab, QWidget *parent,
43 const char *name ) 45 const char *name )
44 : QWidget( parent, name ), mAddressBook( ab ), mFieldList() 46 : QWidget( parent, name ), mAddressBook( ab ), mFieldList()
45{ 47{
46 48
@@ -124,25 +126,25 @@ KABC::Addressee::List KAddressBookView::addressees()
124 KABC::AddressBook::Iterator it; 126 KABC::AddressBook::Iterator it;
125 for (it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 127 for (it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
126 if ( mFilter.filterAddressee( *it ) ) 128 if ( mFilter.filterAddressee( *it ) )
127 addresseeList.append( *it ); 129 addresseeList.append( *it );
128 } 130 }
129 131
130 return addresseeList; 132 return addresseeList;
131} 133}
132 134
133void KAddressBookView::initGUI() 135void KAddressBookView::initGUI()
134{ 136{
135 // Create the layout 137 // Create the layout
136 QVBoxLayout *layout = new QVBoxLayout( this ); 138 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
137 139
138 // Add the view widget 140 // Add the view widget
139 mViewWidget = new QWidget( this ); 141 mViewWidget = new QWidget( this );
140 layout->addWidget( mViewWidget ); 142 layout->addWidget( mViewWidget );
141} 143}
142 144
143KABC::Field::List KAddressBookView::fields() const 145KABC::Field::List KAddressBookView::fields() const
144{ 146{
145 return mFieldList; 147 return mFieldList;
146} 148}
147KABC::Field::List KAddressBookView::allFields() const 149KABC::Field::List KAddressBookView::allFields() const
148{ 150{
@@ -174,15 +176,15 @@ QWidget *KAddressBookView::viewWidget()
174 return mViewWidget; 176 return mViewWidget;
175} 177}
176 178
177ViewConfigureWidget *ViewFactory::configureWidget( KABC::AddressBook *ab, 179ViewConfigureWidget *ViewFactory::configureWidget( KABC::AddressBook *ab,
178 QWidget *parent, 180 QWidget *parent,
179 const char *name ) 181 const char *name )
180{ 182{
181 return new ViewConfigureWidget( ab, parent, name ); 183 return new ViewConfigureWidget( ab, parent, name );
182} 184}
183 185
184 186
185 187
186#ifndef KAB_EMBEDDED 188#ifndef KAB_EMBEDDED_
187#include "kaddressbookview.moc" 189#include "moc_kaddressbookview.cpp"
188#endif //KAB_EMBEDDED 190#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kaddressbookview.h b/kaddressbook/kaddressbookview.h
index 3a3f71a..e423cd7 100644
--- a/kaddressbook/kaddressbookview.h
+++ b/kaddressbook/kaddressbookview.h
@@ -1,12 +1,14 @@
1//Added by qt3to4:
2#include <QDropEvent>
1/* 3/*
2 This file is part of KAddressBook. 4 This file is part of KAddressBook.
3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 5 Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
4 6
5 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 9 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 10 (at your option) any later version.
9 11
10 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -31,25 +33,25 @@
31class KConfig; 33class KConfig;
32class QDropEvent; 34class QDropEvent;
33 35
34#include <qstringlist.h> 36#include <qstringlist.h>
35#include <kabc/field.h> 37#include <kabc/field.h>
36#include <qwidget.h> 38#include <qwidget.h>
37#include <qregexp.h> 39#include <qregexp.h>
38 40
39#include "viewconfigurewidget.h" 41#include "viewconfigurewidget.h"
40#include "filter.h" 42#include "filter.h"
41 43
42#ifdef DESKTOP_VERSION 44#ifdef DESKTOP_VERSION
43#include <qpaintdevicemetrics.h> 45#include <q3paintdevicemetrics.h>
44#include <qprinter.h> 46#include <qprinter.h>
45#include <qpainter.h> 47#include <qpainter.h>
46#endif 48#endif
47 49
48namespace KABC { class AddressBook; } 50namespace KABC { class AddressBook; }
49 51
50/** 52/**
51 Base class for all views in kaddressbook. This class implements 53 Base class for all views in kaddressbook. This class implements
52 all the common methods needed to provide a view to the user. 54 all the common methods needed to provide a view to the user.
53 55
54 To implement a specific view (table, card, etc), just inherit from 56 To implement a specific view (table, card, etc), just inherit from
55 this class and implement all the pure virtuals. 57 this class and implement all the pure virtuals.
@@ -166,27 +168,27 @@ class KAddressBookView : public QWidget
166 in the document are visible. If <i>uid</i> is valid, only the 168 in the document are visible. If <i>uid</i> is valid, only the
167 addressee with uid needs to be refreshed. This is an optimization 169 addressee with uid needs to be refreshed. This is an optimization
168 only. 170 only.
169 */ 171 */
170 virtual void refresh( QString uid = QString::null ) = 0; 172 virtual void refresh( QString uid = QString::null ) = 0;
171 173
172 /** 174 /**
173 This method must be overloaded in subclasses. Select (highlight) 175 This method must be overloaded in subclasses. Select (highlight)
174 the addressee matching <i>uid</i>. If uid 176 the addressee matching <i>uid</i>. If uid
175 is equal to QString::null, then all addressees should be selected. 177 is equal to QString::null, then all addressees should be selected.
176 */ 178 */
177#ifndef KAB_EMBEDDED 179#ifndef KAB_EMBEDDED
178//MOC_SKIP_BEGIN 180#ifndef Q_MOC_RUN
179 virtual void setSelected( QString uid = QString::null, bool selected = true ) = 0; 181 virtual void setSelected( QString uid = QString::null, bool selected = true ) = 0;
180//MOC_SKIP_END 182#endif
181#else //KAB_EMBEDDED 183#else //KAB_EMBEDDED
182 //US my moc can not handle the default parameters. Is this a problem ??? 184 //US my moc can not handle the default parameters. Is this a problem ???
183 virtual void setSelected( QString uid, bool selected) = 0; 185 virtual void setSelected( QString uid, bool selected) = 0;
184#endif //KAB_EMBEDDED 186#endif //KAB_EMBEDDED
185 187
186 signals: 188 signals:
187 189
188 void printView(); 190 void printView();
189 /** 191 /**
190 This signal should be emitted by a subclass whenever an addressee 192 This signal should be emitted by a subclass whenever an addressee
191 is modified. 193 is modified.
192 */ 194 */
@@ -253,27 +255,27 @@ class KAddressBookView : public QWidget
253 void initGUI(); 255 void initGUI();
254 256
255 DefaultFilterType mDefaultFilterType; 257 DefaultFilterType mDefaultFilterType;
256 Filter mFilter; 258 Filter mFilter;
257 QString mDefaultFilterName; 259 QString mDefaultFilterName;
258 KABC::AddressBook *mAddressBook; 260 KABC::AddressBook *mAddressBook;
259 KABC::Field::List mFieldList; 261 KABC::Field::List mFieldList;
260 262
261 QWidget *mViewWidget; 263 QWidget *mViewWidget;
262}; 264};
263 265
264#ifndef KAB_EMBEDDED 266#ifndef KAB_EMBEDDED
265//MOC_SKIP_BEGIN 267#ifndef Q_MOC_RUN
266class ViewFactory : public KLibFactory 268class ViewFactory : public KLibFactory
267//MOC_SKIP_END 269#endif
268#else //KAB_EMBEDDED 270#else //KAB_EMBEDDED
269class ViewFactory 271class ViewFactory
270#endif //KAB_EMBEDDED 272#endif //KAB_EMBEDDED
271{ 273{
272 274
273 public: 275 public:
274 virtual KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, 276 virtual KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent,
275 const char *name = 0 ) = 0; 277 const char *name = 0 ) = 0;
276 278
277 /** 279 /**
278 @return The type of the view. This is normally a small one word 280 @return The type of the view. This is normally a small one word
279 string (ie: Table, Icon, Tree, etc). 281 string (ie: Table, Icon, Tree, etc).
diff --git a/kaddressbook/kcmconfigs/addresseewidget.cpp b/kaddressbook/kcmconfigs/addresseewidget.cpp
index 168d39e..8055085 100644
--- a/kaddressbook/kcmconfigs/addresseewidget.cpp
+++ b/kaddressbook/kcmconfigs/addresseewidget.cpp
@@ -12,102 +12,106 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qgroupbox.h> 24#include <q3groupbox.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlistbox.h> 27#include <q3listbox.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qapplication.h> 29#include <qapplication.h>
30#include <QDesktopWidget>
31//Added by qt3to4:
32#include <Q3GridLayout>
33#include <Q3HBoxLayout>
30 34
31#include <kbuttonbox.h> 35#include <kbuttonbox.h>
32#include <kcombobox.h> 36#include <kcombobox.h>
33#include <kconfig.h> 37#include <kconfig.h>
34#include <kdialog.h> 38#include <kdialog.h>
35#include <klocale.h> 39#include <klocale.h>
36#include <kglobal.h> 40#include <kglobal.h>
37#include <klineedit.h> 41#include <klineedit.h>
38#include <kstandarddirs.h> 42#include <kstandarddirs.h>
39 43
40#include "addresseewidget.h" 44#include "addresseewidget.h"
41 45
42NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, 46NamePartWidget::NamePartWidget( const QString &title, QWidget *parent,
43 const char *name ) 47 const char *name )
44 : QWidget( parent, name ) 48 : QWidget( parent, name )
45{ 49{
46 if (KGlobal::getOrientation() == KGlobal::Portrait) 50 if (KGlobal::getOrientation() == KGlobal::Portrait)
47 { 51 {
48 QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(), 52 Q3GridLayout* layout = new Q3GridLayout( this, 1, 1, KDialog::marginHintSmall(),
49 KDialog::spacingHintSmall() ); 53 KDialog::spacingHintSmall() );
50 54
51 QLabel *label = new QLabel( i18n( title ), this ); 55 QLabel *label = new QLabel( i18n( title ), this );
52 layout->addWidget( label, 0, 1 ); 56 layout->addWidget( label, 0, 1 );
53 57
54 mBox = new QListBox( this ); 58 mBox = new Q3ListBox( this );
55 mBox->setMaximumSize(70, 70); 59 mBox->setMaximumSize(70, 70);
56 layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); 60 layout->addMultiCellWidget( mBox, 0, 1, 0, 0 );
57 61
58 KButtonBox *bbox = new KButtonBox( this, Qt::Vertical ); 62 KButtonBox *bbox = new KButtonBox( this, Qt::Vertical );
59 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); 63 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) );
60 mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) ); 64 mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) );
61 bbox->layout(); 65 bbox->layout();
62 layout->addMultiCellWidget( bbox, 0, 1, 2,2); 66 layout->addMultiCellWidget( bbox, 0, 1, 2,2);
63 67
64 mEdit = new KLineEdit( this ); 68 mEdit = new KLineEdit( this );
65 layout->addWidget( mEdit, 1, 1 ); 69 layout->addWidget( mEdit, 1, 1 );
66 //mEdit->setMinimumWidth(50); 70 //mEdit->setMinimumWidth(50);
67 71
68// layout->addWidget( group ); 72// layout->addWidget( group );
69 73
70 } 74 }
71 else 75 else
72 { 76 {
73 QHBoxLayout *layout = new QHBoxLayout( this ); 77 Q3HBoxLayout *layout = new Q3HBoxLayout( this );
74 78
75 QGroupBox *group = new QGroupBox( 0, Qt::Vertical, title, this ); 79 Q3GroupBox *group = new Q3GroupBox( 0, Qt::Vertical, title, this );
76 QGridLayout *groupLayout = new QGridLayout( group->layout(), 2, 2, 80 Q3GridLayout *groupLayout = new Q3GridLayout( group->layout(), 2, 2,
77 KDialog::spacingHint() ); 81 KDialog::spacingHint() );
78 82
79 mBox = new QListBox( group ); 83 mBox = new Q3ListBox( group );
80 84
81 groupLayout->addWidget( mBox, 0, 0 ); 85 groupLayout->addWidget( mBox, 0, 0 );
82 86
83 KButtonBox *bbox = new KButtonBox( group, Qt::Vertical ); 87 KButtonBox *bbox = new KButtonBox( group, Qt::Vertical );
84 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); 88 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) );
85 mRemoveButton = bbox->addButton( i18n( "Remove" ), this, SLOT( remove() ) ); 89 mRemoveButton = bbox->addButton( i18n( "Remove" ), this, SLOT( remove() ) );
86 bbox->layout(); 90 bbox->layout();
87 groupLayout->addWidget( bbox, 0, 1 ); 91 groupLayout->addWidget( bbox, 0, 1 );
88 92
89 mEdit = new KLineEdit( group ); 93 mEdit = new KLineEdit( group );
90 groupLayout->addMultiCellWidget( mEdit, 1, 1, 0, 1 ); 94 groupLayout->addMultiCellWidget( mEdit, 1, 1, 0, 1 );
91 95
92 layout->addWidget( group ); 96 layout->addWidget( group );
93 97
94 } 98 }
95 99
96 mAddButton->setEnabled( false ); 100 mAddButton->setEnabled( false );
97 mRemoveButton->setEnabled( false ); 101 mRemoveButton->setEnabled( false );
98 102
99 103
100 connect( mBox, SIGNAL( selectionChanged( QListBoxItem* ) ), 104 connect( mBox, SIGNAL( selectionChanged( Q3ListBoxItem* ) ),
101 SLOT( selectionChanged( QListBoxItem* ) ) ); 105 SLOT( selectionChanged( Q3ListBoxItem* ) ) );
102 connect( mEdit, SIGNAL( textChanged( const QString& ) ), 106 connect( mEdit, SIGNAL( textChanged( const QString& ) ),
103 SLOT( textChanged( const QString& ) ) ); 107 SLOT( textChanged( const QString& ) ) );
104 connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) ); 108 connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) );
105 109
106} 110}
107 111
108NamePartWidget::~NamePartWidget() 112NamePartWidget::~NamePartWidget()
109{ 113{
110} 114}
111 115
112void NamePartWidget::setNameParts( const QStringList &list ) 116void NamePartWidget::setNameParts( const QStringList &list )
113{ 117{
@@ -134,72 +138,72 @@ void NamePartWidget::add()
134 mEdit->setText( "" ); 138 mEdit->setText( "" );
135} 139}
136 140
137void NamePartWidget::remove() 141void NamePartWidget::remove()
138{ 142{
139 mBox->removeItem( mBox->currentItem() ); 143 mBox->removeItem( mBox->currentItem() );
140 if ( mBox->count() == 0 ) 144 if ( mBox->count() == 0 )
141 selectionChanged( 0 ); 145 selectionChanged( 0 );
142 146
143 emit modified(); 147 emit modified();
144} 148}
145 149
146void NamePartWidget::selectionChanged( QListBoxItem *item ) 150void NamePartWidget::selectionChanged( Q3ListBoxItem *item )
147{ 151{
148 mRemoveButton->setEnabled( item != 0 ); 152 mRemoveButton->setEnabled( item != 0 );
149} 153}
150 154
151void NamePartWidget::textChanged( const QString& text ) 155void NamePartWidget::textChanged( const QString& text )
152{ 156{
153 mAddButton->setEnabled( !text.isEmpty() ); 157 mAddButton->setEnabled( !text.isEmpty() );
154} 158}
155 159
156 160
157AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) 161AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name )
158 : QWidget( parent, name ) 162 : QWidget( parent, name )
159{ 163{
160 QGridLayout *layout; 164 Q3GridLayout *layout;
161 165
162 mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); 166 mPrefix = new NamePartWidget( i18n( "Prefixes" ), this );
163 mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); 167 mInclusion = new NamePartWidget( i18n( "Inclusions" ), this );
164 mSuffix = new NamePartWidget( i18n( "Suffixes" ), this ); 168 mSuffix = new NamePartWidget( i18n( "Suffixes" ), this );
165 QString dfn; 169 QString dfn;
166 if (QApplication::desktop()->width() > 320 ) 170 if (QApplication::desktop()->width() > 320 )
167 dfn = i18n( "Default formatted name:" ); 171 dfn = i18n( "Default formatted name:" );
168 else 172 else
169 dfn = i18n( "Def. formatted name:" ); 173 dfn = i18n( "Def. formatted name:" );
170 174
171 QLabel *label = new QLabel( dfn, this ); 175 QLabel *label = new QLabel( dfn, this );
172 176
173 mFormattedNameCombo = new KComboBox( this ); 177 mFormattedNameCombo = new KComboBox( this );
174 mFormattedNameCombo->insertItem( i18n( "Empty" ) ); 178 mFormattedNameCombo->insertItem( i18n( "Empty" ) );
175 mFormattedNameCombo->insertItem( i18n( "Simple Name" ) ); 179 mFormattedNameCombo->insertItem( i18n( "Simple Name" ) );
176 mFormattedNameCombo->insertItem( i18n( "Full Name" ) ); 180 mFormattedNameCombo->insertItem( i18n( "Full Name" ) );
177 mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) ); 181 mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) );
178 182
179 if (KGlobal::getOrientation() == KGlobal::Portrait) 183 if (KGlobal::getOrientation() == KGlobal::Portrait)
180 { 184 {
181 layout = new QGridLayout( this, 4, 2, KDialog::marginHintSmall(), 185 layout = new Q3GridLayout( this, 4, 2, KDialog::marginHintSmall(),
182 KDialog::spacingHintSmall() ); 186 KDialog::spacingHintSmall() );
183 187
184 layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); 188 layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 );
185 layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 ); 189 layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 );
186 layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 ); 190 layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 );
187 layout->addWidget( label, 3, 0 ); 191 layout->addWidget( label, 3, 0 );
188 layout->addWidget( mFormattedNameCombo, 3, 1 ); 192 layout->addWidget( mFormattedNameCombo, 3, 1 );
189 193
190 } 194 }
191 else 195 else
192 { 196 {
193 layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), 197 layout = new Q3GridLayout( this, 2, 3, KDialog::marginHint(),
194 KDialog::spacingHint() ); 198 KDialog::spacingHint() );
195 199
196 layout->addWidget( mPrefix, 0, 0 ); 200 layout->addWidget( mPrefix, 0, 0 );
197 layout->addWidget( mInclusion, 0, 1 ); 201 layout->addWidget( mInclusion, 0, 1 );
198 layout->addWidget( mSuffix, 0, 2 ); 202 layout->addWidget( mSuffix, 0, 2 );
199 layout->addWidget( label, 1, 0 ); 203 layout->addWidget( label, 1, 0 );
200 layout->addMultiCellWidget( mFormattedNameCombo, 1, 1, 1, 2 ); 204 layout->addMultiCellWidget( mFormattedNameCombo, 1, 1, 1, 2 );
201 } 205 }
202 206
203 connect( mPrefix, SIGNAL( modified() ), SIGNAL( modified() ) ); 207 connect( mPrefix, SIGNAL( modified() ), SIGNAL( modified() ) );
204 connect( mInclusion, SIGNAL( modified() ), SIGNAL( modified() ) ); 208 connect( mInclusion, SIGNAL( modified() ), SIGNAL( modified() ) );
205 connect( mSuffix, SIGNAL( modified() ), SIGNAL( modified() ) ); 209 connect( mSuffix, SIGNAL( modified() ), SIGNAL( modified() ) );
@@ -224,15 +228,15 @@ void AddresseeWidget::restoreSettings()
224void AddresseeWidget::saveSettings() 228void AddresseeWidget::saveSettings()
225{ 229{
226 qDebug("AddresseeWidget::saveSettings() "); 230 qDebug("AddresseeWidget::saveSettings() ");
227 KConfig config( locateLocal("config","kabcrc") ); 231 KConfig config( locateLocal("config","kabcrc") );
228 config.setGroup( "General" ); 232 config.setGroup( "General" );
229 233
230 config.writeEntry( "Prefixes", mPrefix->nameParts() ); 234 config.writeEntry( "Prefixes", mPrefix->nameParts() );
231 config.writeEntry( "Inclusions", mInclusion->nameParts() ); 235 config.writeEntry( "Inclusions", mInclusion->nameParts() );
232 config.writeEntry( "Suffixes", mSuffix->nameParts() ); 236 config.writeEntry( "Suffixes", mSuffix->nameParts() );
233 config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); 237 config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() );
234} 238}
235 239
236#ifndef KAB_EMBEDDED 240#ifndef KAB_EMBEDDED_
237#include "addresseewidget.moc" 241#include "moc_addresseewidget.cpp"
238#endif //KAB_EMBEDDED 242#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kcmconfigs/addresseewidget.h b/kaddressbook/kcmconfigs/addresseewidget.h
index 09330c8..f2a95a8 100644
--- a/kaddressbook/kcmconfigs/addresseewidget.h
+++ b/kaddressbook/kcmconfigs/addresseewidget.h
@@ -20,54 +20,54 @@
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef ADDRESSEEWIDGET_H 24#ifndef ADDRESSEEWIDGET_H
25#define ADDRESSEEWIDGET_H 25#define ADDRESSEEWIDGET_H
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28 28
29class KComboBox; 29class KComboBox;
30class KLineEdit; 30class KLineEdit;
31 31
32class QListBox; 32class Q3ListBox;
33class QListBoxItem; 33class Q3ListBoxItem;
34class QPushButton; 34class QPushButton;
35 35
36class NamePartWidget : public QWidget 36class NamePartWidget : public QWidget
37{ 37{
38 Q_OBJECT 38 Q_OBJECT
39 39
40 public: 40 public:
41 NamePartWidget( const QString &title, QWidget *parent, 41 NamePartWidget( const QString &title, QWidget *parent,
42 const char *name = 0 ); 42 const char *name = 0 );
43 ~NamePartWidget(); 43 ~NamePartWidget();
44 44
45 void setNameParts( const QStringList &list ); 45 void setNameParts( const QStringList &list );
46 QStringList nameParts() const; 46 QStringList nameParts() const;
47 47
48 signals: 48 signals:
49 void modified(); 49 void modified();
50 50
51 private slots: 51 private slots:
52 void add(); 52 void add();
53 void remove(); 53 void remove();
54 54
55 void selectionChanged( QListBoxItem* ); 55 void selectionChanged( Q3ListBoxItem* );
56 void textChanged( const QString& ); 56 void textChanged( const QString& );
57 57
58 private: 58 private:
59 KLineEdit *mEdit; 59 KLineEdit *mEdit;
60 60
61 QListBox *mBox; 61 Q3ListBox *mBox;
62 QPushButton *mAddButton; 62 QPushButton *mAddButton;
63 QPushButton *mRemoveButton; 63 QPushButton *mRemoveButton;
64}; 64};
65 65
66class AddresseeWidget : public QWidget 66class AddresseeWidget : public QWidget
67{ 67{
68 Q_OBJECT 68 Q_OBJECT
69 69
70 public: 70 public:
71 AddresseeWidget( QWidget *parent, const char *name = 0 ); 71 AddresseeWidget( QWidget *parent, const char *name = 0 );
72 ~AddresseeWidget(); 72 ~AddresseeWidget();
73 73
diff --git a/kaddressbook/kcmconfigs/extensionconfigdialog.cpp b/kaddressbook/kcmconfigs/extensionconfigdialog.cpp
index e87b000..33b66ad 100644
--- a/kaddressbook/kcmconfigs/extensionconfigdialog.cpp
+++ b/kaddressbook/kcmconfigs/extensionconfigdialog.cpp
@@ -13,47 +13,50 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25//Added by qt3to4:
26#include <Q3GridLayout>
27#include <Q3Frame>
25 28
26#include <klocale.h> 29#include <klocale.h>
27 30
28#include "configurewidget.h" 31#include "configurewidget.h"
29 32
30#include "extensionconfigdialog.h" 33#include "extensionconfigdialog.h"
31 34
32ExtensionConfigDialog::ExtensionConfigDialog( ExtensionFactory *factory, KConfig *config, 35ExtensionConfigDialog::ExtensionConfigDialog( ExtensionFactory *factory, KConfig *config,
33 QWidget *parent, const char *name ) 36 QWidget *parent, const char *name )
34 : KDialogBase( Plain, i18n( "Extension Settings" ), Ok | Cancel, Ok, parent, 37 : KDialogBase( Plain, i18n( "Extension Settings" ), Ok | Cancel, Ok, parent,
35 name, true, true ), mWidget( 0 ), mConfig( config ) 38 name, true, true ), mWidget( 0 ), mConfig( config )
36{ 39{
37 QFrame *page = plainPage(); 40 Q3Frame *page = plainPage();
38 QGridLayout *layout = new QGridLayout( page, 1, 1, marginHint(), spacingHint() ); 41 Q3GridLayout *layout = new Q3GridLayout( page, 1, 1, marginHint(), spacingHint() );
39 42
40 mWidget = factory->configureWidget( page, "ExtensionConfigWidget" ); 43 mWidget = factory->configureWidget( page, "ExtensionConfigWidget" );
41 layout->addWidget( mWidget, 0, 0 ); 44 layout->addWidget( mWidget, 0, 0 );
42 45
43 mWidget->restoreSettings( mConfig ); 46 mWidget->restoreSettings( mConfig );
44} 47}
45 48
46ExtensionConfigDialog::~ExtensionConfigDialog() 49ExtensionConfigDialog::~ExtensionConfigDialog()
47{ 50{
48} 51}
49 52
50void ExtensionConfigDialog::slotOk() 53void ExtensionConfigDialog::slotOk()
51{ 54{
52 mWidget->saveSettings( mConfig ); 55 mWidget->saveSettings( mConfig );
53 56
54 KDialogBase::slotOk(); 57 KDialogBase::slotOk();
55} 58}
56 59
57#ifndef KAB_EMBEDDED 60#ifndef KAB_EMBEDDED_
58#include "extensionconfigdialog.moc" 61#include "moc_extensionconfigdialog.cpp"
59#endif //KAB_EMBEDDED 62#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index 9e4db74..d2b7ef1 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -13,34 +13,38 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qframe.h> 25#include <q3frame.h>
26#include <qgroupbox.h> 26#include <q3groupbox.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qtabwidget.h> 29#include <qtabwidget.h>
30#include <qcombobox.h> 30#include <qcombobox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qvbox.h> 34#include <q3vbox.h>
35//Added by qt3to4:
36#include <Q3HBoxLayout>
37#include <Q3PtrList>
38#include <Q3VBoxLayout>
35 39
36#include <kconfig.h> 40#include <kconfig.h>
37#include <kdebug.h> 41#include <kdebug.h>
38#include <kdialog.h> 42#include <kdialog.h>
39#include <klistview.h> 43#include <klistview.h>
40#include <klocale.h> 44#include <klocale.h>
41#include <kglobal.h> 45#include <kglobal.h>
42#include <kmessagebox.h> 46#include <kmessagebox.h>
43#include <kstandarddirs.h> 47#include <kstandarddirs.h>
44 48
45#ifndef KAB_EMBEDDED 49#ifndef KAB_EMBEDDED
46#include <ktrader.h> 50#include <ktrader.h>
@@ -48,85 +52,85 @@
48#include <mergewidget.h> 52#include <mergewidget.h>
49#include <distributionlistwidget.h> 53#include <distributionlistwidget.h>
50#endif // KAB_EMBEDDED 54#endif // KAB_EMBEDDED
51 55
52#include "addresseewidget.h" 56#include "addresseewidget.h"
53#include "extensionconfigdialog.h" 57#include "extensionconfigdialog.h"
54#include "extensionwidget.h" 58#include "extensionwidget.h"
55#include "kabprefs.h" 59#include "kabprefs.h"
56 60
57#include "kabconfigwidget.h" 61#include "kabconfigwidget.h"
58#include <kglobalsettings.h> 62#include <kglobalsettings.h>
59 63
60class ExtensionItem : public QCheckListItem 64class ExtensionItem : public Q3CheckListItem
61{ 65{
62 public: 66 public:
63 67
64#ifndef KAB_EMBEDDED 68#ifndef KAB_EMBEDDED
65 ExtensionItem( QListView *parent, const QString &text ); 69 ExtensionItem( Q3ListView *parent, const QString &text );
66 void setService( const KService::Ptr &ptr ); 70 void setService( const KService::Ptr &ptr );
67#else //KAB_EMBEDDED 71#else //KAB_EMBEDDED
68 ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ); 72 ExtensionItem( Q3ListView *parent, const QString &text, const QString &name, const QString &comment );
69 void setFactory( ExtensionFactory* fac ); 73 void setFactory( ExtensionFactory* fac );
70#endif //KAB_EMBEDDED 74#endif //KAB_EMBEDDED
71 75
72 bool configWidgetAvailable() const; 76 bool configWidgetAvailable() const;
73 ExtensionFactory *factory() const; 77 ExtensionFactory *factory() const;
74 78
75 virtual QString text( int column ) const; 79 virtual QString text( int column ) const;
76 80
77 private: 81 private:
78#ifndef KAB_EMBEDDED 82#ifndef KAB_EMBEDDED
79 KService::Ptr mPtr; 83 KService::Ptr mPtr;
80#else //KAB_EMBEDDED 84#else //KAB_EMBEDDED
81 ExtensionFactory* mFactory; 85 ExtensionFactory* mFactory;
82 QString mName; 86 QString mName;
83 QString mComment; 87 QString mComment;
84 88
85#endif //KAB_EMBEDDED 89#endif //KAB_EMBEDDED
86 90
87}; 91};
88 92
89KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name ) 93KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name )
90 : KPrefsWidget( prefs, parent, name ) 94 : KPrefsWidget( prefs, parent, name )
91{ 95{
92 96
93 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 97 Q3VBoxLayout *topLayout = new Q3VBoxLayout( this, 0,
94 KDialog::spacingHintSmall() ); 98 KDialog::spacingHintSmall() );
95 99
96 QTabWidget *tabWidget = new QTabWidget( this ); 100 QTabWidget *tabWidget = new QTabWidget( this );
97 topLayout->addWidget( tabWidget ); 101 topLayout->addWidget( tabWidget );
98 102
99 // General page 103 // General page
100 QWidget *generalPage = new QWidget( this ); 104 QWidget *generalPage = new QWidget( this );
101 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(), 105 Q3VBoxLayout *layout = new Q3VBoxLayout( generalPage, KDialog::marginHintSmall(),
102 KDialog::spacingHintSmall() ); 106 KDialog::spacingHintSmall() );
103 107
104 108
105 QWidget *hBox = new QWidget( generalPage, "qhbox" ); 109 QWidget *hBox = new QWidget( generalPage, "qhbox" );
106 QHBoxLayout *hboxLayout = new QHBoxLayout( hBox); 110 Q3HBoxLayout *hboxLayout = new Q3HBoxLayout( hBox);
107 KPrefsWidFont *detailsFont = 111 KPrefsWidFont *detailsFont =
108 addWidFont(i18n("phone:123"),i18n("Details view font"), 112 addWidFont(i18n("phone:123"),i18n("Details view font"),
109 &(KABPrefs::instance()->mDetailsFont),hBox); 113 &(KABPrefs::instance()->mDetailsFont),hBox);
110 hboxLayout->addWidget(detailsFont->label()); 114 hboxLayout->addWidget(detailsFont->label());
111 hboxLayout->addWidget(detailsFont->preview()); 115 hboxLayout->addWidget(detailsFont->preview());
112 hboxLayout->addWidget(detailsFont->button()); 116 hboxLayout->addWidget(detailsFont->button());
113 hboxLayout->setMargin(KDialog::marginHintSmall() ); 117 hboxLayout->setMargin(KDialog::marginHintSmall() );
114 hboxLayout->setSpacing(KDialog::spacingHintSmall()); 118 hboxLayout->setSpacing(KDialog::spacingHintSmall());
115 //hBox->setBackgroundColor( black); 119 //hBox->setBackgroundColor( black);
116 layout->addWidget( hBox ); 120 layout->addWidget( hBox );
117 121
118 //general groupbox 122 //general groupbox
119 QWidget *vBox = new QWidget( generalPage, "qvbox" ); 123 QWidget *vBox = new QWidget( generalPage, "qvbox" );
120 QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); 124 Q3VBoxLayout *boxLayout = new Q3VBoxLayout( vBox );
121 boxLayout->setAlignment( Qt::AlignTop ); 125 boxLayout->setAlignment( Qt::AlignTop );
122 boxLayout->setMargin(KDialog::marginHintSmall() ); 126 boxLayout->setMargin(KDialog::marginHintSmall() );
123 boxLayout->setSpacing( KDialog::spacingHintSmall() ); 127 boxLayout->setSpacing( KDialog::spacingHintSmall() );
124 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" ); 128 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" );
125 boxLayout->addWidget( mMenuBarBox ); 129 boxLayout->addWidget( mMenuBarBox );
126 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); 130 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" );
127 boxLayout->addWidget( mSearchReturnBox ); 131 boxLayout->addWidget( mSearchReturnBox );
128 mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" ); 132 mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" );
129 boxLayout->addWidget( mAutoSearchWithWildcardBox); 133 boxLayout->addWidget( mAutoSearchWithWildcardBox);
130 mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" ); 134 mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" );
131 boxLayout->addWidget( mHideSearchOnSwitchBox ); 135 boxLayout->addWidget( mHideSearchOnSwitchBox );
132 136
@@ -145,31 +149,31 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *
145 mAskForDelete = new QCheckBox( i18n( "Ask before delete contact" ), vBox, "mdel" ); 149 mAskForDelete = new QCheckBox( i18n( "Ask before delete contact" ), vBox, "mdel" );
146 boxLayout->addWidget( mAskForDelete ); 150 boxLayout->addWidget( mAskForDelete );
147 151
148 mAskForQuit = new QCheckBox( i18n( "Show exit confirmation" ), vBox, "mquit" ); 152 mAskForQuit = new QCheckBox( i18n( "Show exit confirmation" ), vBox, "mquit" );
149 boxLayout->addWidget( mAskForQuit ); 153 boxLayout->addWidget( mAskForQuit );
150 154
151 layout->addWidget( vBox ); 155 layout->addWidget( vBox );
152 156
153 tabWidget->addTab( generalPage, i18n( "General" ) ); 157 tabWidget->addTab( generalPage, i18n( "General" ) );
154 158
155 // Extension page 159 // Extension page
156 QWidget *extensionPage = new QWidget( this ); 160 QWidget *extensionPage = new QWidget( this );
157 QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(), 161 Q3VBoxLayout *extensionLayout = new Q3VBoxLayout( extensionPage, KDialog::marginHintSmall(),
158 KDialog::spacingHintSmall() ); 162 KDialog::spacingHintSmall() );
159 163
160 //extensions groupbox 164 //extensions groupbox
161 165
162 QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); 166 Q3GroupBox* groupBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage );
163 boxLayout = new QVBoxLayout( groupBox->layout() ); 167 boxLayout = new Q3VBoxLayout( groupBox->layout() );
164 boxLayout->setAlignment( Qt::AlignTop ); 168 boxLayout->setAlignment( Qt::AlignTop );
165 boxLayout->setMargin(KDialog::marginHintSmall()); 169 boxLayout->setMargin(KDialog::marginHintSmall());
166 boxLayout->setSpacing(KDialog::spacingHintSmall()); 170 boxLayout->setSpacing(KDialog::spacingHintSmall());
167 groupBox->layout()->setMargin(1) ; 171 groupBox->layout()->setMargin(1) ;
168 groupBox->layout()->setSpacing(0); 172 groupBox->layout()->setSpacing(0);
169 mExtensionView = new KListView( groupBox ); 173 mExtensionView = new KListView( groupBox );
170 mExtensionView->setAllColumnsShowFocus( true ); 174 mExtensionView->setAllColumnsShowFocus( true );
171 mExtensionView->addColumn( i18n( "Name" ) ); 175 mExtensionView->addColumn( i18n( "Name" ) );
172 mExtensionView->addColumn( i18n( "Description" ) ); 176 mExtensionView->addColumn( i18n( "Description" ) );
173 //mExtensionView->setMaximumHeight(80); 177 //mExtensionView->setMaximumHeight(80);
174 178
175 boxLayout->addWidget( mExtensionView ); 179 boxLayout->addWidget( mExtensionView );
@@ -180,28 +184,28 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *
180 184
181 extensionLayout->addWidget( groupBox ); 185 extensionLayout->addWidget( groupBox );
182 186
183 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 187 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
184 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 188 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
185 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 189 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
186 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 190 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
187 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 191 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
188 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 192 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
189 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 193 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
190 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 194 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
191 connect( mAskForDelete, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 195 connect( mAskForDelete, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
192 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), 196 connect( mExtensionView, SIGNAL( selectionChanged( Q3ListViewItem* ) ),
193 SLOT( selectionChanged( QListViewItem* ) ) ); 197 SLOT( selectionChanged( Q3ListViewItem* ) ) );
194 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), 198 connect( mExtensionView, SIGNAL( clicked( Q3ListViewItem* ) ),
195 SLOT( itemClicked( QListViewItem* ) ) ); 199 SLOT( itemClicked( Q3ListViewItem* ) ) );
196 connect( mConfigureButton, SIGNAL( clicked() ), 200 connect( mConfigureButton, SIGNAL( clicked() ),
197 SLOT( configureExtension() ) ); 201 SLOT( configureExtension() ) );
198 202
199 tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); 203 tabWidget->addTab( extensionPage, i18n( "Extensions" ) );
200 204
201 // Addressee page 205 // Addressee page
202 mAddresseeWidget = new AddresseeWidget( this ); 206 mAddresseeWidget = new AddresseeWidget( this );
203 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); 207 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) );
204 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); 208 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) );
205 209
206} 210}
207 211
@@ -286,26 +290,26 @@ void KABConfigWidget::restoreExtensionSettings()
286 if ( activeExtensions.contains( extensionFactory->identifier() ) ) 290 if ( activeExtensions.contains( extensionFactory->identifier() ) )
287 item->setOn( true ); 291 item->setOn( true );
288 292
289 293
290#endif //KAB_EMBEDDED 294#endif //KAB_EMBEDDED
291 295
292} 296}
293 297
294void KABConfigWidget::saveExtensionSettings() 298void KABConfigWidget::saveExtensionSettings()
295{ 299{
296 QStringList activeExtensions; 300 QStringList activeExtensions;
297 301
298 QPtrList<QListViewItem> list; 302 Q3PtrList<Q3ListViewItem> list;
299 QListViewItemIterator it( mExtensionView ); 303 Q3ListViewItemIterator it( mExtensionView );
300 while ( it.current() ) { 304 while ( it.current() ) {
301 ExtensionItem *item = static_cast<ExtensionItem*>( it.current() ); 305 ExtensionItem *item = static_cast<ExtensionItem*>( it.current() );
302 if ( item ) { 306 if ( item ) {
303 if ( item->isOn() ) 307 if ( item->isOn() )
304 activeExtensions.append( item->factory()->identifier() ); 308 activeExtensions.append( item->factory()->identifier() );
305 } 309 }
306 ++it; 310 ++it;
307 } 311 }
308 312
309 KABPrefs::instance()->mActiveExtensions = activeExtensions; 313 KABPrefs::instance()->mActiveExtensions = activeExtensions;
310} 314}
311 315
@@ -319,52 +323,52 @@ void KABConfigWidget::configureExtension()
319 KConfig config( "kaddressbookrc" ); 323 KConfig config( "kaddressbookrc" );
320#else //KAB_EMBEDDED 324#else //KAB_EMBEDDED
321 KConfig config( locateLocal("config", "kaddressbookrc") ); 325 KConfig config( locateLocal("config", "kaddressbookrc") );
322#endif //KAB_EMBEDDED 326#endif //KAB_EMBEDDED
323 config.setGroup( QString( "Extensions_%1" ).arg( item->factory()->identifier() ) ); 327 config.setGroup( QString( "Extensions_%1" ).arg( item->factory()->identifier() ) );
324 328
325 ExtensionConfigDialog dlg( item->factory(), &config, this ); 329 ExtensionConfigDialog dlg( item->factory(), &config, this );
326 dlg.exec(); 330 dlg.exec();
327 331
328 config.sync(); 332 config.sync();
329} 333}
330 334
331void KABConfigWidget::selectionChanged( QListViewItem *i ) 335void KABConfigWidget::selectionChanged( Q3ListViewItem *i )
332{ 336{
333 ExtensionItem *item = static_cast<ExtensionItem*>( i ); 337 ExtensionItem *item = static_cast<ExtensionItem*>( i );
334 if ( !item ) 338 if ( !item )
335 return; 339 return;
336 340
337 mConfigureButton->setEnabled( item->configWidgetAvailable() ); 341 mConfigureButton->setEnabled( item->configWidgetAvailable() );
338} 342}
339 343
340void KABConfigWidget::itemClicked( QListViewItem *item ) 344void KABConfigWidget::itemClicked( Q3ListViewItem *item )
341{ 345{
342 if ( item != 0 ) 346 if ( item != 0 )
343 modified(); 347 modified();
344} 348}
345 349
346#ifndef KAB_EMBEDDED 350#ifndef KAB_EMBEDDED
347ExtensionItem::ExtensionItem( QListView *parent, const QString &text ) 351ExtensionItem::ExtensionItem( Q3ListView *parent, const QString &text )
348 : QCheckListItem( parent, text, CheckBox ) 352 : Q3CheckListItem( parent, text, CheckBox )
349{ 353{
350} 354}
351 355
352void ExtensionItem::setService( const KService::Ptr &ptr ) 356void ExtensionItem::setService( const KService::Ptr &ptr )
353{ 357{
354 mPtr = ptr; 358 mPtr = ptr;
355} 359}
356#else //KAB_EMBEDDED 360#else //KAB_EMBEDDED
357ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ) 361ExtensionItem::ExtensionItem( Q3ListView *parent, const QString &text, const QString &name, const QString &comment )
358 : QCheckListItem( parent, text, CheckBox ) 362 : Q3CheckListItem( parent, text, CheckBox )
359{ 363{
360 mName = name; 364 mName = name;
361 mComment = comment; 365 mComment = comment;
362} 366}
363 367
364 368
365void ExtensionItem::setFactory( ExtensionFactory* fac ) 369void ExtensionItem::setFactory( ExtensionFactory* fac )
366{ 370{
367 mFactory = fac; 371 mFactory = fac;
368} 372}
369#endif //KAB_EMBEDDED 373#endif //KAB_EMBEDDED
370 374
@@ -409,16 +413,15 @@ QString ExtensionItem::text( int column ) const
409 else 413 else
410 return QString::null; 414 return QString::null;
411#else //KAB_EMBEDDED 415#else //KAB_EMBEDDED
412 if ( column == 0 ) 416 if ( column == 0 )
413 return mName; 417 return mName;
414 else if ( column == 1 ) 418 else if ( column == 1 )
415 return mComment; 419 return mComment;
416 else 420 else
417 return QString::null; 421 return QString::null;
418#endif //KAB_EMBEDDED 422#endif //KAB_EMBEDDED
419} 423}
420 424
421#ifndef KAB_EMBEDDED 425#ifndef KAB_EMBEDDED_
422#include "kabconfigwidget.moc" 426#include "moc_kabconfigwidget.cpp"
423#endif //KAB_EMBEDDED 427#endif //KAB_EMBEDDED
424
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h
index f2a6b1b..4b6e58c 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.h
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.h
@@ -18,25 +18,25 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KABCONFIGWIDGET_H 24#ifndef KABCONFIGWIDGET_H
25#define KABCONFIGWIDGET_H 25#define KABCONFIGWIDGET_H
26 26
27#include <kprefswidget.h> 27#include <kprefswidget.h>
28 28
29class QCheckBox; 29class QCheckBox;
30class QListViewItem; 30class Q3ListViewItem;
31class QPushButton; 31class QPushButton;
32class QComboBox; 32class QComboBox;
33class QLineEdit; 33class QLineEdit;
34class KListView; 34class KListView;
35class KABPrefs; 35class KABPrefs;
36 36
37class AddresseeWidget; 37class AddresseeWidget;
38 38
39class KABConfigWidget : public KPrefsWidget 39class KABConfigWidget : public KPrefsWidget
40{ 40{
41 Q_OBJECT 41 Q_OBJECT
42 42
@@ -44,26 +44,26 @@ class KABConfigWidget : public KPrefsWidget
44 KABConfigWidget(KABPrefs *prefs, QWidget *parent, const char *name = 0 ); 44 KABConfigWidget(KABPrefs *prefs, QWidget *parent, const char *name = 0 );
45 45
46 protected: 46 protected:
47 /** Implement this to read custom configuration widgets. */ 47 /** Implement this to read custom configuration widgets. */
48 virtual void usrReadConfig(); 48 virtual void usrReadConfig();
49 /** Implement this to write custom configuration widgets. */ 49 /** Implement this to write custom configuration widgets. */
50 virtual void usrWriteConfig(); 50 virtual void usrWriteConfig();
51 51
52 52
53 53
54 private slots: 54 private slots:
55 void configureExtension(); 55 void configureExtension();
56 void selectionChanged( QListViewItem* ); 56 void selectionChanged( Q3ListViewItem* );
57 void itemClicked( QListViewItem* ); 57 void itemClicked( Q3ListViewItem* );
58 58
59 private: 59 private:
60 void restoreExtensionSettings(); 60 void restoreExtensionSettings();
61 void saveExtensionSettings(); 61 void saveExtensionSettings();
62 62
63 KListView *mExtensionView; 63 KListView *mExtensionView;
64 QCheckBox *mSearchReturnBox; 64 QCheckBox *mSearchReturnBox;
65 QCheckBox *mNameParsing; 65 QCheckBox *mNameParsing;
66 QCheckBox *mViewsSingleClickBox; 66 QCheckBox *mViewsSingleClickBox;
67 QCheckBox *mAutoSearchWithWildcardBox; 67 QCheckBox *mAutoSearchWithWildcardBox;
68 QCheckBox *mHideSearchOnSwitchBox; 68 QCheckBox *mHideSearchOnSwitchBox;
69 QCheckBox *mMultipleViewsAtOnce; 69 QCheckBox *mMultipleViewsAtOnce;
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.cpp b/kaddressbook/kcmconfigs/kcmkabconfig.cpp
index cbfedbd..55ffcd8 100644
--- a/kaddressbook/kcmconfigs/kcmkabconfig.cpp
+++ b/kaddressbook/kcmconfigs/kcmkabconfig.cpp
@@ -13,24 +13,26 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25//Added by qt3to4:
26#include <Q3VBoxLayout>
25 27
26#ifndef KAB_EMBEDDED 28#ifndef KAB_EMBEDDED
27#include <kaboutdata.h> 29#include <kaboutdata.h>
28#endif //KAB_EMBEDDED 30#endif //KAB_EMBEDDED
29#include <kdebug.h> 31#include <kdebug.h>
30//#include <klocale.h> 32//#include <klocale.h>
31//#include <stdlib.h> 33//#include <stdlib.h>
32 34
33#include "kabconfigwidget.h" 35#include "kabconfigwidget.h"
34 36
35#include "kcmkabconfig.h" 37#include "kcmkabconfig.h"
36 38
@@ -39,25 +41,25 @@
39 41
40extern "C" 42extern "C"
41{ 43{
42 KCModule *create_kabconfig( QWidget *parent, const char * ) { 44 KCModule *create_kabconfig( QWidget *parent, const char * ) {
43 return new KCMKabConfig( parent, "kcmkabconfig" ); 45 return new KCMKabConfig( parent, "kcmkabconfig" );
44 } 46 }
45} 47}
46 48
47KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) 49KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name )
48 : KCModule( KABPrefs::instance(), parent, name ) 50 : KCModule( KABPrefs::instance(), parent, name )
49{ 51{
50 //abort(); 52 //abort();
51 QVBoxLayout *layout = new QVBoxLayout( this ); 53 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
52 mConfigWidget = new KABConfigWidget( (KABPrefs*)getPreferences(), this, "KABConfigWidget" ); 54 mConfigWidget = new KABConfigWidget( (KABPrefs*)getPreferences(), this, "KABConfigWidget" );
53 layout->addWidget( mConfigWidget ); 55 layout->addWidget( mConfigWidget );
54 layout->setSpacing( 0 ); 56 layout->setSpacing( 0 );
55 layout->setMargin( 0 ); 57 layout->setMargin( 0 );
56 58
57 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); 59 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) );
58} 60}
59 61
60void KCMKabConfig::load() 62void KCMKabConfig::load()
61{ 63{
62 mConfigWidget->readConfig(); 64 mConfigWidget->readConfig();
63} 65}
@@ -78,15 +80,15 @@ const KAboutData* KCMKabConfig::aboutData() const
78 KAboutData *about = new KAboutData( I18N_NOOP( "kcmkabconfig" ), 80 KAboutData *about = new KAboutData( I18N_NOOP( "kcmkabconfig" ),
79 I18N_NOOP( "KAddressBook Configure Dialog" ), 81 I18N_NOOP( "KAddressBook Configure Dialog" ),
80 0, 0, KAboutData::License_GPL, 82 0, 0, KAboutData::License_GPL,
81 I18N_NOOP( "(c), 2003 Tobias Koenig" ) ); 83 I18N_NOOP( "(c), 2003 Tobias Koenig" ) );
82 84
83 about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" ); 85 about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" );
84 86
85 return about; 87 return about;
86 88
87} 89}
88#endif //KAB_EMBEDDED 90#endif //KAB_EMBEDDED
89 91
90#ifndef KAB_EMBEDDED 92#ifndef KAB_EMBEDDED_
91#include "kcmkabconfig.moc" 93#include "moc_kcmkabconfig.cpp"
92#endif //KAB_EMBEDDED 94#endif //KAB_EMBEDDED
diff --git a/kaddressbook/keywidget.cpp b/kaddressbook/keywidget.cpp
index c117d34..8ebee19 100644
--- a/kaddressbook/keywidget.cpp
+++ b/kaddressbook/keywidget.cpp
@@ -19,49 +19,51 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qfile.h> 24#include <qfile.h>
25 25
26#include <qinputdialog.h> 26#include <qinputdialog.h>
27 27
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qpushbutton.h> 30#include <qpushbutton.h>
31//Added by qt3to4:
32#include <Q3GridLayout>
31 33
32#ifndef KAB_EMBEDDED 34#ifndef KAB_EMBEDDED
33#include <kaccelmanager.h> 35#include <kaccelmanager.h>
34#include <kio/netaccess.h> 36#include <kio/netaccess.h>
35#include <kmessagebox.h> 37#include <kmessagebox.h>
36#else //KAB_EMBEDDED 38#else //KAB_EMBEDDED
37#include <qmap.h> 39#include <qmap.h>
38#include <qmessagebox.h> 40#include <qmessagebox.h>
39#include <qtextstream.h> 41#include <q3textstream.h>
40#include <kurl.h> 42#include <kurl.h>
41#endif //KAB_EMBEDDED 43#endif //KAB_EMBEDDED
42 44
43#include <kapplication.h> 45#include <kapplication.h>
44#include <kcombobox.h> 46#include <kcombobox.h>
45#include <kdialog.h> 47#include <kdialog.h>
46#include <kfiledialog.h> 48#include <kfiledialog.h>
47#include <klocale.h> 49#include <klocale.h>
48#include <ktempfile.h> 50#include <ktempfile.h>
49 51
50#include "keywidget.h" 52#include "keywidget.h"
51 53
52KeyWidget::KeyWidget( QWidget *parent, const char *name ) 54KeyWidget::KeyWidget( QWidget *parent, const char *name )
53 : QWidget( parent, name ) 55 : QWidget( parent, name )
54{ 56{
55 QGridLayout *layout = new QGridLayout( this, 2, 2, KDialog::marginHint(), 57 Q3GridLayout *layout = new Q3GridLayout( this, 2, 2, KDialog::marginHint(),
56 KDialog::spacingHint() ); 58 KDialog::spacingHint() );
57 59
58 QLabel *label = new QLabel( i18n( "Keys:" ), this ); 60 QLabel *label = new QLabel( i18n( "Keys:" ), this );
59 layout->addWidget( label, 0, 0 ); 61 layout->addWidget( label, 0, 0 );
60 62
61 mKeyCombo = new KComboBox( this ); 63 mKeyCombo = new KComboBox( this );
62 layout->addWidget( mKeyCombo, 0, 1 ); 64 layout->addWidget( mKeyCombo, 0, 1 );
63 65
64 mAddButton = new QPushButton( i18n( "Add" ), this ); 66 mAddButton = new QPushButton( i18n( "Add" ), this );
65 layout->addWidget( mAddButton, 1, 0 ); 67 layout->addWidget( mAddButton, 1, 0 );
66 68
67 mRemoveButton = new QPushButton( i18n( "Remove" ), this ); 69 mRemoveButton = new QPushButton( i18n( "Remove" ), this );
@@ -127,55 +129,55 @@ void KeyWidget::addKey()
127 if ( !keyTypeNames.contains( name ) ) 129 if ( !keyTypeNames.contains( name ) )
128 type = KABC::Key::Custom; 130 type = KABC::Key::Custom;
129 131
130#ifndef KAB_EMBEDDED 132#ifndef KAB_EMBEDDED
131 KURL url = KFileDialog::getOpenURL(); 133 KURL url = KFileDialog::getOpenURL();
132 134
133 if ( url.isEmpty() ) 135 if ( url.isEmpty() )
134 return; 136 return;
135 137
136 QString tmpFile; 138 QString tmpFile;
137 if ( KIO::NetAccess::download( url, tmpFile ) ) { 139 if ( KIO::NetAccess::download( url, tmpFile ) ) {
138 QFile file( tmpFile ); 140 QFile file( tmpFile );
139 if ( !file.open( IO_ReadOnly ) ) { 141 if ( !file.open( QIODevice::ReadOnly ) ) {
140 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); 142 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) );
141 KMessageBox::error( this, text.arg( url.url() ) ); 143 KMessageBox::error( this, text.arg( url.url() ) );
142 return; 144 return;
143 } 145 }
144 146
145 147
146#else //KAB_EMBEDDED 148#else //KAB_EMBEDDED
147 QString keyfile = KFileDialog::getOpenFileName( "huhu", 149 QString keyfile = KFileDialog::getOpenFileName( "huhu",
148 "Select Key", this ); 150 "Select Key", this );
149 151
150 if ( keyfile.isEmpty() ) 152 if ( keyfile.isEmpty() )
151 return; 153 return;
152 154
153 { 155 {
154 QFile file( keyfile ); 156 QFile file( keyfile );
155 if ( !file.open( IO_ReadOnly ) ) { 157 if ( !file.open( QIODevice::ReadOnly ) ) {
156 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); 158 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) );
157 QString caption( i18n( "Error" ) ); 159 QString caption( i18n( "Error" ) );
158 QMessageBox::critical( this, caption, text.arg( keyfile ) ); 160 QMessageBox::critical( this, caption, text.arg( keyfile ) );
159 return; 161 return;
160 } 162 }
161 163
162#endif //KAB_EMBEDDED 164#endif //KAB_EMBEDDED
163 165
164 166
165 167
166 QTextStream s( &file ); 168 Q3TextStream s( &file );
167 QString data; 169 QString data;
168 170
169 s.setEncoding( QTextStream::UnicodeUTF8 ); 171 s.setEncoding( Q3TextStream::UnicodeUTF8 );
170 s >> data; 172 s >> data;
171 file.close(); 173 file.close();
172 174
173 KABC::Key key( data, type ); 175 KABC::Key key( data, type );
174 if ( type == KABC::Key::Custom ) 176 if ( type == KABC::Key::Custom )
175 key.setCustomTypeString( name ); 177 key.setCustomTypeString( name );
176 mKeyList.append( key ); 178 mKeyList.append( key );
177 179
178 emit changed(); 180 emit changed();
179 181
180#ifndef KAB_EMBEDDED 182#ifndef KAB_EMBEDDED
181 KIO::NetAccess::removeTempFile( tmpFile ); 183 KIO::NetAccess::removeTempFile( tmpFile );
@@ -212,47 +214,47 @@ void KeyWidget::removeKey()
212 214
213 updateKeyCombo(); 215 updateKeyCombo();
214} 216}
215 217
216void KeyWidget::exportKey() 218void KeyWidget::exportKey()
217{ 219{
218 KABC::Key key = (*mKeyList.at( mKeyCombo->currentItem() ) ); 220 KABC::Key key = (*mKeyList.at( mKeyCombo->currentItem() ) );
219 221
220#ifndef KAB_EMBEDDED 222#ifndef KAB_EMBEDDED
221 KURL url = KFileDialog::getSaveURL(); 223 KURL url = KFileDialog::getSaveURL();
222 224
223 KTempFile tempFile; 225 KTempFile tempFile;
224 QTextStream *s = tempFile.textStream(); 226 Q3TextStream *s = tempFile.textStream();
225 s->setEncoding( QTextStream::UnicodeUTF8 ); 227 s->setEncoding( Q3TextStream::UnicodeUTF8 );
226 (*s) << key.textData(); 228 (*s) << key.textData();
227 tempFile.close(); 229 tempFile.close();
228 230
229 KIO::NetAccess::upload( tempFile.name(), url, kapp->mainWidget() ); 231 KIO::NetAccess::upload( tempFile.name(), url, kapp->mainWidget() );
230#else //KAB_EMBEDDED 232#else //KAB_EMBEDDED
231 QString keyfile = KFileDialog::getSaveFileName( "huhu", 233 QString keyfile = KFileDialog::getSaveFileName( "huhu",
232 "Save Key", this ); 234 "Save Key", this );
233 235
234 if ( keyfile.isEmpty() ) 236 if ( keyfile.isEmpty() )
235 return; 237 return;
236 238
237 QFile file( keyfile ); 239 QFile file( keyfile );
238 if ( !file.open( IO_ReadWrite ) ) { 240 if ( !file.open( QIODevice::ReadWrite ) ) {
239 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); 241 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) );
240 QString caption( i18n( "Error" ) ); 242 QString caption( i18n( "Error" ) );
241 QMessageBox::critical( this, caption, text.arg( keyfile ) ); 243 QMessageBox::critical( this, caption, text.arg( keyfile ) );
242 return; 244 return;
243 } 245 }
244 246
245 QTextStream s( &file ); 247 Q3TextStream s( &file );
246 s.setEncoding( QTextStream::UnicodeUTF8 ); 248 s.setEncoding( Q3TextStream::UnicodeUTF8 );
247 s << key.textData(); 249 s << key.textData();
248 file.close(); 250 file.close();
249 251
250 252
251#endif //KAB_EMBEDDED 253#endif //KAB_EMBEDDED
252 254
253} 255}
254 256
255void KeyWidget::updateKeyCombo() 257void KeyWidget::updateKeyCombo()
256{ 258{
257 int pos = mKeyCombo->currentItem(); 259 int pos = mKeyCombo->currentItem();
258 mKeyCombo->clear(); 260 mKeyCombo->clear();
@@ -263,15 +265,15 @@ void KeyWidget::updateKeyCombo()
263 mKeyCombo->insertItem( (*it).customTypeString() ); 265 mKeyCombo->insertItem( (*it).customTypeString() );
264 else 266 else
265 mKeyCombo->insertItem( KABC::Key::typeLabel( (*it).type() ) ); 267 mKeyCombo->insertItem( KABC::Key::typeLabel( (*it).type() ) );
266 } 268 }
267 269
268 mKeyCombo->setCurrentItem( pos ); 270 mKeyCombo->setCurrentItem( pos );
269 271
270 bool state = ( mKeyList.count() != 0 ); 272 bool state = ( mKeyList.count() != 0 );
271 mRemoveButton->setEnabled( state ); 273 mRemoveButton->setEnabled( state );
272 mExportButton->setEnabled( state ); 274 mExportButton->setEnabled( state );
273} 275}
274 276
275#ifndef KAB_EMBEDDED 277#ifndef KAB_EMBEDDED_
276#include "keywidget.moc" 278#include "moc_keywidget.cpp"
277#endif //KAB_EMBEDDED 279#endif //KAB_EMBEDDED
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 2f3531d..e373105 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,44 +1,43 @@
1#ifndef DESKTOP_VERSION 1#ifndef DESKTOP_VERSION
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <qcopchannel_qws.h> 3#include <qcopchannel_qws.h>
4#include <stdlib.h> 4#include <stdlib.h>
5#else 5#else
6#include <qapplication.h> 6#include <qapplication.h>
7#include <qwindowsstyle.h> 7#include <qwindowsstyle.h>
8#include <qplatinumstyle.h> 8#include <q3mainwindow.h>
9#include <qmainwindow.h>
10#include <qmessagebox.h> 9#include <qmessagebox.h>
11#include <stdlib.h> 10#include <stdlib.h>
12#endif 11#endif
13 12
14#include <qtextcodec.h> 13#include <qtextcodec.h>
15#include <kstandarddirs.h> 14#include <kstandarddirs.h>
16#include <qregexp.h> 15#include <qregexp.h>
17#include <kglobal.h> 16#include <kglobal.h>
18#include <stdio.h> 17#include <stdio.h>
19#include <qdir.h> 18#include <qdir.h>
20#include "kabprefs.h" 19#include "kabprefs.h"
21#include "kaddressbookmain.h" 20#include "kaddressbookmain.h"
22#include "externalapphandler.h" 21#include "externalapphandler.h"
23#include <libkdepim/kpimglobalprefs.h> 22#include <libkdepim/kpimglobalprefs.h>
24void dumpMissing(); 23void dumpMissing();
25int main( int argc, char **argv ) 24int main( int argc, char **argv )
26{ 25{
26 if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi");
27#ifndef DESKTOP_VERSION 27#ifndef DESKTOP_VERSION
28 QPEApplication a( argc, argv ); 28 QPEApplication a( argc, argv );
29 a.setKeepRunning (); 29 a.setKeepRunning ();
30#else 30#else
31 QApplication a( argc, argv ); 31 QApplication a( argc, argv );
32 QApplication::setStyle( new QPlatinumStyle ());
33#ifdef _WIN32_ 32#ifdef _WIN32_
34 QString hdir ( getenv( "HOME") ); 33 QString hdir ( getenv( "HOME") );
35 if ( hdir.isEmpty() ) { 34 if ( hdir.isEmpty() ) {
36 QString hd ("C:/" ); 35 QString hd ("C:/" );
37 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); 36 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd );
38 if ( QDir::homeDirPath().lower() == hd.lower() ) { 37 if ( QDir::homeDirPath().lower() == hd.lower() ) {
39 _putenv( "HOME=C:"); 38 _putenv( "HOME=C:");
40 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); 39 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) );
41 } 40 }
42 } else { 41 } else {
43 QDir app_dir; 42 QDir app_dir;
44 if ( !app_dir.exists(hdir) ) 43 if ( !app_dir.exists(hdir) )
diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp
index 199f3d6..96822d8 100644
--- a/kaddressbook/nameeditdialog.cpp
+++ b/kaddressbook/nameeditdialog.cpp
@@ -14,30 +14,32 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qlistbox.h> 26#include <q3listbox.h>
27#include <qlistview.h> 27#include <q3listview.h>
28#include <qtooltip.h> 28#include <qtooltip.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qcheckbox.h> 30#include <qcheckbox.h>
31#include <qstring.h> 31#include <qstring.h>
32//Added by qt3to4:
33#include <Q3GridLayout>
32 34
33#ifndef KAB_EMBEDDED 35#ifndef KAB_EMBEDDED
34#include <kaccelmanager.h> 36#include <kaccelmanager.h>
35#else //KAB_EMBEDDED 37#else //KAB_EMBEDDED
36#include <kstandarddirs.h> 38#include <kstandarddirs.h>
37#endif //KAB_EMBEDDED 39#endif //KAB_EMBEDDED
38 40
39#include <kapplication.h> 41#include <kapplication.h>
40#include <kbuttonbox.h> 42#include <kbuttonbox.h>
41#include <kconfig.h> 43#include <kconfig.h>
42#include <klineedit.h> 44#include <klineedit.h>
43#include <klistview.h> 45#include <klistview.h>
@@ -48,25 +50,25 @@
48#include <kiconloader.h> 50#include <kiconloader.h>
49#include <kmessagebox.h> 51#include <kmessagebox.h>
50 52
51#include "nameeditdialog.h" 53#include "nameeditdialog.h"
52 54
53NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type, 55NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type,
54 QWidget *parent, const char *name ) 56 QWidget *parent, const char *name )
55 : KDialogBase( Plain, i18n( "Edit Contact Name" ), Help | Ok | Cancel, 57 : KDialogBase( Plain, i18n( "Edit Contact Name" ), Help | Ok | Cancel,
56 Ok, parent, name, true ) 58 Ok, parent, name, true )
57{ 59{
58 60
59 QWidget *page = plainPage(); 61 QWidget *page = plainPage();
60 QGridLayout *layout = new QGridLayout( page, 5, 3 ); 62 Q3GridLayout *layout = new Q3GridLayout( page, 5, 3 );
61 layout->setSpacing( spacingHint() ); 63 layout->setSpacing( spacingHint() );
62 layout->addColSpacing( 2, 100 ); 64 layout->addColSpacing( 2, 100 );
63 QLabel *label; 65 QLabel *label;
64 66
65 label = new QLabel( i18n( "Honorific prefixes:" ), page ); 67 label = new QLabel( i18n( "Honorific prefixes:" ), page );
66 layout->addWidget( label, 0, 0 ); 68 layout->addWidget( label, 0, 0 );
67 mPrefixCombo = new KComboBox( page ); 69 mPrefixCombo = new KComboBox( page );
68 mPrefixCombo->setDuplicatesEnabled( false ); 70 mPrefixCombo->setDuplicatesEnabled( false );
69 mPrefixCombo->setEditable( true ); 71 mPrefixCombo->setEditable( true );
70 label->setBuddy( mPrefixCombo ); 72 label->setBuddy( mPrefixCombo );
71 layout->addMultiCellWidget( mPrefixCombo, 0, 0, 1, 2 ); 73 layout->addMultiCellWidget( mPrefixCombo, 0, 0, 1, 2 );
72 74
@@ -286,15 +288,15 @@ void NameEditDialog::updateTypeCombo()
286 mFormattedNameCombo->setCurrentItem( pos ); 288 mFormattedNameCombo->setCurrentItem( pos );
287} 289}
288 290
289void NameEditDialog::slotHelp() 291void NameEditDialog::slotHelp()
290{ 292{
291#ifndef KAB_EMBEDDED 293#ifndef KAB_EMBEDDED
292 kapp->invokeHelp( "managing-contacts-automatic-nameparsing" ); 294 kapp->invokeHelp( "managing-contacts-automatic-nameparsing" );
293#else //KAB_EMBEDDED 295#else //KAB_EMBEDDED
294qDebug("NameEditDialog::slotHelp Help is not supported yet"); 296qDebug("NameEditDialog::slotHelp Help is not supported yet");
295#endif //KAB_EMBEDDED 297#endif //KAB_EMBEDDED
296} 298}
297 299
298#ifndef KAB_EMBEDDED 300#ifndef KAB_EMBEDDED_
299#include "nameeditdialog.moc" 301#include "moc_nameeditdialog.cpp"
300#endif //KAB_EMBEDDED 302#endif //KAB_EMBEDDED
diff --git a/kaddressbook/old_mainwindow.cpp b/kaddressbook/old_mainwindow.cpp
index 0e886d9..7a445c7 100644
--- a/kaddressbook/old_mainwindow.cpp
+++ b/kaddressbook/old_mainwindow.cpp
@@ -307,31 +307,31 @@ QPixmap MainWindow::loadPixmap( QString name )
307 return pixmapLoader; 307 return pixmapLoader;
308#else 308#else
309 return Resource::loadPixmap( name ); 309 return Resource::loadPixmap( name );
310#endif 310#endif
311*/ 311*/
312} 312}
313 313
314void MainWindow::initActions() 314void MainWindow::initActions()
315{ 315{
316 iconToolBar->clear(); 316 iconToolBar->clear();
317 KABPrefs *p = KABPrefs::instance(); 317 KABPrefs *p = KABPrefs::instance();
318 QPEMenuBar *menuBar1 = new QPEMenuBar( iconToolBar ); 318 QPEMenuBar *menuBar1 = new QPEMenuBar( iconToolBar );
319 QPopupMenu *menuBar = new QPopupMenu( this ); 319 Q3PopupMenu *menuBar = new Q3PopupMenu( this );
320 menuBar1->insertItem( "ME", menuBar); 320 menuBar1->insertItem( "ME", menuBar);
321 QPopupMenu *fileMenu = new QPopupMenu( this ); 321 Q3PopupMenu *fileMenu = new Q3PopupMenu( this );
322 QPopupMenu *editMenu = new QPopupMenu( this ); 322 Q3PopupMenu *editMenu = new Q3PopupMenu( this );
323 QPopupMenu *viewMenu = new QPopupMenu( this ); 323 Q3PopupMenu *viewMenu = new Q3PopupMenu( this );
324 QPopupMenu *settingsMenu = new QPopupMenu( this ); 324 Q3PopupMenu *settingsMenu = new Q3PopupMenu( this );
325 QPopupMenu *importMenu = new QPopupMenu( this ); 325 Q3PopupMenu *importMenu = new Q3PopupMenu( this );
326 326
327 menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 327 menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
328 328
329 QIconSet icon; 329 QIconSet icon;
330 330
331 331
332 icon = loadPixmap( pathString + "newtodo" ); 332 icon = loadPixmap( pathString + "newtodo" );
333 configureToolBarMenu->insertItem(icon, "New todo", 20 ); 333 configureToolBarMenu->insertItem(icon, "New todo", 20 );
334 QAction* nt_action = new QAction( "New Todo", icon, "New Todo...", 0, this ); 334 QAction* nt_action = new QAction( "New Todo", icon, "New Todo...", 0, this );
335 nt_action->addTo( actionMenu ); 335 nt_action->addTo( actionMenu );
336 connect( nt_action, SIGNAL( activated() ), 336 connect( nt_action, SIGNAL( activated() ),
337 mView, SLOT( newTodo() ) ); 337 mView, SLOT( newTodo() ) );
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp
index df3b551..3661677 100644
--- a/kaddressbook/phoneeditwidget.cpp
+++ b/kaddressbook/phoneeditwidget.cpp
@@ -18,88 +18,94 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qcheckbox.h> 28#include <qcheckbox.h>
29#include <qstring.h> 29#include <qstring.h>
30#include <qlistbox.h> 30#include <q3listbox.h>
31#include <qlistview.h> 31#include <q3listview.h>
32#include <qbuttongroup.h> 32#include <q3buttongroup.h>
33#include <qhbox.h> 33#include <q3hbox.h>
34#include <qcursor.h> 34#include <qcursor.h>
35#include <qtimer.h> 35#include <qtimer.h>
36#include <qapplication.h> 36#include <qapplication.h>
37//Added by qt3to4:
38#include <Q3ValueList>
39#include <Q3GridLayout>
40#include <Q3Frame>
41#include <Q3PopupMenu>
42#include <Q3VBoxLayout>
37 43
38#include <kbuttonbox.h> 44#include <kbuttonbox.h>
39#include <klistview.h> 45#include <klistview.h>
40#include <kapplication.h> 46#include <kapplication.h>
41#include <qapplication.h> 47#include <qapplication.h>
42#include <kconfig.h> 48#include <kconfig.h>
43#include <kmessagebox.h> 49#include <kmessagebox.h>
44#include <klineedit.h> 50#include <klineedit.h>
45#include <kcombobox.h> 51#include <kcombobox.h>
46#include <klocale.h> 52#include <klocale.h>
47#include <kdebug.h> 53#include <kdebug.h>
48#include <kglobal.h> 54#include <kglobal.h>
49#include <kiconloader.h> 55#include <kiconloader.h>
50 56
51#include <kabc/phonenumber.h> 57#include <kabc/phonenumber.h>
52 58
53#include "typecombo.h" 59#include "typecombo.h"
54 60
55#include "phoneeditwidget.h" 61#include "phoneeditwidget.h"
56 62
57PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) 63PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name )
58 : QWidget(parent,name) 64 : QWidget(parent,name)
59{ 65{
60 QGridLayout* gridLayout = new QGridLayout ( this, 2,2 ); 66 Q3GridLayout* gridLayout = new Q3GridLayout ( this, 2,2 );
61 67
62 QLabel *temp = new QLabel( "", this ); 68 QLabel *temp = new QLabel( "", this );
63 temp->setAlignment( Qt::AlignCenter ); 69 temp->setAlignment( Qt::AlignCenter );
64 temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); 70 temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
65 QPushButton *addBut = new QPushButton ( "add", this ); 71 QPushButton *addBut = new QPushButton ( "add", this );
66 addBut->setPixmap ( SmallIcon("plus")); 72 addBut->setPixmap ( SmallIcon("plus"));
67 addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() ); 73 addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() );
68 connect(addBut,SIGNAL(clicked ()),SLOT(addNumber())); 74 connect(addBut,SIGNAL(clicked ()),SLOT(addNumber()));
69 75
70 sv = new QScrollView( this ); 76 sv = new Q3ScrollView( this );
71 sv->setFrameStyle ( QFrame::Plain ); 77 sv->setFrameStyle ( Q3Frame::Plain );
72 sv->setLineWidth ( 0 ); 78 sv->setLineWidth ( 0 );
73 sv->setMidLineWidth ( 0 ); 79 sv->setMidLineWidth ( 0 );
74 mw = new QWidget ( sv->viewport() ); 80 mw = new QWidget ( sv->viewport() );
75 sv->addChild(mw); 81 sv->addChild(mw);
76 sv->setResizePolicy( QScrollView::AutoOneFit ); 82 sv->setResizePolicy( Q3ScrollView::AutoOneFit );
77 mainLayout = new QVBoxLayout ( mw ); 83 mainLayout = new Q3VBoxLayout ( mw );
78 mainLayout->setMargin( 0 ); 84 mainLayout->setMargin( 0 );
79 mainLayout->setSpacing( 0 ); 85 mainLayout->setSpacing( 0 );
80 gridLayout->setMargin( 2 ); 86 gridLayout->setMargin( 2 );
81 gridLayout->setSpacing( 4 ); 87 gridLayout->setSpacing( 4 );
82 if ( QApplication::desktop()->width() == 240 || QApplication::desktop()->width() == 480 ) { 88 if ( QApplication::desktop()->width() == 240 || QApplication::desktop()->width() == 480 ) {
83 gridLayout->addWidget( addBut, 0, 0 ); 89 gridLayout->addWidget( addBut, 0, 0 );
84 gridLayout->addWidget( temp, 0, 1 ); 90 gridLayout->addWidget( temp, 0, 1 );
85 gridLayout->addMultiCellWidget( sv, 1,1 , 0,1 ); 91 gridLayout->addMultiCellWidget( sv, 1,1 , 0,1 );
86 } else { 92 } else {
87 gridLayout->addWidget( temp, 1, 0 ); 93 gridLayout->addWidget( temp, 1, 0 );
88 gridLayout->addWidget( addBut, 0, 0 ); 94 gridLayout->addWidget( addBut, 0, 0 );
89 gridLayout->addMultiCellWidget( sv, 0, 1, 1,1 ); 95 gridLayout->addMultiCellWidget( sv, 0, 1, 1,1 );
90 } 96 }
91 setDefaults(); 97 setDefaults();
92 mTypeNumberEditList.setAutoDelete( true ); 98 mTypeNumberEditList.setAutoDelete( true );
93 mPopup = new QPopupMenu( this ); 99 mPopup = new Q3PopupMenu( this );
94 QStringList list = PhoneNumber::supportedTypeListNames(); 100 QStringList list = PhoneNumber::supportedTypeListNames();
95 mPopupCount = list.count(); 101 mPopupCount = list.count();
96 int i = 0; 102 int i = 0;
97 while ( i < mPopupCount ) { 103 while ( i < mPopupCount ) {
98 mPopup->insertItem( list[ i ], i ); 104 mPopup->insertItem( list[ i ], i );
99 ++i; 105 ++i;
100 } 106 }
101 connect(mPopup,SIGNAL(activated(int)),this,SLOT(addNumberInt( int))); 107 connect(mPopup,SIGNAL(activated(int)),this,SLOT(addNumberInt( int)));
102 108
103} 109}
104 110
105PhoneEditWidget::~PhoneEditWidget() 111PhoneEditWidget::~PhoneEditWidget()
@@ -217,35 +223,35 @@ KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers()
217 retList.append( edit->phoneNumber()); 223 retList.append( edit->phoneNumber());
218 } 224 }
219 edit = mTypeNumberEditList.next(); 225 edit = mTypeNumberEditList.next();
220 226
221 } 227 }
222 return retList; 228 return retList;
223} 229}
224 230
225#if 0 231#if 0
226PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) 232PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name )
227 : QWidget( parent, name ) 233 : QWidget( parent, name )
228{ 234{
229 QGridLayout *layout = new QGridLayout( this, 4, 1 ); 235 Q3GridLayout *layout = new Q3GridLayout( this, 4, 1 );
230//US layout->setSpacing( KDialog::spacingHint() ); 236//US layout->setSpacing( KDialog::spacingHint() );
231 layout->setSpacing( KDialogBase::spacingHintSmall() ); 237 layout->setSpacing( KDialogBase::spacingHintSmall() );
232 238
233 239
234 240
235 QLabel* label = new QLabel( this ); 241 QLabel* label = new QLabel( this );
236//US loadIcon call is ambiguous. Add one more parameter 242//US loadIcon call is ambiguous. Add one more parameter
237//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); 243//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) );
238 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); 244 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
239 label->setAlignment( AlignCenter ); 245 label->setAlignment( Qt::AlignCenter );
240//US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); 246//US layout->addMultiCellWidget( label, 0, 1, 3, 3 );
241 layout->addWidget( label, 0, 0 ); 247 layout->addWidget( label, 0, 0 );
242 248
243 QPushButton *editButton = new QPushButton( i18n( "Edit Phone Numbers..." ), 249 QPushButton *editButton = new QPushButton( i18n( "Edit Phone Numbers..." ),
244 this ); 250 this );
245 if ( QApplication::desktop()->width() < 640 ) 251 if ( QApplication::desktop()->width() < 640 )
246 layout->addWidget( editButton, 0, 1 ); 252 layout->addWidget( editButton, 0, 1 );
247 else 253 else
248 layout->addMultiCellWidget( editButton, 0, 0, 1, 3); 254 layout->addMultiCellWidget( editButton, 0, 0, 1, 3);
249 255
250 mPrefCombo = new PhoneTypeCombo( mPhoneList, this ); 256 mPrefCombo = new PhoneTypeCombo( mPhoneList, this );
251 mPrefEdit = new KLineEdit( this ); 257 mPrefEdit = new KLineEdit( this );
@@ -318,35 +324,35 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name )
318 324
319PhoneEditWidget::~PhoneEditWidget() 325PhoneEditWidget::~PhoneEditWidget()
320{ 326{
321} 327}
322 328
323void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &list ) 329void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &list )
324{ 330{
325 mPhoneList.clear(); 331 mPhoneList.clear();
326 332
327 // Insert types for existing numbers. 333 // Insert types for existing numbers.
328 mPrefCombo->insertTypeList( list ); 334 mPrefCombo->insertTypeList( list );
329 335
330 QValueList<int> defaultTypes; 336 Q3ValueList<int> defaultTypes;
331 defaultTypes << KABC::PhoneNumber::Home; 337 defaultTypes << KABC::PhoneNumber::Home;
332 defaultTypes << KABC::PhoneNumber::Work; 338 defaultTypes << KABC::PhoneNumber::Work;
333 defaultTypes << KABC::PhoneNumber::Cell; 339 defaultTypes << KABC::PhoneNumber::Cell;
334 defaultTypes << ( KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax ); 340 defaultTypes << ( KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax );
335 defaultTypes << ( KABC::PhoneNumber::Home | KABC::PhoneNumber::Fax ); 341 defaultTypes << ( KABC::PhoneNumber::Home | KABC::PhoneNumber::Fax );
336 342
337 // Insert default types. 343 // Insert default types.
338 // Doing this for mPrefCombo is enough because the list is shared by all 344 // Doing this for mPrefCombo is enough because the list is shared by all
339 // combos. 345 // combos.
340 QValueList<int>::ConstIterator it; 346 Q3ValueList<int>::ConstIterator it;
341 for( it = defaultTypes.begin(); it != defaultTypes.end(); ++it ) { 347 for( it = defaultTypes.begin(); it != defaultTypes.end(); ++it ) {
342 if ( !mPrefCombo->hasType( *it ) ) 348 if ( !mPrefCombo->hasType( *it ) )
343 mPrefCombo->insertType( list, *it, PhoneNumber( "", *it ) ); 349 mPrefCombo->insertType( list, *it, PhoneNumber( "", *it ) );
344 } 350 }
345 351
346 updateCombos(); 352 updateCombos();
347 353
348 mPrefCombo->selectType( defaultTypes[ 0 ] ); 354 mPrefCombo->selectType( defaultTypes[ 0 ] );
349 mSecondCombo->selectType( defaultTypes[ 1 ] ); 355 mSecondCombo->selectType( defaultTypes[ 1 ] );
350 mThirdCombo->selectType( defaultTypes[ 2 ] ); 356 mThirdCombo->selectType( defaultTypes[ 2 ] );
351 mFourthCombo->selectType( defaultTypes[ 3 ] ); 357 mFourthCombo->selectType( defaultTypes[ 3 ] );
352 358
@@ -478,50 +484,50 @@ void PhoneEditWidget::updatePhoneNumber( PhoneTypeCombo *combo )
478void PhoneEditWidget::updateOtherEdit( PhoneTypeCombo *combo, PhoneTypeCombo *otherCombo ) 484void PhoneEditWidget::updateOtherEdit( PhoneTypeCombo *combo, PhoneTypeCombo *otherCombo )
479{ 485{
480 if ( combo == otherCombo ) return; 486 if ( combo == otherCombo ) return;
481 487
482 if ( combo->currentItem() == otherCombo->currentItem() ) { 488 if ( combo->currentItem() == otherCombo->currentItem() ) {
483 updateEdit( otherCombo ); 489 updateEdit( otherCombo );
484 } 490 }
485} 491}
486 492
487/////////////////////////////////////////// 493///////////////////////////////////////////
488// PhoneEditDialog 494// PhoneEditDialog
489 495
490class PhoneViewItem : public QListViewItem 496class PhoneViewItem : public Q3ListViewItem
491{ 497{
492public: 498public:
493 PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ); 499 PhoneViewItem( Q3ListView *parent, const KABC::PhoneNumber &number );
494 500
495 void setPhoneNumber( const KABC::PhoneNumber &number ) 501 void setPhoneNumber( const KABC::PhoneNumber &number )
496 { 502 {
497 mPhoneNumber = number; 503 mPhoneNumber = number;
498 makeText(); 504 makeText();
499 } 505 }
500 506
501 QString key() { return mPhoneNumber.id(); } 507 QString key() { return mPhoneNumber.id(); }
502 QString country() { return ""; } 508 QString country() { return ""; }
503 QString region() { return ""; } 509 QString region() { return ""; }
504 QString number() { return ""; } 510 QString number() { return ""; }
505 511
506 KABC::PhoneNumber phoneNumber() { return mPhoneNumber; } 512 KABC::PhoneNumber phoneNumber() { return mPhoneNumber; }
507 513
508private: 514private:
509 void makeText(); 515 void makeText();
510 516
511 KABC::PhoneNumber mPhoneNumber; 517 KABC::PhoneNumber mPhoneNumber;
512}; 518};
513 519
514PhoneViewItem::PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ) 520PhoneViewItem::PhoneViewItem( Q3ListView *parent, const KABC::PhoneNumber &number )
515 : QListViewItem( parent ), mPhoneNumber( number ) 521 : Q3ListViewItem( parent ), mPhoneNumber( number )
516{ 522{
517#ifdef DESKTOP_VERSION 523#ifdef DESKTOP_VERSION
518 setRenameEnabled ( 0, true ); 524 setRenameEnabled ( 0, true );
519#endif 525#endif
520 makeText(); 526 makeText();
521} 527}
522 528
523void PhoneViewItem::makeText() 529void PhoneViewItem::makeText()
524{ 530{
525 /** 531 /**
526 * Will be used in future versions of kaddressbook/libkabc 532 * Will be used in future versions of kaddressbook/libkabc
527 533
@@ -535,69 +541,69 @@ void PhoneViewItem::makeText()
535 setText( 1, mPhoneNumber.typeLabel() ); 541 setText( 1, mPhoneNumber.typeLabel() );
536} 542}
537 543
538PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget *parent, const char *name ) 544PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget *parent, const char *name )
539 : KDialogBase( KDialogBase::Plain, i18n( "Edit Phone Numbers" ), 545 : KDialogBase( KDialogBase::Plain, i18n( "Edit Phone Numbers" ),
540 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, 546 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok,
541 parent, name, true) 547 parent, name, true)
542{ 548{
543 mPhoneNumberList = list; 549 mPhoneNumberList = list;
544 550
545 QWidget *page = plainPage(); 551 QWidget *page = plainPage();
546 552
547 QGridLayout *layout = new QGridLayout( page, 1, 2 ); 553 Q3GridLayout *layout = new Q3GridLayout( page, 1, 2 );
548 layout->setSpacing( spacingHint() ); 554 layout->setSpacing( spacingHint() );
549 555
550 mListView = new KListView( page ); 556 mListView = new KListView( page );
551 mListView->setAllColumnsShowFocus( true ); 557 mListView->setAllColumnsShowFocus( true );
552 mListView->addColumn( i18n( "Number" ) ); 558 mListView->addColumn( i18n( "Number" ) );
553 mListView->addColumn( i18n( "Type" ) ); 559 mListView->addColumn( i18n( "Type" ) );
554 560
555 KButtonBox *buttonBox = new KButtonBox( page, Vertical ); 561 KButtonBox *buttonBox = new KButtonBox( page, Qt::Vertical );
556 562
557 buttonBox->addButton( i18n( "&Add..." ), this, SLOT( slotAddPhoneNumber() ) ); 563 buttonBox->addButton( i18n( "&Add..." ), this, SLOT( slotAddPhoneNumber() ) );
558 mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( slotEditPhoneNumber() ) ); 564 mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( slotEditPhoneNumber() ) );
559 mEditButton->setEnabled( false ); 565 mEditButton->setEnabled( false );
560 mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( slotRemovePhoneNumber() ) ); 566 mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( slotRemovePhoneNumber() ) );
561 mRemoveButton->setEnabled( false ); 567 mRemoveButton->setEnabled( false );
562 buttonBox->layout(); 568 buttonBox->layout();
563 569
564 layout->addWidget( mListView, 0, 0 ); 570 layout->addWidget( mListView, 0, 0 );
565 layout->addWidget( buttonBox, 0, 1 ); 571 layout->addWidget( buttonBox, 0, 1 );
566 572
567 connect( mListView, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) ); 573 connect( mListView, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) );
568 connect( mListView, SIGNAL(doubleClicked( QListViewItem *, const QPoint &, int )), this, SLOT( slotEditPhoneNumber())); 574 connect( mListView, SIGNAL(doubleClicked( Q3ListViewItem *, const QPoint &, int )), this, SLOT( slotEditPhoneNumber()));
569 575
570 KABC::PhoneNumber::List::Iterator it; 576 KABC::PhoneNumber::List::Iterator it;
571 for ( it = mPhoneNumberList.begin(); it != mPhoneNumberList.end(); ++it ) 577 for ( it = mPhoneNumberList.begin(); it != mPhoneNumberList.end(); ++it )
572 new PhoneViewItem( mListView, *it ); 578 new PhoneViewItem( mListView, *it );
573 if (QApplication::desktop()->width() < 480 ) 579 if (QApplication::desktop()->width() < 480 )
574 showMaximized(); 580 showMaximized();
575 else 581 else
576 resize( 400, 400 ); 582 resize( 400, 400 );
577 mChanged = false; 583 mChanged = false;
578} 584}
579 585
580PhoneEditDialog::~PhoneEditDialog() 586PhoneEditDialog::~PhoneEditDialog()
581{ 587{
582 qDebug("PhoneEditDialog::~PhoneEditDialog() "); 588 qDebug("PhoneEditDialog::~PhoneEditDialog() ");
583} 589}
584 590
585void PhoneEditDialog::slotAddPhoneNumber() 591void PhoneEditDialog::slotAddPhoneNumber()
586{ 592{
587 KABC::PhoneNumber tmp( "", 0 ); 593 KABC::PhoneNumber tmp( "", 0 );
588 PhoneTypeDialog dlg( tmp, this ); 594 PhoneTypeDialog dlg( tmp, this );
589 595
590 if ( dlg.exec() ) { 596 if ( dlg.exec() ) {
591 QListViewItem* i = mListView->firstChild(); 597 Q3ListViewItem* i = mListView->firstChild();
592 KABC::PhoneNumber phoneNumber = dlg.phoneNumber(); 598 KABC::PhoneNumber phoneNumber = dlg.phoneNumber();
593 bool insert = true; 599 bool insert = true;
594 while ( i ) { 600 while ( i ) {
595 PhoneViewItem* p = ( PhoneViewItem* ) i; 601 PhoneViewItem* p = ( PhoneViewItem* ) i;
596 KABC::PhoneNumber pn = p->phoneNumber(); 602 KABC::PhoneNumber pn = p->phoneNumber();
597 if ( (pn.type() | KABC::PhoneNumber::Pref) == (phoneNumber.type() | KABC::PhoneNumber::Pref) ) { 603 if ( (pn.type() | KABC::PhoneNumber::Pref) == (phoneNumber.type() | KABC::PhoneNumber::Pref) ) {
598 if ( p->text(0).isEmpty()) { 604 if ( p->text(0).isEmpty()) {
599 p->setPhoneNumber( phoneNumber ); 605 p->setPhoneNumber( phoneNumber );
600 mPhoneNumberList.remove( pn ); 606 mPhoneNumberList.remove( pn );
601 mPhoneNumberList.append( phoneNumber ); 607 mPhoneNumberList.append( phoneNumber );
602 insert = false; 608 insert = false;
603 break; 609 break;
@@ -611,25 +617,25 @@ void PhoneEditDialog::slotAddPhoneNumber()
611 } 617 }
612 mChanged = true; 618 mChanged = true;
613 } 619 }
614} 620}
615 621
616void PhoneEditDialog::slotRemovePhoneNumber() 622void PhoneEditDialog::slotRemovePhoneNumber()
617{ 623{
618 PhoneViewItem *item = static_cast<PhoneViewItem*>( mListView->currentItem() ); 624 PhoneViewItem *item = static_cast<PhoneViewItem*>( mListView->currentItem() );
619 if ( !item ) 625 if ( !item )
620 return; 626 return;
621 627
622 mPhoneNumberList.remove( item->phoneNumber() ); 628 mPhoneNumberList.remove( item->phoneNumber() );
623 QListViewItem *currItem = mListView->currentItem(); 629 Q3ListViewItem *currItem = mListView->currentItem();
624 mListView->takeItem( currItem ); 630 mListView->takeItem( currItem );
625 delete currItem; 631 delete currItem;
626 632
627 mChanged = true; 633 mChanged = true;
628} 634}
629 635
630void PhoneEditDialog::slotEditPhoneNumber() 636void PhoneEditDialog::slotEditPhoneNumber()
631{ 637{
632 PhoneViewItem *item = static_cast<PhoneViewItem*>( mListView->currentItem() ); 638 PhoneViewItem *item = static_cast<PhoneViewItem*>( mListView->currentItem() );
633 if ( !item ) 639 if ( !item )
634 return; 640 return;
635 641
@@ -664,35 +670,35 @@ bool PhoneEditDialog::changed() const
664} 670}
665 671
666/////////////////////////////////////////// 672///////////////////////////////////////////
667// PhoneTypeDialog 673// PhoneTypeDialog
668PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber, 674PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber,
669 QWidget *parent, const char *name) 675 QWidget *parent, const char *name)
670 : KDialogBase( KDialogBase::Plain, i18n( "Edit Phone Number" ), 676 : KDialogBase( KDialogBase::Plain, i18n( "Edit Phone Number" ),
671 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, 677 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok,
672 parent, name, true), mPhoneNumber( phoneNumber ) 678 parent, name, true), mPhoneNumber( phoneNumber )
673{ 679{
674 QWidget *page = plainPage(); 680 QWidget *page = plainPage();
675 QLabel *label = 0; 681 QLabel *label = 0;
676 QGridLayout *layout = new QGridLayout( page, 3, 2, marginHint(), spacingHint() ); 682 Q3GridLayout *layout = new Q3GridLayout( page, 3, 2, marginHint(), spacingHint() );
677 683
678 label = new QLabel( i18n( "Number:" ), page ); 684 label = new QLabel( i18n( "Number:" ), page );
679 layout->addWidget( label, 0, 0 ); 685 layout->addWidget( label, 0, 0 );
680 mNumber = new KLineEdit( page ); 686 mNumber = new KLineEdit( page );
681 layout->addWidget( mNumber, 0, 1 ); 687 layout->addWidget( mNumber, 0, 1 );
682 688
683 mPreferredBox = new QCheckBox( i18n( "This is the preferred phone number" ), page ); 689 mPreferredBox = new QCheckBox( i18n( "This is the preferred phone number" ), page );
684 layout->addMultiCellWidget( mPreferredBox, 1, 1, 0, 1 ); 690 layout->addMultiCellWidget( mPreferredBox, 1, 1, 0, 1 );
685 691
686 mGroup = new QButtonGroup( 2, Horizontal, i18n( "Types" ), page ); 692 mGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "Types" ), page );
687 layout->addMultiCellWidget( mGroup, 2, 2, 0, 1 ); 693 layout->addMultiCellWidget( mGroup, 2, 2, 0, 1 );
688 694
689 // fill widgets 695 // fill widgets
690 mNumber->setText( mPhoneNumber.number() ); 696 mNumber->setText( mPhoneNumber.number() );
691 697
692 mTypeList = KABC::PhoneNumber::typeList(); 698 mTypeList = KABC::PhoneNumber::typeList();
693 mTypeList.remove( KABC::PhoneNumber::Pref ); 699 mTypeList.remove( KABC::PhoneNumber::Pref );
694 700
695 KABC::PhoneNumber::TypeList::Iterator it; 701 KABC::PhoneNumber::TypeList::Iterator it;
696 for ( it = mTypeList.begin(); it != mTypeList.end(); ++it ) 702 for ( it = mTypeList.begin(); it != mTypeList.end(); ++it )
697 new QCheckBox( KABC::PhoneNumber::typeLabel( *it ), mGroup ); 703 new QCheckBox( KABC::PhoneNumber::typeLabel( *it ), mGroup );
698 704
@@ -717,15 +723,15 @@ KABC::PhoneNumber PhoneTypeDialog::phoneNumber()
717 if ( box->isChecked() ) 723 if ( box->isChecked() )
718 type += mTypeList[ i ]; 724 type += mTypeList[ i ];
719 } 725 }
720 726
721 if ( mPreferredBox->isChecked() ) 727 if ( mPreferredBox->isChecked() )
722 mPhoneNumber.setType( type | KABC::PhoneNumber::Pref ); 728 mPhoneNumber.setType( type | KABC::PhoneNumber::Pref );
723 else 729 else
724 mPhoneNumber.setType( type & ~KABC::PhoneNumber::Pref ); 730 mPhoneNumber.setType( type & ~KABC::PhoneNumber::Pref );
725 731
726 return mPhoneNumber; 732 return mPhoneNumber;
727} 733}
728#endif 734#endif
729#ifndef KAB_EMBEDDED 735#ifndef KAB_EMBEDDED_
730#include "phoneeditwidget.moc" 736#include "moc_phoneeditwidget.cpp"
731#endif //KAB_EMBEDDED 737#endif //KAB_EMBEDDED
diff --git a/kaddressbook/phoneeditwidget.h b/kaddressbook/phoneeditwidget.h
index 5bb4226..2be3e2b 100644
--- a/kaddressbook/phoneeditwidget.h
+++ b/kaddressbook/phoneeditwidget.h
@@ -18,34 +18,38 @@
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 20
21 As a special exception, permission is given to link this program 21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25 25
26#include <kdialogbase.h> 26#include <kdialogbase.h>
27#include <kiconloader.h> 27#include <kiconloader.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qpopupmenu.h> 30#include <q3popupmenu.h>
31#include <qapplication.h> 31#include <qapplication.h>
32#include <QDesktopWidget>
32 33
33#include <qptrlist.h> 34#include <q3ptrlist.h>
34#include <qscrollview.h> 35#include <q3scrollview.h>
36//Added by qt3to4:
37#include <Q3HBoxLayout>
38#include <Q3VBoxLayout>
35 39
36#include "addresseeconfig.h" 40#include "addresseeconfig.h"
37#include "typecombo.h" 41#include "typecombo.h"
38 42
39class QButtonGroup; 43class Q3ButtonGroup;
40class QCheckBox; 44class QCheckBox;
41class PhoneTypeNumberEdit; 45class PhoneTypeNumberEdit;
42 46
43#include <klineedit.h> 47#include <klineedit.h>
44#include <kcombobox.h> 48#include <kcombobox.h>
45#include <kabc/phonenumber.h> 49#include <kabc/phonenumber.h>
46 50
47typedef TypeCombo<KABC::PhoneNumber> PhoneTypeCombo; 51typedef TypeCombo<KABC::PhoneNumber> PhoneTypeCombo;
48 52
49/** 53/**
50 Widget for editing phone numbers. 54 Widget for editing phone numbers.
51*/ 55*/
@@ -67,51 +71,51 @@ class PhoneEditWidget : public QWidget
67 void modified(); 71 void modified();
68 void typeChange( int oldType, int newType ); 72 void typeChange( int oldType, int newType );
69 73
70 private slots: 74 private slots:
71 void bottomVisible(); 75 void bottomVisible();
72 void addNumberInt( int ); 76 void addNumberInt( int );
73 void deleteEdit( PhoneTypeNumberEdit* ew ); 77 void deleteEdit( PhoneTypeNumberEdit* ew );
74 void addNumber(); 78 void addNumber();
75 void pendingDelete(); 79 void pendingDelete();
76 protected: 80 protected:
77 81
78 private: 82 private:
79 QScrollView* sv; 83 Q3ScrollView* sv;
80 QPopupMenu *mPopup; 84 Q3PopupMenu *mPopup;
81 int mPopupCount; 85 int mPopupCount;
82 PhoneTypeNumberEdit* mPendingDelete; 86 PhoneTypeNumberEdit* mPendingDelete;
83 void setDefaults(); 87 void setDefaults();
84 PhoneTypeNumberEdit* appendEditCombo(); 88 PhoneTypeNumberEdit* appendEditCombo();
85 QWidget* mw; 89 QWidget* mw;
86 QVBoxLayout* mainLayout; 90 Q3VBoxLayout* mainLayout;
87 QPtrList <PhoneTypeNumberEdit> mTypeNumberEditList; 91 Q3PtrList <PhoneTypeNumberEdit> mTypeNumberEditList;
88 92
89}; 93};
90 94
91 95
92class PhoneTypeNumberEdit : public QWidget 96class PhoneTypeNumberEdit : public QWidget
93{ 97{
94 Q_OBJECT 98 Q_OBJECT
95public: 99public:
96 PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent ) 100 PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent )
97 { 101 {
98 QHBoxLayout * lay = new QHBoxLayout( this ); 102 Q3HBoxLayout * lay = new Q3HBoxLayout( this );
99 lay->setSpacing( 2 ); 103 lay->setSpacing( 2 );
100 lay->setMargin( 0 ); 104 lay->setMargin( 0 );
101 mMinusButton = new QPushButton ( this ); 105 mMinusButton = new QPushButton ( this );
102 mMinusButton->setPixmap ( SmallIcon("minus")); 106 mMinusButton->setPixmap ( SmallIcon("minus"));
103 mCombo = new KComboBox( this ); 107 mCombo = new KComboBox( this );
104 if ( QApplication::desktop()->width() <= 640 ) 108 if ( QApplication::desktop()->width() <= 640 )
105 mCombo->setSizeLimit ( 6 ); 109 mCombo->setMaxVisibleItems ( 6 );
106 mNumber = new KLineEdit( this ); 110 mNumber = new KLineEdit( this );
107 mMinusButton->setMaximumHeight( mNumber->sizeHint().height() + 6); 111 mMinusButton->setMaximumHeight( mNumber->sizeHint().height() + 6);
108 lay->addWidget( mMinusButton ); 112 lay->addWidget( mMinusButton );
109 lay->addWidget( mCombo ); 113 lay->addWidget( mCombo );
110 lay->addWidget( mNumber ); 114 lay->addWidget( mNumber );
111 connect( mMinusButton , SIGNAL ( clicked() ), this, SLOT ( deleteNumber() ) ); 115 connect( mMinusButton , SIGNAL ( clicked() ), this, SLOT ( deleteNumber() ) );
112 connect( mCombo , SIGNAL ( activated ( int ) ), this, SLOT ( comboTypeChange( int ) ) ); 116 connect( mCombo , SIGNAL ( activated ( int ) ), this, SLOT ( comboTypeChange( int ) ) );
113 connect( mNumber , SIGNAL ( textChanged ( const QString & ) ), 117 connect( mNumber , SIGNAL ( textChanged ( const QString & ) ),
114 this, SLOT ( textChanged ( const QString & ) ) ); 118 this, SLOT ( textChanged ( const QString & ) ) );
115 mCombo->insertStringList( PhoneNumber::supportedTypeListNames() ); 119 mCombo->insertStringList( PhoneNumber::supportedTypeListNames() );
116 } 120 }
117 ~PhoneTypeNumberEdit() { 121 ~PhoneTypeNumberEdit() {
diff --git a/kaddressbook/secrecywidget.cpp b/kaddressbook/secrecywidget.cpp
index 4a2acc8..1c237c0 100644
--- a/kaddressbook/secrecywidget.cpp
+++ b/kaddressbook/secrecywidget.cpp
@@ -13,35 +13,37 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25//Added by qt3to4:
26#include <Q3VBoxLayout>
25 27
26#include <kabc/secrecy.h> 28#include <kabc/secrecy.h>
27#include <kcombobox.h> 29#include <kcombobox.h>
28#include <kdialog.h> 30#include <kdialog.h>
29 31
30#include "secrecywidget.h" 32#include "secrecywidget.h"
31 33
32SecrecyWidget::SecrecyWidget( QWidget *parent, const char *name ) 34SecrecyWidget::SecrecyWidget( QWidget *parent, const char *name )
33 : QWidget( parent, name ) 35 : QWidget( parent, name )
34{ 36{
35 QVBoxLayout *layout = new QVBoxLayout( this, KDialog::marginHint(), 37 Q3VBoxLayout *layout = new Q3VBoxLayout( this, KDialog::marginHint(),
36 KDialog::spacingHint() ); 38 KDialog::spacingHint() );
37 mSecrecyCombo = new KComboBox( this ); 39 mSecrecyCombo = new KComboBox( this );
38 layout->addWidget( mSecrecyCombo ); 40 layout->addWidget( mSecrecyCombo );
39 41
40 KABC::Secrecy::TypeList list = KABC::Secrecy::typeList(); 42 KABC::Secrecy::TypeList list = KABC::Secrecy::typeList();
41 KABC::Secrecy::TypeList::Iterator it; 43 KABC::Secrecy::TypeList::Iterator it;
42 for ( it = list.begin(); it != list.end(); ++it ) 44 for ( it = list.begin(); it != list.end(); ++it )
43 mSecrecyCombo->insertItem( KABC::Secrecy::typeLabel( *it ), *it ); 45 mSecrecyCombo->insertItem( KABC::Secrecy::typeLabel( *it ), *it );
44 46
45 connect( mSecrecyCombo, SIGNAL( activated( const QString& ) ), 47 connect( mSecrecyCombo, SIGNAL( activated( const QString& ) ),
46 SIGNAL( changed() ) ); 48 SIGNAL( changed() ) );
47} 49}
@@ -56,15 +58,15 @@ void SecrecyWidget::setSecrecy( const KABC::Secrecy &secrecy )
56 if (secrecy.isValid()) 58 if (secrecy.isValid())
57 mSecrecyCombo->setCurrentItem( secrecy.type() ); 59 mSecrecyCombo->setCurrentItem( secrecy.type() );
58} 60}
59 61
60KABC::Secrecy SecrecyWidget::secrecy() const 62KABC::Secrecy SecrecyWidget::secrecy() const
61{ 63{
62 KABC::Secrecy secrecy; 64 KABC::Secrecy secrecy;
63 secrecy.setType( mSecrecyCombo->currentItem() ); 65 secrecy.setType( mSecrecyCombo->currentItem() );
64 66
65 return secrecy; 67 return secrecy;
66} 68}
67 69
68#ifndef KAB_EMBEDDED 70#ifndef KAB_EMBEDDED_
69#include "secrecywidget.moc" 71#include "moc_secrecywidget.cpp"
70#endif //KAB_EMBEDDED 72#endif //KAB_EMBEDDED
diff --git a/kaddressbook/undo.cpp b/kaddressbook/undo.cpp
index 4442087..a6c1580 100644
--- a/kaddressbook/undo.cpp
+++ b/kaddressbook/undo.cpp
@@ -105,15 +105,15 @@ RedoStack* RedoStack::instance()
105 105
106void RedoStack::redo() 106void RedoStack::redo()
107{ 107{
108 Command *command; 108 Command *command;
109 if (isEmpty()) 109 if (isEmpty())
110 return; 110 return;
111 111
112 command = pop(); 112 command = pop();
113 command->redo(); 113 command->redo();
114 UndoStack::instance()->push( command ); 114 UndoStack::instance()->push( command );
115} 115}
116 116
117#ifndef KAB_EMBEDDED 117#ifndef KAB_EMBEDDED_
118#include "undo.moc" 118#include "moc_undo.cpp"
119#endif //KAB_EMBEDDED 119#endif //KAB_EMBEDDED
diff --git a/kaddressbook/undo.h b/kaddressbook/undo.h
index 843bc26..a8ba2ee 100644
--- a/kaddressbook/undo.h
+++ b/kaddressbook/undo.h
@@ -16,25 +16,25 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef UNDO_H 24#ifndef UNDO_H
25#define UNDO_H 25#define UNDO_H
26 26
27#include <qobject.h> 27#include <qobject.h>
28#include <qptrstack.h> 28#include <q3ptrstack.h>
29#include <qstring.h> 29#include <qstring.h>
30 30
31class Command 31class Command
32{ 32{
33public: 33public:
34 Command() {} 34 Command() {}
35 virtual ~Command() {}; 35 virtual ~Command() {};
36 virtual QString name() = 0; 36 virtual QString name() = 0;
37 virtual void redo() = 0; // egcs requires these methods to have 37 virtual void redo() = 0; // egcs requires these methods to have
38 virtual void undo() = 0; // implementations (Seems like a bug) 38 virtual void undo() = 0; // implementations (Seems like a bug)
39 // pure virtual may not work 39 // pure virtual may not work
40}; 40};
@@ -58,25 +58,25 @@ class StackBase : public QObject
58 Command *top(); 58 Command *top();
59 void clear(); 59 void clear();
60 60
61 signals: 61 signals:
62 void changed(); 62 void changed();
63 63
64 protected: 64 protected:
65 /** Protect the pop method so users must call undo/redo to properly 65 /** Protect the pop method so users must call undo/redo to properly
66 * use the stack, however the subclasses need it to modify the stack. 66 * use the stack, however the subclasses need it to modify the stack.
67 */ 67 */
68 Command *pop(); 68 Command *pop();
69 69
70 QPtrStack<Command> mCommandStack; 70 Q3PtrStack<Command> mCommandStack;
71}; 71};
72 72
73class UndoStack : public StackBase 73class UndoStack : public StackBase
74{ 74{
75public: 75public:
76 static UndoStack *instance(); 76 static UndoStack *instance();
77 void undo(); 77 void undo();
78 78
79protected: 79protected:
80 UndoStack(); 80 UndoStack();
81 static UndoStack* instance_; 81 static UndoStack* instance_;
82}; 82};
diff --git a/kaddressbook/undocmds.cpp b/kaddressbook/undocmds.cpp
index 5807dc0..e900b00 100644
--- a/kaddressbook/undocmds.cpp
+++ b/kaddressbook/undocmds.cpp
@@ -12,25 +12,25 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtextstream.h> 24#include <q3textstream.h>
25 25
26#include <qapplication.h> 26#include <qapplication.h>
27#include <qclipboard.h> 27#include <qclipboard.h>
28 28
29#include <klocale.h> 29#include <klocale.h>
30#include <kdebug.h> 30#include <kdebug.h>
31#include <kapplication.h> 31#include <kapplication.h>
32#include <kabc/addressbook.h> 32#include <kabc/addressbook.h>
33 33
34#include "addresseeutil.h" 34#include "addresseeutil.h"
35#include "addresseeconfig.h" 35#include "addresseeconfig.h"
36#include "kabcore.h" 36#include "kabcore.h"
diff --git a/kaddressbook/viewconfigurefieldspage.cpp b/kaddressbook/viewconfigurefieldspage.cpp
index 5daae1a..7366a0b 100644
--- a/kaddressbook/viewconfigurefieldspage.cpp
+++ b/kaddressbook/viewconfigurefieldspage.cpp
@@ -27,38 +27,42 @@
27#include <kdebug.h> 27#include <kdebug.h>
28 28
29#else //KAB_EMBEDDED 29#else //KAB_EMBEDDED
30#include <qcombobox.h> 30#include <qcombobox.h>
31#endif //KAB_EMBEDDED 31#endif //KAB_EMBEDDED
32 32
33#include <kiconloader.h> 33#include <kiconloader.h>
34#include <kdialog.h> 34#include <kdialog.h>
35#include <klocale.h> 35#include <klocale.h>
36 36
37#include <qtoolbutton.h> 37#include <qtoolbutton.h>
38#include <qapplication.h> 38#include <qapplication.h>
39#include <QDesktopWidget>
39#include <qlabel.h> 40#include <qlabel.h>
40#include <qlistbox.h> 41#include <q3listbox.h>
41#include <qlayout.h> 42#include <qlayout.h>
43//Added by qt3to4:
44#include <Q3GridLayout>
45#include <Q3BoxLayout>
42 46
43#include "viewconfigurefieldspage.h" 47#include "viewconfigurefieldspage.h"
44 48
45class FieldItem : public QListBoxText 49class FieldItem : public Q3ListBoxText
46{ 50{
47 public: 51 public:
48 FieldItem( QListBox *parent, KABC::Field *field ) 52 FieldItem( Q3ListBox *parent, KABC::Field *field )
49 : QListBoxText( parent, field->label() ), mField( field ) {} 53 : Q3ListBoxText( parent, field->label() ), mField( field ) {}
50 54
51 FieldItem( QListBox *parent, KABC::Field *field, int index ) 55 FieldItem( Q3ListBox *parent, KABC::Field *field, int index )
52 : QListBoxText( parent, field->label(), parent->item( index ) ), 56 : Q3ListBoxText( parent, field->label(), parent->item( index ) ),
53 mField( field ) {} 57 mField( field ) {}
54 58
55 KABC::Field *field() { return mField; } 59 KABC::Field *field() { return mField; }
56 60
57 private: 61 private:
58 KABC::Field *mField; 62 KABC::Field *mField;
59}; 63};
60 64
61 65
62ViewConfigureFieldsPage::ViewConfigureFieldsPage( KABC::AddressBook *ab, 66ViewConfigureFieldsPage::ViewConfigureFieldsPage( KABC::AddressBook *ab,
63 QWidget *parent, 67 QWidget *parent,
64 const char *name ) 68 const char *name )
@@ -97,25 +101,25 @@ void ViewConfigureFieldsPage::slotShowFields( int index )
97{ 101{
98 int currentPos = mUnSelectedBox->currentItem(); 102 int currentPos = mUnSelectedBox->currentItem();
99 mUnSelectedBox->clear(); 103 mUnSelectedBox->clear();
100 104
101 int category; 105 int category;
102 if ( index == 0 ) category = KABC::Field::All; 106 if ( index == 0 ) category = KABC::Field::All;
103 else category = 1 << ( index - 1 ); 107 else category = 1 << ( index - 1 );
104 108
105 KABC::Field::List allFields = mAddressBook->fields( category ); 109 KABC::Field::List allFields = mAddressBook->fields( category );
106 110
107 KABC::Field::List::ConstIterator it; 111 KABC::Field::List::ConstIterator it;
108 for ( it = allFields.begin(); it != allFields.end(); ++it ) { 112 for ( it = allFields.begin(); it != allFields.end(); ++it ) {
109 QListBoxItem *item = mSelectedBox->firstItem(); 113 Q3ListBoxItem *item = mSelectedBox->firstItem();
110 while( item ) { 114 while( item ) {
111 FieldItem *fieldItem = static_cast<FieldItem *>( item ); 115 FieldItem *fieldItem = static_cast<FieldItem *>( item );
112 if ( (*it)->equals( fieldItem->field() ) ) 116 if ( (*it)->equals( fieldItem->field() ) )
113 break; 117 break;
114 item = item->next(); 118 item = item->next();
115 } 119 }
116 120
117 if ( !item ) 121 if ( !item )
118 new FieldItem( mUnSelectedBox, *it ); 122 new FieldItem( mUnSelectedBox, *it );
119 } 123 }
120 124
121 mUnSelectedBox->sort(); 125 mUnSelectedBox->sort();
@@ -180,59 +184,59 @@ void ViewConfigureFieldsPage::slotButtonsEnabled()
180//US QListBoxItem::isSelected()) is not available in QT 2.x. Use selected instead. 184//US QListBoxItem::isSelected()) is not available in QT 2.x. Use selected instead.
181 if ( mSelectedBox->item( i )->selected() ) { 185 if ( mSelectedBox->item( i )->selected() ) {
182 state = true; 186 state = true;
183 break; 187 break;
184 } 188 }
185 mRemoveButton->setEnabled( state ); 189 mRemoveButton->setEnabled( state );
186} 190}
187 191
188void ViewConfigureFieldsPage::slotMoveUp() 192void ViewConfigureFieldsPage::slotMoveUp()
189{ 193{
190 int i = mSelectedBox->currentItem(); 194 int i = mSelectedBox->currentItem();
191 if ( i > 0 ) { 195 if ( i > 0 ) {
192 QListBoxItem *item = mSelectedBox->item( i ); 196 Q3ListBoxItem *item = mSelectedBox->item( i );
193 mSelectedBox->takeItem( item ); 197 mSelectedBox->takeItem( item );
194 mSelectedBox->insertItem( item, i - 1 ); 198 mSelectedBox->insertItem( item, i - 1 );
195 mSelectedBox->setCurrentItem( item ); 199 mSelectedBox->setCurrentItem( item );
196 mSelectedBox->setSelected( i - 1, true ); 200 mSelectedBox->setSelected( i - 1, true );
197 } 201 }
198} 202}
199 203
200void ViewConfigureFieldsPage::slotMoveDown() 204void ViewConfigureFieldsPage::slotMoveDown()
201{ 205{
202 int i = mSelectedBox->currentItem(); 206 int i = mSelectedBox->currentItem();
203 if ( i > -1 && i < (int)mSelectedBox->count() - 1 ) { 207 if ( i > -1 && i < (int)mSelectedBox->count() - 1 ) {
204 QListBoxItem *item = mSelectedBox->item( i ); 208 Q3ListBoxItem *item = mSelectedBox->item( i );
205 mSelectedBox->takeItem( item ); 209 mSelectedBox->takeItem( item );
206 mSelectedBox->insertItem( item, i + 1 ); 210 mSelectedBox->insertItem( item, i + 1 );
207 mSelectedBox->setCurrentItem( item ); 211 mSelectedBox->setCurrentItem( item );
208 mSelectedBox->setSelected( i + 1, true ); 212 mSelectedBox->setSelected( i + 1, true );
209 } 213 }
210} 214}
211 215
212void ViewConfigureFieldsPage::initGUI() 216void ViewConfigureFieldsPage::initGUI()
213{ 217{
214 //US change the orientation dependent on the following flag 218 //US change the orientation dependent on the following flag
215 // right the flag is set only staticly. 219 // right the flag is set only staticly.
216 // 0 = 640x480 ; 1 = 240x320 220 // 0 = 640x480 ; 1 = 240x320
217 bool orientation = 1; 221 bool orientation = 1;
218 222
219 223
220 setCaption( i18n("Select Fields to Display") ); 224 setCaption( i18n("Select Fields to Display") );
221 225
222 QGridLayout *gl = 0; 226 Q3GridLayout *gl = 0;
223 if (orientation == 0) 227 if (orientation == 0)
224 gl = new QGridLayout( this , 6, 4, 0, KDialog::spacingHint() ); 228 gl = new Q3GridLayout( this , 6, 4, 0, KDialog::spacingHint() );
225 else 229 else
226 gl = new QGridLayout( this , 4, 6, 0, KDialog::spacingHint() ); 230 gl = new Q3GridLayout( this , 4, 6, 0, KDialog::spacingHint() );
227 231
228 #ifndef KAB_EMBEDDED 232 #ifndef KAB_EMBEDDED
229 mCategoryCombo = new KComboBox( false, this ); 233 mCategoryCombo = new KComboBox( false, this );
230 #else //KAB_EMBEDDED 234 #else //KAB_EMBEDDED
231 mCategoryCombo = new QComboBox( false, this ); 235 mCategoryCombo = new QComboBox( false, this );
232 #endif //KAB_EMBEDDED 236 #endif //KAB_EMBEDDED
233 if ( QApplication::desktop()->width() < 320 ) 237 if ( QApplication::desktop()->width() < 320 )
234 mCategoryCombo->setMaximumWidth( 70 ); 238 mCategoryCombo->setMaximumWidth( 70 );
235 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::All ) ); 239 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::All ) );
236 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Frequent ) ); 240 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Frequent ) );
237 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Address ) ); 241 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Address ) );
238 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Email ) ); 242 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Email ) );
@@ -240,50 +244,50 @@ void ViewConfigureFieldsPage::initGUI()
240 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Organization ) ); 244 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Organization ) );
241 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::CustomCategory ) ); 245 mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::CustomCategory ) );
242 connect( mCategoryCombo, SIGNAL( activated(int) ), SLOT( slotShowFields(int) ) ); 246 connect( mCategoryCombo, SIGNAL( activated(int) ), SLOT( slotShowFields(int) ) );
243 gl->addWidget( mCategoryCombo, 0, 0 ); 247 gl->addWidget( mCategoryCombo, 0, 0 );
244 248
245 QLabel *label = new QLabel( i18n( "&Selected\nfields:" ), this ); 249 QLabel *label = new QLabel( i18n( "&Selected\nfields:" ), this );
246 if (orientation == 0) 250 if (orientation == 0)
247 gl->addWidget( label, 0, 2 ); 251 gl->addWidget( label, 0, 2 );
248 else 252 else
249 gl->addWidget( label, 2, 0 ); 253 gl->addWidget( label, 2, 0 );
250 254
251 255
252 mUnSelectedBox = new QListBox( this ); 256 mUnSelectedBox = new Q3ListBox( this );
253 mUnSelectedBox->setSelectionMode( QListBox::Extended ); 257 mUnSelectedBox->setSelectionMode( Q3ListBox::Extended );
254 mUnSelectedBox->setMinimumHeight( 80 ); 258 mUnSelectedBox->setMinimumHeight( 80 );
255 if (orientation == 0) 259 if (orientation == 0)
256 gl->addWidget( mUnSelectedBox, 1, 0 ); 260 gl->addWidget( mUnSelectedBox, 1, 0 );
257 else 261 else
258 gl->addWidget( mUnSelectedBox, 0, 1 ); 262 gl->addWidget( mUnSelectedBox, 0, 1 );
259 263
260 mSelectedBox = new QListBox( this ); 264 mSelectedBox = new Q3ListBox( this );
261 //if ( QApplication::desktop()->width() < 320 ) { 265 //if ( QApplication::desktop()->width() < 320 ) {
262 // mUnSelectedBox->setMaximumWidth( 134 ); 266 // mUnSelectedBox->setMaximumWidth( 134 );
263 // mSelectedBox->setMaximumWidth( 134 ); 267 // mSelectedBox->setMaximumWidth( 134 );
264 //} 268 //}
265 mSelectedBox->setSelectionMode( QListBox::Extended ); 269 mSelectedBox->setSelectionMode( Q3ListBox::Extended );
266 mSelectedBox->setMinimumHeight( 80 ); 270 mSelectedBox->setMinimumHeight( 80 );
267 label->setBuddy( mSelectedBox ); 271 label->setBuddy( mSelectedBox );
268 if (orientation == 0) 272 if (orientation == 0)
269 gl->addWidget( mSelectedBox, 1, 2 ); 273 gl->addWidget( mSelectedBox, 1, 2 );
270 else 274 else
271 gl->addWidget( mSelectedBox, 2, 1 ); 275 gl->addWidget( mSelectedBox, 2, 1 );
272 276
273 QBoxLayout *vb1 = 0; 277 Q3BoxLayout *vb1 = 0;
274 if (orientation == 0) 278 if (orientation == 0)
275 vb1 = new QBoxLayout( QBoxLayout::TopToBottom, KDialog::spacingHint() ); 279 vb1 = new Q3BoxLayout( Q3BoxLayout::TopToBottom, KDialog::spacingHint() );
276 else 280 else
277 vb1 = new QBoxLayout( QBoxLayout::LeftToRight, KDialog::spacingHint() ); 281 vb1 = new Q3BoxLayout( Q3BoxLayout::LeftToRight, KDialog::spacingHint() );
278 282
279 vb1->addStretch(); 283 vb1->addStretch();
280 284
281 mAddButton = new QToolButton( this ); 285 mAddButton = new QToolButton( this );
282 if (orientation == 0) 286 if (orientation == 0)
283 mAddButton->setIconSet( SmallIconSet( "1rightarrow" ) ); 287 mAddButton->setIconSet( SmallIconSet( "1rightarrow" ) );
284 else 288 else
285 mAddButton->setIconSet( SmallIconSet( "1downarrow" ) ); 289 mAddButton->setIconSet( SmallIconSet( "1downarrow" ) );
286 connect( mAddButton, SIGNAL( clicked() ), SLOT( slotSelect() ) ); 290 connect( mAddButton, SIGNAL( clicked() ), SLOT( slotSelect() ) );
287 vb1->addWidget( mAddButton ); 291 vb1->addWidget( mAddButton );
288 292
289 mRemoveButton = new QToolButton( this ); 293 mRemoveButton = new QToolButton( this );
@@ -292,29 +296,29 @@ void ViewConfigureFieldsPage::initGUI()
292 else 296 else
293 mRemoveButton->setIconSet( SmallIconSet( "1uparrow" ) ); 297 mRemoveButton->setIconSet( SmallIconSet( "1uparrow" ) );
294 298
295 connect( mRemoveButton, SIGNAL( clicked() ), SLOT( slotUnSelect() ) ); 299 connect( mRemoveButton, SIGNAL( clicked() ), SLOT( slotUnSelect() ) );
296 vb1->addWidget( mRemoveButton ); 300 vb1->addWidget( mRemoveButton );
297 301
298 vb1->addStretch(); 302 vb1->addStretch();
299 if (orientation == 0) 303 if (orientation == 0)
300 gl->addLayout( vb1, 1, 1 ); 304 gl->addLayout( vb1, 1, 1 );
301 else 305 else
302 gl->addLayout( vb1, 1, 1 ); 306 gl->addLayout( vb1, 1, 1 );
303 307
304 QBoxLayout *vb2 = 0; 308 Q3BoxLayout *vb2 = 0;
305 if (orientation == 0) 309 if (orientation == 0)
306 vb2 = new QBoxLayout( QBoxLayout::TopToBottom, KDialog::spacingHint() ); 310 vb2 = new Q3BoxLayout( Q3BoxLayout::TopToBottom, KDialog::spacingHint() );
307 else 311 else
308 vb2 = new QBoxLayout( QBoxLayout::LeftToRight, KDialog::spacingHint() ); 312 vb2 = new Q3BoxLayout( Q3BoxLayout::LeftToRight, KDialog::spacingHint() );
309 313
310 vb2->addStretch(); 314 vb2->addStretch();
311 315
312 mUpButton = new QToolButton( this ); 316 mUpButton = new QToolButton( this );
313 mUpButton->setIconSet( SmallIconSet( "1uparrow" ) ); 317 mUpButton->setIconSet( SmallIconSet( "1uparrow" ) );
314 connect( mUpButton, SIGNAL( clicked() ), SLOT( slotMoveUp() ) ); 318 connect( mUpButton, SIGNAL( clicked() ), SLOT( slotMoveUp() ) );
315 vb2->addWidget( mUpButton ); 319 vb2->addWidget( mUpButton );
316 320
317 mDownButton = new QToolButton( this ); 321 mDownButton = new QToolButton( this );
318 mDownButton->setIconSet( SmallIconSet( "1downarrow" ) ); 322 mDownButton->setIconSet( SmallIconSet( "1downarrow" ) );
319 connect( mDownButton, SIGNAL( clicked() ), SLOT( slotMoveDown() ) ); 323 connect( mDownButton, SIGNAL( clicked() ), SLOT( slotMoveDown() ) );
320 vb2->addWidget( mDownButton ); 324 vb2->addWidget( mDownButton );
@@ -331,21 +335,21 @@ void ViewConfigureFieldsPage::initGUI()
331 // get the maxItemWidth we need to not truncate the view 335 // get the maxItemWidth we need to not truncate the view
332 slotShowFields( 0 ); 336 slotShowFields( 0 );
333 337
334 //sizeHint = sizeHint.expandedTo( mSelectedBox->sizeHint() ); 338 //sizeHint = sizeHint.expandedTo( mSelectedBox->sizeHint() );
335 //sizeHint.setWidth( mUnSelectedBox->maxItemWidth() ); 339 //sizeHint.setWidth( mUnSelectedBox->maxItemWidth() );
336 // mUnSelectedBox->setMinimumSize( sizeHint ); 340 // mUnSelectedBox->setMinimumSize( sizeHint );
337 //mSelectedBox->setMinimumSize( sizeHint ); 341 //mSelectedBox->setMinimumSize( sizeHint );
338 342
339 gl->activate(); 343 gl->activate();
340 344
341 connect( mUnSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); 345 connect( mUnSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) );
342 connect( mSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); 346 connect( mSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) );
343 connect( mSelectedBox, SIGNAL( currentChanged( QListBoxItem * ) ), SLOT( slotButtonsEnabled() ) ); 347 connect( mSelectedBox, SIGNAL( currentChanged( Q3ListBoxItem * ) ), SLOT( slotButtonsEnabled() ) );
344 348
345 slotButtonsEnabled(); 349 slotButtonsEnabled();
346} 350}
347 351
348 352
349#ifndef KAB_EMBEDDED 353#ifndef KAB_EMBEDDED_
350#include "viewconfigurefieldspage.moc" 354#include "moc_viewconfigurefieldspage.cpp"
351#endif //KAB_EMBEDDED 355#endif //KAB_EMBEDDED
diff --git a/kaddressbook/viewconfigurefieldspage.h b/kaddressbook/viewconfigurefieldspage.h
index b27668c..42d132f 100644
--- a/kaddressbook/viewconfigurefieldspage.h
+++ b/kaddressbook/viewconfigurefieldspage.h
@@ -26,26 +26,26 @@
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28 28
29#include <kabc/field.h> 29#include <kabc/field.h>
30#include <kabc/addressbook.h> 30#include <kabc/addressbook.h>
31 31
32#ifndef KAB_EMBEDDED 32#ifndef KAB_EMBEDDED
33class KComboBox; 33class KComboBox;
34#else //KAB_EMBEDDED 34#else //KAB_EMBEDDED
35class QComboBox; 35class QComboBox;
36#endif //KAB_EMBEDDED 36#endif //KAB_EMBEDDED
37 37
38class QListBox; 38class Q3ListBox;
39class QListBoxItem; 39class Q3ListBoxItem;
40class QPushButton; 40class QPushButton;
41class QToolButton; 41class QToolButton;
42 42
43class ViewConfigureFieldsPage : public QWidget 43class ViewConfigureFieldsPage : public QWidget
44{ 44{
45 Q_OBJECT 45 Q_OBJECT
46 46
47 public: 47 public:
48 ViewConfigureFieldsPage( KABC::AddressBook *ab, QWidget *parent = 0, 48 ViewConfigureFieldsPage( KABC::AddressBook *ab, QWidget *parent = 0,
49 const char *name = 0 ); 49 const char *name = 0 );
50 50
51 void restoreSettings( KConfig* ); 51 void restoreSettings( KConfig* );
@@ -59,23 +59,23 @@ class ViewConfigureFieldsPage : public QWidget
59 59
60 void slotShowFields( int ); 60 void slotShowFields( int );
61 void slotButtonsEnabled(); 61 void slotButtonsEnabled();
62 62
63 private: 63 private:
64 void initGUI(); 64 void initGUI();
65 65
66#ifndef KAB_EMBEDDED 66#ifndef KAB_EMBEDDED
67 KComboBox *mCategoryCombo; 67 KComboBox *mCategoryCombo;
68#else //KAB_EMBEDDED 68#else //KAB_EMBEDDED
69 QComboBox *mCategoryCombo; 69 QComboBox *mCategoryCombo;
70#endif //KAB_EMBEDDED 70#endif //KAB_EMBEDDED
71 QListBox *mSelectedBox; 71 Q3ListBox *mSelectedBox;
72 QListBox *mUnSelectedBox; 72 Q3ListBox *mUnSelectedBox;
73 QToolButton *mAddButton; 73 QToolButton *mAddButton;
74 QToolButton *mRemoveButton; 74 QToolButton *mRemoveButton;
75 QToolButton *mUpButton; 75 QToolButton *mUpButton;
76 QToolButton *mDownButton; 76 QToolButton *mDownButton;
77 77
78 KABC::AddressBook *mAddressBook; 78 KABC::AddressBook *mAddressBook;
79}; 79};
80 80
81#endif 81#endif
diff --git a/kaddressbook/viewconfigurefilterpage.cpp b/kaddressbook/viewconfigurefilterpage.cpp
index b085a5e..cdb778b 100644
--- a/kaddressbook/viewconfigurefilterpage.cpp
+++ b/kaddressbook/viewconfigurefilterpage.cpp
@@ -18,66 +18,69 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KAB_EMBEDDED 24#ifndef KAB_EMBEDDED
25#include <kcombobox.h> 25#include <kcombobox.h>
26#else //KAB_EMBEDDED 26#else //KAB_EMBEDDED
27#include <qcombobox.h> 27#include <qcombobox.h>
28#endif //KAB_EMBEDDED 28#endif //KAB_EMBEDDED
29 29
30#include <qbuttongroup.h> 30#include <q3buttongroup.h>
31#include <qlabel.h> 31#include <qlabel.h>
32#include <qlayout.h> 32#include <qlayout.h>
33#include <qradiobutton.h> 33#include <qradiobutton.h>
34//Added by qt3to4:
35#include <Q3HBoxLayout>
36#include <Q3VBoxLayout>
34 37
35#include <kconfig.h> 38#include <kconfig.h>
36#include <kdialog.h> 39#include <kdialog.h>
37#include <klocale.h> 40#include <klocale.h>
38 41
39#include "filter.h" 42#include "filter.h"
40 43
41#include "viewconfigurefilterpage.h" 44#include "viewconfigurefilterpage.h"
42 45
43ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent, 46ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent,
44 const char *name ) 47 const char *name )
45 : QWidget( parent, name ) 48 : QWidget( parent, name )
46{ 49{
47 QBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); 50 Q3BoxLayout *topLayout = new Q3VBoxLayout( this, 0, KDialog::spacingHint() );
48 51
49 mFilterGroup = new QButtonGroup(); 52 mFilterGroup = new Q3ButtonGroup();
50 connect( mFilterGroup, SIGNAL( clicked( int ) ), SLOT( buttonClicked( int ) ) ); 53 connect( mFilterGroup, SIGNAL( clicked( int ) ), SLOT( buttonClicked( int ) ) );
51 54
52 QLabel *label = new QLabel( i18n( "The default filter will be activated whenever" 55 QLabel *label = new QLabel( i18n( "The default filter will be activated whenever"
53 " this view is displayed. This feature allows you to configure views that only" 56 " this view is displayed. This feature allows you to configure views that only"
54 " interact with certain types of information based on the filter. Once the view" 57 " interact with certain types of information based on the filter. Once the view"
55 " is activated, the filter can be changed at anytime." ), this ); 58 " is activated, the filter can be changed at anytime." ), this );
56 label->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak ); 59 label->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak );
57 topLayout->addWidget( label ); 60 topLayout->addWidget( label );
58 61
59 QWidget *spacer = new QWidget( this ); 62 QWidget *spacer = new QWidget( this );
60 spacer->setMinimumHeight( 5 ); 63 spacer->setMinimumHeight( 5 );
61 topLayout->addWidget( spacer ); 64 topLayout->addWidget( spacer );
62 65
63 QRadioButton *button = new QRadioButton( i18n( "No default filter" ), this ); 66 QRadioButton *button = new QRadioButton( i18n( "No default filter" ), this );
64 mFilterGroup->insert( button ); 67 mFilterGroup->insert( button );
65 topLayout->addWidget( button ); 68 topLayout->addWidget( button );
66 69
67 button = new QRadioButton( i18n( "Use last active filter" ), this ); 70 button = new QRadioButton( i18n( "Use last active filter" ), this );
68 mFilterGroup->insert( button ); 71 mFilterGroup->insert( button );
69 topLayout->addWidget( button ); 72 topLayout->addWidget( button );
70 73
71 QBoxLayout *comboLayout = new QHBoxLayout(); 74 Q3BoxLayout *comboLayout = new Q3HBoxLayout();
72 topLayout->addLayout( comboLayout ); 75 topLayout->addLayout( comboLayout );
73 button = new QRadioButton( i18n( "Use filter:" ), this ); 76 button = new QRadioButton( i18n( "Use filter:" ), this );
74 mFilterGroup->insert( button ); 77 mFilterGroup->insert( button );
75 comboLayout->addWidget( button ); 78 comboLayout->addWidget( button );
76 79
77#ifndef KAB_EMBEDDED 80#ifndef KAB_EMBEDDED
78 mFilterCombo = new KComboBox( this ); 81 mFilterCombo = new KComboBox( this );
79#else //KAB_EMBEDDED 82#else //KAB_EMBEDDED
80 mFilterCombo = new QComboBox( this ); 83 mFilterCombo = new QComboBox( this );
81#endif //KAB_EMBEDDED 84#endif //KAB_EMBEDDED
82 85
83 comboLayout->addWidget( mFilterCombo ); 86 comboLayout->addWidget( mFilterCombo );
@@ -123,15 +126,15 @@ void ViewConfigureFilterPage::restoreSettings( KConfig *config )
123 126
124void ViewConfigureFilterPage::saveSettings( KConfig *config ) 127void ViewConfigureFilterPage::saveSettings( KConfig *config )
125{ 128{
126 config->writeEntry( "DefaultFilterName", mFilterCombo->currentText() ); 129 config->writeEntry( "DefaultFilterName", mFilterCombo->currentText() );
127 config->writeEntry( "DefaultFilterType", mFilterGroup->id( mFilterGroup->selected() ) ); 130 config->writeEntry( "DefaultFilterType", mFilterGroup->id( mFilterGroup->selected() ) );
128} 131}
129 132
130void ViewConfigureFilterPage::buttonClicked( int id ) 133void ViewConfigureFilterPage::buttonClicked( int id )
131{ 134{
132 mFilterCombo->setEnabled( id == 2 ); 135 mFilterCombo->setEnabled( id == 2 );
133} 136}
134 137
135#ifndef KAB_EMBEDDED 138#ifndef KAB_EMBEDDED_
136#include "viewconfigurefilterpage.moc" 139#include "moc_viewconfigurefilterpage.cpp"
137#endif //KAB_EMBEDDED 140#endif //KAB_EMBEDDED
diff --git a/kaddressbook/viewconfigurefilterpage.h b/kaddressbook/viewconfigurefilterpage.h
index 3be9564..fb39a61 100644
--- a/kaddressbook/viewconfigurefilterpage.h
+++ b/kaddressbook/viewconfigurefilterpage.h
@@ -17,25 +17,25 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef VIEWCONFIGUREFILTERPAGE 24#ifndef VIEWCONFIGUREFILTERPAGE
25#define VIEWCONFIGUREFILTERPAGE 25#define VIEWCONFIGUREFILTERPAGE
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28 28
29class QButtonGroup; 29class Q3ButtonGroup;
30 30
31#ifndef KAB_EMBEDDED 31#ifndef KAB_EMBEDDED
32class KComboBox; 32class KComboBox;
33#else //KAB_EMBEDDED 33#else //KAB_EMBEDDED
34class QComboBox; 34class QComboBox;
35#endif //KAB_EMBEDDED 35#endif //KAB_EMBEDDED
36 36
37class KConfig; 37class KConfig;
38 38
39class ViewConfigureFilterPage : public QWidget 39class ViewConfigureFilterPage : public QWidget
40{ 40{
41 Q_OBJECT 41 Q_OBJECT
@@ -48,16 +48,16 @@ class ViewConfigureFilterPage : public QWidget
48 void saveSettings( KConfig* ); 48 void saveSettings( KConfig* );
49 49
50 protected slots: 50 protected slots:
51 void buttonClicked( int id ); 51 void buttonClicked( int id );
52 52
53 private: 53 private:
54#ifndef KAB_EMBEDDED 54#ifndef KAB_EMBEDDED
55 KComboBox *mFilterCombo; 55 KComboBox *mFilterCombo;
56#else //KAB_EMBEDDED 56#else //KAB_EMBEDDED
57 QComboBox *mFilterCombo; 57 QComboBox *mFilterCombo;
58#endif //KAB_EMBEDDED 58#endif //KAB_EMBEDDED
59 59
60 QButtonGroup *mFilterGroup; 60 Q3ButtonGroup *mFilterGroup;
61}; 61};
62 62
63#endif 63#endif
diff --git a/kaddressbook/viewconfigurewidget.cpp b/kaddressbook/viewconfigurewidget.cpp
index 666e188..047df8c 100644
--- a/kaddressbook/viewconfigurewidget.cpp
+++ b/kaddressbook/viewconfigurewidget.cpp
@@ -15,58 +15,61 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24 24
25#ifndef KAB_EMBEDDED 25#ifndef KAB_EMBEDDED
26 26
27#include <qvbox.h> 27#include <q3vbox.h>
28 28
29#include <kapplication.h> 29#include <kapplication.h>
30#include <kconfig.h> 30#include <kconfig.h>
31#include <kdebug.h> 31#include <kdebug.h>
32#include <kiconloader.h> 32#include <kiconloader.h>
33 33
34#include "viewmanager.h" 34#include "viewmanager.h"
35 35
36#endif //KAB_EMBEDDED 36#endif //KAB_EMBEDDED
37 37
38 38
39#include <qlayout.h> 39#include <qlayout.h>
40//Added by qt3to4:
41#include <Q3VBoxLayout>
42#include <QPixmap>
40 43
41#include <kjanuswidget.h> 44#include <kjanuswidget.h>
42#include <kglobal.h> 45#include <kglobal.h>
43#include <klocale.h> 46#include <klocale.h>
44 47
45#include "viewconfigurewidget.h" 48#include "viewconfigurewidget.h"
46#include "viewconfigurefieldspage.h" 49#include "viewconfigurefieldspage.h"
47#include "viewconfigurefilterpage.h" 50#include "viewconfigurefilterpage.h"
48 51
49ViewConfigureWidget::ViewConfigureWidget( KABC::AddressBook *ab, QWidget *parent, 52ViewConfigureWidget::ViewConfigureWidget( KABC::AddressBook *ab, QWidget *parent,
50 const char *name ) 53 const char *name )
51 : ConfigureWidget( ab, parent, name ) 54 : ConfigureWidget( ab, parent, name )
52{ 55{
53 QVBoxLayout *topLayout = new QVBoxLayout( this ); 56 Q3VBoxLayout *topLayout = new Q3VBoxLayout( this );
54 57
55 mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); 58 mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed );
56 59
57 topLayout->addWidget( mMainWidget ); 60 topLayout->addWidget( mMainWidget );
58 61
59 // Add the first page, the attributes 62 // Add the first page, the attributes
60 QVBox *page = addPage( i18n( "Fields" ), QString::null, 63 Q3VBox *page = addPage( i18n( "Fields" ), QString::null,
61 KGlobal::iconLoader()->loadIcon( "view_detailed", 64 KGlobal::iconLoader()->loadIcon( "view_detailed",
62 KIcon::Panel, 16 ) ); 65 KIcon::Panel, 16 ) );
63 66
64 67
65 // Add the select fields page 68 // Add the select fields page
66 mFieldsPage = new ViewConfigureFieldsPage( addressBook(), (QWidget*)page ); 69 mFieldsPage = new ViewConfigureFieldsPage( addressBook(), (QWidget*)page );
67 70
68//US mFieldsPage->setMinimumSize(300,300); 71//US mFieldsPage->setMinimumSize(300,300);
69 72
70 // Add the second page, the filter selection 73 // Add the second page, the filter selection
71 page = addPage( i18n( "Default Filter" ), QString::null, 74 page = addPage( i18n( "Default Filter" ), QString::null,
72 KGlobal::iconLoader()->loadIcon( "filter", 75 KGlobal::iconLoader()->loadIcon( "filter",
@@ -84,31 +87,31 @@ ViewConfigureWidget::~ViewConfigureWidget()
84void ViewConfigureWidget::restoreSettings( KConfig *config ) 87void ViewConfigureWidget::restoreSettings( KConfig *config )
85{ 88{
86 mFieldsPage->restoreSettings( config ); 89 mFieldsPage->restoreSettings( config );
87 mFilterPage->restoreSettings( config ); 90 mFilterPage->restoreSettings( config );
88} 91}
89 92
90void ViewConfigureWidget::saveSettings( KConfig *config ) 93void ViewConfigureWidget::saveSettings( KConfig *config )
91{ 94{
92 mFieldsPage->saveSettings( config ); 95 mFieldsPage->saveSettings( config );
93 mFilterPage->saveSettings( config ); 96 mFilterPage->saveSettings( config );
94} 97}
95 98
96QVBox *ViewConfigureWidget::addPage( const QString &item, const QString &header, 99Q3VBox *ViewConfigureWidget::addPage( const QString &item, const QString &header,
97 const QPixmap &pixmap ) 100 const QPixmap &pixmap )
98{ 101{
99 return mMainWidget->addVBoxPage( item, header, pixmap ); 102 return mMainWidget->addVBoxPage( item, header, pixmap );
100} 103}
101 104
102#include <qframe.h> 105#include <q3frame.h>
103#include <qlabel.h> 106#include <qlabel.h>
104#include <qlayout.h> 107#include <qlayout.h>
105#include <stdlib.h> 108#include <stdlib.h>
106 109
107ViewConfigureDialog::ViewConfigureDialog( ViewConfigureWidget *wdg, const QString &viewName, 110ViewConfigureDialog::ViewConfigureDialog( ViewConfigureWidget *wdg, const QString &viewName,
108 QWidget *parent, const char *name ) 111 QWidget *parent, const char *name )
109 : KDialogBase( Swallow, i18n( "Modify View: " ) + viewName, Help | Ok | Cancel, 112 : KDialogBase( Swallow, i18n( "Modify View: " ) + viewName, Help | Ok | Cancel,
110 Ok, parent, name, true, true ), mConfigWidget( wdg ) 113 Ok, parent, name, true, true ), mConfigWidget( wdg )
111{ 114{
112//US, I have to change the way, how to connect the ViewConfigureWidget. It looks 115//US, I have to change the way, how to connect the ViewConfigureWidget. It looks
113// like it has changed. 116// like it has changed.
114 //QFrame *topFrame = plainPage(); 117 //QFrame *topFrame = plainPage();
@@ -143,17 +146,15 @@ void ViewConfigureDialog::saveSettings( KConfig *config )
143 mConfigWidget->saveSettings( config ); 146 mConfigWidget->saveSettings( config );
144} 147}
145 148
146void ViewConfigureDialog::slotHelp() 149void ViewConfigureDialog::slotHelp()
147{ 150{
148#ifndef KAB_EMBEDDED 151#ifndef KAB_EMBEDDED
149 kapp->invokeHelp( "using-views" ); 152 kapp->invokeHelp( "using-views" );
150#else //KAB_EMBEDDED 153#else //KAB_EMBEDDED
151 qDebug("ViewConfigureDialog::slotHelp not yet implemented"); 154 qDebug("ViewConfigureDialog::slotHelp not yet implemented");
152#endif //KAB_EMBEDDED 155#endif //KAB_EMBEDDED
153} 156}
154 157
155#ifndef KAB_EMBEDDED 158#ifndef KAB_EMBEDDED_
156#include "viewconfigurewidget.moc" 159#include "moc_viewconfigurewidget.cpp"
157#endif //KAB_EMBEDDED 160#endif //KAB_EMBEDDED
158
159
diff --git a/kaddressbook/viewconfigurewidget.h b/kaddressbook/viewconfigurewidget.h
index 0c2b77c..e3b9b12 100644
--- a/kaddressbook/viewconfigurewidget.h
+++ b/kaddressbook/viewconfigurewidget.h
@@ -19,25 +19,25 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef VIEWCONFIGUREWIDGET_H 24#ifndef VIEWCONFIGUREWIDGET_H
25#define VIEWCONFIGUREWIDGET_H 25#define VIEWCONFIGUREWIDGET_H
26 26
27 27
28 28
29#include "configurewidget.h" 29#include "configurewidget.h"
30 30
31class QVBox; 31class Q3VBox;
32 32
33#include <kdialogbase.h> 33#include <kdialogbase.h>
34#include <qpixmap.h> 34#include <qpixmap.h>
35 35
36class KJanusWidget; 36class KJanusWidget;
37class QString; 37class QString;
38class ViewConfigureFieldsPage; 38class ViewConfigureFieldsPage;
39class ViewConfigureFilterPage; 39class ViewConfigureFilterPage;
40class ViewConfigureDialog; 40class ViewConfigureDialog;
41/** 41/**
42 This widget is the base class for all view configuration widgets. The 42 This widget is the base class for all view configuration widgets. The
43 author of a view may wish to inherit from this widget and add config pages 43 author of a view may wish to inherit from this widget and add config pages
@@ -65,25 +65,25 @@ class ViewConfigureWidget : public ConfigureWidget
65 /** 65 /**
66 Writes the configuration from the GUI to the config object. If this 66 Writes the configuration from the GUI to the config object. If this
67 method is overloaded, be sure to call the base class's method. 67 method is overloaded, be sure to call the base class's method.
68 68
69 Do not change the group of the config object in this method. 69 Do not change the group of the config object in this method.
70 */ 70 */
71 virtual void saveSettings( KConfig *config ); 71 virtual void saveSettings( KConfig *config );
72 72
73 73
74 /** 74 /**
75 Use this method to add new pages to the widget. 75 Use this method to add new pages to the widget.
76 */ 76 */
77 QVBox *addPage( const QString &item, const QString &header = QString::null, 77 Q3VBox *addPage( const QString &item, const QString &header = QString::null,
78 const QPixmap &pixmap = QPixmap() ); 78 const QPixmap &pixmap = QPixmap() );
79 79
80 private: 80 private:
81 KJanusWidget *mMainWidget; 81 KJanusWidget *mMainWidget;
82 82
83 ViewConfigureFieldsPage *mFieldsPage; 83 ViewConfigureFieldsPage *mFieldsPage;
84 ViewConfigureFilterPage *mFilterPage; 84 ViewConfigureFilterPage *mFilterPage;
85}; 85};
86 86
87class ViewConfigureDialog : public KDialogBase 87class ViewConfigureDialog : public KDialogBase
88{ 88{
89 Q_OBJECT 89 Q_OBJECT
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index b5d9419..5cfe3ad 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -41,36 +41,40 @@ $Id$
41#include <ktrader.h> 41#include <ktrader.h>
42#include <kurldrag.h> 42#include <kurldrag.h>
43 43
44#include "addresseeutil.h" 44#include "addresseeutil.h"
45#else //KAB_EMBEDDED 45#else //KAB_EMBEDDED
46#include "views/kaddressbookiconview.h" 46#include "views/kaddressbookiconview.h"
47#include "views/kaddressbooktableview.h" 47#include "views/kaddressbooktableview.h"
48#include "views/kaddressbookcardview.h" 48#include "views/kaddressbookcardview.h"
49#include "kaddressbookview.h" 49#include "kaddressbookview.h"
50 50
51#include <qaction.h> 51#include <qaction.h>
52#include <qmessagebox.h> 52#include <qmessagebox.h>
53#include <qpopupmenu.h> 53#include <q3popupmenu.h>
54//Added by qt3to4:
55#include <Q3HBoxLayout>
56#include <QDropEvent>
54#include <kconfigbase.h> 57#include <kconfigbase.h>
55 58
56#endif //KAB_EMBEDDED 59#endif //KAB_EMBEDDED
57 60
58 61
59#include <kdebug.h> 62#include <kdebug.h>
60#include <kactionclasses.h> 63#include <kactionclasses.h>
61 64
62#include <qlayout.h> 65#include <qlayout.h>
63#include <qapplication.h> 66#include <qapplication.h>
64#include <qwidgetstack.h> 67#include <QDesktopWidget>
68#include <q3widgetstack.h>
65 69
66#include <kabc/addressbook.h> 70#include <kabc/addressbook.h>
67#include "filtereditdialog.h" 71#include "filtereditdialog.h"
68#include "addviewdialog.h" 72#include "addviewdialog.h"
69#include "kabcore.h" 73#include "kabcore.h"
70#include "kabprefs.h" 74#include "kabprefs.h"
71#include "viewmanager.h" 75#include "viewmanager.h"
72 76
73ViewManager::ViewManager( KABCore *core, QWidget *parent, const char *name ) 77ViewManager::ViewManager( KABCore *core, QWidget *parent, const char *name )
74 : QWidget( parent, name ), mCore( core ), mActiveView( 0 ) 78 : QWidget( parent, name ), mCore( core ), mActiveView( 0 )
75{ 79{
76 initGUI(); 80 initGUI();
@@ -108,39 +112,39 @@ void ViewManager::restoreSettings()
108 mActionSelectFilter->setItems( filterNames() ); 112 mActionSelectFilter->setItems( filterNames() );
109 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter ); 113 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter );
110 int cw = 150; 114 int cw = 150;
111 if ( QApplication::desktop()->width() >= 800 ) 115 if ( QApplication::desktop()->width() >= 800 )
112 cw = 200; 116 cw = 200;
113 if (QApplication::desktop()->width() == 480 && !KABPrefs::instance()->mHideSearchOnSwitch) 117 if (QApplication::desktop()->width() == 480 && !KABPrefs::instance()->mHideSearchOnSwitch)
114 cw = 0; 118 cw = 0;
115 mActionSelectFilter->setComboWidth( cw ); 119 mActionSelectFilter->setComboWidth( cw );
116 // Tell the views to reread their config, since they may have 120 // Tell the views to reread their config, since they may have
117 // been modified by global settings 121 // been modified by global settings
118 QString _oldgroup = mCore->config()->group(); 122 QString _oldgroup = mCore->config()->group();
119 123
120 QDictIterator<KAddressBookView> it( mViewDict ); 124 Q3DictIterator<KAddressBookView> it( mViewDict );
121 for ( it.toFirst(); it.current(); ++it ) { 125 for ( it.toFirst(); it.current(); ++it ) {
122 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 126 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
123 it.current()->readConfig( mCore->config() ); 127 it.current()->readConfig( mCore->config() );
124 } 128 }
125 setActiveView( activeViewName ); 129 setActiveView( activeViewName );
126 130
127 mActionDeleteView->setEnabled( mViewNameList.count() > 1 ); 131 mActionDeleteView->setEnabled( mViewNameList.count() > 1 );
128} 132}
129 133
130void ViewManager::saveSettings() 134void ViewManager::saveSettings()
131{ 135{
132 QString _oldgroup = mCore->config()->group(); 136 QString _oldgroup = mCore->config()->group();
133 137
134 QDictIterator<KAddressBookView> it( mViewDict ); 138 Q3DictIterator<KAddressBookView> it( mViewDict );
135 for ( it.toFirst(); it.current(); ++it ) { 139 for ( it.toFirst(); it.current(); ++it ) {
136 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 140 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
137#ifdef DESKTOP_VERSION 141#ifdef DESKTOP_VERSION
138 (*it)->writeConfig( mCore->config() ); 142 (*it)->writeConfig( mCore->config() );
139#else 143#else
140 (*it).writeConfig( mCore->config() ); 144 (*it).writeConfig( mCore->config() );
141#endif 145#endif
142 } 146 }
143 147
144 Filter::save( mCore->config(), "Filter", mFilterList ); 148 Filter::save( mCore->config(), "Filter", mFilterList );
145 KABPrefs::instance()->mCurrentFilter = mActionSelectFilter->currentItem(); 149 KABPrefs::instance()->mCurrentFilter = mActionSelectFilter->currentItem();
146 150
@@ -152,25 +156,25 @@ void ViewManager::saveSettings()
152 156
153QStringList ViewManager::selectedUids() const 157QStringList ViewManager::selectedUids() const
154{ 158{
155 if ( mActiveView ) 159 if ( mActiveView )
156 return mActiveView->selectedUids(); 160 return mActiveView->selectedUids();
157 else 161 else
158 return QStringList(); 162 return QStringList();
159} 163}
160 164
161QStringList ViewManager::selectedEmails() const 165QStringList ViewManager::selectedEmails() const
162{ 166{
163 if ( mActiveView ) 167 if ( mActiveView )
164 return mActiveView->selectedEmails(); 168 return QStringList(mActiveView->selectedEmails());
165 else 169 else
166 return QStringList(); 170 return QStringList();
167} 171}
168 172
169KABC::Addressee::List ViewManager::selectedAddressees() const 173KABC::Addressee::List ViewManager::selectedAddressees() const
170{ 174{
171 KABC::Addressee::List list; 175 KABC::Addressee::List list;
172 if ( mActiveView ) { 176 if ( mActiveView ) {
173 QStringList uids = mActiveView->selectedUids(); 177 QStringList uids = mActiveView->selectedUids();
174 QStringList::Iterator it; 178 QStringList::Iterator it;
175 for ( it = uids.begin(); it != uids.end(); ++it ) { 179 for ( it = uids.begin(); it != uids.end(); ++it ) {
176 KABC::Addressee addr = mCore->addressBook()->findByUid( *it ); 180 KABC::Addressee addr = mCore->addressBook()->findByUid( *it );
@@ -547,25 +551,25 @@ void ViewManager::startDrag()
547 kdDebug(5720) << "ViewManager::startDrag: starting to drag" << endl; 551 kdDebug(5720) << "ViewManager::startDrag: starting to drag" << endl;
548 552
549#ifndef KAB_EMBEDDED 553#ifndef KAB_EMBEDDED
550 554
551 // Get the list of all the selected addressees 555 // Get the list of all the selected addressees
552 KABC::Addressee::List addrList; 556 KABC::Addressee::List addrList;
553 QStringList uidList = selectedUids(); 557 QStringList uidList = selectedUids();
554 QStringList::Iterator iter; 558 QStringList::Iterator iter;
555 for ( iter = uidList.begin(); iter != uidList.end(); ++iter ) 559 for ( iter = uidList.begin(); iter != uidList.end(); ++iter )
556 addrList.append( mCore->addressBook()->findByUid( *iter ) ); 560 addrList.append( mCore->addressBook()->findByUid( *iter ) );
557 561
558 KMultipleDrag *drag = new KMultipleDrag( this ); 562 KMultipleDrag *drag = new KMultipleDrag( this );
559 drag->addDragObject( new QTextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) ); 563 drag->addDragObject( new Q3TextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) );
560 KABC::Addressee::List::Iterator it; 564 KABC::Addressee::List::Iterator it;
561 QStringList vcards; 565 QStringList vcards;
562 for ( it = addrList.begin(); it != addrList.end(); ++it ) { 566 for ( it = addrList.begin(); it != addrList.end(); ++it ) {
563 QString vcard = QString::null; 567 QString vcard = QString::null;
564 KABC::VCardConverter converter; 568 KABC::VCardConverter converter;
565 if ( converter.addresseeToVCard( *it, vcard ) ) 569 if ( converter.addresseeToVCard( *it, vcard ) )
566 vcards.append( vcard ); 570 vcards.append( vcard );
567 } 571 }
568 drag->addDragObject( new KVCardDrag( vcards.join( "\r\n" ), this ) ); 572 drag->addDragObject( new KVCardDrag( vcards.join( "\r\n" ), this ) );
569 573
570 drag->setPixmap( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop ) ); 574 drag->setPixmap( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop ) );
571 drag->dragCopy(); 575 drag->dragCopy();
@@ -650,27 +654,27 @@ int ViewManager::filterPosition( const QString &name ) const
650 if ( name == (*it).name() ) 654 if ( name == (*it).name() )
651 return pos + 1; 655 return pos + 1;
652 656
653 return 0; 657 return 0;
654} 658}
655 659
656void ViewManager::initActions() 660void ViewManager::initActions()
657{ 661{
658//US <ActionList name="view_loadedviews"/> 662//US <ActionList name="view_loadedviews"/>
659//US <Separator/> 663//US <Separator/>
660 664
661#ifdef KAB_EMBEDDED 665#ifdef KAB_EMBEDDED
662 QPopupMenu *viewmenu = (QPopupMenu*)mCore->getViewMenu(); 666 Q3PopupMenu *viewmenu = (Q3PopupMenu*)mCore->getViewMenu();
663 QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); 667 Q3PopupMenu *settingsmenu = (Q3PopupMenu*)mCore->getSettingsMenu();
664 QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu(); 668 Q3PopupMenu *filtermenu = (Q3PopupMenu*)mCore->getFilterMenu();
665#endif //KAB_EMBEDDED 669#endif //KAB_EMBEDDED
666 670
667 mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); 671 mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" );
668#if KDE_VERSION >= 309 672#if KDE_VERSION >= 309
669 mActionSelectView->setMenuAccelsEnabled( false ); 673 mActionSelectView->setMenuAccelsEnabled( false );
670#endif 674#endif
671 connect( mActionSelectView, SIGNAL( activated( const QString& ) ), 675 connect( mActionSelectView, SIGNAL( activated( const QString& ) ),
672 SLOT( selectView( const QString& ) ) ); 676 SLOT( selectView( const QString& ) ) );
673 677
674 678
675#ifdef KAB_EMBEDDED 679#ifdef KAB_EMBEDDED
676 mActionSelectView->plug(viewmenu); 680 mActionSelectView->plug(viewmenu);
@@ -729,20 +733,20 @@ void ViewManager::initActions()
729 connect( mActionSelectFilter, SIGNAL( activated( int ) ), 733 connect( mActionSelectFilter, SIGNAL( activated( int ) ),
730 SLOT( setActiveFilter( int ) ) ); 734 SLOT( setActiveFilter( int ) ) );
731 735
732#ifdef KAB_EMBEDDED 736#ifdef KAB_EMBEDDED
733 action->plug(settingsmenu); 737 action->plug(settingsmenu);
734 mActionSelectFilter->plug(viewmenu,0); 738 mActionSelectFilter->plug(viewmenu,0);
735#endif //KAB_EMBEDDED 739#endif //KAB_EMBEDDED
736 740
737} 741}
738 742
739void ViewManager::initGUI() 743void ViewManager::initGUI()
740{ 744{
741 QHBoxLayout *layout = new QHBoxLayout( this, 0, 0 ); 745 Q3HBoxLayout *layout = new Q3HBoxLayout( this, 0, 0 );
742 mViewWidgetStack = new QWidgetStack( this ); 746 mViewWidgetStack = new Q3WidgetStack( this );
743 layout->addWidget( mViewWidgetStack ); 747 layout->addWidget( mViewWidgetStack );
744} 748}
745 749
746#ifndef KAB_EMBEDDED 750#ifndef KAB_EMBEDDED_
747#include "viewmanager.moc" 751#include "moc_viewmanager.cpp"
748#endif //KAB_EMBEDDED 752#endif //KAB_EMBEDDED
diff --git a/kaddressbook/viewmanager.h b/kaddressbook/viewmanager.h
index ab5d372..4bbdbc7 100644
--- a/kaddressbook/viewmanager.h
+++ b/kaddressbook/viewmanager.h
@@ -17,33 +17,35 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef VIEWMANAGER_H 24#ifndef VIEWMANAGER_H
25#define VIEWMANAGER_H 25#define VIEWMANAGER_H
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29//Added by qt3to4:
30#include <QDropEvent>
29#include <kaddressbookview.h> 31#include <kaddressbookview.h>
30#include <qdict.h> 32#include <q3dict.h>
31#include "filter.h" 33#include "filter.h"
32 34
33class KAction; 35class KAction;
34class KSelectAction; 36class KSelectAction;
35 37
36class KABCore; 38class KABCore;
37class QWidgetStack; 39class Q3WidgetStack;
38class QDropEvent; 40class QDropEvent;
39 41
40namespace KABC { class AddressBook; } 42namespace KABC { class AddressBook; }
41 43
42/** 44/**
43 The view manager manages the views and everything related to them. The 45 The view manager manages the views and everything related to them. The
44 manager will load the views at startup and display a view when told to 46 manager will load the views at startup and display a view when told to
45 make one active. 47 make one active.
46 48
47 The view manager will also create and manage all dialogs directly related to 49 The view manager will also create and manage all dialogs directly related to
48 views (ie: AddView, ConfigureView, DeleteView, etc). 50 views (ie: AddView, ConfigureView, DeleteView, etc).
49 */ 51 */
@@ -136,26 +138,26 @@ class ViewManager : public QWidget
136 QStringList filterNames() const; 138 QStringList filterNames() const;
137 int filterPosition( const QString &name ) const; 139 int filterPosition( const QString &name ) const;
138 QStringList viewNames() const; 140 QStringList viewNames() const;
139 int viewPosition( const QString &name ) const; 141 int viewPosition( const QString &name ) const;
140 void initActions(); 142 void initActions();
141 void initGUI(); 143 void initGUI();
142 144
143 KABCore *mCore; 145 KABCore *mCore;
144 146
145 Filter mCurrentFilter; 147 Filter mCurrentFilter;
146 Filter::List mFilterList; 148 Filter::List mFilterList;
147 149
148 QDict<KAddressBookView> mViewDict; 150 Q3Dict<KAddressBookView> mViewDict;
149 QDict<ViewFactory> mViewFactoryDict; 151 Q3Dict<ViewFactory> mViewFactoryDict;
150 QStringList mViewNameList; 152 QStringList mViewNameList;
151 153
152 QWidgetStack *mViewWidgetStack; 154 Q3WidgetStack *mViewWidgetStack;
153 KAddressBookView *mActiveView; 155 KAddressBookView *mActiveView;
154 156
155 KAction *mActionDeleteView; 157 KAction *mActionDeleteView;
156 KSelectAction *mActionSelectFilter; 158 KSelectAction *mActionSelectFilter;
157 KSelectAction *mActionSelectView; 159 KSelectAction *mActionSelectView;
158 160
159}; 161};
160 162
161#endif 163#endif
diff --git a/kaddressbook/views/cardview.cpp b/kaddressbook/views/cardview.cpp
index b6e053f..1a29f41 100644
--- a/kaddressbook/views/cardview.cpp
+++ b/kaddressbook/views/cardview.cpp
@@ -25,24 +25,32 @@
25#include "cardview.h" 25#include "cardview.h"
26 26
27#include <limits.h> 27#include <limits.h>
28 28
29#include <qpainter.h> 29#include <qpainter.h>
30#include <qtimer.h> 30#include <qtimer.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qstyle.h> 33#include <qstyle.h>
34#include <qcursor.h> 34#include <qcursor.h>
35#include <qtooltip.h> 35#include <qtooltip.h>
36#include <qapplication.h> 36#include <qapplication.h>
37//Added by qt3to4:
38#include <QKeyEvent>
39#include <Q3PtrList>
40#include <QResizeEvent>
41#include <QFocusEvent>
42#include <QMouseEvent>
43#include <QEvent>
44#include <QWheelEvent>
37 45
38#include "kabprefs.h" 46#include "kabprefs.h"
39#include <kdebug.h> 47#include <kdebug.h>
40#include <kglobalsettings.h> 48#include <kglobalsettings.h>
41//END includes 49//END includes
42 50
43#define MIN_ITEM_WIDTH 80 51#define MIN_ITEM_WIDTH 80
44 52
45//BEGIN Helpers 53//BEGIN Helpers
46////////////////////////////////////// 54//////////////////////////////////////
47// CardViewTip 55// CardViewTip
48class CardViewTip : public QLabel { 56class CardViewTip : public QLabel {
@@ -62,29 +70,29 @@ class CardViewTip : public QLabel {
62 hide(); 70 hide();
63 } 71 }
64}; 72};
65 73
66////////////////////////////////////// 74//////////////////////////////////////
67// CardViewItemList 75// CardViewItemList
68 76
69 77
70// 78//
71// Warning: make sure you use findRef() instead of find() to find an 79// Warning: make sure you use findRef() instead of find() to find an
72// item! Only the pointer value is unique in the list. 80// item! Only the pointer value is unique in the list.
73// 81//
74class CardViewItemList : public QPtrList<CardViewItem> 82class CardViewItemList : public Q3PtrList<CardViewItem>
75{ 83{
76 protected: 84 protected:
77 virtual int compareItems(QPtrCollection::Item item1, 85 virtual int compareItems(Q3PtrCollection::Item item1,
78 QPtrCollection::Item item2) 86 Q3PtrCollection::Item item2)
79 { 87 {
80 CardViewItem *cItem1 = (CardViewItem*)item1; 88 CardViewItem *cItem1 = (CardViewItem*)item1;
81 CardViewItem *cItem2 = (CardViewItem*)item2; 89 CardViewItem *cItem2 = (CardViewItem*)item2;
82 90
83 if ( cItem1 == cItem2 ) 91 if ( cItem1 == cItem2 )
84 return 0; 92 return 0;
85 93
86 if ((cItem1 == 0) || (cItem2 == 0)) 94 if ((cItem1 == 0) || (cItem2 == 0))
87 return cItem1 ? -1 : 1; 95 return cItem1 ? -1 : 1;
88 96
89 if (cItem1->caption() < cItem2->caption()) 97 if (cItem1->caption() < cItem2->caption())
90 return -1; 98 return -1;
@@ -152,25 +160,25 @@ class CardViewPrivate
152 mItemMargin( 0 ), 160 mItemMargin( 0 ),
153 mItemSpacing( 10 ), 161 mItemSpacing( 10 ),
154 mItemWidth( 200 ), 162 mItemWidth( 200 ),
155 mMaxFieldLines( INT_MAX ), 163 mMaxFieldLines( INT_MAX ),
156 mCurrentItem( 0L ), 164 mCurrentItem( 0L ),
157 mLastClickPos( QPoint(0, 0) ), 165 mLastClickPos( QPoint(0, 0) ),
158 mResizeAnchor(0), 166 mResizeAnchor(0),
159 mRubberBandAnchor( 0 ), 167 mRubberBandAnchor( 0 ),
160 mCompText( QString::null ) 168 mCompText( QString::null )
161 {}; 169 {};
162 170
163 CardViewItemList mItemList; 171 CardViewItemList mItemList;
164 QPtrList<CardViewSeparator> mSeparatorList; 172 Q3PtrList<CardViewSeparator> mSeparatorList;
165 QFontMetrics *mFm; 173 QFontMetrics *mFm;
166 QFontMetrics *mBFm; // bold font 174 QFontMetrics *mBFm; // bold font
167 QFont mHeaderFont; // custom header font 175 QFont mHeaderFont; // custom header font
168 CardView::SelectionMode mSelectionMode; 176 CardView::SelectionMode mSelectionMode;
169 bool mDrawCardBorder; 177 bool mDrawCardBorder;
170 bool mDrawFieldLabels; 178 bool mDrawFieldLabels;
171 bool mDrawSeparators; 179 bool mDrawSeparators;
172 int mSepWidth; 180 int mSepWidth;
173 bool mShowEmptyFields; 181 bool mShowEmptyFields;
174 bool mLayoutDirty; 182 bool mLayoutDirty;
175 bool mLastClickOnItem; 183 bool mLastClickOnItem;
176 uint mItemMargin; // internal margin in items 184 uint mItemMargin; // internal margin in items
@@ -199,25 +207,25 @@ class CardViewPrivate
199}; 207};
200 208
201class CardViewItemPrivate 209class CardViewItemPrivate
202{ 210{
203 public: 211 public:
204 CardViewItemPrivate() : 212 CardViewItemPrivate() :
205 mSelected( false ), 213 mSelected( false ),
206 x( 0 ), 214 x( 0 ),
207 y( 0 ){}; 215 y( 0 ){};
208 216
209 217
210 QString mCaption; 218 QString mCaption;
211 QPtrList< CardViewItem::Field > mFieldList; 219 Q3PtrList< CardViewItem::Field > mFieldList;
212 bool mSelected; 220 bool mSelected;
213 int x; // horizontal position, set by the view 221 int x; // horizontal position, set by the view
214 int y; // vertical position, set by the view 222 int y; // vertical position, set by the view
215 int maxLabelWidth; // the width of the widest label, according to the view font. 223 int maxLabelWidth; // the width of the widest label, according to the view font.
216 int hcache; // height cache 224 int hcache; // height cache
217}; 225};
218//END Private Data 226//END Private Data
219 227
220//BEGIN CardViewItem 228//BEGIN CardViewItem
221 229
222CardViewItem::CardViewItem(CardView *parent, QString caption) 230CardViewItem::CardViewItem(CardView *parent, QString caption)
223 : d(new CardViewItemPrivate()), mView(parent) 231 : d(new CardViewItemPrivate()), mView(parent)
@@ -304,25 +312,25 @@ void CardViewItem::paintCard(QPainter *p, QColorGroup &cg)
304 p->save(); 312 p->save();
305 QFont bFont = mView->headerFont(); 313 QFont bFont = mView->headerFont();
306 //bFont.setBold(true); 314 //bFont.setBold(true);
307 p->setFont(bFont); 315 p->setFont(bFont);
308 if (isSelected()) 316 if (isSelected())
309 p->setPen(cg.highlightedText()); 317 p->setPen(cg.highlightedText());
310 else 318 else
311 p->setPen(cg.buttonText()); 319 p->setPen(cg.buttonText());
312 p->drawText(2+mg, 2+mg + bFm.ascent()/*bFm.height()*//*-bFm.descent()*//*-bFm.leading()*/, trimString(d->mCaption, w-4, bFm)); 320 p->drawText(2+mg, 2+mg + bFm.ascent()/*bFm.height()*//*-bFm.descent()*//*-bFm.leading()*/, trimString(d->mCaption, w-4, bFm));
313 p->restore(); 321 p->restore();
314 322
315 // Go through the fields and draw them 323 // Go through the fields and draw them
316 QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); 324 Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList);
317 QString label, value; 325 QString label, value;
318 int yPos = mg + 4 + bFm.height()/* + 1*/ + fm.height(); // why the + 1 ??? (anders) 326 int yPos = mg + 4 + bFm.height()/* + 1*/ + fm.height(); // why the + 1 ??? (anders)
319 p->setPen(cg.text()); 327 p->setPen(cg.text());
320 328
321 int fh = fm.height(); 329 int fh = fm.height();
322 int cln( 0 ); 330 int cln( 0 );
323 QString tmp; 331 QString tmp;
324 int maxLines = mView->maxFieldLines(); 332 int maxLines = mView->maxFieldLines();
325 for (iter.toFirst(); iter.current(); ++iter) 333 for (iter.toFirst(); iter.current(); ++iter)
326 { 334 {
327 value = (*iter)->second; 335 value = (*iter)->second;
328 if ( value.isEmpty() && ! mView->d->mShowEmptyFields ) 336 if ( value.isEmpty() && ! mView->d->mShowEmptyFields )
@@ -399,30 +407,30 @@ int CardViewItem::height( bool allowCache ) const
399 int baseHeight = 8 + ( 2 * mView->itemMargin() ); 407 int baseHeight = 8 + ( 2 * mView->itemMargin() );
400 408
401 // size of font for each field 409 // size of font for each field
402 // 2 pad for each field 410 // 2 pad for each field
403 411
404 // anders: if the view does not show empty fields, check for value 412 // anders: if the view does not show empty fields, check for value
405 bool sef = mView->showEmptyFields(); 413 bool sef = mView->showEmptyFields();
406 int fh = mView->d->mFm->height();//lineSpacing(); // font height 414 int fh = mView->d->mFm->height();//lineSpacing(); // font height
407 //int sp = QMAX( 0, 2- mView->d->mFm->leading() ); // field spacing NOTE make a property 415 //int sp = QMAX( 0, 2- mView->d->mFm->leading() ); // field spacing NOTE make a property
408 int fieldHeight = 0; 416 int fieldHeight = 0;
409 int lines; 417 int lines;
410 int maxLines( mView->maxFieldLines() ); 418 int maxLines( mView->maxFieldLines() );
411 QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); 419 Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList);
412 for (iter.toFirst(); iter.current(); ++iter) 420 for (iter.toFirst(); iter.current(); ++iter)
413 { 421 {
414 if ( !sef && (*iter)->second.isEmpty() ) 422 if ( !sef && (*iter)->second.isEmpty() )
415 continue; 423 continue;
416 lines = QMIN( (*iter)->second.contains('\n') + 1, maxLines ); 424 lines = QMIN( (*iter)->second.count('\n') + 1, maxLines );
417 fieldHeight += ( lines * fh ) + 2;//sp; 425 fieldHeight += ( lines * fh ) + 2;//sp;
418 } 426 }
419 427
420 // height of caption font (bold) 428 // height of caption font (bold)
421 fieldHeight += mView->d->mBFm->height(); 429 fieldHeight += mView->d->mBFm->height();
422 d->hcache = baseHeight + fieldHeight; 430 d->hcache = baseHeight + fieldHeight;
423 return d->hcache; 431 return d->hcache;
424} 432}
425 433
426bool CardViewItem::isSelected() const 434bool CardViewItem::isSelected() const
427{ 435{
428 return d->mSelected; 436 return d->mSelected;
@@ -441,25 +449,25 @@ void CardViewItem::insertField(const QString &label, const QString &value)
441 449
442 if (mView) 450 if (mView)
443 { 451 {
444 mView->setLayoutDirty(true); 452 mView->setLayoutDirty(true);
445 d->maxLabelWidth = QMAX( mView->d->mFm->width( label ), d->maxLabelWidth ); 453 d->maxLabelWidth = QMAX( mView->d->mFm->width( label ), d->maxLabelWidth );
446 } 454 }
447} 455}
448 456
449void CardViewItem::removeField(const QString &label) 457void CardViewItem::removeField(const QString &label)
450{ 458{
451 CardViewItem::Field *f; 459 CardViewItem::Field *f;
452 460
453 QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); 461 Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList);
454 for (iter.toFirst(); iter.current(); ++iter) 462 for (iter.toFirst(); iter.current(); ++iter)
455 { 463 {
456 f = *iter; 464 f = *iter;
457 if (f->first == label) 465 if (f->first == label)
458 break; 466 break;
459 } 467 }
460 468
461 if (*iter) 469 if (*iter)
462 d->mFieldList.remove(*iter); 470 d->mFieldList.remove(*iter);
463 d->hcache = 0; 471 d->hcache = 0;
464 472
465 if (mView) 473 if (mView)
@@ -514,25 +522,25 @@ void CardViewItem::repaintCard()
514 if (mView) 522 if (mView)
515 mView->repaintItem(this); 523 mView->repaintItem(this);
516} 524}
517 525
518void CardViewItem::setCaption(const QString &caption) 526void CardViewItem::setCaption(const QString &caption)
519{ 527{
520 d->mCaption = caption; 528 d->mCaption = caption;
521 repaintCard(); 529 repaintCard();
522} 530}
523 531
524QString CardViewItem::fieldValue(const QString &label) 532QString CardViewItem::fieldValue(const QString &label)
525{ 533{
526 QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); 534 Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList);
527 for (iter.toFirst(); iter.current(); ++iter) 535 for (iter.toFirst(); iter.current(); ++iter)
528 if ((*iter)->first == label) 536 if ((*iter)->first == label)
529 return (*iter)->second; 537 return (*iter)->second;
530 538
531 return QString(); 539 return QString();
532} 540}
533 541
534 542
535void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip ) 543void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip )
536{ 544{
537 bool trimmed( false ); 545 bool trimmed( false );
538 QString s; 546 QString s;
@@ -560,42 +568,42 @@ void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip )
560 return; 568 return;
561 569
562 // y position: 570 // y position:
563 // header font height + 4px hader margin + 2px leading + item margin 571 // header font height + 4px hader margin + 2px leading + item margin
564 // + actual field index * (fontheight + 2px leading) 572 // + actual field index * (fontheight + 2px leading)
565 int maxLines = mView->maxFieldLines(); 573 int maxLines = mView->maxFieldLines();
566 bool se = mView->showEmptyFields(); 574 bool se = mView->showEmptyFields();
567 int fh = mView->d->mFm->height(); 575 int fh = mView->d->mFm->height();
568// { 576// {
569 Field *_f; 577 Field *_f;
570 for (_f = d->mFieldList.first(); _f != f; _f = d->mFieldList.next()) 578 for (_f = d->mFieldList.first(); _f != f; _f = d->mFieldList.next())
571 if ( se || ! _f->second.isEmpty() ) 579 if ( se || ! _f->second.isEmpty() )
572 y += ( QMIN(_f->second.contains('\n')+1, maxLines) * fh ) + 2; 580 y += ( QMIN(_f->second.count('\n')+1, maxLines) * fh ) + 2;
573// } 581// }
574 if ( isLabel && itempos.y() > y + fh ) 582 if ( isLabel && itempos.y() > y + fh )
575 return; 583 return;
576 // label or data? 584 // label or data?
577 s = isLabel ? f->first : f->second; 585 s = isLabel ? f->first : f->second;
578 // trimmed? 586 // trimmed?
579 int colonWidth = mView->d->mFm->width(":"); 587 int colonWidth = mView->d->mFm->width(":");
580 lw = drawLabels ? // label width 588 lw = drawLabels ? // label width
581 QMIN( w/2 - 4 - mrg, d->maxLabelWidth + colonWidth + 4 ) : 589 QMIN( w/2 - 4 - mrg, d->maxLabelWidth + colonWidth + 4 ) :
582 0; 590 0;
583 int mw = isLabel ? lw - colonWidth : w - lw - (mrg*2); // max width for string 591 int mw = isLabel ? lw - colonWidth : w - lw - (mrg*2); // max width for string
584 if ( isLabel ) 592 if ( isLabel )
585 { 593 {
586 trimmed = mView->d->mFm->width( s ) > mw - colonWidth; 594 trimmed = mView->d->mFm->width( s ) > mw - colonWidth;
587 } else { 595 } else {
588 QRect r( mView->d->mFm->boundingRect( 0, 0, INT_MAX, INT_MAX, Qt::AlignTop|Qt::AlignLeft, s ) ); 596 QRect r( mView->d->mFm->boundingRect( 0, 0, INT_MAX, INT_MAX, Qt::AlignTop|Qt::AlignLeft, s ) );
589 trimmed = r.width() > mw || r.height()/fh > QMIN(s.contains('\n') + 1, maxLines); 597 trimmed = r.width() > mw || r.height()/fh > QMIN(s.count('\n') + 1, maxLines);
590 } 598 }
591 } 599 }
592 if ( trimmed ) 600 if ( trimmed )
593 { 601 {
594 tip->setFont( (isLabel && !lw) ? mView->headerFont() : mView->font() ); // if condition is true, a header 602 tip->setFont( (isLabel && !lw) ? mView->headerFont() : mView->font() ); // if condition is true, a header
595 tip->setText( s ); 603 tip->setText( s );
596 tip->adjustSize(); 604 tip->adjustSize();
597 // find a proper position 605 // find a proper position
598 int lx; 606 int lx;
599 lx = isLabel || !drawLabels ? mrg : lw + mrg + 2 /*-1*/; 607 lx = isLabel || !drawLabels ? mrg : lw + mrg + 2 /*-1*/;
600 QPoint pnt(mView->contentsToViewport( QPoint(d->x, d->y) )); 608 QPoint pnt(mView->contentsToViewport( QPoint(d->x, d->y) ));
601 pnt += QPoint(lx, y); 609 pnt += QPoint(lx, y);
@@ -617,61 +625,61 @@ CardViewItem::Field *CardViewItem::fieldAt( const QPoint & itempos ) const
617 int iy = itempos.y(); 625 int iy = itempos.y();
618 // skip below caption 626 // skip below caption
619 if ( iy <= ypos ) 627 if ( iy <= ypos )
620 return 0; 628 return 0;
621 // try find a field 629 // try find a field
622 bool showEmpty = mView->showEmptyFields(); 630 bool showEmpty = mView->showEmptyFields();
623 int fh = mView->d->mFm->height(); 631 int fh = mView->d->mFm->height();
624 int maxLines = mView->maxFieldLines(); 632 int maxLines = mView->maxFieldLines();
625 Field *f; 633 Field *f;
626 for ( f = d->mFieldList.first(); f; f = d->mFieldList.next() ) 634 for ( f = d->mFieldList.first(); f; f = d->mFieldList.next() )
627 { 635 {
628 if ( showEmpty || !f->second.isEmpty() ) 636 if ( showEmpty || !f->second.isEmpty() )
629 ypos += ( QMIN( f->second.contains('\n')+1, maxLines ) *fh)+2; 637 ypos += ( QMIN( f->second.count('\n')+1, maxLines ) *fh)+2;
630 if ( iy <= ypos ) 638 if ( iy <= ypos )
631 break; 639 break;
632 } 640 }
633 return f ? f : 0; 641 return f ? f : 0;
634} 642}
635//END CardViewItem 643//END CardViewItem
636 644
637//BEGIN CardView 645//BEGIN CardView
638 646
639CardView::CardView(QWidget *parent, const char *name) 647CardView::CardView(QWidget *parent, const char *name)
640 : QScrollView(parent, name), 648 : Q3ScrollView(parent, name),
641 d(new CardViewPrivate()) 649 d(new CardViewPrivate())
642{ 650{
643 mFlagKeyPressed = false; 651 mFlagKeyPressed = false;
644 mFlagBlockKeyPressed = false; 652 mFlagBlockKeyPressed = false;
645 d->mItemList.setAutoDelete(true); 653 d->mItemList.setAutoDelete(true);
646 d->mSeparatorList.setAutoDelete(true); 654 d->mSeparatorList.setAutoDelete(true);
647 655
648 QFont f = font(); 656 QFont f = font();
649 d->mFm = new QFontMetrics(f); 657 d->mFm = new QFontMetrics(f);
650 f.setBold(true); 658 f.setBold(true);
651 d->mHeaderFont = f; 659 d->mHeaderFont = f;
652 d->mBFm = new QFontMetrics(f); 660 d->mBFm = new QFontMetrics(f);
653 d->mTip = ( new CardViewTip( viewport() ) ), 661 d->mTip = ( new CardViewTip( viewport() ) ),
654 d->mTip->hide(); 662 d->mTip->hide();
655 d->mTimer = ( new QTimer(this, "mouseTimer") ), 663 d->mTimer = ( new QTimer(this, "mouseTimer") ),
656 664
657 viewport()->setMouseTracking( true ); 665 viewport()->setMouseTracking( true );
658 viewport()->setFocusProxy(this); 666 viewport()->setFocusProxy(this);
659 viewport()->setFocusPolicy(WheelFocus); 667 viewport()->setFocusPolicy(Qt::WheelFocus);
660 viewport()->setBackgroundMode(PaletteBase); 668 viewport()->setBackgroundMode(Qt::PaletteBase);
661 669
662 connect( d->mTimer, SIGNAL(timeout()), this, SLOT(tryShowFullText()) ); 670 connect( d->mTimer, SIGNAL(timeout()), this, SLOT(tryShowFullText()) );
663 671
664//US setBackgroundMode(PaletteBackground, PaletteBase); 672//US setBackgroundMode(PaletteBackground, PaletteBase);
665 setBackgroundMode(PaletteBackground); 673 setBackgroundMode(Qt::PaletteBackground);
666 674
667 // no reason for a vertical scrollbar 675 // no reason for a vertical scrollbar
668 setVScrollBarMode(AlwaysOff); 676 setVScrollBarMode(AlwaysOff);
669} 677}
670 678
671CardView::~CardView() 679CardView::~CardView()
672{ 680{
673 delete d->mFm; 681 delete d->mFm;
674 delete d->mBFm; 682 delete d->mBFm;
675 delete d; 683 delete d;
676 d = 0; 684 d = 0;
677} 685}
@@ -730,25 +738,25 @@ void CardView::setCurrentItem( CardViewItem *item )
730 if ( it ) 738 if ( it )
731 it->repaintCard(); 739 it->repaintCard();
732 item->repaintCard(); 740 item->repaintCard();
733 } 741 }
734 if ( ! d->mOnSeparator ) 742 if ( ! d->mOnSeparator )
735 ensureItemVisible( item ); 743 ensureItemVisible( item );
736 emit currentChanged( item ); 744 emit currentChanged( item );
737} 745}
738 746
739CardViewItem *CardView::itemAt(const QPoint &viewPos) 747CardViewItem *CardView::itemAt(const QPoint &viewPos)
740{ 748{
741 CardViewItem *item = 0; 749 CardViewItem *item = 0;
742 QPtrListIterator<CardViewItem> iter(d->mItemList); 750 Q3PtrListIterator<CardViewItem> iter(d->mItemList);
743 bool found = false; 751 bool found = false;
744 for (iter.toFirst(); iter.current() && !found; ++iter) 752 for (iter.toFirst(); iter.current() && !found; ++iter)
745 { 753 {
746 item = *iter; 754 item = *iter;
747 //if (item->d->mRect.contains(viewPos)) 755 //if (item->d->mRect.contains(viewPos))
748 if (QRect(item->d->x, item->d->y, d->mItemWidth, item->height()).contains(viewPos)) 756 if (QRect(item->d->x, item->d->y, d->mItemWidth, item->height()).contains(viewPos))
749 found = true; 757 found = true;
750 } 758 }
751 759
752 if (found) 760 if (found)
753 return item; 761 return item;
754 762
@@ -778,25 +786,25 @@ void CardView::setSelectionMode(CardView::SelectionMode mode)
778 selectAll(false); 786 selectAll(false);
779 787
780 d->mSelectionMode = mode; 788 d->mSelectionMode = mode;
781} 789}
782 790
783CardView::SelectionMode CardView::selectionMode() const 791CardView::SelectionMode CardView::selectionMode() const
784{ 792{
785 return d->mSelectionMode; 793 return d->mSelectionMode;
786} 794}
787 795
788void CardView::selectAll(bool state) 796void CardView::selectAll(bool state)
789{ 797{
790 QPtrListIterator<CardViewItem> iter(d->mItemList); 798 Q3PtrListIterator<CardViewItem> iter(d->mItemList);
791 if (!state) 799 if (!state)
792 { 800 {
793 for (iter.toFirst(); iter.current(); ++iter) 801 for (iter.toFirst(); iter.current(); ++iter)
794 { 802 {
795 if ((*iter)->isSelected()) 803 if ((*iter)->isSelected())
796 { 804 {
797 (*iter)->setSelected(false); 805 (*iter)->setSelected(false);
798 (*iter)->repaintCard(); 806 (*iter)->repaintCard();
799 } 807 }
800 } 808 }
801 //emit selectionChanged(); // WARNING FIXME 809 //emit selectionChanged(); // WARNING FIXME
802 emit selectionChanged(0); 810 emit selectionChanged(0);
@@ -869,25 +877,25 @@ void CardView::setSelected(CardViewItem *item, bool selected)
869 emit selectionChanged(); 877 emit selectionChanged();
870 } 878 }
871} 879}
872 880
873bool CardView::isSelected(CardViewItem *item) const 881bool CardView::isSelected(CardViewItem *item) const
874{ 882{
875 return (item && item->isSelected()); 883 return (item && item->isSelected());
876} 884}
877 885
878CardViewItem *CardView::selectedItem() const 886CardViewItem *CardView::selectedItem() const
879{ 887{
880 // find the first selected item 888 // find the first selected item
881 QPtrListIterator<CardViewItem> iter(d->mItemList); 889 Q3PtrListIterator<CardViewItem> iter(d->mItemList);
882 for (iter.toFirst(); iter.current(); ++iter) 890 for (iter.toFirst(); iter.current(); ++iter)
883 { 891 {
884 if ((*iter)->isSelected()) 892 if ((*iter)->isSelected())
885 return *iter; 893 return *iter;
886 } 894 }
887 895
888 return 0; 896 return 0;
889} 897}
890 898
891CardViewItem *CardView::firstItem() const 899CardViewItem *CardView::firstItem() const
892{ 900{
893 return d->mItemList.first(); 901 return d->mItemList.first();
@@ -946,83 +954,83 @@ void CardView::drawContents(QPainter *p, int clipx, int clipy,
946 QColorGroup cg = viewport()->palette().active(); // allow setting costum colors in the viewport pale 954 QColorGroup cg = viewport()->palette().active(); // allow setting costum colors in the viewport pale
947 int cX, cY; 955 int cX, cY;
948 contentsToViewport ( clipx, clipy, cX, cY ); 956 contentsToViewport ( clipx, clipy, cX, cY );
949 QRect clipRect(clipx, clipy, clipw, cliph); 957 QRect clipRect(clipx, clipy, clipw, cliph);
950 QRect cardRect; 958 QRect cardRect;
951 QRect sepRect; 959 QRect sepRect;
952 CardViewItem *item; 960 CardViewItem *item;
953 CardViewSeparator *sep; 961 CardViewSeparator *sep;
954 // make sure the viewport is a pure background 962 // make sure the viewport is a pure background
955 viewport()->erase( QRect ( cX, cY , clipw, cliph ) ); 963 viewport()->erase( QRect ( cX, cY , clipw, cliph ) );
956 964
957 // Now tell the cards to draw, if they are in the clip region 965 // Now tell the cards to draw, if they are in the clip region
958 QPtrListIterator<CardViewItem> iter(d->mItemList); 966 Q3PtrListIterator<CardViewItem> iter(d->mItemList);
959 for (iter.toFirst(); iter.current(); ++iter) 967 for (iter.toFirst(); iter.current(); ++iter)
960 { 968 {
961 item = *iter; 969 item = *iter;
962 cardRect.setRect( item->d->x, item->d->y, d->mItemWidth, item->height() ); 970 cardRect.setRect( item->d->x, item->d->y, d->mItemWidth, item->height() );
963 971
964 if (clipRect.intersects(cardRect) || clipRect.contains(cardRect)) 972 if (clipRect.intersects(cardRect) || clipRect.contains(cardRect))
965 { 973 {
966 //kdDebug() << "\trepainting card at: " << cardRect.x() << ", " 974 //kdDebug() << "\trepainting card at: " << cardRect.x() << ", "
967 // << cardRect.y() << endl; 975 // << cardRect.y() << endl;
968 976
969 // Tell the card to paint 977 // Tell the card to paint
970 p->save(); 978 p->save();
971 p->translate(cardRect.x(), cardRect.y()); 979 p->translate(cardRect.x(), cardRect.y());
972 item->paintCard(p, cg); 980 item->paintCard(p, cg);
973 p->restore(); 981 p->restore();
974 } 982 }
975 } 983 }
976 984
977 // Followed by the separators if they are in the clip region 985 // Followed by the separators if they are in the clip region
978 QPtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); 986 Q3PtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList);
979 for (sepIter.toFirst(); sepIter.current(); ++sepIter) 987 for (sepIter.toFirst(); sepIter.current(); ++sepIter)
980 { 988 {
981 sep = *sepIter; 989 sep = *sepIter;
982 sepRect = sep->mRect; 990 sepRect = sep->mRect;
983 991
984 if (clipRect.intersects(sepRect) || clipRect.contains(sepRect)) 992 if (clipRect.intersects(sepRect) || clipRect.contains(sepRect))
985 { 993 {
986 p->save(); 994 p->save();
987 p->translate(sepRect.x(), sepRect.y()); 995 p->translate(sepRect.x(), sepRect.y());
988 sep->paintSeparator(p, cg); 996 sep->paintSeparator(p, cg);
989 p->restore(); 997 p->restore();
990 } 998 }
991 } 999 }
992} 1000}
993 1001
994void CardView::resizeEvent(QResizeEvent *e) 1002void CardView::resizeEvent(QResizeEvent *e)
995{ 1003{
996 QScrollView::resizeEvent(e); 1004 Q3ScrollView::resizeEvent(e);
997 1005
998 setLayoutDirty(true); 1006 setLayoutDirty(true);
999} 1007}
1000 1008
1001void CardView::calcLayout() 1009void CardView::calcLayout()
1002{ 1010{
1003 //kdDebug() << "CardView::calcLayout:" << endl; 1011 //kdDebug() << "CardView::calcLayout:" << endl;
1004 1012
1005 // Start in the upper left corner and layout all the 1013 // Start in the upper left corner and layout all the
1006 // cars using their height and width 1014 // cars using their height and width
1007 int maxWidth = 0; 1015 int maxWidth = 0;
1008 int maxHeight = 0; 1016 int maxHeight = 0;
1009 int xPos = 0; 1017 int xPos = 0;
1010 int yPos = 0; 1018 int yPos = 0;
1011 int cardSpacing = d->mItemSpacing; 1019 int cardSpacing = d->mItemSpacing;
1012 1020
1013 // delete the old separators 1021 // delete the old separators
1014 d->mSeparatorList.clear(); 1022 d->mSeparatorList.clear();
1015 1023
1016 QPtrListIterator<CardViewItem> iter(d->mItemList); 1024 Q3PtrListIterator<CardViewItem> iter(d->mItemList);
1017 CardViewItem *item = 0; 1025 CardViewItem *item = 0;
1018 CardViewSeparator *sep = 0; 1026 CardViewSeparator *sep = 0;
1019 xPos += cardSpacing; 1027 xPos += cardSpacing;
1020 1028
1021 for (iter.toFirst(); iter.current(); ++iter) 1029 for (iter.toFirst(); iter.current(); ++iter)
1022 { 1030 {
1023 item = *iter; 1031 item = *iter;
1024 1032
1025 yPos += cardSpacing; 1033 yPos += cardSpacing;
1026 1034
1027 if (yPos + item->height() + cardSpacing >= height() - horizontalScrollBar()->height()) 1035 if (yPos + item->height() + cardSpacing >= height() - horizontalScrollBar()->height())
1028 { 1036 {
@@ -1047,25 +1055,25 @@ void CardView::calcLayout()
1047 item->d->x = xPos; 1055 item->d->x = xPos;
1048 item->d->y = yPos; 1056 item->d->y = yPos;
1049 1057
1050 yPos += item->height(); 1058 yPos += item->height();
1051 maxWidth = QMAX(maxWidth, d->mItemWidth); 1059 maxWidth = QMAX(maxWidth, d->mItemWidth);
1052 } 1060 }
1053 1061
1054 xPos += maxWidth; 1062 xPos += maxWidth;
1055 resizeContents( xPos + cardSpacing, maxHeight ); 1063 resizeContents( xPos + cardSpacing, maxHeight );
1056 1064
1057 // Update the height of all the separators now that we know the 1065 // Update the height of all the separators now that we know the
1058 // max height of a column 1066 // max height of a column
1059 QPtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); 1067 Q3PtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList);
1060 for (sepIter.toFirst(); sepIter.current(); ++sepIter) 1068 for (sepIter.toFirst(); sepIter.current(); ++sepIter)
1061 { 1069 {
1062 (*sepIter)->mRect.setHeight(maxHeight - 2*cardSpacing - 2*d->mItemMargin); 1070 (*sepIter)->mRect.setHeight(maxHeight - 2*cardSpacing - 2*d->mItemMargin);
1063 } 1071 }
1064 1072
1065 d->mLayoutDirty = false; 1073 d->mLayoutDirty = false;
1066} 1074}
1067 1075
1068CardViewItem *CardView::itemAfter(CardViewItem *item) 1076CardViewItem *CardView::itemAfter(CardViewItem *item)
1069{ 1077{
1070 /*int pos = */d->mItemList.findRef(item); 1078 /*int pos = */d->mItemList.findRef(item);
1071 return d->mItemList.next();//at(pos+1); 1079 return d->mItemList.next();//at(pos+1);
@@ -1092,25 +1100,25 @@ uint CardView::itemSpacing()
1092 1100
1093void CardView::setItemSpacing( uint spacing ) 1101void CardView::setItemSpacing( uint spacing )
1094{ 1102{
1095 if ( spacing == d->mItemSpacing ) 1103 if ( spacing == d->mItemSpacing )
1096 return; 1104 return;
1097 1105
1098 d->mItemSpacing = spacing; 1106 d->mItemSpacing = spacing;
1099 setLayoutDirty( true ); 1107 setLayoutDirty( true );
1100} 1108}
1101 1109
1102void CardView::contentsMousePressEvent(QMouseEvent *e) 1110void CardView::contentsMousePressEvent(QMouseEvent *e)
1103{ 1111{
1104 QScrollView::contentsMousePressEvent(e); 1112 Q3ScrollView::contentsMousePressEvent(e);
1105 1113
1106 QPoint pos = e->pos(); 1114 QPoint pos = e->pos();
1107 d->mLastClickPos = pos; 1115 d->mLastClickPos = pos;
1108 1116
1109 CardViewItem *item = itemAt(pos); 1117 CardViewItem *item = itemAt(pos);
1110 1118
1111 if (item == 0) 1119 if (item == 0)
1112 { 1120 {
1113 d->mLastClickOnItem = false; 1121 d->mLastClickOnItem = false;
1114 if ( d->mOnSeparator) 1122 if ( d->mOnSeparator)
1115 { 1123 {
1116 d->mResizeAnchor = e->x()+contentsX(); 1124 d->mResizeAnchor = e->x()+contentsX();
@@ -1162,25 +1170,25 @@ void CardView::contentsMousePressEvent(QMouseEvent *e)
1162 emit selectionChanged(); 1170 emit selectionChanged();
1163 } 1171 }
1164 1172
1165 else if (d->mSelectionMode == CardView::Extended) 1173 else if (d->mSelectionMode == CardView::Extended)
1166 { 1174 {
1167 if ((e->button() & Qt::LeftButton) && 1175 if ((e->button() & Qt::LeftButton) &&
1168 (e->state() & Qt::ShiftButton)) 1176 (e->state() & Qt::ShiftButton))
1169 { 1177 {
1170 if ( item == other ) return; 1178 if ( item == other ) return;
1171 1179
1172 bool s = ! item->isSelected(); 1180 bool s = ! item->isSelected();
1173 1181
1174 if ( s && ! (e->state() & ControlButton) ) 1182 if ( s && ! (e->state() & Qt::ControlButton) )
1175 { 1183 {
1176 bool b = signalsBlocked(); 1184 bool b = signalsBlocked();
1177 blockSignals(true); 1185 blockSignals(true);
1178 selectAll(false); 1186 selectAll(false);
1179 blockSignals(b); 1187 blockSignals(b);
1180 } 1188 }
1181 1189
1182 int from, to, a, b; 1190 int from, to, a, b;
1183 a = d->mItemList.findRef( item ); 1191 a = d->mItemList.findRef( item );
1184 b = d->mItemList.findRef( other ); 1192 b = d->mItemList.findRef( other );
1185 from = a < b ? a : b; 1193 from = a < b ? a : b;
1186 to = a > b ? a : b; 1194 to = a > b ? a : b;
@@ -1210,25 +1218,25 @@ void CardView::contentsMousePressEvent(QMouseEvent *e)
1210 blockSignals(b); 1218 blockSignals(b);
1211 1219
1212 item->setSelected(true); 1220 item->setSelected(true);
1213 item->repaintCard(); 1221 item->repaintCard();
1214 emit selectionChanged(); 1222 emit selectionChanged();
1215 } 1223 }
1216 } 1224 }
1217 1225
1218} 1226}
1219 1227
1220void CardView::contentsMouseReleaseEvent(QMouseEvent *e) 1228void CardView::contentsMouseReleaseEvent(QMouseEvent *e)
1221{ 1229{
1222 QScrollView::contentsMouseReleaseEvent(e); 1230 Q3ScrollView::contentsMouseReleaseEvent(e);
1223 1231
1224 if ( d->mResizeAnchor ) 1232 if ( d->mResizeAnchor )
1225 { 1233 {
1226 // finish the resizing: 1234 // finish the resizing:
1227 unsetCursor(); 1235 unsetCursor();
1228 // hide rubber bands 1236 // hide rubber bands
1229 int newiw = d->mItemWidth - ((d->mResizeAnchor - d->mRubberBandAnchor)/d->span); 1237 int newiw = d->mItemWidth - ((d->mResizeAnchor - d->mRubberBandAnchor)/d->span);
1230 drawRubberBands( 0 ); 1238 drawRubberBands( 0 );
1231 // we should move to reflect the new position if we are scrolled. 1239 // we should move to reflect the new position if we are scrolled.
1232 if ( contentsX() ) 1240 if ( contentsX() )
1233 { 1241 {
1234 int newX = QMAX( 0, ( d->pressed * ( newiw + d->colspace + d->mSepWidth ) ) - e->x() ); 1242 int newX = QMAX( 0, ( d->pressed * ( newiw + d->colspace + d->mSepWidth ) ) - e->x() );
@@ -1248,25 +1256,25 @@ void CardView::contentsMouseReleaseEvent(QMouseEvent *e)
1248 1256
1249 // Get the item at this position 1257 // Get the item at this position
1250 CardViewItem *item = itemAt(e->pos()); 1258 CardViewItem *item = itemAt(e->pos());
1251 1259
1252 if (item && KABPrefs::instance()->mHonorSingleClick) 1260 if (item && KABPrefs::instance()->mHonorSingleClick)
1253 { 1261 {
1254 emit executed(item); 1262 emit executed(item);
1255 } 1263 }
1256} 1264}
1257 1265
1258void CardView::contentsMouseDoubleClickEvent(QMouseEvent *e) 1266void CardView::contentsMouseDoubleClickEvent(QMouseEvent *e)
1259{ 1267{
1260 QScrollView::contentsMouseDoubleClickEvent(e); 1268 Q3ScrollView::contentsMouseDoubleClickEvent(e);
1261 1269
1262 CardViewItem *item = itemAt(e->pos()); 1270 CardViewItem *item = itemAt(e->pos());
1263 1271
1264 if (item) 1272 if (item)
1265 { 1273 {
1266 d->mCurrentItem = item; 1274 d->mCurrentItem = item;
1267 } 1275 }
1268 1276
1269 if (item && !KABPrefs::instance()->mHonorSingleClick) 1277 if (item && !KABPrefs::instance()->mHonorSingleClick)
1270 { 1278 {
1271 emit executed(item); 1279 emit executed(item);
1272 } else 1280 } else
@@ -1293,47 +1301,47 @@ void CardView::contentsMouseMoveEvent( QMouseEvent *e )
1293 1301
1294 d->mTimer->start( 500 ); 1302 d->mTimer->start( 500 );
1295 1303
1296 // see if we are over a separator 1304 // see if we are over a separator
1297 // only if we actually have them painted? 1305 // only if we actually have them painted?
1298 if ( d->mDrawSeparators ) 1306 if ( d->mDrawSeparators )
1299 { 1307 {
1300 int colcontentw = d->mItemWidth + (2*d->mItemSpacing); 1308 int colcontentw = d->mItemWidth + (2*d->mItemSpacing);
1301 int colw = colcontentw + d->mSepWidth; 1309 int colw = colcontentw + d->mSepWidth;
1302 int m = e->x()%colw; 1310 int m = e->x()%colw;
1303 if ( m >= colcontentw && m > 0 ) 1311 if ( m >= colcontentw && m > 0 )
1304 { 1312 {
1305 setCursor( SplitVCursor ); // Why does this fail sometimes? 1313 setCursor( Qt::SplitVCursor ); // Why does this fail sometimes?
1306 d->mOnSeparator = true; 1314 d->mOnSeparator = true;
1307 } 1315 }
1308 else 1316 else
1309 { 1317 {
1310 setCursor( ArrowCursor ); 1318 setCursor( Qt::ArrowCursor );
1311 d->mOnSeparator = false; 1319 d->mOnSeparator = false;
1312 } 1320 }
1313 } 1321 }
1314} 1322}
1315 1323
1316void CardView::enterEvent( QEvent * ) 1324void CardView::enterEvent( QEvent * )
1317{ 1325{
1318 d->mTimer->start( 500 ); 1326 d->mTimer->start( 500 );
1319} 1327}
1320 1328
1321void CardView::leaveEvent( QEvent * ) 1329void CardView::leaveEvent( QEvent * )
1322{ 1330{
1323 d->mTimer->stop(); 1331 d->mTimer->stop();
1324 if (d->mOnSeparator) 1332 if (d->mOnSeparator)
1325 { 1333 {
1326 d->mOnSeparator = false; 1334 d->mOnSeparator = false;
1327 setCursor( ArrowCursor ); 1335 setCursor( Qt::ArrowCursor );
1328 } 1336 }
1329} 1337}
1330 1338
1331void CardView::focusInEvent( QFocusEvent * ) 1339void CardView::focusInEvent( QFocusEvent * )
1332{ 1340{
1333 if (!d->mCurrentItem && d->mItemList.count() ) 1341 if (!d->mCurrentItem && d->mItemList.count() )
1334 { 1342 {
1335 setCurrentItem( d->mItemList.first() ); 1343 setCurrentItem( d->mItemList.first() );
1336 } 1344 }
1337 else if ( d->mCurrentItem ) 1345 else if ( d->mCurrentItem )
1338 { 1346 {
1339 d->mCurrentItem->repaintCard(); 1347 d->mCurrentItem->repaintCard();
@@ -1359,145 +1367,145 @@ void CardView::keyPressEvent( QKeyEvent *e )
1359 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 1367 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1360 e->accept(); 1368 e->accept();
1361 return; 1369 return;
1362 } 1370 }
1363 if (! e->isAutoRepeat() ) 1371 if (! e->isAutoRepeat() )
1364 mFlagKeyPressed = true; 1372 mFlagKeyPressed = true;
1365 uint pos = d->mItemList.findRef( d->mCurrentItem ); 1373 uint pos = d->mItemList.findRef( d->mCurrentItem );
1366 CardViewItem *aItem = 0L; // item that gets the focus 1374 CardViewItem *aItem = 0L; // item that gets the focus
1367 CardViewItem *old = d->mCurrentItem; 1375 CardViewItem *old = d->mCurrentItem;
1368 1376
1369 switch ( e->key() ) 1377 switch ( e->key() )
1370 { 1378 {
1371 case Key_Up: 1379 case Qt::Key_Up:
1372 if ( pos > 0 ) 1380 if ( pos > 0 )
1373 { 1381 {
1374 aItem = d->mItemList.at( pos - 1 ); 1382 aItem = d->mItemList.at( pos - 1 );
1375 setCurrentItem( aItem ); 1383 setCurrentItem( aItem );
1376 } 1384 }
1377 break; 1385 break;
1378 case Key_Down: 1386 case Qt::Key_Down:
1379 if ( pos < d->mItemList.count() - 1 ) 1387 if ( pos < d->mItemList.count() - 1 )
1380 { 1388 {
1381 aItem = d->mItemList.at( pos + 1 ); 1389 aItem = d->mItemList.at( pos + 1 );
1382 setCurrentItem( aItem ); 1390 setCurrentItem( aItem );
1383 } 1391 }
1384 break; 1392 break;
1385 case Key_Left: 1393 case Qt::Key_Left:
1386 { 1394 {
1387 // look for an item in the previous/next column, starting from 1395 // look for an item in the previous/next column, starting from
1388 // the vertical middle of the current item. 1396 // the vertical middle of the current item.
1389 // FIXME use nice calculatd measures!!! 1397 // FIXME use nice calculatd measures!!!
1390 QPoint aPoint( d->mCurrentItem->d->x, d->mCurrentItem->d->y ); 1398 QPoint aPoint( d->mCurrentItem->d->x, d->mCurrentItem->d->y );
1391 aPoint -= QPoint( 30,-(d->mCurrentItem->height()/2) ); 1399 aPoint -= QPoint( 30,-(d->mCurrentItem->height()/2) );
1392 aItem = itemAt( aPoint ); 1400 aItem = itemAt( aPoint );
1393 // maybe we hit some space below an item 1401 // maybe we hit some space below an item
1394 while ( !aItem && aPoint.y() > 27 ) 1402 while ( !aItem && aPoint.y() > 27 )
1395 { 1403 {
1396 aPoint -= QPoint( 0, 16 ); 1404 aPoint -= QPoint( 0, 16 );
1397 aItem = itemAt( aPoint ); 1405 aItem = itemAt( aPoint );
1398 } 1406 }
1399 if ( aItem ) 1407 if ( aItem )
1400 setCurrentItem( aItem ); 1408 setCurrentItem( aItem );
1401 } 1409 }
1402 break; 1410 break;
1403 case Key_Right: 1411 case Qt::Key_Right:
1404 { 1412 {
1405 // FIXME use nice calculated measures!!! 1413 // FIXME use nice calculated measures!!!
1406 QPoint aPoint( d->mCurrentItem->d->x + d->mItemWidth, d->mCurrentItem->d->y ); 1414 QPoint aPoint( d->mCurrentItem->d->x + d->mItemWidth, d->mCurrentItem->d->y );
1407 aPoint += QPoint( 30,(d->mCurrentItem->height()/2) ); 1415 aPoint += QPoint( 30,(d->mCurrentItem->height()/2) );
1408 aItem = itemAt( aPoint ); 1416 aItem = itemAt( aPoint );
1409 while ( !aItem && aPoint.y() > 27 ) 1417 while ( !aItem && aPoint.y() > 27 )
1410 { 1418 {
1411 aPoint -= QPoint( 0, 16 ); 1419 aPoint -= QPoint( 0, 16 );
1412 aItem = itemAt( aPoint ); 1420 aItem = itemAt( aPoint );
1413 } 1421 }
1414 if ( aItem ) 1422 if ( aItem )
1415 setCurrentItem( aItem ); 1423 setCurrentItem( aItem );
1416 } 1424 }
1417 break; 1425 break;
1418 case Key_Home: 1426 case Qt::Key_Home:
1419 aItem = d->mItemList.first(); 1427 aItem = d->mItemList.first();
1420 setCurrentItem( aItem ); 1428 setCurrentItem( aItem );
1421 break; 1429 break;
1422 case Key_End: 1430 case Qt::Key_End:
1423 aItem = d->mItemList.last(); 1431 aItem = d->mItemList.last();
1424 setCurrentItem( aItem ); 1432 setCurrentItem( aItem );
1425 break; 1433 break;
1426 case Key_Prior: // PageUp 1434 case Qt::Key_Prior: // PageUp
1427 { 1435 {
1428 // QListView: "Make the item above the top visible and current" 1436 // QListView: "Make the item above the top visible and current"
1429 // TODO if contentsY(), pick the top item of the leftmost visible column 1437 // TODO if contentsY(), pick the top item of the leftmost visible column
1430 if ( contentsX() <= 0 ) 1438 if ( contentsX() <= 0 )
1431 return; 1439 return;
1432 int cw = columnWidth(); 1440 int cw = columnWidth();
1433 int theCol = ( QMAX( 0, ( contentsX()/cw) * cw ) ) + d->mItemSpacing; 1441 int theCol = ( QMAX( 0, ( contentsX()/cw) * cw ) ) + d->mItemSpacing;
1434 aItem = itemAt( QPoint( theCol + 1, d->mItemSpacing + 1 ) ); 1442 aItem = itemAt( QPoint( theCol + 1, d->mItemSpacing + 1 ) );
1435 if ( aItem ) 1443 if ( aItem )
1436 setCurrentItem( aItem ); 1444 setCurrentItem( aItem );
1437 } 1445 }
1438 break; 1446 break;
1439 case Key_Next: // PageDown 1447 case Qt::Key_Next: // PageDown
1440 { 1448 {
1441 // QListView: "Make the item below the bottom visible and current" 1449 // QListView: "Make the item below the bottom visible and current"
1442 // find the first not fully visible column. 1450 // find the first not fully visible column.
1443 // TODO: consider if a partly visible (or even hidden) item at the 1451 // TODO: consider if a partly visible (or even hidden) item at the
1444 // bottom of the rightmost column exists 1452 // bottom of the rightmost column exists
1445 int cw = columnWidth(); 1453 int cw = columnWidth();
1446 int theCol = ( (( contentsX() + visibleWidth() )/cw) * cw ) + d->mItemSpacing + 1; 1454 int theCol = ( (( contentsX() + visibleWidth() )/cw) * cw ) + d->mItemSpacing + 1;
1447 // if separators are on, we may need to we may be one column further right if only the spacing/sep is hidden 1455 // if separators are on, we may need to we may be one column further right if only the spacing/sep is hidden
1448 if ( d->mDrawSeparators && cw - (( contentsX() + visibleWidth() )%cw) <= int( d->mItemSpacing + d->mSepWidth ) ) 1456 if ( d->mDrawSeparators && cw - (( contentsX() + visibleWidth() )%cw) <= int( d->mItemSpacing + d->mSepWidth ) )
1449 theCol += cw; 1457 theCol += cw;
1450 1458
1451 // make sure this is not too far right 1459 // make sure this is not too far right
1452 while ( theCol > contentsWidth() ) 1460 while ( theCol > contentsWidth() )
1453 theCol -= columnWidth(); 1461 theCol -= columnWidth();
1454 1462
1455 aItem = itemAt( QPoint( theCol, d->mItemSpacing + 1 ) ); 1463 aItem = itemAt( QPoint( theCol, d->mItemSpacing + 1 ) );
1456 1464
1457 if ( aItem ) 1465 if ( aItem )
1458 setCurrentItem( aItem ); 1466 setCurrentItem( aItem );
1459 } 1467 }
1460 break; 1468 break;
1461 case Key_Space: 1469 case Qt::Key_Space:
1462 setSelected( d->mCurrentItem, !d->mCurrentItem->isSelected() ); 1470 setSelected( d->mCurrentItem, !d->mCurrentItem->isSelected() );
1463 emit selectionChanged(); 1471 emit selectionChanged();
1464 break; 1472 break;
1465 case Key_Return: 1473 case Qt::Key_Return:
1466 case Key_Enter: 1474 case Qt::Key_Enter:
1467 { 1475 {
1468 emit returnPressed( d->mCurrentItem ); 1476 emit returnPressed( d->mCurrentItem );
1469 emit executed( d->mCurrentItem ); 1477 emit executed( d->mCurrentItem );
1470 } 1478 }
1471 break; 1479 break;
1472 default: 1480 default:
1473 if ( (e->state() & ControlButton) && e->key() == Key_A ) 1481 if ( (e->state() & Qt::ControlButton) && e->key() == Qt::Key_A )
1474 { 1482 {
1475 // select all 1483 // select all
1476 selectAll( true ); 1484 selectAll( true );
1477 break; 1485 break;
1478 } 1486 }
1479 // if we have a string, do autosearch 1487 // if we have a string, do autosearch
1480 else if ( ! e->text().isEmpty() && e->text()[0].isPrint() ) 1488 else if ( ! e->text().isEmpty() && e->text()[0].isPrint() )
1481 { 1489 {
1482 1490
1483 } 1491 }
1484 break; 1492 break;
1485 } 1493 }
1486 // handle selection 1494 // handle selection
1487 if ( aItem ) 1495 if ( aItem )
1488 { 1496 {
1489 if ( d->mSelectionMode == CardView::Extended ) 1497 if ( d->mSelectionMode == CardView::Extended )
1490 { 1498 {
1491 if ( (e->state() & ShiftButton) ) 1499 if ( (e->state() & Qt::ShiftButton) )
1492 { 1500 {
1493 // shift button: toggle range 1501 // shift button: toggle range
1494 // if control button is pressed, leave all items 1502 // if control button is pressed, leave all items
1495 // and toggle selection current->old current 1503 // and toggle selection current->old current
1496 // otherwise, ?????? 1504 // otherwise, ??????
1497 bool s = ! aItem->isSelected(); 1505 bool s = ! aItem->isSelected();
1498 int from, to, a, b; 1506 int from, to, a, b;
1499 a = d->mItemList.findRef( aItem ); 1507 a = d->mItemList.findRef( aItem );
1500 b = d->mItemList.findRef( old ); 1508 b = d->mItemList.findRef( old );
1501 from = a < b ? a : b; 1509 from = a < b ? a : b;
1502 to = a > b ? a : b; 1510 to = a > b ? a : b;
1503 1511
@@ -1510,25 +1518,25 @@ void CardView::keyPressEvent( QKeyEvent *e )
1510 } 1518 }
1511 1519
1512 //kdDebug()<<"selecting items "<<from<<" - "<<to<<" ( "<<s<<" )"<<endl; 1520 //kdDebug()<<"selecting items "<<from<<" - "<<to<<" ( "<<s<<" )"<<endl;
1513 CardViewItem *item; 1521 CardViewItem *item;
1514 for ( ; from <= to; from++ ) 1522 for ( ; from <= to; from++ )
1515 { 1523 {
1516 item = d->mItemList.at( from ); 1524 item = d->mItemList.at( from );
1517 item->setSelected( s ); 1525 item->setSelected( s );
1518 repaintItem( item ); 1526 repaintItem( item );
1519 } 1527 }
1520 emit selectionChanged(); 1528 emit selectionChanged();
1521 } 1529 }
1522 else if ( (e->state() & ControlButton) ) 1530 else if ( (e->state() & Qt::ControlButton) )
1523 { 1531 {
1524 // control button: do nothing 1532 // control button: do nothing
1525 } 1533 }
1526 else 1534 else
1527 { 1535 {
1528 // no button: move selection to this item 1536 // no button: move selection to this item
1529 bool b = signalsBlocked(); 1537 bool b = signalsBlocked();
1530 blockSignals(true); 1538 blockSignals(true);
1531 selectAll(false); 1539 selectAll(false);
1532 blockSignals(b); 1540 blockSignals(b);
1533 1541
1534 setSelected( aItem, true ); 1542 setSelected( aItem, true );
@@ -1629,27 +1637,27 @@ void CardView::tryShowFullText()
1629 } 1637 }
1630} 1638}
1631 1639
1632void CardView::drawRubberBands( int pos ) 1640void CardView::drawRubberBands( int pos )
1633{ 1641{
1634 if ( pos && ((pos-d->firstX)/d->span) - d->colspace - d->mSepWidth < MIN_ITEM_WIDTH ) return; 1642 if ( pos && ((pos-d->firstX)/d->span) - d->colspace - d->mSepWidth < MIN_ITEM_WIDTH ) return;
1635 1643
1636 int tmpcw = (d->mRubberBandAnchor-d->firstX)/d->span; 1644 int tmpcw = (d->mRubberBandAnchor-d->firstX)/d->span;
1637 int x = d->firstX + tmpcw - d->mSepWidth - contentsX(); 1645 int x = d->firstX + tmpcw - d->mSepWidth - contentsX();
1638 int h = visibleHeight(); 1646 int h = visibleHeight();
1639 1647
1640 QPainter p( viewport() ); 1648 QPainter p( viewport() );
1641 p.setRasterOp( XorROP ); 1649 p.setCompositionMode( QPainter::CompositionMode_Xor );
1642 p.setPen( gray ); 1650 p.setPen( Qt::gray );
1643 p.setBrush( gray ); 1651 p.setBrush( Qt::gray );
1644 uint n = d->first; 1652 uint n = d->first;
1645 // erase 1653 // erase
1646 if ( d->mRubberBandAnchor ) 1654 if ( d->mRubberBandAnchor )
1647 do { 1655 do {
1648 p.drawRect( x, 0, 2, h ); 1656 p.drawRect( x, 0, 2, h );
1649 x += tmpcw; 1657 x += tmpcw;
1650 n++; 1658 n++;
1651 } while ( x < visibleWidth() && n < d->mSeparatorList.count() ); 1659 } while ( x < visibleWidth() && n < d->mSeparatorList.count() );
1652 // paint new 1660 // paint new
1653 if ( ! pos ) return; 1661 if ( ! pos ) return;
1654 tmpcw = (pos - d->firstX)/d->span; 1662 tmpcw = (pos - d->firstX)/d->span;
1655 n = d->first; 1663 n = d->first;
@@ -1690,25 +1698,25 @@ void CardView::setHeaderFont( const QFont &fnt )
1690 d->mHeaderFont = fnt; 1698 d->mHeaderFont = fnt;
1691 delete d->mBFm; 1699 delete d->mBFm;
1692 d->mBFm = new QFontMetrics( fnt ); 1700 d->mBFm = new QFontMetrics( fnt );
1693} 1701}
1694 1702
1695QFont CardView::headerFont() const 1703QFont CardView::headerFont() const
1696{ 1704{
1697 return d->mHeaderFont; 1705 return d->mHeaderFont;
1698} 1706}
1699 1707
1700void CardView::setFont( const QFont &fnt ) 1708void CardView::setFont( const QFont &fnt )
1701{ 1709{
1702 QScrollView::setFont( fnt ); 1710 Q3ScrollView::setFont( fnt );
1703 delete d->mFm; 1711 delete d->mFm;
1704 d->mFm = new QFontMetrics( fnt ); 1712 d->mFm = new QFontMetrics( fnt );
1705} 1713}
1706 1714
1707int CardView::separatorWidth() 1715int CardView::separatorWidth()
1708{ 1716{
1709 return d->mSepWidth; 1717 return d->mSepWidth;
1710} 1718}
1711 1719
1712void CardView::setSeparatorWidth( int width ) 1720void CardView::setSeparatorWidth( int width )
1713{ 1721{
1714 d->mSepWidth = width; 1722 d->mSepWidth = width;
@@ -1727,24 +1735,24 @@ void CardView::setMaxFieldLines( int howmany )
1727} 1735}
1728 1736
1729void CardView::keyReleaseEvent ( QKeyEvent * e ) 1737void CardView::keyReleaseEvent ( QKeyEvent * e )
1730{ 1738{
1731 if ( mFlagBlockKeyPressed ) 1739 if ( mFlagBlockKeyPressed )
1732 return; 1740 return;
1733 if ( !e->isAutoRepeat() ) { 1741 if ( !e->isAutoRepeat() ) {
1734 mFlagBlockKeyPressed = true; 1742 mFlagBlockKeyPressed = true;
1735 qApp->processEvents(); 1743 qApp->processEvents();
1736 mFlagBlockKeyPressed = false; 1744 mFlagBlockKeyPressed = false;
1737 mFlagKeyPressed = false; 1745 mFlagKeyPressed = false;
1738 } 1746 }
1739 QScrollView::keyReleaseEvent ( e ); 1747 Q3ScrollView::keyReleaseEvent ( e );
1740} 1748}
1741 1749
1742 1750
1743 1751
1744 1752
1745 1753
1746//END Cardview 1754//END Cardview
1747 1755
1748#ifndef KAB_EMBEDDED 1756#ifndef KAB_EMBEDDED_
1749#include "cardview.moc" 1757#include "moc_cardview.cpp"
1750#endif //KAB_EMBEDDED 1758#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/cardview.h b/kaddressbook/views/cardview.h
index 2ea3771..9c245ea 100644
--- a/kaddressbook/views/cardview.h
+++ b/kaddressbook/views/cardview.h
@@ -1,21 +1,29 @@
1#ifndef CARDVIEW_H 1#ifndef CARDVIEW_H
2#define CARDVIEW_H 2#define CARDVIEW_H
3 3
4#include <qscrollview.h> 4#include <q3scrollview.h>
5#include <qptrlist.h> 5#include <q3ptrlist.h>
6#include <qstring.h> 6#include <qstring.h>
7#include <qrect.h> 7#include <qrect.h>
8#include <qpair.h> 8#include <qpair.h>
9#include <qpoint.h> 9#include <qpoint.h>
10//Added by qt3to4:
11#include <QWheelEvent>
12#include <QResizeEvent>
13#include <QFocusEvent>
14#include <QLabel>
15#include <QMouseEvent>
16#include <QKeyEvent>
17#include <QEvent>
10 18
11class QLabel; 19class QLabel;
12class QPainter; 20class QPainter;
13class QResizeEvent; 21class QResizeEvent;
14class QMouseEvent; 22class QMouseEvent;
15class CardView; 23class CardView;
16class CardViewPrivate; 24class CardViewPrivate;
17class CardViewItemPrivate; 25class CardViewItemPrivate;
18class CardViewTip; 26class CardViewTip;
19 27
20/** Represents a single card (item) in the card view. A card has a caption 28/** Represents a single card (item) in the card view. A card has a caption
21* and a list of fields. A Field is a label<->value pair. The labels in a 29* and a list of fields. A Field is a label<->value pair. The labels in a
@@ -139,25 +147,25 @@ class CardViewItem
139 147
140/** The CardView is a method of displaying data in cards. This idea is 148/** The CardView is a method of displaying data in cards. This idea is
141* similar to the idea of a rolodex or business cards. Each card has a 149* similar to the idea of a rolodex or business cards. Each card has a
142* caption and a list of fields, which are label<->value pairs. The CardView 150* caption and a list of fields, which are label<->value pairs. The CardView
143* displays multiple cards in a grid. The Cards are sorted based on their 151* displays multiple cards in a grid. The Cards are sorted based on their
144* caption. 152* caption.
145* 153*
146* The CardView class is designed to mirror the API of the QListView or 154* The CardView class is designed to mirror the API of the QListView or
147* QIconView. The CardView is also completely independant of KAddressBook and 155* QIconView. The CardView is also completely independant of KAddressBook and
148* can be used elsewhere. With the exception of a few simple config checks, 156* can be used elsewhere. With the exception of a few simple config checks,
149* the CardView is also 100% independant of KDE. 157* the CardView is also 100% independant of KDE.
150*/ 158*/
151class CardView : public QScrollView 159class CardView : public Q3ScrollView
152{ 160{
153 friend class CardViewItem; 161 friend class CardViewItem;
154 162
155 Q_OBJECT 163 Q_OBJECT
156 164
157 public: 165 public:
158 /** Constructor. 166 /** Constructor.
159 */ 167 */
160 CardView(QWidget *parent, const char *name); 168 CardView(QWidget *parent, const char *name);
161 virtual ~CardView(); 169 virtual ~CardView();
162 170
163 /** Inserts the item into the card view. This method does not have 171 /** Inserts the item into the card view. This method does not have
diff --git a/kaddressbook/views/colorlistbox.cpp b/kaddressbook/views/colorlistbox.cpp
index 2bddca6..46a59a1 100644
--- a/kaddressbook/views/colorlistbox.cpp
+++ b/kaddressbook/views/colorlistbox.cpp
@@ -10,53 +10,58 @@
10 * This program is distributed in the hope that it will be useful, 10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 * 18 *
19 */ 19 */
20 20
21#include <qpainter.h> 21#include <qpainter.h>
22//Added by qt3to4:
23#include <QDragEnterEvent>
24#include <QDropEvent>
25#include <QDragMoveEvent>
26#include <QDragLeaveEvent>
22 27
23#include <kcolordialog.h> 28#include <kcolordialog.h>
24 29
25#ifndef KAB_EMBEDDED 30#ifndef KAB_EMBEDDED
26#include <kcolordrag.h> 31#include <kcolordrag.h>
27#endif //KAB_EMBEDDED 32#endif //KAB_EMBEDDED
28 33
29#include "colorlistbox.h" 34#include "colorlistbox.h"
30#ifdef DESKTOP_VERSION 35#ifdef DESKTOP_VERSION
31#include <qcolordialog.h> 36#include <qcolordialog.h>
32#endif 37#endif
33 38
34ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f ) 39ColorListBox::ColorListBox( QWidget *parent, const char *name, Qt::WFlags f )
35 :KListBox( parent, name, f ), mCurrentOnDragEnter(-1) 40 :KListBox( parent, name, f ), mCurrentOnDragEnter(-1)
36{ 41{
37 connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) ); 42 connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) );
38 connect( this, SIGNAL(clicked(QListBoxItem *)), this, SLOT(slotNewColor(QListBoxItem *)) ); 43 connect( this, SIGNAL(clicked(Q3ListBoxItem *)), this, SLOT(slotNewColor(Q3ListBoxItem *)) );
39 setAcceptDrops( true); 44 setAcceptDrops( true);
40} 45}
41 46
42 47
43void ColorListBox::setEnabled( bool state ) 48void ColorListBox::setEnabled( bool state )
44{ 49{
45 if( state == isEnabled() ) 50 if( state == isEnabled() )
46 { 51 {
47 return; 52 return;
48 } 53 }
49 54
50 QListBox::setEnabled( state ); 55 Q3ListBox::setEnabled( state );
51 for( uint i=0; i<count(); i++ ) 56 for( uint i=0; i<count(); i++ )
52 { 57 {
53 updateItem( i ); 58 updateItem( i );
54 } 59 }
55} 60}
56 61
57 62
58void ColorListBox::setColor( uint index, const QColor &color ) 63void ColorListBox::setColor( uint index, const QColor &color )
59{ 64{
60 if( index < count() ) 65 if( index < count() )
61 { 66 {
62 ColorListItem *colorItem = (ColorListItem*)item(index); 67 ColorListItem *colorItem = (ColorListItem*)item(index);
@@ -66,28 +71,28 @@ void ColorListBox::setColor( uint index, const QColor &color )
66} 71}
67 72
68 73
69QColor ColorListBox::color( uint index ) const 74QColor ColorListBox::color( uint index ) const
70{ 75{
71 if( index < count() ) 76 if( index < count() )
72 { 77 {
73 ColorListItem *colorItem = (ColorListItem*)item(index); 78 ColorListItem *colorItem = (ColorListItem*)item(index);
74 return( colorItem->color() ); 79 return( colorItem->color() );
75 } 80 }
76 else 81 else
77 { 82 {
78 return( black ); 83 return( Qt::black );
79 } 84 }
80} 85}
81void ColorListBox::slotNewColor(QListBoxItem * i) 86void ColorListBox::slotNewColor(Q3ListBoxItem * i)
82{ 87{
83 if ( i ) 88 if ( i )
84 newColor( index( i ) ); 89 newColor( index( i ) );
85} 90}
86 91
87void ColorListBox::newColor( int index ) 92void ColorListBox::newColor( int index )
88{ 93{
89 if( isEnabled() == false ) 94 if( isEnabled() == false )
90 { 95 {
91 return; 96 return;
92 } 97 }
93 98
@@ -189,25 +194,25 @@ void ColorListBox::dropEvent( QDropEvent *e )
189 mCurrentOnDragEnter = -1; 194 mCurrentOnDragEnter = -1;
190 } 195 }
191 196
192#else //KAB_EMBEDDED 197#else //KAB_EMBEDDED
193qDebug("ColorListBox::dropEvent drag&drop currently not supported"); 198qDebug("ColorListBox::dropEvent drag&drop currently not supported");
194#endif //KAB_EMBEDDED 199#endif //KAB_EMBEDDED
195 200
196} 201}
197 202
198 203
199 204
200ColorListItem::ColorListItem( const QString &text, const QColor &color ) 205ColorListItem::ColorListItem( const QString &text, const QColor &color )
201 : QListBoxItem(), mColor( color ), mBoxWidth( 30 ) 206 : Q3ListBoxItem(), mColor( color ), mBoxWidth( 30 )
202{ 207{
203 setText( text ); 208 setText( text );
204} 209}
205 210
206 211
207const QColor &ColorListItem::color( void ) 212const QColor &ColorListItem::color( void )
208{ 213{
209 return( mColor ); 214 return( mColor );
210} 215}
211 216
212 217
213void ColorListItem::setColor( const QColor &color ) 218void ColorListItem::setColor( const QColor &color )
@@ -220,26 +225,26 @@ void ColorListItem::paint( QPainter *p )
220{ 225{
221 QFontMetrics fm = p->fontMetrics(); 226 QFontMetrics fm = p->fontMetrics();
222 int h = fm.height(); 227 int h = fm.height();
223 228
224 p->drawText( mBoxWidth+3*2, fm.ascent() + fm.leading()/2, text() ); 229 p->drawText( mBoxWidth+3*2, fm.ascent() + fm.leading()/2, text() );
225 230
226 p->setPen( Qt::black ); 231 p->setPen( Qt::black );
227 p->drawRect( 3, 1, mBoxWidth, h-1 ); 232 p->drawRect( 3, 1, mBoxWidth, h-1 );
228 p->fillRect( 4, 2, mBoxWidth-2, h-3, mColor ); 233 p->fillRect( 4, 2, mBoxWidth-2, h-3, mColor );
229} 234}
230 235
231 236
232int ColorListItem::height(const QListBox *lb ) const 237int ColorListItem::height(const Q3ListBox *lb ) const
233{ 238{
234 return( lb->fontMetrics().lineSpacing()+1 ); 239 return( lb->fontMetrics().lineSpacing()+1 );
235} 240}
236 241
237 242
238int ColorListItem::width(const QListBox *lb ) const 243int ColorListItem::width(const Q3ListBox *lb ) const
239{ 244{
240 return( mBoxWidth + lb->fontMetrics().width( text() ) + 6 ); 245 return( mBoxWidth + lb->fontMetrics().width( text() ) + 6 );
241} 246}
242 247
243#ifndef KAB_EMBEDDED 248#ifndef KAB_EMBEDDED_
244#include "colorlistbox.moc" 249#include "moc_colorlistbox.cpp"
245#endif //KAB_EMBEDDED 250#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/colorlistbox.h b/kaddressbook/views/colorlistbox.h
index bb91484..31a8085 100644
--- a/kaddressbook/views/colorlistbox.h
+++ b/kaddressbook/views/colorlistbox.h
@@ -13,65 +13,70 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 * 18 *
19 */ 19 */
20 20
21#ifndef _COLOR_LISTBOX_H_ 21#ifndef _COLOR_LISTBOX_H_
22#define _COLOR_LISTBOX_H_ 22#define _COLOR_LISTBOX_H_
23 23
24#include <klistbox.h> 24#include <klistbox.h>
25//Added by qt3to4:
26#include <QDragMoveEvent>
27#include <QDragLeaveEvent>
28#include <QDropEvent>
29#include <QDragEnterEvent>
25 30
26class QDragEnterEvent; 31class QDragEnterEvent;
27class QDragLeaveEvent; 32class QDragLeaveEvent;
28class QDragMoveEvent; 33class QDragMoveEvent;
29class QDropEvent; 34class QDropEvent;
30 35
31class ColorListBox : public KListBox 36class ColorListBox : public KListBox
32{ 37{
33 Q_OBJECT 38 Q_OBJECT
34 39
35 public: 40 public:
36 ColorListBox( QWidget *parent=0, const char * name=0, WFlags f=0 ); 41 ColorListBox( QWidget *parent=0, const char * name=0, Qt::WFlags f=0 );
37 void setColor( uint index, const QColor &color ); 42 void setColor( uint index, const QColor &color );
38 QColor color( uint index ) const; 43 QColor color( uint index ) const;
39 44
40 public slots: 45 public slots:
41 virtual void setEnabled( bool state ); 46 virtual void setEnabled( bool state );
42 47
43 protected: 48 protected:
44 void dragEnterEvent( QDragEnterEvent *e ); 49 void dragEnterEvent( QDragEnterEvent *e );
45 void dragLeaveEvent( QDragLeaveEvent *e ); 50 void dragLeaveEvent( QDragLeaveEvent *e );
46 void dragMoveEvent( QDragMoveEvent *e ); 51 void dragMoveEvent( QDragMoveEvent *e );
47 void dropEvent( QDropEvent *e ); 52 void dropEvent( QDropEvent *e );
48 53
49 private slots: 54 private slots:
50 void newColor( int index ); 55 void newColor( int index );
51 void slotNewColor(QListBoxItem * i); 56 void slotNewColor(Q3ListBoxItem * i);
52 57
53 private: 58 private:
54 int mCurrentOnDragEnter; 59 int mCurrentOnDragEnter;
55 60
56}; 61};
57 62
58 63
59class ColorListItem : public QListBoxItem 64class ColorListItem : public Q3ListBoxItem
60{ 65{
61 public: 66 public:
62 ColorListItem( const QString &text, const QColor &color=Qt::black ); 67 ColorListItem( const QString &text, const QColor &color=Qt::black );
63 const QColor &color( void ); 68 const QColor &color( void );
64 void setColor( const QColor &color ); 69 void setColor( const QColor &color );
65 70
66 protected: 71 protected:
67 virtual void paint( QPainter * ); 72 virtual void paint( QPainter * );
68 virtual int height( const QListBox * ) const; 73 virtual int height( const Q3ListBox * ) const;
69 virtual int width( const QListBox * ) const; 74 virtual int width( const Q3ListBox * ) const;
70 75
71 private: 76 private:
72 QColor mColor; 77 QColor mColor;
73 int mBoxWidth; 78 int mBoxWidth;
74}; 79};
75 80
76#endif 81#endif
77 82
diff --git a/kaddressbook/views/configurecardviewdialog.cpp b/kaddressbook/views/configurecardviewdialog.cpp
index e0fbd21..b6327fe 100644
--- a/kaddressbook/views/configurecardviewdialog.cpp
+++ b/kaddressbook/views/configurecardviewdialog.cpp
@@ -16,29 +16,32 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qcheckbox.h> 27#include <qcheckbox.h>
28#include <qvbox.h> 28#include <q3vbox.h>
29#include <qgroupbox.h> 29#include <q3groupbox.h>
30#include <qspinbox.h> 30#include <qspinbox.h>
31#include <qtabwidget.h> 31#include <qtabwidget.h>
32#include <qwhatsthis.h> 32#include <q3whatsthis.h>
33//Added by qt3to4:
34#include <Q3GridLayout>
35#include <Q3Frame>
33 36
34#include <kdebug.h> 37#include <kdebug.h>
35#include <kglobal.h> 38#include <kglobal.h>
36#include <kglobalsettings.h> 39#include <kglobalsettings.h>
37#include <klocale.h> 40#include <klocale.h>
38#include <kiconloader.h> 41#include <kiconloader.h>
39#include <kconfig.h> 42#include <kconfig.h>
40#include <kfontdialog.h> 43#include <kfontdialog.h>
41 44
42#ifndef KAB_EMBEDDED 45#ifndef KAB_EMBEDDED
43#include <kpushbutton.h> 46#include <kpushbutton.h>
44#else //KAB_EMBEDDED 47#else //KAB_EMBEDDED
@@ -80,25 +83,25 @@ void ConfigureCardViewWidget::restoreSettings( KConfig *config )
80} 83}
81 84
82void ConfigureCardViewWidget::saveSettings( KConfig *config ) 85void ConfigureCardViewWidget::saveSettings( KConfig *config )
83{ 86{
84 ViewConfigureWidget::saveSettings( config ); 87 ViewConfigureWidget::saveSettings( config );
85 88
86 mAdvancedPage->saveSettings( config ); 89 mAdvancedPage->saveSettings( config );
87} 90}
88 91
89//////////////////////// 92////////////////////////
90// CardViewLookNFeelPage 93// CardViewLookNFeelPage
91CardViewLookNFeelPage::CardViewLookNFeelPage( QWidget *parent, const char *name ) 94CardViewLookNFeelPage::CardViewLookNFeelPage( QWidget *parent, const char *name )
92 : QVBox( parent, name ) 95 : Q3VBox( parent, name )
93{ 96{
94 initGUI(); 97 initGUI();
95} 98}
96 99
97CardViewLookNFeelPage::~CardViewLookNFeelPage() 100CardViewLookNFeelPage::~CardViewLookNFeelPage()
98{ 101{
99} 102}
100 103
101void CardViewLookNFeelPage::restoreSettings( KConfig *config ) 104void CardViewLookNFeelPage::restoreSettings( KConfig *config )
102{ 105{
103 // colors 106 // colors
104 cbEnableCustomColors->setChecked( config->readBoolEntry( "EnableCustomColors", false ) ); 107 cbEnableCustomColors->setChecked( config->readBoolEntry( "EnableCustomColors", false ) );
@@ -225,145 +228,145 @@ void CardViewLookNFeelPage::enableColors()
225 if ( cbEnableCustomColors->isChecked() ) 228 if ( cbEnableCustomColors->isChecked() )
226 lbColors->setFocus(); 229 lbColors->setFocus();
227} 230}
228 231
229void CardViewLookNFeelPage::initGUI() 232void CardViewLookNFeelPage::initGUI()
230{ 233{
231 int spacing = KDialog::spacingHint(); 234 int spacing = KDialog::spacingHint();
232 int margin = KDialog::marginHint(); 235 int margin = KDialog::marginHint();
233 236
234 QTabWidget *tabs = new QTabWidget( this ); 237 QTabWidget *tabs = new QTabWidget( this );
235 238
236 // Layout 239 // Layout
237 QVBox *loTab = new QVBox( this, "layouttab" ); 240 Q3VBox *loTab = new Q3VBox( this, "layouttab" );
238 241
239 loTab->setSpacing( spacing ); 242 loTab->setSpacing( spacing );
240 loTab->setMargin( margin ); 243 loTab->setMargin( margin );
241 244
242 QGroupBox *gbGeneral = new QGroupBox( 1, Qt::Horizontal, i18n("General"), loTab ); 245 Q3GroupBox *gbGeneral = new Q3GroupBox( 1, Qt::Horizontal, i18n("General"), loTab );
243 246
244 cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral ); 247 cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral );
245 248
246 QHBox *hbSW = new QHBox( gbGeneral ); 249 Q3HBox *hbSW = new Q3HBox( gbGeneral );
247 QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW ); 250 QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW );
248 sbSepWidth = new QSpinBox( 1, 50, 1, hbSW ); 251 sbSepWidth = new QSpinBox( 1, 50, 1, hbSW );
249 lSW->setBuddy( sbSepWidth); 252 lSW->setBuddy( sbSepWidth);
250 253
251 QHBox *hbPadding = new QHBox( gbGeneral ); 254 Q3HBox *hbPadding = new Q3HBox( gbGeneral );
252 QLabel *lSpacing = new QLabel( i18n("&Padding:"), hbPadding ); 255 QLabel *lSpacing = new QLabel( i18n("&Padding:"), hbPadding );
253 sbSpacing = new QSpinBox( 0, 100, 1, hbPadding ); 256 sbSpacing = new QSpinBox( 0, 100, 1, hbPadding );
254 lSpacing->setBuddy( sbSpacing ); 257 lSpacing->setBuddy( sbSpacing );
255 258
256 QGroupBox *gbCards = new QGroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab ); 259 Q3GroupBox *gbCards = new Q3GroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab );
257 260
258 QHBox *hbMargin = new QHBox( gbCards ); 261 Q3HBox *hbMargin = new Q3HBox( gbCards );
259 QLabel *lMargin = new QLabel( i18n("&Margin:"), hbMargin ); 262 QLabel *lMargin = new QLabel( i18n("&Margin:"), hbMargin );
260 sbMargin = new QSpinBox( 0, 100, 1, hbMargin ); 263 sbMargin = new QSpinBox( 0, 100, 1, hbMargin );
261 lMargin->setBuddy( sbMargin ); 264 lMargin->setBuddy( sbMargin );
262 265
263 cbDrawBorders = new QCheckBox( i18n("Draw &borders"), gbCards ); 266 cbDrawBorders = new QCheckBox( i18n("Draw &borders"), gbCards );
264 267
265 loTab->setStretchFactor( new QWidget( loTab ), 1 ); 268 loTab->setStretchFactor( new QWidget( loTab ), 1 );
266 269
267 QWhatsThis::add( sbMargin, i18n( 270 Q3WhatsThis::add( sbMargin, i18n(
268 "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, " 271 "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, "
269 "incrementing the item margin will add space between the focus rectangle and the item data." 272 "incrementing the item margin will add space between the focus rectangle and the item data."
270 ) ); 273 ) );
271 QWhatsThis::add( lMargin, QWhatsThis::textFor( sbMargin ) ); 274 /* TODO:hacker: Q3WhatsThis::add( lMargin, Q3WhatsThis::textFor( sbMargin ) ); */
272 QWhatsThis::add( sbSpacing, i18n( 275 Q3WhatsThis::add( sbSpacing, i18n(
273 "The Item Spacing decides the distance (in pixels) between the items and anything else: the view " 276 "The Item Spacing decides the distance (in pixels) between the items and anything else: the view "
274 "borders, other items or column separators." 277 "borders, other items or column separators."
275 ) ); 278 ) );
276 QWhatsThis::add( lSpacing, QWhatsThis::textFor( sbSpacing ) ); 279 /* TODO:hacker: Q3WhatsThis::add( lSpacing, Q3WhatsThis::textFor( sbSpacing ) ); */
277 QWhatsThis::add( sbSepWidth, i18n("Sets the width of column separators") ); 280 Q3WhatsThis::add( sbSepWidth, i18n("Sets the width of column separators") );
278 QWhatsThis::add( lSW, QWhatsThis::textFor( sbSepWidth ) ); 281 /* TODO:hacker: Q3WhatsThis::add( lSW, Q3WhatsThis::textFor( sbSepWidth ) ); */
279 282
280 tabs->addTab( loTab, i18n("&Layout") ); 283 tabs->addTab( loTab, i18n("&Layout") );
281 284
282 // Colors 285 // Colors
283 QVBox *colorTab = new QVBox( this, "colortab" ); 286 Q3VBox *colorTab = new Q3VBox( this, "colortab" );
284 colorTab->setSpacing( spacing ); 287 colorTab->setSpacing( spacing );
285 colorTab->setMargin( spacing ); 288 colorTab->setMargin( spacing );
286 cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); 289 cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab );
287 connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); 290 connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) );
288 lbColors = new ColorListBox( colorTab ); 291 lbColors = new ColorListBox( colorTab );
289 tabs->addTab( colorTab, i18n("&Colors") ); 292 tabs->addTab( colorTab, i18n("&Colors") );
290 293
291 QWhatsThis::add( cbEnableCustomColors, i18n( 294 Q3WhatsThis::add( cbEnableCustomColors, i18n(
292 "If custom colors are enabled, you may choose the colors for the view below. " 295 "If custom colors are enabled, you may choose the colors for the view below. "
293 "Otherwise colors from your current KDE color scheme are used." 296 "Otherwise colors from your current KDE color scheme are used."
294 ) ); 297 ) );
295 QWhatsThis::add( lbColors, i18n( 298 Q3WhatsThis::add( lbColors, i18n(
296 "Double click or press RETURN on a item to select a color for the related strings in the view." 299 "Double click or press RETURN on a item to select a color for the related strings in the view."
297 ) ); 300 ) );
298 301
299 // Fonts 302 // Fonts
300 QVBox *fntTab = new QVBox( this, "fonttab" ); 303 Q3VBox *fntTab = new Q3VBox( this, "fonttab" );
301 304
302 fntTab->setSpacing( spacing ); 305 fntTab->setSpacing( spacing );
303 fntTab->setMargin( spacing ); 306 fntTab->setMargin( spacing );
304 307
305 cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab ); 308 cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab );
306 connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); 309 connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) );
307 310
308 vbFonts = new QWidget( fntTab ); 311 vbFonts = new QWidget( fntTab );
309 QGridLayout *gFnts = new QGridLayout( vbFonts, 2, 3 ); 312 Q3GridLayout *gFnts = new Q3GridLayout( vbFonts, 2, 3 );
310 gFnts->setSpacing( spacing ); 313 gFnts->setSpacing( spacing );
311 gFnts->setAutoAdd( true ); 314 gFnts->setAutoAdd( true );
312 gFnts->setColStretch( 1, 1 ); 315 gFnts->setColStretch( 1, 1 );
313 QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); 316 QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts );
314 lTextFont = new QLabel( vbFonts ); 317 lTextFont = new QLabel( vbFonts );
315 lTextFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); 318 lTextFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken );
316#ifndef KAB_EMBEDDED 319#ifndef KAB_EMBEDDED
317 btnFont = new KPushButton( i18n("Choose..."), vbFonts ); 320 btnFont = new KPushButton( i18n("Choose..."), vbFonts );
318#else //KAB_EMBEDDED 321#else //KAB_EMBEDDED
319 btnFont = new QPushButton( i18n("Choose..."), vbFonts ); 322 btnFont = new QPushButton( i18n("Choose..."), vbFonts );
320#endif //KAB_EMBEDDED 323#endif //KAB_EMBEDDED
321 324
322 lTFnt->setBuddy( btnFont ); 325 lTFnt->setBuddy( btnFont );
323 326
324 connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) ); 327 connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) );
325 328
326 QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); 329 QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts );
327 lHeaderFont = new QLabel( vbFonts ); 330 lHeaderFont = new QLabel( vbFonts );
328 lHeaderFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); 331 lHeaderFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken );
329#ifndef KAB_EMBEDDED 332#ifndef KAB_EMBEDDED
330 btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); 333 btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts );
331#else //KAB_EMBEDDED 334#else //KAB_EMBEDDED
332 btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts ); 335 btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts );
333#endif //KAB_EMBEDDED 336#endif //KAB_EMBEDDED
334 lHFnt->setBuddy( btnHeaderFont ); 337 lHFnt->setBuddy( btnHeaderFont );
335 connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) ); 338 connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) );
336 339
337 fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); 340 fntTab->setStretchFactor( new QWidget( fntTab ), 1 );
338 341
339 QWhatsThis::add( cbEnableCustomFonts, i18n( 342 Q3WhatsThis::add( cbEnableCustomFonts, i18n(
340 "If custom fonts are enabled, you may choose which fonts to use for this view below. " 343 "If custom fonts are enabled, you may choose which fonts to use for this view below. "
341 "Otherwise the default KDE font will be used, in bold style for the header and " 344 "Otherwise the default KDE font will be used, in bold style for the header and "
342 "normal style for the data." 345 "normal style for the data."
343 ) ); 346 ) );
344 347
345 tabs->addTab( fntTab, i18n("&Fonts") ); 348 tabs->addTab( fntTab, i18n("&Fonts") );
346 349
347 // Behaviour 350 // Behaviour
348 QVBox *behaviourTab = new QVBox( this ); 351 Q3VBox *behaviourTab = new Q3VBox( this );
349 behaviourTab->setMargin( margin ); 352 behaviourTab->setMargin( margin );
350 behaviourTab->setSpacing( spacing ); 353 behaviourTab->setSpacing( spacing );
351 354
352 cbShowEmptyFields = new QCheckBox( i18n("Show &empty fields"), behaviourTab ); 355 cbShowEmptyFields = new QCheckBox( i18n("Show &empty fields"), behaviourTab );
353 cbShowFieldLabels = new QCheckBox( i18n("Show field &labels"), behaviourTab ); 356 cbShowFieldLabels = new QCheckBox( i18n("Show field &labels"), behaviourTab );
354 357
355 behaviourTab->setStretchFactor( new QWidget( behaviourTab ), 1 ); 358 behaviourTab->setStretchFactor( new QWidget( behaviourTab ), 1 );
356 359
357 tabs->addTab( behaviourTab, i18n("Be&havior") ); 360 tabs->addTab( behaviourTab, i18n("Be&havior") );
358 361
359} 362}
360 363
361void CardViewLookNFeelPage::updateFontLabel( QFont fnt, QLabel *l ) 364void CardViewLookNFeelPage::updateFontLabel( QFont fnt, QLabel *l )
362{ 365{
363 l->setFont( fnt ); 366 l->setFont( fnt );
364 l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); 367 l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) );
365} 368}
366 369
367#ifndef KAB_EMBEDDED 370#ifndef KAB_EMBEDDED_
368#include "configurecardviewdialog.moc" 371#include "moc_configurecardviewdialog.cpp"
369#endif //KAB_EMBEDDED 372#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/configurecardviewdialog.h b/kaddressbook/views/configurecardviewdialog.h
index 7a62226..4af475d 100644
--- a/kaddressbook/views/configurecardviewdialog.h
+++ b/kaddressbook/views/configurecardviewdialog.h
@@ -17,27 +17,29 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef CONFIGURECARDVIEWDIALOG_H 24#ifndef CONFIGURECARDVIEWDIALOG_H
25#define CONFIGURECARDVIEWDIALOG_H 25#define CONFIGURECARDVIEWDIALOG_H
26 26
27#include "viewconfigurewidget.h" 27#include "viewconfigurewidget.h"
28 28
29#include <qvbox.h> 29#include <q3vbox.h>
30#include <qwidget.h> 30#include <qwidget.h>
31#include <qfont.h> 31#include <qfont.h>
32//Added by qt3to4:
33#include <QLabel>
32 34
33class QString; 35class QString;
34class QWidget; 36class QWidget;
35class QCheckBox; 37class QCheckBox;
36class QLabel; 38class QLabel;
37class KConfig; 39class KConfig;
38 40
39namespace KABC { class AddressBook; } 41namespace KABC { class AddressBook; }
40 42
41class CardViewLookAndFeelPage; 43class CardViewLookAndFeelPage;
42 44
43/** 45/**
@@ -68,25 +70,25 @@ class ConfigureCardViewWidget : public ViewConfigureWidget
68 Colors 70 Colors
69 * background color 71 * background color
70 * text color 72 * text color
71 * highlight color 73 * highlight color
72 * title/sep text color 74 * title/sep text color
73 * title/sep bg color 75 * title/sep bg color
74 76
75 Layout 77 Layout
76 * item margin 78 * item margin
77 * item spacing 79 * item spacing
78*/ 80*/
79 81
80class CardViewLookNFeelPage : public QVBox { 82class CardViewLookNFeelPage : public Q3VBox {
81 83
82 Q_OBJECT 84 Q_OBJECT
83 85
84 public: 86 public:
85 CardViewLookNFeelPage( QWidget *parent=0, const char *name=0 ); 87 CardViewLookNFeelPage( QWidget *parent=0, const char *name=0 );
86 ~CardViewLookNFeelPage(); 88 ~CardViewLookNFeelPage();
87 89
88 void restoreSettings( KConfig* ); 90 void restoreSettings( KConfig* );
89 void saveSettings( KConfig* ); 91 void saveSettings( KConfig* );
90 92
91 private slots: 93 private slots:
92 void setTextFont(); 94 void setTextFont();
diff --git a/kaddressbook/views/configuretableviewdialog.cpp b/kaddressbook/views/configuretableviewdialog.cpp
index c329cd9..7ed897a 100644
--- a/kaddressbook/views/configuretableviewdialog.cpp
+++ b/kaddressbook/views/configuretableviewdialog.cpp
@@ -18,29 +18,32 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qwidget.h> 25#include <qwidget.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qradiobutton.h> 28#include <qradiobutton.h>
29#include <qcheckbox.h> 29#include <qcheckbox.h>
30#include <qvbox.h> 30#include <q3vbox.h>
31#include <qbuttongroup.h> 31#include <q3buttongroup.h>
32#include <qtabwidget.h> 32#include <qtabwidget.h>
33#include <qwhatsthis.h> 33#include <q3whatsthis.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35//Added by qt3to4:
36#include <Q3GridLayout>
37#include <Q3Frame>
35 38
36#include <kglobal.h> 39#include <kglobal.h>
37#include <klocale.h> 40#include <klocale.h>
38#include <klineedit.h> 41#include <klineedit.h>
39#include <kurlrequester.h> 42#include <kurlrequester.h>
40#include <kiconloader.h> 43#include <kiconloader.h>
41#include <kfontdialog.h> 44#include <kfontdialog.h>
42 45
43#ifndef KAB_EMBEDDED 46#ifndef KAB_EMBEDDED
44#include <kimageio.h> 47#include <kimageio.h>
45#else //KAB_EMBEDDED 48#else //KAB_EMBEDDED
46#endif //KAB_EMBEDDED 49#endif //KAB_EMBEDDED
@@ -75,25 +78,25 @@ void ConfigureTableViewWidget::restoreSettings( KConfig *config )
75} 78}
76 79
77void ConfigureTableViewWidget::saveSettings( KConfig *config ) 80void ConfigureTableViewWidget::saveSettings( KConfig *config )
78{ 81{
79 ViewConfigureWidget::saveSettings( config ); 82 ViewConfigureWidget::saveSettings( config );
80 83
81 mPage->saveSettings( config ); 84 mPage->saveSettings( config );
82} 85}
83 86
84 87
85 88
86LookAndFeelPage::LookAndFeelPage(QWidget *parent, const char *name) 89LookAndFeelPage::LookAndFeelPage(QWidget *parent, const char *name)
87 : QVBox(parent, name) 90 : Q3VBox(parent, name)
88{ 91{
89 initGUI(); 92 initGUI();
90 93
91 // Set initial state 94 // Set initial state
92 enableBackgroundToggled(mBackgroundBox->isChecked()); 95 enableBackgroundToggled(mBackgroundBox->isChecked());
93} 96}
94 97
95void LookAndFeelPage::restoreSettings( KConfig *config ) 98void LookAndFeelPage::restoreSettings( KConfig *config )
96{ 99{
97 mAlternateButton->setChecked(config->readBoolEntry("ABackground", true)); 100 mAlternateButton->setChecked(config->readBoolEntry("ABackground", true));
98 mLineButton->setChecked(config->readBoolEntry("SingleLine", false)); 101 mLineButton->setChecked(config->readBoolEntry("SingleLine", false));
99 mToolTipBox->setChecked(config->readBoolEntry("ToolTips", true)); 102 mToolTipBox->setChecked(config->readBoolEntry("ToolTips", true));
@@ -220,30 +223,30 @@ void LookAndFeelPage::enableColors()
220 if ( cbEnableCustomColors->isChecked() ) 223 if ( cbEnableCustomColors->isChecked() )
221 lbColors->setFocus(); 224 lbColors->setFocus();
222} 225}
223 226
224void LookAndFeelPage::initGUI() 227void LookAndFeelPage::initGUI()
225{ 228{
226 int spacing = KDialog::spacingHint(); 229 int spacing = KDialog::spacingHint();
227 int margin = KDialog::marginHint(); 230 int margin = KDialog::marginHint();
228 231
229 QTabWidget *tabs = new QTabWidget( this ); 232 QTabWidget *tabs = new QTabWidget( this );
230 233
231 // General 234 // General
232 QVBox *generalTab = new QVBox( this, "generaltab" ); 235 Q3VBox *generalTab = new Q3VBox( this, "generaltab" );
233 236
234 generalTab->setSpacing( spacing ); 237 generalTab->setSpacing( spacing );
235 generalTab->setMargin( margin ); 238 generalTab->setMargin( margin );
236 239
237 QButtonGroup *group = new QButtonGroup(1, Qt::Horizontal, 240 Q3ButtonGroup *group = new Q3ButtonGroup(1, Qt::Horizontal,
238 i18n("Row Separator"), generalTab); 241 i18n("Row Separator"), generalTab);
239 242
240 mAlternateButton = new QRadioButton(i18n("Alternating backgrounds"), 243 mAlternateButton = new QRadioButton(i18n("Alternating backgrounds"),
241 group, "mAlternateButton"); 244 group, "mAlternateButton");
242 mLineButton = new QRadioButton(i18n("Single line"), group, "mLineButton"); 245 mLineButton = new QRadioButton(i18n("Single line"), group, "mLineButton");
243 mNoneButton = new QRadioButton(i18n("None"), group, "mNoneButton"); 246 mNoneButton = new QRadioButton(i18n("None"), group, "mNoneButton");
244 247
245 mBackgroundBox = new QCheckBox(i18n("Enable background image:"), generalTab, 248 mBackgroundBox = new QCheckBox(i18n("Enable background image:"), generalTab,
246 "mBackgroundBox"); 249 "mBackgroundBox");
247 connect(mBackgroundBox, SIGNAL(toggled(bool)), 250 connect(mBackgroundBox, SIGNAL(toggled(bool)),
248 SLOT(enableBackgroundToggled(bool))); 251 SLOT(enableBackgroundToggled(bool)));
249 // LR image not implemented 252 // LR image not implemented
@@ -253,93 +256,93 @@ void LookAndFeelPage::initGUI()
253 mBackgroundName->setMode(KFile::File | KFile::ExistingOnly | 256 mBackgroundName->setMode(KFile::File | KFile::ExistingOnly |
254 KFile::LocalOnly); 257 KFile::LocalOnly);
255 mBackgroundName->setFilter(KImageIO::pattern(KImageIO::Reading)); 258 mBackgroundName->setFilter(KImageIO::pattern(KImageIO::Reading));
256#endif //KAB_EMBEDDED 259#endif //KAB_EMBEDDED
257 260
258 // ToolTip Checkbox 261 // ToolTip Checkbox
259 mToolTipBox = new QCheckBox(i18n("Enable contact tooltips"), generalTab, 262 mToolTipBox = new QCheckBox(i18n("Enable contact tooltips"), generalTab,
260 "mToolTipBox"); 263 "mToolTipBox");
261 264
262 tabs->addTab( generalTab, i18n("&General") ); 265 tabs->addTab( generalTab, i18n("&General") );
263 266
264 // Colors 267 // Colors
265 QVBox *colorTab = new QVBox( this, "colortab" ); 268 Q3VBox *colorTab = new Q3VBox( this, "colortab" );
266 colorTab->setSpacing( spacing ); 269 colorTab->setSpacing( spacing );
267 colorTab->setMargin( spacing ); 270 colorTab->setMargin( spacing );
268 cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); 271 cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab );
269 connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); 272 connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) );
270 lbColors = new ColorListBox( colorTab ); 273 lbColors = new ColorListBox( colorTab );
271 tabs->addTab( colorTab, i18n("&Colors") ); 274 tabs->addTab( colorTab, i18n("&Colors") );
272 275
273 QWhatsThis::add( cbEnableCustomColors, i18n( 276 Q3WhatsThis::add( cbEnableCustomColors, i18n(
274 "If custom colors are enabled, you may choose the colors for the view below. " 277 "If custom colors are enabled, you may choose the colors for the view below. "
275 "Otherwise colors from your current KDE color scheme are used." 278 "Otherwise colors from your current KDE color scheme are used."
276 ) ); 279 ) );
277 QWhatsThis::add( lbColors, i18n( 280 Q3WhatsThis::add( lbColors, i18n(
278 "Double click or press RETURN on a item to select a color for the related strings in the view." 281 "Double click or press RETURN on a item to select a color for the related strings in the view."
279 ) ); 282 ) );
280 283
281 // Fonts 284 // Fonts
282 QVBox *fntTab = new QVBox( this, "fonttab" ); 285 Q3VBox *fntTab = new Q3VBox( this, "fonttab" );
283 286
284 fntTab->setSpacing( spacing ); 287 fntTab->setSpacing( spacing );
285 fntTab->setMargin( spacing ); 288 fntTab->setMargin( spacing );
286 289
287 cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab ); 290 cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab );
288 connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); 291 connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) );
289 292
290 vbFonts = new QWidget( fntTab ); 293 vbFonts = new QWidget( fntTab );
291 QGridLayout *gFnts = new QGridLayout( vbFonts, 2, 3 ); 294 Q3GridLayout *gFnts = new Q3GridLayout( vbFonts, 2, 3 );
292 gFnts->setSpacing( spacing ); 295 gFnts->setSpacing( spacing );
293 gFnts->setAutoAdd( true ); 296 gFnts->setAutoAdd( true );
294 gFnts->setColStretch( 1, 1 ); 297 gFnts->setColStretch( 1, 1 );
295 QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); 298 QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts );
296 lTextFont = new QLabel( vbFonts ); 299 lTextFont = new QLabel( vbFonts );
297 lTextFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); 300 lTextFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken );
298#ifndef KAB_EMBEDDED 301#ifndef KAB_EMBEDDED
299 btnFont = new KPushButton( i18n("Choose..."), vbFonts ); 302 btnFont = new KPushButton( i18n("Choose..."), vbFonts );
300#else //KAB_EMBEDDED 303#else //KAB_EMBEDDED
301 btnFont = new QPushButton( i18n("Choose..."), vbFonts ); 304 btnFont = new QPushButton( i18n("Choose..."), vbFonts );
302#endif //KAB_EMBEDDED 305#endif //KAB_EMBEDDED
303 306
304 lTFnt->setBuddy( btnFont ); 307 lTFnt->setBuddy( btnFont );
305 308
306 connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) ); 309 connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) );
307 310
308 QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); 311 QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts );
309 lHeaderFont = new QLabel( vbFonts ); 312 lHeaderFont = new QLabel( vbFonts );
310 lHeaderFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); 313 lHeaderFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken );
311#ifndef KAB_EMBEDDED 314#ifndef KAB_EMBEDDED
312 btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); 315 btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts );
313#else //KAB_EMBEDDED 316#else //KAB_EMBEDDED
314 btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts ); 317 btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts );
315#endif //KAB_EMBEDDED 318#endif //KAB_EMBEDDED
316 lHFnt->setBuddy( btnHeaderFont ); 319 lHFnt->setBuddy( btnHeaderFont );
317 connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) ); 320 connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) );
318 321
319 fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); 322 fntTab->setStretchFactor( new QWidget( fntTab ), 1 );
320 323
321 QWhatsThis::add( cbEnableCustomFonts, i18n( 324 Q3WhatsThis::add( cbEnableCustomFonts, i18n(
322 "If custom fonts are enabled, you may choose which fonts to use for this view below. " 325 "If custom fonts are enabled, you may choose which fonts to use for this view below. "
323 "Otherwise the default KDE font will be used, in bold style for the header and " 326 "Otherwise the default KDE font will be used, in bold style for the header and "
324 "normal style for the data." 327 "normal style for the data."
325 ) ); 328 ) );
326 329
327 tabs->addTab( fntTab, i18n("&Fonts") ); 330 tabs->addTab( fntTab, i18n("&Fonts") );
328 331
329} 332}
330 333
331void LookAndFeelPage::enableBackgroundToggled(bool enabled) 334void LookAndFeelPage::enableBackgroundToggled(bool enabled)
332{ 335{
333 mBackgroundName->setEnabled(enabled); 336 mBackgroundName->setEnabled(enabled);
334} 337}
335 338
336 339
337void LookAndFeelPage::updateFontLabel( QFont fnt, QLabel *l ) 340void LookAndFeelPage::updateFontLabel( QFont fnt, QLabel *l )
338{ 341{
339 l->setFont( fnt ); 342 l->setFont( fnt );
340 l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); 343 l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) );
341} 344}
342 345
343#ifndef KAB_EMBEDDED 346#ifndef KAB_EMBEDDED_
344#include "configuretableviewdialog.moc" 347#include "moc_configuretableviewdialog.cpp"
345#endif //KAB_EMBEDDED 348#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/configuretableviewdialog.h b/kaddressbook/views/configuretableviewdialog.h
index 003ccf8..8125fc9 100644
--- a/kaddressbook/views/configuretableviewdialog.h
+++ b/kaddressbook/views/configuretableviewdialog.h
@@ -17,25 +17,27 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef CONFIGURETABLEVIEWDIALOG_H 24#ifndef CONFIGURETABLEVIEWDIALOG_H
25#define CONFIGURETABLEVIEWDIALOG_H 25#define CONFIGURETABLEVIEWDIALOG_H
26 26
27#include "viewconfigurewidget.h" 27#include "viewconfigurewidget.h"
28 28
29#include <qvbox.h> 29#include <q3vbox.h>
30//Added by qt3to4:
31#include <QLabel>
30 32
31class QString; 33class QString;
32class QWidget; 34class QWidget;
33class QRadioButton; 35class QRadioButton;
34class QCheckBox; 36class QCheckBox;
35class KURLRequester; 37class KURLRequester;
36class KConfig; 38class KConfig;
37class QLabel; 39class QLabel;
38 40
39namespace KABC { class AddressBook; } 41namespace KABC { class AddressBook; }
40 42
41class LookAndFeelPage; 43class LookAndFeelPage;
@@ -54,25 +56,25 @@ class ConfigureTableViewWidget : public ViewConfigureWidget
54 virtual void restoreSettings( KConfig* ); 56 virtual void restoreSettings( KConfig* );
55 virtual void saveSettings( KConfig* ); 57 virtual void saveSettings( KConfig* );
56 58
57 private: 59 private:
58 void initGUI(); 60 void initGUI();
59 61
60 LookAndFeelPage *mPage; 62 LookAndFeelPage *mPage;
61}; 63};
62 64
63/** 65/**
64 Internal class. It is only defined here for moc 66 Internal class. It is only defined here for moc
65*/ 67*/
66class LookAndFeelPage : public QVBox 68class LookAndFeelPage : public Q3VBox
67{ 69{
68 Q_OBJECT 70 Q_OBJECT
69 71
70 public: 72 public:
71 LookAndFeelPage( QWidget *parent, const char *name = 0 ); 73 LookAndFeelPage( QWidget *parent, const char *name = 0 );
72 ~LookAndFeelPage() {} 74 ~LookAndFeelPage() {}
73 75
74 void restoreSettings( KConfig* ); 76 void restoreSettings( KConfig* );
75 void saveSettings( KConfig* ); 77 void saveSettings( KConfig* );
76 78
77 protected slots: 79 protected slots:
78 void enableBackgroundToggled( bool ); 80 void enableBackgroundToggled( bool );
diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp
index 9accf78..227645d 100644
--- a/kaddressbook/views/contactlistview.cpp
+++ b/kaddressbook/views/contactlistview.cpp
@@ -12,67 +12,73 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qheader.h> 24#include <q3header.h>
25#include <qiconset.h> 25#include <qicon.h>
26#include <qimage.h> 26#include <qimage.h>
27#include <qdragobject.h> 27#include <q3dragobject.h>
28#include <qcombobox.h> 28#include <qcombobox.h>
29#include <qpainter.h> 29#include <qpainter.h>
30#include <qbrush.h> 30#include <qbrush.h>
31#include <qevent.h> 31#include <qevent.h>
32#include <qapplication.h> 32#include <qapplication.h>
33//Added by qt3to4:
34#include <QDropEvent>
35#include <QPixmap>
36#include <QMouseEvent>
37#include <QKeyEvent>
33 38
34#include <klocale.h> 39#include <klocale.h>
35#include <kglobalsettings.h> 40#include <kglobalsettings.h>
36#include <kiconloader.h> 41#include <kiconloader.h>
37#include <kdebug.h> 42#include <kdebug.h>
38#include <kconfig.h> 43#include <kconfig.h>
39#include <kapplication.h> 44#include <kapplication.h>
40#include <kurl.h> 45#include <kurl.h>
41 46
42#include "kaddressbooktableview.h" 47#include "kaddressbooktableview.h"
43 48
44#include "contactlistview.h" 49#include "contactlistview.h"
45 50
46///////////////////////////////// 51/////////////////////////////////
47// DynamicTip Methods 52// DynamicTip Methods
48 53
49DynamicTip::DynamicTip( ContactListView *parent) 54DynamicTip::DynamicTip( ContactListView *parent)
50 : QToolTip( parent ) 55 /* TODO:hacker:: QToolTip( parent ) */
51{ 56{
52} 57}
53 58
54void DynamicTip::maybeTip( const QPoint &pos ) 59void DynamicTip::maybeTip( const QPoint &pos )
55{ 60{
61 /* TODO:hacker:
56 static bool ishidden = true; 62 static bool ishidden = true;
57 if (!parentWidget()->inherits( "ContactListView" )) 63 if (!parentWidget()->inherits( "ContactListView" ))
58 return; 64 return;
59 65
60 ContactListView *plv = (ContactListView*)parentWidget(); 66 ContactListView *plv = (ContactListView*)parentWidget();
61 if (!plv->tooltips()) 67 if (!plv->tooltips())
62 return; 68 return;
63 69
64 QPoint posVp = plv->viewport()->pos(); 70 QPoint posVp = plv->viewport()->pos();
65 71
66 QListViewItem *lvi = plv->itemAt( pos - posVp ); 72 Q3ListViewItem *lvi = plv->itemAt( pos - posVp );
67 if (!lvi) 73 if (!lvi)
68 return; 74 return;
69 75
70#ifndef KAB_EMBEDDED 76#ifndef KAB_EMBEDDED
71 ContactListViewItem *plvi = dynamic_cast< ContactListViewItem* >(lvi); 77 ContactListViewItem *plvi = dynamic_cast< ContactListViewItem* >(lvi);
72#else //KAB_EMBEDDED 78#else //KAB_EMBEDDED
73 ContactListViewItem *plvi = (ContactListViewItem*)(lvi); 79 ContactListViewItem *plvi = (ContactListViewItem*)(lvi);
74#endif //KAB_EMBEDDED 80#endif //KAB_EMBEDDED
75 81
76 if (!plvi) 82 if (!plvi)
77 return; 83 return;
78 84
@@ -142,71 +148,71 @@ void DynamicTip::maybeTip( const QPoint &pos )
142 lastw = linew; 148 lastw = linew;
143 } 149 }
144 150
145 ++i; 151 ++i;
146 } 152 }
147 } 153 }
148 154
149 tip( r, s ); 155 tip( r, s );
150 } 156 }
151 else 157 else
152 hide(); 158 hide();
153 ishidden = !ishidden; 159 ishidden = !ishidden;
154 160 */
155} 161}
156 162
157/////////////////////////// 163///////////////////////////
158// ContactListViewItem Methods 164// ContactListViewItem Methods
159 165
160ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, 166ContactListViewItem::ContactListViewItem(const KABC::Addressee &a,
161 ContactListView *parent, 167 ContactListView *parent,
162 KABC::AddressBook *doc, 168 KABC::AddressBook *doc,
163 const KABC::Field::List &fields ) 169 const KABC::Field::List &fields )
164 : KListViewItem(parent), mAddressee(a), mFields( fields ), 170 : KListViewItem(parent), mAddressee(a), mFields( fields ),
165 parentListView( parent ), mDocument(doc) 171 parentListView( parent ), mDocument(doc)
166{ 172{
167 refresh(); 173 refresh();
168} 174}
169 175
170QString ContactListViewItem::key(int column, bool ascending) const 176QString ContactListViewItem::key(int column, bool ascending) const
171{ 177{
172#ifndef DESKTOP_VERSION 178#ifndef DESKTOP_VERSION
173 int lan = KGlobal::locale()->language(); 179 int lan = KGlobal::locale()->language();
174 //qDebug("language %d ", lan); 180 //qDebug("language %d ", lan);
175 if ( lan == 1 ) { //GERMAN 181 if ( lan == 1 ) { //GERMAN
176 QString ret = QListViewItem::key(column, ascending).lower().utf8(); 182 QString ret = Q3ListViewItem::key(column, ascending).lower().utf8();
177 int start = -1; 183 int start = -1;
178 while ( (start = ret.find( 'ä', start+1)) > 0 ) { 184 while ( (start = ret.find( 'ä', start+1)) > 0 ) {
179 ret.at(start-1) = 'a'; 185 ret.at(start-1) = 'a';
180 } 186 }
181 start = -1; 187 start = -1;
182 while ( (start = ret.find( 'ö', start+1)) > 0 ) { 188 while ( (start = ret.find( 'ö', start+1)) > 0 ) {
183 ret.at(start-1) = 'o'; 189 ret.at(start-1) = 'o';
184 } 190 }
185 start = -1; 191 start = -1;
186 while ( (start = ret.find( 'ü', start+1)) > 0 ) { 192 while ( (start = ret.find( 'ü', start+1)) > 0 ) {
187 ret.at(start-1) = 'o'; 193 ret.at(start-1) = 'o';
188 } 194 }
189 start = -1; 195 start = -1;
190 while ( (start = ret.find( 'ß', start+1)) > 0 ) { 196 while ( (start = ret.find( 'ß', start+1)) > 0 ) {
191 ret.at(start-1) = 's'; 197 ret.at(start-1) = 's';
192 } 198 }
193 //qDebug("conv string %s ", ret.latin1()); 199 //qDebug("conv string %s ", ret.latin1());
194 200
195 return ret; 201 return ret;
196 202
197 } 203 }
198 else 204 else
199#endif 205#endif
200 return QListViewItem::key(column, ascending).lower(); 206 return Q3ListViewItem::key(column, ascending).lower();
201} 207}
202 208
203void ContactListViewItem::paintCell(QPainter * p, 209void ContactListViewItem::paintCell(QPainter * p,
204 const QColorGroup & cg, 210 const QColorGroup & cg,
205 int column, 211 int column,
206 int width, 212 int width,
207 int align) 213 int align)
208{ 214{
209 KListViewItem::paintCell(p, cg, column, width, align); 215 KListViewItem::paintCell(p, cg, column, width, align);
210 216
211 if ( !p ) 217 if ( !p )
212 return; 218 return;
@@ -279,25 +285,25 @@ ContactListView::ContactListView(KAddressBookTableView *view,
279 285
280 286
281 new DynamicTip( this ); 287 new DynamicTip( this );
282} 288}
283void ContactListView::printMe() 289void ContactListView::printMe()
284{ 290{
285#ifdef DESKTOP_VERSION 291#ifdef DESKTOP_VERSION
286 QPrinter printer; 292 QPrinter printer;
287 if (!printer.setup() ) 293 if (!printer.setup() )
288 return; 294 return;
289 QPainter p; 295 QPainter p;
290 p.begin ( &printer ); 296 p.begin ( &printer );
291 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 297 Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
292 float dx, dy; 298 float dx, dy;
293 int wid = (m.width() * 9)/10; 299 int wid = (m.width() * 9)/10;
294 dx = (float) wid/(float)contentsWidth (); 300 dx = (float) wid/(float)contentsWidth ();
295 dy = (float)(m.height()) / (float)contentsHeight (); 301 dy = (float)(m.height()) / (float)contentsHeight ();
296 float scale; 302 float scale;
297 // scale to fit the width or height of the paper 303 // scale to fit the width or height of the paper
298 if ( dx < dy ) 304 if ( dx < dy )
299 scale = dx; 305 scale = dx;
300 else 306 else
301 scale = dy; 307 scale = dy;
302 p.translate( m.width()/10,0 ); 308 p.translate( m.width()/10,0 );
303 p.scale( scale, scale ); 309 p.scale( scale, scale );
@@ -334,35 +340,35 @@ void ContactListView::paintEmptyArea( QPainter * p, const QRect & rect )
334} 340}
335 341
336void ContactListView::contentsMousePressEvent(QMouseEvent* e) 342void ContactListView::contentsMousePressEvent(QMouseEvent* e)
337{ 343{
338 presspos = e->pos(); 344 presspos = e->pos();
339 KListView::contentsMousePressEvent(e); 345 KListView::contentsMousePressEvent(e);
340} 346}
341 347
342 348
343// To initiate a drag operation 349// To initiate a drag operation
344void ContactListView::contentsMouseMoveEvent( QMouseEvent *e ) 350void ContactListView::contentsMouseMoveEvent( QMouseEvent *e )
345{ 351{
346 if ((e->state() & LeftButton) && (e->pos() - presspos).manhattanLength() > 4 ) { 352 if ((e->state() & Qt::LeftButton) && (e->pos() - presspos).manhattanLength() > 4 ) {
347 emit startAddresseeDrag(); 353 emit startAddresseeDrag();
348 } 354 }
349 else 355 else
350 KListView::contentsMouseMoveEvent( e ); 356 KListView::contentsMouseMoveEvent( e );
351} 357}
352 358
353bool ContactListView::acceptDrag(QDropEvent *e) const 359bool ContactListView::acceptDrag(QDropEvent *e) const
354{ 360{
355#ifndef KAB_EMBEDDED 361#ifndef KAB_EMBEDDED
356 return QTextDrag::canDecode(e); 362 return Q3TextDrag::canDecode(e);
357#else //KAB_EMBEDDED 363#else //KAB_EMBEDDED
358qDebug("ContactListView::acceptDrag has to be fixed"); 364qDebug("ContactListView::acceptDrag has to be fixed");
359 return false; 365 return false;
360#endif //KAB_EMBEDDED 366#endif //KAB_EMBEDDED
361} 367}
362 368
363void ContactListView::itemDropped(QDropEvent *e) 369void ContactListView::itemDropped(QDropEvent *e)
364{ 370{
365 contentsDropEvent(e); 371 contentsDropEvent(e);
366} 372}
367 373
368void ContactListView::contentsDropEvent( QDropEvent *e ) 374void ContactListView::contentsDropEvent( QDropEvent *e )
@@ -415,15 +421,15 @@ void ContactListView::keyPressEvent ( QKeyEvent * e )
415void ContactListView::keyReleaseEvent ( QKeyEvent * e ) 421void ContactListView::keyReleaseEvent ( QKeyEvent * e )
416{ 422{
417 if ( mFlagBlockKeyPressed ) 423 if ( mFlagBlockKeyPressed )
418 return; 424 return;
419 if ( !e->isAutoRepeat() ) { 425 if ( !e->isAutoRepeat() ) {
420 mFlagBlockKeyPressed = true; 426 mFlagBlockKeyPressed = true;
421 qApp->processEvents(); 427 qApp->processEvents();
422 mFlagBlockKeyPressed = false; 428 mFlagBlockKeyPressed = false;
423 mFlagKeyPressed = false; 429 mFlagKeyPressed = false;
424 } 430 }
425 KListView::keyReleaseEvent ( e ); 431 KListView::keyReleaseEvent ( e );
426} 432}
427#ifndef KAB_EMBEDDED 433#ifndef KAB_EMBEDDED_
428#include "contactlistview.moc" 434#include "moc_contactlistview.cpp"
429#endif //KAB_EMBEDDED 435#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/contactlistview.h b/kaddressbook/views/contactlistview.h
index 46477e1..c92b002 100644
--- a/kaddressbook/views/contactlistview.h
+++ b/kaddressbook/views/contactlistview.h
@@ -1,35 +1,39 @@
1#ifndef CONTACTLISTVIEW_H 1#ifndef CONTACTLISTVIEW_H
2#define CONTACTLISTVIEW_H 2#define CONTACTLISTVIEW_H
3 3
4#include <qcolor.h> 4#include <qcolor.h>
5#include <qpixmap.h> 5#include <qpixmap.h>
6#include <qtooltip.h> 6#include <qtooltip.h>
7#include <qstring.h> 7#include <qstring.h>
8//Added by qt3to4:
9#include <QDropEvent>
10#include <QMouseEvent>
11#include <QKeyEvent>
8 12
9#include <klistview.h> 13#include <klistview.h>
10 14
11#include <kabc/field.h> 15#include <kabc/field.h>
12#include <kabc/addressee.h> 16#include <kabc/addressee.h>
13#include <kabc/addressbook.h> 17#include <kabc/addressbook.h>
14 18
15 19
16class QDropEvent; 20class QDropEvent;
17class KAddressBookTableView; 21class KAddressBookTableView;
18class ContactListView; 22class ContactListView;
19 23
20/** The whole tooltip design needs a lot of work. Currently it is 24/** The whole tooltip design needs a lot of work. Currently it is
21* hacked together to function. 25* hacked together to function.
22*/ 26*/
23class DynamicTip : public QToolTip 27class DynamicTip /* TODO:hacker: : public QToolTip */
24{ 28{
25 public: 29 public:
26 DynamicTip( ContactListView * parent ); 30 DynamicTip( ContactListView * parent );
27 31
28 protected: 32 protected:
29 void maybeTip( const QPoint & ); 33 void maybeTip( const QPoint & );
30 34
31 private: 35 private:
32}; 36};
33 37
34class ContactListViewItem : public KListViewItem 38class ContactListViewItem : public KListViewItem
35{ 39{
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp
index b503652..1e5a556 100644
--- a/kaddressbook/views/kaddressbookcardview.cpp
+++ b/kaddressbook/views/kaddressbookcardview.cpp
@@ -12,31 +12,36 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qdragobject.h> 24#include <q3dragobject.h>
25#include <qevent.h> 25#include <qevent.h>
26#include <qiconview.h> 26#include <q3iconview.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29#include <qregexp.h> 29#include <qregexp.h>
30#include <qapplication.h> 30#include <qapplication.h>
31//Added by qt3to4:
32#include <QDropEvent>
33#include <QKeyEvent>
34#include <Q3VBoxLayout>
35#include <QDragEnterEvent>
31 36
32#include <kabc/addressbook.h> 37#include <kabc/addressbook.h>
33#include <kabc/addressee.h> 38#include <kabc/addressee.h>
34#include <kconfig.h> 39#include <kconfig.h>
35#include <kdebug.h> 40#include <kdebug.h>
36#include <klocale.h> 41#include <klocale.h>
37 42
38#include "kabprefs.h" 43#include "kabprefs.h"
39#include "viewmanager.h" 44#include "viewmanager.h"
40 45
41 46
42#include "kaddressbookcardview.h" 47#include "kaddressbookcardview.h"
@@ -116,48 +121,48 @@ AddresseeCardView::AddresseeCardView(QWidget *parent, const char *name)
116 121
117AddresseeCardView::~AddresseeCardView() 122AddresseeCardView::~AddresseeCardView()
118{ 123{
119} 124}
120void AddresseeCardView::printMe() 125void AddresseeCardView::printMe()
121{ 126{
122#ifdef DESKTOP_VERSION 127#ifdef DESKTOP_VERSION
123 QPrinter printer; 128 QPrinter printer;
124 if (!printer.setup() ) 129 if (!printer.setup() )
125 return; 130 return;
126 QPainter p; 131 QPainter p;
127 p.begin ( &printer ); 132 p.begin ( &printer );
128 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 133 Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
129 float dx, dy; 134 float dx, dy;
130 int wid = (m.width() * 9)/10; 135 int wid = (m.width() * 9)/10;
131 dx = (float) wid/(float)contentsWidth (); 136 dx = (float) wid/(float)contentsWidth ();
132 dy = (float)(m.height()) / (float)contentsHeight (); 137 dy = (float)(m.height()) / (float)contentsHeight ();
133 float scale; 138 float scale;
134 // scale to fit the width or height of the paper 139 // scale to fit the width or height of the paper
135 if ( dx < dy ) 140 if ( dx < dy )
136 scale = dx; 141 scale = dx;
137 else 142 else
138 scale = dy; 143 scale = dy;
139 p.translate( m.width()/10,0 ); 144 p.translate( m.width()/10,0 );
140 p.scale( scale, scale ); 145 p.scale( scale, scale );
141 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); 146 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
142 p.end(); 147 p.end();
143 repaint(); 148 repaint();
144#endif 149#endif
145} 150}
146 151
147 152
148void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e) 153void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e)
149{ 154{
150#ifndef KAB_EMBEDDED 155#ifndef KAB_EMBEDDED
151 if (QTextDrag::canDecode(e)) 156 if (Q3TextDrag::canDecode(e))
152 e->accept(); 157 e->accept();
153#else //KAB_EMBEDDED 158#else //KAB_EMBEDDED
154qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented"); 159qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented");
155#endif //KAB_EMBEDDED 160#endif //KAB_EMBEDDED
156} 161}
157 162
158void AddresseeCardView::dropEvent(QDropEvent *e) 163void AddresseeCardView::dropEvent(QDropEvent *e)
159{ 164{
160 emit addresseeDropped(e); 165 emit addresseeDropped(e);
161} 166}
162 167
163void AddresseeCardView::startDrag() 168void AddresseeCardView::startDrag()
@@ -167,25 +172,25 @@ void AddresseeCardView::startDrag()
167 172
168 173
169/////////////////////////////// 174///////////////////////////////
170// KAddressBookCardView 175// KAddressBookCardView
171 176
172KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab, 177KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab,
173 QWidget *parent, const char *name ) 178 QWidget *parent, const char *name )
174 : KAddressBookView( ab, parent, name ) 179 : KAddressBookView( ab, parent, name )
175{ 180{
176 mShowEmptyFields = false; 181 mShowEmptyFields = false;
177 182
178 // Init the GUI 183 // Init the GUI
179 QVBoxLayout *layout = new QVBoxLayout(viewWidget()); 184 Q3VBoxLayout *layout = new Q3VBoxLayout(viewWidget());
180 185
181 mCardView = new AddresseeCardView(viewWidget(), "mCardView"); 186 mCardView = new AddresseeCardView(viewWidget(), "mCardView");
182 mCardView->setSelectionMode(CardView::Extended); 187 mCardView->setSelectionMode(CardView::Extended);
183 layout->addWidget(mCardView); 188 layout->addWidget(mCardView);
184 189
185 // Connect up the signals 190 // Connect up the signals
186 connect(mCardView, SIGNAL(executed(CardViewItem *)), 191 connect(mCardView, SIGNAL(executed(CardViewItem *)),
187 this, SLOT(addresseeExecuted(CardViewItem *))); 192 this, SLOT(addresseeExecuted(CardViewItem *)));
188 connect(mCardView, SIGNAL(selectionChanged()), 193 connect(mCardView, SIGNAL(selectionChanged()),
189 this, SLOT(addresseeSelected())); 194 this, SLOT(addresseeSelected()));
190 connect(mCardView, SIGNAL(addresseeDropped(QDropEvent*)), 195 connect(mCardView, SIGNAL(addresseeDropped(QDropEvent*)),
191 this, SIGNAL(dropped(QDropEvent*))); 196 this, SIGNAL(dropped(QDropEvent*)));
@@ -511,15 +516,15 @@ void KAddressBookCardView::addresseeSelected()
511 if ( aItem ) 516 if ( aItem )
512 { 517 {
513 emit selected(aItem->addressee().uid()); 518 emit selected(aItem->addressee().uid());
514 found = true; 519 found = true;
515 } 520 }
516 } 521 }
517 } 522 }
518 523
519 if (!found) 524 if (!found)
520 emit selected(QString::null); 525 emit selected(QString::null);
521 526
522} 527}
523#ifndef KAB_EMBEDDED 528#ifndef KAB_EMBEDDED_
524#include "kaddressbookcardview.moc" 529#include "moc_kaddressbookcardview.cpp"
525#endif //KAB_EMBEDDED 530#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/kaddressbookcardview.h b/kaddressbook/views/kaddressbookcardview.h
index 2a71f7e..8f8e48b 100644
--- a/kaddressbook/views/kaddressbookcardview.h
+++ b/kaddressbook/views/kaddressbookcardview.h
@@ -16,24 +16,27 @@
16 GNU General Public License for more details. 16 GNU General Public License for more details.
17 17
18 You should have received a copy of the GNU General Public License 18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software 19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 21
22 As a special exception, permission is given to link this program 22 As a special exception, permission is given to link this program
23 with any edition of Qt, and distribute the resulting executable, 23 with any edition of Qt, and distribute the resulting executable,
24 without including the source code for Qt in the source distribution. 24 without including the source code for Qt in the source distribution.
25*/ 25*/
26 26
27#include <qstring.h> 27#include <qstring.h>
28//Added by qt3to4:
29#include <QDragEnterEvent>
30#include <QDropEvent>
28#ifndef KAB_EMBEDDED 31#ifndef KAB_EMBEDDED
29#include <kiconview.h> 32#include <kiconview.h>
30#else //KAB_EMBEDDED 33#else //KAB_EMBEDDED
31#include <klocale.h> 34#include <klocale.h>
32#endif //KAB_EMBEDDED 35#endif //KAB_EMBEDDED
33 36
34#include "cardview.h" 37#include "cardview.h"
35#include "kaddressbookview.h" 38#include "kaddressbookview.h"
36#include "configurecardviewdialog.h" 39#include "configurecardviewdialog.h"
37 40
38class QDragEnterEvent; 41class QDragEnterEvent;
39class QDragEntryEvent; 42class QDragEntryEvent;
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp
index d6ddec3..3a41a4b 100644
--- a/kaddressbook/views/kaddressbookiconview.cpp
+++ b/kaddressbook/views/kaddressbookiconview.cpp
@@ -13,37 +13,45 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KAB_EMBEDDED 24#ifndef KAB_EMBEDDED
25#include <qiconview.h> 25#include <q3iconview.h>
26#include <qstringlist.h> 26#include <qstringlist.h>
27 27
28#include <kabc/addressee.h> 28#include <kabc/addressee.h>
29#include <kconfig.h> 29#include <kconfig.h>
30#include <kdebug.h> 30#include <kdebug.h>
31#include <kglobal.h> 31#include <kglobal.h>
32#include <kiconloader.h> 32#include <kiconloader.h>
33#include <klocale.h> 33#include <klocale.h>
34 34
35#else //KAB_EMBEDDED 35#else //KAB_EMBEDDED
36#endif //KAB_EMBEDDED 36#endif //KAB_EMBEDDED
37 37
38//Added by qt3to4:
39#include <QDropEvent>
40#include <Q3ValueList>
41#include <QPixmap>
42#include <QKeyEvent>
43#include <QEvent>
44#include <Q3VBoxLayout>
45
38#include <kabc/addressbook.h> 46#include <kabc/addressbook.h>
39#include "kabprefs.h" 47#include "kabprefs.h"
40#include "viewmanager.h" 48#include "viewmanager.h"
41#include "kaddressbookiconview.h" 49#include "kaddressbookiconview.h"
42#include <qlayout.h> 50#include <qlayout.h>
43#include <qregexp.h> 51#include <qregexp.h>
44#include <qapplication.h> 52#include <qapplication.h>
45#include <kglobal.h> 53#include <kglobal.h>
46/*US transfered to the headerfile 54/*US transfered to the headerfile
47class IconViewFactory : public ViewFactory 55class IconViewFactory : public ViewFactory
48{ 56{
49 public: 57 public:
@@ -64,82 +72,82 @@ extern "C" {
64 { 72 {
65 return ( new IconViewFactory ); 73 return ( new IconViewFactory );
66 } 74 }
67} 75}
68 76
69//////////////////////////////// 77////////////////////////////////
70// AddresseeIconView (internal class) 78// AddresseeIconView (internal class)
71#ifndef KAB_EMBEDDED 79#ifndef KAB_EMBEDDED
72AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) 80AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name)
73 : KIconView(parent, name) 81 : KIconView(parent, name)
74#else //KAB_EMBEDDED 82#else //KAB_EMBEDDED
75AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) 83AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name)
76 : QIconView(parent, name) 84 : Q3IconView(parent, name)
77#endif //KAB_EMBEDDED 85#endif //KAB_EMBEDDED
78 86
79{ 87{
80 setSelectionMode( QIconView::Extended ); 88 setSelectionMode( Q3IconView::Extended );
81 setResizeMode( QIconView::Adjust ); 89 setResizeMode( Q3IconView::Adjust );
82 setWordWrapIconText( true ); 90 setWordWrapIconText( true );
83 setGridX( 100 ); 91 setGridX( 100 );
84 setItemsMovable(false); 92 setItemsMovable(false);
85 setSorting(true, true); 93 setSorting(true, true);
86 94
87 95
88//US ??? setMode( KIconView::Select ); 96//US ??? setMode( KIconView::Select );
89 97
90#ifndef KAB_EMBEDDED 98#ifndef KAB_EMBEDDED
91 99
92 connect(this, SIGNAL(dropped(QDropEvent*, const QValueList<QIconDragItem>&)), 100 connect(this, SIGNAL(dropped(QDropEvent*, const Q3ValueList<Q3IconDragItem>&)),
93 this, SLOT(itemDropped(QDropEvent*, const QValueList<QIconDragItem>&))); 101 this, SLOT(itemDropped(QDropEvent*, const Q3ValueList<Q3IconDragItem>&)));
94#endif //KAB_EMBEDDED 102#endif //KAB_EMBEDDED
95} 103}
96 104
97AddresseeIconView::~AddresseeIconView() 105AddresseeIconView::~AddresseeIconView()
98{ 106{
99} 107}
100 108
101 109
102void AddresseeIconView::itemDropped(QDropEvent *e, 110void AddresseeIconView::itemDropped(QDropEvent *e,
103 const QValueList<QIconDragItem> &) 111 const Q3ValueList<Q3IconDragItem> &)
104{ 112{
105 emit addresseeDropped(e); 113 emit addresseeDropped(e);
106} 114}
107 115
108QDragObject *AddresseeIconView::dragObject() 116Q3DragObject *AddresseeIconView::dragObject()
109{ 117{
110 emit startAddresseeDrag(); 118 emit startAddresseeDrag();
111 119
112 // We never want IconView to start the drag 120 // We never want IconView to start the drag
113 return 0; 121 return 0;
114} 122}
115//////////////////////////////// 123////////////////////////////////
116// AddresseeIconViewItem (internal class) 124// AddresseeIconViewItem (internal class)
117#ifndef KAB_EMBEDDED 125#ifndef KAB_EMBEDDED
118class AddresseeIconViewItem : public KIconViewItem 126class AddresseeIconViewItem : public KIconViewItem
119#else //KAB_EMBEDDED 127#else //KAB_EMBEDDED
120class AddresseeIconViewItem : public QIconViewItem 128class AddresseeIconViewItem : public Q3IconViewItem
121#endif //KAB_EMBEDDED 129#endif //KAB_EMBEDDED
122{ 130{
123 public: 131 public:
124#ifndef KAB_EMBEDDED 132#ifndef KAB_EMBEDDED
125 AddresseeIconViewItem(const KABC::Field::List &fields, 133 AddresseeIconViewItem(const KABC::Field::List &fields,
126 KABC::AddressBook *doc, const KABC::Addressee &a, 134 KABC::AddressBook *doc, const KABC::Addressee &a,
127 QIconView *parent) 135 Q3IconView *parent)
128 : KIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) 136 : KIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a)
129#else //KAB_EMBEDDED 137#else //KAB_EMBEDDED
130 AddresseeIconViewItem(const KABC::Field::List &fields, 138 AddresseeIconViewItem(const KABC::Field::List &fields,
131 KABC::AddressBook *doc, const KABC::Addressee &a, 139 KABC::AddressBook *doc, const KABC::Addressee &a,
132 QIconView *parent) 140 Q3IconView *parent)
133 : QIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) 141 : Q3IconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a)
134#endif //KAB_EMBEDDED 142#endif //KAB_EMBEDDED
135 { 143 {
136 if ( mFields.isEmpty() ) { 144 if ( mFields.isEmpty() ) {
137 mFields = KABC::Field::defaultFields(); 145 mFields = KABC::Field::defaultFields();
138 } 146 }
139 refresh(); 147 refresh();
140 } 148 }
141 149
142 const KABC::Addressee &addressee() const { return mAddressee; } 150 const KABC::Addressee &addressee() const { return mAddressee; }
143 151
144 void refresh() 152 void refresh()
145 { 153 {
@@ -191,36 +199,36 @@ class AddresseeIconViewItem : public QIconViewItem
191 KABC::AddressBook *mDocument; 199 KABC::AddressBook *mDocument;
192 KABC::Addressee mAddressee; 200 KABC::Addressee mAddressee;
193}; 201};
194 202
195/////////////////////////////// 203///////////////////////////////
196// KAddressBookView 204// KAddressBookView
197 205
198KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, 206KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab,
199 QWidget *parent, const char *name) 207 QWidget *parent, const char *name)
200 : KAddressBookView( ab, parent, name ) 208 : KAddressBookView( ab, parent, name )
201{ 209{
202 // Init the GUI 210 // Init the GUI
203 QVBoxLayout *layout = new QVBoxLayout(viewWidget()); 211 Q3VBoxLayout *layout = new Q3VBoxLayout(viewWidget());
204 212
205 mIconView = new AddresseeIconView(viewWidget(), "mIconView"); 213 mIconView = new AddresseeIconView(viewWidget(), "mIconView");
206 layout->addWidget(mIconView); 214 layout->addWidget(mIconView);
207 215
208 // Connect up the signals 216 // Connect up the signals
209 217
210//US method executed is part of KIconView 218//US method executed is part of KIconView
211//US connect(mIconView, SIGNAL(executed(QIconViewItem *)), 219//US connect(mIconView, SIGNAL(executed(QIconViewItem *)),
212//US this, SLOT(addresseeExecuted(QIconViewItem *))); 220//US this, SLOT(addresseeExecuted(QIconViewItem *)));
213 connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), 221 connect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)),
214 this, SLOT(addresseeExecuted(QIconViewItem *))); 222 this, SLOT(addresseeExecuted(Q3IconViewItem *)));
215 223
216 connect(mIconView, SIGNAL(selectionChanged()), 224 connect(mIconView, SIGNAL(selectionChanged()),
217 this, SLOT(addresseeSelected())); 225 this, SLOT(addresseeSelected()));
218 connect(mIconView, SIGNAL(addresseeDropped(QDropEvent*)), 226 connect(mIconView, SIGNAL(addresseeDropped(QDropEvent*)),
219 this, SIGNAL(dropped(QDropEvent*))); 227 this, SIGNAL(dropped(QDropEvent*)));
220 connect(mIconView, SIGNAL(startAddresseeDrag()), 228 connect(mIconView, SIGNAL(startAddresseeDrag()),
221 this, SIGNAL(startDrag())); 229 this, SIGNAL(startDrag()));
222} 230}
223 231
224KAddressBookIconView::~KAddressBookIconView() 232KAddressBookIconView::~KAddressBookIconView()
225{ 233{
226} 234}
@@ -239,38 +247,38 @@ void KAddressBookIconView::scrollUP()
239void KAddressBookIconView::scrollDOWN() 247void KAddressBookIconView::scrollDOWN()
240{ 248{
241 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); 249 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 );
242 QApplication::postEvent( mIconView, ev ); 250 QApplication::postEvent( mIconView, ev );
243} 251}
244void KAddressBookIconView::readConfig(KConfig *config) 252void KAddressBookIconView::readConfig(KConfig *config)
245{ 253{
246 KAddressBookView::readConfig(config); 254 KAddressBookView::readConfig(config);
247 255
248//US method executed is part of KIconView 256//US method executed is part of KIconView
249//US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)), 257//US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)),
250//US this, SLOT(addresseeExecuted(QIconViewItem *))); 258//US this, SLOT(addresseeExecuted(QIconViewItem *)));
251 disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), 259 disconnect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)),
252 this, SLOT(addresseeExecuted(QIconViewItem *))); 260 this, SLOT(addresseeExecuted(Q3IconViewItem *)));
253 261
254//US method executed is part of KIconView. Use selectionChanged instead 262//US method executed is part of KIconView. Use selectionChanged instead
255/*US 263/*US
256 if (KABPrefs::instance()->mHonorSingleClick) 264 if (KABPrefs::instance()->mHonorSingleClick)
257 connect(mIconView, SIGNAL(executed(QIconViewItem *)), 265 connect(mIconView, SIGNAL(executed(QIconViewItem *)),
258 this, SLOT(addresseeExecuted(QIconViewItem *))); 266 this, SLOT(addresseeExecuted(QIconViewItem *)));
259 else 267 else
260 connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)), 268 connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)),
261 this, SLOT(addresseeExecuted(QIconViewItem *))); 269 this, SLOT(addresseeExecuted(QIconViewItem *)));
262*/ 270*/
263 connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), 271 connect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)),
264 this, SLOT(addresseeExecuted(QIconViewItem *))); 272 this, SLOT(addresseeExecuted(Q3IconViewItem *)));
265 273
266} 274}
267void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) 275void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field )
268{ 276{
269 mIconView->clear(); 277 mIconView->clear();
270 mIconList.clear(); 278 mIconList.clear();
271 if ( s.isEmpty() || s == "*" ) { 279 if ( s.isEmpty() || s == "*" ) {
272 refresh(); 280 refresh();
273 return; 281 return;
274 } 282 }
275 QRegExp re = getRegExp( s ); 283 QRegExp re = getRegExp( s );
276 if (!re.isValid()) 284 if (!re.isValid())
@@ -327,47 +335,47 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field )
327 } 335 }
328 mIconView->arrangeItemsInGrid( true ); 336 mIconView->arrangeItemsInGrid( true );
329 if ( mIconView->firstItem() ) { 337 if ( mIconView->firstItem() ) {
330 mIconView->setCurrentItem ( mIconView->firstItem() ); 338 mIconView->setCurrentItem ( mIconView->firstItem() );
331 mIconView->setSelected ( mIconView->firstItem() , true ); 339 mIconView->setSelected ( mIconView->firstItem() , true );
332 } 340 }
333 else 341 else
334 emit selected(QString::null); 342 emit selected(QString::null);
335} 343}
336QStringList KAddressBookIconView::selectedUids() 344QStringList KAddressBookIconView::selectedUids()
337{ 345{
338 QStringList uidList; 346 QStringList uidList;
339 QIconViewItem *item; 347 Q3IconViewItem *item;
340 AddresseeIconViewItem *aItem; 348 AddresseeIconViewItem *aItem;
341 349
342 for (item = mIconView->firstItem(); item; item = item->nextItem()) 350 for (item = mIconView->firstItem(); item; item = item->nextItem())
343 { 351 {
344 if (item->isSelected()) 352 if (item->isSelected())
345 { 353 {
346#ifndef KAB_EMBEDDED 354#ifndef KAB_EMBEDDED
347 aItem = dynamic_cast<AddresseeIconViewItem*>(item); 355 aItem = dynamic_cast<AddresseeIconViewItem*>(item);
348#else //KAB_EMBEDDED 356#else //KAB_EMBEDDED
349 aItem = (AddresseeIconViewItem*)(item); 357 aItem = (AddresseeIconViewItem*)(item);
350#endif //KAB_EMBEDDED 358#endif //KAB_EMBEDDED
351 if (aItem) 359 if (aItem)
352 uidList << aItem->addressee().uid(); 360 uidList << aItem->addressee().uid();
353 } 361 }
354 } 362 }
355 363
356 return uidList; 364 return uidList;
357} 365}
358 366
359void KAddressBookIconView::refresh(QString uid) 367void KAddressBookIconView::refresh(QString uid)
360{ 368{
361 QIconViewItem *item; 369 Q3IconViewItem *item;
362 AddresseeIconViewItem *aItem; 370 AddresseeIconViewItem *aItem;
363 371
364 if ( uid.isNull() ) { 372 if ( uid.isNull() ) {
365 // Rebuild the view 373 // Rebuild the view
366 mIconView->clear(); 374 mIconView->clear();
367 mIconList.clear(); 375 mIconList.clear();
368 376
369 KABC::Addressee::List addresseeList = addressees(); 377 KABC::Addressee::List addresseeList = addressees();
370 KABC::Addressee::List::Iterator iter; 378 KABC::Addressee::List::Iterator iter;
371 for ( iter = addresseeList.begin(); iter != addresseeList.end(); ++iter ) { 379 for ( iter = addresseeList.begin(); iter != addresseeList.end(); ++iter ) {
372 if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") ) 380 if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") )
373 continue; 381 continue;
@@ -397,25 +405,25 @@ void KAddressBookIconView::refresh(QString uid)
397 if ((aItem) && (aItem->addressee().uid() == uid)) { 405 if ((aItem) && (aItem->addressee().uid() == uid)) {
398 aItem->refresh(); 406 aItem->refresh();
399 mIconView->arrangeItemsInGrid( true ); 407 mIconView->arrangeItemsInGrid( true );
400 return; 408 return;
401 } 409 }
402 } 410 }
403 refresh( QString::null ); 411 refresh( QString::null );
404 } 412 }
405} 413}
406 414
407void KAddressBookIconView::setSelected(QString uid, bool selected) 415void KAddressBookIconView::setSelected(QString uid, bool selected)
408{ 416{
409 QIconViewItem *item; 417 Q3IconViewItem *item;
410 AddresseeIconViewItem *aItem; 418 AddresseeIconViewItem *aItem;
411 419
412 if (uid.isNull()) 420 if (uid.isNull())
413 { 421 {
414 mIconView->selectAll(selected); 422 mIconView->selectAll(selected);
415 } 423 }
416 else 424 else
417 { 425 {
418 bool found = false; 426 bool found = false;
419 for (item = mIconView->firstItem(); item && !found; 427 for (item = mIconView->firstItem(); item && !found;
420 item = item->nextItem()) 428 item = item->nextItem())
421 { 429 {
@@ -426,40 +434,40 @@ void KAddressBookIconView::setSelected(QString uid, bool selected)
426#endif //KAB_EMBEDDED 434#endif //KAB_EMBEDDED
427 435
428 if ((aItem) && (aItem->addressee().uid() == uid)) 436 if ((aItem) && (aItem->addressee().uid() == uid))
429 { 437 {
430 mIconView->setSelected(aItem, selected); 438 mIconView->setSelected(aItem, selected);
431 mIconView->ensureItemVisible( aItem ); 439 mIconView->ensureItemVisible( aItem );
432 found = true; 440 found = true;
433 } 441 }
434 } 442 }
435 } 443 }
436} 444}
437 445
438void KAddressBookIconView::addresseeExecuted(QIconViewItem *item) 446void KAddressBookIconView::addresseeExecuted(Q3IconViewItem *item)
439{ 447{
440#ifndef KAB_EMBEDDED 448#ifndef KAB_EMBEDDED
441 AddresseeIconViewItem *aItem = dynamic_cast<AddresseeIconViewItem*>(item); 449 AddresseeIconViewItem *aItem = dynamic_cast<AddresseeIconViewItem*>(item);
442#else //KAB_EMBEDDED 450#else //KAB_EMBEDDED
443 AddresseeIconViewItem *aItem = (AddresseeIconViewItem*)(item); 451 AddresseeIconViewItem *aItem = (AddresseeIconViewItem*)(item);
444#endif //KAB_EMBEDDED 452#endif //KAB_EMBEDDED
445 453
446 if (aItem) { 454 if (aItem) {
447 emit executed(aItem->addressee().uid()); 455 emit executed(aItem->addressee().uid());
448 } 456 }
449} 457}
450 458
451void KAddressBookIconView::addresseeSelected() 459void KAddressBookIconView::addresseeSelected()
452{ 460{
453 QIconViewItem *item; 461 Q3IconViewItem *item;
454 AddresseeIconViewItem *aItem; 462 AddresseeIconViewItem *aItem;
455 463
456 bool found = false; 464 bool found = false;
457 for (item = mIconView->firstItem(); item && !found; 465 for (item = mIconView->firstItem(); item && !found;
458 item = item->nextItem()) 466 item = item->nextItem())
459 { 467 {
460 if (item->isSelected()) 468 if (item->isSelected())
461 { 469 {
462#ifndef KAB_EMBEDDED 470#ifndef KAB_EMBEDDED
463 aItem = dynamic_cast<AddresseeIconViewItem*>(item); 471 aItem = dynamic_cast<AddresseeIconViewItem*>(item);
464#else //KAB_EMBEDDED 472#else //KAB_EMBEDDED
465 aItem = (AddresseeIconViewItem*)(item); 473 aItem = (AddresseeIconViewItem*)(item);
@@ -467,15 +475,15 @@ void KAddressBookIconView::addresseeSelected()
467 if (aItem) 475 if (aItem)
468 { 476 {
469 emit selected(aItem->addressee().uid()); 477 emit selected(aItem->addressee().uid());
470 found = true; 478 found = true;
471 } 479 }
472 } 480 }
473 } 481 }
474 482
475 if (!found) 483 if (!found)
476 emit selected(QString::null); 484 emit selected(QString::null);
477} 485}
478 486
479#ifndef KAB_EMBEDDED 487#ifndef KAB_EMBEDDED_
480#include "kaddressbookiconview.moc" 488#include "moc_kaddressbookiconview.cpp"
481#endif //KAB_EMBEDDED 489#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/kaddressbookiconview.h b/kaddressbook/views/kaddressbookiconview.h
index b0b9fea..6fad4c6 100644
--- a/kaddressbook/views/kaddressbookiconview.h
+++ b/kaddressbook/views/kaddressbookiconview.h
@@ -16,38 +16,41 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KADDRESSBOOKICONVIEW_H 24#ifndef KADDRESSBOOKICONVIEW_H
25#define KADDRESSBOOKICONVIEW_H 25#define KADDRESSBOOKICONVIEW_H
26 26
27#include <qstring.h> 27#include <qstring.h>
28//Added by qt3to4:
29#include <Q3ValueList>
30#include <QDropEvent>
28#ifndef KAB_EMBEDDED 31#ifndef KAB_EMBEDDED
29#include <kiconview.h> 32#include <kiconview.h>
30#else //KAB_EMBEDDED 33#else //KAB_EMBEDDED
31#include <qiconview.h> 34#include <q3iconview.h>
32#include <qptrlist.h> 35#include <q3ptrlist.h>
33#include <klocale.h> 36#include <klocale.h>
34#endif //KAB_EMBEDDED 37#endif //KAB_EMBEDDED
35#include "kaddressbookview.h" 38#include "kaddressbookview.h"
36 39
37class QIconViewItem; 40class Q3IconViewItem;
38class KConfig; 41class KConfig;
39class AddresseeIconView; 42class AddresseeIconView;
40class AddresseeIconViewItem; 43class AddresseeIconViewItem;
41class QIconDragItem; 44class Q3IconDragItem;
42class KAddressBookIconView; 45class KAddressBookIconView;
43 46
44namespace KABC { class AddressBook; } 47namespace KABC { class AddressBook; }
45 48
46/** This is an example kaddressbook view that is implemented using 49/** This is an example kaddressbook view that is implemented using
47* KIconView. This view is not the most useful view, but it displays 50* KIconView. This view is not the most useful view, but it displays
48* how simple implementing a new view can be. 51* how simple implementing a new view can be.
49*/ 52*/
50class KAddressBookIconView : public KAddressBookView 53class KAddressBookIconView : public KAddressBookView
51{ 54{
52 Q_OBJECT 55 Q_OBJECT
53 56
@@ -59,65 +62,65 @@ class KAddressBookIconView : public KAddressBookView
59 virtual QStringList selectedUids(); 62 virtual QStringList selectedUids();
60 virtual QString type() const { return "Icon"; } 63 virtual QString type() const { return "Icon"; }
61 void doSearch( const QString& s ,KABC::Field *field ); 64 void doSearch( const QString& s ,KABC::Field *field );
62 65
63 virtual void readConfig(KConfig *config); 66 virtual void readConfig(KConfig *config);
64 virtual void scrollUP(); 67 virtual void scrollUP();
65 virtual void scrollDOWN(); 68 virtual void scrollDOWN();
66 virtual void setFocusAV(); 69 virtual void setFocusAV();
67 70
68 public slots: 71 public slots:
69 void refresh(QString uid = QString::null); 72 void refresh(QString uid = QString::null);
70#ifndef KAB_EMBEDDED 73#ifndef KAB_EMBEDDED
71//MOC_SKIP_BEGIN 74#ifndef Q_MOC_RUN
72 void setSelected(QString uid = QString::null, bool selected = true); 75 void setSelected(QString uid = QString::null, bool selected = true);
73//MOC_SKIP_END 76#endif
74#else //KAB_EMBEDDED 77#else //KAB_EMBEDDED
75//US my MOC do not like default parameters ??? 78//US my MOC do not like default parameters ???
76 void setSelected(QString uid, bool selected); 79 void setSelected(QString uid, bool selected);
77#endif //KAB_EMBEDDED 80#endif //KAB_EMBEDDED
78 81
79 protected slots: 82 protected slots:
80 void addresseeExecuted(QIconViewItem *item); 83 void addresseeExecuted(Q3IconViewItem *item);
81 void addresseeSelected(); 84 void addresseeSelected();
82 85
83 private: 86 private:
84 AddresseeIconView *mIconView; 87 AddresseeIconView *mIconView;
85 QPtrList<AddresseeIconViewItem> mIconList; 88 Q3PtrList<AddresseeIconViewItem> mIconList;
86}; 89};
87 90
88 91
89#ifndef KAB_EMBEDDED 92#ifndef KAB_EMBEDDED
90//MOC_SKIP_BEGIN 93#ifndef Q_MOC_RUN
91class AddresseeIconView : public KIconView 94class AddresseeIconView : public KIconView
92//MOC_SKIP_END 95#endif
93#else //KAB_EMBEDDED 96#else //KAB_EMBEDDED
94class AddresseeIconView : public QIconView 97class AddresseeIconView : public Q3IconView
95#endif //KAB_EMBEDDED 98#endif //KAB_EMBEDDED
96{ 99{
97 Q_OBJECT 100 Q_OBJECT
98 101
99 public: 102 public:
100 AddresseeIconView(QWidget *parent, const char *name); 103 AddresseeIconView(QWidget *parent, const char *name);
101 ~AddresseeIconView(); 104 ~AddresseeIconView();
102 105
103 signals: 106 signals:
104 void addresseeDropped(QDropEvent *); 107 void addresseeDropped(QDropEvent *);
105 void startAddresseeDrag(); 108 void startAddresseeDrag();
106 109
107 protected: 110 protected:
108 virtual QDragObject *dragObject(); 111 virtual Q3DragObject *dragObject();
109 112
110 protected slots: 113 protected slots:
111 void itemDropped(QDropEvent *, const QValueList<QIconDragItem> &); 114 void itemDropped(QDropEvent *, const Q3ValueList<Q3IconDragItem> &);
112}; 115};
113 116
114class IconViewFactory : public ViewFactory 117class IconViewFactory : public ViewFactory
115{ 118{
116 public: 119 public:
117 KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name ) 120 KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name )
118 { 121 {
119 return new KAddressBookIconView( ab, parent, name ); 122 return new KAddressBookIconView( ab, parent, name );
120 } 123 }
121 124
122 QString type() const { return "Icon"; } 125 QString type() const { return "Icon"; }
123 126
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp
index 272f2eb..7efaaa9 100644
--- a/kaddressbook/views/kaddressbooktableview.cpp
+++ b/kaddressbook/views/kaddressbooktableview.cpp
@@ -1,57 +1,61 @@
1// $Id$ 1// $Id$
2 2
3#include <qvbox.h> 3#include <q3vbox.h>
4#include <qlistbox.h> 4#include <q3listbox.h>
5#include <qwidget.h> 5#include <qwidget.h>
6#include <qfile.h> 6#include <qfile.h>
7#include <qimage.h> 7#include <qimage.h>
8#include <qcombobox.h> 8#include <qcombobox.h>
9#include <qapplication.h> 9#include <qapplication.h>
10#include <qdragobject.h> 10#include <q3dragobject.h>
11#include <qevent.h> 11#include <qevent.h>
12#include <qurl.h> 12#include <q3url.h>
13#include <qpixmap.h> 13#include <qpixmap.h>
14//Added by qt3to4:
15#include <QDropEvent>
16#include <QKeyEvent>
17#include <Q3VBoxLayout>
14 18
15#include <kabc/addressbook.h> 19#include <kabc/addressbook.h>
16#include <kapplication.h> 20#include <kapplication.h>
17#include <kconfig.h> 21#include <kconfig.h>
18#include <kcolorbutton.h> 22#include <kcolorbutton.h>
19#include <kdebug.h> 23#include <kdebug.h>
20#include <kglobal.h> 24#include <kglobal.h>
21#include <kiconloader.h> 25#include <kiconloader.h>
22#include <klineedit.h> 26#include <klineedit.h>
23#include <klocale.h> 27#include <klocale.h>
24#include <kmessagebox.h> 28#include <kmessagebox.h>
25#include <kurl.h> 29#include <kurl.h>
26#include <kurlrequester.h> 30#include <kurlrequester.h>
27 31
28//US#include "configuretableviewdialog.h" 32//US#include "configuretableviewdialog.h"
29#include "contactlistview.h" 33#include "contactlistview.h"
30#include "kabprefs.h" 34#include "kabprefs.h"
31#include "undocmds.h" 35#include "undocmds.h"
32#include "viewmanager.h" 36#include "viewmanager.h"
33 37
34#include <qlayout.h> 38#include <qlayout.h>
35#include <qheader.h> 39#include <q3header.h>
36#include <qregexp.h> 40#include <qregexp.h>
37 41
38#include "kaddressbooktableview.h" 42#include "kaddressbooktableview.h"
39 43
40 44
41KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab, 45KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab,
42 QWidget *parent, const char *name ) 46 QWidget *parent, const char *name )
43 : KAddressBookView( ab, parent, name ) 47 : KAddressBookView( ab, parent, name )
44{ 48{
45 mainLayout = new QVBoxLayout( viewWidget(), 2 ); 49 mainLayout = new Q3VBoxLayout( viewWidget(), 2 );
46 50
47 // The list view will be created when the config is read. 51 // The list view will be created when the config is read.
48 mListView = 0; 52 mListView = 0;
49} 53}
50 54
51KAddressBookTableView::~KAddressBookTableView() 55KAddressBookTableView::~KAddressBookTableView()
52{ 56{
53} 57}
54void KAddressBookTableView::setFocusAV() 58void KAddressBookTableView::setFocusAV()
55{ 59{
56 if ( mListView ) 60 if ( mListView )
57 mListView->setFocus(); 61 mListView->setFocus();
@@ -68,75 +72,75 @@ void KAddressBookTableView::scrollDOWN()
68{ 72{
69 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); 73 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 );
70 QApplication::postEvent( mListView, ev ); 74 QApplication::postEvent( mListView, ev );
71 ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Down, 0,0 ); 75 ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Down, 0,0 );
72 QApplication::postEvent( mListView, ev ); 76 QApplication::postEvent( mListView, ev );
73} 77}
74void KAddressBookTableView::reconstructListView() 78void KAddressBookTableView::reconstructListView()
75{ 79{
76 if (mListView) 80 if (mListView)
77 { 81 {
78 disconnect(mListView, SIGNAL(selectionChanged()), 82 disconnect(mListView, SIGNAL(selectionChanged()),
79 this, SLOT(addresseeSelected())); 83 this, SLOT(addresseeSelected()));
80 disconnect(mListView, SIGNAL(executed(QListViewItem*)), 84 disconnect(mListView, SIGNAL(executed(Q3ListViewItem*)),
81 this, SLOT(addresseeExecuted(QListViewItem*))); 85 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
82 disconnect(mListView, SIGNAL(doubleClicked(QListViewItem*)), 86 disconnect(mListView, SIGNAL(doubleClicked(Q3ListViewItem*)),
83 this, SLOT(addresseeExecuted(QListViewItem*))); 87 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
84 disconnect(mListView, SIGNAL(startAddresseeDrag()), this, 88 disconnect(mListView, SIGNAL(startAddresseeDrag()), this,
85 SIGNAL(startDrag())); 89 SIGNAL(startDrag()));
86 disconnect(mListView, SIGNAL(returnPressed(QListViewItem*)), 90 disconnect(mListView, SIGNAL(returnPressed(Q3ListViewItem*)),
87 this, SLOT(addresseeExecuted(QListViewItem*))); 91 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
88 92
89 disconnect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, 93 disconnect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this,
90 SIGNAL(dropped(QDropEvent*))); 94 SIGNAL(dropped(QDropEvent*)));
91 delete mListView; 95 delete mListView;
92 } 96 }
93 97
94 mListView = new ContactListView( this, addressBook(), viewWidget() ); 98 mListView = new ContactListView( this, addressBook(), viewWidget() );
95 99
96 connect(this, SIGNAL(printView()), 100 connect(this, SIGNAL(printView()),
97 mListView , SLOT(printMe())); 101 mListView , SLOT(printMe()));
98 //US set singleClick manually, because it is no global configparameter in embedded space 102 //US set singleClick manually, because it is no global configparameter in embedded space
99 mListView->setSingleClick(KABPrefs::instance()->mHonorSingleClick); 103 mListView->setSingleClick(KABPrefs::instance()->mHonorSingleClick);
100 104
101 // Add the columns 105 // Add the columns
102 KABC::Field::List fieldList = fields(); 106 KABC::Field::List fieldList = fields();
103 KABC::Field::List::ConstIterator it; 107 KABC::Field::List::ConstIterator it;
104 108
105 int c = 0; 109 int c = 0;
106 for( it = fieldList.begin(); it != fieldList.end(); ++it ) { 110 for( it = fieldList.begin(); it != fieldList.end(); ++it ) {
107 mListView->addColumn( (*it)->label() ); 111 mListView->addColumn( (*it)->label() );
108 mListView->setColumnWidthMode(c++, QListView::Manual); 112 mListView->setColumnWidthMode(c++, Q3ListView::Manual);
109//US 113//US
110 // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); 114 // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1());
111 } 115 }
112 116
113 connect(mListView, SIGNAL(selectionChanged()), 117 connect(mListView, SIGNAL(selectionChanged()),
114 this, SLOT(addresseeSelected())); 118 this, SLOT(addresseeSelected()));
115 connect(mListView, SIGNAL(startAddresseeDrag()), this, 119 connect(mListView, SIGNAL(startAddresseeDrag()), this,
116 SIGNAL(startDrag())); 120 SIGNAL(startDrag()));
117 connect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, 121 connect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this,
118 SIGNAL(dropped(QDropEvent*))); 122 SIGNAL(dropped(QDropEvent*)));
119 123
120 if (KABPrefs::instance()->mHonorSingleClick) { 124 if (KABPrefs::instance()->mHonorSingleClick) {
121 // qDebug("KAddressBookTableView::reconstructListView single"); 125 // qDebug("KAddressBookTableView::reconstructListView single");
122 connect(mListView, SIGNAL(executed(QListViewItem*)), 126 connect(mListView, SIGNAL(executed(Q3ListViewItem*)),
123 this, SLOT(addresseeExecuted(QListViewItem*))); 127 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
124 } else { 128 } else {
125 // qDebug("KAddressBookTableView::reconstructListView double"); 129 // qDebug("KAddressBookTableView::reconstructListView double");
126 connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), 130 connect(mListView, SIGNAL(doubleClicked(Q3ListViewItem*)),
127 this, SLOT(addresseeExecuted(QListViewItem*))); 131 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
128 } 132 }
129 connect(mListView, SIGNAL(returnPressed(QListViewItem*)), 133 connect(mListView, SIGNAL(returnPressed(Q3ListViewItem*)),
130 this, SLOT(addresseeExecuted(QListViewItem*))); 134 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
131 connect(mListView, SIGNAL(signalDelete()), 135 connect(mListView, SIGNAL(signalDelete()),
132 this, SLOT(addresseeDeleted())); 136 this, SLOT(addresseeDeleted()));
133 137
134//US performceimprovement. Refresh is done from the outside 138//US performceimprovement. Refresh is done from the outside
135//US refresh(); 139//US refresh();
136 140
137 mListView->setSorting( 0, true ); 141 mListView->setSorting( 0, true );
138 mainLayout->addWidget( mListView ); 142 mainLayout->addWidget( mListView );
139 mainLayout->activate(); 143 mainLayout->activate();
140 mListView->show(); 144 mListView->show();
141} 145}
142 146
@@ -335,47 +339,47 @@ void KAddressBookTableView::refresh(QString uid)
335 // of items. 339 // of items.
336 mListView->repaint(); 340 mListView->repaint();
337 if ( !currentItem ) 341 if ( !currentItem )
338 currentItem = (ContactListViewItem *)mListView->firstChild(); 342 currentItem = (ContactListViewItem *)mListView->firstChild();
339 if ( currentItem ) { 343 if ( currentItem ) {
340 mListView->setCurrentItem( currentItem ); 344 mListView->setCurrentItem( currentItem );
341 mListView->ensureItemVisible( currentItem ); 345 mListView->ensureItemVisible( currentItem );
342 mListView->setSelected( currentItem, true ); 346 mListView->setSelected( currentItem, true );
343 } 347 }
344 } else { 348 } else {
345 // Only need to update on entry. Iterate through and try to find it 349 // Only need to update on entry. Iterate through and try to find it
346 ContactListViewItem *ceItem; 350 ContactListViewItem *ceItem;
347 QListViewItemIterator it( mListView ); 351 Q3ListViewItemIterator it( mListView );
348 while ( it.current() ) { 352 while ( it.current() ) {
349#ifndef KAB_EMBEDDED 353#ifndef KAB_EMBEDDED
350 ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); 354 ceItem = dynamic_cast<ContactListViewItem*>( it.current() );
351#else //KAB_EMBEDDED 355#else //KAB_EMBEDDED
352 ceItem = (ContactListViewItem*)( it.current() ); 356 ceItem = (ContactListViewItem*)( it.current() );
353#endif //KAB_EMBEDDED 357#endif //KAB_EMBEDDED
354 358
355 if ( ceItem && ceItem->addressee().uid() == uid ) { 359 if ( ceItem && ceItem->addressee().uid() == uid ) {
356 ceItem->refresh(); 360 ceItem->refresh();
357 return; 361 return;
358 } 362 }
359 ++it; 363 ++it;
360 } 364 }
361 365
362 refresh( QString::null ); 366 refresh( QString::null );
363 } 367 }
364} 368}
365 369
366QStringList KAddressBookTableView::selectedUids() 370QStringList KAddressBookTableView::selectedUids()
367{ 371{
368 QStringList uidList; 372 QStringList uidList;
369 QListViewItem *item; 373 Q3ListViewItem *item;
370 ContactListViewItem *ceItem; 374 ContactListViewItem *ceItem;
371 375
372 for(item = mListView->firstChild(); item; item = item->itemBelow()) 376 for(item = mListView->firstChild(); item; item = item->itemBelow())
373 { 377 {
374 if (mListView->isSelected( item )) 378 if (mListView->isSelected( item ))
375 { 379 {
376#ifndef KAB_EMBEDDED 380#ifndef KAB_EMBEDDED
377 ceItem = dynamic_cast<ContactListViewItem*>(item); 381 ceItem = dynamic_cast<ContactListViewItem*>(item);
378#else //KAB_EMBEDDED 382#else //KAB_EMBEDDED
379 ceItem = (ContactListViewItem*)(item); 383 ceItem = (ContactListViewItem*)(item);
380#endif //KAB_EMBEDDED 384#endif //KAB_EMBEDDED
381 385
@@ -385,25 +389,25 @@ QStringList KAddressBookTableView::selectedUids()
385 } 389 }
386 if ( uidList.count() == 0 ) 390 if ( uidList.count() == 0 )
387 if ( mListView->currentItem() ) { 391 if ( mListView->currentItem() ) {
388 ceItem = (ContactListViewItem*)(mListView->currentItem()) ; 392 ceItem = (ContactListViewItem*)(mListView->currentItem()) ;
389 uidList << ceItem->addressee().uid(); 393 uidList << ceItem->addressee().uid();
390 } 394 }
391 395
392 return uidList; 396 return uidList;
393} 397}
394 398
395void KAddressBookTableView::setSelected(QString uid, bool selected) 399void KAddressBookTableView::setSelected(QString uid, bool selected)
396{ 400{
397 QListViewItem *item; 401 Q3ListViewItem *item;
398 ContactListViewItem *ceItem; 402 ContactListViewItem *ceItem;
399 403
400 if (uid.isNull()) 404 if (uid.isNull())
401 { 405 {
402 mListView->selectAll(selected); 406 mListView->selectAll(selected);
403 } 407 }
404 else 408 else
405 { 409 {
406 for(item = mListView->firstChild(); item; item = item->itemBelow()) 410 for(item = mListView->firstChild(); item; item = item->itemBelow())
407 { 411 {
408#ifndef KAB_EMBEDDED 412#ifndef KAB_EMBEDDED
409 ceItem = dynamic_cast<ContactListViewItem*>(item); 413 ceItem = dynamic_cast<ContactListViewItem*>(item);
@@ -420,49 +424,49 @@ void KAddressBookTableView::setSelected(QString uid, bool selected)
420 mListView->ensureItemVisible(item); 424 mListView->ensureItemVisible(item);
421 } 425 }
422 } 426 }
423 } 427 }
424} 428}
425 429
426void KAddressBookTableView::addresseeSelected() 430void KAddressBookTableView::addresseeSelected()
427{ 431{
428 // We need to try to find the first selected item. This might not be the 432 // We need to try to find the first selected item. This might not be the
429 // last selected item, but when QListView is in multiselection mode, 433 // last selected item, but when QListView is in multiselection mode,
430 // there is no way to figure out which one was 434 // there is no way to figure out which one was
431 // selected last. 435 // selected last.
432 QListViewItem *item; 436 Q3ListViewItem *item;
433 bool found =false; 437 bool found =false;
434 for (item = mListView->firstChild(); item && !found; 438 for (item = mListView->firstChild(); item && !found;
435 item = item->nextSibling()) 439 item = item->nextSibling())
436 { 440 {
437 if (item->isSelected()) 441 if (item->isSelected())
438 { 442 {
439 found = true; 443 found = true;
440#ifndef KAB_EMBEDDED 444#ifndef KAB_EMBEDDED
441 ContactListViewItem *ceItem 445 ContactListViewItem *ceItem
442 = dynamic_cast<ContactListViewItem*>(item); 446 = dynamic_cast<ContactListViewItem*>(item);
443#else //KAB_EMBEDDED 447#else //KAB_EMBEDDED
444 ContactListViewItem *ceItem 448 ContactListViewItem *ceItem
445 = (ContactListViewItem*)(item); 449 = (ContactListViewItem*)(item);
446#endif //KAB_EMBEDDED 450#endif //KAB_EMBEDDED
447 451
448 if ( ceItem ) emit selected(ceItem->addressee().uid()); 452 if ( ceItem ) emit selected(ceItem->addressee().uid());
449 } 453 }
450 } 454 }
451 455
452 if (!found) 456 if (!found)
453 emit selected(QString::null); 457 emit selected(QString::null);
454} 458}
455 459
456void KAddressBookTableView::addresseeExecuted(QListViewItem *item) 460void KAddressBookTableView::addresseeExecuted(Q3ListViewItem *item)
457{ 461{
458 if (item) 462 if (item)
459 { 463 {
460#ifndef KAB_EMBEDDED 464#ifndef KAB_EMBEDDED
461 ContactListViewItem *ceItem 465 ContactListViewItem *ceItem
462 = dynamic_cast<ContactListViewItem*>(item); 466 = dynamic_cast<ContactListViewItem*>(item);
463#else //KAB_EMBEDDED 467#else //KAB_EMBEDDED
464 ContactListViewItem *ceItem 468 ContactListViewItem *ceItem
465 = (ContactListViewItem*)(item); 469 = (ContactListViewItem*)(item);
466#endif //KAB_EMBEDDED 470#endif //KAB_EMBEDDED
467 471
468 if (ceItem) 472 if (ceItem)
@@ -478,15 +482,15 @@ void KAddressBookTableView::addresseeExecuted(QListViewItem *item)
478 482
479void KAddressBookTableView::addresseeDeleted() 483void KAddressBookTableView::addresseeDeleted()
480{ 484{
481 485
482 emit deleteRequest(); 486 emit deleteRequest();
483 487
484} 488}
485 489
486 490
487 491
488 492
489 493
490#ifndef KAB_EMBEDDED 494#ifndef KAB_EMBEDDED_
491#include "kaddressbooktableview.moc" 495#include "moc_kaddressbooktableview.cpp"
492#endif //KAB_EMBEDDED 496#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/kaddressbooktableview.h b/kaddressbook/views/kaddressbooktableview.h
index 38db7b4..c3cb038 100644
--- a/kaddressbook/views/kaddressbooktableview.h
+++ b/kaddressbook/views/kaddressbooktableview.h
@@ -1,43 +1,45 @@
1#ifndef KADDRESSBOOKTABLEVIEW_H 1#ifndef KADDRESSBOOKTABLEVIEW_H
2#define KADDRESSBOOKTABLEVIEW_H 2#define KADDRESSBOOKTABLEVIEW_H
3 3
4 4
5#ifndef KAB_EMBEDDED 5#ifndef KAB_EMBEDDED
6 6
7 7
8#ifdef HAVE_CONFIG_H 8#ifdef HAVE_CONFIG_H
9#include <config.h> 9#include <config.h>
10#endif 10#endif
11 11
12#include <qwidget.h> 12#include <qwidget.h>
13#include <qlistview.h> 13#include <q3listview.h>
14#include <qstring.h> 14#include <qstring.h>
15#include <qdialog.h> 15#include <qdialog.h>
16#include <qtabdialog.h> 16#include <q3tabdialog.h>
17#include <qstringlist.h> 17#include <qstringlist.h>
18#include <qvaluelist.h> 18#include <q3valuelist.h>
19 19
20#include "undo.h" 20#include "undo.h"
21 21
22#else //KAB_EMBEDDED 22#else //KAB_EMBEDDED
23#include "views/configuretableviewdialog.h" 23#include "views/configuretableviewdialog.h"
24#endif //KAB_EMBEDDED 24#endif //KAB_EMBEDDED
25 25
26#include "klocale.h" 26#include "klocale.h"
27#include "kaddressbookview.h" 27#include "kaddressbookview.h"
28//Added by qt3to4:
29#include <Q3VBoxLayout>
28 30
29class QListViewItem; 31class Q3ListViewItem;
30class QListBox; 32class Q3ListBox;
31class QVBoxLayout; 33class Q3VBoxLayout;
32class KConfig; 34class KConfig;
33 35
34class ContactListViewItem; 36class ContactListViewItem;
35class ContactListView; 37class ContactListView;
36 38
37 39
38namespace KABC { class AddressBook; } 40namespace KABC { class AddressBook; }
39 41
40/** 42/**
41 * This class is the table view for kaddressbook. This view is a KListView 43 * This class is the table view for kaddressbook. This view is a KListView
42 * with multiple columns for the selected fields. 44 * with multiple columns for the selected fields.
43 * 45 *
@@ -70,28 +72,28 @@ friend class ContactListView;
70 public slots: 72 public slots:
71 virtual void reconstructListView(); 73 virtual void reconstructListView();
72 74
73 protected slots: 75 protected slots:
74 /** Called whenever the user selects an addressee in the list view. 76 /** Called whenever the user selects an addressee in the list view.
75 */ 77 */
76 void addresseeSelected(); 78 void addresseeSelected();
77 void addresseeDeleted(); 79 void addresseeDeleted();
78 80
79 /** Called whenever the user executes an addressee. In terms of the 81 /** Called whenever the user executes an addressee. In terms of the
80 * list view, this is probably a double click 82 * list view, this is probably a double click
81 */ 83 */
82 void addresseeExecuted(QListViewItem*); 84 void addresseeExecuted(Q3ListViewItem*);
83 85
84 private: 86 private:
85 QVBoxLayout *mainLayout; 87 Q3VBoxLayout *mainLayout;
86 ContactListView *mListView; 88 ContactListView *mListView;
87}; 89};
88 90
89 91
90class TableViewFactory : public ViewFactory 92class TableViewFactory : public ViewFactory
91{ 93{
92 public: 94 public:
93 KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name ) 95 KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name )
94 { 96 {
95 return new KAddressBookTableView( ab, parent, name ); 97 return new KAddressBookTableView( ab, parent, name );
96 } 98 }
97 99
diff --git a/kaddressbook/xxport/csv_xxport.cpp b/kaddressbook/xxport/csv_xxport.cpp
index 7281003..ed5807f 100644
--- a/kaddressbook/xxport/csv_xxport.cpp
+++ b/kaddressbook/xxport/csv_xxport.cpp
@@ -21,25 +21,25 @@
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qfile.h> 31#include <qfile.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qtextstream.h> 33#include <q3textstream.h>
34#include <qtextcodec.h> 34#include <qtextcodec.h>
35 35
36#include <kfiledialog.h> 36#include <kfiledialog.h>
37#ifndef KAB_EMBEDDED 37#ifndef KAB_EMBEDDED
38#include <kio/netaccess.h> 38#include <kio/netaccess.h>
39#endif //KAB_EMBEDDED 39#endif //KAB_EMBEDDED
40 40
41#include <klocale.h> 41#include <klocale.h>
42#include <kmessagebox.h> 42#include <kmessagebox.h>
43#include <ktempfile.h> 43#include <ktempfile.h>
44#include <kurl.h> 44#include <kurl.h>
45 45
@@ -95,45 +95,45 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString&
95 QString txt = i18n( "<qt>Unable to open file <b>%1</b>.%2.</qt>" ); 95 QString txt = i18n( "<qt>Unable to open file <b>%1</b>.%2.</qt>" );
96 KMessageBox::error( parentWidget(), txt.arg( url.url() ) 96 KMessageBox::error( parentWidget(), txt.arg( url.url() )
97 .arg( strerror( tmpFile.status() ) ) ); 97 .arg( strerror( tmpFile.status() ) ) );
98 return false; 98 return false;
99 } 99 }
100 100
101 doExport( tmpFile.file(), list ); 101 doExport( tmpFile.file(), list );
102 tmpFile.close(); 102 tmpFile.close();
103 103
104 return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() ); 104 return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() );
105 } else { 105 } else {
106 QFile file( url.path() ); 106 QFile file( url.path() );
107 if ( !file.open( IO_WriteOnly ) ) { 107 if ( !file.open( QIODevice::WriteOnly ) ) {
108 QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); 108 QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" );
109 KMessageBox::error( parentWidget(), txt.arg( url.path() ) ); 109 KMessageBox::error( parentWidget(), txt.arg( url.path() ) );
110 return false; 110 return false;
111 } 111 }
112 112
113 doExport( &file, list ); 113 doExport( &file, list );
114 file.close(); 114 file.close();
115 115
116 return true; 116 return true;
117 } 117 }
118 118
119#else //KAB_EMBEDDED 119#else //KAB_EMBEDDED
120 120
121 QString fileName = KFileDialog::getSaveFileName( "addressbook.csv", i18n("Save file"), parentWidget() ); 121 QString fileName = KFileDialog::getSaveFileName( "addressbook.csv", i18n("Save file"), parentWidget() );
122 122
123 if ( fileName.isEmpty() ) 123 if ( fileName.isEmpty() )
124 return false; 124 return false;
125 125
126 QFile file( fileName ); 126 QFile file( fileName );
127 if ( !file.open( IO_WriteOnly ) ) { 127 if ( !file.open( QIODevice::WriteOnly ) ) {
128 QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); 128 QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" );
129 KMessageBox::error( parentWidget(), txt.arg( fileName ) ); 129 KMessageBox::error( parentWidget(), txt.arg( fileName ) );
130 return false; 130 return false;
131 } 131 }
132 132
133 doExport( &file, list ); 133 doExport( &file, list );
134 file.close(); 134 file.close();
135 135
136 return true; 136 return true;
137 137
138 138
139#endif //KAB_EMBEDDED 139#endif //KAB_EMBEDDED
@@ -142,25 +142,25 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString&
142 142
143KABC::AddresseeList CSVXXPort::importContacts( const QString& ) const 143KABC::AddresseeList CSVXXPort::importContacts( const QString& ) const
144{ 144{
145 CSVImportDialog dlg( addressBook(), parentWidget() ); 145 CSVImportDialog dlg( addressBook(), parentWidget() );
146 if ( dlg.exec() ) 146 if ( dlg.exec() )
147 return dlg.contacts(); 147 return dlg.contacts();
148 else 148 else
149 return KABC::AddresseeList(); 149 return KABC::AddresseeList();
150} 150}
151 151
152void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) 152void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list )
153{ 153{
154 QTextStream t( fp ); 154 Q3TextStream t( fp );
155 t.setCodec( QTextCodec::codecForName("utf8") ); 155 t.setCodec( QTextCodec::codecForName("utf8") );
156 156
157 KABC::AddresseeList::ConstIterator iter; 157 KABC::AddresseeList::ConstIterator iter;
158 KABC::Field::List fields = addressBook()->fields(); 158 KABC::Field::List fields = addressBook()->fields();
159 KABC::Field::List::Iterator fieldIter; 159 KABC::Field::List::Iterator fieldIter;
160 bool first = true; 160 bool first = true;
161 161
162 // First output the column headings 162 // First output the column headings
163 for ( fieldIter = fields.begin(); fieldIter != fields.end(); ++fieldIter ) { 163 for ( fieldIter = fields.begin(); fieldIter != fields.end(); ++fieldIter ) {
164 if ( !first ) 164 if ( !first )
165 t << ","; 165 t << ",";
166 166
@@ -178,17 +178,15 @@ void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list )
178 for ( fieldIter = fields.begin(); fieldIter != fields.end(); ++fieldIter ) { 178 for ( fieldIter = fields.begin(); fieldIter != fields.end(); ++fieldIter ) {
179 if ( !first ) 179 if ( !first )
180 t << ","; 180 t << ",";
181 181
182 t << "\"" << (*fieldIter)->value( addr ) << "\""; 182 t << "\"" << (*fieldIter)->value( addr ) << "\"";
183 first = false; 183 first = false;
184 } 184 }
185 185
186 t << "\n"; 186 t << "\n";
187 } 187 }
188} 188}
189 189
190#ifndef KAB_EMBEDDED 190#ifndef KAB_EMBEDDED_
191#include "csv_xxport.moc" 191#include "moc_csv_xxport.cpp"
192#endif //KAB_EMBEDDED 192#endif //KAB_EMBEDDED
193
194
diff --git a/kaddressbook/xxport/csvimportdialog.cpp b/kaddressbook/xxport/csvimportdialog.cpp
index 862241e..7959cac 100644
--- a/kaddressbook/xxport/csvimportdialog.cpp
+++ b/kaddressbook/xxport/csvimportdialog.cpp
@@ -18,54 +18,58 @@
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22/* 22/*
23Enhanced Version of the file for platform independent KDE tools. 23Enhanced Version of the file for platform independent KDE tools.
24Copyright (c) 2004 Ulf Schenk 24Copyright (c) 2004 Ulf Schenk
25 25
26$Id$ 26$Id$
27*/ 27*/
28 28
29 29
30#include <qbuttongroup.h> 30#include <q3buttongroup.h>
31#include <qcheckbox.h> 31#include <qcheckbox.h>
32#include <qcombobox.h> 32#include <qcombobox.h>
33#ifdef DESKTOP_VERSION 33#ifdef DESKTOP_VERSION
34#include <qinputdialog.h> 34#include <qinputdialog.h>
35#else 35#else
36#include <qtcompat/qinputdialog.h> 36#include <qtcompat/qinputdialog.h>
37#endif 37#endif
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qlineedit.h> 39#include <qlineedit.h>
40#include <qpushbutton.h> 40#include <qpushbutton.h>
41#include <qradiobutton.h> 41#include <qradiobutton.h>
42#include <qtable.h> 42#include <q3table.h>
43#include <qlayout.h> 43#include <qlayout.h>
44#include <qtextstream.h> 44#include <q3textstream.h>
45#include <qfile.h> 45#include <qfile.h>
46//Added by qt3to4:
47#include <Q3HBoxLayout>
48#include <Q3ValueList>
49#include <Q3GridLayout>
46 50
47#include <kapplication.h> 51#include <kapplication.h>
48#include <kdebug.h> 52#include <kdebug.h>
49#include <kdialogbase.h> 53#include <kdialogbase.h>
50#include <kfiledialog.h> 54#include <kfiledialog.h>
51#include <klineedit.h> 55#include <klineedit.h>
52#include <klocale.h> 56#include <klocale.h>
53#include <kglobal.h> 57#include <kglobal.h>
54#include <kmessagebox.h> 58#include <kmessagebox.h>
55#include <kstandarddirs.h> 59#include <kstandarddirs.h>
56#include <kurlrequester.h> 60#include <kurlrequester.h>
57 61
58#ifdef DESKTOP_VERSION 62#ifdef DESKTOP_VERSION
59#include "qtable.h" 63#include "q3table.h"
60#else 64#else
61#include "qcombotableitem.h" 65#include "qcombotableitem.h"
62#endif 66#endif
63#include "csvimportdialog.h" 67#include "csvimportdialog.h"
64 68
65CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, 69CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent,
66 const char * name ) 70 const char * name )
67 : KDialogBase( Plain, i18n ( "CSV Import Dialog" ), Ok | Cancel | User1 | 71 : KDialogBase( Plain, i18n ( "CSV Import Dialog" ), Ok | Cancel | User1 |
68 User2, Ok, parent, name, true, true ), 72 User2, Ok, parent, name, true, true ),
69 mAdjustRows( false ), 73 mAdjustRows( false ),
70 mStartLine( 0 ), 74 mStartLine( 0 ),
71 mTextQuote( '"' ), 75 mTextQuote( '"' ),
@@ -152,50 +156,50 @@ CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent,
152 connect( mUrlRequester, SIGNAL( urlSelected( const QString& ) ), 156 connect( mUrlRequester, SIGNAL( urlSelected( const QString& ) ),
153 this, SLOT( setFile( const QString& ) ) ); 157 this, SLOT( setFile( const QString& ) ) );
154 connect( mUrlRequester->lineEdit(), SIGNAL( textChanged ( const QString& ) ), 158 connect( mUrlRequester->lineEdit(), SIGNAL( textChanged ( const QString& ) ),
155 this, SLOT( urlChanged( const QString& ) ) ); 159 this, SLOT( urlChanged( const QString& ) ) );
156 160
157 connect( this, SIGNAL( user1Clicked() ), 161 connect( this, SIGNAL( user1Clicked() ),
158 this, SLOT( applyTemplate() ) ); 162 this, SLOT( applyTemplate() ) );
159 163
160 connect( this, SIGNAL( user2Clicked() ), 164 connect( this, SIGNAL( user2Clicked() ),
161 this, SLOT( saveTemplate() ) ); 165 this, SLOT( saveTemplate() ) );
162 166
163 // if ( QApplication::desktop()->width() < 321 ) 167 // if ( QApplication::desktop()->width() < 321 )
164 QIconSet icon = SmallIcon("filesave"); 168 QIcon icon = SmallIcon("filesave");
165 169
166 findButton( User2 )->setIconSet (icon ) ; 170 findButton( User2 )->setIconSet (icon ) ;
167 icon = SmallIcon("fileopen"); 171 icon = SmallIcon("fileopen");
168 findButton( User1 )->setIconSet (icon ) ; 172 findButton( User1 )->setIconSet (icon ) ;
169 int wid = findButton( User2 )->sizeHint().height(); 173 int wid = findButton( User2 )->sizeHint().height();
170 findButton( User2 )->setMaximumWidth( wid+4 ); 174 findButton( User2 )->setMaximumWidth( wid+4 );
171 findButton( User1 )->setMaximumWidth( wid+4 ); 175 findButton( User1 )->setMaximumWidth( wid+4 );
172} 176}
173 177
174CSVImportDialog::~CSVImportDialog() 178CSVImportDialog::~CSVImportDialog()
175{ 179{
176} 180}
177 181
178KABC::AddresseeList CSVImportDialog::contacts() const 182KABC::AddresseeList CSVImportDialog::contacts() const
179{ 183{
180 KABC::AddresseeList contacts; 184 KABC::AddresseeList contacts;
181 185
182 for ( int row = 1; row < mTable->numRows(); ++row ) { 186 for ( int row = 1; row < mTable->numRows(); ++row ) {
183 KABC::Addressee a; 187 KABC::Addressee a;
184 bool emptyRow = true; 188 bool emptyRow = true;
185 KABC::Address addrHome( KABC::Address::Home ); 189 KABC::Address addrHome( KABC::Address::Home );
186 KABC::Address addrWork( KABC::Address::Work ); 190 KABC::Address addrWork( KABC::Address::Work );
187 for ( int col = 0; col < mTable->numCols(); ++col ) { 191 for ( int col = 0; col < mTable->numCols(); ++col ) {
188 192
189 QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, col ) ); 193 Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, col ) );
190 194
191 if ( !item ) { 195 if ( !item ) {
192 qDebug( "ERROR: item cast failed" ); 196 qDebug( "ERROR: item cast failed" );
193 continue; 197 continue;
194 } 198 }
195 199
196 QString value = mTable->text( row, col ); 200 QString value = mTable->text( row, col );
197 if ( !value.isEmpty() ) 201 if ( !value.isEmpty() )
198 emptyRow = false; 202 emptyRow = false;
199 203
200 switch ( posToType( item->currentItem() ) ) 204 switch ( posToType( item->currentItem() ) )
201 { 205 {
@@ -220,25 +224,25 @@ KABC::AddresseeList CSVImportDialog::contacts() const
220 case Suffix: 224 case Suffix:
221 a.setSuffix( value ); 225 a.setSuffix( value );
222 break; 226 break;
223 case NickName: 227 case NickName:
224 a.setNickName( value ); 228 a.setNickName( value );
225 break; 229 break;
226 case Birthday: 230 case Birthday:
227//US 231//US
228//the generated code had the following format: a.setBirthday( QDate::fromString( value, Qt::ISODate ) ); 232//the generated code had the following format: a.setBirthday( QDate::fromString( value, Qt::ISODate ) );
229// But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? 233// But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ?
230 { 234 {
231 QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate 235 QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate
232 a.setBirthday(dt); 236 a.setBirthday(QDateTime(dt));
233 } 237 }
234 break; 238 break;
235 case Email: 239 case Email:
236 if ( !value.isEmpty() ) 240 if ( !value.isEmpty() )
237 a.insertEmail( value, true ); 241 a.insertEmail( value, true );
238 break; 242 break;
239 case Role: 243 case Role:
240 a.setRole( value ); 244 a.setRole( value );
241 break; 245 break;
242 case Title: 246 case Title:
243 a.setTitle( value ); 247 a.setTitle( value );
244 break; 248 break;
@@ -373,44 +377,44 @@ KABC::AddresseeList CSVImportDialog::contacts() const
373 377
374 if ( !emptyRow && !a.isEmpty() ) 378 if ( !emptyRow && !a.isEmpty() )
375 contacts.append( a ); 379 contacts.append( a );
376 } 380 }
377 381
378 return contacts; 382 return contacts;
379} 383}
380 384
381void CSVImportDialog::initGUI() 385void CSVImportDialog::initGUI()
382{ 386{
383 QWidget* page = plainPage(); 387 QWidget* page = plainPage();
384 388
385 QGridLayout *layout = new QGridLayout( page, 1, 1, marginHintSmall(), 389 Q3GridLayout *layout = new Q3GridLayout( page, 1, 1, marginHintSmall(),
386 spacingHintSmall() ); 390 spacingHintSmall() );
387 QHBoxLayout *hbox = new QHBoxLayout(); 391 Q3HBoxLayout *hbox = new Q3HBoxLayout();
388 hbox->setSpacing( spacingHint() ); 392 hbox->setSpacing( spacingHint() );
389 393
390 QLabel *label = new QLabel( i18n( "File to import:" ), page ); 394 QLabel *label = new QLabel( i18n( "File to import:" ), page );
391 hbox->addWidget( label ); 395 hbox->addWidget( label );
392 396
393 mUrlRequester = new KURLRequester( page ); 397 mUrlRequester = new KURLRequester( page );
394 mUrlRequester->setFilter( "*.csv" ); 398 mUrlRequester->setFilter( "*.csv" );
395 hbox->addWidget( mUrlRequester ); 399 hbox->addWidget( mUrlRequester );
396 400
397 layout->addMultiCellLayout( hbox, 0, 0, 0, 2 ); 401 layout->addMultiCellLayout( hbox, 0, 0, 0, 2 );
398 402
399 // Delimiter: comma, semicolon, tab, space, other 403 // Delimiter: comma, semicolon, tab, space, other
400 mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), page ); 404 mDelimiterBox = new Q3ButtonGroup( i18n( "Delimiter" ), page );
401 mDelimiterBox->setColumnLayout( 0, Qt::Vertical ); 405 mDelimiterBox->setColumnLayout( 0, Qt::Vertical );
402 mDelimiterBox->layout()->setSpacing( spacingHint() ); 406 mDelimiterBox->layout()->setSpacing( spacingHint() );
403 mDelimiterBox->layout()->setMargin( marginHint() ); 407 mDelimiterBox->layout()->setMargin( marginHint() );
404 QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() ); 408 Q3GridLayout *delimiterLayout = new Q3GridLayout( mDelimiterBox->layout() );
405 delimiterLayout->setAlignment( Qt::AlignTop ); 409 delimiterLayout->setAlignment( Qt::AlignTop );
406 layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 2 ); 410 layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 2 );
407 411
408 mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox ); 412 mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox );
409 mRadioComma->setChecked( true ); 413 mRadioComma->setChecked( true );
410 delimiterLayout->addWidget( mRadioComma, 0, 0 ); 414 delimiterLayout->addWidget( mRadioComma, 0, 0 );
411 415
412 mRadioSemicolon = new QRadioButton( i18n( "Semicolon" ), mDelimiterBox ); 416 mRadioSemicolon = new QRadioButton( i18n( "Semicolon" ), mDelimiterBox );
413 delimiterLayout->addWidget( mRadioSemicolon, 0, 1 ); 417 delimiterLayout->addWidget( mRadioSemicolon, 0, 1 );
414 418
415 mRadioTab = new QRadioButton( i18n( "Tabulator" ), mDelimiterBox ); 419 mRadioTab = new QRadioButton( i18n( "Tabulator" ), mDelimiterBox );
416 delimiterLayout->addWidget( mRadioTab, 1, 0 ); 420 delimiterLayout->addWidget( mRadioTab, 1, 0 );
@@ -441,26 +445,26 @@ void CSVImportDialog::initGUI()
441 label = new QLabel( i18n( "Start at line:" ), page ); 445 label = new QLabel( i18n( "Start at line:" ), page );
442 layout->addWidget( label, 2, 1 ); 446 layout->addWidget( label, 2, 1 );
443 447
444 label = new QLabel( i18n( "Textquote:" ), page ); 448 label = new QLabel( i18n( "Textquote:" ), page );
445 layout->addWidget( label, 2, 0 ); 449 layout->addWidget( label, 2, 0 );
446 label = new QLabel( i18n( "Codec:" ), page ); 450 label = new QLabel( i18n( "Codec:" ), page );
447 layout->addWidget( label, 2, 2 ); 451 layout->addWidget( label, 2, 2 );
448 452
449 mIgnoreDuplicates = new QCheckBox( page ); 453 mIgnoreDuplicates = new QCheckBox( page );
450 mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) ); 454 mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) );
451 layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 2 ); 455 layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 2 );
452 456
453 mTable = new QTable( 0, 0, page ); 457 mTable = new Q3Table( 0, 0, page );
454 mTable->setSelectionMode( QTable::NoSelection ); 458 mTable->setSelectionMode( Q3Table::NoSelection );
455 //mTable->horizontalHeader()->hide(); 459 //mTable->horizontalHeader()->hide();
456 layout->addMultiCellWidget( mTable, 5, 5, 0, 2 ); 460 layout->addMultiCellWidget( mTable, 5, 5, 0, 2 );
457/*US 461/*US
458 setButtonText( User1, i18n( "Apply Template" ) ); 462 setButtonText( User1, i18n( "Apply Template" ) );
459 setButtonText( User2, i18n( "Save Template" ) ); 463 setButtonText( User2, i18n( "Save Template" ) );
460*/ 464*/
461 465
462 enableButtonOK( false ); 466 enableButtonOK( false );
463 467
464 findButton( User1 )->setEnabled( false ); 468 findButton( User1 )->setEnabled( false );
465 findButton( User2 )->setEnabled( false ); 469 findButton( User2 )->setEnabled( false );
466 470
@@ -474,68 +478,68 @@ void CSVImportDialog::initGUI()
474void CSVImportDialog::fillTable() 478void CSVImportDialog::fillTable()
475{ 479{
476 int row, column; 480 int row, column;
477 bool lastCharDelimiter = false; 481 bool lastCharDelimiter = false;
478 bool ignoreDups = mIgnoreDuplicates->isChecked(); 482 bool ignoreDups = mIgnoreDuplicates->isChecked();
479 enum { S_START, S_QUOTED_FIELD, S_MAYBE_END_OF_QUOTED_FIELD, S_END_OF_QUOTED_FIELD, 483 enum { S_START, S_QUOTED_FIELD, S_MAYBE_END_OF_QUOTED_FIELD, S_END_OF_QUOTED_FIELD,
480 S_MAYBE_NORMAL_FIELD, S_NORMAL_FIELD } state = S_START; 484 S_MAYBE_NORMAL_FIELD, S_NORMAL_FIELD } state = S_START;
481 485
482 QChar x; 486 QChar x;
483 QString field = ""; 487 QString field = "";
484 488
485 // store previous assignment 489 // store previous assignment
486 QValueList<int> mTypeOld = mTypeStore; 490 Q3ValueList<int> mTypeOld = mTypeStore;
487 491
488 mTypeStore.clear(); 492 mTypeStore.clear();
489 for ( column = 0; column < mTable->numCols(); ++column ) { 493 for ( column = 0; column < mTable->numCols(); ++column ) {
490 QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, column ) ); 494 Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, column ) );
491 495
492 if ( !item || mClearTypeStore ) 496 if ( !item || mClearTypeStore )
493 mTypeStore.append( typeToPos( Undefined ) ); 497 mTypeStore.append( typeToPos( Undefined ) );
494 else if ( item ) 498 else if ( item )
495 mTypeStore.append( item->currentItem() ); 499 mTypeStore.append( item->currentItem() );
496 } 500 }
497 501
498 clearTable(); 502 clearTable();
499 503
500 row = column = 1; 504 row = column = 1;
501 if ( mComboCodec->currentItem () == 0 ) { 505 if ( mComboCodec->currentItem () == 0 ) {
502 mData = QString::fromUtf8( mFileArray.data() ); 506 mData = QString::fromUtf8( mFileArray.data() );
503 } else if ( mComboCodec->currentItem () == 1 ) { 507 } else if ( mComboCodec->currentItem () == 1 ) {
504 mData = QString::fromLatin1( mFileArray.data() ); 508 mData = QString::fromLatin1( mFileArray.data() );
505 } else { 509 } else {
506 mData = QString::fromLocal8Bit( mFileArray.data() ); 510 mData = QString::fromLocal8Bit( mFileArray.data() );
507 } 511 }
508 512
509 QTextStream inputStream( mData, IO_ReadOnly ); 513 Q3TextStream inputStream( mData, QIODevice::ReadOnly );
510 514
511 if ( mComboCodec->currentItem () == 0 ) { 515 if ( mComboCodec->currentItem () == 0 ) {
512 inputStream.setEncoding( QTextStream::UnicodeUTF8 ); 516 inputStream.setEncoding( Q3TextStream::UnicodeUTF8 );
513 } else if ( mComboCodec->currentItem () == 1 ) { 517 } else if ( mComboCodec->currentItem () == 1 ) {
514 inputStream.setEncoding( QTextStream::Latin1 ); 518 inputStream.setEncoding( Q3TextStream::Latin1 );
515 } else { 519 } else {
516 inputStream.setEncoding( QTextStream::Locale ); 520 inputStream.setEncoding( Q3TextStream::Locale );
517 } 521 }
518 522
519 int maxColumn = 0; 523 int maxColumn = 0;
520 while ( !inputStream.atEnd() ) { 524 while ( !inputStream.atEnd() ) {
521 inputStream >> x; // read one char 525 inputStream >> x; // read one char
522 526
523 if ( x == '\r' ) inputStream >> x; // eat '\r', to handle DOS/LOSEDOWS files correctly 527 if ( x == '\r' ) inputStream >> x; // eat '\r', to handle DOS/LOSEDOWS files correctly
524 528
525 switch ( state ) { 529 switch ( state ) {
526 case S_START : 530 case S_START :
527 if ( x == mTextQuote ) { 531 if ( x == mTextQuote ) {
528 state = S_QUOTED_FIELD; 532 state = S_QUOTED_FIELD;
529 } else if ( x == mDelimiter ) { 533 } else if ( QString(x) == mDelimiter ) {
530 if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) 534 if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) )
531 ++column; 535 ++column;
532 lastCharDelimiter = true; 536 lastCharDelimiter = true;
533 } else if ( x == '\n' ) { 537 } else if ( x == '\n' ) {
534 ++row; 538 ++row;
535 column = 1; 539 column = 1;
536 } else { 540 } else {
537 field += x; 541 field += x;
538 state = S_MAYBE_NORMAL_FIELD; 542 state = S_MAYBE_NORMAL_FIELD;
539 } 543 }
540 break; 544 break;
541 case S_QUOTED_FIELD : 545 case S_QUOTED_FIELD :
@@ -552,81 +556,81 @@ void CSVImportDialog::fillTable()
552 ++column; 556 ++column;
553 lastCharDelimiter = true; 557 lastCharDelimiter = true;
554 } 558 }
555 state = S_START; 559 state = S_START;
556 } else { 560 } else {
557 field += x; 561 field += x;
558 } 562 }
559 break; 563 break;
560 case S_MAYBE_END_OF_QUOTED_FIELD : 564 case S_MAYBE_END_OF_QUOTED_FIELD :
561 if ( x == mTextQuote ) { 565 if ( x == mTextQuote ) {
562 field += x; 566 field += x;
563 state = S_QUOTED_FIELD; 567 state = S_QUOTED_FIELD;
564 } else if ( x == mDelimiter || x == '\n' ) { 568 } else if ( QString(x) == mDelimiter || x == '\n' ) {
565 setText( row - mStartLine + 1, column, field ); 569 setText( row - mStartLine + 1, column, field );
566 field = ""; 570 field = "";
567 if ( x == '\n' ) { 571 if ( x == '\n' ) {
568 ++row; 572 ++row;
569 column = 1; 573 column = 1;
570 } else { 574 } else {
571 if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) 575 if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) )
572 ++column; 576 ++column;
573 lastCharDelimiter = true; 577 lastCharDelimiter = true;
574 } 578 }
575 state = S_START; 579 state = S_START;
576 } else { 580 } else {
577 state = S_END_OF_QUOTED_FIELD; 581 state = S_END_OF_QUOTED_FIELD;
578 } 582 }
579 break; 583 break;
580 case S_END_OF_QUOTED_FIELD : 584 case S_END_OF_QUOTED_FIELD :
581 if ( x == mDelimiter || x == '\n' ) { 585 if ( QString(x) == mDelimiter || x == '\n' ) {
582 setText( row - mStartLine + 1, column, field ); 586 setText( row - mStartLine + 1, column, field );
583 field = ""; 587 field = "";
584 if ( x == '\n' ) { 588 if ( x == '\n' ) {
585 ++row; 589 ++row;
586 column = 1; 590 column = 1;
587 } else { 591 } else {
588 if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) 592 if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) )
589 ++column; 593 ++column;
590 lastCharDelimiter = true; 594 lastCharDelimiter = true;
591 } 595 }
592 state = S_START; 596 state = S_START;
593 } else { 597 } else {
594 state = S_END_OF_QUOTED_FIELD; 598 state = S_END_OF_QUOTED_FIELD;
595 } 599 }
596 break; 600 break;
597 case S_MAYBE_NORMAL_FIELD : 601 case S_MAYBE_NORMAL_FIELD :
598 if ( x == mTextQuote ) { 602 if ( x == mTextQuote ) {
599 field = ""; 603 field = "";
600 state = S_QUOTED_FIELD; 604 state = S_QUOTED_FIELD;
601 break; 605 break;
602 } 606 }
603 case S_NORMAL_FIELD : 607 case S_NORMAL_FIELD :
604 if ( x == mDelimiter || x == '\n' ) { 608 if ( QString(x) == mDelimiter || x == '\n' ) {
605 setText( row - mStartLine + 1, column, field ); 609 setText( row - mStartLine + 1, column, field );
606 field = ""; 610 field = "";
607 if ( x == '\n' ) { 611 if ( x == '\n' ) {
608 ++row; 612 ++row;
609 column = 1; 613 column = 1;
610 } else { 614 } else {
611 if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) 615 if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) )
612 ++column; 616 ++column;
613 lastCharDelimiter = true; 617 lastCharDelimiter = true;
614 } 618 }
615 state = S_START; 619 state = S_START;
616 } else { 620 } else {
617 field += x; 621 field += x;
618 } 622 }
619 } 623 }
620 if ( x != mDelimiter ) 624 if ( QString(x) != mDelimiter )
621 lastCharDelimiter = false; 625 lastCharDelimiter = false;
622 626
623 if ( column > maxColumn ) 627 if ( column > maxColumn )
624 maxColumn = column; 628 maxColumn = column;
625 } 629 }
626 630
627 // file with only one line without '\n' 631 // file with only one line without '\n'
628 if ( field.length() > 0 ) { 632 if ( field.length() > 0 ) {
629 setText( row - mStartLine + 1, column, field ); 633 setText( row - mStartLine + 1, column, field );
630 ++row; 634 ++row;
631 field = ""; 635 field = "";
632 } 636 }
@@ -640,25 +644,25 @@ void CSVImportDialog::fillTable()
640 while ( iii < count ) { 644 while ( iii < count ) {
641 keys << "dummy"; 645 keys << "dummy";
642 ++iii; 646 ++iii;
643 } 647 }
644 QMap<QString, uint>::ConstIterator it; 648 QMap<QString, uint>::ConstIterator it;
645 for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it) 649 for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it)
646 keys[( it.data() )] = it.key(); 650 keys[( it.data() )] = it.key();
647//US end 651//US end
648 652
649 for ( column = 0; column < mTable->numCols(); ++column ) { 653 for ( column = 0; column < mTable->numCols(); ++column ) {
650 654
651//US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() ); 655//US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() );
652 QComboTableItem *item = new QComboTableItem( mTable, keys ); 656 Q3ComboTableItem *item = new Q3ComboTableItem( mTable, keys );
653 mTable->setItem( 0, column, item ); 657 mTable->setItem( 0, column, item );
654 if ( column < mTypeStore.count() ) 658 if ( column < mTypeStore.count() )
655 item->setCurrentItem( mTypeStore[ column ] ); 659 item->setCurrentItem( mTypeStore[ column ] );
656 else 660 else
657 item->setCurrentItem( typeToPos( Undefined ) ); 661 item->setCurrentItem( typeToPos( Undefined ) );
658 662
659 mTable->adjustColumn( column ); 663 mTable->adjustColumn( column );
660 } 664 }
661} 665}
662 666
663void CSVImportDialog::clearTable() 667void CSVImportDialog::clearTable()
664{ 668{
@@ -755,25 +759,25 @@ void CSVImportDialog::textquoteSelected( const QString& mark )
755 759
756void CSVImportDialog::lineSelected( const QString& line ) 760void CSVImportDialog::lineSelected( const QString& line )
757{ 761{
758 mStartLine = line.toInt() - 1; 762 mStartLine = line.toInt() - 1;
759 fillTable(); 763 fillTable();
760} 764}
761 765
762void CSVImportDialog::slotOk() 766void CSVImportDialog::slotOk()
763{ 767{
764 bool assigned = false; 768 bool assigned = false;
765 769
766 for ( int column = 0; column < mTable->numCols(); ++column ) { 770 for ( int column = 0; column < mTable->numCols(); ++column ) {
767 QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, 771 Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0,
768 column ) ); 772 column ) );
769 if ( item && posToType( item->currentItem() ) != Undefined ) 773 if ( item && posToType( item->currentItem() ) != Undefined )
770 assigned = true; 774 assigned = true;
771 } 775 }
772 776
773 if ( assigned ) 777 if ( assigned )
774 KDialogBase::slotOk(); 778 KDialogBase::slotOk();
775 else 779 else
776 KMessageBox::sorry( this, i18n( "You have to assign at least one column." ) ); 780 KMessageBox::sorry( this, i18n( "You have to assign at least one column." ) );
777} 781}
778 782
779void CSVImportDialog::applyTemplate() 783void CSVImportDialog::applyTemplate()
@@ -827,25 +831,25 @@ void CSVImportDialog::applyTemplate()
827 textquoteSelected( mComboQuote->currentText() ); 831 textquoteSelected( mComboQuote->currentText() );
828 832
829 // create the column map 833 // create the column map
830 config.setGroup( "csv column map" ); 834 config.setGroup( "csv column map" );
831 for ( uint i = 0; i < numColumns; ++i ) { 835 for ( uint i = 0; i < numColumns; ++i ) {
832 int col = config.readNumEntry( QString::number( i ) ); 836 int col = config.readNumEntry( QString::number( i ) );
833 columnMap.insert( i, col ); 837 columnMap.insert( i, col );
834 } 838 }
835 839
836 // apply the column map 840 // apply the column map
837 for ( uint column = 0; column < columnMap.count(); ++column ) { 841 for ( uint column = 0; column < columnMap.count(); ++column ) {
838 int type = columnMap[ column ]; 842 int type = columnMap[ column ];
839 QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, 843 Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0,
840 column ) ); 844 column ) );
841 if ( item ) 845 if ( item )
842 item->setCurrentItem( typeToPos( type ) ); 846 item->setCurrentItem( typeToPos( type ) );
843 } 847 }
844} 848}
845 849
846void CSVImportDialog::saveTemplate() 850void CSVImportDialog::saveTemplate()
847{ 851{
848/*US 852/*US
849 QString fileName = KFileDialog::getSaveFileName( 853 QString fileName = KFileDialog::getSaveFileName(
850 locateLocal( "data", QString( kapp->name() ) + "/csv-templates/" ), 854 locateLocal( "data", QString( kapp->name() ) + "/csv-templates/" ),
851 "*.desktop", this ); 855 "*.desktop", this );
@@ -869,25 +873,25 @@ void CSVImportDialog::saveTemplate()
869 config.setGroup( "General" ); 873 config.setGroup( "General" );
870 config.writeEntry( "Columns", mTable->numCols() ); 874 config.writeEntry( "Columns", mTable->numCols() );
871 config.writeEntry( "DelimiterType", mDelimiterBox->id( mDelimiterBox->selected() ) ); 875 config.writeEntry( "DelimiterType", mDelimiterBox->id( mDelimiterBox->selected() ) );
872 config.writeEntry( "DelimiterOther", mDelimiterEdit->text() ); 876 config.writeEntry( "DelimiterOther", mDelimiterEdit->text() );
873 config.writeEntry( "QuoteType", mComboQuote->currentItem() ); 877 config.writeEntry( "QuoteType", mComboQuote->currentItem() );
874 878
875 config.setGroup( "Misc" ); 879 config.setGroup( "Misc" );
876 config.writeEntry( "Name", name ); 880 config.writeEntry( "Name", name );
877 881
878 config.setGroup( "csv column map" ); 882 config.setGroup( "csv column map" );
879 883
880 for ( uint column = 0; column < mTable->numCols(); ++column ) { 884 for ( uint column = 0; column < mTable->numCols(); ++column ) {
881 QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, 885 Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0,
882 column ) ); 886 column ) );
883 if ( item ) 887 if ( item )
884 config.writeEntry( QString::number( column ), posToType( 888 config.writeEntry( QString::number( column ), posToType(
885 item->currentItem() ) ); 889 item->currentItem() ) );
886 else 890 else
887 config.writeEntry( QString::number( column ), 0 ); 891 config.writeEntry( QString::number( column ), 0 );
888 } 892 }
889 893
890 config.sync(); 894 config.sync();
891} 895}
892 896
893QString CSVImportDialog::getText( int row, int col ) 897QString CSVImportDialog::getText( int row, int col )
@@ -925,25 +929,25 @@ int CSVImportDialog::typeToPos( uint type ) const
925 929
926void CSVImportDialog::ignoreDuplicatesChanged( int ) 930void CSVImportDialog::ignoreDuplicatesChanged( int )
927{ 931{
928 fillTable(); 932 fillTable();
929} 933}
930 934
931void CSVImportDialog::setFile( const QString &fileName ) 935void CSVImportDialog::setFile( const QString &fileName )
932{ 936{
933 if ( fileName.isEmpty() ) 937 if ( fileName.isEmpty() )
934 return; 938 return;
935 939
936 QFile file( fileName ); 940 QFile file( fileName );
937 if ( !file.open( IO_ReadOnly ) ) { 941 if ( !file.open( QIODevice::ReadOnly ) ) {
938 KMessageBox::sorry( this, i18n( "Cannot open input file!" ) ); 942 KMessageBox::sorry( this, i18n( "Cannot open input file!" ) );
939 file.close(); 943 file.close();
940 return; 944 return;
941 } 945 }
942 946
943 mFileArray = file.readAll(); 947 mFileArray = file.readAll();
944 file.close(); 948 file.close();
945 949
946 mClearTypeStore = true; 950 mClearTypeStore = true;
947 clearTable(); 951 clearTable();
948 mTable->setNumCols( 0 ); 952 mTable->setNumCols( 0 );
949 mTable->setNumRows( 0 ); 953 mTable->setNumRows( 0 );
@@ -955,15 +959,15 @@ void CSVImportDialog::setFile( const QString &fileName )
955 959
956void CSVImportDialog::urlChanged( const QString &file ) 960void CSVImportDialog::urlChanged( const QString &file )
957{ 961{
958 bool state = !file.isEmpty(); 962 bool state = !file.isEmpty();
959 963
960 enableButtonOK( state ); 964 enableButtonOK( state );
961 965
962 findButton( User1 )->setEnabled( state ); 966 findButton( User1 )->setEnabled( state );
963 findButton( User2 )->setEnabled( state ); 967 findButton( User2 )->setEnabled( state );
964 968
965} 969}
966 970
967#ifndef KAB_EMBEDDED 971#ifndef KAB_EMBEDDED_
968#include <csvimportdialog.moc> 972#include <moc_csvimportdialog.cpp>
969#endif //KAB_EMBEDDED 973#endif //KAB_EMBEDDED
diff --git a/kaddressbook/xxport/csvimportdialog.h b/kaddressbook/xxport/csvimportdialog.h
index 2661420..520f3fa 100644
--- a/kaddressbook/xxport/csvimportdialog.h
+++ b/kaddressbook/xxport/csvimportdialog.h
@@ -24,35 +24,35 @@ Enhanced Version of the file for platform independent KDE tools.
24Copyright (c) 2004 Ulf Schenk 24Copyright (c) 2004 Ulf Schenk
25 25
26$Id$ 26$Id$
27*/ 27*/
28 28
29#ifndef CSV_IMPORT_DLG_H 29#ifndef CSV_IMPORT_DLG_H
30#define CSV_IMPORT_DLG_H 30#define CSV_IMPORT_DLG_H
31 31
32#include <kabc/addressbook.h> 32#include <kabc/addressbook.h>
33#include <kabc/addresseelist.h> 33#include <kabc/addresseelist.h>
34#include <kdialogbase.h> 34#include <kdialogbase.h>
35 35
36#include <qvaluelist.h> 36#include <q3valuelist.h>
37 37
38class KURLRequester; 38class KURLRequester;
39 39
40class QButtonGroup; 40class Q3ButtonGroup;
41class QComboBox; 41class QComboBox;
42class QCheckBox; 42class QCheckBox;
43class QLineEdit; 43class QLineEdit;
44class QPushButton; 44class QPushButton;
45class QRadioButton; 45class QRadioButton;
46class QTable; 46class Q3Table;
47 47
48class CSVImportDialog : public KDialogBase 48class CSVImportDialog : public KDialogBase
49{ 49{
50 Q_OBJECT 50 Q_OBJECT
51 51
52 public: 52 public:
53 CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, 53 CSVImportDialog( KABC::AddressBook *ab, QWidget *parent,
54 const char *name = 0 ); 54 const char *name = 0 );
55 ~CSVImportDialog(); 55 ~CSVImportDialog();
56 56
57 KABC::AddresseeList contacts() const; 57 KABC::AddresseeList contacts() const;
58 58
@@ -76,26 +76,26 @@ class CSVImportDialog : public KDialogBase
76 private: 76 private:
77 enum { Undefined, FormattedName, FamilyName, GivenName, AdditionalName, 77 enum { Undefined, FormattedName, FamilyName, GivenName, AdditionalName,
78 Prefix, Suffix, NickName, Birthday, 78 Prefix, Suffix, NickName, Birthday,
79 HomeAddressStreet, HomeAddressLocality, HomeAddressRegion, 79 HomeAddressStreet, HomeAddressLocality, HomeAddressRegion,
80 HomeAddressPostalCode, HomeAddressCountry, HomeAddressLabel, 80 HomeAddressPostalCode, HomeAddressCountry, HomeAddressLabel,
81 BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion, 81 BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion,
82 BusinessAddressPostalCode, BusinessAddressCountry, 82 BusinessAddressPostalCode, BusinessAddressCountry,
83 BusinessAddressLabel, 83 BusinessAddressLabel,
84 HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, MobileWorkPhone, 84 HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, MobileWorkPhone,
85 Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL, Categories 85 Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL, Categories
86 }; 86 };
87 87
88 QTable* mTable; 88 Q3Table* mTable;
89 QButtonGroup* mDelimiterBox; 89 Q3ButtonGroup* mDelimiterBox;
90 QRadioButton* mRadioComma; 90 QRadioButton* mRadioComma;
91 QRadioButton* mRadioSemicolon; 91 QRadioButton* mRadioSemicolon;
92 QRadioButton* mRadioTab; 92 QRadioButton* mRadioTab;
93 QRadioButton* mRadioSpace; 93 QRadioButton* mRadioSpace;
94 QRadioButton* mRadioOther; 94 QRadioButton* mRadioOther;
95 QLineEdit* mDelimiterEdit; 95 QLineEdit* mDelimiterEdit;
96 QComboBox* mComboLine; 96 QComboBox* mComboLine;
97 QComboBox* mComboQuote; 97 QComboBox* mComboQuote;
98 QComboBox* mComboCodec; 98 QComboBox* mComboCodec;
99 QCheckBox* mIgnoreDuplicates; 99 QCheckBox* mIgnoreDuplicates;
100 KURLRequester* mUrlRequester; 100 KURLRequester* mUrlRequester;
101 101
@@ -110,17 +110,17 @@ class CSVImportDialog : public KDialogBase
110 int typeToPos( uint type ) const; 110 int typeToPos( uint type ) const;
111 111
112 bool mAdjustRows; 112 bool mAdjustRows;
113 int mStartLine; 113 int mStartLine;
114 QChar mTextQuote; 114 QChar mTextQuote;
115 QString mDelimiter; 115 QString mDelimiter;
116 QString mData; 116 QString mData;
117 QByteArray mFileArray; 117 QByteArray mFileArray;
118 QMap<QString, uint> mTypeMap; 118 QMap<QString, uint> mTypeMap;
119 KABC::AddressBook *mAddressBook; 119 KABC::AddressBook *mAddressBook;
120 int mCustomCounter; 120 int mCustomCounter;
121 bool mClearTypeStore; 121 bool mClearTypeStore;
122 QValueList<int> mTypeStore; 122 Q3ValueList<int> mTypeStore;
123 123
124}; 124};
125 125
126#endif 126#endif
diff --git a/kaddressbook/xxport/kde2_xxport.cpp b/kaddressbook/xxport/kde2_xxport.cpp
index 03efc1b..72d3fc2 100644
--- a/kaddressbook/xxport/kde2_xxport.cpp
+++ b/kaddressbook/xxport/kde2_xxport.cpp
@@ -107,15 +107,15 @@ KABC::AddresseeList KDE2XXPort::importContacts( const QString& ) const
107 } else if ( result == KMessageBox::No ) 107 } else if ( result == KMessageBox::No )
108 proc << "kab2kabc"; 108 proc << "kab2kabc";
109 else 109 else
110 kdDebug(5720) << "KAddressBook::importKDE2(): Unknow return value." << endl; 110 kdDebug(5720) << "KAddressBook::importKDE2(): Unknow return value." << endl;
111 111
112 proc.start( KProcess::Block ); 112 proc.start( KProcess::Block );
113 113
114 addressBook()->load(); 114 addressBook()->load();
115 115
116 return KABC::AddresseeList(); 116 return KABC::AddresseeList();
117} 117}
118 118
119#ifndef KAB_EMBEDDED 119#ifndef KAB_EMBEDDED_
120#include "kde2_xxport.moc" 120#include "moc_kde2_xxport.cpp"
121#endif //KAB_EMBEDDED 121#endif //KAB_EMBEDDED
diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp
index 9a8fa68..64b9071 100644
--- a/kaddressbook/xxport/vcard_xxport.cpp
+++ b/kaddressbook/xxport/vcard_xxport.cpp
@@ -20,26 +20,28 @@
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25 Enhanced Version of the file for platform independent KDE tools. 25 Enhanced Version of the file for platform independent KDE tools.
26 Copyright (c) 2004 Ulf Schenk 26 Copyright (c) 2004 Ulf Schenk
27 27
28 $Id$ 28 $Id$
29*/ 29*/
30 30
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <q3textstream.h>
33#include <qfileinfo.h> 33#include <qfileinfo.h>
34//Added by qt3to4:
35#include <Q3CString>
34 36
35#include <kabc/vcardconverter.h> 37#include <kabc/vcardconverter.h>
36#include <kabc/vcardparser/vcardtool.h> 38#include <kabc/vcardparser/vcardtool.h>
37#include <kfiledialog.h> 39#include <kfiledialog.h>
38#ifndef KAB_EMBEDDED 40#ifndef KAB_EMBEDDED
39#include <kio/netaccess.h> 41#include <kio/netaccess.h>
40#endif //KAB_EMBEDDED 42#endif //KAB_EMBEDDED
41 43
42#include <klocale.h> 44#include <klocale.h>
43#include <kmessagebox.h> 45#include <kmessagebox.h>
44#include <ktempfile.h> 46#include <ktempfile.h>
45#include <kurl.h> 47#include <kurl.h>
@@ -93,32 +95,32 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &list, const QString
93 name = "addressbook.vcf"; 95 name = "addressbook.vcf";
94 96
95#ifndef KAB_EMBEDDED 97#ifndef KAB_EMBEDDED
96 QString fileName = KFileDialog::getSaveFileName( name ); 98 QString fileName = KFileDialog::getSaveFileName( name );
97#else //KAB_EMBEDDED 99#else //KAB_EMBEDDED
98 QString fileName = KFileDialog::getSaveFileName( name, i18n("Save file"), parentWidget() ); 100 QString fileName = KFileDialog::getSaveFileName( name, i18n("Save file"), parentWidget() );
99#endif //KAB_EMBEDDED 101#endif //KAB_EMBEDDED
100 102
101 if ( fileName.isEmpty() ) 103 if ( fileName.isEmpty() )
102 return false; 104 return false;
103 105
104 QFile outFile( fileName ); 106 QFile outFile( fileName );
105 if ( !outFile.open( IO_WriteOnly ) ) { 107 if ( !outFile.open( QIODevice::WriteOnly ) ) {
106 QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" ); 108 QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" );
107 KMessageBox::error( parentWidget(), text.arg( fileName ) ); 109 KMessageBox::error( parentWidget(), text.arg( fileName ) );
108 return false; 110 return false;
109 } 111 }
110 112
111 QTextStream t( &outFile ); 113 Q3TextStream t( &outFile );
112 t.setEncoding( QTextStream::UnicodeUTF8 ); 114 t.setEncoding( Q3TextStream::UnicodeUTF8 );
113 115
114 KABC::Addressee::List::ConstIterator it; 116 KABC::Addressee::List::ConstIterator it;
115 for ( it = list.begin(); it != list.end(); ++it ) { 117 for ( it = list.begin(); it != list.end(); ++it ) {
116 KABC::VCardConverter converter; 118 KABC::VCardConverter converter;
117 QString vcard; 119 QString vcard;
118 120
119 KABC::VCardConverter::Version version; 121 KABC::VCardConverter::Version version;
120 if ( data == "v21" ) 122 if ( data == "v21" )
121 version = KABC::VCardConverter::v2_1; 123 version = KABC::VCardConverter::v2_1;
122 else 124 else
123 version = KABC::VCardConverter::v3_0; 125 version = KABC::VCardConverter::v3_0;
124 126
@@ -144,25 +146,25 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
144 if ( XXPortManager::importURL.isEmpty() ) 146 if ( XXPortManager::importURL.isEmpty() )
145 { 147 {
146 url = KFileDialog::getLoadFileName( QString::null, i18n("Select vCard to Import"), parentWidget() ); 148 url = KFileDialog::getLoadFileName( QString::null, i18n("Select vCard to Import"), parentWidget() );
147 } 149 }
148 else 150 else
149 url = XXPortManager::importURL; 151 url = XXPortManager::importURL;
150 if ( url.isEmpty() ) 152 if ( url.isEmpty() )
151 return addrList; 153 return addrList;
152 QString caption( i18n( "vCard Import Failed" ) ); 154 QString caption( i18n( "vCard Import Failed" ) );
153 if ( KIO::NetAccess::download( url, fileName ) ) { 155 if ( KIO::NetAccess::download( url, fileName ) ) {
154 QFile file( fileName ); 156 QFile file( fileName );
155 157
156 file.open( IO_ReadOnly ); 158 file.open( QIODevice::ReadOnly );
157 QByteArray rawData = file.readAll(); 159 QByteArray rawData = file.readAll();
158 file.close(); 160 file.close();
159 161
160 QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); 162 QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 );
161 addrList = parseVCard( data ); 163 addrList = parseVCard( data );
162 164
163 if ( !url.isLocalFile() ) 165 if ( !url.isLocalFile() )
164 KIO::NetAccess::removeTempFile( fileName ); 166 KIO::NetAccess::removeTempFile( fileName );
165 167
166 } else { 168 } else {
167 QString text = i18n( "<qt>Unable to access <b>%1</b>.</qt>" ); 169 QString text = i18n( "<qt>Unable to access <b>%1</b>.</qt>" );
168 KMessageBox::error( parentWidget(), text.arg( url.url() ), caption ); 170 KMessageBox::error( parentWidget(), text.arg( url.url() ), caption );
@@ -187,26 +189,26 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
187 if ( !fi.isFile() ) 189 if ( !fi.isFile() )
188 return addrList; 190 return addrList;
189 } 191 }
190 else 192 else
191 { 193 {
192 //US url = XXPortManager::importURL; 194 //US url = XXPortManager::importURL;
193 qDebug("VCardXXPort::importContacts Urls at the moment not supported"); 195 qDebug("VCardXXPort::importContacts Urls at the moment not supported");
194 if ( url.isEmpty() ) 196 if ( url.isEmpty() )
195 return addrList; 197 return addrList;
196 198
197 } 199 }
198 QFile file( fileName ); 200 QFile file( fileName );
199 if ( file.open( IO_ReadOnly ) ) { 201 if ( file.open( QIODevice::ReadOnly ) ) {
200 QCString rawData ( file.readAll().data(),file.size()+1); 202 Q3CString rawData ( file.readAll().data(),file.size()+1);
201 file.close(); 203 file.close();
202 int start = 0; 204 int start = 0;
203#ifndef DESKTOP_VERSION 205#ifndef DESKTOP_VERSION
204 while ( start < rawData.size()-2 ) { 206 while ( start < rawData.size()-2 ) {
205 if ( rawData.at( start ) == '\r' ) 207 if ( rawData.at( start ) == '\r' )
206 if ( rawData.at( start+1 ) == '\n' ) 208 if ( rawData.at( start+1 ) == '\n' )
207 if ( rawData.at( start+2 ) == ' ' ) { 209 if ( rawData.at( start+2 ) == ' ' ) {
208 rawData.remove(start,3); 210 rawData.remove(start,3);
209 --start; 211 --start;
210 } 212 }
211 ++start; 213 ++start;
212 } 214 }
@@ -258,15 +260,15 @@ KABC::AddresseeList VCardXXPort::parseVCard( const QString &data ) const
258 KMessageBox::sorry( parentWidget(), text ); 260 KMessageBox::sorry( parentWidget(), text );
259 } 261 }
260 } 262 }
261 */ 263 */
262 if ( addrList.isEmpty() ) { 264 if ( addrList.isEmpty() ) {
263 QString text = i18n( "The selected file does not\ninclude a valid vCard.\nPlease check the file and try again.\n" ); 265 QString text = i18n( "The selected file does not\ninclude a valid vCard.\nPlease check the file and try again.\n" );
264 KMessageBox::sorry( parentWidget(), text ); 266 KMessageBox::sorry( parentWidget(), text );
265 } 267 }
266 return addrList; 268 return addrList;
267} 269}
268 270
269 271
270#ifndef KAB_EMBEDDED 272#ifndef KAB_EMBEDDED_
271#include "vcard_xxport.moc" 273#include "moc_vcard_xxport.cpp"
272#endif //KAB_EMBEDDED 274#endif //KAB_EMBEDDED
diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp
index 405f7ec..95b240d 100644
--- a/kaddressbook/xxportmanager.cpp
+++ b/kaddressbook/xxportmanager.cpp
@@ -21,24 +21,26 @@
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qlist.h> 32#include <qlist.h>
33//Added by qt3to4:
34#include <Q3VBoxLayout>
33 35
34#include <kabc/addressbook.h> 36#include <kabc/addressbook.h>
35#include <kabc/resource.h> 37#include <kabc/resource.h>
36#include <kdebug.h> 38#include <kdebug.h>
37#include <kdialogbase.h> 39#include <kdialogbase.h>
38#include <klocale.h> 40#include <klocale.h>
39#include <kmessagebox.h> 41#include <kmessagebox.h>
40 42
41#ifndef KAB_EMBEDDED 43#ifndef KAB_EMBEDDED
42#include <ktrader.h> 44#include <ktrader.h>
43#else //KAB_EMBEDDED 45#else //KAB_EMBEDDED
44extern "C" 46extern "C"
@@ -208,63 +210,60 @@ void XXPortManager::loadPlugins()
208 kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl; 210 kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl;
209 continue; 211 continue;
210 } 212 }
211 213
212 XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory ); 214 XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory );
213 215
214 if ( !xxportFactory ) { 216 if ( !xxportFactory ) {
215 kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl; 217 kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl;
216 continue; 218 continue;
217 } 219 }
218 220
219#else //KAB_EMBEDDED 221#else //KAB_EMBEDDED
220 QList<XXPortFactory> factorylist; 222 QList<XXPortFactory*> factorylist;
221 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport())); 223 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport()));
222 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport())); 224 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport()));
223 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport())); 225 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport()));
224 //US factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_opie_xxport())); 226 //US factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_opie_xxport()));
225 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_qtopia_xxport())); 227 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_qtopia_xxport()));
226 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_sharpdtm_xxport())); 228 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_sharpdtm_xxport()));
227 229
228 QListIterator<XXPortFactory> it(factorylist); 230 for(QList<XXPortFactory*>::iterator it=factorylist.begin();it!=factorylist.end();++it) {
229 for ( ; it.current(); ++it ) 231 XXPortFactory *xxportFactory = *it;
230 {
231 XXPortFactory *xxportFactory = it.current();
232#endif //KAB_EMBEDDED 232#endif //KAB_EMBEDDED
233 233
234 XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore ); 234 XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore );
235 if ( obj ) { 235 if ( obj ) {
236 mCore->addGUIClient( obj ); 236 mCore->addGUIClient( obj );
237 mXXPortObjects.insert( obj->identifier(), obj ); 237 mXXPortObjects.insert( obj->identifier(), obj );
238 connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ), 238 connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ),
239 this, SLOT( slotExport( const QString&, const QString& ) ) ); 239 this, SLOT( slotExport( const QString&, const QString& ) ) );
240 connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ), 240 connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ),
241 this, SLOT( slotImport( const QString&, const QString& ) ) ); 241 this, SLOT( slotImport( const QString&, const QString& ) ) );
242 } 242 }
243 } 243 }
244} 244}
245 245
246 246
247PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, 247PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent,
248 const char *name ) 248 const char *name )
249 : KDialogBase( Plain, i18n( "Import this contact?" ), Ok | User1| User2, Ok, parent, 249 : KDialogBase( Plain, i18n( "Import this contact?" ), Ok | User1| User2, Ok, parent,
250 name, true, true ,i18n( "Import all!" ),i18n( "No" ) ) 250 name, true, true ,i18n( "Import all!" ),i18n( "No" ) )
251{ 251{
252 QWidget *page = plainPage(); 252 QWidget *page = plainPage();
253 QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); 253 Q3VBoxLayout *layout = new Q3VBoxLayout( page, marginHint(), spacingHint() );
254 connect( this, SIGNAL( user1Clicked() ), this, SLOT ( slotClose() ) ); 254 connect( this, SIGNAL( user1Clicked() ), this, SLOT ( slotClose() ) );
255 connect( this, SIGNAL( user2Clicked() ), this, SLOT ( slotCancel() ) ); 255 connect( this, SIGNAL( user2Clicked() ), this, SLOT ( slotCancel() ) );
256 256
257 KABC::AddresseeView *view = new KABC::AddresseeView( page ); 257 KABC::AddresseeView *view = new KABC::AddresseeView( page );
258 view->setAddressee( addr ); 258 view->setAddressee( addr );
259 layout->addWidget( view ); 259 layout->addWidget( view );
260#ifdef DESKTOP_VERSION 260#ifdef DESKTOP_VERSION
261 resize( 640, 480 ); 261 resize( 640, 480 );
262#else 262#else
263 showMaximized(); 263 showMaximized();
264#endif 264#endif
265} 265}
266 266
267#ifndef KAB_EMBEDDED 267#ifndef KAB_EMBEDDED_
268#include "xxportmanager.moc" 268#include "moc_xxportmanager.cpp"
269#endif //KAB_EMBEDDED 269#endif //KAB_EMBEDDED
270
diff --git a/kaddressbook/xxportmanager.h b/kaddressbook/xxportmanager.h
index e801d9b..0528922 100644
--- a/kaddressbook/xxportmanager.h
+++ b/kaddressbook/xxportmanager.h
@@ -23,25 +23,25 @@
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31 31
32#ifndef XXPORTMANAGER_H 32#ifndef XXPORTMANAGER_H
33#define XXPORTMANAGER_H 33#define XXPORTMANAGER_H
34 34
35#include <qdict.h> 35#include <q3dict.h>
36#include <qobject.h> 36#include <qobject.h>
37 37
38#include <kurl.h> 38#include <kurl.h>
39 39
40#include "xxportobject.h" 40#include "xxportobject.h"
41 41
42class KABCore; 42class KABCore;
43 43
44class XXPortManager : public QObject 44class XXPortManager : public QObject
45{ 45{
46 Q_OBJECT 46 Q_OBJECT
47 47
@@ -62,19 +62,19 @@ class XXPortManager : public QObject
62 62
63 signals: 63 signals:
64 void modified(); 64 void modified();
65 65
66 protected slots: 66 protected slots:
67 void noPreview(); 67 void noPreview();
68 void slotImport( const QString&, const QString& ); 68 void slotImport( const QString&, const QString& );
69 void slotExport( const QString&, const QString& ); 69 void slotExport( const QString&, const QString& );
70 70
71 private: 71 private:
72 void loadPlugins(); 72 void loadPlugins();
73 73
74 QDict<XXPortObject> mXXPortObjects; 74 Q3Dict<XXPortObject> mXXPortObjects;
75 75
76 KABCore *mCore; 76 KABCore *mCore;
77 bool mShowPreview; 77 bool mShowPreview;
78}; 78};
79 79
80#endif 80#endif
diff --git a/kaddressbook/xxportobject.cpp b/kaddressbook/xxportobject.cpp
index bd9d986..2d8d0ff 100644
--- a/kaddressbook/xxportobject.cpp
+++ b/kaddressbook/xxportobject.cpp
@@ -262,15 +262,15 @@ KABC::AddresseeList XXPortResourceObject::_importContacts( const QString& identi
262 res = tmpAB.load(); 262 res = tmpAB.load();
263 263
264 adrlst = tmpAB.allAddressees(); 264 adrlst = tmpAB.allAddressees();
265 265
266 //remove resource deletes also the Resourceobject, if the linkcount is 0 266 //remove resource deletes also the Resourceobject, if the linkcount is 0
267 tmpAB.removeResource( mResource ); 267 tmpAB.removeResource( mResource );
268 268
269 return adrlst; 269 return adrlst;
270} 270}
271 271
272 272
273 273
274#ifndef KAB_EMBEDDED 274#ifndef KAB_EMBEDDED_
275#include "xxportobject.moc" 275#include "moc_xxportobject.cpp"
276#endif //KAB_EMBEDDED 276#endif //KAB_EMBEDDED
diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp
index 278cab0..088bffa 100644
--- a/kaddressbook/xxportselectdialog.cpp
+++ b/kaddressbook/xxportselectdialog.cpp
@@ -27,73 +27,78 @@ Enhanced Version of the file for platform independent KDE tools.
27Copyright (c) 2004 Ulf Schenk 27Copyright (c) 2004 Ulf Schenk
28 28
29$Id$ 29$Id$
30*/ 30*/
31 31
32#include <kabc/addressbook.h> 32#include <kabc/addressbook.h>
33#include <kapplication.h> 33#include <kapplication.h>
34#include <kcombobox.h> 34#include <kcombobox.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kglobal.h> 36#include <kglobal.h>
37 37
38#include <qapplication.h> 38#include <qapplication.h>
39#include <qbuttongroup.h> 39#include <QDesktopWidget>
40#include <q3buttongroup.h>
40#include <qcombobox.h> 41#include <qcombobox.h>
41#include <qheader.h> 42#include <q3header.h>
42#include <qlabel.h> 43#include <qlabel.h>
43#include <qlayout.h> 44#include <qlayout.h>
44#include <qlistview.h> 45#include <q3listview.h>
45#include <qpushbutton.h> 46#include <qpushbutton.h>
46#include <qradiobutton.h> 47#include <qradiobutton.h>
47#include <qstringlist.h> 48#include <qstringlist.h>
48#include <qwhatsthis.h> 49#include <q3whatsthis.h>
50//Added by qt3to4:
51#include <Q3GridLayout>
52#include <Q3Frame>
53#include <Q3VBoxLayout>
49 54
50#include "kabcore.h" 55#include "kabcore.h"
51#include "kabprefs.h" 56#include "kabprefs.h"
52 57
53#include "xxportselectdialog.h" 58#include "xxportselectdialog.h"
54 59
55XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, 60XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort,
56 QWidget* parent, const char* name ) 61 QWidget* parent, const char* name )
57 : KDialogBase( Plain, i18n( "Choose contact selection" ), Help | Ok | Cancel, 62 : KDialogBase( Plain, i18n( "Choose contact selection" ), Help | Ok | Cancel,
58 Ok, parent, name, true, true ), mCore( core ), 63 Ok, parent, name, true, true ), mCore( core ),
59 mUseSorting( sort ) 64 mUseSorting( sort )
60{ 65{
61 initGUI(); 66 initGUI();
62 67
63 connect( mFiltersCombo, SIGNAL( activated( int ) ), 68 connect( mFiltersCombo, SIGNAL( activated( int ) ),
64 SLOT( filterChanged( int ) ) ); 69 SLOT( filterChanged( int ) ) );
65 connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ), 70 connect( mCategoriesView, SIGNAL( clicked( Q3ListViewItem* ) ),
66 SLOT( categoryClicked( QListViewItem* ) ) ); 71 SLOT( categoryClicked( Q3ListViewItem* ) ) );
67 72
68 // setup filters 73 // setup filters
69#ifndef KAB_EMBEDDED 74#ifndef KAB_EMBEDDED
70 mFilters = Filter::restore( kapp->config(), "Filter" ); 75 mFilters = Filter::restore( kapp->config(), "Filter" );
71 Filter::List::iterator filterIt; 76 Filter::List::iterator filterIt;
72#else //KAB_EMBEDDED 77#else //KAB_EMBEDDED
73 mFilters = Filter::restore( KGlobal::config(), "Filter" ); 78 mFilters = Filter::restore( KGlobal::config(), "Filter" );
74 Filter::List::Iterator filterIt; 79 Filter::List::Iterator filterIt;
75#endif //KAB_EMBEDDED 80#endif //KAB_EMBEDDED
76 QStringList filters; 81 QStringList filters;
77 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) 82 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt )
78 filters.append( (*filterIt).name() ); 83 filters.append( (*filterIt).name() );
79 84
80 mFiltersCombo->insertStringList( filters ); 85 mFiltersCombo->insertStringList( filters );
81 mUseFilters->setEnabled( filters.count() > 0 ); 86 mUseFilters->setEnabled( filters.count() > 0 );
82 87
83 // setup categories 88 // setup categories
84 QStringList categories = KABPrefs::instance()->mCustomCategories; 89 QStringList categories = KABPrefs::instance()->mCustomCategories;
85 QStringList::Iterator it; 90 QStringList::Iterator it;
86 for ( it = categories.begin(); it != categories.end(); ++it ) 91 for ( it = categories.begin(); it != categories.end(); ++it )
87 new QCheckListItem( mCategoriesView, *it, QCheckListItem::CheckBox ); 92 new Q3CheckListItem( mCategoriesView, *it, Q3CheckListItem::CheckBox );
88 mUseCategories->setEnabled( categories.count() > 0 ); 93 mUseCategories->setEnabled( categories.count() > 0 );
89 94
90 int count = mCore->selectedUIDs().count(); 95 int count = mCore->selectedUIDs().count();
91 mUseSelection->setEnabled( count != 0 ); 96 mUseSelection->setEnabled( count != 0 );
92 mUseSelection->setChecked( count > 1 ); 97 mUseSelection->setChecked( count > 1 );
93 98
94 mSortTypeCombo->insertItem( i18n( "Ascending" ) ); 99 mSortTypeCombo->insertItem( i18n( "Ascending" ) );
95 mSortTypeCombo->insertItem( i18n( "Descending" ) ); 100 mSortTypeCombo->insertItem( i18n( "Descending" ) );
96 101
97 mFields = mCore->addressBook()->fields( KABC::Field::All ); 102 mFields = mCore->addressBook()->fields( KABC::Field::All );
98 KABC::Field::List::Iterator fieldIt; 103 KABC::Field::List::Iterator fieldIt;
99 for ( fieldIt = mFields.begin(); fieldIt != mFields.end(); ++fieldIt ) 104 for ( fieldIt = mFields.begin(); fieldIt != mFields.end(); ++fieldIt )
@@ -201,112 +206,112 @@ KABC::AddresseeList XXPortSelectDialog::contacts()
201 uint pos = mFieldCombo->currentItem(); 206 uint pos = mFieldCombo->currentItem();
202 if ( pos < mFields.count() ) 207 if ( pos < mFields.count() )
203 list.sortByField( mFields[ pos ] ); 208 list.sortByField( mFields[ pos ] );
204 } 209 }
205 210
206 return list; 211 return list;
207} 212}
208 213
209QStringList XXPortSelectDialog::categories() const 214QStringList XXPortSelectDialog::categories() const
210{ 215{
211 QStringList list; 216 QStringList list;
212 217
213 QListViewItemIterator it( mCategoriesView ); 218 Q3ListViewItemIterator it( mCategoriesView );
214 for ( ; it.current(); ++it ) { 219 for ( ; it.current(); ++it ) {
215 QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); 220 Q3CheckListItem* qcli = static_cast<Q3CheckListItem*>(it.current());
216 if ( qcli->isOn() ) 221 if ( qcli->isOn() )
217 list.append( it.current()->text( 0 ) ); 222 list.append( it.current()->text( 0 ) );
218 } 223 }
219 224
220 return list; 225 return list;
221} 226}
222 227
223void XXPortSelectDialog::filterChanged( int ) 228void XXPortSelectDialog::filterChanged( int )
224{ 229{
225 mUseFilters->setChecked( true ); 230 mUseFilters->setChecked( true );
226} 231}
227 232
228void XXPortSelectDialog::categoryClicked( QListViewItem *i ) 233void XXPortSelectDialog::categoryClicked( Q3ListViewItem *i )
229{ 234{
230 QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); 235 Q3CheckListItem *qcli = static_cast<Q3CheckListItem*>( i );
231 if ( qcli->isOn() ) 236 if ( qcli->isOn() )
232 mUseCategories->setChecked( true ); 237 mUseCategories->setChecked( true );
233} 238}
234 239
235void XXPortSelectDialog::slotHelp() 240void XXPortSelectDialog::slotHelp()
236{ 241{
237#ifndef KAB_EMBEDDED 242#ifndef KAB_EMBEDDED
238 kapp->invokeHelp( "import-and-export" ); 243 kapp->invokeHelp( "import-and-export" );
239#else //KAB_EMBEDDED 244#else //KAB_EMBEDDED
240 qDebug("XXPortSelectDialog::slotHelp is not implemented yet"); 245 qDebug("XXPortSelectDialog::slotHelp is not implemented yet");
241#endif //KAB_EMBEDDED 246#endif //KAB_EMBEDDED
242 247
243} 248}
244 249
245void XXPortSelectDialog::initGUI() 250void XXPortSelectDialog::initGUI()
246{ 251{
247 QFrame *page = plainPage(); 252 Q3Frame *page = plainPage();
248 253
249 QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHintSmall(), 254 Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, KDialog::marginHintSmall(),
250 KDialog::spacingHintSmall() ); 255 KDialog::spacingHintSmall() );
251 256
252 QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page ); 257 QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page );
253 topLayout->addWidget( label ); 258 topLayout->addWidget( label );
254 259
255 mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page ); 260 mButtonGroup = new Q3ButtonGroup( i18n( "Contact Selection" ), page );
256 mButtonGroup->setColumnLayout( 0, Qt::Vertical ); 261 mButtonGroup->setColumnLayout( 0, Qt::Vertical );
257 mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); 262 mButtonGroup->layout()->setSpacing( KDialog::spacingHint() );
258 mButtonGroup->layout()->setMargin( KDialog::marginHint() ); 263 mButtonGroup->layout()->setMargin( KDialog::marginHint() );
259 264
260 QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() ); 265 Q3GridLayout *groupLayout = new Q3GridLayout( mButtonGroup->layout() );
261 groupLayout->setAlignment( Qt::AlignTop ); 266 groupLayout->setAlignment( Qt::AlignTop );
262 267
263 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup ); 268 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup );
264 mUseWholeBook->setChecked( true ); 269 mUseWholeBook->setChecked( true );
265 QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); 270 Q3WhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) );
266 groupLayout->addWidget( mUseWholeBook, 0, 0 ); 271 groupLayout->addWidget( mUseWholeBook, 0, 0 );
267 272
268 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup ); 273 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup );
269 QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" 274 Q3WhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n"
270 "This option is disabled if no contacts are selected." ) ); 275 "This option is disabled if no contacts are selected." ) );
271 groupLayout->addWidget( mUseSelection, 1, 0 ); 276 groupLayout->addWidget( mUseSelection, 1, 0 );
272 277
273 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup ); 278 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup );
274 QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" 279 Q3WhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n"
275 "This option is disabled if you haven't defined any filters" ) ); 280 "This option is disabled if you haven't defined any filters" ) );
276 groupLayout->addWidget( mUseFilters, 2, 0 ); 281 groupLayout->addWidget( mUseFilters, 2, 0 );
277 282
278 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup ); 283 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup );
279 QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" 284 Q3WhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n"
280 "This option is disabled if you have no categories." ) ); 285 "This option is disabled if you have no categories." ) );
281 groupLayout->addWidget( mUseCategories, 3, 0 ); 286 groupLayout->addWidget( mUseCategories, 3, 0 );
282 287
283 mFiltersCombo = new QComboBox( false, mButtonGroup ); 288 mFiltersCombo = new QComboBox( false, mButtonGroup );
284 mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); 289 mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
285 QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); 290 Q3WhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) );
286 groupLayout->addWidget( mFiltersCombo, 2, 1 ); 291 groupLayout->addWidget( mFiltersCombo, 2, 1 );
287 292
288 mCategoriesView = new QListView( mButtonGroup ); 293 mCategoriesView = new Q3ListView( mButtonGroup );
289 mCategoriesView->addColumn( "" ); 294 mCategoriesView->addColumn( "" );
290 mCategoriesView->header()->hide(); 295 mCategoriesView->header()->hide();
291 QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); 296 Q3WhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) );
292 groupLayout->addWidget( mCategoriesView, 3, 1 ); 297 groupLayout->addWidget( mCategoriesView, 3, 1 );
293 mCategoriesView->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); 298 mCategoriesView->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
294 //if (QApplication::desktop()->height() == 480 ) 299 //if (QApplication::desktop()->height() == 480 )
295 // mCategoriesView->setMaximumHeight( 240 ); 300 // mCategoriesView->setMaximumHeight( 240 );
296 topLayout->addWidget( mButtonGroup ); 301 topLayout->addWidget( mButtonGroup );
297 302
298 QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); 303 Q3ButtonGroup *sortingGroup = new Q3ButtonGroup( i18n( "Sorting" ), page );
299 sortingGroup->setColumnLayout( 0, Qt::Vertical ); 304 sortingGroup->setColumnLayout( 0, Qt::Vertical );
300 QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2, 305 Q3GridLayout *sortLayout = new Q3GridLayout( sortingGroup->layout(), 2, 2,
301 KDialog::spacingHint() ); 306 KDialog::spacingHint() );
302 sortLayout->setAlignment( Qt::AlignTop ); 307 sortLayout->setAlignment( Qt::AlignTop );
303 308
304 label = new QLabel( i18n( "Criterion:" ), sortingGroup ); 309 label = new QLabel( i18n( "Criterion:" ), sortingGroup );
305 sortLayout->addWidget( label, 0, 0 ); 310 sortLayout->addWidget( label, 0, 0 );
306 311
307#ifndef KAB_EMBEDDED 312#ifndef KAB_EMBEDDED
308 mFieldCombo = new KComboBox( false, sortingGroup ); 313 mFieldCombo = new KComboBox( false, sortingGroup );
309#else //KAB_EMBEDDED 314#else //KAB_EMBEDDED
310 //US Combobox is not editable anyway 315 //US Combobox is not editable anyway
311 mFieldCombo = new KComboBox( sortingGroup ); 316 mFieldCombo = new KComboBox( sortingGroup );
312#endif //KAB_EMBEDDED 317#endif //KAB_EMBEDDED
@@ -326,17 +331,15 @@ void XXPortSelectDialog::initGUI()
326 topLayout->addWidget( sortingGroup ); 331 topLayout->addWidget( sortingGroup );
327 332
328 if ( !mUseSorting ) 333 if ( !mUseSorting )
329 sortingGroup->hide(); 334 sortingGroup->hide();
330 if (QApplication::desktop()->width() <= 640 ) { 335 if (QApplication::desktop()->width() <= 640 ) {
331 showMaximized(); 336 showMaximized();
332#ifndef DESKTOP_VERSION 337#ifndef DESKTOP_VERSION
333 hideButtons(); 338 hideButtons();
334#endif 339#endif
335 } 340 }
336} 341}
337 342
338#ifndef KAB_EMBEDDED 343#ifndef KAB_EMBEDDED_
339#include "xxportselectdialog.moc" 344#include "moc_xxportselectdialog.cpp"
340#endif //KAB_EMBEDDED 345#endif //KAB_EMBEDDED
341
342
diff --git a/kaddressbook/xxportselectdialog.h b/kaddressbook/xxportselectdialog.h
index 28b1fef..208f4f9 100644
--- a/kaddressbook/xxportselectdialog.h
+++ b/kaddressbook/xxportselectdialog.h
@@ -21,63 +21,63 @@
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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#ifndef XXPORTSELECTDIALOG_H 24#ifndef XXPORTSELECTDIALOG_H
25#define XXPORTSELECTDIALOG_H 25#define XXPORTSELECTDIALOG_H
26 26
27#include <kabc/addresseelist.h> 27#include <kabc/addresseelist.h>
28#include <kabc/field.h> 28#include <kabc/field.h>
29#include <kdialogbase.h> 29#include <kdialogbase.h>
30 30
31#include "filter.h" 31#include "filter.h"
32 32
33class QButtonGroup; 33class Q3ButtonGroup;
34class QComboBox; 34class QComboBox;
35class QListView; 35class Q3ListView;
36class QListViewItem; 36class Q3ListViewItem;
37class QRadioButton; 37class QRadioButton;
38 38
39class KABCore; 39class KABCore;
40class KComboBox; 40class KComboBox;
41 41
42class XXPortSelectDialog : public KDialogBase 42class XXPortSelectDialog : public KDialogBase
43{ 43{
44 Q_OBJECT 44 Q_OBJECT
45 45
46 public: 46 public:
47 XXPortSelectDialog( KABCore *core, bool sort, QWidget* parent, 47 XXPortSelectDialog( KABCore *core, bool sort, QWidget* parent,
48 const char* name = 0 ); 48 const char* name = 0 );
49 49
50 KABC::AddresseeList contacts(); 50 KABC::AddresseeList contacts();
51 void tagSelected(); 51 void tagSelected();
52 QStringList uids(); 52 QStringList uids();
53 53
54 private slots: 54 private slots:
55 void filterChanged( int ); 55 void filterChanged( int );
56 void categoryClicked( QListViewItem * i ); 56 void categoryClicked( Q3ListViewItem * i );
57 57
58 protected slots: 58 protected slots:
59 void slotHelp(); 59 void slotHelp();
60 60
61 private: 61 private:
62 void initGUI(); 62 void initGUI();
63 QStringList categories() const; 63 QStringList categories() const;
64 64
65 QButtonGroup* mButtonGroup; 65 Q3ButtonGroup* mButtonGroup;
66 QRadioButton* mUseCategories; 66 QRadioButton* mUseCategories;
67 QRadioButton* mUseFilters; 67 QRadioButton* mUseFilters;
68 QRadioButton* mUseWholeBook; 68 QRadioButton* mUseWholeBook;
69 QRadioButton* mUseSelection; 69 QRadioButton* mUseSelection;
70 QComboBox* mFiltersCombo; 70 QComboBox* mFiltersCombo;
71 QListView* mCategoriesView; 71 Q3ListView* mCategoriesView;
72 72
73 KComboBox *mFieldCombo; 73 KComboBox *mFieldCombo;
74 KComboBox *mSortTypeCombo; 74 KComboBox *mSortTypeCombo;
75 75
76 KABCore *mCore; 76 KABCore *mCore;
77 KABC::AddresseeList mAddresseeList; 77 KABC::AddresseeList mAddresseeList;
78 Filter::List mFilters; 78 Filter::List mFilters;
79 KABC::Field::List mFields; 79 KABC::Field::List mFields;
80 bool mUseSorting; 80 bool mUseSorting;
81}; 81};
82 82
83#endif 83#endif
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp
index 18ce9da..467fef7 100644
--- a/kalarmd/alarmdialog.cpp
+++ b/kalarmd/alarmdialog.cpp
@@ -14,134 +14,138 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24// $Id$ 24// $Id$
25 25
26#include <qhbox.h> 26#include <q3hbox.h>
27#include <qvbox.h> 27#include <q3vbox.h>
28#include <qapp.h> 28#include <qapplication.h>
29#include <QDesktopWidget>
29#include <qlabel.h> 30#include <qlabel.h>
30#include <qlayout.h> 31#include <qlayout.h>
31#include <qfile.h> 32#include <qfile.h>
32#include <qtimer.h> 33#include <qtimer.h>
33#include <qsound.h> 34#include <qsound.h>
34#include <qpushbutton.h> 35#include <qpushbutton.h>
35#include <qregexp.h> 36#include <qregexp.h>
36#ifndef DESKTOP_VERSION 37#ifndef DESKTOP_VERSION
37#define protected public 38#define protected public
38#include <qspinbox.h> 39#include <qspinbox.h>
39#undef protected 40#undef protected
40#else 41#else
41#include <qspinbox.h> 42#include <qspinbox.h>
43//Added by qt3to4:
44#include <Q3HBoxLayout>
45#include <Q3VBoxLayout>
42#endif 46#endif
43#include <stdlib.h> 47#include <stdlib.h>
44#ifndef _WIN32_ 48#ifndef _WIN32_
45#include <unistd.h> 49#include <unistd.h>
46#include <sys/ioctl.h> 50#include <sys/ioctl.h>
47#endif 51#endif
48#include <stdio.h> 52#include <stdio.h>
49#include <fcntl.h> 53#include <fcntl.h>
50 54
51#ifndef DESKTOP_VERSION 55#ifndef DESKTOP_VERSION
52#include <qtopia/alarmserver.h> 56#include <qtopia/alarmserver.h>
53#include <qpe/resource.h> 57#include <qpe/resource.h>
54#include <qtopia/sound.h> 58#include <qtopia/sound.h>
55 59
56#endif 60#endif
57 61
58#include "alarmdialog.h" 62#include "alarmdialog.h"
59 63
60 64
61AlarmDialog::AlarmDialog(QWidget *parent,const char *name) 65AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
62 : QDialog (parent, name ,false, Qt::WStyle_StaysOnTop ) 66 : QDialog (parent, name ,false, Qt::WStyle_StaysOnTop )
63{ 67{
64 setCaption( "KO/Pi Alarm!" ); 68 setCaption( "KO/Pi Alarm!" );
65 QVBoxLayout* layout = new QVBoxLayout( this); 69 Q3VBoxLayout* layout = new Q3VBoxLayout( this);
66 QLabel* l = new QLabel("The following event triggered alarm:",this); 70 QLabel* l = new QLabel("The following event triggered alarm:",this);
67 layout->addWidget ( l ); 71 layout->addWidget ( l );
68 l->setAlignment( AlignCenter); 72 l->setAlignment( Qt::AlignCenter);
69 mMessage = new QLabel ( " ", this ); 73 mMessage = new QLabel ( " ", this );
70 int fs = 18; 74 int fs = 18;
71 int fs2 = 12; 75 int fs2 = 12;
72 int baseSize = 6; 76 int baseSize = 6;
73 if ( QApplication::desktop()->width() < 480 ) { 77 if ( QApplication::desktop()->width() < 480 ) {
74 fs2 = 10; 78 fs2 = 10;
75 fs = 12; 79 fs = 12;
76 baseSize = 4; 80 baseSize = 4;
77 } 81 }
78 layout->setSpacing( 3 ); 82 layout->setSpacing( 3 );
79 layout->setMargin( 3 ); 83 layout->setMargin( 3 );
80 QFont fo = QApplication::font(); 84 QFont fo = QApplication::font();
81 fo.setBold( true ); 85 fo.setBold( true );
82 fo.setPointSize( fs2 ); 86 fo.setPointSize( fs2 );
83 l->setFont( fo ); 87 l->setFont( fo );
84 fo.setPointSize( fs ); 88 fo.setPointSize( fs );
85 mMessage->setFont(fo ); 89 mMessage->setFont(fo );
86 mMessage->setAlignment( AlignCenter); 90 mMessage->setAlignment( Qt::AlignCenter);
87 layout->addWidget ( mMessage ); 91 layout->addWidget ( mMessage );
88 mMissedAlarms= new QLabel ( "(No missed Alarms)", this ); 92 mMissedAlarms= new QLabel ( "(No missed Alarms)", this );
89 mMissedAlarms->setAlignment( AlignCenter); 93 mMissedAlarms->setAlignment( Qt::AlignCenter);
90 94
91 playSoundTimer = new QTimer( this ); 95 playSoundTimer = new QTimer( this );
92 connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); 96 connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) );
93 97
94 playSoundTimer->stop(); 98 playSoundTimer->stop();
95 99
96 layout->addWidget ( mMissedAlarms ); 100 layout->addWidget ( mMissedAlarms );
97 mMissedAlarmsCombo = new QComboBox ( this ); 101 mMissedAlarmsCombo = new QComboBox ( this );
98 layout->addWidget ( mMissedAlarmsCombo ); 102 layout->addWidget ( mMissedAlarmsCombo );
99 103
100 QLabel* labb = new QLabel("Suspend\nduration\n(minutes):",this); 104 QLabel* labb = new QLabel("Suspend\nduration\n(minutes):",this);
101#ifdef DESKTOP_VERSION 105#ifdef DESKTOP_VERSION
102 fo = font(); 106 fo = font();
103 fo.setPointSize( 12 ); 107 fo.setPointSize( 12 );
104 labb->setFont ( fo ); 108 labb->setFont ( fo );
105#endif 109#endif
106 labb->setAlignment(AlignCenter); 110 labb->setAlignment(Qt::AlignCenter);
107 //layout->addWidget ( labb ); 111 //layout->addWidget ( labb );
108 fo = font(); 112 fo = font();
109 int pointSize = 36; 113 int pointSize = 36;
110 if ( QApplication::desktop()->width() <= 320 ) 114 if ( QApplication::desktop()->width() <= 320 )
111 pointSize = 18; 115 pointSize = 18;
112 fo.setPointSize( pointSize ); 116 fo.setPointSize( pointSize );
113 mSuspendSpin = new QSpinBox(1,1440,1,this); 117 mSuspendSpin = new QSpinBox(1,1440,1,this);
114 mSuspendSpin->setFont( fo ); 118 mSuspendSpin->setFont( fo );
115 mSuspendSpin->setValue(7); // default suspend duration 119 mSuspendSpin->setValue(7); // default suspend duration
116 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); 120 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
117 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); 121 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
118 122
119#if QT_VERSION < 0x030000 123#if QT_VERSION < 0x030000
120 mSuspendSpin->upButton ()->setFixedSize( QSize( 8*baseSize, 5*baseSize )); 124 mSuspendSpin->upButton ()->setFixedSize( QSize( 8*baseSize, 5*baseSize ));
121 mSuspendSpin->downButton ()->setFixedSize( QSize( 8*baseSize, 5*baseSize )); 125 mSuspendSpin->downButton ()->setFixedSize( QSize( 8*baseSize, 5*baseSize ));
122#endif 126#endif
123 mSuspendSpin->setFixedSize( 18*baseSize, 10*baseSize+2 ); 127 mSuspendSpin->setFixedSize( 18*baseSize, 10*baseSize+2 );
124 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); 128 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
125 QHBoxLayout* layoutSpin = new QHBoxLayout( layout ); 129 Q3HBoxLayout* layoutSpin = new Q3HBoxLayout( layout );
126 layoutSpin->addStretch (); 130 layoutSpin->addStretch ();
127 layoutSpin->addWidget ( labb ); 131 layoutSpin->addWidget ( labb );
128 layoutSpin->addWidget ( mSuspendSpin ); 132 layoutSpin->addWidget ( mSuspendSpin );
129 layoutSpin->addStretch (); 133 layoutSpin->addStretch ();
130 134
131 QVBox * bbox = new QVBox ( this ); 135 Q3VBox * bbox = new Q3VBox ( this );
132 layout->addWidget ( bbox ); 136 layout->addWidget ( bbox );
133 bbox->layout()->setSpacing( 2 ); 137 bbox->layout()->setSpacing( 2 );
134 labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox); 138 labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox);
135 labb->setAlignment(AlignCenter); 139 labb->setAlignment(Qt::AlignCenter);
136 mSuspendButton = new QPushButton( "Suspend", bbox); 140 mSuspendButton = new QPushButton( "Suspend", bbox);
137 QPushButton* silen = new QPushButton( " Stop sound ", bbox); 141 QPushButton* silen = new QPushButton( " Stop sound ", bbox);
138 okbut = new QPushButton( "Ok", bbox); 142 okbut = new QPushButton( "Ok", bbox);
139 mSuspendButton->setFont( fo ); 143 mSuspendButton->setFont( fo );
140 silen->setFont( fo ); 144 silen->setFont( fo );
141 okbut->setFont( fo ); 145 okbut->setFont( fo );
142 okbut->setDefault( true ); 146 okbut->setDefault( true );
143 connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) ); 147 connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) );
144 connect (mSuspendButton, SIGNAL( clicked() ), this, SLOT (slotSuspend() ) ); 148 connect (mSuspendButton, SIGNAL( clicked() ), this, SLOT (slotSuspend() ) );
145 connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) ); 149 connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) );
146 connect (mSuspendSpin , SIGNAL( valueChanged ( int ) ), this, SLOT ( spinBoxChanged( int ) ) ); 150 connect (mSuspendSpin , SIGNAL( valueChanged ( int ) ), this, SLOT ( spinBoxChanged( int ) ) );
147#ifndef _WIN32_ 151#ifndef _WIN32_
diff --git a/kalarmd/alarmdialog.h b/kalarmd/alarmdialog.h
index 52e681a..c3e0966 100644
--- a/kalarmd/alarmdialog.h
+++ b/kalarmd/alarmdialog.h
@@ -21,24 +21,26 @@
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef ALARMDIALOG_H 23#ifndef ALARMDIALOG_H
24#define ALARMDIALOG_H 24#define ALARMDIALOG_H
25 25
26 26
27 27
28#include <qdialog.h> 28#include <qdialog.h>
29#include <qdatetime.h> 29#include <qdatetime.h>
30#include <qstring.h> 30#include <qstring.h>
31#include <qcombobox.h> 31#include <qcombobox.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33//Added by qt3to4:
34#include <QLabel>
33 35
34#include "sharp_char.h" 36#include "sharp_char.h"
35 37
36 38
37class QSpinBox; 39class QSpinBox;
38class QLabel; 40class QLabel;
39class QString; 41class QString;
40 42
41class AlarmDialog : public QDialog { 43class AlarmDialog : public QDialog {
42 Q_OBJECT 44 Q_OBJECT
43 public: 45 public:
44 AlarmDialog( QWidget *parent = 0, const char *name = 0 ); 46 AlarmDialog( QWidget *parent = 0, const char *name = 0 );
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index 15eff28..74a53cb 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -43,72 +43,72 @@
43#include <qtopia/qcopenvelope_qws.h> 43#include <qtopia/qcopenvelope_qws.h>
44#include <qtopia/alarmserver.h> 44#include <qtopia/alarmserver.h>
45 45
46#include <stdlib.h> 46#include <stdlib.h>
47#include <stdio.h> 47#include <stdio.h>
48#include <unistd.h> 48#include <unistd.h>
49 49
50 50
51SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) 51SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
52 : QLabel( parent ) 52 : QLabel( parent )
53{ 53{
54 mAlarmDialog = new AlarmDialog( 0 ); 54 mAlarmDialog = new AlarmDialog( 0 );
55 mPopUp = new QPopupMenu( this ); 55 mPopUp = new Q3PopupMenu( this );
56 mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); 56 mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) );
57 mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); 57 mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) );
58 mPopUp->insertSeparator(); 58 mPopUp->insertSeparator();
59 mPopUp->insertItem( "Todo List", this, SLOT ( showTodo() ) ); 59 mPopUp->insertItem( "Todo List", this, SLOT ( showTodo() ) );
60 mPopUp->insertSeparator(); 60 mPopUp->insertSeparator();
61 mPopUp->insertItem( "Addresses", this, SLOT ( showAdd() ) ); 61 mPopUp->insertItem( "Addresses", this, SLOT ( showAdd() ) );
62 mPopUp->insertSeparator(); 62 mPopUp->insertSeparator();
63 mPopUp->insertItem( "Edit Journal", this, SLOT ( writeJournal() ) ); 63 mPopUp->insertItem( "Edit Journal", this, SLOT ( writeJournal() ) );
64 mPopUp->insertItem( "New Event", this, SLOT ( newEvent() ) ); 64 mPopUp->insertItem( "New Event", this, SLOT ( newEvent() ) );
65 mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) ); 65 mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) );
66 mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) ); 66 mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) );
67 mPopUp->insertSeparator(); 67 mPopUp->insertSeparator();
68 mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) ); 68 mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) );
69 mTimerPopUp = new QPopupMenu( this ); 69 mTimerPopUp = new Q3PopupMenu( this );
70 70
71 mBeepPopUp = new QPopupMenu( this ); 71 mBeepPopUp = new Q3PopupMenu( this );
72 mSoundPopUp = new QPopupMenu( this ); 72 mSoundPopUp = new Q3PopupMenu( this );
73 mPausePopUp = new QPopupMenu( this ); 73 mPausePopUp = new Q3PopupMenu( this );
74 mFontsizePopup = new QPopupMenu( this ); 74 mFontsizePopup = new Q3PopupMenu( this );
75 mFontsizePopup->insertItem( "10", 10 ); 75 mFontsizePopup->insertItem( "10", 10 );
76 mFontsizePopup->insertItem( "12", 12 ); 76 mFontsizePopup->insertItem( "12", 12 );
77 mFontsizePopup->insertItem( "14", 14 ); 77 mFontsizePopup->insertItem( "14", 14 );
78 mFontsizePopup->insertItem( "16", 16 ); 78 mFontsizePopup->insertItem( "16", 16 );
79 mFontsizePopup->insertItem( "18", 18 ); 79 mFontsizePopup->insertItem( "18", 18 );
80 mFontsizePopup->insertItem( "20", 20 ); 80 mFontsizePopup->insertItem( "20", 20 );
81 mFontsizePopup->insertItem( "22", 22 ); 81 mFontsizePopup->insertItem( "22", 22 );
82 mFontsizePopup->insertItem( "24", 24 ); 82 mFontsizePopup->insertItem( "24", 24 );
83 mFontsizePopup->insertItem( "26", 26 ); 83 mFontsizePopup->insertItem( "26", 26 );
84 mFontsizePopup->insertItem( "28", 28 ); 84 mFontsizePopup->insertItem( "28", 28 );
85 mFontsizePopup->insertItem( "30", 30 ); 85 mFontsizePopup->insertItem( "30", 30 );
86 mFontsizePopup->insertItem( "32", 32 ); 86 mFontsizePopup->insertItem( "32", 32 );
87 mFontsizePopup->insertItem( "36", 36 ); 87 mFontsizePopup->insertItem( "36", 36 );
88 QPopupMenu* savePopUp = new QPopupMenu( this ); 88 QPopupMenu* savePopUp = new Q3PopupMenu( this );
89 savePopUp->insertItem( "Save", 0 ); 89 savePopUp->insertItem( "Save", 0 );
90 savePopUp->insertItem( "Load", 1 ); 90 savePopUp->insertItem( "Load", 1 );
91 mSoundPopUp->insertItem( "Buzzer", 0 ); 91 mSoundPopUp->insertItem( "Buzzer", 0 );
92 mSoundPopUp->insertItem( "Wav file", 1 ); 92 mSoundPopUp->insertItem( "Wav file", 1 );
93 mPausePopUp->insertItem( " 1 sec", 1 ); 93 mPausePopUp->insertItem( " 1 sec", 1 );
94 mPausePopUp->insertItem( " 2 sec", 2 ); 94 mPausePopUp->insertItem( " 2 sec", 2 );
95 mPausePopUp->insertItem( " 3 sec", 3 ); 95 mPausePopUp->insertItem( " 3 sec", 3 );
96 mPausePopUp->insertItem( " 5 sec", 5 ); 96 mPausePopUp->insertItem( " 5 sec", 5 );
97 mPausePopUp->insertItem( "10 sec", 10 ); 97 mPausePopUp->insertItem( "10 sec", 10 );
98 mPausePopUp->insertItem( "15 sec", 15 ); 98 mPausePopUp->insertItem( "15 sec", 15 );
99 mPausePopUp->insertItem( "30 sec", 30 ); 99 mPausePopUp->insertItem( "30 sec", 30 );
100 mPausePopUp->insertItem( " 1 min", 60 ); 100 mPausePopUp->insertItem( " 1 min", 60 );
101 mPausePopUp->insertItem( " 5 min", 300 ); 101 mPausePopUp->insertItem( " 5 min", 300 );
102 mSuspendPopUp = new QPopupMenu( this ); 102 mSuspendPopUp = new Q3PopupMenu( this );
103 mSuspendPopUp->insertItem( "Off", 0 ); 103 mSuspendPopUp->insertItem( "Off", 0 );
104 mSuspendPopUp->insertItem( " 1x", 1 ); 104 mSuspendPopUp->insertItem( " 1x", 1 );
105 mSuspendPopUp->insertItem( " 2x", 2 ); 105 mSuspendPopUp->insertItem( " 2x", 2 );
106 mSuspendPopUp->insertItem( " 3x", 3 ); 106 mSuspendPopUp->insertItem( " 3x", 3 );
107 mSuspendPopUp->insertItem( " 5x", 5 ); 107 mSuspendPopUp->insertItem( " 5x", 5 );
108 mSuspendPopUp->insertItem( "10x", 10 ); 108 mSuspendPopUp->insertItem( "10x", 10 );
109 mSuspendPopUp->insertItem( "20x", 20 ); 109 mSuspendPopUp->insertItem( "20x", 20 );
110 mSuspendPopUp->insertItem( "30x", 30 ); 110 mSuspendPopUp->insertItem( "30x", 30 );
111 mBeepPopUp->insertItem( "Config",savePopUp ); 111 mBeepPopUp->insertItem( "Config",savePopUp );
112 mBeepPopUp->insertItem( "Replay",mSoundPopUp ); 112 mBeepPopUp->insertItem( "Replay",mSoundPopUp );
113 mBeepPopUp->insertItem( "Font Size",mFontsizePopup ); 113 mBeepPopUp->insertItem( "Font Size",mFontsizePopup );
114 mBeepPopUp->insertItem( "Auto suspend",mSuspendPopUp ); 114 mBeepPopUp->insertItem( "Auto suspend",mSuspendPopUp );
diff --git a/kalarmd/simplealarmdaemonimpl.h b/kalarmd/simplealarmdaemonimpl.h
index 06ef91b..ac65797 100644
--- a/kalarmd/simplealarmdaemonimpl.h
+++ b/kalarmd/simplealarmdaemonimpl.h
@@ -21,25 +21,24 @@
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef SIMPLEALARMDAEMONIMPL_H 23#ifndef SIMPLEALARMDAEMONIMPL_H
24#define SIMPLEALARMDAEMONIMPL_H 24#define SIMPLEALARMDAEMONIMPL_H
25 25
26//#include "simplealarmdaemon.h" 26//#include "simplealarmdaemon.h"
27#include <qdatetime.h> 27#include <qdatetime.h>
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qtimer.h> 29#include <qtimer.h>
30 30
31class QLabel; 31class QLabel;
32class QTimer; 32class QTimer;
33class QPopupMenu;
34class AlarmDialog; 33class AlarmDialog;
35class SimpleAlarmDaemonImpl : public QLabel 34class SimpleAlarmDaemonImpl : public QLabel
36{ 35{
37 Q_OBJECT 36 Q_OBJECT
38 public: 37 public:
39 SimpleAlarmDaemonImpl( QWidget *parent = 0 ); 38 SimpleAlarmDaemonImpl( QWidget *parent = 0 );
40 39
41 ~SimpleAlarmDaemonImpl(); 40 ~SimpleAlarmDaemonImpl();
42 41
43 protected slots: 42 protected slots:
44 void recieve( const QCString& msg, const QByteArray& data ); 43 void recieve( const QCString& msg, const QByteArray& data );
45 void newTodo(); 44 void newTodo();
@@ -67,25 +66,25 @@ class SimpleAlarmDaemonImpl : public QLabel
67 protected: 66 protected:
68 void mousePressEvent( QMouseEvent * ); 67 void mousePressEvent( QMouseEvent * );
69 68
70 private: 69 private:
71 AlarmDialog *mAlarmDialog; 70 AlarmDialog *mAlarmDialog;
72 QLabel * mTimerStartLabel; 71 QLabel * mTimerStartLabel;
73 int mPlayBeeps; 72 int mPlayBeeps;
74 int mPausePlay; 73 int mPausePlay;
75 int mSuspend; 74 int mSuspend;
76 QString mAlarmMessage; 75 QString mAlarmMessage;
77 int mTimerTime; 76 int mTimerTime;
78 int getFileNameLen( QString ); 77 int getFileNameLen( QString );
79 QPopupMenu* mPopUp, *mBeepPopUp, *mTimerPopUp, *mSoundPopUp,*mPausePopUp,*mSuspendPopUp, *mFontsizePopup; 78 Q3PopupMenu* mPopUp, *mBeepPopUp, *mTimerPopUp, *mSoundPopUp,*mPausePopUp,*mSuspendPopUp, *mFontsizePopup;
80 QDateTime mRunningTimer; 79 QDateTime mRunningTimer;
81 void fillTimerPopUp(); 80 void fillTimerPopUp();
82 QString timerMesssage; 81 QString timerMesssage;
83 QString mCustomText; 82 QString mCustomText;
84 QString mRunningTimerText; 83 QString mRunningTimerText;
85 int mCustomMinutes; 84 int mCustomMinutes;
86 int mTimerPopupConf; 85 int mTimerPopupConf;
87 int mPopupFontSize; 86 int mPopupFontSize;
88 bool wavAlarm; 87 bool wavAlarm;
89}; 88};
90class KODateLabel : public QLabel 89class KODateLabel : public QLabel
91{ 90{
diff --git a/kdepim-desktop.pro b/kdepim-desktop.pro
index 4a5ceef..05d8357 100644
--- a/kdepim-desktop.pro
+++ b/kdepim-desktop.pro
@@ -10,16 +10,18 @@ SUBDIRS += libical libkcal kabc libkdepim microkde korganizer kaddressbook
10unix:{ 10unix:{
11SUBDIRS += gammu/emb/common gammu/emb/gammu 11SUBDIRS += gammu/emb/common gammu/emb/gammu
12} 12}
13!staticlib: { 13!staticlib: {
14SUBDIRS += kabc/plugins/file kabc/plugins/dir kabc/plugins/qtopia 14SUBDIRS += kabc/plugins/file kabc/plugins/dir kabc/plugins/qtopia
15win32:{ 15win32:{
16#SUBDIRS += kabc/plugins/olaccess 16#SUBDIRS += kabc/plugins/olaccess
17 17
18} 18}
19} 19}
20unix:{ 20unix:{
21!staticlib: { 21!staticlib: {
22SUBDIRS += libetpan kmicromail/libmailwrapper kmicromail pwmanager/libcrypt/cipher pwmanager/libcrypt/error pwmanager/libcrypt/mpi pwmanager/libcrypt/zlib pwmanager/pwmanager 22SUBDIRS += libetpan
23# kmicromail/libmailwrapper kmicromail
24SUBDIRS += pwmanager/libcrypt/cipher pwmanager/libcrypt/error pwmanager/libcrypt/mpi pwmanager/libcrypt/zlib pwmanager/pwmanager
23} 25}
24} 26}
25 27
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp
index 985a762..9b1ea2f 100644
--- a/kmicromail/accountitem.cpp
+++ b/kmicromail/accountitem.cpp
@@ -3,26 +3,28 @@
3#include "accountview.h" 3#include "accountview.h"
4#include "newmaildir.h" 4#include "newmaildir.h"
5#include "nntpgroupsdlg.h" 5#include "nntpgroupsdlg.h"
6#include "defines.h" 6#include "defines.h"
7 7
8#include <libmailwrapper/mailtypes.h> 8#include <libmailwrapper/mailtypes.h>
9#include <libmailwrapper/abstractmail.h> 9#include <libmailwrapper/abstractmail.h>
10#include <libmailwrapper/mailwrapper.h> 10#include <libmailwrapper/mailwrapper.h>
11/* OPIE */ 11/* OPIE */
12//#include <qpe/qpeapplication.h> 12//#include <qpe/qpeapplication.h>
13 13
14/* QT */ 14/* QT */
15#include <qpopupmenu.h> 15#include <q3popupmenu.h>
16#include <qmessagebox.h> 16#include <qmessagebox.h>
17//Added by qt3to4:
18#include <Q3ValueList>
17#include <kiconloader.h> 19#include <kiconloader.h>
18#include <klocale.h> 20#include <klocale.h>
19 21
20#define GET_NEW_MAILS 101 22#define GET_NEW_MAILS 101
21 23
22using namespace Opie::Core; 24using namespace Opie::Core;
23#define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} 25#define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );}
24/** 26/**
25 * POP3 Account stuff 27 * POP3 Account stuff
26 */ 28 */
27POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent ) 29POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent )
28 : AccountViewItem( parent ) 30 : AccountViewItem( parent )
@@ -45,82 +47,82 @@ POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent )
45} 47}
46 48
47POP3viewItem::~POP3viewItem() 49POP3viewItem::~POP3viewItem()
48{ 50{
49 delete wrapper; 51 delete wrapper;
50} 52}
51 53
52AbstractMail *POP3viewItem::getWrapper() 54AbstractMail *POP3viewItem::getWrapper()
53{ 55{
54 return wrapper; 56 return wrapper;
55} 57}
56 58
57void POP3viewItem::refresh(QValueList<Opie::Core::OSmartPointer<RecMail> > & ) 59void POP3viewItem::refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > & )
58{ 60{
59 refresh(); 61 refresh();
60} 62}
61 63
62void POP3viewItem::refresh() 64void POP3viewItem::refresh()
63{ 65{
64 if (account->getOffline()) return; 66 if (account->getOffline()) return;
65 QValueList<FolderP> *folders = wrapper->listFolders(); 67 Q3ValueList<FolderP> *folders = wrapper->listFolders();
66 QListViewItem *child = firstChild(); 68 Q3ListViewItem *child = firstChild();
67 while ( child ) 69 while ( child )
68 { 70 {
69 QListViewItem *tmp = child; 71 Q3ListViewItem *tmp = child;
70 child = child->nextSibling(); 72 child = child->nextSibling();
71 delete tmp; 73 delete tmp;
72 } 74 }
73 QValueList<FolderP>::ConstIterator it; 75 Q3ValueList<FolderP>::ConstIterator it;
74 QListViewItem*item = 0; 76 Q3ListViewItem*item = 0;
75 for ( it = folders->begin(); it!=folders->end(); ++it) 77 for ( it = folders->begin(); it!=folders->end(); ++it)
76 { 78 {
77 item = new POP3folderItem( (*it), this , item ); 79 item = new POP3folderItem( (*it), this , item );
78 item->setSelectable( (*it)->may_select()); 80 item->setSelectable( (*it)->may_select());
79 } 81 }
80 delete folders; 82 delete folders;
81} 83}
82 84
83RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) 85RECBODYP POP3viewItem::fetchBody( const RecMailP &mail )
84{ 86{
85 87
86 return wrapper->fetchBody( mail ); 88 return wrapper->fetchBody( mail );
87} 89}
88 90
89QPopupMenu * POP3viewItem::getContextMenu() 91Q3PopupMenu * POP3viewItem::getContextMenu()
90{ 92{
91 QPopupMenu *m = new QPopupMenu(0); 93 Q3PopupMenu *m = new Q3PopupMenu(0);
92 if (m) 94 if (m)
93 { 95 {
94 if (!account->getOffline()) 96 if (!account->getOffline())
95 { 97 {
96 m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); 98 m->insertItem(i18n("Get new messages"),GET_NEW_MAILS);
97 m->insertItem(i18n("Disconnect"),0); 99 m->insertItem(i18n("Disconnect"),0);
98 m->insertItem(i18n("Set offline"),1); 100 m->insertItem(i18n("Set offline"),1);
99 } 101 }
100 else 102 else
101 { 103 {
102 m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); 104 m->insertItem(i18n("Get new messages"),GET_NEW_MAILS);
103 m->insertItem(i18n("Set online"),1); 105 m->insertItem(i18n("Set online"),1);
104 } 106 }
105 } 107 }
106 return m; 108 return m;
107} 109}
108 110
109void POP3viewItem::disconnect() 111void POP3viewItem::disconnect()
110{ 112{
111 QListViewItem *child = firstChild(); 113 Q3ListViewItem *child = firstChild();
112 while ( child ) 114 while ( child )
113 { 115 {
114 QListViewItem *tmp = child; 116 Q3ListViewItem *tmp = child;
115 child = child->nextSibling(); 117 child = child->nextSibling();
116 delete tmp; 118 delete tmp;
117 } 119 }
118 wrapper->logout(); 120 wrapper->logout();
119} 121}
120 122
121void POP3viewItem::setOnOffline() 123void POP3viewItem::setOnOffline()
122{ 124{
123 if (!account->getOffline()) 125 if (!account->getOffline())
124 { 126 {
125 disconnect(); 127 disconnect();
126 } 128 }
@@ -148,53 +150,53 @@ void POP3viewItem::contextMenuSelected(int which)
148 AccountViewItem* in = findSubItem( "inbox" , 0); 150 AccountViewItem* in = findSubItem( "inbox" , 0);
149 if ( ! in ) 151 if ( ! in )
150 return; 152 return;
151 bl->downloadMailsInbox(in->getFolder() ,getWrapper()); 153 bl->downloadMailsInbox(in->getFolder() ,getWrapper());
152 setOnOffline(); 154 setOnOffline();
153 break; 155 break;
154 } 156 }
155} 157}
156 158
157POP3folderItem::~POP3folderItem() 159POP3folderItem::~POP3folderItem()
158{} 160{}
159 161
160POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) 162POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , Q3ListViewItem*after )
161 : AccountViewItem(folderInit,parent,after ) 163 : AccountViewItem(folderInit,parent,after )
162{ 164{
163 pop3 = parent; 165 pop3 = parent;
164 if (folder->getDisplayName().lower()!="inbox") 166 if (folder->getDisplayName().lower()!="inbox")
165 { 167 {
166 setPixmap( 0, PIXMAP_POP3FOLDER ); 168 setPixmap( 0, PIXMAP_POP3FOLDER );
167 } 169 }
168 else 170 else
169 { 171 {
170 setPixmap( 0, PIXMAP_INBOXFOLDER); 172 setPixmap( 0, PIXMAP_INBOXFOLDER);
171 } 173 }
172 setText( 0, folder->getDisplayName() ); 174 setText( 0, folder->getDisplayName() );
173} 175}
174 176
175void POP3folderItem::refresh(QValueList<RecMailP>&target) 177void POP3folderItem::refresh(Q3ValueList<RecMailP>&target)
176{ 178{
177 if (folder->may_select()) 179 if (folder->may_select())
178 pop3->getWrapper()->listMessages( folder->getName(),target ); 180 pop3->getWrapper()->listMessages( folder->getName(),target );
179} 181}
180 182
181RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) 183RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail)
182{ 184{
183 return pop3->getWrapper()->fetchBody(aMail); 185 return pop3->getWrapper()->fetchBody(aMail);
184} 186}
185 187
186QPopupMenu * POP3folderItem::getContextMenu() 188Q3PopupMenu * POP3folderItem::getContextMenu()
187{ 189{
188 QPopupMenu *m = new QPopupMenu(0); 190 Q3PopupMenu *m = new Q3PopupMenu(0);
189 if (m) 191 if (m)
190 { 192 {
191 m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); 193 m->insertItem(i18n("Get new messages"),GET_NEW_MAILS);
192 m->insertItem(i18n("Refresh header list"),0); 194 m->insertItem(i18n("Refresh header list"),0);
193 m->insertItem(i18n("Delete all mails"),1); 195 m->insertItem(i18n("Delete all mails"),1);
194 m->insertItem(i18n("Move/Copie all mails"),2); 196 m->insertItem(i18n("Move/Copie all mails"),2);
195 } 197 }
196 return m; 198 return m;
197} 199}
198 200
199void POP3folderItem::downloadMails() 201void POP3folderItem::downloadMails()
200{ 202{
@@ -252,60 +254,60 @@ NNTPviewItem::NNTPviewItem( NNTPaccount *a, AccountView *parent )
252} 254}
253 255
254NNTPviewItem::~NNTPviewItem() 256NNTPviewItem::~NNTPviewItem()
255{ 257{
256 delete wrapper; 258 delete wrapper;
257} 259}
258 260
259AbstractMail *NNTPviewItem::getWrapper() 261AbstractMail *NNTPviewItem::getWrapper()
260{ 262{
261 return wrapper; 263 return wrapper;
262} 264}
263 265
264void NNTPviewItem::refresh( QValueList<RecMailP> & ) 266void NNTPviewItem::refresh( Q3ValueList<RecMailP> & )
265{ 267{
266 refresh(); 268 refresh();
267} 269}
268 270
269void NNTPviewItem::refresh() 271void NNTPviewItem::refresh()
270{ 272{
271 if (account->getOffline()) return; 273 if (account->getOffline()) return;
272 QValueList<FolderP> *folders = wrapper->listFolders(); 274 Q3ValueList<FolderP> *folders = wrapper->listFolders();
273 275
274 QListViewItem *child = firstChild(); 276 Q3ListViewItem *child = firstChild();
275 while ( child ) 277 while ( child )
276 { 278 {
277 QListViewItem *tmp = child; 279 Q3ListViewItem *tmp = child;
278 child = child->nextSibling(); 280 child = child->nextSibling();
279 delete tmp; 281 delete tmp;
280 } 282 }
281 QValueList<FolderP>::ConstIterator it; 283 Q3ValueList<FolderP>::ConstIterator it;
282 QListViewItem*item = 0; 284 Q3ListViewItem*item = 0;
283 for ( it = folders->begin(); it!=folders->end(); ++it) 285 for ( it = folders->begin(); it!=folders->end(); ++it)
284 { 286 {
285 item = new NNTPfolderItem( (*it), this , item ); 287 item = new NNTPfolderItem( (*it), this , item );
286 item->setSelectable( (*it)->may_select()); 288 item->setSelectable( (*it)->may_select());
287 } 289 }
288 delete folders; 290 delete folders;
289} 291}
290 292
291RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail ) 293RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail )
292{ 294{
293 295
294 return wrapper->fetchBody( mail ); 296 return wrapper->fetchBody( mail );
295} 297}
296 298
297QPopupMenu * NNTPviewItem::getContextMenu() 299Q3PopupMenu * NNTPviewItem::getContextMenu()
298{ 300{
299 QPopupMenu *m = new QPopupMenu(0); 301 Q3PopupMenu *m = new Q3PopupMenu(0);
300 if (m) 302 if (m)
301 { 303 {
302 if (!account->getOffline()) 304 if (!account->getOffline())
303 { 305 {
304 m->insertItem(i18n("Disconnect"),0); 306 m->insertItem(i18n("Disconnect"),0);
305 m->insertItem(i18n("Set offline"),1); 307 m->insertItem(i18n("Set offline"),1);
306 //m->insertItem(i18n("(Un-)Subscribe groups"),2); 308 //m->insertItem(i18n("(Un-)Subscribe groups"),2);
307 } 309 }
308 else 310 else
309 { 311 {
310 m->insertItem(i18n("Set online"),1); 312 m->insertItem(i18n("Set online"),1);
311 } 313 }
@@ -317,28 +319,28 @@ void NNTPviewItem::subscribeGroups()
317{ 319{
318 NNTPGroupsDlg dlg(account); 320 NNTPGroupsDlg dlg(account);
319#ifndef DESKTOP_VERSION 321#ifndef DESKTOP_VERSION
320 dlg.showMaximized(); 322 dlg.showMaximized();
321#endif 323#endif
322 if ( dlg.exec()== QDialog::Accepted ){ 324 if ( dlg.exec()== QDialog::Accepted ){
323 refresh(); 325 refresh();
324 } 326 }
325} 327}
326 328
327void NNTPviewItem::disconnect() 329void NNTPviewItem::disconnect()
328{ 330{
329 QListViewItem *child = firstChild(); 331 Q3ListViewItem *child = firstChild();
330 while ( child ) 332 while ( child )
331 { 333 {
332 QListViewItem *tmp = child; 334 Q3ListViewItem *tmp = child;
333 child = child->nextSibling(); 335 child = child->nextSibling();
334 delete tmp; 336 delete tmp;
335 } 337 }
336 wrapper->logout(); 338 wrapper->logout();
337} 339}
338 340
339void NNTPviewItem::setOnOffline() 341void NNTPviewItem::setOnOffline()
340{ 342{
341 if (!account->getOffline()) 343 if (!account->getOffline())
342 { 344 {
343 disconnect(); 345 disconnect();
344 } 346 }
@@ -359,53 +361,53 @@ void NNTPviewItem::contextMenuSelected(int which)
359 case 1: 361 case 1:
360 setOnOffline(); 362 setOnOffline();
361 break; 363 break;
362 case 2: 364 case 2:
363 subscribeGroups(); 365 subscribeGroups();
364 break; 366 break;
365 } 367 }
366} 368}
367 369
368NNTPfolderItem::~NNTPfolderItem() 370NNTPfolderItem::~NNTPfolderItem()
369{} 371{}
370 372
371NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent , QListViewItem*after ) 373NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent , Q3ListViewItem*after )
372 : AccountViewItem( folderInit, parent,after ) 374 : AccountViewItem( folderInit, parent,after )
373{ 375{
374 nntp = parent; 376 nntp = parent;
375 if (folder->getDisplayName().lower()!="inbox") 377 if (folder->getDisplayName().lower()!="inbox")
376 { 378 {
377 setPixmap( 0, PIXMAP_POP3FOLDER ); 379 setPixmap( 0, PIXMAP_POP3FOLDER );
378 } 380 }
379 else 381 else
380 { 382 {
381 setPixmap( 0, PIXMAP_INBOXFOLDER); 383 setPixmap( 0, PIXMAP_INBOXFOLDER);
382 } 384 }
383 setText( 0, folder->getDisplayName() ); 385 setText( 0, folder->getDisplayName() );
384} 386}
385 387
386void NNTPfolderItem::refresh(QValueList<RecMailP>&target) 388void NNTPfolderItem::refresh(Q3ValueList<RecMailP>&target)
387{ 389{
388 if (folder->may_select()) 390 if (folder->may_select())
389 nntp->getWrapper()->listMessages( folder->getName(),target ); 391 nntp->getWrapper()->listMessages( folder->getName(),target );
390} 392}
391 393
392RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail) 394RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail)
393{ 395{
394 return nntp->getWrapper()->fetchBody(aMail); 396 return nntp->getWrapper()->fetchBody(aMail);
395} 397}
396 398
397QPopupMenu * NNTPfolderItem::getContextMenu() 399Q3PopupMenu * NNTPfolderItem::getContextMenu()
398{ 400{
399 QPopupMenu *m = new QPopupMenu(0); 401 Q3PopupMenu *m = new Q3PopupMenu(0);
400 if (m) 402 if (m)
401 { 403 {
402 m->insertItem(i18n("Refresh header list"),0); 404 m->insertItem(i18n("Refresh header list"),0);
403 m->insertItem(i18n("Copy all postings"),1); 405 m->insertItem(i18n("Copy all postings"),1);
404 } 406 }
405 return m; 407 return m;
406} 408}
407 409
408void NNTPfolderItem::downloadMails() 410void NNTPfolderItem::downloadMails()
409{ 411{
410 AccountView*bl = nntp->accountView(); 412 AccountView*bl = nntp->accountView();
411 if (!bl) return; 413 if (!bl) return;
@@ -444,46 +446,46 @@ IMAPviewItem::IMAPviewItem( IMAPaccount *a, AccountView *parent )
444} 446}
445 447
446IMAPviewItem::~IMAPviewItem() 448IMAPviewItem::~IMAPviewItem()
447{ 449{
448 delete wrapper; 450 delete wrapper;
449} 451}
450 452
451AbstractMail *IMAPviewItem::getWrapper() 453AbstractMail *IMAPviewItem::getWrapper()
452{ 454{
453 return wrapper; 455 return wrapper;
454} 456}
455 457
456void IMAPviewItem::refresh(QValueList<RecMailP>&) 458void IMAPviewItem::refresh(Q3ValueList<RecMailP>&)
457{ 459{
458 refreshFolders(false); 460 refreshFolders(false);
459} 461}
460 462
461const QStringList&IMAPviewItem::subFolders() 463const QStringList&IMAPviewItem::subFolders()
462{ 464{
463 return currentFolders; 465 return currentFolders;
464} 466}
465 467
466void IMAPviewItem::refreshFolders(bool force) 468void IMAPviewItem::refreshFolders(bool force)
467{ 469{
468 if (childCount()>0 && force==false) return; 470 if (childCount()>0 && force==false) return;
469 if (account->getOffline()) return; 471 if (account->getOffline()) return;
470 472
471 removeChilds(); 473 removeChilds();
472 currentFolders.clear(); 474 currentFolders.clear();
473 QValueList<FolderP> * folders = wrapper->listFolders(); 475 Q3ValueList<FolderP> * folders = wrapper->listFolders();
474 476
475 QValueList<FolderP>::Iterator it; 477 Q3ValueList<FolderP>::Iterator it;
476 QListViewItem*item = 0; 478 Q3ListViewItem*item = 0;
477 QListViewItem*titem = 0; 479 Q3ListViewItem*titem = 0;
478 QString fname,del,search; 480 QString fname,del,search;
479 int pos; 481 int pos;
480 482
481 for ( it = folders->begin(); it!=folders->end(); ++it) 483 for ( it = folders->begin(); it!=folders->end(); ++it)
482 { 484 {
483 if ((*it)->getDisplayName().lower()=="inbox") 485 if ((*it)->getDisplayName().lower()=="inbox")
484 { 486 {
485 item = new IMAPfolderItem( (*it), this , item ); 487 item = new IMAPfolderItem( (*it), this , item );
486 folders->remove(it); 488 folders->remove(it);
487 break; 489 break;
488 } 490 }
489 } 491 }
@@ -504,27 +506,27 @@ void IMAPviewItem::refreshFolders(bool force)
504 /* setup the short name */ 506 /* setup the short name */
505 item->setText(0,(*it)->getDisplayName().mid(pos+1)); 507 item->setText(0,(*it)->getDisplayName().mid(pos+1));
506 item = titem; 508 item = titem;
507 } 509 }
508 else 510 else
509 { 511 {
510 item = new IMAPfolderItem( (*it), this , item ); 512 item = new IMAPfolderItem( (*it), this , item );
511 } 513 }
512 } 514 }
513 delete folders; 515 delete folders;
514} 516}
515 517
516QPopupMenu * IMAPviewItem::getContextMenu() 518Q3PopupMenu * IMAPviewItem::getContextMenu()
517{ 519{
518 QPopupMenu *m = new QPopupMenu(0); 520 Q3PopupMenu *m = new Q3PopupMenu(0);
519 if (m) 521 if (m)
520 { 522 {
521 if (!account->getOffline()) 523 if (!account->getOffline())
522 { 524 {
523 m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); 525 m->insertItem(i18n("Get new messages"),GET_NEW_MAILS);
524 m->insertItem(i18n("Refresh folder list"),0); 526 m->insertItem(i18n("Refresh folder list"),0);
525 m->insertItem(i18n("Create new folder"),1); 527 m->insertItem(i18n("Create new folder"),1);
526 m->insertSeparator(); 528 m->insertSeparator();
527 m->insertItem(i18n("Disconnect"),2); 529 m->insertItem(i18n("Disconnect"),2);
528 m->insertItem(i18n("Set offline"),3); 530 m->insertItem(i18n("Set offline"),3);
529 m->insertSeparator(); 531 m->insertSeparator();
530 } 532 }
@@ -606,82 +608,82 @@ void IMAPviewItem::contextMenuSelected(int id)
606} 608}
607 609
608RECBODYP IMAPviewItem::fetchBody(const RecMailP&) 610RECBODYP IMAPviewItem::fetchBody(const RecMailP&)
609{ 611{
610 return new RecBody(); 612 return new RecBody();
611} 613}
612 614
613bool IMAPviewItem::offline() 615bool IMAPviewItem::offline()
614{ 616{
615 return account->getOffline(); 617 return account->getOffline();
616} 618}
617 619
618IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , QListViewItem*after ) 620IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , Q3ListViewItem*after )
619 : AccountViewItem( folderInit, parent , after ) 621 : AccountViewItem( folderInit, parent , after )
620{ 622{
621 imap = parent; 623 imap = parent;
622 if (folder->getDisplayName().lower()!="inbox") 624 if (folder->getDisplayName().lower()!="inbox")
623 { 625 {
624 setPixmap( 0, PIXMAP_IMAPFOLDER ); 626 setPixmap( 0, PIXMAP_IMAPFOLDER );
625 } 627 }
626 else 628 else
627 { 629 {
628 setPixmap( 0, PIXMAP_INBOXFOLDER); 630 setPixmap( 0, PIXMAP_INBOXFOLDER);
629 } 631 }
630 setText( 0, folder->getDisplayName() ); 632 setText( 0, folder->getDisplayName() );
631} 633}
632 634
633IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ) 635IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , Q3ListViewItem*after, IMAPviewItem *master )
634 : AccountViewItem(folderInit, parent,after ) 636 : AccountViewItem(folderInit, parent,after )
635{ 637{
636 imap = master; 638 imap = master;
637 if (folder->getDisplayName().lower()!="inbox") 639 if (folder->getDisplayName().lower()!="inbox")
638 { 640 {
639 setPixmap( 0, PIXMAP_IMAPFOLDER ); 641 setPixmap( 0, PIXMAP_IMAPFOLDER );
640 } 642 }
641 else 643 else
642 { 644 {
643 setPixmap( 0, PIXMAP_INBOXFOLDER); 645 setPixmap( 0, PIXMAP_INBOXFOLDER);
644 } 646 }
645 setText( 0, folder->getDisplayName() ); 647 setText( 0, folder->getDisplayName() );
646} 648}
647 649
648IMAPfolderItem::~IMAPfolderItem() 650IMAPfolderItem::~IMAPfolderItem()
649{} 651{}
650 652
651const QString& IMAPfolderItem::Delemiter()const 653const QString& IMAPfolderItem::Delemiter()const
652{ 654{
653 return folder->Separator(); 655 return folder->Separator();
654} 656}
655 657
656void IMAPfolderItem::refresh(QValueList<RecMailP>&target) 658void IMAPfolderItem::refresh(Q3ValueList<RecMailP>&target)
657{ 659{
658 if (folder->may_select()) 660 if (folder->may_select())
659 { 661 {
660 imap->getWrapper()->listMessages( folder->getName(),target ); 662 imap->getWrapper()->listMessages( folder->getName(),target );
661 } 663 }
662 else 664 else
663 { 665 {
664 target.clear(); 666 target.clear();
665 } 667 }
666} 668}
667 669
668RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail) 670RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail)
669{ 671{
670 return imap->getWrapper()->fetchBody(aMail); 672 return imap->getWrapper()->fetchBody(aMail);
671} 673}
672 674
673QPopupMenu * IMAPfolderItem::getContextMenu() 675Q3PopupMenu * IMAPfolderItem::getContextMenu()
674{ 676{
675 QPopupMenu *m = new QPopupMenu(0); 677 Q3PopupMenu *m = new Q3PopupMenu(0);
676 if (m) 678 if (m)
677 { 679 {
678 if (folder->may_select()) 680 if (folder->may_select())
679 { 681 {
680 m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); 682 m->insertItem(i18n("Get new messages"),GET_NEW_MAILS);
681 m->insertItem(i18n("Refresh header list"),0); 683 m->insertItem(i18n("Refresh header list"),0);
682 m->insertItem(i18n("Move/Copie all mails"),4); 684 m->insertItem(i18n("Move/Copie all mails"),4);
683 m->insertItem(i18n("Delete all mails"),1); 685 m->insertItem(i18n("Delete all mails"),1);
684 } 686 }
685 if (folder->no_inferior()==false) 687 if (folder->no_inferior()==false)
686 { 688 {
687 m->insertItem(i18n("Create new subfolder"),2); 689 m->insertItem(i18n("Create new subfolder"),2);
@@ -712,25 +714,25 @@ void IMAPfolderItem::createNewFolder()
712 714
713void IMAPfolderItem::deleteFolder() 715void IMAPfolderItem::deleteFolder()
714{ 716{
715 int yesno = QMessageBox::warning(0,i18n("Delete folder"), 717 int yesno = QMessageBox::warning(0,i18n("Delete folder"),
716 i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), 718 i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()),
717 i18n("Yes"), 719 i18n("Yes"),
718 i18n("No"),QString::null,1,1); 720 i18n("No"),QString::null,1,1);
719 721
720 if (yesno == 0) 722 if (yesno == 0)
721 { 723 {
722 if (imap->getWrapper()->deleteMbox(folder)) 724 if (imap->getWrapper()->deleteMbox(folder))
723 { 725 {
724 QListView*v=listView(); 726 Q3ListView*v=listView();
725 IMAPviewItem * box = imap; 727 IMAPviewItem * box = imap;
726 /* be carefull - after that this object is destroyd so don't use 728 /* be carefull - after that this object is destroyd so don't use
727 * any member of it after that call!!*/ 729 * any member of it after that call!!*/
728 imap->refreshFolders(true); 730 imap->refreshFolders(true);
729 if (v) 731 if (v)
730 { 732 {
731 v->setSelected(box,true); 733 v->setSelected(box,true);
732 } 734 }
733 } 735 }
734 } 736 }
735} 737}
736 738
@@ -791,37 +793,37 @@ MHviewItem::MHviewItem( const QString&aPath, AccountView *parent )
791} 793}
792 794
793MHviewItem::~MHviewItem() 795MHviewItem::~MHviewItem()
794{ 796{
795 delete wrapper; 797 delete wrapper;
796} 798}
797 799
798AbstractMail *MHviewItem::getWrapper() 800AbstractMail *MHviewItem::getWrapper()
799{ 801{
800 return wrapper; 802 return wrapper;
801} 803}
802 804
803void MHviewItem::refresh( QValueList<RecMailP> & target) 805void MHviewItem::refresh( Q3ValueList<RecMailP> & target)
804{ 806{
805 refresh(false); 807 refresh(false);
806 getWrapper()->listMessages( "",target ); 808 getWrapper()->listMessages( "",target );
807} 809}
808 810
809void MHviewItem::refresh(bool force) 811void MHviewItem::refresh(bool force)
810{ 812{
811 if (childCount()>0 && force==false) return; 813 if (childCount()>0 && force==false) return;
812 removeChilds(); 814 removeChilds();
813 currentFolders.clear(); 815 currentFolders.clear();
814 QValueList<FolderP> *folders = wrapper->listFolders(); 816 Q3ValueList<FolderP> *folders = wrapper->listFolders();
815 QValueList<FolderP>::ConstIterator it; 817 Q3ValueList<FolderP>::ConstIterator it;
816 MHfolderItem*item = 0; 818 MHfolderItem*item = 0;
817 MHfolderItem*pmaster = 0; 819 MHfolderItem*pmaster = 0;
818 QString fname = ""; 820 QString fname = "";
819 int pos; 821 int pos;
820 for ( it = folders->begin(); it!=folders->end(); ++it) 822 for ( it = folders->begin(); it!=folders->end(); ++it)
821 { 823 {
822 fname = (*it)->getDisplayName(); 824 fname = (*it)->getDisplayName();
823 /* this folder itself */ 825 /* this folder itself */
824 if (fname=="/") 826 if (fname=="/")
825 { 827 {
826 currentFolders.append(fname); 828 currentFolders.append(fname);
827 folder = (*it); 829 folder = (*it);
@@ -848,27 +850,27 @@ void MHviewItem::refresh(bool force)
848 } 850 }
849 item->setSelectable((*it)->may_select()); 851 item->setSelectable((*it)->may_select());
850 } 852 }
851 delete folders; 853 delete folders;
852} 854}
853 855
854RECBODYP MHviewItem::fetchBody( const RecMailP &mail ) 856RECBODYP MHviewItem::fetchBody( const RecMailP &mail )
855{ 857{
856 858
857 return wrapper->fetchBody( mail ); 859 return wrapper->fetchBody( mail );
858} 860}
859 861
860QPopupMenu * MHviewItem::getContextMenu() 862Q3PopupMenu * MHviewItem::getContextMenu()
861{ 863{
862 QPopupMenu *m = new QPopupMenu(0); 864 Q3PopupMenu *m = new Q3PopupMenu(0);
863 if (m) 865 if (m)
864 { 866 {
865 m->insertItem(i18n("Refresh folder list"),0); 867 m->insertItem(i18n("Refresh folder list"),0);
866 m->insertItem(i18n("Create new folder"),1); 868 m->insertItem(i18n("Create new folder"),1);
867 m->insertItem(i18n("Delete all mails"),2); 869 m->insertItem(i18n("Delete all mails"),2);
868 m->insertItem(i18n("Move/Copie all mails"),3); 870 m->insertItem(i18n("Move/Copie all mails"),3);
869 } 871 }
870 return m; 872 return m;
871} 873}
872 874
873void MHviewItem::createFolder() 875void MHviewItem::createFolder()
874{ 876{
@@ -911,32 +913,32 @@ void MHviewItem::contextMenuSelected(int which)
911 break; 913 break;
912 case 3: 914 case 3:
913 downloadMails(); 915 downloadMails();
914 break; 916 break;
915 default: 917 default:
916 break; 918 break;
917 } 919 }
918} 920}
919 921
920MHfolderItem::~MHfolderItem() 922MHfolderItem::~MHfolderItem()
921{} 923{}
922 924
923MHfolderItem::MHfolderItem( const FolderP &folderInit, MHviewItem *parent , QListViewItem*after ) 925MHfolderItem::MHfolderItem( const FolderP &folderInit, MHviewItem *parent , Q3ListViewItem*after )
924 : AccountViewItem(folderInit, parent,after ) 926 : AccountViewItem(folderInit, parent,after )
925{ 927{
926 mbox = parent; 928 mbox = parent;
927 initName(); 929 initName();
928} 930}
929 931
930MHfolderItem::MHfolderItem(const FolderP& folderInit, MHfolderItem *parent, QListViewItem*after, MHviewItem*master) 932MHfolderItem::MHfolderItem(const FolderP& folderInit, MHfolderItem *parent, Q3ListViewItem*after, MHviewItem*master)
931 : AccountViewItem(folderInit, parent,after ) 933 : AccountViewItem(folderInit, parent,after )
932{ 934{
933 folder = folderInit; 935 folder = folderInit;
934 mbox = master; 936 mbox = master;
935 initName(); 937 initName();
936} 938}
937 939
938void MHfolderItem::initName() 940void MHfolderItem::initName()
939{ 941{
940 QString bName = folder->getDisplayName(); 942 QString bName = folder->getDisplayName();
941 if (bName.startsWith("/")&&bName.length()>1) 943 if (bName.startsWith("/")&&bName.length()>1)
942 { 944 {
@@ -958,62 +960,62 @@ void MHfolderItem::initName()
958 setPixmap(0, SmallIcon ("edit")); 960 setPixmap(0, SmallIcon ("edit"));
959 } else { 961 } else {
960 setPixmap( 0, PIXMAP_MBOXFOLDER ); 962 setPixmap( 0, PIXMAP_MBOXFOLDER );
961 } 963 }
962 setText( 0, bName ); 964 setText( 0, bName );
963} 965}
964 966
965const FolderP&MHfolderItem::getFolder()const 967const FolderP&MHfolderItem::getFolder()const
966{ 968{
967 return folder; 969 return folder;
968} 970}
969 971
970void MHfolderItem::refresh(QValueList<RecMailP>&target) 972void MHfolderItem::refresh(Q3ValueList<RecMailP>&target)
971{ 973{
972 if (folder->may_select()) 974 if (folder->may_select())
973 mbox->getWrapper()->listMessages( folder->getName(),target ); 975 mbox->getWrapper()->listMessages( folder->getName(),target );
974} 976}
975 977
976RECBODYP MHfolderItem::fetchBody(const RecMailP&aMail) 978RECBODYP MHfolderItem::fetchBody(const RecMailP&aMail)
977{ 979{
978 return mbox->getWrapper()->fetchBody(aMail); 980 return mbox->getWrapper()->fetchBody(aMail);
979} 981}
980 982
981void MHfolderItem::deleteFolder() 983void MHfolderItem::deleteFolder()
982{ 984{
983 int yesno = QMessageBox::warning(0,i18n("Delete folder"), 985 int yesno = QMessageBox::warning(0,i18n("Delete folder"),
984 i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), 986 i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()),
985 i18n("Yes"), 987 i18n("Yes"),
986 i18n("No"),QString::null,1,1); 988 i18n("No"),QString::null,1,1);
987 989
988 if (yesno == 0) 990 if (yesno == 0)
989 { 991 {
990 if (mbox->getWrapper()->deleteMbox(folder)) 992 if (mbox->getWrapper()->deleteMbox(folder))
991 { 993 {
992 QListView*v=listView(); 994 Q3ListView*v=listView();
993 MHviewItem * box = mbox; 995 MHviewItem * box = mbox;
994 /* be carefull - after that this object is destroyd so don't use 996 /* be carefull - after that this object is destroyd so don't use
995 * any member of it after that call!!*/ 997 * any member of it after that call!!*/
996 mbox->refresh(true); 998 mbox->refresh(true);
997 if (v) 999 if (v)
998 { 1000 {
999 v->setSelected(box,true); 1001 v->setSelected(box,true);
1000 } 1002 }
1001 } 1003 }
1002 } 1004 }
1003} 1005}
1004 1006
1005QPopupMenu * MHfolderItem::getContextMenu() 1007Q3PopupMenu * MHfolderItem::getContextMenu()
1006{ 1008{
1007 QPopupMenu *m = new QPopupMenu(0); 1009 Q3PopupMenu *m = new Q3PopupMenu(0);
1008 if (m) 1010 if (m)
1009 { 1011 {
1010 m->insertItem(i18n("Move/Copie all mails"),2); 1012 m->insertItem(i18n("Move/Copie all mails"),2);
1011 m->insertItem(i18n("Delete all mails"),0); 1013 m->insertItem(i18n("Delete all mails"),0);
1012 m->insertItem(i18n("Create new subfolder"),3); 1014 m->insertItem(i18n("Create new subfolder"),3);
1013 m->insertItem(i18n("Delete folder"),1); 1015 m->insertItem(i18n("Delete folder"),1);
1014 } 1016 }
1015 return m; 1017 return m;
1016} 1018}
1017 1019
1018void MHfolderItem::downloadMails() 1020void MHfolderItem::downloadMails()
1019{ 1021{
@@ -1022,25 +1024,25 @@ void MHfolderItem::downloadMails()
1022 bl->downloadMails(folder,mbox->getWrapper()); 1024 bl->downloadMails(folder,mbox->getWrapper());
1023} 1025}
1024 1026
1025void MHfolderItem::createFolder() 1027void MHfolderItem::createFolder()
1026{ 1028{
1027 Newmdirdlg ndirdlg(0,0,true); 1029 Newmdirdlg ndirdlg(0,0,true);
1028 //ndirdlg.showMaximized(); 1030 //ndirdlg.showMaximized();
1029 if (ndirdlg.exec() ) 1031 if (ndirdlg.exec() )
1030 { 1032 {
1031 QString ndir = ndirdlg.Newdir(); 1033 QString ndir = ndirdlg.Newdir();
1032 if (mbox->getWrapper()->createMbox(ndir,folder)) 1034 if (mbox->getWrapper()->createMbox(ndir,folder))
1033 { 1035 {
1034 QListView*v=listView(); 1036 Q3ListView*v=listView();
1035 MHviewItem * box = mbox; 1037 MHviewItem * box = mbox;
1036 /* be carefull - after that this object is destroyd so don't use 1038 /* be carefull - after that this object is destroyd so don't use
1037 * any member of it after that call!!*/ 1039 * any member of it after that call!!*/
1038 mbox->refresh(true); 1040 mbox->refresh(true);
1039 if (v) 1041 if (v)
1040 { 1042 {
1041 v->setSelected(box,true); 1043 v->setSelected(box,true);
1042 } 1044 }
1043 } 1045 }
1044 } 1046 }
1045} 1047}
1046 1048
@@ -1069,44 +1071,44 @@ bool MHfolderItem::isDraftfolder()
1069{ 1071{
1070 if (folder && folder->getName()==AbstractMail::defaultLocalfolder()+"/"+AbstractMail::draftFolder()) return true; 1072 if (folder && folder->getName()==AbstractMail::defaultLocalfolder()+"/"+AbstractMail::draftFolder()) return true;
1071 return false; 1073 return false;
1072} 1074}
1073 1075
1074/** 1076/**
1075 * Generic stuff 1077 * Generic stuff
1076 */ 1078 */
1077 1079
1078const QString AccountViewItem::contextName="AccountViewItem"; 1080const QString AccountViewItem::contextName="AccountViewItem";
1079 1081
1080AccountViewItem::AccountViewItem( AccountView *parent ) 1082AccountViewItem::AccountViewItem( AccountView *parent )
1081 : QListViewItem( parent ) 1083 : Q3ListViewItem( parent )
1082{ 1084{
1083 init(); 1085 init();
1084 m_Backlink = parent; 1086 m_Backlink = parent;
1085} 1087}
1086 1088
1087AccountViewItem::AccountViewItem( QListViewItem *parent) 1089AccountViewItem::AccountViewItem( Q3ListViewItem *parent)
1088 : QListViewItem( parent),folder(0) 1090 : Q3ListViewItem( parent),folder(0)
1089{ 1091{
1090 init(); 1092 init();
1091} 1093}
1092 1094
1093AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after ) 1095AccountViewItem::AccountViewItem( Q3ListViewItem *parent , Q3ListViewItem*after )
1094 :QListViewItem( parent,after ),folder(0) 1096 :Q3ListViewItem( parent,after ),folder(0)
1095{ 1097{
1096 init(); 1098 init();
1097} 1099}
1098 1100
1099AccountViewItem::AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ) 1101AccountViewItem::AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,Q3ListViewItem *parent , Q3ListViewItem*after )
1100 :QListViewItem( parent,after ),folder(folderInit) 1102 :Q3ListViewItem( parent,after ),folder(folderInit)
1101{ 1103{
1102 init(); 1104 init();
1103} 1105}
1104 1106
1105void AccountViewItem::init() 1107void AccountViewItem::init()
1106{ 1108{
1107 m_Backlink = 0; 1109 m_Backlink = 0;
1108} 1110}
1109 1111
1110AccountViewItem::~AccountViewItem() 1112AccountViewItem::~AccountViewItem()
1111{ 1113{
1112 folder = 0; 1114 folder = 0;
@@ -1131,28 +1133,28 @@ void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder)
1131 if (yesno == 0) 1133 if (yesno == 0)
1132 { 1134 {
1133 if (wrapper->deleteAllMail(folder)) 1135 if (wrapper->deleteAllMail(folder))
1134 { 1136 {
1135 AccountView * view = (AccountView*)listView(); 1137 AccountView * view = (AccountView*)listView();
1136 if (view) view->refreshCurrent(); 1138 if (view) view->refreshCurrent();
1137 } 1139 }
1138 } 1140 }
1139} 1141}
1140 1142
1141void AccountViewItem::removeChilds() 1143void AccountViewItem::removeChilds()
1142{ 1144{
1143 QListViewItem *child = firstChild(); 1145 Q3ListViewItem *child = firstChild();
1144 while ( child ) 1146 while ( child )
1145 { 1147 {
1146 QListViewItem *tmp = child; 1148 Q3ListViewItem *tmp = child;
1147 child = child->nextSibling(); 1149 child = child->nextSibling();
1148 delete tmp; 1150 delete tmp;
1149 } 1151 }
1150} 1152}
1151 1153
1152bool AccountViewItem::matchName(const QString&name)const 1154bool AccountViewItem::matchName(const QString&name)const
1153{ 1155{
1154 if (!folder) return false; 1156 if (!folder) return false;
1155 return folder->getDisplayName().lower()==name.lower(); 1157 return folder->getDisplayName().lower()==name.lower();
1156} 1158}
1157 1159
1158 1160
diff --git a/kmicromail/accountitem.h b/kmicromail/accountitem.h
index 4c92bfc..bbfd05f 100644
--- a/kmicromail/accountitem.h
+++ b/kmicromail/accountitem.h
@@ -1,214 +1,217 @@
1#ifndef __ACCOUNT_ITEM 1#ifndef __ACCOUNT_ITEM
2#define __ACCOUNT_ITEM 2#define __ACCOUNT_ITEM
3 3
4 4
5#include <qlistview.h> 5#include <q3listview.h>
6#include <qlist.h> 6#include <qlist.h>
7//Added by qt3to4:
8#include <Q3ValueList>
9#include <Q3PopupMenu>
7#include <opie2/osmartpointer.h> 10#include <opie2/osmartpointer.h>
8#include <libmailwrapper/mailwrapper.h> 11#include <libmailwrapper/mailwrapper.h>
9 12
10class POP3wrapper; 13class POP3wrapper;
11class RecMail; 14class RecMail;
12class RecBody; 15class RecBody;
13class QPopupMenu; 16class Q3PopupMenu;
14class Selectstore; 17class Selectstore;
15class AccountView; 18class AccountView;
16class POP3account; 19class POP3account;
17class NNTPaccount; 20class NNTPaccount;
18class IMAPaccount; 21class IMAPaccount;
19class AbstractMail; 22class AbstractMail;
20class Folder; 23class Folder;
21 24
22#define RECBODYP Opie::Core::OSmartPointer<RecBody> 25#define RECBODYP Opie::Core::OSmartPointer<RecBody>
23 26
24class AccountViewItem : public QListViewItem 27class AccountViewItem : public Q3ListViewItem
25{ 28{
26 29
27public: 30public:
28 AccountViewItem( AccountView *parent ); 31 AccountViewItem( AccountView *parent );
29 AccountViewItem( QListViewItem *parent); 32 AccountViewItem( Q3ListViewItem *parent);
30 AccountViewItem( QListViewItem *parent , QListViewItem*after ); 33 AccountViewItem( Q3ListViewItem *parent , Q3ListViewItem*after );
31 AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ); 34 AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,Q3ListViewItem *parent , Q3ListViewItem*after );
32 35
33 virtual ~AccountViewItem(); 36 virtual ~AccountViewItem();
34 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&)=0; 37 virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&)=0;
35 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&)=0; 38 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&)=0;
36 virtual QPopupMenu * getContextMenu(){return 0;}; 39 virtual Q3PopupMenu * getContextMenu(){return 0;};
37 virtual void contextMenuSelected(int){} 40 virtual void contextMenuSelected(int){}
38 virtual AccountView*accountView(); 41 virtual AccountView*accountView();
39 virtual bool matchName(const QString&name)const; 42 virtual bool matchName(const QString&name)const;
40 virtual bool isDraftfolder(); 43 virtual bool isDraftfolder();
41 Opie::Core::OSmartPointer<Folder> getFolder() { return folder; }; 44 Opie::Core::OSmartPointer<Folder> getFolder() { return folder; };
42 45
43protected: 46protected:
44 AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0); 47 AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0);
45 virtual void init(); 48 virtual void init();
46 virtual void removeChilds(); 49 virtual void removeChilds();
47 virtual void deleteAllMail(AbstractMail*wrapper,const Opie::Core::OSmartPointer<Folder>&f); 50 virtual void deleteAllMail(AbstractMail*wrapper,const Opie::Core::OSmartPointer<Folder>&f);
48 static const QString contextName; 51 static const QString contextName;
49 AccountView*m_Backlink; 52 AccountView*m_Backlink;
50 Opie::Core::OSmartPointer<Folder> folder; 53 Opie::Core::OSmartPointer<Folder> folder;
51}; 54};
52 55
53class POP3viewItem : public AccountViewItem 56class POP3viewItem : public AccountViewItem
54{ 57{
55 58
56public: 59public:
57 POP3viewItem( POP3account *a, AccountView *parent ); 60 POP3viewItem( POP3account *a, AccountView *parent );
58 virtual ~POP3viewItem(); 61 virtual ~POP3viewItem();
59 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); 62 virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target );
60 virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); 63 virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail );
61 AbstractMail *getWrapper(); 64 AbstractMail *getWrapper();
62 virtual QPopupMenu * getContextMenu(); 65 virtual Q3PopupMenu * getContextMenu();
63 virtual void contextMenuSelected(int); 66 virtual void contextMenuSelected(int);
64 67
65protected: 68protected:
66 POP3account *account; 69 POP3account *account;
67 virtual void refresh(); 70 virtual void refresh();
68 AbstractMail *wrapper; 71 AbstractMail *wrapper;
69 void disconnect(); 72 void disconnect();
70 void setOnOffline(); 73 void setOnOffline();
71}; 74};
72 75
73class POP3folderItem : public AccountViewItem 76class POP3folderItem : public AccountViewItem
74{ 77{
75 78
76public: 79public:
77 POP3folderItem( const Opie::Core::OSmartPointer<Folder>&folder, POP3viewItem *parent , QListViewItem*after ); 80 POP3folderItem( const Opie::Core::OSmartPointer<Folder>&folder, POP3viewItem *parent , Q3ListViewItem*after );
78 virtual ~POP3folderItem(); 81 virtual ~POP3folderItem();
79 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); 82 virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&);
80 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); 83 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&);
81 virtual QPopupMenu * getContextMenu(); 84 virtual Q3PopupMenu * getContextMenu();
82 virtual void contextMenuSelected(int); 85 virtual void contextMenuSelected(int);
83 86
84protected: 87protected:
85 void downloadMails(); 88 void downloadMails();
86 POP3viewItem *pop3; 89 POP3viewItem *pop3;
87}; 90};
88 91
89 92
90class NNTPviewItem : public AccountViewItem 93class NNTPviewItem : public AccountViewItem
91{ 94{
92 95
93public: 96public:
94 NNTPviewItem( NNTPaccount *a, AccountView *parent ); 97 NNTPviewItem( NNTPaccount *a, AccountView *parent );
95 virtual ~NNTPviewItem(); 98 virtual ~NNTPviewItem();
96 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); 99 virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target );
97 virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); 100 virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail );
98 AbstractMail *getWrapper(); 101 AbstractMail *getWrapper();
99 virtual QPopupMenu * getContextMenu(); 102 virtual Q3PopupMenu * getContextMenu();
100 virtual void contextMenuSelected(int); 103 virtual void contextMenuSelected(int);
101 104
102protected: 105protected:
103 NNTPaccount *account; 106 NNTPaccount *account;
104 virtual void refresh(); 107 virtual void refresh();
105 AbstractMail *wrapper; 108 AbstractMail *wrapper;
106 void disconnect(); 109 void disconnect();
107 void setOnOffline(); 110 void setOnOffline();
108 void subscribeGroups(); 111 void subscribeGroups();
109}; 112};
110 113
111class NNTPfolderItem : public AccountViewItem 114class NNTPfolderItem : public AccountViewItem
112{ 115{
113 116
114public: 117public:
115 NNTPfolderItem(const Opie::Core::OSmartPointer<Folder>&folder, NNTPviewItem *parent , QListViewItem*after ); 118 NNTPfolderItem(const Opie::Core::OSmartPointer<Folder>&folder, NNTPviewItem *parent , Q3ListViewItem*after );
116 virtual ~NNTPfolderItem(); 119 virtual ~NNTPfolderItem();
117 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); 120 virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&);
118 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); 121 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&);
119 virtual QPopupMenu * getContextMenu(); 122 virtual Q3PopupMenu * getContextMenu();
120 virtual void contextMenuSelected(int); 123 virtual void contextMenuSelected(int);
121 124
122protected: 125protected:
123 void downloadMails(); 126 void downloadMails();
124 NNTPviewItem *nntp; 127 NNTPviewItem *nntp;
125}; 128};
126 129
127 130
128 131
129class IMAPviewItem : public AccountViewItem 132class IMAPviewItem : public AccountViewItem
130{ 133{
131 friend class IMAPfolderItem; 134 friend class IMAPfolderItem;
132public: 135public:
133 IMAPviewItem( IMAPaccount *a, AccountView *parent ); 136 IMAPviewItem( IMAPaccount *a, AccountView *parent );
134 virtual ~IMAPviewItem(); 137 virtual ~IMAPviewItem();
135 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); 138 virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&);
136 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); 139 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&);
137 AbstractMail *getWrapper(); 140 AbstractMail *getWrapper();
138 virtual QPopupMenu * getContextMenu(); 141 virtual Q3PopupMenu * getContextMenu();
139 virtual void contextMenuSelected(int); 142 virtual void contextMenuSelected(int);
140 const QStringList&subFolders(); 143 const QStringList&subFolders();
141 virtual void refreshFolders(bool force=false); 144 virtual void refreshFolders(bool force=false);
142 bool offline(); 145 bool offline();
143 146
144protected: 147protected:
145 virtual void createNewFolder(); 148 virtual void createNewFolder();
146 IMAPaccount *account; 149 IMAPaccount *account;
147 AbstractMail *wrapper; 150 AbstractMail *wrapper;
148 QStringList currentFolders; 151 QStringList currentFolders;
149}; 152};
150 153
151class IMAPfolderItem : public AccountViewItem 154class IMAPfolderItem : public AccountViewItem
152{ 155{
153 156
154public: 157public:
155 IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPviewItem *parent , QListViewItem*after ); 158 IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPviewItem *parent , Q3ListViewItem*after );
156 IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); 159 IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPfolderItem *parent , Q3ListViewItem*after, IMAPviewItem *master );
157 virtual ~IMAPfolderItem(); 160 virtual ~IMAPfolderItem();
158 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); 161 virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&);
159 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); 162 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&);
160 virtual QPopupMenu * getContextMenu(); 163 virtual Q3PopupMenu * getContextMenu();
161 virtual void contextMenuSelected(int); 164 virtual void contextMenuSelected(int);
162 virtual const QString& Delemiter()const; 165 virtual const QString& Delemiter()const;
163protected: 166protected:
164 virtual void createNewFolder(); 167 virtual void createNewFolder();
165 virtual void deleteFolder(); 168 virtual void deleteFolder();
166 virtual void downloadMails(); 169 virtual void downloadMails();
167 IMAPviewItem *imap; 170 IMAPviewItem *imap;
168}; 171};
169 172
170class MHviewItem : public AccountViewItem 173class MHviewItem : public AccountViewItem
171{ 174{
172 friend class MHfolderItem; 175 friend class MHfolderItem;
173 176
174public: 177public:
175 MHviewItem( const QString&aMboxPath, AccountView *parent ); 178 MHviewItem( const QString&aMboxPath, AccountView *parent );
176 virtual ~MHviewItem(); 179 virtual ~MHviewItem();
177 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); 180 virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target );
178 virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); 181 virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail );
179 AbstractMail *getWrapper(); 182 AbstractMail *getWrapper();
180 virtual QPopupMenu * getContextMenu(); 183 virtual Q3PopupMenu * getContextMenu();
181 virtual void contextMenuSelected(int); 184 virtual void contextMenuSelected(int);
182 QStringList subFolders(); 185 QStringList subFolders();
183 virtual void refresh(bool force=false); 186 virtual void refresh(bool force=false);
184 187
185protected: 188protected:
186 void downloadMails(); 189 void downloadMails();
187 virtual void createFolder(); 190 virtual void createFolder();
188 QString m_Path; 191 QString m_Path;
189 AbstractMail *wrapper; 192 AbstractMail *wrapper;
190 QStringList currentFolders; 193 QStringList currentFolders;
191}; 194};
192 195
193class MHfolderItem : public AccountViewItem 196class MHfolderItem : public AccountViewItem
194{ 197{
195 198
196public: 199public:
197 MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHviewItem *parent , QListViewItem*after ); 200 MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHviewItem *parent , Q3ListViewItem*after );
198 MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master); 201 MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHfolderItem *parent, Q3ListViewItem*after, MHviewItem*master);
199 virtual ~MHfolderItem(); 202 virtual ~MHfolderItem();
200 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); 203 virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&);
201 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); 204 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&);
202 virtual QPopupMenu * getContextMenu(); 205 virtual Q3PopupMenu * getContextMenu();
203 virtual void contextMenuSelected(int); 206 virtual void contextMenuSelected(int);
204 virtual const Opie::Core::OSmartPointer<Folder>&getFolder()const; 207 virtual const Opie::Core::OSmartPointer<Folder>&getFolder()const;
205 virtual bool isDraftfolder(); 208 virtual bool isDraftfolder();
206 209
207protected: 210protected:
208 void downloadMails(); 211 void downloadMails();
209 virtual void createFolder(); 212 virtual void createFolder();
210 virtual void deleteFolder(); 213 virtual void deleteFolder();
211 void initName(); 214 void initName();
212 MHviewItem *mbox; 215 MHviewItem *mbox;
213}; 216};
214 217
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp
index d1d4f7e..eea1f65 100644
--- a/kmicromail/accountview.cpp
+++ b/kmicromail/accountview.cpp
@@ -4,65 +4,67 @@
4#include "selectstore.h" 4#include "selectstore.h"
5 5
6#include <libmailwrapper/settings.h> 6#include <libmailwrapper/settings.h>
7#include <libmailwrapper/mailwrapper.h> 7#include <libmailwrapper/mailwrapper.h>
8#include <libmailwrapper/mailtypes.h> 8#include <libmailwrapper/mailtypes.h>
9#include <libmailwrapper/abstractmail.h> 9#include <libmailwrapper/abstractmail.h>
10 10
11/* OPIE */ 11/* OPIE */
12#include <qpe/qpeapplication.h> 12#include <qpe/qpeapplication.h>
13 13
14/* QT */ 14/* QT */
15#include <qmessagebox.h> 15#include <qmessagebox.h>
16#include <qpopupmenu.h> 16#include <q3popupmenu.h>
17#include <qcheckbox.h> 17#include <qcheckbox.h>
18#include <qtimer.h> 18#include <qtimer.h>
19#include <qspinbox.h> 19#include <qspinbox.h>
20//Added by qt3to4:
21#include <Q3ValueList>
20#include <klocale.h> 22#include <klocale.h>
21#include <kmessagebox.h> 23#include <kmessagebox.h>
22 24
23using namespace Opie::Core; 25using namespace Opie::Core;
24AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) 26AccountView::AccountView( QWidget *parent, const char *name, Qt::WFlags flags )
25 : QListView( parent, name, flags ) 27 : Q3ListView( parent, name, flags )
26{ 28{
27 //connect( this, SIGNAL( selectionChanged(QListViewItem*) ), 29 //connect( this, SIGNAL( selectionChanged(QListViewItem*) ),
28 // SLOT( refresh(QListViewItem*) ) ); 30 // SLOT( refresh(QListViewItem*) ) );
29 connect( this, SIGNAL( clicked(QListViewItem*) ), 31 connect( this, SIGNAL( clicked(Q3ListViewItem*) ),
30 SLOT( refresh(QListViewItem*) ) ); 32 SLOT( refresh(Q3ListViewItem*) ) );
31 connect( this, SIGNAL( returnPressed(QListViewItem*) ), 33 connect( this, SIGNAL( returnPressed(Q3ListViewItem*) ),
32 SLOT( refresh(QListViewItem*) ) ); 34 SLOT( refresh(Q3ListViewItem*) ) );
33 connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, 35 connect( this, SIGNAL( mouseButtonPressed(int,Q3ListViewItem*,const QPoint&,int) ),this,
34 SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) ); 36 SLOT( slotHold(int,Q3ListViewItem*,const QPoint&,int) ) );
35 setSorting(0); 37 setSorting(0);
36} 38}
37 39
38AccountView::~AccountView() 40AccountView::~AccountView()
39{ 41{
40 imapAccounts.clear(); 42 imapAccounts.clear();
41 mhAccounts.clear(); 43 mhAccounts.clear();
42} 44}
43 45
44void AccountView::slotContextMenu(int id) 46void AccountView::slotContextMenu(int id)
45{ 47{
46 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); 48 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem());
47 if (!view) return; 49 if (!view) return;
48 view->contextMenuSelected(id); 50 view->contextMenuSelected(id);
49} 51}
50 52
51void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) 53void AccountView::slotHold(int button, Q3ListViewItem * item,const QPoint&,int)
52{ 54{
53 if (button==1) {return;} 55 if (button==1) {return;}
54 if (!item) return; 56 if (!item) return;
55 AccountViewItem *view = static_cast<AccountViewItem *>(item); 57 AccountViewItem *view = static_cast<AccountViewItem *>(item);
56 QPopupMenu*m = view->getContextMenu(); 58 Q3PopupMenu*m = view->getContextMenu();
57 if (!m) return; 59 if (!m) return;
58 connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); 60 connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int)));
59 m->setFocus(); 61 m->setFocus();
60 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); 62 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
61 delete m; 63 delete m;
62} 64}
63 65
64void AccountView::populate( QList<Account> list ) 66void AccountView::populate( QList<Account> list )
65{ 67{
66 clear(); 68 clear();
67 69
68 imapAccounts.clear(); 70 imapAccounts.clear();
@@ -84,25 +86,25 @@ void AccountView::populate( QList<Account> list )
84 /* must not be hold 'cause it isn't required */ 86 /* must not be hold 'cause it isn't required */
85 (void) new POP3viewItem( pop3, this ); 87 (void) new POP3viewItem( pop3, this );
86 } 88 }
87 else if ( it->getType() == MAILLIB::A_NNTP ) 89 else if ( it->getType() == MAILLIB::A_NNTP )
88 { 90 {
89 NNTPaccount *nntp = static_cast<NNTPaccount *>(it); 91 NNTPaccount *nntp = static_cast<NNTPaccount *>(it);
90 /* must not be hold 'cause it isn't required */ 92 /* must not be hold 'cause it isn't required */
91 (void) new NNTPviewItem( nntp, this ); 93 (void) new NNTPviewItem( nntp, this );
92 } 94 }
93 } 95 }
94} 96}
95 97
96void AccountView::refresh(QListViewItem *item) 98void AccountView::refresh(Q3ListViewItem *item)
97{ 99{
98 if ( item ) 100 if ( item )
99 { 101 {
100 bool ask = true; 102 bool ask = true;
101 //qDebug("text -%s- ",item->text( 0 ).latin1() ); 103 //qDebug("text -%s- ",item->text( 0 ).latin1() );
102 if ( item->text( 0 ) == i18n (" Local Mailfolders") ) 104 if ( item->text( 0 ) == i18n (" Local Mailfolders") )
103 ask = false; 105 ask = false;
104 else { 106 else {
105 if ( item->parent() ) 107 if ( item->parent() )
106 if ( item->parent()->text( 0 ) == i18n (" Local Mailfolders") ) 108 if ( item->parent()->text( 0 ) == i18n (" Local Mailfolders") )
107 ask = false; 109 ask = false;
108 } 110 }
@@ -136,46 +138,46 @@ void AccountView::refreshOutgoing()
136 { 138 {
137 bName.replace(0,pos+1,""); 139 bName.replace(0,pos+1,"");
138 } 140 }
139 //qDebug("name *%s* ",bName.lower().latin1() ); 141 //qDebug("name *%s* ",bName.lower().latin1() );
140 if ( bName.lower() == "outgoing" || bName.lower() == "sent" || bName.lower() == "sendfailed" ) { 142 if ( bName.lower() == "outgoing" || bName.lower() == "sent" || bName.lower() == "sendfailed" ) {
141 refreshCurrent(); 143 refreshCurrent();
142 // qDebug("refresh "); 144 // qDebug("refresh ");
143 } 145 }
144} 146}
145void AccountView::refreshCurrentSelected() 147void AccountView::refreshCurrentSelected()
146{ 148{
147 if ( !m_currentItem ) return; 149 if ( !m_currentItem ) return;
148 QValueList<RecMailP> headerlist; 150 Q3ValueList<RecMailP> headerlist;
149 AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); 151 AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem);
150 view->refresh(headerlist); 152 view->refresh(headerlist);
151 emit refreshMailview(headerlist); 153 emit refreshMailview(headerlist);
152 topLevelWidget()->setCaption( i18n ( "KOpieMail/Pi" ) ) ; 154 topLevelWidget()->setCaption( i18n ( "KOpieMail/Pi" ) ) ;
153} 155}
154 156
155void AccountView::refreshCurrent() 157void AccountView::refreshCurrent()
156{ 158{
157 m_currentItem = currentItem(); 159 m_currentItem = currentItem();
158 if ( !m_currentItem ) return; 160 if ( !m_currentItem ) return;
159 topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ; 161 topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ;
160 QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) ); 162 QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) );
161} 163}
162 164
163void AccountView::refreshAll() 165void AccountView::refreshAll()
164{ 166{
165} 167}
166 168
167RecBodyP AccountView::fetchBody(const RecMailP&aMail) 169RecBodyP AccountView::fetchBody(const RecMailP&aMail)
168{ 170{
169 QListViewItem*item = selectedItem (); 171 Q3ListViewItem*item = selectedItem ();
170 if (!item) return new RecBody(); 172 if (!item) return new RecBody();
171 AccountViewItem *view = static_cast<AccountViewItem *>(item); 173 AccountViewItem *view = static_cast<AccountViewItem *>(item);
172 return view->fetchBody(aMail); 174 return view->fetchBody(aMail);
173} 175}
174 176
175void AccountView::setupFolderselect(Selectstore*sels) 177void AccountView::setupFolderselect(Selectstore*sels)
176{ 178{
177 179
178#ifndef DESKTOP_VERSION 180#ifndef DESKTOP_VERSION
179 sels->showMaximized(); 181 sels->showMaximized();
180#else 182#else
181 sels->show(); 183 sels->show();
diff --git a/kmicromail/accountview.h b/kmicromail/accountview.h
index 33f3479..14b0ff9 100644
--- a/kmicromail/accountview.h
+++ b/kmicromail/accountview.h
@@ -1,48 +1,50 @@
1#ifndef ACCOUNTVIEW_H 1#ifndef ACCOUNTVIEW_H
2#define ACCOUNTVIEW_H 2#define ACCOUNTVIEW_H
3 3
4#include <qlistview.h> 4#include <q3listview.h>
5#include <qlist.h> 5#include <qlist.h>
6//Added by qt3to4:
7#include <Q3ValueList>
6#include <opie2/osmartpointer.h> 8#include <opie2/osmartpointer.h>
7#include <libmailwrapper/mailtypes.h> 9#include <libmailwrapper/mailtypes.h>
8 10
9class Selectstore; 11class Selectstore;
10class Folder; 12class Folder;
11class AbstractMail; 13class AbstractMail;
12class Account; 14class Account;
13class IMAPviewItem; 15class IMAPviewItem;
14class MHviewItem; 16class MHviewItem;
15 17
16class AccountView : public QListView 18class AccountView : public Q3ListView
17{ 19{
18 Q_OBJECT 20 Q_OBJECT
19 21
20public: 22public:
21 AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); 23 AccountView( QWidget *parent = 0, const char *name = 0, Qt::WFlags flags = 0 );
22 virtual ~AccountView(); 24 virtual ~AccountView();
23 virtual void populate( QList<Account> list ); 25 virtual void populate( QList<Account> list );
24 virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail); 26 virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail);
25 virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); 27 virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper);
26 virtual void downloadMailsInbox(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); 28 virtual void downloadMailsInbox(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper);
27 virtual bool currentisDraft(); 29 virtual bool currentisDraft();
28 QValueList<MHviewItem*> allAccounts() { return mhAccounts;} 30 Q3ValueList<MHviewItem*> allAccounts() { return mhAccounts;}
29public slots: 31public slots:
30 virtual void refreshAll(); 32 virtual void refreshAll();
31 virtual void refresh(QListViewItem *item); 33 virtual void refresh(Q3ListViewItem *item);
32 virtual void refreshCurrent(); 34 virtual void refreshCurrent();
33 virtual void refreshCurrentSelected(); 35 virtual void refreshCurrentSelected();
34 virtual void refreshOutgoing(); 36 virtual void refreshOutgoing();
35 virtual void slotHold(int, QListViewItem *,const QPoint&,int); 37 virtual void slotHold(int, Q3ListViewItem *,const QPoint&,int);
36 virtual void slotContextMenu(int id); 38 virtual void slotContextMenu(int id);
37 void setupFolderselect(Selectstore*sels); 39 void setupFolderselect(Selectstore*sels);
38 40
39signals: 41signals:
40 void refreshMailview(const QValueList<RecMailP>& ); 42 void refreshMailview(const Q3ValueList<RecMailP>& );
41 43
42protected: 44protected:
43 QListViewItem* m_currentItem; 45 Q3ListViewItem* m_currentItem;
44 QValueList<IMAPviewItem*> imapAccounts; 46 Q3ValueList<IMAPviewItem*> imapAccounts;
45 QValueList<MHviewItem*> mhAccounts; 47 Q3ValueList<MHviewItem*> mhAccounts;
46}; 48};
47 49
48#endif 50#endif
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index 4bc4441..81d7b52 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -29,32 +29,32 @@
29 29
30/* OPIE */ 30/* OPIE */
31//#include <opie2/ofiledialog.h> 31//#include <opie2/ofiledialog.h>
32//#include <opie2/odebug.h> 32//#include <opie2/odebug.h>
33#include <kfiledialog.h> 33#include <kfiledialog.h>
34//#include <qpe/resource.h> 34//#include <qpe/resource.h>
35#include <qpe/global.h> 35#include <qpe/global.h>
36//#include <qpe/contact.h> 36//#include <qpe/contact.h>
37 37
38 38
39#include <qcombobox.h> 39#include <qcombobox.h>
40#include <qcheckbox.h> 40#include <qcheckbox.h>
41#include <qiconset.h> 41#include <qicon.h>
42#include <qtimer.h> 42#include <qtimer.h>
43#include <qmessagebox.h> 43#include <qmessagebox.h>
44#include <qpushbutton.h> 44#include <qpushbutton.h>
45#include <qmultilineedit.h> 45#include <q3multilineedit.h>
46#include <qlabel.h> 46#include <qlabel.h>
47#include <qtabwidget.h> 47#include <qtabwidget.h>
48#include <qlistview.h> 48#include <q3listview.h>
49 49
50//using namespace Opie::Core; 50//using namespace Opie::Core;
51//using namespace Opie::Ui; 51//using namespace Opie::Ui;
52ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal ) 52ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal )
53 : ComposeMailUI( parent, name, modal ) 53 : ComposeMailUI( parent, name, modal )
54{ 54{
55 55
56 topLevelWidget()->setCaption( i18n("Compose mail - Click OK to send ->") ); 56 topLevelWidget()->setCaption( i18n("Compose mail - Click OK to send ->") );
57 mPickLineEdit = 0; 57 mPickLineEdit = 0;
58 mEncoding = KOPrefs::instance()->mCurrentCodeName; 58 mEncoding = KOPrefs::instance()->mCurrentCodeName;
59 //managed from opiemail now 59 //managed from opiemail now
60 //connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), 60 //connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
@@ -116,41 +116,41 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo
116 smtpAccounts.append( smtp ); 116 smtpAccounts.append( smtp );
117 } 117 }
118 } 118 }
119 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); 119 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) );
120 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); 120 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) );
121 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); 121 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) );
122 connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); 122 connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) );
123 connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); 123 connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) );
124 connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); 124 connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) );
125 connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); 125 connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) );
126 mMail = 0; 126 mMail = 0;
127 warnAttach = true; 127 warnAttach = true;
128 QIconSet icon; 128 QIcon icon;
129 //icon = SmallIcon("fileexport"); 129 //icon = SmallIcon("fileexport");
130 icon = SmallIcon("filesave"); 130 icon = SmallIcon("filesave");
131 SaveButton->setIconSet (icon ) ; 131 SaveButton->setIconSet (icon ) ;
132 if ( QApplication::desktop()->width() < 320 ) { 132 if ( QApplication::desktop()->width() < 320 ) {
133 SaveButton->setText ("") ; 133 SaveButton->setText ("") ;
134 SaveButton->setMaximumSize ( SaveButton->sizeHint().height(),SaveButton->sizeHint().height()) ; 134 SaveButton->setMaximumSize ( SaveButton->sizeHint().height(),SaveButton->sizeHint().height()) ;
135 } 135 }
136 else 136 else
137 SaveButton->setText (i18n("Save")); 137 SaveButton->setText (i18n("Save"));
138#ifndef DESKTOP_VERSION 138#ifndef DESKTOP_VERSION
139 QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold ); 139 QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold );
140 QPEApplication::setStylusOperation( senderNameEdit, QPEApplication::RightOnHold ); 140 QPEApplication::setStylusOperation( senderNameEdit, QPEApplication::RightOnHold );
141 QPEApplication::setStylusOperation( subjectLine, QPEApplication::RightOnHold ); 141 QPEApplication::setStylusOperation( subjectLine, QPEApplication::RightOnHold );
142#endif 142#endif
143 message->setFont ( KOPrefs::instance()->mComposeFont ); 143 message->setFont ( KOPrefs::instance()->mComposeFont );
144 message->setWordWrap (QMultiLineEdit::WidgetWidth); 144 message->setWordWrap (Q3MultiLineEdit::WidgetWidth);
145 if ( smtpAccounts.count() > 0 ) { 145 if ( smtpAccounts.count() > 0 ) {
146 fillValues( smtpAccountBox->currentItem() ); 146 fillValues( smtpAccountBox->currentItem() );
147 } else { 147 } else {
148 QMessageBox::information( 0, i18n( "Problem" ), 148 QMessageBox::information( 0, i18n( "Problem" ),
149 i18n( "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n" ), 149 i18n( "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n" ),
150 i18n( "Ok" ) ); 150 i18n( "Ok" ) );
151 return; 151 return;
152 } 152 }
153 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); 153 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) );
154 connect( SaveSigButton, SIGNAL( clicked() ), SLOT( saveSig()) ); 154 connect( SaveSigButton, SIGNAL( clicked() ), SLOT( saveSig()) );
155 if ( smtpAccountBox->count()) 155 if ( smtpAccountBox->count())
156 fillValues(0); 156 fillValues(0);
@@ -525,22 +525,22 @@ void ComposeMail::reEditMail(const RecMailP&current)
525 RecMailP data = current; 525 RecMailP data = current;
526 RecBodyP body = data->Wrapper()->fetchBody(current); 526 RecBodyP body = data->Wrapper()->fetchBody(current);
527 527
528 message->setText(body->Bodytext()); 528 message->setText(body->Bodytext());
529 subjectLine->setText( data->getSubject()); 529 subjectLine->setText( data->getSubject());
530 toLine->setText(data->To().join(",")); 530 toLine->setText(data->To().join(","));
531 ccLine->setText(data->CC().join(",")); 531 ccLine->setText(data->CC().join(","));
532 bccLine->setText(data->Bcc().join(",")); 532 bccLine->setText(data->Bcc().join(","));
533 replyLine->setText(data->Replyto()); 533 replyLine->setText(data->Replyto());
534 setCharset(body->getCharset()); 534 setCharset(body->getCharset());
535} 535}
536 536
537AttachViewItem::AttachViewItem( QListView *parent, Attachment *att ) 537AttachViewItem::AttachViewItem( Q3ListView *parent, Attachment *att )
538 : QListViewItem( parent ) 538 : Q3ListViewItem( parent )
539{ 539{
540 attachment = att; 540 attachment = att;
541 if ( !attachment->getPixmap().isNull() ) 541 if ( !attachment->getPixmap().isNull() )
542 setPixmap( 0,attachment->getPixmap() ); 542 setPixmap( 0,attachment->getPixmap() );
543 setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() ); 543 setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() );
544 setText( 1, QString::number( att->getSize() ) ); 544 setText( 1, QString::number( att->getSize() ) );
545} 545}
546 546
diff --git a/kmicromail/composemail.h b/kmicromail/composemail.h
index 966ac3e..9aef4e1 100644
--- a/kmicromail/composemail.h
+++ b/kmicromail/composemail.h
@@ -1,17 +1,17 @@
1#ifndef COMPOSEMAIL_H 1#ifndef COMPOSEMAIL_H
2#define COMPOSEMAIL_H 2#define COMPOSEMAIL_H
3 3
4#include <qlineedit.h> 4#include <qlineedit.h>
5#include <qlistview.h> 5#include <q3listview.h>
6 6
7#include "composemailui.h" 7#include "composemailui.h"
8//#include "addresspickerui.h" 8//#include "addresspickerui.h"
9#include <libmailwrapper/settings.h> 9#include <libmailwrapper/settings.h>
10#include <libmailwrapper/mailwrapper.h> 10#include <libmailwrapper/mailwrapper.h>
11 11
12class RecMail; 12class RecMail;
13 13
14#include <opie2/osmartpointer.h> 14#include <opie2/osmartpointer.h>
15#if 0 15#if 0
16class AddressPicker : public AddressPickerUI 16class AddressPicker : public AddressPickerUI
17{ 17{
@@ -71,24 +71,24 @@ private slots:
71 void saveSig(); 71 void saveSig();
72 72
73protected: 73protected:
74 QLineEdit* mPickLineEdit; 74 QLineEdit* mPickLineEdit;
75 Opie::Core::OSmartPointer<Mail> mMail; 75 Opie::Core::OSmartPointer<Mail> mMail;
76 Settings *settings; 76 Settings *settings;
77 QList<SMTPaccount> smtpAccounts; 77 QList<SMTPaccount> smtpAccounts;
78 QString m_replyid; 78 QString m_replyid;
79 QString mEncoding; 79 QString mEncoding;
80 bool warnAttach; 80 bool warnAttach;
81}; 81};
82 82
83class AttachViewItem : public QListViewItem 83class AttachViewItem : public Q3ListViewItem
84{ 84{
85public: 85public:
86 AttachViewItem( QListView *parent, Attachment *att ); 86 AttachViewItem( Q3ListView *parent, Attachment *att );
87 Attachment *getAttachment() { return attachment; } 87 Attachment *getAttachment() { return attachment; }
88 88
89private: 89private:
90 Attachment *attachment; 90 Attachment *attachment;
91 91
92}; 92};
93 93
94#endif 94#endif
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp
index 2c0f2d8..f274dc3 100644
--- a/kmicromail/editaccounts.cpp
+++ b/kmicromail/editaccounts.cpp
@@ -7,60 +7,60 @@
7#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
8 8
9/* QT */ 9/* QT */
10#include <qstringlist.h> 10#include <qstringlist.h>
11 11
12#include <qcombobox.h> 12#include <qcombobox.h>
13#include <qcheckbox.h> 13#include <qcheckbox.h>
14#include <qmessagebox.h> 14#include <qmessagebox.h>
15#include <qpushbutton.h> 15#include <qpushbutton.h>
16#include <qlineedit.h> 16#include <qlineedit.h>
17#include <qlabel.h> 17#include <qlabel.h>
18#include <qtabwidget.h> 18#include <qtabwidget.h>
19#include <qlistview.h> 19#include <q3listview.h>
20#include <qspinbox.h> 20#include <qspinbox.h>
21#include <klocale.h> 21#include <klocale.h>
22#include <kfiledialog.h> 22#include <kfiledialog.h>
23 23
24#include <libmailwrapper/nntpwrapper.h> 24#include <libmailwrapper/nntpwrapper.h>
25 25
26using namespace Opie::Core; 26using namespace Opie::Core;
27 27
28AccountListItem::AccountListItem( QListView *parent, Account *a) 28AccountListItem::AccountListItem( Q3ListView *parent, Account *a)
29 : QListViewItem( parent ) 29 : Q3ListViewItem( parent )
30{ 30{
31 account = a; 31 account = a;
32 setText( 0, account->getAccountName() ); 32 setText( 0, account->getAccountName() );
33 QString ttext = ""; 33 QString ttext = "";
34 switch (account->getType()) { 34 switch (account->getType()) {
35 case MAILLIB::A_NNTP: 35 case MAILLIB::A_NNTP:
36 ttext="NNTP"; 36 ttext="NNTP";
37 break; 37 break;
38 case MAILLIB::A_POP3: 38 case MAILLIB::A_POP3:
39 ttext = "POP3"; 39 ttext = "POP3";
40 break; 40 break;
41 case MAILLIB::A_IMAP: 41 case MAILLIB::A_IMAP:
42 ttext = "IMAP"; 42 ttext = "IMAP";
43 break; 43 break;
44 case MAILLIB::A_SMTP: 44 case MAILLIB::A_SMTP:
45 ttext = "SMTP"; 45 ttext = "SMTP";
46 break; 46 break;
47 default: 47 default:
48 ttext = "UNKNOWN"; 48 ttext = "UNKNOWN";
49 break; 49 break;
50 } 50 }
51 setText( 1, ttext); 51 setText( 1, ttext);
52} 52}
53 53
54EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 54EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, Qt::WFlags flags )
55 : EditAccountsUI( parent, name, modal, flags ) 55 : EditAccountsUI( parent, name, modal, flags )
56{ 56{
57 settings = s; 57 settings = s;
58 58
59 mailList->addColumn( i18n( "Account" ) ); 59 mailList->addColumn( i18n( "Account" ) );
60 mailList->addColumn( i18n( "Type" ) ); 60 mailList->addColumn( i18n( "Type" ) );
61 61
62 newsList->addColumn( i18n( "Account" ) ); 62 newsList->addColumn( i18n( "Account" ) );
63 63
64 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); 64 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) );
65 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); 65 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) );
66 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); 66 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) );
@@ -299,42 +299,42 @@ void EditAccounts::slotAdjustColumns()
299 299
300void EditAccounts::accept() 300void EditAccounts::accept()
301{ 301{
302 settings->saveAccounts(); 302 settings->saveAccounts();
303 303
304 QDialog::accept(); 304 QDialog::accept();
305} 305}
306 306
307/** 307/**
308 * SelectMailType 308 * SelectMailType
309 */ 309 */
310 310
311SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) 311SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, Qt::WFlags flags )
312 : SelectMailTypeUI( parent, name, modal, flags ) 312 : SelectMailTypeUI( parent, name, modal, flags )
313{ 313{
314 selected = selection; 314 selected = selection;
315 selected->replace( 0, selected->length(), typeBox->currentText() ); 315 selected->replace( 0, selected->length(), typeBox->currentText() );
316 connect( typeBox, SIGNAL( activated(const QString&) ), SLOT( slotSelection(const QString&) ) ); 316 connect( typeBox, SIGNAL( activated(const QString&) ), SLOT( slotSelection(const QString&) ) );
317} 317}
318 318
319void SelectMailType::slotSelection( const QString &sel ) 319void SelectMailType::slotSelection( const QString &sel )
320{ 320{
321 selected->replace( 0, selected->length(), sel ); 321 selected->replace( 0, selected->length(), sel );
322} 322}
323 323
324/** 324/**
325 * IMAPconfig 325 * IMAPconfig
326 */ 326 */
327 327
328IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 328IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags )
329 : IMAPconfigUI( parent, name, modal, flags ) 329 : IMAPconfigUI( parent, name, modal, flags )
330{ 330{
331 data = account; 331 data = account;
332 332
333 //fillValues(); 333 //fillValues();
334 334
335 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); 335 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
336 ComboBox1->insertItem( "Only if available", 0 ); 336 ComboBox1->insertItem( "Only if available", 0 );
337 ComboBox1->insertItem( "Always, Negotiated", 1 ); 337 ComboBox1->insertItem( "Always, Negotiated", 1 );
338 ComboBox1->insertItem( "Connect on secure port", 2 ); 338 ComboBox1->insertItem( "Connect on secure port", 2 );
339 ComboBox1->insertItem( "Run command instead", 3 ); 339 ComboBox1->insertItem( "Run command instead", 3 );
340 CommandEdit->hide(); 340 CommandEdit->hide();
@@ -399,25 +399,25 @@ void IMAPconfig::accept()
399 data->setPrefix(prefixLine->text()); 399 data->setPrefix(prefixLine->text());
400 data->setLocalFolder( localFolder->text() ); 400 data->setLocalFolder( localFolder->text() );
401 data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; 401 data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ;
402 data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); 402 data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() );
403 403
404 QDialog::accept(); 404 QDialog::accept();
405} 405}
406 406
407/** 407/**
408 * POP3config 408 * POP3config
409 */ 409 */
410 410
411POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 411POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags )
412 : POP3configUI( parent, name, modal, flags ) 412 : POP3configUI( parent, name, modal, flags )
413{ 413{
414 data = account; 414 data = account;
415 //fillValues(); 415 //fillValues();
416 416
417 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); 417 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
418 ComboBox1->insertItem( "Only if available", 0 ); 418 ComboBox1->insertItem( "Only if available", 0 );
419 ComboBox1->insertItem( "Always, Negotiated", 1 ); 419 ComboBox1->insertItem( "Always, Negotiated", 1 );
420 ComboBox1->insertItem( "Connect on secure port", 2 ); 420 ComboBox1->insertItem( "Connect on secure port", 2 );
421 ComboBox1->insertItem( "Run command instead", 3 ); 421 ComboBox1->insertItem( "Run command instead", 3 );
422 CommandEdit->hide(); 422 CommandEdit->hide();
423 fillValues(); 423 fillValues();
@@ -480,34 +480,34 @@ void POP3config::accept()
480 data->setPassword( passLine->text() ); 480 data->setPassword( passLine->text() );
481 data->setLocalFolder( localFolder->text() ); 481 data->setLocalFolder( localFolder->text() );
482 data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; 482 data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ;
483 data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); 483 data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() );
484 484
485 QDialog::accept(); 485 QDialog::accept();
486} 486}
487 487
488/** 488/**
489 * SMTPconfig 489 * SMTPconfig
490 */ 490 */
491 491
492SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 492SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags )
493 : SMTPconfigUI( parent, name, modal, flags ) 493 : SMTPconfigUI( parent, name, modal, flags )
494{ 494{
495 data = account; 495 data = account;
496 496
497 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); 497 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) );
498 connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); 498 connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) );
499 499
500 // fillValues(); 500 // fillValues();
501 QIconSet icon; 501 QIcon icon;
502 //icon = SmallIcon("fileexport"); 502 //icon = SmallIcon("fileexport");
503 icon = SmallIcon("fileopen"); 503 icon = SmallIcon("fileopen");
504 SignaturButton->setText(""); 504 SignaturButton->setText("");
505 SignaturButton->setIconSet (icon ) ; 505 SignaturButton->setIconSet (icon ) ;
506 SignaturButton->setMaximumSize ( SignaturButton->sizeHint().height()+4,SignaturButton->sizeHint().height()) ; 506 SignaturButton->setMaximumSize ( SignaturButton->sizeHint().height()+4,SignaturButton->sizeHint().height()) ;
507 connect( SignaturButton, SIGNAL( clicked() ), this, SLOT( chooseSig() ) ); 507 connect( SignaturButton, SIGNAL( clicked() ), this, SLOT( chooseSig() ) );
508 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); 508 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
509 ComboBox1->insertItem( "No secure connection, no TLS", 0 ); 509 ComboBox1->insertItem( "No secure connection, no TLS", 0 );
510 ComboBox1->insertItem( "Only if available, try TLS", 1 ); 510 ComboBox1->insertItem( "Only if available, try TLS", 1 );
511 ComboBox1->insertItem( "Always, use TLS", 2 ); 511 ComboBox1->insertItem( "Always, use TLS", 2 );
512 ComboBox1->insertItem( "Connect on secure port (SSL)", 3 ); 512 ComboBox1->insertItem( "Connect on secure port (SSL)", 3 );
513 ComboBox1->insertItem( "Run command instead", 4 ); 513 ComboBox1->insertItem( "Run command instead", 4 );
@@ -563,83 +563,83 @@ void SMTPconfig::accept()
563 data->setLogin( loginBox->isChecked() ); 563 data->setLogin( loginBox->isChecked() );
564 data->setUser( userLine->text() ); 564 data->setUser( userLine->text() );
565 data->setPassword( passLine->text() ); 565 data->setPassword( passLine->text() );
566 data->setSigFile( SignaturEdit->text() ); 566 data->setSigFile( SignaturEdit->text() );
567 567
568 QDialog::accept(); 568 QDialog::accept();
569} 569}
570 570
571/** 571/**
572 * NNTPconfig 572 * NNTPconfig
573 */ 573 */
574 574
575NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 575NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags )
576 : NNTPconfigUI( parent, name, modal, flags ) 576 : NNTPconfigUI( parent, name, modal, flags )
577{ 577{
578 data = account; 578 data = account;
579 579
580 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); 580 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) );
581 connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); 581 connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) );
582 connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) ); 582 connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) );
583 connect( ShowSubcribed, SIGNAL( clicked() ), this, SLOT( slotShowSub() ) ); 583 connect( ShowSubcribed, SIGNAL( clicked() ), this, SLOT( slotShowSub() ) );
584 connect( FilterButton, SIGNAL( clicked() ), this, SLOT( slotShowFilter() ) ); 584 connect( FilterButton, SIGNAL( clicked() ), this, SLOT( slotShowFilter() ) );
585 fillValues(); 585 fillValues();
586 586
587 connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); 587 connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) );
588} 588}
589 589
590void NNTPconfig::slotShowSub() 590void NNTPconfig::slotShowSub()
591{ 591{
592 save(); 592 save();
593 data->save(); 593 data->save();
594 ListViewGroups->clear(); 594 ListViewGroups->clear();
595 for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { 595 for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) {
596 QCheckListItem *item; 596 Q3CheckListItem *item;
597 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); 597 item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox );
598 item->setOn( true ); 598 item->setOn( true );
599 } 599 }
600 topLevelWidget()->setCaption( i18n("%1 groups subscribed").arg( subscribedGroups.count())); 600 topLevelWidget()->setCaption( i18n("%1 groups subscribed").arg( subscribedGroups.count()));
601} 601}
602void NNTPconfig::slotShowFilter() 602void NNTPconfig::slotShowFilter()
603{ 603{
604 save(); 604 save();
605 data->save(); 605 data->save();
606 ListViewGroups->clear(); 606 ListViewGroups->clear();
607 int count = 0; 607 int count = 0;
608 for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) { 608 for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) {
609 QCheckListItem *item; 609 Q3CheckListItem *item;
610 if ( GroupFilter->text().isEmpty() || (*it).find( GroupFilter->text() ) >= 0 ) { 610 if ( GroupFilter->text().isEmpty() || (*it).find( GroupFilter->text() ) >= 0 ) {
611 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); 611 item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox );
612 ++count; 612 ++count;
613 if ( subscribedGroups.contains( (*it) ) >= 1 ) { 613 if ( subscribedGroups.contains( (*it) ) >= 1 ) {
614 item->setOn( true ); 614 item->setOn( true );
615 } 615 }
616 } 616 }
617 } 617 }
618 topLevelWidget()->setCaption( i18n("Filter found %1 groups").arg( count)); 618 topLevelWidget()->setCaption( i18n("Filter found %1 groups").arg( count));
619} 619}
620void NNTPconfig::slotGetNG() { 620void NNTPconfig::slotGetNG() {
621 save(); 621 save();
622 data->save(); 622 data->save();
623 topLevelWidget()->setCaption( i18n("Fetching group list...")); 623 topLevelWidget()->setCaption( i18n("Fetching group list..."));
624 qApp->processEvents(); 624 qApp->processEvents();
625 NNTPwrapper* tmp = new NNTPwrapper( data ); 625 NNTPwrapper* tmp = new NNTPwrapper( data );
626 allGroups = tmp->listAllNewsgroups(); 626 allGroups = tmp->listAllNewsgroups();
627 topLevelWidget()->setCaption( i18n("Downloaded %1 group names").arg( allGroups.count())); 627 topLevelWidget()->setCaption( i18n("Downloaded %1 group names").arg( allGroups.count()));
628 628
629 ListViewGroups->clear(); 629 ListViewGroups->clear();
630 630
631 for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) { 631 for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) {
632 QCheckListItem *item; 632 Q3CheckListItem *item;
633 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); 633 item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox );
634 if ( subscribedGroups.contains( (*it) ) >= 1 ) { 634 if ( subscribedGroups.contains( (*it) ) >= 1 ) {
635 item->setOn( true ); 635 item->setOn( true );
636 636
637 } 637 }
638 } 638 }
639 delete tmp; 639 delete tmp;
640} 640}
641 641
642void NNTPconfig::slotSSL( bool enabled ) 642void NNTPconfig::slotSSL( bool enabled )
643{ 643{
644 if ( enabled ) 644 if ( enabled )
645 { 645 {
@@ -654,45 +654,45 @@ void NNTPconfig::slotSSL( bool enabled )
654void NNTPconfig::fillValues() 654void NNTPconfig::fillValues()
655{ 655{
656 accountLine->setText( data->getAccountName() ); 656 accountLine->setText( data->getAccountName() );
657 serverLine->setText( data->getServer() ); 657 serverLine->setText( data->getServer() );
658 portLine->setText( data->getPort() ); 658 portLine->setText( data->getPort() );
659 sslBox->setChecked( data->getSSL() ); 659 sslBox->setChecked( data->getSSL() );
660 loginBox->setChecked( data->getLogin() ); 660 loginBox->setChecked( data->getLogin() );
661 userLine->setText( data->getUser() ); 661 userLine->setText( data->getUser() );
662 passLine->setText( data->getPassword() ); 662 passLine->setText( data->getPassword() );
663 subscribedGroups = data->getGroups(); 663 subscribedGroups = data->getGroups();
664 /* don't forget that - you will overwrite values if user clicks cancel! */ 664 /* don't forget that - you will overwrite values if user clicks cancel! */
665 for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { 665 for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) {
666 QCheckListItem *item; 666 Q3CheckListItem *item;
667 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); 667 item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox );
668 item->setOn( true ); 668 item->setOn( true );
669 } 669 }
670} 670}
671 671
672void NNTPconfig::save() 672void NNTPconfig::save()
673{ 673{
674 data->setAccountName( accountLine->text() ); 674 data->setAccountName( accountLine->text() );
675 data->setServer( serverLine->text() ); 675 data->setServer( serverLine->text() );
676 data->setPort( portLine->text() ); 676 data->setPort( portLine->text() );
677 data->setSSL( sslBox->isChecked() ); 677 data->setSSL( sslBox->isChecked() );
678 data->setLogin( loginBox->isChecked() ); 678 data->setLogin( loginBox->isChecked() );
679 data->setUser( userLine->text() ); 679 data->setUser( userLine->text() );
680 data->setPassword( passLine->text() ); 680 data->setPassword( passLine->text() );
681 681
682 QListViewItemIterator list_it( ListViewGroups ); 682 Q3ListViewItemIterator list_it( ListViewGroups );
683 683
684 for ( ; list_it.current(); ++list_it ) { 684 for ( ; list_it.current(); ++list_it ) {
685 685
686 if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { 686 if ( ( (Q3CheckListItem*)list_it.current() )->isOn() ) {
687 if ( subscribedGroups.contains( list_it.current()->text(0) ) < 1 ) 687 if ( subscribedGroups.contains( list_it.current()->text(0) ) < 1 )
688 subscribedGroups.append( list_it.current()->text(0) ); 688 subscribedGroups.append( list_it.current()->text(0) );
689 } else { 689 } else {
690 if ( subscribedGroups.contains( list_it.current()->text(0) ) >= 1 ) 690 if ( subscribedGroups.contains( list_it.current()->text(0) ) >= 1 )
691 subscribedGroups.remove( list_it.current()->text(0) ); 691 subscribedGroups.remove( list_it.current()->text(0) );
692 } 692 }
693 693
694 } 694 }
695 data->setGroups( subscribedGroups ); 695 data->setGroups( subscribedGroups );
696} 696}
697 697
698void NNTPconfig::accept() 698void NNTPconfig::accept()
diff --git a/kmicromail/editaccounts.h b/kmicromail/editaccounts.h
index 465780c..3d01d23 100644
--- a/kmicromail/editaccounts.h
+++ b/kmicromail/editaccounts.h
@@ -1,47 +1,47 @@
1#ifndef EDITACCOUNTS_H 1#ifndef EDITACCOUNTS_H
2#define EDITACCOUNTS_H 2#define EDITACCOUNTS_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5#include <qlistview.h> 5#include <q3listview.h>
6 6
7#include "editaccountsui.h" 7#include "editaccountsui.h"
8#include "selectmailtypeui.h" 8#include "selectmailtypeui.h"
9#include "imapconfigui.h" 9#include "imapconfigui.h"
10#include "pop3configui.h" 10#include "pop3configui.h"
11#include "smtpconfigui.h" 11#include "smtpconfigui.h"
12#include "nntpconfigui.h" 12#include "nntpconfigui.h"
13 13
14#include <libetpan/clist.h> 14#include <libetpan/clist.h>
15#include <libmailwrapper/settings.h> 15#include <libmailwrapper/settings.h>
16 16
17 17
18class AccountListItem : public QListViewItem 18class AccountListItem : public Q3ListViewItem
19{ 19{
20 20
21public: 21public:
22 AccountListItem( QListView *parent, Account *a); 22 AccountListItem( Q3ListView *parent, Account *a);
23 Account *getAccount() { return account; } 23 Account *getAccount() { return account; }
24 24
25private: 25private:
26 Account *account; 26 Account *account;
27 27
28}; 28};
29 29
30class EditAccounts : public EditAccountsUI 30class EditAccounts : public EditAccountsUI
31{ 31{
32 Q_OBJECT 32 Q_OBJECT
33 33
34public: 34public:
35 EditAccounts( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 35 EditAccounts( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 );
36 36
37public slots: 37public slots:
38 void slotNewAccount( const QString &type ); 38 void slotNewAccount( const QString &type );
39 void slotEditAccount( Account *account ); 39 void slotEditAccount( Account *account );
40 void slotDeleteAccount( Account * account ); 40 void slotDeleteAccount( Account * account );
41 void slotAdjustColumns(); 41 void slotAdjustColumns();
42 42
43protected slots: 43protected slots:
44 void slotFillLists(); 44 void slotFillLists();
45 void slotNewMail(); 45 void slotNewMail();
46 void slotEditMail(); 46 void slotEditMail();
47 void slotDeleteMail(); 47 void slotDeleteMail();
@@ -51,98 +51,98 @@ protected slots:
51 void accept(); 51 void accept();
52 52
53private: 53private:
54 Settings *settings; 54 Settings *settings;
55 55
56}; 56};
57 57
58class SelectMailType : public SelectMailTypeUI 58class SelectMailType : public SelectMailTypeUI
59{ 59{
60 Q_OBJECT 60 Q_OBJECT
61 61
62public: 62public:
63 SelectMailType( QString *selection = 0, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 63 SelectMailType( QString *selection = 0, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 );
64 64
65private slots: 65private slots:
66 void slotSelection( const QString &sel ); 66 void slotSelection( const QString &sel );
67 67
68private: 68private:
69 QString *selected; 69 QString *selected;
70 70
71}; 71};
72 72
73class IMAPconfig : public IMAPconfigUI 73class IMAPconfig : public IMAPconfigUI
74{ 74{
75 Q_OBJECT 75 Q_OBJECT
76 76
77public: 77public:
78 IMAPconfig( IMAPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 78 IMAPconfig( IMAPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 );
79 79
80public slots: 80public slots:
81 void fillValues(); 81 void fillValues();
82 82
83protected slots: 83protected slots:
84 void slotConnectionToggle( int index ); 84 void slotConnectionToggle( int index );
85 void accept(); 85 void accept();
86 86
87private: 87private:
88 IMAPaccount *data; 88 IMAPaccount *data;
89 89
90}; 90};
91 91
92class POP3config : public POP3configUI 92class POP3config : public POP3configUI
93{ 93{
94 Q_OBJECT 94 Q_OBJECT
95 95
96public: 96public:
97 POP3config( POP3account *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 97 POP3config( POP3account *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 );
98 98
99public slots: 99public slots:
100 void fillValues(); 100 void fillValues();
101 101
102protected slots: 102protected slots:
103 void slotConnectionToggle( int index ); 103 void slotConnectionToggle( int index );
104 void accept(); 104 void accept();
105 105
106private: 106private:
107 POP3account *data; 107 POP3account *data;
108 108
109}; 109};
110 110
111class SMTPconfig : public SMTPconfigUI 111class SMTPconfig : public SMTPconfigUI
112{ 112{
113 Q_OBJECT 113 Q_OBJECT
114 114
115public: 115public:
116 SMTPconfig( SMTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 116 SMTPconfig( SMTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 );
117 117
118public slots: 118public slots:
119 void fillValues(); 119 void fillValues();
120 120
121protected slots: 121protected slots:
122 void slotConnectionToggle( int index ); 122 void slotConnectionToggle( int index );
123 void accept(); 123 void accept();
124 void chooseSig(); 124 void chooseSig();
125 125
126private: 126private:
127 SMTPaccount *data; 127 SMTPaccount *data;
128 128
129}; 129};
130 130
131class NNTPconfig : public NNTPconfigUI 131class NNTPconfig : public NNTPconfigUI
132{ 132{
133 Q_OBJECT 133 Q_OBJECT
134 134
135public: 135public:
136 NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 136 NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 );
137 137
138public slots: 138public slots:
139 void fillValues(); 139 void fillValues();
140 140
141protected slots: 141protected slots:
142 void slotSSL( bool enabled ); 142 void slotSSL( bool enabled );
143 void accept(); 143 void accept();
144 void slotGetNG(); 144 void slotGetNG();
145 void slotShowSub(); 145 void slotShowSub();
146 void slotShowFilter(); 146 void slotShowFilter();
147 147
148private: 148private:
diff --git a/kmicromail/kmicromail.pro b/kmicromail/kmicromail.pro
index 9f4d4bd..ce30bbf 100644
--- a/kmicromail/kmicromail.pro
+++ b/kmicromail/kmicromail.pro
@@ -32,47 +32,53 @@ SOURCES = main.cpp \
32 viewmailbase.cpp \ 32 viewmailbase.cpp \
33 mailistviewitem.cpp \ 33 mailistviewitem.cpp \
34 settingsdialog.cpp \ 34 settingsdialog.cpp \
35 statuswidget.cpp \ 35 statuswidget.cpp \
36 newmaildir.cpp \ 36 newmaildir.cpp \
37 selectstore.cpp \ 37 selectstore.cpp \
38 selectsmtp.cpp \ 38 selectsmtp.cpp \
39 nntpgroups.cpp \ 39 nntpgroups.cpp \
40 koprefs.cpp\ 40 koprefs.cpp\
41 koprefsdialog.cpp\ 41 koprefsdialog.cpp\
42 nntpgroupsdlg.cpp 42 nntpgroupsdlg.cpp
43 43
44INTERFACES = editaccountsui.ui \ 44#The following line was changed from INTERFACES to FORMS3 by qt3to4
45FORMS3 = editaccountsui.ui \
45 selectmailtypeui.ui \ 46 selectmailtypeui.ui \
46 imapconfigui.ui \ 47 imapconfigui.ui \
47 pop3configui.ui \ 48 pop3configui.ui \
48 nntpconfigui.ui \ 49 nntpconfigui.ui \
49 smtpconfigui.ui \ 50 smtpconfigui.ui \
50 composemailui.ui \ 51 composemailui.ui \
51 settingsdialogui.ui \ 52 settingsdialogui.ui \
52 statuswidgetui.ui \ 53 statuswidgetui.ui \
53 newmaildirui.ui \ 54 newmaildirui.ui \
54 selectstoreui.ui \ 55 selectstoreui.ui \
55 nntpgroupsui.ui 56 nntpgroupsui.ui
56 57
57 58
58INCLUDEPATH += ./qpe . .. ../libkdepim ../microkde ../microkde/kdecore ../libetpan/include ../microkde/kdeui 59INCLUDEPATH += ./qpe . .. ../libkdepim ../microkde ../microkde/kdecore ../libetpan/include ../microkde/kdeui
59LIBS += -L../bin -lmicromailwrapper -lmicrolibetpan -lmicrokde -lssl -lcrypto -lmicrokdepim -lmicrokabc -lpthread 60LIBS += -L../bin -lmicromailwrapper -lxmicrolibetpan -lxmicrokde -lssl -lcrypto -lxmicrokdepim -lxmicrokabc -lpthread
60 61
61DESTDIR= ../bin 62DESTDIR= ../bin
62TARGET = ompi 63TARGET = ompi
63 64
64DEFINES += DESKTOP_VERSION 65DEFINES += DESKTOP_VERSION
65unix : { 66unix : {
66OBJECTS_DIR = obj/unix 67OBJECTS_DIR = obj/unix
67MOC_DIR = moc/unix 68MOC_DIR = moc/unix
68} 69}
69win32: { 70win32: {
70DEFINES += _WIN32_ 71DEFINES += _WIN32_
71LIBS += mfc71u.lib 72LIBS += mfc71u.lib
72QMAKE_LINK += /NODEFAULTLIB:LIBC 73QMAKE_LINK += /NODEFAULTLIB:LIBC
73#QMAKE_LINK += /NODEFAULTLIB:MSVCRT 74#QMAKE_LINK += /NODEFAULTLIB:MSVCRT
74#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib 75#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib
75OBJECTS_DIR = obj/win 76OBJECTS_DIR = obj/win
76MOC_DIR = moc/win 77MOC_DIR = moc/win
77} 78}
78 79
80#The following line was inserted by qt3to4
81QT += xml qt3support
82#The following line was inserted by qt3to4
83CONFIG += uic3
84
diff --git a/kmicromail/kmicromailE.pro b/kmicromail/kmicromailE.pro
index a5a51f7..19fa398 100644
--- a/kmicromail/kmicromailE.pro
+++ b/kmicromail/kmicromailE.pro
@@ -46,25 +46,25 @@ INTERFACES = editaccountsui.ui \
46 pop3configui.ui \ 46 pop3configui.ui \
47 nntpconfigui.ui \ 47 nntpconfigui.ui \
48 smtpconfigui.ui \ 48 smtpconfigui.ui \
49 composemailui.ui \ 49 composemailui.ui \
50 settingsdialogui.ui \ 50 settingsdialogui.ui \
51 statuswidgetui.ui \ 51 statuswidgetui.ui \
52 newmaildirui.ui \ 52 newmaildirui.ui \
53 selectstoreui.ui \ 53 selectstoreui.ui \
54 nntpgroupsui.ui 54 nntpgroupsui.ui
55 55
56 56
57INCLUDEPATH += $(QPEDIR)/include . $(KDEPIMDIR) $(KDEPIMDIR)/libkdepim $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/libetpan/include $(KDEPIMDIR)/microkde/kdeui 57INCLUDEPATH += $(QPEDIR)/include . $(KDEPIMDIR) $(KDEPIMDIR)/libkdepim $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/libetpan/include $(KDEPIMDIR)/microkde/kdeui
58LIBS += -L$(QPEDIR)/lib -lmicromailwrapper -lqpe -lmicrolibetpan -lmicrokde -lmicroqtcompat -lssl -lcrypto -ljpeg -lmicrokdepim -lpthread 58LIBS += -L$(QPEDIR)/lib -lmicromailwrapper -lqpe -lxmicrolibetpan -lxmicrokde -lmicroqtcompat -lssl -lcrypto -ljpeg -lxmicrokdepim -lpthread
59LIBS += $(QTOPIALIB) 59LIBS += $(QTOPIALIB)
60#LIBS += -lqtopia 60#LIBS += -lqtopia
61#next line for Zaurus only 61#next line for Zaurus only
62#LIBS += -luuid 62#LIBS += -luuid
63 63
64LIBS += $(GCC3EXTRALIB1) 64LIBS += $(GCC3EXTRALIB1)
65LIBS += $(GCC3EXTRALIB2) 65LIBS += $(GCC3EXTRALIB2)
66# 66#
67OBJECTS_DIR = obj/$(PLATFORM) 67OBJECTS_DIR = obj/$(PLATFORM)
68MOC_DIR = moc/$(PLATFORM) 68MOC_DIR = moc/$(PLATFORM)
69DESTDIR=$(QPEDIR)/bin 69DESTDIR=$(QPEDIR)/bin
70TARGET = ompi 70TARGET = ompi
diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp
index e4b61dc..e2eed9a 100644
--- a/kmicromail/koprefs.cpp
+++ b/kmicromail/koprefs.cpp
@@ -17,25 +17,25 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <q3textstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <klocale.h> 40#include <klocale.h>
41#include <kdebug.h> 41#include <kdebug.h>
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp
index 017f1f7..e3102a4 100644
--- a/kmicromail/koprefsdialog.cpp
+++ b/kmicromail/koprefsdialog.cpp
@@ -14,42 +14,47 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#include <kdialog.h> 23#include <kdialog.h>
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <q3groupbox.h>
27#include <qbuttongroup.h> 27#include <q3buttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <q3textstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <q3vbox.h>
35#include <qhbox.h> 35#include <q3hbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <q3strlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44//Added by qt3to4:
45#include <Q3HBoxLayout>
46#include <Q3GridLayout>
47#include <QPixmap>
48#include <Q3Frame>
44 49
45#include <kcolorbutton.h> 50#include <kcolorbutton.h>
46#include <kdebug.h> 51#include <kdebug.h>
47#include <klocale.h> 52#include <klocale.h>
48#include <kglobal.h> 53#include <kglobal.h>
49#include <kfontdialog.h> 54#include <kfontdialog.h>
50#include <kfiledialog.h> 55#include <kfiledialog.h>
51#include <kmessagebox.h> 56#include <kmessagebox.h>
52#include <kcolordialog.h> 57#include <kcolordialog.h>
53#include <kiconloader.h> 58#include <kiconloader.h>
54#include <kemailsettings.h> 59#include <kemailsettings.h>
55#include <kstandarddirs.h> 60#include <kstandarddirs.h>
@@ -102,52 +107,52 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
102 107
103KOPrefsDialog::~KOPrefsDialog() 108KOPrefsDialog::~KOPrefsDialog()
104{ 109{
105} 110}
106void KOPrefsDialog::setupGlobalTab() 111void KOPrefsDialog::setupGlobalTab()
107{ 112{
108 113
109 114
110 115
111} 116}
112void KOPrefsDialog::setupMainTab() 117void KOPrefsDialog::setupMainTab()
113{ 118{
114 QFrame *topFrame = addPage(i18n("General"),0,0); 119 Q3Frame *topFrame = addPage(i18n("General"),0,0);
115 120
116 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 121 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2);
117 topLayout->setSpacing(spacingHint()); 122 topLayout->setSpacing(spacingHint());
118 topLayout->setMargin(marginHint()); 123 topLayout->setMargin(marginHint());
119 124
120 125
121 mNameEdit = new QLineEdit(topFrame); 126 mNameEdit = new QLineEdit(topFrame);
122 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 127 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
123 topLayout->addWidget(mNameLabel,0,0); 128 topLayout->addWidget(mNameLabel,0,0);
124 topLayout->addWidget(mNameEdit,0,1); 129 topLayout->addWidget(mNameEdit,0,1);
125 130
126 mEmailEdit = new QLineEdit(topFrame); 131 mEmailEdit = new QLineEdit(topFrame);
127 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 132 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
128 topLayout->addWidget(mEmailLabel,1,0); 133 topLayout->addWidget(mEmailLabel,1,0);
129 topLayout->addWidget(mEmailEdit,1,1); 134 topLayout->addWidget(mEmailEdit,1,1);
130 QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); 135 QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame);
131 topLayout->addMultiCellWidget(lab,2,2,0,1); 136 topLayout->addMultiCellWidget(lab,2,2,0,1);
132 KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), 137 KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"),
133 &(KOPrefs::instance()->mUseKapi),topFrame); 138 &(KOPrefs::instance()->mUseKapi),topFrame);
134 topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); 139 topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1);
135} 140}
136 141
137void KOPrefsDialog::setupMailTab() 142void KOPrefsDialog::setupMailTab()
138{ 143{
139 QFrame *topFrame = addPage(i18n("Mail"),0,0); 144 Q3Frame *topFrame = addPage(i18n("Mail"),0,0);
140 145
141 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 146 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2);
142 topLayout->setSpacing(spacingHint()); 147 topLayout->setSpacing(spacingHint());
143 topLayout->setMargin(marginHint()); 148 topLayout->setMargin(marginHint());
144 149
145 KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), 150 KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"),
146 &(KOPrefs::instance()->mViewAsHtml),topFrame); 151 &(KOPrefs::instance()->mViewAsHtml),topFrame);
147 topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); 152 topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1);
148 153
149 154
150 ttt = addWidBool(i18n("Send mails later"), 155 ttt = addWidBool(i18n("Send mails later"),
151 &(KOPrefs::instance()->mSendLater),topFrame); 156 &(KOPrefs::instance()->mSendLater),topFrame);
152 topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); 157 topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1);
153 ttt = addWidBool(i18n("Show \"To\" field in list view"), 158 ttt = addWidBool(i18n("Show \"To\" field in list view"),
@@ -173,28 +178,28 @@ void KOPrefsDialog::setupMailTab()
173 ++iii; 178 ++iii;
174 179
175 /* 180 /*
176 mCodecEdit = new QLineEdit(topFrame); 181 mCodecEdit = new QLineEdit(topFrame);
177 topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); 182 topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1);
178 topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); 183 topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1);
179 topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); 184 topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1);
180 */ 185 */
181} 186}
182void KOPrefsDialog::setupFontsTab() 187void KOPrefsDialog::setupFontsTab()
183{ 188{
184 189
185 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 190 Q3Frame *topFrame = addPage(i18n("Fonts"),0,0);
186 // DesktopIcon("fonts",KIcon::SizeMedium)); 191 // DesktopIcon("fonts",KIcon::SizeMedium));
187 192
188 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 193 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,7,3);
189 topLayout->setSpacing(1); 194 topLayout->setSpacing(1);
190 topLayout->setMargin(3); 195 topLayout->setMargin(3);
191 KPrefsDialogWidFont * tVFont; 196 KPrefsDialogWidFont * tVFont;
192 int i = 0; 197 int i = 0;
193 KPrefsDialogWidFont *timeLabelsFont = 198 KPrefsDialogWidFont *timeLabelsFont =
194 addWidFont(i18n("OK"),i18n("Application(nr)"), 199 addWidFont(i18n("OK"),i18n("Application(nr)"),
195 &(KOPrefs::instance()->mAppFont),topFrame); 200 &(KOPrefs::instance()->mAppFont),topFrame);
196 topLayout->addWidget(timeLabelsFont->label(),i,0); 201 topLayout->addWidget(timeLabelsFont->label(),i,0);
197 topLayout->addWidget(timeLabelsFont->preview(),i,1); 202 topLayout->addWidget(timeLabelsFont->preview(),i,1);
198 topLayout->addWidget(timeLabelsFont->button(),i,2); 203 topLayout->addWidget(timeLabelsFont->button(),i,2);
199 ++i; 204 ++i;
200 205
@@ -229,26 +234,26 @@ void KOPrefsDialog::usrReadConfig()
229void KOPrefsDialog::usrWriteConfig() 234void KOPrefsDialog::usrWriteConfig()
230{ 235{
231 KOPrefs::instance()->mName = mNameEdit->text(); 236 KOPrefs::instance()->mName = mNameEdit->text();
232 KOPrefs::instance()->mEmail = mEmailEdit->text(); 237 KOPrefs::instance()->mEmail = mEmailEdit->text();
233 //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); 238 //KOPrefs::instance()->mSendCodec = mCodecEdit->text();
234 239
235 240
236} 241}
237 242
238#if 0 243#if 0
239void KOPrefsDialog::setupLocaleDateTab() 244void KOPrefsDialog::setupLocaleDateTab()
240{ 245{
241QFrame *topFrame = addPage(i18n("Date Format"),0,0); 246Q3Frame *topFrame = addPage(i18n("Date Format"),0,0);
242 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 247 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,2);
243 topLayout->setSpacing(spacingHint()); 248 topLayout->setSpacing(spacingHint());
244 topLayout->setMargin(marginHint()); 249 topLayout->setMargin(marginHint());
245 int iii = 0; 250 int iii = 0;
246 251
247 252
248 KPrefsWidRadios *syncPrefsGroup = 253 KPrefsWidRadios *syncPrefsGroup =
249 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 254 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
250 QString format; 255 QString format;
251 if ( QApplication::desktop()->width() < 480 ) 256 if ( QApplication::desktop()->width() < 480 )
252 format = "(%d.%m.%Y)"; 257 format = "(%d.%m.%Y)";
253 else 258 else
254 format = "(%d.%m.%Y|%A %d %B %Y)"; 259 format = "(%d.%m.%Y|%A %d %B %Y)";
@@ -283,26 +288,26 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0);
283 ++iii; 288 ++iii;
284 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 289 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
285 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 290 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
286 ++iii; 291 ++iii;
287 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 292 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
288 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 293 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
289 ++iii; 294 ++iii;
290 295
291} 296}
292 297
293void KOPrefsDialog::setupLocaleTab() 298void KOPrefsDialog::setupLocaleTab()
294{ 299{
295 QFrame *topFrame = addPage(i18n("Locale"),0,0); 300 Q3Frame *topFrame = addPage(i18n("Locale"),0,0);
296 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 301 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2);
297 topLayout->setSpacing(spacingHint()); 302 topLayout->setSpacing(spacingHint());
298 topLayout->setMargin(marginHint()); 303 topLayout->setMargin(marginHint());
299 int iii = 0; 304 int iii = 0;
300 KPrefsWidRadios *syncPrefsGroup = 305 KPrefsWidRadios *syncPrefsGroup =
301 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 306 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
302 syncPrefsGroup->addRadio(i18n("English")); 307 syncPrefsGroup->addRadio(i18n("English"));
303 syncPrefsGroup->addRadio(i18n("German")); 308 syncPrefsGroup->addRadio(i18n("German"));
304 syncPrefsGroup->addRadio(i18n("French")); 309 syncPrefsGroup->addRadio(i18n("French"));
305 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 310 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
306 if ( QApplication::desktop()->width() < 300 ) 311 if ( QApplication::desktop()->width() < 300 )
307 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 312 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
308 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 313 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
@@ -322,25 +327,25 @@ void KOPrefsDialog::setupLocaleTab()
322 sb = 327 sb =
323 addWidBool(i18n("Week starts on Sunday"), 328 addWidBool(i18n("Week starts on Sunday"),
324 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 329 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
325 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 330 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
326 ++iii; 331 ++iii;
327 sb = 332 sb =
328 addWidBool(i18n("Use short date in (WN/E) view"), 333 addWidBool(i18n("Use short date in (WN/E) view"),
329 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 334 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
330 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 335 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
331 } 336 }
332 else { 337 else {
333 QWidget * hb = new QWidget( topFrame ); 338 QWidget * hb = new QWidget( topFrame );
334 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 339 Q3HBoxLayout *hbLayout = new Q3HBoxLayout(hb);
335 sb = 340 sb =
336 addWidBool(i18n("Week starts on Sunday"), 341 addWidBool(i18n("Week starts on Sunday"),
337 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 342 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
338 hbLayout->addWidget(sb->checkBox() ); 343 hbLayout->addWidget(sb->checkBox() );
339 sb = 344 sb =
340 addWidBool(i18n("Use short date in (WN/E) view"), 345 addWidBool(i18n("Use short date in (WN/E) view"),
341 &(KOPrefs::instance()->mShortDateInViewer),hb); 346 &(KOPrefs::instance()->mShortDateInViewer),hb);
342 hbLayout->addWidget(sb->checkBox() ); 347 hbLayout->addWidget(sb->checkBox() );
343 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 348 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
344 349
345 } 350 }
346 //#ifndef DESKTOP_VERSION 351 //#ifndef DESKTOP_VERSION
@@ -352,27 +357,27 @@ void KOPrefsDialog::setupLocaleTab()
352 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 357 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
353#endif 358#endif
354} 359}
355void KOPrefsDialog::showSyncPage() 360void KOPrefsDialog::showSyncPage()
356{ 361{
357 showPage ( 2 ) ; 362 showPage ( 2 ) ;
358 363
359} 364}
360void KOPrefsDialog::setupSyncAlgTab() 365void KOPrefsDialog::setupSyncAlgTab()
361{ 366{
362#if 0 367#if 0
363 QLabel * lab; 368 QLabel * lab;
364 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); 369 Q3Frame *topFrame = addPage(i18n("Sync Prefs"),0,0);
365 mSetupSyncAlgTab = topFrame; 370 mSetupSyncAlgTab = topFrame;
366 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 371 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2);
367 topLayout->setSpacing(spacingHint()); 372 topLayout->setSpacing(spacingHint());
368 topLayout->setMargin(marginHint()); 373 topLayout->setMargin(marginHint());
369 int iii = 0; 374 int iii = 0;
370 375
371 KPrefsDialogWidBool *sb = 376 KPrefsDialogWidBool *sb =
372 addWidBool(i18n("Ask for preferences before syncing"), 377 addWidBool(i18n("Ask for preferences before syncing"),
373 &(KOPrefs::instance()->mAskForPreferences),topFrame); 378 &(KOPrefs::instance()->mAskForPreferences),topFrame);
374 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 379 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
375 380
376 ++iii; 381 ++iii;
377 382
378 KPrefsWidRadios *syncPrefsGroup = 383 KPrefsWidRadios *syncPrefsGroup =
@@ -394,26 +399,26 @@ void KOPrefsDialog::setupSyncAlgTab()
394 ++iii; 399 ++iii;
395#endif 400#endif
396 401
397 402
398 403
399} 404}
400 405
401 406
402void KOPrefsDialog::setupSyncTab() 407void KOPrefsDialog::setupSyncTab()
403{ 408{
404#if 0 409#if 0
405 QLabel * lab; 410 QLabel * lab;
406 QFrame *topFrame = addPage(i18n("Sync Network"),0,0); 411 Q3Frame *topFrame = addPage(i18n("Sync Network"),0,0);
407 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 412 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2);
408 topLayout->setSpacing(spacingHint()); 413 topLayout->setSpacing(spacingHint());
409 topLayout->setMargin(marginHint()); 414 topLayout->setMargin(marginHint());
410 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); 415 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame);
411 int iii = 0; 416 int iii = 0;
412 topLayout->addMultiCellWidget(lab , iii,iii,0,1); 417 topLayout->addMultiCellWidget(lab , iii,iii,0,1);
413 ++iii; 418 ++iii;
414 419
415 mRemoteIPEdit = new QLineEdit(topFrame); 420 mRemoteIPEdit = new QLineEdit(topFrame);
416 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); 421 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame);
417 topLayout->addWidget(lab ,iii,0); 422 topLayout->addWidget(lab ,iii,0);
418 topLayout->addWidget(mRemoteIPEdit,iii,1); 423 topLayout->addWidget(mRemoteIPEdit,iii,1);
419 ++iii; 424 ++iii;
@@ -442,103 +447,103 @@ void KOPrefsDialog::setupSyncTab()
442 ++iii; 447 ++iii;
443 wb = 448 wb =
444 addWidBool(i18n("Write back existing entries only"), 449 addWidBool(i18n("Write back existing entries only"),
445 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); 450 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame);
446 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 451 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
447 ++iii; 452 ++iii;
448 453
449#endif 454#endif
450} 455}
451 456
452void KOPrefsDialog::setupMainTab() 457void KOPrefsDialog::setupMainTab()
453{ 458{
454 QFrame *topFrame = addPage(i18n("General"),0,0); 459 Q3Frame *topFrame = addPage(i18n("General"),0,0);
455 // DesktopIcon("identity",KIcon::SizeMedium)); 460 // DesktopIcon("identity",KIcon::SizeMedium));
456 461
457 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 462 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2);
458 topLayout->setSpacing(spacingHint()); 463 topLayout->setSpacing(spacingHint());
459 topLayout->setMargin(marginHint()); 464 topLayout->setMargin(marginHint());
460 465
461 // KPrefsDialogWidBool *emailControlCenter = 466 // KPrefsDialogWidBool *emailControlCenter =
462// addWidBool(i18n("&Use email settings from Control Center"), 467// addWidBool(i18n("&Use email settings from Control Center"),
463// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 468// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
464// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 469// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
465 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 470 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
466 // SLOT(toggleEmailSettings(bool))); 471 // SLOT(toggleEmailSettings(bool)));
467 472
468 mNameEdit = new QLineEdit(topFrame); 473 mNameEdit = new QLineEdit(topFrame);
469 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 474 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
470 topLayout->addWidget(mNameLabel,0,0); 475 topLayout->addWidget(mNameLabel,0,0);
471 topLayout->addWidget(mNameEdit,0,1); 476 topLayout->addWidget(mNameEdit,0,1);
472 477
473 mEmailEdit = new QLineEdit(topFrame); 478 mEmailEdit = new QLineEdit(topFrame);
474 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 479 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
475 topLayout->addWidget(mEmailLabel,1,0); 480 topLayout->addWidget(mEmailLabel,1,0);
476 topLayout->addWidget(mEmailEdit,1,1); 481 topLayout->addWidget(mEmailEdit,1,1);
477 KPrefsDialogWidBool *wb; 482 KPrefsDialogWidBool *wb;
478 QHBox *dummy; 483 Q3HBox *dummy;
479 if ( QApplication::desktop()->width() > 480 ) { 484 if ( QApplication::desktop()->width() > 480 ) {
480 dummy = new QHBox(topFrame); 485 dummy = new Q3HBox(topFrame);
481 } else { 486 } else {
482 dummy = new QVBox(topFrame); 487 dummy = new Q3VBox(topFrame);
483 } 488 }
484 489
485 topLayout->addMultiCellWidget(dummy, 2,2,0,1); 490 topLayout->addMultiCellWidget(dummy, 2,2,0,1);
486 addWidBool(i18n("Full menu bar(nr)"), 491 addWidBool(i18n("Full menu bar(nr)"),
487 &(KOPrefs::instance()->mShowFullMenu),dummy); 492 &(KOPrefs::instance()->mShowFullMenu),dummy);
488 493
489 494
490 addWidBool(i18n("Mini icons in toolbar(nr)"), 495 addWidBool(i18n("Mini icons in toolbar(nr)"),
491 &(KOPrefs::instance()->mToolBarMiniIcons),dummy); 496 &(KOPrefs::instance()->mToolBarMiniIcons),dummy);
492 497
493 498
494 dummy = new QHBox(topFrame); 499 dummy = new Q3HBox(topFrame);
495 new QLabel(i18n("Days in What's Next:"),dummy); 500 new QLabel(i18n("Days in What's Next:"),dummy);
496 mWhatsNextSpin = new QSpinBox(1,14,1,dummy); 501 mWhatsNextSpin = new QSpinBox(1,14,1,dummy);
497 502
498 topLayout->addMultiCellWidget(dummy,3,3,0,1); 503 topLayout->addMultiCellWidget(dummy,3,3,0,1);
499 504
500 505
501 506
502 dummy = new QHBox(topFrame); 507 dummy = new Q3HBox(topFrame);
503 new QLabel(i18n("Days in Next-X-Days:"),dummy); 508 new QLabel(i18n("Days in Next-X-Days:"),dummy);
504 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 509 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
505 510
506 topLayout->addMultiCellWidget(dummy,4,4,0,1); 511 topLayout->addMultiCellWidget(dummy,4,4,0,1);
507 512
508 QHBox *prioBox = new QHBox(topFrame); 513 Q3HBox *prioBox = new Q3HBox(topFrame);
509 // intervalBox->setSpacing(spacingHint()); 514 // intervalBox->setSpacing(spacingHint());
510 topLayout->addMultiCellWidget(prioBox,5,5,0,1); 515 topLayout->addMultiCellWidget(prioBox,5,5,0,1);
511 QString messa = i18n("Show topmost todo prios in What's Next:"); 516 QString messa = i18n("Show topmost todo prios in What's Next:");
512 517
513 if ( QApplication::desktop()->width() < 300 ) 518 if ( QApplication::desktop()->width() < 300 )
514 messa = i18n("Show topmost todo prios in What's N.:"); 519 messa = i18n("Show topmost todo prios in What's N.:");
515 QLabel *prioLabel = new QLabel(messa, prioBox); 520 QLabel *prioLabel = new QLabel(messa, prioBox);
516 mPrioSpin = new QSpinBox(0,5,1,prioBox); 521 mPrioSpin = new QSpinBox(0,5,1,prioBox);
517 if ( QApplication::desktop()->width() < 300 ) 522 if ( QApplication::desktop()->width() < 300 )
518 mPrioSpin->setFixedWidth( 40 ); 523 mPrioSpin->setFixedWidth( 40 );
519 524
520 // KPrefsDialogWidBool *bcc = 525 // KPrefsDialogWidBool *bcc =
521// addWidBool(i18n("Send copy to owner when mailing events"), 526// addWidBool(i18n("Send copy to owner when mailing events"),
522// &(KOPrefs::instance()->mBcc),topFrame); 527// &(KOPrefs::instance()->mBcc),topFrame);
523// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 528// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
524 529
525 530
526 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 531 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
527 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 532 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
528 533
529 // addWidBool(i18n("Enable automatic saving of calendar"), 534 // addWidBool(i18n("Enable automatic saving of calendar"),
530 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 535 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
531 536
532 QHBox *intervalBox = new QHBox(topFrame); 537 Q3HBox *intervalBox = new Q3HBox(topFrame);
533 // intervalBox->setSpacing(spacingHint()); 538 // intervalBox->setSpacing(spacingHint());
534 topLayout->addMultiCellWidget(intervalBox,6,6,0,1); 539 topLayout->addMultiCellWidget(intervalBox,6,6,0,1);
535 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 540 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
536 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 541 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
537 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 542 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
538 /* 543 /*
539 QHBox * agendasize = new QHBox ( topFrame ); 544 QHBox * agendasize = new QHBox ( topFrame );
540 545
541 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 546 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
542 547
543 548
544 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 549 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
@@ -611,32 +616,32 @@ void KOPrefsDialog::setupMainTab()
611 topFrame); 616 topFrame);
612 destinationGroup->addRadio(i18n("be added to the standard resource")); 617 destinationGroup->addRadio(i18n("be added to the standard resource"));
613 destinationGroup->addRadio(i18n("be asked which resource to use")); 618 destinationGroup->addRadio(i18n("be asked which resource to use"));
614 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 619 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
615 620
616 topLayout->setRowStretch(14,1); 621 topLayout->setRowStretch(14,1);
617 */ 622 */
618} 623}
619 624
620 625
621void KOPrefsDialog::setupTimeTab() 626void KOPrefsDialog::setupTimeTab()
622{ 627{
623 QFrame *topFrame = addPage(i18n("Time"),0,0); 628 Q3Frame *topFrame = addPage(i18n("Time"),0,0);
624 // DesktopIcon("clock",KIcon::SizeMedium)); 629 // DesktopIcon("clock",KIcon::SizeMedium));
625 630
626 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 631 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2);
627 topLayout->setSpacing(spacingHint()); 632 topLayout->setSpacing(spacingHint());
628 topLayout->setMargin(marginHint()); 633 topLayout->setMargin(marginHint());
629 634
630 QHBox *dummy = new QHBox(topFrame); 635 Q3HBox *dummy = new Q3HBox(topFrame);
631 KPrefsWidTime *dayBegins = 636 KPrefsWidTime *dayBegins =
632 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 637 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
633 dummy); 638 dummy);
634 //topLayout->addWidget(dayBegins->label(),2,0); 639 //topLayout->addWidget(dayBegins->label(),2,0);
635 640
636 //topLayout->addWidget(dayBegins->spinBox(),2,1); 641 //topLayout->addWidget(dayBegins->spinBox(),2,1);
637 topLayout->addMultiCellWidget(dummy,0,0,0,1); 642 topLayout->addMultiCellWidget(dummy,0,0,0,1);
638 643
639 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 644 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
640 topFrame),1,0); 645 topFrame),1,0);
641 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 646 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
642 mStartTimeSpin->setSuffix(":00"); 647 mStartTimeSpin->setSuffix(":00");
@@ -649,63 +654,63 @@ void KOPrefsDialog::setupTimeTab()
649 topLayout->addWidget(mDefaultDurationSpin,2,1); 654 topLayout->addWidget(mDefaultDurationSpin,2,1);
650 655
651 QStringList alarmList; 656 QStringList alarmList;
652 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 657 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
653 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 658 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
654 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 659 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
655 3,0); 660 3,0);
656 mAlarmTimeCombo = new QComboBox(topFrame); 661 mAlarmTimeCombo = new QComboBox(topFrame);
657 mAlarmTimeCombo->insertStringList(alarmList); 662 mAlarmTimeCombo->insertStringList(alarmList);
658 topLayout->addWidget(mAlarmTimeCombo,3,1); 663 topLayout->addWidget(mAlarmTimeCombo,3,1);
659 664
660 665
661 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 666 Q3GroupBox *workingHoursGroup = new Q3GroupBox(1,Qt::Horizontal,
662 i18n("Working Hours"), 667 i18n("Working Hours"),
663 topFrame); 668 topFrame);
664 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); 669 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1);
665 workingHoursGroup->layout()->setSpacing( 0 ); 670 workingHoursGroup->layout()->setSpacing( 0 );
666 workingHoursGroup->layout()->setMargin( 4 ); 671 workingHoursGroup->layout()->setMargin( 4 );
667 QHBox *workStartBox = new QHBox(workingHoursGroup); 672 Q3HBox *workStartBox = new Q3HBox(workingHoursGroup);
668 // workStartBox->setMargin( 0 ); 673 // workStartBox->setMargin( 0 );
669 addWidTime(i18n("Daily starting hour:"), 674 addWidTime(i18n("Daily starting hour:"),
670 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 675 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
671 676
672 QHBox *workEndBox = new QHBox(workingHoursGroup); 677 Q3HBox *workEndBox = new Q3HBox(workingHoursGroup);
673 //workEndBox->setMargin( 0 ); 678 //workEndBox->setMargin( 0 );
674 addWidTime(i18n("Daily ending hour:"), 679 addWidTime(i18n("Daily ending hour:"),
675 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 680 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
676 QVBox *excludeBox = new QVBox(workingHoursGroup); 681 Q3VBox *excludeBox = new Q3VBox(workingHoursGroup);
677 //excludeBox->setMargin( 0 ); 682 //excludeBox->setMargin( 0 );
678 addWidBool(i18n("Exclude holidays"), 683 addWidBool(i18n("Exclude holidays"),
679 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 684 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
680 685
681 addWidBool(i18n("Exclude Saturdays"), 686 addWidBool(i18n("Exclude Saturdays"),
682 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 687 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
683 688
684// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 689// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
685 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 690 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
686 // topFrame); 691 // topFrame);
687// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 692// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
688 693
689 // topLayout->setRowStretch(6,1); 694 // topLayout->setRowStretch(6,1);
690} 695}
691 696
692 697
693void KOPrefsDialog::setupViewsTab() 698void KOPrefsDialog::setupViewsTab()
694{ 699{
695 700
696 QFrame *topFrame = addPage(i18n("Views"),0,0); 701 Q3Frame *topFrame = addPage(i18n("Views"),0,0);
697 // DesktopIcon("viewmag",KIcon::SizeMedium)); 702 // DesktopIcon("viewmag",KIcon::SizeMedium));
698 703
699 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 704 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,1);
700 topLayout->setSpacing(spacingHint()); 705 topLayout->setSpacing(spacingHint());
701 topLayout->setMargin(marginHint()); 706 topLayout->setMargin(marginHint());
702 707
703// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 708// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
704// topLayout->addLayout(dayBeginsLayout,0,0); 709// topLayout->addLayout(dayBeginsLayout,0,0);
705 710
706// KPrefsWidTime *dayBegins = 711// KPrefsWidTime *dayBegins =
707// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 712// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
708// topFrame); 713// topFrame);
709// dayBeginsLayout->addWidget(dayBegins->label()); 714// dayBeginsLayout->addWidget(dayBegins->label());
710// dayBeginsLayout->addStretch(1); 715// dayBeginsLayout->addStretch(1);
711// dayBeginsLayout->addWidget(dayBegins->spinBox()); 716// dayBeginsLayout->addWidget(dayBegins->spinBox());
@@ -776,25 +781,25 @@ void KOPrefsDialog::setupViewsTab()
776 // topLayout->addWidget(hourSizeGroup,ii++,0); 781 // topLayout->addWidget(hourSizeGroup,ii++,0);
777 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 782 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
778 //topLayout->setRowStretch(11,1); 783 //topLayout->setRowStretch(11,1);
779 784
780 785
781 786
782 787
783 788
784 789
785 topFrame = addPage(i18n("ViewChange"),0,0); 790 topFrame = addPage(i18n("ViewChange"),0,0);
786 // DesktopIcon("viewmag",KIcon::SizeMedium)); 791 // DesktopIcon("viewmag",KIcon::SizeMedium));
787 792
788 topLayout = new QGridLayout(topFrame,6,1); 793 topLayout = new Q3GridLayout(topFrame,6,1);
789 topLayout->setSpacing(spacingHint()); 794 topLayout->setSpacing(spacingHint());
790 topLayout->setMargin(marginHint()); 795 topLayout->setMargin(marginHint());
791 ii = 0; 796 ii = 0;
792 797
793 798
794 dummy = 799 dummy =
795 addWidBool(i18n("Hold fullscreen on view change"), 800 addWidBool(i18n("Hold fullscreen on view change"),
796 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 801 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
797 topLayout->addWidget(dummy->checkBox(),ii++,0); 802 topLayout->addWidget(dummy->checkBox(),ii++,0);
798 803
799 dummy = 804 dummy =
800 addWidBool(i18n("Hold non-fullscreen on view change"), 805 addWidBool(i18n("Hold non-fullscreen on view change"),
@@ -829,52 +834,52 @@ void KOPrefsDialog::setupViewsTab()
829 dummy = 834 dummy =
830 addWidBool(i18n("Highlight selection in Time Edit"), 835 addWidBool(i18n("Highlight selection in Time Edit"),
831 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 836 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
832 topLayout->addWidget( dummy->checkBox(), ii++,0); 837 topLayout->addWidget( dummy->checkBox(), ii++,0);
833 838
834 839
835 840
836 841
837 842
838 topFrame = addPage(i18n("Month View"),0,0); 843 topFrame = addPage(i18n("Month View"),0,0);
839 // DesktopIcon("viewmag",KIcon::SizeMedium)); 844 // DesktopIcon("viewmag",KIcon::SizeMedium));
840 845
841 topLayout = new QGridLayout(topFrame,5,1); 846 topLayout = new Q3GridLayout(topFrame,5,1);
842 topLayout->setSpacing(spacingHint()); 847 topLayout->setSpacing(spacingHint());
843 topLayout->setMargin(marginHint()); 848 topLayout->setMargin(marginHint());
844 ii = 0; 849 ii = 0;
845 QLabel *lab; 850 QLabel *lab;
846 QHBox *habo = new QHBox( topFrame ); 851 Q3HBox *habo = new Q3HBox( topFrame );
847 if ( QApplication::desktop()->width() < 320 ) { 852 if ( QApplication::desktop()->width() < 320 ) {
848 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 853 lab = new QLabel ( i18n("Show events that recur "), topFrame );
849 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 854 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
850 ii++; 855 ii++;
851 856
852 } else { 857 } else {
853 new QLabel ( i18n("Show events that recur "), habo ); 858 new QLabel ( i18n("Show events that recur "), habo );
854 859
855 } 860 }
856 dailyRecur = 861 dailyRecur =
857 addWidBool(i18n("daily"), 862 addWidBool(i18n("daily"),
858 &(KOPrefs::instance()->mMonthDailyRecur),habo); 863 &(KOPrefs::instance()->mMonthDailyRecur),habo);
859 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 864 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
860 865
861 weeklyRecur = 866 weeklyRecur =
862 addWidBool(i18n("weekly"), 867 addWidBool(i18n("weekly"),
863 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 868 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
864 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 869 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
865 ii++; 870 ii++;
866 871
867 872
868 habo = new QHBox( topFrame ); 873 habo = new Q3HBox( topFrame );
869 if ( QApplication::desktop()->width() < 320 ) { 874 if ( QApplication::desktop()->width() < 320 ) {
870 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 875 lab = new QLabel (i18n("Show in every cell ") , topFrame );
871 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 876 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
872 ii++; 877 ii++;
873 878
874 } else { 879 } else {
875 new QLabel ( i18n("Show in every cell "), habo ); 880 new QLabel ( i18n("Show in every cell "), habo );
876 } 881 }
877 weeklyRecur = 882 weeklyRecur =
878 addWidBool(i18n("short month"), 883 addWidBool(i18n("short month"),
879 &(KOPrefs::instance()->mMonthShowShort),habo); 884 &(KOPrefs::instance()->mMonthShowShort),habo);
880 weeklyRecur = 885 weeklyRecur =
@@ -924,25 +929,25 @@ void KOPrefsDialog::setupViewsTab()
924 929
925 holidayColor = 930 holidayColor =
926 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 931 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
927 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 932 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
928 topLayout->addWidget(holidayColor->label(),ii,0); 933 topLayout->addWidget(holidayColor->label(),ii,0);
929 topLayout->addWidget(holidayColor->button(),ii++,1); 934 topLayout->addWidget(holidayColor->button(),ii++,1);
930 935
931 // *********************** Todo View 936 // *********************** Todo View
932 937
933 topFrame = addPage(i18n("Todo View"),0,0); 938 topFrame = addPage(i18n("Todo View"),0,0);
934 // DesktopIcon("viewmag",KIcon::SizeMedium)); 939 // DesktopIcon("viewmag",KIcon::SizeMedium));
935 940
936 topLayout = new QGridLayout(topFrame,4,1); 941 topLayout = new Q3GridLayout(topFrame,4,1);
937 topLayout->setSpacing(spacingHint()); 942 topLayout->setSpacing(spacingHint());
938 topLayout->setMargin(marginHint()); 943 topLayout->setMargin(marginHint());
939 ii = 0; 944 ii = 0;
940 945
941 KPrefsDialogWidBool *showCompletedTodo = 946 KPrefsDialogWidBool *showCompletedTodo =
942 addWidBool(i18n("To-do view shows completed Todos"), 947 addWidBool(i18n("To-do view shows completed Todos"),
943 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 948 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
944 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 949 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
945 dummy = 950 dummy =
946 addWidBool(i18n("To-do view shows complete as 'xx %'"), 951 addWidBool(i18n("To-do view shows complete as 'xx %'"),
947 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 952 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
948 topLayout->addWidget(dummy->checkBox(),ii++,0); 953 topLayout->addWidget(dummy->checkBox(),ii++,0);
@@ -956,102 +961,102 @@ void KOPrefsDialog::setupViewsTab()
956 961
957 dummy = 962 dummy =
958 addWidBool(i18n("Todo view uses category colors"), 963 addWidBool(i18n("Todo view uses category colors"),
959 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 964 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
960 topLayout->addWidget(dummy->checkBox(),ii++,0); 965 topLayout->addWidget(dummy->checkBox(),ii++,0);
961 966
962 967
963 QWidget* wid = new QWidget( topFrame ); 968 QWidget* wid = new QWidget( topFrame );
964 // Todo due today color 969 // Todo due today color
965 KPrefsWidColor *todoDueTodayColor = 970 KPrefsWidColor *todoDueTodayColor =
966 addWidColor(i18n("Todo due today color:"), 971 addWidColor(i18n("Todo due today color:"),
967 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 972 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
968 QHBoxLayout *widLayout = new QHBoxLayout(wid); 973 Q3HBoxLayout *widLayout = new Q3HBoxLayout(wid);
969 widLayout->addWidget( todoDueTodayColor->label() ); 974 widLayout->addWidget( todoDueTodayColor->label() );
970 widLayout->addWidget( todoDueTodayColor->button() ); 975 widLayout->addWidget( todoDueTodayColor->button() );
971 topLayout->addWidget(wid,ii++,0); 976 topLayout->addWidget(wid,ii++,0);
972 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 977 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
973 978
974 // Todo overdue color 979 // Todo overdue color
975 wid = new QWidget( topFrame ); 980 wid = new QWidget( topFrame );
976 widLayout = new QHBoxLayout(wid); 981 widLayout = new Q3HBoxLayout(wid);
977 KPrefsWidColor *todoOverdueColor = 982 KPrefsWidColor *todoOverdueColor =
978 addWidColor(i18n("Todo overdue color:"), 983 addWidColor(i18n("Todo overdue color:"),
979 &(KOPrefs::instance()->mTodoOverdueColor),wid); 984 &(KOPrefs::instance()->mTodoOverdueColor),wid);
980 widLayout->addWidget(todoOverdueColor->label()); 985 widLayout->addWidget(todoOverdueColor->label());
981 widLayout->addWidget(todoOverdueColor->button()); 986 widLayout->addWidget(todoOverdueColor->button());
982 topLayout->addWidget(wid,ii++,0); 987 topLayout->addWidget(wid,ii++,0);
983 988
984 dummy = 989 dummy =
985 addWidBool(i18n("Colors are applied to text"), 990 addWidBool(i18n("Colors are applied to text"),
986 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 991 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
987 topLayout->addWidget(dummy->checkBox(),ii++,0); 992 topLayout->addWidget(dummy->checkBox(),ii++,0);
988 993
989 dummy = 994 dummy =
990 addWidBool(i18n("Allday Agenda view shows todos"), 995 addWidBool(i18n("Allday Agenda view shows todos"),
991 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 996 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
992 topLayout->addWidget(dummy->checkBox(),ii++,0); 997 topLayout->addWidget(dummy->checkBox(),ii++,0);
993 998
994 999
995 1000
996 1001
997 topFrame = addPage(i18n("Alarm"),0,0); 1002 topFrame = addPage(i18n("Alarm"),0,0);
998 // DesktopIcon("viewmag",KIcon::SizeMedium)); 1003 // DesktopIcon("viewmag",KIcon::SizeMedium));
999 1004
1000 topLayout = new QGridLayout(topFrame,2,1); 1005 topLayout = new Q3GridLayout(topFrame,2,1);
1001 topLayout->setSpacing(spacingHint()); 1006 topLayout->setSpacing(spacingHint());
1002 topLayout->setMargin(marginHint()); 1007 topLayout->setMargin(marginHint());
1003 int iii = 0; 1008 int iii = 0;
1004 1009
1005 dummy = 1010 dummy =
1006 addWidBool(i18n("Use internal alarm notification"), 1011 addWidBool(i18n("Use internal alarm notification"),
1007 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 1012 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
1008 topLayout->addWidget(dummy->checkBox(),iii++,0); 1013 topLayout->addWidget(dummy->checkBox(),iii++,0);
1009 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 1014 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
1010 1015
1011 topLayout->addWidget(lab ,iii++,0); 1016 topLayout->addWidget(lab ,iii++,0);
1012#ifndef DESKTOP_VERSION 1017#ifndef DESKTOP_VERSION
1013 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 1018 lab->setAlignment( Qt::AlignLeft|Qt::TextWordWrap|Qt::AlignTop);
1014#else 1019#else
1015 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 1020 lab->setAlignment( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop);
1016 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 1021 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
1017#endif 1022#endif
1018 1023
1019 QHBox* dummyBox = new QHBox(topFrame); 1024 Q3HBox* dummyBox = new Q3HBox(topFrame);
1020 new QLabel(i18n("Play beeps count:"),dummyBox); 1025 new QLabel(i18n("Play beeps count:"),dummyBox);
1021 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 1026 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
1022 topLayout->addWidget(dummyBox,iii++,0); 1027 topLayout->addWidget(dummyBox,iii++,0);
1023 1028
1024 dummyBox = new QHBox(topFrame); 1029 dummyBox = new Q3HBox(topFrame);
1025 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 1030 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
1026 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 1031 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
1027 topLayout->addWidget(dummyBox,iii++,0); 1032 topLayout->addWidget(dummyBox,iii++,0);
1028 1033
1029 dummyBox = new QHBox(topFrame); 1034 dummyBox = new Q3HBox(topFrame);
1030 new QLabel(i18n("Default suspend time in min:"),dummyBox); 1035 new QLabel(i18n("Default suspend time in min:"),dummyBox);
1031 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 1036 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
1032 topLayout->addWidget(dummyBox,iii++,0); 1037 topLayout->addWidget(dummyBox,iii++,0);
1033 1038
1034 dummyBox = new QHBox(topFrame); 1039 dummyBox = new Q3HBox(topFrame);
1035 new QLabel(i18n("Auto suspend count:"),dummyBox); 1040 new QLabel(i18n("Auto suspend count:"),dummyBox);
1036 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 1041 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
1037 topLayout->addWidget(dummyBox,iii++,0); 1042 topLayout->addWidget(dummyBox,iii++,0);
1038 1043
1039 1044
1040 1045
1041 1046
1042 1047
1043 1048
1044 1049
1045 QHBox* hbo = new QHBox ( topFrame ); 1050 Q3HBox* hbo = new Q3HBox ( topFrame );
1046 mDefaultAlarmFile = new QLineEdit(hbo); 1051 mDefaultAlarmFile = new QLineEdit(hbo);
1047 QPushButton * loadTemplate = new QPushButton(hbo); 1052 QPushButton * loadTemplate = new QPushButton(hbo);
1048 QPixmap icon; 1053 QPixmap icon;
1049 if ( QApplication::desktop()->width() < 321 ) 1054 if ( QApplication::desktop()->width() < 321 )
1050 icon = SmallIcon("fileimport16"); 1055 icon = SmallIcon("fileimport16");
1051 else 1056 else
1052 icon = SmallIcon("fileimport"); 1057 icon = SmallIcon("fileimport");
1053 loadTemplate->setIconSet (icon ) ; 1058 loadTemplate->setIconSet (icon ) ;
1054 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 1059 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
1055 int size = loadTemplate->sizeHint().height(); 1060 int size = loadTemplate->sizeHint().height();
1056 loadTemplate->setFixedSize( size, size ); 1061 loadTemplate->setFixedSize( size, size );
1057 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 1062 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
@@ -1073,28 +1078,28 @@ void KOPrefsDialog::setupViewsTab()
1073} 1078}
1074 1079
1075void KOPrefsDialog::selectSoundFile() 1080void KOPrefsDialog::selectSoundFile()
1076{ 1081{
1077 QString fileName = mDefaultAlarmFile->text(); 1082 QString fileName = mDefaultAlarmFile->text();
1078 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 1083 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
1079 if ( fileName.length() > 0 ) 1084 if ( fileName.length() > 0 )
1080 mDefaultAlarmFile->setText( fileName ); 1085 mDefaultAlarmFile->setText( fileName );
1081} 1086}
1082void KOPrefsDialog::setupFontsTab() 1087void KOPrefsDialog::setupFontsTab()
1083{ 1088{
1084 1089
1085 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 1090 Q3Frame *topFrame = addPage(i18n("Fonts"),0,0);
1086 // DesktopIcon("fonts",KIcon::SizeMedium)); 1091 // DesktopIcon("fonts",KIcon::SizeMedium));
1087 1092
1088 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 1093 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,7,3);
1089 topLayout->setSpacing(1); 1094 topLayout->setSpacing(1);
1090 topLayout->setMargin(3); 1095 topLayout->setMargin(3);
1091 KPrefsDialogWidFont * tVFont; 1096 KPrefsDialogWidFont * tVFont;
1092 int i = 0; 1097 int i = 0;
1093 KPrefsDialogWidFont *timeLabelsFont = 1098 KPrefsDialogWidFont *timeLabelsFont =
1094 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 1099 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
1095 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 1100 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
1096 topLayout->addWidget(timeLabelsFont->label(),i,0); 1101 topLayout->addWidget(timeLabelsFont->label(),i,0);
1097 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1102 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1098 topLayout->addWidget(timeLabelsFont->button(),i,2); 1103 topLayout->addWidget(timeLabelsFont->button(),i,2);
1099 ++i; 1104 ++i;
1100 1105
@@ -1143,25 +1148,25 @@ void KOPrefsDialog::setupFontsTab()
1143 ++i; 1148 ++i;
1144 1149
1145 1150
1146 1151
1147 topLayout->setColStretch(1,1); 1152 topLayout->setColStretch(1,1);
1148 topLayout->setRowStretch(4,1); 1153 topLayout->setRowStretch(4,1);
1149 1154
1150 1155
1151 i = 0; 1156 i = 0;
1152 topFrame = addPage(i18n("View Fonts"),0, 1157 topFrame = addPage(i18n("View Fonts"),0,
1153 DesktopIcon("fonts",KIcon::SizeMedium)); 1158 DesktopIcon("fonts",KIcon::SizeMedium));
1154 1159
1155 topLayout = new QGridLayout(topFrame,7,3); 1160 topLayout = new Q3GridLayout(topFrame,7,3);
1156 topLayout->setSpacing(1); 1161 topLayout->setSpacing(1);
1157 topLayout->setMargin(3); 1162 topLayout->setMargin(3);
1158 1163
1159 tVFont = 1164 tVFont =
1160 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1165 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1161 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1166 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1162 topLayout->addWidget(tVFont->label(),i,0); 1167 topLayout->addWidget(tVFont->label(),i,0);
1163 topLayout->addWidget(tVFont->preview(),i,1); 1168 topLayout->addWidget(tVFont->preview(),i,1);
1164 topLayout->addWidget(tVFont->button(),i,2); 1169 topLayout->addWidget(tVFont->button(),i,2);
1165 ++i; 1170 ++i;
1166 KPrefsDialogWidFont *agendaViewFont = 1171 KPrefsDialogWidFont *agendaViewFont =
1167 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1172 addWidFont(i18n("Event text"),i18n("Agenda view:"),
@@ -1211,38 +1216,38 @@ void KOPrefsDialog::setupFontsTab()
1211 1216
1212 1217
1213 topLayout->setColStretch(1,1); 1218 topLayout->setColStretch(1,1);
1214 topLayout->setRowStretch(4,1); 1219 topLayout->setRowStretch(4,1);
1215 1220
1216 1221
1217 1222
1218 1223
1219} 1224}
1220 1225
1221void KOPrefsDialog::setupColorsTab() 1226void KOPrefsDialog::setupColorsTab()
1222{ 1227{
1223 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1228 Q3Frame *topFrame = addPage(i18n("Colors"),0,0);
1224 // DesktopIcon("colorize",KIcon::SizeMedium)); 1229 // DesktopIcon("colorize",KIcon::SizeMedium));
1225 1230
1226 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1231 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2);
1227 // topLayout->setSpacing(spacingHint()); 1232 // topLayout->setSpacing(spacingHint());
1228 // topLayout->setMargin(marginHint()); 1233 // topLayout->setMargin(marginHint());
1229 1234
1230 topLayout->setSpacing(2); 1235 topLayout->setSpacing(2);
1231 topLayout->setMargin(3); 1236 topLayout->setMargin(3);
1232 1237
1233 int ii = 1; 1238 int ii = 1;
1234 QGroupBox *categoryGroup ; 1239 Q3GroupBox *categoryGroup ;
1235 1240
1236 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), 1241 categoryGroup = new Q3GroupBox(1,Qt::Vertical,i18n("Categories"),
1237 topFrame); 1242 topFrame);
1238 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); 1243 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
1239 1244
1240 mCategoryCombo = new QComboBox(categoryGroup); 1245 mCategoryCombo = new QComboBox(categoryGroup);
1241 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1246 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1242 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); 1247 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
1243 1248
1244 mCategoryButton = new KColorButton(categoryGroup); 1249 mCategoryButton = new KColorButton(categoryGroup);
1245 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); 1250 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
1246 updateCategoryColor(); 1251 updateCategoryColor();
1247 1252
1248 1253
@@ -1317,89 +1322,89 @@ void KOPrefsDialog::updateCategoryColor()
1317 color = KOPrefs::instance()->categoryColor(cat); 1322 color = KOPrefs::instance()->categoryColor(cat);
1318 } 1323 }
1319 if (color) { 1324 if (color) {
1320 mCategoryButton->setColor(*color); 1325 mCategoryButton->setColor(*color);
1321 } 1326 }
1322} 1327}
1323 1328
1324void KOPrefsDialog::setupPrinterTab() 1329void KOPrefsDialog::setupPrinterTab()
1325{ 1330{
1326 mPrinterTab = addPage(i18n("Printing"),0, 1331 mPrinterTab = addPage(i18n("Printing"),0,
1327 DesktopIcon("fileprint",KIcon::SizeMedium)); 1332 DesktopIcon("fileprint",KIcon::SizeMedium));
1328 1333
1329 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1334 Q3GridLayout *topLayout = new Q3GridLayout(mPrinterTab,5,2);
1330 topLayout->setSpacing(spacingHint()); 1335 topLayout->setSpacing(spacingHint());
1331 topLayout->setMargin(marginHint()); 1336 topLayout->setMargin(marginHint());
1332 1337
1333 topLayout->setRowStretch(4,1); 1338 topLayout->setRowStretch(4,1);
1334} 1339}
1335 1340
1336void KOPrefsDialog::setupGroupSchedulingTab() 1341void KOPrefsDialog::setupGroupSchedulingTab()
1337{ 1342{
1338#if 0 1343#if 0
1339 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1344 Q3Frame *topFrame = addPage(i18n("Group Scheduling"),0,
1340 DesktopIcon("personal",KIcon::SizeMedium)); 1345 DesktopIcon("personal",KIcon::SizeMedium));
1341 1346
1342 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1347 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2);
1343 topLayout->setSpacing(spacingHint()); 1348 topLayout->setSpacing(spacingHint());
1344 topLayout->setMargin(marginHint()); 1349 topLayout->setMargin(marginHint());
1345 1350
1346#if 0 1351#if 0
1347 KPrefsWidRadios *schedulerGroup = 1352 KPrefsWidRadios *schedulerGroup =
1348 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1353 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1349 topFrame); 1354 topFrame);
1350 schedulerGroup->addRadio("Dummy"); // Only for debugging 1355 schedulerGroup->addRadio("Dummy"); // Only for debugging
1351 schedulerGroup->addRadio(i18n("Mail client")); 1356 schedulerGroup->addRadio(i18n("Mail client"));
1352 1357
1353 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1358 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1354#endif 1359#endif
1355 1360
1356 KPrefsWidRadios *sendGroup = 1361 KPrefsWidRadios *sendGroup =
1357 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1362 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1358 topFrame); 1363 topFrame);
1359 sendGroup->addRadio(i18n("Send to outbox")); 1364 sendGroup->addRadio(i18n("Send to outbox"));
1360 sendGroup->addRadio(i18n("Send directly")); 1365 sendGroup->addRadio(i18n("Send directly"));
1361 1366
1362 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1367 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1363 1368
1364 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1369 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1365 mAMails = new QListView(topFrame); 1370 mAMails = new Q3ListView(topFrame);
1366 mAMails->addColumn(i18n("Email"),300); 1371 mAMails->addColumn(i18n("Email"),300);
1367 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1372 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1368 1373
1369 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1374 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1370 aEmailsEdit = new QLineEdit(topFrame); 1375 aEmailsEdit = new QLineEdit(topFrame);
1371 aEmailsEdit->setEnabled(false); 1376 aEmailsEdit->setEnabled(false);
1372 topLayout->addWidget(aEmailsEdit,4,1); 1377 topLayout->addWidget(aEmailsEdit,4,1);
1373 1378
1374 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1379 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1375 topLayout->addWidget(add,5,0); 1380 topLayout->addWidget(add,5,0);
1376 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1381 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1377 topLayout->addWidget(del,5,1); 1382 topLayout->addWidget(del,5,1);
1378 1383
1379 //topLayout->setRowStretch(2,1); 1384 //topLayout->setRowStretch(2,1);
1380 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1385 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1381 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1386 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1382 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1387 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1383 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1388 connect(mAMails,SIGNAL(selectionChanged(Q3ListViewItem *)),SLOT(updateInput()));
1384#endif 1389#endif
1385} 1390}
1386 1391
1387void KOPrefsDialog::setupGroupAutomationTab() 1392void KOPrefsDialog::setupGroupAutomationTab()
1388{ 1393{
1389 return; 1394 return;
1390 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1395 Q3Frame *topFrame = addPage(i18n("Group Automation"),0,
1391 DesktopIcon("personal",KIcon::SizeMedium)); 1396 DesktopIcon("personal",KIcon::SizeMedium));
1392 1397
1393 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1398 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,1);
1394 topLayout->setSpacing(spacingHint()); 1399 topLayout->setSpacing(spacingHint());
1395 topLayout->setMargin(marginHint()); 1400 topLayout->setMargin(marginHint());
1396 1401
1397 KPrefsWidRadios *autoRefreshGroup = 1402 KPrefsWidRadios *autoRefreshGroup =
1398 addWidRadios(i18n("Auto Send Refresh"), 1403 addWidRadios(i18n("Auto Send Refresh"),
1399 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1404 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1400 autoRefreshGroup->addRadio(i18n("Never")); 1405 autoRefreshGroup->addRadio(i18n("Never"));
1401 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1406 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1402 //autoRefreshGroup->addRadio(i18n("selected emails")); 1407 //autoRefreshGroup->addRadio(i18n("selected emails"));
1403 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1408 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1404 1409
1405 KPrefsWidRadios *autoInsertGroup = 1410 KPrefsWidRadios *autoInsertGroup =
@@ -1534,25 +1539,25 @@ void KOPrefsDialog::usrWriteConfig()
1534 sub = 1; 1539 sub = 1;
1535 else 1540 else
1536 sub = 0; 1541 sub = 0;
1537 KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; 1542 KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
1538 // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); 1543 // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
1539 1544
1540 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1545 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1541 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1546 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1542 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1547 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1543 1548
1544 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); 1549 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
1545 1550
1546 QDictIterator<QColor> it(mCategoryDict); 1551 Q3DictIterator<QColor> it(mCategoryDict);
1547 while (it.current()) { 1552 while (it.current()) {
1548 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1553 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1549 ++it; 1554 ++it;
1550 } 1555 }
1551 1556
1552 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1557 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1553 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1558 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1554 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1559 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1555 1560
1556 KOPrefs::instance()->mAdditionalMails.clear(); 1561 KOPrefs::instance()->mAdditionalMails.clear();
1557 // QListViewItem *item; 1562 // QListViewItem *item;
1558 // item = mAMails->firstChild(); 1563 // item = mAMails->firstChild();
@@ -1674,32 +1679,32 @@ void KOPrefsDialog::updateTimezoneOffset( int index )
1674 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1679 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1675 1680
1676 } else { 1681 } else {
1677 mTimezoneOffsetSpin->setEnabled ( false ); 1682 mTimezoneOffsetSpin->setEnabled ( false );
1678 mTimezoneOffsetSpin->setValue( 0 ); 1683 mTimezoneOffsetSpin->setValue( 0 );
1679 } 1684 }
1680 } 1685 }
1681 */ 1686 */
1682} 1687}
1683 1688
1684void KOPrefsDialog::setupTimeZoneTab() 1689void KOPrefsDialog::setupTimeZoneTab()
1685{ 1690{
1686 QFrame *topFrame = addPage(i18n("Time Zone"),0,0); 1691 Q3Frame *topFrame = addPage(i18n("Time Zone"),0,0);
1687 // DesktopIcon("clock",KIcon::SizeMedium)); 1692 // DesktopIcon("clock",KIcon::SizeMedium));
1688 1693
1689 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1694 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2);
1690 topLayout->setSpacing(spacingHint()); 1695 topLayout->setSpacing(spacingHint());
1691 topLayout->setMargin(marginHint()); 1696 topLayout->setMargin(marginHint());
1692 1697
1693 QHBox *timeZoneBox = new QHBox( topFrame ); 1698 Q3HBox *timeZoneBox = new Q3HBox( topFrame );
1694 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 1699 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
1695 1700
1696 new QLabel( i18n("Timezone:"), timeZoneBox ); 1701 new QLabel( i18n("Timezone:"), timeZoneBox );
1697 mTimeZoneCombo = new QComboBox( timeZoneBox ); 1702 mTimeZoneCombo = new QComboBox( timeZoneBox );
1698 if ( QApplication::desktop()->width() < 300 ) { 1703 if ( QApplication::desktop()->width() < 300 ) {
1699 mTimeZoneCombo->setMaximumWidth(150); 1704 mTimeZoneCombo->setMaximumWidth(150);
1700 } 1705 }
1701 1706
1702 QStringList list; 1707 QStringList list;
1703 list = KGlobal::locale()->timeZoneList(); 1708 list = KGlobal::locale()->timeZoneList();
1704 mTimeZoneCombo->insertStringList(list); 1709 mTimeZoneCombo->insertStringList(list);
1705 1710
diff --git a/kmicromail/koprefsdialog.h b/kmicromail/koprefsdialog.h
index 7fa9261..042af3f 100644
--- a/kmicromail/koprefsdialog.h
+++ b/kmicromail/koprefsdialog.h
@@ -14,28 +14,30 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOPREFSDIALOG_H 23#ifndef _KOPREFSDIALOG_H
24#define _KOPREFSDIALOG_H 24#define _KOPREFSDIALOG_H
25 25
26#include <qframe.h> 26#include <q3frame.h>
27#include <qdict.h> 27#include <q3dict.h>
28#include <qcolor.h> 28#include <qcolor.h>
29#include <qlistview.h> 29#include <q3listview.h>
30//Added by qt3to4:
31#include <QLabel>
30 32
31#include <kdialogbase.h> 33#include <kdialogbase.h>
32 34
33#include <libkdepim/kprefsdialog.h> 35#include <libkdepim/kprefsdialog.h>
34#include <libkdepim/kdateedit.h> 36#include <libkdepim/kdateedit.h>
35#include <kcmconfigs/kdepimconfigwidget.h> 37#include <kcmconfigs/kdepimconfigwidget.h>
36 38
37class KColorButton; 39class KColorButton;
38class QSpinBox; 40class QSpinBox;
39class QSlider; 41class QSlider;
40class KURLRequester; 42class KURLRequester;
41class QComboBox; 43class QComboBox;
@@ -110,25 +112,25 @@ protected:
110 void setupGroupSchedulingTab(); 112 void setupGroupSchedulingTab();
111 void setupGroupAutomationTab(); 113 void setupGroupAutomationTab();
112 void setupSyncTab(); 114 void setupSyncTab();
113 void setupSyncAlgTab(); 115 void setupSyncAlgTab();
114 116
115 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); 117 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
116 118
117 119
118 private: 120 private:
119 KPrefsWidBool *mEnableGroupScheduling; 121 KPrefsWidBool *mEnableGroupScheduling;
120 KPrefsWidBool *mEnableProjectView; 122 KPrefsWidBool *mEnableProjectView;
121 123
122 QFrame *mPrinterTab; 124 Q3Frame *mPrinterTab;
123 125
124 QLineEdit *nameEdit; 126 QLineEdit *nameEdit;
125 QLineEdit *emailEdit; 127 QLineEdit *emailEdit;
126 128
127 QComboBox *timeCombo; 129 QComboBox *timeCombo;
128 QComboBox *tzCombo; 130 QComboBox *tzCombo;
129 131
130 // widgets holding preferences data 132 // widgets holding preferences data
131 QLineEdit *mNameEdit; 133 QLineEdit *mNameEdit;
132 QLineEdit *mEmailEdit; 134 QLineEdit *mEmailEdit;
133 QLabel *mNameLabel; 135 QLabel *mNameLabel;
134 QLabel *mEmailLabel; 136 QLabel *mEmailLabel;
@@ -137,25 +139,25 @@ protected:
137 QSpinBox *mPrioSpin; 139 QSpinBox *mPrioSpin;
138 // QListView *mAMails; 140 // QListView *mAMails;
139 QLineEdit *aEmailsEdit; 141 QLineEdit *aEmailsEdit;
140 142
141 QComboBox *mTimeZoneCombo; 143 QComboBox *mTimeZoneCombo;
142 QStringList tzonenames; 144 QStringList tzonenames;
143 QSpinBox *mStartTimeSpin; 145 QSpinBox *mStartTimeSpin;
144 QSpinBox *mDefaultDurationSpin; 146 QSpinBox *mDefaultDurationSpin;
145 QComboBox *mAlarmTimeCombo; 147 QComboBox *mAlarmTimeCombo;
146 148
147 QComboBox *mCategoryCombo; 149 QComboBox *mCategoryCombo;
148 KColorButton *mCategoryButton; 150 KColorButton *mCategoryButton;
149 QDict<QColor> mCategoryDict; 151 Q3Dict<QColor> mCategoryDict;
150 152
151 QSlider *mHourSizeSlider; 153 QSlider *mHourSizeSlider;
152 154
153 QSpinBox *mNextXDaysSpin; 155 QSpinBox *mNextXDaysSpin;
154 QSpinBox *mWhatsNextSpin; 156 QSpinBox *mWhatsNextSpin;
155 157
156 QLineEdit * mRemoteIPEdit; 158 QLineEdit * mRemoteIPEdit;
157 QLineEdit * mRemoteUser; 159 QLineEdit * mRemoteUser;
158 QLineEdit * mRemotePassWd; 160 QLineEdit * mRemotePassWd;
159 QLineEdit * mRemoteFile; 161 QLineEdit * mRemoteFile;
160 QLineEdit * mLocalTempFile; 162 QLineEdit * mLocalTempFile;
161 QWidget* mSetupSyncAlgTab; 163 QWidget* mSetupSyncAlgTab;
diff --git a/kmicromail/libetpan/libetpan.pro b/kmicromail/libetpan/libetpan.pro
index dfafa07..4b2654e 100644
--- a/kmicromail/libetpan/libetpan.pro
+++ b/kmicromail/libetpan/libetpan.pro
@@ -1,18 +1,18 @@
1###################################################################### 1######################################################################
2# Automatically generated by qmake (1.07a) Thu Jul 1 00:54:03 2004 2# Automatically generated by qmake (1.07a) Thu Jul 1 00:54:03 2004
3###################################################################### 3######################################################################
4 4
5TEMPLATE = lib 5TEMPLATE = lib
6 TARGET = microlibetpan 6 TARGET = xmicrolibetpan
7 7
8OBJECTS_DIR = obj 8OBJECTS_DIR = obj
9MOC_DIR = moc 9MOC_DIR = moc
10DESTDIR=../../bin 10DESTDIR=../../bin
11 11
12DEPENDPATH += generic \ 12DEPENDPATH += generic \
13 imap \ 13 imap \
14 imf \ 14 imf \
15 maildir \ 15 maildir \
16 mbox \ 16 mbox \
17 mh \ 17 mh \
18 mime \ 18 mime \
diff --git a/kmicromail/libetpan/libetpanE.pro b/kmicromail/libetpan/libetpanE.pro
index 7f37948..ea22692 100644
--- a/kmicromail/libetpan/libetpanE.pro
+++ b/kmicromail/libetpan/libetpanE.pro
@@ -1,18 +1,18 @@
1###################################################################### 1######################################################################
2# Automatically generated by qmake (1.07a) Thu Jul 1 00:54:03 2004 2# Automatically generated by qmake (1.07a) Thu Jul 1 00:54:03 2004
3###################################################################### 3######################################################################
4 4
5TEMPLATE = lib 5TEMPLATE = lib
6 TARGET = microlibetpan 6 TARGET = xmicrolibetpan
7 7
8OBJECTS_DIR = obj/$(PLATFORM) 8OBJECTS_DIR = obj/$(PLATFORM)
9MOC_DIR = moc/$(PLATFORM) 9MOC_DIR = moc/$(PLATFORM)
10DESTDIR=$(QPEDIR)/lib 10DESTDIR=$(QPEDIR)/lib
11 11
12DEPENDPATH += generic \ 12DEPENDPATH += generic \
13 imap \ 13 imap \
14 imf \ 14 imf \
15 maildir \ 15 maildir \
16 mbox \ 16 mbox \
17 mh \ 17 mh \
18 mime \ 18 mime \
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp
index 870985e..746d2ae 100644
--- a/kmicromail/libmailwrapper/abstractmail.cpp
+++ b/kmicromail/libmailwrapper/abstractmail.cpp
@@ -1,29 +1,31 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#include "abstractmail.h" 2#include "abstractmail.h"
3#include "imapwrapper.h" 3#include "imapwrapper.h"
4#include "pop3wrapper.h" 4#include "pop3wrapper.h"
5#include "nntpwrapper.h" 5#include "nntpwrapper.h"
6#include "mhwrapper.h" 6#include "mhwrapper.h"
7#include "mailtypes.h" 7#include "mailtypes.h"
8#include <qpe/global.h> 8#include <qpe/global.h>
9 9
10 10
11#include <qprogressbar.h> 11#include <q3progressbar.h>
12#include <qapplication.h> 12#include <qapplication.h>
13#include <qmessagebox.h> 13#include <qmessagebox.h>
14//Added by qt3to4:
15#include <Q3ValueList>
14#include <klocale.h> 16#include <klocale.h>
15#include <kdecore/kstandarddirs.h> 17#include <kdecore/kstandarddirs.h>
16#include <qfile.h> 18#include <qfile.h>
17#include <qtextstream.h> 19#include <q3textstream.h>
18#include <stdlib.h> 20#include <stdlib.h>
19#include <libetpan/mailmime_content.h> 21#include <libetpan/mailmime_content.h>
20#include <libetpan/mailmime.h> 22#include <libetpan/mailmime.h>
21 23
22using namespace Opie::Core; 24using namespace Opie::Core;
23AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) 25AbstractMail* AbstractMail::getWrapper(IMAPaccount *a)
24{ 26{
25 return new IMAPwrapper(a); 27 return new IMAPwrapper(a);
26} 28}
27 29
28AbstractMail* AbstractMail::getWrapper(POP3account *a) 30AbstractMail* AbstractMail::getWrapper(POP3account *a)
29{ 31{
@@ -102,61 +104,61 @@ QString AbstractMail::convert_String(const char*text)
102 if (err == MAILIMF_NO_ERROR && res && strlen(res)) { 104 if (err == MAILIMF_NO_ERROR && res && strlen(res)) {
103 result = QString::fromUtf8(res); 105 result = QString::fromUtf8(res);
104 } 106 }
105 //qDebug("convert_String:%s ",result.latin1() ); 107 //qDebug("convert_String:%s ",result.latin1() );
106 if (res) free(res); 108 if (res) free(res);
107 return result; 109 return result;
108} 110}
109 111
110/* cp & paste from launcher */ 112/* cp & paste from launcher */
111QString AbstractMail::gen_attachment_id() 113QString AbstractMail::gen_attachment_id()
112{ 114{
113 QFile file( "/proc/sys/kernel/random/uuid" ); 115 QFile file( "/proc/sys/kernel/random/uuid" );
114 if (!file.open(IO_ReadOnly ) ) 116 if (!file.open(QIODevice::ReadOnly ) )
115 return QString::null; 117 return QString::null;
116 118
117 QTextStream stream(&file); 119 Q3TextStream stream(&file);
118 120
119 return "{" + stream.read().stripWhiteSpace() + "}"; 121 return "{" + stream.read().stripWhiteSpace() + "}";
120} 122}
121 123
122int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool) 124int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool)
123{ 125{
124 return 0; 126 return 0;
125} 127}
126 128
127QString AbstractMail::defaultLocalfolder() 129QString AbstractMail::defaultLocalfolder()
128{ 130{
129 // QString f = getenv( "HOME" ); 131 // QString f = getenv( "HOME" );
130 QString f = locateLocal( "data", "kopiemail/localmail"); 132 QString f = locateLocal( "data", "kopiemail/localmail");
131 // f += "/Applications/opiemail/localmail"; 133 // f += "/Applications/opiemail/localmail";
132 return f; 134 return f;
133} 135}
134 136
135QString AbstractMail::draftFolder() 137QString AbstractMail::draftFolder()
136{ 138{
137 return QString("Drafts"); 139 return QString("Drafts");
138} 140}
139 141
140/* temporary - will be removed when implemented in all classes */ 142/* temporary - will be removed when implemented in all classes */
141void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &) 143void AbstractMail::deleteMails(const QString &,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &)
142{ 144{
143} 145}
144void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) 146void AbstractMail::deleteMailList(const Q3ValueList<RecMailP>&target)
145{ 147{
146 //qDebug("AbstractMail::deleteMailList:: Please reimplement! "); 148 //qDebug("AbstractMail::deleteMailList:: Please reimplement! ");
147 // this is currently re-implemented in pop3wrapper and imapwrapper 149 // this is currently re-implemented in pop3wrapper and imapwrapper
148 int iii = 0; 150 int iii = 0;
149 int count = target.count(); 151 int count = target.count();
150 QProgressBar wid ( count ); 152 Q3ProgressBar wid ( count );
151 wid.setCaption( i18n("Deleting ...")); 153 wid.setCaption( i18n("Deleting ..."));
152 wid.show(); 154 wid.show();
153 while (iii < count ) { 155 while (iii < count ) {
154 Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); 156 Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count));
155 wid.setProgress( iii ); 157 wid.setProgress( iii );
156 wid.raise(); 158 wid.raise();
157 qApp->processEvents(); 159 qApp->processEvents();
158 RecMailP mail = (*target.at( iii )); 160 RecMailP mail = (*target.at( iii ));
159 deleteMail(mail); 161 deleteMail(mail);
160 ++iii; 162 ++iii;
161 } 163 }
162} 164}
@@ -168,38 +170,38 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe
168 Account * acc = getAccount(); 170 Account * acc = getAccount();
169 if ( !acc ) return; 171 if ( !acc ) return;
170 QString lfName = acc->getLocalFolder(); 172 QString lfName = acc->getLocalFolder();
171 if ( lfName.isEmpty() ) 173 if ( lfName.isEmpty() )
172 lfName = acc->getAccountName(); 174 lfName = acc->getAccountName();
173 // create local folder 175 // create local folder
174 if ( !targetMail->createMbox(lfName)) 176 if ( !targetMail->createMbox(lfName))
175 { 177 {
176 QMessageBox::critical(0,i18n("Error creating new Folder"), 178 QMessageBox::critical(0,i18n("Error creating new Folder"),
177 i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); 179 i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName));
178 return; 180 return;
179 } 181 }
180 QValueList<RecMailP> t; 182 Q3ValueList<RecMailP> t;
181 listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); 183 listMessages(fromFolder->getName(),t,acc->getMaxMailSize() );
182 if ( t.count() == 0 ) { 184 if ( t.count() == 0 ) {
183 qDebug("There are no new messages %s", fromFolder->getName().latin1()); 185 qDebug("There are no new messages %s", fromFolder->getName().latin1());
184 Global::statusMessage(i18n("There are no new messages")); 186 Global::statusMessage(i18n("There are no new messages"));
185 return; 187 return;
186 } 188 }
187 Global::statusMessage(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); 189 Global::statusMessage(i18n("%1 :Downloading mails..."). arg(acc->getAccountName()));
188 qDebug(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); 190 qDebug(i18n("%1 :Downloading mails..."). arg(acc->getAccountName()));
189 qApp->processEvents(); 191 qApp->processEvents();
190 QValueList<RecMailP> e; 192 Q3ValueList<RecMailP> e;
191 targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); 193 targetMail->listMessages(lfName,e,acc->getMaxMailSize() );
192 //qDebug("target has mails %d ", e.count()); 194 //qDebug("target has mails %d ", e.count());
193 QValueList<RecMailP> n; 195 Q3ValueList<RecMailP> n;
194 int iii = 0; 196 int iii = 0;
195 int count = t.count(); 197 int count = t.count();
196 while (iii < count ) { 198 while (iii < count ) {
197 RecMailP r = (*t.at( iii )); 199 RecMailP r = (*t.at( iii ));
198 bool found = false; 200 bool found = false;
199 int jjj = 0; 201 int jjj = 0;
200 int countE = e.count(); 202 int countE = e.count();
201 while (jjj < countE ) { 203 while (jjj < countE ) {
202 RecMailP re = (*e.at( jjj )); 204 RecMailP re = (*e.at( jjj ));
203 if ( re->isEqual(r) ) { 205 if ( re->isEqual(r) ) {
204 found = true; 206 found = true;
205 break; 207 break;
@@ -212,50 +214,50 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe
212 } 214 }
213 ++iii; 215 ++iii;
214 } 216 }
215 qDebug("Downloaded %d messages ",n.count() ); 217 qDebug("Downloaded %d messages ",n.count() );
216 if ( n.count() == 0 ) { 218 if ( n.count() == 0 ) {
217 Global::statusMessage(i18n("There are no new messages")); 219 Global::statusMessage(i18n("There are no new messages"));
218 return; 220 return;
219 } 221 }
220 mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer()); 222 mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer());
221 Global::statusMessage(i18n("Downloaded %1 messages").arg(n.count())); 223 Global::statusMessage(i18n("Downloaded %1 messages").arg(n.count()));
222 224
223#if 0 225#if 0
224 QValueList<RecMailP> t; 226 Q3ValueList<RecMailP> t;
225 listMessages(fromFolder->getName(),t, maxSizeInKb); 227 listMessages(fromFolder->getName(),t, maxSizeInKb);
226 mvcpMailList( t,targetFolder,targetWrapper,moveit); 228 mvcpMailList( t,targetFolder,targetWrapper,moveit);
227#endif 229#endif
228 230
229} 231}
230void AbstractMail::mvcpAllMails(const FolderP&fromFolder, 232void AbstractMail::mvcpAllMails(const FolderP&fromFolder,
231 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) 233 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb)
232{ 234{
233 QValueList<RecMailP> t; 235 Q3ValueList<RecMailP> t;
234 listMessages(fromFolder->getName(),t, maxSizeInKb); 236 listMessages(fromFolder->getName(),t, maxSizeInKb);
235 mvcpMailList( t,targetFolder,targetWrapper,moveit); 237 mvcpMailList( t,targetFolder,targetWrapper,moveit);
236 238
237} 239}
238void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, 240void AbstractMail::mvcpMailList(const Q3ValueList<RecMailP>& t,
239 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 241 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
240{ 242{
241 encodedString*st = 0; 243 encodedString*st = 0;
242 int iii = 0; 244 int iii = 0;
243 int count = t.count(); 245 int count = t.count();
244 if ( count == 0 ) 246 if ( count == 0 )
245 return; 247 return;
246 // wel, processevents is qite strange, we need a widget for getting 248 // wel, processevents is qite strange, we need a widget for getting
247 // Global::statusMessage(i18n("Copy2 message %1").arg(iii)); displaye 249 // Global::statusMessage(i18n("Copy2 message %1").arg(iii)); displaye
248 250
249 QProgressBar wid ( count ); 251 Q3ProgressBar wid ( count );
250 wid.setCaption( i18n("Copying...")); 252 wid.setCaption( i18n("Copying..."));
251 wid.show(); 253 wid.show();
252 while (iii < count ) { 254 while (iii < count ) {
253 Global::statusMessage(i18n("Copy message %1 of %2").arg(iii).arg(count)); 255 Global::statusMessage(i18n("Copy message %1 of %2").arg(iii).arg(count));
254 wid.setProgress( iii ); 256 wid.setProgress( iii );
255 wid.raise(); 257 wid.raise();
256 qApp->processEvents(); 258 qApp->processEvents();
257 RecMailP r = (*t.at( iii )); 259 RecMailP r = (*t.at( iii ));
258 st = fetchRawBody(r); 260 st = fetchRawBody(r);
259 if (st) { 261 if (st) {
260 targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); 262 targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder);
261 delete st; 263 delete st;
diff --git a/kmicromail/libmailwrapper/abstractmail.h b/kmicromail/libmailwrapper/abstractmail.h
index 2069ca1..f606b1f 100644
--- a/kmicromail/libmailwrapper/abstractmail.h
+++ b/kmicromail/libmailwrapper/abstractmail.h
@@ -1,59 +1,61 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#ifndef __abstract_mail_ 2#ifndef __abstract_mail_
3#define __abstract_mail_ 3#define __abstract_mail_
4 4
5#include "maildefines.h" 5#include "maildefines.h"
6 6
7#include "settings.h" 7#include "settings.h"
8 8
9#include <qobject.h> 9#include <qobject.h>
10//Added by qt3to4:
11#include <Q3ValueList>
10#include <opie2/osmartpointer.h> 12#include <opie2/osmartpointer.h>
11#include "mailtypes.h" 13#include "mailtypes.h"
12 14
13 15
14#include "mailwrapper.h" 16#include "mailwrapper.h"
15 17
16class IMAPwrapper; 18class IMAPwrapper;
17class POP3wrapper; 19class POP3wrapper;
18class Folder; 20class Folder;
19class encodedString; 21class encodedString;
20struct folderStat; 22struct folderStat;
21 23
22class AbstractMail:public QObject 24class AbstractMail:public QObject
23{ 25{
24 Q_OBJECT 26 Q_OBJECT
25public: 27public:
26 AbstractMail(){}; 28 AbstractMail(){};
27 virtual ~AbstractMail(){} 29 virtual ~AbstractMail(){}
28 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0; 30 virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0;
29 virtual void listMessages(const QString & mailbox,QValueList<RecMailP>&target, int sizeInKb = 0 )=0; 31 virtual void listMessages(const QString & mailbox,Q3ValueList<RecMailP>&target, int sizeInKb = 0 )=0;
30 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; 32 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0;
31 virtual RecBodyP fetchBody(const RecMailP&mail)=0; 33 virtual RecBodyP fetchBody(const RecMailP&mail)=0;
32 virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part)=0; 34 virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part)=0;
33 virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part)=0; 35 virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part)=0;
34 virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part)=0; 36 virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part)=0;
35 virtual encodedString* fetchRawBody(const RecMailP&mail)=0; 37 virtual encodedString* fetchRawBody(const RecMailP&mail)=0;
36 38
37 virtual void deleteMail(const RecMailP&mail)=0; 39 virtual void deleteMail(const RecMailP&mail)=0;
38 virtual void deleteMailList(const QValueList<RecMailP>&target); 40 virtual void deleteMailList(const Q3ValueList<RecMailP>&target);
39 virtual void answeredMail(const RecMailP&mail)=0; 41 virtual void answeredMail(const RecMailP&mail)=0;
40 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&)=0; 42 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&)=0;
41 virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> >&target); 43 virtual void deleteMails(const QString & FolderName,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target);
42 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&)=0; 44 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&)=0;
43 virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; 45 virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0;
44 void downloadNewMails(const FolderP&fromFolder,AbstractMail*targetWrapper ); 46 void downloadNewMails(const FolderP&fromFolder,AbstractMail*targetWrapper );
45 virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, 47 virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,
46 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int sizeInKb = 0); 48 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int sizeInKb = 0);
47 virtual void mvcpMailList(const QValueList<RecMailP>& t, 49 virtual void mvcpMailList(const Q3ValueList<RecMailP>& t,
48 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 50 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
49 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 51 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
50 52
51 virtual void cleanMimeCache(){}; 53 virtual void cleanMimeCache(){};
52 /* mail box methods */ 54 /* mail box methods */
53 /* parameter is the box to create. 55 /* parameter is the box to create.
54 * if the implementing subclass has prefixes, 56 * if the implementing subclass has prefixes,
55 * them has to be appended automatic. 57 * them has to be appended automatic.
56 */ 58 */
57 virtual int createMbox(const QString&,const Opie::Core::OSmartPointer<Folder>&parentfolder=0, 59 virtual int createMbox(const QString&,const Opie::Core::OSmartPointer<Folder>&parentfolder=0,
58 const QString& delemiter="/",bool getsubfolder=false); 60 const QString& delemiter="/",bool getsubfolder=false);
59 virtual void logout()=0; 61 virtual void logout()=0;
diff --git a/kmicromail/libmailwrapper/generatemail.cpp b/kmicromail/libmailwrapper/generatemail.cpp
index 2d213fe..ddad21b 100644
--- a/kmicromail/libmailwrapper/generatemail.cpp
+++ b/kmicromail/libmailwrapper/generatemail.cpp
@@ -1,21 +1,23 @@
1#include "generatemail.h" 1#include "generatemail.h"
2#include "mailwrapper.h" 2#include "mailwrapper.h"
3 3
4#include <libetpan/libetpan.h> 4#include <libetpan/libetpan.h>
5 5
6//#include <qt.h> 6//#include <qt.h>
7 7
8#include <stdlib.h> 8#include <stdlib.h>
9#include <qfileinfo.h> 9#include <qfileinfo.h>
10//Added by qt3to4:
11#include <Q3CString>
10 12
11using namespace Opie::Core; 13using namespace Opie::Core;
12const char* Generatemail::USER_AGENT="KOpieMail 33 1/3"; 14const char* Generatemail::USER_AGENT="KOpieMail 33 1/3";
13 15
14Generatemail::Generatemail() 16Generatemail::Generatemail()
15{ 17{
16 mCharset = "iso-8859-1"; 18 mCharset = "iso-8859-1";
17} 19}
18 20
19Generatemail::~Generatemail() 21Generatemail::~Generatemail()
20{ 22{
21} 23}
@@ -219,49 +221,49 @@ void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files
219 if ( err != MAILIMF_NO_ERROR ) { 221 if ( err != MAILIMF_NO_ERROR ) {
220 mailmime_free( filePart ); 222 mailmime_free( filePart );
221 } 223 }
222 } 224 }
223} 225}
224 226
225mailmime *Generatemail::buildTxtPart(const QString&str ) { 227mailmime *Generatemail::buildTxtPart(const QString&str ) {
226 mailmime *txtPart; 228 mailmime *txtPart;
227 mailmime_fields *fields; 229 mailmime_fields *fields;
228 mailmime_content *content; 230 mailmime_content *content;
229 mailmime_parameter *param; 231 mailmime_parameter *param;
230 int err; 232 int err;
231 QCString __str; 233 Q3CString __str;
232 //qDebug(" Generatemail::buildTxtPart %s", str.latin1()); 234 //qDebug(" Generatemail::buildTxtPart %s", str.latin1());
233 param = mailmime_parameter_new( strdup( "charset" ), 235 param = mailmime_parameter_new( strdup( "charset" ),
234 strdup( mCharset.latin1() ) ); 236 strdup( mCharset.latin1() ) );
235 if ( param == NULL ) 237 if ( param == NULL )
236 goto err_free; 238 goto err_free;
237 239
238 content = mailmime_content_new_with_str( "text/plain" ); 240 content = mailmime_content_new_with_str( "text/plain" );
239 if ( content == NULL ) 241 if ( content == NULL )
240 goto err_free_param; 242 goto err_free_param;
241 243
242 err = clist_append( content->ct_parameters, param ); 244 err = clist_append( content->ct_parameters, param );
243 if ( err != MAILIMF_NO_ERROR ) 245 if ( err != MAILIMF_NO_ERROR )
244 goto err_free_content; 246 goto err_free_content;
245 247
246 fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_8BIT); 248 fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_8BIT);
247 if ( fields == NULL ) 249 if ( fields == NULL )
248 goto err_free_content; 250 goto err_free_content;
249 251
250 txtPart = mailmime_new_empty( content, fields ); 252 txtPart = mailmime_new_empty( content, fields );
251 if ( txtPart == NULL ) 253 if ( txtPart == NULL )
252 goto err_free_fields; 254 goto err_free_fields;
253 { 255 {
254 //__str = str.utf8(); 256 //__str = str.utf8();
255 __str = QCString (str.latin1()); 257 __str = Q3CString (str.latin1());
256 err = mailmime_set_body_text( txtPart, strdup(__str.data()), __str.length() ); 258 err = mailmime_set_body_text( txtPart, strdup(__str.data()), __str.length() );
257 } 259 }
258 if ( err != MAILIMF_NO_ERROR ) 260 if ( err != MAILIMF_NO_ERROR )
259 goto err_free_txtPart; 261 goto err_free_txtPart;
260 262
261 return txtPart; // Success :) 263 return txtPart; // Success :)
262 264
263err_free_txtPart: 265err_free_txtPart:
264 mailmime_free( txtPart ); 266 mailmime_free( txtPart );
265err_free_fields: 267err_free_fields:
266 mailmime_fields_free( fields ); 268 mailmime_fields_free( fields );
267err_free_content: 269err_free_content:
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp
index 0b6adf7..633ab42 100644
--- a/kmicromail/libmailwrapper/genericwrapper.cpp
+++ b/kmicromail/libmailwrapper/genericwrapper.cpp
@@ -1,20 +1,22 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#include "genericwrapper.h" 2#include "genericwrapper.h"
3#include <libetpan/libetpan.h> 3#include <libetpan/libetpan.h>
4#include "mailtypes.h" 4#include "mailtypes.h"
5 5
6#include <kconfig.h> 6#include <kconfig.h>
7#include <kglobal.h> 7#include <kglobal.h>
8#include <kstandarddirs.h> 8#include <kstandarddirs.h>
9//Added by qt3to4:
10#include <Q3ValueList>
9 11
10 12
11using namespace Opie::Core; 13using namespace Opie::Core;
12Genericwrapper::Genericwrapper() 14Genericwrapper::Genericwrapper()
13 : AbstractMail() 15 : AbstractMail()
14{ 16{
15 bodyCache.clear(); 17 bodyCache.clear();
16 m_storage = 0; 18 m_storage = 0;
17 m_folder = 0; 19 m_folder = 0;
18} 20}
19 21
20Genericwrapper::~Genericwrapper() 22Genericwrapper::~Genericwrapper()
@@ -173,43 +175,43 @@ QString Genericwrapper::getencoding(mailmime_mechanism*aEnc)
173 enc = "base64"; 175 enc = "base64";
174 break; 176 break;
175 case MAILMIME_MECHANISM_TOKEN: 177 case MAILMIME_MECHANISM_TOKEN:
176 default: 178 default:
177 if (aEnc->enc_token) { 179 if (aEnc->enc_token) {
178 enc = QString(aEnc->enc_token); 180 enc = QString(aEnc->enc_token);
179 } 181 }
180 break; 182 break;
181 } 183 }
182 return enc; 184 return enc;
183} 185}
184 186
185void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count) 187void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueList<int>recList,unsigned int current_rec,int current_count)
186{ 188{
187 if (current_rec >= 10) { 189 if (current_rec >= 10) {
188 ; // odebug << "too deep recursion!" << oendl; 190 ; // odebug << "too deep recursion!" << oendl;
189 } 191 }
190 if (!message || !mime) { 192 if (!message || !mime) {
191 return; 193 return;
192 } 194 }
193 int r; 195 int r;
194 char*data = 0; 196 char*data = 0;
195 size_t len; 197 size_t len;
196 clistiter * cur = 0; 198 clistiter * cur = 0;
197 QString b; 199 QString b;
198 RecPartP part = new RecPart(); 200 RecPartP part = new RecPart();
199 201
200 switch (mime->mm_type) { 202 switch (mime->mm_type) {
201 case MAILMIME_SINGLE: 203 case MAILMIME_SINGLE:
202 { 204 {
203 QValueList<int>countlist = recList; 205 Q3ValueList<int>countlist = recList;
204 countlist.append(current_count); 206 countlist.append(current_count);
205 r = mailmessage_fetch_section(message,mime,&data,&len); 207 r = mailmessage_fetch_section(message,mime,&data,&len);
206 part->setSize(len); 208 part->setSize(len);
207 part->setPositionlist(countlist); 209 part->setPositionlist(countlist);
208 b = gen_attachment_id(); 210 b = gen_attachment_id();
209 part->setIdentifier(b); 211 part->setIdentifier(b);
210 fillSingleBody(part,message,mime); 212 fillSingleBody(part,message,mime);
211 if (part->Type()=="text" && target->Bodytext().isNull()) { 213 if (part->Type()=="text" && target->Bodytext().isNull()) {
212 encodedString*rs = new encodedString(); 214 encodedString*rs = new encodedString();
213 rs->setContent(data,len); 215 rs->setContent(data,len);
214 encodedString*res = decode_String(rs,part->Encoding()); 216 encodedString*res = decode_String(rs,part->Encoding());
215 if (countlist.count()>2) { 217 if (countlist.count()>2) {
@@ -241,45 +243,45 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m
241 target->setBodytext(b); 243 target->setBodytext(b);
242 target->setDescription(part); 244 target->setDescription(part);
243 } else { 245 } else {
244 bodyCache[b]=new encodedString(data,len); 246 bodyCache[b]=new encodedString(data,len);
245 target->addPart(part); 247 target->addPart(part);
246 } 248 }
247 } 249 }
248 break; 250 break;
249 case MAILMIME_MULTIPLE: 251 case MAILMIME_MULTIPLE:
250 { 252 {
251 unsigned int ccount = 1; 253 unsigned int ccount = 1;
252 mailmime*cbody=0; 254 mailmime*cbody=0;
253 QValueList<int>countlist = recList; 255 Q3ValueList<int>countlist = recList;
254 for (cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list) ; cur != NULL ; cur = clist_next(cur)) { 256 for (cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list) ; cur != NULL ; cur = clist_next(cur)) {
255 cbody = (mailmime*)clist_content(cur); 257 cbody = (mailmime*)clist_content(cur);
256 if (cbody->mm_type==MAILMIME_MULTIPLE) { 258 if (cbody->mm_type==MAILMIME_MULTIPLE) {
257 RecPartP targetPart = new RecPart(); 259 RecPartP targetPart = new RecPart();
258 targetPart->setType("multipart"); 260 targetPart->setType("multipart");
259 countlist.append(current_count); 261 countlist.append(current_count);
260 targetPart->setPositionlist(countlist); 262 targetPart->setPositionlist(countlist);
261 target->addPart(targetPart); 263 target->addPart(targetPart);
262 } 264 }
263 traverseBody(target,message, cbody,countlist,current_rec+1,ccount); 265 traverseBody(target,message, cbody,countlist,current_rec+1,ccount);
264 if (cbody->mm_type==MAILMIME_MULTIPLE) { 266 if (cbody->mm_type==MAILMIME_MULTIPLE) {
265 countlist = recList; 267 countlist = recList;
266 } 268 }
267 ++ccount; 269 ++ccount;
268 } 270 }
269 } 271 }
270 break; 272 break;
271 case MAILMIME_MESSAGE: 273 case MAILMIME_MESSAGE:
272 { 274 {
273 QValueList<int>countlist = recList; 275 Q3ValueList<int>countlist = recList;
274 countlist.append(current_count); 276 countlist.append(current_count);
275 /* the own header is always at recursion 0 - we don't need that */ 277 /* the own header is always at recursion 0 - we don't need that */
276 if (current_rec > 0) { 278 if (current_rec > 0) {
277 part->setPositionlist(countlist); 279 part->setPositionlist(countlist);
278 r = mailmessage_fetch_section(message,mime,&data,&len); 280 r = mailmessage_fetch_section(message,mime,&data,&len);
279 part->setSize(len); 281 part->setSize(len);
280 part->setPositionlist(countlist); 282 part->setPositionlist(countlist);
281 b = gen_attachment_id(); 283 b = gen_attachment_id();
282 part->setIdentifier(b); 284 part->setIdentifier(b);
283 part->setType("message"); 285 part->setType("message");
284 part->setSubtype("rfc822"); 286 part->setSubtype("rfc822");
285 bodyCache[b]=new encodedString(data,len); 287 bodyCache[b]=new encodedString(data,len);
@@ -293,25 +295,25 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m
293 } 295 }
294} 296}
295 297
296RecBodyP Genericwrapper::parseMail( mailmessage * msg ) 298RecBodyP Genericwrapper::parseMail( mailmessage * msg )
297{ 299{
298 int err = MAILIMF_NO_ERROR; 300 int err = MAILIMF_NO_ERROR;
299 //mailmime_single_fields fields; 301 //mailmime_single_fields fields;
300 /* is bound to msg and will be freed there */ 302 /* is bound to msg and will be freed there */
301 mailmime * mime=0; 303 mailmime * mime=0;
302 RecBodyP body = new RecBody(); 304 RecBodyP body = new RecBody();
303 //memset(&fields, 0, sizeof(struct mailmime_single_fields)); 305 //memset(&fields, 0, sizeof(struct mailmime_single_fields));
304 err = mailmessage_get_bodystructure(msg,&mime); 306 err = mailmessage_get_bodystructure(msg,&mime);
305 QValueList<int>recList; 307 Q3ValueList<int>recList;
306 traverseBody(body,msg,mime,recList); 308 traverseBody(body,msg,mime,recList);
307 return body; 309 return body;
308} 310}
309 311
310 312
311QString Genericwrapper::parseAddressList( mailimf_address_list *list ) 313QString Genericwrapper::parseAddressList( mailimf_address_list *list )
312{ 314{
313 QString result( "" ); 315 QString result( "" );
314 316
315 bool first = true; 317 bool first = true;
316 if (list == 0) return result; 318 if (list == 0) return result;
317 for ( clistiter *current = clist_begin( list->ad_list ); current != NULL; current = current->next ) { 319 for ( clistiter *current = clist_begin( list->ad_list ); current != NULL; current = current->next ) {
@@ -438,25 +440,25 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies)
438 h.remove(0,1); 440 h.remove(0,1);
439 } 441 }
440 while (h.length()>0 && h[h.length()-1]=='>') { 442 while (h.length()>0 && h[h.length()-1]=='>') {
441 h.remove(h.length()-1,1); 443 h.remove(h.length()-1,1);
442 } 444 }
443 if (h.length()>0) { 445 if (h.length()>0) {
444 res.append(h); 446 res.append(h);
445 } 447 }
446 } 448 }
447 return res; 449 return res;
448} 450}
449 451
450void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) 452void Genericwrapper::parseList(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb)
451{ 453{
452 int r; 454 int r;
453 mailmessage_list * env_list = 0; 455 mailmessage_list * env_list = 0;
454 r = mailsession_get_messages_list(session,&env_list); 456 r = mailsession_get_messages_list(session,&env_list);
455 if (r != MAIL_NO_ERROR) { 457 if (r != MAIL_NO_ERROR) {
456 ; // odebug << "Error message list" << oendl; 458 ; // odebug << "Error message list" << oendl;
457 return; 459 return;
458 } 460 }
459 r = mailsession_get_envelopes_list(session, env_list); 461 r = mailsession_get_envelopes_list(session, env_list);
460 if (r != MAIL_NO_ERROR) { 462 if (r != MAIL_NO_ERROR) {
461 ; // odebug << "Error filling message list" << oendl; 463 ; // odebug << "Error filling message list" << oendl;
462 if (env_list) { 464 if (env_list) {
diff --git a/kmicromail/libmailwrapper/genericwrapper.h b/kmicromail/libmailwrapper/genericwrapper.h
index c35a6da..a50161d 100644
--- a/kmicromail/libmailwrapper/genericwrapper.h
+++ b/kmicromail/libmailwrapper/genericwrapper.h
@@ -1,19 +1,21 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#ifndef __GENERIC_WRAPPER_H 2#ifndef __GENERIC_WRAPPER_H
3#define __GENERIC_WRAPPER_H 3#define __GENERIC_WRAPPER_H
4 4
5#include "abstractmail.h" 5#include "abstractmail.h"
6#include <qmap.h> 6#include <qmap.h>
7#include <qstring.h> 7#include <qstring.h>
8//Added by qt3to4:
9#include <Q3ValueList>
8#include <libetpan/clist.h> 10#include <libetpan/clist.h>
9 11
10class RecMail; 12class RecMail;
11class RecBody; 13class RecBody;
12class encodedString; 14class encodedString;
13struct mailpop3; 15struct mailpop3;
14struct mailmessage; 16struct mailmessage;
15struct mailmime; 17struct mailmime;
16struct mailmime_mechanism; 18struct mailmime_mechanism;
17struct mailimf_mailbox_list; 19struct mailimf_mailbox_list;
18struct mailimf_mailbox; 20struct mailimf_mailbox;
19struct mailimf_date_time; 21struct mailimf_date_time;
@@ -42,27 +44,27 @@ public:
42 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&){return 1;} 44 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&){return 1;}
43 virtual void logout(){}; 45 virtual void logout(){};
44 virtual void storeMessage(const char*msg,size_t length, const QString&folder){}; 46 virtual void storeMessage(const char*msg,size_t length, const QString&folder){};
45 static const QDateTime parseDateTime( mailimf_date_time *date ); 47 static const QDateTime parseDateTime( mailimf_date_time *date );
46 48
47protected: 49protected:
48 RecBodyP parseMail( mailmessage * msg ); 50 RecBodyP parseMail( mailmessage * msg );
49 QString parseMailboxList( mailimf_mailbox_list *list ); 51 QString parseMailboxList( mailimf_mailbox_list *list );
50 QString parseMailbox( mailimf_mailbox *box ); 52 QString parseMailbox( mailimf_mailbox *box );
51 QString parseGroup( mailimf_group *group ); 53 QString parseGroup( mailimf_group *group );
52 QString parseAddressList( mailimf_address_list *list ); 54 QString parseAddressList( mailimf_address_list *list );
53 55
54 void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1); 56 void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueList<int>recList,unsigned int current_rek=0,int current_count=1);
55 static void fillSingleBody(RecPartP&target,mailmessage*message,mailmime*mime); 57 static void fillSingleBody(RecPartP&target,mailmessage*message,mailmime*mime);
56 static void fillParameters(RecPartP&target,clist*parameters); 58 static void fillParameters(RecPartP&target,clist*parameters);
57 static QString getencoding(mailmime_mechanism*aEnc); 59 static QString getencoding(mailmime_mechanism*aEnc);
58 virtual void parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0); 60 virtual void parseList(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0);
59 QStringList parseInreplies(mailimf_in_reply_to * in_replies); 61 QStringList parseInreplies(mailimf_in_reply_to * in_replies);
60 62
61 QString msgTempName; 63 QString msgTempName;
62 unsigned int last_msg_id; 64 unsigned int last_msg_id;
63 QMap<QString,encodedString*> bodyCache; 65 QMap<QString,encodedString*> bodyCache;
64 mailstorage * m_storage; 66 mailstorage * m_storage;
65 mailfolder*m_folder; 67 mailfolder*m_folder;
66}; 68};
67 69
68#endif 70#endif
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index 4f0c849..f73f4cc 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -1,21 +1,23 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#include <stdlib.h> 2#include <stdlib.h>
3#include <libetpan/libetpan.h> 3#include <libetpan/libetpan.h>
4#include <qpe/global.h> 4#include <qpe/global.h>
5#include <qapplication.h> 5#include <qapplication.h>
6//Added by qt3to4:
7#include <Q3ValueList>
6#include "imapwrapper.h" 8#include "imapwrapper.h"
7#include "mailtypes.h" 9#include "mailtypes.h"
8#include "logindialog.h" 10#include "logindialog.h"
9#include <qprogressbar.h> 11#include <q3progressbar.h>
10#include "genericwrapper.h" 12#include "genericwrapper.h"
11#include <kglobal.h> 13#include <kglobal.h>
12 14
13using namespace Opie::Core; 15using namespace Opie::Core;
14int IMAPwrapper::mMax = 0; 16int IMAPwrapper::mMax = 0;
15int IMAPwrapper::mCurrent = 0; 17int IMAPwrapper::mCurrent = 0;
16 18
17IMAPwrapper::IMAPwrapper( IMAPaccount *a ) 19IMAPwrapper::IMAPwrapper( IMAPaccount *a )
18 : AbstractMail() 20 : AbstractMail()
19{ 21{
20 account = a; 22 account = a;
21 m_imap = 0; 23 m_imap = 0;
@@ -230,25 +232,25 @@ void IMAPwrapper::login(bool tryTLS) // = true)
230 232
231void IMAPwrapper::logout() 233void IMAPwrapper::logout()
232{ 234{
233 int err = MAILIMAP_NO_ERROR; 235 int err = MAILIMAP_NO_ERROR;
234 if (!m_imap) return; 236 if (!m_imap) return;
235 err = mailimap_logout( m_imap ); 237 err = mailimap_logout( m_imap );
236 err = mailimap_close( m_imap ); 238 err = mailimap_close( m_imap );
237 mailimap_free( m_imap ); 239 mailimap_free( m_imap );
238 m_imap = 0; 240 m_imap = 0;
239 m_Lastmbox = ""; 241 m_Lastmbox = "";
240} 242}
241 243
242void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) 244void IMAPwrapper::listMessages(const QString&mailbox,Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb)
243{ 245{
244 246
245 int tryAgain = 1; 247 int tryAgain = 1;
246 while ( tryAgain >= 0 ) { 248 while ( tryAgain >= 0 ) {
247 int err = MAILIMAP_NO_ERROR; 249 int err = MAILIMAP_NO_ERROR;
248 clist *result = 0; 250 clist *result = 0;
249 clistcell *current; 251 clistcell *current;
250 mailimap_fetch_type *fetchType = 0; 252 mailimap_fetch_type *fetchType = 0;
251 mailimap_set *set = 0; 253 mailimap_set *set = 0;
252 254
253 login(); 255 login();
254 if (!m_imap) { 256 if (!m_imap) {
@@ -311,34 +313,34 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma
311 --tryAgain; 313 --tryAgain;
312 --tryAgain;//disabled tryagain by adding this line 314 --tryAgain;//disabled tryagain by adding this line
313 if ( tryAgain < 0 ) 315 if ( tryAgain < 0 )
314 Global::statusMessage(i18n("Error fetching headers: %1").arg(m_imap->imap_response)); 316 Global::statusMessage(i18n("Error fetching headers: %1").arg(m_imap->imap_response));
315 else 317 else
316 qDebug("try again... "); 318 qDebug("try again... ");
317 } 319 }
318 320
319 if (result) mailimap_fetch_list_free(result); 321 if (result) mailimap_fetch_list_free(result);
320 } 322 }
321} 323}
322 324
323QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() 325Q3ValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
324{ 326{
325 const char *path, *mask; 327 const char *path, *mask;
326 int err = MAILIMAP_NO_ERROR; 328 int err = MAILIMAP_NO_ERROR;
327 clist *result = 0; 329 clist *result = 0;
328 clistcell *current = 0; 330 clistcell *current = 0;
329 clistcell*cur_flag = 0; 331 clistcell*cur_flag = 0;
330 mailimap_mbx_list_flags*bflags = 0; 332 mailimap_mbx_list_flags*bflags = 0;
331 333
332 QValueList<FolderP>* folders = new QValueList<FolderP>(); 334 Q3ValueList<FolderP>* folders = new Q3ValueList<FolderP>();
333 login(); 335 login();
334 if (!m_imap) { 336 if (!m_imap) {
335 return folders; 337 return folders;
336 } 338 }
337 339
338/* 340/*
339 * First we have to check for INBOX 'cause it sometimes it's not inside the path. 341 * First we have to check for INBOX 'cause it sometimes it's not inside the path.
340 * We must not forget to filter them out in next loop! 342 * We must not forget to filter them out in next loop!
341 * it seems like ugly code. and yes - it is ugly code. but the best way. 343 * it seems like ugly code. and yes - it is ugly code. but the best way.
342 */ 344 */
343 Global::statusMessage(i18n("Fetching folder list")); 345 Global::statusMessage(i18n("Fetching folder list"));
344 qApp->processEvents(); 346 qApp->processEvents();
@@ -604,25 +606,25 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail)
604 /* the range has to start at 1!!! not with 0!!!! */ 606 /* the range has to start at 1!!! not with 0!!!! */
605 set = mailimap_set_new_interval( mail->getNumber(),mail->getNumber() ); 607 set = mailimap_set_new_interval( mail->getNumber(),mail->getNumber() );
606 fetchAtt = mailimap_fetch_att_new_bodystructure(); 608 fetchAtt = mailimap_fetch_att_new_bodystructure();
607 fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt); 609 fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt);
608 err = mailimap_fetch( m_imap, set, fetchType, &result ); 610 err = mailimap_fetch( m_imap, set, fetchType, &result );
609 mailimap_set_free( set ); 611 mailimap_set_free( set );
610 mailimap_fetch_type_free( fetchType ); 612 mailimap_fetch_type_free( fetchType );
611 613
612 if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { 614 if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) {
613 mailimap_msg_att * msg_att; 615 mailimap_msg_att * msg_att;
614 msg_att = (mailimap_msg_att*)current->data; 616 msg_att = (mailimap_msg_att*)current->data;
615 mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data; 617 mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data;
616 QValueList<int> path; 618 Q3ValueList<int> path;
617 body_desc = item->att_data.att_static->att_data.att_body; 619 body_desc = item->att_data.att_static->att_data.att_body;
618 traverseBody(mail,body_desc,body,0,path); 620 traverseBody(mail,body_desc,body,0,path);
619 } else { 621 } else {
620 qDebug("error fetching body %d (%d): %s", err, MAILIMAP_NO_ERROR, m_imap->imap_response ); 622 qDebug("error fetching body %d (%d): %s", err, MAILIMAP_NO_ERROR, m_imap->imap_response );
621 } 623 }
622 if (result) mailimap_fetch_list_free(result); 624 if (result) mailimap_fetch_list_free(result);
623 return body; 625 return body;
624} 626}
625 627
626QStringList IMAPwrapper::address_list_to_stringlist(clist*list) 628QStringList IMAPwrapper::address_list_to_stringlist(clist*list)
627{ 629{
628 QStringList l; 630 QStringList l;
@@ -655,25 +657,25 @@ QStringList IMAPwrapper::address_list_to_stringlist(clist*list)
655 } 657 }
656 if (named_from && (current_address->ad_mailbox_name || current_address->ad_host_name)) { 658 if (named_from && (current_address->ad_mailbox_name || current_address->ad_host_name)) {
657 from+=">"; 659 from+=">";
658 } 660 }
659 l.append(QString(from)); 661 l.append(QString(from));
660 if (++count > 99) { 662 if (++count > 99) {
661 break; 663 break;
662 } 664 }
663 } 665 }
664 return l; 666 return l;
665} 667}
666 668
667encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call) 669encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call)
668{ 670{
669 encodedString*res=new encodedString; 671 encodedString*res=new encodedString;
670 int err; 672 int err;
671 mailimap_fetch_type *fetchType; 673 mailimap_fetch_type *fetchType;
672 mailimap_set *set; 674 mailimap_set *set;
673 clistcell*current,*cur; 675 clistcell*current,*cur;
674 mailimap_section_part * section_part = 0; 676 mailimap_section_part * section_part = 0;
675 mailimap_section_spec * section_spec = 0; 677 mailimap_section_spec * section_spec = 0;
676 mailimap_section * section = 0; 678 mailimap_section * section = 0;
677 mailimap_fetch_att * fetch_att = 0; 679 mailimap_fetch_att * fetch_att = 0;
678 680
679 login(); 681 login();
@@ -729,33 +731,33 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int
729 } 731 }
730 } 732 }
731 } else { 733 } else {
732 ;//odebug << "error fetching text: " << m_imap->imap_response << "" << oendl; 734 ;//odebug << "error fetching text: " << m_imap->imap_response << "" << oendl;
733 } 735 }
734 if (result) mailimap_fetch_list_free(result); 736 if (result) mailimap_fetch_list_free(result);
735 return res; 737 return res;
736} 738}
737 739
738/* current_recursion is for recursive calls. 740/* current_recursion is for recursive calls.
739 current_count means the position inside the internal loop! */ 741 current_count means the position inside the internal loop! */
740void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body, 742void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,
741 int current_recursion,QValueList<int>recList,int current_count) 743 int current_recursion,Q3ValueList<int>recList,int current_count)
742{ 744{
743 if (!body || current_recursion>=10) { 745 if (!body || current_recursion>=10) {
744 return; 746 return;
745 } 747 }
746 switch (body->bd_type) { 748 switch (body->bd_type) {
747 case MAILIMAP_BODY_1PART: 749 case MAILIMAP_BODY_1PART:
748 { 750 {
749 QValueList<int>countlist = recList; 751 Q3ValueList<int>countlist = recList;
750 countlist.append(current_count); 752 countlist.append(current_count);
751 RecPartP currentPart = new RecPart(); 753 RecPartP currentPart = new RecPart();
752 mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; 754 mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part;
753 QString id(""); 755 QString id("");
754 currentPart->setPositionlist(countlist); 756 currentPart->setPositionlist(countlist);
755 for (unsigned int j = 0; j < countlist.count();++j) { 757 for (unsigned int j = 0; j < countlist.count();++j) {
756 id+=(j>0?" ":""); 758 id+=(j>0?" ":"");
757 id+=QString("%1").arg(countlist[j]); 759 id+=QString("%1").arg(countlist[j]);
758 } 760 }
759 //odebug << "ID = " << id.latin1() << "" << oendl; 761 //odebug << "ID = " << id.latin1() << "" << oendl;
760 currentPart->setIdentifier(id); 762 currentPart->setIdentifier(id);
761 fillSinglePart(currentPart,part1); 763 fillSinglePart(currentPart,part1);
@@ -790,25 +792,25 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t
790 target_body->addPart(currentPart); 792 target_body->addPart(currentPart);
791 } 793 }
792 } else { 794 } else {
793 target_body->addPart(currentPart); 795 target_body->addPart(currentPart);
794 } 796 }
795 if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_MSG) { 797 if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_MSG) {
796 traverseBody(mail,part1->bd_data.bd_type_msg->bd_body,target_body,current_recursion+1,countlist); 798 traverseBody(mail,part1->bd_data.bd_type_msg->bd_body,target_body,current_recursion+1,countlist);
797 } 799 }
798 } 800 }
799 break; 801 break;
800 case MAILIMAP_BODY_MPART: 802 case MAILIMAP_BODY_MPART:
801 { 803 {
802 QValueList<int>countlist = recList; 804 Q3ValueList<int>countlist = recList;
803 clistcell*current=0; 805 clistcell*current=0;
804 mailimap_body*current_body=0; 806 mailimap_body*current_body=0;
805 unsigned int ccount = 1; 807 unsigned int ccount = 1;
806 mailimap_body_type_mpart*mailDescription = body->bd_data.bd_body_mpart; 808 mailimap_body_type_mpart*mailDescription = body->bd_data.bd_body_mpart;
807 for (current=clist_begin(mailDescription->bd_list);current!=0;current=clist_next(current)) { 809 for (current=clist_begin(mailDescription->bd_list);current!=0;current=clist_next(current)) {
808 current_body = (mailimap_body*)current->data; 810 current_body = (mailimap_body*)current->data;
809 if (current_body->bd_type==MAILIMAP_BODY_MPART) { 811 if (current_body->bd_type==MAILIMAP_BODY_MPART) {
810 RecPartP targetPart = new RecPart(); 812 RecPartP targetPart = new RecPart();
811 targetPart->setType("multipart"); 813 targetPart->setType("multipart");
812 fillMultiPart(targetPart,mailDescription); 814 fillMultiPart(targetPart,mailDescription);
813 countlist.append(current_count); 815 countlist.append(current_count);
814 targetPart->setPositionlist(countlist); 816 targetPart->setPositionlist(countlist);
@@ -976,45 +978,45 @@ void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which
976 char*t=enc->enc_value; 978 char*t=enc->enc_value;
977 encoding=QString(enc->enc_value); 979 encoding=QString(enc->enc_value);
978 enc->enc_value=0L; 980 enc->enc_value=0L;
979 free(t); 981 free(t);
980 } 982 }
981 } 983 }
982 if (which->bd_description) { 984 if (which->bd_description) {
983 target_part->setDescription(QString(which->bd_description)); 985 target_part->setDescription(QString(which->bd_description));
984 } 986 }
985 target_part->setEncoding(encoding); 987 target_part->setEncoding(encoding);
986 target_part->setSize(which->bd_size); 988 target_part->setSize(which->bd_size);
987} 989}
988void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) 990void IMAPwrapper::deleteMailList(const Q3ValueList<RecMailP>&target)
989{ 991{
990 //#if 0 992 //#if 0
991 mailimap_flag_list*flist; 993 mailimap_flag_list*flist;
992 mailimap_set *set; 994 mailimap_set *set;
993 mailimap_store_att_flags * store_flags; 995 mailimap_store_att_flags * store_flags;
994 int err; 996 int err;
995 login(); 997 login();
996 //#endif 998 //#endif
997 if (!m_imap) { 999 if (!m_imap) {
998 return; 1000 return;
999 } 1001 }
1000 int iii = 0; 1002 int iii = 0;
1001 int count = target.count(); 1003 int count = target.count();
1002 // qDebug("imap remove count %d ", count); 1004 // qDebug("imap remove count %d ", count);
1003 1005
1004 1006
1005 mMax = count; 1007 mMax = count;
1006 progress( i18n("Delete")); 1008 progress( i18n("Delete"));
1007 1009
1008 QProgressBar wid ( count ); 1010 Q3ProgressBar wid ( count );
1009 wid.setCaption( i18n("Deleting ...")); 1011 wid.setCaption( i18n("Deleting ..."));
1010 wid.show(); 1012 wid.show();
1011 while (iii < count ) { 1013 while (iii < count ) {
1012 Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); 1014 Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count));
1013 wid.setProgress( iii ); 1015 wid.setProgress( iii );
1014 wid.raise(); 1016 wid.raise();
1015 qApp->processEvents(); 1017 qApp->processEvents();
1016 RecMailP mail = (*target.at( iii )); 1018 RecMailP mail = (*target.at( iii ));
1017 //#if 0 1019 //#if 0
1018 //qDebug("IMAP remove %d %d ", iii, mail->getNumber() ); 1020 //qDebug("IMAP remove %d %d ", iii, mail->getNumber() );
1019 err = selectMbox(mail->getMbox()); 1021 err = selectMbox(mail->getMbox());
1020 if ( err != MAILIMAP_NO_ERROR ) { 1022 if ( err != MAILIMAP_NO_ERROR ) {
@@ -1105,25 +1107,25 @@ void IMAPwrapper::answeredMail(const RecMailP&mail)
1105 store_flags = mailimap_store_att_flags_new_add_flags(flist); 1107 store_flags = mailimap_store_att_flags_new_add_flags(flist);
1106 set = mailimap_set_new_single(mail->getNumber()); 1108 set = mailimap_set_new_single(mail->getNumber());
1107 err = mailimap_store(m_imap,set,store_flags); 1109 err = mailimap_store(m_imap,set,store_flags);
1108 mailimap_set_free( set ); 1110 mailimap_set_free( set );
1109 mailimap_store_att_flags_free(store_flags); 1111 mailimap_store_att_flags_free(store_flags);
1110 1112
1111 if (err != MAILIMAP_NO_ERROR) { 1113 if (err != MAILIMAP_NO_ERROR) {
1112 // odebug << "error marking mail: " << m_imap->imap_response << "" << oendl; 1114 // odebug << "error marking mail: " << m_imap->imap_response << "" << oendl;
1113 return; 1115 return;
1114 } 1116 }
1115} 1117}
1116 1118
1117QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) 1119QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call,const QString&enc)
1118{ 1120{
1119 QString body(""); 1121 QString body("");
1120 encodedString*res = fetchRawPart(mail,path,internal_call); 1122 encodedString*res = fetchRawPart(mail,path,internal_call);
1121 encodedString*r = decode_String(res,enc); 1123 encodedString*r = decode_String(res,enc);
1122 delete res; 1124 delete res;
1123 if (r) { 1125 if (r) {
1124 if (r->Length()>0) { 1126 if (r->Length()>0) {
1125 body = r->Content(); 1127 body = r->Content();
1126 } 1128 }
1127 delete r; 1129 delete r;
1128 } 1130 }
1129 return body; 1131 return body;
@@ -1290,25 +1292,25 @@ MAILLIB::ATYPE IMAPwrapper::getType()const
1290 return account->getType(); 1292 return account->getType();
1291} 1293}
1292 1294
1293const QString&IMAPwrapper::getName()const 1295const QString&IMAPwrapper::getName()const
1294{ 1296{
1295 // odebug << "Get name: " << account->getAccountName().latin1() << "" << oendl; 1297 // odebug << "Get name: " << account->getAccountName().latin1() << "" << oendl;
1296 return account->getAccountName(); 1298 return account->getAccountName();
1297} 1299}
1298 1300
1299encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) 1301encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail)
1300{ 1302{
1301 // dummy 1303 // dummy
1302 QValueList<int> path; 1304 Q3ValueList<int> path;
1303 return fetchRawPart(mail,path,false); 1305 return fetchRawPart(mail,path,false);
1304} 1306}
1305 1307
1306void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, 1308void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
1307 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) 1309 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb)
1308{ 1310{
1309 if (targetWrapper != this || maxSizeInKb > 0 ) { 1311 if (targetWrapper != this || maxSizeInKb > 0 ) {
1310 mMax = 0; 1312 mMax = 0;
1311 progress( i18n("Copy")); 1313 progress( i18n("Copy"));
1312 AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb); 1314 AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb);
1313 //qDebug("IMAPwrapper::mvcpAllMails::Using generic"); 1315 //qDebug("IMAPwrapper::mvcpAllMails::Using generic");
1314 // odebug << "Using generic" << oendl; 1316 // odebug << "Using generic" << oendl;
diff --git a/kmicromail/libmailwrapper/imapwrapper.h b/kmicromail/libmailwrapper/imapwrapper.h
index 31c60a8..d3d3ecd 100644
--- a/kmicromail/libmailwrapper/imapwrapper.h
+++ b/kmicromail/libmailwrapper/imapwrapper.h
@@ -1,44 +1,46 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#ifndef __IMAPWRAPPER 2#ifndef __IMAPWRAPPER
3#define __IMAPWRAPPER 3#define __IMAPWRAPPER
4 4
5#include <qlist.h> 5#include <qlist.h>
6//Added by qt3to4:
7#include <Q3ValueList>
6#include "mailwrapper.h" 8#include "mailwrapper.h"
7#include "abstractmail.h" 9#include "abstractmail.h"
8#include <libetpan/clist.h> 10#include <libetpan/clist.h>
9 11
10struct mailimap; 12struct mailimap;
11struct mailimap_body; 13struct mailimap_body;
12struct mailimap_body_type_1part; 14struct mailimap_body_type_1part;
13struct mailimap_body_type_text; 15struct mailimap_body_type_text;
14struct mailimap_body_type_basic; 16struct mailimap_body_type_basic;
15struct mailimap_body_type_msg; 17struct mailimap_body_type_msg;
16struct mailimap_body_type_mpart; 18struct mailimap_body_type_mpart;
17struct mailimap_body_fields; 19struct mailimap_body_fields;
18struct mailimap_msg_att; 20struct mailimap_msg_att;
19class encodedString; 21class encodedString;
20 22
21class IMAPwrapper : public AbstractMail 23class IMAPwrapper : public AbstractMail
22{ 24{
23 Q_OBJECT 25 Q_OBJECT
24public: 26public:
25 IMAPwrapper( IMAPaccount *a ); 27 IMAPwrapper( IMAPaccount *a );
26 virtual ~IMAPwrapper(); 28 virtual ~IMAPwrapper();
27 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); 29 virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders();
28 virtual void listMessages(const QString & mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); 30 virtual void listMessages(const QString & mailbox,Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0);
29 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 31 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
30 32
31 virtual void deleteMail(const RecMailP&mail); 33 virtual void deleteMail(const RecMailP&mail);
32 void deleteMailList(const QValueList<RecMailP>&target); 34 void deleteMailList(const Q3ValueList<RecMailP>&target);
33 virtual void answeredMail(const RecMailP&mail); 35 virtual void answeredMail(const RecMailP&mail);
34 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&folder); 36 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&folder);
35 virtual void storeMessage(const char*msg,size_t length, const QString&folder); 37 virtual void storeMessage(const char*msg,size_t length, const QString&folder);
36 virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, 38 virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,
37 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit,int sizeInKb = 0); 39 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit,int sizeInKb = 0);
38 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 40 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
39 41
40 virtual RecBodyP fetchBody(const RecMailP&mail); 42 virtual RecBodyP fetchBody(const RecMailP&mail);
41 virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part); 43 virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part);
42 virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part); 44 virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part);
43 virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part); 45 virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part);
44 virtual encodedString* fetchRawBody(const RecMailP&mail); 46 virtual encodedString* fetchRawBody(const RecMailP&mail);
@@ -50,34 +52,34 @@ public:
50 static void imap_progress( size_t current, size_t maximum ); 52 static void imap_progress( size_t current, size_t maximum );
51 53
52 virtual void logout(); 54 virtual void logout();
53 virtual MAILLIB::ATYPE getType()const; 55 virtual MAILLIB::ATYPE getType()const;
54 virtual const QString&getName()const; 56 virtual const QString&getName()const;
55 virtual Account* getAccount() { return account; }; 57 virtual Account* getAccount() { return account; };
56 58
57protected: 59protected:
58 RecMail*parse_list_result(mailimap_msg_att*); 60 RecMail*parse_list_result(mailimap_msg_att*);
59 void login(bool tryTLS = true); 61 void login(bool tryTLS = true);
60 bool start_tls(bool force=true); 62 bool start_tls(bool force=true);
61 63
62 virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); 64 virtual QString fetchTextPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call=false,const QString&enc="");
63 virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call); 65 virtual encodedString*fetchRawPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call);
64 int selectMbox(const QString&mbox); 66 int selectMbox(const QString&mbox);
65 67
66 void fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description); 68 void fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description);
67 void fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which); 69 void fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which);
68 void fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which); 70 void fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which);
69 void fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which); 71 void fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which);
70 void fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which); 72 void fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which);
71 void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,QValueList<int>recList,int current_count=1); 73 void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,Q3ValueList<int>recList,int current_count=1);
72 74
73 /* just helpers */ 75 /* just helpers */
74 static void fillBodyFields(RecPartP&target_part,mailimap_body_fields*which); 76 static void fillBodyFields(RecPartP&target_part,mailimap_body_fields*which);
75 static QStringList address_list_to_stringlist(clist*list); 77 static QStringList address_list_to_stringlist(clist*list);
76 78
77 static void progress(QString mess = QString::null); 79 static void progress(QString mess = QString::null);
78 static int mCurrent; 80 static int mCurrent;
79 static int mMax; 81 static int mMax;
80 IMAPaccount *account; 82 IMAPaccount *account;
81 mailimap *m_imap; 83 mailimap *m_imap;
82 QString m_Lastmbox; 84 QString m_Lastmbox;
83}; 85};
diff --git a/kmicromail/libmailwrapper/libmailwrapper.pro b/kmicromail/libmailwrapper/libmailwrapper.pro
index 646630b..6b595ab 100644
--- a/kmicromail/libmailwrapper/libmailwrapper.pro
+++ b/kmicromail/libmailwrapper/libmailwrapper.pro
@@ -29,37 +29,43 @@ SOURCES = imapwrapper.cpp \
29 mboxwrapper.cpp \ 29 mboxwrapper.cpp \
30 settings.cpp \ 30 settings.cpp \
31 logindialog.cpp \ 31 logindialog.cpp \
32 sendmailprogress.cpp \ 32 sendmailprogress.cpp \
33 statusmail.cpp \ 33 statusmail.cpp \
34 mhwrapper.cpp \ 34 mhwrapper.cpp \
35 nntpwrapper.cpp \ 35 nntpwrapper.cpp \
36 generatemail.cpp \ 36 generatemail.cpp \
37 storemail.cpp \ 37 storemail.cpp \
38 ../qpe/qdialog_hacked.cpp \ 38 ../qpe/qdialog_hacked.cpp \
39 ../qpe/global.cpp 39 ../qpe/global.cpp
40 40
41INTERFACES = logindialogui.ui \ 41#The following line was changed from INTERFACES to FORMS3 by qt3to4
42FORMS3 = logindialogui.ui \
42 sendmailprogressui.ui 43 sendmailprogressui.ui
43 44
44INCLUDEPATH += ../qpe .. ../../microkde ../../microkde/kdecore ../../libetpan/include 45INCLUDEPATH += ../qpe .. ../../microkde ../../microkde/kdecore ../../libetpan/include
45LIBS += -lssl -lcrypto 46LIBS += -lssl -lcrypto
46 47
47#-lqpe -letpan 48#-lqpe -letpan
48 49
49DESTDIR = ../../bin 50DESTDIR = ../../bin
50TARGET = micromailwrapper 51TARGET = micromailwrapper
51 52
52DEFINES += DESKTOP_VERSION 53DEFINES += DESKTOP_VERSION
53unix : { 54unix : {
54OBJECTS_DIR = obj/unix 55OBJECTS_DIR = obj/unix
55MOC_DIR = moc/unix 56MOC_DIR = moc/unix
56} 57}
57win32: { 58win32: {
58DEFINES += _WIN32_ 59DEFINES += _WIN32_
59LIBS += mfc71u.lib 60LIBS += mfc71u.lib
60QMAKE_LINK += /NODEFAULTLIB:LIBC 61QMAKE_LINK += /NODEFAULTLIB:LIBC
61#QMAKE_LINK += /NODEFAULTLIB:MSVCRT 62#QMAKE_LINK += /NODEFAULTLIB:MSVCRT
62#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib 63#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib
63OBJECTS_DIR = obj/win 64OBJECTS_DIR = obj/win
64MOC_DIR = moc/win 65MOC_DIR = moc/win
65} 66}
67#The following line was inserted by qt3to4
68QT += xml qt3support
69#The following line was inserted by qt3to4
70CONFIG += uic3
71
diff --git a/kmicromail/libmailwrapper/logindialog.cpp b/kmicromail/libmailwrapper/logindialog.cpp
index 31b75d0..d1f4b5d 100644
--- a/kmicromail/libmailwrapper/logindialog.cpp
+++ b/kmicromail/libmailwrapper/logindialog.cpp
@@ -1,21 +1,21 @@
1#include <qlineedit.h> 1#include <qlineedit.h>
2 2
3#include "logindialog.h" 3#include "logindialog.h"
4 4
5 5
6 6
7//using namespace Opie::Core; 7//using namespace Opie::Core;
8 8
9LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, WFlags flags ) 9LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, Qt::WFlags flags )
10 : LoginDialogUI( parent, name, modal, flags ) 10 : LoginDialogUI( parent, name, modal, flags )
11{ 11{
12 userLine->setText( (user.isEmpty()?QString(""):user) ); 12 userLine->setText( (user.isEmpty()?QString(""):user) );
13 passLine->setText( (pass.isEmpty()?QString(""):pass) ); 13 passLine->setText( (pass.isEmpty()?QString(""):pass) );
14 _user = user; 14 _user = user;
15 _pass = pass; 15 _pass = pass;
16 16
17 if ( user.isEmpty() ) { 17 if ( user.isEmpty() ) {
18 userLine->setFocus(); 18 userLine->setFocus();
19 } else { 19 } else {
20 passLine->setFocus(); 20 passLine->setFocus();
21 } 21 }
diff --git a/kmicromail/libmailwrapper/logindialog.h b/kmicromail/libmailwrapper/logindialog.h
index f406f2c..a18daa5 100644
--- a/kmicromail/libmailwrapper/logindialog.h
+++ b/kmicromail/libmailwrapper/logindialog.h
@@ -1,23 +1,23 @@
1#ifndef LOGINDIALOG_H 1#ifndef LOGINDIALOG_H
2#define LOGINDIALOG_H 2#define LOGINDIALOG_H
3 3
4#include "logindialogui.h" 4#include "logindialogui.h"
5 5
6class LoginDialog : public LoginDialogUI 6class LoginDialog : public LoginDialogUI
7{ 7{
8 Q_OBJECT 8 Q_OBJECT
9 9
10public: 10public:
11 LoginDialog(const QString&user,const QString&pass, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); 11 LoginDialog(const QString&user,const QString&pass, QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags flags = 0 );
12 QString getUser() { return _user; } 12 QString getUser() { return _user; }
13 QString getPassword() { return _pass; } 13 QString getPassword() { return _pass; }
14 14
15protected slots: 15protected slots:
16 void accept(); 16 void accept();
17 17
18private: 18private:
19 QString _user, _pass; 19 QString _user, _pass;
20 20
21}; 21};
22 22
23#endif 23#endif
diff --git a/kmicromail/libmailwrapper/mailtypes.cpp b/kmicromail/libmailwrapper/mailtypes.cpp
index 70a0ab5..84ccf9f 100644
--- a/kmicromail/libmailwrapper/mailtypes.cpp
+++ b/kmicromail/libmailwrapper/mailtypes.cpp
@@ -1,17 +1,19 @@
1#include "mailtypes.h" 1#include "mailtypes.h"
2 2
3//#include <opie2/odebug.h> 3//#include <opie2/odebug.h>
4 4
5#include <stdlib.h> 5#include <stdlib.h>
6//Added by qt3to4:
7#include <Q3ValueList>
6 8
7using namespace Opie::Core; 9using namespace Opie::Core;
8RecMail::RecMail() 10RecMail::RecMail()
9 :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) 11 :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7)
10{ 12{
11 init(); 13 init();
12} 14}
13 15
14RecMail::RecMail(const RecMail&old) 16RecMail::RecMail(const RecMail&old)
15 :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) 17 :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7)
16{ 18{
17 init(); 19 init();
@@ -274,30 +276,30 @@ void RecPart::addParameter(const QString&key,const QString&value)
274} 276}
275 277
276const QString RecPart::searchParamter(const QString&key)const 278const QString RecPart::searchParamter(const QString&key)const
277{ 279{
278 QString value(""); 280 QString value("");
279 part_plist_t::ConstIterator it = m_Parameters.find(key); 281 part_plist_t::ConstIterator it = m_Parameters.find(key);
280 if (it != m_Parameters.end()) { 282 if (it != m_Parameters.end()) {
281 value = it.data(); 283 value = it.data();
282 } 284 }
283 return value; 285 return value;
284} 286}
285 287
286void RecPart::setPositionlist(const QValueList<int>&poslist) 288void RecPart::setPositionlist(const Q3ValueList<int>&poslist)
287{ 289{
288 m_poslist = poslist; 290 m_poslist = poslist;
289} 291}
290 292
291const QValueList<int>& RecPart::Positionlist()const 293const Q3ValueList<int>& RecPart::Positionlist()const
292{ 294{
293 return m_poslist; 295 return m_poslist;
294} 296}
295 297
296RecBody::RecBody() 298RecBody::RecBody()
297 : Opie::Core::ORefCount(),m_BodyText(),m_description(new RecPart()) 299 : Opie::Core::ORefCount(),m_BodyText(),m_description(new RecPart())
298{ 300{
299 m_PartsList.clear(); 301 m_PartsList.clear();
300} 302}
301 303
302RecBody::RecBody(const RecBody&old) 304RecBody::RecBody(const RecBody&old)
303 :Opie::Core::ORefCount(),m_BodyText(),m_PartsList(),m_description(new RecPart()) 305 :Opie::Core::ORefCount(),m_BodyText(),m_PartsList(),m_description(new RecPart())
@@ -314,31 +316,31 @@ RecBody::~RecBody()
314} 316}
315 317
316void RecBody::setBodytext(const QString&bodyText) 318void RecBody::setBodytext(const QString&bodyText)
317{ 319{
318 m_BodyText = bodyText; 320 m_BodyText = bodyText;
319} 321}
320 322
321const QString& RecBody::Bodytext()const 323const QString& RecBody::Bodytext()const
322{ 324{
323 return m_BodyText; 325 return m_BodyText;
324} 326}
325 327
326void RecBody::setParts(const QValueList<RecPartP>&parts) 328void RecBody::setParts(const Q3ValueList<RecPartP>&parts)
327{ 329{
328 m_PartsList.clear(); 330 m_PartsList.clear();
329 m_PartsList = parts; 331 m_PartsList = parts;
330} 332}
331 333
332const QValueList<RecPartP>& RecBody::Parts()const 334const Q3ValueList<RecPartP>& RecBody::Parts()const
333{ 335{
334 return m_PartsList; 336 return m_PartsList;
335} 337}
336 338
337void RecBody::addPart(const RecPartP& part) 339void RecBody::addPart(const RecPartP& part)
338{ 340{
339 m_PartsList.append(part); 341 m_PartsList.append(part);
340} 342}
341 343
342void RecBody::setDescription(const RecPartP&des) 344void RecBody::setDescription(const RecPartP&des)
343{ 345{
344 m_description = des; 346 m_description = des;
diff --git a/kmicromail/libmailwrapper/mailtypes.h b/kmicromail/libmailwrapper/mailtypes.h
index 97f10d7..ac7f8da 100644
--- a/kmicromail/libmailwrapper/mailtypes.h
+++ b/kmicromail/libmailwrapper/mailtypes.h
@@ -5,25 +5,25 @@
5#define FLAG_FLAGGED 1 5#define FLAG_FLAGGED 1
6#define FLAG_DELETED 2 6#define FLAG_DELETED 2
7#define FLAG_SEEN 3 7#define FLAG_SEEN 3
8#define FLAG_DRAFT 4 8#define FLAG_DRAFT 4
9#define FLAG_RECENT 5 9#define FLAG_RECENT 5
10 10
11#include <opie2/osmartpointer.h> 11#include <opie2/osmartpointer.h>
12 12
13#include <qbitarray.h> 13#include <qbitarray.h>
14#include <qstring.h> 14#include <qstring.h>
15#include <qstringlist.h> 15#include <qstringlist.h>
16#include <qmap.h> 16#include <qmap.h>
17#include <qvaluelist.h> 17#include <q3valuelist.h>
18 18
19class AbstractMail; 19class AbstractMail;
20/* a class to describe mails in a mailbox */ 20/* a class to describe mails in a mailbox */
21/* Attention! 21/* Attention!
22 From programmers point of view it would make sense to 22 From programmers point of view it would make sense to
23 store the mail body into this class, too. 23 store the mail body into this class, too.
24 But: not from the point of view of the device. 24 But: not from the point of view of the device.
25 Mailbodies can be real large. So we request them when 25 Mailbodies can be real large. So we request them when
26 needed from the mail-wrapper class direct from the server itself 26 needed from the mail-wrapper class direct from the server itself
27 (imap) or from a file-based cache (pop3?) 27 (imap) or from a file-based cache (pop3?)
28 So there is no interface "const QString&body()" but you should 28 So there is no interface "const QString&body()" but you should
29 make a request to the mailwrapper with this class as parameter to 29 make a request to the mailwrapper with this class as parameter to
@@ -100,25 +100,25 @@ protected:
100}; 100};
101 101
102typedef Opie::Core::OSmartPointer<RecMail> RecMailP; 102typedef Opie::Core::OSmartPointer<RecMail> RecMailP;
103typedef QMap<QString,QString> part_plist_t; 103typedef QMap<QString,QString> part_plist_t;
104 104
105class RecPart:public Opie::Core::ORefCount 105class RecPart:public Opie::Core::ORefCount
106{ 106{
107protected: 107protected:
108 QString m_type,m_subtype,m_identifier,m_encoding,m_description; 108 QString m_type,m_subtype,m_identifier,m_encoding,m_description;
109 unsigned int m_lines,m_size; 109 unsigned int m_lines,m_size;
110 part_plist_t m_Parameters; 110 part_plist_t m_Parameters;
111 /* describes the position in the mail */ 111 /* describes the position in the mail */
112 QValueList<int> m_poslist; 112 Q3ValueList<int> m_poslist;
113 113
114public: 114public:
115 RecPart(); 115 RecPart();
116 RecPart(const RecPart&); 116 RecPart(const RecPart&);
117 virtual ~RecPart(); 117 virtual ~RecPart();
118 118
119 const QString&Type()const; 119 const QString&Type()const;
120 void setType(const QString&type); 120 void setType(const QString&type);
121 const QString&Subtype()const; 121 const QString&Subtype()const;
122 void setSubtype(const QString&subtype); 122 void setSubtype(const QString&subtype);
123 const QString&Identifier()const; 123 const QString&Identifier()const;
124 void setIdentifier(const QString&identifier); 124 void setIdentifier(const QString&identifier);
@@ -127,52 +127,52 @@ public:
127 const QString&Description()const; 127 const QString&Description()const;
128 void setDescription(const QString&desc); 128 void setDescription(const QString&desc);
129 void setLines(unsigned int lines); 129 void setLines(unsigned int lines);
130 const unsigned int Lines()const; 130 const unsigned int Lines()const;
131 void setSize(unsigned int size); 131 void setSize(unsigned int size);
132 const unsigned int Size()const; 132 const unsigned int Size()const;
133 133
134 134
135 void setParameters(const part_plist_t&list); 135 void setParameters(const part_plist_t&list);
136 const part_plist_t&Parameters()const; 136 const part_plist_t&Parameters()const;
137 void addParameter(const QString&key,const QString&value); 137 void addParameter(const QString&key,const QString&value);
138 const QString searchParamter(const QString&key)const; 138 const QString searchParamter(const QString&key)const;
139 void setPositionlist(const QValueList<int>&poslist); 139 void setPositionlist(const Q3ValueList<int>&poslist);
140 const QValueList<int>& Positionlist()const; 140 const Q3ValueList<int>& Positionlist()const;
141}; 141};
142 142
143typedef Opie::Core::OSmartPointer<RecPart> RecPartP; 143typedef Opie::Core::OSmartPointer<RecPart> RecPartP;
144 144
145class RecBody:public Opie::Core::ORefCount 145class RecBody:public Opie::Core::ORefCount
146{ 146{
147protected: 147protected:
148 QString m_BodyText; 148 QString m_BodyText;
149 QString mCharset; 149 QString mCharset;
150 QValueList<RecPartP> m_PartsList; 150 Q3ValueList<RecPartP> m_PartsList;
151 RecPartP m_description; 151 RecPartP m_description;
152 152
153public: 153public:
154 RecBody(); 154 RecBody();
155 RecBody(const RecBody&old); 155 RecBody(const RecBody&old);
156 virtual ~RecBody(); 156 virtual ~RecBody();
157 void setBodytext(const QString&); 157 void setBodytext(const QString&);
158 const QString& Bodytext()const; 158 const QString& Bodytext()const;
159 void setCharset(const QString&); 159 void setCharset(const QString&);
160 QString getCharset()const; 160 QString getCharset()const;
161 161
162 void setDescription(const RecPartP&des); 162 void setDescription(const RecPartP&des);
163 const RecPartP& Description()const; 163 const RecPartP& Description()const;
164 164
165 void setParts(const QValueList<RecPartP>&parts); 165 void setParts(const Q3ValueList<RecPartP>&parts);
166 const QValueList<RecPartP>& Parts()const; 166 const Q3ValueList<RecPartP>& Parts()const;
167 void addPart(const RecPartP&part); 167 void addPart(const RecPartP&part);
168}; 168};
169 169
170typedef Opie::Core::OSmartPointer<RecBody> RecBodyP; 170typedef Opie::Core::OSmartPointer<RecBody> RecBodyP;
171 171
172class encodedString 172class encodedString
173{ 173{
174public: 174public:
175 encodedString(); 175 encodedString();
176 /* 176 /*
177 creates an new content string. 177 creates an new content string.
178 it makes a deep copy of it! 178 it makes a deep copy of it!
diff --git a/kmicromail/libmailwrapper/mailwrapper.cpp b/kmicromail/libmailwrapper/mailwrapper.cpp
index 2ee1ab3..9c299e8 100644
--- a/kmicromail/libmailwrapper/mailwrapper.cpp
+++ b/kmicromail/libmailwrapper/mailwrapper.cpp
@@ -1,19 +1,21 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <sys/types.h> 3#include <sys/types.h>
4#include <unistd.h> 4#include <unistd.h>
5#include <fcntl.h> 5#include <fcntl.h>
6#include <string.h> 6#include <string.h>
7#include <qdir.h> 7#include <qdir.h>
8//Added by qt3to4:
9#include <Q3CString>
8 10
9#include "mailwrapper.h" 11#include "mailwrapper.h"
10//#include "logindialog.h" 12//#include "logindialog.h"
11//#include "defines.h" 13//#include "defines.h"
12 14
13#define UNDEFINED 64 15#define UNDEFINED 64
14#define MAXLINE 76 16#define MAXLINE 76
15#define UTF16MASK 0x03FFUL 17#define UTF16MASK 0x03FFUL
16#define UTF16SHIFT 10 18#define UTF16SHIFT 10
17#define UTF16BASE 0x10000UL 19#define UTF16BASE 0x10000UL
18#define UTF16HIGHSTART 0xD800UL 20#define UTF16HIGHSTART 0xD800UL
19#define UTF16HIGHEND 0xDBFFUL 21#define UTF16HIGHEND 0xDBFFUL
@@ -72,49 +74,49 @@ static unsigned char base64chars[] =
72 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,"; 74 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,";
73 75
74/** 76/**
75 * Decodes base64 encoded parts of the imapfolder name 77 * Decodes base64 encoded parts of the imapfolder name
76 * Code taken from kde cvs: kdebase/kioslave/imap4/rfcdecoder.cc 78 * Code taken from kde cvs: kdebase/kioslave/imap4/rfcdecoder.cc
77 */ 79 */
78QString IMAPFolder::decodeFolderName( const QString &name ) 80QString IMAPFolder::decodeFolderName( const QString &name )
79{ 81{
80 unsigned char c, i, bitcount; 82 unsigned char c, i, bitcount;
81 unsigned long ucs4, utf16, bitbuf; 83 unsigned long ucs4, utf16, bitbuf;
82 unsigned char base64[256], utf8[6]; 84 unsigned char base64[256], utf8[6];
83 unsigned long srcPtr = 0; 85 unsigned long srcPtr = 0;
84 QCString dst = ""; 86 Q3CString dst = "";
85 QCString src = name.ascii(); 87 Q3CString src = name.ascii();
86 88
87 /* initialize modified base64 decoding table */ 89 /* initialize modified base64 decoding table */
88 memset(base64, UNDEFINED, sizeof(base64)); 90 memset(base64, UNDEFINED, sizeof(base64));
89 for (i = 0; i < sizeof(base64chars); ++i) { 91 for (i = 0; i < sizeof(base64chars); ++i) {
90 base64[(int)base64chars[i]] = i; 92 base64[(int)base64chars[i]] = i;
91 } 93 }
92 94
93 /* loop until end of string */ 95 /* loop until end of string */
94 while (srcPtr < src.length ()) { 96 while (srcPtr < src.length ()) {
95 c = src[srcPtr++]; 97 c = src.at(srcPtr++);
96 /* deal with literal characters and &- */ 98 /* deal with literal characters and &- */
97 if (c != '&' || src[srcPtr] == '-') { 99 if (c != '&' || src.at(srcPtr) == '-') {
98 /* encode literally */ 100 /* encode literally */
99 dst += c; 101 dst += c;
100 /* skip over the '-' if this is an &- sequence */ 102 /* skip over the '-' if this is an &- sequence */
101 if (c == '&') 103 if (c == '&')
102 srcPtr++; 104 srcPtr++;
103 } else { 105 } else {
104 /* convert modified UTF-7 -> UTF-16 -> UCS-4 -> UTF-8 -> HEX */ 106 /* convert modified UTF-7 -> UTF-16 -> UCS-4 -> UTF-8 -> HEX */
105 bitbuf = 0; 107 bitbuf = 0;
106 bitcount = 0; 108 bitcount = 0;
107 ucs4 = 0; 109 ucs4 = 0;
108 while ((c = base64[(unsigned char) src[srcPtr]]) != UNDEFINED) { 110 while ((c = base64[(unsigned char) src.at(srcPtr)]) != UNDEFINED) {
109 ++srcPtr; 111 ++srcPtr;
110 bitbuf = (bitbuf << 6) | c; 112 bitbuf = (bitbuf << 6) | c;
111 bitcount += 6; 113 bitcount += 6;
112 /* enough bits for a UTF-16 character? */ 114 /* enough bits for a UTF-16 character? */
113 if (bitcount >= 16) { 115 if (bitcount >= 16) {
114 bitcount -= 16; 116 bitcount -= 16;
115 utf16 = (bitcount ? bitbuf >> bitcount : bitbuf) & 0xffff; 117 utf16 = (bitcount ? bitbuf >> bitcount : bitbuf) & 0xffff;
116 /* convert UTF16 to UCS4 */ 118 /* convert UTF16 to UCS4 */
117 if (utf16 >= UTF16HIGHSTART && utf16 <= UTF16HIGHEND) { 119 if (utf16 >= UTF16HIGHSTART && utf16 <= UTF16HIGHEND) {
118 ucs4 = (utf16 - UTF16HIGHSTART) << UTF16SHIFT; 120 ucs4 = (utf16 - UTF16HIGHSTART) << UTF16SHIFT;
119 continue; 121 continue;
120 } else if (utf16 >= UTF16LOSTART && utf16 <= UTF16LOEND) { 122 } else if (utf16 >= UTF16LOSTART && utf16 <= UTF16LOEND) {
@@ -140,25 +142,25 @@ QString IMAPFolder::decodeFolderName( const QString &name )
140 utf8[1] = 0x80 | ((ucs4 >> 12) & 0x3f); 142 utf8[1] = 0x80 | ((ucs4 >> 12) & 0x3f);
141 utf8[2] = 0x80 | ((ucs4 >> 6) & 0x3f); 143 utf8[2] = 0x80 | ((ucs4 >> 6) & 0x3f);
142 utf8[3] = 0x80 | (ucs4 & 0x3f); 144 utf8[3] = 0x80 | (ucs4 & 0x3f);
143 i = 4; 145 i = 4;
144 } 146 }
145 /* copy it */ 147 /* copy it */
146 for (c = 0; c < i; ++c) { 148 for (c = 0; c < i; ++c) {
147 dst += utf8[c]; 149 dst += utf8[c];
148 } 150 }
149 } 151 }
150 } 152 }
151 /* skip over trailing '-' in modified UTF-7 encoding */ 153 /* skip over trailing '-' in modified UTF-7 encoding */
152 if (src[srcPtr] == '-') 154 if (src.at(srcPtr) == '-')
153 ++srcPtr; 155 ++srcPtr;
154 } 156 }
155 } 157 }
156 158
157 return QString::fromUtf8( dst.data() ); 159 return QString::fromUtf8( dst.data() );
158} 160}
159 161
160Mail::Mail() 162Mail::Mail()
161 :Opie::Core::ORefCount(),name(""), mail(""), to(""), cc(""), bcc(""), reply(""), subject(""), message("") 163 :Opie::Core::ORefCount(),name(""), mail(""), to(""), cc(""), bcc(""), reply(""), subject(""), message("")
162{ 164{
163} 165}
164 166
diff --git a/kmicromail/libmailwrapper/mailwrapper.h b/kmicromail/libmailwrapper/mailwrapper.h
index 3e8b51f..bebabf4 100644
--- a/kmicromail/libmailwrapper/mailwrapper.h
+++ b/kmicromail/libmailwrapper/mailwrapper.h
@@ -1,20 +1,22 @@
1#ifndef MAILWRAPPER_H 1#ifndef MAILWRAPPER_H
2#define MAILWRAPPER_H 2#define MAILWRAPPER_H
3 3
4//#include <qpe/applnk.h> 4//#include <qpe/applnk.h>
5 5
6#include <qbitarray.h> 6#include <qbitarray.h>
7#include <qdatetime.h> 7#include <qdatetime.h>
8#include <qfileinfo.h> 8#include <qfileinfo.h>
9//Added by qt3to4:
10#include <QPixmap>
9#include <kiconloader.h> 11#include <kiconloader.h>
10 12
11#include "settings.h" 13#include "settings.h"
12 14
13#include <opie2/osmartpointer.h> 15#include <opie2/osmartpointer.h>
14/* 16/*
15class Attachment 17class Attachment
16{ 18{
17public: 19public:
18 Attachment( DocLnk lnk ); 20 Attachment( DocLnk lnk );
19 virtual ~Attachment(){} 21 virtual ~Attachment(){}
20 const QString getFileName()const{ return doc.file(); } 22 const QString getFileName()const{ return doc.file(); }
@@ -52,50 +54,50 @@ protected:
52 54
53class Mail:public Opie::Core::ORefCount 55class Mail:public Opie::Core::ORefCount
54{ 56{
55public: 57public:
56 Mail(); 58 Mail();
57 /* Possible that this destructor must not be declared virtual 59 /* Possible that this destructor must not be declared virtual
58 * 'cause it seems that it will never have some child classes. 60 * 'cause it seems that it will never have some child classes.
59 * in this case this object will not get a virtual table -> memory and 61 * in this case this object will not get a virtual table -> memory and
60 * speed will be a little bit better? 62 * speed will be a little bit better?
61 */ 63 */
62 virtual ~Mail(){} 64 virtual ~Mail(){}
63 void addAttachment( Attachment *att ) { attList.append( att ); } 65 void addAttachment( Attachment *att ) { attList.append( att ); }
64 const QList<Attachment>& getAttachments()const { return attList; } 66 const QList<Attachment*>& getAttachments()const { return attList; }
65 void removeAttachment( Attachment *att ) { attList.remove( att ); } 67 void removeAttachment( Attachment *att ) { attList.remove( att ); }
66 const QString&getName()const { return name; } 68 const QString&getName()const { return name; }
67 void setName( QString s ) { name = s; } 69 void setName( QString s ) { name = s; }
68 const QString&getMail()const{ return mail; } 70 const QString&getMail()const{ return mail; }
69 void setMail( const QString&s ) { mail = s; } 71 void setMail( const QString&s ) { mail = s; }
70 const QString&getTo()const{ return to; } 72 const QString&getTo()const{ return to; }
71 void setTo( const QString&s ) { to = s; } 73 void setTo( const QString&s ) { to = s; }
72 const QString&getCC()const{ return cc; } 74 const QString&getCC()const{ return cc; }
73 void setCC( const QString&s ) { cc = s; } 75 void setCC( const QString&s ) { cc = s; }
74 const QString&getBCC()const { return bcc; } 76 const QString&getBCC()const { return bcc; }
75 void setBCC( const QString&s ) { bcc = s; } 77 void setBCC( const QString&s ) { bcc = s; }
76 const QString&getMessage()const { return message; } 78 const QString&getMessage()const { return message; }
77 void setMessage( const QString&s ) { message = s; } 79 void setMessage( const QString&s ) { message = s; }
78 const QString&getSubject()const { return subject; } 80 const QString&getSubject()const { return subject; }
79 void setSubject( const QString&s ) { subject = s; } 81 void setSubject( const QString&s ) { subject = s; }
80 const QString&getReply()const{ return reply; } 82 const QString&getReply()const{ return reply; }
81 void setReply( const QString&a ) { reply = a; } 83 void setReply( const QString&a ) { reply = a; }
82 void setInreply(const QStringList&list){m_in_reply_to = list;} 84 void setInreply(const QStringList&list){m_in_reply_to = list;}
83 const QStringList&Inreply()const{return m_in_reply_to;} 85 const QStringList&Inreply()const{return m_in_reply_to;}
84 86
85 void setCharset( const QString&a ) { charset= a; } 87 void setCharset( const QString&a ) { charset= a; }
86 const QString& getCharset() const { return charset; } 88 const QString& getCharset() const { return charset; }
87 89
88private: 90private:
89 QList<Attachment> attList; 91 QList<Attachment*> attList;
90 QString name, mail, to, cc, bcc, reply, subject, message, charset; 92 QString name, mail, to, cc, bcc, reply, subject, message, charset;
91 QStringList m_in_reply_to; 93 QStringList m_in_reply_to;
92}; 94};
93 95
94class Folder:public Opie::Core::ORefCount 96class Folder:public Opie::Core::ORefCount
95{ 97{
96public: 98public:
97 Folder( const QString&init_name,const QString&sep ); 99 Folder( const QString&init_name,const QString&sep );
98 virtual ~Folder(); 100 virtual ~Folder();
99 const QString&getDisplayName()const { return nameDisplay; } 101 const QString&getDisplayName()const { return nameDisplay; }
100 const QString&getName()const { return name; } 102 const QString&getName()const { return name; }
101 const QString&getPrefix()const{return prefix; } 103 const QString&getPrefix()const{return prefix; }
diff --git a/kmicromail/libmailwrapper/mboxwrapper.cpp b/kmicromail/libmailwrapper/mboxwrapper.cpp
index 87f8c8a..888cae2 100644
--- a/kmicromail/libmailwrapper/mboxwrapper.cpp
+++ b/kmicromail/libmailwrapper/mboxwrapper.cpp
@@ -1,65 +1,67 @@
1#include "mboxwrapper.h" 1#include "mboxwrapper.h"
2#include "mailtypes.h" 2#include "mailtypes.h"
3#include "mailwrapper.h" 3#include "mailwrapper.h"
4#include <libetpan/libetpan.h> 4#include <libetpan/libetpan.h>
5#include <qdir.h> 5#include <qdir.h>
6//Added by qt3to4:
7#include <Q3ValueList>
6#include <stdlib.h> 8#include <stdlib.h>
7#include <klocale.h> 9#include <klocale.h>
8 10
9 11
10#include <qpe/global.h> 12#include <qpe/global.h>
11 13
12using namespace Opie::Core; 14using namespace Opie::Core;
13MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) 15MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name)
14 : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name) 16 : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name)
15{ 17{
16 QDir dir(MBOXPath); 18 QDir dir(MBOXPath);
17 if (!dir.exists()) { 19 if (!dir.exists()) {
18 dir.mkdir(MBOXPath); 20 dir.mkdir(MBOXPath);
19 } 21 }
20} 22}
21 23
22MBOXwrapper::~MBOXwrapper() 24MBOXwrapper::~MBOXwrapper()
23{ 25{
24} 26}
25 27
26void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target ) 28void MBOXwrapper::listMessages(const QString & mailbox, Q3ValueList<RecMailP> &target )
27{ 29{
28 mailstorage*storage = mailstorage_new(NULL); 30 mailstorage*storage = mailstorage_new(NULL);
29 QString p = MBOXPath+"/"; 31 QString p = MBOXPath+"/";
30 p+=mailbox; 32 p+=mailbox;
31 33
32 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); 34 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
33 mailfolder*folder; 35 mailfolder*folder;
34 folder = mailfolder_new( storage,(char*)p.latin1(),NULL); 36 folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
35 r = mailfolder_connect(folder); 37 r = mailfolder_connect(folder);
36 if (r != MAIL_NO_ERROR) { 38 if (r != MAIL_NO_ERROR) {
37 //odebug << "Error initializing mbox" << oendl; 39 //odebug << "Error initializing mbox" << oendl;
38 mailfolder_free(folder); 40 mailfolder_free(folder);
39 mailstorage_free(storage); 41 mailstorage_free(storage);
40 return; 42 return;
41 } 43 }
42 44
43 parseList(target,folder->fld_session,mailbox); 45 parseList(target,folder->fld_session,mailbox);
44 46
45 mailfolder_disconnect(folder); 47 mailfolder_disconnect(folder);
46 mailfolder_free(folder); 48 mailfolder_free(folder);
47 mailstorage_free(storage); 49 mailstorage_free(storage);
48 Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); 50 Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count()));
49} 51}
50 52
51QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() 53Q3ValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders()
52{ 54{
53 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); 55 Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >();
54 QDir dir(MBOXPath); 56 QDir dir(MBOXPath);
55 if (!dir.exists()) return folders; 57 if (!dir.exists()) return folders;
56 dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); 58 dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable);
57 QStringList entries = dir.entryList(); 59 QStringList entries = dir.entryList();
58 QStringList::ConstIterator it = entries.begin(); 60 QStringList::ConstIterator it = entries.begin();
59 for (;it!=entries.end();++it) { 61 for (;it!=entries.end();++it) {
60 FolderP inb=new Folder(*it,"/"); 62 FolderP inb=new Folder(*it,"/");
61 folders->append(inb); 63 folders->append(inb);
62 } 64 }
63 return folders; 65 return folders;
64} 66}
65 67
@@ -208,43 +210,43 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail)
208 mailstorage_free(storage); 210 mailstorage_free(storage);
209 mailmessage_free(msg); 211 mailmessage_free(msg);
210 return 0; 212 return 0;
211 } 213 }
212 encodedString*result = new encodedString(data,size); 214 encodedString*result = new encodedString(data,size);
213 215
214 mailfolder_free(folder); 216 mailfolder_free(folder);
215 mailstorage_free(storage); 217 mailstorage_free(storage);
216 mailmessage_free(msg); 218 mailmessage_free(msg);
217 return result; 219 return result;
218} 220}
219 221
220void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) 222void MBOXwrapper::deleteMails(const QString & mailbox,const Q3ValueList<RecMailP> &target)
221{ 223{
222 QString p = MBOXPath+"/"; 224 QString p = MBOXPath+"/";
223 p+=mailbox; 225 p+=mailbox;
224 mailmbox_folder*f = 0; 226 mailmbox_folder*f = 0;
225 int r = mailmbox_init(p.latin1(),0,1,0,&f); 227 int r = mailmbox_init(p.latin1(),0,1,0,&f);
226 if (r != MAIL_NO_ERROR) { 228 if (r != MAIL_NO_ERROR) {
227 ; // << "Error init folder" << oendl; 229 ; // << "Error init folder" << oendl;
228 return; 230 return;
229 } 231 }
230 deleteMails(f,target); 232 deleteMails(f,target);
231 mailmbox_done(f); 233 mailmbox_done(f);
232} 234}
233 235
234void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target) 236void MBOXwrapper::deleteMails(mailmbox_folder*f,const Q3ValueList<RecMailP> &target)
235{ 237{
236 if (!f) return; 238 if (!f) return;
237 int r; 239 int r;
238 QValueList<RecMailP>::ConstIterator it; 240 Q3ValueList<RecMailP>::ConstIterator it;
239 for (it=target.begin(); it != target.end();++it) { 241 for (it=target.begin(); it != target.end();++it) {
240 r = mailmbox_delete_msg(f,(*it)->getNumber()); 242 r = mailmbox_delete_msg(f,(*it)->getNumber());
241 if (r!=MAILMBOX_NO_ERROR) { 243 if (r!=MAILMBOX_NO_ERROR) {
242 ; // << "error delete mail" << oendl; 244 ; // << "error delete mail" << oendl;
243 } 245 }
244 } 246 }
245 r = mailmbox_expunge(f); 247 r = mailmbox_expunge(f);
246 if (r != MAILMBOX_NO_ERROR) { 248 if (r != MAILMBOX_NO_ERROR) {
247 ; // << "error expunge mailbox" << oendl; 249 ; // << "error expunge mailbox" << oendl;
248 } 250 }
249} 251}
250 252
diff --git a/kmicromail/libmailwrapper/mboxwrapper.h b/kmicromail/libmailwrapper/mboxwrapper.h
index d03940f..e658a71 100644
--- a/kmicromail/libmailwrapper/mboxwrapper.h
+++ b/kmicromail/libmailwrapper/mboxwrapper.h
@@ -1,47 +1,49 @@
1#ifndef __MBOX_WRAPPER_H 1#ifndef __MBOX_WRAPPER_H
2#define __MBOX_WRAPPER_H 2#define __MBOX_WRAPPER_H
3 3
4#include "genericwrapper.h" 4#include "genericwrapper.h"
5#include <qstring.h> 5#include <qstring.h>
6//Added by qt3to4:
7#include <Q3ValueList>
6 8
7class encodedString; 9class encodedString;
8struct mailmbox_folder; 10struct mailmbox_folder;
9 11
10class MBOXwrapper : public Genericwrapper 12class MBOXwrapper : public Genericwrapper
11{ 13{
12 Q_OBJECT 14 Q_OBJECT
13 15
14public: 16public:
15 MBOXwrapper(const QString & dir,const QString&name); 17 MBOXwrapper(const QString & dir,const QString&name);
16 virtual ~MBOXwrapper(); 18 virtual ~MBOXwrapper();
17 19
18 virtual void listMessages(const QString & mailbox, QValueList<RecMailP>&target ); 20 virtual void listMessages(const QString & mailbox, Q3ValueList<RecMailP>&target );
19 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); 21 virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders();
20 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 22 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
21 23
22 virtual void deleteMail(const RecMailP&mail); 24 virtual void deleteMail(const RecMailP&mail);
23 virtual void answeredMail(const RecMailP&mail); 25 virtual void answeredMail(const RecMailP&mail);
24 26
25 virtual int createMbox(const QString&folder,const Opie::Core::OSmartPointer<Folder>&f=0, 27 virtual int createMbox(const QString&folder,const Opie::Core::OSmartPointer<Folder>&f=0,
26 const QString&d="",bool s=false); 28 const QString&d="",bool s=false);
27 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&); 29 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&);
28 30
29 virtual void storeMessage(const char*msg,size_t length, const QString&folder); 31 virtual void storeMessage(const char*msg,size_t length, const QString&folder);
30 32
31 virtual RecBodyP fetchBody( const RecMailP &mail ); 33 virtual RecBodyP fetchBody( const RecMailP &mail );
32 static void mbox_progress( size_t current, size_t maximum ); 34 static void mbox_progress( size_t current, size_t maximum );
33 35
34 virtual encodedString* fetchRawBody(const RecMailP&mail); 36 virtual encodedString* fetchRawBody(const RecMailP&mail);
35 virtual void deleteMails(const QString & FolderName,const QValueList<RecMailP> &target); 37 virtual void deleteMails(const QString & FolderName,const Q3ValueList<RecMailP> &target);
36 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); 38 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&);
37 virtual MAILLIB::ATYPE getType()const; 39 virtual MAILLIB::ATYPE getType()const;
38 virtual const QString&getName()const; 40 virtual const QString&getName()const;
39 virtual Account* getAccount() { return 0; }; 41 virtual Account* getAccount() { return 0; };
40 42
41protected: 43protected:
42 static void deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target); 44 static void deleteMails(mailmbox_folder*f,const Q3ValueList<RecMailP> &target);
43 QString MBOXPath; 45 QString MBOXPath;
44 QString MBOXName; 46 QString MBOXName;
45}; 47};
46 48
47#endif 49#endif
diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp
index 787e85d..4cd7a94 100644
--- a/kmicromail/libmailwrapper/mhwrapper.cpp
+++ b/kmicromail/libmailwrapper/mhwrapper.cpp
@@ -1,19 +1,21 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#include "mhwrapper.h" 2#include "mhwrapper.h"
3#include "mailtypes.h" 3#include "mailtypes.h"
4#include "mailwrapper.h" 4#include "mailwrapper.h"
5#include <libetpan/libetpan.h> 5#include <libetpan/libetpan.h>
6#include <qdir.h> 6#include <qdir.h>
7#include <qmessagebox.h> 7#include <qmessagebox.h>
8//Added by qt3to4:
9#include <Q3ValueList>
8#include <stdlib.h> 10#include <stdlib.h>
9#include <qpe/global.h> 11#include <qpe/global.h>
10#include <klocale.h> 12#include <klocale.h>
11#include <kglobal.h> 13#include <kglobal.h>
12//#include <opie2/odebug.h> 14//#include <opie2/odebug.h>
13 15
14using namespace Opie::Core; 16using namespace Opie::Core;
15MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) 17MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name)
16 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) 18 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name)
17{ 19{
18 if (MHPath.length()>0) { 20 if (MHPath.length()>0) {
19 if (MHPath[MHPath.length()-1]=='/') { 21 if (MHPath[MHPath.length()-1]=='/') {
@@ -55,43 +57,43 @@ void MHwrapper::clean_storage()
55 if (m_storage) { 57 if (m_storage) {
56 mailstorage_disconnect(m_storage); 58 mailstorage_disconnect(m_storage);
57 mailstorage_free(m_storage); 59 mailstorage_free(m_storage);
58 m_storage = 0; 60 m_storage = 0;
59 } 61 }
60} 62}
61 63
62MHwrapper::~MHwrapper() 64MHwrapper::~MHwrapper()
63{ 65{
64 clean_storage(); 66 clean_storage();
65} 67}
66 68
67void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) 69void MHwrapper::listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb )
68{ 70{
69 init_storage(); 71 init_storage();
70 if (!m_storage) { 72 if (!m_storage) {
71 return; 73 return;
72 } 74 }
73 QString f = buildPath(mailbox); 75 QString f = buildPath(mailbox);
74 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 76 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
75 if (r!=MAIL_NO_ERROR) { 77 if (r!=MAIL_NO_ERROR) {
76 qDebug("listMessages: error selecting folder! "); 78 qDebug("listMessages: error selecting folder! ");
77 return; 79 return;
78 } 80 }
79 parseList(target,m_storage->sto_session,f, false, maxSizeInKb ); 81 parseList(target,m_storage->sto_session,f, false, maxSizeInKb );
80 Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); 82 Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count()));
81} 83}
82 84
83QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() 85Q3ValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders()
84{ 86{
85 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); 87 Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >();
86 /* this is needed! */ 88 /* this is needed! */
87 if (m_storage) mailstorage_disconnect(m_storage); 89 if (m_storage) mailstorage_disconnect(m_storage);
88 init_storage(); 90 init_storage();
89 if (!m_storage) { 91 if (!m_storage) {
90 return folders; 92 return folders;
91 } 93 }
92 mail_list*flist = 0; 94 mail_list*flist = 0;
93 clistcell*current=0; 95 clistcell*current=0;
94 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist); 96 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist);
95 if (r != MAIL_NO_ERROR || !flist) { 97 if (r != MAIL_NO_ERROR || !flist) {
96 qDebug("error getting folder list "); 98 qDebug("error getting folder list ");
97 return folders; 99 return folders;
@@ -246,33 +248,33 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail)
246 } 248 }
247 r = mailmessage_fetch(msg,&data,&size); 249 r = mailmessage_fetch(msg,&data,&size);
248 if (r != MAIL_NO_ERROR) { 250 if (r != MAIL_NO_ERROR) {
249 Global::statusMessage(i18n("Error fetching mail %i").arg(mail->getNumber())); 251 Global::statusMessage(i18n("Error fetching mail %i").arg(mail->getNumber()));
250 if (msg) mailmessage_free(msg); 252 if (msg) mailmessage_free(msg);
251 return 0; 253 return 0;
252 } 254 }
253 result = new encodedString(data,size); 255 result = new encodedString(data,size);
254 if (msg) mailmessage_free(msg); 256 if (msg) mailmessage_free(msg);
255 return result; 257 return result;
256} 258}
257 259
258void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) 260void MHwrapper::deleteMails(const QString & mailbox,const Q3ValueList<RecMailP> &target)
259{ 261{
260 QString f = buildPath(mailbox); 262 QString f = buildPath(mailbox);
261 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 263 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
262 if (r!=MAIL_NO_ERROR) { 264 if (r!=MAIL_NO_ERROR) {
263 qDebug("deleteMails: error selecting folder! "); 265 qDebug("deleteMails: error selecting folder! ");
264 return; 266 return;
265 } 267 }
266 QValueList<RecMailP>::ConstIterator it; 268 Q3ValueList<RecMailP>::ConstIterator it;
267 for (it=target.begin(); it!=target.end();++it) { 269 for (it=target.begin(); it!=target.end();++it) {
268 r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); 270 r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber());
269 if (r != MAIL_NO_ERROR) { 271 if (r != MAIL_NO_ERROR) {
270 qDebug("error deleting mail "); 272 qDebug("error deleting mail ");
271 break; 273 break;
272 } 274 }
273 } 275 }
274} 276}
275 277
276int MHwrapper::deleteAllMail(const FolderP&tfolder) 278int MHwrapper::deleteAllMail(const FolderP&tfolder)
277{ 279{
278 init_storage(); 280 init_storage();
diff --git a/kmicromail/libmailwrapper/mhwrapper.h b/kmicromail/libmailwrapper/mhwrapper.h
index 36a443a..6151ff1 100644
--- a/kmicromail/libmailwrapper/mhwrapper.h
+++ b/kmicromail/libmailwrapper/mhwrapper.h
@@ -1,51 +1,53 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#ifndef __MH_WRAPPER_H 2#ifndef __MH_WRAPPER_H
3#define __MH_WRAPPER_H 3#define __MH_WRAPPER_H
4 4
5#include "maildefines.h" 5#include "maildefines.h"
6 6
7#include "genericwrapper.h" 7#include "genericwrapper.h"
8#include <qstring.h> 8#include <qstring.h>
9//Added by qt3to4:
10#include <Q3ValueList>
9 11
10class encodedString; 12class encodedString;
11struct mailmbox_folder; 13struct mailmbox_folder;
12class MHwrapper : public Genericwrapper 14class MHwrapper : public Genericwrapper
13{ 15{
14 Q_OBJECT 16 Q_OBJECT
15public: 17public:
16 MHwrapper(const QString & dir,const QString&name); 18 MHwrapper(const QString & dir,const QString&name);
17 virtual ~MHwrapper(); 19 virtual ~MHwrapper();
18 20
19 virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); 21 virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 );
20 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); 22 virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders();
21 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 23 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
22 24
23 virtual void deleteMail(const RecMailP&mail); 25 virtual void deleteMail(const RecMailP&mail);
24 virtual void answeredMail(const RecMailP&mail); 26 virtual void answeredMail(const RecMailP&mail);
25 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 27 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
26 virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, 28 virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,
27 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 29 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
28 30
29 virtual int createMbox(const QString&folder,const Opie::Core::OSmartPointer<Folder>&f=0, 31 virtual int createMbox(const QString&folder,const Opie::Core::OSmartPointer<Folder>&f=0,
30 const QString&d="",bool s=false); 32 const QString&d="",bool s=false);
31 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&); 33 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&);
32 34
33 virtual void storeMessage(const char*msg,size_t length, const QString&folder); 35 virtual void storeMessage(const char*msg,size_t length, const QString&folder);
34 36
35 virtual RecBodyP fetchBody( const RecMailP &mail ); 37 virtual RecBodyP fetchBody( const RecMailP &mail );
36 static void mbox_progress( size_t current, size_t maximum ); 38 static void mbox_progress( size_t current, size_t maximum );
37 39
38 virtual encodedString* fetchRawBody(const RecMailP&mail); 40 virtual encodedString* fetchRawBody(const RecMailP&mail);
39 virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> > &target); 41 virtual void deleteMails(const QString & FolderName,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target);
40 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); 42 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&);
41 virtual MAILLIB::ATYPE getType()const; 43 virtual MAILLIB::ATYPE getType()const;
42 virtual const QString&getName()const; 44 virtual const QString&getName()const;
43 virtual Account* getAccount() { return 0; }; 45 virtual Account* getAccount() { return 0; };
44 46
45public slots: 47public slots:
46 48
47protected: 49protected:
48 QString buildPath(const QString&p); 50 QString buildPath(const QString&p);
49 QString MHPath; 51 QString MHPath;
50 QString MHName; 52 QString MHName;
51 53
diff --git a/kmicromail/libmailwrapper/nntpwrapper.cpp b/kmicromail/libmailwrapper/nntpwrapper.cpp
index 93cd2b5..b328ecd 100644
--- a/kmicromail/libmailwrapper/nntpwrapper.cpp
+++ b/kmicromail/libmailwrapper/nntpwrapper.cpp
@@ -1,18 +1,20 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#include "nntpwrapper.h" 2#include "nntpwrapper.h"
3#include "logindialog.h" 3#include "logindialog.h"
4#include "mailtypes.h" 4#include "mailtypes.h"
5 5
6#include <qfile.h> 6#include <qfile.h>
7//Added by qt3to4:
8#include <Q3ValueList>
7 9
8#include <stdlib.h> 10#include <stdlib.h>
9 11
10#include <libetpan/libetpan.h> 12#include <libetpan/libetpan.h>
11 13
12 14
13 15
14#define HARD_MSG_SIZE_LIMIT 5242880 16#define HARD_MSG_SIZE_LIMIT 5242880
15 17
16using namespace Opie::Core; 18using namespace Opie::Core;
17NNTPwrapper::NNTPwrapper( NNTPaccount *a ) 19NNTPwrapper::NNTPwrapper( NNTPaccount *a )
18: Genericwrapper() { 20: Genericwrapper() {
@@ -51,32 +53,32 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) {
51 ; // << "Message to large: " << mail->Msgsize() << "" << oendl; 53 ; // << "Message to large: " << mail->Msgsize() << "" << oendl;
52 return body; 54 return body;
53 } 55 }
54 56
55 QFile msg_cache(msgTempName); 57 QFile msg_cache(msgTempName);
56 58
57 cleanMimeCache(); 59 cleanMimeCache();
58 60
59 if (mail->getNumber()!=last_msg_id) { 61 if (mail->getNumber()!=last_msg_id) {
60 if (msg_cache.exists()) { 62 if (msg_cache.exists()) {
61 msg_cache.remove(); 63 msg_cache.remove();
62 } 64 }
63 msg_cache.open(IO_ReadWrite|IO_Truncate); 65 msg_cache.open(QIODevice::ReadWrite|QIODevice::Truncate);
64 last_msg_id = mail->getNumber(); 66 last_msg_id = mail->getNumber();
65 err = mailsession_get_message(m_nntp->sto_session, mail->getNumber(), &mailmsg); 67 err = mailsession_get_message(m_nntp->sto_session, mail->getNumber(), &mailmsg);
66 err = mailmessage_fetch(mailmsg,&message,&length); 68 err = mailmessage_fetch(mailmsg,&message,&length);
67 msg_cache.writeBlock(message,length); 69 msg_cache.writeBlock(message,length);
68 } else { 70 } else {
69 QString msg=""; 71 QString msg="";
70 msg_cache.open(IO_ReadOnly); 72 msg_cache.open(QIODevice::ReadOnly);
71 message = new char[4096]; 73 message = new char[4096];
72 memset(message,0,4096); 74 memset(message,0,4096);
73 while (msg_cache.readBlock(message,4095)>0) { 75 while (msg_cache.readBlock(message,4095)>0) {
74 msg+=message; 76 msg+=message;
75 memset(message,0,4096); 77 memset(message,0,4096);
76 } 78 }
77 delete message; 79 delete message;
78 message = (char*)malloc(msg.length()+1*sizeof(char)); 80 message = (char*)malloc(msg.length()+1*sizeof(char));
79 memset(message,0,msg.length()+1); 81 memset(message,0,msg.length()+1);
80 memcpy(message,msg.latin1(),msg.length()); 82 memcpy(message,msg.latin1(),msg.length());
81 /* transform to libetpan stuff */ 83 /* transform to libetpan stuff */
82 mailmsg = mailmessage_new(); 84 mailmsg = mailmessage_new();
@@ -90,25 +92,25 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) {
90 body = parseMail(mailmsg); 92 body = parseMail(mailmsg);
91 93
92 /* clean up */ 94 /* clean up */
93 if (mailmsg) 95 if (mailmsg)
94 mailmessage_free(mailmsg); 96 mailmessage_free(mailmsg);
95 if (message) 97 if (message)
96 free(message); 98 free(message);
97 99
98 return body; 100 return body;
99} 101}
100 102
101 103
102void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb) 104void NNTPwrapper::listMessages(const QString & which, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb)
103{ 105{
104 login(); 106 login();
105 if (!m_nntp) 107 if (!m_nntp)
106 return; 108 return;
107 uint32_t res_messages,res_recent,res_unseen; 109 uint32_t res_messages,res_recent,res_unseen;
108 mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); 110 mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen);
109 parseList(target,m_nntp->sto_session,which,true, maxSizeInKb); 111 parseList(target,m_nntp->sto_session,which,true, maxSizeInKb);
110} 112}
111 113
112void NNTPwrapper::login() 114void NNTPwrapper::login()
113{ 115{
114 if (account->getOffline()) 116 if (account->getOffline())
@@ -177,27 +179,27 @@ void NNTPwrapper::login()
177 179
178} 180}
179 181
180void NNTPwrapper::logout() 182void NNTPwrapper::logout()
181{ 183{
182 int err = NEWSNNTP_NO_ERROR; 184 int err = NEWSNNTP_NO_ERROR;
183 if ( m_nntp == NULL ) 185 if ( m_nntp == NULL )
184 return; 186 return;
185 mailstorage_free(m_nntp); 187 mailstorage_free(m_nntp);
186 m_nntp = 0; 188 m_nntp = 0;
187} 189}
188 190
189QValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { 191Q3ValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() {
190 192
191 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); 193 Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >();
192 QStringList groups; 194 QStringList groups;
193 if (account) { 195 if (account) {
194 groups = account->getGroups(); 196 groups = account->getGroups();
195 } 197 }
196 for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) { 198 for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) {
197 folders->append(new Folder((*it),".")); 199 folders->append(new Folder((*it),"."));
198 } 200 }
199 return folders; 201 return folders;
200} 202}
201 203
202/* we made this method in raw nntp access of etpan and not via generic interface 204/* we made this method in raw nntp access of etpan and not via generic interface
203 * 'cause in that case there will be doubled copy operations. eg. the etpan would 205 * 'cause in that case there will be doubled copy operations. eg. the etpan would
diff --git a/kmicromail/libmailwrapper/nntpwrapper.h b/kmicromail/libmailwrapper/nntpwrapper.h
index 8c54f12..7c8e671 100644
--- a/kmicromail/libmailwrapper/nntpwrapper.h
+++ b/kmicromail/libmailwrapper/nntpwrapper.h
@@ -1,38 +1,40 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#ifndef __NNTPWRAPPER 2#ifndef __NNTPWRAPPER
3#define __NNTPWRAPPER 3#define __NNTPWRAPPER
4 4
5#include "mailwrapper.h" 5#include "mailwrapper.h"
6#include "genericwrapper.h" 6#include "genericwrapper.h"
7#include <qstring.h> 7#include <qstring.h>
8//Added by qt3to4:
9#include <Q3ValueList>
8#include <libetpan/clist.h> 10#include <libetpan/clist.h>
9 11
10class encodedString; 12class encodedString;
11struct mailstorage; 13struct mailstorage;
12struct mailfolder; 14struct mailfolder;
13 15
14class NNTPwrapper : public Genericwrapper 16class NNTPwrapper : public Genericwrapper
15{ 17{
16 18
17 Q_OBJECT 19 Q_OBJECT
18 20
19public: 21public:
20 NNTPwrapper( NNTPaccount *a ); 22 NNTPwrapper( NNTPaccount *a );
21 virtual ~NNTPwrapper(); 23 virtual ~NNTPwrapper();
22 24
23 /* mailbox will be ignored */ 25 /* mailbox will be ignored */
24 virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); 26 virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 );
25 /* should only get the subscribed one */ 27 /* should only get the subscribed one */
26 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); 28 virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders();
27 /* mailbox will be ignored */ 29 /* mailbox will be ignored */
28 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 30 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
29 QStringList listAllNewsgroups(const QString&mask = QString::null); 31 QStringList listAllNewsgroups(const QString&mask = QString::null);
30 virtual void deleteMail(const RecMailP&mail); 32 virtual void deleteMail(const RecMailP&mail);
31 virtual void answeredMail(const RecMailP&mail); 33 virtual void answeredMail(const RecMailP&mail);
32 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); 34 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&);
33 35
34 virtual RecBodyP fetchBody( const RecMailP &mail ); 36 virtual RecBodyP fetchBody( const RecMailP &mail );
35 virtual encodedString* fetchRawBody(const RecMailP&mail); 37 virtual encodedString* fetchRawBody(const RecMailP&mail);
36 virtual void logout(); 38 virtual void logout();
37 virtual MAILLIB::ATYPE getType()const; 39 virtual MAILLIB::ATYPE getType()const;
38 virtual const QString&getName()const; 40 virtual const QString&getName()const;
diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp
index 2888f7c..ebeed71 100644
--- a/kmicromail/libmailwrapper/pop3wrapper.cpp
+++ b/kmicromail/libmailwrapper/pop3wrapper.cpp
@@ -1,25 +1,27 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#include <stdlib.h> 2#include <stdlib.h>
3#include "pop3wrapper.h" 3#include "pop3wrapper.h"
4#include "mailtypes.h" 4#include "mailtypes.h"
5#include "logindialog.h" 5#include "logindialog.h"
6#include <libetpan/libetpan.h> 6#include <libetpan/libetpan.h>
7 7
8#include <klocale.h> 8#include <klocale.h>
9 9
10#include <qpe/global.h> 10#include <qpe/global.h>
11#include <qfile.h> 11#include <qfile.h>
12#include <qprogressbar.h> 12#include <q3progressbar.h>
13#include <qapplication.h> 13#include <qapplication.h>
14//Added by qt3to4:
15#include <Q3ValueList>
14 16
15/* we don't fetch messages larger than 5 MB */ 17/* we don't fetch messages larger than 5 MB */
16#define HARD_MSG_SIZE_LIMIT 5242880 18#define HARD_MSG_SIZE_LIMIT 5242880
17 19
18using namespace Opie::Core; 20using namespace Opie::Core;
19POP3wrapper::POP3wrapper( POP3account *a ) 21POP3wrapper::POP3wrapper( POP3account *a )
20: Genericwrapper() { 22: Genericwrapper() {
21 account = a; 23 account = a;
22 m_pop3 = NULL; 24 m_pop3 = NULL;
23 msgTempName = a->getFileName()+"_msg_cache"; 25 msgTempName = a->getFileName()+"_msg_cache";
24 last_msg_id = 0; 26 last_msg_id = 0;
25} 27}
@@ -53,32 +55,32 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) {
53 ; // odebug << "Message to large: " << mail->Msgsize() << "" << oendl; 55 ; // odebug << "Message to large: " << mail->Msgsize() << "" << oendl;
54 return body; 56 return body;
55 } 57 }
56 58
57 QFile msg_cache(msgTempName); 59 QFile msg_cache(msgTempName);
58 60
59 cleanMimeCache(); 61 cleanMimeCache();
60 62
61 if (mail->getNumber()!=last_msg_id) { 63 if (mail->getNumber()!=last_msg_id) {
62 if (msg_cache.exists()) { 64 if (msg_cache.exists()) {
63 msg_cache.remove(); 65 msg_cache.remove();
64 } 66 }
65 msg_cache.open(IO_ReadWrite|IO_Truncate); 67 msg_cache.open(QIODevice::ReadWrite|QIODevice::Truncate);
66 last_msg_id = mail->getNumber(); 68 last_msg_id = mail->getNumber();
67 err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); 69 err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg);
68 err = mailmessage_fetch(mailmsg,&message,&length); 70 err = mailmessage_fetch(mailmsg,&message,&length);
69 msg_cache.writeBlock(message,length); 71 msg_cache.writeBlock(message,length);
70 } else { 72 } else {
71 QString msg=""; 73 QString msg="";
72 msg_cache.open(IO_ReadOnly); 74 msg_cache.open(QIODevice::ReadOnly);
73 message = new char[4096]; 75 message = new char[4096];
74 memset(message,0,4096); 76 memset(message,0,4096);
75 while (msg_cache.readBlock(message,4095)>0) { 77 while (msg_cache.readBlock(message,4095)>0) {
76 msg+=message; 78 msg+=message;
77 memset(message,0,4096); 79 memset(message,0,4096);
78 } 80 }
79 delete message; 81 delete message;
80 message = (char*)malloc(msg.length()+1*sizeof(char)); 82 message = (char*)malloc(msg.length()+1*sizeof(char));
81 memset(message,0,msg.length()+1); 83 memset(message,0,msg.length()+1);
82 memcpy(message,msg.latin1(),msg.length()); 84 memcpy(message,msg.latin1(),msg.length());
83 /* transform to libetpan stuff */ 85 /* transform to libetpan stuff */
84 mailmsg = mailmessage_new(); 86 mailmsg = mailmessage_new();
@@ -91,25 +93,25 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) {
91 } 93 }
92 body = parseMail(mailmsg); 94 body = parseMail(mailmsg);
93 95
94 /* clean up */ 96 /* clean up */
95 if (mailmsg) 97 if (mailmsg)
96 mailmessage_free(mailmsg); 98 mailmessage_free(mailmsg);
97 if (message) 99 if (message)
98 free(message); 100 free(message);
99 101
100 return body; 102 return body;
101} 103}
102 104
103void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) 105void POP3wrapper::listMessages(const QString &, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb )
104{ 106{
105 login(); 107 login();
106 if (!m_pop3) 108 if (!m_pop3)
107 return; 109 return;
108 uint32_t res_messages,res_recent,res_unseen; 110 uint32_t res_messages,res_recent,res_unseen;
109 mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); 111 mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen);
110 parseList(target,m_pop3->sto_session,"INBOX", false, maxSizeInKb); 112 parseList(target,m_pop3->sto_session,"INBOX", false, maxSizeInKb);
111 Global::statusMessage( i18n("Mailbox contains %1 mail(s)").arg(res_messages)); 113 Global::statusMessage( i18n("Mailbox contains %1 mail(s)").arg(res_messages));
112} 114}
113 115
114void POP3wrapper::login() 116void POP3wrapper::login()
115{ 117{
@@ -178,40 +180,40 @@ void POP3wrapper::login()
178 } 180 }
179} 181}
180 182
181void POP3wrapper::logout() 183void POP3wrapper::logout()
182{ 184{
183 if ( m_pop3 == NULL ) 185 if ( m_pop3 == NULL )
184 return; 186 return;
185 mailstorage_free(m_pop3); 187 mailstorage_free(m_pop3);
186 m_pop3 = 0; 188 m_pop3 = 0;
187} 189}
188 190
189 191
190QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { 192Q3ValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() {
191 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<FolderP>(); 193 Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<FolderP>();
192 FolderP inb=new Folder("INBOX","/"); 194 FolderP inb=new Folder("INBOX","/");
193 folders->append(inb); 195 folders->append(inb);
194 return folders; 196 return folders;
195} 197}
196 198
197void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) 199void POP3wrapper::deleteMailList(const Q3ValueList<RecMailP>&target)
198{ 200{
199 login(); 201 login();
200 if (!m_pop3) 202 if (!m_pop3)
201 return; 203 return;
202 int iii = 0; 204 int iii = 0;
203 int count = target.count(); 205 int count = target.count();
204 206
205 QProgressBar wid ( count ); 207 Q3ProgressBar wid ( count );
206 wid.setCaption( i18n("Deleting ...")); 208 wid.setCaption( i18n("Deleting ..."));
207 wid.show(); 209 wid.show();
208 while (iii < count ) { 210 while (iii < count ) {
209 Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); 211 Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count));
210 wid.setProgress( iii ); 212 wid.setProgress( iii );
211 wid.raise(); 213 wid.raise();
212 qApp->processEvents(); 214 qApp->processEvents();
213 //qDebug("delete "); 215 //qDebug("delete ");
214 RecMailP mail = (*target.at( iii )); 216 RecMailP mail = (*target.at( iii ));
215 int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); 217 int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber());
216 if (err != MAIL_NO_ERROR) { 218 if (err != MAIL_NO_ERROR) {
217 Global::statusMessage(i18n("Error deleting mail")); 219 Global::statusMessage(i18n("Error deleting mail"));
@@ -237,25 +239,25 @@ int POP3wrapper::deleteAllMail(const FolderP&) {
237 return 0; 239 return 0;
238 int res = 1; 240 int res = 1;
239 241
240 uint32_t result = 0; 242 uint32_t result = 0;
241 int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result); 243 int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result);
242 if (err != MAIL_NO_ERROR) { 244 if (err != MAIL_NO_ERROR) {
243 Global::statusMessage(i18n("Error getting folder info")); 245 Global::statusMessage(i18n("Error getting folder info"));
244 return 0; 246 return 0;
245 } 247 }
246 248
247 249
248 250
249 QProgressBar wid ( result ); 251 Q3ProgressBar wid ( result );
250 wid.setCaption( i18n("Deleting ...")); 252 wid.setCaption( i18n("Deleting ..."));
251 wid.show(); 253 wid.show();
252 for (unsigned int i = 0; i < result; ++i) { 254 for (unsigned int i = 0; i < result; ++i) {
253 Global::statusMessage(i18n("Delete message %1 of %2").arg(i).arg(result)); 255 Global::statusMessage(i18n("Delete message %1 of %2").arg(i).arg(result));
254 wid.setProgress( i ); 256 wid.setProgress( i );
255 wid.raise(); 257 wid.raise();
256 qApp->processEvents(); 258 qApp->processEvents();
257 259
258 err = mailsession_remove_message(m_pop3->sto_session,i+1); 260 err = mailsession_remove_message(m_pop3->sto_session,i+1);
259 if (err != MAIL_NO_ERROR) { 261 if (err != MAIL_NO_ERROR) {
260 Global::statusMessage(i18n("Error deleting mail %1").arg(i+1)); 262 Global::statusMessage(i18n("Error deleting mail %1").arg(i+1));
261 res=0; 263 res=0;
diff --git a/kmicromail/libmailwrapper/pop3wrapper.h b/kmicromail/libmailwrapper/pop3wrapper.h
index ebc2fc7..a077877 100644
--- a/kmicromail/libmailwrapper/pop3wrapper.h
+++ b/kmicromail/libmailwrapper/pop3wrapper.h
@@ -1,39 +1,41 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#ifndef __POP3WRAPPER 2#ifndef __POP3WRAPPER
3#define __POP3WRAPPER 3#define __POP3WRAPPER
4 4
5#include "mailwrapper.h" 5#include "mailwrapper.h"
6#include "genericwrapper.h" 6#include "genericwrapper.h"
7#include <qstring.h> 7#include <qstring.h>
8//Added by qt3to4:
9#include <Q3ValueList>
8 10
9class encodedString; 11class encodedString;
10struct mailstorage; 12struct mailstorage;
11struct mailfolder; 13struct mailfolder;
12 14
13class POP3wrapper : public Genericwrapper 15class POP3wrapper : public Genericwrapper
14{ 16{
15 Q_OBJECT 17 Q_OBJECT
16 18
17public: 19public:
18 POP3wrapper( POP3account *a ); 20 POP3wrapper( POP3account *a );
19 virtual ~POP3wrapper(); 21 virtual ~POP3wrapper();
20 /* mailbox will be ignored */ 22 /* mailbox will be ignored */
21 virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); 23 virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 );
22 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); 24 virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders();
23 /* mailbox will be ignored */ 25 /* mailbox will be ignored */
24 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 26 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
25 27
26 virtual void deleteMail(const RecMailP&mail); 28 virtual void deleteMail(const RecMailP&mail);
27 virtual void deleteMailList(const QValueList<RecMailP>&target); 29 virtual void deleteMailList(const Q3ValueList<RecMailP>&target);
28 virtual void answeredMail(const RecMailP&mail); 30 virtual void answeredMail(const RecMailP&mail);
29 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); 31 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&);
30 32
31 virtual RecBodyP fetchBody( const RecMailP &mail ); 33 virtual RecBodyP fetchBody( const RecMailP &mail );
32 virtual encodedString* fetchRawBody(const RecMailP&mail); 34 virtual encodedString* fetchRawBody(const RecMailP&mail);
33 virtual void logout(); 35 virtual void logout();
34 virtual MAILLIB::ATYPE getType()const; 36 virtual MAILLIB::ATYPE getType()const;
35 virtual const QString&getName()const; 37 virtual const QString&getName()const;
36 static void pop3_progress( size_t current, size_t maximum ); 38 static void pop3_progress( size_t current, size_t maximum );
37 virtual Account* getAccount() { return account; }; 39 virtual Account* getAccount() { return account; };
38protected: 40protected:
39 void login(); 41 void login();
diff --git a/kmicromail/libmailwrapper/sendmailprogress.cpp b/kmicromail/libmailwrapper/sendmailprogress.cpp
index 20dfe9b..6cd6409 100644
--- a/kmicromail/libmailwrapper/sendmailprogress.cpp
+++ b/kmicromail/libmailwrapper/sendmailprogress.cpp
@@ -1,14 +1,14 @@
1#include "sendmailprogress.h" 1#include "sendmailprogress.h"
2#include <qprogressbar.h> 2#include <q3progressbar.h>
3#include <qlabel.h> 3#include <qlabel.h>
4#include <klocale.h> 4#include <klocale.h>
5 5
6progressMailSend::progressMailSend(QWidget*parent, const char * name) 6progressMailSend::progressMailSend(QWidget*parent, const char * name)
7 :progressMailSendUI(parent,name,true),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0) 7 :progressMailSendUI(parent,name,true),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0)
8{ 8{
9} 9}
10 10
11progressMailSend::~progressMailSend() 11progressMailSend::~progressMailSend()
12{ 12{
13} 13}
14 14
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp
index 9436d43..fc01528 100644
--- a/kmicromail/libmailwrapper/settings.cpp
+++ b/kmicromail/libmailwrapper/settings.cpp
@@ -1,17 +1,17 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <qdir.h> 2#include <qdir.h>
3 3
4#include <qtextcodec.h> 4#include <qtextcodec.h>
5#include <qtextstream.h> 5#include <q3textstream.h>
6#include <qfile.h> 6#include <qfile.h>
7 7
8//#include <opie2/odebug.h> 8//#include <opie2/odebug.h>
9#include <kconfig.h> 9#include <kconfig.h>
10 10
11#include <kstandarddirs.h> 11#include <kstandarddirs.h>
12#include "settings.h" 12#include "settings.h"
13//#include "defines.h" 13//#include "defines.h"
14 14
15#define IMAP_PORT "143" 15#define IMAP_PORT "143"
16#define IMAP_SSL_PORT "993" 16#define IMAP_SSL_PORT "993"
17#define SMTP_PORT "25" 17#define SMTP_PORT "25"
@@ -367,52 +367,52 @@ SMTPaccount::SMTPaccount( QString filename )
367 login = false; 367 login = false;
368 type = MAILLIB::A_SMTP; 368 type = MAILLIB::A_SMTP;
369 port = SMTP_PORT; 369 port = SMTP_PORT;
370} 370}
371 371
372QString SMTPaccount::getSignature() 372QString SMTPaccount::getSignature()
373{ 373{
374 QFileInfo fi ( signature ); 374 QFileInfo fi ( signature );
375 if ( ! fi.exists() ) 375 if ( ! fi.exists() )
376 return QString(); 376 return QString();
377 377
378 QFile file( signature ); 378 QFile file( signature );
379 if (!file.open( IO_ReadOnly ) ) { 379 if (!file.open( QIODevice::ReadOnly ) ) {
380 return QString(); 380 return QString();
381 381
382 } 382 }
383 QTextStream ts( &file ); 383 Q3TextStream ts( &file );
384 ts.setCodec( QTextCodec::codecForName("utf8") ); 384 ts.setCodec( QTextCodec::codecForName("utf8") );
385 QString text = ts.read(); 385 QString text = ts.read();
386 file.close(); 386 file.close();
387 387
388 return text; 388 return text;
389 389
390} 390}
391void SMTPaccount::setSignature( QString b ) 391void SMTPaccount::setSignature( QString b )
392{ 392{
393 393
394 QFileInfo fi ( signature ); 394 QFileInfo fi ( signature );
395 if ( ! fi.exists() ) { 395 if ( ! fi.exists() ) {
396 QString filedir( locateLocal("data", "kopiemail" ) ); 396 QString filedir( locateLocal("data", "kopiemail" ) );
397 signature = filedir+ "/" + getAccountName() +".sig"; 397 signature = filedir+ "/" + getAccountName() +".sig";
398 qDebug("new sig %s ", signature.latin1()); 398 qDebug("new sig %s ", signature.latin1());
399 save(); 399 save();
400 } 400 }
401 QFile fileIn( signature ); 401 QFile fileIn( signature );
402 if (!fileIn.open( IO_WriteOnly ) ) { 402 if (!fileIn.open( QIODevice::WriteOnly ) ) {
403 qDebug("OM: Cannot write signature file %s ", signature.latin1() ); 403 qDebug("OM: Cannot write signature file %s ", signature.latin1() );
404 return ; 404 return ;
405 } 405 }
406 QTextStream tsIn( &fileIn ); 406 Q3TextStream tsIn( &fileIn );
407 tsIn.setCodec( QTextCodec::codecForName("utf8") ); 407 tsIn.setCodec( QTextCodec::codecForName("utf8") );
408 tsIn << b ; 408 tsIn << b ;
409 fileIn.close(); 409 fileIn.close();
410} 410}
411QString SMTPaccount::getUniqueFileName() 411QString SMTPaccount::getUniqueFileName()
412{ 412{
413 int num = 0; 413 int num = 0;
414 QString unique; 414 QString unique;
415 415
416 QDir dir( locateLocal("data", "kopiemail" ) ); 416 QDir dir( locateLocal("data", "kopiemail" ) );
417 417
418 QStringList imap = dir.entryList( "smtp-*" ); 418 QStringList imap = dir.entryList( "smtp-*" );
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp
index 7c813cc..2df55ff 100644
--- a/kmicromail/libmailwrapper/smtpwrapper.cpp
+++ b/kmicromail/libmailwrapper/smtpwrapper.cpp
@@ -1,23 +1,25 @@
1#include "smtpwrapper.h" 1#include "smtpwrapper.h"
2#include "mailwrapper.h" 2#include "mailwrapper.h"
3#include "abstractmail.h" 3#include "abstractmail.h"
4#include "logindialog.h" 4#include "logindialog.h"
5#include "mailtypes.h" 5#include "mailtypes.h"
6#include "sendmailprogress.h" 6#include "sendmailprogress.h"
7 7
8//#include <opie2/odebug.h> 8//#include <opie2/odebug.h>
9//#include <qt.h> 9//#include <qt.h>
10#include <qapplication.h> 10#include <qapplication.h>
11#include <qmessagebox.h> 11#include <qmessagebox.h>
12//Added by qt3to4:
13#include <Q3ValueList>
12#include <stdlib.h> 14#include <stdlib.h>
13#ifndef DESKTOP_VERSION 15#ifndef DESKTOP_VERSION
14//#include <qpe/config.h> 16//#include <qpe/config.h>
15#include <qpe/qcopenvelope_qws.h> 17#include <qpe/qcopenvelope_qws.h>
16#endif 18#endif
17#include <libetpan/libetpan.h> 19#include <libetpan/libetpan.h>
18#include <klocale.h> 20#include <klocale.h>
19#include <kglobal.h> 21#include <kglobal.h>
20#include <kconfig.h> 22#include <kconfig.h>
21 23
22 24
23using namespace Opie::Core; 25using namespace Opie::Core;
@@ -425,26 +427,26 @@ bool SMTPwrapper::flushOutbox() {
425 ; // odebug << "No smtp account given" << oendl; 427 ; // odebug << "No smtp account given" << oendl;
426 return false; 428 return false;
427 } 429 }
428 430
429 bool reset_user_value = false; 431 bool reset_user_value = false;
430 QString localfolders = AbstractMail::defaultLocalfolder(); 432 QString localfolders = AbstractMail::defaultLocalfolder();
431 AbstractMail*wrap = AbstractMail::getWrapper(localfolders); 433 AbstractMail*wrap = AbstractMail::getWrapper(localfolders);
432 if (!wrap) { 434 if (!wrap) {
433 ; // odebug << "memory error" << oendl; 435 ; // odebug << "memory error" << oendl;
434 return false; 436 return false;
435 } 437 }
436 QString oldPw, oldUser; 438 QString oldPw, oldUser;
437 QValueList<RecMailP> mailsToSend; 439 Q3ValueList<RecMailP> mailsToSend;
438 QValueList<RecMailP> mailsToRemove; 440 Q3ValueList<RecMailP> mailsToRemove;
439 QString mbox("Outgoing"); 441 QString mbox("Outgoing");
440 wrap->listMessages(mbox,mailsToSend); 442 wrap->listMessages(mbox,mailsToSend);
441 if (mailsToSend.count()==0) { 443 if (mailsToSend.count()==0) {
442 delete wrap; 444 delete wrap;
443 ; // odebug << "No mails to send" << oendl; 445 ; // odebug << "No mails to send" << oendl;
444 return false; 446 return false;
445 } 447 }
446 448
447 oldPw = m_SmtpAccount->getPassword(); 449 oldPw = m_SmtpAccount->getPassword();
448 oldUser = m_SmtpAccount->getUser(); 450 oldUser = m_SmtpAccount->getUser();
449 if (m_SmtpAccount->getLogin() && (m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty()) ) { 451 if (m_SmtpAccount->getLogin() && (m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty()) ) {
450 // get'em 452 // get'em
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp
index 41cee52..d8eee7d 100644
--- a/kmicromail/mailistviewitem.cpp
+++ b/kmicromail/mailistviewitem.cpp
@@ -1,21 +1,21 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2#include "mailistviewitem.h" 2#include "mailistviewitem.h"
3#include <libmailwrapper/abstractmail.h> 3#include <libmailwrapper/abstractmail.h>
4#include <qtextstream.h> 4#include <q3textstream.h>
5#include <kiconloader.h> 5#include <kiconloader.h>
6#include "koprefs.h" 6#include "koprefs.h"
7//#include <qpe/resource.h> 7//#include <qpe/resource.h>
8 8
9MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) 9MailListViewItem::MailListViewItem(Q3ListView * parent, MailListViewItem * item )
10 :KListViewItem(parent,item),mail_data() 10 :KListViewItem(parent,item),mail_data()
11{ 11{
12} 12}
13 13
14void MailListViewItem::showEntry() 14void MailListViewItem::showEntry()
15{ 15{
16 if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { 16 if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) {
17 setPixmap( 0, SmallIcon ( "kmmsgreplied") ); 17 setPixmap( 0, SmallIcon ( "kmmsgreplied") );
18 mKeyMap.insert(0, "r" ); 18 mKeyMap.insert(0, "r" );
19 } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { 19 } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) {
20 /* I think it looks nicer if there are not such a log of icons but only on mails 20 /* I think it looks nicer if there are not such a log of icons but only on mails
21 replied or new - Alwin*/ 21 replied or new - Alwin*/
diff --git a/kmicromail/mailistviewitem.h b/kmicromail/mailistviewitem.h
index b409c9d..ecc01ba 100644
--- a/kmicromail/mailistviewitem.h
+++ b/kmicromail/mailistviewitem.h
@@ -1,24 +1,24 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2#ifndef __MAILLISTVIEWITEM_H 2#ifndef __MAILLISTVIEWITEM_H
3#define __MAILLISTVIEWITEM_H 3#define __MAILLISTVIEWITEM_H
4 4
5#include <klistview.h> 5#include <klistview.h>
6#include <libmailwrapper/mailtypes.h> 6#include <libmailwrapper/mailtypes.h>
7#include <libmailwrapper/maildefines.h> 7#include <libmailwrapper/maildefines.h>
8 8
9class MailListViewItem:public KListViewItem 9class MailListViewItem:public KListViewItem
10{ 10{
11public: 11public:
12 MailListViewItem(QListView * parent, MailListViewItem * after ); 12 MailListViewItem(Q3ListView * parent, MailListViewItem * after );
13 virtual ~MailListViewItem(){} 13 virtual ~MailListViewItem(){}
14 14
15 void storeData(const RecMailP&data); 15 void storeData(const RecMailP&data);
16 const RecMailP&data()const; 16 const RecMailP&data()const;
17 void showEntry(); 17 void showEntry();
18 MAILLIB::ATYPE wrapperType(); 18 MAILLIB::ATYPE wrapperType();
19 QString key(int column, bool) const; 19 QString key(int column, bool) const;
20 void setSortKey(int column,const QString &key); 20 void setSortKey(int column,const QString &key);
21protected: 21protected:
22 RecMailP mail_data; 22 RecMailP mail_data;
23 private: 23 private:
24 QMap<int,QString> mKeyMap; 24 QMap<int,QString> mKeyMap;
diff --git a/kmicromail/main.cpp b/kmicromail/main.cpp
index fe4bc76..dc73455 100644
--- a/kmicromail/main.cpp
+++ b/kmicromail/main.cpp
@@ -1,37 +1,40 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2 2
3 3
4#ifndef DESKTOP_VERSION 4#ifndef DESKTOP_VERSION
5#include <qpe/qpeapplication.h> 5#include <qpe/qpeapplication.h>
6//Added by qt3to4:
7#include <Q3CString>
6#include <libkdepim/externalapphandler.h> 8#include <libkdepim/externalapphandler.h>
7#include <stdlib.h> 9#include <stdlib.h>
8#else 10#else
9#include <qapplication.h> 11#include <qapplication.h>
10#include <qstring.h> 12#include <qstring.h>
11#include <qwindowsstyle.h> 13#include <qwindowsstyle.h>
12#include <qplatinumstyle.h> 14#include <qplatinumstyle.h>
13#include <qsgistyle.h> 15#include <qsgistyle.h>
14#endif 16#endif
15#include "opiemail.h" 17#include "opiemail.h"
16#include <qdir.h> 18#include <qdir.h>
17#include <kstandarddirs.h> 19#include <kstandarddirs.h>
18#include <kglobal.h> 20#include <kglobal.h>
19#include <stdio.h> 21#include <stdio.h>
20#include "mainwindow.h" 22#include "mainwindow.h"
21#include "koprefs.h" 23#include "koprefs.h"
22#include <libkdepim/kpimglobalprefs.h> 24#include <libkdepim/kpimglobalprefs.h>
23void dumpMissing(); 25void dumpMissing();
24//using namespace Opie::Core; 26//using namespace Opie::Core;
25int main( int argc, char **argv ) { 27int main( int argc, char **argv ) {
28 if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi");
26 29
27#ifndef DESKTOP_VERSION 30#ifndef DESKTOP_VERSION
28 QPEApplication a( argc, argv ); 31 QPEApplication a( argc, argv );
29 a.setKeepRunning (); 32 a.setKeepRunning ();
30#else 33#else
31 QApplication a( argc, argv ); 34 QApplication a( argc, argv );
32 QApplication::setStyle( new QPlatinumStyle ()); 35 QApplication::setStyle( new QPlatinumStyle ());
33#endif 36#endif
34 //a.setFont( KOPrefs::instance()->mAppFont ); 37 //a.setFont( KOPrefs::instance()->mAppFont );
35 KGlobal::setAppName( "kopiemail" ); 38 KGlobal::setAppName( "kopiemail" );
36 QString fileName ; 39 QString fileName ;
37#ifndef DESKTOP_VERSION 40#ifndef DESKTOP_VERSION
@@ -42,25 +45,25 @@ int main( int argc, char **argv ) {
42 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/"); 45 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/");
43#else 46#else
44 fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/icons22/"; 47 fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/icons22/";
45 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 48 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
46#endif 49#endif
47 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kopiemail"))); 50 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kopiemail")));
48 KPimGlobalPrefs::instance()->setGlobalConfig(); 51 KPimGlobalPrefs::instance()->setGlobalConfig();
49 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); 52 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
50 QApplication::setFont( KOPrefs::instance()->mAppFont ); 53 QApplication::setFont( KOPrefs::instance()->mAppFont );
51 OpieMail mw; 54 OpieMail mw;
52#ifndef DESKTOP_VERSION 55#ifndef DESKTOP_VERSION
53 //qDebug("CONNECT "); 56 //qDebug("CONNECT ");
54 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& ))); 57 QObject::connect( &a, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )),&mw, SLOT(message( const Q3CString&, const QByteArray& )));
55 // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 58 // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
56 a.showMainWidget(&mw ); 59 a.showMainWidget(&mw );
57#else 60#else
58 a.setMainWidget(&mw ); 61 a.setMainWidget(&mw );
59 mw.show(); 62 mw.show();
60 //m.resize( 800, 600 ); 63 //m.resize( 800, 600 );
61 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); 64 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
62#endif 65#endif
63 int rv = a.exec(); 66 int rv = a.exec();
64 dumpMissing(); 67 dumpMissing();
65 68
66 KPimGlobalPrefs::instance()->writeConfig(); 69 KPimGlobalPrefs::instance()->writeConfig();
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index d547dda..627d92e 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -1,55 +1,61 @@
1 1
2// CHANGED 2004-08-06 Lutz Rogowski 2// CHANGED 2004-08-06 Lutz Rogowski
3#include <qlabel.h> 3#include <qlabel.h>
4#include <qvbox.h> 4#include <q3vbox.h>
5#include <qheader.h> 5#include <q3header.h>
6#include <qtimer.h> 6#include <qtimer.h>
7#include <qlayout.h> 7#include <qlayout.h>
8//Added by qt3to4:
9#include <Q3CString>
10#include <Q3GridLayout>
11#include <Q3ValueList>
12#include <QPixmap>
13#include <Q3PopupMenu>
8//#include <kdialog.h> 14//#include <kdialog.h>
9#include <kiconloader.h> 15#include <kiconloader.h>
10#include <kapplication.h> 16#include <kapplication.h>
11 17
12#ifdef DESKTOP_VERSION 18#ifdef DESKTOP_VERSION
13#include <qapplication.h> 19#include <qapplication.h>
14#include <qstatusbar.h> 20#include <qstatusbar.h>
15#include <kabc/stdaddressbook.h> 21#include <kabc/stdaddressbook.h>
16extern QStatusBar* globalSstatusBarMainWindow; 22extern QStatusBar* globalSstatusBarMainWindow;
17#else 23#else
18#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
19#include <klocale.h> 25#include <klocale.h>
20#endif 26#endif
21#include "defines.h" 27#include "defines.h"
22#include "koprefs.h" 28#include "koprefs.h"
23#include "mainwindow.h" 29#include "mainwindow.h"
24#include "mailistviewitem.h" 30#include "mailistviewitem.h"
25#include <KDGanttMinimizeSplitter.h> 31#include <KDGanttMinimizeSplitter.h>
26#include <libkdepim/kpimglobalprefs.h> 32#include <libkdepim/kpimglobalprefs.h>
27 33
28#include "koprefs.h" 34#include "koprefs.h"
29 35
30MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) 36MainWindow::MainWindow( QWidget *parent, const char *name, Qt::WFlags flags )
31 : QMainWindow( parent, name ) //, flags ) 37 : Q3MainWindow( parent, name ) //, flags )
32{ 38{
33#ifdef DESKTOP_VERSION 39#ifdef DESKTOP_VERSION
34 globalSstatusBarMainWindow = statusBar(); 40 globalSstatusBarMainWindow = statusBar();
35#endif 41#endif
36 setCaption( i18n( "KOpieMail/Pi" ) ); 42 setCaption( i18n( "KOpieMail/Pi" ) );
37 setToolBarsMovable( false ); 43 setToolBarsMovable( false );
38 //KABC::StdAddressBook::self(); 44 //KABC::StdAddressBook::self();
39 toolBar = new QToolBar( this ); 45 toolBar = new Q3ToolBar( this );
40 menuBar = new QPEMenuBar( toolBar ); 46 menuBar = new QPEMenuBar( toolBar );
41 mailMenu = new QPopupMenu( menuBar ); 47 mailMenu = new Q3PopupMenu( menuBar );
42 menuBar->insertItem( i18n( "Mail" ), mailMenu ); 48 menuBar->insertItem( i18n( "Mail" ), mailMenu );
43 settingsMenu = new QPopupMenu( menuBar ); 49 settingsMenu = new Q3PopupMenu( menuBar );
44 menuBar->insertItem( i18n( "Settings" ), settingsMenu ); 50 menuBar->insertItem( i18n( "Settings" ), settingsMenu );
45 51
46 addToolBar( toolBar ); 52 addToolBar( toolBar );
47 toolBar->setHorizontalStretchable( true ); 53 toolBar->setHorizontalStretchable( true );
48 QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), 54 QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"),
49 0, 0, this ); 55 0, 0, this );
50 connect(getMail, SIGNAL( activated() ), 56 connect(getMail, SIGNAL( activated() ),
51 SLOT( slotGetAllMail() ) ); 57 SLOT( slotGetAllMail() ) );
52 getMail->addTo( mailMenu ); 58 getMail->addTo( mailMenu );
53 59
54 getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), 60 getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"),
55 0, 0, this ); 61 0, 0, this );
@@ -105,50 +111,50 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
105 111
106 QAction * editSettings2 = new QAction( i18n( "Global Settings..." ), SmallIcon("SettingsIcon") , 112 QAction * editSettings2 = new QAction( i18n( "Global Settings..." ), SmallIcon("SettingsIcon") ,
107 0, 0, this ); 113 0, 0, this );
108 editSettings2->addTo( settingsMenu ); 114 editSettings2->addTo( settingsMenu );
109 connect( editSettings2, SIGNAL( activated() ), 115 connect( editSettings2, SIGNAL( activated() ),
110 SLOT( slotEditGlobalSettings() ) ); 116 SLOT( slotEditGlobalSettings() ) );
111 117
112 118
113 119
114 editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , 120 editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") ,
115 0, 0, this ); 121 0, 0, this );
116 editAccounts->addTo( settingsMenu ); 122 editAccounts->addTo( settingsMenu );
117 codecMenu = new QPopupMenu( menuBar ); 123 codecMenu = new Q3PopupMenu( menuBar );
118 codecMenu->insertItem( "Western (iso-8859-1)",0,0); 124 codecMenu->insertItem( "Western (iso-8859-1)",0,0);
119 codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); 125 codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1);
120 codecMenu->insertItem( "Western (iso-8859-15)",2,2); 126 codecMenu->insertItem( "Western (iso-8859-15)",2,2);
121 codecMenu->insertItem( "Chinese (big-5)",3,3); 127 codecMenu->insertItem( "Chinese (big-5)",3,3);
122 codecMenu->insertItem( "Unicode (utf-8)",4,4); 128 codecMenu->insertItem( "Unicode (utf-8)",4,4);
123 codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); 129 codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5);
124 //disabled 130 //disabled
125 //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); 131 //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu);
126 //setCentralWidget( view ); 132 //setCentralWidget( view );
127 133
128 QVBox* wrapperBox = new QVBox( this ); 134 Q3VBox* wrapperBox = new Q3VBox( this );
129 setCentralWidget( wrapperBox ); 135 setCentralWidget( wrapperBox );
130 136
131 // QWidget *view = new QWidget( wrapperBox ); 137 // QWidget *view = new QWidget( wrapperBox );
132 KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox); 138 KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox);
133 splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); 139 splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down);
134 KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); 140 KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor);
135 split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); 141 split->setMinimizeDirection( KDGanttMinimizeSplitter::Left);
136 //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); 142 //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight );
137 subLE = 0; 143 subLE = 0;
138 fromLE = 0; 144 fromLE = 0;
139 toLE = 0; 145 toLE = 0;
140 if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { 146 if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) {
141 QWidget* infoBox = new QWidget( splithor ); 147 QWidget* infoBox = new QWidget( splithor );
142 QGridLayout *griLay = new QGridLayout( infoBox, 2,2); 148 Q3GridLayout *griLay = new Q3GridLayout( infoBox, 2,2);
143 if ( KOPrefs::instance()->mShowInfoSub ) { 149 if ( KOPrefs::instance()->mShowInfoSub ) {
144 griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); 150 griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 );
145 griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; 151 griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ;
146 } 152 }
147 if ( KOPrefs::instance()->mShowInfoFrom ) { 153 if ( KOPrefs::instance()->mShowInfoFrom ) {
148 griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); 154 griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 );
149 griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; 155 griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ;
150 } 156 }
151 if ( KOPrefs::instance()->mShowInfoTo ) { 157 if ( KOPrefs::instance()->mShowInfoTo ) {
152 griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); 158 griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 );
153 griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; 159 griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ;
154 } 160 }
@@ -159,116 +165,116 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
159 } 165 }
160 166
161 167
162 folderView = new AccountView( split ); 168 folderView = new AccountView( split );
163 folderView->header()->hide(); 169 folderView->header()->hide();
164 folderView->setRootIsDecorated( false ); 170 folderView->setRootIsDecorated( false );
165 folderView->addColumn( i18n( "Mailbox" ) ); 171 folderView->addColumn( i18n( "Mailbox" ) );
166 172
167 //layout->addWidget( folderView ); 173 //layout->addWidget( folderView );
168 174
169 mailView = new KListView( split ); 175 mailView = new KListView( split );
170 mailView->addColumn( i18n( " " ) ); 176 mailView->addColumn( i18n( " " ) );
171 mailView->addColumn( i18n( "Subject" ),QListView::Manual ); 177 mailView->addColumn( i18n( "Subject" ),Q3ListView::Manual );
172 mailView->addColumn( i18n( "Sender" ),QListView::Manual ); 178 mailView->addColumn( i18n( "Sender" ),Q3ListView::Manual );
173 mailView->addColumn( i18n( "Size" ),QListView::Manual); 179 mailView->addColumn( i18n( "Size" ),Q3ListView::Manual);
174 mailView->addColumn( i18n( "Date" ),QListView::Manual); 180 mailView->addColumn( i18n( "Date" ),Q3ListView::Manual);
175 if ( KOPrefs::instance()->mShowToField ) 181 if ( KOPrefs::instance()->mShowToField )
176 mailView->addColumn( i18n( "To" ),QListView::Manual); 182 mailView->addColumn( i18n( "To" ),Q3ListView::Manual);
177 mailView->setAllColumnsShowFocus(true); 183 mailView->setAllColumnsShowFocus(true);
178 //mailView->setSorting(-1); 184 //mailView->setSorting(-1);
179 mailView->setRootIsDecorated( false ); 185 mailView->setRootIsDecorated( false );
180 statusWidget = new StatusWidget( wrapperBox ); 186 statusWidget = new StatusWidget( wrapperBox );
181 statusWidget->hide(); 187 statusWidget->hide();
182 mailView->setSelectionMode( QListView::Multi ); 188 mailView->setSelectionMode( Q3ListView::Multi );
183 mailView->setMultiSelection( true); 189 mailView->setMultiSelection( true);
184 mailView->setAlternateBackground(KPimGlobalPrefs::instance()->mAlternateColor ); 190 mailView->setAlternateBackground(KPimGlobalPrefs::instance()->mAlternateColor );
185 //layout->addWidget( mailView ); 191 //layout->addWidget( mailView );
186 //layout->setStretchFactor( folderView, 1 ); 192 //layout->setStretchFactor( folderView, 1 );
187 //layout->setStretchFactor( mailView, 2 ); 193 //layout->setStretchFactor( mailView, 2 );
188 194
189 slotAdjustLayout(); 195 slotAdjustLayout();
190#ifndef DESKTOP_VERSION 196#ifndef DESKTOP_VERSION
191 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); 197 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold);
192 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); 198 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold);
193 if ( subLE ) 199 if ( subLE )
194 QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); 200 QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold);
195 if ( fromLE ) 201 if ( fromLE )
196 QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); 202 QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold);
197 if ( toLE ) 203 if ( toLE )
198 QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); 204 QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold);
199#endif 205#endif
200 connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, 206 connect( mailView, SIGNAL( doubleClicked (Q3ListViewItem* )),this,
201 SLOT( mailLeftClicked(QListViewItem*) ) ); 207 SLOT( mailLeftClicked(Q3ListViewItem*) ) );
202 connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, 208 connect( mailView, SIGNAL( returnPressed (Q3ListViewItem* )),this,
203 SLOT( mailLeftClicked(QListViewItem*) ) ); 209 SLOT( mailLeftClicked(Q3ListViewItem*) ) );
204 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, 210 connect( mailView, SIGNAL( mouseButtonPressed(int,Q3ListViewItem*,const QPoint&,int) ),this,
205 SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); 211 SLOT( mailHold(int,Q3ListViewItem*,const QPoint&,int) ) );
206 connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), 212 connect(folderView, SIGNAL(refreshMailview(const Q3ValueList<RecMailP>&)),
207 this,SLOT(refreshMailView(const QValueList<RecMailP>&))); 213 this,SLOT(refreshMailView(const Q3ValueList<RecMailP>&)));
208 214
209 connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, 215 connect( mailView, SIGNAL( currentChanged (Q3ListViewItem* )),this,
210 SLOT( setInfoFields(QListViewItem*) ) ); 216 SLOT( setInfoFields(Q3ListViewItem*) ) );
211 217
212 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); 218 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
213 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 219 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
214// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 220// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
215 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); 221 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
216 //mailView->setMultiSelection ( true ); 222 //mailView->setMultiSelection ( true );
217 //mailView->setSelectionMode( QListView::Extended ); 223 //mailView->setSelectionMode( QListView::Extended );
218 QValueList<int> list; 224 Q3ValueList<int> list;
219 int fw = 100; 225 int fw = 100;
220 if ( QApplication::desktop()->width() > 320 ) 226 if ( QApplication::desktop()->width() > 320 )
221 fw = 50; 227 fw = 50;
222 list.append( fw ); 228 list.append( fw );
223 list.append( 100 ); 229 list.append( 100 );
224 split->setSizes( list ); 230 split->setSizes( list );
225 QTimer::singleShot( 100, this, SLOT( slotAdjustColumns() ) ); 231 QTimer::singleShot( 100, this, SLOT( slotAdjustColumns() ) );
226 mailView->setShowSortIndicator ( true ); 232 mailView->setShowSortIndicator ( true );
227 QLabel *spacer = new QLabel( toolBar ); 233 QLabel *spacer = new QLabel( toolBar );
228 spacer->setBackgroundMode( QWidget::PaletteButton ); 234 spacer->setBackgroundMode( QWidget::PaletteButton );
229 toolBar->setStretchableWidget( spacer ); 235 toolBar->setStretchableWidget( spacer );
230 236
231 QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); 237 QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this);
232 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 238 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
233 if ( QApplication::desktop()->width() > 320 ) 239 if ( QApplication::desktop()->width() > 320 )
234 closeMail->addTo(toolBar); 240 closeMail->addTo(toolBar);
235 closeMail->addTo(mailMenu); 241 closeMail->addTo(mailMenu);
236 242
237 243
238 QPopupMenu* helpMenu = new QPopupMenu( menuBar ); 244 Q3PopupMenu* helpMenu = new Q3PopupMenu( menuBar );
239 menuBar->insertItem( i18n( "Help" ), helpMenu ); 245 menuBar->insertItem( i18n( "Help" ), helpMenu );
240 QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); 246 QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this);
241 connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); 247 connect( li, SIGNAL( activated() ), SLOT( showAbout()) );
242 li->addTo(helpMenu); 248 li->addTo(helpMenu);
243 li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); 249 li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this);
244 connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); 250 connect( li, SIGNAL( activated() ), SLOT( showLicence()) );
245 li->addTo(helpMenu); 251 li->addTo(helpMenu);
246 li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); 252 li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this);
247 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); 253 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) );
248 li->addTo(helpMenu); 254 li->addTo(helpMenu);
249 connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); 255 connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) );
250 slotSetCodec( KOPrefs::instance()->mCurrentCodec ); 256 slotSetCodec( KOPrefs::instance()->mCurrentCodec );
251 menuBar->setMaximumWidth( menuBar->sizeHint().width()); 257 menuBar->setMaximumWidth( menuBar->sizeHint().width());
252 //menuBar->setMaximumSize( menuBar->sizeHint()); 258 //menuBar->setMaximumSize( menuBar->sizeHint());
253#ifdef DESKTOP_VERSION 259#ifdef DESKTOP_VERSION
254 resize ( 640, 480 ); 260 resize ( 640, 480 );
255#endif 261#endif
256} 262}
257 263
258MainWindow::~MainWindow() 264MainWindow::~MainWindow()
259{ 265{
260} 266}
261 267
262void MainWindow::setInfoFields(QListViewItem* item ) 268void MainWindow::setInfoFields(Q3ListViewItem* item )
263{ 269{
264 if ( item == 0) { 270 if ( item == 0) {
265 if ( subLE ) subLE->setText(""); 271 if ( subLE ) subLE->setText("");
266 if ( fromLE ) fromLE->setText(""); 272 if ( fromLE ) fromLE->setText("");
267 if ( toLE ) toLE->setText(""); 273 if ( toLE ) toLE->setText("");
268 return; 274 return;
269 } 275 }
270 RecMailP mail = ((MailListViewItem*)item)->data(); 276 RecMailP mail = ((MailListViewItem*)item)->data();
271 if ( subLE ) subLE->setText(mail->getSubject()); 277 if ( subLE ) subLE->setText(mail->getSubject());
272 if ( fromLE ) fromLE->setText(mail->getFrom()); 278 if ( fromLE ) fromLE->setText(mail->getFrom());
273 if ( toLE ) toLE->setText(mail->To().join(";" )); 279 if ( toLE ) toLE->setText(mail->To().join(";" ));
274 if ( subLE ) subLE->setCursorPosition(0); 280 if ( subLE ) subLE->setCursorPosition(0);
@@ -336,25 +342,25 @@ void MainWindow::showAbout()
336 "\n" 342 "\n"
337 "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" 343 "KOpieMail/Pi uses LibEtPan - a mail stuff library\n"
338 "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" 344 "Copyright (C) 2001, 2002 - DINH Viet Hoa\n"
339 "libEtPan has its own licence - see LibEtPan licence\n"; 345 "libEtPan has its own licence - see LibEtPan licence\n";
340 346
341 KApplication::showText( cap, text ); 347 KApplication::showText( cap, text );
342} 348}
343void MainWindow::showEtpanLicence() 349void MainWindow::showEtpanLicence()
344{ 350{
345 KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); 351 KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" );
346 352
347} 353}
348void MainWindow::appMessage(const QCString &, const QByteArray &) 354void MainWindow::appMessage(const Q3CString &, const QByteArray &)
349{ 355{
350 qDebug("appMessage implemented by subclass"); 356 qDebug("appMessage implemented by subclass");
351} 357}
352 358
353void MainWindow::slotAdjustLayout() { 359void MainWindow::slotAdjustLayout() {
354 360
355 /* 361 /*
356 QWidget *d = QApplication::desktop(); 362 QWidget *d = QApplication::desktop();
357 363
358 if ( d->width() < d->height() ) { 364 if ( d->width() < d->height() ) {
359 layout->setDirection( QBoxLayout::TopToBottom ); 365 layout->setDirection( QBoxLayout::TopToBottom );
360 } else { 366 } else {
@@ -396,45 +402,45 @@ void MainWindow::slotAdjustColumnsWide()
396void MainWindow::slotEditSettings() 402void MainWindow::slotEditSettings()
397{ 403{
398} 404}
399void MainWindow::slotEditGlobalSettings() 405void MainWindow::slotEditGlobalSettings()
400{ 406{
401} 407}
402 408
403void MainWindow::slotShowFolders( bool ) 409void MainWindow::slotShowFolders( bool )
404{ 410{
405 qDebug("not implemented: "); 411 qDebug("not implemented: ");
406} 412}
407 413
408void MainWindow::refreshMailView(const QValueList<RecMailP>&) 414void MainWindow::refreshMailView(const Q3ValueList<RecMailP>&)
409{ 415{
410 qDebug("not implemented: "); 416 qDebug("not implemented: ");
411} 417}
412 418
413void MainWindow::mailLeftClicked(QListViewItem * ) 419void MainWindow::mailLeftClicked(Q3ListViewItem * )
414{ 420{
415 qDebug("not implemented: "); 421 qDebug("not implemented: ");
416} 422}
417 423
418void MainWindow::displayMail() 424void MainWindow::displayMail()
419{ 425{
420 qDebug("not implemented: "); 426 qDebug("not implemented: ");
421} 427}
422 428
423void MainWindow::slotDeleteMail() 429void MainWindow::slotDeleteMail()
424{ 430{
425 qDebug("not implemented: "); 431 qDebug("not implemented: ");
426} 432}
427 433
428void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) 434void MainWindow::mailHold(int, Q3ListViewItem *,const QPoint&,int )
429{ 435{
430 qDebug("not implemented: "); 436 qDebug("not implemented: ");
431} 437}
432 438
433void MainWindow::slotSendQueued() 439void MainWindow::slotSendQueued()
434{ 440{
435 qDebug("not implemented: "); 441 qDebug("not implemented: ");
436} 442}
437 443
438void MainWindow::slotEditAccounts() 444void MainWindow::slotEditAccounts()
439{ 445{
440 qDebug("not implemented: "); 446 qDebug("not implemented: ");
diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h
index f65f3b4..1ccadc2 100644
--- a/kmicromail/mainwindow.h
+++ b/kmicromail/mainwindow.h
@@ -1,75 +1,79 @@
1 1
2// CHANGED 2004-08-06 Lutz Rogowski 2// CHANGED 2004-08-06 Lutz Rogowski
3#ifndef MAINWINDOW_H 3#ifndef MAINWINDOW_H
4#define MAINWINDOW_H 4#define MAINWINDOW_H
5 5
6#include <qmainwindow.h> 6#include <q3mainwindow.h>
7//Added by qt3to4:
8#include <Q3CString>
9#include <Q3ValueList>
10#include <Q3PopupMenu>
7#include <klistview.h> 11#include <klistview.h>
8#include <qaction.h> 12#include <qaction.h>
9#include <qlineedit.h> 13#include <qlineedit.h>
10 14
11#include <qtoolbar.h> 15#include <q3toolbar.h>
12#ifdef DESKTOP_VERSION 16#ifdef DESKTOP_VERSION
13#include <qmenubar.h> 17#include <qmenubar.h>
14#define QPEMenuBar QMenuBar 18#define QPEMenuBar QMenuBar
15#else 19#else
16#include <qpe/qpemenubar.h> 20#include <qpe/qpemenubar.h>
17#endif 21#endif
18 22
19#include "accountview.h" 23#include "accountview.h"
20#include "statuswidget.h" 24#include "statuswidget.h"
21 25
22#include <libmailwrapper/mailtypes.h> 26#include <libmailwrapper/mailtypes.h>
23#include <opie2/osmartpointer.h> 27#include <opie2/osmartpointer.h>
24 28
25class RecMail; 29class RecMail;
26 30
27class MainWindow : public QMainWindow 31class MainWindow : public Q3MainWindow
28{ 32{
29 Q_OBJECT 33 Q_OBJECT
30 34
31public: 35public:
32 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); 36 MainWindow( QWidget *parent = 0, const char *name = 0, Qt::WFlags flags = 0 );
33 virtual ~MainWindow(); 37 virtual ~MainWindow();
34 38
35public slots: 39public slots:
36 virtual void slotAdjustColumns(); 40 virtual void slotAdjustColumns();
37 virtual void slotAdjustColumnsWide(); 41 virtual void slotAdjustColumnsWide();
38 virtual void appMessage(const QCString &msg, const QByteArray &data); 42 virtual void appMessage(const Q3CString &msg, const QByteArray &data);
39 virtual void slotComposeMail(); 43 virtual void slotComposeMail();
40 44
41protected slots: 45protected slots:
42 virtual void setInfoFields(QListViewItem* ); 46 virtual void setInfoFields(Q3ListViewItem* );
43 virtual void slotSendQueued(); 47 virtual void slotSendQueued();
44 virtual void slotEditAccounts(); 48 virtual void slotEditAccounts();
45 virtual void slotShowFolders( bool show ); 49 virtual void slotShowFolders( bool show );
46 virtual void refreshMailView(const QValueList<RecMailP>&); 50 virtual void refreshMailView(const Q3ValueList<RecMailP>&);
47 virtual void displayMail(); 51 virtual void displayMail();
48 virtual void slotGetMail() = 0; 52 virtual void slotGetMail() = 0;
49 virtual void slotGetAllMail() = 0; 53 virtual void slotGetAllMail() = 0;
50 virtual void slotDeleteMail(); 54 virtual void slotDeleteMail();
51 virtual void slotDeleteAllMail() = 0; 55 virtual void slotDeleteAllMail() = 0;
52 virtual void slotSetCodec(int); 56 virtual void slotSetCodec(int);
53 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 57 virtual void mailHold(int, Q3ListViewItem *,const QPoint&,int);
54 virtual void slotAdjustLayout(); 58 virtual void slotAdjustLayout();
55 virtual void slotEditSettings(); 59 virtual void slotEditSettings();
56 virtual void slotEditGlobalSettings(); 60 virtual void slotEditGlobalSettings();
57 virtual void mailLeftClicked( QListViewItem * ); 61 virtual void mailLeftClicked( Q3ListViewItem * );
58 void showLicence(); 62 void showLicence();
59 void showAbout(); 63 void showAbout();
60 void showEtpanLicence(); 64 void showEtpanLicence();
61 65
62protected: 66protected:
63 QToolBar *toolBar; 67 Q3ToolBar *toolBar;
64 StatusWidget *statusWidget; 68 StatusWidget *statusWidget;
65 QPEMenuBar *menuBar; 69 QPEMenuBar *menuBar;
66 QPopupMenu *mailMenu, *settingsMenu, *codecMenu; 70 Q3PopupMenu *mailMenu, *settingsMenu, *codecMenu;
67 QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, 71 QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails,
68 *editSettings, *editAccounts, *syncFolders; 72 *editSettings, *editAccounts, *syncFolders;
69 AccountView *folderView; 73 AccountView *folderView;
70 KListView *mailView; 74 KListView *mailView;
71 QLineEdit* toLE,*fromLE,*subLE; 75 QLineEdit* toLE,*fromLE,*subLE;
72 //QBoxLayout *layout; 76 //QBoxLayout *layout;
73}; 77};
74 78
75#endif 79#endif
diff --git a/kmicromail/nntpgroups.cpp b/kmicromail/nntpgroups.cpp
index c729f79..d2213d4 100644
--- a/kmicromail/nntpgroups.cpp
+++ b/kmicromail/nntpgroups.cpp
@@ -1,62 +1,62 @@
1#include "nntpgroups.h" 1#include "nntpgroups.h"
2 2
3#include <libmailwrapper/settings.h> 3#include <libmailwrapper/settings.h>
4#include <qlistview.h> 4#include <q3listview.h>
5#include <qlineedit.h> 5#include <qlineedit.h>
6 6
7using namespace Opie::Core; 7using namespace Opie::Core;
8 8
9NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, WFlags fl) 9NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, Qt::WFlags fl)
10 : NNTPGroupsUI(parent,name,fl),subscribedGroups() 10 : NNTPGroupsUI(parent,name,fl),subscribedGroups()
11{ 11{
12 m_Account = account; 12 m_Account = account;
13 fillGroups(); 13 fillGroups();
14} 14}
15 15
16NNTPGroups::~NNTPGroups() 16NNTPGroups::~NNTPGroups()
17{ 17{
18 18
19} 19}
20 20
21void NNTPGroups::slotGetNG() 21void NNTPGroups::slotGetNG()
22{ 22{
23 if (!m_Account) return; 23 if (!m_Account) return;
24 GroupListView->clear(); 24 GroupListView->clear();
25 NNTPwrapper tmp( m_Account ); 25 NNTPwrapper tmp( m_Account );
26 QString filter = Groupfilteredit->text(); 26 QString filter = Groupfilteredit->text();
27 QStringList list = tmp.listAllNewsgroups(filter); 27 QStringList list = tmp.listAllNewsgroups(filter);
28 subscribedGroupsNotListed = subscribedGroups; 28 subscribedGroupsNotListed = subscribedGroups;
29 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { 29 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
30 QCheckListItem *item; 30 Q3CheckListItem *item;
31 item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); 31 item = new Q3CheckListItem( GroupListView, (*it), Q3CheckListItem::CheckBox );
32 if ( subscribedGroups.contains( (*it) ) >= 1 ) { 32 if ( subscribedGroups.contains( (*it) ) >= 1 ) {
33 item->setOn( true ); 33 item->setOn( true );
34 subscribedGroupsNotListed.remove((*it)); 34 subscribedGroupsNotListed.remove((*it));
35 } 35 }
36 } 36 }
37} 37}
38 38
39void NNTPGroups::fillGroups() 39void NNTPGroups::fillGroups()
40{ 40{
41 if (!m_Account) return; 41 if (!m_Account) return;
42 subscribedGroups = m_Account->getGroups(); 42 subscribedGroups = m_Account->getGroups();
43 for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { 43 for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) {
44 QCheckListItem *item; 44 Q3CheckListItem *item;
45 item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); 45 item = new Q3CheckListItem( GroupListView, (*it), Q3CheckListItem::CheckBox );
46 item->setOn( true ); 46 item->setOn( true );
47 } 47 }
48} 48}
49 49
50void NNTPGroups::storeValues() 50void NNTPGroups::storeValues()
51{ 51{
52 if (!m_Account) return; 52 if (!m_Account) return;
53 QListViewItemIterator list_it( GroupListView ); 53 Q3ListViewItemIterator list_it( GroupListView );
54 subscribedGroups.clear(); 54 subscribedGroups.clear();
55 for ( ; list_it.current(); ++list_it ) { 55 for ( ; list_it.current(); ++list_it ) {
56 if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { 56 if ( ( (Q3CheckListItem*)list_it.current() )->isOn() ) {
57 subscribedGroups.append( list_it.current()->text(0) ); 57 subscribedGroups.append( list_it.current()->text(0) );
58 } 58 }
59 } 59 }
60 subscribedGroups+=subscribedGroupsNotListed; 60 subscribedGroups+=subscribedGroupsNotListed;
61 m_Account->setGroups( subscribedGroups ); 61 m_Account->setGroups( subscribedGroups );
62} 62}
diff --git a/kmicromail/nntpgroups.h b/kmicromail/nntpgroups.h
index e5b7c35..80cc329 100644
--- a/kmicromail/nntpgroups.h
+++ b/kmicromail/nntpgroups.h
@@ -3,25 +3,25 @@
3 3
4#include "nntpgroupsui.h" 4#include "nntpgroupsui.h"
5 5
6#include <libmailwrapper/nntpwrapper.h> 6#include <libmailwrapper/nntpwrapper.h>
7 7
8class NNTPaccount; 8class NNTPaccount;
9class QStringList; 9class QStringList;
10 10
11class NNTPGroups:public NNTPGroupsUI 11class NNTPGroups:public NNTPGroupsUI
12{ 12{
13 Q_OBJECT 13 Q_OBJECT
14public: 14public:
15 NNTPGroups(NNTPaccount *account, QWidget* parent = 0, const char* name = 0, WFlags fl = 0); 15 NNTPGroups(NNTPaccount *account, QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0);
16 virtual ~NNTPGroups(); 16 virtual ~NNTPGroups();
17 /* must be called from external. 17 /* must be called from external.
18 * it will store the new subscription list into the account 18 * it will store the new subscription list into the account
19 * but don't save them, this must be done by the calling class. 19 * but don't save them, this must be done by the calling class.
20 */ 20 */
21 void storeValues(); 21 void storeValues();
22 22
23protected slots: 23protected slots:
24 virtual void slotGetNG(); 24 virtual void slotGetNG();
25 25
26protected: 26protected:
27 virtual void fillGroups(); 27 virtual void fillGroups();
diff --git a/kmicromail/nntpgroupsdlg.cpp b/kmicromail/nntpgroupsdlg.cpp
index f564b10..bfe1d35 100644
--- a/kmicromail/nntpgroupsdlg.cpp
+++ b/kmicromail/nntpgroupsdlg.cpp
@@ -1,26 +1,28 @@
1#include "nntpgroupsdlg.h" 1#include "nntpgroupsdlg.h"
2#include "nntpgroups.h" 2#include "nntpgroups.h"
3#include <klocale.h> 3#include <klocale.h>
4 4
5#include <libmailwrapper/settings.h> 5#include <libmailwrapper/settings.h>
6 6
7#include <qlayout.h> 7#include <qlayout.h>
8//Added by qt3to4:
9#include <Q3VBoxLayout>
8 10
9NNTPGroupsDlg::NNTPGroupsDlg(NNTPaccount *account,QWidget * parent, const char * name) 11NNTPGroupsDlg::NNTPGroupsDlg(NNTPaccount *account,QWidget * parent, const char * name)
10 : QDialog(parent,name,true,0) 12 : QDialog(parent,name,true,0)
11{ 13{
12 setCaption(i18n("Subscribed newsgroups")); 14 setCaption(i18n("Subscribed newsgroups"));
13 m_Account = account; 15 m_Account = account;
14 QVBoxLayout*dlglayout = new QVBoxLayout(this); 16 Q3VBoxLayout*dlglayout = new Q3VBoxLayout(this);
15 dlglayout->setSpacing(2); 17 dlglayout->setSpacing(2);
16 dlglayout->setMargin(1); 18 dlglayout->setMargin(1);
17 groupsWidget = new NNTPGroups(account,this); 19 groupsWidget = new NNTPGroups(account,this);
18 dlglayout->addWidget(groupsWidget); 20 dlglayout->addWidget(groupsWidget);
19} 21}
20 22
21NNTPGroupsDlg::~NNTPGroupsDlg() 23NNTPGroupsDlg::~NNTPGroupsDlg()
22{ 24{
23} 25}
24 26
25void NNTPGroupsDlg::accept() 27void NNTPGroupsDlg::accept()
26{ 28{
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 75a75b9..f453be5 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -1,42 +1,47 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2// CHANGED 2004-08-06 Lutz Rogowski 2// CHANGED 2004-08-06 Lutz Rogowski
3 3
4 4
5#define protected public 5#define protected public
6#include <qwidget.h> 6#include <qwidget.h>
7//Added by qt3to4:
8#include <Q3ValueList>
9#include <Q3CString>
10#include <QPixmap>
11#include <Q3PopupMenu>
7#undef protected 12#undef protected
8#include "koprefsdialog.h" 13#include "koprefsdialog.h"
9#include <kapplication.h> 14#include <kapplication.h>
10#include <libkdepim/externalapphandler.h> 15#include <libkdepim/externalapphandler.h>
11#include <libkdepim/kpimglobalprefs.h> 16#include <libkdepim/kpimglobalprefs.h>
12#ifdef MINIKDE_KDIALOG_H 17#ifdef MINIKDE_KDIALOG_H
13#undef MINIKDE_KDIALOG_H 18#undef MINIKDE_KDIALOG_H
14#endif 19#endif
15#include "settingsdialog.h" 20#include "settingsdialog.h"
16#include "opiemail.h" 21#include "opiemail.h"
17#include "editaccounts.h" 22#include "editaccounts.h"
18#include "composemail.h" 23#include "composemail.h"
19#include "mailistviewitem.h" 24#include "mailistviewitem.h"
20#include "viewmail.h" 25#include "viewmail.h"
21#include "selectstore.h" 26#include "selectstore.h"
22#include "selectsmtp.h" 27#include "selectsmtp.h"
23#include "accountitem.h" 28#include "accountitem.h"
24#include "accountview.h" 29#include "accountview.h"
25#include "klocale.h" 30#include "klocale.h"
26 31
27#include <qmessagebox.h> 32#include <qmessagebox.h>
28#include <qtimer.h> 33#include <qtimer.h>
29#include <qcursor.h> 34#include <qcursor.h>
30#include <qtextbrowser.h> 35#include <q3textbrowser.h>
31#include <qregexp.h> 36#include <qregexp.h>
32#include <qpe/global.h> 37#include <qpe/global.h>
33 38
34#ifdef DESKTOP_VERSION 39#ifdef DESKTOP_VERSION
35#include <qapplication.h> 40#include <qapplication.h>
36#else 41#else
37#include <qpe/qpeapplication.h> 42#include <qpe/qpeapplication.h>
38#endif 43#endif
39#include <libmailwrapper/smtpwrapper.h> 44#include <libmailwrapper/smtpwrapper.h>
40#include <libmailwrapper/mailtypes.h> 45#include <libmailwrapper/mailtypes.h>
41#include <libmailwrapper/abstractmail.h> 46#include <libmailwrapper/abstractmail.h>
42#include "koprefs.h" 47#include "koprefs.h"
@@ -54,62 +59,62 @@ OpieMail::OpieMail( QWidget *parent, const char *name )
54 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), 59 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
55 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); 60 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
56 folderView->setFocus(); 61 folderView->setFocus();
57} 62}
58 63
59OpieMail::~OpieMail() 64OpieMail::~OpieMail()
60{ 65{
61 if (settings) delete settings; 66 if (settings) delete settings;
62 if ( tb ) 67 if ( tb )
63 delete tb; 68 delete tb;
64} 69}
65 70
66void OpieMail::appMessage(const QCString &msg, const QByteArray &data) 71void OpieMail::appMessage(const Q3CString &msg, const QByteArray &data)
67{ 72{
68 73
69} 74}
70#include <stdlib.h> 75#include <stdlib.h>
71void OpieMail::message(const QCString &msg, const QByteArray &data) 76void OpieMail::message(const Q3CString &msg, const QByteArray &data)
72{ 77{
73 // copied from old mail2 78 // copied from old mail2
74 static int ii = 0; 79 static int ii = 0;
75 //qDebug("QCOP CALL ############################# %d ", ii); 80 //qDebug("QCOP CALL ############################# %d ", ii);
76 //QString mess ( msg ); 81 //QString mess ( msg );
77 //qDebug("Message = %s ",mess.latin1()); 82 //qDebug("Message = %s ",mess.latin1());
78 ++ii; 83 ++ii;
79 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); 84 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this);
80 85
81 mPendingEmail = QString::null; 86 mPendingEmail = QString::null;
82 mPendingName = QString::null; 87 mPendingName = QString::null;
83 if (msg == "writeMail(QString,QString)") 88 if (msg == "writeMail(QString,QString)")
84 { 89 {
85 //qDebug("writeMail(QString,QString) "); 90 //qDebug("writeMail(QString,QString) ");
86 QDataStream stream(data,IO_ReadOnly); 91 QDataStream stream(data,QIODevice::ReadOnly);
87 stream >> mPendingName >> mPendingEmail; 92 stream >> mPendingName >> mPendingEmail;
88 // removing the whitespaces at beginning and end is needed! 93 // removing the whitespaces at beginning and end is needed!
89 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 94 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
90 } 95 }
91 else if (msg == "newMail()") 96 else if (msg == "newMail()")
92 { 97 {
93 //qDebug("slotComposeMail() "); 98 //qDebug("slotComposeMail() ");
94 // we cannot call slotComposeMail(); directly, because may be executing a QCOP call 99 // we cannot call slotComposeMail(); directly, because may be executing a QCOP call
95 // and a QCOP call does not like a processevents in his execution 100 // and a QCOP call does not like a processevents in his execution
96 // with the Qtimer we call slotComposeMail() after we reached the main event loop 101 // with the Qtimer we call slotComposeMail() after we reached the main event loop
97 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 102 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
98 // slotComposeMail(); 103 // slotComposeMail();
99 } 104 }
100 else if (msg == "newMail(QString)") 105 else if (msg == "newMail(QString)")
101 { 106 {
102 //qDebug(" newMail(QString)"); 107 //qDebug(" newMail(QString)");
103 QDataStream stream(data,IO_ReadOnly); 108 QDataStream stream(data,QIODevice::ReadOnly);
104 stream >> mPendingName; 109 stream >> mPendingName;
105 // the format is 110 // the format is
106 // NAME <EMAIL>:SUBJECT 111 // NAME <EMAIL>:SUBJECT
107 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 112 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
108 } else { 113 } else {
109 mPendingData = data; 114 mPendingData = data;
110 mPendingMessage = msg; 115 mPendingMessage = msg;
111 QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); 116 QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) );
112 } 117 }
113 118
114 //qDebug("END OpieMail::message "); 119 //qDebug("END OpieMail::message ");
115} 120}
@@ -270,25 +275,25 @@ void OpieMail::slotEditAccounts()
270#ifndef DESKTOP_VERSION 275#ifndef DESKTOP_VERSION
271 eaDialog.showMaximized(); 276 eaDialog.showMaximized();
272#endif 277#endif
273 eaDialog.exec(); 278 eaDialog.exec();
274 if ( settings ) delete settings; 279 if ( settings ) delete settings;
275 settings = new Settings(); 280 settings = new Settings();
276 281
277 folderView->populate( settings->getAccounts() ); 282 folderView->populate( settings->getAccounts() );
278} 283}
279void OpieMail::replyMail() 284void OpieMail::replyMail()
280{ 285{
281 286
282 QListViewItem*item = mailView->currentItem(); 287 Q3ListViewItem*item = mailView->currentItem();
283 if (!item) return; 288 if (!item) return;
284 RecMailP mail = ((MailListViewItem*)item)->data(); 289 RecMailP mail = ((MailListViewItem*)item)->data();
285 RecBodyP body = folderView->fetchBody(mail); 290 RecBodyP body = folderView->fetchBody(mail);
286 291
287 QString rtext; 292 QString rtext;
288 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose 293 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
289 .arg( mail->getFrom()) 294 .arg( mail->getFrom())
290 .arg( mail->getDate()); 295 .arg( mail->getDate());
291 296
292 QString text = body->Bodytext(); 297 QString text = body->Bodytext();
293 QStringList lines = QStringList::split(QRegExp("\\n"), text); 298 QStringList lines = QStringList::split(QRegExp("\\n"), text);
294 QStringList::Iterator it; 299 QStringList::Iterator it;
@@ -322,25 +327,25 @@ void OpieMail::replyMail()
322 mCurrentComposer = 0; 327 mCurrentComposer = 0;
323 folderView->refreshOutgoing(); 328 folderView->refreshOutgoing();
324 delete settings; 329 delete settings;
325 330
326} 331}
327void OpieMail::closeViewMail(ViewMail * vm) 332void OpieMail::closeViewMail(ViewMail * vm)
328{ 333{
329 vm->hide(); 334 vm->hide();
330} 335}
331 336
332void OpieMail::slotDownloadMail( ) 337void OpieMail::slotDownloadMail( )
333{ 338{
334 QListViewItem*item = mailView->currentItem(); 339 Q3ListViewItem*item = mailView->currentItem();
335 if (!item ) { 340 if (!item ) {
336 Global::statusMessage("Error: No item slected!"); 341 Global::statusMessage("Error: No item slected!");
337 return; 342 return;
338 } 343 }
339 RecMailP mail = ((MailListViewItem*)item)->data(); 344 RecMailP mail = ((MailListViewItem*)item)->data();
340 Account * acc = mail->Wrapper()->getAccount(); 345 Account * acc = mail->Wrapper()->getAccount();
341 if ( !acc ) { 346 if ( !acc ) {
342 Global::statusMessage("Mail is already stored locally!"); 347 Global::statusMessage("Mail is already stored locally!");
343 return; 348 return;
344 } 349 }
345 QString lfName = acc->getLocalFolder(); 350 QString lfName = acc->getLocalFolder();
346 //qDebug("local folder " + lfName ); 351 //qDebug("local folder " + lfName );
@@ -363,117 +368,117 @@ void OpieMail::slotDownloadMail( )
363 if ( st ) { 368 if ( st ) {
364 targetMail->storeMessage(st->Content(),st->Length(),lfName); 369 targetMail->storeMessage(st->Content(),st->Length(),lfName);
365 Global::statusMessage("Mail stored in "+ lfName); 370 Global::statusMessage("Mail stored in "+ lfName);
366 delete st; 371 delete st;
367 } else { 372 } else {
368 Global::statusMessage("Error: Cannot fetch mail!"); 373 Global::statusMessage("Error: Cannot fetch mail!");
369 } 374 }
370} 375}
371 376
372 377
373void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) 378void OpieMail::deleteAndDisplayNextMail(ViewMail * vm)
374{ 379{
375 QListViewItem*item = mailView->currentItem(); 380 Q3ListViewItem*item = mailView->currentItem();
376 if (!item ) { 381 if (!item ) {
377 closeViewMail(vm); 382 closeViewMail(vm);
378 return; 383 return;
379 } 384 }
380 RecMailP mail = ((MailListViewItem*)item)->data(); 385 RecMailP mail = ((MailListViewItem*)item)->data();
381 mail->Wrapper()->deleteMail( mail ); 386 mail->Wrapper()->deleteMail( mail );
382 item = item->itemBelow(); 387 item = item->itemBelow();
383 if (!item ) { 388 if (!item ) {
384 closeViewMail(vm); 389 closeViewMail(vm);
385 return; 390 return;
386 } 391 }
387 mailView->setCurrentItem(item); 392 mailView->setCurrentItem(item);
388 mail = ((MailListViewItem*)item)->data(); 393 mail = ((MailListViewItem*)item)->data();
389 RecBodyP body = folderView->fetchBody(mail); 394 RecBodyP body = folderView->fetchBody(mail);
390 vm->setBody( body ); 395 vm->setBody( body );
391 vm->setMail( mail ); 396 vm->setMail( mail );
392} 397}
393void OpieMail::displayNextMail(ViewMail * vm) 398void OpieMail::displayNextMail(ViewMail * vm)
394{ 399{
395 QListViewItem*item = mailView->currentItem(); 400 Q3ListViewItem*item = mailView->currentItem();
396 if (!item) return; 401 if (!item) return;
397 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 402 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
398 item = item->itemBelow(); 403 item = item->itemBelow();
399 if (!item) { 404 if (!item) {
400 vm->setCaption(i18n("End of List" )); 405 vm->setCaption(i18n("End of List" ));
401 return; 406 return;
402 } 407 }
403 mailView->setCurrentItem(item); 408 mailView->setCurrentItem(item);
404 RecMailP mail = ((MailListViewItem*)item)->data(); 409 RecMailP mail = ((MailListViewItem*)item)->data();
405 RecBodyP body = folderView->fetchBody(mail); 410 RecBodyP body = folderView->fetchBody(mail);
406 vm->setBody( body ); 411 vm->setBody( body );
407 vm->setMail( mail ); 412 vm->setMail( mail );
408} 413}
409void OpieMail::displayMail() 414void OpieMail::displayMail()
410{ 415{
411 QListViewItem*item = mailView->currentItem(); 416 Q3ListViewItem*item = mailView->currentItem();
412 if (!item) return; 417 if (!item) return;
413 RecMailP mail = ((MailListViewItem*)item)->data(); 418 RecMailP mail = ((MailListViewItem*)item)->data();
414 RecBodyP body = folderView->fetchBody(mail); 419 RecBodyP body = folderView->fetchBody(mail);
415 ViewMail readMail( this,"", Qt::WType_Modal ); 420 ViewMail readMail( this,"", Qt::WType_Modal );
416 readMail.setBody( body ); 421 readMail.setBody( body );
417 readMail.setMail( mail ); 422 readMail.setMail( mail );
418#ifndef DESKTOP_VERSION 423#ifndef DESKTOP_VERSION
419 readMail.showMaximized(); 424 readMail.showMaximized();
420#else 425#else
421 readMail.resize( 640, 480); 426 readMail.resize( 640, 480);
422#endif 427#endif
423 connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); 428 connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) );
424 connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); 429 connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) );
425 connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); 430 connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) );
426 431
427 readMail.exec(); 432 readMail.exec();
428 433
429 if ( readMail.deleted ) 434 if ( readMail.deleted )
430 { 435 {
431 folderView->refreshCurrent(); 436 folderView->refreshCurrent();
432 } 437 }
433 else 438 else
434 { 439 {
435 QListViewItem*item = mailView->currentItem(); 440 Q3ListViewItem*item = mailView->currentItem();
436 if (item) 441 if (item)
437 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 442 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
438 } 443 }
439} 444}
440void OpieMail::slotGetAllMail() 445void OpieMail::slotGetAllMail()
441{ 446{
442 QListViewItem * item = folderView->firstChild(); 447 Q3ListViewItem * item = folderView->firstChild();
443 while ( item ){ 448 while ( item ){
444 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 449 ((AccountViewItem *)item)->contextMenuSelected( 101 );
445 item = item->nextSibling (); 450 item = item->nextSibling ();
446 } 451 }
447} 452}
448void OpieMail::slotGetMail() 453void OpieMail::slotGetMail()
449{ 454{
450 QListViewItem * item = folderView->currentItem(); 455 Q3ListViewItem * item = folderView->currentItem();
451 if ( ! item ) return; 456 if ( ! item ) return;
452 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 457 ((AccountViewItem *)item)->contextMenuSelected( 101 );
453} 458}
454void OpieMail::slotDeleteMail() 459void OpieMail::slotDeleteMail()
455{ 460{
456 if (!mailView->currentItem()) return; 461 if (!mailView->currentItem()) return;
457 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); 462 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
458 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 463 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
459 { 464 {
460 mail->Wrapper()->deleteMail( mail ); 465 mail->Wrapper()->deleteMail( mail );
461 folderView->refreshCurrent(); 466 folderView->refreshCurrent();
462 } 467 }
463} 468}
464void OpieMail::slotDeleteAllMail() 469void OpieMail::slotDeleteAllMail()
465{ 470{
466 471
467 QValueList<RecMailP> t; 472 Q3ValueList<RecMailP> t;
468 if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 473 if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
469 { 474 {
470 MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); 475 MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
471 while ( item ) { 476 while ( item ) {
472 if ( item->isSelected() ) { 477 if ( item->isSelected() ) {
473 t.append( item->data() ); 478 t.append( item->data() );
474 } 479 }
475 item = (MailListViewItem*)item->nextSibling(); 480 item = (MailListViewItem*)item->nextSibling();
476 } 481 }
477 } 482 }
478 else 483 else
479 return; 484 return;
@@ -483,39 +488,39 @@ void OpieMail::slotDeleteAllMail()
483 mail->Wrapper()->deleteMailList(t); 488 mail->Wrapper()->deleteMailList(t);
484 folderView->refreshCurrent(); 489 folderView->refreshCurrent();
485 490
486 491
487} 492}
488void OpieMail::clearSelection() 493void OpieMail::clearSelection()
489{ 494{
490 mailView->clearSelection(); 495 mailView->clearSelection();
491 496
492} 497}
493void OpieMail::selectAll() 498void OpieMail::selectAll()
494{ 499{
495 QListViewItem* item = mailView->firstChild (); 500 Q3ListViewItem* item = mailView->firstChild ();
496 while ( item ) { 501 while ( item ) {
497 mailView->setSelected ( item, true ); 502 mailView->setSelected ( item, true );
498 item = item->nextSibling(); 503 item = item->nextSibling();
499 } 504 }
500} 505}
501 506
502void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) 507void OpieMail::mailHold(int button, Q3ListViewItem *item,const QPoint&,int )
503{ 508{
504 if (!mailView->currentItem()) return; 509 if (!mailView->currentItem()) return;
505 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); 510 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType();
506 /* just the RIGHT button - or hold on pda */ 511 /* just the RIGHT button - or hold on pda */
507 if (button!=2) {return;} 512 if (button!=2) {return;}
508 if (!item) return; 513 if (!item) return;
509 QPopupMenu *m = new QPopupMenu(0); 514 Q3PopupMenu *m = new Q3PopupMenu(0);
510 if (m) 515 if (m)
511 { 516 {
512 if (mailtype==MAILLIB::A_NNTP) { 517 if (mailtype==MAILLIB::A_NNTP) {
513 m->insertItem(i18n("Read this posting"),this,SLOT(displayMail())); 518 m->insertItem(i18n("Read this posting"),this,SLOT(displayMail()));
514 m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail())); 519 m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail()));
515 m->insertSeparator(); 520 m->insertSeparator();
516 m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); 521 m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail()));
517 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); 522 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection()));
518 } else { 523 } else {
519 if (folderView->currentisDraft()) { 524 if (folderView->currentisDraft()) {
520 m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail())); 525 m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail()));
521 } 526 }
@@ -544,40 +549,40 @@ void OpieMail::slotShowFolders( bool show )
544 slotAdjustColumns(); 549 slotAdjustColumns();
545 folderView->show(); 550 folderView->show();
546 //slotAdjustColumns(); 551 //slotAdjustColumns();
547 } 552 }
548 else if ( !show && !folderView->isHidden() ) 553 else if ( !show && !folderView->isHidden() )
549 { 554 {
550 slotAdjustColumnsWide(); 555 slotAdjustColumnsWide();
551 folderView->hide(); 556 folderView->hide();
552 //slotAdjustColumnsWide(); 557 //slotAdjustColumnsWide();
553 } 558 }
554} 559}
555 560
556void OpieMail::refreshMailView(const QValueList<RecMailP>&list) 561void OpieMail::refreshMailView(const Q3ValueList<RecMailP>&list)
557{ 562{
558 MailListViewItem*item = 0; 563 MailListViewItem*item = 0;
559 mailView->clear(); 564 mailView->clear();
560 565
561 QValueList<RecMailP>::ConstIterator it; 566 Q3ValueList<RecMailP>::ConstIterator it;
562 for (it = list.begin(); it != list.end();++it) 567 for (it = list.begin(); it != list.end();++it)
563 { 568 {
564 item = new MailListViewItem(mailView,item); 569 item = new MailListViewItem(mailView,item);
565 item->storeData((*it)); 570 item->storeData((*it));
566 item->showEntry(); 571 item->showEntry();
567 } 572 }
568 mailView->setSorting ( 4, false ); 573 mailView->setSorting ( 4, false );
569} 574}
570 575
571void OpieMail::mailLeftClicked( QListViewItem *item ) 576void OpieMail::mailLeftClicked( Q3ListViewItem *item )
572{ 577{
573 mailView->clearSelection(); 578 mailView->clearSelection();
574 /* just LEFT button - or tap with stylus on pda */ 579 /* just LEFT button - or tap with stylus on pda */
575 //if (button!=1) return; 580 //if (button!=1) return;
576 if (!item) return; 581 if (!item) return;
577 if (folderView->currentisDraft()) { 582 if (folderView->currentisDraft()) {
578 reEditMail(); 583 reEditMail();
579 } else { 584 } else {
580 displayMail(); 585 displayMail();
581 } 586 }
582} 587}
583 588
@@ -605,25 +610,25 @@ void OpieMail::slotMoveCopyMail()
605 } 610 }
606 sels.hide(); 611 sels.hide();
607 qApp->processEvents(); 612 qApp->processEvents();
608 // qDebug("hiding sels "); 613 // qDebug("hiding sels ");
609 mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); 614 mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails());
610 folderView->refreshCurrent(); 615 folderView->refreshCurrent();
611} 616}
612 617
613void OpieMail::slotMoveCopyAllMail() 618void OpieMail::slotMoveCopyAllMail()
614{ 619{
615 620
616 if (!mailView->currentItem()) return; 621 if (!mailView->currentItem()) return;
617 QValueList<RecMailP> t; 622 Q3ValueList<RecMailP> t;
618 // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 623 // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
619 { 624 {
620 MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); 625 MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
621 while ( item ) { 626 while ( item ) {
622 if ( item->isSelected() ) { 627 if ( item->isSelected() ) {
623 t.append( item->data() ); 628 t.append( item->data() );
624 } 629 }
625 item = (MailListViewItem*)item->nextSibling(); 630 item = (MailListViewItem*)item->nextSibling();
626 } 631 }
627 } 632 }
628 // else 633 // else
629 // return; 634 // return;
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h
index bdd9058..ea64dc4 100644
--- a/kmicromail/opiemail.h
+++ b/kmicromail/opiemail.h
@@ -1,68 +1,71 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#ifndef OPIEMAIL_H 2#ifndef OPIEMAIL_H
3#define OPIEMAIL_H 3#define OPIEMAIL_H
4 4
5#include "mainwindow.h" 5#include "mainwindow.h"
6#include <libmailwrapper/settings.h> 6#include <libmailwrapper/settings.h>
7 7
8#include <opie2/osmartpointer.h> 8#include <opie2/osmartpointer.h>
9#include <libmailwrapper/mailtypes.h> 9#include <libmailwrapper/mailtypes.h>
10#include <viewmail.h> 10#include <viewmail.h>
11#include <qstringlist.h> 11#include <qstringlist.h>
12//Added by qt3to4:
13#include <Q3CString>
14#include <Q3ValueList>
12 15
13class ComposeMail; 16class ComposeMail;
14 17
15class OpieMail : public MainWindow 18class OpieMail : public MainWindow
16{ 19{
17 Q_OBJECT 20 Q_OBJECT
18 21
19public: 22public:
20 OpieMail( QWidget *parent = 0, const char *name = 0 ); 23 OpieMail( QWidget *parent = 0, const char *name = 0 );
21 virtual ~OpieMail(); 24 virtual ~OpieMail();
22 static QString appName() { return QString::fromLatin1("kopiemail"); } 25 static QString appName() { return QString::fromLatin1("kopiemail"); }
23 26
24public slots: 27public slots:
25 virtual void slotwriteMail(const QString&name,const QString&email); 28 virtual void slotwriteMail(const QString&name,const QString&email);
26 virtual void slotwriteMail2(const QString&nameemail); 29 virtual void slotwriteMail2(const QString&nameemail);
27 virtual void slotComposeMail(); 30 virtual void slotComposeMail();
28 virtual void slotExtAppHandler(); 31 virtual void slotExtAppHandler();
29 virtual void appMessage(const QCString &msg, const QByteArray &data); 32 virtual void appMessage(const Q3CString &msg, const QByteArray &data);
30 virtual void message(const QCString &msg, const QByteArray &data); 33 virtual void message(const Q3CString &msg, const QByteArray &data);
31 void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); 34 void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist);
32protected slots: 35protected slots:
33 virtual void deleteAndDisplayNextMail(ViewMail * vm); 36 virtual void deleteAndDisplayNextMail(ViewMail * vm);
34 virtual void displayNextMail(ViewMail * vm); 37 virtual void displayNextMail(ViewMail * vm);
35 virtual void slotSendQueued(); 38 virtual void slotSendQueued();
36 virtual void slotSearchMails(); 39 virtual void slotSearchMails();
37 virtual void slotEditSettings(); 40 virtual void slotEditSettings();
38 virtual void slotEditGlobalSettings(); 41 virtual void slotEditGlobalSettings();
39 virtual void slotEditAccounts(); 42 virtual void slotEditAccounts();
40 virtual void displayMail(); 43 virtual void displayMail();
41 virtual void replyMail(); 44 virtual void replyMail();
42 virtual void slotDeleteMail(); 45 virtual void slotDeleteMail();
43 virtual void slotGetMail(); 46 virtual void slotGetMail();
44 virtual void slotGetAllMail(); 47 virtual void slotGetAllMail();
45 virtual void slotDeleteAllMail(); 48 virtual void slotDeleteAllMail();
46 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 49 virtual void mailHold(int, Q3ListViewItem *,const QPoint&,int);
47 virtual void slotShowFolders( bool show ); 50 virtual void slotShowFolders( bool show );
48 virtual void refreshMailView(const QValueList<RecMailP>&); 51 virtual void refreshMailView(const Q3ValueList<RecMailP>&);
49 virtual void mailLeftClicked( QListViewItem * ); 52 virtual void mailLeftClicked( Q3ListViewItem * );
50 virtual void slotMoveCopyMail(); 53 virtual void slotMoveCopyMail();
51 virtual void slotMoveCopyAllMail(); 54 virtual void slotMoveCopyAllMail();
52 virtual void reEditMail(); 55 virtual void reEditMail();
53 void clearSelection(); 56 void clearSelection();
54 void selectAll(); 57 void selectAll();
55 void slotDownloadMail(); 58 void slotDownloadMail();
56private: 59private:
57 ComposeMail* mCurrentComposer; 60 ComposeMail* mCurrentComposer;
58 void closeViewMail(ViewMail * vm); 61 void closeViewMail(ViewMail * vm);
59 QString mPendingEmail; 62 QString mPendingEmail;
60 QString mPendingName; 63 QString mPendingName;
61 QByteArray mPendingData; 64 QByteArray mPendingData;
62 QCString mPendingMessage; 65 Q3CString mPendingMessage;
63 Settings *settings; 66 Settings *settings;
64 QTextBrowser * tb; 67 Q3TextBrowser * tb;
65 68
66}; 69};
67 70
68#endif 71#endif
diff --git a/kmicromail/qpe/qdialog.h b/kmicromail/qpe/qdialog.h
index c63133d..3720182 100644
--- a/kmicromail/qpe/qdialog.h
+++ b/kmicromail/qpe/qdialog.h
@@ -5,25 +5,25 @@
5#define DEFINE_QDIALOG_HACK 5#define DEFINE_QDIALOG_HACK
6#warning call of include <qdialog.h> 6#warning call of include <qdialog.h>
7#warning including /usr/local/qt/include/qdialog.h 7#warning including /usr/local/qt/include/qdialog.h
8#warning if you get a compiling error 8#warning if you get a compiling error
9#warning please adjust your path here! 9#warning please adjust your path here!
10 10
11#include "/usr/local/qt/include/qdialog.h" 11#include "/usr/local/qt/include/qdialog.h"
12class QDialog_hacked : public QDialog 12class QDialog_hacked : public QDialog
13{ 13{
14 //Q__OBJECT 14 //Q__OBJECT
15 15
16 public: 16 public:
17 QDialog_hacked ( QWidget * parent=0, const char * name=0, bool modal=true, WFlags f=0 ); 17 QDialog_hacked ( QWidget * parent=0, const char * name=0, bool modal=true, Qt::WFlags f=0 );
18 18
19}; 19};
20 20
21#define QDialog QDialog_hacked 21#define QDialog QDialog_hacked
22 22
23#endif 23#endif
24 24
25#else 25#else
26#warning "/usr/local/qt/include/qdialog.h" for KDialog 26#warning "/usr/local/qt/include/qdialog.h" for KDialog
27#include "/usr/local/qt/include/qdialog.h" 27#include "/usr/local/qt/include/qdialog.h"
28 28
29#endif 29#endif
diff --git a/kmicromail/qpe/qdialog_hacked.cpp b/kmicromail/qpe/qdialog_hacked.cpp
index 0a34cec..5d4d353 100644
--- a/kmicromail/qpe/qdialog_hacked.cpp
+++ b/kmicromail/qpe/qdialog_hacked.cpp
@@ -1,27 +1,27 @@
1 1
2#include <qdialog.h> 2#include <qdialog.h>
3#include <qhbox.h> 3#include <q3hbox.h>
4#include <qpushbutton.h> 4#include <qpushbutton.h>
5#include <klocale.h> 5#include <klocale.h>
6#ifdef QDialog 6#ifdef QDialog
7#undef QDialog 7#undef QDialog
8#endif 8#endif
9 QDialog_hacked::QDialog_hacked ( QWidget * parent, const char * name, bool modal, WFlags f ) 9 QDialog_hacked::QDialog_hacked ( QWidget * parent, const char * name, bool modal, Qt::WFlags f )
10 : QDialog( parent,name,modal, f) 10 : QDialog( parent,name,modal, f)
11 { 11 {
12 qDebug("New hacked QDialog for ompi desktop"); 12 qDebug("New hacked QDialog for ompi desktop");
13 //QTimer::singleShot( 1, this,SLOT(addaddbuttons()) ); 13 //QTimer::singleShot( 1, this,SLOT(addaddbuttons()) );
14 14
15 setOrientation ( Vertical ); 15 setOrientation ( Vertical );
16 QHBox * hb = new QHBox ( this ); 16 Q3HBox * hb = new Q3HBox ( this );
17 QPushButton *ok = new QPushButton( i18n("OK"), hb ); 17 QPushButton *ok = new QPushButton( i18n("OK"), hb );
18 QPushButton *cancel = new QPushButton( i18n("Cancel"), hb ); 18 QPushButton *cancel = new QPushButton( i18n("Cancel"), hb );
19 setExtension ( hb ); 19 setExtension ( hb );
20 showExtension ( true ); 20 showExtension ( true );
21 connect ( ok, SIGNAL ( clicked()),this, SLOT (accept() ) ); 21 connect ( ok, SIGNAL ( clicked()),this, SLOT (accept() ) );
22 connect ( cancel, SIGNAL ( clicked()),this, SLOT (reject() ) ); 22 connect ( cancel, SIGNAL ( clicked()),this, SLOT (reject() ) );
23 //setWFlags(WStyle_MinMax ); 23 //setWFlags(WStyle_MinMax );
24 24
25 } 25 }
26 26
27 27
diff --git a/kmicromail/selectsmtp.cpp b/kmicromail/selectsmtp.cpp
index 10b6d79..ead723c 100644
--- a/kmicromail/selectsmtp.cpp
+++ b/kmicromail/selectsmtp.cpp
@@ -1,25 +1,25 @@
1#include "selectsmtp.h" 1#include "selectsmtp.h"
2#include <libmailwrapper/mailwrapper.h> 2#include <libmailwrapper/mailwrapper.h>
3 3
4#include <qcombobox.h> 4#include <qcombobox.h>
5#include <qcheckbox.h> 5#include <qcheckbox.h>
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <qpushbutton.h> 7#include <qpushbutton.h>
8#include <qlineedit.h> 8#include <qlineedit.h>
9#include <qlabel.h> 9#include <qlabel.h>
10#include <qtabwidget.h> 10#include <qtabwidget.h>
11#include <qlistview.h> 11#include <q3listview.h>
12#include <klocale.h> 12#include <klocale.h>
13selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, WFlags fl) 13selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
14 : selectstoreui(parent,name,modal,fl) 14 : selectstoreui(parent,name,modal,fl)
15{ 15{
16 //m_smtpList.setAutoDelete(false); 16 //m_smtpList.setAutoDelete(false);
17 m_smtpList = 0; 17 m_smtpList = 0;
18 //headlabel->setText(i18n("<center>Select SMTP account to use</center>")); 18 //headlabel->setText(i18n("<center>Select SMTP account to use</center>"));
19 headlabel->hide(); 19 headlabel->hide();
20 folderSelection->hide(); 20 folderSelection->hide();
21 folderLabel->hide(); 21 folderLabel->hide();
22 //accountlabel->setText(i18n("SMTP\nAccount:")); 22 //accountlabel->setText(i18n("SMTP\nAccount:"));
23 Line1->hide(); 23 Line1->hide();
24 newFoldersel->hide(); 24 newFoldersel->hide();
25 newFolderedit->hide(); 25 newFolderedit->hide();
diff --git a/kmicromail/selectsmtp.h b/kmicromail/selectsmtp.h
index 9157ddf..d7accf6 100644
--- a/kmicromail/selectsmtp.h
+++ b/kmicromail/selectsmtp.h
@@ -2,25 +2,25 @@
2#define __selectstmp_h 2#define __selectstmp_h
3 3
4 4
5#include "selectstoreui.h" 5#include "selectstoreui.h"
6#include <qlist.h> 6#include <qlist.h>
7 7
8class SMTPaccount; 8class SMTPaccount;
9 9
10class selectsmtp : public selectstoreui 10class selectsmtp : public selectstoreui
11{ 11{
12 Q_OBJECT 12 Q_OBJECT
13public: 13public:
14 selectsmtp(QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 ); 14 selectsmtp(QWidget* parent = 0, const char* name = 0, bool modal = TRUE, Qt::WFlags fl = 0 );
15 virtual ~selectsmtp(); 15 virtual ~selectsmtp();
16 void setSelectionlist(QList<SMTPaccount>*list); 16 void setSelectionlist(QList<SMTPaccount>*list);
17 SMTPaccount*selected_smtp(); 17 SMTPaccount*selected_smtp();
18 18
19protected: 19protected:
20 QList<SMTPaccount>*m_smtpList; 20 QList<SMTPaccount>*m_smtpList;
21 SMTPaccount*m_current_smtp; 21 SMTPaccount*m_current_smtp;
22 22
23protected slots: 23protected slots:
24 virtual void slotAccountselected(int); 24 virtual void slotAccountselected(int);
25}; 25};
26 26
diff --git a/kmicromail/selectstore.h b/kmicromail/selectstore.h
index 447a6ae..d312c1d 100644
--- a/kmicromail/selectstore.h
+++ b/kmicromail/selectstore.h
@@ -1,17 +1,17 @@
1#ifndef _SELECTSTORE_H 1#ifndef _SELECTSTORE_H
2#define _SELECTSTORE_H 2#define _SELECTSTORE_H
3 3
4#include "selectstoreui.h" 4#include "selectstoreui.h"
5#include <qvaluelist.h> 5#include <q3valuelist.h>
6#include <qmap.h> 6#include <qmap.h>
7#include <qstringlist.h> 7#include <qstringlist.h>
8 8
9class AbstractMail; 9class AbstractMail;
10 10
11class Selectstore:public selectstoreui 11class Selectstore:public selectstoreui
12{ 12{
13 Q_OBJECT 13 Q_OBJECT
14public: 14public:
15 Selectstore(QWidget* parent = 0, const char* name = 0); 15 Selectstore(QWidget* parent = 0, const char* name = 0);
16 virtual ~Selectstore(); 16 virtual ~Selectstore();
17 virtual void addAccounts(AbstractMail*mail,const QStringList&folders); 17 virtual void addAccounts(AbstractMail*mail,const QStringList&folders);
diff --git a/kmicromail/settingsdialog.cpp b/kmicromail/settingsdialog.cpp
index c593b48..889c490 100644
--- a/kmicromail/settingsdialog.cpp
+++ b/kmicromail/settingsdialog.cpp
@@ -1,33 +1,35 @@
1#include <qcheckbox.h> 1#include <qcheckbox.h>
2#include <qspinbox.h> 2#include <qspinbox.h>
3#include <qlayout.h> 3#include <qlayout.h>
4#include <qtabwidget.h> 4#include <qtabwidget.h>
5//Added by qt3to4:
6#include <Q3GridLayout>
5 7
6#include <kconfig.h> 8#include <kconfig.h>
7#include <kprefs.h> 9#include <kprefs.h>
8#include <klocale.h> 10#include <klocale.h>
9#include <kglobal.h> 11#include <kglobal.h>
10#include <kfontdialog.h> 12#include <kfontdialog.h>
11 13
12#include "settingsdialog.h" 14#include "settingsdialog.h"
13 15
14 16
15SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 17SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, Qt::WFlags fl )
16 : SettingsDialogUI( parent, name, modal, fl ) { 18 : SettingsDialogUI( parent, name, modal, fl ) {
17 19
18#if 0 20#if 0
19 QTabWidget *topFrame = TabWidget2; 21 QTabWidget *topFrame = TabWidget2;
20 22
21 QGridLayout *topLayout = new QGridLayout(topFrame,3,3); 23 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,3);
22 topLayout->setSpacing(2); 24 topLayout->setSpacing(2);
23 topLayout->setMargin(3); 25 topLayout->setMargin(3);
24 KPrefsWidFont * tVFont; 26 KPrefsWidFont * tVFont;
25 int i = 0; 27 int i = 0;
26 KPrefsWidFont *timeLabelsFont = 28 KPrefsWidFont *timeLabelsFont =
27 addWidFont(i18n("OK"),i18n("Application(nr):"), 29 addWidFont(i18n("OK"),i18n("Application(nr):"),
28 &(mAppFont),topFrame); 30 &(mAppFont),topFrame);
29 topLayout->addWidget(timeLabelsFont->label(),i,0); 31 topLayout->addWidget(timeLabelsFont->label(),i,0);
30 topLayout->addWidget(timeLabelsFont->preview(),i,1); 32 topLayout->addWidget(timeLabelsFont->preview(),i,1);
31 topLayout->addWidget(timeLabelsFont->button(),i,2); 33 topLayout->addWidget(timeLabelsFont->button(),i,2);
32 ++i; 34 ++i;
33 35
diff --git a/kmicromail/settingsdialog.h b/kmicromail/settingsdialog.h
index 042b69f..b168226 100644
--- a/kmicromail/settingsdialog.h
+++ b/kmicromail/settingsdialog.h
@@ -2,25 +2,25 @@
2#define SETTINGS_DIALOG_H 2#define SETTINGS_DIALOG_H
3 3
4#include <qwidget.h> 4#include <qwidget.h>
5#include <qfont.h> 5#include <qfont.h>
6 6
7#include "settingsdialogui.h" 7#include "settingsdialogui.h"
8 8
9class SettingsDialog : public SettingsDialogUI { 9class SettingsDialog : public SettingsDialogUI {
10 10
11Q_OBJECT 11Q_OBJECT
12 12
13public: 13public:
14 SettingsDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 14 SettingsDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
15 ~SettingsDialog(); 15 ~SettingsDialog();
16 16
17private: 17private:
18 void readConfig(); 18 void readConfig();
19 void writeConfig(); 19 void writeConfig();
20 QFont mAppFont, mComposeFont, mReadFont; 20 QFont mAppFont, mComposeFont, mReadFont;
21 21
22private slots: 22private slots:
23 void accept(); 23 void accept();
24 24
25 25
26}; 26};
diff --git a/kmicromail/statuswidget.cpp b/kmicromail/statuswidget.cpp
index 19cf635..6da6f54 100644
--- a/kmicromail/statuswidget.cpp
+++ b/kmicromail/statuswidget.cpp
@@ -1,22 +1,22 @@
1#include <qtimer.h> 1#include <qtimer.h>
2#include <qprogressbar.h> 2#include <q3progressbar.h>
3#include <qlabel.h> 3#include <qlabel.h>
4 4
5#include "statuswidget.h" 5#include "statuswidget.h"
6 6
7// the current problem I see is "locking": used exclusive by one sender 7// the current problem I see is "locking": used exclusive by one sender
8 8
9 9
10StatusWidget::StatusWidget( QWidget* parent, const char* name,WFlags fl ) 10StatusWidget::StatusWidget( QWidget* parent, const char* name,Qt::WFlags fl )
11 : StatusWidgetUI( parent, name, fl ) { 11 : StatusWidgetUI( parent, name, fl ) {
12 12
13 setMaximumHeight( 15 ); 13 setMaximumHeight( 15 );
14 // hide for now since nothing reports decent progress data yet. 14 // hide for now since nothing reports decent progress data yet.
15 statusProgress->hide(); 15 statusProgress->hide();
16 } 16 }
17 17
18StatusWidget::~StatusWidget() { 18StatusWidget::~StatusWidget() {
19} 19}
20 20
21void StatusWidget::setText( const QString& text ) { 21void StatusWidget::setText( const QString& text ) {
22 show(); 22 show();
diff --git a/kmicromail/statuswidget.h b/kmicromail/statuswidget.h
index 73f0d75..1d29daf 100644
--- a/kmicromail/statuswidget.h
+++ b/kmicromail/statuswidget.h
@@ -1,24 +1,24 @@
1#ifndef STATUS_WIDGET_H 1#ifndef STATUS_WIDGET_H
2#define STATUS_WIDGET_H 2#define STATUS_WIDGET_H
3 3
4#include <qwidget.h> 4#include <qwidget.h>
5#include "statuswidgetui.h" 5#include "statuswidgetui.h"
6 6
7class StatusWidget : public StatusWidgetUI { 7class StatusWidget : public StatusWidgetUI {
8 8
9Q_OBJECT 9Q_OBJECT
10 10
11public: 11public:
12 StatusWidget( QWidget* parent = 0, const char* name = 0,WFlags fl = 0 ); 12 StatusWidget( QWidget* parent = 0, const char* name = 0,Qt::WFlags fl = 0 );
13 ~StatusWidget(); 13 ~StatusWidget();
14 14
15 15
16public slots: 16public slots:
17 17
18 void setText( const QString& text ); 18 void setText( const QString& text );
19 void setProgress( int progress ); 19 void setProgress( int progress );
20}; 20};
21 21
22 22
23#endif 23#endif
24 24
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 685b4e4..c9dedb0 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -15,73 +15,76 @@
15#include "composemail.h" 15#include "composemail.h"
16#include "viewmail.h" 16#include "viewmail.h"
17 17
18#include <libmailwrapper/settings.h> 18#include <libmailwrapper/settings.h>
19#include <libmailwrapper/abstractmail.h> 19#include <libmailwrapper/abstractmail.h>
20#include <libmailwrapper/mailtypes.h> 20#include <libmailwrapper/mailtypes.h>
21 21
22#include <qdialog.h> 22#include <qdialog.h>
23 23
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25 25
26/* QT */ 26/* QT */
27#include <qtextbrowser.h> 27#include <q3textbrowser.h>
28#include <qmessagebox.h> 28#include <qmessagebox.h>
29#include <qtextstream.h> 29#include <q3textstream.h>
30#include <qaction.h> 30#include <qaction.h>
31#include <qpopupmenu.h> 31#include <q3popupmenu.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qlayout.h> 33#include <qlayout.h>
34//Added by qt3to4:
35#include <Q3ValueList>
36#include <Q3VBoxLayout>
34 37
35//using namespace Opie::Ui; 38//using namespace Opie::Ui;
36//using namespace Opie::Core; 39//using namespace Opie::Core;
37 40
38AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 41AttachItem::AttachItem(Q3ListView * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file,
39 const QString&fsize,int num,const QValueList<int>&path) 42 const QString&fsize,int num,const Q3ValueList<int>&path)
40 : QListViewItem(parent,after),_partNum(num) 43 : Q3ListViewItem(parent,after),_partNum(num)
41{ 44{
42 _path=path; 45 _path=path;
43 setText(0, mime); 46 setText(0, mime);
44 setText(1, desc); 47 setText(1, desc);
45 setText(2, file); 48 setText(2, file);
46 setText(3, fsize); 49 setText(3, fsize);
47} 50}
48 51
49AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 52AttachItem::AttachItem(Q3ListViewItem * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file,
50 const QString&fsize,int num,const QValueList<int>&path) 53 const QString&fsize,int num,const Q3ValueList<int>&path)
51 : QListViewItem(parent,after),_partNum(num) 54 : Q3ListViewItem(parent,after),_partNum(num)
52{ 55{
53 _path=path; 56 _path=path;
54 setText(0, mime); 57 setText(0, mime);
55 setText(1, desc); 58 setText(1, desc);
56 setText(2, file); 59 setText(2, file);
57 setText(3, fsize); 60 setText(3, fsize);
58} 61}
59 62
60bool AttachItem::isParentof(const QValueList<int>&path) 63bool AttachItem::isParentof(const Q3ValueList<int>&path)
61{ 64{
62 /* if not set, then no parent */ 65 /* if not set, then no parent */
63 if (path.count()==0||_path.count()==0) return false; 66 if (path.count()==0||_path.count()==0) return false;
64 /* the parent must have one digit less then a child */ 67 /* the parent must have one digit less then a child */
65 if (path.count()!=_path.count()+1) return false; 68 if (path.count()!=_path.count()+1) return false;
66 for (unsigned int i=0; i < _path.count();++i) 69 for (unsigned int i=0; i < _path.count();++i)
67 { 70 {
68 if (_path[i]!=path[i]) return false; 71 if (_path[i]!=path[i]) return false;
69 } 72 }
70 return true; 73 return true;
71} 74}
72 75
73AttachItem* ViewMail::searchParent(const QValueList<int>&path) 76AttachItem* ViewMail::searchParent(const Q3ValueList<int>&path)
74{ 77{
75 QListViewItemIterator it( attachments ); 78 Q3ListViewItemIterator it( attachments );
76 for ( ; it.current(); ++it ) 79 for ( ; it.current(); ++it )
77 { 80 {
78 AttachItem*ati = (AttachItem*)it.current(); 81 AttachItem*ati = (AttachItem*)it.current();
79 if (ati->isParentof(path)) return ati; 82 if (ati->isParentof(path)) return ati;
80 } 83 }
81 return 0; 84 return 0;
82} 85}
83 86
84AttachItem* ViewMail::lastChild(AttachItem*parent) 87AttachItem* ViewMail::lastChild(AttachItem*parent)
85{ 88{
86 if (!parent) return 0; 89 if (!parent) return 0;
87 AttachItem* item = (AttachItem*)parent->firstChild(); 90 AttachItem* item = (AttachItem*)parent->firstChild();
@@ -145,25 +148,25 @@ void ViewMail::setBody(const RecBodyP&body )
145 default: 148 default:
146 break; 149 break;
147 } 150 }
148 151
149 { 152 {
150 /* I did not found a method to make a CONTENT reset on a QTextStream 153 /* I did not found a method to make a CONTENT reset on a QTextStream
151 so I use this construct that the stream will re-constructed in each 154 so I use this construct that the stream will re-constructed in each
152 loop. To let it work, the textstream is packed into a own area of 155 loop. To let it work, the textstream is packed into a own area of
153 code is it will be destructed after finishing its small job. 156 code is it will be destructed after finishing its small job.
154 */ 157 */
155 QTextOStream o(&fsize); 158 QTextOStream o(&fsize);
156 if (w>0) o.precision(2); else o.precision(0); 159 if (w>0) o.precision(2); else o.precision(0);
157 o.setf(QTextStream::fixed); 160 o.setf(Q3TextStream::fixed);
158 o << s << " " << q << "Byte"; 161 o << s << " " << q << "Byte";
159 } 162 }
160 163
161 curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body->Description()->Positionlist()); 164 curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body->Description()->Positionlist());
162 QString filename = ""; 165 QString filename = "";
163 166
164 for (unsigned int i = 0; i < body->Parts().count();++i) 167 for (unsigned int i = 0; i < body->Parts().count();++i)
165 { 168 {
166 filename = ""; 169 filename = "";
167 type = body->Parts()[i]->Type()+"/"+body->Parts()[i]->Subtype(); 170 type = body->Parts()[i]->Type()+"/"+body->Parts()[i]->Subtype();
168 part_plist_t::ConstIterator it = body->Parts()[i]->Parameters().begin(); 171 part_plist_t::ConstIterator it = body->Parts()[i]->Parameters().begin();
169 for (;it!=body->Parts()[i]->Parameters().end();++it) 172 for (;it!=body->Parts()[i]->Parameters().end();++it)
@@ -186,25 +189,25 @@ void ViewMail::setBody(const RecBodyP&body )
186 case 1: 189 case 1:
187 q="k"; 190 q="k";
188 break; 191 break;
189 case 2: 192 case 2:
190 q="M"; 193 q="M";
191 break; 194 break;
192 default: 195 default:
193 q=""; 196 q="";
194 break; 197 break;
195 } 198 }
196 QTextOStream o(&fsize); 199 QTextOStream o(&fsize);
197 if (w>0) o.precision(2); else o.precision(0); 200 if (w>0) o.precision(2); else o.precision(0);
198 o.setf(QTextStream::fixed); 201 o.setf(Q3TextStream::fixed);
199 o << s << " " << q << "Byte"; 202 o << s << " " << q << "Byte";
200 desc = body->Parts()[i]->Description(); 203 desc = body->Parts()[i]->Description();
201 parentItem = searchParent(body->Parts()[i]->Positionlist()); 204 parentItem = searchParent(body->Parts()[i]->Positionlist());
202 if (parentItem) 205 if (parentItem)
203 { 206 {
204 AttachItem*temp = lastChild(parentItem); 207 AttachItem*temp = lastChild(parentItem);
205 if (temp) curItem = temp; 208 if (temp) curItem = temp;
206 curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist()); 209 curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist());
207 attachments->setRootIsDecorated(true); 210 attachments->setRootIsDecorated(true);
208 curItem = parentItem; 211 curItem = parentItem;
209 } 212 }
210 else 213 else
@@ -230,35 +233,35 @@ void ViewMail::slotViewSource()
230 } 233 }
231 } else 234 } else
232 setText(); 235 setText();
233 236
234 237
235} 238}
236void ViewMail::slotShowHtml( bool state ) 239void ViewMail::slotShowHtml( bool state )
237{ 240{
238 m_showHtml = state; 241 m_showHtml = state;
239 setText(); 242 setText();
240} 243}
241 244
242void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) 245void ViewMail::slotItemClicked( Q3ListViewItem * item , const QPoint & point, int )
243{ 246{
244 if (!item ) 247 if (!item )
245 return; 248 return;
246 249
247 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) 250 if ( ( ( AttachItem* )item )->Partnumber() == -1 )
248 { 251 {
249 setText(); 252 setText();
250 return; 253 return;
251 } 254 }
252 QPopupMenu *menu = new QPopupMenu(); 255 Q3PopupMenu *menu = new Q3PopupMenu();
253 int ret=0; 256 int ret=0;
254 257
255 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) 258 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" )
256 { 259 {
257 menu->insertItem( i18n( "Show Text" ), 1 ); 260 menu->insertItem( i18n( "Show Text" ), 1 );
258 } 261 }
259 if (item->text(0).left(6)=="image/") { 262 if (item->text(0).left(6)=="image/") {
260 menu->insertItem(i18n("Display image preview"),2); 263 menu->insertItem(i18n("Display image preview"),2);
261 } 264 }
262 menu->insertItem( i18n( "Save Attachment" ), 0 ); 265 menu->insertItem( i18n( "Save Attachment" ), 0 );
263 menu->insertSeparator(1); 266 menu->insertSeparator(1);
264 267
@@ -269,44 +272,44 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
269 case 0: 272 case 0:
270 { 273 {
271 //MimeTypes types; 274 //MimeTypes types;
272 //types.insert( "all", "*" ); 275 //types.insert( "all", "*" );
273 QString str = KFileDialog::getSaveFileName( "/", item->text( 2 ), this ); 276 QString str = KFileDialog::getSaveFileName( "/", item->text( 2 ), this );
274 277
275 if( !str.isEmpty() ) 278 if( !str.isEmpty() )
276 { 279 {
277 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); 280 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
278 if (content) 281 if (content)
279 { 282 {
280 QFile output(str); 283 QFile output(str);
281 output.open(IO_WriteOnly); 284 output.open(QIODevice::WriteOnly);
282 output.writeBlock(content->Content(),content->Length()); 285 output.writeBlock(content->Content(),content->Length());
283 output.close(); 286 output.close();
284 delete content; 287 delete content;
285 } 288 }
286 } 289 }
287 } 290 }
288 break ; 291 break ;
289 292
290 case 2: 293 case 2:
291 { 294 {
292#ifdef DESKTOP_VERSION 295#ifdef DESKTOP_VERSION
293 QString tmpfile = locateLocal( "tmp", "opiemail-image"); 296 QString tmpfile = locateLocal( "tmp", "opiemail-image");
294#else 297#else
295 QString tmpfile = "/tmp/opiemail-image"; 298 QString tmpfile = "/tmp/opiemail-image";
296#endif 299#endif
297 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); 300 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
298 if (content) { 301 if (content) {
299 QFile output(tmpfile); 302 QFile output(tmpfile);
300 output.open(IO_WriteOnly); 303 output.open(QIODevice::WriteOnly);
301 output.writeBlock(content->Content(),content->Length()); 304 output.writeBlock(content->Content(),content->Length());
302 output.close(); 305 output.close();
303 delete content; 306 delete content;
304 MailImageDlg iview(""); 307 MailImageDlg iview("");
305 iview.setName(tmpfile); 308 iview.setName(tmpfile);
306 KApplication::execDialog(&iview); 309 KApplication::execDialog(&iview);
307 output.remove(); 310 output.remove();
308 } 311 }
309 } 312 }
310 break; 313 break;
311 case 1: 314 case 1:
312 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) 315 if ( ( ( AttachItem* )item )->Partnumber() == -1 )
@@ -343,42 +346,42 @@ void ViewMail::setMail(const RecMailP&mail )
343 setText(); 346 setText();
344} 347}
345 348
346void ViewMail::slotNextMail() 349void ViewMail::slotNextMail()
347{ 350{
348 nextMail->blockSignals( true ); 351 nextMail->blockSignals( true );
349 setCaption(i18n("Displaying next mail...please wait!")); 352 setCaption(i18n("Displaying next mail...please wait!"));
350 qApp->processEvents(); 353 qApp->processEvents();
351 emit showNextMail(this); 354 emit showNextMail(this);
352 nextMail->blockSignals( false ); 355 nextMail->blockSignals( false );
353} 356}
354 357
355ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) 358ViewMail::ViewMail( QWidget *parent, const char *name, Qt::WFlags fl)
356 : ViewMailBase(parent, name, fl), _inLoop(false) 359 : ViewMailBase(parent, name, fl), _inLoop(false)
357{ 360{
358 m_gotBody = false; 361 m_gotBody = false;
359 deleted = false; 362 deleted = false;
360 sourceOn = false; 363 sourceOn = false;
361 readConfig(); 364 readConfig();
362 connect( reply, SIGNAL(activated()), SLOT(slotReply())); 365 connect( reply, SIGNAL(activated()), SLOT(slotReply()));
363 connect( forward, SIGNAL(activated()), SLOT(slotForward())); 366 connect( forward, SIGNAL(activated()), SLOT(slotForward()));
364 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); 367 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) );
365 connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); 368 connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) );
366 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 369 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
367 connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) ); 370 connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) );
368 connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) ); 371 connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) );
369 connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) ); 372 connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) );
370 373
371 attachments->setEnabled(m_gotBody); 374 attachments->setEnabled(m_gotBody);
372 connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); 375 connect( attachments, SIGNAL( clicked(Q3ListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(Q3ListViewItem*,const QPoint&, int) ) );
373 376
374 attachments->setSorting(-1); 377 attachments->setSorting(-1);
375} 378}
376 379
377void ViewMail::readConfig() 380void ViewMail::readConfig()
378{ 381{
379 382
380 setFont ( KOPrefs::instance()->mReadFont ); 383 setFont ( KOPrefs::instance()->mReadFont );
381 m_showHtml = KOPrefs::instance()->mViewAsHtml; 384 m_showHtml = KOPrefs::instance()->mViewAsHtml;
382 showHtml->setOn( m_showHtml ); 385 showHtml->setOn( m_showHtml );
383} 386}
384 387
@@ -548,28 +551,28 @@ void ViewMail::slotForward()
548 551
549void ViewMail::slotDeleteMail( ) 552void ViewMail::slotDeleteMail( )
550{ 553{
551 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 554 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
552 { 555 {
553 emit deleteAndDisplayNextMail( this); 556 emit deleteAndDisplayNextMail( this);
554 //m_recMail->Wrapper()->deleteMail( m_recMail ); 557 //m_recMail->Wrapper()->deleteMail( m_recMail );
555 //hide(); 558 //hide();
556 deleted = true; 559 deleted = true;
557 } 560 }
558} 561}
559 562
560MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f) 563MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, Qt::WFlags f)
561 : QDialog(parent,name,modal) 564 : QDialog(parent,name,modal)
562{ 565{
563 QVBoxLayout*dlglayout = new QVBoxLayout(this); 566 Q3VBoxLayout*dlglayout = new Q3VBoxLayout(this);
564 dlglayout->setSpacing(2); 567 dlglayout->setSpacing(2);
565 dlglayout->setMargin(1); 568 dlglayout->setMargin(1);
566 //m_imageview = new Opie::MM::OImageScrollView(this); 569 //m_imageview = new Opie::MM::OImageScrollView(this);
567 //dlglayout->addWidget(m_imageview); 570 //dlglayout->addWidget(m_imageview);
568} 571}
569 572
570MailImageDlg::~MailImageDlg() 573MailImageDlg::~MailImageDlg()
571{ 574{
572} 575}
573 576
574void MailImageDlg::setName(const QString&fname) 577void MailImageDlg::setName(const QString&fname)
575{ 578{
diff --git a/kmicromail/viewmail.h b/kmicromail/viewmail.h
index bb5b685..6cf6efb 100644
--- a/kmicromail/viewmail.h
+++ b/kmicromail/viewmail.h
@@ -1,93 +1,93 @@
1#ifndef VIEWMAIL_H 1#ifndef VIEWMAIL_H
2#define VIEWMAIL_H 2#define VIEWMAIL_H
3 3
4#include "viewmailbase.h" 4#include "viewmailbase.h"
5#include <libmailwrapper/mailtypes.h> 5#include <libmailwrapper/mailtypes.h>
6 6
7#include <qdialog.h> 7#include <qdialog.h>
8#include <qapplication.h> 8#include <qapplication.h>
9 9
10#include <qlistview.h> 10#include <q3listview.h>
11#include <qmap.h> 11#include <qmap.h>
12#include <klocale.h> 12#include <klocale.h>
13#include <qstringlist.h> 13#include <qstringlist.h>
14#include <qvaluelist.h> 14#include <q3valuelist.h>
15 15
16//namespace Opie { namespace MM { class OImageScrollView; } } 16//namespace Opie { namespace MM { class OImageScrollView; } }
17 17
18class AttachItem : public QListViewItem 18class AttachItem : public Q3ListViewItem
19{ 19{
20public: 20public:
21 AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 21 AttachItem(Q3ListView * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file,
22 const QString&fsize,int num,const QValueList<int>&path); 22 const QString&fsize,int num,const Q3ValueList<int>&path);
23 AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 23 AttachItem(Q3ListViewItem * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file,
24 const QString&fsize,int num,const QValueList<int>&path); 24 const QString&fsize,int num,const Q3ValueList<int>&path);
25 int Partnumber() { return _partNum; } 25 int Partnumber() { return _partNum; }
26 bool isParentof(const QValueList<int>&path); 26 bool isParentof(const Q3ValueList<int>&path);
27 27
28private: 28private:
29 int _partNum; 29 int _partNum;
30 /* needed for a better display of attachments */ 30 /* needed for a better display of attachments */
31 QValueList<int> _path; 31 Q3ValueList<int> _path;
32}; 32};
33 33
34class ViewMail : public ViewMailBase 34class ViewMail : public ViewMailBase
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37 37
38public: 38public:
39 ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = 0); 39 ViewMail( QWidget *parent = 0, const char *name = 0, Qt::WFlags fl = 0);
40 ~ViewMail(); 40 ~ViewMail();
41 41
42 void hide(); 42 void hide();
43 void exec(); 43 void exec();
44 void setMail(const RecMailP&mail ); 44 void setMail(const RecMailP&mail );
45 void setBody(const RecBodyP&body); 45 void setBody(const RecBodyP&body);
46 bool deleted; 46 bool deleted;
47 signals: 47 signals:
48 void showNextMail(ViewMail*); 48 void showNextMail(ViewMail*);
49 void deleteAndDisplayNextMail(ViewMail *); 49 void deleteAndDisplayNextMail(ViewMail *);
50 void signalDownloadMail(); 50 void signalDownloadMail();
51protected: 51protected:
52 QString deHtml(const QString &string); 52 QString deHtml(const QString &string);
53 AttachItem* searchParent(const QValueList<int>&path); 53 AttachItem* searchParent(const Q3ValueList<int>&path);
54 AttachItem* lastChild(AttachItem*parent); 54 AttachItem* lastChild(AttachItem*parent);
55 55
56protected slots: 56protected slots:
57 void slotNextMail(); 57 void slotNextMail();
58 void slotReply(); 58 void slotReply();
59 void slotForward(); 59 void slotForward();
60 void setText(); 60 void setText();
61 void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); 61 void slotItemClicked( Q3ListViewItem * item , const QPoint & point, int c );
62 void slotDeleteMail( ); 62 void slotDeleteMail( );
63 void slotShowHtml( bool ); 63 void slotShowHtml( bool );
64 void slotViewSource(); 64 void slotViewSource();
65 65
66private: 66private:
67 void readConfig(); 67 void readConfig();
68 bool sourceOn;; 68 bool sourceOn;;
69 bool _inLoop; 69 bool _inLoop;
70 QString m_mailHtml; 70 QString m_mailHtml;
71 bool m_gotBody; 71 bool m_gotBody;
72 RecBodyP m_body; 72 RecBodyP m_body;
73 RecMailP m_recMail; 73 RecMailP m_recMail;
74 bool m_showHtml; 74 bool m_showHtml;
75 75
76 // 0 from 1 subject 2 bodytext 3 date 76 // 0 from 1 subject 2 bodytext 3 date
77 QMap <int,QString> m_mail; 77 QMap <int,QString> m_mail;
78 // 0 to 1 cc 2 bcc 78 // 0 to 1 cc 2 bcc
79 QMap <int,QStringList> m_mail2; 79 QMap <int,QStringList> m_mail2;
80}; 80};
81 81
82class MailImageDlg:public QDialog 82class MailImageDlg:public QDialog
83{ 83{
84 Q_OBJECT 84 Q_OBJECT
85public: 85public:
86 MailImageDlg(const QString&,QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0); 86 MailImageDlg(const QString&,QWidget *parent = 0, const char *name = 0, bool modal = true, Qt::WFlags f = 0);
87 ~MailImageDlg(); 87 ~MailImageDlg();
88 void setName(const QString&); 88 void setName(const QString&);
89protected: 89protected:
90 //Opie::MM::OImageScrollView*m_imageview; 90 //Opie::MM::OImageScrollView*m_imageview;
91}; 91};
92 92
93#endif 93#endif
diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp
index 3bb964e..371ee91 100644
--- a/kmicromail/viewmailbase.cpp
+++ b/kmicromail/viewmailbase.cpp
@@ -1,38 +1,41 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2#include <qtextbrowser.h> 2#include <q3textbrowser.h>
3#include <qlistview.h> 3#include <q3listview.h>
4#include <qaction.h> 4#include <qaction.h>
5#include <qlabel.h> 5#include <qlabel.h>
6#include <qvbox.h> 6#include <q3vbox.h>
7#include <qapplication.h> 7#include <qapplication.h>
8 8
9#include <qtoolbar.h> 9#include <q3toolbar.h>
10#include <qmenubar.h> 10#include <qmenubar.h>
11//Added by qt3to4:
12#include <QKeyEvent>
13#include <Q3PopupMenu>
11#include <kiconloader.h> 14#include <kiconloader.h>
12//#include <qpe/resource.h> 15//#include <qpe/resource.h>
13#include <klocale.h> 16#include <klocale.h>
14 17
15#include "viewmailbase.h" 18#include "viewmailbase.h"
16//#include "opendiag.h" 19//#include "opendiag.h"
17 20
18ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) 21ViewMailBase::ViewMailBase(QWidget *parent, const char *name, Qt::WFlags fl)
19 : QMainWindow(parent, name, fl) 22 : Q3MainWindow(parent, name, fl)
20{ 23{
21 24
22 setToolBarsMovable(false); 25 setToolBarsMovable(false);
23 26
24 toolbar = new QToolBar(this); 27 toolbar = new Q3ToolBar(this);
25 menubar = new QMenuBar( toolbar ); 28 menubar = new QMenuBar( toolbar );
26 mailmenu = new QPopupMenu( menubar ); 29 mailmenu = new Q3PopupMenu( menubar );
27 menubar->insertItem( i18n( "Mail" ), mailmenu ); 30 menubar->insertItem( i18n( "Mail" ), mailmenu );
28 31
29 toolbar->setHorizontalStretchable(true); 32 toolbar->setHorizontalStretchable(true);
30 addToolBar(toolbar); 33 addToolBar(toolbar);
31 34
32 viewSource = new QAction(i18n("View Source"), 0, 0, this); 35 viewSource = new QAction(i18n("View Source"), 0, 0, this);
33 viewSource->addTo(mailmenu); 36 viewSource->addTo(mailmenu);
34 37
35 downloadMail= new QAction(i18n("Download Mail"),SmallIcon("add"), 0, 0, this); 38 downloadMail= new QAction(i18n("Download Mail"),SmallIcon("add"), 0, 0, this);
36 downloadMail->addTo(toolbar); 39 downloadMail->addTo(toolbar);
37 downloadMail->addTo(mailmenu); 40 downloadMail->addTo(mailmenu);
38 41
@@ -60,41 +63,41 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl)
60 63
61 nextMail = new QAction(i18n("Show next mail"),SmallIcon("enter"), 0, 0, this); 64 nextMail = new QAction(i18n("Show next mail"),SmallIcon("enter"), 0, 0, this);
62 QLabel *spacer = new QLabel(toolbar); 65 QLabel *spacer = new QLabel(toolbar);
63 nextMail->addTo(toolbar); 66 nextMail->addTo(toolbar);
64 nextMail->addTo(mailmenu); 67 nextMail->addTo(mailmenu);
65 68
66 closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); 69 closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this);
67 //QLabel *spacer = new QLabel(toolbar); 70 //QLabel *spacer = new QLabel(toolbar);
68 spacer->setBackgroundMode(QWidget::PaletteButton); 71 spacer->setBackgroundMode(QWidget::PaletteButton);
69 toolbar->setStretchableWidget(spacer); 72 toolbar->setStretchableWidget(spacer);
70 closeMail->addTo(toolbar); 73 closeMail->addTo(toolbar);
71 closeMail->addTo(mailmenu); 74 closeMail->addTo(mailmenu);
72 QVBox *view = new QVBox(this); 75 Q3VBox *view = new Q3VBox(this);
73 setCentralWidget(view); 76 setCentralWidget(view);
74 77
75 attachments = new QListView(view); 78 attachments = new Q3ListView(view);
76 int fixh = 100; 79 int fixh = 100;
77 if ( QApplication::desktop()->width() > 320 ) 80 if ( QApplication::desktop()->width() > 320 )
78 fixh = 200; 81 fixh = 200;
79 attachments->setFixedHeight(fixh); 82 attachments->setFixedHeight(fixh);
80 attachments->setAllColumnsShowFocus(true); 83 attachments->setAllColumnsShowFocus(true);
81 attachments->addColumn("Mime Type", fixh-30); 84 attachments->addColumn("Mime Type", fixh-30);
82 attachments->addColumn(i18n("Description"), 100); 85 attachments->addColumn(i18n("Description"), 100);
83 attachments->addColumn(i18n("Filename"), 80); 86 attachments->addColumn(i18n("Filename"), 80);
84 attachments->addColumn(i18n("Size"), 80); 87 attachments->addColumn(i18n("Size"), 80);
85 attachments->setSorting(-1); 88 attachments->setSorting(-1);
86 attachments->hide(); 89 attachments->hide();
87 90
88 browser = new QTextBrowser(view); 91 browser = new Q3TextBrowser(view);
89 92
90 //openDiag = new OpenDiag(view); 93 //openDiag = new OpenDiag(view);
91 //openDiag->hide(); 94 //openDiag->hide();
92 95
93} 96}
94 97
95void ViewMailBase::slotChangeAttachview(bool state) 98void ViewMailBase::slotChangeAttachview(bool state)
96{ 99{
97 if (state) attachments->show(); 100 if (state) attachments->show();
98 else attachments->hide(); 101 else attachments->hide();
99} 102}
100 103
diff --git a/kmicromail/viewmailbase.h b/kmicromail/viewmailbase.h
index 7c075eb..3f1dead 100644
--- a/kmicromail/viewmailbase.h
+++ b/kmicromail/viewmailbase.h
@@ -1,44 +1,47 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2#ifndef VIEWMAILBASE_H 2#ifndef VIEWMAILBASE_H
3#define VIEWMAILBASE_H 3#define VIEWMAILBASE_H
4 4
5#include <qmainwindow.h> 5#include <q3mainwindow.h>
6//Added by qt3to4:
7#include <Q3PopupMenu>
8#include <QKeyEvent>
6 9
7#ifndef DESKTOP_VERSION 10#ifndef DESKTOP_VERSION
8#include <qpe/qpemenubar.h> 11#include <qpe/qpemenubar.h>
9#define QMenuBar QPEMenuBar 12#define QMenuBar QPEMenuBar
10#endif 13#endif
11 14
12class QAction; 15class QAction;
13class OpenDiag; 16class OpenDiag;
14class QListView; 17class Q3ListView;
15class QToolBar; 18class Q3ToolBar;
16class QTextBrowser; 19class Q3TextBrowser;
17class QMenuBar; 20class QMenuBar;
18class QPopupMenu; 21class Q3PopupMenu;
19 22
20class ViewMailBase : public QMainWindow 23class ViewMailBase : public Q3MainWindow
21{ 24{
22 Q_OBJECT 25 Q_OBJECT
23 26
24public: 27public:
25 ViewMailBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); 28 ViewMailBase(QWidget *parent = 0, const char *name = 0, Qt::WFlags fl = 0);
26 29
27protected: 30protected:
28 QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail, *downloadMail, *viewSource; 31 QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail, *downloadMail, *viewSource;
29 QListView *attachments; 32 Q3ListView *attachments;
30 QToolBar *toolbar; 33 Q3ToolBar *toolbar;
31 QTextBrowser *browser; 34 Q3TextBrowser *browser;
32 OpenDiag *openDiag; 35 OpenDiag *openDiag;
33 QMenuBar *menubar; 36 QMenuBar *menubar;
34 QPopupMenu *mailmenu; 37 Q3PopupMenu *mailmenu;
35 38
36protected slots: 39protected slots:
37 void slotChangeAttachview(bool state); 40 void slotChangeAttachview(bool state);
38 virtual void keyPressEvent ( QKeyEvent * e ); 41 virtual void keyPressEvent ( QKeyEvent * e );
39 42
40 43
41}; 44};
42 45
43#endif 46#endif
44 47
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 8385bcc..c1a2f76 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -23,40 +23,46 @@
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
24 GNU General Public License for more details. 24 GNU General Public License for more details.
25 25
26 You should have received a copy of the GNU General Public License 26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software 27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#include <stdlib.h> 31#include <stdlib.h>
32 32
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qradiobutton.h> 34#include <qradiobutton.h>
35#include <qbuttongroup.h> 35#include <q3buttongroup.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qclipboard.h> 37#include <qclipboard.h>
38#include <qcursor.h> 38#include <qcursor.h>
39#include <qmessagebox.h> 39#include <qmessagebox.h>
40#include <qprogressbar.h> 40#include <q3progressbar.h>
41#include <qmultilineedit.h> 41#include <q3multilineedit.h>
42#include <qtimer.h> 42#include <qtimer.h>
43#include <qwidgetstack.h> 43#include <q3widgetstack.h>
44#include <qptrlist.h> 44#include <q3ptrlist.h>
45#include <qregexp.h> 45#include <qregexp.h>
46#include <qgroupbox.h> 46#include <q3groupbox.h>
47#include <qfile.h> 47#include <qfile.h>
48#include <qdir.h> 48#include <qdir.h>
49#ifndef KORG_NOSPLITTER 49#ifndef KORG_NOSPLITTER
50#include <qsplitter.h> 50#include <qsplitter.h>
51//Added by qt3to4:
52#include <Q3VBoxLayout>
53#include <QKeyEvent>
54#include <Q3Frame>
55#include <QLabel>
56#include <Q3ValueList>
51#endif 57#endif
52 58
53#include <kglobal.h> 59#include <kglobal.h>
54#include <kdebug.h> 60#include <kdebug.h>
55#include <kstandarddirs.h> 61#include <kstandarddirs.h>
56#include <kfiledialog.h> 62#include <kfiledialog.h>
57#include <kmessagebox.h> 63#include <kmessagebox.h>
58#include <knotifyclient.h> 64#include <knotifyclient.h>
59#include <kconfig.h> 65#include <kconfig.h>
60 66
61#include <libkdepim/ksyncprefsdialog.h> 67#include <libkdepim/ksyncprefsdialog.h>
62#include <krun.h> 68#include <krun.h>
@@ -119,37 +125,37 @@
119#include "mainwindow.h" 125#include "mainwindow.h"
120#include "categoryeditdialog.h" 126#include "categoryeditdialog.h"
121 127
122#include "calendarview.h" 128#include "calendarview.h"
123#ifndef DESKTOP_VERSION 129#ifndef DESKTOP_VERSION
124#include <qtopia/alarmserver.h> 130#include <qtopia/alarmserver.h>
125#endif 131#endif
126#ifndef _WIN32_ 132#ifndef _WIN32_
127#include <stdlib.h> 133#include <stdlib.h>
128#include <stdio.h> 134#include <stdio.h>
129#include <unistd.h> 135#include <unistd.h>
130#else 136#else
131#include <qprocess.h> 137#include <q3process.h>
132#endif 138#endif
133 139
134#ifdef DESKTOP_VERSION 140#ifdef DESKTOP_VERSION
135#include <kabc/stdaddressbook.h> 141#include <kabc/stdaddressbook.h>
136#endif 142#endif
137using namespace KOrg; 143using namespace KOrg;
138using namespace KCal; 144using namespace KCal;
139extern int globalFlagBlockAgenda; 145extern int globalFlagBlockAgenda;
140extern int globalFlagBlockStartup; 146extern int globalFlagBlockStartup;
141 147
142 148
143MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent) 149MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, Q3PtrList<Incidence> alarms,QDateTime start ) : Q3TextBrowser(parent)
144 150
145{ 151{
146 mAlarms = alarms; 152 mAlarms = alarms;
147 viewport()->setBackgroundColor( QColor( 255, 255, 255 ) ); 153 viewport()->setBackgroundColor( QColor( 255, 255, 255 ) );
148 QString mText = "<table width=\"100%\">\n"; 154 QString mText = "<table width=\"100%\">\n";
149 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; 155 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
150#ifdef DESKTOP_VERSION 156#ifdef DESKTOP_VERSION
151 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; 157 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
152#else 158#else
153 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>"; 159 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>";
154#endif 160#endif
155 // mText += "<img src=\""; 161 // mText += "<img src=\"";
@@ -268,31 +274,31 @@ void MissedAlarmTextBrowser::setSource(const QString & n)
268 return; 274 return;
269 } 275 }
270} 276}
271 277
272 278
273class KOBeamPrefs : public QDialog 279class KOBeamPrefs : public QDialog
274{ 280{
275 public: 281 public:
276 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : 282 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
277 QDialog( parent, name, true ) 283 QDialog( parent, name, true )
278 { 284 {
279 setCaption( i18n("Beam Options") ); 285 setCaption( i18n("Beam Options") );
280 QVBoxLayout* lay = new QVBoxLayout( this ); 286 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
281 lay->setSpacing( 3 ); 287 lay->setSpacing( 3 );
282 lay->setMargin( 3 ); 288 lay->setMargin( 3 );
283 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); 289 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("File format"), this );
284 lay->addWidget( format ); 290 lay->addWidget( format );
285 format->setExclusive ( true ) ; 291 format->setExclusive ( true ) ;
286 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); 292 Q3ButtonGroup* time = new Q3ButtonGroup(1, Qt::Horizontal, i18n("Time format"), this );
287 lay->addWidget( time ); time->setExclusive ( true ) ; 293 lay->addWidget( time ); time->setExclusive ( true ) ;
288 vcal = new QRadioButton(" vCalendar ", format ); 294 vcal = new QRadioButton(" vCalendar ", format );
289 ical = new QRadioButton(" iCalendar ", format ); 295 ical = new QRadioButton(" iCalendar ", format );
290 vcal->setChecked( true ); 296 vcal->setChecked( true );
291 tz = new QRadioButton(i18n(" With timezone "), time ); 297 tz = new QRadioButton(i18n(" With timezone "), time );
292 local = new QRadioButton(i18n(" Local time "), time ); 298 local = new QRadioButton(i18n(" Local time "), time );
293 tz->setChecked( true ); 299 tz->setChecked( true );
294 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); 300 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
295 lay->addWidget( ok ); 301 lay->addWidget( ok );
296 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 302 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
297 lay->addWidget( cancel ); 303 lay->addWidget( cancel );
298 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 304 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
@@ -303,30 +309,30 @@ class KOBeamPrefs : public QDialog
303 bool beamVcal() { return vcal->isChecked(); } 309 bool beamVcal() { return vcal->isChecked(); }
304 bool beamLocal() { return local->isChecked(); } 310 bool beamLocal() { return local->isChecked(); }
305private: 311private:
306 QRadioButton* vcal, *ical, *local, *tz; 312 QRadioButton* vcal, *ical, *local, *tz;
307}; 313};
308class KOCatPrefs : public QDialog 314class KOCatPrefs : public QDialog
309{ 315{
310 public: 316 public:
311 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 317 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
312 QDialog( parent, name, true ) 318 QDialog( parent, name, true )
313 { 319 {
314 setCaption( i18n("Manage new Categories") ); 320 setCaption( i18n("Manage new Categories") );
315 QVBoxLayout* lay = new QVBoxLayout( this ); 321 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
316 lay->setSpacing( 3 ); 322 lay->setSpacing( 3 );
317 lay->setMargin( 3 ); 323 lay->setMargin( 3 );
318 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 ); 324 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 );
319 lay->addWidget( lab ); 325 lay->addWidget( lab );
320 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 326 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("New categories not in list:"), this );
321 lay->addWidget( format ); 327 lay->addWidget( format );
322 format->setExclusive ( true ) ; 328 format->setExclusive ( true ) ;
323 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 329 addCatBut = new QRadioButton(i18n("Add to category list"), format );
324 new QRadioButton(i18n("Remove from Events/Todos"), format ); 330 new QRadioButton(i18n("Remove from Events/Todos"), format );
325 addCatBut->setChecked( true ); 331 addCatBut->setChecked( true );
326 QPushButton * ok = new QPushButton( i18n("Change category list now!"), this ); 332 QPushButton * ok = new QPushButton( i18n("Change category list now!"), this );
327 lay->addWidget( ok ); 333 lay->addWidget( ok );
328 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 334 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
329 lay->addWidget( cancel ); 335 lay->addWidget( cancel );
330 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 336 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
331 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 337 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
332 resize( 200, 200 ); 338 resize( 200, 200 );
@@ -364,46 +370,46 @@ CalendarView::CalendarView( Calendar *calendar,
364 init(); 370 init();
365} 371}
366 372
367void CalendarView::init() 373void CalendarView::init()
368{ 374{
369 mMultiResourceSync = false; 375 mMultiResourceSync = false;
370 flag_blockConflict = false; 376 flag_blockConflict = false;
371 flag_blockScrollBar = false; 377 flag_blockScrollBar = false;
372 flag_checkFileFirsttime = true; 378 flag_checkFileFirsttime = true;
373 flag_clearallviewsEventDisplay = false; 379 flag_clearallviewsEventDisplay = false;
374 flag_clearallviewsupdateView = false; 380 flag_clearallviewsupdateView = false;
375 mNextAlarmDateTime = QDateTime::currentDateTime(); 381 mNextAlarmDateTime = QDateTime::currentDateTime();
376 setFocusPolicy (NoFocus ); 382 setFocusPolicy (Qt::NoFocus );
377 mViewerCallerIsSearchDialog = false; 383 mViewerCallerIsSearchDialog = false;
378 mBlockShowDates = false; 384 mBlockShowDates = false;
379 mConflictingEvent = 0; 385 mConflictingEvent = 0;
380 mDatePickerMode = 0; 386 mDatePickerMode = 0;
381 mCurrentSyncDevice = ""; 387 mCurrentSyncDevice = "";
382 mViewManager = new KOViewManager( this ); 388 mViewManager = new KOViewManager( this );
383 mDialogManager = new KODialogManager( this ); 389 mDialogManager = new KODialogManager( this );
384 mEventViewerDialog = 0; 390 mEventViewerDialog = 0;
385 mModified = false; 391 mModified = false;
386 mReadOnly = false; 392 mReadOnly = false;
387 mSelectedIncidence = 0; 393 mSelectedIncidence = 0;
388 mCalPrinter = 0; 394 mCalPrinter = 0;
389 mFilters.setAutoDelete(true); 395 mFilters.setAutoDelete(true);
390 396
391 mCalendar->registerObserver( this ); 397 mCalendar->registerObserver( this );
392 // TODO: Make sure that view is updated, when calendar is changed. 398 // TODO: Make sure that view is updated, when calendar is changed.
393 399
394 mStorage = new FileStorage( mCalendar ); 400 mStorage = new FileStorage( mCalendar );
395 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 401 mNavigator = new DateNavigator( this, "datevav", mViewManager );
396 402
397 QBoxLayout *topLayout = (QBoxLayout*)layout(); 403 Q3BoxLayout *topLayout = (Q3BoxLayout*)layout();
398#ifndef KORG_NOSPLITTER 404#ifndef KORG_NOSPLITTER
399 // create the main layout frames. 405 // create the main layout frames.
400 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); 406 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
401 topLayout->addWidget(mPanner); 407 topLayout->addWidget(mPanner);
402 408
403 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 409 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
404 "CalendarView::LeftFrame"); 410 "CalendarView::LeftFrame");
405 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 411 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
406 412
407 mDateNavigator = new DateNavigatorContainer( mLeftSplitter, 413 mDateNavigator = new DateNavigatorContainer( mLeftSplitter,
408 "CalendarView::DateNavigator" ); 414 "CalendarView::DateNavigator" );
409 415
@@ -416,27 +422,27 @@ void CalendarView::init()
416 mResourceView = 0; 422 mResourceView = 0;
417#else 423#else
418 if ( mResourceManager ) { 424 if ( mResourceManager ) {
419 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 425 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
420 mResourceView->updateView(); 426 mResourceView->updateView();
421 connect( mResourceView, SIGNAL( resourcesChanged() ), 427 connect( mResourceView, SIGNAL( resourcesChanged() ),
422 SLOT( updateView() ) ); 428 SLOT( updateView() ) );
423 } else { 429 } else {
424 mResourceView = 0; 430 mResourceView = 0;
425 } 431 }
426#endif 432#endif
427 QWidget *rightBox = new QWidget( mPanner ); 433 QWidget *rightBox = new QWidget( mPanner );
428 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 434 Q3BoxLayout *rightLayout = new Q3VBoxLayout( rightBox );
429 435
430 mRightFrame = new QWidgetStack( rightBox ); 436 mRightFrame = new Q3WidgetStack( rightBox );
431 rightLayout->addWidget( mRightFrame, 1 ); 437 rightLayout->addWidget( mRightFrame, 1 );
432 438
433 mLeftFrame = mLeftSplitter; 439 mLeftFrame = mLeftSplitter;
434#else 440#else
435 //QWidget *mainBox = new QWidget( this ); 441 //QWidget *mainBox = new QWidget( this );
436 //QWidget *leftFrame = new QWidget( mainBox ); 442 //QWidget *leftFrame = new QWidget( mainBox );
437 //QBoxLayout * mainBoxLayout; 443 //QBoxLayout * mainBoxLayout;
438 if ( KOPrefs::instance()->mVerticalScreen ) { 444 if ( KOPrefs::instance()->mVerticalScreen ) {
439 //mainBoxLayout = new QVBoxLayout(mainBox); 445 //mainBoxLayout = new QVBoxLayout(mainBox);
440 //leftFrameLayout = new QHBoxLayout(leftFrame ); 446 //leftFrameLayout = new QHBoxLayout(leftFrame );
441 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); 447 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this );
442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 448 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
@@ -445,25 +451,25 @@ void CalendarView::init()
445 } else { 451 } else {
446 //mainBoxLayout = new QHBoxLayout(mainBox); 452 //mainBoxLayout = new QHBoxLayout(mainBox);
447 //leftFrameLayout = new QVBoxLayout(leftFrame ); 453 //leftFrameLayout = new QVBoxLayout(leftFrame );
448 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 454 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
449 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); 455 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left);
450 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); 456 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
451 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 457 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
452 } 458 }
453 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 459 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
454 //QBoxLayout * leftFrameLayout; 460 //QBoxLayout * leftFrameLayout;
455 topLayout->addWidget( mMainFrame ); 461 topLayout->addWidget( mMainFrame );
456#ifdef DESKTOP_VERSION 462#ifdef DESKTOP_VERSION
457 mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this ); 463 mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,Qt::Horizontal, this );
458 topLayout->addWidget( mDateScrollBar ); 464 topLayout->addWidget( mDateScrollBar );
459 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); 465 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) );
460 if ( QApplication::desktop()->width() < 800 ) 466 if ( QApplication::desktop()->width() < 800 )
461 mDateScrollBar->hide(); 467 mDateScrollBar->hide();
462#endif 468#endif
463 //mainBoxLayout->addWidget (mLeftFrame); 469 //mainBoxLayout->addWidget (mLeftFrame);
464 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 470 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
465 "CalendarView::DateNavigator" ); 471 "CalendarView::DateNavigator" );
466#if 0 472#if 0
467 // FIXME 473 // FIXME
468 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 474 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
469 "CalendarView::DateNavigator", QDate::currentDate()); 475 "CalendarView::DateNavigator", QDate::currentDate());
@@ -492,26 +498,26 @@ void CalendarView::init()
492 leftFrameLayout->addWidget(mFilterView); 498 leftFrameLayout->addWidget(mFilterView);
493 leftFrameLayout->addWidget(mTodoList, 2 ); 499 leftFrameLayout->addWidget(mTodoList, 2 );
494 500
495 } else { 501 } else {
496 leftFrameLayout->addWidget(mTodoList,2 ); 502 leftFrameLayout->addWidget(mTodoList,2 );
497 leftFrameLayout->addWidget(mFilterView ); 503 leftFrameLayout->addWidget(mFilterView );
498 } 504 }
499#endif 505#endif
500 mFilterView->hide(); 506 mFilterView->hide();
501 mCalEditView->hide(); 507 mCalEditView->hide();
502 QWidget *rightBox = new QWidget( mMainFrame ); 508 QWidget *rightBox = new QWidget( mMainFrame );
503 //mainBoxLayout->addWidget ( rightBox, 10 ); 509 //mainBoxLayout->addWidget ( rightBox, 10 );
504 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 510 Q3BoxLayout *rightLayout = new Q3VBoxLayout( rightBox );
505 mRightFrame = new QWidgetStack( rightBox ); 511 mRightFrame = new Q3WidgetStack( rightBox );
506 rightLayout->addWidget( mRightFrame, 10 ); 512 rightLayout->addWidget( mRightFrame, 10 );
507 513
508 //mLeftFrame = (QWidget *)leftFrame; 514 //mLeftFrame = (QWidget *)leftFrame;
509 if ( KOPrefs::instance()->mVerticalScreen ) { 515 if ( KOPrefs::instance()->mVerticalScreen ) {
510 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 516 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
511 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 517 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
512 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 518 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
513 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 519 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
514 } else { 520 } else {
515 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 521 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
516 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 522 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
517 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 523 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
@@ -607,27 +613,27 @@ void CalendarView::init()
607 613
608 614
609 615
610 616
611 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 617 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
612 SLOT(checkClipboard())); 618 SLOT(checkClipboard()));
613 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 619 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
614 SLOT( processTodoListSelection( Incidence * ) ) ); 620 SLOT( processTodoListSelection( Incidence * ) ) );
615 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 621 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
616 622
617 // kdDebug() << "CalendarView::CalendarView() done" << endl; 623 // kdDebug() << "CalendarView::CalendarView() done" << endl;
618 624
619 mDateFrame = new QVBox(0,0,WType_Popup); 625 mDateFrame = new Q3VBox(0,0,Qt::WType_Popup);
620 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 626 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
621 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 627 mDateFrame->setFrameStyle( Q3Frame::WinPanel |Q3Frame::Raised );
622 mDateFrame->setLineWidth(3); 628 mDateFrame->setLineWidth(3);
623 mDateFrame->hide(); 629 mDateFrame->hide();
624 mDateFrame->setCaption( i18n( "Pick a date to display")); 630 mDateFrame->setCaption( i18n( "Pick a date to display"));
625 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 631 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
626 632
627 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 633 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
628 634
629 mEventEditor = mDialogManager->getEventEditor(); 635 mEventEditor = mDialogManager->getEventEditor();
630 mTodoEditor = mDialogManager->getTodoEditor(); 636 mTodoEditor = mDialogManager->getTodoEditor();
631 637
632 mFlagEditDescription = false; 638 mFlagEditDescription = false;
633 639
@@ -660,41 +666,41 @@ CalendarView::~CalendarView()
660 delete mViewManager; 666 delete mViewManager;
661 delete mStorage; 667 delete mStorage;
662 delete mDateFrame ; 668 delete mDateFrame ;
663 delete mEventViewerDialog; 669 delete mEventViewerDialog;
664 //kdDebug() << "~CalendarView() done" << endl; 670 //kdDebug() << "~CalendarView() done" << endl;
665} 671}
666 672
667 673
668void CalendarView::nextConflict( bool all, bool allday ) 674void CalendarView::nextConflict( bool all, bool allday )
669{ 675{
670 if ( flag_blockConflict ) return; 676 if ( flag_blockConflict ) return;
671 flag_blockConflict = true; 677 flag_blockConflict = true;
672 QPtrList<Event> testlist = mCalendar->events(); 678 Q3PtrList<Event> testlist = mCalendar->events();
673 Event * test = testlist.first(); 679 Event * test = testlist.first();
674 while ( test ) { 680 while ( test ) {
675 test->setTagged( false ); 681 test->setTagged( false );
676 test = testlist.next(); 682 test = testlist.next();
677 } 683 }
678 QTime st ( 0,0,0); 684 QTime st ( 0,0,0);
679 if ( mViewManager->currentView() == mViewManager->agendaView() ) 685 if ( mViewManager->currentView() == mViewManager->agendaView() )
680 st = mViewManager->agendaView()->agenda()->getEndTime(); 686 st = mViewManager->agendaView()->agenda()->getEndTime();
681 //qDebug("time %s ", st.toString().latin1()); 687 //qDebug("time %s ", st.toString().latin1());
682 QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); 688 QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st);
683 QDateTime conflict; 689 QDateTime conflict;
684 QDateTime retVal; 690 QDateTime retVal;
685 bool found = false; 691 bool found = false;
686 Event * cE = 0; 692 Event * cE = 0;
687 Event * cE2 = 0; 693 Event * cE2 = 0;
688 QPtrList<Event> testlist2 = testlist; 694 Q3PtrList<Event> testlist2 = testlist;
689 test = testlist.first(); 695 test = testlist.first();
690 bool skip = false; 696 bool skip = false;
691 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); 697 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
692 //QTime tm; 698 //QTime tm;
693 //tm.start(); 699 //tm.start();
694 while ( test ) { 700 while ( test ) {
695 qApp->processEvents(); 701 qApp->processEvents();
696 skip = false; 702 skip = false;
697 if ( !all ) skip = ( allday != test->doesFloat() ); 703 if ( !all ) skip = ( allday != test->doesFloat() );
698 if ( !skip ) { 704 if ( !skip ) {
699 if ( found ) 705 if ( found )
700 skip = !test->matchTime( &startDT, &conflict ); 706 skip = !test->matchTime( &startDT, &conflict );
@@ -826,78 +832,78 @@ void CalendarView::updateView(const QDate &start, const QDate &end)
826 } 832 }
827#endif 833#endif
828 mTodoList->updateView(); 834 mTodoList->updateView();
829 mViewManager->updateView(start, end); 835 mViewManager->updateView(start, end);
830 //mDateNavigator->updateView(); 836 //mDateNavigator->updateView();
831} 837}
832 838
833 839
834 840
835void CalendarView::checkFiles() 841void CalendarView::checkFiles()
836{ 842{
837 QString message; 843 QString message;
838 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 844 Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
839 KopiCalendarFile * cal = calendars.first(); 845 KopiCalendarFile * cal = calendars.first();
840 while ( cal ) { 846 while ( cal ) {
841 if ( cal->mErrorOnLoad ) { 847 if ( cal->mErrorOnLoad ) {
842 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; 848 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
843 } 849 }
844 cal = calendars.next(); 850 cal = calendars.next();
845 } 851 }
846 if ( !message.isEmpty() ) { 852 if ( !message.isEmpty() ) {
847 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); 853 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0);
848 KMessageBox::error(this,message, i18n("Loading of calendar(s) failed")); 854 KMessageBox::error(this,message, i18n("Loading of calendar(s) failed"));
849 } 855 }
850 if ( flag_checkFileFirsttime ) { 856 if ( flag_checkFileFirsttime ) {
851 flag_checkFileFirsttime = false; 857 flag_checkFileFirsttime = false;
852 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 858 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
853 } 859 }
854} 860}
855void CalendarView::checkAlarms() 861void CalendarView::checkAlarms()
856{ 862{
857 KConfig *config = KOGlobals::config(); 863 KConfig *config = KOGlobals::config();
858 config->setGroup( "AppRun" ); 864 config->setGroup( "AppRun" );
859 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 865 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
860 int daysto = dt.daysTo( QDate::currentDate() ); 866 int daysto = dt.daysTo( (QDateTime)QDate::currentDate() );
861 int days = config->readNumEntry( "LatestProgramStopDays" , daysto); 867 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
862 dt = dt.addDays( days ); 868 dt = dt.addDays( days );
863 int secto = dt.secsTo( QDateTime::currentDateTime() ); 869 int secto = dt.secsTo( QDateTime::currentDateTime() );
864 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; 870 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
865 //qDebug("KO: Reading program stop %d ", secs); 871 //qDebug("KO: Reading program stop %d ", secs);
866 //secs -= ( 3600 * 24*3 ); // debug only 872 //secs -= ( 3600 * 24*3 ); // debug only
867 QDateTime latest = dt.addSecs ( secs ); 873 QDateTime latest = dt.addSecs ( secs );
868 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 874 qDebug("KO: Last termination on %s ", latest.toString().latin1());
869 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 875 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
870 QPtrList<Incidence> el = mCalendar->rawIncidences(); 876 Q3PtrList<Incidence> el = mCalendar->rawIncidences();
871 QPtrList<Incidence> al; 877 Q3PtrList<Incidence> al;
872 Incidence* inL = el.first(); 878 Incidence* inL = el.first();
873 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 879 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
874 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 880 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
875 while ( inL ) { 881 while ( inL ) {
876 bool ok = false; 882 bool ok = false;
877 int offset = 0; 883 int offset = 0;
878 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 884 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
879 if ( ok ) { 885 if ( ok ) {
880 //qDebug("OK %s",next.toString().latin1()); 886 //qDebug("OK %s",next.toString().latin1());
881 if ( next < cur ) { 887 if ( next < cur ) {
882 al.append( inL ); 888 al.append( inL );
883 //qDebug("found missed alarm: %s ", inL->summary().latin1() ); 889 //qDebug("found missed alarm: %s ", inL->summary().latin1() );
884 } 890 }
885 } 891 }
886 inL = el.next(); 892 inL = el.next();
887 } 893 }
888 if ( al.count() ) { 894 if ( al.count() ) {
889 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); 895 QDialog* dia = new QDialog( this, "huhu", false, Qt::WDestructiveClose | Qt::WStyle_StaysOnTop );
890 dia->setCaption( i18n("KO/Pi: Missing alarms!") ); 896 dia->setCaption( i18n("KO/Pi: Missing alarms!") );
891 QVBoxLayout* lay = new QVBoxLayout( dia ); 897 Q3VBoxLayout* lay = new Q3VBoxLayout( dia );
892 lay->setSpacing( 0 ); 898 lay->setSpacing( 0 );
893 lay->setMargin( 0 ); 899 lay->setMargin( 0 );
894 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); 900 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
895 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 901 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
896 lay->addWidget( matb ); 902 lay->addWidget( matb );
897 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { 903 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) {
898 int wid = 210; 904 int wid = 210;
899 int x = QApplication::desktop()->width() - wid - 7; 905 int x = QApplication::desktop()->width() - wid - 7;
900 int y = QApplication::desktop()->height() - wid - 70; 906 int y = QApplication::desktop()->height() - wid - 70;
901 dia->setGeometry ( x,y,wid,wid); 907 dia->setGeometry ( x,y,wid,wid);
902 } else { 908 } else {
903 int si = 220; 909 int si = 220;
@@ -1207,25 +1213,25 @@ void CalendarView::computeAlarm( QString msg )
1207 if ( error ) { 1213 if ( error ) {
1208 mAlarmMessage = "Procedure Alarm\nError - File not found\n"; 1214 mAlarmMessage = "Procedure Alarm\nError - File not found\n";
1209 mAlarmMessage += mess.mid( 10+len+3+9 ); 1215 mAlarmMessage += mess.mid( 10+len+3+9 );
1210 } else { 1216 } else {
1211 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); 1217 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
1212 //qDebug("-----system command %s ",tempfilename.latin1() ); 1218 //qDebug("-----system command %s ",tempfilename.latin1() );
1213#ifndef _WIN32_ 1219#ifndef _WIN32_
1214 if ( vfork () == 0 ) { 1220 if ( vfork () == 0 ) {
1215 execl ( tempfilename.latin1(), 0 ); 1221 execl ( tempfilename.latin1(), 0 );
1216 return; 1222 return;
1217 } 1223 }
1218#else 1224#else
1219 QProcess* p = new QProcess(); 1225 Q3Process* p = new Q3Process();
1220 p->addArgument( tempfilename.latin1() ); 1226 p->addArgument( tempfilename.latin1() );
1221 p->start(); 1227 p->start();
1222 return; 1228 return;
1223#endif 1229#endif
1224 1230
1225 return; 1231 return;
1226 } 1232 }
1227 1233
1228 //qDebug("+++++++system command %s ",tempfilename.latin1() ); 1234 //qDebug("+++++++system command %s ",tempfilename.latin1() );
1229 } 1235 }
1230 if ( mess.left( 11 ) == "audio_alarm") { 1236 if ( mess.left( 11 ) == "audio_alarm") {
1231 bool error = false; 1237 bool error = false;
@@ -1257,56 +1263,56 @@ void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
1257 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 1263 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
1258 1264
1259 mSuspendAlarmNotification = noti; 1265 mSuspendAlarmNotification = noti;
1260 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; 1266 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000;
1261 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); 1267 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000);
1262 mSuspendTimer->start( ms , true ); 1268 mSuspendTimer->start( ms , true );
1263#ifdef DESKTOP_VERSION 1269#ifdef DESKTOP_VERSION
1264 if ( QApplication::desktop()->width() < 1024 ) { 1270 if ( QApplication::desktop()->width() < 1024 ) {
1265 QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti; 1271 QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti;
1266 //qDebug("nextsuspendalarm = \n%s ",mess.latin1() ); 1272 //qDebug("nextsuspendalarm = \n%s ",mess.latin1() );
1267 QString fn = QDir::homeDirPath() + "/.kopi_suspend_alarm"; 1273 QString fn = QDir::homeDirPath() + "/.kopi_suspend_alarm";
1268 QFile file( fn ); 1274 QFile file( fn );
1269 if (!file.open( IO_WriteOnly ) ) { 1275 if (!file.open( QIODevice::WriteOnly ) ) {
1270 qDebug("KO: Error writing next suspend alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); 1276 qDebug("KO: Error writing next suspend alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1());
1271 } else { 1277 } else {
1272 QTextStream ts( &file ); 1278 Q3TextStream ts( &file );
1273 ts << mess; 1279 ts << mess;
1274 file.close(); 1280 file.close();
1275 } 1281 }
1276 } 1282 }
1277#endif 1283#endif
1278 1284
1279} 1285}
1280 1286
1281void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti ) 1287void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
1282{ 1288{
1283 mNextAlarmDateTime = qdt; 1289 mNextAlarmDateTime = qdt;
1284 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 1290 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
1285 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 1291 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
1286#ifndef DESKTOP_VERSION 1292#ifndef DESKTOP_VERSION
1287 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() ); 1293 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() );
1288#endif 1294#endif
1289 return; 1295 return;
1290 } 1296 }
1291#ifdef DESKTOP_VERSION 1297#ifdef DESKTOP_VERSION
1292 if ( QApplication::desktop()->width() < 1024 ) { 1298 if ( QApplication::desktop()->width() < 1024 ) {
1293 QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti; 1299 QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti;
1294 //qDebug("nextalarm = \n%s ",mess.latin1() ); 1300 //qDebug("nextalarm = \n%s ",mess.latin1() );
1295 QString fn = QDir::homeDirPath() + "/.kopi_next_alarm"; 1301 QString fn = QDir::homeDirPath() + "/.kopi_next_alarm";
1296 QFile file( fn ); 1302 QFile file( fn );
1297 if (!file.open( IO_WriteOnly ) ) { 1303 if (!file.open( QIODevice::WriteOnly ) ) {
1298 qDebug("KO: Error writing next alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); 1304 qDebug("KO: Error writing next alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1());
1299 } else { 1305 } else {
1300 QTextStream ts( &file ); 1306 Q3TextStream ts( &file );
1301 ts << mess; 1307 ts << mess;
1302 file.close(); 1308 file.close();
1303 } 1309 }
1304 } 1310 }
1305#endif 1311#endif
1306 int maxSec; 1312 int maxSec;
1307 //maxSec = 5; //testing only 1313 //maxSec = 5; //testing only
1308 maxSec = 86400+3600; // one day+1hour 1314 maxSec = 86400+3600; // one day+1hour
1309 mAlarmNotification = noti; 1315 mAlarmNotification = noti;
1310 int sec = QDateTime::currentDateTime().secsTo( qdt ); 1316 int sec = QDateTime::currentDateTime().secsTo( qdt );
1311 if ( sec > maxSec ) { 1317 if ( sec > maxSec ) {
1312 mRecheckAlarmTimer->start( maxSec * 1000 ); 1318 mRecheckAlarmTimer->start( maxSec * 1000 );
@@ -1561,25 +1567,25 @@ Event* CalendarView::getLastSyncEvent()
1561 lse->setReadOnly( true ); 1567 lse->setReadOnly( true );
1562 lse->setCalID( 1 ); 1568 lse->setCalID( 1 );
1563 mCalendar->addEvent( lse ); 1569 mCalendar->addEvent( lse );
1564 } else 1570 } else
1565 qDebug("KO: Last Syncevent on local found"); 1571 qDebug("KO: Last Syncevent on local found");
1566 1572
1567 return lse; 1573 return lse;
1568 1574
1569} 1575}
1570 1576
1571// we check, if the to delete event has a id for a profile 1577// we check, if the to delete event has a id for a profile
1572// if yes, we set this id in the profile to delete 1578// if yes, we set this id in the profile to delete
1573void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) 1579void CalendarView::checkExternSyncEvent( Q3PtrList<Event> lastSync , Incidence* toDelete )
1574{ 1580{
1575 if ( lastSync.count() == 0 ) { 1581 if ( lastSync.count() == 0 ) {
1576 //qDebug(" lastSync.count() == 0"); 1582 //qDebug(" lastSync.count() == 0");
1577 return; 1583 return;
1578 } 1584 }
1579 if ( toDelete->typeID() == journalID ) 1585 if ( toDelete->typeID() == journalID )
1580 return; 1586 return;
1581 1587
1582 Event* eve = lastSync.first(); 1588 Event* eve = lastSync.first();
1583 1589
1584 while ( eve ) { 1590 while ( eve ) {
1585 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name 1591 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name
@@ -1591,50 +1597,50 @@ void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* t
1591 des += pref+ id + ","; 1597 des += pref+ id + ",";
1592 eve->setReadOnly( false ); 1598 eve->setReadOnly( false );
1593 eve->setDescription( des ); 1599 eve->setDescription( des );
1594 //qDebug("setdes %s ", des.latin1()); 1600 //qDebug("setdes %s ", des.latin1());
1595 eve->setReadOnly( true ); 1601 eve->setReadOnly( true );
1596 } 1602 }
1597 eve = lastSync.next(); 1603 eve = lastSync.next();
1598 } 1604 }
1599 1605
1600} 1606}
1601void CalendarView::checkExternalId( Incidence * inc ) 1607void CalendarView::checkExternalId( Incidence * inc )
1602{ 1608{
1603 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; 1609 Q3PtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ;
1604 checkExternSyncEvent( lastSync, inc ); 1610 checkExternSyncEvent( lastSync, inc );
1605 1611
1606} 1612}
1607// SSSSSSSSSSSSSSSSSSSSSS 1613// SSSSSSSSSSSSSSSSSSSSSS
1608bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) 1614bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode )
1609{ 1615{
1610 1616
1611 bool syncOK = true; 1617 bool syncOK = true;
1612 int addedEvent = 0; 1618 int addedEvent = 0;
1613 int addedEventR = 0; 1619 int addedEventR = 0;
1614 int deletedEventR = 0; 1620 int deletedEventR = 0;
1615 int deletedEventL = 0; 1621 int deletedEventL = 0;
1616 int changedLocal = 0; 1622 int changedLocal = 0;
1617 int changedRemote = 0; 1623 int changedRemote = 0;
1618 int filteredIN = 0; 1624 int filteredIN = 0;
1619 int filteredOUT = 0; 1625 int filteredOUT = 0;
1620 //QPtrList<Event> el = local->rawEvents(); 1626 //QPtrList<Event> el = local->rawEvents();
1621 Event* eventR; 1627 Event* eventR;
1622 QString uid; 1628 QString uid;
1623 int take; 1629 int take;
1624 Event* eventRSync; 1630 Event* eventRSync;
1625 Event* eventLSync; 1631 Event* eventLSync;
1626 clearAllViews(); 1632 clearAllViews();
1627 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); 1633 Q3PtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
1628 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); 1634 Q3PtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
1629 bool fullDateRange = false; 1635 bool fullDateRange = false;
1630 local->resetTempSyncStat(); 1636 local->resetTempSyncStat();
1631 mLastCalendarSync = QDateTime::currentDateTime(); 1637 mLastCalendarSync = QDateTime::currentDateTime();
1632 if ( mSyncManager->syncWithDesktop() ) { 1638 if ( mSyncManager->syncWithDesktop() ) {
1633 remote->resetPilotStat(1); 1639 remote->resetPilotStat(1);
1634 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 1640 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
1635 mLastCalendarSync = KSyncManager::mRequestedSyncEvent; 1641 mLastCalendarSync = KSyncManager::mRequestedSyncEvent;
1636 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() ); 1642 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() );
1637 } else { 1643 } else {
1638 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); 1644 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime ");
1639 } 1645 }
1640 } 1646 }
@@ -1675,28 +1681,28 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1675 } 1681 }
1676 if ( fullDateRange ) 1682 if ( fullDateRange )
1677 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); 1683 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
1678 else 1684 else
1679 mLastCalendarSync = eventLSync->dtStart(); 1685 mLastCalendarSync = eventLSync->dtStart();
1680 // for resyncing if own file has changed 1686 // for resyncing if own file has changed
1681 if ( mCurrentSyncDevice == "deleteaftersync" ) { 1687 if ( mCurrentSyncDevice == "deleteaftersync" ) {
1682 mLastCalendarSync = loadedFileVersion; 1688 mLastCalendarSync = loadedFileVersion;
1683 //qDebug("setting mLastCalendarSync "); 1689 //qDebug("setting mLastCalendarSync ");
1684 } 1690 }
1685 //qDebug("*************************** "); 1691 //qDebug("*************************** ");
1686 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); 1692 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
1687 QPtrList<Incidence> er = remote->rawIncidences(); 1693 Q3PtrList<Incidence> er = remote->rawIncidences();
1688 Incidence* inR = er.first(); 1694 Incidence* inR = er.first();
1689 Incidence* inL; 1695 Incidence* inL;
1690 QProgressBar bar( er.count(),0 ); 1696 Q3ProgressBar bar( er.count(),0 );
1691 bar.setCaption (i18n("Syncing - close to abort!") ); 1697 bar.setCaption (i18n("Syncing - close to abort!") );
1692 1698
1693 // ************** setting up filter ************* 1699 // ************** setting up filter *************
1694 CalFilter *filterIN = 0; 1700 CalFilter *filterIN = 0;
1695 CalFilter *filterOUT = 0; 1701 CalFilter *filterOUT = 0;
1696 CalFilter *filter = mFilters.first(); 1702 CalFilter *filter = mFilters.first();
1697 while(filter) { 1703 while(filter) {
1698 if ( filter->name() == mSyncManager->mFilterInCal ) 1704 if ( filter->name() == mSyncManager->mFilterInCal )
1699 filterIN = filter; 1705 filterIN = filter;
1700 if ( filter->name() == mSyncManager->mFilterOutCal ) 1706 if ( filter->name() == mSyncManager->mFilterOutCal )
1701 filterOUT = filter; 1707 filterOUT = filter;
1702 filter = mFilters.next(); 1708 filter = mFilters.next();
@@ -1822,25 +1828,25 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1822 checkExternSyncEvent(eventRSyncSharp, inR); 1828 checkExternSyncEvent(eventRSyncSharp, inR);
1823 remote->deleteIncidence( inR ); 1829 remote->deleteIncidence( inR );
1824 ++deletedEventR; 1830 ++deletedEventR;
1825 } 1831 }
1826 } 1832 }
1827 } else { 1833 } else {
1828 ++filteredIN; 1834 ++filteredIN;
1829 } 1835 }
1830 } 1836 }
1831 } 1837 }
1832 inR = er.next(); 1838 inR = er.next();
1833 } 1839 }
1834 QPtrList<Incidence> el = local->rawIncidences(); 1840 Q3PtrList<Incidence> el = local->rawIncidences();
1835 inL = el.first(); 1841 inL = el.first();
1836 modulo = (el.count()/10)+1; 1842 modulo = (el.count()/10)+1;
1837 bar.setCaption (i18n("Add / remove events") ); 1843 bar.setCaption (i18n("Add / remove events") );
1838 bar.setTotalSteps ( el.count() ) ; 1844 bar.setTotalSteps ( el.count() ) ;
1839 bar.show(); 1845 bar.show();
1840 incCounter = 0; 1846 incCounter = 0;
1841 1847
1842 while ( inL ) { 1848 while ( inL ) {
1843 1849
1844 qApp->processEvents(); 1850 qApp->processEvents();
1845 if ( ! bar.isVisible() ) 1851 if ( ! bar.isVisible() )
1846 return false; 1852 return false;
@@ -2039,25 +2045,25 @@ void CalendarView::syncExternal( int mode )
2039 } else { 2045 } else {
2040 emit tempDisableBR(false); 2046 emit tempDisableBR(false);
2041 return; 2047 return;
2042 } 2048 }
2043 if ( loadSuccess ) { 2049 if ( loadSuccess ) {
2044 getEventViewerDialog()->setSyncMode( true ); 2050 getEventViewerDialog()->setSyncMode( true );
2045 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 2051 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
2046 getEventViewerDialog()->setSyncMode( false ); 2052 getEventViewerDialog()->setSyncMode( false );
2047 qApp->processEvents(); 2053 qApp->processEvents();
2048 if ( syncOK ) { 2054 if ( syncOK ) {
2049 if ( mSyncManager->mWriteBackFile ) 2055 if ( mSyncManager->mWriteBackFile )
2050 { 2056 {
2051 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 2057 Q3PtrList<Incidence> iL = mCalendar->rawIncidences();
2052 Incidence* inc = iL.first(); 2058 Incidence* inc = iL.first();
2053 if ( phoneFormat ) { 2059 if ( phoneFormat ) {
2054 while ( inc ) { 2060 while ( inc ) {
2055 inc->removeID(mCurrentSyncDevice); 2061 inc->removeID(mCurrentSyncDevice);
2056 inc = iL.next(); 2062 inc = iL.next();
2057 } 2063 }
2058 } 2064 }
2059#ifndef DESKTOP_VERSION 2065#ifndef DESKTOP_VERSION
2060 if ( sharpFormat ) 2066 if ( sharpFormat )
2061 sharpFormat->save(calendar); 2067 sharpFormat->save(calendar);
2062#endif 2068#endif
2063 if ( phoneFormat ) 2069 if ( phoneFormat )
@@ -2106,25 +2112,25 @@ bool CalendarView::importBday()
2106#ifdef DESKTOP_VERSION 2112#ifdef DESKTOP_VERSION
2107 int curCal = mCalendar->defaultCalendar(); 2113 int curCal = mCalendar->defaultCalendar();
2108 int bd = mCalEditView->getBirtdayID(); 2114 int bd = mCalEditView->getBirtdayID();
2109 if ( bd == 0 ) 2115 if ( bd == 0 )
2110 return false; 2116 return false;
2111 mCalendar->setDefaultCalendar( bd ); 2117 mCalendar->setDefaultCalendar( bd );
2112 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 2118 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
2113 KABC::AddressBook::Iterator it; 2119 KABC::AddressBook::Iterator it;
2114 int count = 0; 2120 int count = 0;
2115 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 2121 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
2116 ++count; 2122 ++count;
2117 } 2123 }
2118 QProgressBar bar(count,0 ); 2124 Q3ProgressBar bar(count,0 );
2119 int w = 300; 2125 int w = 300;
2120 if ( QApplication::desktop()->width() < 320 ) 2126 if ( QApplication::desktop()->width() < 320 )
2121 w = 220; 2127 w = 220;
2122 int h = bar.sizeHint().height() ; 2128 int h = bar.sizeHint().height() ;
2123 int dw = QApplication::desktop()->width(); 2129 int dw = QApplication::desktop()->width();
2124 int dh = QApplication::desktop()->height(); 2130 int dh = QApplication::desktop()->height();
2125 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2131 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2126 bar.show(); 2132 bar.show();
2127 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 2133 bar.setCaption (i18n("Reading addressbook - close to abort!") );
2128 qApp->processEvents(); 2134 qApp->processEvents();
2129 count = 0; 2135 count = 0;
2130 int addCount = 0; 2136 int addCount = 0;
@@ -2177,25 +2183,25 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd
2177 int bd = mCalEditView->getBirtdayID(); 2183 int bd = mCalEditView->getBirtdayID();
2178 if ( bd == 0 ) 2184 if ( bd == 0 )
2179 return; 2185 return;
2180 mCalendar->setDefaultCalendar( bd ); 2186 mCalendar->setDefaultCalendar( bd );
2181 2187
2182 2188
2183 int count = birthdayList.count(); 2189 int count = birthdayList.count();
2184 int addCount = 0; 2190 int addCount = 0;
2185 KCal::Attendee* a = 0; 2191 KCal::Attendee* a = 0;
2186 2192
2187 //qDebug("CalView 1 %i", count); 2193 //qDebug("CalView 1 %i", count);
2188 2194
2189 QProgressBar bar(count,0 ); 2195 Q3ProgressBar bar(count,0 );
2190 int w = 300; 2196 int w = 300;
2191 if ( QApplication::desktop()->width() < 320 ) 2197 if ( QApplication::desktop()->width() < 320 )
2192 w = 220; 2198 w = 220;
2193 int h = bar.sizeHint().height() ; 2199 int h = bar.sizeHint().height() ;
2194 int dw = QApplication::desktop()->width(); 2200 int dw = QApplication::desktop()->width();
2195 int dh = QApplication::desktop()->height(); 2201 int dh = QApplication::desktop()->height();
2196 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2202 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2197 bar.show(); 2203 bar.show();
2198 bar.setCaption (i18n("inserting birthdays - close to abort!") ); 2204 bar.setCaption (i18n("inserting birthdays - close to abort!") );
2199 qApp->processEvents(); 2205 qApp->processEvents();
2200 2206
2201 QDate birthday; 2207 QDate birthday;
@@ -2341,39 +2347,39 @@ bool CalendarView::importQtopia( const QString &categories,
2341 2347
2342#endif 2348#endif
2343 2349
2344} 2350}
2345 2351
2346void CalendarView::setSyncEventsReadOnly() 2352void CalendarView::setSyncEventsReadOnly()
2347{ 2353{
2348 mCalendar->setSyncEventsReadOnly(); 2354 mCalendar->setSyncEventsReadOnly();
2349} 2355}
2350 2356
2351bool CalendarView::loadCalendars() 2357bool CalendarView::loadCalendars()
2352{ 2358{
2353 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2359 Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2354 KopiCalendarFile * cal = calendars.first(); 2360 KopiCalendarFile * cal = calendars.first();
2355 mCalendar->setDefaultCalendar( 1 ); 2361 mCalendar->setDefaultCalendar( 1 );
2356 openCalendar( MainWindow::defaultFileName(), false ); 2362 openCalendar( MainWindow::defaultFileName(), false );
2357 cal = calendars.next(); 2363 cal = calendars.next();
2358 while ( cal ) { 2364 while ( cal ) {
2359 addCalendar( cal ); 2365 addCalendar( cal );
2360 cal = calendars.next(); 2366 cal = calendars.next();
2361 } 2367 }
2362 restoreCalendarSettings(); 2368 restoreCalendarSettings();
2363 return true; 2369 return true;
2364} 2370}
2365bool CalendarView::restoreCalendarSettings() 2371bool CalendarView::restoreCalendarSettings()
2366{ 2372{
2367 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2373 Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2368 KopiCalendarFile * cal = calendars.first(); 2374 KopiCalendarFile * cal = calendars.first();
2369 while ( cal ) { 2375 while ( cal ) {
2370 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 2376 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
2371 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 2377 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
2372 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 2378 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
2373 if ( cal->isStandard ) 2379 if ( cal->isStandard )
2374 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2380 mCalendar->setDefaultCalendar( cal->mCalNumber );
2375 cal = calendars.next(); 2381 cal = calendars.next();
2376 } 2382 }
2377 setSyncEventsReadOnly(); 2383 setSyncEventsReadOnly();
2378 mCalendar->reInitAlarmSettings(); 2384 mCalendar->reInitAlarmSettings();
2379 updateUnmanagedViews(); 2385 updateUnmanagedViews();
@@ -2520,25 +2526,25 @@ void CalendarView::watchSavedFile()
2520 if ( !finf.exists() ) 2526 if ( !finf.exists() )
2521 return; 2527 return;
2522 QDateTime dt = finf.lastModified (); 2528 QDateTime dt = finf.lastModified ();
2523 if ( dt < loadedFileVersion ) { 2529 if ( dt < loadedFileVersion ) {
2524 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); 2530 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
2525 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); 2531 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
2526 return; 2532 return;
2527 } 2533 }
2528 loadedFileVersion = dt; 2534 loadedFileVersion = dt;
2529} 2535}
2530bool CalendarView::checkAllFileVersions() 2536bool CalendarView::checkAllFileVersions()
2531{ 2537{
2532 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2538 Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2533 KopiCalendarFile * cal = calendars.first(); 2539 KopiCalendarFile * cal = calendars.first();
2534 mCalendar->setDefaultCalendar( 1 ); 2540 mCalendar->setDefaultCalendar( 1 );
2535 mCalendar->setDefaultCalendarEnabledOnly(); 2541 mCalendar->setDefaultCalendarEnabledOnly();
2536 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2542 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2537 if ( !checkFileVersion(MainWindow::defaultFileName())) { 2543 if ( !checkFileVersion(MainWindow::defaultFileName())) {
2538 restoreCalendarSettings(); 2544 restoreCalendarSettings();
2539 return false; 2545 return false;
2540 } 2546 }
2541 } 2547 }
2542 cal = calendars.next(); 2548 cal = calendars.next();
2543 QDateTime storeTemp = loadedFileVersion; 2549 QDateTime storeTemp = loadedFileVersion;
2544 while ( cal ) { 2550 while ( cal ) {
@@ -2582,25 +2588,25 @@ bool CalendarView::checkFileVersion(QString fn)
2582 mSyncManager->mWriteBackFile = false; 2588 mSyncManager->mWriteBackFile = false;
2583 mSyncManager->mWriteBackExistingOnly = false; 2589 mSyncManager->mWriteBackExistingOnly = false;
2584 mSyncManager->mShowSyncSummary = false; 2590 mSyncManager->mShowSyncSummary = false;
2585 mMultiResourceSync = false; 2591 mMultiResourceSync = false;
2586 syncCalendar( fn, 3 ); 2592 syncCalendar( fn, 3 );
2587 Event * e = getLastSyncEvent(); 2593 Event * e = getLastSyncEvent();
2588 if ( e ) 2594 if ( e )
2589 mCalendar->deleteEvent( e ); 2595 mCalendar->deleteEvent( e );
2590 return true; 2596 return true;
2591} 2597}
2592bool CalendarView::saveCalendars() 2598bool CalendarView::saveCalendars()
2593{ 2599{
2594 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2600 Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2595 KopiCalendarFile * cal = calendars.first(); 2601 KopiCalendarFile * cal = calendars.first();
2596 mCalendar->setDefaultCalendar( 1 ); 2602 mCalendar->setDefaultCalendar( 1 );
2597 mCalendar->setDefaultCalendarEnabledOnly(); 2603 mCalendar->setDefaultCalendarEnabledOnly();
2598 QString saveError; 2604 QString saveError;
2599 if ( !saveCalendar( MainWindow::defaultFileName() ) ) 2605 if ( !saveCalendar( MainWindow::defaultFileName() ) )
2600 saveError = cal->mName +"\n"; 2606 saveError = cal->mName +"\n";
2601 cal = calendars.next(); 2607 cal = calendars.next();
2602 while ( cal ) { 2608 while ( cal ) {
2603 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2609 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2604 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2610 mCalendar->setDefaultCalendar( cal->mCalNumber );
2605 mCalendar->setDefaultCalendarEnabledOnly(); 2611 mCalendar->setDefaultCalendarEnabledOnly();
2606 if ( saveCalendar( cal->mFileName ) ) 2612 if ( saveCalendar( cal->mFileName ) )
@@ -2686,25 +2692,25 @@ void CalendarView::readSettings()
2686{ 2692{
2687 2693
2688 2694
2689 // mViewManager->showAgendaView(); 2695 // mViewManager->showAgendaView();
2690 QString str; 2696 QString str;
2691 //qDebug("CalendarView::readSettings() "); 2697 //qDebug("CalendarView::readSettings() ");
2692 // read settings from the KConfig, supplying reasonable 2698 // read settings from the KConfig, supplying reasonable
2693 // defaults where none are to be found 2699 // defaults where none are to be found
2694 KConfig *config = KOGlobals::config(); 2700 KConfig *config = KOGlobals::config();
2695#ifndef KORG_NOSPLITTER 2701#ifndef KORG_NOSPLITTER
2696 config->setGroup("KOrganizer Geometry"); 2702 config->setGroup("KOrganizer Geometry");
2697 2703
2698 QValueList<int> sizes = config->readIntListEntry("Separator1"); 2704 Q3ValueList<int> sizes = config->readIntListEntry("Separator1");
2699 if (sizes.count() != 2) { 2705 if (sizes.count() != 2) {
2700 sizes << mDateNavigator->minimumSizeHint().width(); 2706 sizes << mDateNavigator->minimumSizeHint().width();
2701 sizes << 300; 2707 sizes << 300;
2702 } 2708 }
2703 mPanner->setSizes(sizes); 2709 mPanner->setSizes(sizes);
2704 2710
2705 sizes = config->readIntListEntry("Separator2"); 2711 sizes = config->readIntListEntry("Separator2");
2706 if ( ( mResourceView && sizes.count() == 4 ) || 2712 if ( ( mResourceView && sizes.count() == 4 ) ||
2707 ( !mResourceView && sizes.count() == 3 ) ) { 2713 ( !mResourceView && sizes.count() == 3 ) ) {
2708 mLeftSplitter->setSizes(sizes); 2714 mLeftSplitter->setSizes(sizes);
2709 } 2715 }
2710#endif 2716#endif
@@ -2754,25 +2760,25 @@ void CalendarView::readSettings()
2754 if ( ! list.isEmpty() ) { 2760 if ( ! list.isEmpty() ) {
2755 x = list[0].toInt(); 2761 x = list[0].toInt();
2756 y = list[1].toInt(); 2762 y = list[1].toInt();
2757 w = list[2].toInt(); 2763 w = list[2].toInt();
2758 h = list[3].toInt(); 2764 h = list[3].toInt();
2759 KApplication::testCoords( &x,&y,&w,&h ); 2765 KApplication::testCoords( &x,&y,&w,&h );
2760 getEventViewerDialog()->setGeometry(x,y,w,h); 2766 getEventViewerDialog()->setGeometry(x,y,w,h);
2761 } 2767 }
2762#endif 2768#endif
2763 config->setGroup( "Views" ); 2769 config->setGroup( "Views" );
2764 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 2770 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
2765 2771
2766 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 2772 Q3ValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
2767 2773
2768 int resetval = 0; 2774 int resetval = 0;
2769 int maxVal = 0; 2775 int maxVal = 0;
2770 if (sizes.count() != 3) { 2776 if (sizes.count() != 3) {
2771 if ( KOPrefs::instance()->mVerticalScreen ) { 2777 if ( KOPrefs::instance()->mVerticalScreen ) {
2772 resetval = mDateNavigator->sizeHint().width()+2; 2778 resetval = mDateNavigator->sizeHint().width()+2;
2773 } else { 2779 } else {
2774 resetval = mDateNavigator->sizeHint().height()+2; 2780 resetval = mDateNavigator->sizeHint().height()+2;
2775 } 2781 }
2776 } 2782 }
2777 if ( resetval ) { 2783 if ( resetval ) {
2778 sizes.clear(); 2784 sizes.clear();
@@ -2833,25 +2839,25 @@ void CalendarView::writeSettings()
2833 2839
2834 KConfig *config = KOGlobals::config(); 2840 KConfig *config = KOGlobals::config();
2835 2841
2836 mViewManager->writeSettings( config ); 2842 mViewManager->writeSettings( config );
2837 mTodoList->saveLayout(config,QString("Todo Layout")); 2843 mTodoList->saveLayout(config,QString("Todo Layout"));
2838 mDialogManager->writeSettings( config ); 2844 mDialogManager->writeSettings( config );
2839 //KOPrefs::instance()->usrWriteConfig(); 2845 //KOPrefs::instance()->usrWriteConfig();
2840 KOPrefs::instance()->writeConfig(); 2846 KOPrefs::instance()->writeConfig();
2841 2847
2842 writeFilterSettings(config); 2848 writeFilterSettings(config);
2843 config->setGroup( "AppRun" ); 2849 config->setGroup( "AppRun" );
2844 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 2850 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2845 int days = dt.daysTo( QDate::currentDate() ); 2851 int days = dt.daysTo( (QDateTime)QDate::currentDate() );
2846 dt = dt.addDays( days ); 2852 dt = dt.addDays( days );
2847 int secs = dt.secsTo( QDateTime::currentDateTime() ); 2853 int secs = dt.secsTo( QDateTime::currentDateTime() );
2848 config->writeEntry( "LatestProgramStopDays", days ); 2854 config->writeEntry( "LatestProgramStopDays", days );
2849 config->writeEntry( "LatestProgramStopSecs", secs ); 2855 config->writeEntry( "LatestProgramStopSecs", secs );
2850 //qDebug("KO: Writing stop time: %d ", secs); 2856 //qDebug("KO: Writing stop time: %d ", secs);
2851 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 2857 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2852 //QDateTime latest = dt.addSecs ( secs ); 2858 //QDateTime latest = dt.addSecs ( secs );
2853 //qDebug("KO: Termination on %s ", latest.toString().latin1()); 2859 //qDebug("KO: Termination on %s ", latest.toString().latin1());
2854 config->setGroup( "Views" ); 2860 config->setGroup( "Views" );
2855 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2861 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2856 2862
2857#if 0 2863#if 0
@@ -2860,27 +2866,27 @@ void CalendarView::writeSettings()
2860 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) ); 2866 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
2861 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) ); 2867 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
2862 int secsto = dt_nodaylight.secsTo( dt_daylight ); 2868 int secsto = dt_nodaylight.secsTo( dt_daylight );
2863 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto ); 2869 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
2864 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() ); 2870 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
2865 qDebug("dt daylight %s ",dt_daylight.toString().latin1() ); 2871 qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
2866 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); 2872 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() );
2867 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); 2873 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600);
2868 qDebug("********************* testcode end"); 2874 qDebug("********************* testcode end");
2869 2875
2870#endif 2876#endif
2871 2877
2872 QValueList<int> listINT = mLeftFrame->sizes(); 2878 Q3ValueList<int> listINT = mLeftFrame->sizes();
2873 config->writeEntry("Left Splitter Frame",listINT); 2879 config->writeEntry("Left Splitter Frame",listINT);
2874 QValueList<int> listINT2 = mMainFrame->sizes(); 2880 Q3ValueList<int> listINT2 = mMainFrame->sizes();
2875 config->writeEntry("Main Splitter Frame",listINT2); 2881 config->writeEntry("Main Splitter Frame",listINT2);
2876#ifdef DESKTOP_VERSION 2882#ifdef DESKTOP_VERSION
2877 config->setGroup("WidgetLayout"); 2883 config->setGroup("WidgetLayout");
2878 QStringList list ;//= config->readListEntry("MainLayout"); 2884 QStringList list ;//= config->readListEntry("MainLayout");
2879 int x,y,w,h; 2885 int x,y,w,h;
2880 QWidget* wid; 2886 QWidget* wid;
2881 wid = topLevelWidget(); 2887 wid = topLevelWidget();
2882 x = wid->geometry().x(); 2888 x = wid->geometry().x();
2883 y = wid->geometry().y(); 2889 y = wid->geometry().y();
2884 w = wid->width(); 2890 w = wid->width();
2885 h = wid->height(); 2891 h = wid->height();
2886 list.clear(); 2892 list.clear();
@@ -3157,25 +3163,25 @@ void CalendarView::checkConflictForEvent()
3157 while(filter) { 3163 while(filter) {
3158 if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem) 3164 if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem)
3159 filterIN = filter; 3165 filterIN = filter;
3160 if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem ) 3166 if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem )
3161 filterALL = filter; 3167 filterALL = filter;
3162 filter = mFilters.next(); 3168 filter = mFilters.next();
3163 } 3169 }
3164 if ( filterIN ) { 3170 if ( filterIN ) {
3165 if ( !filterIN->filterCalendarItem( conflictingEvent ) ) { 3171 if ( !filterIN->filterCalendarItem( conflictingEvent ) ) {
3166 return; 3172 return;
3167 } 3173 }
3168 } 3174 }
3169 QPtrList<Event> testlist = mCalendar->events(); 3175 Q3PtrList<Event> testlist = mCalendar->events();
3170 Event * test = testlist.first(); 3176 Event * test = testlist.first();
3171 QDateTime conflict; 3177 QDateTime conflict;
3172 QDateTime retVal; 3178 QDateTime retVal;
3173 bool found = false; 3179 bool found = false;
3174 Event * cE = 0; 3180 Event * cE = 0;
3175 bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay; 3181 bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay;
3176 bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD; 3182 bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD;
3177 if ( !conflictingEvent->doesFloat() ) { 3183 if ( !conflictingEvent->doesFloat() ) {
3178 chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay; 3184 chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay;
3179 chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD; 3185 chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD;
3180 } 3186 }
3181 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); 3187 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
@@ -3419,46 +3425,46 @@ void CalendarView::slotSelectPickerDate( QDate d)
3419 } else if ( mMoveIncidence->typeID() == journalID ) { 3425 } else if ( mMoveIncidence->typeID() == journalID ) {
3420 QTime tim = mMoveIncidence->dtStart().time(); 3426 QTime tim = mMoveIncidence->dtStart().time();
3421 QDateTime dt ( d,tim ); 3427 QDateTime dt ( d,tim );
3422 mMoveIncidence->setDtStart( dt ); 3428 mMoveIncidence->setDtStart( dt );
3423 updateView(); 3429 updateView();
3424 } 3430 }
3425 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 3431 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
3426 } 3432 }
3427} 3433}
3428 3434
3429void CalendarView::removeCategories() 3435void CalendarView::removeCategories()
3430{ 3436{
3431 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 3437 Q3PtrList<Incidence> incList = mCalendar->rawIncidences();
3432 QStringList catList = KOPrefs::instance()->mCustomCategories; 3438 QStringList catList = KOPrefs::instance()->mCustomCategories;
3433 QStringList catIncList; 3439 QStringList catIncList;
3434 QStringList newCatList; 3440 QStringList newCatList;
3435 Incidence* inc = incList.first(); 3441 Incidence* inc = incList.first();
3436 uint i; 3442 uint i;
3437 while ( inc ) { 3443 while ( inc ) {
3438 newCatList.clear(); 3444 newCatList.clear();
3439 catIncList = inc->categories() ; 3445 catIncList = inc->categories() ;
3440 for( i = 0; i< catIncList.count(); ++i ) { 3446 for( i = 0; i< catIncList.count(); ++i ) {
3441 if ( catList.contains (catIncList[i])) 3447 if ( catList.contains (catIncList[i]))
3442 newCatList.append( catIncList[i] ); 3448 newCatList.append( catIncList[i] );
3443 } 3449 }
3444 newCatList.sort(); 3450 newCatList.sort();
3445 inc->setCategories( newCatList.join(",") ); 3451 inc->setCategories( newCatList.join(",") );
3446 inc = incList.next(); 3452 inc = incList.next();
3447 } 3453 }
3448} 3454}
3449 3455
3450int CalendarView::addCategories() 3456int CalendarView::addCategories()
3451{ 3457{
3452 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 3458 Q3PtrList<Incidence> incList = mCalendar->rawIncidences();
3453 QStringList catList = KOPrefs::instance()->mCustomCategories; 3459 QStringList catList = KOPrefs::instance()->mCustomCategories;
3454 QStringList catIncList; 3460 QStringList catIncList;
3455 Incidence* inc = incList.first(); 3461 Incidence* inc = incList.first();
3456 uint i; 3462 uint i;
3457 int count = 0; 3463 int count = 0;
3458 while ( inc ) { 3464 while ( inc ) {
3459 catIncList = inc->categories() ; 3465 catIncList = inc->categories() ;
3460 for( i = 0; i< catIncList.count(); ++i ) { 3466 for( i = 0; i< catIncList.count(); ++i ) {
3461 if ( !catList.contains (catIncList[i])) { 3467 if ( !catList.contains (catIncList[i])) {
3462 catList.append( catIncList[i] ); 3468 catList.append( catIncList[i] );
3463 //qDebug("add cat %s ", catIncList[i].latin1()); 3469 //qDebug("add cat %s ", catIncList[i].latin1());
3464 ++count; 3470 ++count;
@@ -3498,41 +3504,41 @@ void CalendarView::manageCategories()
3498 writeSettings(); 3504 writeSettings();
3499 } else 3505 } else
3500 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); 3506 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
3501 } else { 3507 } else {
3502 removeCategories(); 3508 removeCategories();
3503 updateView(); 3509 updateView();
3504 } 3510 }
3505 delete cp; 3511 delete cp;
3506} 3512}
3507 3513
3508void CalendarView::beamIncidence(Incidence * Inc) 3514void CalendarView::beamIncidence(Incidence * Inc)
3509{ 3515{
3510 QPtrList<Incidence> delSel ; 3516 Q3PtrList<Incidence> delSel ;
3511 delSel.append(Inc); 3517 delSel.append(Inc);
3512 beamIncidenceList( delSel ); 3518 beamIncidenceList( delSel );
3513} 3519}
3514void CalendarView::beamCalendar() 3520void CalendarView::beamCalendar()
3515{ 3521{
3516 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 3522 Q3PtrList<Incidence> delSel = mCalendar->rawIncidences();
3517 //qDebug("beamCalendar() "); 3523 //qDebug("beamCalendar() ");
3518 beamIncidenceList( delSel ); 3524 beamIncidenceList( delSel );
3519} 3525}
3520void CalendarView::beamFilteredCalendar() 3526void CalendarView::beamFilteredCalendar()
3521{ 3527{
3522 QPtrList<Incidence> delSel = mCalendar->incidences(); 3528 Q3PtrList<Incidence> delSel = mCalendar->incidences();
3523 //qDebug("beamFilteredCalendar() "); 3529 //qDebug("beamFilteredCalendar() ");
3524 beamIncidenceList( delSel ); 3530 beamIncidenceList( delSel );
3525} 3531}
3526void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 3532void CalendarView::beamIncidenceList(Q3PtrList<Incidence> delSel )
3527{ 3533{
3528 3534
3529 KOBeamPrefs beamDialog; 3535 KOBeamPrefs beamDialog;
3530 if ( beamDialog.exec () == QDialog::Rejected ) 3536 if ( beamDialog.exec () == QDialog::Rejected )
3531 return; 3537 return;
3532#ifdef DESKTOP_VERSION 3538#ifdef DESKTOP_VERSION
3533 QString fn = locateLocal( "tmp", "kopibeamfile" ); 3539 QString fn = locateLocal( "tmp", "kopibeamfile" );
3534#else 3540#else
3535 QString fn = "/tmp/kopibeamfile"; 3541 QString fn = "/tmp/kopibeamfile";
3536#endif 3542#endif
3537 QString mes; 3543 QString mes;
3538 bool createbup = true; 3544 bool createbup = true;
@@ -4306,25 +4312,25 @@ void CalendarView::schedule_publish(Incidence *incidence)
4306 if ( incidence && incidence->typeID() == todoID ) { 4312 if ( incidence && incidence->typeID() == todoID ) {
4307 todo = static_cast<Todo *>(incidence); 4313 todo = static_cast<Todo *>(incidence);
4308 } 4314 }
4309 } 4315 }
4310 4316
4311 if (!event && !todo) { 4317 if (!event && !todo) {
4312 KMessageBox::sorry(this,i18n("No event selected.")); 4318 KMessageBox::sorry(this,i18n("No event selected."));
4313 return; 4319 return;
4314 } 4320 }
4315 4321
4316 PublishDialog *publishdlg = new PublishDialog(); 4322 PublishDialog *publishdlg = new PublishDialog();
4317 if (incidence->attendeeCount()>0) { 4323 if (incidence->attendeeCount()>0) {
4318 QPtrList<Attendee> attendees = incidence->attendees(); 4324 Q3PtrList<Attendee> attendees = incidence->attendees();
4319 attendees.first(); 4325 attendees.first();
4320 while ( attendees.current()!=0 ) { 4326 while ( attendees.current()!=0 ) {
4321 publishdlg->addAttendee(attendees.current()); 4327 publishdlg->addAttendee(attendees.current());
4322 attendees.next(); 4328 attendees.next();
4323 } 4329 }
4324 } 4330 }
4325 bool send = true; 4331 bool send = true;
4326 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { 4332 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) {
4327 if ( publishdlg->exec() != QDialog::Accepted ) 4333 if ( publishdlg->exec() != QDialog::Accepted )
4328 send = false; 4334 send = false;
4329 } 4335 }
4330 if ( send ) { 4336 if ( send ) {
@@ -4715,25 +4721,25 @@ void CalendarView::showDates(const DateList &selectedDates)
4715 addString = i18n("Day before yesterday"); 4721 addString = i18n("Day before yesterday");
4716 else if ( date == QDateTime::currentDateTime().date().addDays(2) ) 4722 else if ( date == QDateTime::currentDateTime().date().addDays(2) )
4717 addString = i18n("Day after tomorrow"); 4723 addString = i18n("Day after tomorrow");
4718 if ( !addString.isEmpty() ) { 4724 if ( !addString.isEmpty() ) {
4719 topLevelWidget()->setCaption( addString+", " + selDates ); 4725 topLevelWidget()->setCaption( addString+", " + selDates );
4720 return; 4726 return;
4721 } 4727 }
4722 } 4728 }
4723 topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); 4729 topLevelWidget()->setCaption( i18n("Dates: ") + selDates );
4724 4730
4725} 4731}
4726 4732
4727QPtrList<CalFilter> CalendarView::filters() 4733Q3PtrList<CalFilter> CalendarView::filters()
4728{ 4734{
4729 return mFilters; 4735 return mFilters;
4730 4736
4731} 4737}
4732void CalendarView::editFilters() 4738void CalendarView::editFilters()
4733{ 4739{
4734 // kdDebug() << "CalendarView::editFilters()" << endl; 4740 // kdDebug() << "CalendarView::editFilters()" << endl;
4735 4741
4736 CalFilter *filter = mFilters.first(); 4742 CalFilter *filter = mFilters.first();
4737 while(filter) { 4743 while(filter) {
4738 filter = mFilters.next(); 4744 filter = mFilters.next();
4739 } 4745 }
@@ -4756,25 +4762,25 @@ KOFilterView *CalendarView::filterView()
4756} 4762}
4757void CalendarView::selectFilter( int fil ) 4763void CalendarView::selectFilter( int fil )
4758{ 4764{
4759 mFilterView->setSelectedFilter( fil ); 4765 mFilterView->setSelectedFilter( fil );
4760 updateUnmanagedViews(); 4766 updateUnmanagedViews();
4761} 4767}
4762void CalendarView::showFilter(bool visible) 4768void CalendarView::showFilter(bool visible)
4763{ 4769{
4764#if 1 4770#if 1
4765 if (visible) { 4771 if (visible) {
4766 mCalEditView->readConfig(); 4772 mCalEditView->readConfig();
4767 mCalEditView->show(); 4773 mCalEditView->show();
4768 QValueList<int> sizes; 4774 Q3ValueList<int> sizes;
4769 sizes = mLeftFrame->sizes(); 4775 sizes = mLeftFrame->sizes();
4770 if ( sizes.count() == 4 && sizes[3] < 20 ) { 4776 if ( sizes.count() == 4 && sizes[3] < 20 ) {
4771 sizes.clear(); 4777 sizes.clear();
4772 sizes << 100; 4778 sizes << 100;
4773 sizes << 0; 4779 sizes << 0;
4774 sizes << 0; 4780 sizes << 0;
4775 sizes << 100; 4781 sizes << 100;
4776 mLeftFrame->setSizes(sizes); 4782 mLeftFrame->setSizes(sizes);
4777 } 4783 }
4778#if 0 4784#if 0
4779 sizes = mLeftFrame->sizes(); 4785 sizes = mLeftFrame->sizes();
4780 int ccc = 0; 4786 int ccc = 0;
@@ -4837,54 +4843,54 @@ void CalendarView::takeOverEvent()
4837 incidence->setOrganizer(KOPrefs::instance()->email()); 4843 incidence->setOrganizer(KOPrefs::instance()->email());
4838 incidence->recreate(); 4844 incidence->recreate();
4839 incidence->setReadOnly(false); 4845 incidence->setReadOnly(false);
4840 4846
4841 updateView(); 4847 updateView();
4842} 4848}
4843 4849
4844void CalendarView::takeOverCalendar() 4850void CalendarView::takeOverCalendar()
4845{ 4851{
4846 // TODO: Create Calendar::allIncidences() function and use it here 4852 // TODO: Create Calendar::allIncidences() function and use it here
4847 4853
4848 clearAllViews(); 4854 clearAllViews();
4849 QPtrList<Event> events = mCalendar->events(); 4855 Q3PtrList<Event> events = mCalendar->events();
4850 for(uint i=0; i<events.count(); ++i) { 4856 for(uint i=0; i<events.count(); ++i) {
4851 events.at(i)->setOrganizer(KOPrefs::instance()->email()); 4857 events.at(i)->setOrganizer(KOPrefs::instance()->email());
4852 events.at(i)->recreate(); 4858 events.at(i)->recreate();
4853 events.at(i)->setReadOnly(false); 4859 events.at(i)->setReadOnly(false);
4854 } 4860 }
4855 4861
4856 QPtrList<Todo> todos = mCalendar->todos(); 4862 Q3PtrList<Todo> todos = mCalendar->todos();
4857 for(uint i=0; i<todos.count(); ++i) { 4863 for(uint i=0; i<todos.count(); ++i) {
4858 todos.at(i)->setOrganizer(KOPrefs::instance()->email()); 4864 todos.at(i)->setOrganizer(KOPrefs::instance()->email());
4859 todos.at(i)->recreate(); 4865 todos.at(i)->recreate();
4860 todos.at(i)->setReadOnly(false); 4866 todos.at(i)->setReadOnly(false);
4861 } 4867 }
4862 4868
4863 QPtrList<Journal> journals = mCalendar->journals(); 4869 Q3PtrList<Journal> journals = mCalendar->journals();
4864 for(uint i=0; i<journals.count(); ++i) { 4870 for(uint i=0; i<journals.count(); ++i) {
4865 journals.at(i)->setOrganizer(KOPrefs::instance()->email()); 4871 journals.at(i)->setOrganizer(KOPrefs::instance()->email());
4866 journals.at(i)->recreate(); 4872 journals.at(i)->recreate();
4867 journals.at(i)->setReadOnly(false); 4873 journals.at(i)->setReadOnly(false);
4868 } 4874 }
4869 4875
4870 updateView(); 4876 updateView();
4871} 4877}
4872 4878
4873void CalendarView::showIntro() 4879void CalendarView::showIntro()
4874{ 4880{
4875 kdDebug() << "To be implemented." << endl; 4881 kdDebug() << "To be implemented." << endl;
4876} 4882}
4877 4883
4878QWidgetStack *CalendarView::viewStack() 4884Q3WidgetStack *CalendarView::viewStack()
4879{ 4885{
4880 return mRightFrame; 4886 return mRightFrame;
4881} 4887}
4882 4888
4883QWidget *CalendarView::leftFrame() 4889QWidget *CalendarView::leftFrame()
4884{ 4890{
4885 return ( QWidget *)mLeftFrame; 4891 return ( QWidget *)mLeftFrame;
4886} 4892}
4887 4893
4888DateNavigator *CalendarView::dateNavigator() 4894DateNavigator *CalendarView::dateNavigator()
4889{ 4895{
4890 return mNavigator; 4896 return mNavigator;
@@ -5051,25 +5057,25 @@ void CalendarView::lookForOutgoingMessages()
5051 ogd->loadMessages(); 5057 ogd->loadMessages();
5052} 5058}
5053 5059
5054void CalendarView::lookForIncomingMessages() 5060void CalendarView::lookForIncomingMessages()
5055{ 5061{
5056 IncomingDialog *icd = mDialogManager->incomingDialog(); 5062 IncomingDialog *icd = mDialogManager->incomingDialog();
5057 icd->retrieve(); 5063 icd->retrieve();
5058} 5064}
5059 5065
5060bool CalendarView::removeCompletedSubTodos( Todo* t ) 5066bool CalendarView::removeCompletedSubTodos( Todo* t )
5061{ 5067{
5062 bool deleteTodo = true; 5068 bool deleteTodo = true;
5063 QPtrList<Incidence> subTodos; 5069 Q3PtrList<Incidence> subTodos;
5064 Incidence *aTodo; 5070 Incidence *aTodo;
5065 subTodos = t->relations(); 5071 subTodos = t->relations();
5066 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { 5072 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) {
5067 if (! removeCompletedSubTodos( (Todo*) aTodo )) 5073 if (! removeCompletedSubTodos( (Todo*) aTodo ))
5068 deleteTodo = false; 5074 deleteTodo = false;
5069 } 5075 }
5070 if ( deleteTodo ) { 5076 if ( deleteTodo ) {
5071 if ( t->isCompleted() && !t->doesRecur()) { 5077 if ( t->isCompleted() && !t->doesRecur()) {
5072 checkExternalId( t ); 5078 checkExternalId( t );
5073 mCalendar->deleteTodo( t ); 5079 mCalendar->deleteTodo( t );
5074 changeTodoDisplay( t,KOGlobals::EVENTDELETED ); 5080 changeTodoDisplay( t,KOGlobals::EVENTDELETED );
5075 } 5081 }
@@ -5077,26 +5083,26 @@ bool CalendarView::removeCompletedSubTodos( Todo* t )
5077 deleteTodo = false; 5083 deleteTodo = false;
5078 } 5084 }
5079 return deleteTodo; 5085 return deleteTodo;
5080 5086
5081} 5087}
5082void CalendarView::purgeCompleted() 5088void CalendarView::purgeCompleted()
5083{ 5089{
5084 int result = KMessageBox::warningContinueCancel(this, 5090 int result = KMessageBox::warningContinueCancel(this,
5085 i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); 5091 i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge"));
5086 5092
5087 if (result == KMessageBox::Continue) { 5093 if (result == KMessageBox::Continue) {
5088 5094
5089 QPtrList<Todo> todoCal; 5095 Q3PtrList<Todo> todoCal;
5090 QPtrList<Todo> rootTodos; 5096 Q3PtrList<Todo> rootTodos;
5091 //QPtrList<Incidence> rel; 5097 //QPtrList<Incidence> rel;
5092 Todo *aTodo; 5098 Todo *aTodo;
5093 todoCal = calendar()->todos(); 5099 todoCal = calendar()->todos();
5094 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { 5100 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) {
5095 if ( !aTodo->relatedTo() ) 5101 if ( !aTodo->relatedTo() )
5096 rootTodos.append( aTodo ); 5102 rootTodos.append( aTodo );
5097 } 5103 }
5098 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { 5104 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) {
5099 removeCompletedSubTodos( aTodo ); 5105 removeCompletedSubTodos( aTodo );
5100 } 5106 }
5101 5107
5102 updateView(); 5108 updateView();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 60b1276..b4eada7 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -15,48 +15,50 @@
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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#ifndef CALENDARVIEW_H 24#ifndef CALENDARVIEW_H
25#define CALENDARVIEW_H 25#define CALENDARVIEW_H
26 26
27#include <qframe.h> 27#include <q3frame.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qwidget.h> 29#include <qwidget.h>
30#include <qptrlist.h> 30#include <q3ptrlist.h>
31#include <qvbox.h> 31#include <q3vbox.h>
32#include <qmap.h> 32#include <qmap.h>
33#include <qscrollbar.h> 33#include <qscrollbar.h>
34//Added by qt3to4:
35#include <QKeyEvent>
34#ifndef DESKTOP_VERSION 36#ifndef DESKTOP_VERSION
35#include <qtopia/ir.h> 37#include <qtopia/ir.h>
36#else 38#else
37#define Ir char 39#define Ir char
38#endif 40#endif
39#include <libkcal/calendar.h> 41#include <libkcal/calendar.h>
40#include <libkcal/scheduler.h> 42#include <libkcal/scheduler.h>
41#include <libkcal/calendarresources.h> 43#include <libkcal/calendarresources.h>
42#include <libkcal/resourcecalendar.h> 44#include <libkcal/resourcecalendar.h>
43#include <KDGanttMinimizeSplitter.h> 45#include <KDGanttMinimizeSplitter.h>
44 46
45#include <korganizer/calendarviewbase.h> 47#include <korganizer/calendarviewbase.h>
46 48
47#include <ksyncmanager.h> 49#include <ksyncmanager.h>
48//#include <koprefs.h> 50//#include <koprefs.h>
49 51
50class QWidgetStack; 52class Q3WidgetStack;
51class QSplitter; 53class QSplitter;
52class KopiCalendarFile; 54class KopiCalendarFile;
53class CalPrinter; 55class CalPrinter;
54class KOFilterView; 56class KOFilterView;
55class KOCalEditView; 57class KOCalEditView;
56class KOViewManager; 58class KOViewManager;
57class KODialogManager; 59class KODialogManager;
58class KOTodoView; 60class KOTodoView;
59class KDateNavigator; 61class KDateNavigator;
60class DateNavigatorContainer; 62class DateNavigatorContainer;
61class DateNavigator; 63class DateNavigator;
62class KOIncidenceEditor; 64class KOIncidenceEditor;
@@ -75,37 +77,37 @@ namespace KCal { class FileStorage; }
75using namespace KCal; 77using namespace KCal;
76 78
77/** 79/**
78 This is the main calendar widget. It provides the different vies on t he 80 This is the main calendar widget. It provides the different vies on t he
79 calendar data as well as the date navigator. It also handles synchronisation 81 calendar data as well as the date navigator. It also handles synchronisation
80 of the different views and controls the different dialogs like preferences, 82 of the different views and controls the different dialogs like preferences,
81 event editor, search dialog etc. 83 event editor, search dialog etc.
82 84
83 @short main calendar view widget 85 @short main calendar view widget
84 @author Cornelius Schumacher 86 @author Cornelius Schumacher
85*/ 87*/
86 88
87#include <qtextbrowser.h> 89#include <q3textbrowser.h>
88#include <qtextcodec.h> 90#include <qtextcodec.h>
89 91
90class MissedAlarmTextBrowser : public QTextBrowser { 92class MissedAlarmTextBrowser : public Q3TextBrowser {
91 Q_OBJECT 93 Q_OBJECT
92 public: 94 public:
93 MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start); 95 MissedAlarmTextBrowser(QWidget *parent, Q3PtrList<Incidence> alarms ,QDateTime start);
94 ~MissedAlarmTextBrowser(); 96 ~MissedAlarmTextBrowser();
95 void setSource(const QString & n); 97 void setSource(const QString & n);
96 98
97 private: 99 private:
98 Incidence * getNextInc(QDateTime start ); 100 Incidence * getNextInc(QDateTime start );
99 QPtrList<Incidence> mAlarms; 101 Q3PtrList<Incidence> mAlarms;
100 signals: 102 signals:
101 void showIncidence( QString uid); 103 void showIncidence( QString uid);
102}; 104};
103 105
104 106
105class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface 107class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface
106{ 108{
107 Q_OBJECT 109 Q_OBJECT
108 public: 110 public:
109 /** 111 /**
110 Constructs a new calendar view widget. 112 Constructs a new calendar view widget.
111 113
@@ -118,25 +120,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
118 CalendarView( Calendar *calendar, QWidget *parent = 0, 120 CalendarView( Calendar *calendar, QWidget *parent = 0,
119 const char *name = 0 ); 121 const char *name = 0 );
120 virtual ~CalendarView(); 122 virtual ~CalendarView();
121 123
122 Calendar *calendar() { return mCalendar; } 124 Calendar *calendar() { return mCalendar; }
123 125
124 KOViewManager *viewManager(); 126 KOViewManager *viewManager();
125 KODialogManager *dialogManager(); 127 KODialogManager *dialogManager();
126 128
127 QDate startDate(); 129 QDate startDate();
128 QDate endDate(); 130 QDate endDate();
129 131
130 QWidgetStack *viewStack(); 132 Q3WidgetStack *viewStack();
131 QWidget *leftFrame(); 133 QWidget *leftFrame();
132 134
133 DateNavigator *dateNavigator(); 135 DateNavigator *dateNavigator();
134 KDateNavigator *dateNavigatorWidget(); 136 KDateNavigator *dateNavigatorWidget();
135 137
136 void addView(KOrg::BaseView *); 138 void addView(KOrg::BaseView *);
137 void showView(KOrg::BaseView *); 139 void showView(KOrg::BaseView *);
138 KOEventViewerDialog* getEventViewerDialog(); 140 KOEventViewerDialog* getEventViewerDialog();
139 Incidence *currentSelection(); 141 Incidence *currentSelection();
140 void checkSuspendAlarm(); 142 void checkSuspendAlarm();
141 void mergeFile( QString fn ); 143 void mergeFile( QString fn );
142 void mergeFileResource( QString fn ,QString res); 144 void mergeFileResource( QString fn ,QString res);
@@ -432,25 +434,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
432 void schedule_refresh(Incidence *incidence = 0); 434 void schedule_refresh(Incidence *incidence = 0);
433 void schedule_cancel(Incidence *incidence = 0); 435 void schedule_cancel(Incidence *incidence = 0);
434 void schedule_add(Incidence *incidence = 0); 436 void schedule_add(Incidence *incidence = 0);
435 void schedule_reply(Incidence *incidence = 0); 437 void schedule_reply(Incidence *incidence = 0);
436 void schedule_counter(Incidence *incidence = 0); 438 void schedule_counter(Incidence *incidence = 0);
437 void schedule_declinecounter(Incidence *incidence = 0); 439 void schedule_declinecounter(Incidence *incidence = 0);
438 void schedule_publish_freebusy(int daysToPublish = 30); 440 void schedule_publish_freebusy(int daysToPublish = 30);
439 441
440 void openAddressbook(); 442 void openAddressbook();
441 443
442 void editFilters(); 444 void editFilters();
443 void toggleFilerEnabled(); 445 void toggleFilerEnabled();
444 QPtrList<CalFilter> filters(); 446 Q3PtrList<CalFilter> filters();
445 void toggleFilter(); 447 void toggleFilter();
446 void showFilter(bool visible); 448 void showFilter(bool visible);
447 void updateFilter(); 449 void updateFilter();
448 void filterEdited(); 450 void filterEdited();
449 void selectFilter( int ); 451 void selectFilter( int );
450 KOFilterView *filterView(); 452 KOFilterView *filterView();
451 453
452 void showIntro(); 454 void showIntro();
453 455
454 /** Move the curdatepient view date to today */ 456 /** Move the curdatepient view date to today */
455 void goToday(); 457 void goToday();
456 458
@@ -486,25 +488,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
486 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); 488 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday );
487 bool importQtopia( const QString &categoriesFile, 489 bool importQtopia( const QString &categoriesFile,
488 const QString &datebookFile, 490 const QString &datebookFile,
489 const QString &tasklistFile ); 491 const QString &tasklistFile );
490 void syncExternal( int mode ); 492 void syncExternal( int mode );
491 void slotSelectPickerDate( QDate ) ; 493 void slotSelectPickerDate( QDate ) ;
492 void showDatePicker() ; 494 void showDatePicker() ;
493 void showDatePickerPopup() ; 495 void showDatePickerPopup() ;
494 void moveIncidence(Incidence *) ; 496 void moveIncidence(Incidence *) ;
495 void beamIncidence(Incidence *) ; 497 void beamIncidence(Incidence *) ;
496 void beamCalendar() ; 498 void beamCalendar() ;
497 void beamFilteredCalendar() ; 499 void beamFilteredCalendar() ;
498 void beamIncidenceList(QPtrList<Incidence>) ; 500 void beamIncidenceList(Q3PtrList<Incidence>) ;
499 void manageCategories(); 501 void manageCategories();
500 void editCategories(); 502 void editCategories();
501 int addCategories(); 503 int addCategories();
502 void removeCategories(); 504 void removeCategories();
503 void setSyncDevice( QString ); 505 void setSyncDevice( QString );
504 void setSyncName( QString ); 506 void setSyncName( QString );
505 void showDay( QDate ); 507 void showDay( QDate );
506 void undo_delete(); 508 void undo_delete();
507 protected slots: 509 protected slots:
508 void resetFocus(); 510 void resetFocus();
509 void scrollBarValue(int); 511 void scrollBarValue(int);
510 void slotViewerClosed(); 512 void slotViewerClosed();
@@ -566,68 +568,68 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
566 KSyncManager* mSyncManager; 568 KSyncManager* mSyncManager;
567 AlarmDialog * mAlarmDialog; 569 AlarmDialog * mAlarmDialog;
568 QString mAlarmNotification; 570 QString mAlarmNotification;
569 QString mSuspendAlarmNotification; 571 QString mSuspendAlarmNotification;
570 QTimer* mSuspendTimer; 572 QTimer* mSuspendTimer;
571 QTimer* mAlarmTimer; 573 QTimer* mAlarmTimer;
572 QTimer* mRecheckAlarmTimer; 574 QTimer* mRecheckAlarmTimer;
573 void computeAlarm( QString ); 575 void computeAlarm( QString );
574 void startAlarm( QString, QString ); 576 void startAlarm( QString, QString );
575 void setSyncEventsReadOnly(); 577 void setSyncEventsReadOnly();
576 578
577 QDateTime loadedFileVersion; 579 QDateTime loadedFileVersion;
578 void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); 580 void checkExternSyncEvent( Q3PtrList<Event> lastSync , Incidence* toDelete );
579 void checkExternalId( Incidence * inc ); 581 void checkExternalId( Incidence * inc );
580 int mGlobalSyncMode; 582 int mGlobalSyncMode;
581 QString mCurrentSyncDevice; 583 QString mCurrentSyncDevice;
582 QString mCurrentSyncName; 584 QString mCurrentSyncName;
583 void init(); 585 void init();
584 int mDatePickerMode; 586 int mDatePickerMode;
585 bool mFlagEditDescription; 587 bool mFlagEditDescription;
586 QDateTime mLastCalendarSync; 588 QDateTime mLastCalendarSync;
587 void createPrinter(); 589 void createPrinter();
588 590
589 void calendarModified( bool, Calendar * ); 591 void calendarModified( bool, Calendar * );
590 592
591 CalPrinter *mCalPrinter; 593 CalPrinter *mCalPrinter;
592 594
593 QSplitter *mPanner; 595 QSplitter *mPanner;
594 QSplitter *mLeftSplitter; 596 QSplitter *mLeftSplitter;
595 KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame; 597 KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame;
596 QWidgetStack *mRightFrame; 598 Q3WidgetStack *mRightFrame;
597 599
598 KDatePicker* mDatePicker; 600 KDatePicker* mDatePicker;
599 QVBox* mDateFrame; 601 Q3VBox* mDateFrame;
600 602
601 DateNavigatorContainer *mDateNavigator; // widget showing small month view. 603 DateNavigatorContainer *mDateNavigator; // widget showing small month view.
602 604
603 KOFilterView *mFilterView; 605 KOFilterView *mFilterView;
604 KOCalEditView *mCalEditView; 606 KOCalEditView *mCalEditView;
605 607
606 ResourceView *mResourceView; 608 ResourceView *mResourceView;
607 609
608 // calendar object for this viewing instance 610 // calendar object for this viewing instance
609 Calendar *mCalendar; 611 Calendar *mCalendar;
610 612
611 CalendarResourceManager *mResourceManager; 613 CalendarResourceManager *mResourceManager;
612 614
613 FileStorage *mStorage; 615 FileStorage *mStorage;
614 616
615 DateNavigator *mNavigator; 617 DateNavigator *mNavigator;
616 618
617 KOViewManager *mViewManager; 619 KOViewManager *mViewManager;
618 KODialogManager *mDialogManager; 620 KODialogManager *mDialogManager;
619 621
620 // Calendar filters 622 // Calendar filters
621 QPtrList<CalFilter> mFilters; 623 Q3PtrList<CalFilter> mFilters;
622 624
623 // various housekeeping variables. 625 // various housekeeping variables.
624 bool mModified; // flag indicating if calendar is modified 626 bool mModified; // flag indicating if calendar is modified
625 bool mReadOnly; // flag indicating if calendar is read-only 627 bool mReadOnly; // flag indicating if calendar is read-only
626 QDate mSaveSingleDate; 628 QDate mSaveSingleDate;
627 629
628 Incidence *mSelectedIncidence; 630 Incidence *mSelectedIncidence;
629 Incidence *mMoveIncidence; 631 Incidence *mMoveIncidence;
630 QDate mMoveIncidenceOldDate; 632 QDate mMoveIncidenceOldDate;
631 KOTodoView *mTodoList; 633 KOTodoView *mTodoList;
632 KOEventEditor * mEventEditor; 634 KOEventEditor * mEventEditor;
633 KOTodoEditor * mTodoEditor; 635 KOTodoEditor * mTodoEditor;
diff --git a/korganizer/calprintbase.cpp b/korganizer/calprintbase.cpp
index 7b7d54c..ecb9e03 100644
--- a/korganizer/calprintbase.cpp
+++ b/korganizer/calprintbase.cpp
@@ -16,29 +16,31 @@
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 20
21 As a special exception, permission is given to link this program 21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25 25
26#include <qpainter.h> 26#include <qpainter.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qframe.h> 28#include <q3frame.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qptrlist.h> 30#include <q3ptrlist.h>
31#include <qintdict.h> 31#include <q3intdict.h>
32#include <qfontmetrics.h> 32#include <qfontmetrics.h>
33//Added by qt3to4:
34#include <Q3VBoxLayout>
33 35
34#include <kglobal.h> 36#include <kglobal.h>
35#include <klocale.h> 37#include <klocale.h>
36#include <kdebug.h> 38#include <kdebug.h>
37#include <kconfig.h> 39#include <kconfig.h>
38#include <kcalendarsystem.h> 40#include <kcalendarsystem.h>
39#include <kprinter.h> 41#include <kprinter.h>
40 42
41#include <libkcal/todo.h> 43#include <libkcal/todo.h>
42#include <libkcal/event.h> 44#include <libkcal/event.h>
43#include <libkcal/calendar.h> 45#include <libkcal/calendar.h>
44 46
@@ -136,26 +138,26 @@ CalPrintBase::CalPrintBase( KPrinter *printer, Calendar *cal, KConfig *cfg )
136 : QObject(), mPrinter( printer ), mCalendar( cal ), mConfig( cfg ) 138 : QObject(), mPrinter( printer ), mCalendar( cal ), mConfig( cfg )
137{ 139{
138} 140}
139 141
140CalPrintBase::~CalPrintBase() 142CalPrintBase::~CalPrintBase()
141{ 143{
142} 144}
143 145
144 146
145 147
146QWidget *CalPrintBase::configWidget( QWidget *w ) 148QWidget *CalPrintBase::configWidget( QWidget *w )
147{ 149{
148 QFrame *wdg = new QFrame( w ); 150 Q3Frame *wdg = new Q3Frame( w );
149 QVBoxLayout *layout = new QVBoxLayout( wdg ); 151 Q3VBoxLayout *layout = new Q3VBoxLayout( wdg );
150 152
151 QLabel *title = new QLabel( description(), wdg ); 153 QLabel *title = new QLabel( description(), wdg );
152 QFont titleFont( title->font() ); 154 QFont titleFont( title->font() );
153 titleFont.setPointSize( 20 ); 155 titleFont.setPointSize( 20 );
154 titleFont.setBold( true ); 156 titleFont.setBold( true );
155 title->setFont( titleFont ); 157 title->setFont( titleFont );
156 158
157 layout->addWidget( title ); 159 layout->addWidget( title );
158 layout->addWidget( new QLabel( longDescription(), wdg ) ); 160 layout->addWidget( new QLabel( longDescription(), wdg ) );
159 layout->addSpacing( 20 ); 161 layout->addSpacing( 20 );
160 layout->addWidget( new QLabel( i18n("This printing style does not " 162 layout->addWidget( new QLabel( i18n("This printing style does not "
161 "have any configuration options."), 163 "have any configuration options."),
@@ -276,58 +278,58 @@ void CalPrintBase::drawHeader( QPainter &p, QString title,
276void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, 278void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd,
277 int x, int y, int width, int height) 279 int x, int y, int width, int height)
278{ 280{
279 bool firstCol = true; 281 bool firstCol = true;
280 QDate monthDate(QDate(qd.year(), qd.month(), 1)); 282 QDate monthDate(QDate(qd.year(), qd.month(), 1));
281 QDate monthDate2; 283 QDate monthDate2;
282 int month = monthDate.month(); 284 int month = monthDate.month();
283 285
284 // draw the title 286 // draw the title
285 p.setFont(QFont("helvetica", 7, QFont::Bold)); 287 p.setFont(QFont("helvetica", 7, QFont::Bold));
286 // int lineSpacing = p.fontMetrics().lineSpacing(); 288 // int lineSpacing = p.fontMetrics().lineSpacing();
287 const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem(); 289 const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem();
288 p.drawText(x, y, width, height/4, AlignCenter, calSys->monthName( qd ) ); 290 p.drawText(x, y, width, height/4, Qt::AlignCenter, calSys->monthName( qd ) );
289 291
290 int cellWidth = width/7; 292 int cellWidth = width/7;
291 int cellHeight = height/8; 293 int cellHeight = height/8;
292 QString tmpStr; 294 QString tmpStr;
293 295
294 // correct begin of week 296 // correct begin of week
295 int weekdayCol = weekdayColumn( qd.dayOfWeek() ); 297 int weekdayCol = weekdayColumn( qd.dayOfWeek() );
296 monthDate2 = monthDate.addDays(-weekdayCol); 298 monthDate2 = monthDate.addDays(-weekdayCol);
297 299
298 // draw days of week 300 // draw days of week
299 p.setFont(QFont("helvetica", 7, QFont::Bold)); 301 p.setFont(QFont("helvetica", 7, QFont::Bold));
300 for (int col = 0; col < 7; col++) { 302 for (int col = 0; col < 7; col++) {
301 // tmpStr.sprintf("%c",(const char*)monthDate2.dayName(monthDate2.dayOfWeek())); 303 // tmpStr.sprintf("%c",(const char*)monthDate2.dayName(monthDate2.dayOfWeek()));
302 tmpStr=calSys->weekDayName( monthDate2 )[0].upper(); 304 tmpStr=calSys->weekDayName( monthDate2 )[0].upper();
303 p.drawText(x+col*cellWidth, y+height/4, cellWidth, cellHeight, 305 p.drawText(x+col*cellWidth, y+height/4, cellWidth, cellHeight,
304 AlignCenter, tmpStr); 306 Qt::AlignCenter, tmpStr);
305 monthDate2 = monthDate2.addDays(1); 307 monthDate2 = monthDate2.addDays(1);
306 } 308 }
307 309
308 // draw separator line 310 // draw separator line
309 p.drawLine(x, y+height/4+cellHeight, x+width, y+height/4+cellHeight); 311 p.drawLine(x, y+height/4+cellHeight, x+width, y+height/4+cellHeight);
310 312
311 for (int row = 0; row < 5; row++) { 313 for (int row = 0; row < 5; row++) {
312 for (int col = 0; col < 7; col++) { 314 for (int col = 0; col < 7; col++) {
313 if (monthDate.month() != month) 315 if (monthDate.month() != month)
314 break; 316 break;
315 if (firstCol) { 317 if (firstCol) {
316 firstCol = true; 318 firstCol = true;
317 col = weekdayColumn( monthDate.dayOfWeek() ); 319 col = weekdayColumn( monthDate.dayOfWeek() );
318 } 320 }
319 p.drawText( x+col*cellWidth, 321 p.drawText( x+col*cellWidth,
320 y+height/4+cellHeight+(row*cellHeight), 322 y+height/4+cellHeight+(row*cellHeight),
321 cellWidth, cellHeight, AlignCenter, 323 cellWidth, cellHeight, Qt::AlignCenter,
322 tmpStr.setNum(monthDate.day()) ); 324 tmpStr.setNum(monthDate.day()) );
323 monthDate = monthDate.addDays(1); 325 monthDate = monthDate.addDays(1);
324 } 326 }
325 } 327 }
326} 328}
327 329
328 330
329/////////////////////////////////////////////////////////////////////////////// 331///////////////////////////////////////////////////////////////////////////////
330 332
331/* 333/*
332 * This routine draws a header box over the main part of the calendar 334 * This routine draws a header box over the main part of the calendar
333 * containing the days of the week. 335 * containing the days of the week.
@@ -349,25 +351,25 @@ void CalPrintBase::drawDaysOfWeek(QPainter &p,
349 351
350 352
351void CalPrintBase::drawDaysOfWeekBox(QPainter &p, const QDate &qd, 353void CalPrintBase::drawDaysOfWeekBox(QPainter &p, const QDate &qd,
352 int x, int y, int width, int height) 354 int x, int y, int width, int height)
353{ 355{
354 const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem(); 356 const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem();
355 357
356 p.setFont( QFont( "helvetica", 10, QFont::Bold ) ); 358 p.setFont( QFont( "helvetica", 10, QFont::Bold ) );
357 p.drawRect( x, y, width, height ); 359 p.drawRect( x, y, width, height );
358// p.fillRect( x+1, y+1, 360// p.fillRect( x+1, y+1,
359// width-2, height-2, 361// width-2, height-2,
360// QBrush( Dense7Pattern ) ); 362// QBrush( Dense7Pattern ) );
361 p.drawText( x+5, y, width-10, height, AlignCenter | AlignVCenter, 363 p.drawText( x+5, y, width-10, height, Qt::AlignCenter | Qt::AlignVCenter,
362 calSys->weekDayName( qd ) ); 364 calSys->weekDayName( qd ) );
363} 365}
364 366
365 367
366void CalPrintBase::drawTimeLine(QPainter &p, 368void CalPrintBase::drawTimeLine(QPainter &p,
367 const QTime &fromTime, const QTime &toTime, 369 const QTime &fromTime, const QTime &toTime,
368 int x, int y, int width, int height) 370 int x, int y, int width, int height)
369{ 371{
370 p.drawRect(x, y, width, height); 372 p.drawRect(x, y, width, height);
371 373
372 int totalsecs=fromTime.secsTo(toTime); 374 int totalsecs=fromTime.secsTo(toTime);
373 float minlen=(float)height*60./(float)totalsecs; 375 float minlen=(float)height*60./(float)totalsecs;
@@ -392,34 +394,34 @@ void CalPrintBase::drawTimeLine(QPainter &p,
392 QString numStr; 394 QString numStr;
393 if (newY < y+height) { 395 if (newY < y+height) {
394 p.drawLine(x+width/2, (int)newY, x+width, (int)newY); 396 p.drawLine(x+width/2, (int)newY, x+width, (int)newY);
395 // draw the time: 397 // draw the time:
396 if ( !KGlobal::locale()->use12Clock() ) { 398 if ( !KGlobal::locale()->use12Clock() ) {
397 numStr.setNum(curTime.hour()); 399 numStr.setNum(curTime.hour());
398 if (cellHeight > 30) { 400 if (cellHeight > 30) {
399 p.setFont(QFont("helvetica", 16, QFont::Bold)); 401 p.setFont(QFont("helvetica", 16, QFont::Bold));
400 } else { 402 } else {
401 p.setFont(QFont("helvetica", 12, QFont::Bold)); 403 p.setFont(QFont("helvetica", 12, QFont::Bold));
402 } 404 }
403 p.drawText(x+2, (int)currY+2, width/2-2, (int)cellHeight, 405 p.drawText(x+2, (int)currY+2, width/2-2, (int)cellHeight,
404 AlignTop|AlignRight, numStr); 406 Qt::AlignTop|Qt::AlignRight, numStr);
405 p.setFont(QFont("helvetica", 10, QFont::Normal)); 407 p.setFont(QFont("helvetica", 10, QFont::Normal));
406 p.drawText(x+width/2, (int)currY+2, width/2+2, (int)(cellHeight/2)-3, 408 p.drawText(x+width/2, (int)currY+2, width/2+2, (int)(cellHeight/2)-3,
407 AlignTop | AlignLeft, "00"); 409 Qt::AlignTop | Qt::AlignLeft, "00");
408 } else { 410 } else {
409 QTime time( curTime.hour(), 0 ); 411 QTime time( curTime.hour(), 0 );
410 numStr = KGlobal::locale()->formatTime( time ); 412 numStr = KGlobal::locale()->formatTime( time );
411 p.setFont(QFont("helvetica", 14, QFont::Bold)); 413 p.setFont(QFont("helvetica", 14, QFont::Bold));
412 p.drawText(x+2, (int)currY+2, width-4, (int)cellHeight/2-3, 414 p.drawText(x+2, (int)currY+2, width-4, (int)cellHeight/2-3,
413 AlignTop|AlignLeft, numStr); 415 Qt::AlignTop|Qt::AlignLeft, numStr);
414 } 416 }
415 currY+=cellHeight; 417 currY+=cellHeight;
416 } // enough space for half-hour line and time 418 } // enough space for half-hour line and time
417 if (curTime.secsTo(endTime)>3600) 419 if (curTime.secsTo(endTime)>3600)
418 curTime=curTime.addSecs(3600); 420 curTime=curTime.addSecs(3600);
419 else curTime=endTime; 421 else curTime=endTime;
420 } // currTime<endTime 422 } // currTime<endTime
421} 423}
422 424
423 425
424/////////////////////////////////////////////////////////////////////////////// 426///////////////////////////////////////////////////////////////////////////////
425 427
@@ -463,46 +465,46 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList,
463 if ( currEvent->doesFloat() ) { 465 if ( currEvent->doesFloat() ) {
464 // set the colors according to the categories 466 // set the colors according to the categories
465 QString text = currEvent->summary() ; 467 QString text = currEvent->summary() ;
466 if ( ! currEvent->location().isEmpty() ) 468 if ( ! currEvent->location().isEmpty() )
467 text += " ("+currEvent->location()+")"; 469 text += " ("+currEvent->location()+")";
468 if (expandable) { 470 if (expandable) {
469 if (mUseColors) 471 if (mUseColors)
470 setCategoryColors(p, currEvent); 472 setCategoryColors(p, currEvent);
471 473
472 p.drawRect( x, offset, width, height ); 474 p.drawRect( x, offset, width, height );
473 475
474 p.drawText( x+5, offset+5, width-10, height-10, 476 p.drawText( x+5, offset+5, width-10, height-10,
475 AlignCenter | AlignVCenter | AlignJustify | WordBreak, 477 Qt::AlignCenter | Qt::AlignVCenter | Qt::AlignJustify | Qt::WordBreak,
476 text ); 478 text );
477 // reset the colors 479 // reset the colors
478 p.setBrush( oldBrush ); 480 p.setBrush( oldBrush );
479 p.setPen( oldPen ); 481 p.setPen( oldPen );
480 p.setBackgroundColor(oldBgColor); 482 p.setBackgroundColor(oldBgColor);
481 483
482 offset += height; 484 offset += height;
483 } else { 485 } else {
484 //if (!multiDayStr.isEmpty()) multiDayStr+=", "; 486 //if (!multiDayStr.isEmpty()) multiDayStr+=", ";
485 multiDayStr += text+"\n"; 487 multiDayStr += text+"\n";
486 } 488 }
487 eventList.remove( itold ); 489 eventList.remove( itold );
488 } 490 }
489 } 491 }
490 492
491 if (!expandable) { 493 if (!expandable) {
492 p.drawRect(x, offset, width, height); 494 p.drawRect(x, offset, width, height);
493 if (!multiDayStr.isEmpty()) { 495 if (!multiDayStr.isEmpty()) {
494 // p.fillRect(x+1, offset+1, width-2, height-2, QBrush(Dense5Pattern) ); 496 // p.fillRect(x+1, offset+1, width-2, height-2, QBrush(Dense5Pattern) );
495 p.drawText( x+5, offset+5, width-10, height-10, 497 p.drawText( x+5, offset+5, width-10, height-10,
496 AlignLeft | AlignTop | AlignJustify , 498 Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify ,
497 multiDayStr); 499 multiDayStr);
498 } 500 }
499 } else { 501 } else {
500 height=offset-y; 502 height=offset-y;
501 } 503 }
502} 504}
503 505
504 506
505void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, 507void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events,
506 const QDate &qd, bool expandable, 508 const QDate &qd, bool expandable,
507 QTime &fromTime, QTime &toTime, 509 QTime &fromTime, QTime &toTime,
508 int x, int y, int width, int height ) 510 int x, int y, int width, int height )
@@ -551,58 +553,58 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events,
551 if ( curTime.secsTo( toTime ) > 3600 ) 553 if ( curTime.secsTo( toTime ) > 3600 )
552 curTime = curTime.addSecs( 3600 ); 554 curTime = curTime.addSecs( 3600 );
553 else curTime = toTime; 555 else curTime = toTime;
554 currY += cellHeight / 2; 556 currY += cellHeight / 2;
555 } 557 }
556 558
557 QDateTime startPrintDate = QDateTime( qd, fromTime ); 559 QDateTime startPrintDate = QDateTime( qd, fromTime );
558 QDateTime endPrintDate = QDateTime( qd, toTime ); 560 QDateTime endPrintDate = QDateTime( qd, toTime );
559 561
560 // Calculate horizontal positions and widths of events taking into account 562 // Calculate horizontal positions and widths of events taking into account
561 // overlapping events 563 // overlapping events
562 564
563 QPtrList<KOrg::CellItem> cells; 565 Q3PtrList<KOrg::CellItem> cells;
564 cells.setAutoDelete( true ); 566 cells.setAutoDelete( true );
565 567
566 Event::List::ConstIterator itEvents; 568 Event::List::ConstIterator itEvents;
567 for( itEvents = events.begin(); itEvents != events.end(); ++itEvents ) { 569 for( itEvents = events.begin(); itEvents != events.end(); ++itEvents ) {
568 cells.append( new PrintCellItem( *itEvents, qd ) ); 570 cells.append( new PrintCellItem( *itEvents, qd ) );
569 } 571 }
570 572
571 QPtrListIterator<KOrg::CellItem> it1( cells ); 573 Q3PtrListIterator<KOrg::CellItem> it1( cells );
572 for( it1.toFirst(); it1.current(); ++it1 ) { 574 for( it1.toFirst(); it1.current(); ++it1 ) {
573 KOrg::CellItem *placeItem = it1.current(); 575 KOrg::CellItem *placeItem = it1.current();
574 576
575 KOrg::CellItem::placeItem( cells, placeItem ); 577 KOrg::CellItem::placeItem( cells, placeItem );
576 } 578 }
577 579
578 QPen oldPen = p.pen(); 580 QPen oldPen = p.pen();
579 QColor oldBgColor = p.backgroundColor(); 581 QColor oldBgColor = p.backgroundColor();
580 QBrush oldBrush = p.brush(); 582 QBrush oldBrush = p.brush();
581 583
582 p.setFont( QFont( "helvetica", 10 ) ); 584 p.setFont( QFont( "helvetica", 10 ) );
583 //p.setBrush( QBrush( Dense7Pattern ) ); 585 //p.setBrush( QBrush( Dense7Pattern ) );
584 586
585 for( it1.toFirst(); it1.current(); ++it1 ) { 587 for( it1.toFirst(); it1.current(); ++it1 ) {
586 PrintCellItem *placeItem = static_cast<PrintCellItem *>( it1.current() ); 588 PrintCellItem *placeItem = static_cast<PrintCellItem *>( it1.current() );
587 589
588 drawAgendaItem( placeItem, p, qd, startPrintDate, endPrintDate, minlen, x, 590 drawAgendaItem( placeItem, p, qd, startPrintDate, endPrintDate, minlen, x,
589 y, width ); 591 y, width );
590 592
591 p.setBrush( oldBrush ); 593 p.setBrush( oldBrush );
592 p.setPen( oldPen ); 594 p.setPen( oldPen );
593 p.setBackgroundColor( oldBgColor ); 595 p.setBackgroundColor( oldBgColor );
594 } 596 }
595 597
596 p.setBrush( QBrush( NoBrush ) ); 598 p.setBrush( QBrush( Qt::NoBrush ) );
597} 599}
598 600
599 601
600void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p, 602void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p,
601 const QDate &qd, 603 const QDate &qd,
602 const QDateTime &startPrintDate, 604 const QDateTime &startPrintDate,
603 const QDateTime &endPrintDate, 605 const QDateTime &endPrintDate,
604 float minlen, int x, int y, int width ) 606 float minlen, int x, int y, int width )
605{ 607{
606 Event *event = item->event(); 608 Event *event = item->event();
607 609
608 // set the colors according to the categories 610 // set the colors according to the categories
@@ -626,25 +628,25 @@ void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p,
626 int currentX = x + item->subCell() * currentWidth; 628 int currentX = x + item->subCell() * currentWidth;
627 QString text = KGlobal::locale()->formatTime(event->dtStart().time())+ 629 QString text = KGlobal::locale()->formatTime(event->dtStart().time())+
628 "-"+KGlobal::locale()->formatTime(event->dtEnd().time())+ 630 "-"+KGlobal::locale()->formatTime(event->dtEnd().time())+
629 " "+event->summary(); 631 " "+event->summary();
630 if ( !event->location().isEmpty() ) 632 if ( !event->location().isEmpty() )
631 text += " (" +event->location()+")"; 633 text += " (" +event->location()+")";
632 // p.save(); 634 // p.save();
633 QPen pe = p.pen(); 635 QPen pe = p.pen();
634 pe.setWidth( 2 ); 636 pe.setWidth( 2 );
635 p.setPen( pe ); 637 p.setPen( pe );
636 p.drawRect( currentX, currentyPos+1, currentWidth+1, eventLength+1 ); 638 p.drawRect( currentX, currentyPos+1, currentWidth+1, eventLength+1 );
637 p.drawText( currentX+3, currentyPos+2, currentWidth-5, eventLength-3, 639 p.drawText( currentX+3, currentyPos+2, currentWidth-5, eventLength-3,
638 AlignLeft | AlignTop | AlignJustify | WordBreak, 640 Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify | Qt::TextWordWrap,
639 text); 641 text);
640 // p.restore(); 642 // p.restore();
641 } 643 }
642} 644}
643 645
644void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, 646void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd,
645 int x, int y, int width, int height, 647 int x, int y, int width, int height,
646 bool fullDate) 648 bool fullDate)
647{ 649{
648 QString dayNumStr; 650 QString dayNumStr;
649 QString ampm; 651 QString ampm;
650 const KLocale*local = KGlobal::locale(); 652 const KLocale*local = KGlobal::locale();
@@ -661,35 +663,35 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd,
661 p.drawRect( x, y, width, height ); 663 p.drawRect( x, y, width, height );
662 // p.fillRect( x+1, y+1, width-2,height, QBrush(Dense7Pattern) ); 664 // p.fillRect( x+1, y+1, width-2,height, QBrush(Dense7Pattern) );
663 p.drawRect( x, y, width, mSubHeaderHeight ); 665 p.drawRect( x, y, width, mSubHeaderHeight );
664 //p.fillRect( x+1, y+1, width-2, mSubHeaderHeight-2, QBrush(Dense7Pattern) ); 666 //p.fillRect( x+1, y+1, width-2, mSubHeaderHeight-2, QBrush(Dense7Pattern) );
665 QString hstring; 667 QString hstring;
666#ifndef KORG_NOPLUGINS 668#ifndef KORG_NOPLUGINS
667 hstring=KOCore::self()->holiday(qd); 669 hstring=KOCore::self()->holiday(qd);
668#endif 670#endif
669 671
670 if (!hstring.isEmpty()) { 672 if (!hstring.isEmpty()) {
671 p.setFont( QFont( "helvetica", 8, QFont::Bold, true ) ); 673 p.setFont( QFont( "helvetica", 8, QFont::Bold, true ) );
672 674
673 p.drawText( x+5, y, width-25, mSubHeaderHeight, AlignLeft | AlignVCenter, 675 p.drawText( x+5, y, width-25, mSubHeaderHeight, Qt::AlignLeft | Qt::AlignVCenter,
674 hstring ); 676 hstring );
675 } 677 }
676 p.setFont(QFont("helvetica", 10, QFont::Bold)); 678 p.setFont(QFont("helvetica", 10, QFont::Bold));
677 if ( fullDate) { 679 if ( fullDate) {
678 // use short date format, if long date is too long 680 // use short date format, if long date is too long
679 QFontMetrics fm ( p.font() ); 681 QFontMetrics fm ( p.font() );
680 if ( fm.width( dayNumStr ) > width -10 ) 682 if ( fm.width( dayNumStr ) > width -10 )
681 dayNumStr = local->formatDate(qd, true); 683 dayNumStr = local->formatDate(qd, true);
682 } 684 }
683 p.drawText(x+5, y, width-10, mSubHeaderHeight, AlignRight | AlignVCenter, 685 p.drawText(x+5, y, width-10, mSubHeaderHeight, Qt::AlignRight | Qt::AlignVCenter,
684 dayNumStr); 686 dayNumStr);
685 Event::List eventList; 687 Event::List eventList;
686 eventList.fill( mCalendar->events( qd, true )); 688 eventList.fill( mCalendar->events( qd, true ));
687 Todo::List todos; 689 Todo::List todos;
688 todos.fill( mCalendar->todos( qd )); 690 todos.fill( mCalendar->todos( qd ));
689 QString outStr; 691 QString outStr;
690 p.setFont( QFont( "helvetica", 8 ) ); 692 p.setFont( QFont( "helvetica", 8 ) );
691 int lineSpacing = p.fontMetrics().lineSpacing(); 693 int lineSpacing = p.fontMetrics().lineSpacing();
692 694
693 int textY=mSubHeaderHeight+3; // gives the relative y-coord of the next printed entry 695 int textY=mSubHeaderHeight+3; // gives the relative y-coord of the next printed entry
694 Event::List::ConstIterator it; 696 Event::List::ConstIterator it;
695 int entryCount = eventList.count() +todos.count(); 697 int entryCount = eventList.count() +todos.count();
@@ -715,44 +717,44 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd,
715 if ( ! currEvent->location().isEmpty() ) 717 if ( ! currEvent->location().isEmpty() )
716 outStr += " (" + currEvent->location()+")"; 718 outStr += " (" + currEvent->location()+")";
717 } else { 719 } else {
718 QTime t1 = currEvent->dtStart().time(); 720 QTime t1 = currEvent->dtStart().time();
719 721
720 outStr = local->formatTime(t1); 722 outStr = local->formatTime(t1);
721 outStr += " " + currEvent->summary(); 723 outStr += " " + currEvent->summary();
722 } 724 }
723 725
724 } // doesFloat 726 } // doesFloat
725 727
726 p.drawText(x+5, y+textY, width-10, lineSpacing, 728 p.drawText(x+5, y+textY, width-10, lineSpacing,
727 AlignLeft|AlignBottom, outStr); 729 Qt::AlignLeft|Qt::AlignBottom, outStr);
728 textY+=lineSpacing; 730 textY+=lineSpacing;
729 } 731 }
730 732
731 if ( textY<height ) { 733 if ( textY<height ) {
732 734
733 Todo::List::ConstIterator it2; 735 Todo::List::ConstIterator it2;
734 for( it2 = todos.begin(); it2 != todos.end() && textY<height; ++it2 ) { 736 for( it2 = todos.begin(); it2 != todos.end() && textY<height; ++it2 ) {
735 Todo *todo = *it2; 737 Todo *todo = *it2;
736 QString text; 738 QString text;
737 if (todo->hasDueDate()) { 739 if (todo->hasDueDate()) {
738 if (!todo->doesFloat()) { 740 if (!todo->doesFloat()) {
739 text += KGlobal::locale()->formatTime(todo->dtDue().time()); 741 text += KGlobal::locale()->formatTime(todo->dtDue().time());
740 text += " "; 742 text += " ";
741 } 743 }
742 } 744 }
743 text += i18n("To-Do: %1").arg(todo->summary()); 745 text += i18n("To-Do: %1").arg(todo->summary());
744 746
745 p.drawText(x+5, y+textY, width-10, lineSpacing, 747 p.drawText(x+5, y+textY, width-10, lineSpacing,
746 AlignLeft|AlignBottom, text); 748 Qt::AlignLeft|Qt::AlignBottom, text);
747 textY+=lineSpacing; 749 textY+=lineSpacing;
748 } 750 }
749 } 751 }
750} 752}
751 753
752 754
753/////////////////////////////////////////////////////////////////////////////// 755///////////////////////////////////////////////////////////////////////////////
754 756
755void CalPrintBase::drawWeek(QPainter &p, const QDate &qd, 757void CalPrintBase::drawWeek(QPainter &p, const QDate &qd,
756 int x, int y, int width, int height) 758 int x, int y, int width, int height)
757{ 759{
758 QDate weekDate = qd; 760 QDate weekDate = qd;
@@ -840,25 +842,25 @@ void CalPrintBase::drawMonth(QPainter &p, const QDate &qd, bool weeknumbers,
840 int cellHeight = (height-yoffset) / rows; 842 int cellHeight = (height-yoffset) / rows;
841 843
842 if (weeknumbers) { 844 if (weeknumbers) {
843 QFont oldFont(p.font()); 845 QFont oldFont(p.font());
844 QFont newFont(p.font()); 846 QFont newFont(p.font());
845 newFont.setPointSize(7); 847 newFont.setPointSize(7);
846 p.setFont(newFont); 848 p.setFont(newFont);
847 xoffset += 18; 849 xoffset += 18;
848 QDate weekDate(monthDate); 850 QDate weekDate(monthDate);
849 for (int row = 0; row<rows; row++) { 851 for (int row = 0; row<rows; row++) {
850 int calWeek = weekDate.weekNumber(); 852 int calWeek = weekDate.weekNumber();
851 QRect rc(x, y+yoffset+cellHeight*row, xoffset-1, cellHeight); 853 QRect rc(x, y+yoffset+cellHeight*row, xoffset-1, cellHeight);
852 p.drawText( rc, AlignRight|AlignVCenter, QString::number(calWeek) ); 854 p.drawText( rc, Qt::AlignRight|Qt::AlignVCenter, QString::number(calWeek) );
853 weekDate = weekDate.addDays(7); 855 weekDate = weekDate.addDays(7);
854 } 856 }
855 p.setFont(oldFont); 857 p.setFont(oldFont);
856 } 858 }
857 859
858 drawDaysOfWeek( p, monthDate, monthDate.addDays(6), x+xoffset, y, width-xoffset, mSubHeaderHeight ); 860 drawDaysOfWeek( p, monthDate, monthDate.addDays(6), x+xoffset, y, width-xoffset, mSubHeaderHeight );
859 int cellWidth = (width-xoffset) / 7; 861 int cellWidth = (width-xoffset) / 7;
860 862
861 QColor back = p.backgroundColor(); 863 QColor back = p.backgroundColor();
862 bool darkbg = false; 864 bool darkbg = false;
863 for (int row = 0; row < rows; row++) { 865 for (int row = 0; row < rows; row++) {
864 for (int col = 0; col < 7; col++) { 866 for (int col = 0; col < 7; col++) {
@@ -888,145 +890,143 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
888 if ( !completed && item->isCompleted() ) 890 if ( !completed && item->isCompleted() )
889 return; 891 return;
890 QString outStr; 892 QString outStr;
891// int fontHeight = 10; 893// int fontHeight = 10;
892 const KLocale *local = KGlobal::locale(); 894 const KLocale *local = KGlobal::locale();
893 int priority=item->priority(); 895 int priority=item->priority();
894 int posdue=posDueDt; 896 int posdue=posDueDt;
895 if (posdue<0) posdue=x+width; 897 if (posdue<0) posdue=x+width;
896 QRect rect; 898 QRect rect;
897 TodoParentStart startpt; 899 TodoParentStart startpt;
898 // This list keeps all starting points of the parent todos so the connection 900 // This list keeps all starting points of the parent todos so the connection
899 // lines of the tree can easily be drawn (needed if a new page is started) 901 // lines of the tree can easily be drawn (needed if a new page is started)
900 static QPtrList<TodoParentStart> startPoints; 902 static Q3PtrList<TodoParentStart> startPoints;
901 if (level<1) { 903 if (level<1) {
902 startPoints.clear(); 904 startPoints.clear();
903 } 905 }
904 906
905 // size of item 907 // size of item
906 outStr=item->summary(); 908 outStr=item->summary();
907 if ( ! item->location().isEmpty() ) 909 if ( ! item->location().isEmpty() )
908 outStr += " ("+item->location()+")"; 910 outStr += " ("+item->location()+")";
909 if ( item->hasDueDate() && posDueDt>=0 ) { 911 if ( item->hasDueDate() && posDueDt>=0 ) {
910 outStr += " [" +local->formatDate(item->dtDue().date(),true)+"]"; 912 outStr += " [" +local->formatDate(item->dtDue().date(),true)+"]";
911 } 913 }
912 int left = possummary+(level*10); 914 int left = possummary+(level*10);
913 rect = p.boundingRect(left, y, (posdue-left-5),-1, WordBreak, outStr); 915 rect = p.boundingRect(left, y, (posdue-left-5),-1, Qt::WordBreak, outStr);
914 //qDebug("bottom1 %d ", rect.bottom() ); 916 //qDebug("bottom1 %d ", rect.bottom() );
915 if ( !item->description().isEmpty() && desc ) { 917 if ( !item->description().isEmpty() && desc ) {
916 outStr = item->description(); 918 outStr = item->description();
917 rect = p.boundingRect( left+20, rect.bottom()+5, width-(left+10-x), -1, 919 rect = p.boundingRect( left+20, rect.bottom()+5, width-(left+10-x), -1,
918 WordBreak, outStr ); 920 Qt::WordBreak, outStr );
919 } 921 }
920 //qDebug("bottom2 %d y+h %d y %d ph %d", rect.bottom(), y+height, y , pageHeight ); 922 //qDebug("bottom2 %d y+h %d y %d ph %d", rect.bottom(), y+height, y , pageHeight );
921 // if too big make new page 923 // if too big make new page
922 if ( rect.bottom() > y+height) { 924 if ( rect.bottom() > y+height) {
923 // first draw the connection lines from parent todos: 925 // first draw the connection lines from parent todos:
924 if (level > 0 && connectSubTodos) { 926 if (level > 0 && connectSubTodos) {
925 TodoParentStart *rct; 927 TodoParentStart *rct;
926 for ( rct = startPoints.first(); rct; rct = startPoints.next() ) { 928 for ( rct = startPoints.first(); rct; rct = startPoints.next() ) {
927 int start; 929 int start;
928 int center = rct->mRect.left() + (rct->mRect.width()/2); 930 int center = rct->mRect.left() + (rct->mRect.width()/2);
929 int to = p.viewport().bottom(); 931 int to = p.viewport().bottom();
930 932
931 // draw either from start point of parent or from top of the page 933 // draw either from start point of parent or from top of the page
932 if (rct->mSamePage) 934 if (rct->mSamePage)
933 start = rct->mRect.bottom() + 1; 935 start = rct->mRect.bottom() + 1;
934 else 936 else
935 start = p.viewport().top(); 937 start = p.viewport().top();
936 p.moveTo( center, start ); 938 p.drawLine( center, start, center, to );
937 p.lineTo( center, to );
938 rct->mSamePage=false; 939 rct->mSamePage=false;
939 } 940 }
940 } 941 }
941 y=0; 942 y=0;
942 height=pageHeight-y; 943 height=pageHeight-y;
943 mPrinter->newPage(); 944 mPrinter->newPage();
944 } 945 }
945 946
946 // If this is a sub-item, r will not be 0, and we want the LH side of the priority line up 947 // If this is a sub-item, r will not be 0, and we want the LH side of the priority line up
947 //to the RH side of the parent item's priority 948 //to the RH side of the parent item's priority
948 if (r && pospriority >= 0 ) { 949 if (r && pospriority >= 0 ) {
949 pospriority = r->mRect.right() + 1; 950 pospriority = r->mRect.right() + 1;
950 } 951 }
951 952
952 // Priority 953 // Priority
953 outStr.setNum(priority); 954 outStr.setNum(priority);
954 rect = p.boundingRect(pospriority, y + 10, 5, -1, AlignCenter, outStr); 955 rect = p.boundingRect(pospriority, y + 10, 5, -1, Qt::AlignCenter, outStr);
955 // Make it a more reasonable size 956 // Make it a more reasonable size
956 rect.setWidth(19); 957 rect.setWidth(19);
957 rect.setHeight(19); 958 rect.setHeight(19);
958 if ( priority > 0 && pospriority>=0 ) { 959 if ( priority > 0 && pospriority>=0 ) {
959 p.drawText(rect, AlignCenter, outStr); 960 p.drawText(rect, Qt::AlignCenter, outStr);
960 p.drawRect(rect); 961 p.drawRect(rect);
961 // cross out the rectangle for completed items 962 // cross out the rectangle for completed items
962 if ( item->isCompleted() ) { 963 if ( item->isCompleted() ) {
963 p.drawLine( rect.topLeft(), rect.bottomRight() ); 964 p.drawLine( rect.topLeft(), rect.bottomRight() );
964 p.drawLine( rect.topRight(), rect.bottomLeft() ); 965 p.drawLine( rect.topRight(), rect.bottomLeft() );
965 } else if (item->cancelled() ) { 966 } else if (item->cancelled() ) {
966 QPen pen = p.pen(); 967 QPen pen = p.pen();
967 p.setPen ( QPen ( black, 2) ); 968 p.setPen ( QPen ( Qt::black, 2) );
968 p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 ); 969 p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 );
969 p.setPen( pen ); 970 p.setPen( pen );
970 } 971 }
971 } 972 }
972 startpt.mRect = rect; //save for later 973 startpt.mRect = rect; //save for later
973 974
974 // Connect the dots 975 // Connect the dots
975 if (level > 0 && connectSubTodos) { 976 if (level > 0 && connectSubTodos) {
976 int bottom; 977 int bottom;
977 int center( r->mRect.left() + (r->mRect.width()/2)+1 ); 978 int center( r->mRect.left() + (r->mRect.width()/2)+1 );
978 if (r->mSamePage ) 979 if (r->mSamePage )
979 bottom = r->mRect.bottom();//lutz + 1; 980 bottom = r->mRect.bottom();//lutz + 1;
980 else 981 else
981 bottom = 0; 982 bottom = 0;
982 int to( rect.top() + (rect.height()/2)+1 ); 983 int to( rect.top() + (rect.height()/2)+1 );
983 int endx( rect.left() ); 984 int endx( rect.left() );
984 p.moveTo(center, bottom); 985 p.drawLine(center,bottom, center,to);
985 p.lineTo(center, to); 986 p.drawLine(center,to, endx,to);
986 p.lineTo(endx, to);
987 } 987 }
988 988
989 // if completed, use strike out font 989 // if completed, use strike out font
990 // LR does not work - font is underlined, not striked out 990 // LR does not work - font is underlined, not striked out
991 //QFont ft=p.font(); 991 //QFont ft=p.font();
992 //ft.setStrikeOut( item->isCompleted() ); 992 //ft.setStrikeOut( item->isCompleted() );
993 //p.setFont( ft ); 993 //p.setFont( ft );
994 // summary 994 // summary
995 outStr=item->summary(); 995 outStr=item->summary();
996 if ( ! item->location().isEmpty() ) 996 if ( ! item->location().isEmpty() )
997 outStr += " ("+item->location()+")"; 997 outStr += " ("+item->location()+")";
998 if ( item->hasDueDate() && posDueDt>=0 ) { 998 if ( item->hasDueDate() && posDueDt>=0 ) {
999 outStr += " [" +item->dtDueStr(true)+"]"; 999 outStr += " [" +item->dtDueStr(true)+"]";
1000 } 1000 }
1001 rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)), 1001 rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)),
1002 -1, WordBreak, outStr); 1002 -1, Qt::WordBreak, outStr);
1003 QRect newrect; 1003 QRect newrect;
1004 p.drawText( rect, WordBreak, outStr, -1, &newrect ); 1004 p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect );
1005 //ft.setStrikeOut(false); 1005 //ft.setStrikeOut(false);
1006 // p.setFont(ft); 1006 // p.setFont(ft);
1007 1007
1008 // due 1008 // due
1009 // if ( item->hasDueDate() && posDueDt>=0 ) { 1009 // if ( item->hasDueDate() && posDueDt>=0 ) {
1010// outStr = local->formatDate(item->dtDue().date(),true); 1010// outStr = local->formatDate(item->dtDue().date(),true);
1011// rect = p.boundingRect(posdue, y, x+width, -1, AlignTop|AlignLeft, outStr); 1011// rect = p.boundingRect(posdue, y, x+width, -1, AlignTop|AlignLeft, outStr);
1012// p.drawText(rect, AlignTop|AlignLeft, outStr); 1012// p.drawText(rect, AlignTop|AlignLeft, outStr);
1013// } 1013// }
1014 1014
1015 if ( !item->description().isEmpty() && desc ) { 1015 if ( !item->description().isEmpty() && desc ) {
1016 y=newrect.bottom() + 5; 1016 y=newrect.bottom() + 5;
1017 outStr = item->description(); 1017 outStr = item->description();
1018 rect = p.boundingRect( left+20, y, x+width-(left+10), -1, 1018 rect = p.boundingRect( left+20, y, x+width-(left+10), -1,
1019 WordBreak, outStr ); 1019 Qt::WordBreak, outStr );
1020 p.drawText( rect, WordBreak, outStr, -1, &newrect ); 1020 p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect );
1021 } 1021 }
1022 1022
1023 // Set the new line position 1023 // Set the new line position
1024 y=newrect.bottom() + 10; //set the line position 1024 y=newrect.bottom() + 10; //set the line position
1025 1025
1026 // If the item has subitems, we need to call ourselves recursively 1026 // If the item has subitems, we need to call ourselves recursively
1027 Incidence::List l;l.fill( item->relations()); 1027 Incidence::List l;l.fill( item->relations());
1028 Incidence::List::ConstIterator it; 1028 Incidence::List::ConstIterator it;
1029 startPoints.append( &startpt ); 1029 startPoints.append( &startpt );
1030 for( it = l.begin(); it != l.end(); ++it ) { 1030 for( it = l.begin(); it != l.end(); ++it ) {
1031 count++; 1031 count++;
1032 drawTodo( completed, count, static_cast<Todo *>( *it ), p, connectSubTodos, 1032 drawTodo( completed, count, static_cast<Todo *>( *it ), p, connectSubTodos,
@@ -1129,58 +1129,58 @@ void CalPrintBase::drawSplitWeek( QPainter &p, const QDate &fd,
1129 1129
1130} 1130}
1131 1131
1132void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, 1132void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd,
1133 const QDate &td, 1133 const QDate &td,
1134 const QDate &, 1134 const QDate &,
1135 int width, int ) 1135 int width, int )
1136{ 1136{
1137 int tempStore = mSubHeaderHeight; 1137 int tempStore = mSubHeaderHeight;
1138 mSubHeaderHeight+= mSubHeaderHeight; 1138 mSubHeaderHeight+= mSubHeaderHeight;
1139 KLocale *local = KGlobal::locale(); 1139 KLocale *local = KGlobal::locale();
1140 QFont font("helvetica", 18, QFont::Bold); 1140 QFont font("helvetica", 18, QFont::Bold);
1141 QPen penA( black,0); 1141 QPen penA( Qt::black,0);
1142 QPen penB( black,3); 1142 QPen penB( Qt::black,3);
1143 p.setFont(font); 1143 p.setFont(font);
1144 int lineSpacing = p.fontMetrics().lineSpacing(); 1144 int lineSpacing = p.fontMetrics().lineSpacing();
1145 QString title; 1145 QString title;
1146 QString myOwner(mCalendar->getOwner()); 1146 QString myOwner(mCalendar->getOwner());
1147 if ( fd.month() == td.month() ) { 1147 if ( fd.month() == td.month() ) {
1148 title = local->monthName(fd.month(), false) + ' ' + QString::number(fd.day()) + ' ' 1148 title = local->monthName(fd.month(), false) + ' ' + QString::number(fd.day()) + ' '
1149 + '-' + ' ' + QString::number(td.day()); 1149 + '-' + ' ' + QString::number(td.day());
1150 } else { 1150 } else {
1151 title = local->monthName(fd.month(), false) + ' ' + QString::number(fd.day()) + ' ' 1151 title = local->monthName(fd.month(), false) + ' ' + QString::number(fd.day()) + ' '
1152 + '-' + ' ' + local->monthName(td.month(), false) + ' ' + QString::number(td.day()); 1152 + '-' + ' ' + local->monthName(td.month(), false) + ' ' + QString::number(td.day());
1153 } 1153 }
1154 1154
1155// Grrrrrrr! why can't I set the font to a serif font?!?!? 1155// Grrrrrrr! why can't I set the font to a serif font?!?!?
1156 QFont serifFont("Helvetica", 30); 1156 QFont serifFont("Helvetica", 30);
1157// serifFont.setFamily("Serif"); 1157// serifFont.setFamily("Serif");
1158// serifFont.setWeight(87); 1158// serifFont.setWeight(87);
1159// serifFont.setItalic(true); 1159// serifFont.setItalic(true);
1160 p.setFont(serifFont); 1160 p.setFont(serifFont);
1161 QFontInfo info(p.font()); 1161 QFontInfo info(p.font());
1162 1162
1163 lineSpacing = p.fontMetrics().lineSpacing(); 1163 lineSpacing = p.fontMetrics().lineSpacing();
1164 p.drawText(0, lineSpacing * 0, width, lineSpacing, AlignRight |AlignTop, title ); 1164 p.drawText(0, lineSpacing * 0, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title );
1165 1165
1166 title.truncate(0); 1166 title.truncate(0);
1167 1167
1168 p.setPen(penB ); 1168 p.setPen(penB );
1169 p.drawLine(200, lineSpacing * 1, width, lineSpacing * 1); 1169 p.drawLine(200, lineSpacing * 1, width, lineSpacing * 1);
1170 p.setPen(penA ); 1170 p.setPen(penA );
1171 1171
1172 p.setFont(QFont("Helvetica", 20, QFont::Bold, TRUE)); 1172 p.setFont(QFont("Helvetica", 20, QFont::Bold, TRUE));
1173 title += QString::number(fd.year()); 1173 title += QString::number(fd.year());
1174 p.drawText(0, lineSpacing * 1, width, lineSpacing, AlignRight |AlignTop, title ); 1174 p.drawText(0, lineSpacing * 1, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title );
1175 mSubHeaderHeight = tempStore ; 1175 mSubHeaderHeight = tempStore ;
1176} 1176}
1177 1177
1178void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width, 1178void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width,
1179 int height, int offsetLeft ) 1179 int height, int offsetLeft )
1180{ 1180{
1181 int tempStore = mSubHeaderHeight; 1181 int tempStore = mSubHeaderHeight;
1182 mSubHeaderHeight+= mSubHeaderHeight; 1182 mSubHeaderHeight+= mSubHeaderHeight;
1183 int startHour = KOPrefs::instance()->mDayBegins; 1183 int startHour = KOPrefs::instance()->mDayBegins;
1184 int endHour = 20; 1184 int endHour = 20;
1185 int offset = mHeaderHeight + mSubHeaderHeight + 10; 1185 int offset = mHeaderHeight + mSubHeaderHeight + 10;
1186 Event::List eventList; eventList.fill( mCalendar->events( qd, true )); 1186 Event::List eventList; eventList.fill( mCalendar->events( qd, true ));
@@ -1188,25 +1188,25 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width,
1188 Event *currEvent; 1188 Event *currEvent;
1189 KLocale *local = KGlobal::locale(); 1189 KLocale *local = KGlobal::locale();
1190 QString dayName; 1190 QString dayName;
1191 1191
1192 dayName = local->weekDayName(qd.dayOfWeek()) + ' ' + ' ' + QString::number(qd.day()); 1192 dayName = local->weekDayName(qd.dayOfWeek()) + ' ' + ' ' + QString::number(qd.day());
1193 //p.setBrush(QBrush(black)); 1193 //p.setBrush(QBrush(black));
1194// width+1 to make sure there's a continuous, black bar across the top. 1194// width+1 to make sure there's a continuous, black bar across the top.
1195 p.setPen( QPen(Qt::black,2)); 1195 p.setPen( QPen(Qt::black,2));
1196 p.drawRect(offsetLeft, mHeaderHeight + 5, width +1, mSubHeaderHeight); 1196 p.drawRect(offsetLeft, mHeaderHeight + 5, width +1, mSubHeaderHeight);
1197 p.setPen( Qt::black); 1197 p.setPen( Qt::black);
1198 p.setFont(QFont("helvetica", 12, QFont::Bold, true)); 1198 p.setFont(QFont("helvetica", 12, QFont::Bold, true));
1199 p.drawText(offsetLeft, mHeaderHeight + 5, 1199 p.drawText(offsetLeft, mHeaderHeight + 5,
1200 width, mSubHeaderHeight, AlignHCenter | AlignVCenter, 1200 width, mSubHeaderHeight, Qt::AlignHCenter | Qt::AlignVCenter,
1201 dayName); 1201 dayName);
1202 1202
1203 p.setPen( QPen(Qt::black,2)); 1203 p.setPen( QPen(Qt::black,2));
1204 p.setFont(QFont("helvetica", 12)); 1204 p.setFont(QFont("helvetica", 12));
1205 p.setBrush(Qt::white); 1205 p.setBrush(Qt::white);
1206 it = eventList.begin(); 1206 it = eventList.begin();
1207 int allDays = 0; 1207 int allDays = 0;
1208 /* 1208 /*
1209 while( it != eventList.end() ) { 1209 while( it != eventList.end() ) {
1210 Event *currEvent = *it; 1210 Event *currEvent = *it;
1211 if ( currEvent->doesFloat() ) { 1211 if ( currEvent->doesFloat() ) {
1212 p.drawRect( offsetLeft, offset, width, 35 ); 1212 p.drawRect( offsetLeft, offset, width, 35 );
@@ -1245,62 +1245,62 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width,
1245 startTime -= startHour; 1245 startTime -= startHour;
1246 int startMinuteOff = (int) (minuteInc * 1246 int startMinuteOff = (int) (minuteInc *
1247 currEvent->dtStart().time().minute()); 1247 currEvent->dtStart().time().minute());
1248 QString text = currEvent->summary() ; 1248 QString text = currEvent->summary() ;
1249 if ( ! currEvent->location().isEmpty() ) 1249 if ( ! currEvent->location().isEmpty() )
1250 text += "\n("+currEvent->location()+")"; 1250 text += "\n("+currEvent->location()+")";
1251 int endMinuteOff = (int) (minuteInc * currEvent->dtEnd().time().minute()); 1251 int endMinuteOff = (int) (minuteInc * currEvent->dtEnd().time().minute());
1252 int cheight = (int) (minuteInc * 1252 int cheight = (int) (minuteInc *
1253 currEvent->dtStart().secsTo(currEvent->dtEnd()) / 60 ); 1253 currEvent->dtStart().secsTo(currEvent->dtEnd()) / 60 );
1254 p.drawRect(offsetLeft+2, 1+offset+startMinuteOff+startTime*cellHeight, 1254 p.drawRect(offsetLeft+2, 1+offset+startMinuteOff+startTime*cellHeight,
1255 width-4, cheight); 1255 width-4, cheight);
1256 p.drawText(offsetLeft+12, offset+startMinuteOff+startTime*cellHeight+5, width-24, 1256 p.drawText(offsetLeft+12, offset+startMinuteOff+startTime*cellHeight+5, width-24,
1257 cheight-10, AlignHCenter | AlignTop, text); 1257 cheight-10, Qt::AlignHCenter | Qt::AlignTop, text);
1258 } 1258 }
1259 } 1259 }
1260 p.setBrush(QBrush(NoBrush)); 1260 p.setBrush(QBrush(Qt::NoBrush));
1261 mSubHeaderHeight = tempStore ; 1261 mSubHeaderHeight = tempStore ;
1262} 1262}
1263 1263
1264void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth, 1264void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth,
1265 int height ) 1265 int height )
1266{ 1266{
1267 int tempStore = mSubHeaderHeight; 1267 int tempStore = mSubHeaderHeight;
1268 mSubHeaderHeight+= mSubHeaderHeight; 1268 mSubHeaderHeight+= mSubHeaderHeight;
1269 int startHour = KOPrefs::instance()->mDayBegins; 1269 int startHour = KOPrefs::instance()->mDayBegins;
1270 int endHour = 20; 1270 int endHour = 20;
1271 int offset = mHeaderHeight + mSubHeaderHeight + 10; 1271 int offset = mHeaderHeight + mSubHeaderHeight + 10;
1272 int hours = endHour - startHour; 1272 int hours = endHour - startHour;
1273 int cellHeight = (height-offset) / hours; // hour increments. 1273 int cellHeight = (height-offset) / hours; // hour increments.
1274 1274
1275 QString numStr; 1275 QString numStr;
1276 for (int i = 0; i < hours; i++) { 1276 for (int i = 0; i < hours; i++) {
1277 p.setPen(QPen(black,1)); 1277 p.setPen(QPen(Qt::black,1));
1278 p.drawLine(0, offset+i*cellHeight, width, offset+i*cellHeight); 1278 p.drawLine(0, offset+i*cellHeight, width, offset+i*cellHeight);
1279 p.setPen(QPen(gray,0)); 1279 p.setPen(QPen(Qt::gray,0));
1280 p.drawLine(37, offset+i*cellHeight+(cellHeight/2), 1280 p.drawLine(37, offset+i*cellHeight+(cellHeight/2),
1281 width, offset+i*cellHeight+(cellHeight/2)); 1281 width, offset+i*cellHeight+(cellHeight/2));
1282 p.setPen(QPen(black,0)); 1282 p.setPen(QPen(Qt::black,0));
1283 1283
1284 if ( !KGlobal::locale()->use12Clock() ) { 1284 if ( !KGlobal::locale()->use12Clock() ) {
1285 numStr.setNum(i+startHour); 1285 numStr.setNum(i+startHour);
1286 if (cellHeight > 40) { 1286 if (cellHeight > 40) {
1287 p.setFont(QFont("helvetica", 16, QFont::Bold)); 1287 p.setFont(QFont("helvetica", 16, QFont::Bold));
1288 } else { 1288 } else {
1289 p.setFont(QFont("helvetica", 14, QFont::Bold)); 1289 p.setFont(QFont("helvetica", 14, QFont::Bold));
1290 } 1290 }
1291 p.drawText(0, offset+i*cellHeight, 33, cellHeight/2, 1291 p.drawText(0, offset+i*cellHeight, 33, cellHeight/2,
1292 AlignTop|AlignRight, numStr); 1292 Qt::AlignTop|Qt::AlignRight, numStr);
1293 p.setFont(QFont("helvetica", 12, QFont::Bold)); 1293 p.setFont(QFont("helvetica", 12, QFont::Bold));
1294 p.drawText(37, offset+i*cellHeight, 45, cellHeight/2, 1294 p.drawText(37, offset+i*cellHeight, 45, cellHeight/2,
1295 AlignTop | AlignLeft, "00"); 1295 Qt::AlignTop | Qt::AlignLeft, "00");
1296 } else { 1296 } else {
1297 QTime time( i + startHour, 0 ); 1297 QTime time( i + startHour, 0 );
1298 numStr = KGlobal::locale()->formatTime( time ); 1298 numStr = KGlobal::locale()->formatTime( time );
1299 p.setFont(QFont("helvetica", 12, QFont::Bold)); 1299 p.setFont(QFont("helvetica", 12, QFont::Bold));
1300 p.drawText(4, offset+i*cellHeight, 70, cellHeight/2, 1300 p.drawText(4, offset+i*cellHeight, 70, cellHeight/2,
1301 AlignTop|AlignLeft, numStr); 1301 Qt::AlignTop|Qt::AlignLeft, numStr);
1302 } 1302 }
1303 } mSubHeaderHeight = tempStore ; 1303 } mSubHeaderHeight = tempStore ;
1304} 1304}
1305 1305
1306#endif 1306#endif
diff --git a/korganizer/calprinter.cpp b/korganizer/calprinter.cpp
index 0cdf28e..d4bf988 100644
--- a/korganizer/calprinter.cpp
+++ b/korganizer/calprinter.cpp
@@ -12,33 +12,36 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qvbuttongroup.h> 24// #include <qvbuttongroup.h>
25#include <qwidgetstack.h> 25#include <q3widgetstack.h>
26#include <qradiobutton.h> 26#include <qradiobutton.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qcombobox.h> 29#include <qcombobox.h>
30#include <qlabel.h> 30#include <qlabel.h>
31#include <qvbox.h> 31#include <q3vbox.h>
32#include <qsplitter.h> 32#include <qsplitter.h>
33//Added by qt3to4:
34#include <Q3GridLayout>
35#include <Q3PtrList>
33 36
34#include <kprinter.h> 37#include <kprinter.h>
35#include <kglobal.h> 38#include <kglobal.h>
36#include <ksimpleconfig.h> 39#include <ksimpleconfig.h>
37#include <kmessagebox.h> 40#include <kmessagebox.h>
38#include <kdebug.h> 41#include <kdebug.h>
39//#include <kdeversion.h> 42//#include <kdeversion.h>
40 43
41#include "koprefsdialog.h" 44#include "koprefsdialog.h"
42 45
43#include "calprinter.h" 46#include "calprinter.h"
44#ifndef KORG_NOPRINTER 47#ifndef KORG_NOPRINTER
@@ -165,55 +168,55 @@ void CalPrinter::doPrint( CalPrintBase *selectedStyle, bool preview )
165 //mPrinter->setPreviewOnly( false ); 168 //mPrinter->setPreviewOnly( false );
166} 169}
167 170
168/////////////////////////////////////////////////////////////////////////////// 171///////////////////////////////////////////////////////////////////////////////
169 172
170void CalPrinter::updateConfig() 173void CalPrinter::updateConfig()
171{ 174{
172} 175}
173 176
174 177
175/****************************************************************************/ 178/****************************************************************************/
176 179
177CalPrintDialog::CalPrintDialog( QPtrList<CalPrintBase> plugins, KPrinter *p, 180CalPrintDialog::CalPrintDialog( Q3PtrList<CalPrintBase> plugins, KPrinter *p,
178 QWidget *parent, const char *name ) 181 QWidget *parent, const char *name )
179 : KDialogBase( parent, name, /*modal*/true, i18n("Print"), Ok | Cancel ), 182 : KDialogBase( parent, name, /*modal*/true, i18n("Print"), Ok | Cancel ),
180 mPrinter( p ), mPrintPlugins( plugins ) 183 mPrinter( p ), mPrintPlugins( plugins )
181{ 184{
182 QVBox *page = new QVBox(this);//makeVBoxMainWidget(); 185 Q3VBox *page = new Q3VBox(this);//makeVBoxMainWidget();
183 setMainWidget( page ); 186 setMainWidget( page );
184 QHBox *printerLayout = new QHBox( page ); 187 Q3HBox *printerLayout = new Q3HBox( page );
185 188
186 mPrinterLabel = new QLabel( printerLayout ); 189 mPrinterLabel = new QLabel( printerLayout );
187 QPushButton *setupButton = new QPushButton( i18n("&Setup Printer..."), 190 QPushButton *setupButton = new QPushButton( i18n("&Setup Printer..."),
188 printerLayout ); 191 printerLayout );
189 setupButton->setSizePolicy( QSizePolicy( 192 setupButton->setSizePolicy( QSizePolicy(
190 (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)0, 193 (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)0,
191 0, 0, setupButton->sizePolicy().hasHeightForWidth() ) ); 194 0, 0, setupButton->sizePolicy().hasHeightForWidth() ) );
192 195
193 QSplitter *splitter = new QSplitter( page ); 196 QSplitter *splitter = new QSplitter( page );
194 splitter->setOrientation( QSplitter::Horizontal ); 197 splitter->setOrientation( Qt::Horizontal );
195 198
196 mTypeGroup = new QVButtonGroup( i18n("View Type"), splitter, "buttonGroup" ); 199 mTypeGroup = new Q3VButtonGroup( i18n("View Type"), splitter, "buttonGroup" );
197 // use the minimal width possible = max width of the radio buttons, not extensible 200 // use the minimal width possible = max width of the radio buttons, not extensible
198/* mTypeGroup->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, 201/* mTypeGroup->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4,
199 (QSizePolicy::SizeType)5, 0, 0, 202 (QSizePolicy::SizeType)5, 0, 0,
200 mTypeGroup->sizePolicy().hasHeightForWidth() ) );*/ 203 mTypeGroup->sizePolicy().hasHeightForWidth() ) );*/
201 204
202 QWidget *splitterRight = new QWidget( splitter, "splitterRight" ); 205 QWidget *splitterRight = new QWidget( splitter, "splitterRight" );
203 QGridLayout *splitterRightLayout = new QGridLayout( splitterRight ); 206 Q3GridLayout *splitterRightLayout = new Q3GridLayout( splitterRight );
204 splitterRightLayout->setMargin( marginHint() ); 207 splitterRightLayout->setMargin( marginHint() );
205 splitterRightLayout->setSpacing( spacingHint() ); 208 splitterRightLayout->setSpacing( spacingHint() );
206 209
207 mConfigArea = new QWidgetStack( splitterRight, "configWidgetStack" ); 210 mConfigArea = new Q3WidgetStack( splitterRight, "configWidgetStack" );
208 splitterRightLayout->addMultiCellWidget( mConfigArea, 0,0, 0,1 ); 211 splitterRightLayout->addMultiCellWidget( mConfigArea, 0,0, 0,1 );
209 212
210 QLabel *orientationLabel = new QLabel( i18n("Page &orientation:"), 213 QLabel *orientationLabel = new QLabel( i18n("Page &orientation:"),
211 splitterRight, "orientationLabel" ); 214 splitterRight, "orientationLabel" );
212 splitterRightLayout->addWidget( orientationLabel, 1, 0 ); 215 splitterRightLayout->addWidget( orientationLabel, 1, 0 );
213 216
214 mOrientationSelection = new QComboBox( splitterRight, "orientationCombo" ); 217 mOrientationSelection = new QComboBox( splitterRight, "orientationCombo" );
215 mOrientationSelection->insertItem( i18n("Use Default of Selected Style") ); 218 mOrientationSelection->insertItem( i18n("Use Default of Selected Style") );
216 mOrientationSelection->insertItem( i18n("Use Default Setting of Printer") ); 219 mOrientationSelection->insertItem( i18n("Use Default Setting of Printer") );
217 mOrientationSelection->insertItem( i18n("Portrait") ); 220 mOrientationSelection->insertItem( i18n("Portrait") );
218 mOrientationSelection->insertItem( i18n("Landscape") ); 221 mOrientationSelection->insertItem( i18n("Landscape") );
219 splitterRightLayout->addWidget( mOrientationSelection, 1, 1 ); 222 splitterRightLayout->addWidget( mOrientationSelection, 1, 1 );
diff --git a/korganizer/calprinter.h b/korganizer/calprinter.h
index 7b58f4f..e065779 100644
--- a/korganizer/calprinter.h
+++ b/korganizer/calprinter.h
@@ -1,12 +1,14 @@
1//Added by qt3to4:
2#include <QLabel>
1/* 3/*
2 This file is part of KOrganizer. 4 This file is part of KOrganizer.
3 5
4 Copyright (c) 1998 Preston Brown 6 Copyright (c) 1998 Preston Brown
5 7
6 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 10 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 11 (at your option) any later version.
10 12
11 This program is distributed in the hope that it will be useful, 13 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,36 +21,36 @@
19 21
20 As a special exception, permission is given to link this program 22 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 23 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 24 without including the source code for Qt in the source distribution.
23*/ 25*/
24#ifndef _CALPRINTER_H 26#ifndef _CALPRINTER_H
25#define _CALPRINTER_H 27#define _CALPRINTER_H
26 28
27// #define KORG_NOPRINTER 29// #define KORG_NOPRINTER
28 30
29#ifndef KORG_NOPRINTER 31#ifndef KORG_NOPRINTER
30 32
31#include <qptrlist.h> 33#include <q3ptrlist.h>
32 34
33#include <kdialogbase.h> 35#include <kdialogbase.h>
34 36
35#include <korganizer/baseview.h> 37#include <korganizer/baseview.h>
36 38
37#include "calprintbase.h" 39#include "calprintbase.h"
38 40
39using namespace KCal; 41using namespace KCal;
40 42
41class QVButtonGroup; 43class Q3VButtonGroup;
42class QWidgetStack; 44class Q3WidgetStack;
43class KPrinter; 45class KPrinter;
44class CalPrintDialog; 46class CalPrintDialog;
45class KConfig; 47class KConfig;
46class QComboBox; 48class QComboBox;
47class QLabel; 49class QLabel;
48 50
49 51
50/** 52/**
51 CalPrinter is a class for printing Calendars. It can print in several 53 CalPrinter is a class for printing Calendars. It can print in several
52 different formats (day, week, month). It also provides a way for setting 54 different formats (day, week, month). It also provides a way for setting
53 up the printer and remembering these preferences. 55 up the printer and remembering these preferences.
54*/ 56*/
@@ -85,58 +87,58 @@ class CalPrinter : public QObject, public KOrg::CalPrinterBase
85 87
86 public slots: 88 public slots:
87 void updateConfig(); 89 void updateConfig();
88 90
89 private slots: 91 private slots:
90 void doPrint( CalPrintBase *selectedStyle, bool preview ); 92 void doPrint( CalPrintBase *selectedStyle, bool preview );
91 93
92 public: 94 public:
93 void preview( PrintType type, const QDate &fd, const QDate &td ); 95 void preview( PrintType type, const QDate &fd, const QDate &td );
94 void print( PrintType type, const QDate &fd, const QDate &td ); 96 void print( PrintType type, const QDate &fd, const QDate &td );
95 97
96 protected: 98 protected:
97 QPtrList<CalPrintBase> mPrintPlugins; 99 Q3PtrList<CalPrintBase> mPrintPlugins;
98 100
99 private: 101 private:
100 KPrinter *mPrinter; 102 KPrinter *mPrinter;
101 Calendar *mCalendar; 103 Calendar *mCalendar;
102 QWidget *mParent; 104 QWidget *mParent;
103 KConfig *mConfig; 105 KConfig *mConfig;
104 106
105 CalPrintDialog *mPrintDialog; 107 CalPrintDialog *mPrintDialog;
106}; 108};
107 109
108class CalPrintDialog : public KDialogBase 110class CalPrintDialog : public KDialogBase
109{ 111{
110 Q_OBJECT 112 Q_OBJECT
111 public: 113 public:
112 CalPrintDialog( QPtrList<CalPrintBase> plugins, KPrinter *p, 114 CalPrintDialog( Q3PtrList<CalPrintBase> plugins, KPrinter *p,
113 QWidget *parent = 0, const char *name = 0 ); 115 QWidget *parent = 0, const char *name = 0 );
114 virtual ~CalPrintDialog(); 116 virtual ~CalPrintDialog();
115 CalPrintBase *selectedPlugin(); 117 CalPrintBase *selectedPlugin();
116 CalPrinter::ePrintOrientation orientation() { return mOrientation; } 118 CalPrinter::ePrintOrientation orientation() { return mOrientation; }
117 119
118 public slots: 120 public slots:
119 void setPrintType( int ); 121 void setPrintType( int );
120 void setPreview( bool ); 122 void setPreview( bool );
121 123
122 protected slots: 124 protected slots:
123 void slotOk(); 125 void slotOk();
124 void setupPrinter(); 126 void setupPrinter();
125 void setPrinterLabel(); 127 void setPrinterLabel();
126signals: 128signals:
127 void okClicked(); 129 void okClicked();
128 private: 130 private:
129 KPrinter *mPrinter; 131 KPrinter *mPrinter;
130 QVButtonGroup *mTypeGroup; 132 Q3VButtonGroup *mTypeGroup;
131 QWidgetStack *mConfigArea; 133 Q3WidgetStack *mConfigArea;
132 QPtrList<CalPrintBase> mPrintPlugins; 134 Q3PtrList<CalPrintBase> mPrintPlugins;
133 QLabel *mPrinterLabel; 135 QLabel *mPrinterLabel;
134 QString mPreviewText; 136 QString mPreviewText;
135 QComboBox *mOrientationSelection; 137 QComboBox *mOrientationSelection;
136 138
137 CalPrinter::ePrintOrientation mOrientation; 139 CalPrinter::ePrintOrientation mOrientation;
138}; 140};
139 141
140#endif 142#endif
141 143
142#endif 144#endif
diff --git a/korganizer/calprintplugins.cpp b/korganizer/calprintplugins.cpp
index bc35ca4..9b6dc6e 100644
--- a/korganizer/calprintplugins.cpp
+++ b/korganizer/calprintplugins.cpp
@@ -16,29 +16,29 @@
16 GNU General Public License for more details. 16 GNU General Public License for more details.
17 17
18 You should have received a copy of the GNU General Public License 18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software 19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 21
22 As a special exception, permission is given to link this program 22 As a special exception, permission is given to link this program
23 with any edition of Qt, and distribute the resulting executable, 23 with any edition of Qt, and distribute the resulting executable,
24 without including the source code for Qt in the source distribution. 24 without including the source code for Qt in the source distribution.
25*/ 25*/
26 26
27#include <qpainter.h> 27#include <qpainter.h>
28#include <qdatetimeedit.h> 28#include <q3datetimeedit.h>
29#include <qdatetime.h> 29#include <qdatetime.h>
30#include <qcheckbox.h> 30#include <qcheckbox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qbuttongroup.h> 32#include <q3buttongroup.h>
33 33
34#include <kglobal.h> 34#include <kglobal.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kdebug.h> 36#include <kdebug.h>
37#include <kprinter.h> 37#include <kprinter.h>
38#include <kconfig.h> 38#include <kconfig.h>
39#include <kcalendarsystem.h> 39#include <kcalendarsystem.h>
40 40
41#include <libkcal/todo.h> 41#include <libkcal/todo.h>
42#include <libkcal/calendar.h> 42#include <libkcal/calendar.h>
43 43
44#include <libkdepim/kdateedit.h> 44#include <libkdepim/kdateedit.h>
diff --git a/korganizer/cellitem.cpp b/korganizer/cellitem.cpp
index 61d06ac..1fd703c 100644
--- a/korganizer/cellitem.cpp
+++ b/korganizer/cellitem.cpp
@@ -18,44 +18,46 @@
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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 "cellitem.h" 25#include "cellitem.h"
26 26
27#include <klocale.h> 27#include <klocale.h>
28#include <kdebug.h> 28#include <kdebug.h>
29 29
30#include <qintdict.h> 30#include <q3intdict.h>
31//Added by qt3to4:
32#include <Q3PtrList>
31 33
32using namespace KOrg; 34using namespace KOrg;
33 35
34QString CellItem::label() const 36QString CellItem::label() const
35{ 37{
36 return i18n("<undefined>"); 38 return i18n("<undefined>");
37} 39}
38 40
39QPtrList<CellItem> CellItem::placeItem( QPtrList<CellItem> cells, 41Q3PtrList<CellItem> CellItem::placeItem( Q3PtrList<CellItem> cells,
40 CellItem *placeItem ) 42 CellItem *placeItem )
41{ 43{
42 kdDebug(5855) << "Placing " << placeItem->label() << endl; 44 kdDebug(5855) << "Placing " << placeItem->label() << endl;
43 45
44 QPtrList<KOrg::CellItem> conflictItems; 46 Q3PtrList<KOrg::CellItem> conflictItems;
45 int maxSubCells = 0; 47 int maxSubCells = 0;
46 QIntDict<KOrg::CellItem> subCellDict; 48 Q3IntDict<KOrg::CellItem> subCellDict;
47 49
48 // Find all items which are in same cell 50 // Find all items which are in same cell
49 QPtrListIterator<KOrg::CellItem> it2( cells ); 51 Q3PtrListIterator<KOrg::CellItem> it2( cells );
50 for( it2.toFirst(); it2.current(); ++it2 ) { 52 for( it2.toFirst(); it2.current(); ++it2 ) {
51 KOrg::CellItem *item = it2.current(); 53 KOrg::CellItem *item = it2.current();
52 if ( item == placeItem ) continue; 54 if ( item == placeItem ) continue;
53 55
54 if ( item->overlaps( placeItem ) ) { 56 if ( item->overlaps( placeItem ) ) {
55 kdDebug(5855) << " Overlaps: " << item->label() << endl; 57 kdDebug(5855) << " Overlaps: " << item->label() << endl;
56 58
57 conflictItems.append( item ); 59 conflictItems.append( item );
58 if ( item->subCells() > maxSubCells ) maxSubCells = item->subCells(); 60 if ( item->subCells() > maxSubCells ) maxSubCells = item->subCells();
59 subCellDict.insert( item->subCell(), item ); 61 subCellDict.insert( item->subCell(), item );
60 } 62 }
61 } 63 }
@@ -74,25 +76,25 @@ QPtrList<CellItem> CellItem::placeItem( QPtrList<CellItem> cells,
74 if ( i == maxSubCells ) { 76 if ( i == maxSubCells ) {
75 kdDebug(5855) << " New subcell " << i << endl; 77 kdDebug(5855) << " New subcell " << i << endl;
76 placeItem->setSubCell( maxSubCells ); 78 placeItem->setSubCell( maxSubCells );
77 maxSubCells++; // add new item to number of sub cells 79 maxSubCells++; // add new item to number of sub cells
78 } 80 }
79 81
80 kdDebug(5855) << " Sub cells: " << maxSubCells << endl; 82 kdDebug(5855) << " Sub cells: " << maxSubCells << endl;
81 83
82 // Write results to item to be placed 84 // Write results to item to be placed
83 conflictItems.append( placeItem ); 85 conflictItems.append( placeItem );
84 placeItem->setSubCells( maxSubCells ); 86 placeItem->setSubCells( maxSubCells );
85 87
86 QPtrListIterator<KOrg::CellItem> it3( conflictItems ); 88 Q3PtrListIterator<KOrg::CellItem> it3( conflictItems );
87 for( it3.toFirst(); it3.current(); ++it3 ) { 89 for( it3.toFirst(); it3.current(); ++it3 ) {
88 (*it3)->setSubCells( maxSubCells ); 90 (*it3)->setSubCells( maxSubCells );
89 } 91 }
90 // Todo: Adapt subCells of items conflicting with conflicting items 92 // Todo: Adapt subCells of items conflicting with conflicting items
91 } else { 93 } else {
92 kdDebug(5855) << " no conflicts" << endl; 94 kdDebug(5855) << " no conflicts" << endl;
93 placeItem->setSubCell( 0 ); 95 placeItem->setSubCell( 0 );
94 placeItem->setSubCells( 1 ); 96 placeItem->setSubCells( 1 );
95 } 97 }
96 98
97 return conflictItems; 99 return conflictItems;
98} 100}
diff --git a/korganizer/cellitem.h b/korganizer/cellitem.h
index 72773d0..b917bd5 100644
--- a/korganizer/cellitem.h
+++ b/korganizer/cellitem.h
@@ -16,25 +16,25 @@
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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#ifndef KORG_CELLITEM_H 24#ifndef KORG_CELLITEM_H
25#define KORG_CELLITEM_H 25#define KORG_CELLITEM_H
26 26
27#include <qstring.h> 27#include <qstring.h>
28#include <qptrlist.h> 28#include <q3ptrlist.h>
29 29
30namespace KOrg { 30namespace KOrg {
31 31
32class CellItem 32class CellItem
33{ 33{
34 public: 34 public:
35 CellItem() 35 CellItem()
36 : mSubCells( 0 ), mSubCell( -1 ) 36 : mSubCells( 0 ), mSubCell( -1 )
37 { 37 {
38 } 38 }
39 39
40 void setSubCells( int v ) { mSubCells = v; } 40 void setSubCells( int v ) { mSubCells = v; }
@@ -44,23 +44,23 @@ class CellItem
44 int subCell() const { return mSubCell; } 44 int subCell() const { return mSubCell; }
45 45
46 virtual bool overlaps( CellItem *other ) const = 0; 46 virtual bool overlaps( CellItem *other ) const = 0;
47 47
48 virtual QString label() const; 48 virtual QString label() const;
49 49
50 /** 50 /**
51 Place item \arg placeItem into stripe containing items \arg cells in a 51 Place item \arg placeItem into stripe containing items \arg cells in a
52 way that items don't overlap. 52 way that items don't overlap.
53 53
54 \return Placed items 54 \return Placed items
55 */ 55 */
56 static QPtrList<CellItem> placeItem( QPtrList<CellItem> cells, 56 static Q3PtrList<CellItem> placeItem( Q3PtrList<CellItem> cells,
57 CellItem *placeItem ); 57 CellItem *placeItem );
58 58
59 private: 59 private:
60 int mSubCells; 60 int mSubCells;
61 int mSubCell; 61 int mSubCell;
62}; 62};
63 63
64} 64}
65 65
66#endif 66#endif
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index ea510f1..53507d3 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -25,24 +25,26 @@
25 25
26#include <kdebug.h> 26#include <kdebug.h>
27#include <klocale.h> 27#include <klocale.h>
28 28
29//#include "koglobals.h" 29//#include "koglobals.h"
30#include "navigatorbar.h" 30#include "navigatorbar.h"
31#include "kdatenavigator.h" 31#include "kdatenavigator.h"
32 32
33#include <kcalendarsystem.h> 33#include <kcalendarsystem.h>
34 34
35#include "datenavigatorcontainer.h" 35#include "datenavigatorcontainer.h"
36#include "koprefs.h" 36#include "koprefs.h"
37//Added by qt3to4:
38#include <QResizeEvent>
37 39
38DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, 40DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
39 const char *name ) 41 const char *name )
40 : QWidget( parent, name ), mCalendar( 0 ), 42 : QWidget( parent, name ), mCalendar( 0 ),
41 mHorizontalCount( 1 ), mVerticalCount( 1 ) 43 mHorizontalCount( 1 ), mVerticalCount( 1 )
42{ 44{
43 mResizeEnabled = false; 45 mResizeEnabled = false;
44 mExtraViews.setAutoDelete( true ); 46 mExtraViews.setAutoDelete( true );
45 47
46 mNavigatorView = new KDateNavigator( this, name ); 48 mNavigatorView = new KDateNavigator( this, name );
47 mNavigatorView->hide(); 49 mNavigatorView->hide();
48 connectNavigatorView( mNavigatorView ); 50 connectNavigatorView( mNavigatorView );
diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h
index 87cc59f..75d387c 100644
--- a/korganizer/datenavigatorcontainer.h
+++ b/korganizer/datenavigatorcontainer.h
@@ -1,12 +1,15 @@
1//Added by qt3to4:
2#include <QResizeEvent>
3#include <Q3PtrList>
1/* 4/*
2 This file is part of KOrganizer. 5 This file is part of KOrganizer.
3 6
4 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org> 7 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com> 8 Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 9
7 This program is free software; you can redistribute it and/or modify 10 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 11 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or 12 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 13 (at your option) any later version.
11 14
12 This program is distributed in the hope that it will be useful, 15 This program is distributed in the hope that it will be useful,
@@ -91,19 +94,19 @@ class DateNavigatorContainer: public QWidget
91 void connectNavigatorView( KDateNavigator *v ); 94 void connectNavigatorView( KDateNavigator *v );
92 95
93 private: 96 private:
94 bool mResizeEnabled; 97 bool mResizeEnabled;
95 QTimer* mUpdateTimer; 98 QTimer* mUpdateTimer;
96 int mLastDisplayedDN; 99 int mLastDisplayedDN;
97 QDate mFirstSelectedDate; 100 QDate mFirstSelectedDate;
98 int mSelectedDateCount; 101 int mSelectedDateCount;
99 KDateNavigator *mNavigatorView; 102 KDateNavigator *mNavigatorView;
100 103
101 KCal::Calendar *mCalendar; 104 KCal::Calendar *mCalendar;
102 105
103 QPtrList<KDateNavigator> mExtraViews; 106 Q3PtrList<KDateNavigator> mExtraViews;
104 107
105 int mHorizontalCount; 108 int mHorizontalCount;
106 int mVerticalCount; 109 int mVerticalCount;
107}; 110};
108 111
109#endif 112#endif
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
@@ -2,123 +2,127 @@
2** Form implementation generated from reading ui file 'filteredit_base.ui' 2** Form implementation generated from reading ui file 'filteredit_base.ui'
3** 3**
4** Created: Fr Jan 21 21:25:30 2005 4** Created: Fr Jan 21 21:25:30 2005
5** by: The User Interface Compiler ($Id$) 5** by: The User Interface Compiler ($Id$)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9 9
10#include "filteredit_base.h" 10#include "filteredit_base.h"
11 11
12#include <qvariant.h> 12#include <qvariant.h>
13#include <qpushbutton.h> 13#include <qpushbutton.h>
14#include <qframe.h> 14#include <q3frame.h>
15#include <qbuttongroup.h> 15#include <q3buttongroup.h>
16#include <qapplication.h> 16#include <qapplication.h>
17#include <QDesktopWidget>
17#include <qradiobutton.h> 18#include <qradiobutton.h>
18#include <qlistbox.h> 19#include <q3listbox.h>
19#include <qlabel.h> 20#include <qlabel.h>
20#include <qcheckbox.h> 21#include <qcheckbox.h>
21#include <qlayout.h> 22#include <qlayout.h>
22#include <qtooltip.h> 23#include <qtooltip.h>
23#include <qwhatsthis.h> 24#include <q3whatsthis.h>
25//Added by qt3to4:
26#include <Q3GridLayout>
27#include <Q3HBoxLayout>
28#include <Q3VBoxLayout>
24#include "tr.h" 29#include "tr.h"
25 30
26/* 31/*
27 * Constructs a FilterEdit_base as a child of 'parent', with the 32 * Constructs a FilterEdit_base as a child of 'parent', with the
28 * name 'name' and widget flags set to 'f'. 33 * name 'name' and widget flags set to 'f'.
29 */ 34 */
30FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) 35FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, Qt::WFlags fl )
31 : QWidget( parent, name, fl ) 36 : QWidget( parent, name, fl )
32{ 37{
33 if ( !name ) 38 if ( !name )
34 setName( "FilterEdit_base" ); 39 setName( "FilterEdit_base" );
35 FilterEdit_baseLayout = new QVBoxLayout( this, 0, 0, "FilterEdit_baseLayout"); 40 FilterEdit_baseLayout = new Q3VBoxLayout( this, 0, 0, "FilterEdit_baseLayout");
36 41
37 mCriteriaFrame = new QFrame( this, "mCriteriaFrame" ); 42 mCriteriaFrame = new Q3Frame( this, "mCriteriaFrame" );
38 mCriteriaFrame->setFrameShape( QFrame::StyledPanel ); 43 mCriteriaFrame->setFrameShape( Q3Frame::StyledPanel );
39 mCriteriaFrame->setFrameShadow( QFrame::Raised ); 44 mCriteriaFrame->setFrameShadow( Q3Frame::Raised );
40 mCriteriaFrameLayout = new QVBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout"); 45 mCriteriaFrameLayout = new Q3VBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout");
41 46
42 ButtonGroup1 = new QButtonGroup( mCriteriaFrame, "ButtonGroup1" ); 47 ButtonGroup1 = new Q3ButtonGroup( mCriteriaFrame, "ButtonGroup1" );
43 ButtonGroup1->setColumnLayout(0, Qt::Vertical ); 48 ButtonGroup1->setColumnLayout(0, Qt::Vertical );
44 ButtonGroup1->layout()->setSpacing( 6 ); 49 ButtonGroup1->layout()->setSpacing( 6 );
45 ButtonGroup1->layout()->setMargin( 6 ); 50 ButtonGroup1->layout()->setMargin( 6 );
46 ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() ); 51 ButtonGroup1Layout = new Q3GridLayout( ButtonGroup1->layout() );
47 ButtonGroup1Layout->setAlignment( Qt::AlignTop ); 52 ButtonGroup1Layout->setAlignment( Qt::AlignTop );
48 53
49 layout4 = new QHBoxLayout( 0, 0, 6, "layout4"); 54 layout4 = new Q3HBoxLayout( 0, 0, 6, "layout4");
50 55
51 mCatShowCheck = new QRadioButton( ButtonGroup1, "mCatShowCheck" ); 56 mCatShowCheck = new QRadioButton( ButtonGroup1, "mCatShowCheck" );
52 layout4->addWidget( mCatShowCheck ); 57 layout4->addWidget( mCatShowCheck );
53 58
54 mCatHideCheck = new QRadioButton( ButtonGroup1, "mCatHideCheck" ); 59 mCatHideCheck = new QRadioButton( ButtonGroup1, "mCatHideCheck" );
55 layout4->addWidget( mCatHideCheck ); 60 layout4->addWidget( mCatHideCheck );
56 61
57 mCatEditButton = new QPushButton( ButtonGroup1, "mCatEditButton" ); 62 mCatEditButton = new QPushButton( ButtonGroup1, "mCatEditButton" );
58 layout4->addWidget( mCatEditButton ); 63 layout4->addWidget( mCatEditButton );
59 64
60 ButtonGroup1Layout->addLayout( layout4, 0, 0 ); 65 ButtonGroup1Layout->addLayout( layout4, 0, 0 );
61 66
62 mCatList = new QListBox( ButtonGroup1, "mCatList" ); 67 mCatList = new Q3ListBox( ButtonGroup1, "mCatList" );
63 68
64 ButtonGroup1Layout->addWidget( mCatList, 1, 0 ); 69 ButtonGroup1Layout->addWidget( mCatList, 1, 0 );
65 mCriteriaFrameLayout->addWidget( ButtonGroup1 ); 70 mCriteriaFrameLayout->addWidget( ButtonGroup1 );
66 71
67 layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); 72 layout7 = new Q3HBoxLayout( 0, 0, 6, "layout7");
68 73
69 textLabel1 = new QLabel( mCriteriaFrame, "textLabel1" ); 74 textLabel1 = new QLabel( mCriteriaFrame, "textLabel1" );
70 layout7->addWidget( textLabel1 ); 75 layout7->addWidget( textLabel1 );
71 76
72 mRecurringCheck = new QCheckBox( mCriteriaFrame, "mRecurringCheck" ); 77 mRecurringCheck = new QCheckBox( mCriteriaFrame, "mRecurringCheck" );
73 layout7->addWidget( mRecurringCheck ); 78 layout7->addWidget( mRecurringCheck );
74 79
75 mCompletedCheck = new QCheckBox( mCriteriaFrame, "mCompletedCheck" ); 80 mCompletedCheck = new QCheckBox( mCriteriaFrame, "mCompletedCheck" );
76 layout7->addWidget( mCompletedCheck ); 81 layout7->addWidget( mCompletedCheck );
77 mCriteriaFrameLayout->addLayout( layout7 ); 82 mCriteriaFrameLayout->addLayout( layout7 );
78 83
79 layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); 84 layout9 = new Q3HBoxLayout( 0, 0, 6, "layout9");
80 85
81 textLabel1_2 = new QLabel( mCriteriaFrame, "textLabel1_2" ); 86 textLabel1_2 = new QLabel( mCriteriaFrame, "textLabel1_2" );
82 layout9->addWidget( textLabel1_2 ); 87 layout9->addWidget( textLabel1_2 );
83 88
84 mEventCheck = new QCheckBox( mCriteriaFrame, "mEventCheck" ); 89 mEventCheck = new QCheckBox( mCriteriaFrame, "mEventCheck" );
85 layout9->addWidget( mEventCheck ); 90 layout9->addWidget( mEventCheck );
86 91
87 mTodoCheck = new QCheckBox( mCriteriaFrame, "mTodoCheck" ); 92 mTodoCheck = new QCheckBox( mCriteriaFrame, "mTodoCheck" );
88 layout9->addWidget( mTodoCheck ); 93 layout9->addWidget( mTodoCheck );
89 94
90 mJournalCheck = new QCheckBox( mCriteriaFrame, "mJournalCheck" ); 95 mJournalCheck = new QCheckBox( mCriteriaFrame, "mJournalCheck" );
91 layout9->addWidget( mJournalCheck ); 96 layout9->addWidget( mJournalCheck );
92 mCriteriaFrameLayout->addLayout( layout9 ); 97 mCriteriaFrameLayout->addLayout( layout9 );
93 98
94 layout2 = new QHBoxLayout( 0, 0, 0, "layout2"); 99 layout2 = new Q3HBoxLayout( 0, 0, 0, "layout2");
95 100
96 textLabel2 = new QLabel( mCriteriaFrame, "textLabel2" ); 101 textLabel2 = new QLabel( mCriteriaFrame, "textLabel2" );
97 layout2->addWidget( textLabel2 ); 102 layout2->addWidget( textLabel2 );
98 103
99 mPublicCheck = new QCheckBox( mCriteriaFrame, "mPublicCheck" ); 104 mPublicCheck = new QCheckBox( mCriteriaFrame, "mPublicCheck" );
100 layout2->addWidget( mPublicCheck ); 105 layout2->addWidget( mPublicCheck );
101 106
102 mPrivateCheck = new QCheckBox( mCriteriaFrame, "mPrivateCheck" ); 107 mPrivateCheck = new QCheckBox( mCriteriaFrame, "mPrivateCheck" );
103 layout2->addWidget( mPrivateCheck ); 108 layout2->addWidget( mPrivateCheck );
104 109
105 mConfidentialCheck = new QCheckBox( mCriteriaFrame, "mConfidentialCheck" ); 110 mConfidentialCheck = new QCheckBox( mCriteriaFrame, "mConfidentialCheck" );
106 mConfidentialCheck->setChecked( FALSE ); 111 mConfidentialCheck->setChecked( FALSE );
107 layout2->addWidget( mConfidentialCheck ); 112 layout2->addWidget( mConfidentialCheck );
108 mCriteriaFrameLayout->addLayout( layout2 ); 113 mCriteriaFrameLayout->addLayout( layout2 );
109 FilterEdit_baseLayout->addWidget( mCriteriaFrame ); 114 FilterEdit_baseLayout->addWidget( mCriteriaFrame );
110 languageChange(); 115 languageChange();
111 resize( QSize(300, 200).expandedTo(minimumSizeHint()) ); 116 resize( QSize(300, 200).expandedTo(minimumSizeHint()) );
112 clearWState( WState_Polished );
113} 117}
114 118
115/* 119/*
116 * Destroys the object and frees any allocated resources 120 * Destroys the object and frees any allocated resources
117 */ 121 */
118FilterEdit_base::~FilterEdit_base() 122FilterEdit_base::~FilterEdit_base()
119{ 123{
120 // no need to delete child widgets, Qt does it all for us 124 // no need to delete child widgets, Qt does it all for us
121} 125}
122 126
123/* 127/*
124 * Sets the strings of the subwidgets using the current 128 * Sets the strings of the subwidgets using the current
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
@@ -3,67 +3,73 @@
3** 3**
4** Created: Fr Jan 21 21:25:30 2005 4** Created: Fr Jan 21 21:25:30 2005
5** by: The User Interface Compiler ($Id$) 5** by: The User Interface Compiler ($Id$)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9 9
10#ifndef FILTEREDIT_BASE_H 10#ifndef FILTEREDIT_BASE_H
11#define FILTEREDIT_BASE_H 11#define FILTEREDIT_BASE_H
12 12
13#include <qvariant.h> 13#include <qvariant.h>
14#include <qwidget.h> 14#include <qwidget.h>
15//Added by qt3to4:
16#include <Q3VBoxLayout>
17#include <Q3Frame>
18#include <Q3GridLayout>
19#include <Q3HBoxLayout>
20#include <QLabel>
15 21
16class QVBoxLayout; 22class Q3VBoxLayout;
17class QHBoxLayout; 23class Q3HBoxLayout;
18class QGridLayout; 24class Q3GridLayout;
19class QSpacerItem; 25class QSpacerItem;
20class QFrame; 26class Q3Frame;
21class QButtonGroup; 27class Q3ButtonGroup;
22class QRadioButton; 28class QRadioButton;
23class QPushButton; 29class QPushButton;
24class QListBox; 30class Q3ListBox;
25class QListBoxItem; 31class Q3ListBoxItem;
26class QLabel; 32class QLabel;
27class QCheckBox; 33class QCheckBox;
28 34
29class FilterEdit_base : public QWidget 35class FilterEdit_base : public QWidget
30{ 36{
31 Q_OBJECT 37 Q_OBJECT
32 38
33public: 39public:
34 FilterEdit_base( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 40 FilterEdit_base( QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0 );
35 ~FilterEdit_base(); 41 ~FilterEdit_base();
36 42
37 QFrame* mCriteriaFrame; 43 Q3Frame* mCriteriaFrame;
38 QButtonGroup* ButtonGroup1; 44 Q3ButtonGroup* ButtonGroup1;
39 QRadioButton* mCatShowCheck; 45 QRadioButton* mCatShowCheck;
40 QRadioButton* mCatHideCheck; 46 QRadioButton* mCatHideCheck;
41 QPushButton* mCatEditButton; 47 QPushButton* mCatEditButton;
42 QListBox* mCatList; 48 Q3ListBox* mCatList;
43 QLabel* textLabel1; 49 QLabel* textLabel1;
44 QCheckBox* mRecurringCheck; 50 QCheckBox* mRecurringCheck;
45 QCheckBox* mCompletedCheck; 51 QCheckBox* mCompletedCheck;
46 QLabel* textLabel1_2; 52 QLabel* textLabel1_2;
47 QCheckBox* mEventCheck; 53 QCheckBox* mEventCheck;
48 QCheckBox* mTodoCheck; 54 QCheckBox* mTodoCheck;
49 QCheckBox* mJournalCheck; 55 QCheckBox* mJournalCheck;
50 QLabel* textLabel2; 56 QLabel* textLabel2;
51 QCheckBox* mPublicCheck; 57 QCheckBox* mPublicCheck;
52 QCheckBox* mPrivateCheck; 58 QCheckBox* mPrivateCheck;
53 QCheckBox* mConfidentialCheck; 59 QCheckBox* mConfidentialCheck;
54 60
55protected: 61protected:
56 QVBoxLayout* FilterEdit_baseLayout; 62 Q3VBoxLayout* FilterEdit_baseLayout;
57 QVBoxLayout* mCriteriaFrameLayout; 63 Q3VBoxLayout* mCriteriaFrameLayout;
58 QGridLayout* ButtonGroup1Layout; 64 Q3GridLayout* ButtonGroup1Layout;
59 QHBoxLayout* layout4; 65 Q3HBoxLayout* layout4;
60 QHBoxLayout* layout7; 66 Q3HBoxLayout* layout7;
61 QHBoxLayout* layout9; 67 Q3HBoxLayout* layout9;
62 QHBoxLayout* layout2; 68 Q3HBoxLayout* layout2;
63 69
64protected slots: 70protected slots:
65 virtual void languageChange(); 71 virtual void languageChange();
66 72
67}; 73};
68 74
69#endif // FILTEREDIT_BASE_H 75#endif // FILTEREDIT_BASE_H
diff --git a/korganizer/filtereditdialog.cpp b/korganizer/filtereditdialog.cpp
index df84911..a3cff49 100644
--- a/korganizer/filtereditdialog.cpp
+++ b/korganizer/filtereditdialog.cpp
@@ -17,26 +17,31 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qpushbutton.h> 25#include <qpushbutton.h>
26#include <qcombobox.h> 26#include <qcombobox.h>
27#include <qcheckbox.h> 27#include <qcheckbox.h>
28#include <qradiobutton.h> 28#include <qradiobutton.h>
29#include <qlistbox.h> 29#include <q3listbox.h>
30#include <qapplication.h> 30#include <qapplication.h>
31//Added by qt3to4:
32#include <Q3GridLayout>
33#include <Q3PtrList>
34
35#include <QDesktopWidget>
31 36
32#include <kdebug.h> 37#include <kdebug.h>
33#include <klocale.h> 38#include <klocale.h>
34#include <klineeditdlg.h> 39#include <klineeditdlg.h>
35#include <kmessagebox.h> 40#include <kmessagebox.h>
36 41
37#include <libkdepim/categoryselectdialog.h> 42#include <libkdepim/categoryselectdialog.h>
38 43
39#include "koprefs.h" 44#include "koprefs.h"
40#include "filteredit_base.h" 45#include "filteredit_base.h"
41 46
42#include "filtereditdialog.h" 47#include "filtereditdialog.h"
@@ -44,25 +49,25 @@
44 49
45// TODO: Make dialog work on a copy of the filters objects. 50// TODO: Make dialog work on a copy of the filters objects.
46 51
47class ComboFilterBox: public QComboBox 52class ComboFilterBox: public QComboBox
48{ 53{
49public: 54public:
50 ComboFilterBox( QWidget *parent=0, const char *name=0) : 55 ComboFilterBox( QWidget *parent=0, const char *name=0) :
51 QComboBox( parent,name ) { } 56 QComboBox( parent,name ) { }
52 void popupBox() { popup(); } 57 void popupBox() { popup(); }
53 58
54}; 59};
55 60
56FilterEditDialog::FilterEditDialog(QPtrList<CalFilter> *filters,QWidget *parent, 61FilterEditDialog::FilterEditDialog(Q3PtrList<CalFilter> *filters,QWidget *parent,
57 const char *name) : 62 const char *name) :
58 KDialogBase(parent,name,true,i18n("Edit Calendar Filters"), 63 KDialogBase(parent,name,true,i18n("Edit Calendar Filters"),
59 Ok|Apply|Cancel) 64 Ok|Apply|Cancel)
60{ 65{
61 mFilters = filters; 66 mFilters = filters;
62 67
63 QWidget *mainWidget = new QWidget(this); 68 QWidget *mainWidget = new QWidget(this);
64 setMainWidget(mainWidget); 69 setMainWidget(mainWidget);
65 70
66 mSelectionCombo = new ComboFilterBox(mainWidget); 71 mSelectionCombo = new ComboFilterBox(mainWidget);
67 connect(mSelectionCombo,SIGNAL(activated(int)),SLOT(filterSelected())); 72 connect(mSelectionCombo,SIGNAL(activated(int)),SLOT(filterSelected()));
68 // mSelectionCombo->setEditable ( true ); 73 // mSelectionCombo->setEditable ( true );
@@ -71,25 +76,25 @@ FilterEditDialog::FilterEditDialog(QPtrList<CalFilter> *filters,QWidget *parent,
71 addButton->setMaximumSize( addButton->sizeHint()); 76 addButton->setMaximumSize( addButton->sizeHint());
72 mRemoveButton = new QPushButton( i18n("Remove"), mainWidget ); 77 mRemoveButton = new QPushButton( i18n("Remove"), mainWidget );
73 connect( mRemoveButton, SIGNAL( clicked() ), SLOT( slotRemove() ) ); 78 connect( mRemoveButton, SIGNAL( clicked() ), SLOT( slotRemove() ) );
74 mRemoveButton->setMaximumSize( mRemoveButton->sizeHint()); 79 mRemoveButton->setMaximumSize( mRemoveButton->sizeHint());
75 80
76 QPushButton *upButton = new QPushButton(i18n("Up"),mainWidget); 81 QPushButton *upButton = new QPushButton(i18n("Up"),mainWidget);
77 upButton->setMaximumSize( upButton->sizeHint()); 82 upButton->setMaximumSize( upButton->sizeHint());
78 connect(upButton,SIGNAL(clicked()),SLOT(slotUp())); 83 connect(upButton,SIGNAL(clicked()),SLOT(slotUp()));
79 84
80 85
81 mEditor = new FilterEdit_base(mainWidget); 86 mEditor = new FilterEdit_base(mainWidget);
82 87
83 QGridLayout *topLayout = new QGridLayout(mainWidget,2,2); 88 Q3GridLayout *topLayout = new Q3GridLayout(mainWidget,2,2);
84 topLayout->setSpacing(spacingHint()); 89 topLayout->setSpacing(spacingHint());
85 topLayout->addWidget(mSelectionCombo,0,0); 90 topLayout->addWidget(mSelectionCombo,0,0);
86 topLayout->addWidget(upButton,0,1); 91 topLayout->addWidget(upButton,0,1);
87 topLayout->addWidget(addButton,0,2); 92 topLayout->addWidget(addButton,0,2);
88 topLayout->addWidget(mRemoveButton,0,3); 93 topLayout->addWidget(mRemoveButton,0,3);
89 topLayout->addMultiCellWidget(mEditor,1,1,0,3); 94 topLayout->addMultiCellWidget(mEditor,1,1,0,3);
90 mSelectionCombo->setMaximumWidth ( QApplication::desktop()->width() - 95 mSelectionCombo->setMaximumWidth ( QApplication::desktop()->width() -
91 addButton->maximumWidth() - 96 addButton->maximumWidth() -
92 mRemoveButton->maximumWidth() - 97 mRemoveButton->maximumWidth() -
93 upButton->maximumWidth() - 98 upButton->maximumWidth() -
94 spacingHint() * 5 ); 99 spacingHint() * 5 );
95 connect(mEditor->mCatEditButton,SIGNAL(clicked()), 100 connect(mEditor->mCatEditButton,SIGNAL(clicked()),
diff --git a/korganizer/filtereditdialog.h b/korganizer/filtereditdialog.h
index 42aa3da..c1a52ed 100644
--- a/korganizer/filtereditdialog.h
+++ b/korganizer/filtereditdialog.h
@@ -14,48 +14,48 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _FILTEREDITDIALOG_H 23#ifndef _FILTEREDITDIALOG_H
24#define _FILTEREDITDIALOG_H 24#define _FILTEREDITDIALOG_H
25 25
26#include <qptrlist.h> 26#include <q3ptrlist.h>
27 27
28#include <kdialogbase.h> 28#include <kdialogbase.h>
29 29
30#include <libkcal/calfilter.h> 30#include <libkcal/calfilter.h>
31 31
32class QComboBox; 32class QComboBox;
33class ComboFilterBox; 33class ComboFilterBox;
34class QPushButton; 34class QPushButton;
35class FilterEdit_base; 35class FilterEdit_base;
36 36
37using namespace KCal; 37using namespace KCal;
38 38
39/** 39/**
40 This is the class to add/edit a calendar filter. 40 This is the class to add/edit a calendar filter.
41 41
42 @short Creates a dialog box to create/edit a calendar filter 42 @short Creates a dialog box to create/edit a calendar filter
43 @author Cornelius Schumacher 43 @author Cornelius Schumacher
44*/ 44*/
45class FilterEditDialog : public KDialogBase 45class FilterEditDialog : public KDialogBase
46{ 46{
47 Q_OBJECT 47 Q_OBJECT
48 public: 48 public:
49 FilterEditDialog(QPtrList<CalFilter> *,QWidget *parent=0, const char *name=0); 49 FilterEditDialog(Q3PtrList<CalFilter> *,QWidget *parent=0, const char *name=0);
50 virtual ~FilterEditDialog(); 50 virtual ~FilterEditDialog();
51 51
52 public slots: 52 public slots:
53 void updateFilterList(); 53 void updateFilterList();
54 54
55 signals: 55 signals:
56 void filterChanged(); 56 void filterChanged();
57 57
58 protected slots: 58 protected slots:
59 void slotDefault(); 59 void slotDefault();
60 void slotApply(); 60 void slotApply();
61 void slotOk(); 61 void slotOk();
@@ -65,22 +65,22 @@ class FilterEditDialog : public KDialogBase
65 void slotUp(); 65 void slotUp();
66 void slotRemove(); 66 void slotRemove();
67 67
68 void filterSelected(); 68 void filterSelected();
69 void editCategorySelection(); 69 void editCategorySelection();
70 void updateCategorySelection(const QStringList &categories); 70 void updateCategorySelection(const QStringList &categories);
71 71
72 protected: 72 protected:
73 void readFilter(CalFilter *); 73 void readFilter(CalFilter *);
74 void writeFilter(CalFilter *); 74 void writeFilter(CalFilter *);
75 75
76 private: 76 private:
77 QPtrList<CalFilter> *mFilters; 77 Q3PtrList<CalFilter> *mFilters;
78 78
79 ComboFilterBox *mSelectionCombo; 79 ComboFilterBox *mSelectionCombo;
80 QPushButton *mRemoveButton; 80 QPushButton *mRemoveButton;
81 FilterEdit_base *mEditor; 81 FilterEdit_base *mEditor;
82 82
83 QStringList mCategories; 83 QStringList mCategories;
84}; 84};
85 85
86#endif 86#endif
diff --git a/korganizer/incomingdialog.cpp b/korganizer/incomingdialog.cpp
index fe78356..c2402d4 100644
--- a/korganizer/incomingdialog.cpp
+++ b/korganizer/incomingdialog.cpp
@@ -8,28 +8,30 @@
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <qlistview.h> 20#include <q3listview.h>
21#include <qfile.h> 21#include <qfile.h>
22#include <qdir.h> 22#include <qdir.h>
23#include <qmap.h> 23#include <qmap.h>
24//Added by qt3to4:
25#include <Q3PtrList>
24 26
25#include <kglobal.h> 27#include <kglobal.h>
26#include <klocale.h> 28#include <klocale.h>
27#include <kdebug.h> 29#include <kdebug.h>
28#include <kstandarddirs.h> 30#include <kstandarddirs.h>
29#include <kmessagebox.h> 31#include <kmessagebox.h>
30 32
31#include <libkcal/incidence.h> 33#include <libkcal/incidence.h>
32#include <libkcal/event.h> 34#include <libkcal/event.h>
33#include <libkcal/calendar.h> 35#include <libkcal/calendar.h>
34#include <libkcal/freebusy.h> 36#include <libkcal/freebusy.h>
35#include <libkcal/attendee.h> 37#include <libkcal/attendee.h>
@@ -47,27 +49,27 @@
47#include "incomingdialog.h" 49#include "incomingdialog.h"
48#include "koeventviewerdialog.h" 50#include "koeventviewerdialog.h"
49#include "kocounterdialog.h" 51#include "kocounterdialog.h"
50#include "koprefs.h" 52#include "koprefs.h"
51 53
52#ifndef KORG_NOKABC 54#ifndef KORG_NOKABC
53#define KORG_NOKABC 55#define KORG_NOKABC
54//#include <kabc/stdaddressbook.h> 56//#include <kabc/stdaddressbook.h>
55#define size count 57#define size count
56#endif 58#endif
57 59
58 60
59ScheduleItemIn::ScheduleItemIn(QListView *parent,IncidenceBase *ev, 61ScheduleItemIn::ScheduleItemIn(Q3ListView *parent,IncidenceBase *ev,
60 Scheduler::Method method,ScheduleMessage::Status status) 62 Scheduler::Method method,ScheduleMessage::Status status)
61 : QListViewItem(parent) 63 : Q3ListViewItem(parent)
62{ 64{
63 mIncidence = ev; 65 mIncidence = ev;
64 mMethod = method; 66 mMethod = method;
65 mStatus = status; 67 mStatus = status;
66 setText(6,Scheduler::translatedMethodName(mMethod)+" "); 68 setText(6,Scheduler::translatedMethodName(mMethod)+" ");
67 setText(7,ScheduleMessage::statusName(status)); 69 setText(7,ScheduleMessage::statusName(status));
68} 70}
69 71
70 72
71/* Visitor */ 73/* Visitor */
72ScheduleItemVisitor::ScheduleItemVisitor(ScheduleItemIn *item) 74ScheduleItemVisitor::ScheduleItemVisitor(ScheduleItemIn *item)
73{ 75{
@@ -126,59 +128,59 @@ bool ScheduleItemVisitor::visit(Journal *)
126 return false; 128 return false;
127} 129}
128 130
129 131
130/* 132/*
131 * Constructs a IncomingDialog which is a child of 'parent', with the 133 * Constructs a IncomingDialog which is a child of 'parent', with the
132 * name 'name' and widget flags set to 'f' 134 * name 'name' and widget flags set to 'f'
133 * 135 *
134 * The dialog will by default be modeless, unless you set 'modal' to 136 * The dialog will by default be modeless, unless you set 'modal' to
135 * TRUE to construct a modal dialog. 137 * TRUE to construct a modal dialog.
136 */ 138 */
137IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, 139IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing,
138 QWidget* parent,const char* name,bool modal,WFlags fl) : 140 QWidget* parent,const char* name,bool modal,Qt::WFlags fl) :
139 IncomingDialog_base(parent,name,modal,fl) 141 IncomingDialog_base(parent,name,modal,fl)
140{ 142{
141 mCalendar = calendar; 143 mCalendar = calendar;
142 mOutgoing = outgoing; 144 mOutgoing = outgoing;
143#ifndef KORG_NOMAIL 145#ifndef KORG_NOMAIL
144 mScheduler = new MailScheduler(mCalendar); 146 mScheduler = new MailScheduler(mCalendar);
145#else 147#else
146 mScheduler = new DummyScheduler(mCalendar); 148 mScheduler = new DummyScheduler(mCalendar);
147#endif 149#endif
148 mMessageListView->setColumnAlignment(1,AlignHCenter); 150 mMessageListView->setColumnAlignment(1,Qt::AlignHCenter);
149 mMessageListView->setColumnAlignment(2,AlignHCenter); 151 mMessageListView->setColumnAlignment(2,Qt::AlignHCenter);
150 mMessageListView->setColumnAlignment(3,AlignHCenter); 152 mMessageListView->setColumnAlignment(3,Qt::AlignHCenter);
151 mMessageListView->setColumnAlignment(4,AlignHCenter); 153 mMessageListView->setColumnAlignment(4,Qt::AlignHCenter);
152 QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)), 154 QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)),
153 this,SLOT(showEvent(QListViewItem *))); 155 this,SLOT(showEvent(Q3ListViewItem *)));
154 retrieve(); 156 retrieve();
155} 157}
156 158
157/* 159/*
158 * Destroys the object and frees any allocated resources 160 * Destroys the object and frees any allocated resources
159 */ 161 */
160IncomingDialog::~IncomingDialog() 162IncomingDialog::~IncomingDialog()
161{ 163{
162 // no need to delete child widgets, Qt does it all for us 164 // no need to delete child widgets, Qt does it all for us
163} 165}
164 166
165void IncomingDialog::setOutgoingDialog(OutgoingDialog *outgoing) 167void IncomingDialog::setOutgoingDialog(OutgoingDialog *outgoing)
166{ 168{
167 mOutgoing = outgoing; 169 mOutgoing = outgoing;
168} 170}
169 171
170void IncomingDialog::retrieve() 172void IncomingDialog::retrieve()
171{ 173{
172 QPtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions(); 174 Q3PtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions();
173 175
174 ScheduleMessage *message; 176 ScheduleMessage *message;
175 for(message = messages.first();message;message = messages.next()) { 177 for(message = messages.first();message;message = messages.next()) {
176 IncidenceBase *inc = message->event(); 178 IncidenceBase *inc = message->event();
177 Scheduler::Method method = (Scheduler::Method)message->method(); 179 Scheduler::Method method = (Scheduler::Method)message->method();
178 ScheduleMessage::Status status = message->status(); 180 ScheduleMessage::Status status = message->status();
179 181
180 ScheduleItemIn *item = new ScheduleItemIn(mMessageListView,inc,method,status); 182 ScheduleItemIn *item = new ScheduleItemIn(mMessageListView,inc,method,status);
181 if(inc->typeID() != freebusyID ) { 183 if(inc->typeID() != freebusyID ) {
182 Incidence *incidence = static_cast<Incidence *>(inc); 184 Incidence *incidence = static_cast<Incidence *>(inc);
183 ScheduleItemVisitor v(item); 185 ScheduleItemVisitor v(item);
184 if (!incidence->accept(v)) delete item; 186 if (!incidence->accept(v)) delete item;
@@ -243,42 +245,42 @@ bool IncomingDialog::acceptMessage(ScheduleItemIn *item)
243} 245}
244 246
245void IncomingDialog::rejectMessage() 247void IncomingDialog::rejectMessage()
246{ 248{
247 ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->selectedItem(); 249 ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->selectedItem();
248 if (item) { 250 if (item) {
249 mScheduler->deleteTransaction(item->event()); 251 mScheduler->deleteTransaction(item->event());
250 delete item; 252 delete item;
251 emit numMessagesChanged(mMessageListView->childCount()); 253 emit numMessagesChanged(mMessageListView->childCount());
252 } 254 }
253} 255}
254 256
255void IncomingDialog::showEvent(QListViewItem *item) 257void IncomingDialog::showEvent(Q3ListViewItem *item)
256{ 258{
257 IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); 259 IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
258 if( incidence && incidence->typeID() == eventID ) { 260 if( incidence && incidence->typeID() == eventID ) {
259 Event *event = static_cast<Event *>(incidence); 261 Event *event = static_cast<Event *>(incidence);
260 KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this); 262 KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this);
261 eventViewer->setEvent(event); 263 eventViewer->setEvent(event);
262 eventViewer->show(); 264 eventViewer->show();
263 } 265 }
264} 266}
265 267
266bool IncomingDialog::incomeRefresh(ScheduleItemIn *item) 268bool IncomingDialog::incomeRefresh(ScheduleItemIn *item)
267{ 269{
268 Event *ev = mCalendar->event(item->event()->uid()); 270 Event *ev = mCalendar->event(item->event()->uid());
269 if (ev) { 271 if (ev) {
270 //user interaction before?? 272 //user interaction before??
271 Attendee *att; 273 Attendee *att;
272 QPtrList<Attendee> attlist = ev->attendees(); 274 Q3PtrList<Attendee> attlist = ev->attendees();
273 for (att=attlist.first(); att; att=attlist.next()) { 275 for (att=attlist.first(); att; att=attlist.next()) {
274 Event *event = new Event(*ev); 276 Event *event = new Event(*ev);
275 mOutgoing->addMessage(event,Scheduler::Request,att->email()); 277 mOutgoing->addMessage(event,Scheduler::Request,att->email());
276 delete(event); 278 delete(event);
277 } 279 }
278 mScheduler->deleteTransaction(item->event()); 280 mScheduler->deleteTransaction(item->event());
279 delete item; 281 delete item;
280 emit numMessagesChanged(mMessageListView->childCount()); 282 emit numMessagesChanged(mMessageListView->childCount());
281 return true; 283 return true;
282 } 284 }
283 mScheduler->deleteTransaction(item->event()); 285 mScheduler->deleteTransaction(item->event());
284 delete item; 286 delete item;
@@ -505,24 +507,24 @@ bool IncomingDialog::checkOrganizerInAddressbook(QString organizer)
505 addressList = add_book->findByEmail(organizer); 507 addressList = add_book->findByEmail(organizer);
506 if ( addressList.size()>0 ) inBook = true; 508 if ( addressList.size()>0 ) inBook = true;
507#endif 509#endif
508 return inBook; 510 return inBook;
509} 511}
510 512
511bool IncomingDialog::checkAttendeesInAddressbook(IncidenceBase *inc) 513bool IncomingDialog::checkAttendeesInAddressbook(IncidenceBase *inc)
512{ 514{
513 bool inBook = false; 515 bool inBook = false;
514#ifndef KORG_NOKABC 516#ifndef KORG_NOKABC
515 KABC::AddressBook *add_book = KABC::StdAddressBook::self(); 517 KABC::AddressBook *add_book = KABC::StdAddressBook::self();
516 KABC::Addressee::List addressList; 518 KABC::Addressee::List addressList;
517 QPtrList <Attendee> attendees; 519 Q3PtrList <Attendee> attendees;
518 Attendee *att; 520 Attendee *att;
519 attendees = inc->attendees(); 521 attendees = inc->attendees();
520 for (att=attendees.first();att;att=attendees.next()) { 522 for (att=attendees.first();att;att=attendees.next()) {
521 addressList = add_book->findByEmail(att->email()); 523 addressList = add_book->findByEmail(att->email());
522 if (addressList.size()>0 ) inBook = true; 524 if (addressList.size()>0 ) inBook = true;
523 } 525 }
524#endif 526#endif
525 return inBook; 527 return inBook;
526} 528}
527 529
528//#include "incomingdialog.moc" 530//#include "incomingdialog.moc"
diff --git a/korganizer/incomingdialog.h b/korganizer/incomingdialog.h
index 413ce6a..e002b25 100644
--- a/korganizer/incomingdialog.h
+++ b/korganizer/incomingdialog.h
@@ -10,38 +10,38 @@
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19#ifndef INCOMINGDIALOG_H 19#ifndef INCOMINGDIALOG_H
20#define INCOMINGDIALOG_H 20#define INCOMINGDIALOG_H
21 21
22#include <qlistview.h> 22#include <q3listview.h>
23 23
24#include <libkcal/calendar.h> 24#include <libkcal/calendar.h>
25#include <libkcal/scheduler.h> 25#include <libkcal/scheduler.h>
26 26
27#include "incomingdialog_base.h" 27#include "incomingdialog_base.h"
28#include "outgoingdialog.h" 28#include "outgoingdialog.h"
29 29
30using namespace KCal; 30using namespace KCal;
31 31
32class ScheduleItemIn : public QListViewItem 32class ScheduleItemIn : public Q3ListViewItem
33{ 33{
34 public: 34 public:
35 ScheduleItemIn(QListView *parent,IncidenceBase *ev,Scheduler::Method method, 35 ScheduleItemIn(Q3ListView *parent,IncidenceBase *ev,Scheduler::Method method,
36 ScheduleMessage::Status status); 36 ScheduleMessage::Status status);
37 virtual ~ScheduleItemIn() {} 37 virtual ~ScheduleItemIn() {}
38 38
39 IncidenceBase *event() { return mIncidence; } 39 IncidenceBase *event() { return mIncidence; }
40 Scheduler::Method method() { return mMethod; } 40 Scheduler::Method method() { return mMethod; }
41 ScheduleMessage::Status status() { return mStatus; } 41 ScheduleMessage::Status status() { return mStatus; }
42 42
43 private: 43 private:
44 IncidenceBase *mIncidence; 44 IncidenceBase *mIncidence;
45 Scheduler::Method mMethod; 45 Scheduler::Method mMethod;
46 ScheduleMessage::Status mStatus; 46 ScheduleMessage::Status mStatus;
47}; 47};
@@ -63,40 +63,40 @@ class ScheduleItemVisitor : public Incidence::Visitor
63 63
64 private: 64 private:
65 ScheduleItemIn *mItem; 65 ScheduleItemIn *mItem;
66}; 66};
67 67
68 68
69 69
70class IncomingDialog : public IncomingDialog_base 70class IncomingDialog : public IncomingDialog_base
71{ 71{
72 Q_OBJECT 72 Q_OBJECT
73 public: 73 public:
74 IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, 74 IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing,
75 QWidget* parent=0,const char* name=0,bool modal=false,WFlags fl=0); 75 QWidget* parent=0,const char* name=0,bool modal=false,Qt::WFlags fl=0);
76 ~IncomingDialog(); 76 ~IncomingDialog();
77 77
78 void setOutgoingDialog(OutgoingDialog *outgoing); 78 void setOutgoingDialog(OutgoingDialog *outgoing);
79 79
80 signals: 80 signals:
81 void calendarUpdated(); 81 void calendarUpdated();
82 void numMessagesChanged(int); 82 void numMessagesChanged(int);
83 public slots: 83 public slots:
84 void retrieve(); 84 void retrieve();
85 85
86 protected slots: 86 protected slots:
87 void acceptAllMessages(); 87 void acceptAllMessages();
88 void acceptMessage(); 88 void acceptMessage();
89 void rejectMessage(); 89 void rejectMessage();
90 void showEvent(QListViewItem *); 90 void showEvent(Q3ListViewItem *);
91 91
92 protected: 92 protected:
93 bool acceptMessage(ScheduleItemIn *item); 93 bool acceptMessage(ScheduleItemIn *item);
94 bool incomeRefresh(ScheduleItemIn *item); 94 bool incomeRefresh(ScheduleItemIn *item);
95 bool incomeCounter(ScheduleItemIn *item); 95 bool incomeCounter(ScheduleItemIn *item);
96 bool incomeDeclineCounter(ScheduleItemIn *item); 96 bool incomeDeclineCounter(ScheduleItemIn *item);
97 bool incomeAdd(ScheduleItemIn *item); 97 bool incomeAdd(ScheduleItemIn *item);
98 bool incomeRequest(ScheduleItemIn *item); 98 bool incomeRequest(ScheduleItemIn *item);
99 bool incomeDefault(ScheduleItemIn *item); 99 bool incomeDefault(ScheduleItemIn *item);
100 bool automaticAction(ScheduleItemIn *item); 100 bool automaticAction(ScheduleItemIn *item);
101 101
102 private: 102 private:
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
@@ -2,56 +2,58 @@
2/**************************************************************************** 2/****************************************************************************
3** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/incomingdialog_base.ui' 3** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/incomingdialog_base.ui'
4** 4**
5** Created: Sat Mar 29 22:31:27 2003 5** Created: Sat Mar 29 22:31:27 2003
6** by: The User Interface Compiler () 6** by: The User Interface Compiler ()
7** 7**
8** WARNING! All changes made in this file will be lost! 8** WARNING! All changes made in this file will be lost!
9****************************************************************************/ 9****************************************************************************/
10 10
11#include "incomingdialog_base.h" 11#include "incomingdialog_base.h"
12 12
13#include <qvariant.h> 13#include <qvariant.h>
14#include <qheader.h> 14#include <q3header.h>
15#include <qlistview.h> 15#include <q3listview.h>
16#include <qpushbutton.h> 16#include <qpushbutton.h>
17#include <qlayout.h> 17#include <qlayout.h>
18#include <qtooltip.h> 18#include <qtooltip.h>
19#include <qwhatsthis.h> 19#include <q3whatsthis.h>
20//Added by qt3to4:
21#include <Q3GridLayout>
20 22
21/* 23/*
22 * Constructs a IncomingDialog_base as a child of 'parent', with the 24 * Constructs a IncomingDialog_base as a child of 'parent', with the
23 * name 'name' and widget flags set to 'f'. 25 * name 'name' and widget flags set to 'f'.
24 * 26 *
25 * The dialog will by default be modeless, unless you set 'modal' to 27 * The dialog will by default be modeless, unless you set 'modal' to
26 * TRUE to construct a modal dialog. 28 * TRUE to construct a modal dialog.
27 */ 29 */
28IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) 30IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl )
29 : QDialog( parent, name, modal, fl ) 31 : QDialog( parent, name, modal, fl )
30 32
31{ 33{
32 if ( !name ) 34 if ( !name )
33 setName( "IncomingDialog_base" ); 35 setName( "IncomingDialog_base" );
34 IncomingDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "IncomingDialog_baseLayout"); 36 IncomingDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "IncomingDialog_baseLayout");
35 37
36 PushButton4 = new QPushButton( this, "PushButton4" ); 38 PushButton4 = new QPushButton( this, "PushButton4" );
37 39
38 IncomingDialog_baseLayout->addWidget( PushButton4, 0, 1 ); 40 IncomingDialog_baseLayout->addWidget( PushButton4, 0, 1 );
39 41
40 PushButton7 = new QPushButton( this, "PushButton7" ); 42 PushButton7 = new QPushButton( this, "PushButton7" );
41 PushButton7->setDefault( TRUE ); 43 PushButton7->setDefault( TRUE );
42 44
43 IncomingDialog_baseLayout->addWidget( PushButton7, 5, 1 ); 45 IncomingDialog_baseLayout->addWidget( PushButton7, 5, 1 );
44 46
45 mMessageListView = new QListView( this, "mMessageListView" ); 47 mMessageListView = new Q3ListView( this, "mMessageListView" );
46 mMessageListView->addColumn( tr2i18n( "Summary" ) ); 48 mMessageListView->addColumn( tr2i18n( "Summary" ) );
47 mMessageListView->addColumn( tr2i18n( "Start Date" ) ); 49 mMessageListView->addColumn( tr2i18n( "Start Date" ) );
48 mMessageListView->addColumn( tr2i18n( "Start Time" ) ); 50 mMessageListView->addColumn( tr2i18n( "Start Time" ) );
49 mMessageListView->addColumn( tr2i18n( "End Date" ) ); 51 mMessageListView->addColumn( tr2i18n( "End Date" ) );
50 mMessageListView->addColumn( tr2i18n( "End Time" ) ); 52 mMessageListView->addColumn( tr2i18n( "End Time" ) );
51 mMessageListView->addColumn( tr2i18n( "Organizer" ) ); 53 mMessageListView->addColumn( tr2i18n( "Organizer" ) );
52 mMessageListView->addColumn( tr2i18n( "Method" ) ); 54 mMessageListView->addColumn( tr2i18n( "Method" ) );
53 mMessageListView->addColumn( tr2i18n( "Status" ) ); 55 mMessageListView->addColumn( tr2i18n( "Status" ) );
54 mMessageListView->setAllColumnsShowFocus( FALSE ); 56 mMessageListView->setAllColumnsShowFocus( FALSE );
55 57
56 IncomingDialog_baseLayout->addMultiCellWidget( mMessageListView, 0, 5, 0, 0 ); 58 IncomingDialog_baseLayout->addMultiCellWidget( mMessageListView, 0, 5, 0, 0 );
57 59
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
@@ -3,49 +3,53 @@
3** 3**
4** Created: Sat Mar 29 22:24:26 2003 4** Created: Sat Mar 29 22:24:26 2003
5** by: The User Interface Compiler () 5** by: The User Interface Compiler ()
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9 9
10#ifndef INCOMINGDIALOG_BASE_H 10#ifndef INCOMINGDIALOG_BASE_H
11#define INCOMINGDIALOG_BASE_H 11#define INCOMINGDIALOG_BASE_H
12 12
13#include <qvariant.h> 13#include <qvariant.h>
14#include <qdialog.h> 14#include <qdialog.h>
15 15//Added by qt3to4:
16class QVBoxLayout; 16#include <Q3VBoxLayout>
17class QHBoxLayout; 17#include <Q3GridLayout>
18class QGridLayout; 18#include <Q3HBoxLayout>
19class QListView; 19
20class QListViewItem; 20class Q3VBoxLayout;
21class Q3HBoxLayout;
22class Q3GridLayout;
23class Q3ListView;
24class Q3ListViewItem;
21class QPushButton; 25class QPushButton;
22 26
23class IncomingDialog_base : public QDialog 27class IncomingDialog_base : public QDialog
24{ 28{
25 Q_OBJECT 29 Q_OBJECT
26 30
27public: 31public:
28 IncomingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 32 IncomingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
29 ~IncomingDialog_base(); 33 ~IncomingDialog_base();
30 34
31 QPushButton* PushButton4; 35 QPushButton* PushButton4;
32 QPushButton* PushButton7; 36 QPushButton* PushButton7;
33 QListView* mMessageListView; 37 Q3ListView* mMessageListView;
34 QPushButton* PushButton7_2; 38 QPushButton* PushButton7_2;
35 QPushButton* PushButton8; 39 QPushButton* PushButton8;
36 QPushButton* PushButton9; 40 QPushButton* PushButton9;
37 41
38protected: 42protected:
39 QGridLayout* IncomingDialog_baseLayout; 43 Q3GridLayout* IncomingDialog_baseLayout;
40 44
41protected slots: 45protected slots:
42 virtual void languageChange(); 46 virtual void languageChange();
43 47
44 virtual void acceptAllMessages(); 48 virtual void acceptAllMessages();
45 virtual void acceptMessage(); 49 virtual void acceptMessage();
46 virtual void rejectMessage(); 50 virtual void rejectMessage();
47 virtual void retrieve(); 51 virtual void retrieve();
48 52
49}; 53};
50 54
51#endif // INCOMINGDIALOG_BASE_H 55#endif // INCOMINGDIALOG_BASE_H
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
@@ -15,26 +15,26 @@
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21#ifndef KORG_BASEVIEW_H 21#ifndef KORG_BASEVIEW_H
22#define KORG_BASEVIEW_H 22#define KORG_BASEVIEW_H
23// $Id$ 23// $Id$
24// KOBaseView is the abstract base class of all calendar views. 24// KOBaseView is the abstract base class of all calendar views.
25 25
26#include <qwidget.h> 26#include <qwidget.h>
27#include <qptrlist.h> 27#include <q3ptrlist.h>
28#include <qvaluelist.h> 28#include <q3valuelist.h>
29 29
30#include <klocale.h> 30#include <klocale.h>
31#include <kdebug.h> 31#include <kdebug.h>
32#include <kmessagebox.h> 32#include <kmessagebox.h>
33 33
34#include <libkcal/event.h> 34#include <libkcal/event.h>
35#include <libkcal/calendar.h> 35#include <libkcal/calendar.h>
36 36
37using namespace KCal; 37using namespace KCal;
38 38
39class CalPrinter; 39class CalPrinter;
40 40
@@ -79,25 +79,25 @@ class BaseView : public QWidget
79 virtual ~BaseView() {} 79 virtual ~BaseView() {}
80 80
81 /** 81 /**
82 Return calendar object of this view. 82 Return calendar object of this view.
83 */ 83 */
84 Calendar *calendar() { return mCalendar; } 84 Calendar *calendar() { return mCalendar; }
85 85
86 /** 86 /**
87 @return a list of selected events. Most views can probably only 87 @return a list of selected events. Most views can probably only
88 select a single event at a time, but some may be able to select 88 select a single event at a time, but some may be able to select
89 more than one. 89 more than one.
90 */ 90 */
91 virtual QPtrList<Incidence> selectedIncidences() = 0; 91 virtual Q3PtrList<Incidence> selectedIncidences() = 0;
92 92
93 /** 93 /**
94 @return a list of the dates of selected events. Most views can probably only 94 @return a list of the dates of selected events. Most views can probably only
95 select a single event at a time, but some may be able to select 95 select a single event at a time, but some may be able to select
96 more than one. 96 more than one.
97 */ 97 */
98 virtual DateList selectedDates() = 0; 98 virtual DateList selectedDates() = 0;
99 99
100 /** 100 /**
101 Generate a print preview of this event view. 101 Generate a print preview of this event view.
102 102
103 @param calPrinter Calendar printer object used for printing 103 @param calPrinter Calendar printer object used for printing
@@ -144,25 +144,25 @@ class BaseView : public QWidget
144 144
145 @param start Start of date range. 145 @param start Start of date range.
146 @param end End of date range. 146 @param end End of date range.
147 */ 147 */
148 virtual void showDates( const QDate &start, const QDate &end ) = 0; 148 virtual void showDates( const QDate &start, const QDate &end ) = 0;
149 149
150 /** 150 /**
151 Show given events. Depending on the actual view it might not be possible to 151 Show given events. Depending on the actual view it might not be possible to
152 show all given events. 152 show all given events.
153 153
154 @param eventList a list of events to show. 154 @param eventList a list of events to show.
155 */ 155 */
156 virtual void showEvents(QPtrList<Event> eventList) = 0; 156 virtual void showEvents(Q3PtrList<Event> eventList) = 0;
157 157
158 /** 158 /**
159 Updates the current display to reflect changes that may have happened 159 Updates the current display to reflect changes that may have happened
160 in the calendar since the last display refresh. 160 in the calendar since the last display refresh.
161 */ 161 */
162 virtual void updateView() = 0; 162 virtual void updateView() = 0;
163 163
164 /** 164 /**
165 Write all unsaved data back to calendar store. 165 Write all unsaved data back to calendar store.
166 */ 166 */
167 virtual void flushView() {} 167 virtual void flushView() {}
168 168
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
@@ -14,42 +14,44 @@
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef KORG_CALENDARVIEWBASE_H 20#ifndef KORG_CALENDARVIEWBASE_H
21#define KORG_CALENDARVIEWBASE_H 21#define KORG_CALENDARVIEWBASE_H
22// $Id$ 22// $Id$
23 23
24#include <qwidget.h> 24#include <qwidget.h>
25#include <qlayout.h> 25#include <qlayout.h>
26//Added by qt3to4:
27#include <Q3VBoxLayout>
26 28
27 29
28#include <libkcal/calendar.h> 30#include <libkcal/calendar.h>
29 31
30#include <korganizer/baseview.h> 32#include <korganizer/baseview.h>
31 33
32namespace KOrg { 34namespace KOrg {
33 35
34/** 36/**
35 @short interface for main calendar view widget 37 @short interface for main calendar view widget
36 @author Cornelius Schumacher 38 @author Cornelius Schumacher
37*/ 39*/
38class CalendarViewBase : public QWidget 40class CalendarViewBase : public QWidget
39{ 41{
40 Q_OBJECT 42 Q_OBJECT
41 public: 43 public:
42 CalendarViewBase(QWidget *parent, const char *name) : 44 CalendarViewBase(QWidget *parent, const char *name) :
43 QWidget(parent,name) {new QVBoxLayout(this);} 45 QWidget(parent,name) {new Q3VBoxLayout(this);}
44 virtual ~CalendarViewBase() {}; 46 virtual ~CalendarViewBase() {};
45 47
46 virtual KCal::Calendar *calendar() = 0; 48 virtual KCal::Calendar *calendar() = 0;
47 49
48 virtual QDate startDate() = 0; 50 virtual QDate startDate() = 0;
49 virtual QDate endDate() = 0; 51 virtual QDate endDate() = 0;
50 52
51 virtual Incidence *currentSelection() = 0; 53 virtual Incidence *currentSelection() = 0;
52 54
53 virtual void addView(KOrg::BaseView *) = 0; 55 virtual void addView(KOrg::BaseView *) = 0;
54 56
55 /** changes the view to be the currently selected view */ 57 /** changes the view to be the currently selected view */
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index 5269af7..2814c61 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -17,69 +17,76 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24// 24//
25// Journal Entry 25// Journal Entry
26 26
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qvbox.h> 29#include <q3vbox.h>
30#include <qfile.h> 30#include <qfile.h>
31#include <qdir.h> 31#include <qdir.h>
32#include <qtextstream.h> 32#include <q3textstream.h>
33#include <qtextcodec.h> 33#include <qtextcodec.h>
34#include <qpixmap.h> 34#include <qpixmap.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qapplication.h> 36#include <qapplication.h>
37#include <QDesktopWidget>
38//Added by qt3to4:
39#include <QResizeEvent>
40#include <Q3Frame>
41#include <QKeyEvent>
42#include <QEvent>
43#include <Q3VBoxLayout>
37 44
38#include <kdebug.h> 45#include <kdebug.h>
39#include <kglobal.h> 46#include <kglobal.h>
40#include <klocale.h> 47#include <klocale.h>
41#include <ktextedit.h> 48#include <ktextedit.h>
42#include <kfiledialog.h> 49#include <kfiledialog.h>
43#include <kmessagebox.h> 50#include <kmessagebox.h>
44#include "koprefs.h" 51#include "koprefs.h"
45#include <klineedit.h> 52#include <klineedit.h>
46#include <kdialog.h> 53#include <kdialog.h>
47#include "kolocationbox.h" 54#include "kolocationbox.h"
48 55
49#include <libkcal/journal.h> 56#include <libkcal/journal.h>
50#include <libkcal/calendarresources.h> 57#include <libkcal/calendarresources.h>
51#include <libkcal/resourcecalendar.h> 58#include <libkcal/resourcecalendar.h>
52#include <kresources/resourceselectdialog.h> 59#include <kresources/resourceselectdialog.h>
53 60
54#include "journalentry.h" 61#include "journalentry.h"
55//#include "journalentry.moc" 62//#include "journalentry.moc"
56#ifndef DESKTOP_VERSION 63#ifndef DESKTOP_VERSION
57#include <qpe/qpeapplication.h> 64#include <qpe/qpeapplication.h>
58#endif 65#endif
59JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : 66JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
60 QFrame(parent) 67 Q3Frame(parent)
61{ 68{
62 69
63 int fac = 5; 70 int fac = 5;
64 heiHint = QApplication::desktop()->height(); 71 heiHint = QApplication::desktop()->height();
65 if ( heiHint > 800 ) 72 if ( heiHint > 800 )
66 fac += 2; 73 fac += 2;
67 heiHint = heiHint / fac; 74 heiHint = heiHint / fac;
68 75
69 showOnlyMode = false; 76 showOnlyMode = false;
70 mCalendar = calendar; 77 mCalendar = calendar;
71 mJournal = 0; 78 mJournal = 0;
72 visibleMode = true; 79 visibleMode = true;
73 QHBox * vb = new QHBox ( this ); 80 Q3HBox * vb = new Q3HBox ( this );
74 QPixmap iconp; 81 QPixmap iconp;
75 vb->setMargin ( KDialog::marginHint()-1 ); 82 vb->setMargin ( KDialog::marginHint()-1 );
76 QPushButton * toggleJournal = new QPushButton( vb ); 83 QPushButton * toggleJournal = new QPushButton( vb );
77 iconp = SmallIcon("1updownarrow"); 84 iconp = SmallIcon("1updownarrow");
78 toggleJournal->setPixmap (iconp ) ; 85 toggleJournal->setPixmap (iconp ) ;
79 QLabel* textLabel = new QLabel(" "+i18n("Title: "),vb); 86 QLabel* textLabel = new QLabel(" "+i18n("Title: "),vb);
80 mTitle = new KOLocationBox(TRUE, vb, 30); 87 mTitle = new KOLocationBox(TRUE, vb, 30);
81 mTitle->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); 88 mTitle->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
82 mCalendarBox = new QComboBox(vb); 89 mCalendarBox = new QComboBox(vb);
83 mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); 90 mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
84#ifndef DESKTOP_VERSION 91#ifndef DESKTOP_VERSION
85 mTitle->setSizeLimit( 8 ); 92 mTitle->setSizeLimit( 8 );
@@ -120,31 +127,31 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
120 mMaxWidDiff = 3*size - 2*frameWidth() - textLabel->sizeHint().width(); 127 mMaxWidDiff = 3*size - 2*frameWidth() - textLabel->sizeHint().width();
121 mDeskWid = QApplication::desktop()->width(); 128 mDeskWid = QApplication::desktop()->width();
122 int maxwid = mDeskWid - mMaxWidDiff; 129 int maxwid = mDeskWid - mMaxWidDiff;
123 if ( QApplication::desktop()->width() < 640 ) { 130 if ( QApplication::desktop()->width() < 640 ) {
124 mTitle->setMaximumWidth( maxwid/2 +20 ); 131 mTitle->setMaximumWidth( maxwid/2 +20 );
125 mCalendarBox->setMaximumWidth( maxwid/2 -20); 132 mCalendarBox->setMaximumWidth( maxwid/2 -20);
126 } else { 133 } else {
127 mTitle->setMaximumWidth( (maxwid/4)*3); 134 mTitle->setMaximumWidth( (maxwid/4)*3);
128 mCalendarBox->setMaximumWidth( maxwid/2 ); 135 mCalendarBox->setMaximumWidth( maxwid/2 );
129 } 136 }
130 //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); 137 //mCalendarBox->setMaximumWidth( maxwid/2 -20 );
131 mEditor->setWordWrap( KTextEdit::WidgetWidth ); 138 mEditor->setWordWrap( KTextEdit::WidgetWidth );
132 QBoxLayout *topLayout = new QVBoxLayout(this); 139 Q3BoxLayout *topLayout = new Q3VBoxLayout(this);
133 topLayout->addWidget(vb); 140 topLayout->addWidget(vb);
134 topLayout->addWidget(mEditor); 141 topLayout->addWidget(mEditor);
135 mEditor->installEventFilter(this); 142 mEditor->installEventFilter(this);
136 installEventFilter(this); 143 installEventFilter(this);
137 mTitle->installEventFilter(this); 144 mTitle->installEventFilter(this);
138 setFocusPolicy (QWidget::NoFocus); 145 setFocusPolicy (Qt::NoFocus);
139 146
140 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 147 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
141 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); 148 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
142 connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); 149 connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
143 mTitle->load( KOLocationBox::SUMMARYJOURNAL ); 150 mTitle->load( KOLocationBox::SUMMARYJOURNAL );
144 mTitle->lineEdit ()->setText(""); 151 mTitle->lineEdit ()->setText("");
145} 152}
146 153
147JournalEntry::~JournalEntry() 154JournalEntry::~JournalEntry()
148{ 155{
149 //qDebug("JournalEntry::~JournalEntry() "); 156 //qDebug("JournalEntry::~JournalEntry() ");
150} 157}
@@ -159,70 +166,70 @@ void JournalEntry::resizeEvent(QResizeEvent* e )
159 mTitle->setMaximumWidth( maxwid/2 +20 ); 166 mTitle->setMaximumWidth( maxwid/2 +20 );
160 mCalendarBox->setMaximumWidth( maxwid/2 -20); 167 mCalendarBox->setMaximumWidth( maxwid/2 -20);
161 } 168 }
162 else { 169 else {
163 mTitle->setMaximumWidth( (maxwid/4)*3); 170 mTitle->setMaximumWidth( (maxwid/4)*3);
164 mCalendarBox->setMaximumWidth( maxwid/2 ); 171 mCalendarBox->setMaximumWidth( maxwid/2 );
165 } 172 }
166 //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); 173 //mCalendarBox->setMaximumWidth( maxwid/2 -20 );
167 } 174 }
168 //setMaximumWidth( QApplication::desktop()->width() ); 175 //setMaximumWidth( QApplication::desktop()->width() );
169 //qDebug("MAXXX %d ", QApplication::desktop()->width()); 176 //qDebug("MAXXX %d ", QApplication::desktop()->width());
170#endif 177#endif
171 QFrame::resizeEvent( e ); 178 Q3Frame::resizeEvent( e );
172} 179}
173QSize JournalEntry::sizeHint() const 180QSize JournalEntry::sizeHint() const
174{ 181{
175 return QSize ( 240, heiHint ); 182 return QSize ( 240, heiHint );
176} 183}
177void JournalEntry::slotSaveTemplate() 184void JournalEntry::slotSaveTemplate()
178{ 185{
179 QString fileName =locateLocal( "templates", "journals" ); 186 QString fileName =locateLocal( "templates", "journals" );
180 QDir t_dir; 187 QDir t_dir;
181 if ( !t_dir.exists(fileName) ) 188 if ( !t_dir.exists(fileName) )
182 t_dir.mkdir ( fileName ); 189 t_dir.mkdir ( fileName );
183 fileName += "/journal"; 190 fileName += "/journal";
184 fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this ); 191 fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this );
185 if ( fileName.length() == 0 ) 192 if ( fileName.length() == 0 )
186 return; 193 return;
187 194
188 QFile fileIn( fileName ); 195 QFile fileIn( fileName );
189 if (!fileIn.open( IO_WriteOnly ) ) { 196 if (!fileIn.open( QIODevice::WriteOnly ) ) {
190 KMessageBox::error( this, i18n("Error saving template file\n '%1'.") 197 KMessageBox::error( this, i18n("Error saving template file\n '%1'.")
191 .arg( fileName ) ); 198 .arg( fileName ) );
192 return; 199 return;
193 } 200 }
194 // QString text; 201 // QString text;
195 QTextStream tsIn( &fileIn ); 202 Q3TextStream tsIn( &fileIn );
196 tsIn.setCodec( QTextCodec::codecForName("utf8") ); 203 tsIn.setCodec( QTextCodec::codecForName("utf8") );
197 tsIn << mEditor->text(); 204 tsIn << mEditor->text();
198 fileIn.close(); 205 fileIn.close();
199} 206}
200void JournalEntry::slotLoadTemplate() 207void JournalEntry::slotLoadTemplate()
201{ 208{
202 QString fileName =locateLocal( "templates", "journals" ); 209 QString fileName =locateLocal( "templates", "journals" );
203 QDir t_dir; 210 QDir t_dir;
204 if ( !t_dir.exists(fileName) ) 211 if ( !t_dir.exists(fileName) )
205 t_dir.mkdir ( fileName ); 212 t_dir.mkdir ( fileName );
206 fileName += "/journal"; 213 fileName += "/journal";
207 fileName = KFileDialog::getOpenFileName( fileName , i18n("Insert Journal template"), this ); 214 fileName = KFileDialog::getOpenFileName( fileName , i18n("Insert Journal template"), this );
208 if ( fileName.length() == 0 ) 215 if ( fileName.length() == 0 )
209 return; 216 return;
210 QFile fileIn( fileName ); 217 QFile fileIn( fileName );
211 if (!fileIn.open( IO_ReadOnly ) ) { 218 if (!fileIn.open( QIODevice::ReadOnly ) ) {
212 KMessageBox::error( this, i18n("Error loading template file\n '%1'.") 219 KMessageBox::error( this, i18n("Error loading template file\n '%1'.")
213 .arg( fileName ) ); 220 .arg( fileName ) );
214 return; 221 return;
215 } 222 }
216 QTextStream tsIn( &fileIn ); 223 Q3TextStream tsIn( &fileIn );
217 tsIn.setCodec( QTextCodec::codecForName("utf8") ); 224 tsIn.setCodec( QTextCodec::codecForName("utf8") );
218 QString text = tsIn.read(); 225 QString text = tsIn.read();
219 fileIn.close(); 226 fileIn.close();
220 int line, col; 227 int line, col;
221 mEditor->getCursorPosition (& line, & col ); 228 mEditor->getCursorPosition (& line, & col );
222 mEditor-> insertAt ( text, line, col, true ); 229 mEditor-> insertAt ( text, line, col, true );
223 //mEditor->setIgnoreMark( true ); 230 //mEditor->setIgnoreMark( true );
224} 231}
225void JournalEntry::setDate(const QDate &date) 232void JournalEntry::setDate(const QDate &date)
226{ 233{
227 showOnlyMode = false; 234 showOnlyMode = false;
228 writeJournal(); 235 writeJournal();
@@ -307,44 +314,44 @@ Journal *JournalEntry::journal() const
307void JournalEntry::clear() 314void JournalEntry::clear()
308{ 315{
309 mJournal = 0; 316 mJournal = 0;
310 mEditor->setText(""); 317 mEditor->setText("");
311 mTitle->load( KOLocationBox::SUMMARYJOURNAL ); 318 mTitle->load( KOLocationBox::SUMMARYJOURNAL );
312 mTitle->lineEdit ()->setText(""); 319 mTitle->lineEdit ()->setText("");
313} 320}
314 321
315bool JournalEntry::eventFilter( QObject *o, QEvent *e ) 322bool JournalEntry::eventFilter( QObject *o, QEvent *e )
316{ 323{
317// kdDebug() << "JournalEntry::event received " << e->type() << endl; 324// kdDebug() << "JournalEntry::event received " << e->type() << endl;
318 if ( isVisible() ) { 325 if ( isVisible() ) {
319 mEditor->setFocusPolicy (QWidget::StrongFocus); 326 mEditor->setFocusPolicy (Qt::StrongFocus);
320 mTitle->setFocusPolicy (QWidget::StrongFocus); 327 mTitle->setFocusPolicy (Qt::StrongFocus);
321 } else { 328 } else {
322 mEditor->setFocusPolicy (QWidget::NoFocus); 329 mEditor->setFocusPolicy (Qt::NoFocus);
323 mTitle->setFocusPolicy (QWidget::NoFocus); 330 mTitle->setFocusPolicy (Qt::NoFocus);
324 } 331 }
325 if ( e->type() == QEvent::FocusOut ) { 332 if ( e->type() == QEvent::FocusOut ) {
326 writeJournal(); 333 writeJournal();
327 } 334 }
328 if ( e->type() == QEvent::KeyPress ) { 335 if ( e->type() == QEvent::KeyPress ) {
329 QKeyEvent * k = (QKeyEvent *) e; 336 QKeyEvent * k = (QKeyEvent *) e;
330 if ( !isVisible() ) 337 if ( !isVisible() )
331 return true; 338 return true;
332 if ( k->state() == Qt::ControlButton ) { 339 if ( k->state() == Qt::ControlButton ) {
333 k->ignore(); 340 k->ignore();
334 //return true; 341 //return true;
335 } 342 }
336 } 343 }
337 344
338 return QFrame::eventFilter( o, e ); // standard event processing 345 return Q3Frame::eventFilter( o, e ); // standard event processing
339} 346}
340 347
341void JournalEntry::writeJournal() 348void JournalEntry::writeJournal()
342{ 349{
343 if ( !visibleMode ) return; 350 if ( !visibleMode ) return;
344 if ( !mTitle->isEnabled() ) return; 351 if ( !mTitle->isEnabled() ) return;
345 if (mEditor->text().isEmpty() && mTitle->currentText().isEmpty()) { 352 if (mEditor->text().isEmpty() && mTitle->currentText().isEmpty()) {
346 if ( mJournal ) { 353 if ( mJournal ) {
347 Journal* j = mJournal; 354 Journal* j = mJournal;
348 mJournal = 0; 355 mJournal = 0;
349 bool conf = KOPrefs::instance()->mConfirm; 356 bool conf = KOPrefs::instance()->mConfirm;
350 KOPrefs::instance()->mConfirm = false; 357 KOPrefs::instance()->mConfirm = false;
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h
index ee17da8..0adebe9 100644
--- a/korganizer/journalentry.h
+++ b/korganizer/journalentry.h
@@ -16,37 +16,42 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef JOURNALENTRY_H 23#ifndef JOURNALENTRY_H
24#define JOURNALENTRY_H 24#define JOURNALENTRY_H
25// 25//
26// Widget showing one Journal entry 26// Widget showing one Journal entry
27 27
28#include <qframe.h> 28#include <q3frame.h>
29//Added by qt3to4:
30#include <QResizeEvent>
31#include <QEvent>
32#include <QLabel>
33#include <QKeyEvent>
29 34
30#include <libkcal/calendar.h> 35#include <libkcal/calendar.h>
31 36
32class QLabel; 37class QLabel;
33class KTextEdit; 38class KTextEdit;
34class QComboBox; 39class QComboBox;
35class KLineEdit; 40class KLineEdit;
36class KOLocationBox; 41class KOLocationBox;
37 42
38using namespace KCal; 43using namespace KCal;
39 44
40class JournalEntry : public QFrame { 45class JournalEntry : public Q3Frame {
41 Q_OBJECT 46 Q_OBJECT
42 public: 47 public:
43 JournalEntry(Calendar *,QWidget *parent); 48 JournalEntry(Calendar *,QWidget *parent);
44 virtual ~JournalEntry(); 49 virtual ~JournalEntry();
45 50
46 void setJournal(Journal *, bool saveJournal = true ); 51 void setJournal(Journal *, bool saveJournal = true );
47 Journal *journal() const; 52 Journal *journal() const;
48 53
49 void setDate(const QDate &); 54 void setDate(const QDate &);
50 55
51 void clear(); 56 void clear();
52 57
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 6697602..ecc7a2f 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -13,54 +13,58 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qkeycode.h> 25#include <qnamespace.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qtimer.h> 27#include <qtimer.h>
28#include <qframe.h> 28#include <q3frame.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qapplication.h> 30#include <qapplication.h>
31//Added by qt3to4:
32#include <QWheelEvent>
33#include <Q3GridLayout>
34#include <QEvent>
31 35
32#include <kdebug.h> 36#include <kdebug.h>
33#include <klocale.h> 37#include <klocale.h>
34#include <kglobal.h> 38#include <kglobal.h>
35 39
36#include "koglobals.h" 40#include "koglobals.h"
37#include "koprefs.h" 41#include "koprefs.h"
38#ifndef KORG_NOPLUGINS 42#ifndef KORG_NOPLUGINS
39#include "kocore.h" 43#include "kocore.h"
40#endif 44#endif
41 45
42#include <kcalendarsystem.h> 46#include <kcalendarsystem.h>
43 47
44#include "navigatorbar.h" 48#include "navigatorbar.h"
45 49
46#include "kdatenavigator.h" 50#include "kdatenavigator.h"
47 51
48KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) 52KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
49 : QFrame(parent, name), 53 : Q3Frame(parent, name),
50 updateTimer(0L) 54 updateTimer(0L)
51{ 55{
52 setFrameStyle(QFrame::NoFrame); 56 setFrameStyle(Q3Frame::NoFrame);
53 QDate startDate = QDate::currentDate(); 57 QDate startDate = QDate::currentDate();
54 QGridLayout *topLayout = new QGridLayout(this,8,8); 58 Q3GridLayout *topLayout = new Q3GridLayout(this,8,8);
55 59
56 if (! startDate.isValid()) { 60 if (! startDate.isValid()) {
57 qDebug("KDateNavigator::invalid startdate "); 61 qDebug("KDateNavigator::invalid startdate ");
58 startDate = QDate::currentDate(); 62 startDate = QDate::currentDate();
59 } 63 }
60 mMonthSignalOffset = 0; 64 mMonthSignalOffset = 0;
61 mSelectedDates.append(startDate); 65 mSelectedDates.append(startDate);
62 m_MthYr = startDate; 66 m_MthYr = startDate;
63 m_bShowWeekNums = true; 67 m_bShowWeekNums = true;
64 setFont( KOPrefs::instance()->mDateNavigatorFont ); 68 setFont( KOPrefs::instance()->mDateNavigatorFont );
65 mNavigatorBar = new NavigatorBar( startDate, this ); 69 mNavigatorBar = new NavigatorBar( startDate, this );
66 topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 ); 70 topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 );
@@ -72,45 +76,45 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
72 connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); 76 connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
73 77
74 // get the day of the week on the first day 78 // get the day of the week on the first day
75 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); 79 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1);
76 m_fstDayOfWk = dayone.dayOfWeek(); 80 m_fstDayOfWk = dayone.dayOfWeek();
77 81
78 int i; 82 int i;
79 83
80 // Set up the heading fields. 84 // Set up the heading fields.
81 for( i = 0; i < 7; i++ ) { 85 for( i = 0; i < 7; i++ ) {
82 headings[i] = new QLabel("",this); 86 headings[i] = new QLabel("",this);
83 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); 87 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold));
84 headings[i]->setAlignment(AlignCenter); 88 headings[i]->setAlignment(Qt::AlignCenter);
85 headings[i]->installEventFilter(this); 89 headings[i]->installEventFilter(this);
86 90
87 topLayout->addWidget(headings[i],1,i+1); 91 topLayout->addWidget(headings[i],1,i+1);
88 } 92 }
89 93
90 // Create the weeknumber labels 94 // Create the weeknumber labels
91 for( i = 0; i < 6; i++ ) { 95 for( i = 0; i < 6; i++ ) {
92 weeknos[i] = new QLabel(this); 96 weeknos[i] = new QLabel(this);
93 weeknos[i]->setAlignment(AlignCenter ); 97 weeknos[i]->setAlignment(Qt::AlignCenter );
94 //weeknos[i]->setFont(QFont("Arial", 10)); 98 //weeknos[i]->setFont(QFont("Arial", 10));
95 if(!m_bShowWeekNums) { 99 if(!m_bShowWeekNums) {
96 weeknos[i]->hide(); 100 weeknos[i]->hide();
97 } 101 }
98 weeknos[i]->installEventFilter(this); 102 weeknos[i]->installEventFilter(this);
99 103
100 topLayout->addWidget(weeknos[i],i+2,0); 104 topLayout->addWidget(weeknos[i],i+2,0);
101 } 105 }
102 106
103 daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); 107 daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix");
104 daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); 108 daymatrix->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken);
105 daymatrix->setLineWidth(1); 109 daymatrix->setLineWidth(1);
106 110
107 connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), 111 connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ),
108 SIGNAL( datesSelected( const KCal::DateList & ) ) ); 112 SIGNAL( datesSelected( const KCal::DateList & ) ) );
109 113
110 connect( daymatrix, SIGNAL( eventDropped( Event * ) ), 114 connect( daymatrix, SIGNAL( eventDropped( Event * ) ),
111 SIGNAL( eventDropped( Event * ) ) ); 115 SIGNAL( eventDropped( Event * ) ) );
112 116
113 topLayout->addMultiCellWidget(daymatrix,2,7,1,7); 117 topLayout->addMultiCellWidget(daymatrix,2,7,1,7);
114 118
115 // read settings from configuration file. 119 // read settings from configuration file.
116 updateConfig(); 120 updateConfig();
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h
index 780ebb8..2cbca76 100644
--- a/korganizer/kdatenavigator.h
+++ b/korganizer/kdatenavigator.h
@@ -14,40 +14,43 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KDATENAVIGATOR_H 23#ifndef KDATENAVIGATOR_H
24#define KDATENAVIGATOR_H 24#define KDATENAVIGATOR_H
25 25
26#include <qframe.h> 26#include <q3frame.h>
27#include <qdatetime.h> 27#include <qdatetime.h>
28#include <qlabel.h> 28#include <qlabel.h>
29//Added by qt3to4:
30#include <QWheelEvent>
31#include <QEvent>
29 32
30#include <libkcal/calendar.h> 33#include <libkcal/calendar.h>
31 34
32#include "kodaymatrix.h" 35#include "kodaymatrix.h"
33 36
34class QPushButton; 37class QPushButton;
35class QTimer; 38class QTimer;
36 39
37class KCalendarSystem; 40class KCalendarSystem;
38 41
39class NavigatorBar; 42class NavigatorBar;
40 43
41class KDateNavigator: public QFrame 44class KDateNavigator: public Q3Frame
42{ 45{
43 Q_OBJECT 46 Q_OBJECT
44 public: 47 public:
45 KDateNavigator( QWidget *parent = 0,const char *name = 0 ); 48 KDateNavigator( QWidget *parent = 0,const char *name = 0 );
46 ~KDateNavigator(); 49 ~KDateNavigator();
47 50
48 /** The DateNavigator automatically checks for 51 /** The DateNavigator automatically checks for
49 * the passage of midnight. If rollover type is 52 * the passage of midnight. If rollover type is
50 * set to None, no signals are emitted and no 53 * set to None, no signals are emitted and no
51 * processing is done. With rollover set to 54 * processing is done. With rollover set to
52 * FollowDay, the day highlighter changes at 55 * FollowDay, the day highlighter changes at
53 * midnight and dayPassed() is emitted. 56 * midnight and dayPassed() is emitted.
@@ -124,26 +127,26 @@ class KDateNavigator: public QFrame
124 127
125 void wheelEvent (QWheelEvent *); 128 void wheelEvent (QWheelEvent *);
126 129
127 bool eventFilter (QObject *,QEvent *); 130 bool eventFilter (QObject *,QEvent *);
128 131
129 private: 132 private:
130 QSize mySizeHint; 133 QSize mySizeHint;
131 QSize myFullSizeHint; 134 QSize myFullSizeHint;
132 bool mFontChanged; 135 bool mFontChanged;
133 int mMonthSignalOffset; 136 int mMonthSignalOffset;
134 NavigatorBar *mNavigatorBar; 137 NavigatorBar *mNavigatorBar;
135 138
136 QFrame *headingSep; 139 Q3Frame *headingSep;
137 QFrame *weeknumSep; 140 Q3Frame *weeknumSep;
138 QLabel *headings[7]; 141 QLabel *headings[7];
139 QLabel *weeknos[7]; 142 QLabel *weeknos[7];
140 KODayMatrix *daymatrix; 143 KODayMatrix *daymatrix;
141 144
142 KCal::DateList mSelectedDates; 145 KCal::DateList mSelectedDates;
143 QDate m_MthYr; 146 QDate m_MthYr;
144 int m_fstDayOfWk; 147 int m_fstDayOfWk;
145 bool m_bShowWeekNums; 148 bool m_bShowWeekNums;
146 149
147 int dayNum(int row, int col); 150 int dayNum(int row, int col);
148 int dayToIndex(int dayNum); 151 int dayToIndex(int dayNum);
149 152
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 1d4d6de..fe59787 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -20,30 +20,41 @@
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 21
22 As a special exception, permission is given to link this program 22 As a special exception, permission is given to link this program
23 with any edition of Qt, and distribute the resulting executable, 23 with any edition of Qt, and distribute the resulting executable,
24 without including the source code for Qt in the source distribution. 24 without including the source code for Qt in the source distribution.
25*/ 25*/
26 26
27#ifndef _WIN32_ 27#ifndef _WIN32_
28#define protected public 28#define protected public
29#include <qwidget.h> 29#include <qwidget.h>
30#undef protected 30#undef protected
31#endif 31#endif
32#include <qintdict.h> 32#include <q3intdict.h>
33#include <qdatetime.h> 33#include <qdatetime.h>
34#include <qapplication.h> 34#include <qapplication.h>
35#include <qpopupmenu.h> 35#include <q3popupmenu.h>
36#include <qcursor.h> 36#include <qcursor.h>
37#include <qpainter.h> 37#include <qpainter.h>
38#include <QDesktopWidget>
39//Added by qt3to4:
40#include <QResizeEvent>
41#include <QLabel>
42#include <QPixmap>
43#include <QMouseEvent>
44#include <QKeyEvent>
45#include <Q3MemArray>
46#include <QEvent>
47#include <Q3Frame>
48#include <Q3PtrList>
38 49
39#include <kdebug.h> 50#include <kdebug.h>
40#include <klocale.h> 51#include <klocale.h>
41#include <kiconloader.h> 52#include <kiconloader.h>
42#include <kglobal.h> 53#include <kglobal.h>
43 54
44#include "koagendaitem.h" 55#include "koagendaitem.h"
45#include "koprefs.h" 56#include "koprefs.h"
46#include "koglobals.h" 57#include "koglobals.h"
47 58
48#include "koagenda.h" 59#include "koagenda.h"
49 60
@@ -54,25 +65,25 @@
54#include <qpe/qpeapplication.h> 65#include <qpe/qpeapplication.h>
55#endif 66#endif
56 67
57//extern bool globalFlagBlockPainting; 68//extern bool globalFlagBlockPainting;
58extern int globalFlagBlockAgenda; 69extern int globalFlagBlockAgenda;
59extern int globalFlagBlockAgendaItemPaint; 70extern int globalFlagBlockAgendaItemPaint;
60extern int globalFlagBlockAgendaItemUpdate; 71extern int globalFlagBlockAgendaItemUpdate;
61extern int globalFlagBlockStartup; 72extern int globalFlagBlockStartup;
62 73
63 74
64//////////////////////////////////////////////////////////////////////////// 75////////////////////////////////////////////////////////////////////////////
65MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) 76MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name)
66 : QFrame(_agenda->viewport(),name), agenda(_agenda) 77 : Q3Frame(_agenda->viewport(),name), agenda(_agenda)
67{ 78{
68 setLineWidth(0); 79 setLineWidth(0);
69 setMargin(0); 80 setMargin(0);
70 setBackgroundColor(Qt::red); 81 setBackgroundColor(Qt::red);
71 minutes = new QTimer(this); 82 minutes = new QTimer(this);
72 connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc())); 83 connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc()));
73 minutes->start(0, true); 84 minutes->start(0, true);
74 mTimeBox = new QLabel(this); 85 mTimeBox = new QLabel(this);
75 mTimeBox->setAlignment(Qt::AlignRight | Qt::AlignBottom); 86 mTimeBox->setAlignment(Qt::AlignRight | Qt::AlignBottom);
76 QPalette pal = mTimeBox->palette(); 87 QPalette pal = mTimeBox->palette();
77 pal.setColor(QColorGroup::Foreground, Qt::red); 88 pal.setColor(QColorGroup::Foreground, Qt::red);
78 mTimeBox->setPalette(pal); 89 mTimeBox->setPalette(pal);
@@ -160,47 +171,47 @@ void MarcusBains::updateLocation(bool recalculate)
160 int secs = QTime::currentTime().second(); 171 int secs = QTime::currentTime().second();
161 minutes->start( (60 - secs +1)*1000 ,true); 172 minutes->start( (60 - secs +1)*1000 ,true);
162} 173}
163 174
164 175
165//////////////////////////////////////////////////////////////////////////// 176////////////////////////////////////////////////////////////////////////////
166 177
167 178
168/* 179/*
169 Create an agenda widget with rows rows and columns columns. 180 Create an agenda widget with rows rows and columns columns.
170*/ 181*/
171KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, 182KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
172 const char *name,WFlags f) : 183 const char *name,Qt::WFlags f) :
173 QScrollView(parent,name,f) 184 Q3ScrollView(parent,name,f)
174{ 185{
175 186
176 mAllAgendaPopup = 0; 187 mAllAgendaPopup = 0;
177 mColumns = columns; 188 mColumns = columns;
178 mRows = rows; 189 mRows = rows;
179 mGridSpacingY = rowSize; 190 mGridSpacingY = rowSize;
180 mAllDayMode = false; 191 mAllDayMode = false;
181#ifndef DESKTOP_VERSION 192#ifndef DESKTOP_VERSION
182 //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 193 //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
183#endif 194#endif
184 mHolidayMask = 0; 195 mHolidayMask = 0;
185 init(); 196 init();
186 connect ( this, SIGNAL (contentsMoving ( int , int ) ), this, SLOT ( slotContentMove(int,int)) ); 197 connect ( this, SIGNAL (contentsMoving ( int , int ) ), this, SLOT ( slotContentMove(int,int)) );
187} 198}
188 199
189/* 200/*
190 Create an agenda widget with columns columns and one row. This is used for 201 Create an agenda widget with columns columns and one row. This is used for
191 all-day events. 202 all-day events.
192*/ 203*/
193KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : 204KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,Qt::WFlags f) :
194 QScrollView(parent,name,f) 205 Q3ScrollView(parent,name,f)
195{ 206{
196 mAllAgendaPopup = 0; 207 mAllAgendaPopup = 0;
197 blockResize = false; 208 blockResize = false;
198 mColumns = columns; 209 mColumns = columns;
199 mRows = 1; 210 mRows = 1;
200 //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); 211 //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize);
201 mGridSpacingY = KOPrefs::instance()->mAllDaySize; 212 mGridSpacingY = KOPrefs::instance()->mAllDaySize;
202 mAllDayMode = true; 213 mAllDayMode = true;
203#ifndef DESKTOP_VERSION 214#ifndef DESKTOP_VERSION
204 //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 215 //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
205#endif 216#endif
206 mHolidayMask = 0; 217 mHolidayMask = 0;
@@ -222,57 +233,57 @@ Incidence *KOAgenda::selectedIncidence() const
222 233
223QDate KOAgenda::selectedIncidenceDate() const 234QDate KOAgenda::selectedIncidenceDate() const
224{ 235{
225 return (mSelectedItem ? mSelectedItem->itemDate() : QDate()); 236 return (mSelectedItem ? mSelectedItem->itemDate() : QDate());
226} 237}
227 238
228 239
229void KOAgenda::init() 240void KOAgenda::init()
230{ 241{
231 mPopupTimer = new QTimer(this); 242 mPopupTimer = new QTimer(this);
232 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); 243 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
233 244
234 mNewItemPopup = new QPopupMenu( this ); 245 mNewItemPopup = new Q3PopupMenu( this );
235 connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); 246 connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
236 QString pathString = ""; 247 QString pathString = "";
237 if ( !KOPrefs::instance()->mToolBarMiniIcons ) { 248 if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
238 if ( QApplication::desktop()->width() < 480 ) 249 if ( QApplication::desktop()->width() < 480 )
239 pathString += "icons16/"; 250 pathString += "icons16/";
240 } else 251 } else
241 pathString += "iconsmini/"; 252 pathString += "iconsmini/";
242 253
243 mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); 254 mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
244 mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); 255 mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
245 mNewItemPopup->insertSeparator ( ); 256 mNewItemPopup->insertSeparator ( );
246 mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); 257 mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"day" ), i18n("Day view"),3 );
247 mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); 258 mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"xdays" ), i18n("Next days"),8 );
248 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 ); 259 mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next week"),4 );
249 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); 260 mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 );
250 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("This month"),6 ); 261 mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"month" ), i18n("This month"),6 );
251 mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); 262 mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
252#ifndef _WIN32_ 263#ifndef _WIN32_
253 int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase 264 Qt::WindowFlags wflags = viewport()-> windowFlags() |Qt::WRepaintNoErase;//WResizeNoErase
254 viewport()->setWFlags ( wflags); 265 viewport()->setWindowFlags ( wflags);
255#endif 266#endif
256 mGridSpacingX = 80; 267 mGridSpacingX = 80;
257 mResizeBorderWidth = 8; 268 mResizeBorderWidth = 8;
258 mScrollBorderWidth = 8; 269 mScrollBorderWidth = 8;
259 mScrollDelay = 30; 270 mScrollDelay = 30;
260 mScrollOffset = 10; 271 mScrollOffset = 10;
261 mPaintPixmap.resize( 20,20); 272 mPaintPixmap.resize( 20,20);
262 //enableClipper(true); 273 //enableClipper(true);
263 274
264 // Grab key strokes for keyboard navigation of agenda. Seems to have no 275 // Grab key strokes for keyboard navigation of agenda. Seems to have no
265 // effect. Has to be fixed. 276 // effect. Has to be fixed.
266 setFocusPolicy(WheelFocus); 277 setFocusPolicy(Qt::WheelFocus);
267 278
268 connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); 279 connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp()));
269 connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); 280 connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown()));
270 connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize())); 281 connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize()));
271 282
272 mStartCellX = 0; 283 mStartCellX = 0;
273 mStartCellY = 0; 284 mStartCellY = 0;
274 mCurrentCellX = 0; 285 mCurrentCellX = 0;
275 mCurrentCellY = 0; 286 mCurrentCellY = 0;
276 287
277 mSelectionCellX = 0; 288 mSelectionCellX = 0;
278 mSelectionYTop = 0; 289 mSelectionYTop = 0;
@@ -386,29 +397,29 @@ void KOAgenda::changeColumns(int columns)
386bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) 397bool KOAgenda::eventFilter ( QObject *object, QEvent *event )
387{ 398{
388 // kdDebug() << "KOAgenda::eventFilter" << endl; 399 // kdDebug() << "KOAgenda::eventFilter" << endl;
389 switch(event->type()) { 400 switch(event->type()) {
390 case QEvent::MouseButtonPress: 401 case QEvent::MouseButtonPress:
391 case QEvent::MouseButtonDblClick: 402 case QEvent::MouseButtonDblClick:
392 case QEvent::MouseButtonRelease: 403 case QEvent::MouseButtonRelease:
393 case QEvent::MouseMove: 404 case QEvent::MouseMove:
394 return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); 405 return eventFilter_mouse(object, static_cast<QMouseEvent *>(event));
395 406
396 case (QEvent::Leave): 407 case (QEvent::Leave):
397 if (!mActionItem) 408 if (!mActionItem)
398 setCursor(arrowCursor); 409 setCursor(Qt::arrowCursor);
399 return true; 410 return true;
400 411
401 default: 412 default:
402 return QScrollView::eventFilter(object,event); 413 return Q3ScrollView::eventFilter(object,event);
403 } 414 }
404} 415}
405void KOAgenda::popupMenu() 416void KOAgenda::popupMenu()
406{ 417{
407 mPopupTimer->stop(); 418 mPopupTimer->stop();
408 if ( mPopupKind == 1 || mPopupKind == 3 ) { 419 if ( mPopupKind == 1 || mPopupKind == 3 ) {
409 if (mActionItem ) { 420 if (mActionItem ) {
410 endItemAction(); 421 endItemAction();
411 } 422 }
412 mLeftMouseDown = false; // no more leftMouse computation 423 mLeftMouseDown = false; // no more leftMouse computation
413 if (mPopupItem) { 424 if (mPopupItem) {
414 //mClickedItem = mPopupItem; 425 //mClickedItem = mPopupItem;
@@ -496,29 +507,29 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
496 return true; 507 return true;
497 } 508 }
498 QPoint viewportPos; 509 QPoint viewportPos;
499 if (object != viewport()) { 510 if (object != viewport()) {
500 blockmoveDist = blockmoveDist*2; 511 blockmoveDist = blockmoveDist*2;
501 viewportPos = ((QWidget *)object)->mapToParent(me->pos()); 512 viewportPos = ((QWidget *)object)->mapToParent(me->pos());
502 } else { 513 } else {
503 viewportPos = me->pos(); 514 viewportPos = me->pos();
504 } 515 }
505 bool objIsNotViewport = (object != viewport()); 516 bool objIsNotViewport = (object != viewport());
506 bool leftButt = false; 517 bool leftButt = false;
507#ifdef DESKTOP_VERSION 518#ifdef DESKTOP_VERSION
508 leftButt = (me->button() == LeftButton); 519 leftButt = (me->button() == Qt::LeftButton);
509#endif 520#endif
510 switch (me->type()) { 521 switch (me->type()) {
511 case QEvent::MouseButtonPress: 522 case QEvent::MouseButtonPress:
512 if (me->button() == LeftButton) { 523 if (me->button() == Qt::LeftButton) {
513 mPopupTimer->start( 600 ); 524 mPopupTimer->start( 600 );
514 mLeftMouseDown = true; 525 mLeftMouseDown = true;
515 } 526 }
516 blockMoving = true; 527 blockMoving = true;
517 startX = viewportPos.x(); 528 startX = viewportPos.x();
518 startY = viewportPos.y(); 529 startY = viewportPos.y();
519 mPopupPos = me->globalPos(); 530 mPopupPos = me->globalPos();
520 if ( objIsNotViewport && !leftButt ) { 531 if ( objIsNotViewport && !leftButt ) {
521 KOAgendaItem * tempItem = (KOAgendaItem *)object; 532 KOAgendaItem * tempItem = (KOAgendaItem *)object;
522 if (mAllDayMode) { 533 if (mAllDayMode) {
523 if ( tempItem->height() > 10 ) { 534 if ( tempItem->height() > 10 ) {
524 int minV = tempItem->height()/4; 535 int minV = tempItem->height()/4;
@@ -569,96 +580,96 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
569 diff *= -1; 580 diff *= -1;
570 if ( diff < minH ) { 581 if ( diff < minH ) {
571 border = true; 582 border = true;
572 objIsNotViewport = false; 583 objIsNotViewport = false;
573 } 584 }
574 } 585 }
575 } 586 }
576 } 587 }
577 } 588 }
578 if ( objIsNotViewport ) { 589 if ( objIsNotViewport ) {
579 mPopupItem = (KOAgendaItem *)object; 590 mPopupItem = (KOAgendaItem *)object;
580 mPopupKind = 1; 591 mPopupKind = 1;
581 if (me->button() == RightButton) { 592 if (me->button() == Qt::RightButton) {
582 mPopupKind = 3; 593 mPopupKind = 3;
583 popupMenu(); 594 popupMenu();
584 } else if (me->button() == LeftButton) { 595 } else if (me->button() == Qt::LeftButton) {
585 mActionItem = (KOAgendaItem *)object; 596 mActionItem = (KOAgendaItem *)object;
586 if (mActionItem) { 597 if (mActionItem) {
587 emit signalClearSelection(); 598 emit signalClearSelection();
588 slotClearSelection(); 599 slotClearSelection();
589 selectItem(mActionItem); 600 selectItem(mActionItem);
590 Incidence *incidence = mActionItem->incidence(); 601 Incidence *incidence = mActionItem->incidence();
591 if ( incidence->isReadOnly() /*|| incidence->doesRecur() */) { 602 if ( incidence->isReadOnly() /*|| incidence->doesRecur() */) {
592 mActionItem = 0; 603 mActionItem = 0;
593 } else { 604 } else {
594 startItemAction(viewportPos); 605 startItemAction(viewportPos);
595 } 606 }
596 } 607 }
597 } 608 }
598 } else { // ---------- viewport() 609 } else { // ---------- viewport()
599 mPopupItem = 0; 610 mPopupItem = 0;
600 mPopupKind = 2; 611 mPopupKind = 2;
601 selectItem(0); 612 selectItem(0);
602 mActionItem = 0; 613 mActionItem = 0;
603 if (me->button() == RightButton) { 614 if (me->button() == Qt::RightButton) {
604 int x,y; 615 int x,y;
605 viewportToContents(viewportPos.x(),viewportPos.y(),x,y); 616 viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
606 int gx,gy; 617 int gx,gy;
607 contentsToGrid(x,y,gx,gy); 618 contentsToGrid(x,y,gx,gy);
608 mCurrentCellX = gx; 619 mCurrentCellX = gx;
609 mCurrentCellY = gy; 620 mCurrentCellY = gy;
610 mStartCellX = gx; 621 mStartCellX = gx;
611 mStartCellY = gy; 622 mStartCellY = gy;
612 mPopupKind = 4; 623 mPopupKind = 4;
613 popupMenu(); 624 popupMenu();
614 } else if (me->button() == LeftButton) { 625 } else if (me->button() == Qt::LeftButton) {
615 setCursor(arrowCursor); 626 setCursor(Qt::arrowCursor);
616 startSelectAction(viewportPos); 627 startSelectAction(viewportPos);
617 } 628 }
618 } 629 }
619 break; 630 break;
620 631
621 case QEvent::MouseButtonRelease: 632 case QEvent::MouseButtonRelease:
622 if (me->button() == LeftButton ) { 633 if (me->button() == Qt::LeftButton ) {
623 mPopupTimer->stop(); 634 mPopupTimer->stop();
624 } 635 }
625 if (object != viewport()) { 636 if (object != viewport()) {
626 if (me->button() == LeftButton && mLeftMouseDown) { 637 if (me->button() == Qt::LeftButton && mLeftMouseDown) {
627 if (mActionItem) { 638 if (mActionItem) {
628 QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); 639 QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos));
629 //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); 640 //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 );
630 if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { 641 if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) {
631 mScrollUpTimer.stop(); 642 mScrollUpTimer.stop();
632 mScrollDownTimer.stop(); 643 mScrollDownTimer.stop();
633 mActionItem->resetMove(); 644 mActionItem->resetMove();
634 placeSubCells( mActionItem ); 645 placeSubCells( mActionItem );
635 // emit startDragSignal( mActionItem->incidence() ); 646 // emit startDragSignal( mActionItem->incidence() );
636 setCursor( arrowCursor ); 647 setCursor( Qt::arrowCursor );
637 mActionItem = 0; 648 mActionItem = 0;
638 mActionType = NOP; 649 mActionType = NOP;
639 mItemMoved = 0; 650 mItemMoved = 0;
640 mLeftMouseDown = false; 651 mLeftMouseDown = false;
641 return true; 652 return true;
642 } 653 }
643 endItemAction(); 654 endItemAction();
644 } 655 }
645 } 656 }
646 657
647 } else { // ---------- viewport() 658 } else { // ---------- viewport()
648 if (me->button() == LeftButton && mLeftMouseDown ) { //left click 659 if (me->button() == Qt::LeftButton && mLeftMouseDown ) { //left click
649 endSelectAction( true ); // emit new event signal 660 endSelectAction( true ); // emit new event signal
650 } 661 }
651 } 662 }
652 if (me->button() == LeftButton) 663 if (me->button() == Qt::LeftButton)
653 mLeftMouseDown = false; 664 mLeftMouseDown = false;
654 665
655 break; 666 break;
656 667
657 case QEvent::MouseMove: 668 case QEvent::MouseMove:
658 //qDebug("mm "); 669 //qDebug("mm ");
659 if ( !mLeftMouseDown ) 670 if ( !mLeftMouseDown )
660 return false; 671 return false;
661 if ( blockMoving ) { 672 if ( blockMoving ) {
662 int dX, dY; 673 int dX, dY;
663 dX = startX - viewportPos.x(); 674 dX = startX - viewportPos.x();
664 if ( dX < 0 ) 675 if ( dX < 0 )
@@ -841,50 +852,50 @@ void KOAgenda::startItemAction(QPoint viewportPos)
841 852
842 mStartCellX = gx; 853 mStartCellX = gx;
843 mStartCellY = gy; 854 mStartCellY = gy;
844 mCurrentCellX = gx; 855 mCurrentCellX = gx;
845 mCurrentCellY = gy; 856 mCurrentCellY = gy;
846 bool allowResize = ( mActionItem->incidence()->typeID() != todoID ); 857 bool allowResize = ( mActionItem->incidence()->typeID() != todoID );
847 858
848 if (mAllDayMode) { 859 if (mAllDayMode) {
849 int gridDistanceX = (x - gx * mGridSpacingX); 860 int gridDistanceX = (x - gx * mGridSpacingX);
850 if ( allowResize && gridDistanceX < mResizeBorderWidth && 861 if ( allowResize && gridDistanceX < mResizeBorderWidth &&
851 mActionItem->cellX() == mCurrentCellX) { 862 mActionItem->cellX() == mCurrentCellX) {
852 mActionType = RESIZELEFT; 863 mActionType = RESIZELEFT;
853 setCursor(sizeHorCursor); 864 setCursor(Qt::sizeHorCursor);
854 } else if ( allowResize && (mGridSpacingX - gridDistanceX) < mResizeBorderWidth && 865 } else if ( allowResize && (mGridSpacingX - gridDistanceX) < mResizeBorderWidth &&
855 mActionItem->cellXWidth() == mCurrentCellX) { 866 mActionItem->cellXWidth() == mCurrentCellX) {
856 mActionType = RESIZERIGHT; 867 mActionType = RESIZERIGHT;
857 setCursor(sizeHorCursor); 868 setCursor(Qt::sizeHorCursor);
858 } else { 869 } else {
859 mActionType = MOVE; 870 mActionType = MOVE;
860 mActionItem->startMove(); 871 mActionItem->startMove();
861 setCursor(sizeAllCursor); 872 setCursor(Qt::sizeAllCursor);
862 } 873 }
863 } else { 874 } else {
864 int gridDistanceY = (y - gy * mGridSpacingY); 875 int gridDistanceY = (y - gy * mGridSpacingY);
865 if (allowResize && gridDistanceY < mResizeBorderWidth && 876 if (allowResize && gridDistanceY < mResizeBorderWidth &&
866 mActionItem->cellYTop() == mCurrentCellY && 877 mActionItem->cellYTop() == mCurrentCellY &&
867 !mActionItem->firstMultiItem()) { 878 !mActionItem->firstMultiItem()) {
868 mActionType = RESIZETOP; 879 mActionType = RESIZETOP;
869 setCursor(sizeVerCursor); 880 setCursor(Qt::sizeVerCursor);
870 } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && 881 } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth &&
871 mActionItem->cellYBottom() == mCurrentCellY && 882 mActionItem->cellYBottom() == mCurrentCellY &&
872 !mActionItem->lastMultiItem()) { 883 !mActionItem->lastMultiItem()) {
873 mActionType = RESIZEBOTTOM; 884 mActionType = RESIZEBOTTOM;
874 setCursor(sizeVerCursor); 885 setCursor(Qt::sizeVerCursor);
875 } else { 886 } else {
876 mActionType = MOVE; 887 mActionType = MOVE;
877 mActionItem->startMove(); 888 mActionItem->startMove();
878 setCursor(sizeAllCursor); 889 setCursor(Qt::sizeAllCursor);
879 } 890 }
880 } 891 }
881} 892}
882 893
883void KOAgenda::performItemAction(QPoint viewportPos) 894void KOAgenda::performItemAction(QPoint viewportPos)
884{ 895{
885// kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl; 896// kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl;
886// QPoint point = viewport()->mapToGlobal(viewportPos); 897// QPoint point = viewport()->mapToGlobal(viewportPos);
887// kdDebug() << "Global: " << point.x() << "," << point.y() << endl; 898// kdDebug() << "Global: " << point.x() << "," << point.y() << endl;
888// point = clipper()->mapFromGlobal(point); 899// point = clipper()->mapFromGlobal(point);
889// kdDebug() << "clipper: " << point.x() << "," << point.y() << endl; 900// kdDebug() << "clipper: " << point.x() << "," << point.y() << endl;
890// kdDebug() << "visible height: " << visibleHeight() << endl; 901// kdDebug() << "visible height: " << visibleHeight() << endl;
@@ -897,45 +908,45 @@ void KOAgenda::performItemAction(QPoint viewportPos)
897 mapFromGlobal(viewport()->mapToGlobal(viewportPos)); 908 mapFromGlobal(viewport()->mapToGlobal(viewportPos));
898 909
899 // Cursor left active agenda area. 910 // Cursor left active agenda area.
900 // This starts a drag. 911 // This starts a drag.
901 if ( /*clipperPos.y() < 0 || clipperPos.y() > visibleHeight() ||*/ 912 if ( /*clipperPos.y() < 0 || clipperPos.y() > visibleHeight() ||*/
902 clipperPos.x() < 0 || clipperPos.x() > visibleWidth() ) { 913 clipperPos.x() < 0 || clipperPos.x() > visibleWidth() ) {
903 if ( mActionType == MOVE ) { 914 if ( mActionType == MOVE ) {
904 mScrollUpTimer.stop(); 915 mScrollUpTimer.stop();
905 mScrollDownTimer.stop(); 916 mScrollDownTimer.stop();
906 mActionItem->resetMove(); 917 mActionItem->resetMove();
907 placeSubCells( mActionItem ); 918 placeSubCells( mActionItem );
908 // emit startDragSignal( mActionItem->incidence() ); 919 // emit startDragSignal( mActionItem->incidence() );
909 setCursor( arrowCursor ); 920 setCursor( Qt::arrowCursor );
910 mActionItem = 0; 921 mActionItem = 0;
911 mActionType = NOP; 922 mActionType = NOP;
912 mItemMoved = 0; 923 mItemMoved = 0;
913 return; 924 return;
914 } 925 }
915 } else { 926 } else {
916 switch ( mActionType ) { 927 switch ( mActionType ) {
917 case MOVE: 928 case MOVE:
918 setCursor( sizeAllCursor ); 929 setCursor( Qt::sizeAllCursor );
919 break; 930 break;
920 case RESIZETOP: 931 case RESIZETOP:
921 case RESIZEBOTTOM: 932 case RESIZEBOTTOM:
922 setCursor( sizeVerCursor ); 933 setCursor( Qt::sizeVerCursor );
923 break; 934 break;
924 case RESIZELEFT: 935 case RESIZELEFT:
925 case RESIZERIGHT: 936 case RESIZERIGHT:
926 setCursor( sizeHorCursor ); 937 setCursor( Qt::sizeHorCursor );
927 break; 938 break;
928 default: 939 default:
929 setCursor( arrowCursor ); 940 setCursor( Qt::arrowCursor );
930 } 941 }
931 } 942 }
932 943
933 // Scroll if item was moved to upper or lower end of agenda. 944 // Scroll if item was moved to upper or lower end of agenda.
934 if (clipperPos.y() < mScrollBorderWidth) { 945 if (clipperPos.y() < mScrollBorderWidth) {
935 mScrollUpTimer.start(mScrollDelay); 946 mScrollUpTimer.start(mScrollDelay);
936 } else if (visibleHeight() - clipperPos.y() < 947 } else if (visibleHeight() - clipperPos.y() <
937 mScrollBorderWidth) { 948 mScrollBorderWidth) {
938 mScrollDownTimer.start(mScrollDelay); 949 mScrollDownTimer.start(mScrollDelay);
939 } else { 950 } else {
940 mScrollUpTimer.stop(); 951 mScrollUpTimer.stop();
941 mScrollDownTimer.stop(); 952 mScrollDownTimer.stop();
@@ -962,25 +973,25 @@ void KOAgenda::performItemAction(QPoint viewportPos)
962 moveItem->raise(); 973 moveItem->raise();
963 moveChild(moveItem,x+diff,y); 974 moveChild(moveItem,x+diff,y);
964 moveItem = moveItem->nextMultiItem(); 975 moveItem = moveItem->nextMultiItem();
965 } 976 }
966 } else if (mActionType == RESIZETOP) { 977 } else if (mActionType == RESIZETOP) {
967 if (mCurrentCellY <= mActionItem->cellYBottom()) { 978 if (mCurrentCellY <= mActionItem->cellYBottom()) {
968 mActionItem->expandTop(gy - mCurrentCellY); 979 mActionItem->expandTop(gy - mCurrentCellY);
969 mActionItem->resize(mActionItem->width(), 980 mActionItem->resize(mActionItem->width(),
970 mGridSpacingY * mActionItem->cellHeight()); 981 mGridSpacingY * mActionItem->cellHeight());
971 int x,y; 982 int x,y;
972 gridToContents(mCurrentCellX,mActionItem->cellYTop(),x,y); 983 gridToContents(mCurrentCellX,mActionItem->cellYTop(),x,y);
973 //moveChild(mActionItem,childX(mActionItem),y); 984 //moveChild(mActionItem,childX(mActionItem),y);
974 QScrollView::moveChild( mActionItem,childX(mActionItem),y ); 985 Q3ScrollView::moveChild( mActionItem,childX(mActionItem),y );
975 } 986 }
976 } else if (mActionType == RESIZEBOTTOM) { 987 } else if (mActionType == RESIZEBOTTOM) {
977 if (mCurrentCellY >= mActionItem->cellYTop()) { 988 if (mCurrentCellY >= mActionItem->cellYTop()) {
978 mActionItem->expandBottom(gy - mCurrentCellY); 989 mActionItem->expandBottom(gy - mCurrentCellY);
979 mActionItem->resize(mActionItem->width(), 990 mActionItem->resize(mActionItem->width(),
980 mGridSpacingY * mActionItem->cellHeight()); 991 mGridSpacingY * mActionItem->cellHeight());
981 } 992 }
982 } else if (mActionType == RESIZELEFT) { 993 } else if (mActionType == RESIZELEFT) {
983 if (mCurrentCellX <= mActionItem->cellXWidth()) { 994 if (mCurrentCellX <= mActionItem->cellXWidth()) {
984 mActionItem->expandLeft(gx - mCurrentCellX); 995 mActionItem->expandLeft(gx - mCurrentCellX);
985 int diff = mActionItem->resizeMe(mGridSpacingX , 996 int diff = mActionItem->resizeMe(mGridSpacingX ,
986 mGridSpacingX * mActionItem->cellWidth(), 997 mGridSpacingX * mActionItem->cellWidth(),
@@ -1010,25 +1021,25 @@ void KOAgenda::endItemAction()
1010 placeItem = mActionItem; 1021 placeItem = mActionItem;
1011 } 1022 }
1012 if ( placeItem->incidence()->doesRecur() ) { 1023 if ( placeItem->incidence()->doesRecur() ) {
1013 Incidence* oldInc = placeItem->incidence(); 1024 Incidence* oldInc = placeItem->incidence();
1014 placeItem->recreateIncidence(); 1025 placeItem->recreateIncidence();
1015 emit addToCalSignal(placeItem->incidence(), oldInc ); 1026 emit addToCalSignal(placeItem->incidence(), oldInc );
1016 } 1027 }
1017 int type = mActionType; 1028 int type = mActionType;
1018 if ( mAllDayMode ) 1029 if ( mAllDayMode )
1019 type = -1; 1030 type = -1;
1020 KOAgendaItem *modifiedItem = placeItem; 1031 KOAgendaItem *modifiedItem = placeItem;
1021 //emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */); 1032 //emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */);
1022 QPtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems(); 1033 Q3PtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems();
1023 KOAgendaItem *item; 1034 KOAgendaItem *item;
1024 1035
1025 if ( placeItem->incidence()->typeID() == todoID ) { 1036 if ( placeItem->incidence()->typeID() == todoID ) {
1026 mSelectedItem = 0; 1037 mSelectedItem = 0;
1027 //qDebug("todo %d %d %d ", mCurrentCellX, modifiedItem->cellX() ,modifiedItem->cellXWidth()); 1038 //qDebug("todo %d %d %d ", mCurrentCellX, modifiedItem->cellX() ,modifiedItem->cellXWidth());
1028 modifiedItem->mLastMoveXPos = mCurrentCellX; 1039 modifiedItem->mLastMoveXPos = mCurrentCellX;
1029 emit itemModified( modifiedItem, mActionType ); 1040 emit itemModified( modifiedItem, mActionType );
1030 } 1041 }
1031 else { 1042 else {
1032 1043
1033 1044
1034 globalFlagBlockAgendaItemPaint = 1; 1045 globalFlagBlockAgendaItemPaint = 1;
@@ -1101,25 +1112,25 @@ void KOAgenda::endItemAction()
1101 item->repaint(false); 1112 item->repaint(false);
1102 } 1113 }
1103 */ 1114 */
1104 1115
1105 1116
1106 } 1117 }
1107 1118
1108 } 1119 }
1109 if ( mActionItem ) 1120 if ( mActionItem )
1110 emit incidenceSelected( mActionItem->incidence() ); 1121 emit incidenceSelected( mActionItem->incidence() );
1111 mScrollUpTimer.stop(); 1122 mScrollUpTimer.stop();
1112 mScrollDownTimer.stop(); 1123 mScrollDownTimer.stop();
1113 setCursor( arrowCursor ); 1124 setCursor( Qt::arrowCursor );
1114 mActionItem = 0; 1125 mActionItem = 0;
1115 mActionType = NOP; 1126 mActionType = NOP;
1116 mItemMoved = 0; 1127 mItemMoved = 0;
1117 1128
1118} 1129}
1119 1130
1120void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos) 1131void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos)
1121{ 1132{
1122// kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl; 1133// kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl;
1123// QPoint point = viewport()->mapToGlobal(viewportPos); 1134// QPoint point = viewport()->mapToGlobal(viewportPos);
1124// kdDebug() << "Global: " << point.x() << "," << point.y() << endl; 1135// kdDebug() << "Global: " << point.x() << "," << point.y() << endl;
1125// point = clipper()->mapFromGlobal(point); 1136// point = clipper()->mapFromGlobal(point);
@@ -1127,64 +1138,64 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos)
1127 1138
1128 int x,y; 1139 int x,y;
1129 viewportToContents(viewportPos.x(),viewportPos.y(),x,y); 1140 viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
1130// kdDebug() << "contents: " << x << "," << y << "\n" << endl; 1141// kdDebug() << "contents: " << x << "," << y << "\n" << endl;
1131 int gx,gy; 1142 int gx,gy;
1132 contentsToGrid(x,y,gx,gy); 1143 contentsToGrid(x,y,gx,gy);
1133 1144
1134 // Change cursor to resize cursor if appropriate 1145 // Change cursor to resize cursor if appropriate
1135 if (mAllDayMode) { 1146 if (mAllDayMode) {
1136 int gridDistanceX = (x - gx * mGridSpacingX); 1147 int gridDistanceX = (x - gx * mGridSpacingX);
1137 if (gridDistanceX < mResizeBorderWidth && 1148 if (gridDistanceX < mResizeBorderWidth &&
1138 moveItem->cellX() == gx) { 1149 moveItem->cellX() == gx) {
1139 setCursor(sizeHorCursor); 1150 setCursor(Qt::sizeHorCursor);
1140 } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && 1151 } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth &&
1141 moveItem->cellXWidth() == gx) { 1152 moveItem->cellXWidth() == gx) {
1142 setCursor(sizeHorCursor); 1153 setCursor(Qt::sizeHorCursor);
1143 } else { 1154 } else {
1144 setCursor(arrowCursor); 1155 setCursor(Qt::arrowCursor);
1145 } 1156 }
1146 } else { 1157 } else {
1147 int gridDistanceY = (y - gy * mGridSpacingY); 1158 int gridDistanceY = (y - gy * mGridSpacingY);
1148 if (gridDistanceY < mResizeBorderWidth && 1159 if (gridDistanceY < mResizeBorderWidth &&
1149 moveItem->cellYTop() == gy && 1160 moveItem->cellYTop() == gy &&
1150 !moveItem->firstMultiItem()) { 1161 !moveItem->firstMultiItem()) {
1151 setCursor(sizeVerCursor); 1162 setCursor(Qt::sizeVerCursor);
1152 } else if ((mGridSpacingY - gridDistanceY) < mResizeBorderWidth && 1163 } else if ((mGridSpacingY - gridDistanceY) < mResizeBorderWidth &&
1153 moveItem->cellYBottom() == gy && 1164 moveItem->cellYBottom() == gy &&
1154 !moveItem->lastMultiItem()) { 1165 !moveItem->lastMultiItem()) {
1155 setCursor(sizeVerCursor); 1166 setCursor(Qt::sizeVerCursor);
1156 } else { 1167 } else {
1157 setCursor(arrowCursor); 1168 setCursor(Qt::arrowCursor);
1158 } 1169 }
1159 } 1170 }
1160} 1171}
1161 1172
1162 1173
1163/* 1174/*
1164 Place item in cell and take care that multiple items using the same cell do 1175 Place item in cell and take care that multiple items using the same cell do
1165 not overlap. This method is not yet optimal. It doesn´t use the maximum space 1176 not overlap. This method is not yet optimal. It doesn´t use the maximum space
1166 it can get in all cases. 1177 it can get in all cases.
1167 At the moment the method has a bug: When an item is placed only the sub cell 1178 At the moment the method has a bug: When an item is placed only the sub cell
1168 widths of the items are changed, which are within the Y region the item to 1179 widths of the items are changed, which are within the Y region the item to
1169 place spans. When the sub cell width change of one of this items affects a 1180 place spans. When the sub cell width change of one of this items affects a
1170 cell, where other items are, which do not overlap in Y with the item to place, 1181 cell, where other items are, which do not overlap in Y with the item to place,
1171 the display gets corrupted, although the corruption looks quite nice. 1182 the display gets corrupted, although the corruption looks quite nice.
1172*/ 1183*/
1173void KOAgenda::placeSubCells(KOAgendaItem *placeItem) 1184void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
1174{ 1185{
1175 1186
1176 QPtrList<KOAgendaItem> conflictItems; 1187 Q3PtrList<KOAgendaItem> conflictItems;
1177 int maxSubCells = 0; 1188 int maxSubCells = 0;
1178 QIntDict<KOAgendaItem> subCellDict(7); 1189 Q3IntDict<KOAgendaItem> subCellDict(7);
1179 1190
1180 KOAgendaItem *item; 1191 KOAgendaItem *item;
1181 for ( item=mItems.first(); item != 0; item=mItems.next() ) { 1192 for ( item=mItems.first(); item != 0; item=mItems.next() ) {
1182 if (item != placeItem) { 1193 if (item != placeItem) {
1183 if (placeItem->cellX() <= item->cellXWidth() && 1194 if (placeItem->cellX() <= item->cellXWidth() &&
1184 placeItem->cellXWidth() >= item->cellX()) { 1195 placeItem->cellXWidth() >= item->cellX()) {
1185 if ((placeItem->cellYTop() <= item->cellYBottom()) && 1196 if ((placeItem->cellYTop() <= item->cellYBottom()) &&
1186 (placeItem->cellYBottom() >= item->cellYTop())) { 1197 (placeItem->cellYBottom() >= item->cellYTop())) {
1187 conflictItems.append(item); 1198 conflictItems.append(item);
1188 if (item->subCells() > maxSubCells) 1199 if (item->subCells() > maxSubCells)
1189 maxSubCells = item->subCells(); 1200 maxSubCells = item->subCells();
1190 subCellDict.insert(item->subCell(),item); 1201 subCellDict.insert(item->subCell(),item);
@@ -1231,25 +1242,25 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
1231 } else { 1242 } else {
1232 x += item->subCell() * newSubCellWidth; 1243 x += item->subCell() * newSubCellWidth;
1233 } 1244 }
1234 moveChild(item,x+diff,y); 1245 moveChild(item,x+diff,y);
1235 // qDebug("moveChild %s %d %d ", item->incidence()->summary().latin1() ,x,y); 1246 // qDebug("moveChild %s %d %d ", item->incidence()->summary().latin1() ,x,y);
1236 //item->updateItem(); 1247 //item->updateItem();
1237 } 1248 }
1238 // Adjust sub cell geometry of all conflict items of all conflict items 1249 // Adjust sub cell geometry of all conflict items of all conflict items
1239 for ( item=conflictItems.first(); item != 0; 1250 for ( item=conflictItems.first(); item != 0;
1240 item=conflictItems.next() ) { 1251 item=conflictItems.next() ) {
1241 if ( placeItem != item ) { 1252 if ( placeItem != item ) {
1242 KOAgendaItem *item2; 1253 KOAgendaItem *item2;
1243 QPtrList<KOAgendaItem> conflictItems2 = item->conflictItems(); 1254 Q3PtrList<KOAgendaItem> conflictItems2 = item->conflictItems();
1244 for ( item2=conflictItems2.first(); item2 != 0; 1255 for ( item2=conflictItems2.first(); item2 != 0;
1245 item2=conflictItems2.next() ) { 1256 item2=conflictItems2.next() ) {
1246 if ( item2->subCells() != maxSubCells) { 1257 if ( item2->subCells() != maxSubCells) {
1247 item2->setSubCells(maxSubCells); 1258 item2->setSubCells(maxSubCells);
1248 int diff = 0; 1259 int diff = 0;
1249 if (mAllDayMode) { 1260 if (mAllDayMode) {
1250 diff = item2->resizeMe(mGridSpacingX, item2->cellWidth() * mGridSpacingX, newSubCellWidth); 1261 diff = item2->resizeMe(mGridSpacingX, item2->cellWidth() * mGridSpacingX, newSubCellWidth);
1251 } else { 1262 } else {
1252 item2->resize(newSubCellWidth, item2->cellHeight() * mGridSpacingY); 1263 item2->resize(newSubCellWidth, item2->cellHeight() * mGridSpacingY);
1253 } 1264 }
1254 int x,y; 1265 int x,y;
1255 gridToContents(item2->cellX(),item2->cellYTop(),x,y); 1266 gridToContents(item2->cellX(),item2->cellYTop(),x,y);
@@ -1316,79 +1327,79 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
1316 //qDebug(" %d %d %d %d %d", cx, cy, cw,ch,mGridSpacingX-1) ; 1327 //qDebug(" %d %d %d %d %d", cx, cy, cw,ch,mGridSpacingX-1) ;
1317 1328
1318 if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) { 1329 if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) {
1319 if ( mGridSpacingX == cw && mSelectionHeight > 0 && ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && 1330 if ( mGridSpacingX == cw && mSelectionHeight > 0 && ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
1320 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) ) { 1331 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) ) {
1321 1332
1322 int vxSel, vySel; 1333 int vxSel, vySel;
1323 contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel); 1334 contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel);
1324 int off = mSelectionHeight; 1335 int off = mSelectionHeight;
1325 if ( vySel < 0 ) 1336 if ( vySel < 0 )
1326 off += vySel; 1337 off += vySel;
1327 //qDebug("OFF %d %d %d", off,vySel, vy ); 1338 //qDebug("OFF %d %d %d", off,vySel, vy );
1328 bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP); 1339 bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,QPainter::CompositionMode_Source);
1329 } else { 1340 } else {
1330 bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); 1341 bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source);
1331 } 1342 }
1332 } 1343 }
1333 if ( mSelectionHeight > 0 ) { 1344 if ( mSelectionHeight > 0 ) {
1334 //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); 1345 //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
1335 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && 1346 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
1336 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { 1347 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
1337 contentsToViewport ( selectionX, mSelectionYTop, vx,vy); 1348 contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
1338 // bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); 1349 // bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
1339 int hei = mSelectionHeight; 1350 int hei = mSelectionHeight;
1340 int offset = 0; 1351 int offset = 0;
1341 while ( hei > 0 ) { 1352 while ( hei > 0 ) {
1342 int p_hei = 5; 1353 int p_hei = 5;
1343 if ( hei < 5 ) p_hei = hei; 1354 if ( hei < 5 ) p_hei = hei;
1344 hei -= 5; 1355 hei -= 5;
1345 bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP); 1356 bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source);
1346 offset += 5; 1357 offset += 5;
1347 } 1358 }
1348 } 1359 }
1349 } 1360 }
1350 p->begin( pd ); 1361 p->begin( pd );
1351 } else { 1362 } else {
1352#if 0 1363#if 0
1353 qDebug("mCurPixWid %d %d ",mCurPixWid, contentsWidth() ); 1364 qDebug("mCurPixWid %d %d ",mCurPixWid, contentsWidth() );
1354 if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) { 1365 if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) {
1355 qDebug("WAUWAU "); 1366 qDebug("WAUWAU ");
1356 drawContentsToPainter(); 1367 drawContentsToPainter();
1357 } 1368 }
1358#endif 1369#endif
1359 QPaintDevice* pd = p->device(); 1370 QPaintDevice* pd = p->device();
1360 p->end(); 1371 p->end();
1361 int vx, vy; 1372 int vx, vy;
1362 int selectionX = KOGlobals::self()->reverseLayout() ? 1373 int selectionX = KOGlobals::self()->reverseLayout() ?
1363 (mColumns - 1 - mSelectionCellX) * mGridSpacingX : 1374 (mColumns - 1 - mSelectionCellX) * mGridSpacingX :
1364 mSelectionCellX * mGridSpacingX; 1375 mSelectionCellX * mGridSpacingX;
1365 contentsToViewport ( cx, cy, vx,vy); 1376 contentsToViewport ( cx, cy, vx,vy);
1366 // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; 1377 // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ;
1367 if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) 1378 if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) )
1368 bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); 1379 bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source);
1369 1380
1370 if ( mSelectionHeight > 0 ) { 1381 if ( mSelectionHeight > 0 ) {
1371 //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); 1382 //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
1372 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && 1383 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
1373 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { 1384 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
1374 contentsToViewport ( selectionX, mSelectionYTop, vx,vy); 1385 contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
1375 //bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); 1386 //bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
1376 int hei = mSelectionHeight; 1387 int hei = mSelectionHeight;
1377 int offset = 0; 1388 int offset = 0;
1378 while ( hei > 0 ) { 1389 while ( hei > 0 ) {
1379 int p_hei = 5; 1390 int p_hei = 5;
1380 if ( hei < 5 ) p_hei = hei; 1391 if ( hei < 5 ) p_hei = hei;
1381 hei -= 5; 1392 hei -= 5;
1382 bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP); 1393 bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source);
1383 offset += 5; 1394 offset += 5;
1384 } 1395 }
1385 } 1396 }
1386 } 1397 }
1387 p->begin( pd ); 1398 p->begin( pd );
1388 } 1399 }
1389 1400
1390} 1401}
1391 1402
1392void KOAgenda::finishUpdate() 1403void KOAgenda::finishUpdate()
1393{ 1404{
1394 1405
@@ -1567,32 +1578,32 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i
1567 1578
1568 int x = ((int)(cx/mGridSpacingX))*mGridSpacingX; 1579 int x = ((int)(cx/mGridSpacingX))*mGridSpacingX;
1569 if ( mGridSpacingX > 0 ) { 1580 if ( mGridSpacingX > 0 ) {
1570 while (x < cx + cw) { 1581 while (x < cx + cw) {
1571 p->drawLine(x,cy,x,cy+ch); 1582 p->drawLine(x,cy,x,cy+ch);
1572 x+=mGridSpacingX; 1583 x+=mGridSpacingX;
1573 } 1584 }
1574 } 1585 }
1575 // Draw horizontal lines of grid 1586 // Draw horizontal lines of grid
1576 int y = ((int)(cy/lGridSpacingY))*lGridSpacingY; 1587 int y = ((int)(cy/lGridSpacingY))*lGridSpacingY;
1577 if ( lGridSpacingY > 0 ) { 1588 if ( lGridSpacingY > 0 ) {
1578 while (y < cy + ch) { 1589 while (y < cy + ch) {
1579 p->setPen( SolidLine ); 1590 p->setPen( Qt::SolidLine );
1580 p->drawLine(cx,y,cx+cw,y); 1591 p->drawLine(cx,y,cx+cw,y);
1581 y+=lGridSpacingY; 1592 y+=lGridSpacingY;
1582 p->setPen( DotLine ); 1593 p->setPen( Qt::DotLine );
1583 p->drawLine(cx,y,cx+cw,y); 1594 p->drawLine(cx,y,cx+cw,y);
1584 y+=lGridSpacingY; 1595 y+=lGridSpacingY;
1585 } 1596 }
1586 p->setPen( SolidLine ); 1597 p->setPen( Qt::SolidLine );
1587 } 1598 }
1588 mPixPainter.end() ; 1599 mPixPainter.end() ;
1589} 1600}
1590 1601
1591/* 1602/*
1592 Convert srcollview contents coordinates to agenda grid coordinates. 1603 Convert srcollview contents coordinates to agenda grid coordinates.
1593*/ 1604*/
1594void KOAgenda::contentsToGrid (int x, int y, int& gx, int& gy) 1605void KOAgenda::contentsToGrid (int x, int y, int& gx, int& gy)
1595{ 1606{
1596 gx = KOGlobals::self()->reverseLayout() ? mColumns - 1 - x/mGridSpacingX : 1607 gx = KOGlobals::self()->reverseLayout() ? mColumns - 1 - x/mGridSpacingX :
1597 x/mGridSpacingX; 1608 x/mGridSpacingX;
1598 gy = y/mGridSpacingY; 1609 gy = y/mGridSpacingY;
@@ -1708,25 +1719,25 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
1708 // ( todo->hasCompletedDate() && todo->completed().date() == currentDate )|| 1719 // ( todo->hasCompletedDate() && todo->completed().date() == currentDate )||
1709 KOAgendaItem *item; 1720 KOAgendaItem *item;
1710 item = getItemForTodo ( todo ); 1721 item = getItemForTodo ( todo );
1711 //qDebug("KOAgenda::updateTodo %d %d %d %d", this, todo, days, remove); 1722 //qDebug("KOAgenda::updateTodo %d %d %d %d", this, todo, days, remove);
1712 if ( item ) { 1723 if ( item ) {
1713 blockSignals( true ); 1724 blockSignals( true );
1714 //qDebug("item found "); 1725 //qDebug("item found ");
1715 item->hide(); 1726 item->hide();
1716 item->setCellX(-2, -1 ); 1727 item->setCellX(-2, -1 );
1717 item->select(false); 1728 item->select(false);
1718 mUnusedItems.append( item ); 1729 mUnusedItems.append( item );
1719 mItems.remove( item ); 1730 mItems.remove( item );
1720 QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); 1731 Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
1721 KOAgendaItem *itemit; 1732 KOAgendaItem *itemit;
1722 //globalFlagBlockAgendaItemPaint = 1; 1733 //globalFlagBlockAgendaItemPaint = 1;
1723 for ( itemit=oldconflictItems.first(); itemit != 0; 1734 for ( itemit=oldconflictItems.first(); itemit != 0;
1724 itemit=oldconflictItems.next() ) { 1735 itemit=oldconflictItems.next() ) {
1725 if ( itemit != item ) 1736 if ( itemit != item )
1726 placeSubCells(itemit); 1737 placeSubCells(itemit);
1727 } 1738 }
1728 qApp->processEvents(); 1739 qApp->processEvents();
1729 //globalFlagBlockAgendaItemPaint = 0; 1740 //globalFlagBlockAgendaItemPaint = 0;
1730 for ( itemit=oldconflictItems.first(); itemit != 0; 1741 for ( itemit=oldconflictItems.first(); itemit != 0;
1731 itemit=oldconflictItems.next() ) { 1742 itemit=oldconflictItems.next() ) {
1732 globalFlagBlockAgendaItemUpdate = 0; 1743 globalFlagBlockAgendaItemUpdate = 0;
@@ -1738,25 +1749,25 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
1738 //itemit->repaint( false ); repaintItem() 1749 //itemit->repaint( false ); repaintItem()
1739 } 1750 }
1740 blockSignals( false ); 1751 blockSignals( false );
1741 } 1752 }
1742 if ( remove ) { 1753 if ( remove ) {
1743 //qDebug("remove****************************************** "); 1754 //qDebug("remove****************************************** ");
1744 return; 1755 return;
1745 } 1756 }
1746 if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) 1757 if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda )
1747 return; 1758 return;
1748 //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); 1759 //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ ");
1749 QDate currentDate = QDate::currentDate(); 1760 QDate currentDate = QDate::currentDate();
1750 bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); 1761 bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda );
1751 QDateTime dt; 1762 QDateTime dt;
1752 if ( todo->hasCompletedDate() ) 1763 if ( todo->hasCompletedDate() )
1753 dt = todo->completed(); 1764 dt = todo->completed();
1754 else 1765 else
1755 dt = todo->dtDue(); 1766 dt = todo->dtDue();
1756 if ( overdue ) { 1767 if ( overdue ) {
1757 days += todo->dtDue().date().daysTo( currentDate ); 1768 days += todo->dtDue().date().daysTo( currentDate );
1758 } 1769 }
1759 else 1770 else
1760 currentDate = dt.date(); 1771 currentDate = dt.date();
1761 1772
1762 if (( todo->doesFloat() || overdue) && !todo->hasCompletedDate() ) { 1773 if (( todo->doesFloat() || overdue) && !todo->hasCompletedDate() ) {
@@ -1770,25 +1781,25 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
1770 else { 1781 else {
1771 if ( mAllDayMode ) return; 1782 if ( mAllDayMode ) return;
1772 // mAgenda 1783 // mAgenda
1773 globalFlagBlockAgendaItemPaint = 1; 1784 globalFlagBlockAgendaItemPaint = 1;
1774 int endY = timeToY(dt.time()) - 1; 1785 int endY = timeToY(dt.time()) - 1;
1775 int hi = 12/KOPrefs::instance()->mHourSize; 1786 int hi = 12/KOPrefs::instance()->mHourSize;
1776 int startY = endY - 1-hi; 1787 int startY = endY - 1-hi;
1777 item = insertItem(todo,currentDate,days,startY,endY); 1788 item = insertItem(todo,currentDate,days,startY,endY);
1778 item->show(); 1789 item->show();
1779 } 1790 }
1780 qApp->processEvents(); 1791 qApp->processEvents();
1781 globalFlagBlockAgendaItemPaint = 0; 1792 globalFlagBlockAgendaItemPaint = 0;
1782 QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); 1793 Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
1783 KOAgendaItem *itemit; 1794 KOAgendaItem *itemit;
1784 for ( itemit=oldconflictItems.first(); itemit != 0; 1795 for ( itemit=oldconflictItems.first(); itemit != 0;
1785 itemit=oldconflictItems.next() ) { 1796 itemit=oldconflictItems.next() ) {
1786 globalFlagBlockAgendaItemUpdate = 0; 1797 globalFlagBlockAgendaItemUpdate = 0;
1787 itemit->repaintMe(); 1798 itemit->repaintMe();
1788 globalFlagBlockAgendaItemUpdate = 1; 1799 globalFlagBlockAgendaItemUpdate = 1;
1789 itemit->repaint(); 1800 itemit->repaint();
1790 } 1801 }
1791 globalFlagBlockAgendaItemUpdate = 0; 1802 globalFlagBlockAgendaItemUpdate = 0;
1792 item->repaintMe(); 1803 item->repaintMe();
1793 globalFlagBlockAgendaItemUpdate = 1; 1804 globalFlagBlockAgendaItemUpdate = 1;
1794 item->repaint(); 1805 item->repaint();
@@ -1858,25 +1869,25 @@ void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd,
1858 int YTop,int YBottom) 1869 int YTop,int YBottom)
1859{ 1870{
1860 if (mAllDayMode) { 1871 if (mAllDayMode) {
1861 ; 1872 ;
1862 return; 1873 return;
1863 } 1874 }
1864 1875
1865 int cellX,cellYTop,cellYBottom; 1876 int cellX,cellYTop,cellYBottom;
1866 QString newtext; 1877 QString newtext;
1867 int width = XEnd - XBegin + 1; 1878 int width = XEnd - XBegin + 1;
1868 int count = 0; 1879 int count = 0;
1869 KOAgendaItem *current = 0; 1880 KOAgendaItem *current = 0;
1870 QPtrList<KOAgendaItem> multiItems; 1881 Q3PtrList<KOAgendaItem> multiItems;
1871 for (cellX = XBegin;cellX <= XEnd;++cellX) { 1882 for (cellX = XBegin;cellX <= XEnd;++cellX) {
1872 if (cellX == XBegin) cellYTop = YTop; 1883 if (cellX == XBegin) cellYTop = YTop;
1873 else cellYTop = 0; 1884 else cellYTop = 0;
1874 if (cellX == XEnd) cellYBottom = YBottom; 1885 if (cellX == XEnd) cellYBottom = YBottom;
1875 else cellYBottom = rows() - 1; 1886 else cellYBottom = rows() - 1;
1876 newtext = QString("(%1/%2): ").arg(++count).arg(width); 1887 newtext = QString("(%1/%2): ").arg(++count).arg(width);
1877 newtext.append(event->summary()); 1888 newtext.append(event->summary());
1878 current = insertItem(event,qd,cellX,cellYTop,cellYBottom); 1889 current = insertItem(event,qd,cellX,cellYTop,cellYBottom);
1879 current->setText(newtext); 1890 current->setText(newtext);
1880 multiItems.append(current); 1891 multiItems.append(current);
1881 } 1892 }
1882 1893
@@ -1918,25 +1929,25 @@ void KOAgenda::finishResize ( )
1918 finishUpdate(); 1929 finishUpdate();
1919 //qDebug("finishUpdate() called "); 1930 //qDebug("finishUpdate() called ");
1920 } 1931 }
1921} 1932}
1922/* 1933/*
1923 Overridden from QScrollView to provide proper resizing of KOAgendaItems. 1934 Overridden from QScrollView to provide proper resizing of KOAgendaItems.
1924*/ 1935*/
1925void KOAgenda::resizeEvent ( QResizeEvent *ev ) 1936void KOAgenda::resizeEvent ( QResizeEvent *ev )
1926{ 1937{
1927 mSelectionHeight = 0; 1938 mSelectionHeight = 0;
1928 mResizeTimer.start( 150 , true ); 1939 mResizeTimer.start( 150 , true );
1929 computeSizes(); 1940 computeSizes();
1930 QScrollView::resizeEvent( ev ); 1941 Q3ScrollView::resizeEvent( ev );
1931 return; 1942 return;
1932 1943
1933} 1944}
1934void KOAgenda::computeSizes() 1945void KOAgenda::computeSizes()
1935{ 1946{
1936 if ( globalFlagBlockStartup ) 1947 if ( globalFlagBlockStartup )
1937 return; 1948 return;
1938 int frameOffset = frameWidth() * 2 +1; 1949 int frameOffset = frameWidth() * 2 +1;
1939 if (mAllDayMode) { 1950 if (mAllDayMode) {
1940 mGridSpacingX = (width()-frameOffset) / mColumns; 1951 mGridSpacingX = (width()-frameOffset) / mColumns;
1941 mGridSpacingY = height() - 2 * frameWidth() - 1; 1952 mGridSpacingY = height() - 2 * frameWidth() - 1;
1942 resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY + 1); 1953 resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY + 1);
@@ -2007,25 +2018,25 @@ void KOAgenda::scrollDown()
2007{ 2018{
2008 scrollBy(0,mScrollOffset); 2019 scrollBy(0,mScrollOffset);
2009} 2020}
2010 2021
2011void KOAgenda::popupAlarm() 2022void KOAgenda::popupAlarm()
2012{ 2023{
2013 if (!mClickedItem) { 2024 if (!mClickedItem) {
2014 qDebug("KOAgenda::popupAlarm() called without having a clicked item "); 2025 qDebug("KOAgenda::popupAlarm() called without having a clicked item ");
2015 return; 2026 return;
2016 } 2027 }
2017 // TODO: deal correctly with multiple alarms 2028 // TODO: deal correctly with multiple alarms
2018 Alarm* alarm; 2029 Alarm* alarm;
2019 QPtrList<Alarm> list(mClickedItem->incidence()->alarms()); 2030 Q3PtrList<Alarm> list(mClickedItem->incidence()->alarms());
2020 for(alarm=list.first();alarm;alarm=list.next()) { 2031 for(alarm=list.first();alarm;alarm=list.next()) {
2021 alarm->toggleAlarm(); 2032 alarm->toggleAlarm();
2022 } 2033 }
2023 emit itemModified( mClickedItem , KOGlobals::EVENTEDITED ); 2034 emit itemModified( mClickedItem , KOGlobals::EVENTEDITED );
2024 mClickedItem->paintMe( true ); 2035 mClickedItem->paintMe( true );
2025 mClickedItem->repaint( false ); 2036 mClickedItem->repaint( false );
2026} 2037}
2027 2038
2028/* 2039/*
2029 Calculates the minimum width 2040 Calculates the minimum width
2030*/ 2041*/
2031int KOAgenda::minimumWidth() const 2042int KOAgenda::minimumWidth() const
@@ -2098,34 +2109,34 @@ void KOAgenda::selectItem(KOAgendaItem *item)
2098 emit incidenceSelected( 0 ); 2109 emit incidenceSelected( 0 );
2099 return; 2110 return;
2100 } 2111 }
2101 mSelectedItem = item; 2112 mSelectedItem = item;
2102 mSelectedItem->select(); 2113 mSelectedItem->select();
2103 emit incidenceSelected( mSelectedItem->incidence() ); 2114 emit incidenceSelected( mSelectedItem->incidence() );
2104} 2115}
2105 2116
2106// This function seems never be called. 2117// This function seems never be called.
2107void KOAgenda::keyPressEvent( QKeyEvent *kev ) 2118void KOAgenda::keyPressEvent( QKeyEvent *kev )
2108{ 2119{
2109 switch(kev->key()) { 2120 switch(kev->key()) {
2110 case Key_PageDown: 2121 case Qt::Key_PageDown:
2111 verticalScrollBar()->addPage(); 2122 verticalScrollBar()->addPage();
2112 break; 2123 break;
2113 case Key_PageUp: 2124 case Qt::Key_PageUp:
2114 verticalScrollBar()->subtractPage(); 2125 verticalScrollBar()->subtractPage();
2115 break; 2126 break;
2116 case Key_Down: 2127 case Qt::Key_Down:
2117 verticalScrollBar()->addLine(); 2128 verticalScrollBar()->addLine();
2118 break; 2129 break;
2119 case Key_Up: 2130 case Qt::Key_Up:
2120 verticalScrollBar()->subtractLine(); 2131 verticalScrollBar()->subtractLine();
2121 break; 2132 break;
2122 default: 2133 default:
2123 ; 2134 ;
2124 } 2135 }
2125} 2136}
2126 2137
2127void KOAgenda::calculateWorkingHours() 2138void KOAgenda::calculateWorkingHours()
2128{ 2139{
2129// mWorkingHoursEnable = KOPrefs::instance()->mEnableWorkingHours; 2140// mWorkingHoursEnable = KOPrefs::instance()->mEnableWorkingHours;
2130 mWorkingHoursEnable = !mAllDayMode; 2141 mWorkingHoursEnable = !mAllDayMode;
2131 2142
@@ -2137,41 +2148,41 @@ void KOAgenda::calculateWorkingHours()
2137 2148
2138 2149
2139DateList KOAgenda::dateList() const 2150DateList KOAgenda::dateList() const
2140{ 2151{
2141 return mSelectedDates; 2152 return mSelectedDates;
2142} 2153}
2143 2154
2144void KOAgenda::setDateList(const DateList &selectedDates) 2155void KOAgenda::setDateList(const DateList &selectedDates)
2145{ 2156{
2146 mSelectedDates = selectedDates; 2157 mSelectedDates = selectedDates;
2147} 2158}
2148 2159
2149void KOAgenda::setHolidayMask(QMemArray<bool> *mask) 2160void KOAgenda::setHolidayMask(Q3MemArray<bool> *mask)
2150{ 2161{
2151 mHolidayMask = mask; 2162 mHolidayMask = mask;
2152 2163
2153/* 2164/*
2154 kdDebug() << "HolidayMask: "; 2165 kdDebug() << "HolidayMask: ";
2155 for(uint i=0;i<mask->count();++i) { 2166 for(uint i=0;i<mask->count();++i) {
2156 kdDebug() << (mask->at(i) ? "*" : "o"); 2167 kdDebug() << (mask->at(i) ? "*" : "o");
2157 } 2168 }
2158 kdDebug() << endl; 2169 kdDebug() << endl;
2159*/ 2170*/
2160} 2171}
2161 2172
2162void KOAgenda::contentsMousePressEvent ( QMouseEvent *event ) 2173void KOAgenda::contentsMousePressEvent ( QMouseEvent *event )
2163{ 2174{
2164 2175
2165 QScrollView::contentsMousePressEvent(event); 2176 Q3ScrollView::contentsMousePressEvent(event);
2166} 2177}
2167 2178
2168void KOAgenda::storePosition() 2179void KOAgenda::storePosition()
2169{ 2180{
2170 //mContentPosition 2181 //mContentPosition
2171 int max = mGridSpacingY*4*24; 2182 int max = mGridSpacingY*4*24;
2172 if ( contentsY() < 5 && max > viewport()->height()*3/2 ) 2183 if ( contentsY() < 5 && max > viewport()->height()*3/2 )
2173 mContentPosition = 0; 2184 mContentPosition = 0;
2174 else if ( contentsY() + viewport()->height() > max - 5 && max > viewport()->height()*3/2) 2185 else if ( contentsY() + viewport()->height() > max - 5 && max > viewport()->height()*3/2)
2175 mContentPosition = -1.0; 2186 mContentPosition = -1.0;
2176 else 2187 else
2177 mContentPosition = ((float) max)/ ((float)(contentsY()+ ( viewport()->height()/2))); 2188 mContentPosition = ((float) max)/ ((float)(contentsY()+ ( viewport()->height()/2)));
@@ -2187,31 +2198,31 @@ void KOAgenda::restorePosition()
2187 else 2198 else
2188 if ( mContentPosition == 0 ) 2199 if ( mContentPosition == 0 )
2189 posY = 0; 2200 posY = 0;
2190 else 2201 else
2191 posY = (int) ((max/mContentPosition)-(viewport()->height()/2)); 2202 posY = (int) ((max/mContentPosition)-(viewport()->height()/2));
2192 setContentsPos (0, posY ); 2203 setContentsPos (0, posY );
2193 //qDebug("posY %d hei %d", posY, max); 2204 //qDebug("posY %d hei %d", posY, max);
2194 2205
2195} 2206}
2196void KOAgenda::moveChild( QWidget *w, int x , int y ) 2207void KOAgenda::moveChild( QWidget *w, int x , int y )
2197{ 2208{
2198 ++x; 2209 ++x;
2199 QScrollView::moveChild( w, x , y ); 2210 Q3ScrollView::moveChild( w, x , y );
2200} 2211}
2201#include <qmessagebox.h> 2212#include <qmessagebox.h>
2202#ifdef DESKTOP_VERSION 2213#ifdef DESKTOP_VERSION
2203#include <qprinter.h> 2214#include <qprinter.h>
2204#include <qpainter.h> 2215#include <qpainter.h>
2205#include <qpaintdevicemetrics.h> 2216#include <q3paintdevicemetrics.h>
2206 2217
2207#endif 2218#endif
2208void KOAgenda::printSelection() 2219void KOAgenda::printSelection()
2209{ 2220{
2210#ifdef DESKTOP_VERSION 2221#ifdef DESKTOP_VERSION
2211 if ( mStartCellY == mCurrentCellY ) { 2222 if ( mStartCellY == mCurrentCellY ) {
2212 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2223 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2213 i18n("Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. "), 2224 i18n("Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. "),
2214 i18n("OK"), 0, 0, 2225 i18n("OK"), 0, 0,
2215 0, 1 ); 2226 0, 1 );
2216 return; 2227 return;
2217 } 2228 }
@@ -2222,25 +2233,25 @@ void KOAgenda::printSelection()
2222 w= contentsWidth()+2; 2233 w= contentsWidth()+2;
2223 // h= contentsHeight(); 2234 // h= contentsHeight();
2224 y = mGridSpacingY*mStartCellY; 2235 y = mGridSpacingY*mStartCellY;
2225 h = mGridSpacingY*(mCurrentCellY+1)-y+2; 2236 h = mGridSpacingY*(mCurrentCellY+1)-y+2;
2226 2237
2227 //return; 2238 //return;
2228 QPrinter* printer = new QPrinter(); 2239 QPrinter* printer = new QPrinter();
2229 if ( !printer->setup()) { 2240 if ( !printer->setup()) {
2230 delete printer; 2241 delete printer;
2231 return; 2242 return;
2232 } 2243 }
2233 QPainter p( printer ); 2244 QPainter p( printer );
2234 QPaintDeviceMetrics m = QPaintDeviceMetrics ( printer ); 2245 Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( printer );
2235 QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() ); 2246 QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() );
2236 //date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true ); 2247 //date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true );
2237 int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height(); 2248 int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height();
2238 // p.drawText( 0, 0, date ); 2249 // p.drawText( 0, 0, date );
2239 int offset = m.width()/8; 2250 int offset = m.width()/8;
2240 // compute the scale 2251 // compute the scale
2241 dx = ((float) m.width()-offset) / (float)w; 2252 dx = ((float) m.width()-offset) / (float)w;
2242 dy = (float)(m.height() - ( 2 * hei )-offset ) / (float)h; 2253 dy = (float)(m.height() - ( 2 * hei )-offset ) / (float)h;
2243 float scale; 2254 float scale;
2244 // scale to fit the width or height of the paper 2255 // scale to fit the width or height of the paper
2245 if ( dx < dy ) 2256 if ( dx < dy )
2246 scale = dx; 2257 scale = dx;
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index 380ce62..0708341 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -14,75 +14,84 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOAGENDA_H 23#ifndef KOAGENDA_H
24#define KOAGENDA_H 24#define KOAGENDA_H
25 25
26#include <qscrollview.h> 26#include <q3scrollview.h>
27#include <qtimer.h> 27#include <qtimer.h>
28#include <qmemarray.h> 28#include <q3memarray.h>
29#include <qpainter.h> 29#include <qpainter.h>
30#include <qpixmap.h> 30#include <qpixmap.h>
31#include <qguardedptr.h> 31#include <qpointer.h>
32//Added by qt3to4:
33#include <QResizeEvent>
34#include <Q3Frame>
35#include <QLabel>
36#include <QMouseEvent>
37#include <Q3PtrList>
38#include <Q3PopupMenu>
39#include <QKeyEvent>
40#include <QEvent>
32 41
33#include "koagendaitem.h" 42#include "koagendaitem.h"
34#include "koeventview.h" 43#include "koeventview.h"
35 44
36class QPopupMenu; 45class Q3PopupMenu;
37class QTime; 46class QTime;
38class KConfig; 47class KConfig;
39class QFrame; 48class Q3Frame;
40class KOAgenda; 49class KOAgenda;
41class KCal::Event; 50class KCal::Event;
42class KCal::Todo; 51class KCal::Todo;
43 52
44using namespace KCal; 53using namespace KCal;
45 54
46class MarcusBains : public QFrame { 55class MarcusBains : public Q3Frame {
47 Q_OBJECT 56 Q_OBJECT
48 public: 57 public:
49 MarcusBains(KOAgenda *agenda=0,const char *name=0); 58 MarcusBains(KOAgenda *agenda=0,const char *name=0);
50 virtual ~MarcusBains(); 59 virtual ~MarcusBains();
51 void hideMe(); 60 void hideMe();
52 public slots: 61 public slots:
53 void updateLocation(bool recalculate=false); 62 void updateLocation(bool recalculate=false);
54 void updateLoc(); 63 void updateLoc();
55 64
56 private: 65 private:
57 int todayColumn(); 66 int todayColumn();
58 QTimer *minutes; 67 QTimer *minutes;
59 QLabel *mTimeBox; 68 QLabel *mTimeBox;
60 KOAgenda *agenda; 69 KOAgenda *agenda;
61 QTime oldTime; 70 QTime oldTime;
62 int oldToday; 71 int oldToday;
63}; 72};
64 73
65 74
66class KOAgenda : public QScrollView 75class KOAgenda : public Q3ScrollView
67{ 76{
68 Q_OBJECT 77 Q_OBJECT
69 public: 78 public:
70 enum MouseActionType { NOP, MOVE, SELECT, 79 enum MouseActionType { NOP, MOVE, SELECT,
71 RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; 80 RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT };
72 81
73 KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, 82 KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0,
74 const char * name=0, WFlags f=0 ); 83 const char * name=0, Qt::WFlags f=0 );
75 KOAgenda ( int columns, QWidget * parent=0, 84 KOAgenda ( int columns, QWidget * parent=0,
76 const char * name=0, WFlags f=0 ); 85 const char * name=0, Qt::WFlags f=0 );
77 virtual ~KOAgenda(); 86 virtual ~KOAgenda();
78 bool mInvalidPixmap; 87 bool mInvalidPixmap;
79 88
80 Incidence *selectedIncidence() const; 89 Incidence *selectedIncidence() const;
81 QDate selectedIncidenceDate() const; 90 QDate selectedIncidenceDate() const;
82 91
83 virtual bool eventFilter ( QObject *, QEvent * ); 92 virtual bool eventFilter ( QObject *, QEvent * );
84 93
85 void contentsToGrid (int x, int y, int& gx, int& gy); 94 void contentsToGrid (int x, int y, int& gx, int& gy);
86 void gridToContents (int gx, int gy, int& x, int& y); 95 void gridToContents (int gx, int gy, int& x, int& y);
87 96
88 int timeToY (const QTime &time); 97 int timeToY (const QTime &time);
@@ -108,25 +117,25 @@ class KOAgenda : public QScrollView
108 void clear(); 117 void clear();
109 118
110 void clearSelection(); 119 void clearSelection();
111 void hideUnused(); 120 void hideUnused();
112 121
113 /** Calculates the minimum width */ 122 /** Calculates the minimum width */
114 virtual int minimumWidth() const; 123 virtual int minimumWidth() const;
115 /** Update configuration from preference settings */ 124 /** Update configuration from preference settings */
116 void updateConfig(); 125 void updateConfig();
117 126
118 void checkScrollBoundaries(); 127 void checkScrollBoundaries();
119 128
120 void setHolidayMask(QMemArray<bool> *); 129 void setHolidayMask(Q3MemArray<bool> *);
121 void setDateList(const DateList &selectedDates); 130 void setDateList(const DateList &selectedDates);
122 DateList dateList() const; 131 DateList dateList() const;
123 void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); 132 void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false);
124 void finishUpdate(); 133 void finishUpdate();
125 void printSelection(); 134 void printSelection();
126 void storePosition(); 135 void storePosition();
127 void restorePosition(); 136 void restorePosition();
128 void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; } 137 void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; }
129 void shrinkPixmap(); 138 void shrinkPixmap();
130 QTime getEndTime(); 139 QTime getEndTime();
131 bool invalidPixmap(); 140 bool invalidPixmap();
132 141
@@ -268,41 +277,41 @@ class KOAgenda : public QScrollView
268 // Selection 277 // Selection
269 int mSelectionCellX; 278 int mSelectionCellX;
270 int mSelectionYTop; 279 int mSelectionYTop;
271 int mSelectionHeight; 280 int mSelectionHeight;
272 281
273 // List of dates to be displayed 282 // List of dates to be displayed
274 DateList mSelectedDates; 283 DateList mSelectedDates;
275 284
276 // The KOAgendaItem, which has been right-clicked last 285 // The KOAgendaItem, which has been right-clicked last
277 KOAgendaItem *mClickedItem; 286 KOAgendaItem *mClickedItem;
278 287
279 // The KOAgendaItem, which is being moved/resized 288 // The KOAgendaItem, which is being moved/resized
280 QGuardedPtr<KOAgendaItem> mActionItem; 289 QPointer<KOAgendaItem> mActionItem;
281 290
282 // Currently selected item 291 // Currently selected item
283 QGuardedPtr<KOAgendaItem> mSelectedItem; 292 QPointer<KOAgendaItem> mSelectedItem;
284 293
285 // The Marcus Bains Line widget. 294 // The Marcus Bains Line widget.
286 MarcusBains *mMarcusBains; 295 MarcusBains *mMarcusBains;
287 void computeSizes(); 296 void computeSizes();
288 297
289 MouseActionType mActionType; 298 MouseActionType mActionType;
290 299
291 bool mItemMoved; 300 bool mItemMoved;
292 301
293 // List of all Items contained in agenda 302 // List of all Items contained in agenda
294 QPtrList<KOAgendaItem> mItems; 303 Q3PtrList<KOAgendaItem> mItems;
295 QPtrList<KOAgendaItem> mUnusedItems; 304 Q3PtrList<KOAgendaItem> mUnusedItems;
296 KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport); 305 KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport);
297 QPopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems 306 Q3PopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems
298 QPopupMenu *mNewItemPopup; 307 Q3PopupMenu *mNewItemPopup;
299 308
300 int mOldLowerScrollValue; 309 int mOldLowerScrollValue;
301 int mOldUpperScrollValue; 310 int mOldUpperScrollValue;
302 KOAgendaItem * getItemForTodo ( Todo * todo ); 311 KOAgendaItem * getItemForTodo ( Todo * todo );
303 QMemArray<bool> *mHolidayMask; 312 Q3MemArray<bool> *mHolidayMask;
304 int mCurPixWid; 313 int mCurPixWid;
305 int mCurPixHei; 314 int mCurPixHei;
306}; 315};
307 316
308#endif // KOAGENDA_H 317#endif // KOAGENDA_H
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 407424d..0f9a38f 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -10,31 +10,41 @@
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <qlabel.h> 20#include <qlabel.h>
21#include <qlayout.h> 21#include <qlayout.h>
22#include <qhbox.h> 22#include <q3hbox.h>
23#include <qvbox.h> 23#include <q3vbox.h>
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qwhatsthis.h> 25#include <q3whatsthis.h>
26#include <qdragobject.h> 26#include <q3dragobject.h>
27#include <qdrawutil.h> 27#include <qdrawutil.h>
28#include <qpainter.h> 28#include <qpainter.h>
29#include <QDesktopWidget>
30//Added by qt3to4:
31#include <Q3PtrList>
32#include <QPixmap>
33#include <QDragEnterEvent>
34#include <QDropEvent>
35#include <QResizeEvent>
36#include <QMouseEvent>
37#include <QEvent>
38#include <QPaintEvent>
29 39
30#include <kiconloader.h> 40#include <kiconloader.h>
31#include <kdebug.h> 41#include <kdebug.h>
32#include <kglobal.h> 42#include <kglobal.h>
33#include <klocale.h> 43#include <klocale.h>
34#ifndef DESKTOP_VERSION 44#ifndef DESKTOP_VERSION
35#include <qpe/qpeapplication.h> 45#include <qpe/qpeapplication.h>
36#define AGENDA_ICON_SIZE 5 46#define AGENDA_ICON_SIZE 5
37#else 47#else
38#include <qapplication.h> 48#include <qapplication.h>
39#define AGENDA_ICON_SIZE 7 49#define AGENDA_ICON_SIZE 7
40#endif 50#endif
@@ -48,71 +58,71 @@ extern int globalFlagBlockAgendaItemUpdate;
48#include "koprefs.h" 58#include "koprefs.h"
49 59
50#include "koagendaitem.h" 60#include "koagendaitem.h"
51//#include "koagendaitem.moc" 61//#include "koagendaitem.moc"
52 62
53 63
54//-------------------------------------------------------------------------- 64//--------------------------------------------------------------------------
55 65
56QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; 66QToolTipGroup *KOAgendaItem::mToolTipGroup = 0;
57 67
58//-------------------------------------------------------------------------- 68//--------------------------------------------------------------------------
59 69
60class KOAgendaItemWhatsThis :public QWhatsThis 70class KOAgendaItemWhatsThis :public Q3WhatsThis
61{ 71{
62public: 72public:
63 KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; 73 KOAgendaItemWhatsThis( KOAgendaItem* view ) : Q3WhatsThis( view ),_view (view) { };
64 74
65protected: 75protected:
66 virtual QString text( const QPoint& ) 76 virtual QString text( const QPoint& )
67 { 77 {
68 return _view->getWhatsThisText() ; 78 return _view->getWhatsThisText() ;
69 } 79 }
70private: 80private:
71 KOAgendaItem * _view; 81 KOAgendaItem * _view;
72}; 82};
73 83
74KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, 84KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday,
75 const char *name,WFlags) : 85 const char *name,Qt::WFlags) :
76 QWidget(parent, name), mIncidence(incidence), mDate(qd) 86 QWidget(parent, name), mIncidence(incidence), mDate(qd)
77{ 87{
78#ifndef DESKTOP_VERSION 88#ifndef DESKTOP_VERSION
79 //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); 89 //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
80#endif 90#endif
81 mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this); 91 mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this);
82 int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase 92 Qt::WindowFlags wflags = windowFlags() |Qt::WRepaintNoErase;// WResizeNoErase
83 setWFlags ( wflags); 93 setWindowFlags ( wflags);
84 mAllDay = allday; 94 mAllDay = allday;
85 init ( incidence, qd ); 95 init ( incidence, qd );
86 //setMouseTracking(true); 96 //setMouseTracking(true);
87 //setAcceptDrops(true); 97 //setAcceptDrops(true);
88 xPaintCoord = -1; 98 xPaintCoord = -1;
89 yPaintCoord = -1; 99 yPaintCoord = -1;
90} 100}
91QString KOAgendaItem::getWhatsThisText() 101QString KOAgendaItem::getWhatsThisText()
92{ 102{
93 if ( mIncidence ) 103 if ( mIncidence )
94 return KIncidenceFormatter::instance()->getFormattedText( mIncidence, 104 return KIncidenceFormatter::instance()->getFormattedText( mIncidence,
95 KOPrefs::instance()->mWTshowDetails, 105 KOPrefs::instance()->mWTshowDetails,
96 KOPrefs::instance()->mWTshowCreated, 106 KOPrefs::instance()->mWTshowCreated,
97 KOPrefs::instance()->mWTshowChanged); 107 KOPrefs::instance()->mWTshowChanged);
98 return "KOAgendaItem::getWhatsThisText()::internal error"; 108 return "KOAgendaItem::getWhatsThisText()::internal error";
99} 109}
100 110
101void KOAgendaItem::initColor () 111void KOAgendaItem::initColor ()
102{ 112{
103 if ( (mIncidence->typeID() == todoID ) && 113 if ( (mIncidence->typeID() == todoID ) &&
104 ( !((static_cast<Todo*>(mIncidence))->isCompleted()) && 114 ( !((static_cast<Todo*>(mIncidence))->isCompleted()) &&
105 ((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) { 115 ((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) {
106 if ( (static_cast<Todo*>(mIncidence))->dtDue() < QDateTime::currentDateTime().date()) 116 if ( (static_cast<Todo*>(mIncidence))->dtDue() < (QDateTime)QDateTime::currentDateTime().date())
107 mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; 117 mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ;
108 else 118 else
109 mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; 119 mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor;
110 } 120 }
111 else { 121 else {
112 QStringList categories = mIncidence->categories(); 122 QStringList categories = mIncidence->categories();
113 QString cat = categories.first(); 123 QString cat = categories.first();
114 if (cat.isEmpty()) { 124 if (cat.isEmpty()) {
115 if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) ) 125 if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) )
116 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; 126 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
117 else 127 else
118 mBackgroundColor =KOPrefs::instance()->defaultColor( mIncidence->calID() ); 128 mBackgroundColor =KOPrefs::instance()->defaultColor( mIncidence->calID() );
@@ -123,25 +133,25 @@ void KOAgendaItem::initColor ()
123 mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; 133 mBackgroundColor = KOPrefs::instance()->mTodoDoneColor;
124 } 134 }
125 } 135 }
126 136
127 } 137 }
128 138
129 QColor BackgroundColor ( mBackgroundColor ); 139 QColor BackgroundColor ( mBackgroundColor );
130 if ( mIncidence->calID() > 1 ) { 140 if ( mIncidence->calID() > 1 ) {
131 //BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() ); 141 //BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() );
132 } 142 }
133 mColorGroup = QColorGroup( BackgroundColor.light(), 143 mColorGroup = QColorGroup( BackgroundColor.light(),
134 BackgroundColor.dark(),BackgroundColor.light(), 144 BackgroundColor.dark(),BackgroundColor.light(),
135 BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; 145 BackgroundColor.dark(),BackgroundColor, Qt::black, BackgroundColor) ;
136 setBackgroundColor( mBackgroundColor ); 146 setBackgroundColor( mBackgroundColor );
137 mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); 147 mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250);
138} 148}
139void KOAgendaItem::init ( Incidence *incidence, QDate qd ) 149void KOAgendaItem::init ( Incidence *incidence, QDate qd )
140{ 150{
141 mIncidence = incidence; 151 mIncidence = incidence;
142 mDate = qd; 152 mDate = qd;
143 mFirstMultiItem = 0; 153 mFirstMultiItem = 0;
144 mNextMultiItem = 0; 154 mNextMultiItem = 0;
145 mLastMultiItem = 0; 155 mLastMultiItem = 0;
146 computeText(); 156 computeText();
147 initColor(); 157 initColor();
@@ -219,74 +229,74 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
219 } 229 }
220 if (mIncidence->cancelled() && height() < 20 ) { 230 if (mIncidence->cancelled() && height() < 20 ) {
221 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; 231 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x;
222 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; 232 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y;
223 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); 233 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 );
224 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); 234 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos );
225 if ( horLayout ) 235 if ( horLayout )
226 ++xOff; 236 ++xOff;
227 else 237 else
228 ++yOff; 238 ++yOff;
229 } 239 }
230 if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { 240 if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) {
231 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); 241 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::red );
232 if ( horLayout ) 242 if ( horLayout )
233 ++xOff; 243 ++xOff;
234 else 244 else
235 ++yOff; 245 ++yOff;
236 } 246 }
237 if (mIncidence->doesRecur()) { 247 if (mIncidence->doesRecur()) {
238 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); 248 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::blue );
239 if ( horLayout ) 249 if ( horLayout )
240 ++xOff; 250 ++xOff;
241 else 251 else
242 ++yOff; 252 ++yOff;
243 } 253 }
244 if (mIncidence->description().length() > 0) { 254 if (mIncidence->description().length() > 0) {
245 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); 255 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkGreen );
246 if ( horLayout ) 256 if ( horLayout )
247 ++xOff; 257 ++xOff;
248 else 258 else
249 ++yOff; 259 ++yOff;
250 } 260 }
251 if (mIncidence->isReadOnly()) { 261 if (mIncidence->isReadOnly()) {
252 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); 262 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::white );
253 if ( horLayout ) 263 if ( horLayout )
254 ++xOff; 264 ++xOff;
255 else 265 else
256 ++yOff; 266 ++yOff;
257 } 267 }
258 268
259 if (mIncidence->attendeeCount()>0) { 269 if (mIncidence->attendeeCount()>0) {
260 270
261 if (mIncidence->organizer() == KOPrefs::instance()->email()) { 271 if (mIncidence->organizer() == KOPrefs::instance()->email()) {
262 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black ); 272 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::black );
263 if ( horLayout ) 273 if ( horLayout )
264 ++xOff; 274 ++xOff;
265 else 275 else
266 ++yOff; 276 ++yOff;
267 } else { 277 } else {
268 Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 278 Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
269 if (me!=0) { 279 if (me!=0) {
270 280
271 281
272 } else { 282 } else {
273 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow ); 283 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::yellow );
274 if ( horLayout ) 284 if ( horLayout )
275 ++xOff; 285 ++xOff;
276 else 286 else
277 ++yOff; 287 ++yOff;
278 288
279 } 289 }
280 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow ); 290 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkYellow );
281 if ( horLayout ) 291 if ( horLayout )
282 ++xOff; 292 ++xOff;
283 else 293 else
284 ++yOff; 294 ++yOff;
285 295
286 } 296 }
287 297
288 } 298 }
289 return ( yOff || xOff ); 299 return ( yOff || xOff );
290} 300}
291 301
292 302
@@ -411,51 +421,51 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
411 } else { 421 } else {
412 x += 2; yy += 1;w -= 4; h-= 4; 422 x += 2; yy += 1;w -= 4; h-= 4;
413 if ( nfh < 6.01 ) { 423 if ( nfh < 6.01 ) {
414 yy -= 2; 424 yy -= 2;
415 h += 4; 425 h += 4;
416 } 426 }
417 else 427 else
418 if ( nfh < h -2 ) 428 if ( nfh < h -2 )
419 ++yy; 429 ++yy;
420 } 430 }
421 int align; 431 int align;
422#ifndef DESKTOP_VERSION 432#ifndef DESKTOP_VERSION
423 align = ( AlignLeft|WordBreak|AlignTop); 433 align = ( Qt::AlignLeft|Qt::TextWordWrap|Qt::AlignTop);
424#else 434#else
425 align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 435 align = ( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop);
426#endif 436#endif
427 if ( addIcon ) { 437 if ( addIcon ) {
428 if ( ! horLayout ) { 438 if ( ! horLayout ) {
429 x += AGENDA_ICON_SIZE+3; 439 x += AGENDA_ICON_SIZE+3;
430 w -= (AGENDA_ICON_SIZE+3); 440 w -= (AGENDA_ICON_SIZE+3);
431 } 441 }
432 else { 442 else {
433 yy+= AGENDA_ICON_SIZE+2; 443 yy+= AGENDA_ICON_SIZE+2;
434 h -=(AGENDA_ICON_SIZE+3); 444 h -=(AGENDA_ICON_SIZE+3);
435 } 445 }
436 } 446 }
437 if ( mWhiteText ) 447 if ( mWhiteText )
438 paint->setPen ( white); 448 paint->setPen ( Qt::white);
439 if ( x < 0 ) { 449 if ( x < 0 ) {
440 w = w+x-3; 450 w = w+x-3;
441 x = 3; 451 x = 3;
442 if ( !horLayout && addIcon ) 452 if ( !horLayout && addIcon )
443 x += AGENDA_ICON_SIZE+3; 453 x += AGENDA_ICON_SIZE+3;
444 if ( w > parentWidget()->width() ){ 454 if ( w > parentWidget()->width() ){
445 w = parentWidget()->width() - 6; 455 w = parentWidget()->width() - 6;
446#ifndef DESKTOP_VERSION 456#ifndef DESKTOP_VERSION
447 align = ( AlignHCenter|WordBreak|AlignTop); 457 align = ( Qt::AlignHCenter|Qt::TextWordWrap|Qt::AlignTop);
448#else 458#else
449 align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); 459 align = ( Qt::AlignHCenter|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop);
450#endif 460#endif
451 461
452 } 462 }
453 } 463 }
454 QRect dr; 464 QRect dr;
455 if ( w + x > parentWidget()->width() ) 465 if ( w + x > parentWidget()->width() )
456 w = parentWidget()->width()-x; 466 w = parentWidget()->width()-x;
457 paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); 467 paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr );
458 //qDebug("%d %d %d %d ", x, yy, w, h ); 468 //qDebug("%d %d %d %d ", x, yy, w, h );
459 if ( mIncidence->cancelled() ){ 469 if ( mIncidence->cancelled() ){
460 470
461 471
@@ -552,25 +562,25 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e )
552 //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); 562 //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1());
553 return; 563 return;
554 } 564 }
555 } 565 }
556 if ( paintFrom->width() < xx+rw ) { 566 if ( paintFrom->width() < xx+rw ) {
557 rw = paintFrom->width() - xx; 567 rw = paintFrom->width() - xx;
558 if ( rw <= 1 ) { 568 if ( rw <= 1 ) {
559 //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); 569 //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() );
560 return; 570 return;
561 } 571 }
562 } 572 }
563 //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); 573 //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh);
564 bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); 574 bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,QPainter::CompositionMode_Source);
565} 575}
566void KOAgendaItem::computeText() 576void KOAgendaItem::computeText()
567{ 577{
568 mDisplayedText = mIncidence->summary(); 578 mDisplayedText = mIncidence->summary();
569 if ( (mIncidence->typeID() == todoID ) ) { 579 if ( (mIncidence->typeID() == todoID ) ) {
570 if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { 580 if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
571 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) 581 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
572 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; 582 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
573 else if ( !(mIncidence->doesFloat())) 583 else if ( !(mIncidence->doesFloat()))
574 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; 584 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
575 } 585 }
576 } else { 586 } else {
@@ -619,25 +629,25 @@ void KOAgendaItem::computeText()
619 tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr(); 629 tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr();
620 } 630 }
621 } else if ( mIncidence->typeID() == todoID ) { 631 } else if ( mIncidence->typeID() == todoID ) {
622 if (mIncidence->hasStartDate()) 632 if (mIncidence->hasStartDate())
623 tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr(); 633 tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr();
624 if (((Todo*)mIncidence)->hasDueDate()) 634 if (((Todo*)mIncidence)->hasDueDate())
625 tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr(); 635 tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr();
626 } 636 }
627 637
628 if (!mIncidence->location().isEmpty()) { 638 if (!mIncidence->location().isEmpty()) {
629 tipText += "\n"+i18n("Location: ")+mIncidence->location(); 639 tipText += "\n"+i18n("Location: ")+mIncidence->location();
630 } 640 }
631 QToolTip::add(this,tipText,toolTipGroup(),""); 641 QToolTip::add(this,tipText /*TODO:hacker: ,toolTipGroup(),"" */);
632#endif 642#endif
633} 643}
634void KOAgendaItem::updateItem() 644void KOAgendaItem::updateItem()
635{ 645{
636 computeText(); 646 computeText();
637 647
638 //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); 648 //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y());
639 paintMe( mSelected ); 649 paintMe( mSelected );
640 repaint( false); 650 repaint( false);
641} 651}
642 652
643void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) 653void KOAgendaItem::resizeEvent ( QResizeEvent *ev )
@@ -786,68 +796,68 @@ void KOAgendaItem::expandLeft(int dx)
786} 796}
787 797
788void KOAgendaItem::expandRight(int dx) 798void KOAgendaItem::expandRight(int dx)
789{ 799{
790 int newX = cellX(); 800 int newX = cellX();
791 int newXWidth = cellXWidth() + dx; 801 int newXWidth = cellXWidth() + dx;
792 if (newXWidth < newX) newXWidth = newX; 802 if (newXWidth < newX) newXWidth = newX;
793 setCellX(newX,newXWidth); 803 setCellX(newX,newXWidth);
794} 804}
795 805
796QToolTipGroup *KOAgendaItem::toolTipGroup() 806QToolTipGroup *KOAgendaItem::toolTipGroup()
797{ 807{
798 if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); 808 /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */
799 return mToolTipGroup; 809 return mToolTipGroup;
800} 810}
801 811
802void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) 812void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e )
803{ 813{
804#ifndef KORG_NODND 814#ifndef KORG_NODND
805 if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || 815 if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) ||
806 !QTextDrag::canDecode( e ) ) { 816 !Q3TextDrag::canDecode( e ) ) {
807 e->ignore(); 817 e->ignore();
808 return; 818 return;
809 } 819 }
810 e->accept(); 820 e->accept();
811#endif 821#endif
812} 822}
813 823
814void KOAgendaItem::dropEvent( QDropEvent *e ) 824void KOAgendaItem::dropEvent( QDropEvent *e )
815{ 825{
816#ifndef KORG_NODND 826#ifndef KORG_NODND
817 QString text; 827 QString text;
818 if(QTextDrag::decode(e,text)) 828 if(Q3TextDrag::decode(e,text))
819 { 829 {
820 kdDebug() << "Dropped : " << text << endl; 830 kdDebug() << "Dropped : " << text << endl;
821 QStringList emails = QStringList::split(",",text); 831 QStringList emails = QStringList::split(",",text);
822 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { 832 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) {
823 kdDebug() << " Email: " << (*it) << endl; 833 kdDebug() << " Email: " << (*it) << endl;
824 int pos = (*it).find("<"); 834 int pos = (*it).find("<");
825 QString name = (*it).left(pos); 835 QString name = (*it).left(pos);
826 QString email = (*it).mid(pos); 836 QString email = (*it).mid(pos);
827 if (!email.isEmpty()) { 837 if (!email.isEmpty()) {
828 mIncidence->addAttendee(new Attendee(name,email)); 838 mIncidence->addAttendee(new Attendee(name,email));
829 } 839 }
830 } 840 }
831 } 841 }
832#endif 842#endif
833} 843}
834 844
835 845
836QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() 846Q3PtrList<KOAgendaItem> KOAgendaItem::conflictItems()
837{ 847{
838 return mConflictItems; 848 return mConflictItems;
839} 849}
840 850
841void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci) 851void KOAgendaItem::setConflictItems(Q3PtrList<KOAgendaItem> ci)
842{ 852{
843 mConflictItems = ci; 853 mConflictItems = ci;
844 KOAgendaItem *item; 854 KOAgendaItem *item;
845 for ( item=mConflictItems.first(); item != 0; 855 for ( item=mConflictItems.first(); item != 0;
846 item=mConflictItems.next() ) { 856 item=mConflictItems.next() ) {
847 item->addConflictItem(this); 857 item->addConflictItem(this);
848 } 858 }
849} 859}
850 860
851void KOAgendaItem::addConflictItem(KOAgendaItem *ci) 861void KOAgendaItem::addConflictItem(KOAgendaItem *ci)
852{ 862{
853 if (mConflictItems.find(ci)<0) 863 if (mConflictItems.find(ci)<0)
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h
index 27ee720..17cf975 100644
--- a/korganizer/koagendaitem.h
+++ b/korganizer/koagendaitem.h
@@ -10,51 +10,58 @@
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19#ifndef KOAGENDAITEM_H 19#ifndef KOAGENDAITEM_H
20#define KOAGENDAITEM_H 20#define KOAGENDAITEM_H
21 21
22#include <qframe.h> 22#include <q3frame.h>
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qpixmap.h> 24#include <qpixmap.h>
25#include <qdatetime.h> 25#include <qdatetime.h>
26#include <qpalette.h> 26#include <qpalette.h>
27//Added by qt3to4:
28#include <QDropEvent>
29#include <QPaintEvent>
30#include <QResizeEvent>
31#include <Q3PtrList>
32#include <QEvent>
33#include <QDragEnterEvent>
27 34
28#include <libkcal/incidence.h> 35#include <libkcal/incidence.h>
29 36
30class KOAgendaItemWhatsThis; 37class KOAgendaItemWhatsThis;
31class QToolTipGroup; 38class QToolTipGroup;
32class QDragEnterEvent; 39class QDragEnterEvent;
33class QDropEvent; 40class QDropEvent;
34 41
35using namespace KCal; 42using namespace KCal;
36 43
37/* 44/*
38 The KOAgendaItem has to make sure that it receives all mouse events, which are 45 The KOAgendaItem has to make sure that it receives all mouse events, which are
39 to be used for dragging and resizing. That means it has to be installed as 46 to be used for dragging and resizing. That means it has to be installed as
40 eventfiler for its children, if it has children, and it has to pass mouse 47 eventfiler for its children, if it has children, and it has to pass mouse
41 events from the cildren to itself. See eventFilter(). 48 events from the cildren to itself. See eventFilter().
42*/ 49*/
43class KOAgendaItem : public QWidget 50class KOAgendaItem : public QWidget
44{ 51{
45 Q_OBJECT 52 Q_OBJECT
46 public: 53 public:
47 KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0, 54 KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0,
48 WFlags f=0 ); 55 Qt::WFlags f=0 );
49 ~KOAgendaItem(); 56 ~KOAgendaItem();
50 QString getWhatsThisText(); 57 QString getWhatsThisText();
51 void init ( Incidence *incidence, QDate qd ); 58 void init ( Incidence *incidence, QDate qd );
52 int cellX() { return mCellX; } 59 int cellX() { return mCellX; }
53 int cellXWidth() { return mCellXWidth; } 60 int cellXWidth() { return mCellXWidth; }
54 int cellYTop() { return mCellYTop; } 61 int cellYTop() { return mCellYTop; }
55 int cellYBottom() { return mCellYBottom; } 62 int cellYBottom() { return mCellYBottom; }
56 int cellHeight(); 63 int cellHeight();
57 int cellWidth(); 64 int cellWidth();
58 int subCell() { return mSubCell; } 65 int subCell() { return mSubCell; }
59 int subCells() { return mSubCells; } 66 int subCells() { return mSubCells; }
60 67
@@ -87,26 +94,26 @@ class KOAgendaItem : public QWidget
87 QDate itemDate() { return mDate; } 94 QDate itemDate() { return mDate; }
88 95
89 /** Update the date of this item's occurence (not in the event) */ 96 /** Update the date of this item's occurence (not in the event) */
90 void setItemDate(QDate qd); 97 void setItemDate(QDate qd);
91 98
92 void setText ( const QString & text ) { mDisplayedText = text; } 99 void setText ( const QString & text ) { mDisplayedText = text; }
93 QString text () { return mDisplayedText; } 100 QString text () { return mDisplayedText; }
94 101
95 virtual bool eventFilter ( QObject *, QEvent * ); 102 virtual bool eventFilter ( QObject *, QEvent * );
96 103
97 static QToolTipGroup *toolTipGroup(); 104 static QToolTipGroup *toolTipGroup();
98 105
99 QPtrList<KOAgendaItem> conflictItems(); 106 Q3PtrList<KOAgendaItem> conflictItems();
100 void setConflictItems(QPtrList<KOAgendaItem>); 107 void setConflictItems(Q3PtrList<KOAgendaItem>);
101 void addConflictItem(KOAgendaItem *ci); 108 void addConflictItem(KOAgendaItem *ci);
102 void paintMe( bool, QPainter* painter = 0 ); 109 void paintMe( bool, QPainter* painter = 0 );
103 void repaintMe(); 110 void repaintMe();
104 static QPixmap * paintPix(); 111 static QPixmap * paintPix();
105 static QPixmap * paintPixAllday(); 112 static QPixmap * paintPixAllday();
106 void updateItem(); 113 void updateItem();
107 void computeText(); 114 void computeText();
108 void recreateIncidence(); 115 void recreateIncidence();
109 bool checkLayout(); 116 bool checkLayout();
110 void initColor (); 117 void initColor ();
111 bool isAllDay() { return mAllDay; } 118 bool isAllDay() { return mAllDay; }
112 int resizeMe( int grid, int wid, int hei, bool invalidWidth = false ); 119 int resizeMe( int grid, int wid, int hei, bool invalidWidth = false );
@@ -152,16 +159,16 @@ class KOAgendaItem : public QWidget
152 //QLabel *mTodoIconLabel; 159 //QLabel *mTodoIconLabel;
153 //QLabel *mItemLabel; 160 //QLabel *mItemLabel;
154 //QWidget *mIconBox; 161 //QWidget *mIconBox;
155 //QLabel *mIconAlarm,*mIconRecur,*mIconReadonly; 162 //QLabel *mIconAlarm,*mIconRecur,*mIconReadonly;
156 //QLabel *mIconReply,*mIconGroup,*mIconOrganizer; 163 //QLabel *mIconReply,*mIconGroup,*mIconOrganizer;
157 //QLabel *mIconMoreInfo; 164 //QLabel *mIconMoreInfo;
158 static QToolTipGroup *mToolTipGroup; 165 static QToolTipGroup *mToolTipGroup;
159 166
160 QColor mBackgroundColor; 167 QColor mBackgroundColor;
161 QColorGroup mColorGroup; 168 QColorGroup mColorGroup;
162 QString mDisplayedText; 169 QString mDisplayedText;
163 bool mSelected; 170 bool mSelected;
164 QPtrList<KOAgendaItem> mConflictItems; 171 Q3PtrList<KOAgendaItem> mConflictItems;
165}; 172};
166 173
167#endif // KOAGENDAITEM_H 174#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
@@ -12,39 +12,51 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qhbox.h> 24#include <q3hbox.h>
25#include <qvbox.h> 25#include <q3vbox.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qframe.h> 27#include <q3frame.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#ifndef KORG_NOSPLITTER 29#ifndef KORG_NOSPLITTER
30#include <qsplitter.h> 30#include <qsplitter.h>
31#endif 31#endif
32#include <qfont.h> 32#include <qfont.h>
33#include <qfontmetrics.h> 33#include <qfontmetrics.h>
34#include <qpopupmenu.h> 34#include <q3popupmenu.h>
35#include <qtooltip.h> 35#include <qtooltip.h>
36#include <qpainter.h> 36#include <qpainter.h>
37#include <qpushbutton.h> 37#include <qpushbutton.h>
38#include <qapplication.h> 38#include <qapplication.h>
39#include <QDesktopWidget>
40//Added by qt3to4:
41#include <QResizeEvent>
42#include <QPixmap>
43#include <QMouseEvent>
44#include <Q3GridLayout>
45#include <Q3ValueList>
46#include <QKeyEvent>
47#include <Q3HBoxLayout>
48#include <Q3VBoxLayout>
49#include <QPaintEvent>
50#include <Q3PtrList>
39 51
40#include <kapplication.h> 52#include <kapplication.h>
41#include <KDGanttMinimizeSplitter.h> 53#include <KDGanttMinimizeSplitter.h>
42#include <kdebug.h> 54#include <kdebug.h>
43#include <kstandarddirs.h> 55#include <kstandarddirs.h>
44#include <kiconloader.h> 56#include <kiconloader.h>
45#include <klocale.h> 57#include <klocale.h>
46#include <kconfig.h> 58#include <kconfig.h>
47#include <kglobal.h> 59#include <kglobal.h>
48#include "calendarview.h" 60#include "calendarview.h"
49#include "koviewmanager.h" 61#include "koviewmanager.h"
50 62
@@ -69,42 +81,42 @@
69//#include "koagendaview.moc" 81//#include "koagendaview.moc"
70 82
71//extern bool globalFlagBlockPainting; 83//extern bool globalFlagBlockPainting;
72extern int globalFlagBlockAgenda; 84extern int globalFlagBlockAgenda;
73extern int globalFlagBlockStartup; 85extern int globalFlagBlockStartup;
74extern int globalFlagBlockAgendaItemPaint; 86extern int globalFlagBlockAgendaItemPaint;
75extern int globalFlagBlockAgendaItemUpdate; 87extern int globalFlagBlockAgendaItemUpdate;
76extern int globalFlagBlockLabel; 88extern int globalFlagBlockLabel;
77using namespace KOrg; 89using namespace KOrg;
78 90
79#define IDLETIMEOUT 45 91#define IDLETIMEOUT 45
80 92
81TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : 93TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,Qt::WFlags f) :
82 QScrollView(parent,name,f) 94 Q3ScrollView(parent,name,f)
83{ 95{
84 myPix.resize( 1, 1 ); 96 myPix.resize( 1, 1 );
85 mRows = rows; 97 mRows = rows;
86 98
87 mRedrawNeeded = true; 99 mRedrawNeeded = true;
88 setMinimumHeight( 20 ); 100 setMinimumHeight( 20 );
89 mCellHeight = KOPrefs::instance()->mHourSize*4; 101 mCellHeight = KOPrefs::instance()->mHourSize*4;
90 102
91 enableClipper(true); 103 enableClipper(true);
92 104
93 setHScrollBarMode(AlwaysOff); 105 setHScrollBarMode(AlwaysOff);
94 setVScrollBarMode(AlwaysOff); 106 setVScrollBarMode(AlwaysOff);
95 107
96 resizeContents(50,mRows * mCellHeight); 108 resizeContents(50,mRows * mCellHeight);
97 109
98 viewport()->setBackgroundMode( PaletteBackground ); 110 viewport()->setBackgroundMode( Qt::PaletteBackground );
99} 111}
100 112
101void TimeLabels::setCellHeight(int height) 113void TimeLabels::setCellHeight(int height)
102{ 114{
103 mCellHeight = height; 115 mCellHeight = height;
104} 116}
105 117
106/* 118/*
107 Optimization so that only the "dirty" portion of the scroll view 119 Optimization so that only the "dirty" portion of the scroll view
108 is redrawn. Unfortunately, this is not called by default paintEvent() method. 120 is redrawn. Unfortunately, this is not called by default paintEvent() method.
109*/ 121*/
110void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) 122void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
@@ -274,25 +286,25 @@ void TimeLabels::paintEvent(QPaintEvent*)
274{ 286{
275 287
276 // kdDebug() << "paintevent..." << endl; 288 // kdDebug() << "paintevent..." << endl;
277 // this is another hack! 289 // this is another hack!
278 // QPainter painter(this); 290 // QPainter painter(this);
279 //QString c 291 //QString c
280 repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); 292 repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight());
281} 293}
282 294
283//////////////////////////////////////////////////////////////////////////// 295////////////////////////////////////////////////////////////////////////////
284 296
285EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) 297EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name)
286 : QFrame(parent,name) 298 : Q3Frame(parent,name)
287{ 299{
288 mColumns = 1; 300 mColumns = 1;
289 mTopBox = 0; 301 mTopBox = 0;
290 mLocation = loc; 302 mLocation = loc;
291 mTopLayout = 0; 303 mTopLayout = 0;
292 mPaintWidget = 0; 304 mPaintWidget = 0;
293 mXOffset = 0; 305 mXOffset = 0;
294 if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); 306 if (mLocation == Top) mPixmap = SmallIcon("1uparrow");
295 else mPixmap = SmallIcon("1downarrow"); 307 else mPixmap = SmallIcon("1downarrow");
296 mEnabled.resize(mColumns); 308 mEnabled.resize(mColumns);
297 mEnabled.fill( false ); 309 mEnabled.fill( false );
298 setMinimumHeight(mPixmap.height()); 310 setMinimumHeight(mPixmap.height());
@@ -384,97 +396,97 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
384 396
385 mLayoutDayLabels = 0; 397 mLayoutDayLabels = 0;
386 mDayLabelsFrame = 0; 398 mDayLabelsFrame = 0;
387 mDayLabels = 0; 399 mDayLabels = 0;
388 bool isRTL = KOGlobals::self()->reverseLayout(); 400 bool isRTL = KOGlobals::self()->reverseLayout();
389 QPixmap expandPix; 401 QPixmap expandPix;
390 if ( KOPrefs::instance()->mVerticalScreen ) { 402 if ( KOPrefs::instance()->mVerticalScreen ) {
391 expandPix = SmallIcon( "1updownarrow" ); 403 expandPix = SmallIcon( "1updownarrow" );
392 } else { 404 } else {
393 expandPix = SmallIcon("1leftrightarrow" ); 405 expandPix = SmallIcon("1leftrightarrow" );
394 } 406 }
395 407
396 QBoxLayout *topLayout = new QVBoxLayout(this); 408 Q3BoxLayout *topLayout = new Q3VBoxLayout(this);
397 409
398 // Create day name labels for agenda columns 410 // Create day name labels for agenda columns
399 // Create agenda splitter 411 // Create agenda splitter
400 412
401 mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); 413 mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this);
402 mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 414 mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
403 topLayout->addWidget( mSplitterAgenda ); 415 topLayout->addWidget( mSplitterAgenda );
404 mAllDayFrame = new QHBox(mSplitterAgenda); 416 mAllDayFrame = new Q3HBox(mSplitterAgenda);
405 mAllDayFrame->setFocusPolicy(NoFocus); 417 mAllDayFrame->setFocusPolicy(Qt::NoFocus);
406 QWidget *agendaFrame = new QWidget(mSplitterAgenda); 418 QWidget *agendaFrame = new QWidget(mSplitterAgenda);
407 agendaFrame->setFocusPolicy(NoFocus); 419 agendaFrame->setFocusPolicy(Qt::NoFocus);
408 420
409 // Create all-day agenda widget 421 // Create all-day agenda widget
410 mDummyAllDayLeft = new QVBox( mAllDayFrame ); 422 mDummyAllDayLeft = new Q3VBox( mAllDayFrame );
411 423
412 mExpandButton = new QPushButton(mDummyAllDayLeft); 424 mExpandButton = new QPushButton(mDummyAllDayLeft);
413 mExpandButton->setPixmap( expandPix ); 425 mExpandButton->setPixmap( expandPix );
414 int widebut = mExpandButton->sizeHint().width()+4; 426 int widebut = mExpandButton->sizeHint().width()+4;
415 int heibut = mExpandButton->sizeHint().height()+4; 427 int heibut = mExpandButton->sizeHint().height()+4;
416 if ( heibut > widebut ) 428 if ( heibut > widebut )
417 widebut = heibut ; 429 widebut = heibut ;
418 430
419 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, 431 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed,
420 // QSizePolicy::Fixed ) ); 432 // QSizePolicy::Fixed ) );
421 mExpandButton->setFixedSize( widebut, widebut); 433 mExpandButton->setFixedSize( widebut, widebut);
422 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); 434 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) );
423 mExpandButton->setFocusPolicy(NoFocus); 435 mExpandButton->setFocusPolicy(Qt::NoFocus);
424 mAllDayAgenda = new KOAgenda(1,mAllDayFrame); 436 mAllDayAgenda = new KOAgenda(1,mAllDayFrame);
425 mAllDayAgenda->setFocusPolicy(NoFocus); 437 mAllDayAgenda->setFocusPolicy(Qt::NoFocus);
426 QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); 438 QLabel *dummyAllDayRight = new QLabel (mAllDayFrame);
427 439
428 // Create event context menu for all day agenda 440 // Create event context menu for all day agenda
429 //mAllDayAgendaPopup = eventPopup(); 441 //mAllDayAgendaPopup = eventPopup();
430 442
431 // Create agenda frame 443 // Create agenda frame
432 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); 444 Q3GridLayout *agendaLayout = new Q3GridLayout(agendaFrame,4,3);
433 // QHBox *agendaFrame = new QHBox(splitterAgenda); 445 // QHBox *agendaFrame = new QHBox(splitterAgenda);
434 446
435 // create event indicator bars 447 // create event indicator bars
436 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); 448 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame);
437#ifndef DESKTOP_VERSION 449#ifndef DESKTOP_VERSION
438 mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); 450 mEventIndicatorTop->setPaintWidget( mSplitterAgenda );
439#endif 451#endif
440 mDayLabelsFrame = new QHBox(agendaFrame); 452 mDayLabelsFrame = new Q3HBox(agendaFrame);
441 //topLayout->addWidget(mDayLabelsFrame); 453 //topLayout->addWidget(mDayLabelsFrame);
442 mDayLabels = new QFrame (mDayLabelsFrame); 454 mDayLabels = new Q3Frame (mDayLabelsFrame);
443 mLayoutDayLabels = new QHBoxLayout(mDayLabels); 455 mLayoutDayLabels = new Q3HBoxLayout(mDayLabels);
444 agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); 456 agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2);
445 agendaLayout->addWidget(mEventIndicatorTop,1,1); 457 agendaLayout->addWidget(mEventIndicatorTop,1,1);
446 458
447 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, 459 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom,
448 agendaFrame); 460 agendaFrame);
449 agendaLayout->addWidget(mEventIndicatorBottom,3,1); 461 agendaLayout->addWidget(mEventIndicatorBottom,3,1);
450 QWidget *dummyAgendaRight = new QWidget(agendaFrame); 462 QWidget *dummyAgendaRight = new QWidget(agendaFrame);
451 agendaLayout->addWidget(dummyAgendaRight,1,2); 463 agendaLayout->addWidget(dummyAgendaRight,1,2);
452 464
453 // Create time labels 465 // Create time labels
454 mTimeLabels = new TimeLabels(24,agendaFrame); 466 mTimeLabels = new TimeLabels(24,agendaFrame);
455 agendaLayout->addWidget(mTimeLabels,2,0); 467 agendaLayout->addWidget(mTimeLabels,2,0);
456 connect(mTimeLabels,SIGNAL( scaleChanged()), 468 connect(mTimeLabels,SIGNAL( scaleChanged()),
457 this,SLOT(updateConfig())); 469 this,SLOT(updateConfig()));
458 470
459 // Create agenda 471 // Create agenda
460 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); 472 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame);
461 agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); 473 agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2);
462 agendaLayout->setColStretch(1,1); 474 agendaLayout->setColStretch(1,1);
463 mAgenda->setFocusPolicy(NoFocus); 475 mAgenda->setFocusPolicy(Qt::NoFocus);
464 // Create event context menu for agenda 476 // Create event context menu for agenda
465 mAllAgendaPopup = eventPopup(); 477 mAllAgendaPopup = eventPopup();
466 478
467#if 0 479#if 0
468 mAllAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), 480 mAllAgendaPopup->addAdditionalItem(QIcon(SmallIcon("bell")),
469 i18n("Toggle Alarm"),mAgenda, 481 i18n("Toggle Alarm"),mAgenda,
470 SLOT(popupAlarm()),true); 482 SLOT(popupAlarm()),true);
471 483
472#endif 484#endif
473 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 485 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
474 mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 486 mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
475 487
476 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 488 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
477 mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 489 mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
478 490
479 connect(mAllAgendaPopup,SIGNAL(categoryChanged(Incidence *)), 491 connect(mAllAgendaPopup,SIGNAL(categoryChanged(Incidence *)),
480 this,SLOT(categoryChanged(Incidence *))); 492 this,SLOT(categoryChanged(Incidence *)));
@@ -909,27 +921,27 @@ void KOAgendaView::createDayLabels()
909 921
910int KOAgendaView::maxDatesHint() 922int KOAgendaView::maxDatesHint()
911{ 923{
912 // Not sure about the max number of events, so return 0 for now. 924 // Not sure about the max number of events, so return 0 for now.
913 return 0; 925 return 0;
914} 926}
915 927
916int KOAgendaView::currentDateCount() 928int KOAgendaView::currentDateCount()
917{ 929{
918 return mSelectedDates.count(); 930 return mSelectedDates.count();
919} 931}
920 932
921QPtrList<Incidence> KOAgendaView::selectedIncidences() 933Q3PtrList<Incidence> KOAgendaView::selectedIncidences()
922{ 934{
923 QPtrList<Incidence> selected; 935 Q3PtrList<Incidence> selected;
924 Incidence *incidence; 936 Incidence *incidence;
925 937
926 incidence = mAgenda->selectedIncidence(); 938 incidence = mAgenda->selectedIncidence();
927 if (incidence) selected.append(incidence); 939 if (incidence) selected.append(incidence);
928 940
929 incidence = mAllDayAgenda->selectedIncidence(); 941 incidence = mAllDayAgenda->selectedIncidence();
930 if (incidence) selected.append(incidence); 942 if (incidence) selected.append(incidence);
931 943
932 return selected; 944 return selected;
933} 945}
934 946
935DateList KOAgendaView::selectedDates() 947DateList KOAgendaView::selectedDates()
@@ -978,26 +990,26 @@ void KOAgendaView::updateConfig()
978 mAgenda->updateConfig(); 990 mAgenda->updateConfig();
979 mAllDayAgenda->updateConfig(); 991 mAllDayAgenda->updateConfig();
980 // widget synchronization 992 // widget synchronization
981 //TODO: find a better way, maybe signal/slot 993 //TODO: find a better way, maybe signal/slot
982 mTimeLabels->positionChanged(); 994 mTimeLabels->positionChanged();
983 995
984 // for some reason, this needs to be called explicitly 996 // for some reason, this needs to be called explicitly
985 mTimeLabels->repaint(); 997 mTimeLabels->repaint();
986 998
987 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); 999 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width());
988 1000
989 // ToolTips displaying summary of events 1001 // ToolTips displaying summary of events
990 KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() 1002 /* TODO:hacker: KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance()
991 ->mEnableToolTips); 1003 ->mEnableToolTips); */
992 1004
993 //setHolidayMasks(); 1005 //setHolidayMasks();
994 1006
995 //createDayLabels(); called by via updateView(); 1007 //createDayLabels(); called by via updateView();
996 mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); 1008 mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth());
997 updateView(); 1009 updateView();
998 mAgenda->restorePosition(); 1010 mAgenda->restorePosition();
999} 1011}
1000 1012
1001 1013
1002void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) 1014void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
1003{ 1015{
@@ -1108,25 +1120,25 @@ void KOAgendaView::showDates( const QDate &start, const QDate &end )
1108 // qDebug("KOAgendaView::showDates "); 1120 // qDebug("KOAgendaView::showDates ");
1109 QDate d = start; 1121 QDate d = start;
1110 while (d <= end) { 1122 while (d <= end) {
1111 mSelectedDates.append(d); 1123 mSelectedDates.append(d);
1112 d = d.addDays( 1 ); 1124 d = d.addDays( 1 );
1113 } 1125 }
1114 1126
1115 // and update the view 1127 // and update the view
1116 fillAgenda(); 1128 fillAgenda();
1117} 1129}
1118 1130
1119 1131
1120void KOAgendaView::showEvents(QPtrList<Event>) 1132void KOAgendaView::showEvents(Q3PtrList<Event>)
1121{ 1133{
1122 kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; 1134 kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl;
1123} 1135}
1124 1136
1125void KOAgendaView::changeEventDisplay(Event *, int) 1137void KOAgendaView::changeEventDisplay(Event *, int)
1126{ 1138{
1127 // qDebug("KOAgendaView::changeEventDisplay "); 1139 // qDebug("KOAgendaView::changeEventDisplay ");
1128 // kdDebug() << "KOAgendaView::changeEventDisplay" << endl; 1140 // kdDebug() << "KOAgendaView::changeEventDisplay" << endl;
1129 // this should be re-written to be MUCH smarter. Right now we 1141 // this should be re-written to be MUCH smarter. Right now we
1130 // are just playing dumb. 1142 // are just playing dumb.
1131 fillAgenda(); 1143 fillAgenda();
1132} 1144}
@@ -1156,29 +1168,29 @@ void KOAgendaView::fillAgenda()
1156 globalFlagBlockAgendaItemPaint = 1; 1168 globalFlagBlockAgendaItemPaint = 1;
1157 1169
1158 mAllDayAgenda->changeColumns(mSelectedDates.count()); 1170 mAllDayAgenda->changeColumns(mSelectedDates.count());
1159 mAgenda->changeColumns(mSelectedDates.count()); 1171 mAgenda->changeColumns(mSelectedDates.count());
1160 qApp->processEvents(); 1172 qApp->processEvents();
1161 mEventIndicatorTop->changeColumns(mSelectedDates.count()); 1173 mEventIndicatorTop->changeColumns(mSelectedDates.count());
1162 mEventIndicatorBottom->changeColumns(mSelectedDates.count()); 1174 mEventIndicatorBottom->changeColumns(mSelectedDates.count());
1163 setHolidayMasks(); 1175 setHolidayMasks();
1164 1176
1165 mMinY.resize(mSelectedDates.count()); 1177 mMinY.resize(mSelectedDates.count());
1166 mMaxY.resize(mSelectedDates.count()); 1178 mMaxY.resize(mSelectedDates.count());
1167 1179
1168 QPtrList<Event> dayEvents; 1180 Q3PtrList<Event> dayEvents;
1169 1181
1170 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. 1182 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
1171 // Therefore, gtodoset all of them. 1183 // Therefore, gtodoset all of them.
1172 QPtrList<Todo> todos = calendar()->todos(); 1184 Q3PtrList<Todo> todos = calendar()->todos();
1173 1185
1174 mAgenda->setDateList(mSelectedDates); 1186 mAgenda->setDateList(mSelectedDates);
1175 1187
1176 QDate today = QDate::currentDate(); 1188 QDate today = QDate::currentDate();
1177 1189
1178 DateList::ConstIterator dit; 1190 DateList::ConstIterator dit;
1179 int curCol = 0; 1191 int curCol = 0;
1180 int maxCol = mSelectedDates.count()-1; 1192 int maxCol = mSelectedDates.count()-1;
1181 for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { 1193 for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) {
1182 QDate currentDate = *dit; 1194 QDate currentDate = *dit;
1183 // kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString() 1195 // kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString()
1184 // << endl; 1196 // << endl;
@@ -1291,25 +1303,25 @@ void KOAgendaView::fillAgenda()
1291 } 1303 }
1292 } 1304 }
1293 // ---------- [display Todos -------------- 1305 // ---------- [display Todos --------------
1294 unsigned int numTodo; 1306 unsigned int numTodo;
1295 for (numTodo = 0; numTodo < todos.count(); ++numTodo) { 1307 for (numTodo = 0; numTodo < todos.count(); ++numTodo) {
1296 Todo *todo = todos.at(numTodo); 1308 Todo *todo = todos.at(numTodo);
1297 1309
1298 if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date 1310 if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date
1299 if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) continue; 1311 if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) continue;
1300 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. 1312 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
1301 // Already completed items can be displayed on their original due date 1313 // Already completed items can be displayed on their original due date
1302 //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda 1314 //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda
1303 bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; 1315 bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)today) && KOPrefs::instance()->mShowTodoInAgenda;
1304 bool fillIn = false; 1316 bool fillIn = false;
1305 if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) 1317 if ( todo->hasCompletedDate() && todo->completed().date() == currentDate )
1306 fillIn = true; 1318 fillIn = true;
1307 if ( ! fillIn && !todo->hasCompletedDate() ) 1319 if ( ! fillIn && !todo->hasCompletedDate() )
1308 fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); 1320 fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue);
1309 if ( fillIn ) { 1321 if ( fillIn ) {
1310 if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue 1322 if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue
1311 if ( KOPrefs::instance()->mShowTodoInAgenda ) 1323 if ( KOPrefs::instance()->mShowTodoInAgenda )
1312 mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol); 1324 mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol);
1313 } 1325 }
1314 else { 1326 else {
1315 QDateTime dt; 1327 QDateTime dt;
@@ -1494,63 +1506,63 @@ void KOAgendaView::startDrag(Event *event)
1494void KOAgendaView::readSettings() 1506void KOAgendaView::readSettings()
1495{ 1507{
1496 readSettings(KOGlobals::config()); 1508 readSettings(KOGlobals::config());
1497} 1509}
1498 1510
1499void KOAgendaView::readSettings(KConfig *config) 1511void KOAgendaView::readSettings(KConfig *config)
1500{ 1512{
1501 // kdDebug() << "KOAgendaView::readSettings()" << endl; 1513 // kdDebug() << "KOAgendaView::readSettings()" << endl;
1502 1514
1503 config->setGroup("Views"); 1515 config->setGroup("Views");
1504 1516
1505 //#ifndef KORG_NOSPLITTER 1517 //#ifndef KORG_NOSPLITTER
1506 QValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); 1518 Q3ValueList<int> sizes = config->readIntListEntry("Separator AgendaView");
1507 if (sizes.count() == 2) { 1519 if (sizes.count() == 2) {
1508 if ( sizes[0] < 20 ) { 1520 if ( sizes[0] < 20 ) {
1509 sizes[1] = sizes[1] +20 - sizes[0]; 1521 sizes[1] = sizes[1] +20 - sizes[0];
1510 sizes[0] = 20; 1522 sizes[0] = 20;
1511 } 1523 }
1512 mSplitterAgenda->setSizes(sizes); 1524 mSplitterAgenda->setSizes(sizes);
1513 // qDebug("read %d %d ",sizes[0],sizes[1] ); 1525 // qDebug("read %d %d ",sizes[0],sizes[1] );
1514 } 1526 }
1515 //#endif 1527 //#endif
1516 1528
1517 // updateConfig(); 1529 // updateConfig();
1518} 1530}
1519 1531
1520void KOAgendaView::writeSettings(KConfig *config) 1532void KOAgendaView::writeSettings(KConfig *config)
1521{ 1533{
1522 // kdDebug() << "KOAgendaView::writeSettings()" << endl; 1534 // kdDebug() << "KOAgendaView::writeSettings()" << endl;
1523 1535
1524 config->setGroup("Views"); 1536 config->setGroup("Views");
1525 1537
1526 //#ifndef KORG_NOSPLITTER 1538 //#ifndef KORG_NOSPLITTER
1527 QValueList<int> list = mSplitterAgenda->sizes(); 1539 Q3ValueList<int> list = mSplitterAgenda->sizes();
1528 config->writeEntry("Separator AgendaView",list); 1540 config->writeEntry("Separator AgendaView",list);
1529 //qDebug("write %d %d ", list[0],list[1] ); 1541 //qDebug("write %d %d ", list[0],list[1] );
1530 //#endif 1542 //#endif
1531} 1543}
1532 1544
1533void KOAgendaView::setHolidayMasks() 1545void KOAgendaView::setHolidayMasks()
1534{ 1546{
1535 mHolidayMask.resize(mSelectedDates.count()); 1547 mHolidayMask.resize(mSelectedDates.count());
1536 1548
1537 uint i; 1549 uint i;
1538 for(i=0;i<mSelectedDates.count();++i) { 1550 for(i=0;i<mSelectedDates.count();++i) {
1539 QDate date = mSelectedDates[i]; 1551 QDate date = mSelectedDates[i];
1540 bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); 1552 bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6);
1541 bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); 1553 bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7);
1542 bool showHoliday = false; 1554 bool showHoliday = false;
1543 if ( KOPrefs::instance()->mExcludeHolidays ) { 1555 if ( KOPrefs::instance()->mExcludeHolidays ) {
1544 QPtrList<Event> events = calendar()->events( date, true ); 1556 Q3PtrList<Event> events = calendar()->events( date, true );
1545 Event *event; 1557 Event *event;
1546 for( event = events.first(); event; event = events.next() ) { 1558 for( event = events.first(); event; event = events.next() ) {
1547 if ( event->isHoliday()) { 1559 if ( event->isHoliday()) {
1548 showHoliday = true; 1560 showHoliday = true;
1549 break; 1561 break;
1550 } 1562 }
1551 } 1563 }
1552 1564
1553 } 1565 }
1554 1566
1555#ifndef KORG_NOPLUGINS 1567#ifndef KORG_NOPLUGINS
1556 bool showHoliday = KOPrefs::instance()->mExcludeHolidays && 1568 bool showHoliday = KOPrefs::instance()->mExcludeHolidays &&
@@ -1654,25 +1666,25 @@ void KOAgendaView::updateTodo( Todo * t, int )
1654 bool remove = false; 1666 bool remove = false;
1655 bool removeAD = false; 1667 bool removeAD = false;
1656 QDate da; 1668 QDate da;
1657 if ( t->hasCompletedDate() ) 1669 if ( t->hasCompletedDate() )
1658 da = t->completed().date(); 1670 da = t->completed().date();
1659 else 1671 else
1660 da = t->dtDue().date(); 1672 da = t->dtDue().date();
1661 if ( ! t->hasDueDate() && !t->hasCompletedDate() ) { 1673 if ( ! t->hasDueDate() && !t->hasCompletedDate() ) {
1662 remove = true; 1674 remove = true;
1663 removeAD = true; 1675 removeAD = true;
1664 } 1676 }
1665 else { 1677 else {
1666 bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; 1678 bool overdue = (!t->isCompleted()) && (t->dtDue() < (QDateTime)QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ;
1667 if ( overdue && 1679 if ( overdue &&
1668 QDate::currentDate() >= mSelectedDates.first() && 1680 QDate::currentDate() >= mSelectedDates.first() &&
1669 QDate::currentDate() <= mSelectedDates.last()) { 1681 QDate::currentDate() <= mSelectedDates.last()) {
1670 removeAD = false; 1682 removeAD = false;
1671 remove = true; 1683 remove = true;
1672 } 1684 }
1673 else { 1685 else {
1674 1686
1675 if ( da < mSelectedDates.first() || 1687 if ( da < mSelectedDates.first() ||
1676 da > mSelectedDates.last() ) { 1688 da > mSelectedDates.last() ) {
1677 remove = true; 1689 remove = true;
1678 removeAD = true; 1690 removeAD = true;
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index 5e68146..3b871d9 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -14,75 +14,85 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOAGENDAVIEW_H 23#ifndef KOAGENDAVIEW_H
24#define KOAGENDAVIEW_H 24#define KOAGENDAVIEW_H
25 25
26#include <qscrollview.h> 26#include <q3scrollview.h>
27#include <qdatetime.h> 27#include <qdatetime.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <Q3BoxLayout>
30#ifndef DESKTOP_VERSION 31#ifndef DESKTOP_VERSION
31#include <qksplitter.h> 32#include <qksplitter.h>
32#else 33#else
33#include <qsplitter.h> 34#include <qsplitter.h>
34#endif 35#endif
35#include <qmemarray.h> 36#include <q3memarray.h>
37//Added by qt3to4:
38#include <QPaintEvent>
39#include <QResizeEvent>
40#include <Q3Frame>
41#include <QPixmap>
42#include <QLabel>
43#include <QMouseEvent>
44#include <Q3PtrList>
45#include <QKeyEvent>
36 46
37#include "koeventview.h" 47#include "koeventview.h"
38 48
39class QHBox; 49class Q3HBox;
40class QFrame; 50class Q3Frame;
41class QLabel; 51class QLabel;
42class QPushButton; 52class QPushButton;
43class CalendarView; 53class CalendarView;
44class KOAgenda; 54class KOAgenda;
45class KOAgendaItem; 55class KOAgendaItem;
46class KConfig; 56class KConfig;
47class KDGanttMinimizeSplitter; 57class KDGanttMinimizeSplitter;
48 58
49class KOAgendaButton : public QPushButton 59class KOAgendaButton : public QPushButton
50{ 60{
51 Q_OBJECT 61 Q_OBJECT
52 public: 62 public:
53 KOAgendaButton( QWidget *parent=0, const char *name=0 ) : 63 KOAgendaButton( QWidget *parent=0, const char *name=0 ) :
54 QPushButton( parent, name ) 64 QPushButton( parent, name )
55 { 65 {
56 mNum = -3; 66 mNum = -3;
57 setFlat( true ); 67 setFlat( true );
58 setFocusPolicy(NoFocus); 68 setFocusPolicy(Qt::NoFocus);
59 setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); 69 setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding ));
60 connect( this, SIGNAL( clicked() ), this, SLOT ( bClicked() ) ); 70 connect( this, SIGNAL( clicked() ), this, SLOT ( bClicked() ) );
61 }; 71 };
62 72
63 QSize sizeHint () const { return QSize( 5,5) ;} 73 QSize sizeHint () const { return QSize( 5,5) ;}
64 void setNum( int n) { mNum = n; } 74 void setNum( int n) { mNum = n; }
65private slots: 75private slots:
66 void bClicked() {emit numClicked( mNum);} 76 void bClicked() {emit numClicked( mNum);}
67signals: 77signals:
68 void numClicked( int ); 78 void numClicked( int );
69private: 79private:
70 int mNum; 80 int mNum;
71}; 81};
72 82
73class TimeLabels : public QScrollView { 83class TimeLabels : public Q3ScrollView {
74 Q_OBJECT 84 Q_OBJECT
75 public: 85 public:
76 TimeLabels(int rows,QWidget *parent=0,const char *name=0,WFlags f=0); 86 TimeLabels(int rows,QWidget *parent=0,const char *name=0,Qt::WFlags f=0);
77 87
78 void setCellHeight(int height); 88 void setCellHeight(int height);
79 89
80 /** Calculates the minimum width */ 90 /** Calculates the minimum width */
81 virtual int minimumWidth() const; 91 virtual int minimumWidth() const;
82 92
83 /** updates widget's internal state */ 93 /** updates widget's internal state */
84 void updateConfig(); 94 void updateConfig();
85 95
86 /** */ 96 /** */
87 void setAgenda(KOAgenda* agenda); 97 void setAgenda(KOAgenda* agenda);
88 98
@@ -104,71 +114,71 @@ class TimeLabels : public QScrollView {
104 QPixmap myPix; 114 QPixmap myPix;
105 bool mRedrawNeeded; 115 bool mRedrawNeeded;
106 int mMiniWidth; 116 int mMiniWidth;
107 int mMouseDownY; 117 int mMouseDownY;
108 QString mOrgCap; 118 QString mOrgCap;
109 int mRows; 119 int mRows;
110 int mCellHeight; 120 int mCellHeight;
111 121
112 /** */ 122 /** */
113 KOAgenda* mAgenda; 123 KOAgenda* mAgenda;
114}; 124};
115 125
116class EventIndicator : public QFrame { 126class EventIndicator : public Q3Frame {
117 Q_OBJECT 127 Q_OBJECT
118 public: 128 public:
119 enum Location { Top, Bottom }; 129 enum Location { Top, Bottom };
120 EventIndicator(Location loc=Top,QWidget *parent=0,const char *name=0); 130 EventIndicator(Location loc=Top,QWidget *parent=0,const char *name=0);
121 virtual ~EventIndicator(); 131 virtual ~EventIndicator();
122 132
123 void changeColumns(int columns); 133 void changeColumns(int columns);
124 void setPaintWidget( KDGanttMinimizeSplitter* ); 134 void setPaintWidget( KDGanttMinimizeSplitter* );
125 void setXOffset( int ); 135 void setXOffset( int );
126 void enableColumn(int column, bool enable); 136 void enableColumn(int column, bool enable);
127 137
128 protected: 138 protected:
129 void drawContents(QPainter *); 139 void drawContents(QPainter *);
130 140
131 private: 141 private:
132 int mXOffset; 142 int mXOffset;
133 KDGanttMinimizeSplitter* mPaintWidget; 143 KDGanttMinimizeSplitter* mPaintWidget;
134 int mColumns; 144 int mColumns;
135 QHBox *mTopBox; 145 Q3HBox *mTopBox;
136 QBoxLayout *mTopLayout; 146 Q3BoxLayout *mTopLayout;
137 Location mLocation; 147 Location mLocation;
138 QPixmap mPixmap; 148 QPixmap mPixmap;
139 QMemArray<bool> mEnabled; 149 Q3MemArray<bool> mEnabled;
140}; 150};
141 151
142/** 152/**
143 KOAgendaView is the agenda-like view used to display events in an one or 153 KOAgendaView is the agenda-like view used to display events in an one or
144 multi-day view. 154 multi-day view.
145*/ 155*/
146class KOAgendaView : public KOEventView { 156class KOAgendaView : public KOEventView {
147 Q_OBJECT 157 Q_OBJECT
148 public: 158 public:
149 KOAgendaView(Calendar *cal,QWidget *parent = 0,const char *name = 0 ); 159 KOAgendaView(Calendar *cal,QWidget *parent = 0,const char *name = 0 );
150 virtual ~KOAgendaView(); 160 virtual ~KOAgendaView();
151 void setStartHour( int ); 161 void setStartHour( int );
152 void toggleAllDay(); 162 void toggleAllDay();
153 163
154 164
155 /** Returns maximum number of days supported by the koagendaview */ 165 /** Returns maximum number of days supported by the koagendaview */
156 virtual int maxDatesHint(); 166 virtual int maxDatesHint();
157 167
158 /** Returns number of currently shown dates. */ 168 /** Returns number of currently shown dates. */
159 virtual int currentDateCount(); 169 virtual int currentDateCount();
160 170
161 /** returns the currently selected events */ 171 /** returns the currently selected events */
162 virtual QPtrList<Incidence> selectedIncidences(); 172 virtual Q3PtrList<Incidence> selectedIncidences();
163 173
164 /** returns the currently selected events */ 174 /** returns the currently selected events */
165 virtual DateList selectedDates(); 175 virtual DateList selectedDates();
166 176
167 /** Remove all events from view */ 177 /** Remove all events from view */
168 void clearView(); 178 void clearView();
169 void clearList(); 179 void clearList();
170 KOAgenda *agenda() { return mAgenda;} 180 KOAgenda *agenda() { return mAgenda;}
171 virtual void printPreview(CalPrinter *calPrinter, 181 virtual void printPreview(CalPrinter *calPrinter,
172 const QDate &, const QDate &); 182 const QDate &, const QDate &);
173 183
174 /** start-datetime of selection */ 184 /** start-datetime of selection */
@@ -176,25 +186,25 @@ class KOAgendaView : public KOEventView {
176 /** end-datetime of selection */ 186 /** end-datetime of selection */
177 QDateTime selectionEnd() {return mTimeSpanEnd;} 187 QDateTime selectionEnd() {return mTimeSpanEnd;}
178 /** returns true if selection is for whole day */ 188 /** returns true if selection is for whole day */
179 bool selectedIsAllDay() {return mTimeSpanInAllDay;} 189 bool selectedIsAllDay() {return mTimeSpanInAllDay;}
180 /** make selected start/end invalid */ 190 /** make selected start/end invalid */
181 void deleteSelectedDateTime(); 191 void deleteSelectedDateTime();
182 void repaintAgenda(); 192 void repaintAgenda();
183 public slots: 193 public slots:
184 void setInitStartHour(); 194 void setInitStartHour();
185 virtual void updateView(); 195 virtual void updateView();
186 virtual void updateConfig(); 196 virtual void updateConfig();
187 virtual void showDates(const QDate &start, const QDate &end); 197 virtual void showDates(const QDate &start, const QDate &end);
188 virtual void showEvents(QPtrList<Event> eventList); 198 virtual void showEvents(Q3PtrList<Event> eventList);
189 199
190 void updateTodo( Todo *, int ); 200 void updateTodo( Todo *, int );
191 void changeEventDisplay(Event *, int); 201 void changeEventDisplay(Event *, int);
192 202
193 void clearSelection(); 203 void clearSelection();
194 204
195 void newTodo(int gx,int gy); 205 void newTodo(int gx,int gy);
196 void newEvent(int gx,int gy); 206 void newEvent(int gx,int gy);
197 void newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd); 207 void newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd);
198 void newEventAllDay(int gx, int gy); 208 void newEventAllDay(int gx, int gy);
199 void newTodoAllDay(int gx, int gy); 209 void newTodoAllDay(int gx, int gy);
200 210
@@ -251,49 +261,49 @@ class KOAgendaView : public KOEventView {
251 void updateEventIndicatorBottom(int newY); 261 void updateEventIndicatorBottom(int newY);
252 262
253 /** Updates data for selected timespan */ 263 /** Updates data for selected timespan */
254 void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd); 264 void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd);
255 /** Updates data for selected timespan for all day event*/ 265 /** Updates data for selected timespan for all day event*/
256 void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd); 266 void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd);
257 267
258 private: 268 private:
259 bool flag_blockfillAgenda; 269 bool flag_blockfillAgenda;
260 QTimer* mIdleTimer; 270 QTimer* mIdleTimer;
261 QDateTime mIdleStart; 271 QDateTime mIdleStart;
262 // view widgets 272 // view widgets
263 QFrame *mDayLabels; 273 Q3Frame *mDayLabels;
264 QHBox *mDayLabelsFrame; 274 Q3HBox *mDayLabelsFrame;
265 QBoxLayout *mLayoutDayLabels; 275 Q3BoxLayout *mLayoutDayLabels;
266 QFrame *mAllDayFrame; 276 Q3Frame *mAllDayFrame;
267 KOAgenda *mAllDayAgenda; 277 KOAgenda *mAllDayAgenda;
268 KOAgenda *mAgenda; 278 KOAgenda *mAgenda;
269 TimeLabels *mTimeLabels; 279 TimeLabels *mTimeLabels;
270 QWidget *mDummyAllDayLeft; 280 QWidget *mDummyAllDayLeft;
271 281
272 KDGanttMinimizeSplitter* mSplitterAgenda; 282 KDGanttMinimizeSplitter* mSplitterAgenda;
273 QPushButton *mExpandButton; 283 QPushButton *mExpandButton;
274 284
275 DateList mSelectedDates; // List of dates to be displayed 285 DateList mSelectedDates; // List of dates to be displayed
276 int mViewType; 286 int mViewType;
277 287
278 bool mWeekStartsMonday; 288 bool mWeekStartsMonday;
279 int mStartHour; 289 int mStartHour;
280 290
281 KOEventPopupMenu *mAllAgendaPopup; 291 KOEventPopupMenu *mAllAgendaPopup;
282 //KOEventPopupMenu *mAllDayAgendaPopup; 292 //KOEventPopupMenu *mAllDayAgendaPopup;
283 293
284 EventIndicator *mEventIndicatorTop; 294 EventIndicator *mEventIndicatorTop;
285 EventIndicator *mEventIndicatorBottom; 295 EventIndicator *mEventIndicatorBottom;
286 296
287 QMemArray<int> mMinY; 297 Q3MemArray<int> mMinY;
288 QMemArray<int> mMaxY; 298 Q3MemArray<int> mMaxY;
289 299
290 QMemArray<bool> mHolidayMask; 300 Q3MemArray<bool> mHolidayMask;
291 301
292 QPtrList<KOAgendaButton> mDayLabelsList; 302 Q3PtrList<KOAgendaButton> mDayLabelsList;
293 QDateTime mTimeSpanBegin; 303 QDateTime mTimeSpanBegin;
294 QDateTime mTimeSpanEnd; 304 QDateTime mTimeSpanEnd;
295 bool mTimeSpanInAllDay; 305 bool mTimeSpanInAllDay;
296 void keyPressEvent ( QKeyEvent * e ); 306 void keyPressEvent ( QKeyEvent * e );
297}; 307};
298 308
299#endif // KOAGENDAVIEW_H 309#endif // KOAGENDAVIEW_H
diff --git a/korganizer/kocounterdialog.h b/korganizer/kocounterdialog.h
index c8dcf45..493d9e1 100644
--- a/korganizer/kocounterdialog.h
+++ b/korganizer/kocounterdialog.h
@@ -13,25 +13,25 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19#ifndef KOCOUNTERDIALOG_H 19#ifndef KOCOUNTERDIALOG_H
20#define KOCOUNTERDIALOG_H 20#define KOCOUNTERDIALOG_H
21// 21//
22// Viewer dialog for counter events. 22// Viewer dialog for counter events.
23// 23//
24 24
25#include <qtextview.h> 25#include <q3textview.h>
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28 28
29#include <libkcal/event.h> 29#include <libkcal/event.h>
30 30
31using namespace KCal; 31using namespace KCal;
32 32
33class KOEventViewer; 33class KOEventViewer;
34 34
35class KOCounterDialog : public KDialogBase { 35class KOCounterDialog : public KDialogBase {
36 Q_OBJECT 36 Q_OBJECT
37 public: 37 public:
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 52fd1e8..4f681b3 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -15,27 +15,36 @@
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source ode for Qt in the source distribution. 22 without including the source ode for Qt in the source distribution.
23*/ 23*/
24 24
25#include <qevent.h> 25#include <qevent.h>
26#include <qpainter.h> 26#include <qpainter.h>
27#include <qptrlist.h> 27#include <q3ptrlist.h>
28#include <qtimer.h> 28#include <qtimer.h>
29#include <qwhatsthis.h> 29#include <q3whatsthis.h>
30//Added by qt3to4:
31#include <QDragLeaveEvent>
32#include <Q3Frame>
33#include <QDragEnterEvent>
34#include <QDragMoveEvent>
35#include <QDropEvent>
36#include <QResizeEvent>
37#include <QMouseEvent>
38#include <QPaintEvent>
30 39
31#include <kglobal.h> 40#include <kglobal.h>
32#include <kdebug.h> 41#include <kdebug.h>
33#include <klocale.h> 42#include <klocale.h>
34 43
35#include <libkcal/vcaldrag.h> 44#include <libkcal/vcaldrag.h>
36#include <libkcal/icaldrag.h> 45#include <libkcal/icaldrag.h>
37#include <libkcal/dndfactory.h> 46#include <libkcal/dndfactory.h>
38#include <libkcal/calendarresources.h> 47#include <libkcal/calendarresources.h>
39#include <libkcal/resourcecalendar.h> 48#include <libkcal/resourcecalendar.h>
40#include <kresources/resourceselectdialog.h> 49#include <kresources/resourceselectdialog.h>
41 50
@@ -45,33 +54,33 @@
45#include "kocore.h" 54#include "kocore.h"
46#endif 55#endif
47#include "koprefs.h" 56#include "koprefs.h"
48#include "koglobals.h" 57#include "koglobals.h"
49 58
50#include "kodaymatrix.h" 59#include "kodaymatrix.h"
51 60
52// ============================================================================ 61// ============================================================================
53// D Y N A M I C T I P 62// D Y N A M I C T I P
54// ============================================================================ 63// ============================================================================
55 64
56DynamicTip::DynamicTip( QWidget * parent ) 65DynamicTip::DynamicTip( QWidget * parent )
57 : QToolTip( parent ) 66 /* TODO:hacker: : QToolTip( parent ) */
58{ 67{
59 matrix = (KODayMatrix*)parent; 68 matrix = (KODayMatrix*)parent;
60} 69}
61 70
62class KODaymatrixWhatsThis :public QWhatsThis 71class KODaymatrixWhatsThis :public Q3WhatsThis
63{ 72{
64public: 73public:
65 KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;}; 74 KODaymatrixWhatsThis( KODayMatrix* view ) : Q3WhatsThis( view ),_view (view) { ;};
66 ~KODaymatrixWhatsThis() { ; }; 75 ~KODaymatrixWhatsThis() { ; };
67 76
68protected: 77protected:
69 virtual QString text( const QPoint& p ) 78 virtual QString text( const QPoint& p )
70 { 79 {
71 return _view->getWhatsThisText( p ) ; 80 return _view->getWhatsThisText( p ) ;
72 } 81 }
73private: 82private:
74 KODayMatrix * _view; 83 KODayMatrix * _view;
75}; 84};
76 85
77void DynamicTip::maybeTip( const QPoint &pos ) 86void DynamicTip::maybeTip( const QPoint &pos )
@@ -82,37 +91,37 @@ void DynamicTip::maybeTip( const QPoint &pos )
82 int dwidth = sz.width() / 7; 91 int dwidth = sz.width() / 7;
83 int row = pos.y()/dheight; 92 int row = pos.y()/dheight;
84 int col = pos.x()/dwidth; 93 int col = pos.x()/dwidth;
85 94
86 QRect rct(col*dwidth, row*dheight, dwidth, dheight); 95 QRect rct(col*dwidth, row*dheight, dwidth, dheight);
87 96
88// kdDebug() << "DynamicTip::maybeTip matrix cell index [" << 97// kdDebug() << "DynamicTip::maybeTip matrix cell index [" <<
89// col << "][" << row << "] => " <<(col+row*7) << endl; 98// col << "][" << row << "] => " <<(col+row*7) << endl;
90 99
91 //show holiday names only 100 //show holiday names only
92 QString str = matrix->getHolidayLabel(col+row*7); 101 QString str = matrix->getHolidayLabel(col+row*7);
93 if (str.isEmpty()) return; 102 if (str.isEmpty()) return;
94 tip(rct, str); 103 /* TODO:hacker: tip(rct, str);*/
95} 104}
96 105
97 106
98// ============================================================================ 107// ============================================================================
99// K O D A Y M A T R I X 108// K O D A Y M A T R I X
100// ============================================================================ 109// ============================================================================
101 110
102const int KODayMatrix::NOSELECTION = -1000; 111const int KODayMatrix::NOSELECTION = -1000;
103const int KODayMatrix::NUMDAYS = 42; 112const int KODayMatrix::NUMDAYS = 42;
104 113
105KODayMatrix::KODayMatrix( QWidget *parent, const char *name ) 114KODayMatrix::KODayMatrix( QWidget *parent, const char *name )
106 : QFrame( parent, name , Qt::WRepaintNoErase ), mCalendar( 0 ) 115 : Q3Frame( parent, name , Qt::WNoAutoErase ), mCalendar( 0 )
107 116
108 117
109{ 118{
110 mLastView = -1; 119 mLastView = -1;
111 oldW = 0; 120 oldW = 0;
112 oldH = 0; 121 oldH = 0;
113 myPix.resize( 150, 120 ); 122 myPix.resize( 150, 120 );
114 mRedrawNeeded = true; 123 mRedrawNeeded = true;
115 mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this); 124 mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this);
116 mPendingUpdateBeforeRepaint = false; 125 mPendingUpdateBeforeRepaint = false;
117 mouseDown = false; 126 mouseDown = false;
118 // initialize dynamic arrays 127 // initialize dynamic arrays
@@ -142,25 +151,25 @@ KODayMatrix::KODayMatrix( QWidget *parent, const char *name )
142 mRepaintTimer = new QTimer( this ); 151 mRepaintTimer = new QTimer( this );
143 connect (mRepaintTimer ,SIGNAL(timeout()), this, SLOT ( repaintViewTimed() )); 152 connect (mRepaintTimer ,SIGNAL(timeout()), this, SLOT ( repaintViewTimed() ));
144 mDayChanged = false; 153 mDayChanged = false;
145 updateView(); 154 updateView();
146} 155}
147QString KODayMatrix::getWhatsThisText( QPoint p ) 156QString KODayMatrix::getWhatsThisText( QPoint p )
148{ 157{
149 158
150 int tmp = getDayIndexFrom(p.x(), p.y()); 159 int tmp = getDayIndexFrom(p.x(), p.y());
151 if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar ) 160 if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar )
152 return QString(); 161 return QString();
153 QDate mDate = days[tmp]; 162 QDate mDate = days[tmp];
154 QPtrList<Event> eventlist = mCalendar->events(mDate); 163 Q3PtrList<Event> eventlist = mCalendar->events(mDate);
155 Event *event; 164 Event *event;
156 QStringList mToolTip; 165 QStringList mToolTip;
157 for(event=eventlist.first();event != 0;event=eventlist.next()) { 166 for(event=eventlist.first();event != 0;event=eventlist.next()) {
158 QString mToolTipText; 167 QString mToolTipText;
159 QString text; 168 QString text;
160 int multiday = 0;// 1 = start, 2 = midddle, 3 = end day 169 int multiday = 0;// 1 = start, 2 = midddle, 3 = end day
161 if (event->isMultiDay()) { 170 if (event->isMultiDay()) {
162 QString prefix = "<->";multiday = 2; 171 QString prefix = "<->";multiday = 2;
163 QString time; 172 QString time;
164 if ( event->doesRecur() ) { 173 if ( event->doesRecur() ) {
165 if ( event->recursOn( mDate) ) { 174 if ( event->recursOn( mDate) ) {
166 prefix ="->" ;multiday = 1; 175 prefix ="->" ;multiday = 1;
@@ -196,40 +205,40 @@ QString KODayMatrix::getWhatsThisText( QPoint p )
196 text = KGlobal::locale()->formatTime(event->dtStart().time()); 205 text = KGlobal::locale()->formatTime(event->dtStart().time());
197 text += " " + event->summary(); 206 text += " " + event->summary();
198 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); 207 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
199 } 208 }
200 } 209 }
201 if ( !event->location().isEmpty() ) 210 if ( !event->location().isEmpty() )
202 mToolTipText += " (" + event->location() + ")"; 211 mToolTipText += " (" + event->location() + ")";
203 //qDebug("TTT: %s ", mToolTipText.latin1()); 212 //qDebug("TTT: %s ", mToolTipText.latin1());
204 mToolTip.append( deTag( mToolTipText ) ); 213 mToolTip.append( deTag( mToolTipText ) );
205 } 214 }
206 mToolTip.sort(); 215 mToolTip.sort();
207 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 216 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
208 QPtrList<Todo> todolist = mCalendar->todos(mDate); 217 Q3PtrList<Todo> todolist = mCalendar->todos(mDate);
209 Todo *todo; 218 Todo *todo;
210 for(todo=todolist.first();todo != 0;todo=todolist.next()) { 219 for(todo=todolist.first();todo != 0;todo=todolist.next()) {
211 QString mToolTipText; 220 QString mToolTipText;
212 if ( !todo->doesFloat() ) 221 if ( !todo->doesFloat() )
213 mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" "; 222 mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" ";
214 mToolTipText += todo->summary(); 223 mToolTipText += todo->summary();
215 if ( !todo->location().isEmpty() ) 224 if ( !todo->location().isEmpty() )
216 mToolTipText += " (" + todo->location() + ")"; 225 mToolTipText += " (" + todo->location() + ")";
217 mToolTipText = deTag( mToolTipText); 226 mToolTipText = deTag( mToolTipText);
218 mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText; 227 mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText;
219 mToolTip.append( mToolTipText ); 228 mToolTip.append( mToolTipText );
220 } 229 }
221 } 230 }
222 if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { 231 if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
223 QPtrList<Journal> j_list = mCalendar->journals4Date( mDate ); 232 Q3PtrList<Journal> j_list = mCalendar->journals4Date( mDate );
224 Journal *j = j_list.first(); 233 Journal *j = j_list.first();
225 while ( j ) { 234 while ( j ) {
226 QString mToolTipText; 235 QString mToolTipText;
227 if ( !j->summary().isEmpty() ) { 236 if ( !j->summary().isEmpty() ) {
228 mToolTipText = j->summary().left(30); 237 mToolTipText = j->summary().left(30);
229 if ( j->summary().length() > 30 ) 238 if ( j->summary().length() > 30 )
230 mToolTipText += " ..."; 239 mToolTipText += " ...";
231 } else { 240 } else {
232 mToolTipText = j->description().left(25); 241 mToolTipText = j->description().left(25);
233 if ( j->description().length() > 25 ) 242 if ( j->description().length() > 25 )
234 mToolTipText += " ..."; 243 mToolTipText += " ...";
235 mToolTipText = deTag( mToolTipText); 244 mToolTipText = deTag( mToolTipText);
@@ -432,25 +441,25 @@ void KODayMatrix::computeEvent(Event *event, int i )
432void KODayMatrix::updateViewTimed() 441void KODayMatrix::updateViewTimed()
433{ 442{
434 mUpdateTimer->stop(); 443 mUpdateTimer->stop();
435 if ( !mCalendar ) { 444 if ( !mCalendar ) {
436 qDebug("NOT CAL "); 445 qDebug("NOT CAL ");
437 return; 446 return;
438 } 447 }
439#if 1 448#if 1
440 449
441 450
442 int i; 451 int i;
443 int timeSpan = NUMDAYS-1; 452 int timeSpan = NUMDAYS-1;
444 QPtrList<Event> events = mCalendar->events(); 453 Q3PtrList<Event> events = mCalendar->events();
445 Event *event; 454 Event *event;
446 QDateTime dt; 455 QDateTime dt;
447 bool ok; 456 bool ok;
448 bDays.fill( false); 457 bDays.fill( false);
449 pDays.fill( false); 458 pDays.fill( false);
450 hDays.fill( false); 459 hDays.fill( false);
451 eDays.fill( false); 460 eDays.fill( false);
452 mHolidays.clear(); 461 mHolidays.clear();
453 QDate mStartDate = days[0]; 462 QDate mStartDate = days[0];
454 QDate endDate = mStartDate.addDays( timeSpan ); 463 QDate endDate = mStartDate.addDays( timeSpan );
455 for( event = events.first(); event; event = events.next() ) { // for event 464 for( event = events.first(); event; event = events.next() ) { // for event
456 ushort recurType = event->doesRecur(); 465 ushort recurType = event->doesRecur();
@@ -517,74 +526,74 @@ void KODayMatrix::updateViewTimed()
517 } 526 }
518 } 527 }
519 } 528 }
520 int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday 529 int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday
521 for(i = 0; i < NUMDAYS; i++) { 530 for(i = 0; i < NUMDAYS; i++) {
522 if ( ( (i+startDay) % 7 == 0 ) ) { 531 if ( ( (i+startDay) % 7 == 0 ) ) {
523 pDays.setBit(i); 532 pDays.setBit(i);
524 } 533 }
525 } 534 }
526 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 535 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
527 bDays.fill( false); 536 bDays.fill( false);
528 // insert due todos 537 // insert due todos
529 QPtrList<Todo> todos = mCalendar->todos( ); 538 Q3PtrList<Todo> todos = mCalendar->todos( );
530 Todo *todo; 539 Todo *todo;
531 for(todo = todos.first(); todo; todo = todos.next()) { 540 for(todo = todos.first(); todo; todo = todos.next()) {
532 //insertTodo( todo ); 541 //insertTodo( todo );
533 if ( todo->hasDueDate() ) { 542 if ( todo->hasDueDate() ) {
534 int day = mStartDate.daysTo( todo->dtDue().date() ); 543 int day = mStartDate.daysTo( todo->dtDue().date() );
535 if ( day >= 0 && day < timeSpan + 1) { 544 if ( day >= 0 && day < timeSpan + 1) {
536 int i = day; 545 int i = day;
537 QString holiStr = mHolidays[i]; 546 QString holiStr = mHolidays[i];
538 pDays.setBit(i); 547 pDays.setBit(i);
539 if ( !holiStr.isEmpty() ) 548 if ( !holiStr.isEmpty() )
540 holiStr += "\n"; 549 holiStr += "\n";
541 holiStr += i18n("Todo") + ": "+todo->summary(); 550 holiStr += i18n("Todo") + ": "+todo->summary();
542 if ( !todo->location().isEmpty() ) 551 if ( !todo->location().isEmpty() )
543 holiStr += " (" + todo->location() + ")"; 552 holiStr += " (" + todo->location() + ")";
544 bDays.setBit(i); 553 bDays.setBit(i);
545 mHolidays[i] =holiStr ; 554 mHolidays[i] =holiStr ;
546 eDays.setBit(i); 555 eDays.setBit(i);
547 } 556 }
548 } 557 }
549 } 558 }
550 } 559 }
551 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { 560 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
552 bDays.fill( false); 561 bDays.fill( false);
553 // insert due todos 562 // insert due todos
554 QPtrList<Journal> todos = mCalendar->journals( ); 563 Q3PtrList<Journal> todos = mCalendar->journals( );
555 Journal *todo; 564 Journal *todo;
556 for(todo = todos.first(); todo; todo = todos.next()) { 565 for(todo = todos.first(); todo; todo = todos.next()) {
557 int day = mStartDate.daysTo( todo->dtStart().date() ); 566 int day = mStartDate.daysTo( todo->dtStart().date() );
558 if ( day >= 0 && day < timeSpan + 1) { 567 if ( day >= 0 && day < timeSpan + 1) {
559 int i = day; 568 int i = day;
560 QString holiStr = mHolidays[i]; 569 QString holiStr = mHolidays[i];
561 pDays.setBit(i); 570 pDays.setBit(i);
562 if ( !holiStr.isEmpty() ) 571 if ( !holiStr.isEmpty() )
563 holiStr += "\n"; 572 holiStr += "\n";
564 holiStr += i18n("Journal: ")+todo->summary().left(25); 573 holiStr += i18n("Journal: ")+todo->summary().left(25);
565 if ( todo->summary().length() > 25 ) 574 if ( todo->summary().length() > 25 )
566 holiStr +="..."; 575 holiStr +="...";
567 bDays.setBit(i); 576 bDays.setBit(i);
568 mHolidays[i] =holiStr ; 577 mHolidays[i] =holiStr ;
569 eDays.setBit(i); 578 eDays.setBit(i);
570 579
571 } 580 }
572 } 581 }
573 } 582 }
574#else 583#else
575 //qDebug("KODayMatrix::updateViewTimed "); 584 //qDebug("KODayMatrix::updateViewTimed ");
576 for(int i = 0; i < NUMDAYS; i++) { 585 for(int i = 0; i < NUMDAYS; i++) {
577 // if events are set for the day then remember to draw it bold 586 // if events are set for the day then remember to draw it bold
578 QPtrList<Event> eventlist = mCalendar->events(days[i]); 587 Q3PtrList<Event> eventlist = mCalendar->events(days[i]);
579 Event *event; 588 Event *event;
580 int numEvents = eventlist.count(); 589 int numEvents = eventlist.count();
581 QString holiStr = ""; 590 QString holiStr = "";
582 bDays.clearBit(i); 591 bDays.clearBit(i);
583 hDays.clearBit(i); 592 hDays.clearBit(i);
584 eDays.clearBit(i); 593 eDays.clearBit(i);
585 for(event=eventlist.first();event != 0;event=eventlist.next()) { 594 for(event=eventlist.first();event != 0;event=eventlist.next()) {
586 ushort recurType = event->recurrence()->doesRecur(); 595 ushort recurType = event->recurrence()->doesRecur();
587 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || 596 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) ||
588 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { 597 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) {
589 numEvents--; 598 numEvents--;
590 } 599 }
@@ -666,25 +675,25 @@ void KODayMatrix::updateView(QDate actdate)
666#else 675#else
667 mRepaintTimer->start( 250 ); 676 mRepaintTimer->start( 250 );
668 mUpdateTimer->start( 500 ); 677 mUpdateTimer->start( 500 );
669#endif 678#endif
670 } 679 }
671} 680}
672void KODayMatrix::updateEvents() 681void KODayMatrix::updateEvents()
673{ 682{
674 if ( !mCalendar ) return; 683 if ( !mCalendar ) return;
675 684
676 for( int i = 0; i < NUMDAYS; i++ ) { 685 for( int i = 0; i < NUMDAYS; i++ ) {
677 // if events are set for the day then remember to draw it bold 686 // if events are set for the day then remember to draw it bold
678 QPtrList<Event> eventlist = mCalendar->events( days[ i ] ); 687 Q3PtrList<Event> eventlist = mCalendar->events( days[ i ] );
679 int numEvents = eventlist.count(); 688 int numEvents = eventlist.count();
680 Event *event; 689 Event *event;
681 for( event = eventlist.first(); event != 0;event=eventlist.next()) { 690 for( event = eventlist.first(); event != 0;event=eventlist.next()) {
682 ushort recurType = event->doesRecur(); 691 ushort recurType = event->doesRecur();
683 692
684 if ( ( recurType == Recurrence::rDaily && 693 if ( ( recurType == Recurrence::rDaily &&
685 !KOPrefs::instance()->mDailyRecur ) || 694 !KOPrefs::instance()->mDailyRecur ) ||
686 ( recurType == Recurrence::rWeekly && 695 ( recurType == Recurrence::rWeekly &&
687 !KOPrefs::instance()->mWeeklyRecur ) ) { 696 !KOPrefs::instance()->mWeeklyRecur ) ) {
688 numEvents--; 697 numEvents--;
689 } 698 }
690 if ( !KOPrefs::instance()->mLongAllday && event->doesFloat()&& event->isMultiDay() ) { 699 if ( !KOPrefs::instance()->mLongAllday && event->doesFloat()&& event->isMultiDay() ) {
@@ -730,38 +739,38 @@ int KODayMatrix::getDayIndexFrom(int x, int y)
730 739
731 return 7*(yVal) + xVal; 740 return 7*(yVal) + xVal;
732 741
733} 742}
734 743
735// ---------------------------------------------------------------------------- 744// ----------------------------------------------------------------------------
736// M O U S E E V E N T H A N D L I N G 745// M O U S E E V E N T H A N D L I N G
737// ---------------------------------------------------------------------------- 746// ----------------------------------------------------------------------------
738 747
739void KODayMatrix::mousePressEvent (QMouseEvent* e) 748void KODayMatrix::mousePressEvent (QMouseEvent* e)
740{ 749{
741 750
742 if ( e->button() == LeftButton ) 751 if ( e->button() == Qt::LeftButton )
743 mouseDown = true; 752 mouseDown = true;
744 mSelStart = getDayIndexFrom(e->x(), e->y()); 753 mSelStart = getDayIndexFrom(e->x(), e->y());
745 if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1; 754 if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1;
746 mSelInit = mSelStart; 755 mSelInit = mSelStart;
747 mSelEnd = mSelStart; 756 mSelEnd = mSelStart;
748 mRedrawNeeded = true; 757 mRedrawNeeded = true;
749 repaint(false); 758 repaint(false);
750} 759}
751 760
752void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) 761void KODayMatrix::mouseReleaseEvent (QMouseEvent* e)
753{ 762{
754 mRedrawNeeded = true; 763 mRedrawNeeded = true;
755 if ( e->button() == LeftButton ) 764 if ( e->button() == Qt::LeftButton )
756 if ( ! mouseDown ) { 765 if ( ! mouseDown ) {
757 return; 766 return;
758 } 767 }
759 else 768 else
760 mouseDown = false; 769 mouseDown = false;
761 int tmp = getDayIndexFrom(e->x(), e->y()); 770 int tmp = getDayIndexFrom(e->x(), e->y());
762 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1; 771 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1;
763 772
764 if (mSelInit > tmp) { 773 if (mSelInit > tmp) {
765 mSelEnd = mSelInit; 774 mSelEnd = mSelInit;
766 if (tmp != mSelStart) { 775 if (tmp != mSelStart) {
767 mSelStart = tmp; 776 mSelStart = tmp;
@@ -1186,38 +1195,38 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
1186 if ( eDays.testBit(i)) { 1195 if ( eDays.testBit(i)) {
1187 QFont myFont = font(); 1196 QFont myFont = font();
1188 myFont.setBold(false); 1197 myFont.setBold(false);
1189 p.setFont(myFont); 1198 p.setFont(myFont);
1190 } 1199 }
1191 } 1200 }
1192 p.setPen(mDefaultTextColor); 1201 p.setPen(mDefaultTextColor);
1193 p.drawRect(0, 0, width(), height()); 1202 p.drawRect(0, 0, width(), height());
1194 } else { 1203 } else {
1195 //qDebug("NO redraw "); 1204 //qDebug("NO redraw ");
1196 } 1205 }
1197 1206
1198 bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,CopyROP); 1207 bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,QPainter::CompositionMode_Source);
1199 mRedrawNeeded = false; 1208 mRedrawNeeded = false;
1200} 1209}
1201 1210
1202// ---------------------------------------------------------------------------- 1211// ----------------------------------------------------------------------------
1203// R E SI Z E E V E N T H A N D L I N G 1212// R E SI Z E E V E N T H A N D L I N G
1204// ---------------------------------------------------------------------------- 1213// ----------------------------------------------------------------------------
1205 1214
1206void KODayMatrix::resizeEvent(QResizeEvent * e) 1215void KODayMatrix::resizeEvent(QResizeEvent * e)
1207{ 1216{
1208 QRect sz = frameRect(); 1217 QRect sz = frameRect();
1209 daysize.setHeight(sz.height()*7 / NUMDAYS); 1218 daysize.setHeight(sz.height()*7 / NUMDAYS);
1210 daysize.setWidth(sz.width() / 7); 1219 daysize.setWidth(sz.width() / 7);
1211 QFrame::resizeEvent( e ); 1220 Q3Frame::resizeEvent( e );
1212} 1221}
1213 1222
1214QSize KODayMatrix::sizeHint() const 1223QSize KODayMatrix::sizeHint() const
1215{ 1224{
1216 1225
1217 QFontMetrics fm ( font() ); 1226 QFontMetrics fm ( font() );
1218 int wid = fm.width( "30") *7+3; 1227 int wid = fm.width( "30") *7+3;
1219 int hei = fm.height() * 6+3; 1228 int hei = fm.height() * 6+3;
1220 //qDebug("KODayMatrix::sizeHint()********************* %d %d", wid , hei); 1229 //qDebug("KODayMatrix::sizeHint()********************* %d %d", wid , hei);
1221 return QSize ( wid, hei ); 1230 return QSize ( wid, hei );
1222 1231
1223} 1232}
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index b96e08f..6edf7cd 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -17,50 +17,58 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KODAYMAT_H 23#ifndef _KODAYMAT_H
24#define _KODAYMAT_H 24#define _KODAYMAT_H
25 25
26#include <libkcal/calendar.h> 26#include <libkcal/calendar.h>
27 27
28#include <qstring.h> 28#include <qstring.h>
29#include <qframe.h> 29#include <q3frame.h>
30#include <qcolor.h> 30#include <qcolor.h>
31#include <qpen.h> 31#include <qpen.h>
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <qtooltip.h> 33#include <qtooltip.h>
34#include <qpixmap.h> 34#include <qpixmap.h>
35#include <qbitarray.h> 35#include <qbitarray.h>
36#include <qmap.h> 36#include <qmap.h>
37//Added by qt3to4:
38#include <QDragMoveEvent>
39#include <QDropEvent>
40#include <QDragLeaveEvent>
41#include <QPaintEvent>
42#include <QResizeEvent>
43#include <QMouseEvent>
44#include <QDragEnterEvent>
37 45
38class QDragEnterEvent; 46class QDragEnterEvent;
39class QDragMoveEvent; 47class QDragMoveEvent;
40class QDragLeaveEvent; 48class QDragLeaveEvent;
41class QDropEvent; 49class QDropEvent;
42 50
43class KODayMatrix; 51class KODayMatrix;
44class KODaymatrixWhatsThis; 52class KODaymatrixWhatsThis;
45 53
46using namespace KCal; 54using namespace KCal;
47 55
48 56
49/** 57/**
50 * small helper class to dynamically show tooltips inside the day matrix. 58 * small helper class to dynamically show tooltips inside the day matrix.
51 * This class asks the day matrix object for a appropriate label which 59 * This class asks the day matrix object for a appropriate label which
52 * is in our special case the name of the holiday or null if this day is no holiday. 60 * is in our special case the name of the holiday or null if this day is no holiday.
53 */ 61 */
54class DynamicTip : public QToolTip 62class DynamicTip /* TODO:hacker: : public QToolTip */
55{ 63{
56public: 64public:
57 65
58 /** 66 /**
59 * Constructor that expects a KODayMatrix object as parent. 67 * Constructor that expects a KODayMatrix object as parent.
60 * 68 *
61 * @param parent the parent KODayMatrix control. 69 * @param parent the parent KODayMatrix control.
62 */ 70 */
63 DynamicTip(QWidget* parent ); 71 DynamicTip(QWidget* parent );
64 72
65protected: 73protected:
66 74
@@ -94,25 +102,25 @@ private:
94 * user friendly.) 102 * user friendly.)
95 * This feature has been replaced with dragging a selection on the matrix. The matrix will 103 * This feature has been replaced with dragging a selection on the matrix. The matrix will
96 * automatically choose the appropriate selection (e.g. you are not any longer able to select 104 * automatically choose the appropriate selection (e.g. you are not any longer able to select
97 * two distinct groups of date selections as in the old class) 105 * two distinct groups of date selections as in the old class)
98 * o now that you can select more then a week it can happen that not all selected days are 106 * o now that you can select more then a week it can happen that not all selected days are
99 * displayed in the matrix. However this is preferred to the alternative which would mean to 107 * displayed in the matrix. However this is preferred to the alternative which would mean to
100 * adjust the selection and leave some days undisplayed while scrolling through the months 108 * adjust the selection and leave some days undisplayed while scrolling through the months
101 * 109 *
102 * @short day matrix widget of the KDateNavigator 110 * @short day matrix widget of the KDateNavigator
103 * 111 *
104 * @author Eitzenberger Thomas 112 * @author Eitzenberger Thomas
105 */ 113 */
106class KODayMatrix: public QFrame { 114class KODayMatrix: public Q3Frame {
107 115
108 Q_OBJECT 116 Q_OBJECT
109 117
110public: 118public:
111 119
112 /** constructor to create a day matrix widget. 120 /** constructor to create a day matrix widget.
113 * 121 *
114 * @param parent widget that is the parent of the day matrix. Normally this should 122 * @param parent widget that is the parent of the day matrix. Normally this should
115 * be a KDateNavigator 123 * be a KDateNavigator
116 * @param calendar instance of a calendar on which all calculations are based 124 * @param calendar instance of a calendar on which all calculations are based
117 * @param date start date of the matrix (is expected to be already fixed). It is 125 * @param date start date of the matrix (is expected to be already fixed). It is
118 * assumed that this date is the first week day to be shown in the matrix. 126 * assumed that this date is the first week day to be shown in the matrix.
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index ea30fac..deb1e46 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -32,24 +32,26 @@
32#include "searchdialog.h" 32#include "searchdialog.h"
33#include "filtereditdialog.h" 33#include "filtereditdialog.h"
34#ifndef KORG_NOPLUGINS 34#ifndef KORG_NOPLUGINS
35#include "plugindialog.h" 35#include "plugindialog.h"
36#endif 36#endif
37#ifndef KORG_NOARCHIVE 37#ifndef KORG_NOARCHIVE
38#include "archivedialog.h" 38#include "archivedialog.h"
39#endif 39#endif
40 40
41#include "kconfig.h" 41#include "kconfig.h"
42#include "kodialogmanager.h" 42#include "kodialogmanager.h"
43#include <kapplication.h> 43#include <kapplication.h>
44//Added by qt3to4:
45#include <Q3PtrList>
44 46
45KODialogManager::KODialogManager( CalendarView *mainView ) : 47KODialogManager::KODialogManager( CalendarView *mainView ) :
46 QObject(), mMainView( mainView ) 48 QObject(), mMainView( mainView )
47{ 49{
48 mOutgoingDialog = 0; 50 mOutgoingDialog = 0;
49 mIncomingDialog = 0; 51 mIncomingDialog = 0;
50 mOptionsDialog = 0; 52 mOptionsDialog = 0;
51 mSearchDialog = 0; 53 mSearchDialog = 0;
52 mArchiveDialog = 0; 54 mArchiveDialog = 0;
53 mFilterEditDialog = 0; 55 mFilterEditDialog = 0;
54 mPluginDialog = 0; 56 mPluginDialog = 0;
55 57
@@ -179,26 +181,26 @@ void KODialogManager::showSearchDialog()
179 connect(lview, SIGNAL(showIncidenceSignal(Incidence *)), 181 connect(lview, SIGNAL(showIncidenceSignal(Incidence *)),
180 mMainView, SLOT(showIncidence(Incidence *))); 182 mMainView, SLOT(showIncidence(Incidence *)));
181 connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), 183 connect(lview, SIGNAL(editIncidenceSignal(Incidence *)),
182 mMainView, SLOT(editIncidence(Incidence *))); 184 mMainView, SLOT(editIncidence(Incidence *)));
183 connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), 185 connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)),
184 mMainView, SLOT(deleteIncidence(Incidence *))); 186 mMainView, SLOT(deleteIncidence(Incidence *)));
185 connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), 187 connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)),
186 mMainView, SLOT(cloneIncidence(Incidence *))); 188 mMainView, SLOT(cloneIncidence(Incidence *)));
187 connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), 189 connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)),
188 mMainView, SLOT(beamIncidence(Incidence *))); 190 mMainView, SLOT(beamIncidence(Incidence *)));
189 connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), 191 connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)),
190 mMainView, SLOT(moveIncidence(Incidence *))); 192 mMainView, SLOT(moveIncidence(Incidence *)));
191 connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), 193 connect(lview, SIGNAL(beamIncidenceList(Q3PtrList<Incidence> )),
192 mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); 194 mMainView, SLOT(beamIncidenceList(Q3PtrList<Incidence> )));
193 195
194 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); 196 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig()));
195 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); 197 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList()));
196 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), 198 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ),
197 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 199 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
198#ifndef DESKTOP_VERSION 200#ifndef DESKTOP_VERSION
199 mSearchDialog->setMaximumSize( QApplication::desktop()->size()); 201 mSearchDialog->setMaximumSize( QApplication::desktop()->size());
200 mSearchDialog->showMaximized(); 202 mSearchDialog->showMaximized();
201#else 203#else
202 KConfig *config = KOGlobals::config(); 204 KConfig *config = KOGlobals::config();
203 config->setGroup("WidgetLayout"); 205 config->setGroup("WidgetLayout");
204 QStringList list; 206 QStringList list;
@@ -237,25 +239,25 @@ void KODialogManager::showArchiveDialog()
237 mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); 239 mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView);
238 connect(mArchiveDialog,SIGNAL(eventsDeleted()), 240 connect(mArchiveDialog,SIGNAL(eventsDeleted()),
239 mMainView,SLOT(updateView())); 241 mMainView,SLOT(updateView()));
240 } 242 }
241 mArchiveDialog->show(); 243 mArchiveDialog->show();
242 mArchiveDialog->raise(); 244 mArchiveDialog->raise();
243 245
244 // Workaround. 246 // Workaround.
245 QApplication::restoreOverrideCursor(); 247 QApplication::restoreOverrideCursor();
246#endif 248#endif
247} 249}
248 250
249void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) 251void KODialogManager::showFilterEditDialog(Q3PtrList<CalFilter> *filters)
250{ 252{
251 if (!mFilterEditDialog) { 253 if (!mFilterEditDialog) {
252 mFilterEditDialog = new FilterEditDialog(filters,mMainView); 254 mFilterEditDialog = new FilterEditDialog(filters,mMainView);
253 connect(mFilterEditDialog,SIGNAL(filterChanged()), 255 connect(mFilterEditDialog,SIGNAL(filterChanged()),
254 mMainView,SLOT(filterEdited())); 256 mMainView,SLOT(filterEdited()));
255 257
256 } 258 }
257 259
258#ifndef DESKTOP_VERSION 260#ifndef DESKTOP_VERSION
259 mFilterEditDialog->showMaximized(); 261 mFilterEditDialog->showMaximized();
260#else 262#else
261 mFilterEditDialog->show(); 263 mFilterEditDialog->show();
diff --git a/korganizer/kodialogmanager.h b/korganizer/kodialogmanager.h
index b68ddc2..00ad1df 100644
--- a/korganizer/kodialogmanager.h
+++ b/korganizer/kodialogmanager.h
@@ -16,25 +16,25 @@
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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#ifndef KODIALOGMANAGER_H 24#ifndef KODIALOGMANAGER_H
25#define KODIALOGMANAGER_H 25#define KODIALOGMANAGER_H
26 26
27#include <qobject.h> 27#include <qobject.h>
28#include <qptrlist.h> 28#include <q3ptrlist.h>
29 29
30#include <libkcal/calfilter.h> 30#include <libkcal/calfilter.h>
31 31
32class CalendarView; 32class CalendarView;
33class OutgoingDialog; 33class OutgoingDialog;
34class IncomingDialog; 34class IncomingDialog;
35class KOPrefsDialog; 35class KOPrefsDialog;
36//namespace KPIM { class CategoryEditDialog; } 36//namespace KPIM { class CategoryEditDialog; }
37class KOEventEditor; 37class KOEventEditor;
38class KOTodoEditor; 38class KOTodoEditor;
39class SearchDialog; 39class SearchDialog;
40class ArchiveDialog; 40class ArchiveDialog;
@@ -69,25 +69,25 @@ class KODialogManager : public QObject
69 SearchDialog * getSearchDialog(); 69 SearchDialog * getSearchDialog();
70 void setDocumentId( const QString &id ); 70 void setDocumentId( const QString &id );
71 71
72 public slots: 72 public slots:
73 void showOptionsDialog( bool showSync = false); 73 void showOptionsDialog( bool showSync = false);
74 void showGlobalOptionsDialog(bool showSync = false); 74 void showGlobalOptionsDialog(bool showSync = false);
75 void showSyncOptions(); 75 void showSyncOptions();
76 void showIncomingDialog(); 76 void showIncomingDialog();
77 void showOutgoingDialog(); 77 void showOutgoingDialog();
78 // void showCategoryEditDialog(); 78 // void showCategoryEditDialog();
79 void showSearchDialog(); 79 void showSearchDialog();
80 void showArchiveDialog(); 80 void showArchiveDialog();
81 void showFilterEditDialog(QPtrList<CalFilter> *filters); 81 void showFilterEditDialog(Q3PtrList<CalFilter> *filters);
82 void showPluginDialog(); 82 void showPluginDialog();
83 void hideSearchDialog(); 83 void hideSearchDialog();
84 84
85 private: 85 private:
86 void createOutgoingDialog(); 86 void createOutgoingDialog();
87 void createIncomingDialog(); 87 void createIncomingDialog();
88 88
89 CalendarView *mMainView; 89 CalendarView *mMainView;
90 90
91 OutgoingDialog *mOutgoingDialog; 91 OutgoingDialog *mOutgoingDialog;
92 IncomingDialog *mIncomingDialog; 92 IncomingDialog *mIncomingDialog;
93 KOPrefsDialog *mOptionsDialog; 93 KOPrefsDialog *mOptionsDialog;
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp
index 9a4b4ec..a01c838 100644
--- a/korganizer/koeditordetails.cpp
+++ b/korganizer/koeditordetails.cpp
@@ -13,32 +13,38 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qfiledialog.h> 25#include <q3filedialog.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <q3vbox.h>
28#include <qbuttongroup.h> 28#include <q3buttongroup.h>
29#include <qvgroupbox.h> 29#include <q3vgroupbox.h>
30#include <qwidgetstack.h> 30#include <q3widgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qapp.h> 32#include <qapplication.h>
33#include <QDesktopWidget>
34//Added by qt3to4:
35#include <Q3GridLayout>
36#include <QLabel>
37#include <Q3PtrList>
38#include <Q3VBoxLayout>
33 39
34#include <klocale.h> 40#include <klocale.h>
35#include <kglobal.h> 41#include <kglobal.h>
36#include <kdialog.h> 42#include <kdialog.h>
37#include <kiconloader.h> 43#include <kiconloader.h>
38#include <kstandarddirs.h> 44#include <kstandarddirs.h>
39#include <kmessagebox.h> 45#include <kmessagebox.h>
40#ifndef KORG_NOKABC 46#ifndef KORG_NOKABC
41 47
42#ifdef DESKTOP_VERSION 48#ifdef DESKTOP_VERSION
43#include <kabc/addresseedialog.h> 49#include <kabc/addresseedialog.h>
44#else //DESKTOP_VERSION 50#else //DESKTOP_VERSION
@@ -71,50 +77,50 @@ void CustomListViewItem<Attendee *>::updateItem()
71 setSortKey(4,"j"); 77 setSortKey(4,"j");
72 } 78 }
73 else { 79 else {
74 setPixmap(4,SmallIcon("nomailappt")); 80 setPixmap(4,SmallIcon("nomailappt"));
75 setSortKey(4,"n"); 81 setSortKey(4,"n");
76 } 82 }
77} 83}
78 84
79 85
80KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) 86KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
81 : QWidget( parent, name), mDisableItemUpdate( false ) 87 : QWidget( parent, name), mDisableItemUpdate( false )
82{ 88{
83 QGridLayout *topLayout = new QGridLayout(this); 89 Q3GridLayout *topLayout = new Q3GridLayout(this);
84 topLayout->setSpacing(spacing); 90 topLayout->setSpacing(spacing);
85 topLayout->setMargin(KDialog::marginHint()-2); 91 topLayout->setMargin(KDialog::marginHint()-2);
86 92
87 QString organizer = KOPrefs::instance()->email(); 93 QString organizer = KOPrefs::instance()->email();
88 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); 94 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this);
89 95
90 mListView = new KListView(this,"mListView"); 96 mListView = new KListView(this,"mListView");
91 mListView->addColumn(i18n("Name"),180); 97 mListView->addColumn(i18n("Name"),180);
92 mListView->addColumn(i18n("Email"),180); 98 mListView->addColumn(i18n("Email"),180);
93 mListView->addColumn(i18n("Role"),60); 99 mListView->addColumn(i18n("Role"),60);
94 mListView->addColumn(i18n("Status"),100); 100 mListView->addColumn(i18n("Status"),100);
95 mListView->addColumn(i18n("RSVP"),35); 101 mListView->addColumn(i18n("RSVP"),35);
96 if ( QApplication::desktop()->width() <= 320 || QApplication::desktop()->height() <= 240) { 102 if ( QApplication::desktop()->width() <= 320 || QApplication::desktop()->height() <= 240) {
97 int hei = 80; 103 int hei = 80;
98 if ( QApplication::desktop()->height() <= 240 ) 104 if ( QApplication::desktop()->height() <= 240 )
99 hei = 60; 105 hei = 60;
100 mListView->setFixedHeight(hei); 106 mListView->setFixedHeight(hei);
101 } 107 }
102 mListView->setAllColumnsShowFocus (true ); 108 mListView->setAllColumnsShowFocus (true );
103 //mListView->setSingleClick( true ); 109 //mListView->setSingleClick( true );
104 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), 110 connect(mListView,SIGNAL(selectionChanged(Q3ListViewItem *)),
105 SLOT(updateAttendeeInput())); 111 SLOT(updateAttendeeInput()));
106 112
107 connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), 113 connect(mListView,SIGNAL(executed(Q3ListViewItem * ,const QPoint&, int )),
108 SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); 114 SLOT(itemClicked(Q3ListViewItem * ,const QPoint& , int )));
109 115
110 mRsvpButton = new QCheckBox(this); 116 mRsvpButton = new QCheckBox(this);
111 mRsvpButton->setText(i18n("Request response")); 117 mRsvpButton->setText(i18n("Request response"));
112 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); 118 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this);
113 QLabel *attendeeLabel = new QLabel(this); 119 QLabel *attendeeLabel = new QLabel(this);
114 attendeeLabel->setText(i18n("Name:")); 120 attendeeLabel->setText(i18n("Name:"));
115 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); 121 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() );
116 mNameEdit = new QLineEdit(this); 122 mNameEdit = new QLineEdit(this);
117 connect(mNameEdit,SIGNAL(textChanged(const QString &)), 123 connect(mNameEdit,SIGNAL(textChanged(const QString &)),
118 SLOT(updateAttendeeItem())); 124 SLOT(updateAttendeeItem()));
119 125
120 126
@@ -131,25 +137,25 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
131 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 137 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
132 138
133 QLabel *statusLabel = new QLabel(this); 139 QLabel *statusLabel = new QLabel(this);
134 statusLabel->setText( i18n("Status:") ); 140 statusLabel->setText( i18n("Status:") );
135 141
136 mStatusCombo = new QComboBox(false,this); 142 mStatusCombo = new QComboBox(false,this);
137 mStatusCombo->insertStringList(Attendee::statusList()); 143 mStatusCombo->insertStringList(Attendee::statusList());
138 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 144 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
139 145
140 146
141 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); 147 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem()));
142 QWidget *buttonBox = new QWidget(this); 148 QWidget *buttonBox = new QWidget(this);
143 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); 149 Q3VBoxLayout *buttonLayout = new Q3VBoxLayout(buttonBox);
144 150
145 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); 151 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox);
146 buttonLayout->addWidget(newButton); 152 buttonLayout->addWidget(newButton);
147 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); 153 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee()));
148 154
149 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); 155 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox);
150 buttonLayout->addWidget(mRemoveButton); 156 buttonLayout->addWidget(mRemoveButton);
151 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); 157 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee()));
152 158
153 // buttonLayout->addWidget(mAddressBookButton); 159 // buttonLayout->addWidget(mAddressBookButton);
154 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); 160 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook()));
155 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); 161 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () );
@@ -356,37 +362,37 @@ void KOEditorDetails::setDefaults()
356 mUidEdit = ""; 362 mUidEdit = "";
357 mEmailEdit->setText(""); 363 mEmailEdit->setText("");
358 mRoleCombo->setCurrentItem( 0 ); 364 mRoleCombo->setCurrentItem( 0 );
359 mStatusCombo->setCurrentItem( 0 ); 365 mStatusCombo->setCurrentItem( 0 );
360 366
361} 367}
362 368
363void KOEditorDetails::readEvent(Incidence *event) 369void KOEditorDetails::readEvent(Incidence *event)
364{ 370{
365 setDefaults(); 371 setDefaults();
366 //mListView->clear(); 372 //mListView->clear();
367 //mdelAttendees.clear(); 373 //mdelAttendees.clear();
368 QPtrList<Attendee> tmpAList = event->attendees(); 374 Q3PtrList<Attendee> tmpAList = event->attendees();
369 Attendee *a; 375 Attendee *a;
370 for (a = tmpAList.first(); a; a = tmpAList.next()) 376 for (a = tmpAList.first(); a; a = tmpAList.next())
371 insertAttendee(new Attendee(*a)); 377 insertAttendee(new Attendee(*a));
372 378
373 mListView->setSelected( mListView->firstChild(), true ); 379 mListView->setSelected( mListView->firstChild(), true );
374 mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer())); 380 mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer()));
375} 381}
376 382
377void KOEditorDetails::writeEvent(Incidence *event) 383void KOEditorDetails::writeEvent(Incidence *event)
378{ 384{
379 event->clearAttendees(); 385 event->clearAttendees();
380 QListViewItem *item; 386 Q3ListViewItem *item;
381 AttendeeListItem *a; 387 AttendeeListItem *a;
382 for (item = mListView->firstChild(); item; 388 for (item = mListView->firstChild(); item;
383 item = item->nextSibling()) { 389 item = item->nextSibling()) {
384 a = (AttendeeListItem *)item; 390 a = (AttendeeListItem *)item;
385 event->addAttendee(new Attendee(*(a->data()))); 391 event->addAttendee(new Attendee(*(a->data())));
386 } 392 }
387 event->setOrganizer(KOPrefs::instance()->email()); 393 event->setOrganizer(KOPrefs::instance()->email());
388} 394}
389 395
390void KOEditorDetails::cancelAttendeeEvent(Incidence *event) 396void KOEditorDetails::cancelAttendeeEvent(Incidence *event)
391{ 397{
392 event->clearAttendees(); 398 event->clearAttendees();
@@ -395,25 +401,25 @@ void KOEditorDetails::cancelAttendeeEvent(Incidence *event)
395 event->addAttendee(new Attendee(*att)); 401 event->addAttendee(new Attendee(*att));
396 } 402 }
397 mdelAttendees.clear(); 403 mdelAttendees.clear();
398} 404}
399 405
400bool KOEditorDetails::validateInput() 406bool KOEditorDetails::validateInput()
401{ 407{
402 return true; 408 return true;
403} 409}
404 410
405void KOEditorDetails::updateAttendeeInput() 411void KOEditorDetails::updateAttendeeInput()
406{ 412{
407 QListViewItem *item = mListView->selectedItem(); 413 Q3ListViewItem *item = mListView->selectedItem();
408 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); 414 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
409 if (aItem) { 415 if (aItem) {
410 fillAttendeeInput( aItem ); 416 fillAttendeeInput( aItem );
411 } else { 417 } else {
412 clearAttendeeInput(); 418 clearAttendeeInput();
413 } 419 }
414} 420}
415 421
416void KOEditorDetails::clearAttendeeInput() 422void KOEditorDetails::clearAttendeeInput()
417{ 423{
418 mNameEdit->setText(""); 424 mNameEdit->setText("");
419 mUidEdit = ""; 425 mUidEdit = "";
@@ -442,36 +448,36 @@ void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem )
442 448
443void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) 449void KOEditorDetails::setEnabledAttendeeInput( bool enabled )
444{ 450{
445 mNameEdit->setEnabled( enabled ); 451 mNameEdit->setEnabled( enabled );
446 mEmailEdit->setEnabled( enabled ); 452 mEmailEdit->setEnabled( enabled );
447 mRoleCombo->setEnabled( enabled ); 453 mRoleCombo->setEnabled( enabled );
448 mStatusCombo->setEnabled( enabled ); 454 mStatusCombo->setEnabled( enabled );
449 mRsvpButton->setEnabled( enabled ); 455 mRsvpButton->setEnabled( enabled );
450 456
451 mRemoveButton->setEnabled( enabled ); 457 mRemoveButton->setEnabled( enabled );
452} 458}
453 459
454void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c ) 460void KOEditorDetails::itemClicked(Q3ListViewItem * item ,const QPoint & pnt, int c )
455{ 461{
456 if ( item && c == 4 ) { 462 if ( item && c == 4 ) {
457 mRsvpButton->setChecked( !mRsvpButton->isChecked() ); 463 mRsvpButton->setChecked( !mRsvpButton->isChecked() );
458 updateAttendeeItem(); 464 updateAttendeeItem();
459 } 465 }
460} 466}
461void KOEditorDetails::updateAttendeeItem() 467void KOEditorDetails::updateAttendeeItem()
462{ 468{
463 if (mDisableItemUpdate) return; 469 if (mDisableItemUpdate) return;
464 470
465 QListViewItem *item = mListView->selectedItem(); 471 Q3ListViewItem *item = mListView->selectedItem();
466 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); 472 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
467 if ( !aItem ) return; 473 if ( !aItem ) return;
468 474
469 Attendee *a = aItem->data(); 475 Attendee *a = aItem->data();
470 476
471 a->setName( mNameEdit->text() ); 477 a->setName( mNameEdit->text() );
472 a->setUid( mUidEdit ); 478 a->setUid( mUidEdit );
473 a->setEmail( mEmailEdit->text() ); 479 a->setEmail( mEmailEdit->text() );
474 if ( mEmailEdit->text().isEmpty() ) 480 if ( mEmailEdit->text().isEmpty() )
475 mRsvpButton->setChecked( false ); 481 mRsvpButton->setChecked( false );
476 a->setRSVP( mRsvpButton->isChecked() ); 482 a->setRSVP( mRsvpButton->isChecked() );
477 a->setRole( Attendee::Role( mRoleCombo->currentItem() ) ); 483 a->setRole( Attendee::Role( mRoleCombo->currentItem() ) );
diff --git a/korganizer/koeditordetails.h b/korganizer/koeditordetails.h
index 5f8f6f2..40e896c 100644
--- a/korganizer/koeditordetails.h
+++ b/korganizer/koeditordetails.h
@@ -15,35 +15,35 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOEDITORDETAILS_H 23#ifndef _KOEDITORDETAILS_H
24#define _KOEDITORDETAILS_H 24#define _KOEDITORDETAILS_H
25 25
26#include <qmap.h> 26#include <qmap.h>
27#include <qframe.h> 27#include <q3frame.h>
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qcheckbox.h> 29#include <qcheckbox.h>
30#include <qpushbutton.h> 30#include <qpushbutton.h>
31#include <qgroupbox.h> 31#include <q3groupbox.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qmultilineedit.h> 34#include <q3multilineedit.h>
35#include <klistview.h> 35#include <klistview.h>
36#include <qradiobutton.h> 36#include <qradiobutton.h>
37#include <qptrlist.h> 37#include <q3ptrlist.h>
38 38
39#include <kapplication.h> 39#include <kapplication.h>
40 40
41#include <libkcal/event.h> 41#include <libkcal/event.h>
42 42
43#include "ktimeedit.h" 43#include "ktimeedit.h"
44#include "customlistviewitem.h" 44#include "customlistviewitem.h"
45 45
46class KDateEdit; 46class KDateEdit;
47 47
48using namespace KCal; 48using namespace KCal;
49 49
@@ -74,36 +74,36 @@ class KOEditorDetails : public QWidget
74 // called when the app recieves a list of name/email/uid (=addresses) from another app. Usually Ka/Pi 74 // called when the app recieves a list of name/email/uid (=addresses) from another app. Usually Ka/Pi
75 // The first parameter is a uniqueid. It can be used to identify if event 75 // The first parameter is a uniqueid. It can be used to identify if event
76 void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); 76 void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist);
77 77
78 78
79 protected slots: 79 protected slots:
80 void addNewAttendee(); 80 void addNewAttendee();
81 void removeAttendee(); 81 void removeAttendee();
82 void openAddressBook(); 82 void openAddressBook();
83 void updateAttendeeInput(); 83 void updateAttendeeInput();
84 void clearAttendeeInput(); 84 void clearAttendeeInput();
85 void fillAttendeeInput(AttendeeListItem *); 85 void fillAttendeeInput(AttendeeListItem *);
86 void itemClicked(QListViewItem *,const QPoint & pnt, int c); 86 void itemClicked(Q3ListViewItem *,const QPoint & pnt, int c);
87 void updateAttendeeItem(); 87 void updateAttendeeItem();
88 void setEnabledAttendeeInput(bool); 88 void setEnabledAttendeeInput(bool);
89 89
90 private: 90 private:
91 bool mDisableItemUpdate; 91 bool mDisableItemUpdate;
92 92
93 QLineEdit *mNameEdit; 93 QLineEdit *mNameEdit;
94 QString mUidEdit; 94 QString mUidEdit;
95 QLineEdit *mEmailEdit; 95 QLineEdit *mEmailEdit;
96 KListView *mListView; 96 KListView *mListView;
97 QComboBox* mRoleCombo; 97 QComboBox* mRoleCombo;
98 QCheckBox* mRsvpButton; 98 QCheckBox* mRsvpButton;
99 QComboBox* mStatusCombo; 99 QComboBox* mStatusCombo;
100 QLabel *mOrganizerLabel; 100 QLabel *mOrganizerLabel;
101 101
102 QPushButton* mAddButton; 102 QPushButton* mAddButton;
103 QPushButton* mRemoveButton; 103 QPushButton* mRemoveButton;
104 QPushButton* mAddressBookButton; 104 QPushButton* mAddressBookButton;
105 105
106 QPtrList<Attendee> mdelAttendees; 106 Q3PtrList<Attendee> mdelAttendees;
107}; 107};
108 108
109#endif 109#endif
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 21f220c..8105432 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -15,33 +15,40 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qwidget.h> 24#include <qwidget.h>
25#include <qtooltip.h> 25#include <qtooltip.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <q3vbox.h>
28#include <qbuttongroup.h> 28#include <q3buttongroup.h>
29#include <qvgroupbox.h> 29#include <q3vgroupbox.h>
30#include <qwidgetstack.h> 30#include <q3widgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qregexp.h> 34#include <qregexp.h>
35//Added by qt3to4:
36#include <Q3HBoxLayout>
37#include <QLabel>
38#include <Q3GridLayout>
39#include <Q3PtrList>
40#include <Q3PopupMenu>
35 41
42#include <QDesktopWidget>
36 43
37#include <kglobal.h> 44#include <kglobal.h>
38#include <kdialog.h> 45#include <kdialog.h>
39#include <kdebug.h> 46#include <kdebug.h>
40#include <klocale.h> 47#include <klocale.h>
41#include <kiconloader.h> 48#include <kiconloader.h>
42#include <kmessagebox.h> 49#include <kmessagebox.h>
43#include <kfiledialog.h> 50#include <kfiledialog.h>
44#include <kstandarddirs.h> 51#include <kstandarddirs.h>
45 52
46#include <libkcal/todo.h> 53#include <libkcal/todo.h>
47#include <libkcal/event.h> 54#include <libkcal/event.h>
@@ -60,27 +67,27 @@
60#endif 67#endif
61 68
62KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : 69KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) :
63 QObject( parent, name) 70 QObject( parent, name)
64{ 71{
65 mNextFocus = 0; 72 mNextFocus = 0;
66} 73}
67 74
68KOEditorGeneral::~KOEditorGeneral() 75KOEditorGeneral::~KOEditorGeneral()
69{ 76{
70} 77}
71 78
72void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) 79void KOEditorGeneral::initHeader(QWidget *parent,Q3BoxLayout *topLayout)
73{ 80{
74 QGridLayout *headerLayout = new QGridLayout(topLayout); 81 Q3GridLayout *headerLayout = new Q3GridLayout(topLayout);
75 82
76#if 0 83#if 0
77 mOwnerLabel = new QLabel(i18n("Owner:"),parent); 84 mOwnerLabel = new QLabel(i18n("Owner:"),parent);
78 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); 85 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1);
79#endif 86#endif
80 // 1 on pda 87 // 1 on pda
81 // 11 on desktop 88 // 11 on desktop
82 headerLayout->setSpacing( (KDialog::spacingHint()-3)*2+1 ); 89 headerLayout->setSpacing( (KDialog::spacingHint()-3)*2+1 );
83 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); 90 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent);
84 headerLayout->addWidget(summaryLabel,0,0); 91 headerLayout->addWidget(summaryLabel,0,0);
85 92
86 mSummaryEdit = new KOLocationBox(TRUE,parent, 50); 93 mSummaryEdit = new KOLocationBox(TRUE,parent, 50);
@@ -186,75 +193,75 @@ void KOEditorGeneral::selectedCatPopup( int index )
186 else 193 else
187 categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]); 194 categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]);
188 categories.sort (); 195 categories.sort ();
189 if ( !colcat.isEmpty() ) { 196 if ( !colcat.isEmpty() ) {
190 if ( categories.find ( colcat ) != categories.end () ) { 197 if ( categories.find ( colcat ) != categories.end () ) {
191 categories.remove( colcat ); 198 categories.remove( colcat );
192 categories.prepend( colcat ); 199 categories.prepend( colcat );
193 } 200 }
194 } 201 }
195 setCategories( categories.join(",") ); 202 setCategories( categories.join(",") );
196} 203}
197 204
198void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) 205void KOEditorGeneral::initCategories(QWidget *parent, Q3BoxLayout *topLayout)
199{ 206{
200 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); 207 Q3BoxLayout *categoriesLayout = new Q3HBoxLayout( topLayout );
201 mCatPopup = new QPopupMenu ( parent ); 208 mCatPopup = new Q3PopupMenu ( parent );
202 mCatPopup->setCheckable (true); 209 mCatPopup->setCheckable (true);
203 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); 210 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup()));
204 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); 211 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int )));
205 mCategoriesButton = new QPushButton(parent); 212 mCategoriesButton = new QPushButton(parent);
206 mCategoriesButton->setText(i18n("Categories...")); 213 mCategoriesButton->setText(i18n("Categories..."));
207 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 214 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
208 //connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 215 //connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
209 categoriesLayout->addWidget(mCategoriesButton); 216 categoriesLayout->addWidget(mCategoriesButton);
210 mCategoriesLabel = new QPushButton(parent);//new QLabel(parent); 217 mCategoriesLabel = new QPushButton(parent);//new QLabel(parent);
211 mCategoriesLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); 218 mCategoriesLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
212 mCategoriesLabel->setPopup( mCatPopup ); 219 mCategoriesLabel->setPopup( mCatPopup );
213 //mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); 220 //mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken);
214 categoriesLayout->addWidget(mCategoriesLabel,1); 221 categoriesLayout->addWidget(mCategoriesLabel,1);
215} 222}
216 223
217void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) 224void KOEditorGeneral::initSecrecy(QWidget *parent, Q3BoxLayout *topLayout)
218{ 225{
219 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); 226 Q3BoxLayout *secrecyLayout = new Q3HBoxLayout( topLayout );
220 227
221 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); 228 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent);
222 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); 229 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent);
223 secrecyLayout->addWidget(mCancelBox); 230 secrecyLayout->addWidget(mCancelBox);
224 secrecyLayout->addWidget(secrecyLabel); 231 secrecyLayout->addWidget(secrecyLabel);
225 232
226 mSecrecyCombo = new QComboBox(parent); 233 mSecrecyCombo = new QComboBox(parent);
227 mSecrecyCombo->insertStringList(Incidence::secrecyList()); 234 mSecrecyCombo->insertStringList(Incidence::secrecyList());
228 secrecyLayout->addWidget(mSecrecyCombo); 235 secrecyLayout->addWidget(mSecrecyCombo);
229} 236}
230 237
231void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) 238void KOEditorGeneral::initDescription(QWidget *parent,Q3BoxLayout *topLayout)
232{ 239{
233 mDescriptionEdit = new KTextEdit(parent); 240 mDescriptionEdit = new KTextEdit(parent);
234 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); 241 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont );
235 mDescriptionEdit->append(""); 242 mDescriptionEdit->append("");
236 mDescriptionEdit->setReadOnly(false); 243 mDescriptionEdit->setReadOnly(false);
237 mDescriptionEdit->setOverwriteMode(false); 244 mDescriptionEdit->setOverwriteMode(false);
238 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); 245 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth );
239 topLayout->addWidget(mDescriptionEdit); 246 topLayout->addWidget(mDescriptionEdit);
240#ifndef DESKTOP_VERSION 247#ifndef DESKTOP_VERSION
241 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); 248 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold );
242#endif 249#endif
243 250
244} 251}
245 252
246void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) 253void KOEditorGeneral::initAlarm(QWidget *parent,Q3BoxLayout *topLayout)
247{ 254{
248 QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); 255 Q3BoxLayout *alarmLayout = new Q3HBoxLayout(topLayout);
249 256
250 //mAlarmBell = new QLabel(parent); 257 //mAlarmBell = new QLabel(parent);
251 //mAlarmBell->setPixmap(SmallIcon("bell")); 258 //mAlarmBell->setPixmap(SmallIcon("bell"));
252 //alarmLayout->addWidget(mAlarmBell); 259 //alarmLayout->addWidget(mAlarmBell);
253 if ( QApplication::desktop()->width() < 320 ) 260 if ( QApplication::desktop()->width() < 320 )
254 mAlarmButton = new QCheckBox(i18n("Rem."),parent); 261 mAlarmButton = new QCheckBox(i18n("Rem."),parent);
255 else 262 else
256 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); 263 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent);
257 264
258 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); 265 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool)));
259 alarmLayout->addWidget(mAlarmButton); 266 alarmLayout->addWidget(mAlarmButton);
260 267
@@ -519,25 +526,25 @@ void KOEditorGeneral::readIncidence(Incidence *event)
519 } else { 526 } else {
520 alarmTime = a[index]; 527 alarmTime = a[index];
521 } 528 }
522 mAlarmTimeEdit->setValue(alarmTime); 529 mAlarmTimeEdit->setValue(alarmTime);
523 } 530 }
524 mAlarmButton->setChecked( event->isAlarmEnabled() ); 531 mAlarmButton->setChecked( event->isAlarmEnabled() );
525 mSecrecyCombo->setCurrentItem(event->secrecy()); 532 mSecrecyCombo->setCurrentItem(event->secrecy());
526 mCancelBox->setChecked( event->cancelled() ); 533 mCancelBox->setChecked( event->cancelled() );
527 mAlarmProgramButton->setOn(false); 534 mAlarmProgramButton->setOn(false);
528 mAlarmSoundButton->setOn(false); 535 mAlarmSoundButton->setOn(false);
529 536
530 // set up alarm stuff 537 // set up alarm stuff
531 QPtrList<Alarm> alarms = event->alarms(); 538 Q3PtrList<Alarm> alarms = event->alarms();
532 Alarm* alarm; 539 Alarm* alarm;
533 mAlarmIncrCombo->setCurrentItem(0); 540 mAlarmIncrCombo->setCurrentItem(0);
534 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { 541 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) {
535 int offset; 542 int offset;
536 if ( alarm->hasTime() ) { 543 if ( alarm->hasTime() ) {
537 QDateTime t = alarm->time(); 544 QDateTime t = alarm->time();
538 offset = event->dtStart().secsTo( t ); 545 offset = event->dtStart().secsTo( t );
539 } else { 546 } else {
540 offset = alarm->startOffset().asSeconds(); 547 offset = alarm->startOffset().asSeconds();
541 } 548 }
542 if ( offset != 0 ) { 549 if ( offset != 0 ) {
543 offset = offset / -60; // make minutes 550 offset = offset / -60; // make minutes
@@ -581,25 +588,25 @@ void KOEditorGeneral::writeIncidence(Incidence *event)
581 // kdDebug() << "KOEditorGeneral::writeEvent()" << endl; 588 // kdDebug() << "KOEditorGeneral::writeEvent()" << endl;
582 mLocationEdit->save(KOLocationBox::LOCATION); 589 mLocationEdit->save(KOLocationBox::LOCATION);
583 event->setSummary(mSummaryEdit->currentText()); 590 event->setSummary(mSummaryEdit->currentText());
584 event->setLocation(mLocationEdit->currentText()); 591 event->setLocation(mLocationEdit->currentText());
585 event->setDescription(mDescriptionEdit->text()); 592 event->setDescription(mDescriptionEdit->text());
586 event->setCategories(mCategoriesLabel->text()); 593 event->setCategories(mCategoriesLabel->text());
587 event->setSecrecy(mSecrecyCombo->currentItem()); 594 event->setSecrecy(mSecrecyCombo->currentItem());
588 event->setCancelled(mCancelBox->isChecked() );; 595 event->setCancelled(mCancelBox->isChecked() );;
589 // alarm stuff 596 // alarm stuff
590 if (mAlarmButton->isChecked()) { 597 if (mAlarmButton->isChecked()) {
591 if (event->alarms().count() == 0) 598 if (event->alarms().count() == 0)
592 event->newAlarm(); 599 event->newAlarm();
593 QPtrList<Alarm> alarms = event->alarms(); 600 Q3PtrList<Alarm> alarms = event->alarms();
594 Alarm *alarm; 601 Alarm *alarm;
595 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { 602 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) {
596 alarm->setEnabled(true); 603 alarm->setEnabled(true);
597 int j = mAlarmTimeEdit->value()* -60; 604 int j = mAlarmTimeEdit->value()* -60;
598 if (mAlarmIncrCombo->currentItem() == 1) 605 if (mAlarmIncrCombo->currentItem() == 1)
599 j = j * 60; 606 j = j * 60;
600 else if (mAlarmIncrCombo->currentItem() == 2) 607 else if (mAlarmIncrCombo->currentItem() == 2)
601 j = j * (60 * 24); 608 j = j * (60 * 24);
602 alarm->setStartOffset( j ); 609 alarm->setStartOffset( j );
603 610
604 if (!mAlarmProgram.isEmpty() && mAlarmProgramButton->isOn()) { 611 if (!mAlarmProgram.isEmpty() && mAlarmProgramButton->isOn()) {
605 alarm->setProcedureAlarm(mAlarmProgram); 612 alarm->setProcedureAlarm(mAlarmProgram);
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h
index b10a5d4..45f26fd 100644
--- a/korganizer/koeditorgeneral.h
+++ b/korganizer/koeditorgeneral.h
@@ -14,61 +14,62 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOEDITORGENERAL_H 23#ifndef KOEDITORGENERAL_H
24#define KOEDITORGENERAL_H 24#define KOEDITORGENERAL_H
25 25
26#include <qframe.h> 26#include <q3frame.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qcheckbox.h> 28#include <qcheckbox.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qpopupmenu.h> 30#include <q3popupmenu.h>
31#include <qgroupbox.h> 31#include <q3groupbox.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qlistview.h> 34#include <q3listview.h>
35#include <qradiobutton.h> 35#include <qradiobutton.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qcombobox.h> 38#include <qcombobox.h>
39#include <Q3BoxLayout>
39 40
40#include <ktextedit.h> 41#include <ktextedit.h>
41#include <krestrictedline.h> 42#include <krestrictedline.h>
42 43
43#include <libkcal/incidence.h> 44#include <libkcal/incidence.h>
44 45
45#include "ktimeedit.h" 46#include "ktimeedit.h"
46 47
47class KDateEdit; 48class KDateEdit;
48class KOLocationBox; 49class KOLocationBox;
49using namespace KCal; 50using namespace KCal;
50 51
51class KOEditorGeneral : public QObject 52class KOEditorGeneral : public QObject
52{ 53{
53 Q_OBJECT 54 Q_OBJECT
54 public: 55 public:
55 KOEditorGeneral (QObject* parent=0,const char* name=0); 56 KOEditorGeneral (QObject* parent=0,const char* name=0);
56 virtual ~KOEditorGeneral(); 57 virtual ~KOEditorGeneral();
57 void setFocusOn( int i ); 58 void setFocusOn( int i );
58 void initHeader(QWidget *,QBoxLayout *); 59 void initHeader(QWidget *,Q3BoxLayout *);
59 void initDescription(QWidget *,QBoxLayout *); 60 void initDescription(QWidget *,Q3BoxLayout *);
60 void initSecrecy(QWidget *,QBoxLayout *); 61 void initSecrecy(QWidget *,Q3BoxLayout *);
61 void initCategories(QWidget *,QBoxLayout *); 62 void initCategories(QWidget *,Q3BoxLayout *);
62 void initAlarm(QWidget *,QBoxLayout *); 63 void initAlarm(QWidget *,Q3BoxLayout *);
63 64
64 /** Set widgets to default values */ 65 /** Set widgets to default values */
65 void setDefaults(bool allDay); 66 void setDefaults(bool allDay);
66 /** Read event object and setup widgets accordingly */ 67 /** Read event object and setup widgets accordingly */
67 void readIncidence(Incidence *); 68 void readIncidence(Incidence *);
68 /** Write event settings to event object */ 69 /** Write event settings to event object */
69 void writeIncidence(Incidence *); 70 void writeIncidence(Incidence *);
70 71
71 /** Check if the input is valid. */ 72 /** Check if the input is valid. */
72 bool validateInput() { return true; } 73 bool validateInput() { return true; }
73 74
74 void enableAlarm( bool enable ); 75 void enableAlarm( bool enable );
@@ -106,20 +107,20 @@ class KOEditorGeneral : public QObject
106 QSpinBox *mAlarmTimeEdit; 107 QSpinBox *mAlarmTimeEdit;
107 QPushButton *mAlarmSoundButton; 108 QPushButton *mAlarmSoundButton;
108 QPushButton *mAlarmProgramButton; 109 QPushButton *mAlarmProgramButton;
109 QComboBox *mAlarmIncrCombo; 110 QComboBox *mAlarmIncrCombo;
110 KTextEdit *mDescriptionEdit; 111 KTextEdit *mDescriptionEdit;
111 QLabel *mOwnerLabel; 112 QLabel *mOwnerLabel;
112 QComboBox *mSecrecyCombo; 113 QComboBox *mSecrecyCombo;
113 QCheckBox *mCancelBox; 114 QCheckBox *mCancelBox;
114 QPushButton *mCategoriesButton; 115 QPushButton *mCategoriesButton;
115 QPushButton *mCategoriesLabel; 116 QPushButton *mCategoriesLabel;
116 117
117 private: 118 private:
118 QPopupMenu * mCatPopup; 119 Q3PopupMenu * mCatPopup;
119 QString getFittingPath( const QString &) ; 120 QString getFittingPath( const QString &) ;
120 QString mAlarmSound; 121 QString mAlarmSound;
121 QString mAlarmProgram; 122 QString mAlarmProgram;
122 QString mAlarmMessage; 123 QString mAlarmMessage;
123}; 124};
124 125
125#endif 126#endif
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp
index 2c6ed9f..73a4139 100644
--- a/korganizer/koeditorgeneralevent.cpp
+++ b/korganizer/koeditorgeneralevent.cpp
@@ -14,29 +14,35 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qvbox.h> 26#include <q3vbox.h>
27#include <qbuttongroup.h> 27#include <q3buttongroup.h>
28#include <qvgroupbox.h> 28#include <q3vgroupbox.h>
29#include <qwidgetstack.h> 29#include <q3widgetstack.h>
30#include <qdatetime.h> 30#include <qdatetime.h>
31//Added by qt3to4:
32#include <Q3HBoxLayout>
33#include <Q3GridLayout>
34#include <Q3Frame>
35#include <QLabel>
36#include <Q3VBoxLayout>
31 37
32#include <kdebug.h> 38#include <kdebug.h>
33#include <kglobal.h> 39#include <kglobal.h>
34#include <kdialog.h> 40#include <kdialog.h>
35#include <klocale.h> 41#include <klocale.h>
36#include <kiconloader.h> 42#include <kiconloader.h>
37#include <kmessagebox.h> 43#include <kmessagebox.h>
38#include <kfiledialog.h> 44#include <kfiledialog.h>
39#include <kstandarddirs.h> 45#include <kstandarddirs.h>
40 46
41#include <libkcal/event.h> 47#include <libkcal/event.h>
42 48
@@ -75,90 +81,90 @@ void KOEditorGeneralEvent::finishSetup()
75// QWidget::setTabOrder( mNoTimeButton, mAlarmButton ); 81// QWidget::setTabOrder( mNoTimeButton, mAlarmButton );
76// QWidget::setTabOrder( mAlarmButton, mAlarmTimeEdit ); 82// QWidget::setTabOrder( mAlarmButton, mAlarmTimeEdit );
77// QWidget::setTabOrder( mFreeTimeCombo, mCategoriesButton ); 83// QWidget::setTabOrder( mFreeTimeCombo, mCategoriesButton );
78// QWidget::setTabOrder( mCategoriesButton, mSecrecyCombo ); 84// QWidget::setTabOrder( mCategoriesButton, mSecrecyCombo );
79// QWidget::setTabOrder( mSecrecyCombo, mDescriptionEdit ); 85// QWidget::setTabOrder( mSecrecyCombo, mDescriptionEdit );
80 86
81 87
82 88
83 mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); 89 mSummaryEdit->load(KOLocationBox::SUMMARYEVENT);
84 mSummaryEdit->setFocus(); 90 mSummaryEdit->setFocus();
85} 91}
86 92
87void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) 93void KOEditorGeneralEvent::initTime(QWidget *parent,Q3BoxLayout *topLayout)
88{ 94{
89 QBoxLayout *timeLayout = new QVBoxLayout(topLayout); 95 Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout);
90 96
91 QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, 97 Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal,
92 i18n("Date && Time"),parent); 98 i18n("Date && Time"),parent);
93 timeLayout->addWidget(timeGroupBox); 99 timeLayout->addWidget(timeGroupBox);
94 100
95 timeGroupBox->layout()->setSpacing( KDialog::spacingHintSmall() ); 101 timeGroupBox->layout()->setSpacing( KDialog::spacingHintSmall() );
96 timeGroupBox->layout()->setMargin( KDialog::marginHint() ); 102 timeGroupBox->layout()->setMargin( KDialog::marginHint() );
97 QFrame *timeBoxFrame = new QFrame(timeGroupBox); 103 Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox);
98 104
99 QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,2,3); 105 Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,2,3);
100 layoutTimeBox->setSpacing(topLayout->spacing()); 106 layoutTimeBox->setSpacing(topLayout->spacing());
101 107
102 mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame); 108 mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame);
103 layoutTimeBox->addWidget(mStartDateLabel,0,0); 109 layoutTimeBox->addWidget(mStartDateLabel,0,0);
104 110
105 mStartDateEdit = new KDateEdit(timeBoxFrame); 111 mStartDateEdit = new KDateEdit(timeBoxFrame);
106 layoutTimeBox->addWidget(mStartDateEdit,0,1); 112 layoutTimeBox->addWidget(mStartDateEdit,0,1);
107 113
108 mStartTimeEdit = new KOTimeEdit(timeBoxFrame); 114 mStartTimeEdit = new KOTimeEdit(timeBoxFrame);
109 layoutTimeBox->addWidget(mStartTimeEdit,0,2); 115 layoutTimeBox->addWidget(mStartTimeEdit,0,2);
110 116
111 117
112 mEndDateLabel = new QLabel(i18n("End:"),timeBoxFrame); 118 mEndDateLabel = new QLabel(i18n("End:"),timeBoxFrame);
113 layoutTimeBox->addWidget(mEndDateLabel,1,0); 119 layoutTimeBox->addWidget(mEndDateLabel,1,0);
114 120
115 mEndDateEdit = new KDateEdit(timeBoxFrame); 121 mEndDateEdit = new KDateEdit(timeBoxFrame);
116 layoutTimeBox->addWidget(mEndDateEdit,1,1); 122 layoutTimeBox->addWidget(mEndDateEdit,1,1);
117 123
118 mEndTimeEdit = new KOTimeEdit(timeBoxFrame); 124 mEndTimeEdit = new KOTimeEdit(timeBoxFrame);
119 layoutTimeBox->addWidget(mEndTimeEdit,1,2); 125 layoutTimeBox->addWidget(mEndTimeEdit,1,2);
120 QWidget* duration = new QWidget( timeBoxFrame ); 126 QWidget* duration = new QWidget( timeBoxFrame );
121 QHBoxLayout *flagsBox = new QHBoxLayout( duration ); 127 Q3HBoxLayout *flagsBox = new Q3HBoxLayout( duration );
122 mNoTimeButton = new QCheckBox(i18n("All day event"),duration); 128 mNoTimeButton = new QCheckBox(i18n("All day event"),duration);
123 flagsBox->addWidget(mNoTimeButton); 129 flagsBox->addWidget(mNoTimeButton);
124 connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool))); 130 connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool)));
125 mDurationLabel = new QLabel( duration ); 131 mDurationLabel = new QLabel( duration );
126 // if ( KOPrefs::instance()->mCompactDialogs ) { 132 // if ( KOPrefs::instance()->mCompactDialogs ) {
127 //layoutTimeBox->addMultiCellWidget( mDurationLabel, 3, 3, 0, 3 ); 133 //layoutTimeBox->addMultiCellWidget( mDurationLabel, 3, 3, 0, 3 );
128 //} else { 134 //} else {
129 flagsBox->addWidget( mDurationLabel ); 135 flagsBox->addWidget( mDurationLabel );
130 //} 136 //}
131 flagsBox->setStretchFactor(mDurationLabel, 10 ); 137 flagsBox->setStretchFactor(mDurationLabel, 10 );
132 mDurationLabel->setAlignment( AlignRight | AlignVCenter); 138 mDurationLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter);
133 layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 ); 139 layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 );
134 140
135 // time widgets are checked if they contain a valid time 141 // time widgets are checked if they contain a valid time
136 connect(mStartTimeEdit, SIGNAL(timeChanged(QTime)), 142 connect(mStartTimeEdit, SIGNAL(timeChanged(QTime)),
137 this, SLOT(startTimeChanged(QTime))); 143 this, SLOT(startTimeChanged(QTime)));
138 connect(mEndTimeEdit, SIGNAL(timeChanged(QTime)), 144 connect(mEndTimeEdit, SIGNAL(timeChanged(QTime)),
139 this, SLOT(endTimeChanged(QTime))); 145 this, SLOT(endTimeChanged(QTime)));
140 146
141 // date widgets are checked if they contain a valid date 147 // date widgets are checked if they contain a valid date
142 connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), 148 connect(mStartDateEdit, SIGNAL(dateChanged(QDate)),
143 this, SLOT(startDateChanged(QDate))); 149 this, SLOT(startDateChanged(QDate)));
144 connect(mEndDateEdit, SIGNAL(dateChanged(QDate)), 150 connect(mEndDateEdit, SIGNAL(dateChanged(QDate)),
145 this, SLOT(endDateChanged(QDate))); 151 this, SLOT(endDateChanged(QDate)));
146 connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(sTimeChanged(QTime))); 152 connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(sTimeChanged(QTime)));
147 connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime))); 153 connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime)));
148} 154}
149 155
150void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout) 156void KOEditorGeneralEvent::initClass(QWidget *parent,Q3BoxLayout *topLayout)
151{ 157{
152 QBoxLayout *classLayout = new QHBoxLayout(topLayout); 158 Q3BoxLayout *classLayout = new Q3HBoxLayout(topLayout);
153 159
154 QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent); 160 QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent);
155 classLayout->addWidget(freeTimeLabel); 161 classLayout->addWidget(freeTimeLabel);
156 162
157 mFreeTimeCombo = new QComboBox(false, parent); 163 mFreeTimeCombo = new QComboBox(false, parent);
158 mFreeTimeCombo->insertItem(i18n("Busy")); 164 mFreeTimeCombo->insertItem(i18n("Busy"));
159 mFreeTimeCombo->insertItem(i18n("Free")); 165 mFreeTimeCombo->insertItem(i18n("Free"));
160 classLayout->addWidget(mFreeTimeCombo); 166 classLayout->addWidget(mFreeTimeCombo);
161} 167}
162 168
163void KOEditorGeneralEvent::timeStuffDisable(bool disable) 169void KOEditorGeneralEvent::timeStuffDisable(bool disable)
164{ 170{
diff --git a/korganizer/koeditorgeneralevent.h b/korganizer/koeditorgeneralevent.h
index d798905..5d97a5c 100644
--- a/korganizer/koeditorgeneralevent.h
+++ b/korganizer/koeditorgeneralevent.h
@@ -14,54 +14,54 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOEDITORGENERALEVENT_H 23#ifndef _KOEDITORGENERALEVENT_H
24#define _KOEDITORGENERALEVENT_H 24#define _KOEDITORGENERALEVENT_H
25 25
26#include <qframe.h> 26#include <q3frame.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qcheckbox.h> 28#include <qcheckbox.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qgroupbox.h> 30#include <q3groupbox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qcombobox.h> 32#include <qcombobox.h>
33#include <qmultilineedit.h> 33#include <q3multilineedit.h>
34#include <qlistview.h> 34#include <q3listview.h>
35#include <qradiobutton.h> 35#include <qradiobutton.h>
36 36
37#include <krestrictedline.h> 37#include <krestrictedline.h>
38 38
39#include "koeditorgeneral.h" 39#include "koeditorgeneral.h"
40 40
41#include "ktimeedit.h" 41#include "ktimeedit.h"
42 42
43class KDateEdit; 43class KDateEdit;
44 44
45using namespace KCal; 45using namespace KCal;
46 46
47class KOEditorGeneralEvent : public KOEditorGeneral 47class KOEditorGeneralEvent : public KOEditorGeneral
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 KOEditorGeneralEvent (QObject* parent=0,const char* name=0); 51 KOEditorGeneralEvent (QObject* parent=0,const char* name=0);
52 virtual ~KOEditorGeneralEvent(); 52 virtual ~KOEditorGeneralEvent();
53 53
54 void initTime(QWidget *,QBoxLayout *); 54 void initTime(QWidget *,Q3BoxLayout *);
55 void initClass(QWidget *,QBoxLayout *); 55 void initClass(QWidget *,Q3BoxLayout *);
56 56
57 void finishSetup(); 57 void finishSetup();
58 58
59 /** Set widgets to default values */ 59 /** Set widgets to default values */
60 void setDefaults(QDateTime from,QDateTime to,bool allDay); 60 void setDefaults(QDateTime from,QDateTime to,bool allDay);
61 /** 61 /**
62 Read event object and setup widgets accordingly. If templ is true, the 62 Read event object and setup widgets accordingly. If templ is true, the
63 event is read as template, i.e. the time and date information isn't set. 63 event is read as template, i.e. the time and date information isn't set.
64 */ 64 */
65 void readEvent( Event *, bool tmpl = false ); 65 void readEvent( Event *, bool tmpl = false );
66 /** Write event settings to event object */ 66 /** Write event settings to event object */
67 void writeEvent(Event *); 67 void writeEvent(Event *);
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp
index d32d5a5..baee9fc 100644
--- a/korganizer/koeditorgeneraltodo.cpp
+++ b/korganizer/koeditorgeneraltodo.cpp
@@ -13,32 +13,39 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qfiledialog.h> 25#include <q3filedialog.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <q3vbox.h>
28#include <qbuttongroup.h> 28#include <q3buttongroup.h>
29#include <qvgroupbox.h> 29#include <q3vgroupbox.h>
30#include <qwidgetstack.h> 30#include <q3widgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qapplication.h> 32#include <qapplication.h>
33#include <QDesktopWidget>
34//Added by qt3to4:
35#include <Q3HBoxLayout>
36#include <Q3GridLayout>
37#include <Q3Frame>
38#include <QLabel>
39#include <Q3VBoxLayout>
33 40
34#include <kglobal.h> 41#include <kglobal.h>
35#include <klocale.h> 42#include <klocale.h>
36#include <kiconloader.h> 43#include <kiconloader.h>
37#include <kmessagebox.h> 44#include <kmessagebox.h>
38#include <kdebug.h> 45#include <kdebug.h>
39#include <krestrictedline.h> 46#include <krestrictedline.h>
40#include <kstandarddirs.h> 47#include <kstandarddirs.h>
41#include <kfiledialog.h> 48#include <kfiledialog.h>
42#include <kdialog.h> 49#include <kdialog.h>
43 50
44#include <libkcal/todo.h> 51#include <libkcal/todo.h>
@@ -73,36 +80,36 @@ void KOEditorGeneralTodo::finishSetup()
73// QWidget::setTabOrder(mStartDateEdit, mStartTimeEdit); 80// QWidget::setTabOrder(mStartDateEdit, mStartTimeEdit);
74// QWidget::setTabOrder(mStartTimeEdit, mTimeButton); 81// QWidget::setTabOrder(mStartTimeEdit, mTimeButton);
75// QWidget::setTabOrder(mTimeButton, mCompletedCombo); 82// QWidget::setTabOrder(mTimeButton, mCompletedCombo);
76// QWidget::setTabOrder(mCompletedCombo, mPriorityCombo); 83// QWidget::setTabOrder(mCompletedCombo, mPriorityCombo);
77// QWidget::setTabOrder(mPriorityCombo, mAlarmButton); 84// QWidget::setTabOrder(mPriorityCombo, mAlarmButton);
78// QWidget::setTabOrder(mAlarmButton, mCategoriesButton); 85// QWidget::setTabOrder(mAlarmButton, mCategoriesButton);
79// QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo); 86// QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo);
80// QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit); 87// QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit);
81 mSummaryEdit->load(KOLocationBox::SUMMARYTODO); 88 mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
82 mSummaryEdit->setFocus(); 89 mSummaryEdit->setFocus();
83} 90}
84 91
85void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) 92void KOEditorGeneralTodo::initTime(QWidget *parent,Q3BoxLayout *topLayout)
86{ 93{
87 QBoxLayout *timeLayout = new QVBoxLayout(topLayout); 94 Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout);
88 95
89 QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, 96 Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal,
90 i18n("Date && Time"),parent); 97 i18n("Date && Time"),parent);
91 timeLayout->addWidget(timeGroupBox); 98 timeLayout->addWidget(timeGroupBox);
92 timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); 99 timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 );
93 timeGroupBox->layout()->setMargin( KDialog::marginHint() ); 100 timeGroupBox->layout()->setMargin( KDialog::marginHint() );
94 QFrame *timeBoxFrame = new QFrame(timeGroupBox); 101 Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox);
95 102
96 QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); 103 Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,3,3);
97 layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); 104 layoutTimeBox->setSpacing(KDialog::spacingHintSmall());
98 layoutTimeBox->setColStretch( 1, 1 ); 105 layoutTimeBox->setColStretch( 1, 1 );
99 106
100 mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); 107 mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame);
101 layoutTimeBox->addWidget(mStartCheck,0,0); 108 layoutTimeBox->addWidget(mStartCheck,0,0);
102 connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); 109 connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool)));
103 110
104 mStartDateEdit = new KDateEdit(timeBoxFrame); 111 mStartDateEdit = new KDateEdit(timeBoxFrame);
105 layoutTimeBox->addWidget(mStartDateEdit,0,1); 112 layoutTimeBox->addWidget(mStartDateEdit,0,1);
106 113
107 mStartTimeEdit = new KOTimeEdit(timeBoxFrame); 114 mStartTimeEdit = new KOTimeEdit(timeBoxFrame);
108 layoutTimeBox->addWidget(mStartTimeEdit,0,2); 115 layoutTimeBox->addWidget(mStartTimeEdit,0,2);
@@ -124,25 +131,25 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout)
124 layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1); 131 layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1);
125 132
126 connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool))); 133 connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool)));
127 connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime))); 134 connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime)));
128 connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); 135 connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime)));
129 connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), 136 connect(mStartDateEdit, SIGNAL(dateChanged(QDate)),
130 this, SLOT(startDateChanged(QDate))); 137 this, SLOT(startDateChanged(QDate)));
131 // some more layouting 138 // some more layouting
132 //layoutTimeBox->setColStretch(3,1); 139 //layoutTimeBox->setColStretch(3,1);
133} 140}
134 141
135 142
136void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) 143void KOEditorGeneralTodo::initCompletion(QWidget *parent, Q3BoxLayout *topLayout)
137{ 144{
138 mCompletedCombo = new QComboBox(parent); 145 mCompletedCombo = new QComboBox(parent);
139 // xgettext:no-c-format 146 // xgettext:no-c-format
140 mCompletedCombo->insertItem(i18n(" 0 %")); 147 mCompletedCombo->insertItem(i18n(" 0 %"));
141 // xgettext:no-c-format 148 // xgettext:no-c-format
142 mCompletedCombo->insertItem(i18n(" 20 %")); 149 mCompletedCombo->insertItem(i18n(" 20 %"));
143 // xgettext:no-c-format 150 // xgettext:no-c-format
144 mCompletedCombo->insertItem(i18n(" 40 %")); 151 mCompletedCombo->insertItem(i18n(" 40 %"));
145 // xgettext:no-c-format 152 // xgettext:no-c-format
146 mCompletedCombo->insertItem(i18n(" 60 %")); 153 mCompletedCombo->insertItem(i18n(" 60 %"));
147 // xgettext:no-c-format 154 // xgettext:no-c-format
148 mCompletedCombo->insertItem(i18n(" 80 %")); 155 mCompletedCombo->insertItem(i18n(" 80 %"));
@@ -164,43 +171,43 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout)
164 mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) ); 171 mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) );
165 connect(mCompleteDateEdit,SIGNAL(setTimeTo(QTime)),mCompleteTimeEdit,SLOT(setTime(QTime))); 172 connect(mCompleteDateEdit,SIGNAL(setTimeTo(QTime)),mCompleteTimeEdit,SLOT(setTime(QTime)));
166 173
167 if ( QApplication::desktop()->width() <= 480 ) { 174 if ( QApplication::desktop()->width() <= 480 ) {
168 if ( QApplication::desktop()->width() < 320 ) 175 if ( QApplication::desktop()->width() < 320 )
169 mCompleteDateEdit->setMaximumWidth( 85 ); 176 mCompleteDateEdit->setMaximumWidth( 85 );
170 else 177 else
171 mCompleteDateEdit->setMaximumWidth( 140 ); 178 mCompleteDateEdit->setMaximumWidth( 140 );
172 topLayout->setSpacing( 0 ); 179 topLayout->setSpacing( 0 );
173 } 180 }
174} 181}
175 182
176void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) 183void KOEditorGeneralTodo::initPriority(QWidget *parent, Q3BoxLayout *topLayout)
177{ 184{
178 185
179 QHBox* h = new QHBox ( parent ); 186 Q3HBox* h = new Q3HBox ( parent );
180 topLayout->addWidget( h ); 187 topLayout->addWidget( h );
181 QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); 188 QLabel *priorityLabel = new QLabel(i18n("Priority:"), h);
182 // topLayout->addWidget(priorityLabel); 189 // topLayout->addWidget(priorityLabel);
183 mPriorityCombo = new QComboBox( h ); 190 mPriorityCombo = new QComboBox( h );
184 mPriorityCombo->insertItem(i18n("1 (high)")); 191 mPriorityCombo->insertItem(i18n("1 (high)"));
185 mPriorityCombo->insertItem(i18n("2")); 192 mPriorityCombo->insertItem(i18n("2"));
186 mPriorityCombo->insertItem(i18n("3")); 193 mPriorityCombo->insertItem(i18n("3"));
187 mPriorityCombo->insertItem(i18n("4")); 194 mPriorityCombo->insertItem(i18n("4"));
188 mPriorityCombo->insertItem(i18n("5 (low)")); 195 mPriorityCombo->insertItem(i18n("5 (low)"));
189 //topLayout->addWidget(mPriorityCombo); 196 //topLayout->addWidget(mPriorityCombo);
190} 197}
191 198
192void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout) 199void KOEditorGeneralTodo::initStatus(QWidget *parent,Q3BoxLayout *topLayout)
193{ 200{
194 QBoxLayout *statusLayout = new QHBoxLayout(topLayout); 201 Q3BoxLayout *statusLayout = new Q3HBoxLayout(topLayout);
195 202
196 initCompletion( parent, statusLayout ); 203 initCompletion( parent, statusLayout );
197 204
198 statusLayout->addStretch( 1 ); 205 statusLayout->addStretch( 1 );
199 206
200 initPriority( parent, statusLayout ); 207 initPriority( parent, statusLayout );
201} 208}
202 209
203void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay) 210void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay)
204{ 211{
205 212
206 mSummaryEdit->load(KOLocationBox::SUMMARYTODO); 213 mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
@@ -387,25 +394,25 @@ void KOEditorGeneralTodo::enableStartEdit( bool enable )
387 } 394 }
388 395
389 if (enable) { 396 if (enable) {
390 mStartTimeEdit->setEnabled( mTimeButton->isChecked() ); 397 mStartTimeEdit->setEnabled( mTimeButton->isChecked() );
391 } else { 398 } else {
392 mStartTimeEdit->setEnabled( false ); 399 mStartTimeEdit->setEnabled( false );
393 } 400 }
394 emit datesChecked(); 401 emit datesChecked();
395} 402}
396void KOEditorGeneralTodo::startDateChanged(QDate newdate) 403void KOEditorGeneralTodo::startDateChanged(QDate newdate)
397{ 404{
398 if ( mDueCheck->isChecked() ) 405 if ( mDueCheck->isChecked() )
399 emit dateTimesChanged(newdate,mDueDateEdit->date()); 406 emit dateTimesChanged((QDateTime)newdate,(QDateTime)mDueDateEdit->date());
400} 407}
401void KOEditorGeneralTodo::enableTimeEdits(bool enable) 408void KOEditorGeneralTodo::enableTimeEdits(bool enable)
402{ 409{
403 if(mStartCheck->isChecked()) { 410 if(mStartCheck->isChecked()) {
404 mStartTimeEdit->setEnabled( enable ); 411 mStartTimeEdit->setEnabled( enable );
405 } 412 }
406 if(mDueCheck->isChecked()) { 413 if(mDueCheck->isChecked()) {
407 mDueTimeEdit->setEnabled( enable ); 414 mDueTimeEdit->setEnabled( enable );
408 } 415 }
409} 416}
410 417
411void KOEditorGeneralTodo::showAlarm() 418void KOEditorGeneralTodo::showAlarm()
diff --git a/korganizer/koeditorgeneraltodo.h b/korganizer/koeditorgeneraltodo.h
index 2e56a7a..2e97ff5 100644
--- a/korganizer/koeditorgeneraltodo.h
+++ b/korganizer/koeditorgeneraltodo.h
@@ -14,55 +14,55 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOEDITORGENERALTODO_H 23#ifndef _KOEDITORGENERALTODO_H
24#define _KOEDITORGENERALTODO_H 24#define _KOEDITORGENERALTODO_H
25 25
26#include <qframe.h> 26#include <q3frame.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qcheckbox.h> 28#include <qcheckbox.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qgroupbox.h> 30#include <q3groupbox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qcombobox.h> 32#include <qcombobox.h>
33#include <qmultilineedit.h> 33#include <q3multilineedit.h>
34#include <qlistview.h> 34#include <q3listview.h>
35#include <qradiobutton.h> 35#include <qradiobutton.h>
36 36
37#include "koeditorgeneral.h" 37#include "koeditorgeneral.h"
38#include "koglobals.h" 38#include "koglobals.h"
39 39
40class KRestrictedLine; 40class KRestrictedLine;
41 41
42class KDateEdit; 42class KDateEdit;
43 43
44using namespace KCal; 44using namespace KCal;
45 45
46class KOEditorGeneralTodo : public KOEditorGeneral 46class KOEditorGeneralTodo : public KOEditorGeneral
47{ 47{
48 Q_OBJECT 48 Q_OBJECT
49 public: 49 public:
50 KOEditorGeneralTodo (QObject* parent=0,const char* name=0); 50 KOEditorGeneralTodo (QObject* parent=0,const char* name=0);
51 virtual ~KOEditorGeneralTodo(); 51 virtual ~KOEditorGeneralTodo();
52 52
53 void initTime(QWidget *, QBoxLayout *); 53 void initTime(QWidget *, Q3BoxLayout *);
54 void initStatus(QWidget *, QBoxLayout *); 54 void initStatus(QWidget *, Q3BoxLayout *);
55 void initCompletion(QWidget *, QBoxLayout *); 55 void initCompletion(QWidget *, Q3BoxLayout *);
56 void initPriority(QWidget *, QBoxLayout *); 56 void initPriority(QWidget *, Q3BoxLayout *);
57 57
58 void finishSetup(); 58 void finishSetup();
59 59
60 /** Set widgets to default values */ 60 /** Set widgets to default values */
61 void setDefaults(QDateTime due,bool allDay); 61 void setDefaults(QDateTime due,bool allDay);
62 /** Read todo object and setup widgets accordingly */ 62 /** Read todo object and setup widgets accordingly */
63 void readTodo(Todo *); 63 void readTodo(Todo *);
64 /** Write todo settings to event object */ 64 /** Write todo settings to event object */
65 void writeTodo(Todo *); 65 void writeTodo(Todo *);
66 66
67 /** Check if the input is valid. */ 67 /** Check if the input is valid. */
68 bool validateInput(); 68 bool validateInput();
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp
index e0380c4..e0ae3a0 100644
--- a/korganizer/koeditorrecurrence.cpp
+++ b/korganizer/koeditorrecurrence.cpp
@@ -13,35 +13,43 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qfiledialog.h> 25#include <q3filedialog.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <q3vbox.h>
28#include <qbuttongroup.h> 28#include <q3buttongroup.h>
29#include <qvgroupbox.h> 29#include <q3vgroupbox.h>
30#include <qwidgetstack.h> 30#include <q3widgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qlistbox.h> 32#include <q3listbox.h>
33#include <qspinbox.h> 33#include <qspinbox.h>
34#include <qcheckbox.h> 34#include <qcheckbox.h>
35#include <qapplication.h> 35#include <qapplication.h>
36#include <QDesktopWidget>
37//Added by qt3to4:
38#include <Q3HBoxLayout>
39#include <QLabel>
40#include <Q3GridLayout>
41#include <Q3PtrList>
42#include <Q3Frame>
43#include <Q3VBoxLayout>
36 44
37#include <kdialog.h> 45#include <kdialog.h>
38#include <kglobal.h> 46#include <kglobal.h>
39#include <klocale.h> 47#include <klocale.h>
40#include <kiconloader.h> 48#include <kiconloader.h>
41#include <kdebug.h> 49#include <kdebug.h>
42#include <knumvalidator.h> 50#include <knumvalidator.h>
43 51
44#include <libkcal/event.h> 52#include <libkcal/event.h>
45#include <libkcal/todo.h> 53#include <libkcal/todo.h>
46 54
47#include <libkdepim/kdateedit.h> 55#include <libkdepim/kdateedit.h>
@@ -72,61 +80,61 @@ void RecurBase::setFrequency( int f )
72} 80}
73 81
74int RecurBase::frequency() 82int RecurBase::frequency()
75{ 83{
76 return mFrequencyEdit->value(); 84 return mFrequencyEdit->value();
77} 85}
78 86
79/////////////////////////// RecurDaily /////////////////////////////// 87/////////////////////////// RecurDaily ///////////////////////////////
80 88
81RecurDaily::RecurDaily( QWidget *parent, const char *name ) : 89RecurDaily::RecurDaily( QWidget *parent, const char *name ) :
82 RecurBase( parent, name ) 90 RecurBase( parent, name )
83{ 91{
84 QBoxLayout *topLayout = new QHBoxLayout( this ); 92 Q3BoxLayout *topLayout = new Q3HBoxLayout( this );
85 topLayout->setSpacing( KDialog::spacingHint() ); 93 topLayout->setSpacing( KDialog::spacingHint() );
86 topLayout->setMargin( KDialog::marginHintSmall() ); 94 topLayout->setMargin( KDialog::marginHintSmall() );
87 95
88 QLabel *preLabel = new QLabel( i18n("Recur every"), this ); 96 QLabel *preLabel = new QLabel( i18n("Recur every"), this );
89 topLayout->addWidget( preLabel ); 97 topLayout->addWidget( preLabel );
90 98
91 topLayout->addWidget( frequencyEdit() ); 99 topLayout->addWidget( frequencyEdit() );
92 100
93 QLabel *postLabel = new QLabel( i18n("day(s)"), this ); 101 QLabel *postLabel = new QLabel( i18n("day(s)"), this );
94 topLayout->addWidget( postLabel ); 102 topLayout->addWidget( postLabel );
95} 103}
96 104
97 105
98/////////////////////////// RecurWeekly /////////////////////////////// 106/////////////////////////// RecurWeekly ///////////////////////////////
99 107
100RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) : 108RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) :
101 RecurBase( parent, name ) 109 RecurBase( parent, name )
102{ 110{
103 QBoxLayout *topLayout = new QVBoxLayout( this ); 111 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
104 topLayout->setSpacing( KDialog::spacingHint() ); 112 topLayout->setSpacing( KDialog::spacingHint() );
105 topLayout->setMargin( KDialog::marginHintSmall() ); 113 topLayout->setMargin( KDialog::marginHintSmall() );
106 114
107 //topLayout->addStretch( 1 ); 115 //topLayout->addStretch( 1 );
108 116
109 QBoxLayout *weeksLayout = new QHBoxLayout( topLayout ); 117 Q3BoxLayout *weeksLayout = new Q3HBoxLayout( topLayout );
110 118
111 QLabel *preLabel = new QLabel( i18n("Recur every"), this ); 119 QLabel *preLabel = new QLabel( i18n("Recur every"), this );
112 weeksLayout->addWidget( preLabel ); 120 weeksLayout->addWidget( preLabel );
113 121
114 weeksLayout->addWidget( frequencyEdit() ); 122 weeksLayout->addWidget( frequencyEdit() );
115 123
116 QLabel *postLabel = new QLabel( i18n("week(s) on:"), this ); 124 QLabel *postLabel = new QLabel( i18n("week(s) on:"), this );
117 weeksLayout->addWidget( postLabel ); 125 weeksLayout->addWidget( postLabel );
118 126
119 QHBox *dayBox = new QHBox( this ); 127 Q3HBox *dayBox = new Q3HBox( this );
120 topLayout->addWidget( dayBox, 1, AlignVCenter ); 128 topLayout->addWidget( dayBox, 1, Qt::AlignVCenter );
121 // TODO: Respect start of week setting 129 // TODO: Respect start of week setting
122 for ( int i = 0; i < 7; ++i ) { 130 for ( int i = 0; i < 7; ++i ) {
123 QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true ); 131 QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true );
124 int left = 1; 132 int left = 1;
125 if ( QApplication::desktop()->width() > 480 ) { 133 if ( QApplication::desktop()->width() > 480 ) {
126 ++left; 134 ++left;
127 if ( QApplication::desktop()->width() > 640 ) 135 if ( QApplication::desktop()->width() > 640 )
128 ++left; 136 ++left;
129 } 137 }
130 mDayBoxes[ i ] = new QCheckBox( weekDayName.left( left ), dayBox ); 138 mDayBoxes[ i ] = new QCheckBox( weekDayName.left( left ), dayBox );
131 } 139 }
132 140
@@ -147,58 +155,58 @@ QBitArray RecurWeekly::days()
147 for ( int i = 0; i < 7; ++i ) { 155 for ( int i = 0; i < 7; ++i ) {
148 days.setBit( i, mDayBoxes[ i ]->isChecked() ); 156 days.setBit( i, mDayBoxes[ i ]->isChecked() );
149 } 157 }
150 158
151 return days; 159 return days;
152} 160}
153 161
154/////////////////////////// RecurMonthly /////////////////////////////// 162/////////////////////////// RecurMonthly ///////////////////////////////
155 163
156RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : 164RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) :
157 RecurBase( parent, name ) 165 RecurBase( parent, name )
158{ 166{
159 QBoxLayout *topLayout = new QVBoxLayout( this ); 167 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
160 topLayout->setSpacing( KDialog::spacingHint() ); 168 topLayout->setSpacing( KDialog::spacingHint() );
161 topLayout->setMargin( KDialog::marginHintSmall() ); 169 topLayout->setMargin( KDialog::marginHintSmall() );
162 170
163 171
164 QBoxLayout *freqLayout = new QHBoxLayout( topLayout ); 172 Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout );
165 173
166 QLabel *preLabel = new QLabel( i18n("every"), this ); 174 QLabel *preLabel = new QLabel( i18n("every"), this );
167 freqLayout->addWidget( preLabel ); 175 freqLayout->addWidget( preLabel );
168 176
169 freqLayout->addWidget( frequencyEdit() ); 177 freqLayout->addWidget( frequencyEdit() );
170 178
171 QLabel *postLabel = new QLabel( i18n("month(s)"), this ); 179 QLabel *postLabel = new QLabel( i18n("month(s)"), this );
172 freqLayout->addWidget( postLabel ); 180 freqLayout->addWidget( postLabel );
173 181
174 182
175 QButtonGroup *buttonGroup = new QButtonGroup( this ); 183 Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this );
176 buttonGroup->setFrameStyle( QFrame::NoFrame ); 184 buttonGroup->setFrameStyle( Q3Frame::NoFrame );
177 topLayout->addWidget( buttonGroup, 1, AlignVCenter ); 185 topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter );
178 186
179 QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 3, 2 ); 187 Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 3, 2 );
180 buttonLayout->setSpacing( KDialog::spacingHint() ); 188 buttonLayout->setSpacing( KDialog::spacingHint() );
181 buttonLayout->setMargin( KDialog::marginHintSmall() ); 189 buttonLayout->setMargin( KDialog::marginHintSmall() );
182 190
183 191
184 QString recurOnText; 192 QString recurOnText;
185 if ( QApplication::desktop()->width() > 320 ) { 193 if ( QApplication::desktop()->width() > 320 ) {
186 recurOnText = i18n("Recur on the"); 194 recurOnText = i18n("Recur on the");
187 } 195 }
188 196
189 mByDayRadio = new QRadioButton( recurOnText, buttonGroup ); 197 mByDayRadio = new QRadioButton( recurOnText, buttonGroup );
190 buttonLayout->addWidget( mByDayRadio, 0, 0 ); 198 buttonLayout->addWidget( mByDayRadio, 0, 0 );
191 199
192 mByDayCombo = new QComboBox( buttonGroup ); 200 mByDayCombo = new Q3ComboBox( buttonGroup );
193 mByDayCombo->setSizeLimit( 7 ); 201 mByDayCombo->setSizeLimit( 7 );
194 mByDayCombo->insertItem( i18n("1st") ); 202 mByDayCombo->insertItem( i18n("1st") );
195 mByDayCombo->insertItem( i18n("2nd") ); 203 mByDayCombo->insertItem( i18n("2nd") );
196 mByDayCombo->insertItem( i18n("3rd") ); 204 mByDayCombo->insertItem( i18n("3rd") );
197 mByDayCombo->insertItem( i18n("4th") ); 205 mByDayCombo->insertItem( i18n("4th") );
198 mByDayCombo->insertItem( i18n("5th") ); 206 mByDayCombo->insertItem( i18n("5th") );
199 mByDayCombo->insertItem( i18n("6th") ); 207 mByDayCombo->insertItem( i18n("6th") );
200 mByDayCombo->insertItem( i18n("7th") ); 208 mByDayCombo->insertItem( i18n("7th") );
201 mByDayCombo->insertItem( i18n("8th") ); 209 mByDayCombo->insertItem( i18n("8th") );
202 mByDayCombo->insertItem( i18n("9th") ); 210 mByDayCombo->insertItem( i18n("9th") );
203 mByDayCombo->insertItem( i18n("10th") ); 211 mByDayCombo->insertItem( i18n("10th") );
204 mByDayCombo->insertItem( i18n("11th") ); 212 mByDayCombo->insertItem( i18n("11th") );
@@ -284,52 +292,52 @@ int RecurMonthly::count()
284} 292}
285 293
286int RecurMonthly::weekday() 294int RecurMonthly::weekday()
287{ 295{
288 return mByPosWeekdayCombo->currentItem(); 296 return mByPosWeekdayCombo->currentItem();
289} 297}
290 298
291/////////////////////////// RecurYearly /////////////////////////////// 299/////////////////////////// RecurYearly ///////////////////////////////
292 300
293RecurYearly::RecurYearly( QWidget *parent, const char *name ) : 301RecurYearly::RecurYearly( QWidget *parent, const char *name ) :
294 RecurBase( parent, name ) 302 RecurBase( parent, name )
295{ 303{
296 QBoxLayout *topLayout = new QVBoxLayout( this ); 304 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
297 topLayout->setSpacing( KDialog::spacingHint() ); 305 topLayout->setSpacing( KDialog::spacingHint() );
298 topLayout->setMargin( KDialog::marginHintSmall() ); 306 topLayout->setMargin( KDialog::marginHintSmall() );
299 307
300 308
301 QBoxLayout *freqLayout = new QHBoxLayout( topLayout ); 309 Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout );
302 310
303 QLabel *preLabel = new QLabel( i18n("every"), this ); 311 QLabel *preLabel = new QLabel( i18n("every"), this );
304 freqLayout->addWidget( preLabel ); 312 freqLayout->addWidget( preLabel );
305 313
306 freqLayout->addWidget( frequencyEdit() ); 314 freqLayout->addWidget( frequencyEdit() );
307 315
308 QLabel *postLabel = new QLabel( i18n("year(s)"), this ); 316 QLabel *postLabel = new QLabel( i18n("year(s)"), this );
309 freqLayout->addWidget( postLabel ); 317 freqLayout->addWidget( postLabel );
310 318
311 319
312 QButtonGroup *buttonGroup = new QButtonGroup( this ); 320 Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this );
313 buttonGroup->setFrameStyle( QFrame::NoFrame ); 321 buttonGroup->setFrameStyle( Q3Frame::NoFrame );
314 topLayout->addWidget( buttonGroup, 1, AlignVCenter ); 322 topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter );
315 323
316 QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 2, 3 ); 324 Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 2, 3 );
317 325
318 mByMonthRadio = new QRadioButton( i18n("On day "), buttonGroup); 326 mByMonthRadio = new QRadioButton( i18n("On day "), buttonGroup);
319 buttonLayout->addWidget( mByMonthRadio, 0, 0 , Qt::AlignRight); 327 buttonLayout->addWidget( mByMonthRadio, 0, 0 , Qt::AlignRight);
320 mByDayLabel = new QLabel( i18n("%1 of ").arg(1), buttonGroup ); 328 mByDayLabel = new QLabel( i18n("%1 of ").arg(1), buttonGroup );
321 329
322 buttonLayout->addWidget( mByDayLabel, 0, 1 ); 330 buttonLayout->addWidget( mByDayLabel, 0, 1 );
323 mByMonthCombo = new QComboBox( buttonGroup ); 331 mByMonthCombo = new Q3ComboBox( buttonGroup );
324 mByMonthCombo->insertItem( i18n("January") ); 332 mByMonthCombo->insertItem( i18n("January") );
325 mByMonthCombo->insertItem( i18n("February") ); 333 mByMonthCombo->insertItem( i18n("February") );
326 mByMonthCombo->insertItem( i18n("March") ); 334 mByMonthCombo->insertItem( i18n("March") );
327 mByMonthCombo->insertItem( i18n("April") ); 335 mByMonthCombo->insertItem( i18n("April") );
328 mByMonthCombo->insertItem( i18n("May") ); 336 mByMonthCombo->insertItem( i18n("May") );
329 mByMonthCombo->insertItem( i18n("June") ); 337 mByMonthCombo->insertItem( i18n("June") );
330 mByMonthCombo->insertItem( i18n("July") ); 338 mByMonthCombo->insertItem( i18n("July") );
331 mByMonthCombo->insertItem( i18n("August") ); 339 mByMonthCombo->insertItem( i18n("August") );
332 mByMonthCombo->insertItem( i18n("September") ); 340 mByMonthCombo->insertItem( i18n("September") );
333 mByMonthCombo->insertItem( i18n("October") ); 341 mByMonthCombo->insertItem( i18n("October") );
334 mByMonthCombo->insertItem( i18n("November") ); 342 mByMonthCombo->insertItem( i18n("November") );
335 mByMonthCombo->insertItem( i18n("December") ); 343 mByMonthCombo->insertItem( i18n("December") );
@@ -374,45 +382,45 @@ int RecurYearly::month()
374 return mByMonthCombo->currentItem() + 1; 382 return mByMonthCombo->currentItem() + 1;
375} 383}
376int RecurYearly::day() 384int RecurYearly::day()
377{ 385{
378 return mDay;//mByDayCombo->currentItem() + 1; 386 return mDay;//mByDayCombo->currentItem() + 1;
379} 387}
380 388
381//////////////////////////// ExceptionsWidget ////////////////////////// 389//////////////////////////// ExceptionsWidget //////////////////////////
382 390
383ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) : 391ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) :
384 QWidget( parent, name ) 392 QWidget( parent, name )
385{ 393{
386 QBoxLayout *topLayout = new QVBoxLayout( this ); 394 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
387 395
388 QGroupBox *groupBox = new QGroupBox( 1, Horizontal, i18n("Exceptions"), 396 Q3GroupBox *groupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Exceptions"),
389 this ); 397 this );
390 topLayout->addWidget( groupBox ); 398 topLayout->addWidget( groupBox );
391 399
392 QWidget *box = new QWidget( groupBox ); 400 QWidget *box = new QWidget( groupBox );
393 401
394 QGridLayout *boxLayout = new QGridLayout( box ); 402 Q3GridLayout *boxLayout = new Q3GridLayout( box );
395 403
396 mExceptionDateEdit = new KDateEdit( box ); 404 mExceptionDateEdit = new KDateEdit( box );
397 boxLayout->addWidget( mExceptionDateEdit, 0, 0 ); 405 boxLayout->addWidget( mExceptionDateEdit, 0, 0 );
398 406
399 QPushButton *addExceptionButton = new QPushButton( i18n("Add"), box ); 407 QPushButton *addExceptionButton = new QPushButton( i18n("Add"), box );
400 boxLayout->addWidget( addExceptionButton, 1, 0 ); 408 boxLayout->addWidget( addExceptionButton, 1, 0 );
401 QPushButton *changeExceptionButton = new QPushButton( i18n("Change"), box ); 409 QPushButton *changeExceptionButton = new QPushButton( i18n("Change"), box );
402 boxLayout->addWidget( changeExceptionButton, 2, 0 ); 410 boxLayout->addWidget( changeExceptionButton, 2, 0 );
403 QPushButton *deleteExceptionButton = new QPushButton( i18n("Delete"), box ); 411 QPushButton *deleteExceptionButton = new QPushButton( i18n("Delete"), box );
404 boxLayout->addWidget( deleteExceptionButton, 3, 0 ); 412 boxLayout->addWidget( deleteExceptionButton, 3, 0 );
405 413
406 mExceptionList = new QListBox( box ); 414 mExceptionList = new Q3ListBox( box );
407 boxLayout->addMultiCellWidget( mExceptionList, 0, 3, 1, 1 ); 415 boxLayout->addMultiCellWidget( mExceptionList, 0, 3, 1, 1 );
408 416
409 boxLayout->setRowStretch( 4, 1 ); 417 boxLayout->setRowStretch( 4, 1 );
410 boxLayout->setColStretch( 1, 3 ); 418 boxLayout->setColStretch( 1, 3 );
411 419
412 connect( addExceptionButton, SIGNAL( clicked() ), 420 connect( addExceptionButton, SIGNAL( clicked() ),
413 SLOT( addException() ) ); 421 SLOT( addException() ) );
414 connect( changeExceptionButton, SIGNAL( clicked() ), 422 connect( changeExceptionButton, SIGNAL( clicked() ),
415 SLOT( changeException() ) ); 423 SLOT( changeException() ) );
416 connect( deleteExceptionButton, SIGNAL( clicked() ), 424 connect( deleteExceptionButton, SIGNAL( clicked() ),
417 SLOT( deleteException() ) ); 425 SLOT( deleteException() ) );
418 if ( QApplication::desktop()->width() < 480 ) { 426 if ( QApplication::desktop()->width() < 480 ) {
@@ -497,58 +505,58 @@ void ExceptionsDialog::setDates( const DateList &dates )
497 505
498DateList ExceptionsDialog::dates() 506DateList ExceptionsDialog::dates()
499{ 507{
500 return mExceptions->dates(); 508 return mExceptions->dates();
501} 509}
502 510
503///////////////////////// RecurrenceRangeWidget /////////////////////////// 511///////////////////////// RecurrenceRangeWidget ///////////////////////////
504 512
505RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent, 513RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent,
506 const char *name ) 514 const char *name )
507 : QWidget( parent, name ) 515 : QWidget( parent, name )
508{ 516{
509 QBoxLayout *topLayout = new QVBoxLayout( this ); 517 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
510 518
511 mRangeGroupBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Range"), 519 mRangeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Range"),
512 this ); 520 this );
513 topLayout->addWidget( mRangeGroupBox ); 521 topLayout->addWidget( mRangeGroupBox );
514 522
515 QWidget *rangeBox = new QWidget( mRangeGroupBox ); 523 QWidget *rangeBox = new QWidget( mRangeGroupBox );
516 QVBoxLayout *rangeLayout = new QVBoxLayout( rangeBox ); 524 Q3VBoxLayout *rangeLayout = new Q3VBoxLayout( rangeBox );
517 rangeLayout->setSpacing( KDialog::spacingHint() ); 525 rangeLayout->setSpacing( KDialog::spacingHint() );
518 rangeLayout->setMargin( KDialog::marginHintSmall() ); 526 rangeLayout->setMargin( KDialog::marginHintSmall() );
519 527
520 mStartDateLabel = new QLabel( i18n("Begin on:"), rangeBox ); 528 mStartDateLabel = new QLabel( i18n("Begin on:"), rangeBox );
521 rangeLayout->addWidget( mStartDateLabel ); 529 rangeLayout->addWidget( mStartDateLabel );
522 530
523 mRangeButtonGroup = new QButtonGroup; 531 mRangeButtonGroup = new Q3ButtonGroup;
524 532
525 mNoEndDateButton = new QRadioButton( i18n("No ending date"), rangeBox ); 533 mNoEndDateButton = new QRadioButton( i18n("No ending date"), rangeBox );
526 mRangeButtonGroup->insert( mNoEndDateButton ); 534 mRangeButtonGroup->insert( mNoEndDateButton );
527 rangeLayout->addWidget( mNoEndDateButton ); 535 rangeLayout->addWidget( mNoEndDateButton );
528 536
529 QBoxLayout *durationLayout = new QHBoxLayout( rangeLayout ); 537 Q3BoxLayout *durationLayout = new Q3HBoxLayout( rangeLayout );
530 durationLayout->setSpacing( KDialog::spacingHint() ); 538 durationLayout->setSpacing( KDialog::spacingHint() );
531 539
532 mEndDurationButton = new QRadioButton( i18n("End after"), rangeBox ); 540 mEndDurationButton = new QRadioButton( i18n("End after"), rangeBox );
533 mRangeButtonGroup->insert( mEndDurationButton ); 541 mRangeButtonGroup->insert( mEndDurationButton );
534 durationLayout->addWidget( mEndDurationButton ); 542 durationLayout->addWidget( mEndDurationButton );
535 543
536 mEndDurationEdit = new QSpinBox( 1, 9999, 1, rangeBox ); 544 mEndDurationEdit = new QSpinBox( 1, 9999, 1, rangeBox );
537 durationLayout->addWidget( mEndDurationEdit ); 545 durationLayout->addWidget( mEndDurationEdit );
538 546
539 QLabel *endDurationLabel = new QLabel( i18n("occurrence(s)"), rangeBox ); 547 QLabel *endDurationLabel = new QLabel( i18n("occurrence(s)"), rangeBox );
540 durationLayout ->addWidget( endDurationLabel ); 548 durationLayout ->addWidget( endDurationLabel );
541 549
542 QBoxLayout *endDateLayout = new QHBoxLayout( rangeLayout ); 550 Q3BoxLayout *endDateLayout = new Q3HBoxLayout( rangeLayout );
543 endDateLayout->setSpacing( KDialog::spacingHint() ); 551 endDateLayout->setSpacing( KDialog::spacingHint() );
544 552
545 mEndDateButton = new QRadioButton( i18n("End by:"), rangeBox ); 553 mEndDateButton = new QRadioButton( i18n("End by:"), rangeBox );
546 mRangeButtonGroup->insert( mEndDateButton ); 554 mRangeButtonGroup->insert( mEndDateButton );
547 endDateLayout->addWidget( mEndDateButton ); 555 endDateLayout->addWidget( mEndDateButton );
548 556
549 mEndDateEdit = new KDateEdit( rangeBox ); 557 mEndDateEdit = new KDateEdit( rangeBox );
550 endDateLayout->addWidget( mEndDateEdit ); 558 endDateLayout->addWidget( mEndDateEdit );
551 559
552 //endDateLayout->addStretch( 1 ); 560 //endDateLayout->addStretch( 1 );
553 561
554 connect( mNoEndDateButton, SIGNAL( toggled( bool ) ), 562 connect( mNoEndDateButton, SIGNAL( toggled( bool ) ),
@@ -657,25 +665,25 @@ QDate RecurrenceRangeDialog::endDate()
657 665
658void RecurrenceRangeDialog::setDateTimes( const QDateTime &start, 666void RecurrenceRangeDialog::setDateTimes( const QDateTime &start,
659 const QDateTime &end ) 667 const QDateTime &end )
660{ 668{
661 mRecurrenceRangeWidget->setDateTimes( start, end ); 669 mRecurrenceRangeWidget->setDateTimes( start, end );
662} 670}
663 671
664//////////////////////////// RecurrenceChooser //////////////////////// 672//////////////////////////// RecurrenceChooser ////////////////////////
665 673
666RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) : 674RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) :
667 QWidget( parent, name ) 675 QWidget( parent, name )
668{ 676{
669 QBoxLayout *topLayout = new QVBoxLayout( this ); 677 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
670 678
671 mTypeCombo = new QComboBox( this ); 679 mTypeCombo = new QComboBox( this );
672 mTypeCombo->insertItem( i18n("Daily") ); 680 mTypeCombo->insertItem( i18n("Daily") );
673 mTypeCombo->insertItem( i18n("Weekly") ); 681 mTypeCombo->insertItem( i18n("Weekly") );
674 mTypeCombo->insertItem( i18n("Monthly") ); 682 mTypeCombo->insertItem( i18n("Monthly") );
675 mTypeCombo->insertItem( i18n("Yearly") ); 683 mTypeCombo->insertItem( i18n("Yearly") );
676 684
677 topLayout->addWidget( mTypeCombo ); 685 topLayout->addWidget( mTypeCombo );
678 686
679 connect( mTypeCombo, SIGNAL( activated( int ) ), SLOT( emitChoice() ) ); 687 connect( mTypeCombo, SIGNAL( activated( int ) ), SLOT( emitChoice() ) );
680 688
681} 689}
@@ -716,59 +724,59 @@ void RecurrenceChooser::setType( int type )
716} 724}
717 725
718void RecurrenceChooser::emitChoice() 726void RecurrenceChooser::emitChoice()
719{ 727{
720 emit chosen ( type() ); 728 emit chosen ( type() );
721} 729}
722 730
723/////////////////////////////// Main Widget ///////////////////////////// 731/////////////////////////////// Main Widget /////////////////////////////
724 732
725KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : 733KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
726 QWidget( parent, name ) 734 QWidget( parent, name )
727{ 735{
728 QGridLayout *topLayout = new QGridLayout( this, 2,2 ); 736 Q3GridLayout *topLayout = new Q3GridLayout( this, 2,2 );
729 topLayout->setSpacing( KDialog::spacingHint() ); 737 topLayout->setSpacing( KDialog::spacingHint() );
730 topLayout->setMargin( KDialog::marginHintSmall() ); 738 topLayout->setMargin( KDialog::marginHintSmall() );
731 739
732 mEnabledCheck = new QCheckBox( i18n("Enable Recurrence"), this ); 740 mEnabledCheck = new QCheckBox( i18n("Enable Recurrence"), this );
733 connect( mEnabledCheck, SIGNAL( toggled( bool ) ), 741 connect( mEnabledCheck, SIGNAL( toggled( bool ) ),
734 SLOT( setEnabled( bool ) ) ); 742 SLOT( setEnabled( bool ) ) );
735 topLayout->addMultiCellWidget( mEnabledCheck, 0, 0, 0, 1 ); 743 topLayout->addMultiCellWidget( mEnabledCheck, 0, 0, 0, 1 );
736 744
737 745
738 mTimeGroupBox = new QGroupBox( 1, Horizontal, i18n("Time"), 746 mTimeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Time"),
739 this ); 747 this );
740 topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 ); 748 topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 );
741 749
742 if ( QApplication::desktop()->width() <= 640 ) { 750 if ( QApplication::desktop()->width() <= 640 ) {
743 mTimeGroupBox->hide(); 751 mTimeGroupBox->hide();
744 } 752 }
745 753
746// QFrame *timeFrame = new QFrame( mTimeGroupBox ); 754// QFrame *timeFrame = new QFrame( mTimeGroupBox );
747// QBoxLayout *layoutTimeFrame = new QHBoxLayout( timeFrame ); 755// QBoxLayout *layoutTimeFrame = new QHBoxLayout( timeFrame );
748// layoutTimeFrame->setSpacing( KDialog::spacingHint() ); 756// layoutTimeFrame->setSpacing( KDialog::spacingHint() );
749 757
750 mDateTimeLabel = new QLabel( mTimeGroupBox ); 758 mDateTimeLabel = new QLabel( mTimeGroupBox );
751// mDateTimeLabel = new QLabel( timeFrame ); 759// mDateTimeLabel = new QLabel( timeFrame );
752// layoutTimeFrame->addWidget( mDateTimeLabel ); 760// layoutTimeFrame->addWidget( mDateTimeLabel );
753 //mTimeGroupBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) ); 761 //mTimeGroupBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) );
754 //mDateTimeLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum) ); 762 //mDateTimeLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum) );
755 mRuleBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Rule"), this ); 763 mRuleBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Rule"), this );
756 topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 ); 764 topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 );
757 mRecurrenceChooser = new RecurrenceChooser( mRuleBox ); 765 mRecurrenceChooser = new RecurrenceChooser( mRuleBox );
758 connect( mRecurrenceChooser, SIGNAL( chosen( int ) ), 766 connect( mRecurrenceChooser, SIGNAL( chosen( int ) ),
759 SLOT( showCurrentRule( int ) ) ); 767 SLOT( showCurrentRule( int ) ) );
760 768
761 769
762 mRuleStack = new QWidgetStack( mRuleBox ); 770 mRuleStack = new Q3WidgetStack( mRuleBox );
763 771
764 mDaily = new RecurDaily( mRuleStack ); 772 mDaily = new RecurDaily( mRuleStack );
765 mRuleStack->addWidget( mDaily, 0 ); 773 mRuleStack->addWidget( mDaily, 0 );
766 774
767 mWeekly = new RecurWeekly( mRuleStack ); 775 mWeekly = new RecurWeekly( mRuleStack );
768 mRuleStack->addWidget( mWeekly, 0 ); 776 mRuleStack->addWidget( mWeekly, 0 );
769 777
770 mMonthly = new RecurMonthly( mRuleStack ); 778 mMonthly = new RecurMonthly( mRuleStack );
771 mRuleStack->addWidget( mMonthly, 0 ); 779 mRuleStack->addWidget( mMonthly, 0 );
772 780
773 mYearly = new RecurYearly( mRuleStack ); 781 mYearly = new RecurYearly( mRuleStack );
774 mRuleStack->addWidget( mYearly, 0 ); 782 mRuleStack->addWidget( mYearly, 0 );
@@ -887,26 +895,26 @@ void KOEditorRecurrence::setDefaults( QDateTime from, QDateTime to )
887 895
888void KOEditorRecurrence::readEvent(Incidence *event) 896void KOEditorRecurrence::readEvent(Incidence *event)
889{ 897{
890 898
891 QDateTime dtEnd; 899 QDateTime dtEnd;
892 if ( event->typeID() == eventID ) 900 if ( event->typeID() == eventID )
893 dtEnd = ((Event*)event)->dtEnd(); 901 dtEnd = ((Event*)event)->dtEnd();
894 else 902 else
895 dtEnd = ((Todo*)event)->dtDue(); 903 dtEnd = ((Todo*)event)->dtDue();
896 904
897 setDefaults( event->dtStart(), dtEnd ); 905 setDefaults( event->dtStart(), dtEnd );
898 QBitArray rDays( 7 ); 906 QBitArray rDays( 7 );
899 QPtrList<Recurrence::rMonthPos> rmp; 907 Q3PtrList<Recurrence::rMonthPos> rmp;
900 QPtrList<int> rmd; 908 Q3PtrList<int> rmd;
901 int day = 0; 909 int day = 0;
902 int count = 0; 910 int count = 0;
903 int month = 0; 911 int month = 0;
904 setDateTimes( event->dtStart(), dtEnd ); 912 setDateTimes( event->dtStart(), dtEnd );
905 913
906 914
907 915
908 int recurs = event->doesRecur(); 916 int recurs = event->doesRecur();
909 917
910 mEnabledCheck->setChecked( recurs ); 918 mEnabledCheck->setChecked( recurs );
911 setEnabled( recurs ); 919 setEnabled( recurs );
912 920
@@ -959,25 +967,25 @@ void KOEditorRecurrence::readEvent(Incidence *event)
959 { 967 {
960 recurrenceType = RecurrenceChooser::Yearly; 968 recurrenceType = RecurrenceChooser::Yearly;
961 //qDebug("Recurrence::rYearlyMonth: "); 969 //qDebug("Recurrence::rYearlyMonth: ");
962 day = event->dtStart().date().day(); 970 day = event->dtStart().date().day();
963 rmd = r->yearNums(); 971 rmd = r->yearNums();
964 if ( rmd.count() > 0 ) 972 if ( rmd.count() > 0 )
965 month = *rmd.first(); 973 month = *rmd.first();
966 else 974 else
967 month = event->dtStart().date().month() ; 975 month = event->dtStart().date().month() ;
968 mYearly->setByMonth( month, day ); 976 mYearly->setByMonth( month, day );
969#if 0 977#if 0
970 //qDebug("2day = %d ",day ); 978 //qDebug("2day = %d ",day );
971 QPtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions(); 979 Q3PtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions();
972 int month; 980 int month;
973 if ( !monthlist.isEmpty() ) { 981 if ( !monthlist.isEmpty() ) {
974 month = monthlist.first()->rPos ; 982 month = monthlist.first()->rPos ;
975 } else { 983 } else {
976 month = event->dtStart().date().month() ; 984 month = event->dtStart().date().month() ;
977 } 985 }
978 mYearly->setByMonth( day, month ); 986 mYearly->setByMonth( day, month );
979#endif 987#endif
980 mYearly->setFrequency( f ); 988 mYearly->setFrequency( f );
981 } 989 }
982 990
983 break; 991 break;
diff --git a/korganizer/koeditorrecurrence.h b/korganizer/koeditorrecurrence.h
index 75e0c73..6c012bd 100644
--- a/korganizer/koeditorrecurrence.h
+++ b/korganizer/koeditorrecurrence.h
@@ -14,43 +14,45 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOEDITORRECURRENCE_H 23#ifndef _KOEDITORRECURRENCE_H
24#define _KOEDITORRECURRENCE_H 24#define _KOEDITORRECURRENCE_H
25 25
26#include <qframe.h> 26#include <q3frame.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qcheckbox.h> 28#include <qcheckbox.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qgroupbox.h> 30#include <q3groupbox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qcombobox.h> 32#include <qcombobox.h>
33#include <qmultilineedit.h> 33#include <q3multilineedit.h>
34#include <qlistview.h> 34#include <q3listview.h>
35#include <qradiobutton.h> 35#include <qradiobutton.h>
36#include <qbuttongroup.h> 36#include <q3buttongroup.h>
37#include <Q3ListBox>
38#include <Q3ComboBox>
37 39
38#include <kdialogbase.h> 40#include <kdialogbase.h>
39 41
40#include <libkcal/event.h> 42#include <libkcal/event.h>
41 43
42#include "ktimeedit.h" 44#include "ktimeedit.h"
43 45
44class QWidgetStack; 46class Q3WidgetStack;
45class QSpinBox; 47class QSpinBox;
46 48
47class KDateEdit; 49class KDateEdit;
48 50
49using namespace KCal; 51using namespace KCal;
50 52
51class RecurBase : public QWidget 53class RecurBase : public QWidget
52{ 54{
53 public: 55 public:
54 RecurBase( QWidget *parent = 0, const char *name = 0 ); 56 RecurBase( QWidget *parent = 0, const char *name = 0 );
55 57
56 void setFrequency( int ); 58 void setFrequency( int );
@@ -89,49 +91,49 @@ class RecurMonthly : public RecurBase
89 void setByPos( int count, int weekday ); 91 void setByPos( int count, int weekday );
90 92
91 bool byDay(); 93 bool byDay();
92 bool byPos(); 94 bool byPos();
93 95
94 int day(); 96 int day();
95 97
96 int count(); 98 int count();
97 int weekday(); 99 int weekday();
98 100
99 private: 101 private:
100 QRadioButton *mByDayRadio; 102 QRadioButton *mByDayRadio;
101 QComboBox *mByDayCombo; 103 Q3ComboBox *mByDayCombo;
102 104
103 QRadioButton *mByPosRadio; 105 QRadioButton *mByPosRadio;
104 QComboBox *mByPosCountCombo; 106 QComboBox *mByPosCountCombo;
105 QComboBox *mByPosWeekdayCombo; 107 QComboBox *mByPosWeekdayCombo;
106}; 108};
107 109
108class RecurYearly : public RecurBase 110class RecurYearly : public RecurBase
109{ 111{
110 public: 112 public:
111 RecurYearly( QWidget *parent = 0, const char *name = 0 ); 113 RecurYearly( QWidget *parent = 0, const char *name = 0 );
112 114
113 void setByDay( int doy ); 115 void setByDay( int doy );
114 void setByMonth( int month, int day ); 116 void setByMonth( int month, int day );
115 117
116 bool byMonth(); 118 bool byMonth();
117 bool byDay(); 119 bool byDay();
118 120
119 int month(); 121 int month();
120 int day(); 122 int day();
121 123
122 private: 124 private:
123 int mDay; 125 int mDay;
124 QRadioButton *mByMonthRadio; 126 QRadioButton *mByMonthRadio;
125 QComboBox *mByMonthCombo; 127 Q3ComboBox *mByMonthCombo;
126 QLabel* mByDayLabel; 128 QLabel* mByDayLabel;
127 QLabel* mDayOfLabel; 129 QLabel* mDayOfLabel;
128 QRadioButton *mByDayRadio; 130 QRadioButton *mByDayRadio;
129}; 131};
130 132
131class RecurrenceChooser : public QWidget 133class RecurrenceChooser : public QWidget
132{ 134{
133 Q_OBJECT 135 Q_OBJECT
134 public: 136 public:
135 RecurrenceChooser( QWidget *parent = 0, const char *name = 0 ); 137 RecurrenceChooser( QWidget *parent = 0, const char *name = 0 );
136 138
137 enum { Daily, Weekly, Monthly, Yearly }; 139 enum { Daily, Weekly, Monthly, Yearly };
@@ -171,25 +173,25 @@ class ExceptionsWidget : public QWidget, public ExceptionsBase
171 void setDefaults( const QDateTime &from ); 173 void setDefaults( const QDateTime &from );
172 174
173 void setDates( const DateList & ); 175 void setDates( const DateList & );
174 DateList dates(); 176 DateList dates();
175 177
176 protected slots: 178 protected slots:
177 void addException(); 179 void addException();
178 void changeException(); 180 void changeException();
179 void deleteException(); 181 void deleteException();
180 182
181 private: 183 private:
182 KDateEdit *mExceptionDateEdit; 184 KDateEdit *mExceptionDateEdit;
183 QListBox *mExceptionList; 185 Q3ListBox *mExceptionList;
184 DateList mExceptionDates; 186 DateList mExceptionDates;
185}; 187};
186 188
187class ExceptionsDialog : public KDialogBase, public ExceptionsBase 189class ExceptionsDialog : public KDialogBase, public ExceptionsBase
188{ 190{
189 public: 191 public:
190 ExceptionsDialog( QWidget *parent, const char *name = 0 ); 192 ExceptionsDialog( QWidget *parent, const char *name = 0 );
191 193
192 void setDefaults( const QDateTime &from ); 194 void setDefaults( const QDateTime &from );
193 195
194 void setDates( const DateList & ); 196 void setDates( const DateList & );
195 DateList dates(); 197 DateList dates();
@@ -226,26 +228,26 @@ class RecurrenceRangeWidget : public QWidget, public RecurrenceRangeBase
226 int duration(); 228 int duration();
227 229
228 void setEndDate( const QDate & ); 230 void setEndDate( const QDate & );
229 QDate endDate(); 231 QDate endDate();
230 232
231 void setDateTimes( const QDateTime &start, 233 void setDateTimes( const QDateTime &start,
232 const QDateTime &end = QDateTime() ); 234 const QDateTime &end = QDateTime() );
233 235
234 protected slots: 236 protected slots:
235 void showCurrentRange(); 237 void showCurrentRange();
236 238
237 private: 239 private:
238 QButtonGroup *mRangeButtonGroup; 240 Q3ButtonGroup *mRangeButtonGroup;
239 QGroupBox *mRangeGroupBox; 241 Q3GroupBox *mRangeGroupBox;
240 QLabel *mStartDateLabel; 242 QLabel *mStartDateLabel;
241 QRadioButton *mNoEndDateButton; 243 QRadioButton *mNoEndDateButton;
242 QRadioButton *mEndDurationButton; 244 QRadioButton *mEndDurationButton;
243 QSpinBox *mEndDurationEdit; 245 QSpinBox *mEndDurationEdit;
244 QRadioButton *mEndDateButton; 246 QRadioButton *mEndDateButton;
245 KDateEdit *mEndDateEdit; 247 KDateEdit *mEndDateEdit;
246}; 248};
247 249
248class RecurrenceRangeDialog : public KDialogBase, public RecurrenceRangeBase 250class RecurrenceRangeDialog : public KDialogBase, public RecurrenceRangeBase
249{ 251{
250 public: 252 public:
251 RecurrenceRangeDialog( QWidget *parent = 0, const char *name = 0 ); 253 RecurrenceRangeDialog( QWidget *parent = 0, const char *name = 0 );
@@ -291,29 +293,29 @@ class KOEditorRecurrence : public QWidget
291 293
292 signals: 294 signals:
293 void dateTimesChanged( QDateTime start, QDateTime end ); 295 void dateTimesChanged( QDateTime start, QDateTime end );
294 296
295 protected slots: 297 protected slots:
296 void showCurrentRule( int ); 298 void showCurrentRule( int );
297 void showExceptionsDialog(); 299 void showExceptionsDialog();
298 void showRecurrenceRangeDialog(); 300 void showRecurrenceRangeDialog();
299 301
300 private: 302 private:
301 QCheckBox *mEnabledCheck; 303 QCheckBox *mEnabledCheck;
302 304
303 QGroupBox *mTimeGroupBox; 305 Q3GroupBox *mTimeGroupBox;
304 QLabel *mDateTimeLabel; 306 QLabel *mDateTimeLabel;
305 307
306 QGroupBox *mRuleBox; 308 Q3GroupBox *mRuleBox;
307 QWidgetStack *mRuleStack; 309 Q3WidgetStack *mRuleStack;
308 RecurrenceChooser *mRecurrenceChooser; 310 RecurrenceChooser *mRecurrenceChooser;
309 311
310 RecurDaily *mDaily; 312 RecurDaily *mDaily;
311 RecurWeekly *mWeekly; 313 RecurWeekly *mWeekly;
312 RecurMonthly *mMonthly; 314 RecurMonthly *mMonthly;
313 RecurYearly *mYearly; 315 RecurYearly *mYearly;
314 316
315 RecurrenceRangeBase *mRecurrenceRange; 317 RecurrenceRangeBase *mRecurrenceRange;
316 RecurrenceRangeWidget *mRecurrenceRangeWidget; 318 RecurrenceRangeWidget *mRecurrenceRangeWidget;
317 RecurrenceRangeDialog *mRecurrenceRangeDialog; 319 RecurrenceRangeDialog *mRecurrenceRangeDialog;
318 QPushButton *mRecurrenceRangeButton; 320 QPushButton *mRecurrenceRangeButton;
319 321
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp
index 3e87197..62ad250 100644
--- a/korganizer/koeventeditor.cpp
+++ b/korganizer/koeventeditor.cpp
@@ -13,32 +13,37 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qframe.h> 25#include <q3frame.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qhbox.h> 27#include <q3hbox.h>
28#include <qtimer.h> 28#include <qtimer.h>
29#include <qdir.h> 29#include <qdir.h>
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qwidgetstack.h> 31#include <q3widgetstack.h>
32#include <qapplication.h> 32#include <qapplication.h>
33#include <QDesktopWidget>
34//Added by qt3to4:
35#include <Q3HBoxLayout>
36#include <Q3PtrList>
37#include <Q3VBoxLayout>
33 38
34#include <kiconloader.h> 39#include <kiconloader.h>
35#include <kstandarddirs.h> 40#include <kstandarddirs.h>
36#include <kdebug.h> 41#include <kdebug.h>
37#include <klocale.h> 42#include <klocale.h>
38#include <kfiledialog.h> 43#include <kfiledialog.h>
39#include <kmessagebox.h> 44#include <kmessagebox.h>
40#include <libkcal/calendarresources.h> 45#include <libkcal/calendarresources.h>
41#include <libkcal/resourcecalendar.h> 46#include <libkcal/resourcecalendar.h>
42#include <kresources/resourceselectdialog.h> 47#include <kresources/resourceselectdialog.h>
43 48
44#include <libkdepim/categoryselectdialog.h> 49#include <libkdepim/categoryselectdialog.h>
@@ -96,103 +101,103 @@ void KOEventEditor::setSecrecy( int sec )
96} 101}
97void KOEventEditor::setCategories( QString s ) 102void KOEventEditor::setCategories( QString s )
98{ 103{
99 mGeneral->setCategories(s); 104 mGeneral->setCategories(s);
100 105
101} 106}
102void KOEventEditor::setupGeneral() 107void KOEventEditor::setupGeneral()
103{ 108{
104 mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" ); 109 mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" );
105 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); 110 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
106 111
107 if( KOPrefs::instance()->mCompactDialogs ) { 112 if( KOPrefs::instance()->mCompactDialogs ) {
108 QFrame *topFrame = addPage(i18n("General")); 113 Q3Frame *topFrame = addPage(i18n("General"));
109 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 114 Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
110 topLayout->setSpacing(spacingHint()-1); 115 topLayout->setSpacing(spacingHint()-1);
111 topLayout->setMargin(marginHint()-1); 116 topLayout->setMargin(marginHint()-1);
112 topLayout->addStretch ( 1 ); 117 topLayout->addStretch ( 1 );
113 mGeneral->initHeader(topFrame,topLayout); 118 mGeneral->initHeader(topFrame,topLayout);
114 topLayout->addStretch ( 1 ); 119 topLayout->addStretch ( 1 );
115 mGeneral->initTime(topFrame,topLayout); 120 mGeneral->initTime(topFrame,topLayout);
116 topLayout->addStretch ( 1 ); 121 topLayout->addStretch ( 1 );
117// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 122// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
118 mGeneral->initAlarm(topFrame,topLayout); 123 mGeneral->initAlarm(topFrame,topLayout);
119 topLayout->addStretch ( 1 ); 124 topLayout->addStretch ( 1 );
120 mGeneral->enableAlarm( false ); 125 mGeneral->enableAlarm( false );
121 126
122 QBoxLayout *buttonLayout; 127 Q3BoxLayout *buttonLayout;
123 if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 ) 128 if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 )
124 buttonLayout = new QVBoxLayout( topLayout ); 129 buttonLayout = new Q3VBoxLayout( topLayout );
125 else 130 else
126 buttonLayout = new QHBoxLayout( topLayout ); 131 buttonLayout = new Q3HBoxLayout( topLayout );
127 QHBox* buttonWidget = new QHBox (topFrame); 132 Q3HBox* buttonWidget = new Q3HBox (topFrame);
128 QIconSet icon; 133 QIcon icon;
129 if ( QApplication::desktop()->width() < 321 ) 134 if ( QApplication::desktop()->width() < 321 )
130 icon = SmallIcon("fileexport16"); 135 icon = SmallIcon("fileexport16");
131 else 136 else
132 icon = SmallIcon("fileexport"); 137 icon = SmallIcon("fileexport");
133 QPushButton * loadTemplate = new QPushButton( buttonWidget); 138 QPushButton * loadTemplate = new QPushButton( buttonWidget);
134 QPushButton * saveTemplate = new QPushButton( buttonWidget); 139 QPushButton * saveTemplate = new QPushButton( buttonWidget);
135 saveTemplate->setIconSet (icon ) ; 140 saveTemplate->setIconSet (icon ) ;
136 int size = saveTemplate->sizeHint().height(); 141 int size = saveTemplate->sizeHint().height();
137 saveTemplate->setFixedSize( size, size ); 142 saveTemplate->setFixedSize( size, size );
138 if ( QApplication::desktop()->width() < 321 ) 143 if ( QApplication::desktop()->width() < 321 )
139 icon = SmallIcon("fileimport16"); 144 icon = SmallIcon("fileimport16");
140 else 145 else
141 icon = SmallIcon("fileimport"); 146 icon = SmallIcon("fileimport");
142 loadTemplate->setIconSet (icon ) ; 147 loadTemplate->setIconSet (icon ) ;
143 loadTemplate->setFixedSize( size, size ); 148 loadTemplate->setFixedSize( size, size );
144 buttonLayout->addWidget( buttonWidget ); 149 buttonLayout->addWidget( buttonWidget );
145 mGeneral->initCategories( topFrame, buttonLayout ); 150 mGeneral->initCategories( topFrame, buttonLayout );
146 151
147 topLayout->addStretch( 1 ); 152 topLayout->addStretch( 1 );
148 153
149 QFrame *topFrame2 = addPage(i18n("Details")); 154 Q3Frame *topFrame2 = addPage(i18n("Details"));
150 155
151 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); 156 Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2);
152 topLayout2->setSpacing(spacingHint()-1); 157 topLayout2->setSpacing(spacingHint()-1);
153 topLayout2->setMargin(marginHint()-1); 158 topLayout2->setMargin(marginHint()-1);
154 topLayout2->setSpacing(spacingHint()); 159 topLayout2->setSpacing(spacingHint());
155 160
156 mGeneral->initClass(topFrame2,topLayout2); 161 mGeneral->initClass(topFrame2,topLayout2);
157 mGeneral->initSecrecy( topFrame2, topLayout2 ); 162 mGeneral->initSecrecy( topFrame2, topLayout2 );
158 mGeneral->initDescription(topFrame2,topLayout2); 163 mGeneral->initDescription(topFrame2,topLayout2);
159 164
160 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 165 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
161 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); 166 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
162 } else { 167 } else {
163 QFrame *topFrame = addPage(i18n("General")); 168 Q3Frame *topFrame = addPage(i18n("General"));
164 169
165 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 170 Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
166 topLayout->setSpacing(spacingHint()); 171 topLayout->setSpacing(spacingHint());
167 172
168 mGeneral->initHeader(topFrame,topLayout); 173 mGeneral->initHeader(topFrame,topLayout);
169 mGeneral->initTime(topFrame,topLayout); 174 mGeneral->initTime(topFrame,topLayout);
170 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 175 Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout);
171 mGeneral->initAlarm(topFrame,alarmLineLayout); 176 mGeneral->initAlarm(topFrame,alarmLineLayout);
172 mGeneral->initClass(topFrame,alarmLineLayout); 177 mGeneral->initClass(topFrame,alarmLineLayout);
173 mGeneral->initDescription(topFrame,topLayout); 178 mGeneral->initDescription(topFrame,topLayout);
174 QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); 179 Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout);
175 mGeneral->initCategories( topFrame, detailsLayout ); 180 mGeneral->initCategories( topFrame, detailsLayout );
176 mGeneral->initSecrecy( topFrame, detailsLayout ); 181 mGeneral->initSecrecy( topFrame, detailsLayout );
177 } 182 }
178 183
179 mGeneral->finishSetup(); 184 mGeneral->finishSetup();
180 185
181} 186}
182 187
183void KOEventEditor::setupRecurrence() 188void KOEventEditor::setupRecurrence()
184{ 189{
185 QFrame *topFrame = addPage( i18n("Recurrence") ); 190 Q3Frame *topFrame = addPage( i18n("Recurrence") );
186 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 191 Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame );
187 192
188 mRecurrence = new KOEditorRecurrence( topFrame ); 193 mRecurrence = new KOEditorRecurrence( topFrame );
189 topLayout->addWidget( mRecurrence ); 194 topLayout->addWidget( mRecurrence );
190} 195}
191 196
192void KOEventEditor::editEvent(Event *event, bool showDescription) 197void KOEventEditor::editEvent(Event *event, bool showDescription)
193{ 198{
194 // init(); 199 // init();
195 200
196 mEvent = event; 201 mEvent = event;
197 readEvent(mEvent); 202 readEvent(mEvent);
198 if ( showDescription ) { 203 if ( showDescription ) {
@@ -347,25 +352,25 @@ void KOEventEditor::slotLoadTemplate()
347 t_dir.mkdir ( fileName ); 352 t_dir.mkdir ( fileName );
348 fileName += "/event"; 353 fileName += "/event";
349 fileName = KFileDialog::getOpenFileName( fileName , i18n("Load Event template"), this ); 354 fileName = KFileDialog::getOpenFileName( fileName , i18n("Load Event template"), this );
350 if ( fileName.length() == 0 ) 355 if ( fileName.length() == 0 )
351 return; 356 return;
352 CalendarLocal cal; 357 CalendarLocal cal;
353 ICalFormat format; 358 ICalFormat format;
354 if ( !format.load( &cal, fileName ) ) { 359 if ( !format.load( &cal, fileName ) ) {
355 KMessageBox::error( this, i18n("Error loading template file\n '%1'.") 360 KMessageBox::error( this, i18n("Error loading template file\n '%1'.")
356 .arg( fileName ) ); 361 .arg( fileName ) );
357 return ; 362 return ;
358 } 363 }
359 QPtrList<Event> events = cal.events(); 364 Q3PtrList<Event> events = cal.events();
360 Event* event = events.first(); 365 Event* event = events.first();
361 if ( !event ) { 366 if ( !event ) {
362 KMessageBox::error( this, 367 KMessageBox::error( this,
363 i18n("Template does not contain\na valid Event.")); 368 i18n("Template does not contain\na valid Event."));
364 } else { 369 } else {
365 kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl; 370 kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl;
366 readEvent( event, true ); 371 readEvent( event, true );
367 } 372 }
368} 373}
369 374
370 375
371void KOEventEditor::slotSaveTemplate() 376void KOEventEditor::slotSaveTemplate()
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp
index fc4d9a4..81047c1 100644
--- a/korganizer/koeventpopupmenu.cpp
+++ b/korganizer/koeventpopupmenu.cpp
@@ -13,77 +13,80 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcursor.h> 24#include <qcursor.h>
25//Added by qt3to4:
26#include <Q3ValueList>
27#include <Q3PopupMenu>
25 28
26#include <klocale.h> 29#include <klocale.h>
27#include <kdebug.h> 30#include <kdebug.h>
28#include <kiconloader.h> 31#include <kiconloader.h>
29 32
30#include <libkcal/event.h> 33#include <libkcal/event.h>
31 34
32#include "koeventpopupmenu.h" 35#include "koeventpopupmenu.h"
33#include "koprefs.h" 36#include "koprefs.h"
34 37
35KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() 38KOEventPopupMenu::KOEventPopupMenu(): Q3PopupMenu()
36{ 39{
37 mCurrentIncidence = 0; 40 mCurrentIncidence = 0;
38 mHasAdditionalItems = false; 41 mHasAdditionalItems = false;
39 42
40 43
41 mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow()))); 44 mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow())));
42 mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit()))); 45 mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit())));
43 mEditOnlyItems.append(insertItem (i18n("&Delete..."), 46 mEditOnlyItems.append(insertItem (i18n("&Delete..."),
44 this,SLOT(popupDelete()))); 47 this,SLOT(popupDelete())));
45 mEditOnlyItems.append(insertItem (i18n("&Clone..."), 48 mEditOnlyItems.append(insertItem (i18n("&Clone..."),
46 this,SLOT(popupClone()))); 49 this,SLOT(popupClone())));
47 mEditOnlyItems.append(insertItem (i18n("&Move..."), 50 mEditOnlyItems.append(insertItem (i18n("&Move..."),
48 this,SLOT(popupMove()))); 51 this,SLOT(popupMove())));
49#ifndef DESKTOP_VERSION 52#ifndef DESKTOP_VERSION
50 mEditOnlyItems.append(insertItem (i18n("&Beam..."), 53 mEditOnlyItems.append(insertItem (i18n("&Beam..."),
51 this,SLOT(popupBeam()))); 54 this,SLOT(popupBeam())));
52#endif 55#endif
53 mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), 56 mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"),
54 this,SLOT(popupCancel()))); 57 this,SLOT(popupCancel())));
55 isDisabled = false; 58 isDisabled = false;
56 mCatPopup = new QPopupMenu ( this ); 59 mCatPopup = new Q3PopupMenu ( this );
57 mCatPopup->setCheckable (true); 60 mCatPopup->setCheckable (true);
58 connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup())); 61 connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup()));
59 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int ))); 62 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int )));
60 mCalPopup = new QPopupMenu ( this ); 63 mCalPopup = new Q3PopupMenu ( this );
61 mCalPopup->setCheckable (true); 64 mCalPopup->setCheckable (true);
62 connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup())); 65 connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup()));
63 connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int ))); 66 connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int )));
64 //mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup )); 67 //mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup ));
65 //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup )); 68 //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup ));
66 insertItem (i18n("Categories"),mCatPopup ); 69 insertItem (i18n("Categories"),mCatPopup );
67 insertItem (i18n("Calendar"),mCalPopup ); 70 insertItem (i18n("Calendar"),mCalPopup );
68 QValueList<int>::Iterator it; 71 Q3ValueList<int>::Iterator it;
69 for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { 72 for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
70 mSingleOnlyItems.append(*it); 73 mSingleOnlyItems.append(*it);
71 } 74 }
72 75
73} 76}
74void KOEventPopupMenu::enableDefault( bool enable ) 77void KOEventPopupMenu::enableDefault( bool enable )
75{ 78{
76 isDisabled = !enable; 79 isDisabled = !enable;
77 QValueList<int>::Iterator it; 80 Q3ValueList<int>::Iterator it;
78 for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) { 81 for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) {
79 setItemEnabled(*it,enable); 82 setItemEnabled(*it,enable);
80 } 83 }
81} 84}
82 85
83void KOEventPopupMenu::fillCalPopup() // CAL 86void KOEventPopupMenu::fillCalPopup() // CAL
84{ 87{
85 mCalPopup->clear(); 88 mCalPopup->clear();
86 if (!mCurrentIncidence) return; 89 if (!mCurrentIncidence) return;
87 bool readO = mCurrentIncidence->isReadOnly()|| isDisabled; 90 bool readO = mCurrentIncidence->isReadOnly()|| isDisabled;
88 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 91 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
89 while ( kkf ) { 92 while ( kkf ) {
@@ -137,34 +140,34 @@ void KOEventPopupMenu::computeCatPopup( int index )
137 } 140 }
138 mCurrentIncidence->setCategories( categories ); 141 mCurrentIncidence->setCategories( categories );
139 emit categoryChanged( mCurrentIncidence ); 142 emit categoryChanged( mCurrentIncidence );
140} 143}
141void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) 144void KOEventPopupMenu::showIncidencePopup(Incidence *incidence)
142{ 145{
143 if ( !incidence) return; 146 if ( !incidence) return;
144 mCurrentIncidence = incidence; 147 mCurrentIncidence = incidence;
145 148
146 if (mCurrentIncidence) { 149 if (mCurrentIncidence) {
147 // Enable/Disabled menu items only valid for editable events. 150 // Enable/Disabled menu items only valid for editable events.
148 if ( !isDisabled ) { 151 if ( !isDisabled ) {
149 QValueList<int>::Iterator it; 152 Q3ValueList<int>::Iterator it;
150 for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { 153 for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
151 setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); 154 setItemEnabled(*it,!mCurrentIncidence->isReadOnly());
152 } 155 }
153 } 156 }
154 popup(QCursor::pos()); 157 popup(QCursor::pos());
155 } 158 }
156} 159}
157 160
158void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text, 161void KOEventPopupMenu::addAdditionalItem(const QIcon &icon,const QString &text,
159 const QObject *receiver, const char *member, 162 const QObject *receiver, const char *member,
160 bool editOnly) 163 bool editOnly)
161{ 164{
162 if (!mHasAdditionalItems) { 165 if (!mHasAdditionalItems) {
163 mHasAdditionalItems = true; 166 mHasAdditionalItems = true;
164 insertSeparator(); 167 insertSeparator();
165 } 168 }
166 int id = insertItem(icon,text,receiver,member); 169 int id = insertItem(icon,text,receiver,member);
167 if (editOnly) mEditOnlyItems.append(id); 170 if (editOnly) mEditOnlyItems.append(id);
168} 171}
169 172
170void KOEventPopupMenu::popupShow() 173void KOEventPopupMenu::popupShow()
diff --git a/korganizer/koeventpopupmenu.h b/korganizer/koeventpopupmenu.h
index e28745b..de5220b 100644
--- a/korganizer/koeventpopupmenu.h
+++ b/korganizer/koeventpopupmenu.h
@@ -17,36 +17,38 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOEVENTPOPUPMENU_H 23#ifndef KOEVENTPOPUPMENU_H
24#define KOEVENTPOPUPMENU_H 24#define KOEVENTPOPUPMENU_H
25// 25//
26// Context menu for event views with standard event actions 26// Context menu for event views with standard event actions
27// 27//
28 28
29#include <qpopupmenu.h> 29#include <q3popupmenu.h>
30//Added by qt3to4:
31#include <Q3ValueList>
30 32
31#include <libkcal/incidence.h> 33#include <libkcal/incidence.h>
32 34
33using namespace KCal; 35using namespace KCal;
34 36
35class KOEventPopupMenu : public QPopupMenu { 37class KOEventPopupMenu : public Q3PopupMenu {
36 Q_OBJECT 38 Q_OBJECT
37 public: 39 public:
38 KOEventPopupMenu(); 40 KOEventPopupMenu();
39 41
40 void addAdditionalItem(const QIconSet &icon,const QString &text, 42 void addAdditionalItem(const QIcon &icon,const QString &text,
41 const QObject *receiver, const char *member, 43 const QObject *receiver, const char *member,
42 bool editOnly=false); 44 bool editOnly=false);
43 45
44 46
45 public slots: 47 public slots:
46 void showIncidencePopup(Incidence *); 48 void showIncidencePopup(Incidence *);
47 void enableDefault( bool ); 49 void enableDefault( bool );
48 50
49 protected slots: 51 protected slots:
50 void popupShow(); 52 void popupShow();
51 void popupEdit(); 53 void popupEdit();
52 void popupDelete(); 54 void popupDelete();
@@ -64,20 +66,20 @@ class KOEventPopupMenu : public QPopupMenu {
64 void showIncidenceSignal(Incidence *); 66 void showIncidenceSignal(Incidence *);
65 void deleteIncidenceSignal(Incidence *); 67 void deleteIncidenceSignal(Incidence *);
66 void cloneIncidenceSignal(Incidence *); 68 void cloneIncidenceSignal(Incidence *);
67 void cancelIncidenceSignal(Incidence *); 69 void cancelIncidenceSignal(Incidence *);
68 void moveIncidenceSignal(Incidence *); 70 void moveIncidenceSignal(Incidence *);
69 void beamIncidenceSignal(Incidence *); 71 void beamIncidenceSignal(Incidence *);
70 void categoryChanged( Incidence * ); 72 void categoryChanged( Incidence * );
71 73
72 private: 74 private:
73 Incidence *mCurrentIncidence; 75 Incidence *mCurrentIncidence;
74 76
75 bool mHasAdditionalItems; 77 bool mHasAdditionalItems;
76 QValueList<int> mEditOnlyItems; 78 Q3ValueList<int> mEditOnlyItems;
77 QValueList<int> mSingleOnlyItems; 79 Q3ValueList<int> mSingleOnlyItems;
78 bool isDisabled; 80 bool isDisabled;
79 QPopupMenu *mCatPopup; 81 Q3PopupMenu *mCatPopup;
80 QPopupMenu *mCalPopup; 82 Q3PopupMenu *mCalPopup;
81}; 83};
82 84
83#endif 85#endif
diff --git a/korganizer/koeventview.cpp b/korganizer/koeventview.cpp
index 1d26930..a4ba85e 100644
--- a/korganizer/koeventview.cpp
+++ b/korganizer/koeventview.cpp
@@ -12,25 +12,25 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qpopupmenu.h> 24#include <q3popupmenu.h>
25#include <qcursor.h> 25#include <qcursor.h>
26 26
27#include <klocale.h> 27#include <klocale.h>
28#include <kdebug.h> 28#include <kdebug.h>
29#include <kiconloader.h> 29#include <kiconloader.h>
30#include <kmessagebox.h> 30#include <kmessagebox.h>
31 31
32#include <libkcal/calendar.h> 32#include <libkcal/calendar.h>
33#include "koprefs.h" 33#include "koprefs.h"
34#include "koeventview.h" 34#include "koeventview.h"
35using namespace KOrg; 35using namespace KOrg;
36 36
@@ -64,25 +64,25 @@ KOEventPopupMenu *KOEventView::eventPopup()
64 connect(eventPopup,SIGNAL(cloneIncidenceSignal(Incidence *)), 64 connect(eventPopup,SIGNAL(cloneIncidenceSignal(Incidence *)),
65 SIGNAL(cloneIncidenceSignal(Incidence *))); 65 SIGNAL(cloneIncidenceSignal(Incidence *)));
66 connect(eventPopup,SIGNAL(beamIncidenceSignal(Incidence *)), 66 connect(eventPopup,SIGNAL(beamIncidenceSignal(Incidence *)),
67 SIGNAL(beamIncidenceSignal(Incidence *))); 67 SIGNAL(beamIncidenceSignal(Incidence *)));
68 connect(eventPopup,SIGNAL(moveIncidenceSignal(Incidence *)), 68 connect(eventPopup,SIGNAL(moveIncidenceSignal(Incidence *)),
69 SIGNAL(moveIncidenceSignal(Incidence *))); 69 SIGNAL(moveIncidenceSignal(Incidence *)));
70 70
71 return eventPopup; 71 return eventPopup;
72} 72}
73 73
74//--------------------------------------------------------------------------- 74//---------------------------------------------------------------------------
75 75
76void KOEventView::showIncidencePopup(QPopupMenu *popup,Incidence *event) 76void KOEventView::showIncidencePopup(Q3PopupMenu *popup,Incidence *event)
77{ 77{
78 mCurrentIncidence = event; 78 mCurrentIncidence = event;
79 if (event) popup->popup(QCursor::pos()); 79 if (event) popup->popup(QCursor::pos());
80} 80}
81 81
82//--------------------------------------------------------------------------- 82//---------------------------------------------------------------------------
83 83
84void KOEventView::popupShow() 84void KOEventView::popupShow()
85{ 85{
86 emit showIncidenceSignal(mCurrentIncidence); 86 emit showIncidenceSignal(mCurrentIncidence);
87} 87}
88 88
diff --git a/korganizer/koeventview.h b/korganizer/koeventview.h
index 77ec111..f28e68b 100644
--- a/korganizer/koeventview.h
+++ b/korganizer/koeventview.h
@@ -21,24 +21,26 @@
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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#ifndef _KOEVENTVIEW_H 24#ifndef _KOEVENTVIEW_H
25#define _KOEVENTVIEW_H 25#define _KOEVENTVIEW_H
26 26
27#include <libkcal/calendar.h> 27#include <libkcal/calendar.h>
28#include <libkcal/event.h> 28#include <libkcal/event.h>
29 29
30#include <korganizer/baseview.h> 30#include <korganizer/baseview.h>
31 31
32#include "koeventpopupmenu.h" 32#include "koeventpopupmenu.h"
33//Added by qt3to4:
34#include <Q3PopupMenu>
33 35
34using namespace KCal; 36using namespace KCal;
35 37
36class CalPrinter; 38class CalPrinter;
37 39
38/** 40/**
39 KOEventView is the abstract base class from which all other 41 KOEventView is the abstract base class from which all other
40 calendar views for event data are derived. It provides methods for 42 calendar views for event data are derived. It provides methods for
41 displaying 43 displaying
42 appointments and events on one or more days. The actual number of 44 appointments and events on one or more days. The actual number of
43 days that a view actually supports is not defined by this abstract class; 45 days that a view actually supports is not defined by this abstract class;
44 that is up to the classes that inherit from it. It also provides 46 that is up to the classes that inherit from it. It also provides
@@ -78,25 +80,25 @@ class KOEventView : public KOrg::BaseView
78 KOEventPopupMenu *eventPopup(); 80 KOEventPopupMenu *eventPopup();
79 81
80 /** This view is an view for displaying events. */ 82 /** This view is an view for displaying events. */
81 bool isEventView() { return true; } 83 bool isEventView() { return true; }
82 84
83 public slots: 85 public slots:
84 86
85 /** 87 /**
86 * Show context menu for event. 88 * Show context menu for event.
87 * @param event event, which is to be manipulated by the menu actions 89 * @param event event, which is to be manipulated by the menu actions
88 * @param popup a popop menu created with eventPopup() 90 * @param popup a popop menu created with eventPopup()
89 */ 91 */
90 void showIncidencePopup(QPopupMenu *popup, Incidence *event); 92 void showIncidencePopup(Q3PopupMenu *popup, Incidence *event);
91 93
92 /** 94 /**
93 Perform the default action for an incidence, e.g. open the event editor, 95 Perform the default action for an incidence, e.g. open the event editor,
94 when double-clicking an event in the agenda view. 96 when double-clicking an event in the agenda view.
95 */ 97 */
96 void defaultAction( Incidence * ); 98 void defaultAction( Incidence * );
97 99
98 signals: 100 signals:
99 /** 101 /**
100 * when the view changes the dates that are selected in one way or 102 * when the view changes the dates that are selected in one way or
101 * another, this signal is emitted. It should be connected back to 103 * another, this signal is emitted. It should be connected back to
102 * the @see KDateNavigator object so that it changes appropriately, 104 * the @see KDateNavigator object so that it changes appropriately,
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index c0acf34..4df26a9 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -8,30 +8,35 @@
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <qcstring.h> 20#include <q3cstring.h>
21#include <qwhatsthis.h> 21#include <q3whatsthis.h>
22#include <qdialog.h> 22#include <qdialog.h>
23#include <qapplication.h> 23#include <qapplication.h>
24#include <QDesktopWidget>
24#include <qlabel.h> 25#include <qlabel.h>
25#include <qlayout.h> 26#include <qlayout.h>
27//Added by qt3to4:
28#include <QKeyEvent>
29#include <Q3PtrList>
30#include <Q3VBoxLayout>
26 31
27#include <klocale.h> 32#include <klocale.h>
28#include <kapplication.h> 33#include <kapplication.h>
29#include <libkcal/event.h> 34#include <libkcal/event.h>
30#include <libkcal/todo.h> 35#include <libkcal/todo.h>
31#include <kdebug.h> 36#include <kdebug.h>
32#include <kiconloader.h> 37#include <kiconloader.h>
33#include <krun.h> 38#include <krun.h>
34#include <kglobal.h> 39#include <kglobal.h>
35#include <kprocess.h> 40#include <kprocess.h>
36#include "koprefs.h" 41#include "koprefs.h"
37 42
@@ -46,56 +51,56 @@
46 51
47#include "koeventviewer.h" 52#include "koeventviewer.h"
48//#ifndef KORG_NOKABC 53//#ifndef KORG_NOKABC
49//#include <kabc/stdaddressbook.h> 54//#include <kabc/stdaddressbook.h>
50//#define size count 55//#define size count
51//#endif 56//#endif
52 57
53#ifdef DESKTOP_VERSION 58#ifdef DESKTOP_VERSION
54#include <kabc/addresseedialog.h> 59#include <kabc/addresseedialog.h>
55#include <kabc/addresseeview.h> 60#include <kabc/addresseeview.h>
56#include <qprinter.h> 61#include <qprinter.h>
57#include <qpainter.h> 62#include <qpainter.h>
58#include <qpaintdevicemetrics.h> 63#include <q3paintdevicemetrics.h>
59#else //DESKTOP_VERSION 64#else //DESKTOP_VERSION
60#include <qtopia/qcopenvelope_qws.h> 65#include <qtopia/qcopenvelope_qws.h>
61#endif //DESKTOP_VERSION 66#endif //DESKTOP_VERSION
62#include <externalapphandler.h> 67#include <externalapphandler.h>
63 68
64KOEventViewer::KOEventViewer(QWidget *parent,const char *name) 69KOEventViewer::KOEventViewer(QWidget *parent,const char *name)
65 : QTextBrowser(parent,name) 70 : Q3TextBrowser(parent,name)
66{ 71{
67 mSyncMode = false; 72 mSyncMode = false;
68 mColorMode = 0; 73 mColorMode = 0;
69} 74}
70 75
71KOEventViewer::~KOEventViewer() 76KOEventViewer::~KOEventViewer()
72{ 77{
73} 78}
74 79
75void KOEventViewer::printMe() 80void KOEventViewer::printMe()
76{ 81{
77#ifdef DESKTOP_VERSION 82#ifdef DESKTOP_VERSION
78 83
79 KOPrintPrefs pp ( this ); 84 KOPrintPrefs pp ( this );
80 if (!pp.exec() ) 85 if (!pp.exec() )
81 return; 86 return;
82 int scaleval = pp.printMode() ; 87 int scaleval = pp.printMode() ;
83 88
84 QPrinter printer; 89 QPrinter printer;
85 if (!printer.setup() ) 90 if (!printer.setup() )
86 return; 91 return;
87 QPainter p; 92 QPainter p;
88 p.begin ( &printer ); 93 p.begin ( &printer );
89 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 94 Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
90 float dx, dy; 95 float dx, dy;
91 int wid = (m.width() * 9)/10; 96 int wid = (m.width() * 9)/10;
92 dx = (float) wid/(float)contentsWidth (); 97 dx = (float) wid/(float)contentsWidth ();
93 dy = (float)(m.height()) / (float)contentsHeight (); 98 dy = (float)(m.height()) / (float)contentsHeight ();
94 float scale; 99 float scale;
95 // scale to fit the width or height of the paper 100 // scale to fit the width or height of the paper
96 if ( dx < dy ) 101 if ( dx < dy )
97 scale = dx; 102 scale = dx;
98 else 103 else
99 scale = dy; 104 scale = dy;
100 105
101 p.translate( m.width()/10,0 ); 106 p.translate( m.width()/10,0 );
@@ -125,46 +130,46 @@ void KOEventViewer::setSource(const QString& n)
125 { 130 {
126 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 131 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
127 KABC::AddressBook::Iterator it; 132 KABC::AddressBook::Iterator it;
128 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 133 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
129 // LR I do not understand, why the uid string is different on zaurus and desktop 134 // LR I do not understand, why the uid string is different on zaurus and desktop
130 QString uid = "uid://"+(*it).uid(); 135 QString uid = "uid://"+(*it).uid();
131 136
132 //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); 137 //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1());
133 if (n == uid ) { 138 if (n == uid ) {
134 //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); 139 //qDebug("found %s ",(*it).mobileHomePhone().latin1() );
135 QDialog dia( this,"dia123", true ); 140 QDialog dia( this,"dia123", true );
136 dia.setCaption( i18n("Details of attendee") ); 141 dia.setCaption( i18n("Details of attendee") );
137 QVBoxLayout lay ( &dia ); 142 Q3VBoxLayout lay ( &dia );
138 KABC::AddresseeView av ( &dia ); 143 KABC::AddresseeView av ( &dia );
139 av.setAddressee( (*it) ); 144 av.setAddressee( (*it) );
140 lay.addWidget( &av ); 145 lay.addWidget( &av );
141 if ( QApplication::desktop()->width() < 480 ) 146 if ( QApplication::desktop()->width() < 480 )
142 dia.resize( 220, 240); 147 dia.resize( 220, 240);
143 else { 148 else {
144 dia.resize( 400,400); 149 dia.resize( 400,400);
145 } 150 }
146 dia.exec(); 151 dia.exec();
147 break; 152 break;
148 } 153 }
149 } 154 }
150 return; 155 return;
151 } 156 }
152#else 157#else
153 { 158 {
154 if ( "uid:organizer" == n ) { 159 if ( "uid:organizer" == n ) {
155 ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); 160 ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),"");
156 return; 161 return;
157 } 162 }
158 QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); 163 Q3PtrList<Attendee> attendees = mCurrentIncidence->attendees();
159 if (attendees.count()) { 164 if (attendees.count()) {
160 Attendee *a; 165 Attendee *a;
161 for(a=attendees.first();a;a=attendees.next()) { 166 for(a=attendees.first();a;a=attendees.next()) {
162 if ( "uid:"+a->uid() == n ) { 167 if ( "uid:"+a->uid() == n ) {
163 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); 168 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid());
164 return; 169 return;
165 } 170 }
166 } 171 }
167 } 172 }
168 return; 173 return;
169 } 174 }
170 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 175 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
@@ -191,56 +196,56 @@ void KOEventViewer::setSource(const QString& n)
191#ifndef KORG_NODCOP 196#ifndef KORG_NODCOP
192 kdDebug() << "KOEventViewer::setSource(): " << n << endl; 197 kdDebug() << "KOEventViewer::setSource(): " << n << endl;
193 QString tmpStr; 198 QString tmpStr;
194 if (n.startsWith("mailto:")) { 199 if (n.startsWith("mailto:")) {
195 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); 200 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null);
196 //emit showIncidence(n); 201 //emit showIncidence(n);
197 return; 202 return;
198 } else if (n.startsWith("uid:")) { 203 } else if (n.startsWith("uid:")) {
199 DCOPClient *client = KApplication::kApplication()->dcopClient(); 204 DCOPClient *client = KApplication::kApplication()->dcopClient();
200 const QByteArray noParamData; 205 const QByteArray noParamData;
201 const QByteArray paramData; 206 const QByteArray paramData;
202 QByteArray replyData; 207 QByteArray replyData;
203 QCString replyTypeStr; 208 Q3CString replyTypeStr;
204#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) 209#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData))
205 bool foundAbbrowser = PING_ABBROWSER; 210 bool foundAbbrowser = PING_ABBROWSER;
206 211
207 if (foundAbbrowser) { 212 if (foundAbbrowser) {
208 //KAddressbook is already running, so just DCOP to it to bring up the contact editor 213 //KAddressbook is already running, so just DCOP to it to bring up the contact editor
209 //client->send("kaddressbook","KAddressBookIface", 214 //client->send("kaddressbook","KAddressBookIface",
210 QDataStream arg(paramData, IO_WriteOnly); 215 QDataStream arg(paramData, QIODevice::WriteOnly);
211 arg << n.mid(6); 216 arg << n.mid(6);
212 client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); 217 client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData);
213 return; 218 return;
214 } else { 219 } else {
215 /* 220 /*
216 KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. 221 KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater.
217 We start it without its main interface 222 We start it without its main interface
218 */ 223 */
219 KIconLoader* iconLoader = new KIconLoader(); 224 KIconLoader* iconLoader = new KIconLoader();
220 QString iconPath = iconLoader->iconPath("go",KIcon::Small); 225 QString iconPath = iconLoader->iconPath("go",KIcon::Small);
221 ActionManager::setStartedKAddressBook(true); 226 ActionManager::setStartedKAddressBook(true);
222 tmpStr = "kaddressbook --editor-only --uid "; 227 tmpStr = "kaddressbook --editor-only --uid ";
223 tmpStr += KProcess::quote(n.mid(6)); 228 tmpStr += KProcess::quote(n.mid(6));
224 KRun::runCommand(tmpStr,"KAddressBook",iconPath); 229 KRun::runCommand(tmpStr,"KAddressBook",iconPath);
225 return; 230 return;
226 } 231 }
227 } else { 232 } else {
228 //QTextBrowser::setSource(n); 233 //QTextBrowser::setSource(n);
229 } 234 }
230#endif 235#endif
231} 236}
232void KOEventViewer::mailToAttendees( bool all ) 237void KOEventViewer::mailToAttendees( bool all )
233{ 238{
234 QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); 239 Q3PtrList<Attendee> attendees = mCurrentIncidence->attendees();
235 if (attendees.count() == 0) return; 240 if (attendees.count() == 0) return;
236 QStringList nameList; 241 QStringList nameList;
237 QStringList emailList; 242 QStringList emailList;
238 QStringList uidList; 243 QStringList uidList;
239 Attendee* a; 244 Attendee* a;
240 for(a=attendees.first();a;a=attendees.next()) { 245 for(a=attendees.first();a;a=attendees.next()) {
241 if ( !all && !a->RSVP() ) continue; 246 if ( !all && !a->RSVP() ) continue;
242 if (!a->email().isEmpty()) { 247 if (!a->email().isEmpty()) {
243#ifndef DESKTOP_VERSION 248#ifndef DESKTOP_VERSION
244 nameList.append (a->realName() ); 249 nameList.append (a->realName() );
245 emailList.append (a->email() ); 250 emailList.append (a->email() );
246 uidList.append (a->uid() ); 251 uidList.append (a->uid() );
@@ -251,25 +256,25 @@ void KOEventViewer::mailToAttendees( bool all )
251 } 256 }
252#ifndef DESKTOP_VERSION 257#ifndef DESKTOP_VERSION
253 QString uid = "ComposeMailUIpick2"+mMailSubject; 258 QString uid = "ComposeMailUIpick2"+mMailSubject;
254 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 259 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
255 260
256#else 261#else
257 ExternalAppHandler::instance()->mailToMultipleContacts( emailList.join(","), mMailSubject ); 262 ExternalAppHandler::instance()->mailToMultipleContacts( emailList.join(","), mMailSubject );
258#endif 263#endif
259 264
260} 265}
261void KOEventViewer::addTag(const QString & tag,const QString & text) 266void KOEventViewer::addTag(const QString & tag,const QString & text)
262{ 267{
263 int number=text.contains("\n"); 268 int number=text.count("\n");
264 QString str = "<" + tag + ">"; 269 QString str = "<" + tag + ">";
265 QString tmpText=text; 270 QString tmpText=text;
266 QString tmpStr=str; 271 QString tmpStr=str;
267 if(number !=-1) 272 if(number !=-1)
268 { 273 {
269 if (number > 0) { 274 if (number > 0) {
270 int pos=0; 275 int pos=0;
271 QString tmp; 276 QString tmp;
272 for(int i=0;i<=number;i++) { 277 for(int i=0;i<=number;i++) {
273 pos=tmpText.find("\n"); 278 pos=tmpText.find("\n");
274 tmp=tmpText.left(pos); 279 tmp=tmpText.left(pos);
275 tmpText=tmpText.right(tmpText.length()-pos-1); 280 tmpText=tmpText.right(tmpText.length()-pos-1);
@@ -578,25 +583,25 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
578 if ( event->relatedTo() ) { 583 if ( event->relatedTo() ) {
579 addTag("b",i18n("Parent todo:<br>")); 584 addTag("b",i18n("Parent todo:<br>"));
580 585
581 QString t_name = "[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] ";// +event->relatedTo()->summary()); 586 QString t_name = "[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] ";// +event->relatedTo()->summary());
582 587
583 mText += t_name; 588 mText += t_name;
584 mText += "<a href=\"todo_uid:" + event->relatedTo()->uid() + "\">"; 589 mText += "<a href=\"todo_uid:" + event->relatedTo()->uid() + "\">";
585 mText += deTag(event->relatedTo()->summary()); 590 mText += deTag(event->relatedTo()->summary());
586 mText += "</a><br>"; 591 mText += "</a><br>";
587 592
588 // mText.append(deTag("[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] " +event->relatedTo()->summary()) +"<br>"); 593 // mText.append(deTag("[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] " +event->relatedTo()->summary()) +"<br>");
589 } 594 }
590 QPtrList<Incidence> Relations = event->relations(); 595 Q3PtrList<Incidence> Relations = event->relations();
591 Incidence *to; 596 Incidence *to;
592 if ( Relations.first() ) 597 if ( Relations.first() )
593 addTag("b",i18n("Sub todos:<br>")); 598 addTag("b",i18n("Sub todos:<br>"));
594 for (to=Relations.first();to;to=Relations.next()) { 599 for (to=Relations.first();to;to=Relations.next()) {
595 QString t_name = "[" +QString::number(((Todo*)to)->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%] ";// +to->relatedTo()->summary()); 600 QString t_name = "[" +QString::number(((Todo*)to)->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%] ";// +to->relatedTo()->summary());
596 mText += t_name; 601 mText += t_name;
597 mText += "<a href=\"todo_uid:" + to->uid() + "\">"; 602 mText += "<a href=\"todo_uid:" + to->uid() + "\">";
598 mText += deTag(to->summary()); 603 mText += deTag(to->summary());
599 mText += "</a><br>"; 604 mText += "</a><br>";
600 605
601 } 606 }
602 607
@@ -612,25 +617,25 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
612void KOEventViewer::formatCategories(Incidence *event) 617void KOEventViewer::formatCategories(Incidence *event)
613{ 618{
614 if (!event->categoriesStr().isEmpty()) { 619 if (!event->categoriesStr().isEmpty()) {
615 if (event->categories().count() == 1) { 620 if (event->categories().count() == 1) {
616 addTag("p","<b>"+i18n("Category") + ":</b> " + event->categoriesStrWithSpace()); 621 addTag("p","<b>"+i18n("Category") + ":</b> " + event->categoriesStrWithSpace());
617 } else { 622 } else {
618 addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ; 623 addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ;
619 } 624 }
620 } 625 }
621} 626}
622void KOEventViewer::formatAttendees(Incidence *event) 627void KOEventViewer::formatAttendees(Incidence *event)
623{ 628{
624 QPtrList<Attendee> attendees = event->attendees(); 629 Q3PtrList<Attendee> attendees = event->attendees();
625 if (attendees.count()) { 630 if (attendees.count()) {
626 631
627 632
628 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); 633 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
629 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); 634 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
630 addTag("h3",i18n("Organizer")); 635 addTag("h3",i18n("Organizer"));
631 mText.append("<ul><li>"); 636 mText.append("<ul><li>");
632#ifndef KORG_NOKABC 637#ifndef KORG_NOKABC
633 638
634#ifdef DESKTOP_VERSION 639#ifdef DESKTOP_VERSION
635 KABC::AddressBook *add_book = KABC::StdAddressBook::self(); 640 KABC::AddressBook *add_book = KABC::StdAddressBook::self();
636 KABC::Addressee::List addressList; 641 KABC::Addressee::List addressList;
@@ -645,25 +650,25 @@ void KOEventViewer::formatAttendees(Incidence *event)
645 } 650 }
646#else //DESKTOP_VERSION 651#else //DESKTOP_VERSION
647 mText += "<a href=\"uid:organizer\">"; 652 mText += "<a href=\"uid:organizer\">";
648 mText += event->organizer(); 653 mText += event->organizer();
649 mText += "</a>\n"; 654 mText += "</a>\n";
650#endif //DESKTOP_VERSION 655#endif //DESKTOP_VERSION
651 656
652 657
653#else 658#else
654 mText.append(event->organizer()); 659 mText.append(event->organizer());
655#endif 660#endif
656 661
657 if (iconPath) { 662 if (!iconPath.isEmpty()) {
658 mText += " <a href=\"mailto:" + event->organizer() + "\">"; 663 mText += " <a href=\"mailto:" + event->organizer() + "\">";
659 mText += "<IMG src=\"" + iconPath + "\">"; 664 mText += "<IMG src=\"" + iconPath + "\">";
660 mText += "</a>\n"; 665 mText += "</a>\n";
661 } 666 }
662 mText.append("</li></ul>"); 667 mText.append("</li></ul>");
663 668
664 addTag("h3",i18n("Attendees")); 669 addTag("h3",i18n("Attendees"));
665 Attendee *a; 670 Attendee *a;
666 mText.append("<ul>"); 671 mText.append("<ul>");
667 int a_count = 0; 672 int a_count = 0;
668 int a_count_nr = 0; 673 int a_count_nr = 0;
669 674
@@ -695,25 +700,25 @@ void KOEventViewer::formatAttendees(Incidence *event)
695 mText += "</a>\n"; 700 mText += "</a>\n";
696#endif //DESKTOP_VERSION 701#endif //DESKTOP_VERSION
697#else 702#else
698 //qDebug("nokabc "); 703 //qDebug("nokabc ");
699 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 704 mText += "<li><a href=\"uid:" + a->uid() + "\">";
700 if (!a->name().isEmpty()) mText += a->name(); 705 if (!a->name().isEmpty()) mText += a->name();
701 else mText += a->email(); 706 else mText += a->email();
702 mText += "</a>\n"; 707 mText += "</a>\n";
703#endif 708#endif
704 709
705 710
706 if (!a->email().isEmpty()) { 711 if (!a->email().isEmpty()) {
707 if (iconPath) { 712 if (!iconPath.isEmpty()) {
708 mText += "<a href=\"mailto:" + a->realName() +" <" + a->email() + ">:" + mMailSubject + "\">"; 713 mText += "<a href=\"mailto:" + a->realName() +" <" + a->email() + ">:" + mMailSubject + "\">";
709 if ( a->RSVP() ) { 714 if ( a->RSVP() ) {
710 ++a_count_nr; 715 ++a_count_nr;
711 mText += "<IMG src=\"" + iconPath + "\">"; 716 mText += "<IMG src=\"" + iconPath + "\">";
712 } 717 }
713 else { 718 else {
714 ++a_count; 719 ++a_count;
715 mText += "<IMG src=\"" + NOiconPath + "\">"; 720 mText += "<IMG src=\"" + NOiconPath + "\">";
716 } 721 }
717 mText += "</a>\n"; 722 mText += "</a>\n";
718 } 723 }
719 } 724 }
@@ -853,16 +858,16 @@ QString KOEventViewer::deTag(QString text)
853 } 858 }
854#endif 859#endif
855 return text; 860 return text;
856} 861}
857void KOEventViewer::keyPressEvent ( QKeyEvent * e ) 862void KOEventViewer::keyPressEvent ( QKeyEvent * e )
858{ 863{
859 switch ( e->key() ) { 864 switch ( e->key() ) {
860 case Qt::Key_Return: 865 case Qt::Key_Return:
861 case Qt::Key_Enter : 866 case Qt::Key_Enter :
862 e->ignore(); 867 e->ignore();
863 break; 868 break;
864 default: 869 default:
865 QTextBrowser::keyPressEvent ( e ); 870 Q3TextBrowser::keyPressEvent ( e );
866 break; 871 break;
867 } 872 }
868} 873}
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h
index 64eb4ff..3df667f 100644
--- a/korganizer/koeventviewer.h
+++ b/korganizer/koeventviewer.h
@@ -13,56 +13,59 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19#ifndef KOEVENTVIEWER_H 19#ifndef KOEVENTVIEWER_H
20#define KOEVENTVIEWER_H 20#define KOEVENTVIEWER_H
21// 21//
22// Viewer widget for events. 22// Viewer widget for events.
23// 23//
24 24
25#include <qtextbrowser.h> 25#include <q3textbrowser.h>
26//Added by qt3to4:
27#include <Q3VBoxLayout>
28#include <QKeyEvent>
26 29
27#include <libkcal/event.h> 30#include <libkcal/event.h>
28#include <libkcal/journal.h> 31#include <libkcal/journal.h>
29 32
30 33
31using namespace KCal; 34using namespace KCal;
32 35
33#ifdef DESKTOP_VERSION 36#ifdef DESKTOP_VERSION
34 37
35#include <qradiobutton.h> 38#include <qradiobutton.h>
36#include <qpushbutton.h> 39#include <qpushbutton.h>
37#include <qlayout.h> 40#include <qlayout.h>
38#include <qdialog.h> 41#include <qdialog.h>
39#include <qlabel.h> 42#include <qlabel.h>
40#include <qbuttongroup.h> 43#include <q3buttongroup.h>
41#include <kglobal.h> 44#include <kglobal.h>
42 45
43class KOPrintPrefs : public QDialog 46class KOPrintPrefs : public QDialog
44{ 47{
45 public: 48 public:
46 KOPrintPrefs( QWidget *parent=0, const char *name=0 ) : 49 KOPrintPrefs( QWidget *parent=0, const char *name=0 ) :
47 QDialog( parent, name, true ) 50 QDialog( parent, name, true )
48 { 51 {
49 setCaption( i18n("KO/Pi Printout") ); 52 setCaption( i18n("KO/Pi Printout") );
50 QVBoxLayout* lay = new QVBoxLayout( this ); 53 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
51 lay->setSpacing( 9 ); 54 lay->setSpacing( 9 );
52 lay->setMargin( 9 ); 55 lay->setMargin( 9 );
53 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 ); 56 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 );
54 lay->addWidget( lab ); 57 lay->addWidget( lab );
55 lab->setAlignment( AlignCenter ); 58 lab->setAlignment( Qt::AlignCenter );
56 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Printout Mode"), this ); 59 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Printout Mode"), this );
57 lay->addWidget( format ); 60 lay->addWidget( format );
58 format->setExclusive ( true ) ; 61 format->setExclusive ( true ) ;
59 pmNo = new QRadioButton(i18n("Print unscaled"), format ); 62 pmNo = new QRadioButton(i18n("Print unscaled"), format );
60 pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format ); 63 pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format );
61 new QRadioButton(i18n("Print scaled up/down to fit one page"), format ); 64 new QRadioButton(i18n("Print scaled up/down to fit one page"), format );
62 pmScaledDown->setChecked( true ); 65 pmScaledDown->setChecked( true );
63 QPushButton * ok = new QPushButton( i18n("OK"), this ); 66 QPushButton * ok = new QPushButton( i18n("OK"), this );
64 lay->addWidget( ok ); 67 lay->addWidget( ok );
65 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 68 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
66 lay->addWidget( cancel ); 69 lay->addWidget( cancel );
67 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 70 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
68 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 71 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
@@ -74,25 +77,25 @@ class KOPrintPrefs : public QDialog
74 return 0; 77 return 0;
75 if ( pmScaledDown->isChecked() ) 78 if ( pmScaledDown->isChecked() )
76 return 1; 79 return 1;
77 return 2; 80 return 2;
78 } 81 }
79private: 82private:
80 QRadioButton* pmNo; 83 QRadioButton* pmNo;
81 QRadioButton* pmScaledDown; 84 QRadioButton* pmScaledDown;
82}; 85};
83 86
84#endif 87#endif
85 88
86class KOEventViewer : public QTextBrowser { 89class KOEventViewer : public Q3TextBrowser {
87 Q_OBJECT 90 Q_OBJECT
88 public: 91 public:
89 KOEventViewer(QWidget *parent=0,const char *name=0); 92 KOEventViewer(QWidget *parent=0,const char *name=0);
90 virtual ~KOEventViewer(); 93 virtual ~KOEventViewer();
91 94
92 void setSource(const QString &); 95 void setSource(const QString &);
93 void setEvent(Event *event); 96 void setEvent(Event *event);
94 void addEvent(Event *event); 97 void addEvent(Event *event);
95 void setTodo(Todo *event, bool clearV = true ); 98 void setTodo(Todo *event, bool clearV = true );
96 void setJournal(Journal *jour, bool clearV = true ); 99 void setJournal(Journal *jour, bool clearV = true );
97 100
98 void appendEvent(Event *event, int mode = 0 ); 101 void appendEvent(Event *event, int mode = 0 );
@@ -108,25 +111,25 @@ class KOEventViewer : public QTextBrowser {
108 void printMe(); 111 void printMe();
109 112
110 protected: 113 protected:
111 int mColorMode; 114 int mColorMode;
112 void addTag(const QString & tag,const QString & text); 115 void addTag(const QString & tag,const QString & text);
113 116
114 void formatCategories(Incidence *event); 117 void formatCategories(Incidence *event);
115 void formatAttendees(Incidence *event); 118 void formatAttendees(Incidence *event);
116 void formatReadOnly(Incidence *event); 119 void formatReadOnly(Incidence *event);
117 void keyPressEvent ( QKeyEvent * e ); 120 void keyPressEvent ( QKeyEvent * e );
118 121
119 private: 122 private:
120 QTextBrowser *mEventTextView; 123 Q3TextBrowser *mEventTextView;
121 bool mSyncMode; 124 bool mSyncMode;
122 QString deTag(QString text); 125 QString deTag(QString text);
123 126
124 QString mText; 127 QString mText;
125 QString mMailSubject; 128 QString mMailSubject;
126 Incidence* mCurrentIncidence; 129 Incidence* mCurrentIncidence;
127 signals: 130 signals:
128 void launchaddressbook(QString uid); 131 void launchaddressbook(QString uid);
129 void showIncidence(QString uid); 132 void showIncidence(QString uid);
130}; 133};
131 134
132#endif 135#endif
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 2e936f3..3a37852 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -13,30 +13,33 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <klocale.h> 20#include <klocale.h>
21 21
22#include <libkcal/event.h> 22#include <libkcal/event.h>
23#include <qtimer.h> 23#include <qtimer.h>
24#include <qpushbutton.h> 24#include <qpushbutton.h>
25//Added by qt3to4:
26#include <QHideEvent>
27#include <QKeyEvent>
25 28
26#include "koeventviewer.h" 29#include "koeventviewer.h"
27#include <kmessagebox.h> 30#include <kmessagebox.h>
28#include "koprefs.h" 31#include "koprefs.h"
29#include <libkcal/todo.h> 32#include <libkcal/todo.h>
30#include "qapp.h" 33#include "qapplication.h"
31 34
32#include "koeventviewerdialog.h" 35#include "koeventviewerdialog.h"
33extern int globalFlagBlockAgenda; 36extern int globalFlagBlockAgenda;
34 37
35KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) 38KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name)
36 : KDialogBase(parent,name, 39 : KDialogBase(parent,name,
37#ifndef DESKTOP_VERSION 40#ifndef DESKTOP_VERSION
38 true , 41 true ,
39#else 42#else
40 false, 43 false,
41#endif 44#endif
42 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) 45 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda"))
diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h
index 71696f4..947c10b 100644
--- a/korganizer/koeventviewerdialog.h
+++ b/korganizer/koeventviewerdialog.h
@@ -13,25 +13,28 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19#ifndef KOEVENTVIEWERDIALOG_H 19#ifndef KOEVENTVIEWERDIALOG_H
20#define KOEVENTVIEWERDIALOG_H 20#define KOEVENTVIEWERDIALOG_H
21// 21//
22// Viewer dialog for events. 22// Viewer dialog for events.
23// 23//
24 24
25#include <qtextview.h> 25#include <q3textview.h>
26//Added by qt3to4:
27#include <QKeyEvent>
28#include <QHideEvent>
26 29
27#include <kdialogbase.h> 30#include <kdialogbase.h>
28 31
29#include <libkcal/event.h> 32#include <libkcal/event.h>
30 33
31using namespace KCal; 34using namespace KCal;
32 35
33class KOEventViewer; 36class KOEventViewer;
34 37
35class KOEventViewerDialog : public KDialogBase { 38class KOEventViewerDialog : public KDialogBase {
36 Q_OBJECT 39 Q_OBJECT
37 public: 40 public:
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index ee9c9f6..8335ba9 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -18,46 +18,50 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qcombobox.h> 25#include <qcombobox.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qdialog.h> 29#include <qdialog.h>
30#include <qtextstream.h> 30#include <q3textstream.h>
31#include <qtextcodec.h> 31#include <qtextcodec.h>
32#include <qwhatsthis.h> 32#include <q3whatsthis.h>
33#include <qdir.h> 33#include <qdir.h>
34//Added by qt3to4:
35#include <Q3GridLayout>
36#include <Q3Frame>
37#include <Q3PtrList>
34 38
35 39
36#include <libkcal/calfilter.h> 40#include <libkcal/calfilter.h>
37 41
38#include "kofilterview.h" 42#include "kofilterview.h"
39#include "koprefs.h" 43#include "koprefs.h"
40#include <kiconloader.h> 44#include <kiconloader.h>
41#include <kglobal.h> 45#include <kglobal.h>
42#include <kglobalsettings.h> 46#include <kglobalsettings.h>
43#include <kcolorbutton.h> 47#include <kcolorbutton.h>
44#include <kmessagebox.h> 48#include <kmessagebox.h>
45 49
46 50
47 51
48 52
49 53
50KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent, 54KOFilterView::KOFilterView(Q3PtrList<CalFilter> *filterList,QWidget* parent,
51 const char* name,WFlags fl ) 55 const char* name,Qt::WFlags fl )
52 : KOFilterView_base(parent,name,fl) 56 : KOFilterView_base(parent,name,fl)
53{ 57{
54 mFilters = filterList; 58 mFilters = filterList;
55 59
56 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged())); 60 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged()));
57 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged())); 61 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged()));
58 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters())); 62 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters()));
59} 63}
60 64
61KOFilterView::~KOFilterView() 65KOFilterView::~KOFilterView()
62{ 66{
63 // no need to delete child widgets, Qt does it all for us 67 // no need to delete child widgets, Qt does it all for us
@@ -105,32 +109,32 @@ void KOFilterView::setSelectedFilter(QString filterName)
105void KOFilterView::setSelectedFilter( int fil ) 109void KOFilterView::setSelectedFilter( int fil )
106{ 110{
107 if ( fil >= mSelectionCombo->count() ) 111 if ( fil >= mSelectionCombo->count() )
108 return; 112 return;
109 mSelectionCombo->setCurrentItem( fil ); 113 mSelectionCombo->setCurrentItem( fil );
110 emit filterChanged(); 114 emit filterChanged();
111} 115}
112 116
113 117
114 118
115KOCalEditView::KOCalEditView(QWidget* parent, 119KOCalEditView::KOCalEditView(QWidget* parent,
116 const char* name ) 120 const char* name )
117 : QScrollView(parent,name) 121 : Q3ScrollView(parent,name)
118{ 122{
119 mw = 0; 123 mw = 0;
120 setResizePolicy( AutoOneFit ); 124 setResizePolicy( AutoOneFit );
121 setFrameStyle ( QFrame::Panel | QFrame::Plain ); 125 setFrameStyle ( Q3Frame::Panel | Q3Frame::Plain );
122 setLineWidth ( 1 ); 126 setLineWidth ( 1 );
123 setMidLineWidth ( 1 ); 127 setMidLineWidth ( 1 );
124 setFocusPolicy(NoFocus); 128 setFocusPolicy(Qt::NoFocus);
125} 129}
126 130
127KOCalEditView::~KOCalEditView() 131KOCalEditView::~KOCalEditView()
128{ 132{
129 // no need to delete child widgets, Qt does it all for us 133 // no need to delete child widgets, Qt does it all for us
130} 134}
131void KOCalEditView::selectCal(int id ,bool b) 135void KOCalEditView::selectCal(int id ,bool b)
132{ 136{
133 KOPrefs::instance()->getCalendar( id )->isEnabled = b; 137 KOPrefs::instance()->getCalendar( id )->isEnabled = b;
134 emit calendarEnabled ( id, b ); 138 emit calendarEnabled ( id, b );
135 emit needsUpdate(); 139 emit needsUpdate();
136 140
@@ -238,73 +242,73 @@ void KOCalEditView::infoCal( int id )
238void KOCalEditView::readConfig() 242void KOCalEditView::readConfig()
239{ 243{
240 244
241 mStdandardB.clear(); 245 mStdandardB.clear();
242 mEnabledB.clear(); 246 mEnabledB.clear();
243 mAlarmB.clear(); 247 mAlarmB.clear();
244 mROB.clear(); 248 mROB.clear();
245 249
246 if ( mw ) delete mw; 250 if ( mw ) delete mw;
247 mw = new QWidget ( viewport() ); 251 mw = new QWidget ( viewport() );
248 addChild(mw); 252 addChild(mw);
249 int ii = 0; 253 int ii = 0;
250 mainLayout = new QGridLayout ( mw , 2, 8 ); 254 mainLayout = new Q3GridLayout ( mw , 2, 8 );
251 mainLayout->setMargin( 2 ); 255 mainLayout->setMargin( 2 );
252 mainLayout->setSpacing( 2 ); 256 mainLayout->setSpacing( 2 );
253 QPushButton * addButT = new QPushButton ( mw ); 257 QPushButton * addButT = new QPushButton ( mw );
254 addButT->setFocusPolicy(NoFocus); 258 addButT->setFocusPolicy(Qt::NoFocus);
255 mainLayout->addWidget( addButT,0,0 ); 259 mainLayout->addWidget( addButT,0,0 );
256 addButT->setText( "D"); 260 addButT->setText( "D");
257 connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo())); 261 connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo()));
258 QWhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); 262 Q3WhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") );
259 //addBut->setPixmap ( SmallIcon("greenhook16")); 263 //addBut->setPixmap ( SmallIcon("greenhook16"));
260 QPushButton *addBut = new QPushButton ( mw ); 264 QPushButton *addBut = new QPushButton ( mw );
261 addBut->setFocusPolicy(NoFocus); 265 addBut->setFocusPolicy(Qt::NoFocus);
262 mainLayout->addWidget( addBut,0,++ii ); 266 mainLayout->addWidget( addBut,0,++ii );
263 addBut->setPixmap ( SmallIcon("eye")); 267 addBut->setPixmap ( SmallIcon("eye"));
264 QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar to be visible</b>. 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.") ); 268 Q3WhatsThis::add( addBut, i18n("In this column you can <b>set a calendar to be visible</b>. 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.") );
265 connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); 269 connect(addBut,SIGNAL(clicked()),SLOT(enableAll()));
266 int max = addBut->sizeHint().height(); 270 int max = addBut->sizeHint().height();
267 addBut->setMaximumWidth( max ); 271 addBut->setMaximumWidth( max );
268 addButT->setFixedSize( QSize( max, max ) ); 272 addButT->setFixedSize( QSize( max, max ) );
269 QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); 273 QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw );
270 mainLayout->addWidget( lab,0,++ii ); 274 mainLayout->addWidget( lab,0,++ii );
271 QWhatsThis::add( lab, i18n("In this column you can see the <b>name of the calendar</b>. 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.") ); 275 Q3WhatsThis::add( lab, i18n("In this column you can see the <b>name of the calendar</b>. 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.") );
272 //lab = new QLabel ( i18n(" "), mw ); 276 //lab = new QLabel ( i18n(" "), mw );
273 //mainLayout->addWidget( lab,0,++ii ); 277 //mainLayout->addWidget( lab,0,++ii );
274 //lab->setFixedWidth( 1 ); 278 //lab->setFixedWidth( 1 );
275 addBut = new QPushButton ( mw ); 279 addBut = new QPushButton ( mw );
276 addBut->setFocusPolicy(NoFocus); 280 addBut->setFocusPolicy(Qt::NoFocus);
277 mainLayout->addWidget( addBut,0,++ii ); 281 mainLayout->addWidget( addBut,0,++ii );
278 addBut->setPixmap ( SmallIcon("bell")); 282 addBut->setPixmap ( SmallIcon("bell"));
279 QWhatsThis::add( addBut, i18n("In this column you can <b>disable the alarms of a calendar all together</b>. 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.") ); 283 Q3WhatsThis::add( addBut, i18n("In this column you can <b>disable the alarms of a calendar all together</b>. 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.") );
280 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); 284 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm()));
281 addBut->setMaximumWidth( addBut->sizeHint().height() ); 285 addBut->setMaximumWidth( addBut->sizeHint().height() );
282 286
283 addBut = new QPushButton ( mw ); 287 addBut = new QPushButton ( mw );
284 addBut->setFocusPolicy(NoFocus); 288 addBut->setFocusPolicy(Qt::NoFocus);
285 mainLayout->addWidget( addBut,0,++ii ); 289 mainLayout->addWidget( addBut,0,++ii );
286 addBut->setPixmap ( SmallIcon("pencil")); 290 addBut->setPixmap ( SmallIcon("pencil"));
287 QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar and all entries of the calendar to read only</b>. 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.") ); 291 Q3WhatsThis::add( addBut, i18n("In this column you can <b>set a calendar and all entries of the calendar to read only</b>. 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.") );
288 connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); 292 connect(addBut,SIGNAL(clicked()),SLOT(disableRO()));
289 addBut->setMaximumWidth( addBut->sizeHint().height() ); 293 addBut->setMaximumWidth( addBut->sizeHint().height() );
290 lab = new QLabel ( "", mw ); 294 lab = new QLabel ( "", mw );
291 mainLayout->addWidget( lab,0,++ii ); 295 mainLayout->addWidget( lab,0,++ii );
292 296
293 addBut = new QPushButton ( mw ); 297 addBut = new QPushButton ( mw );
294 addBut->setFocusPolicy(NoFocus); 298 addBut->setFocusPolicy(Qt::NoFocus);
295 mainLayout->addWidget( addBut,0,++ii ); 299 mainLayout->addWidget( addBut,0,++ii );
296 addBut->setPixmap ( SmallIcon("plus")); 300 addBut->setPixmap ( SmallIcon("plus"));
297 connect(addBut,SIGNAL(clicked()),SLOT(addCal())); 301 connect(addBut,SIGNAL(clicked()),SLOT(addCal()));
298 QWhatsThis::add( addBut, i18n("Click this button to <b>add a calendar</b>. 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.") ); 302 Q3WhatsThis::add( addBut, i18n("Click this button to <b>add a calendar</b>. 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.") );
299 lab = new QLabel ( " ", mw ); 303 lab = new QLabel ( " ", mw );
300 mainLayout->addWidget( lab,0,++ii ); 304 mainLayout->addWidget( lab,0,++ii );
301 305
302 306
303 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 307 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
304 int row = 1; 308 int row = 1;
305 bool errorLoadStandard = false; 309 bool errorLoadStandard = false;
306 while ( kkf ) { 310 while ( kkf ) {
307 int iii = 0; 311 int iii = 0;
308 KOCalRadioButton* rb = new KOCalRadioButton( mw ); 312 KOCalRadioButton* rb = new KOCalRadioButton( mw );
309 mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb ); 313 mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb );
310 rb->setChecked( kkf->isStandard ); 314 rb->setChecked( kkf->isStandard );
@@ -422,29 +426,29 @@ int KOCalEditView::addCalendar( QString name, QString file, bool ask )
422 QString cd = QDir::convertSeparators( KGlobalSettings::calendarDir() ); 426 QString cd = QDir::convertSeparators( KGlobalSettings::calendarDir() );
423 if ( file.left( cd.length() ) == cd ) { 427 if ( file.left( cd.length() ) == cd ) {
424 isRelative = true; 428 isRelative = true;
425 file = fi.fileName (); 429 file = fi.fileName ();
426 fi.setFile( absFile ); 430 fi.setFile( absFile );
427 } 431 }
428 } 432 }
429 if (!fi.exists() ) { 433 if (!fi.exists() ) {
430 if ( ask ) 434 if ( ask )
431 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 ) 435 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 )
432 return 0; 436 return 0;
433 QFile fileIn( absFile ); 437 QFile fileIn( absFile );
434 if (!fileIn.open( IO_WriteOnly ) ) { 438 if (!fileIn.open( QIODevice::WriteOnly ) ) {
435 KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); 439 KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) );
436 return 0; 440 return 0;
437 } 441 }
438 QTextStream tsIn( &fileIn ); 442 Q3TextStream tsIn( &fileIn );
439 tsIn.setCodec( QTextCodec::codecForName("utf8") ); 443 tsIn.setCodec( QTextCodec::codecForName("utf8") );
440 tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n"; 444 tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n";
441 fileIn.close(); 445 fileIn.close();
442 } 446 }
443 KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); 447 KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar();
444 kkf->mName = name; 448 kkf->mName = name;
445 kkf->mFileName = absFile; 449 kkf->mFileName = absFile;
446 kkf->mSavedFileName = file; 450 kkf->mSavedFileName = file;
447 kkf->isRelative = isRelative; 451 kkf->isRelative = isRelative;
448 emit calendarAdded( kkf->mCalNumber ); 452 emit calendarAdded( kkf->mCalNumber );
449 if ( ask ) 453 if ( ask )
450 emit needsUpdate(); 454 emit needsUpdate();
@@ -466,25 +470,25 @@ int KOCalEditView::getBirtdayID()
466void KOCalEditView::enableAll() 470void KOCalEditView::enableAll()
467{ 471{
468 toggleList( mEnabledB ); 472 toggleList( mEnabledB );
469} 473}
470void KOCalEditView::enableAlarm() 474void KOCalEditView::enableAlarm()
471{ 475{
472 toggleList( mAlarmB ); 476 toggleList( mAlarmB );
473} 477}
474void KOCalEditView::disableRO() 478void KOCalEditView::disableRO()
475{ 479{
476 toggleList( mROB, false ); 480 toggleList( mROB, false );
477} 481}
478void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list , bool enable ) 482void KOCalEditView::toggleList ( Q3PtrList<KOCalCheckButton> list , bool enable )
479{ 483{
480 bool dis = !enable; 484 bool dis = !enable;
481 KOCalCheckButton* it = list.first(); 485 KOCalCheckButton* it = list.first();
482 while ( it ) { 486 while ( it ) {
483 if ( !it->isChecked() == enable && it->isEnabled() ) { 487 if ( !it->isChecked() == enable && it->isEnabled() ) {
484 dis = !dis; 488 dis = !dis;
485 break; 489 break;
486 } 490 }
487 it = list.next(); 491 it = list.next();
488 } 492 }
489 it = list.first(); 493 it = list.first();
490 while ( it ) { 494 while ( it ) {
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index 0dd423a..f1bbab4 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -17,53 +17,59 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOFILTERVIEW_H 23#ifndef KOFILTERVIEW_H
24#define KOFILTERVIEW_H 24#define KOFILTERVIEW_H
25 25
26#include <qstring.h> 26#include <qstring.h>
27#include <qcheckbox.h> 27#include <qcheckbox.h>
28#include <qapplication.h> 28#include <qapplication.h>
29#include <QDesktopWidget>
29#include <qradiobutton.h> 30#include <qradiobutton.h>
30#include <qlayout.h> 31#include <qlayout.h>
31#include <qlabel.h> 32#include <qlabel.h>
32#include <qdialog.h> 33#include <qdialog.h>
33#include <qscrollview.h> 34#include <q3scrollview.h>
34#include <qpushbutton.h> 35#include <qpushbutton.h>
36//Added by qt3to4:
37#include <Q3GridLayout>
38#include <Q3PtrList>
39#include <QKeyEvent>
40#include <Q3VBoxLayout>
35#include <kconfig.h> 41#include <kconfig.h>
36#include "kofilterview_base.h" 42#include "kofilterview_base.h"
37 43
38#include <libkcal/calfilter.h> 44#include <libkcal/calfilter.h>
39 45
40#include <kurlrequester.h> 46#include <kurlrequester.h>
41#include <klineedit.h> 47#include <klineedit.h>
42#include <kglobal.h> 48#include <kglobal.h>
43#include <kmessagebox.h> 49#include <kmessagebox.h>
44 50
45class QGridLayout; 51class Q3GridLayout;
46 52
47using namespace KCal; 53using namespace KCal;
48 54
49class KONewCalPrefs : public QDialog 55class KONewCalPrefs : public QDialog
50{ 56{
51 Q_OBJECT 57 Q_OBJECT
52 public: 58 public:
53 KONewCalPrefs( QWidget *parent=0, const char *name=0 ) : 59 KONewCalPrefs( QWidget *parent=0, const char *name=0 ) :
54 QDialog( parent, name, true ) 60 QDialog( parent, name, true )
55 { 61 {
56 setCaption( i18n("Add new Calendar") ); 62 setCaption( i18n("Add new Calendar") );
57 QVBoxLayout* lay = new QVBoxLayout( this ); 63 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
58 lay->setSpacing( 3 ); 64 lay->setSpacing( 3 );
59 lay->setMargin( 3 ); 65 lay->setMargin( 3 );
60 QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this ); 66 QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this );
61 lay->addWidget( lab ); 67 lay->addWidget( lab );
62 nameE = new KLineEdit( this ); 68 nameE = new KLineEdit( this );
63 lay->addWidget( nameE ); 69 lay->addWidget( nameE );
64 lab = new QLabel( i18n("<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)"), this ); 70 lab = new QLabel( i18n("<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)"), this );
65 lay->addWidget( lab ); 71 lay->addWidget( lab );
66 url = new KURLRequester ( this ); 72 url = new KURLRequester ( this );
67 lay->addWidget( url ); 73 lay->addWidget( url );
68 QPushButton * ok = new QPushButton( i18n("OK"), this ); 74 QPushButton * ok = new QPushButton( i18n("OK"), this );
69 lay->addWidget( ok ); 75 lay->addWidget( ok );
@@ -101,50 +107,50 @@ public:
101}; 107};
102 108
103class KOCalButton : public QPushButton 109class KOCalButton : public QPushButton
104{ 110{
105 Q_OBJECT 111 Q_OBJECT
106 public: 112 public:
107 KOCalButton( QWidget *parent=0, const char *name=0 ) : 113 KOCalButton( QWidget *parent=0, const char *name=0 ) :
108 QPushButton( parent, name) 114 QPushButton( parent, name)
109 { 115 {
110 connect( this, SIGNAL( clicked() ), 116 connect( this, SIGNAL( clicked() ),
111 SLOT( bottonClicked() )); 117 SLOT( bottonClicked() ));
112 mNumber = -1; 118 mNumber = -1;
113 setFocusPolicy(NoFocus); 119 setFocusPolicy(Qt::NoFocus);
114 } 120 }
115 void setNum ( int num ) {mNumber = num; } 121 void setNum ( int num ) {mNumber = num; }
116 signals: 122 signals:
117 void selectNum ( int ); 123 void selectNum ( int );
118private: 124private:
119 int mNumber; 125 int mNumber;
120 void keyPressEvent ( QKeyEvent * e ) 126 void keyPressEvent ( QKeyEvent * e )
121 { 127 {
122 e->ignore(); 128 e->ignore();
123 } 129 }
124 130
125private slots : 131private slots :
126 void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); } 132 void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); }
127}; 133};
128class KOCalCheckButton : public QCheckBox 134class KOCalCheckButton : public QCheckBox
129{ 135{
130 Q_OBJECT 136 Q_OBJECT
131 public: 137 public:
132 KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : 138 KOCalCheckButton( QWidget *parent=0, const char *name=0 ) :
133 QCheckBox( parent, name) 139 QCheckBox( parent, name)
134 { 140 {
135 connect( this, SIGNAL( toggled ( bool ) ), 141 connect( this, SIGNAL( toggled ( bool ) ),
136 SLOT( bottonClicked( bool ) )); 142 SLOT( bottonClicked( bool ) ));
137 mNumber = -1; 143 mNumber = -1;
138 setFocusPolicy(NoFocus); 144 setFocusPolicy(Qt::NoFocus);
139 //setMaximumWidth( 10 ); 145 //setMaximumWidth( 10 );
140 146
141 } 147 }
142 void setNum ( int num ) {mNumber = num; } 148 void setNum ( int num ) {mNumber = num; }
143 signals: 149 signals:
144 void selectNum ( int, bool ); 150 void selectNum ( int, bool );
145private: 151private:
146 int mNumber; 152 int mNumber;
147 void keyPressEvent ( QKeyEvent * e ) 153 void keyPressEvent ( QKeyEvent * e )
148 { 154 {
149 e->ignore(); 155 e->ignore();
150 } 156 }
@@ -154,69 +160,69 @@ private slots :
154}; 160};
155 161
156class KOCalRadioButton : public QRadioButton 162class KOCalRadioButton : public QRadioButton
157{ 163{
158 Q_OBJECT 164 Q_OBJECT
159 public: 165 public:
160 KOCalRadioButton( QWidget *parent=0, const char *name=0 ) : 166 KOCalRadioButton( QWidget *parent=0, const char *name=0 ) :
161 QRadioButton( parent, name) 167 QRadioButton( parent, name)
162 { 168 {
163 connect( this, SIGNAL( toggled ( bool ) ), 169 connect( this, SIGNAL( toggled ( bool ) ),
164 SLOT( bottonClicked( bool ) )); 170 SLOT( bottonClicked( bool ) ));
165 mNumber = -1; 171 mNumber = -1;
166 setFocusPolicy(NoFocus); 172 setFocusPolicy(Qt::NoFocus);
167 //setMaximumWidth( 10 ); 173 //setMaximumWidth( 10 );
168 174
169 } 175 }
170 int num() { return mNumber;} 176 int num() { return mNumber;}
171 void setNum ( int num ) {mNumber = num; } 177 void setNum ( int num ) {mNumber = num; }
172 signals: 178 signals:
173 void selectNum ( int ); 179 void selectNum ( int );
174private: 180private:
175 int mNumber; 181 int mNumber;
176 void keyPressEvent ( QKeyEvent * e ) 182 void keyPressEvent ( QKeyEvent * e )
177 { 183 {
178 e->ignore(); 184 e->ignore();
179 } 185 }
180 186
181private slots : 187private slots :
182 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber); } 188 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber); }
183}; 189};
184 190
185 191
186 192
187class KOFilterView : public KOFilterView_base 193class KOFilterView : public KOFilterView_base
188{ 194{
189 Q_OBJECT 195 Q_OBJECT
190 public: 196 public:
191 KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); 197 KOFilterView(Q3PtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, Qt::WFlags fl=0);
192 ~KOFilterView(); 198 ~KOFilterView();
193 199
194 void updateFilters(); 200 void updateFilters();
195 201
196 bool filtersEnabled(); 202 bool filtersEnabled();
197 void setFiltersEnabled(bool); 203 void setFiltersEnabled(bool);
198 CalFilter *selectedFilter(); 204 CalFilter *selectedFilter();
199 void setSelectedFilter(QString); 205 void setSelectedFilter(QString);
200 void setSelectedFilter( int ); 206 void setSelectedFilter( int );
201 207
202 signals: 208 signals:
203 void filterChanged(); 209 void filterChanged();
204 void editFilters(); 210 void editFilters();
205 211
206 private: 212 private:
207 QPtrList<CalFilter> *mFilters; 213 Q3PtrList<CalFilter> *mFilters;
208}; 214};
209 215
210class KOCalEditView : public QScrollView 216class KOCalEditView : public Q3ScrollView
211{ 217{
212 Q_OBJECT 218 Q_OBJECT
213 public: 219 public:
214 KOCalEditView( QWidget* parent=0,const char* name=0); 220 KOCalEditView( QWidget* parent=0,const char* name=0);
215 ~KOCalEditView(); 221 ~KOCalEditView();
216 int addCalendar( QString calName, QString fileName, bool ask = true ); 222 int addCalendar( QString calName, QString fileName, bool ask = true );
217 int getBirtdayID(); 223 int getBirtdayID();
218 public slots: 224 public slots:
219 void addCal(); 225 void addCal();
220 void enableAll(); 226 void enableAll();
221 void enableAlarm(); 227 void enableAlarm();
222 void disableRO(); 228 void disableRO();
@@ -235,23 +241,23 @@ class KOCalEditView : public QScrollView
235 void alarmEnabled ( int cal, bool enable ); 241 void alarmEnabled ( int cal, bool enable );
236 void calendarEnabled ( int cal, bool enable ); 242 void calendarEnabled ( int cal, bool enable );
237 void calendarReadonly ( int cal, bool readonly ); 243 void calendarReadonly ( int cal, bool readonly );
238 void setCalendarDefault ( int cal ); 244 void setCalendarDefault ( int cal );
239 void removeCalendar ( int cal ); 245 void removeCalendar ( int cal );
240 void calendarAdded( int ); 246 void calendarAdded( int );
241 void needsUpdate(); 247 void needsUpdate();
242 void checkCalendar(); 248 void checkCalendar();
243 void requestCalendarInfo( int id ); 249 void requestCalendarInfo( int id );
244 250
245 private: 251 private:
246 QWidget *mw; 252 QWidget *mw;
247 void toggleList ( QPtrList<KOCalCheckButton> , bool b = true ); 253 void toggleList ( Q3PtrList<KOCalCheckButton> , bool b = true );
248 QPtrList<KOCalRadioButton> mStdandardB; 254 Q3PtrList<KOCalRadioButton> mStdandardB;
249 QPtrList<KOCalCheckButton> mEnabledB; 255 Q3PtrList<KOCalCheckButton> mEnabledB;
250 QPtrList<KOCalCheckButton> mAlarmB; 256 Q3PtrList<KOCalCheckButton> mAlarmB;
251 QPtrList<KOCalCheckButton> mROB; 257 Q3PtrList<KOCalCheckButton> mROB;
252 QGridLayout* mainLayout; 258 Q3GridLayout* mainLayout;
253}; 259};
254 260
255 261
256 262
257#endif // KOFILTERVIEW_H 263#endif // KOFILTERVIEW_H
diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp
index 79b97e8..63d044c 100644
--- a/korganizer/koimportoldialog.cpp
+++ b/korganizer/koimportoldialog.cpp
@@ -13,38 +13,38 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qframe.h> 25#include <q3frame.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qprogressbar.h> 28#include <q3progressbar.h>
29#include <qprogressdialog.h> 29#include <q3progressdialog.h>
30#include <qwidgetstack.h> 30#include <q3widgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qdir.h> 32#include <qdir.h>
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qhbox.h> 34#include <q3hbox.h>
35#include <qregexp.h> 35#include <qregexp.h>
36#include <qheader.h> 36#include <q3header.h>
37#include <qdatetime.h> 37#include <qdatetime.h>
38#include <qlistview.h> 38#include <q3listview.h>
39 39
40#include <kdebug.h> 40#include <kdebug.h>
41#include <klocale.h> 41#include <klocale.h>
42#include <kstandarddirs.h> 42#include <kstandarddirs.h>
43#include <kmessagebox.h> 43#include <kmessagebox.h>
44#include <kfiledialog.h> 44#include <kfiledialog.h>
45 45
46#include <libkdepim/categoryselectdialog.h> 46#include <libkdepim/categoryselectdialog.h>
47#include <libkdepim/kinputdialog.h> 47#include <libkdepim/kinputdialog.h>
48 48
49#include <libkcal/calendarlocal.h> 49#include <libkcal/calendarlocal.h>
50#include <libkcal/icalformat.h> 50#include <libkcal/icalformat.h>
@@ -61,46 +61,46 @@
61_Application gOlApp; 61_Application gOlApp;
62 62
63QDateTime mDdate2Qdtr( DATE dt) 63QDateTime mDdate2Qdtr( DATE dt)
64{ 64{
65 COleDateTime odt; 65 COleDateTime odt;
66 SYSTEMTIME st; 66 SYSTEMTIME st;
67 odt = dt; 67 odt = dt;
68 odt.GetAsSystemTime(st); 68 odt.GetAsSystemTime(st);
69 QDateTime qdt (QDate(st.wYear, st.wMonth,st.wDay ),QTime( st.wHour, st.wMinute,st.wSecond ) ); 69 QDateTime qdt (QDate(st.wYear, st.wMonth,st.wDay ),QTime( st.wHour, st.wMinute,st.wSecond ) );
70 return qdt; 70 return qdt;
71} 71}
72 72
73class OLEListViewItem : public QCheckListItem 73class OLEListViewItem : public Q3CheckListItem
74{ 74{
75 public: 75 public:
76 OLEListViewItem( QListView *parent, QString text ) : 76 OLEListViewItem( Q3ListView *parent, QString text ) :
77 QCheckListItem( parent, text, QCheckListItem::CheckBox ) { mData = 0; }; 77 Q3CheckListItem( parent, text, Q3CheckListItem::CheckBox ) { mData = 0; };
78 OLEListViewItem( QListViewItem *after, QString text ) : 78 OLEListViewItem( Q3ListViewItem *after, QString text ) :
79 QCheckListItem( after, text, QCheckListItem::CheckBox ) { mData = 0; }; 79 Q3CheckListItem( after, text, Q3CheckListItem::CheckBox ) { mData = 0; };
80 ~OLEListViewItem() {}; 80 ~OLEListViewItem() {};
81 void setData( DWORD data ) {mData= data; }; 81 void setData( DWORD data ) {mData= data; };
82 DWORD data() { return mData ;}; 82 DWORD data() { return mData ;};
83 private: 83 private:
84 DWORD mData; 84 DWORD mData;
85}; 85};
86 86
87KOImportOLdialog::KOImportOLdialog( const QString &caption, 87KOImportOLdialog::KOImportOLdialog( const QString &caption,
88 Calendar *calendar, QWidget *parent ) : 88 Calendar *calendar, QWidget *parent ) :
89 KDialogBase( Plain, caption, User1 | Close, Ok, 89 KDialogBase( Plain, caption, User1 | Close, Ok,
90 parent, caption, true, false, i18n("Import!") ) 90 parent, caption, true, false, i18n("Import!") )
91{ 91{
92 QHBox * mw = new QHBox( this ); 92 Q3HBox * mw = new Q3HBox( this );
93 setMainWidget( mw ); 93 setMainWidget( mw );
94 mListView = new QListView( mw ); 94 mListView = new Q3ListView( mw );
95 mListView->addColumn(i18n("Select Folder to import")); 95 mListView->addColumn(i18n("Select Folder to import"));
96 mListView->addColumn(i18n("Content Type")); 96 mListView->addColumn(i18n("Content Type"));
97 mCalendar = calendar; 97 mCalendar = calendar;
98 connect( this, SIGNAL( user1Clicked() ),SLOT ( slotApply())); 98 connect( this, SIGNAL( user1Clicked() ),SLOT ( slotApply()));
99 setupFolderView(); 99 setupFolderView();
100 resize( sizeHint().width()+50, sizeHint().height()+50 ); 100 resize( sizeHint().width()+50, sizeHint().height()+50 );
101} 101}
102 102
103KOImportOLdialog::~KOImportOLdialog() 103KOImportOLdialog::~KOImportOLdialog()
104{ 104{
105 105
106} 106}
@@ -203,25 +203,25 @@ void KOImportOLdialog::slotApply()
203void KOImportOLdialog::readCalendarData( DWORD folder ) 203void KOImportOLdialog::readCalendarData( DWORD folder )
204{ 204{
205 205
206 LPDISPATCH dispItem = (LPDISPATCH)folder; 206 LPDISPATCH dispItem = (LPDISPATCH)folder;
207 dispItem->AddRef(); 207 dispItem->AddRef();
208 MAPIFolder mf(dispItem); 208 MAPIFolder mf(dispItem);
209 mf.m_lpDispatch->AddRef(); 209 mf.m_lpDispatch->AddRef();
210 _Items folderItems; 210 _Items folderItems;
211 _variant_t indx((long)0); 211 _variant_t indx((long)0);
212 LPDISPATCH itm; 212 LPDISPATCH itm;
213 int i; 213 int i;
214 folderItems = mf.GetItems(); 214 folderItems = mf.GetItems();
215 QProgressDialog bar( i18n("Importing calendar data"),i18n("Abort"), folderItems.GetCount(),this ); 215 Q3ProgressDialog bar( i18n("Importing calendar data"),i18n("Abort"), folderItems.GetCount(),this );
216 bar.setCaption (i18n("Importing!") ); 216 bar.setCaption (i18n("Importing!") );
217 int h = bar.sizeHint().height() ; 217 int h = bar.sizeHint().height() ;
218 int w = 300; 218 int w = 300;
219 int dw = QApplication::desktop()->width(); 219 int dw = QApplication::desktop()->width();
220 int dh = QApplication::desktop()->height(); 220 int dh = QApplication::desktop()->height();
221 //bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 221 //bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
222 bar.show(); 222 bar.show();
223 for(i=1; i <= folderItems.GetCount(); ++i) 223 for(i=1; i <= folderItems.GetCount(); ++i)
224 { 224 {
225 qApp->processEvents(); 225 qApp->processEvents();
226 if ( ! bar.isVisible() ) 226 if ( ! bar.isVisible() )
227 return ; 227 return ;
diff --git a/korganizer/koimportoldialog.h b/korganizer/koimportoldialog.h
index c8847c5..d66f099 100644
--- a/korganizer/koimportoldialog.h
+++ b/korganizer/koimportoldialog.h
@@ -22,25 +22,25 @@
22*/ 22*/
23#ifndef KOINCIDENCEEDITOR_H 23#ifndef KOINCIDENCEEDITOR_H
24#define KOINCIDENCEEDITOR_H 24#define KOINCIDENCEEDITOR_H
25 25
26#include <kdialogbase.h> 26#include <kdialogbase.h>
27 27
28#include <afxdisp.h> 28#include <afxdisp.h>
29#include <libkcal/calendar.h> 29#include <libkcal/calendar.h>
30#include <libkcal/event.h> 30#include <libkcal/event.h>
31 31
32 32
33class QDateTime; 33class QDateTime;
34class QListView; 34class Q3ListView;
35class OLEListViewItem; 35class OLEListViewItem;
36class _AppointmentItem; 36class _AppointmentItem;
37namespace KPIM { class CategorySelectDialog; } 37namespace KPIM { class CategorySelectDialog; }
38 38
39using namespace KCal; 39using namespace KCal;
40 40
41/** 41/**
42 This is the base class for the calendar component editors. 42 This is the base class for the calendar component editors.
43*/ 43*/
44class KOImportOLdialog : public KDialogBase 44class KOImportOLdialog : public KDialogBase
45{ 45{
46 Q_OBJECT 46 Q_OBJECT
@@ -63,22 +63,22 @@ class KOImportOLdialog : public KDialogBase
63 protected slots: 63 protected slots:
64 void slotApply(); 64 void slotApply();
65 void slotOk(); 65 void slotOk();
66 void slotCancel(); 66 void slotCancel();
67 67
68 protected: 68 protected:
69 void setupFolderView(); 69 void setupFolderView();
70 void addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent); 70 void addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent);
71 void readCalendarData( DWORD folder ); 71 void readCalendarData( DWORD folder );
72 void ol2kopiCalendar( _AppointmentItem * , bool computeRecurrence = true ); 72 void ol2kopiCalendar( _AppointmentItem * , bool computeRecurrence = true );
73 73
74 Calendar *mCalendar; 74 Calendar *mCalendar;
75 QListView * mListView; 75 Q3ListView * mListView;
76 QString getUidByEmail( QString email ); 76 QString getUidByEmail( QString email );
77 77
78 private: 78 private:
79 int importedItems; 79 int importedItems;
80}; 80};
81 81
82#endif 82#endif
83 83
84 84
diff --git a/korganizer/koincidenceeditor.cpp b/korganizer/koincidenceeditor.cpp
index 236f6f9..2060ea1 100644
--- a/korganizer/koincidenceeditor.cpp
+++ b/korganizer/koincidenceeditor.cpp
@@ -13,30 +13,32 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qframe.h> 25#include <q3frame.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qwidgetstack.h> 28#include <q3widgetstack.h>
29#include <qdatetime.h> 29#include <qdatetime.h>
30#include <qdir.h> 30#include <qdir.h>
31//Added by qt3to4:
32#include <Q3VBoxLayout>
31 33
32#include <kdebug.h> 34#include <kdebug.h>
33#include <klocale.h> 35#include <klocale.h>
34#include <kstandarddirs.h> 36#include <kstandarddirs.h>
35#include <kmessagebox.h> 37#include <kmessagebox.h>
36#include <kfiledialog.h> 38#include <kfiledialog.h>
37 39
38#include <libkdepim/categoryselectdialog.h> 40#include <libkdepim/categoryselectdialog.h>
39#include <libkdepim/kinputdialog.h> 41#include <libkdepim/kinputdialog.h>
40 42
41#include <libkcal/calendarlocal.h> 43#include <libkcal/calendarlocal.h>
42#include <libkcal/icalformat.h> 44#include <libkcal/icalformat.h>
@@ -73,27 +75,27 @@ KOIncidenceEditor::KOIncidenceEditor( const QString &caption,
73 //connect( this, SIGNAL( defaultClicked() ), SLOT( slotLoadTemplate() ) ); 75 //connect( this, SIGNAL( defaultClicked() ), SLOT( slotLoadTemplate() ) );
74 // connect( this, SIGNAL( user1Clicked() ), SLOT( slotSaveTemplate() ) ); 76 // connect( this, SIGNAL( user1Clicked() ), SLOT( slotSaveTemplate() ) );
75 connect( this, SIGNAL( user1Clicked() ), SLOT( slotShowIncidence() ) ); 77 connect( this, SIGNAL( user1Clicked() ), SLOT( slotShowIncidence() ) );
76} 78}
77 79
78KOIncidenceEditor::~KOIncidenceEditor() 80KOIncidenceEditor::~KOIncidenceEditor()
79{ 81{
80 //delete mCategoryDialog; 82 //delete mCategoryDialog;
81} 83}
82 84
83void KOIncidenceEditor::setupAttendeesTab() 85void KOIncidenceEditor::setupAttendeesTab()
84{ 86{
85 QFrame *topFrame = addPage(i18n("Attendees")); 87 Q3Frame *topFrame = addPage(i18n("Attendees"));
86 88
87 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 89 Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
88 90
89 mDetails = new KOEditorDetails(spacingHint()-2,topFrame); 91 mDetails = new KOEditorDetails(spacingHint()-2,topFrame);
90 topLayout->addWidget(mDetails); 92 topLayout->addWidget(mDetails);
91} 93}
92 94
93void KOIncidenceEditor::alarmWarning() 95void KOIncidenceEditor::alarmWarning()
94{ 96{
95 KMessageBox::information( 0, i18n("The alarm for this calendar\nis currently disabled!\nEnable it in resource settings."), i18n("Alarm disabled warning")); 97 KMessageBox::information( 0, i18n("The alarm for this calendar\nis currently disabled!\nEnable it in resource settings."), i18n("Alarm disabled warning"));
96 98
97} 99}
98 100
99void KOIncidenceEditor::slotApply() 101void KOIncidenceEditor::slotApply()
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 406df5a..51594ff 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -16,98 +16,104 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24// 24//
25// View of Journal entries 25// View of Journal entries
26 26
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qscrollview.h> 28#include <q3scrollview.h>
29#include <qpopupmenu.h> 29#include <q3popupmenu.h>
30#include <qhbox.h> 30#include <q3hbox.h>
31#include <qpushbutton.h> 31#include <qpushbutton.h>
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qpushbutton.h> 33#include <qpushbutton.h>
34#include <qapplication.h> 34#include <qapplication.h>
35#include <QDesktopWidget>
36//Added by qt3to4:
37#include <QPixmap>
38#include <Q3PtrList>
39#include <QKeyEvent>
40#include <Q3VBoxLayout>
35 41
36#include <klocale.h> 42#include <klocale.h>
37#include <kdebug.h> 43#include <kdebug.h>
38#include "koprefs.h" 44#include "koprefs.h"
39#include <kglobal.h> 45#include <kglobal.h>
40#include <ktextedit.h> 46#include <ktextedit.h>
41 47
42#include <libkcal/calendar.h> 48#include <libkcal/calendar.h>
43 49
44#include "journalentry.h" 50#include "journalentry.h"
45 51
46#include "kojournalview.h" 52#include "kojournalview.h"
47using namespace KOrg; 53using namespace KOrg;
48 54
49KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, 55KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
50 const char *name) 56 const char *name)
51 : KOrg::BaseView(calendar, parent, name) 57 : KOrg::BaseView(calendar, parent, name)
52{ 58{
53 mCalendar = calendar; 59 mCalendar = calendar;
54 QHBox * vb = new QHBox ( this ); 60 Q3HBox * vb = new Q3HBox ( this );
55 QPushButton * newJournal = new QPushButton( vb ); 61 QPushButton * newJournal = new QPushButton( vb );
56 QPixmap icon; 62 QPixmap icon;
57 if ( QApplication::desktop()->width() < 321 ) 63 if ( QApplication::desktop()->width() < 321 )
58 icon = SmallIcon("ko16old"); 64 icon = SmallIcon("ko16old");
59 else 65 else
60 icon = SmallIcon("ko24old"); 66 icon = SmallIcon("ko24old");
61 newJournal->setPixmap (icon ) ; 67 newJournal->setPixmap (icon ) ;
62 int size = newJournal->sizeHint().height(); 68 int size = newJournal->sizeHint().height();
63 newJournal->setFixedSize( size, size ); 69 newJournal->setFixedSize( size, size );
64 mDateLabel = new QLabel ( vb ); 70 mDateLabel = new QLabel ( vb );
65 mDateLabel->setMargin(1); 71 mDateLabel->setMargin(1);
66 mDateLabel->setAlignment(AlignCenter); 72 mDateLabel->setAlignment(Qt::AlignCenter);
67 QScrollView * sv = new QScrollView( this ); 73 Q3ScrollView * sv = new Q3ScrollView( this );
68 QVBoxLayout * hbl = new QVBoxLayout( this ); 74 Q3VBoxLayout * hbl = new Q3VBoxLayout( this );
69 hbl->addWidget( vb ); 75 hbl->addWidget( vb );
70 hbl->addWidget( sv ); 76 hbl->addWidget( sv );
71 parWid = new QWidget( sv->viewport() ); 77 parWid = new QWidget( sv->viewport() );
72 sv->addChild(parWid); 78 sv->addChild(parWid);
73 sv->setResizePolicy( QScrollView:: AutoOneFit ); 79 sv->setResizePolicy( Q3ScrollView:: AutoOneFit );
74 mTopLayout = new QVBoxLayout(parWid); 80 mTopLayout = new Q3VBoxLayout(parWid);
75 connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) ); 81 connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) );
76 getNewEntry(); 82 getNewEntry();
77} 83}
78 84
79KOJournalView::~KOJournalView() 85KOJournalView::~KOJournalView()
80{ 86{
81} 87}
82 88
83int KOJournalView::currentDateCount() 89int KOJournalView::currentDateCount()
84{ 90{
85 return 0; 91 return 0;
86} 92}
87JournalEntry* KOJournalView::getNewEntry() 93JournalEntry* KOJournalView::getNewEntry()
88{ 94{
89 JournalEntry* Entry = new JournalEntry(mCalendar,parWid); 95 JournalEntry* Entry = new JournalEntry(mCalendar,parWid);
90 jEntries.append( Entry ); 96 jEntries.append( Entry );
91 mTopLayout->addWidget(Entry); 97 mTopLayout->addWidget(Entry);
92 Entry->setFont ( KOPrefs::instance()->mJornalViewFont ); 98 Entry->setFont ( KOPrefs::instance()->mJornalViewFont );
93 connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; 99 connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ;
94 connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; 100 connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ;
95 connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; 101 connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ;
96 return Entry; 102 return Entry;
97} 103}
98 104
99QPtrList<Incidence> KOJournalView::selectedIncidences() 105Q3PtrList<Incidence> KOJournalView::selectedIncidences()
100{ 106{
101 QPtrList<Incidence> eventList; 107 Q3PtrList<Incidence> eventList;
102 108
103 return eventList; 109 return eventList;
104} 110}
105void KOJournalView::updateConfig() 111void KOJournalView::updateConfig()
106{ 112{
107 JournalEntry* mEntry = jEntries.first(); 113 JournalEntry* mEntry = jEntries.first();
108 while ( mEntry ) { 114 while ( mEntry ) {
109 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont ); 115 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
110 mEntry = jEntries.next(); 116 mEntry = jEntries.next();
111 } 117 }
112} 118}
113void KOJournalView::updateView() 119void KOJournalView::updateView()
@@ -153,31 +159,31 @@ void KOJournalView::newJournal()
153 mCalendar->addJournal(mJournal); 159 mCalendar->addJournal(mJournal);
154 showDates( mDate, QDate() ); 160 showDates( mDate, QDate() );
155} 161}
156 162
157void KOJournalView::showOnly ( Journal* j ) 163void KOJournalView::showOnly ( Journal* j )
158{ 164{
159 //qDebug("showOnly %x ", j); 165 //qDebug("showOnly %x ", j);
160 flushView(); 166 flushView();
161 if ( j == 0 ) { 167 if ( j == 0 ) {
162 showDates( mDate, QDate() ); 168 showDates( mDate, QDate() );
163 return; 169 return;
164 } 170 }
165 QPtrList<Journal> jl; 171 Q3PtrList<Journal> jl;
166 jl.append ( j ); 172 jl.append ( j );
167 showList( jl ); 173 showList( jl );
168 JournalEntry* mEntry = jEntries.first(); 174 JournalEntry* mEntry = jEntries.first();
169 mEntry->setShowOnly(); 175 mEntry->setShowOnly();
170} 176}
171void KOJournalView::showList(QPtrList<Journal> jl) 177void KOJournalView::showList(Q3PtrList<Journal> jl)
172{ 178{
173 static bool ff = false; 179 static bool ff = false;
174 if ( ff ) return; 180 if ( ff ) return;
175 ff = true; 181 ff = true;
176 //qDebug("KOJournalView::showList %d",jl.count() ); 182 //qDebug("KOJournalView::showList %d",jl.count() );
177 JournalEntry* mEntry = jEntries.first(); 183 JournalEntry* mEntry = jEntries.first();
178 JournalEntry* firstEntry = mEntry; 184 JournalEntry* firstEntry = mEntry;
179 int count = jl.count(); 185 int count = jl.count();
180 int iii = 0; 186 int iii = 0;
181 QWidget* fw = qApp->focusWidget (); 187 QWidget* fw = qApp->focusWidget ();
182 while ( iii < count ) { 188 while ( iii < count ) {
183 if ( !mEntry ) { 189 if ( !mEntry ) {
@@ -216,29 +222,29 @@ void KOJournalView::showList(QPtrList<Journal> jl)
216 mEntry->setVisibleMode( true ); 222 mEntry->setVisibleMode( true );
217 mEntry->show(); 223 mEntry->show();
218 } 224 }
219 mEntry = jEntries.next(); 225 mEntry = jEntries.next();
220 } 226 }
221 ff = false; 227 ff = false;
222} 228}
223 229
224void KOJournalView::showDates(const QDate &start, const QDate &) 230void KOJournalView::showDates(const QDate &start, const QDate &)
225{ 231{
226 mDate = start; 232 mDate = start;
227 mDateLabel->setText(KGlobal::locale()->formatDate(mDate)); 233 mDateLabel->setText(KGlobal::locale()->formatDate(mDate));
228 QPtrList<Journal> jl = calendar()->journals4Date( start ); 234 Q3PtrList<Journal> jl = calendar()->journals4Date( start );
229 showList( jl ); 235 showList( jl );
230} 236}
231 237
232void KOJournalView::showEvents(QPtrList<Event>) 238void KOJournalView::showEvents(Q3PtrList<Event>)
233{ 239{
234 // After new creation of list view no events are selected. 240 // After new creation of list view no events are selected.
235// emit incidenceSelected( 0 ); 241// emit incidenceSelected( 0 );
236} 242}
237 243
238void KOJournalView::changeEventDisplay(Event *, int /*action*/) 244void KOJournalView::changeEventDisplay(Event *, int /*action*/)
239{ 245{
240 updateView(); 246 updateView();
241} 247}
242 248
243void KOJournalView::keyPressEvent ( QKeyEvent * e ) 249void KOJournalView::keyPressEvent ( QKeyEvent * e )
244{ 250{
diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h
index 7fa94ae..22f26cd 100644
--- a/korganizer/kojournalview.h
+++ b/korganizer/kojournalview.h
@@ -16,65 +16,70 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOJOURNALVIEW_H 23#ifndef _KOJOURNALVIEW_H
24#define _KOJOURNALVIEW_H 24#define _KOJOURNALVIEW_H
25 25
26#include <korganizer/baseview.h> 26#include <korganizer/baseview.h>
27#include <qlayout.h> 27#include <qlayout.h>
28//Added by qt3to4:
29#include <QKeyEvent>
30#include <Q3PtrList>
31#include <QLabel>
32#include <Q3BoxLayout>
28 33
29class JournalEntry; 34class JournalEntry;
30class QLabel; 35class QLabel;
31 36
32/** 37/**
33 * This class provides a journal view. 38 * This class provides a journal view.
34 39
35 * @short View for Journal components. 40 * @short View for Journal components.
36 * @author Cornelius Schumacher <schumacher@kde.org> 41 * @author Cornelius Schumacher <schumacher@kde.org>
37 * @see KOBaseView 42 * @see KOBaseView
38 */ 43 */
39class KOJournalView : public KOrg::BaseView 44class KOJournalView : public KOrg::BaseView
40{ 45{
41 Q_OBJECT 46 Q_OBJECT
42 public: 47 public:
43 KOJournalView(Calendar *calendar, QWidget *parent = 0, 48 KOJournalView(Calendar *calendar, QWidget *parent = 0,
44 const char *name = 0); 49 const char *name = 0);
45 ~KOJournalView(); 50 ~KOJournalView();
46 51
47 virtual int currentDateCount(); 52 virtual int currentDateCount();
48 void clearList(); 53 void clearList();
49 virtual QPtrList<Incidence> selectedIncidences(); 54 virtual Q3PtrList<Incidence> selectedIncidences();
50 DateList selectedDates() 55 DateList selectedDates()
51 {DateList q; 56 {DateList q;
52 return q;}; 57 return q;};
53 void checkModified(); 58 void checkModified();
54 signals: 59 signals:
55 void deleteJournal(Journal *); 60 void deleteJournal(Journal *);
56 public slots: 61 public slots:
57 void showOnly ( Journal* ); 62 void showOnly ( Journal* );
58 void newJournal(); 63 void newJournal();
59 void updateView(); 64 void updateView();
60 void flushView(); 65 void flushView();
61 void updateConfig(); 66 void updateConfig();
62 void showDates( const QDate &start, const QDate &end ); 67 void showDates( const QDate &start, const QDate &end );
63 void showEvents(QPtrList<Event> eventList); 68 void showEvents(Q3PtrList<Event> eventList);
64 69
65 void changeEventDisplay(Event *, int); 70 void changeEventDisplay(Event *, int);
66 71
67 private: 72 private:
68 void showList(QPtrList<Journal> jl); 73 void showList(Q3PtrList<Journal> jl);
69 Calendar *mCalendar; 74 Calendar *mCalendar;
70 JournalEntry* getNewEntry(); 75 JournalEntry* getNewEntry();
71 QPtrList<JournalEntry> jEntries; 76 Q3PtrList<JournalEntry> jEntries;
72 void keyPressEvent ( QKeyEvent * ) ; 77 void keyPressEvent ( QKeyEvent * ) ;
73 QBoxLayout *mTopLayout; 78 Q3BoxLayout *mTopLayout;
74 QWidget *parWid; 79 QWidget *parWid;
75 QLabel * mDateLabel; 80 QLabel * mDateLabel;
76 QDate mDate; 81 QDate mDate;
77 82
78}; 83};
79 84
80#endif 85#endif
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 192f8c0..0ea1d50 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -13,38 +13,47 @@
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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>
42#include <kiconloader.h> 51#include <kiconloader.h>
43#include <kglobal.h> 52#include <kglobal.h>
44 53
45#include <libkdepim/kpimglobalprefs.h> 54#include <libkdepim/kpimglobalprefs.h>
46#include <libkcal/calendar.h> 55#include <libkcal/calendar.h>
47#include <libkcal/calendarlocal.h> 56#include <libkcal/calendarlocal.h>
48#include <libkcal/icalformat.h> 57#include <libkcal/icalformat.h>
49#include <libkcal/vcalformat.h> 58#include <libkcal/vcalformat.h>
50#include <libkcal/recurrence.h> 59#include <libkcal/recurrence.h>
@@ -61,28 +70,28 @@
61#include "calprinter.h" 70#include "calprinter.h"
62#endif 71#endif
63#include "koglobals.h" 72#include "koglobals.h"
64#include "koprefs.h" 73#include "koprefs.h"
65#include "kfiledialog.h" 74#include "kfiledialog.h"
66 75
67#include "kolistview.h" 76#include "kolistview.h"
68#include "koeventviewer.h" 77#include "koeventviewer.h"
69 78
70extern QPixmap* sgListViewCompletedPix[6]; 79extern QPixmap* sgListViewCompletedPix[6];
71extern QPixmap* sgListViewJournalPix; 80extern QPixmap* sgListViewJournalPix;
72 81
73class KOListViewWhatsThis :public QWhatsThis 82class KOListViewWhatsThis :public Q3WhatsThis
74{ 83{
75public: 84public:
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
78protected: 87protected:
79 virtual QString text( const QPoint& p) 88 virtual QString text( const QPoint& p)
80 { 89 {
81 return _view->getWhatsThisText(p) ; 90 return _view->getWhatsThisText(p) ;
82 } 91 }
83private: 92private:
84 QWidget* _wid; 93 QWidget* _wid;
85 KOListView * _view; 94 KOListView * _view;
86}; 95};
87 96
88 97
@@ -265,81 +274,81 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
265 mListView->addColumn(i18n("Start Date")); 274 mListView->addColumn(i18n("Start Date"));
266 mListView->addColumn(i18n("Start Time")); 275 mListView->addColumn(i18n("Start Time"));
267 mListView->addColumn(i18n("End/Due Date")); 276 mListView->addColumn(i18n("End/Due Date"));
268 mListView->addColumn(i18n("End/Due Time")); 277 mListView->addColumn(i18n("End/Due Time"));
269 mListView->addColumn(i18n("Duration")); 278 mListView->addColumn(i18n("Duration"));
270 mListView->addColumn(i18n("Alarm")); // alarm set? 279 mListView->addColumn(i18n("Alarm")); // alarm set?
271 mListView->addColumn(i18n("Recurs")); // recurs? 280 mListView->addColumn(i18n("Recurs")); // recurs?
272 mListView->addColumn(i18n("Cancelled")); 281 mListView->addColumn(i18n("Cancelled"));
273 mListView->addColumn(i18n("Categories")); 282 mListView->addColumn(i18n("Categories"));
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,
303 SLOT(allSelection())); 312 SLOT(allSelection()));
304 selPopup->insertItem(i18n("None"),this, 313 selPopup->insertItem(i18n("None"),this,
305 SLOT(clearSelection())); 314 SLOT(clearSelection()));
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,
326 SLOT(setCat()) ); 335 SLOT(setCat()) );
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
337 QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, 346 QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this,
338 SLOT( populateCalPopup() )); 347 SLOT( populateCalPopup() ));
339 QObject::connect(mCalPopup,SIGNAL(activated( int )),this, 348 QObject::connect(mCalPopup,SIGNAL(activated( int )),this,
340 SLOT( setCalendar( int ) )); 349 SLOT( setCalendar( int ) ));
341 QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this, 350 QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this,
342 SLOT( catChanged( Incidence * ) )); 351 SLOT( catChanged( Incidence * ) ));
343 exportPO->insertItem( i18n("As iCal (ics) file..."),this, 352 exportPO->insertItem( i18n("As iCal (ics) file..."),this,
344 SLOT(saveToFile())); 353 SLOT(saveToFile()));
345 exportPO->insertItem( i18n("As vCal (vcs) file..."),this, 354 exportPO->insertItem( i18n("As vCal (vcs) file..."),this,
@@ -347,50 +356,50 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
347 exportPO->insertItem( i18n("Journal/Details..."),this, 356 exportPO->insertItem( i18n("Journal/Details..."),this,
348 SLOT(saveDescriptionToFile())); 357 SLOT(saveDescriptionToFile()));
349 // mPopupMenu->insertSeparator(); 358 // mPopupMenu->insertSeparator();
350 // mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 359 // mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
351 // i18n("Add Categ. to selected..."),this, 360 // i18n("Add Categ. to selected..."),this,
352 // SLOT(addCat()),true); 361 // SLOT(addCat()),true);
353 //mPopupMenu->insertSeparator(); 362 //mPopupMenu->insertSeparator();
354#ifndef DESKTOP_VERSION 363#ifndef DESKTOP_VERSION
355 selPopup->insertSeparator(); 364 selPopup->insertSeparator();
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
363#endif 372#endif
364 /* 373 /*
365 mPopupMenu = new QPopupMenu; 374 mPopupMenu = new QPopupMenu;
366 mPopupMenu->insertItem(i18n("Edit Event"), this, 375 mPopupMenu->insertItem(i18n("Edit Event"), this,
367 SLOT (editEvent())); 376 SLOT (editEvent()));
368 mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, 377 mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this,
369 SLOT (deleteEvent())); 378 SLOT (deleteEvent()));
370 mPopupMenu->insertSeparator(); 379 mPopupMenu->insertSeparator();
371 mPopupMenu->insertItem(i18n("Show Dates"), this, 380 mPopupMenu->insertItem(i18n("Show Dates"), this,
372 SLOT(showDates())); 381 SLOT(showDates()));
373 mPopupMenu->insertItem(i18n("Hide Dates"), this, 382 mPopupMenu->insertItem(i18n("Hide Dates"), this,
374 SLOT(hideDates())); 383 SLOT(hideDates()));
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
388 readSettings(KOGlobals::config(),"KOListView Layout"); 397 readSettings(KOGlobals::config(),"KOListView Layout");
389} 398}
390 399
391KOListView::~KOListView() 400KOListView::~KOListView()
392{ 401{
393 delete mPopupMenu; 402 delete mPopupMenu;
394#if QT_VERSION >= 0x030000 403#if QT_VERSION >= 0x030000
395 404
396#else 405#else
@@ -419,39 +428,39 @@ QString KOListView::getWhatsThisText(QPoint p)
419} 428}
420 429
421void KOListView::setCalendar( int c ) 430void KOListView::setCalendar( int c )
422{ 431{
423 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"), 432 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"),
424 i18n("This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!").arg( KOPrefs::instance()->calName( c ) ), 433 i18n("This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!").arg( KOPrefs::instance()->calName( c ) ),
425 i18n("Continue"), i18n("Cancel"), 0, 434 i18n("Continue"), i18n("Cancel"), 0,
426 0, 1 ); 435 0, 1 );
427 if ( result != 0 ) { 436 if ( result != 0 ) {
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();
435 while ( incidence ) { 444 while ( incidence ) {
436 incidence->setCalID( c ); 445 incidence->setCalID( c );
437 KOListViewItem * item = getItemForEvent( incidence ); 446 KOListViewItem * item = getItemForEvent( incidence );
438 if ( item ) { 447 if ( item ) {
439 ListItemVisitor v(item, mStartDate ); 448 ListItemVisitor v(item, mStartDate );
440 incidence->accept(v); 449 incidence->accept(v);
441 } 450 }
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 );
449 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 458 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
450 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 459 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
451 if ( cal->isStandard ) 460 if ( cal->isStandard )
452 mCalendar->setDefaultCalendar( cal->mCalNumber ); 461 mCalendar->setDefaultCalendar( cal->mCalNumber );
453 cal = calendars.next(); 462 cal = calendars.next();
454 } 463 }
455 mCalendar->setSyncEventsReadOnly(); 464 mCalendar->setSyncEventsReadOnly();
456 mCalendar->reInitAlarmSettings(); 465 mCalendar->reInitAlarmSettings();
457 466
@@ -488,50 +497,50 @@ void KOListView::setCat()
488 i18n("Add"), 497 i18n("Add"),
489 i18n("Reset")); 498 i18n("Reset"));
490 if (result == KMessageBox::Cancel) return; 499 if (result == KMessageBox::Cancel) return;
491 if (result == KMessageBox::Yes) set = false; 500 if (result == KMessageBox::Yes) set = false;
492 setCategories( set ); 501 setCategories( set );
493} 502}
494 503
495void KOListView::setAlarm() 504void KOListView::setAlarm()
496{ 505{
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 ) {
504 ++count; 513 ++count;
505 if (kap.mAlarmButton->isChecked()) { 514 if (kap.mAlarmButton->isChecked()) {
506 if (inc->alarms().count() == 0) 515 if (inc->alarms().count() == 0)
507 inc->newAlarm(); 516 inc->newAlarm();
508 Alarm *alarm = inc->alarms().first(); 517 Alarm *alarm = inc->alarms().first();
509 alarm->setEnabled(true); 518 alarm->setEnabled(true);
510 int j = kap.mAlarmTimeEdit->value()* -60; 519 int j = kap.mAlarmTimeEdit->value()* -60;
511 if (kap.mAlarmIncrCombo->currentItem() == 1) 520 if (kap.mAlarmIncrCombo->currentItem() == 1)
512 j = j * 60; 521 j = j * 60;
513 else if (kap.mAlarmIncrCombo->currentItem() == 2) 522 else if (kap.mAlarmIncrCombo->currentItem() == 2)
514 j = j * (60 * 24); 523 j = j * (60 * 24);
515 alarm->setStartOffset( j ); 524 alarm->setStartOffset( j );
516 525
517 if (!kap.mAlarmProgram.isEmpty() && kap.mAlarmProgramButton->isOn()) { 526 if (!kap.mAlarmProgram.isEmpty() && kap.mAlarmProgramButton->isOn()) {
518 alarm->setProcedureAlarm(kap.mAlarmProgram); 527 alarm->setProcedureAlarm(kap.mAlarmProgram);
519 } 528 }
520 else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn()) 529 else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn())
521 alarm->setAudioAlarm(kap.mAlarmSound); 530 alarm->setAudioAlarm(kap.mAlarmSound);
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);
529 alarm->setType(Alarm::Invalid); 538 alarm->setType(Alarm::Invalid);
530 } 539 }
531 } 540 }
532 KOListViewItem* item = getItemForEvent(inc); 541 KOListViewItem* item = getItemForEvent(inc);
533 if (item) { 542 if (item) {
534 ListItemVisitor v(item, mStartDate ); 543 ListItemVisitor v(item, mStartDate );
535 inc->accept(v); 544 inc->accept(v);
536 } 545 }
537 inc = delSel.next(); 546 inc = delSel.next();
@@ -543,60 +552,60 @@ void KOListView::setAlarm()
543} 552}
544void KOListView::setCategories( bool removeOld ) 553void KOListView::setCategories( bool removeOld )
545{ 554{
546 555
547 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); 556 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
548 csd->setColorEnabled(); 557 csd->setColorEnabled();
549 if (! csd->exec()) { 558 if (! csd->exec()) {
550 delete csd; 559 delete csd;
551 return; 560 return;
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 ) {
559 inc->setCategories( catList, false ); 568 inc->setCategories( catList, false );
560 } else { 569 } else {
561 inc->addCategories( catList, false ); 570 inc->addCategories( catList, false );
562 } 571 }
563 KOListViewItem* item = getItemForEvent(inc); 572 KOListViewItem* item = getItemForEvent(inc);
564 if (item) { 573 if (item) {
565 ListItemVisitor v(item, mStartDate ); 574 ListItemVisitor v(item, mStartDate );
566 inc->accept(v); 575 inc->accept(v);
567 } 576 }
568 inc = delSel.next(); 577 inc = delSel.next();
569 } 578 }
570 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); 579 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) );
571} 580}
572 581
573void KOListView::beamSelected() 582void 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}
579 588
580void KOListView::saveDescriptionToFile() 589void KOListView::saveDescriptionToFile()
581{ 590{
582 591
583 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"), 592 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"),
584 i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."), 593 i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."),
585 i18n("Continue"), i18n("Cancel"), 0, 594 i18n("Continue"), i18n("Cancel"), 0,
586 0, 1 ); 595 0, 1 );
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;
594 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); 603 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this );
595 604
596 if ( fn == "" ) 605 if ( fn == "" )
597 return; 606 return;
598 QFileInfo info; 607 QFileInfo info;
599 info.setFile( fn ); 608 info.setFile( fn );
600 QString mes; 609 QString mes;
601 bool createbup = true; 610 bool createbup = true;
602 if ( info. exists() ) { 611 if ( info. exists() ) {
@@ -636,52 +645,52 @@ void KOListView::saveDescriptionToFile()
636 text +="\n(" + i18n("Location: ") + incidence->location()+ ")"; 645 text +="\n(" + i18n("Location: ") + incidence->location()+ ")";
637 if ( incidence->hasStartDate() ) 646 if ( incidence->hasStartDate() )
638 text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false ); 647 text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false );
639 text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); 648 text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
640 text += "\n" + i18n("Description: ") + "\n" + incidence->description(); 649 text += "\n" + i18n("Description: ") + "\n" + incidence->description();
641 ++icount; 650 ++icount;
642 651
643 } 652 }
644 } 653 }
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());
656 mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount ); 665 mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount );
657 KOPrefs::instance()->mLastSaveFile = fn; 666 KOPrefs::instance()->mLastSaveFile = fn;
658 topLevelWidget()->setCaption(mes); 667 topLevelWidget()->setCaption(mes);
659 } 668 }
660 } 669 }
661} 670}
662void KOListView::saveToFileVCS() 671void KOListView::saveToFileVCS()
663{ 672{
664 writeToFile( false ); 673 writeToFile( false );
665} 674}
666void KOListView::saveToFile() 675void KOListView::saveToFile()
667{ 676{
668 writeToFile( true ); 677 writeToFile( true );
669} 678}
670QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool includeTodos, bool includeJournals, bool onlyDueTodos ) 679Q3PtrList<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();
679 if ( ( addSubTodos && delSel.findRef( inc ) == -1) || !addSubTodos ) { 688 if ( ( addSubTodos && delSel.findRef( inc ) == -1) || !addSubTodos ) {
680 if ( (inc->typeID() == todoID && includeTodos) || 689 if ( (inc->typeID() == todoID && includeTodos) ||
681 (inc->typeID() == eventID && includeEvents) || 690 (inc->typeID() == eventID && includeEvents) ||
682 (inc->typeID() == journalID && includeJournals) ) { 691 (inc->typeID() == journalID && includeJournals) ) {
683 if ( inc->typeID() == todoID && onlyDueTodos ) { 692 if ( inc->typeID() == todoID && onlyDueTodos ) {
684 if ( ((Todo*)inc)->hasDueDate() ) 693 if ( ((Todo*)inc)->hasDueDate() )
685 delSel.append( inc ); 694 delSel.append( inc );
686 } else 695 } else
687 delSel.append( inc ); 696 delSel.append( inc );
@@ -697,49 +706,49 @@ QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool
697 i18n("Todo has subtodos"), 706 i18n("Todo has subtodos"),
698 i18n("Yes"), 707 i18n("Yes"),
699 i18n("No")); 708 i18n("No"));
700 if ( result == KMessageBox::Cancel ) { 709 if ( result == KMessageBox::Cancel ) {
701 delSel.clear(); 710 delSel.clear();
702 return delSel; 711 return delSel;
703 } 712 }
704 if (result == KMessageBox::Yes) 713 if (result == KMessageBox::Yes)
705 addSubTodos = true; 714 addSubTodos = true;
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 ) {
713 if ( delSel.findRef( tempinc ) == -1 ) { 722 if ( delSel.findRef( tempinc ) == -1 ) {
714 if ( tempinc->typeID() == todoID && onlyDueTodos ) { 723 if ( tempinc->typeID() == todoID && onlyDueTodos ) {
715 if ( ((Todo*)tempinc)->hasDueDate() ) 724 if ( ((Todo*)tempinc)->hasDueDate() )
716 delSel.append( tempinc ); 725 delSel.append( tempinc );
717 } else 726 } else
718 delSel.append( tempinc ); 727 delSel.append( tempinc );
719 } 728 }
720 tempinc = tempSel.next(); 729 tempinc = tempSel.next();
721 } 730 }
722 } 731 }
723 } 732 }
724 } 733 }
725 } 734 }
726 item = item->nextSibling(); 735 item = item->nextSibling();
727 } 736 }
728 return delSel; 737 return delSel;
729} 738}
730 739
731void KOListView::writeToFile( bool iCal ) 740void 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();
737 while ( incidence ) { 746 while ( incidence ) {
738 if ( incidence->typeID() == journalID ) { 747 if ( incidence->typeID() == journalID ) {
739 journal = true; 748 journal = true;
740 break; 749 break;
741 } 750 }
742 incidence = delSel.next(); 751 incidence = delSel.next();
743 } 752 }
744 if ( journal ) { 753 if ( journal ) {
745 int result = KMessageBox::warningContinueCancel(this, 754 int result = KMessageBox::warningContinueCancel(this,
@@ -794,64 +803,64 @@ void KOListView::writeToFile( bool iCal )
794 VCalFormat format; 803 VCalFormat format;
795 format.save( &cal, fn ); 804 format.save( &cal, fn );
796 } 805 }
797 mes = i18n("KO/Pi:Saved %1").arg(fn ); 806 mes = i18n("KO/Pi:Saved %1").arg(fn );
798 KOPrefs::instance()->mLastSaveFile = fn; 807 KOPrefs::instance()->mLastSaveFile = fn;
799 topLevelWidget()->setCaption(mes); 808 topLevelWidget()->setCaption(mes);
800 } 809 }
801 } 810 }
802 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); 811 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) );
803} 812}
804void KOListView::hideAll() 813void 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);
811 } 820 }
812 item = item->nextSibling(); 821 item = item->nextSibling();
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 }
820} 829}
821void KOListView::printList() 830void KOListView::printList()
822{ 831{
823 mListView->printList(); 832 mListView->printList();
824} 833}
825void KOListView::deleteAll() 834void 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();
831 Incidence *toDelete; 840 Incidence *toDelete;
832 KOPrefs *p = KOPrefs::instance(); 841 KOPrefs *p = KOPrefs::instance();
833 bool confirm = p->mConfirm; 842 bool confirm = p->mConfirm;
834 QString mess; 843 QString mess;
835 mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); 844 mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount );
836 if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) { 845 if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) {
837 p->mConfirm = false; 846 p->mConfirm = false;
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;
849 int dw = QApplication::desktop()->width(); 858 int dw = QApplication::desktop()->width();
850 int dh = QApplication::desktop()->height(); 859 int dh = QApplication::desktop()->height();
851 dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 860 dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
852 //dia.resize( 240,50 ); 861 //dia.resize( 240,50 );
853 dia.show(); 862 dia.show();
854 KOPrefs::instance()->mGlobalUpdateDisabled = true; 863 KOPrefs::instance()->mGlobalUpdateDisabled = true;
855 while ( incidence ) { 864 while ( incidence ) {
856 bar.setProgress( delCounter ); 865 bar.setProgress( delCounter );
857 mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter ); 866 mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter );
@@ -875,28 +884,28 @@ void KOListView::deleteAll()
875 884
876} 885}
877int KOListView::maxDatesHint() 886int KOListView::maxDatesHint()
878{ 887{
879 return 0; 888 return 0;
880} 889}
881 890
882int KOListView::currentDateCount() 891int KOListView::currentDateCount()
883{ 892{
884 return 0; 893 return 0;
885} 894}
886 895
887QPtrList<Incidence> KOListView::selectedIncidences() 896Q3PtrList<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());
894 } 903 }
895 904
896 item = item->nextSibling(); 905 item = item->nextSibling();
897 } 906 }
898 907
899 // // QListViewItem *item = mListView->selectedItem(); 908 // // QListViewItem *item = mListView->selectedItem();
900 //if (item) eventList.append(((KOListViewItem *)item)->data()); 909 //if (item) eventList.append(((KOListViewItem *)item)->data());
901 910
902 return eventList; 911 return eventList;
@@ -978,47 +987,47 @@ void KOListView::showDates(const QDate &start, const QDate &end)
978 QDate date = start; 987 QDate date = start;
979 while( date <= end ) { 988 while( date <= end ) {
980 addEvents(calendar()->events(date)); 989 addEvents(calendar()->events(date));
981 addTodos(calendar()->todos(date)); 990 addTodos(calendar()->todos(date));
982 addJournals( calendar()->journals4Date(date) ); 991 addJournals( calendar()->journals4Date(date) );
983 date = date.addDays( 1 ); 992 date = date.addDays( 1 );
984 } 993 }
985 //emit incidenceSelected( 0 ); 994 //emit incidenceSelected( 0 );
986 updateView(); 995 updateView();
987 996
988} 997}
989 998
990void KOListView::addEvents(QPtrList<Event> eventList) 999void KOListView::addEvents(Q3PtrList<Event> eventList)
991{ 1000{
992 1001
993 Event *ev; 1002 Event *ev;
994 for(ev = eventList.first(); ev; ev = eventList.next()) { 1003 for(ev = eventList.first(); ev; ev = eventList.next()) {
995 addIncidence(ev); 1004 addIncidence(ev);
996 } 1005 }
997 if ( !mListView->currentItem() ){ 1006 if ( !mListView->currentItem() ){
998 updateView(); 1007 updateView();
999 } 1008 }
1000} 1009}
1001 1010
1002void KOListView::addTodos(QPtrList<Todo> eventList) 1011void 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()) {
1006 addIncidence(ev); 1015 addIncidence(ev);
1007 } 1016 }
1008 if ( !mListView->currentItem() ){ 1017 if ( !mListView->currentItem() ){
1009 updateView(); 1018 updateView();
1010 } 1019 }
1011} 1020}
1012void KOListView::addJournals(QPtrList<Journal> eventList) 1021void 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()) {
1016 addIncidence(ev); 1025 addIncidence(ev);
1017 } 1026 }
1018 if ( !mListView->currentItem() ){ 1027 if ( !mListView->currentItem() ){
1019 updateView(); 1028 updateView();
1020 } 1029 }
1021} 1030}
1022 1031
1023void KOListView::showCompletedTodos() 1032void KOListView::showCompletedTodos()
1024{ 1033{
@@ -1035,25 +1044,25 @@ void KOListView::addIncidence(Incidence *incidence)
1035 return; 1044 return;
1036 } 1045 }
1037 } 1046 }
1038 mUidDict.insert( incidence->uid(), incidence ); 1047 mUidDict.insert( incidence->uid(), incidence );
1039 KOListViewItem *item = new KOListViewItem( incidence, mListView ); 1048 KOListViewItem *item = new KOListViewItem( incidence, mListView );
1040 ListItemVisitor v(item, mStartDate ); 1049 ListItemVisitor v(item, mStartDate );
1041 if (incidence->accept(v)) { 1050 if (incidence->accept(v)) {
1042 return; 1051 return;
1043 } 1052 }
1044 else delete item; 1053 else delete item;
1045} 1054}
1046 1055
1047void KOListView::showEvents(QPtrList<Event> eventList) 1056void KOListView::showEvents(Q3PtrList<Event> eventList)
1048{ 1057{
1049 clear(); 1058 clear();
1050 1059
1051 addEvents(eventList); 1060 addEvents(eventList);
1052 1061
1053 // After new creation of list view no events are selected. 1062 // After new creation of list view no events are selected.
1054 emit incidenceSelected( 0 ); 1063 emit incidenceSelected( 0 );
1055} 1064}
1056int KOListView::count() 1065int KOListView::count()
1057{ 1066{
1058 return mListView->childCount(); 1067 return mListView->childCount();
1059} 1068}
@@ -1086,32 +1095,32 @@ void KOListView::changeEventDisplay(Event *event, int action)
1086} 1095}
1087 1096
1088KOListViewItem *KOListView::getItemForEvent(Incidence *event) 1097KOListViewItem *KOListView::getItemForEvent(Incidence *event)
1089{ 1098{
1090 KOListViewItem *item = (KOListViewItem *)mListView->firstChild(); 1099 KOListViewItem *item = (KOListViewItem *)mListView->firstChild();
1091 while (item) { 1100 while (item) {
1092 if (item->data() == event) return item; 1101 if (item->data() == event) return item;
1093 item = (KOListViewItem *)item->nextSibling(); 1102 item = (KOListViewItem *)item->nextSibling();
1094 } 1103 }
1095 return 0; 1104 return 0;
1096} 1105}
1097 1106
1098void KOListView::defaultItemAction(QListViewItem *i) 1107void 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
1105void KOListView::popupMenu(QListViewItem *item,const QPoint &,int) 1114void KOListView::popupMenu(Q3ListViewItem *item,const QPoint &,int)
1106{ 1115{
1107 mActiveItem = (KOListViewItem *)item; 1116 mActiveItem = (KOListViewItem *)item;
1108 if (mActiveItem) { 1117 if (mActiveItem) {
1109 Incidence *incidence = mActiveItem->data(); 1118 Incidence *incidence = mActiveItem->data();
1110 mPopupMenu->enableDefault( !mListView->hasMultiSelection( item ) ); 1119 mPopupMenu->enableDefault( !mListView->hasMultiSelection( item ) );
1111 mPopupMenu->showIncidencePopup(incidence); 1120 mPopupMenu->showIncidencePopup(incidence);
1112 1121
1113 /* 1122 /*
1114 if ( incidence && incidence->type() == "Event" ) { 1123 if ( incidence && incidence->type() == "Event" ) {
1115 Event *event = static_cast<Event *>( incidence ); 1124 Event *event = static_cast<Event *>( incidence );
1116 mPopupMenu->showEventPopup(event); 1125 mPopupMenu->showEventPopup(event);
1117 } 1126 }
@@ -1122,25 +1131,25 @@ void KOListView::popupMenu(QListViewItem *item,const QPoint &,int)
1122void KOListView::readSettings(KConfig *config, QString setting) 1131void KOListView::readSettings(KConfig *config, QString setting)
1123{ 1132{
1124 // qDebug("KOListView::readSettings "); 1133 // qDebug("KOListView::readSettings ");
1125 mListView->restoreLayout(config,setting); 1134 mListView->restoreLayout(config,setting);
1126} 1135}
1127 1136
1128void KOListView::writeSettings(KConfig *config, QString setting) 1137void KOListView::writeSettings(KConfig *config, QString setting)
1129{ 1138{
1130 // qDebug("KOListView::writeSettings "); 1139 // qDebug("KOListView::writeSettings ");
1131 mListView->saveLayout(config, setting); 1140 mListView->saveLayout(config, setting);
1132} 1141}
1133 1142
1134void KOListView::processSelectionChange(QListViewItem *) 1143void KOListView::processSelectionChange(Q3ListViewItem *)
1135{ 1144{
1136 1145
1137 KOListViewItem *item = 1146 KOListViewItem *item =
1138 static_cast<KOListViewItem *>( mListView->currentItem() ); 1147 static_cast<KOListViewItem *>( mListView->currentItem() );
1139 1148
1140 if ( !item ) { 1149 if ( !item ) {
1141 emit incidenceSelected( 0 ); 1150 emit incidenceSelected( 0 );
1142 } else { 1151 } else {
1143 emit incidenceSelected( item->data() ); 1152 emit incidenceSelected( item->data() );
1144 } 1153 }
1145} 1154}
1146 1155
@@ -1171,115 +1180,115 @@ void KOListView::keyPressEvent ( QKeyEvent *e)
1171 if ( e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace ) { 1180 if ( e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace ) {
1172 deleteAll(); 1181 deleteAll();
1173 return; 1182 return;
1174 } 1183 }
1175 1184
1176 e->ignore(); 1185 e->ignore();
1177} 1186}
1178void KOListViewListView::keyPressEvent ( QKeyEvent *e) 1187void KOListViewListView::keyPressEvent ( QKeyEvent *e)
1179{ 1188{
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 )
1188 return; 1197 return;
1189 while ( cn->nextSibling() ) 1198 while ( cn->nextSibling() )
1190 cn = cn->nextSibling(); 1199 cn = cn->nextSibling();
1191 setCurrentItem ( cn ); 1200 setCurrentItem ( cn );
1192 ensureItemVisible ( cn ); 1201 ensureItemVisible ( cn );
1193 1202
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;
1204 if ( jump == 0 ) 1213 if ( jump == 0 )
1205 jump = 1; 1214 jump = 1;
1206 while ( jump && cn->nextSibling() ) { 1215 while ( jump && cn->nextSibling() ) {
1207 cn = cn->nextSibling(); 1216 cn = cn->nextSibling();
1208 --jump; 1217 --jump;
1209 } 1218 }
1210 setCurrentItem ( cn ); 1219 setCurrentItem ( cn );
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 );
1224 } 1233 }
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;
1235 if ( jump == 0 ) 1244 if ( jump == 0 )
1236 jump = 1; 1245 jump = 1;
1237 while ( jump && cn->itemAbove ()) { 1246 while ( jump && cn->itemAbove ()) {
1238 cn = cn->itemAbove (); 1247 cn = cn->itemAbove ();
1239 --jump; 1248 --jump;
1240 } 1249 }
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 );
1252 if ( ci ){ 1261 if ( ci ){
1253 //emit showIncidence( ci->data()); 1262 //emit showIncidence( ci->data());
1254 cn = cn->nextSibling(); 1263 cn = cn->nextSibling();
1255 if ( cn ) { 1264 if ( cn ) {
1256 setCurrentItem ( cn ); 1265 setCurrentItem ( cn );
1257 ensureItemVisible ( cn ); 1266 ensureItemVisible ( cn );
1258 } 1267 }
1259 emit showIncidence( ci->data()); 1268 emit showIncidence( ci->data());
1260 } 1269 }
1261 } 1270 }
1262 e->accept(); 1271 e->accept();
1263 } 1272 }
1264 break; 1273 break;
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 );
1277 cn = cn->nextSibling(); 1286 cn = cn->nextSibling();
1278 if ( cn ) { 1287 if ( cn ) {
1279 setCurrentItem ( cn ); 1288 setCurrentItem ( cn );
1280 ensureItemVisible ( cn ); 1289 ensureItemVisible ( cn );
1281 } else { 1290 } else {
1282 emit currentChanged( ci ); 1291 emit currentChanged( ci );
1283 } 1292 }
1284 } 1293 }
1285 } 1294 }
@@ -1291,88 +1300,88 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e)
1291 } 1300 }
1292} 1301}
1293KOListViewListView::KOListViewListView(KOListView * lv ) 1302KOListViewListView::KOListViewListView(KOListView * lv )
1294 : KListView( lv, "kolistlistview", false ) 1303 : KListView( lv, "kolistlistview", false )
1295{ 1304{
1296 mYMousePos = 0; 1305 mYMousePos = 0;
1297 setAllColumnsShowFocus( true ); 1306 setAllColumnsShowFocus( true );
1298 mPopupTimer = new QTimer(this); 1307 mPopupTimer = new QTimer(this);
1299 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); 1308 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
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}
1306bool KOListViewListView::hasMultiSelection(QListViewItem* item) 1315bool 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;
1312 qitem = qitem->nextSibling(); 1321 qitem = qitem->nextSibling();
1313 } 1322 }
1314 return false; 1323 return false;
1315} 1324}
1316void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 1325void 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;
1324 } 1333 }
1325 KListView::contentsMouseDoubleClickEvent(e); 1334 KListView::contentsMouseDoubleClickEvent(e);
1326} 1335}
1327#if 0 1336#if 0
1328void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1337void 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 );
1337 } 1346 }
1338} 1347}
1339void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) 1348void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
1340{ 1349{
1341 KListView::contentsMouseReleaseEvent(e); 1350 KListView::contentsMouseReleaseEvent(e);
1342} 1351}
1343void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) 1352void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
1344{ 1353{
1345 KListView::contentsMouseMoveEvent(e); 1354 KListView::contentsMouseMoveEvent(e);
1346} 1355}
1347#endif 1356#endif
1348void KOListViewListView::popupMenu() 1357void 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}
1355void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1364void 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 );
1370 } 1379 }
1371} 1380}
1372void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) 1381void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
1373{ 1382{
1374 mPopupTimer->stop(); 1383 mPopupTimer->stop();
1375 KListView::contentsMouseReleaseEvent(e); 1384 KListView::contentsMouseReleaseEvent(e);
1376} 1385}
1377void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) 1386void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
1378{ 1387{
@@ -1381,42 +1390,42 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
1381 int diff = mYMousePos - mapToGlobal( (e->pos())).y(); 1390 int diff = mYMousePos - mapToGlobal( (e->pos())).y();
1382 if ( diff < 0 ) diff = -diff; 1391 if ( diff < 0 ) diff = -diff;
1383 if ( diff > 15 ) 1392 if ( diff > 15 )
1384 mPopupTimer->stop(); 1393 mPopupTimer->stop();
1385 else { 1394 else {
1386 mEventPos = contentsToViewport(e->pos()); 1395 mEventPos = contentsToViewport(e->pos());
1387 mEventGlobalPos = e->globalPos(); 1396 mEventGlobalPos = e->globalPos();
1388 } 1397 }
1389 KListView::contentsMouseMoveEvent(e); 1398 KListView::contentsMouseMoveEvent(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
1395void KOListViewListView::printList() 1404void KOListViewListView::printList()
1396{ 1405{
1397#ifdef DESKTOP_VERSION 1406#ifdef DESKTOP_VERSION
1398 KOPrintPrefs pp ( this ); 1407 KOPrintPrefs pp ( this );
1399 if (!pp.exec() ) 1408 if (!pp.exec() )
1400 return; 1409 return;
1401 int scaleval = pp.printMode() ; 1410 int scaleval = pp.printMode() ;
1402 1411
1403 QPrinter printer; 1412 QPrinter printer;
1404 if (!printer.setup() ) 1413 if (!printer.setup() )
1405 return; 1414 return;
1406 clearSelection (); 1415 clearSelection ();
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 ();
1414 dy = (float)(m.height()) / (float)contentsHeight (); 1423 dy = (float)(m.height()) / (float)contentsHeight ();
1415 float scale; 1424 float scale;
1416 // scale to fit the width or height of the paper 1425 // scale to fit the width or height of the paper
1417 if ( dx < dy ) 1426 if ( dx < dy )
1418 scale = dx; 1427 scale = dx;
1419 else 1428 else
1420 scale = dy; 1429 scale = dy;
1421 1430
1422 p.translate( m.width()/10,m.width()/10 ); 1431 p.translate( m.width()/10,m.width()/10 );
@@ -1434,25 +1443,25 @@ void KOListViewListView::printList()
1434 } 1443 }
1435 p.translate( 0, header()->height()); 1444 p.translate( 0, header()->height());
1436 //drawContentsOffset ( &p, 0,0, 0,0, contentsWidth (), contentsHeight () ); 1445 //drawContentsOffset ( &p, 0,0, 0,0, contentsWidth (), contentsHeight () );
1437 1446
1438 const QColorGroup &cg = colorGroup(); 1447 const QColorGroup &cg = colorGroup();
1439 KOListViewItem* item = (KOListViewItem* )firstChild(); 1448 KOListViewItem* item = (KOListViewItem* )firstChild();
1440 int yOff = 0; 1449 int yOff = 0;
1441 while ( item ) { 1450 while ( item ) {
1442 p.translate( 0, yOff ); 1451 p.translate( 0, yOff );
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);
1450 item->paintCell( &p, cg, iii, header()->sectionSize (iii), align ); 1459 item->paintCell( &p, cg, iii, header()->sectionSize (iii), align );
1451 } 1460 }
1452 yOff = item->height(); 1461 yOff = item->height();
1453 item = (KOListViewItem* )(item->itemBelow()); 1462 item = (KOListViewItem* )(item->itemBelow());
1454 p.restore(); 1463 p.restore();
1455 } 1464 }
1456 p.end(); 1465 p.end();
1457#endif 1466#endif
1458} 1467}
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index 99d0561..9fb0b00 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -15,75 +15,81 @@
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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#ifndef _KOLISTVIEW_H 24#ifndef _KOLISTVIEW_H
25#define _KOLISTVIEW_H 25#define _KOLISTVIEW_H
26 26
27#include <qlistview.h> 27#include <q3listview.h>
28#include <qmap.h> 28#include <qmap.h>
29#include <qdict.h> 29#include <q3dict.h>
30//Added by qt3to4:
31#include <QMouseEvent>
32#include <Q3PtrList>
33#include <Q3PopupMenu>
34#include <QKeyEvent>
35#include <Q3VBoxLayout>
30 36
31#include <klistview.h> 37#include <klistview.h>
32 38
33#include <libkcal/incidence.h> 39#include <libkcal/incidence.h>
34 40
35#include "koeventview.h" 41#include "koeventview.h"
36#include "customlistviewitem.h" 42#include "customlistviewitem.h"
37 43
38using namespace KCal; 44using namespace KCal;
39 45
40class KOListViewWhatsThis; 46class KOListViewWhatsThis;
41 47
42#include <qpushbutton.h> 48#include <qpushbutton.h>
43#include <qlayout.h> 49#include <qlayout.h>
44#include <qdialog.h> 50#include <qdialog.h>
45#include <qtimer.h> 51#include <qtimer.h>
46#include <qcombobox.h> 52#include <qcombobox.h>
47#include <qspinbox.h> 53#include <qspinbox.h>
48#include <qtooltip.h> 54#include <qtooltip.h>
49#include <qcheckbox.h> 55#include <qcheckbox.h>
50#include <qhbox.h> 56#include <q3hbox.h>
51#include <qlabel.h> 57#include <qlabel.h>
52#include <kiconloader.h> 58#include <kiconloader.h>
53#include "kfiledialog.h" 59#include "kfiledialog.h"
54#include "koprefs.h" 60#include "koprefs.h"
55class KOAlarmPrefs : public QDialog 61class KOAlarmPrefs : public QDialog
56{ 62{
57 Q_OBJECT 63 Q_OBJECT
58 public: 64 public:
59 KOAlarmPrefs( QWidget *par=0, const char *name=0 ) : 65 KOAlarmPrefs( QWidget *par=0, const char *name=0 ) :
60 QDialog( par, name, true ) 66 QDialog( par, name, true )
61 { 67 {
62 setCaption( i18n("Alarm Options") ); 68 setCaption( i18n("Alarm Options") );
63 QVBoxLayout* alarmLayout = new QVBoxLayout( this ); 69 Q3VBoxLayout* alarmLayout = new Q3VBoxLayout( this );
64 alarmLayout->setSpacing( 3 ); 70 alarmLayout->setSpacing( 3 );
65 alarmLayout->setMargin( 3 ); 71 alarmLayout->setMargin( 3 );
66 QWidget *parent = this; 72 QWidget *parent = this;
67 mAlarmButton = new QCheckBox(i18n("Set reminder ON with offset to:"),parent); 73 mAlarmButton = new QCheckBox(i18n("Set reminder ON with offset to:"),parent);
68 alarmLayout->addWidget(mAlarmButton); 74 alarmLayout->addWidget(mAlarmButton);
69 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; 75 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ;
70 mAlarmTimeEdit->setValue( 15 ); 76 mAlarmTimeEdit->setValue( 15 );
71 alarmLayout->addWidget(mAlarmTimeEdit); 77 alarmLayout->addWidget(mAlarmTimeEdit);
72 mAlarmIncrCombo = new QComboBox(false, parent); 78 mAlarmIncrCombo = new QComboBox(false, parent);
73 mAlarmIncrCombo->insertItem(i18n("minute(s)")); 79 mAlarmIncrCombo->insertItem(i18n("minute(s)"));
74 mAlarmIncrCombo->insertItem(i18n("hour(s)")); 80 mAlarmIncrCombo->insertItem(i18n("hour(s)"));
75 mAlarmIncrCombo->insertItem(i18n("day(s)")); 81 mAlarmIncrCombo->insertItem(i18n("day(s)"));
76 alarmLayout->addWidget(mAlarmIncrCombo); 82 alarmLayout->addWidget(mAlarmIncrCombo);
77 QHBox * hb = new QHBox ( parent ); 83 Q3HBox * hb = new Q3HBox ( parent );
78 alarmLayout->addWidget(hb); 84 alarmLayout->addWidget(hb);
79 mAlarmSoundButton = new QPushButton(hb); 85 mAlarmSoundButton = new QPushButton(hb);
80 mAlarmSoundButton->setPixmap(SmallIcon("playsound")); 86 mAlarmSoundButton->setPixmap(SmallIcon("playsound"));
81 mAlarmSoundButton->setToggleButton(true); 87 mAlarmSoundButton->setToggleButton(true);
82 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); 88 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound()));
83 mAlarmProgramButton = new QPushButton(hb); 89 mAlarmProgramButton = new QPushButton(hb);
84 mAlarmProgramButton->setPixmap(SmallIcon("run")); 90 mAlarmProgramButton->setPixmap(SmallIcon("run"));
85 mAlarmProgramButton->setToggleButton(true); 91 mAlarmProgramButton->setToggleButton(true);
86 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); 92 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram()));
87 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); 93 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 );
88 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); 94 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 );
89 mAlarmLabel = new QLabel( this ); 95 mAlarmLabel = new QLabel( this );
@@ -201,25 +207,25 @@ class ListItemVisitor : public Incidence::Visitor
201 207
202 @short multi-column list view of various events. 208 @short multi-column list view of various events.
203 @author Preston Brown <pbrown@kde.org> 209 @author Preston Brown <pbrown@kde.org>
204 @see KOBaseView, KODayListView 210 @see KOBaseView, KODayListView
205*/ 211*/
206class KOListView; 212class KOListView;
207 213
208class KOListViewListView : public KListView 214class KOListViewListView : public KListView
209{ 215{
210 Q_OBJECT 216 Q_OBJECT
211 public: 217 public:
212 KOListViewListView(KOListView * lv ); 218 KOListViewListView(KOListView * lv );
213 bool hasMultiSelection(QListViewItem*); 219 bool hasMultiSelection(Q3ListViewItem*);
214 void printList(); 220 void printList();
215 signals: 221 signals:
216 void newEvent(); 222 void newEvent();
217 void showIncidence( Incidence* ); 223 void showIncidence( Incidence* );
218 public slots: 224 public slots:
219 void popupMenu(); 225 void popupMenu();
220 private: 226 private:
221 QPoint mEventPos; 227 QPoint mEventPos;
222 QPoint mEventGlobalPos; 228 QPoint mEventGlobalPos;
223 QTimer* mPopupTimer; 229 QTimer* mPopupTimer;
224 int mYMousePos; 230 int mYMousePos;
225 void keyPressEvent ( QKeyEvent * ) ; 231 void keyPressEvent ( QKeyEvent * ) ;
@@ -231,87 +237,87 @@ class KOListViewListView : public KListView
231}; 237};
232 238
233class KOListView : public KOEventView 239class KOListView : public KOEventView
234{ 240{
235 Q_OBJECT 241 Q_OBJECT
236 public: 242 public:
237 KOListView(Calendar *calendar, QWidget *parent = 0, 243 KOListView(Calendar *calendar, QWidget *parent = 0,
238 const char *name = 0); 244 const char *name = 0);
239 ~KOListView(); 245 ~KOListView();
240 246
241 virtual int maxDatesHint(); 247 virtual int maxDatesHint();
242 virtual int currentDateCount(); 248 virtual int currentDateCount();
243 virtual QPtrList<Incidence> selectedIncidences(); 249 virtual Q3PtrList<Incidence> selectedIncidences();
244 virtual DateList selectedDates(); 250 virtual DateList selectedDates();
245 251
246 void showDates(bool show); 252 void showDates(bool show);
247 Incidence* currentItem(); 253 Incidence* currentItem();
248 void addTodos(QPtrList<Todo> eventList); 254 void addTodos(Q3PtrList<Todo> eventList);
249 void addJournals(QPtrList<Journal> eventList); 255 void addJournals(Q3PtrList<Journal> eventList);
250 virtual void printPreview(CalPrinter *calPrinter, 256 virtual void printPreview(CalPrinter *calPrinter,
251 const QDate &, const QDate &); 257 const QDate &, const QDate &);
252 258
253 void readSettings(KConfig *config, QString setting = "KOListView Layout"); 259 void readSettings(KConfig *config, QString setting = "KOListView Layout");
254 void writeSettings(KConfig *config, QString setting = "KOListView Layout"); 260 void writeSettings(KConfig *config, QString setting = "KOListView Layout");
255 void updateList(); 261 void updateList();
256 void clearList(); 262 void clearList();
257 void setStartDate(const QDate &start); 263 void setStartDate(const QDate &start);
258 int count(); 264 int count();
259 QString getWhatsThisText(QPoint p); 265 QString getWhatsThisText(QPoint p);
260 QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false ); 266 Q3PtrList<Incidence> getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false );
261 void showCompletedTodos(); 267 void showCompletedTodos();
262 signals: 268 signals:
263 void signalNewEvent(); 269 void signalNewEvent();
264 void beamIncidenceList(QPtrList<Incidence>); 270 void beamIncidenceList(Q3PtrList<Incidence>);
265 271
266 public slots: 272 public slots:
267 void hideAll(); 273 void hideAll();
268 void printList(); 274 void printList();
269 void resetFocus(); 275 void resetFocus();
270 virtual void updateView(); 276 virtual void updateView();
271 virtual void showDates(const QDate &start, const QDate &end); 277 virtual void showDates(const QDate &start, const QDate &end);
272 virtual void showEvents(QPtrList<Event> eventList); 278 virtual void showEvents(Q3PtrList<Event> eventList);
273 void clearSelection(); 279 void clearSelection();
274 void allSelection(); 280 void allSelection();
275 281
276 void clear(); 282 void clear();
277 void showDates(); 283 void showDates();
278 void hideDates(); 284 void hideDates();
279 void deleteAll(); 285 void deleteAll();
280 void saveToFile(); 286 void saveToFile();
281 void saveToFileVCS(); 287 void saveToFileVCS();
282 void saveDescriptionToFile(); 288 void saveDescriptionToFile();
283 void beamSelected(); 289 void beamSelected();
284 void updateConfig(); 290 void updateConfig();
285 void setCat(); 291 void setCat();
286 void setAlarm(); 292 void setAlarm();
287 void setCategories( bool removeOld ); 293 void setCategories( bool removeOld );
288 void changeEventDisplay(Event *, int); 294 void changeEventDisplay(Event *, int);
289 295
290 void defaultItemAction(QListViewItem *item); 296 void defaultItemAction(Q3ListViewItem *item);
291 void popupMenu(QListViewItem *item,const QPoint &,int); 297 void popupMenu(Q3ListViewItem *item,const QPoint &,int);
292 void setCalendar( int c ); 298 void setCalendar( int c );
293 void populateCalPopup(); 299 void populateCalPopup();
294 300
295 protected slots: 301 protected slots:
296 void processSelectionChange(QListViewItem *); 302 void processSelectionChange(Q3ListViewItem *);
297 void catChanged( Incidence* ); 303 void catChanged( Incidence* );
298 304
299 protected: 305 protected:
300 void writeToFile( bool iCal ); 306 void writeToFile( bool iCal );
301 void addEvents(QPtrList<Event> eventList); 307 void addEvents(Q3PtrList<Event> eventList);
302 void addIncidence(Incidence *); 308 void addIncidence(Incidence *);
303 KOListViewItem *getItemForEvent(Incidence *event); 309 KOListViewItem *getItemForEvent(Incidence *event);
304 310
305 private: 311 private:
306 bool mForceShowCompletedTodos; 312 bool mForceShowCompletedTodos;
307 QPopupMenu* mCalPopup; 313 Q3PopupMenu* mCalPopup;
308 KOListViewWhatsThis *mKOListViewWhatsThis; 314 KOListViewWhatsThis *mKOListViewWhatsThis;
309 KOListViewListView *mListView; 315 KOListViewListView *mListView;
310 KOEventPopupMenu *mPopupMenu; 316 KOEventPopupMenu *mPopupMenu;
311 KOListViewItem *mActiveItem; 317 KOListViewItem *mActiveItem;
312 QDict<Incidence> mUidDict; 318 Q3Dict<Incidence> mUidDict;
313 QDate mStartDate; 319 QDate mStartDate;
314 void keyPressEvent ( QKeyEvent * ) ; 320 void keyPressEvent ( QKeyEvent * ) ;
315}; 321};
316 322
317#endif 323#endif
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 85e9166..ca55c43 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -8,40 +8,52 @@
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <qpopupmenu.h> 20#include <q3popupmenu.h>
21#include <qfont.h> 21#include <qfont.h>
22#include <qfontmetrics.h> 22#include <qfontmetrics.h>
23#include <qkeycode.h> 23#include <qnamespace.h>
24#include <qhbox.h> 24#include <q3hbox.h>
25#include <qvbox.h> 25#include <q3vbox.h>
26#include <qwidgetstack.h> 26#include <q3widgetstack.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qtooltip.h> 28#include <qtooltip.h>
29#include <qpainter.h> 29#include <qpainter.h>
30#include <qtimer.h> 30#include <qtimer.h>
31#include <qwhatsthis.h> 31#include <q3whatsthis.h>
32#ifndef DESKTOP_VERSION 32#ifndef DESKTOP_VERSION
33#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
34#else 34#else
35#include <qapplication.h> 35#include <qapplication.h>
36#include <QDesktopWidget>
37//Added by qt3to4:
38#include <QResizeEvent>
39#include <QLabel>
40#include <QPixmap>
41#include <QFocusEvent>
42#include <QMouseEvent>
43#include <QKeyEvent>
44#include <Q3VBoxLayout>
45#include <Q3Frame>
46#include <Q3PointArray>
47#include <Q3PtrList>
36#endif 48#endif
37 49
38#include <kdebug.h> 50#include <kdebug.h>
39#include <klocale.h> 51#include <klocale.h>
40#include <kglobal.h> 52#include <kglobal.h>
41#include <kconfig.h> 53#include <kconfig.h>
42#include <kiconloader.h> 54#include <kiconloader.h>
43 55
44#include <kcalendarsystem.h> 56#include <kcalendarsystem.h>
45 57
46#ifndef KORG_NOPRINTER 58#ifndef KORG_NOPRINTER
47#include "calprinter.h" 59#include "calprinter.h"
@@ -50,202 +62,202 @@
50#ifndef KORG_NOPLUGINS 62#ifndef KORG_NOPLUGINS
51#include "kocore.h" 63#include "kocore.h"
52#endif 64#endif
53#include "koglobals.h" 65#include "koglobals.h"
54#include <libkcal/kincidenceformatter.h> 66#include <libkcal/kincidenceformatter.h>
55 67
56#include "komonthview.h" 68#include "komonthview.h"
57 69
58#define PIXMAP_SIZE 5 70#define PIXMAP_SIZE 5
59#ifdef DESKTOP_VERSION 71#ifdef DESKTOP_VERSION
60QToolTipGroup *MonthViewCell::mToolTipGroup = 0; 72QToolTipGroup *MonthViewCell::mToolTipGroup = 0;
61#endif 73#endif
62class KNOWhatsThis :public QWhatsThis 74class KNOWhatsThis :public Q3WhatsThis
63{ 75{
64public: 76public:
65 KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; 77 KNOWhatsThis( KNoScrollListBox* sbox ) : Q3WhatsThis( sbox ), _wid( sbox) { };
66 //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; 78 //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); };
67 79
68protected: 80protected:
69 virtual QString text( const QPoint& p) 81 virtual QString text( const QPoint& p)
70 { 82 {
71 return _wid->getWhatsThisText(p) ; 83 return _wid->getWhatsThisText(p) ;
72 }; 84 };
73private: 85private:
74 KNoScrollListBox* _wid; 86 KNoScrollListBox* _wid;
75 87
76}; 88};
77 89
78 90
79KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) 91KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
80 : QListBox(parent, name, WRepaintNoErase) 92 : Q3ListBox(parent, name, Qt::WNoAutoErase)
81{ 93{
82#ifndef DESKTOP_VERSION 94#ifndef DESKTOP_VERSION
83 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 95 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
84#endif 96#endif
85 mBlockDeselect = false; 97 mBlockDeselect = false;
86 mWT = new KNOWhatsThis(this); 98 mWT = new KNOWhatsThis(this);
87 resetOnFocusIn = true; 99 resetOnFocusIn = true;
88 setVScrollBarMode(QScrollView::AlwaysOff); 100 setVScrollBarMode(Q3ScrollView::AlwaysOff);
89 setHScrollBarMode(QScrollView::AlwaysOff); 101 setHScrollBarMode(Q3ScrollView::AlwaysOff);
90} 102}
91KNoScrollListBox::~KNoScrollListBox() 103KNoScrollListBox::~KNoScrollListBox()
92{ 104{
93#if QT_VERSION >= 0x030000 105#if QT_VERSION >= 0x030000
94 106
95#else 107#else
96 delete mWT; 108 delete mWT;
97#endif 109#endif
98} 110}
99 111
100 112
101void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) 113void KNoScrollListBox::focusInEvent ( QFocusEvent * e )
102{ 114{
103 QListBox::focusInEvent ( e ); 115 Q3ListBox::focusInEvent ( e );
104 if ( count() ){ 116 if ( count() ){
105 int ci = currentItem(); 117 int ci = currentItem();
106 if ( ci < 0 ) ci = 0; 118 if ( ci < 0 ) ci = 0;
107 119
108 setCurrentItem( ci ); 120 setCurrentItem( ci );
109 setSelected ( ci, true ); 121 setSelected ( ci, true );
110 emit highlighted( item ( ci ) ); 122 emit highlighted( item ( ci ) );
111 123
112 resetOnFocusIn = true; 124 resetOnFocusIn = true;
113 125
114 if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) { 126 if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) {
115 QListBoxItem *fi = firstItem (); 127 Q3ListBoxItem *fi = firstItem ();
116 if (fi ) { 128 if (fi ) {
117 int ihei = fi->height( this ); 129 int ihei = fi->height( this );
118 int hei = numRows () * ihei; 130 int hei = numRows () * ihei;
119 if ( hei < height() - horizontalScrollBar()->height () ) { 131 if ( hei < height() - horizontalScrollBar()->height () ) {
120 setVScrollBarMode(QScrollView::AlwaysOff); 132 setVScrollBarMode(Q3ScrollView::AlwaysOff);
121 } 133 }
122 else 134 else
123 setVScrollBarMode(QScrollView::Auto); 135 setVScrollBarMode(Q3ScrollView::Auto);
124 if ( ihei *3 > height() ) { 136 if ( ihei *3 > height() ) {
125 setHScrollBarMode(QScrollView::AlwaysOff); 137 setHScrollBarMode(Q3ScrollView::AlwaysOff);
126 } 138 }
127 else { 139 else {
128 setHScrollBarMode(QScrollView::Auto); 140 setHScrollBarMode(Q3ScrollView::Auto);
129 } 141 }
130 } else { 142 } else {
131 setVScrollBarMode(QScrollView::Auto); 143 setVScrollBarMode(Q3ScrollView::Auto);
132 setHScrollBarMode(QScrollView::Auto); 144 setHScrollBarMode(Q3ScrollView::Auto);
133 } 145 }
134 } 146 }
135 } 147 }
136} 148}
137void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) 149void KNoScrollListBox::focusOutEvent ( QFocusEvent * e )
138{ 150{
139 if ( ! mBlockDeselect ) { 151 if ( ! mBlockDeselect ) {
140 int i = currentItem (); 152 int i = currentItem ();
141 if ( i >= 0 ) { 153 if ( i >= 0 ) {
142 setSelected ( i, false ); 154 setSelected ( i, false );
143 } 155 }
144 QListBox::focusOutEvent ( e ); 156 Q3ListBox::focusOutEvent ( e );
145 } 157 }
146 setVScrollBarMode(QScrollView::AlwaysOff); 158 setVScrollBarMode(Q3ScrollView::AlwaysOff);
147 setHScrollBarMode(QScrollView::AlwaysOff); 159 setHScrollBarMode(Q3ScrollView::AlwaysOff);
148 if ( ! mBlockDeselect ) 160 if ( ! mBlockDeselect )
149 emit highlightIncidence( 0, (MonthViewCell*)this, 0 ); 161 emit highlightIncidence( 0, (MonthViewCell*)this, 0 );
150 mBlockDeselect = false; 162 mBlockDeselect = false;
151} 163}
152 164
153QString KNoScrollListBox::getWhatsThisText(QPoint p) 165QString KNoScrollListBox::getWhatsThisText(QPoint p)
154{ 166{
155 QListBoxItem* item = itemAt ( p ); 167 Q3ListBoxItem* item = itemAt ( p );
156 if ( ! item ) { 168 if ( ! item ) {
157 return i18n("Click in the cell\nto add an event!"); 169 return i18n("Click in the cell\nto add an event!");
158 } 170 }
159 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence(), 171 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence(),
160 KOPrefs::instance()->mWTshowDetails, 172 KOPrefs::instance()->mWTshowDetails,
161 KOPrefs::instance()->mWTshowCreated, 173 KOPrefs::instance()->mWTshowCreated,
162 KOPrefs::instance()->mWTshowChanged); 174 KOPrefs::instance()->mWTshowChanged);
163} 175}
164void KNoScrollListBox::keyPressEvent(QKeyEvent *e) 176void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
165{ 177{
166 //qDebug("KNoScrollListBox::keyPressEvent "); 178 //qDebug("KNoScrollListBox::keyPressEvent ");
167 switch(e->key()) { 179 switch(e->key()) {
168 case Key_Right: 180 case Qt::Key_Right:
169 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 181 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
170 { 182 {
171 e->ignore(); 183 e->ignore();
172 return; 184 return;
173 } 185 }
174 scrollBy(10,0); 186 scrollBy(10,0);
175 break; 187 break;
176 case Key_Left: 188 case Qt::Key_Left:
177 if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 189 if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
178 { 190 {
179 e->ignore(); 191 e->ignore();
180 return; 192 return;
181 } 193 }
182 scrollBy(-10,0); 194 scrollBy(-10,0);
183 break; 195 break;
184 case Key_Up: 196 case Qt::Key_Up:
185 if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { 197 if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
186 e->ignore(); 198 e->ignore();
187 break; 199 break;
188 } 200 }
189 if ( count() ) { 201 if ( count() ) {
190 if ( currentItem() == 0 ) { 202 if ( currentItem() == 0 ) {
191 emit prevCell(); 203 emit prevCell();
192 } else { 204 } else {
193 setCurrentItem((currentItem()+count()-1)%count()); 205 setCurrentItem((currentItem()+count()-1)%count());
194 if(!itemVisible(currentItem())) { 206 if(!itemVisible(currentItem())) {
195 if((unsigned int) currentItem() == (count()-1)) { 207 if((unsigned int) currentItem() == (count()-1)) {
196 setTopItem(currentItem()-numItemsVisible()+1); 208 setTopItem(currentItem()-numItemsVisible()+1);
197 } else { 209 } else {
198 setTopItem(topItem()-1); 210 setTopItem(topItem()-1);
199 } 211 }
200 } 212 }
201 } 213 }
202 } 214 }
203 break; 215 break;
204 case Key_Down: 216 case Qt::Key_Down:
205 if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { 217 if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
206 e->ignore(); 218 e->ignore();
207 break; 219 break;
208 } 220 }
209 if ( count () ) { 221 if ( count () ) {
210 if ( ((uint)currentItem()+1) == count () ) { 222 if ( ((uint)currentItem()+1) == count () ) {
211 emit nextCell(); 223 emit nextCell();
212 } else { 224 } else {
213 setCurrentItem((currentItem()+1)%count()); 225 setCurrentItem((currentItem()+1)%count());
214 if(!itemVisible(currentItem())) { 226 if(!itemVisible(currentItem())) {
215 if(currentItem() == 0) { 227 if(currentItem() == 0) {
216 setTopItem(0); 228 setTopItem(0);
217 } else { 229 } else {
218 setTopItem(topItem()+1); 230 setTopItem(topItem()+1);
219 } 231 }
220 } 232 }
221 } 233 }
222 } 234 }
223 break; 235 break;
224 case Key_I: 236 case Qt::Key_I:
225 QTimer::singleShot( 1, this, SLOT ( oneDown() ) ); 237 QTimer::singleShot( 1, this, SLOT ( oneDown() ) );
226 e->ignore(); 238 e->ignore();
227 break; 239 break;
228 case Key_Return: 240 case Qt::Key_Return:
229 case Key_Enter: 241 case Qt::Key_Enter:
230 { 242 {
231 if ( currentItem() >= 0 ) { 243 if ( currentItem() >= 0 ) {
232 emit doubleClicked( item( currentItem() ) ); 244 emit doubleClicked( item( currentItem() ) );
233 e->accept(); 245 e->accept();
234 } else { 246 } else {
235 e->ignore(); 247 e->ignore();
236 } 248 }
237 } 249 }
238 break; 250 break;
239 case Key_Shift: 251 case Qt::Key_Shift:
240 emit shiftDown(); 252 emit shiftDown();
241 break; 253 break;
242 default: 254 default:
243 e->ignore(); 255 e->ignore();
244 break; 256 break;
245 } 257 }
246} 258}
247 259
248void KNoScrollListBox::oneDown() 260void KNoScrollListBox::oneDown()
249{ 261{
250 if ( count () ) { 262 if ( count () ) {
251 if ( ((uint)currentItem()+1) == count () ) { 263 if ( ((uint)currentItem()+1) == count () ) {
@@ -257,43 +269,43 @@ void KNoScrollListBox::oneDown()
257 if(currentItem() == 0) { 269 if(currentItem() == 0) {
258 setTopItem(0); 270 setTopItem(0);
259 } else { 271 } else {
260 setTopItem(topItem()+1); 272 setTopItem(topItem()+1);
261 } 273 }
262 } 274 }
263 } 275 }
264 } 276 }
265} 277}
266void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) 278void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
267{ 279{
268 switch(e->key()) { 280 switch(e->key()) {
269 case Key_Shift: 281 case Qt::Key_Shift:
270 emit shiftUp(); 282 emit shiftUp();
271 break; 283 break;
272 default: 284 default:
273 break; 285 break;
274 } 286 }
275} 287}
276 288
277void KNoScrollListBox::mousePressEvent(QMouseEvent *e) 289void KNoScrollListBox::mousePressEvent(QMouseEvent *e)
278{ 290{
279 QListBox::mousePressEvent(e); 291 Q3ListBox::mousePressEvent(e);
280 292
281 if(e->button() == RightButton) { 293 if(e->button() == Qt::RightButton) {
282 emit rightClick(); 294 emit rightClick();
283 } 295 }
284} 296}
285 297
286MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s) 298MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s)
287 : QListBoxItem() 299 : Q3ListBoxItem()
288{ 300{
289 mblockRepaint = true; 301 mblockRepaint = true;
290 isWeekItem = KOPrefs::instance()->mMonthViewWeek; 302 isWeekItem = KOPrefs::instance()->mMonthViewWeek;
291 recycle( incidence, s ); 303 recycle( incidence, s );
292} 304}
293void MonthViewItem::recycle( Incidence *incidence, const QString & s) 305void MonthViewItem::recycle( Incidence *incidence, const QString & s)
294{ 306{
295 mDisplayHighlighted = false; 307 mDisplayHighlighted = false;
296 setText( s ); 308 setText( s );
297 mMultiday = 0; 309 mMultiday = 0;
298 mIncidence = incidence; 310 mIncidence = incidence;
299 mRecur = false; 311 mRecur = false;
@@ -386,32 +398,32 @@ void MonthViewItem::paint(QPainter *p)
386 p->setPen( palette().color( QPalette::Normal, sel ? \ 398 p->setPen( palette().color( QPalette::Normal, sel ? \
387 QColorGroup::HighlightedText : QColorGroup::Foreground ) ); 399 QColorGroup::HighlightedText : QColorGroup::Foreground ) );
388#endif 400#endif
389 QColor textColor = p->pen().color(); 401 QColor textColor = p->pen().color();
390 402
391 403
392 if ( mMultiday ) { 404 if ( mMultiday ) {
393 int yyy = y+(size/2); 405 int yyy = y+(size/2);
394 int sizeM = size+2; 406 int sizeM = size+2;
395 p->setBrush( QBrush( textColor ) ); 407 p->setBrush( QBrush( textColor ) );
396 p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; 408 p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ;
397 if ( mMultiday == 2 || mMultiday == 3 ) { 409 if ( mMultiday == 2 || mMultiday == 3 ) {
398 QPointArray pa ( 3 ); 410 Q3PointArray pa ( 3 );
399 pa.setPoint (0, x, yyy ); 411 pa.setPoint (0, x, yyy );
400 pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 ); 412 pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 );
401 pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 ); 413 pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 );
402 p->drawPolygon( pa ); 414 p->drawPolygon( pa );
403 } 415 }
404 if ( mMultiday == 2 || mMultiday == 1 ) { 416 if ( mMultiday == 2 || mMultiday == 1 ) {
405 QPointArray pa ( 3 ); 417 Q3PointArray pa ( 3 );
406 pa.setPoint (0, x+sizeM +sizeM/2, yyy ); 418 pa.setPoint (0, x+sizeM +sizeM/2, yyy );
407 pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); 419 pa.setPoint (1, x+sizeM, yyy+sizeM/2 );
408 pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); 420 pa.setPoint (2, x+sizeM, yyy-sizeM/2 );
409 p->drawPolygon( pa ); 421 p->drawPolygon( pa );
410 } 422 }
411 if ( mMultiday == 1 ) { 423 if ( mMultiday == 1 ) {
412 // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); 424 // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
413 p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 ); 425 p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 );
414 } 426 }
415 if ( mMultiday == 3 ) { 427 if ( mMultiday == 3 ) {
416 // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); 428 // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
417 p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 ); 429 p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 );
@@ -453,33 +465,33 @@ void MonthViewItem::paint(QPainter *p)
453 } else { 465 } else {
454 QString pText = text(); 466 QString pText = text();
455 if( pText.mid(2,1) == ":" ) 467 if( pText.mid(2,1) == ":" )
456 pText = pText.mid( 6 ); 468 pText = pText.mid( 6 );
457 p->drawText( x, yPos, pText ); 469 p->drawText( x, yPos, pText );
458 if ( mIncidence->cancelled() ) { 470 if ( mIncidence->cancelled() ) {
459 int wid = fm.width( pText ); 471 int wid = fm.width( pText );
460 p->drawLine( x, heihei/2 ,x+wid, heihei/2 ); 472 p->drawLine( x, heihei/2 ,x+wid, heihei/2 );
461 } 473 }
462 } 474 }
463} 475}
464 476
465int MonthViewItem::height(const QListBox *lb) const 477int MonthViewItem::height(const Q3ListBox *lb) const
466{ 478{
467 int ret = 10; 479 int ret = 10;
468 if ( lb ) 480 if ( lb )
469 ret = lb->fontMetrics().lineSpacing()+1; 481 ret = lb->fontMetrics().lineSpacing()+1;
470 return ret; 482 return ret;
471} 483}
472 484
473int MonthViewItem::width(const QListBox *lb) const 485int MonthViewItem::width(const Q3ListBox *lb) const
474{ 486{
475 if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) { 487 if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) {
476 int size = PIXMAP_SIZE; 488 int size = PIXMAP_SIZE;
477 if ( QApplication::desktop()->width() < 300 ) 489 if ( QApplication::desktop()->width() < 300 )
478 size = 3; 490 size = 3;
479 int x = 1; 491 int x = 1;
480 if ( KOPrefs::instance()->mMonthShowIcons ) { 492 if ( KOPrefs::instance()->mMonthShowIcons ) {
481 if ( mInfo ) { 493 if ( mInfo ) {
482 x += size + 1; 494 x += size + 1;
483 } 495 }
484 if( mRecur ) { 496 if( mRecur ) {
485 x += size+1; 497 x += size+1;
@@ -505,56 +517,56 @@ int MonthViewItem::width(const QListBox *lb) const
505MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) 517MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
506 : KNoScrollListBox( par ), 518 : KNoScrollListBox( par ),
507 mMonthView( parent ) 519 mMonthView( parent )
508{ 520{
509 //QVBoxLayout *topLayout = new QVBoxLayout( this ); 521 //QVBoxLayout *topLayout = new QVBoxLayout( this );
510 currentPalette = 0; 522 currentPalette = 0;
511 // mLabel = new QLabel( this );QPushButton 523 // mLabel = new QLabel( this );QPushButton
512 mLabel = new QPushButton( this ); 524 mLabel = new QPushButton( this );
513 //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); 525 //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain );
514 //mLabel->setLineWidth( 1 ); 526 //mLabel->setLineWidth( 1 );
515 //mLabel->setAlignment( AlignCenter ); 527 //mLabel->setAlignment( AlignCenter );
516 mLabel->setFlat( true ); 528 mLabel->setFlat( true );
517 mLabel->setFocusPolicy(NoFocus); 529 mLabel->setFocusPolicy(Qt::NoFocus);
518 //mItemList = new KNoScrollListBox( this ); 530 //mItemList = new KNoScrollListBox( this );
519 setMinimumSize( 10, 10 ); 531 setMinimumSize( 10, 10 );
520 setFrameStyle( QFrame::Panel | QFrame::Plain ); 532 setFrameStyle( Q3Frame::Panel | Q3Frame::Plain );
521 setLineWidth( 1 ); 533 setLineWidth( 1 );
522 //topLayout->addWidget( mItemList ); 534 //topLayout->addWidget( mItemList );
523 mLabel->raise(); 535 mLabel->raise();
524 // QColor( 0,0,255 ) QColor( 160,1600,255 ) 536 // QColor( 0,0,255 ) QColor( 160,1600,255 )
525 mStandardPalette = palette(); 537 mStandardPalette = palette();
526 mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); 538 mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) );
527 539
528 enableScrollBars( false ); 540 enableScrollBars( false );
529 updateConfig(); 541 updateConfig();
530 //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); 542 //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() ));
531 connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); 543 connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() ));
532 connect( this , SIGNAL( doubleClicked( QListBoxItem *) ), 544 connect( this , SIGNAL( doubleClicked( Q3ListBoxItem *) ),
533 SLOT( defaultAction( QListBoxItem * ) ) ); 545 SLOT( defaultAction( Q3ListBoxItem * ) ) );
534 connect( this, SIGNAL( rightButtonPressed( QListBoxItem *, 546 connect( this, SIGNAL( rightButtonPressed( Q3ListBoxItem *,
535 const QPoint &) ), 547 const QPoint &) ),
536 SLOT( contextMenu( QListBoxItem * ) ) ); 548 SLOT( contextMenu( Q3ListBoxItem * ) ) );
537 connect( this, SIGNAL( highlighted( QListBoxItem *) ), 549 connect( this, SIGNAL( highlighted( Q3ListBoxItem *) ),
538 SLOT( selection( QListBoxItem * ) ) ); 550 SLOT( selection( Q3ListBoxItem * ) ) );
539 551
540 /* 552 /*
541 connect( this, SIGNAL( clicked( QListBoxItem * ) ), 553 connect( this, SIGNAL( clicked( QListBoxItem * ) ),
542 SLOT( selection( QListBoxItem * ) ) ); 554 SLOT( selection( QListBoxItem * ) ) );
543 */ 555 */
544} 556}
545#ifdef DESKTOP_VERSION 557#ifdef DESKTOP_VERSION
546QToolTipGroup *MonthViewCell::toolTipGroup() 558QToolTipGroup *MonthViewCell::toolTipGroup()
547{ 559{
548 if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); 560 /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */
549 return mToolTipGroup; 561 return mToolTipGroup;
550} 562}
551#endif 563#endif
552 564
553void MonthViewCell::setDate( const QDate &date ) 565void MonthViewCell::setDate( const QDate &date )
554{ 566{
555 // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl; 567 // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl;
556 mDate = date; 568 mDate = date;
557 569
558 570
559 571
560 //resizeEvent( 0 ); 572 //resizeEvent( 0 );
@@ -628,25 +640,25 @@ void MonthViewCell::setHoliday( const QString &holiday )
628{ 640{
629 mHolidayString = holiday; 641 mHolidayString = holiday;
630 642
631 if ( !holiday.isEmpty() ) { 643 if ( !holiday.isEmpty() ) {
632 setHoliday( true ); 644 setHoliday( true );
633 } 645 }
634} 646}
635 647
636void MonthViewCell::startUpdateCell() 648void MonthViewCell::startUpdateCell()
637{ 649{
638 blockSignals( true ); 650 blockSignals( true );
639 mdayCount = 0; 651 mdayCount = 0;
640 setFocusPolicy(NoFocus); 652 setFocusPolicy(Qt::NoFocus);
641 if ( !mMonthView->isUpdatePossible() ) 653 if ( !mMonthView->isUpdatePossible() )
642 return; 654 return;
643 MonthViewItem *mitem = (MonthViewItem*) firstItem (); 655 MonthViewItem *mitem = (MonthViewItem*) firstItem ();
644 while ( mitem ) { 656 while ( mitem ) {
645 mitem->setBlockRepaint( true ); 657 mitem->setBlockRepaint( true );
646 mitem = (MonthViewItem *)mitem->next(); 658 mitem = (MonthViewItem *)mitem->next();
647 } 659 }
648 if ( mAvailItemList.count() > 20 ) { 660 if ( mAvailItemList.count() > 20 ) {
649 mAvailItemList.setAutoDelete( true ); 661 mAvailItemList.setAutoDelete( true );
650 mAvailItemList.clear(); 662 mAvailItemList.clear();
651 mAvailItemList.setAutoDelete( false ); 663 mAvailItemList.setAutoDelete( false );
652 clear(); 664 clear();
@@ -683,25 +695,25 @@ void MonthViewCell::startUpdateCell()
683 mToolTip.append ( mHolidayString ); 695 mToolTip.append ( mHolidayString );
684 } 696 }
685#endif 697#endif
686} 698}
687 699
688int MonthViewCell::insertEvent(Event *event) 700int MonthViewCell::insertEvent(Event *event)
689{ 701{
690 bool useToolTips = true; 702 bool useToolTips = true;
691#ifndef DESKTOP_VERSION 703#ifndef DESKTOP_VERSION
692 useToolTips = false; 704 useToolTips = false;
693#endif 705#endif
694 QString mToolTipText; 706 QString mToolTipText;
695 setFocusPolicy(WheelFocus); 707 setFocusPolicy(Qt::WheelFocus);
696 if ( !(event->doesRecur() == Recurrence::rNone) ) { 708 if ( !(event->doesRecur() == Recurrence::rNone) ) {
697 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) 709 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
698 return mdayCount; 710 return mdayCount;
699 else 711 else
700 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) 712 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
701 return mdayCount; 713 return mdayCount;
702 } 714 }
703 715
704 if ( event->isHoliday()) { 716 if ( event->isHoliday()) {
705 setHoliday( true ); 717 setHoliday( true );
706 if ( mDate.dayOfWeek() == 7 ) 718 if ( mDate.dayOfWeek() == 7 )
707 setLineWidth( 3 ); 719 setLineWidth( 3 );
@@ -825,41 +837,41 @@ int MonthViewCell::insertEvent(Event *event)
825 insertItem( item ,mdayCount); 837 insertItem( item ,mdayCount);
826 ++mdayCount; 838 ++mdayCount;
827 } else { 839 } else {
828 uint i = mdayCount; 840 uint i = mdayCount;
829 uint pos = mdayCount; 841 uint pos = mdayCount;
830 uint itcount = count(); 842 uint itcount = count();
831 if ( itcount > 1000 ) { 843 if ( itcount > 1000 ) {
832 qDebug("KO: Bug in MonthViewCell::insertEvent %u ", itcount); 844 qDebug("KO: Bug in MonthViewCell::insertEvent %u ", itcount);
833 itcount = 0; 845 itcount = 0;
834 } 846 }
835 for ( i = pos; i < itcount;++i ) { 847 for ( i = pos; i < itcount;++i ) {
836 // qDebug("i %d mday %u count %d ",i,itcount,mdayCount ); 848 // qDebug("i %d mday %u count %d ",i,itcount,mdayCount );
837 QListBoxItem* it = this->item ( i ); 849 Q3ListBoxItem* it = this->item ( i );
838 if ( it && text < it->text() ) { 850 if ( it && text < it->text() ) {
839 pos = i; 851 pos = i;
840 break; 852 break;
841 } 853 }
842 ++pos; 854 ++pos;
843 } 855 }
844 insertItem( item ,pos); 856 insertItem( item ,pos);
845 } 857 }
846 if ( useToolTips ) { 858 if ( useToolTips ) {
847 mToolTip.append( mToolTipText ); 859 mToolTip.append( mToolTipText );
848 } 860 }
849 return mdayCount; 861 return mdayCount;
850} 862}
851void MonthViewCell::insertTodo(Todo *todo) 863void MonthViewCell::insertTodo(Todo *todo)
852{ 864{
853 setFocusPolicy(WheelFocus); 865 setFocusPolicy(Qt::WheelFocus);
854 QString text; 866 QString text;
855 if (todo->hasDueDate()) { 867 if (todo->hasDueDate()) {
856 if (!todo->doesFloat()) { 868 if (!todo->doesFloat()) {
857 text += KGlobal::locale()->formatTime(todo->dtDue().time()); 869 text += KGlobal::locale()->formatTime(todo->dtDue().time());
858 text += " "; 870 text += " ";
859 } 871 }
860 } 872 }
861 text += todo->summary(); 873 text += todo->summary();
862 MonthViewItem *item ; 874 MonthViewItem *item ;
863 if ( mAvailItemList.count() ) { 875 if ( mAvailItemList.count() ) {
864 item = mAvailItemList.first(); 876 item = mAvailItemList.first();
865 mAvailItemList.remove( item ); 877 mAvailItemList.remove( item );
@@ -913,47 +925,47 @@ void MonthViewCell::repaintfinishUpdateCell()
913 mitem = (MonthViewItem *)mitem->next(); 925 mitem = (MonthViewItem *)mitem->next();
914 } 926 }
915 blockSignals( false ); 927 blockSignals( false );
916} 928}
917void MonthViewCell::finishUpdateCell() 929void MonthViewCell::finishUpdateCell()
918{ 930{
919 931
920 932
921 933
922#ifdef DESKTOP_VERSION 934#ifdef DESKTOP_VERSION
923 if (mToolTip.count() > 0 ) { 935 if (mToolTip.count() > 0 ) {
924 mToolTip.sort(); 936 mToolTip.sort();
925 QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); 937 /* TODO: hacker: QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); */
926 } 938 }
927#endif 939#endif
928 //sort(); 940 //sort();
929 //setMyPalette(); 941 //setMyPalette();
930 setMyPalette(); 942 setMyPalette();
931 943
932 resizeEvent( 0 ); 944 resizeEvent( 0 );
933 945
934} 946}
935void MonthViewCell::updateCell() 947void MonthViewCell::updateCell()
936{ 948{
937 if ( !mMonthView->isUpdatePossible() ) 949 if ( !mMonthView->isUpdatePossible() )
938 return; 950 return;
939 startUpdateCell(); 951 startUpdateCell();
940 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 952 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
941 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); 953 Q3PtrList<Event> events = mMonthView->calendar()->events( mDate, true );
942 Event *event; 954 Event *event;
943 for( event = events.first(); event; event = events.next() ) { // for event 955 for( event = events.first(); event; event = events.next() ) { // for event
944 insertEvent(event); 956 insertEvent(event);
945 } 957 }
946 // insert due todos 958 // insert due todos
947 QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); 959 Q3PtrList<Todo> todos = mMonthView->calendar()->todos( mDate );
948 Todo *todo; 960 Todo *todo;
949 for(todo = todos.first(); todo; todo = todos.next()) { 961 for(todo = todos.first(); todo; todo = todos.next()) {
950 insertTodo( todo ); 962 insertTodo( todo );
951 } 963 }
952 finishUpdateCell(); 964 finishUpdateCell();
953 // if ( isVisible()) 965 // if ( isVisible())
954 //qApp->processEvents(); 966 //qApp->processEvents();
955} 967}
956 968
957void MonthViewCell::updateConfig( bool bigFont ) // = false 969void MonthViewCell::updateConfig( bool bigFont ) // = false
958{ 970{
959 971
@@ -983,46 +995,46 @@ void MonthViewCell::updateConfig( bool bigFont ) // = false
983 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); 995 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark());
984 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); 996 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor);
985 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); 997 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor);
986 } 998 }
987 //updateCell(); 999 //updateCell();
988} 1000}
989 1001
990void MonthViewCell::enableScrollBars( bool enabled ) 1002void MonthViewCell::enableScrollBars( bool enabled )
991{ 1003{
992 1004
993 return; 1005 return;
994 if ( enabled ) { 1006 if ( enabled ) {
995 QListBoxItem *fi = firstItem (); 1007 Q3ListBoxItem *fi = firstItem ();
996 if (fi ) { 1008 if (fi ) {
997 int ihei = fi->height( this ); 1009 int ihei = fi->height( this );
998 int hei = numRows () * ihei; 1010 int hei = numRows () * ihei;
999 if ( hei < height() - horizontalScrollBar()->height () ) { 1011 if ( hei < height() - horizontalScrollBar()->height () ) {
1000 setVScrollBarMode(QScrollView::AlwaysOff); 1012 setVScrollBarMode(Q3ScrollView::AlwaysOff);
1001 } 1013 }
1002 else 1014 else
1003 setVScrollBarMode(QScrollView::Auto); 1015 setVScrollBarMode(Q3ScrollView::Auto);
1004 if ( ihei *3 > height() ) { 1016 if ( ihei *3 > height() ) {
1005 setHScrollBarMode(QScrollView::AlwaysOff); 1017 setHScrollBarMode(Q3ScrollView::AlwaysOff);
1006 } 1018 }
1007 else { 1019 else {
1008 setHScrollBarMode(QScrollView::Auto); 1020 setHScrollBarMode(Q3ScrollView::Auto);
1009 } 1021 }
1010 } else { 1022 } else {
1011 setVScrollBarMode(QScrollView::Auto); 1023 setVScrollBarMode(Q3ScrollView::Auto);
1012 setHScrollBarMode(QScrollView::Auto); 1024 setHScrollBarMode(Q3ScrollView::Auto);
1013 } 1025 }
1014 } else { 1026 } else {
1015 setVScrollBarMode(QScrollView::AlwaysOff); 1027 setVScrollBarMode(Q3ScrollView::AlwaysOff);
1016 setHScrollBarMode(QScrollView::AlwaysOff); 1028 setHScrollBarMode(Q3ScrollView::AlwaysOff);
1017 } 1029 }
1018} 1030}
1019 1031
1020Incidence *MonthViewCell::selectedIncidence() 1032Incidence *MonthViewCell::selectedIncidence()
1021{ 1033{
1022 int index = currentItem(); 1034 int index = currentItem();
1023 if ( index < 0 ) return 0; 1035 if ( index < 0 ) return 0;
1024 1036
1025 MonthViewItem *mitem = 1037 MonthViewItem *mitem =
1026 static_cast<MonthViewItem *>( item( index ) ); 1038 static_cast<MonthViewItem *>( item( index ) );
1027 1039
1028 if ( !mitem ) return 0; 1040 if ( !mitem ) return 0;
@@ -1074,75 +1086,75 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e )
1074 if ( size > 0 ) 1086 if ( size > 0 )
1075 verticalScrollBar()->setMaximumHeight( size ); 1087 verticalScrollBar()->setMaximumHeight( size );
1076 size = width() - mLabel->width() -lineWidth()-1; 1088 size = width() - mLabel->width() -lineWidth()-1;
1077 if ( size > 0 ) 1089 if ( size > 0 )
1078 horizontalScrollBar()->setMaximumWidth( size ); 1090 horizontalScrollBar()->setMaximumWidth( size );
1079 mLabel->move( width()-lineWidth() - mLabel->width(), height()-lineWidth() - mLabel->height() ); 1091 mLabel->move( width()-lineWidth() - mLabel->width(), height()-lineWidth() - mLabel->height() );
1080 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 1092 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
1081 // mItemList->resize ( width(), height () ); 1093 // mItemList->resize ( width(), height () );
1082 if ( e ) 1094 if ( e )
1083 KNoScrollListBox::resizeEvent ( e ); 1095 KNoScrollListBox::resizeEvent ( e );
1084} 1096}
1085 1097
1086void MonthViewCell::defaultAction( QListBoxItem *item ) 1098void MonthViewCell::defaultAction( Q3ListBoxItem *item )
1087{ 1099{
1088 1100
1089 if ( !item ) { 1101 if ( !item ) {
1090 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 1102 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
1091 emit newEventSignal( dt ); 1103 emit newEventSignal( dt );
1092 return; 1104 return;
1093 } 1105 }
1094 1106
1095 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 1107 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
1096 Incidence *incidence = eventItem->incidence(); 1108 Incidence *incidence = eventItem->incidence();
1097 if ( incidence ) mMonthView->defaultAction( incidence ); 1109 if ( incidence ) mMonthView->defaultAction( incidence );
1098} 1110}
1099void MonthViewCell::showDay() 1111void MonthViewCell::showDay()
1100{ 1112{
1101 emit showDaySignal( date() ); 1113 emit showDaySignal( date() );
1102} 1114}
1103void MonthViewCell::newEvent() 1115void MonthViewCell::newEvent()
1104{ 1116{
1105 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 1117 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
1106 emit newEventSignal( dt ); 1118 emit newEventSignal( dt );
1107} 1119}
1108void MonthViewCell::cellClicked( QListBoxItem *item ) 1120void MonthViewCell::cellClicked( Q3ListBoxItem *item )
1109{ 1121{
1110 mMonthView->setSelectedCell( this ); 1122 mMonthView->setSelectedCell( this );
1111 if ( item == 0 ) { 1123 if ( item == 0 ) {
1112 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 1124 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
1113 emit newEventSignal( dt ); 1125 emit newEventSignal( dt );
1114 return; 1126 return;
1115 } 1127 }
1116 1128
1117} 1129}
1118 1130
1119void MonthViewCell::contextMenu( QListBoxItem *item ) 1131void MonthViewCell::contextMenu( Q3ListBoxItem *item )
1120{ 1132{
1121 mMonthView->setPopupCell( this ); 1133 mMonthView->setPopupCell( this );
1122 if ( !item ) { 1134 if ( !item ) {
1123 mMonthView->showContextMenu( 0 ); 1135 mMonthView->showContextMenu( 0 );
1124 return; 1136 return;
1125 } 1137 }
1126 //selection( item ); 1138 //selection( item );
1127 //qApp->processEvents(); 1139 //qApp->processEvents();
1128 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 1140 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
1129 Incidence *incidence = eventItem->incidence(); 1141 Incidence *incidence = eventItem->incidence();
1130 if ( incidence ) { 1142 if ( incidence ) {
1131 mBlockDeselect = true; 1143 mBlockDeselect = true;
1132 mMonthView->showContextMenu( incidence ); 1144 mMonthView->showContextMenu( incidence );
1133 } 1145 }
1134} 1146}
1135 1147
1136void MonthViewCell::selection( QListBoxItem *item ) 1148void MonthViewCell::selection( Q3ListBoxItem *item )
1137{ 1149{
1138 if ( !item ) { 1150 if ( !item ) {
1139 emit highlightIncidence( 0 , this, 0 ); 1151 emit highlightIncidence( 0 , this, 0 );
1140 return; 1152 return;
1141 } 1153 }
1142 MonthViewItem * it = (static_cast<MonthViewItem *>( item )); 1154 MonthViewItem * it = (static_cast<MonthViewItem *>( item ));
1143 emit highlightIncidence( it->incidence(), this, it->multiDay() ); 1155 emit highlightIncidence( it->incidence(), this, it->multiDay() );
1144 mMonthView->setSelectedCell( this ); 1156 mMonthView->setSelectedCell( this );
1145} 1157}
1146 1158
1147void MonthViewCell::deHighLight() 1159void MonthViewCell::deHighLight()
1148{ 1160{
@@ -1176,26 +1188,26 @@ bool MonthViewCell::doHighLight( Incidence * inc )
1176KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) 1188KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
1177 : KOEventView( calendar, parent, name ), 1189 : KOEventView( calendar, parent, name ),
1178 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), 1190 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ),
1179 mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) 1191 mWidthLongDayLabel( 0 ), mSelectedCell( 0 )
1180{ 1192{
1181 mFlagKeyPressed = false; 1193 mFlagKeyPressed = false;
1182 mShortDayLabelsM = false; 1194 mShortDayLabelsM = false;
1183 mShortDayLabelsW = false; 1195 mShortDayLabelsW = false;
1184 skipResize = false; 1196 skipResize = false;
1185 clPending = true; 1197 clPending = true;
1186 mPopupCell = 0; 1198 mPopupCell = 0;
1187 mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); 1199 mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" );
1188 mWidStack = new QWidgetStack( this ); 1200 mWidStack = new Q3WidgetStack( this );
1189 QVBoxLayout* hb = new QVBoxLayout( this ); 1201 Q3VBoxLayout* hb = new Q3VBoxLayout( this );
1190 mMonthView = new QWidget( mWidStack ); 1202 mMonthView = new QWidget( mWidStack );
1191 mWeekView = new QWidget( mWidStack ); 1203 mWeekView = new QWidget( mWidStack );
1192#if QT_VERSION >= 0x030000 1204#if QT_VERSION >= 0x030000
1193 mWidStack->addWidget(mMonthView ); 1205 mWidStack->addWidget(mMonthView );
1194 mWidStack->addWidget(mWeekView ); 1206 mWidStack->addWidget(mWeekView );
1195#else 1207#else
1196 mWidStack->addWidget( mMonthView, 1 ); 1208 mWidStack->addWidget( mMonthView, 1 );
1197 mWidStack->addWidget( mWeekView , 1 ); 1209 mWidStack->addWidget( mWeekView , 1 );
1198#endif 1210#endif
1199 hb->addWidget( mNavigatorBar ); 1211 hb->addWidget( mNavigatorBar );
1200 hb->addWidget( mWidStack ); 1212 hb->addWidget( mWidStack );
1201 mShowWeekView = KOPrefs::instance()->mMonthViewWeek; 1213 mShowWeekView = KOPrefs::instance()->mMonthViewWeek;
@@ -1206,69 +1218,69 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
1206 mDayLabels.resize( mDaysPerWeek ); 1218 mDayLabels.resize( mDaysPerWeek );
1207 mDayLabelsW.resize( mDaysPerWeek ); 1219 mDayLabelsW.resize( mDaysPerWeek );
1208 QFont bfont = font(); 1220 QFont bfont = font();
1209 if ( QApplication::desktop()->width() < 650 ) { 1221 if ( QApplication::desktop()->width() < 650 ) {
1210 bfont.setPointSize( bfont.pointSize() - 2 ); 1222 bfont.setPointSize( bfont.pointSize() - 2 );
1211 } 1223 }
1212 bfont.setBold( true ); 1224 bfont.setBold( true );
1213 int i; 1225 int i;
1214 1226
1215 for( i = 0; i < mDaysPerWeek; i++ ) { 1227 for( i = 0; i < mDaysPerWeek; i++ ) {
1216 QLabel *label = new QLabel( mMonthView ); 1228 QLabel *label = new QLabel( mMonthView );
1217 label->setFont(bfont); 1229 label->setFont(bfont);
1218 label->setFrameStyle(QFrame::Panel|QFrame::Raised); 1230 label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised);
1219 label->setLineWidth(1); 1231 label->setLineWidth(1);
1220 label->setAlignment(AlignCenter); 1232 label->setAlignment(Qt::AlignCenter);
1221 mDayLabels.insert( i, label ); 1233 mDayLabels.insert( i, label );
1222 label = new QLabel( mWeekView ); 1234 label = new QLabel( mWeekView );
1223 label->setFont(bfont); 1235 label->setFont(bfont);
1224 label->setFrameStyle(QFrame::Panel|QFrame::Raised); 1236 label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised);
1225 label->setLineWidth(1); 1237 label->setLineWidth(1);
1226 label->setAlignment(AlignCenter); 1238 label->setAlignment(Qt::AlignCenter);
1227 mDayLabelsW.insert( i, label ); 1239 mDayLabelsW.insert( i, label );
1228 } 1240 }
1229 1241
1230 bfont.setBold( false ); 1242 bfont.setBold( false );
1231 mWeekLabels.resize( mNumWeeks+1 ); 1243 mWeekLabels.resize( mNumWeeks+1 );
1232 mWeekLabelsW.resize( 2 ); 1244 mWeekLabelsW.resize( 2 );
1233 for( i = 0; i < mNumWeeks+1; i++ ) { 1245 for( i = 0; i < mNumWeeks+1; i++ ) {
1234 KOWeekButton *label = new KOWeekButton( mMonthView ); 1246 KOWeekButton *label = new KOWeekButton( mMonthView );
1235 label->setFocusPolicy(NoFocus); 1247 label->setFocusPolicy(Qt::NoFocus);
1236 label->setFont(bfont); 1248 label->setFont(bfont);
1237 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); 1249 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
1238 label->setFlat(true); 1250 label->setFlat(true);
1239 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); 1251 Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
1240 //label->setFrameStyle(QFrame::Panel|QFrame::Raised); 1252 //label->setFrameStyle(QFrame::Panel|QFrame::Raised);
1241 //label->setLineWidth(1); 1253 //label->setLineWidth(1);
1242 //label->setAlignment(AlignCenter); 1254 //label->setAlignment(AlignCenter);
1243 mWeekLabels.insert( i, label ); 1255 mWeekLabels.insert( i, label );
1244 } 1256 }
1245 mWeekLabels[mNumWeeks]->setText( i18n("W")); 1257 mWeekLabels[mNumWeeks]->setText( i18n("W"));
1246 mWeekLabels[mNumWeeks]->setFocusPolicy(WheelFocus); 1258 mWeekLabels[mNumWeeks]->setFocusPolicy(Qt::WheelFocus);
1247 QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); 1259 Q3WhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number"));
1248 1260
1249 for( i = 0; i < 1+1; i++ ) { 1261 for( i = 0; i < 1+1; i++ ) {
1250 KOWeekButton *label = new KOWeekButton( mWeekView ); 1262 KOWeekButton *label = new KOWeekButton( mWeekView );
1251 label->setFocusPolicy(NoFocus); 1263 label->setFocusPolicy(Qt::NoFocus);
1252 label->setFont(bfont); 1264 label->setFont(bfont);
1253 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); 1265 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
1254 label->setFlat(true); 1266 label->setFlat(true);
1255 QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); 1267 Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
1256 //label->setFrameStyle(QFrame::Panel|QFrame::Raised); 1268 //label->setFrameStyle(QFrame::Panel|QFrame::Raised);
1257 //label->setLineWidth(1); 1269 //label->setLineWidth(1);
1258 //label->setAlignment(AlignCenter); 1270 //label->setAlignment(AlignCenter);
1259 mWeekLabelsW.insert( i, label ); 1271 mWeekLabelsW.insert( i, label );
1260 } 1272 }
1261 mWeekLabelsW[1]->setText( i18n("W")); 1273 mWeekLabelsW[1]->setText( i18n("W"));
1262 mWeekLabelsW[1]->setFocusPolicy(WheelFocus); 1274 mWeekLabelsW[1]->setFocusPolicy(Qt::WheelFocus);
1263 1275
1264 1276
1265 int row, col; 1277 int row, col;
1266 mCells.resize( mNumCells ); 1278 mCells.resize( mNumCells );
1267 for( row = 0; row < mNumWeeks; ++row ) { 1279 for( row = 0; row < mNumWeeks; ++row ) {
1268 for( col = 0; col < mDaysPerWeek; ++col ) { 1280 for( col = 0; col < mDaysPerWeek; ++col ) {
1269 MonthViewCell *cell = new MonthViewCell( this, mMonthView ); 1281 MonthViewCell *cell = new MonthViewCell( this, mMonthView );
1270 mCells.insert( row * mDaysPerWeek + col, cell ); 1282 mCells.insert( row * mDaysPerWeek + col, cell );
1271 1283
1272 connect( cell, SIGNAL( defaultAction( Incidence * ) ), 1284 connect( cell, SIGNAL( defaultAction( Incidence * ) ),
1273 SLOT( defaultAction( Incidence * ) ) ); 1285 SLOT( defaultAction( Incidence * ) ) );
1274 connect( cell, SIGNAL( newEventSignal( QDateTime ) ), 1286 connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
@@ -1296,45 +1308,45 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
1296 SIGNAL( showDaySignal( QDate ) ) ); 1308 SIGNAL( showDaySignal( QDate ) ) );
1297 connect( cell, SIGNAL( nextCell() ), 1309 connect( cell, SIGNAL( nextCell() ),
1298 SLOT( nextCell() ) ); 1310 SLOT( nextCell() ) );
1299 connect( cell, SIGNAL( prevCell() ), 1311 connect( cell, SIGNAL( prevCell() ),
1300 SLOT( prevCell() ) ); 1312 SLOT( prevCell() ) );
1301 connect( cell, SIGNAL( highlightIncidence( Incidence * , MonthViewCell *, int ) ), 1313 connect( cell, SIGNAL( highlightIncidence( Incidence * , MonthViewCell *, int ) ),
1302 SLOT( incidenceHighlighted( Incidence *, MonthViewCell *, int ) )); 1314 SLOT( incidenceHighlighted( Incidence *, MonthViewCell *, int ) ));
1303 cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); 1315 cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont );
1304 } 1316 }
1305 1317
1306 //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); 1318 //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) );
1307 mContextMenu = eventPopup(); 1319 mContextMenu = eventPopup();
1308 mContextMenu->addAdditionalItem(QIconSet(QPixmap()), 1320 mContextMenu->addAdditionalItem(QIcon(QPixmap()),
1309 i18n("New Event..."),this, 1321 i18n("New Event..."),this,
1310 SLOT(slotNewEvent()),false); 1322 SLOT(slotNewEvent()),false);
1311 mContextMenu->addAdditionalItem(QIconSet(QPixmap()), 1323 mContextMenu->addAdditionalItem(QIcon(QPixmap()),
1312 i18n("New Todo..."),this, 1324 i18n("New Todo..."),this,
1313 SLOT(slotNewTodo()),false); 1325 SLOT(slotNewTodo()),false);
1314 mContextMenu->addAdditionalItem(QIconSet(QPixmap()), 1326 mContextMenu->addAdditionalItem(QIcon(QPixmap()),
1315 i18n("Journal"),this, 1327 i18n("Journal"),this,
1316 SLOT(slotEditJournal()),false); 1328 SLOT(slotEditJournal()),false);
1317 1329
1318 connect (mContextMenu ,SIGNAL(categoryChanged( Incidence * )),this, 1330 connect (mContextMenu ,SIGNAL(categoryChanged( Incidence * )),this,
1319 SLOT( catChanged( Incidence * ) )); 1331 SLOT( catChanged( Incidence * ) ));
1320 1332
1321 1333
1322 QString pathString = ""; 1334 QString pathString = "";
1323 if ( !KOPrefs::instance()->mToolBarMiniIcons ) { 1335 if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
1324 if ( QApplication::desktop()->width() < 480 ) 1336 if ( QApplication::desktop()->width() < 480 )
1325 pathString += "icons16/"; 1337 pathString += "icons16/";
1326 } else 1338 } else
1327 pathString += "iconsmini/"; 1339 pathString += "iconsmini/";
1328 mNewItemMenu = new QPopupMenu( this ); 1340 mNewItemMenu = new Q3PopupMenu( this );
1329 mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent())); 1341 mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent()));
1330 mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false); 1342 mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false);
1331 mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false); 1343 mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false);
1332 1344
1333 // updateConfig(); //useless here... 1345 // updateConfig(); //useless here...
1334 // ... but we need mWidthLongDayLabel computed 1346 // ... but we need mWidthLongDayLabel computed
1335 QFontMetrics fontmetric(mDayLabels[0]->font()); 1347 QFontMetrics fontmetric(mDayLabels[0]->font());
1336 mWidthLongDayLabel = 0; 1348 mWidthLongDayLabel = 0;
1337 for (int i = 0; i < 7; i++) { 1349 for (int i = 0; i < 7; i++) {
1338 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); 1350 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
1339 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; 1351 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
1340 } 1352 }
@@ -1388,25 +1400,25 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
1388 lastCell = mc; 1400 lastCell = mc;
1389 //qDebug("KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday ); 1401 //qDebug("KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday );
1390 1402
1391 bool weekview = false; 1403 bool weekview = false;
1392 uint index = 0; 1404 uint index = 0;
1393 for (uint i = 0; i < mCellsW.count(); ++i) { 1405 for (uint i = 0; i < mCellsW.count(); ++i) {
1394 if ( mCellsW[i] == mc ) { 1406 if ( mCellsW[i] == mc ) {
1395 weekview = true; 1407 weekview = true;
1396 index = i; 1408 index = i;
1397 break; 1409 break;
1398 } 1410 }
1399 } 1411 }
1400 QPtrVector<MonthViewCell> *cells; 1412 Q3PtrVector<MonthViewCell> *cells;
1401 if ( weekview ) 1413 if ( weekview )
1402 cells = &mCellsW; 1414 cells = &mCellsW;
1403 else { 1415 else {
1404 for (uint i = 0; i < mCells.count(); ++i) { 1416 for (uint i = 0; i < mCells.count(); ++i) {
1405 if ( mCells[i] == mc ) { 1417 if ( mCells[i] == mc ) {
1406 index = i; 1418 index = i;
1407 break; 1419 break;
1408 } 1420 }
1409 } 1421 }
1410 cells = &mCells; 1422 cells = &mCells;
1411 } 1423 }
1412 for (uint i = 0; i < (*cells).count(); ++i) { 1424 for (uint i = 0; i < (*cells).count(); ++i) {
@@ -1486,27 +1498,27 @@ void KOMonthView::switchView()
1486} 1498}
1487 1499
1488int KOMonthView::maxDatesHint() 1500int KOMonthView::maxDatesHint()
1489{ 1501{
1490 return mNumCells; 1502 return mNumCells;
1491} 1503}
1492 1504
1493int KOMonthView::currentDateCount() 1505int KOMonthView::currentDateCount()
1494{ 1506{
1495 return mNumCells; 1507 return mNumCells;
1496} 1508}
1497 1509
1498QPtrList<Incidence> KOMonthView::selectedIncidences() 1510Q3PtrList<Incidence> KOMonthView::selectedIncidences()
1499{ 1511{
1500 QPtrList<Incidence> selected; 1512 Q3PtrList<Incidence> selected;
1501 1513
1502 if ( mSelectedCell ) { 1514 if ( mSelectedCell ) {
1503 Incidence *incidence = mSelectedCell->selectedIncidence(); 1515 Incidence *incidence = mSelectedCell->selectedIncidence();
1504 if ( incidence ) selected.append( incidence ); 1516 if ( incidence ) selected.append( incidence );
1505 } 1517 }
1506 1518
1507 return selected; 1519 return selected;
1508} 1520}
1509 1521
1510DateList KOMonthView::selectedDates() 1522DateList KOMonthView::selectedDates()
1511{ 1523{
1512 DateList selected; 1524 DateList selected;
@@ -1552,33 +1564,33 @@ void KOMonthView::updateConfig()
1552 updateDayLabels(); 1564 updateDayLabels();
1553 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); 1565 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks);
1554 //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; 1566 //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks;
1555 //resizeEvent( 0 ); 1567 //resizeEvent( 0 );
1556 for (uint i = 0; i < mCells.count(); ++i) { 1568 for (uint i = 0; i < mCells.count(); ++i) {
1557 mCells[i]->updateConfig(); 1569 mCells[i]->updateConfig();
1558 } 1570 }
1559 1571
1560 for (uint i = 0; i < mCellsW.count(); ++i) { 1572 for (uint i = 0; i < mCellsW.count(); ++i) {
1561 mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); 1573 mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont);
1562 } 1574 }
1563#ifdef DESKTOP_VERSION 1575#ifdef DESKTOP_VERSION
1564 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); 1576 /* TODO:hacker: MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); */
1565#endif 1577#endif
1566 updateView(); 1578 updateView();
1567} 1579}
1568 1580
1569void KOMonthView::updateDayLabels() 1581void KOMonthView::updateDayLabels()
1570{ 1582{
1571 1583
1572 QPtrVector<QLabel> *mDayLabelsT; 1584 Q3PtrVector<QLabel> *mDayLabelsT;
1573 1585
1574 mDayLabelsT = &mDayLabelsW; 1586 mDayLabelsT = &mDayLabelsW;
1575 for (int i = 0; i < 7; i++) { 1587 for (int i = 0; i < 7; i++) {
1576 { 1588 {
1577 bool show = mShortDayLabelsW; 1589 bool show = mShortDayLabelsW;
1578 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) 1590 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
1579 show = true; 1591 show = true;
1580 (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); 1592 (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
1581 } 1593 }
1582 } 1594 }
1583 mDayLabelsT = &mDayLabels; 1595 mDayLabelsT = &mDayLabels;
1584 for (int i = 0; i < 7; i++) { 1596 for (int i = 0; i < 7; i++) {
@@ -1601,27 +1613,27 @@ void KOMonthView::clearList()
1601 unsigned int i; 1613 unsigned int i;
1602 for( i = 0; i < mCells.size(); ++i ) { 1614 for( i = 0; i < mCells.size(); ++i ) {
1603 mCells[i]->clear(); 1615 mCells[i]->clear();
1604 } 1616 }
1605 for( i = 0; i < mCellsW.size(); ++i ) { 1617 for( i = 0; i < mCellsW.size(); ++i ) {
1606 mCellsW[i]->clear(); 1618 mCellsW[i]->clear();
1607 } 1619 }
1608} 1620}
1609void KOMonthView::showDates(const QDate &start, const QDate &) 1621void KOMonthView::showDates(const QDate &start, const QDate &)
1610{ 1622{
1611 // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; 1623 // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl;
1612 1624
1613 QPtrVector<MonthViewCell> *cells; 1625 Q3PtrVector<MonthViewCell> *cells;
1614 QPtrVector<QLabel> *dayLabels; 1626 Q3PtrVector<QLabel> *dayLabels;
1615 QPtrVector<KOWeekButton> *weekLabels; 1627 Q3PtrVector<KOWeekButton> *weekLabels;
1616 uint weekNum = 6; 1628 uint weekNum = 6;
1617 mStartDate = start; 1629 mStartDate = start;
1618 if ( mShowWeekView ) { 1630 if ( mShowWeekView ) {
1619 weekNum = 1; 1631 weekNum = 1;
1620 cells = &mCellsW; 1632 cells = &mCellsW;
1621 dayLabels = &mDayLabelsW; 1633 dayLabels = &mDayLabelsW;
1622 weekLabels = &mWeekLabelsW; 1634 weekLabels = &mWeekLabelsW;
1623 if ( !KGlobal::locale()->weekStartsMonday() ) { 1635 if ( !KGlobal::locale()->weekStartsMonday() ) {
1624 mStartDate = mStartDate.addDays( 1 ); 1636 mStartDate = mStartDate.addDays( 1 );
1625 } 1637 }
1626 } else { 1638 } else {
1627 cells = &mCells; 1639 cells = &mCells;
@@ -1659,62 +1671,62 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
1659 // not just 1. 1671 // not just 1.
1660 int dayOfYear = date.dayOfYear(); 1672 int dayOfYear = date.dayOfYear();
1661 if (dayOfYear % 7 != 0) 1673 if (dayOfYear % 7 != 0)
1662 wno = dayOfYear / 7 + 1; 1674 wno = dayOfYear / 7 + 1;
1663 else 1675 else
1664 wno =dayOfYear / 7; 1676 wno =dayOfYear / 7;
1665 (*weekLabels)[i]->setWeekNum( wno ); 1677 (*weekLabels)[i]->setWeekNum( wno );
1666 date = date.addDays( 7 ); 1678 date = date.addDays( 7 );
1667 } 1679 }
1668 updateView(); 1680 updateView();
1669} 1681}
1670 1682
1671void KOMonthView::showEvents(QPtrList<Event>) 1683void KOMonthView::showEvents(Q3PtrList<Event>)
1672{ 1684{
1673 qDebug("KOMonthView::selectEvents is not implemented yet. "); 1685 qDebug("KOMonthView::selectEvents is not implemented yet. ");
1674} 1686}
1675 1687
1676void KOMonthView::changeEventDisplay(Event *, int) 1688void KOMonthView::changeEventDisplay(Event *, int)
1677{ 1689{
1678 // this should be re-written to be much more efficient, but this 1690 // this should be re-written to be much more efficient, but this
1679 // quick-and-dirty-hack gets the job done for right now. 1691 // quick-and-dirty-hack gets the job done for right now.
1680 //qDebug("KOMonthView::changeEventDisplay "); 1692 //qDebug("KOMonthView::changeEventDisplay ");
1681 updateView(); 1693 updateView();
1682} 1694}
1683 1695
1684void KOMonthView::updateView() 1696void KOMonthView::updateView()
1685{ 1697{
1686 1698
1687 if ( !updatePossible ) 1699 if ( !updatePossible )
1688 return; 1700 return;
1689 //qDebug("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU "); 1701 //qDebug("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU ");
1690 //QTime ti; 1702 //QTime ti;
1691 //ti.start(); 1703 //ti.start();
1692 clearSelection(); 1704 clearSelection();
1693 QPtrVector<MonthViewCell> *cells; 1705 Q3PtrVector<MonthViewCell> *cells;
1694 if ( mShowWeekView ) { 1706 if ( mShowWeekView ) {
1695 cells = &mCellsW; 1707 cells = &mCellsW;
1696 } else { 1708 } else {
1697 cells = &mCells; 1709 cells = &mCells;
1698 } 1710 }
1699#if 1 1711#if 1
1700 int i; 1712 int i;
1701 int timeSpan = (*cells).size()-1; 1713 int timeSpan = (*cells).size()-1;
1702 if ( KOPrefs::instance()->mMonthViewWeek ) 1714 if ( KOPrefs::instance()->mMonthViewWeek )
1703 timeSpan = 6; 1715 timeSpan = 6;
1704 for( i = 0; i < timeSpan + 1; ++i ) { 1716 for( i = 0; i < timeSpan + 1; ++i ) {
1705 (*cells)[i]->startUpdateCell(); 1717 (*cells)[i]->startUpdateCell();
1706 } 1718 }
1707 1719
1708 QPtrList<Event> events = calendar()->events(); 1720 Q3PtrList<Event> events = calendar()->events();
1709 Event *event; 1721 Event *event;
1710 QDateTime dt; 1722 QDateTime dt;
1711 QDate endDate = mStartDate.addDays( timeSpan ); 1723 QDate endDate = mStartDate.addDays( timeSpan );
1712 for( event = events.first(); event; event = events.next() ) { // for event 1724 for( event = events.first(); event; event = events.next() ) { // for event
1713 if ( event->doesRecur() ) { 1725 if ( event->doesRecur() ) {
1714 bool last; 1726 bool last;
1715 QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); 1727 QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last );
1716 QDateTime incidenceEnd; 1728 QDateTime incidenceEnd;
1717 int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); 1729 int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() );
1718 bool invalid = false; 1730 bool invalid = false;
1719 while( true ) { 1731 while( true ) {
1720 if ( incidenceStart.isValid() ) { 1732 if ( incidenceStart.isValid() ) {
@@ -1760,25 +1772,25 @@ void KOMonthView::updateView()
1760 //normalize 1772 //normalize
1761 st = timeSpan - st; 1773 st = timeSpan - st;
1762 if ( st < 0 ) st = 0; 1774 if ( st < 0 ) st = 0;
1763 if ( end > timeSpan ) end = timeSpan; 1775 if ( end > timeSpan ) end = timeSpan;
1764 int iii; 1776 int iii;
1765 for ( iii = st;iii<= end;++iii) 1777 for ( iii = st;iii<= end;++iii)
1766 (*cells)[iii]->insertEvent( event ); 1778 (*cells)[iii]->insertEvent( event );
1767 } 1779 }
1768 } 1780 }
1769 } 1781 }
1770 } 1782 }
1771 // insert due todos 1783 // insert due todos
1772 QPtrList<Todo> todos = calendar()->todos( ); 1784 Q3PtrList<Todo> todos = calendar()->todos( );
1773 Todo *todo; 1785 Todo *todo;
1774 for(todo = todos.first(); todo; todo = todos.next()) { 1786 for(todo = todos.first(); todo; todo = todos.next()) {
1775 //insertTodo( todo ); 1787 //insertTodo( todo );
1776 if ( todo->hasDueDate() ) { 1788 if ( todo->hasDueDate() ) {
1777 int day = mStartDate.daysTo( todo->dtDue().date() ); 1789 int day = mStartDate.daysTo( todo->dtDue().date() );
1778 if ( day >= 0 && day < timeSpan + 1) { 1790 if ( day >= 0 && day < timeSpan + 1) {
1779 (*cells)[day]->insertTodo( todo ); 1791 (*cells)[day]->insertTodo( todo );
1780 } 1792 }
1781 } 1793 }
1782 } 1794 }
1783 1795
1784 for( i = 0; i < timeSpan+1; ++i ) { 1796 for( i = 0; i < timeSpan+1; ++i ) {
@@ -2216,25 +2228,25 @@ void KOMonthView::setSelectedCell( MonthViewCell *cell )
2216 } else 2228 } else
2217 mSelectedCell = cell; 2229 mSelectedCell = cell;
2218 // if ( mSelectedCell ) 2230 // if ( mSelectedCell )
2219 // mSelectedCell->select(); 2231 // mSelectedCell->select();
2220 if ( !mSelectedCell ) 2232 if ( !mSelectedCell )
2221 emit incidenceSelected( 0 ); 2233 emit incidenceSelected( 0 );
2222 else 2234 else
2223 emit incidenceSelected( mSelectedCell->selectedIncidence() ); 2235 emit incidenceSelected( mSelectedCell->selectedIncidence() );
2224} 2236}
2225 2237
2226void KOMonthView::processSelectionChange() 2238void KOMonthView::processSelectionChange()
2227{ 2239{
2228 QPtrList<Incidence> incidences = selectedIncidences(); 2240 Q3PtrList<Incidence> incidences = selectedIncidences();
2229 if (incidences.count() > 0) { 2241 if (incidences.count() > 0) {
2230 emit incidenceSelected( incidences.first() ); 2242 emit incidenceSelected( incidences.first() );
2231 } else { 2243 } else {
2232 emit incidenceSelected( 0 ); 2244 emit incidenceSelected( 0 );
2233 clearSelection(); 2245 clearSelection();
2234 } 2246 }
2235} 2247}
2236 2248
2237void KOMonthView::clearSelection() 2249void KOMonthView::clearSelection()
2238{ 2250{
2239 if ( mSelectedCell ) { 2251 if ( mSelectedCell ) {
2240 mSelectedCell->deselect(); 2252 mSelectedCell->deselect();
@@ -2252,55 +2264,55 @@ void KOMonthView::keyReleaseEvent ( QKeyEvent * e)
2252void KOMonthView::keyPressEvent ( QKeyEvent * e ) 2264void KOMonthView::keyPressEvent ( QKeyEvent * e )
2253{ 2265{
2254 2266
2255 qApp->processEvents(); 2267 qApp->processEvents();
2256 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 2268 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
2257 //e->ignore(); 2269 //e->ignore();
2258 e->accept(); 2270 e->accept();
2259 return; 2271 return;
2260 } 2272 }
2261 if (! e->isAutoRepeat() ) 2273 if (! e->isAutoRepeat() )
2262 mFlagKeyPressed = true; 2274 mFlagKeyPressed = true;
2263 switch(e->key()) { 2275 switch(e->key()) {
2264 case Key_Up: 2276 case Qt::Key_Up:
2265 { 2277 {
2266 if ( mShowWeekView ) { 2278 if ( mShowWeekView ) {
2267 emit selectWeekNum ( currentWeek() - 1 ); 2279 emit selectWeekNum ( currentWeek() - 1 );
2268 } 2280 }
2269 else { 2281 else {
2270 emit prevMonth(); 2282 emit prevMonth();
2271 } 2283 }
2272 } 2284 }
2273 e->accept(); 2285 e->accept();
2274 break; 2286 break;
2275 case Key_Down: 2287 case Qt::Key_Down:
2276 { 2288 {
2277 if ( mShowWeekView ) { 2289 if ( mShowWeekView ) {
2278 emit selectWeekNum ( currentWeek() +1); 2290 emit selectWeekNum ( currentWeek() +1);
2279 } 2291 }
2280 else { 2292 else {
2281 emit nextMonth(); 2293 emit nextMonth();
2282 } 2294 }
2283 2295
2284 } 2296 }
2285 e->accept(); 2297 e->accept();
2286 break; 2298 break;
2287 case Key_Return: 2299 case Qt::Key_Return:
2288 case Key_Enter: 2300 case Qt::Key_Enter:
2289 { 2301 {
2290 selectInternalWeekNum ( currentWeek() ); 2302 selectInternalWeekNum ( currentWeek() );
2291 } 2303 }
2292 e->accept(); 2304 e->accept();
2293 break; 2305 break;
2294 case Key_D: 2306 case Qt::Key_D:
2295 if ( mSelectedCell ) { 2307 if ( mSelectedCell ) {
2296 mSelectedCell->showDay(); 2308 mSelectedCell->showDay();
2297 e->accept(); 2309 e->accept();
2298 } else { 2310 } else {
2299 e->ignore(); 2311 e->ignore();
2300 } 2312 }
2301 break; 2313 break;
2302 default: 2314 default:
2303 e->ignore(); 2315 e->ignore();
2304 break; 2316 break;
2305 } 2317 }
2306} 2318}
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 1a9d16d..bca76e5 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -12,35 +12,42 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#ifndef _KOMONTHVIEW_H 20#ifndef _KOMONTHVIEW_H
21#define _KOMONTHVIEW_H 21#define _KOMONTHVIEW_H
22 22
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qframe.h> 24#include <q3frame.h>
25#include <qdatetime.h> 25#include <qdatetime.h>
26#include <qlistbox.h> 26#include <q3listbox.h>
27#include <qpoint.h> 27#include <qpoint.h>
28#include <qwidgetstack.h> 28#include <q3widgetstack.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qtimer.h> 30#include <qtimer.h>
31#include <qintdict.h> 31#include <q3intdict.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qvaluelist.h> 33#include <q3valuelist.h>
34#include <qptrvector.h> 34#include <q3ptrvector.h>
35//Added by qt3to4:
36#include <QResizeEvent>
37#include <QFocusEvent>
38#include <QMouseEvent>
39#include <Q3PtrList>
40#include <Q3PopupMenu>
41#include <QKeyEvent>
35 42
36#include <libkcal/calendar.h> 43#include <libkcal/calendar.h>
37#include <libkcal/event.h> 44#include <libkcal/event.h>
38 45
39#include "koeventview.h" 46#include "koeventview.h"
40#include "navigatorbar.h" 47#include "navigatorbar.h"
41 48
42#ifdef DESKTOP_VERSION 49#ifdef DESKTOP_VERSION
43class QToolTipGroup; 50class QToolTipGroup;
44#endif 51#endif
45 52
46class KNOWhatsThis; 53class KNOWhatsThis;
@@ -63,25 +70,25 @@ class KOWeekButton : public QPushButton
63private: 70private:
64 void focusInEvent ( QFocusEvent * ){;} 71 void focusInEvent ( QFocusEvent * ){;}
65 int mNumber; 72 int mNumber;
66 void keyPressEvent ( QKeyEvent * e ) 73 void keyPressEvent ( QKeyEvent * e )
67 { 74 {
68 e->ignore(); 75 e->ignore();
69 } 76 }
70 77
71private slots : 78private slots :
72 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } 79 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); }
73}; 80};
74 81
75class KNoScrollListBox: public QListBox 82class KNoScrollListBox: public Q3ListBox
76{ 83{
77 Q_OBJECT 84 Q_OBJECT
78 public: 85 public:
79 KNoScrollListBox(QWidget *parent=0, const char *name=0); 86 KNoScrollListBox(QWidget *parent=0, const char *name=0);
80 ~KNoScrollListBox(); 87 ~KNoScrollListBox();
81 QString getWhatsThisText(QPoint p) ; 88 QString getWhatsThisText(QPoint p) ;
82 89
83 signals: 90 signals:
84 void shiftDown(); 91 void shiftDown();
85 void shiftUp(); 92 void shiftUp();
86 void rightClick(); 93 void rightClick();
87 void nextCell(); 94 void nextCell();
@@ -94,49 +101,49 @@ class KNoScrollListBox: public QListBox
94 void keyPressEvent(QKeyEvent *); 101 void keyPressEvent(QKeyEvent *);
95 void keyReleaseEvent(QKeyEvent *); 102 void keyReleaseEvent(QKeyEvent *);
96 void mousePressEvent(QMouseEvent *); 103 void mousePressEvent(QMouseEvent *);
97 void focusInEvent ( QFocusEvent * ); 104 void focusInEvent ( QFocusEvent * );
98 void focusOutEvent ( QFocusEvent * ); 105 void focusOutEvent ( QFocusEvent * );
99 106
100 private: 107 private:
101 bool resetOnFocusIn; 108 bool resetOnFocusIn;
102 KNOWhatsThis * mWT; 109 KNOWhatsThis * mWT;
103}; 110};
104 111
105 112
106class MonthViewItem: public QListBoxItem 113class MonthViewItem: public Q3ListBoxItem
107{ 114{
108 public: 115 public:
109 MonthViewItem( Incidence *,const QString & title ); 116 MonthViewItem( Incidence *,const QString & title );
110 void recycle( Incidence *incidence, const QString & s); 117 void recycle( Incidence *incidence, const QString & s);
111 void setRecur(bool on) { mRecur = on; } 118 void setRecur(bool on) { mRecur = on; }
112 void setAlarm(bool on) { mAlarm = on; } 119 void setAlarm(bool on) { mAlarm = on; }
113 void setReply(bool on) { mReply = on; } 120 void setReply(bool on) { mReply = on; }
114 void setMoreInfo(bool on) { mInfo = on; } 121 void setMoreInfo(bool on) { mInfo = on; }
115 void setMultiDay(int type) { mMultiday = type; } 122 void setMultiDay(int type) { mMultiday = type; }
116 int multiDay() { return mMultiday; } 123 int multiDay() { return mMultiday; }
117 void setMultiDayPos(int type) { mdayPos = type; } 124 void setMultiDayPos(int type) { mdayPos = type; }
118 int gettMultiDayPos() { return mdayPos; } 125 int gettMultiDayPos() { return mdayPos; }
119 void setBlockRepaint(bool on) { mblockRepaint = on; } 126 void setBlockRepaint(bool on) { mblockRepaint = on; }
120 bool setHighlighted( Incidence * ); 127 bool setHighlighted( Incidence * );
121 128
122 void setPalette(const QPalette &p) { mPalette = p; } 129 void setPalette(const QPalette &p) { mPalette = p; }
123 QPalette palette() const { return mPalette; } 130 QPalette palette() const { return mPalette; }
124 bool setHighlightedFalse(); 131 bool setHighlightedFalse();
125 Incidence *incidence() const { return mIncidence; } 132 Incidence *incidence() const { return mIncidence; }
126 133
127 protected: 134 protected:
128 virtual void paint(QPainter *); 135 virtual void paint(QPainter *);
129 virtual int height(const QListBox *) const; 136 virtual int height(const Q3ListBox *) const;
130 virtual int width(const QListBox *) const; 137 virtual int width(const Q3ListBox *) const;
131 138
132 private: 139 private:
133 int mdayPos; 140 int mdayPos;
134 bool isWeekItem; 141 bool isWeekItem;
135 bool mblockRepaint; 142 bool mblockRepaint;
136 int mMultiday; 143 int mMultiday;
137 bool mRecur; 144 bool mRecur;
138 bool mAlarm; 145 bool mAlarm;
139 bool mReply; 146 bool mReply;
140 bool mInfo; 147 bool mInfo;
141 bool mDisplayHighlighted; 148 bool mDisplayHighlighted;
142 149
@@ -189,33 +196,33 @@ class MonthViewCell : public KNoScrollListBox
189 void newEventSignal( QDateTime ); 196 void newEventSignal( QDateTime );
190 void showDaySignal( QDate ); 197 void showDaySignal( QDate );
191 198
192 protected: 199 protected:
193 QStringList mToolTip; 200 QStringList mToolTip;
194 void resizeEvent( QResizeEvent * ); 201 void resizeEvent( QResizeEvent * );
195 202
196public slots: 203public slots:
197 void showDay(); 204 void showDay();
198 void deHighLight(); 205 void deHighLight();
199 void repaintfinishUpdateCell(); 206 void repaintfinishUpdateCell();
200 protected slots: 207 protected slots:
201 void defaultAction( QListBoxItem * ); 208 void defaultAction( Q3ListBoxItem * );
202 void contextMenu( QListBoxItem * ); 209 void contextMenu( Q3ListBoxItem * );
203 void selection( QListBoxItem * ); 210 void selection( Q3ListBoxItem * );
204 void cellClicked( QListBoxItem * ); 211 void cellClicked( Q3ListBoxItem * );
205 void newEvent(); 212 void newEvent();
206 213
207 private: 214 private:
208 int mdayCount; 215 int mdayCount;
209 QPtrList <MonthViewItem> mAvailItemList; 216 Q3PtrList <MonthViewItem> mAvailItemList;
210 KOMonthView *mMonthView; 217 KOMonthView *mMonthView;
211 int currentPalette; 218 int currentPalette;
212 219
213 QDate mDate; 220 QDate mDate;
214 bool mPrimary; 221 bool mPrimary;
215 bool mHoliday; 222 bool mHoliday;
216 QString mHolidayString; 223 QString mHolidayString;
217 224
218 //QLabel *mLabel; 225 //QLabel *mLabel;
219 QPushButton *mLabel; 226 QPushButton *mLabel;
220 //QListBox *mItemList; 227 //QListBox *mItemList;
221#ifdef DESKTOP_VERSION 228#ifdef DESKTOP_VERSION
@@ -238,47 +245,47 @@ class KOMonthView: public KOEventView
238 Q_OBJECT 245 Q_OBJECT
239 public: 246 public:
240 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); 247 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 );
241 ~KOMonthView(); 248 ~KOMonthView();
242 249
243 /** Returns maximum number of days supported by the komonthview */ 250 /** Returns maximum number of days supported by the komonthview */
244 virtual int maxDatesHint(); 251 virtual int maxDatesHint();
245 252
246 /** Returns number of currently shown dates. */ 253 /** Returns number of currently shown dates. */
247 virtual int currentDateCount(); 254 virtual int currentDateCount();
248 255
249 /** returns the currently selected events */ 256 /** returns the currently selected events */
250 virtual QPtrList<Incidence> selectedIncidences(); 257 virtual Q3PtrList<Incidence> selectedIncidences();
251 258
252 /** returns dates of the currently selected events */ 259 /** returns dates of the currently selected events */
253 virtual DateList selectedDates(); 260 virtual DateList selectedDates();
254#if 0 261#if 0
255 virtual void printPreview(CalPrinter *calPrinter, 262 virtual void printPreview(CalPrinter *calPrinter,
256 const QDate &, const QDate &); 263 const QDate &, const QDate &);
257#endif 264#endif
258 bool isMonthView() { return !mShowWeekView; } 265 bool isMonthView() { return !mShowWeekView; }
259 bool isUpdatePossible() { return updatePossible; } 266 bool isUpdatePossible() { return updatePossible; }
260 267
261 MonthViewCell * selectedCell(); 268 MonthViewCell * selectedCell();
262 bool skipResize; 269 bool skipResize;
263 NavigatorBar* navigatorBar() { return mNavigatorBar ;} 270 NavigatorBar* navigatorBar() { return mNavigatorBar ;}
264 void clearList(); 271 void clearList();
265 public slots: 272 public slots:
266 void incidenceHighlighted( Incidence *, MonthViewCell*, int ); 273 void incidenceHighlighted( Incidence *, MonthViewCell*, int );
267 void nextCell(); 274 void nextCell();
268 void prevCell(); 275 void prevCell();
269 virtual void updateView(); 276 virtual void updateView();
270 virtual void updateConfig(); 277 virtual void updateConfig();
271 virtual void showDates(const QDate &start, const QDate &end); 278 virtual void showDates(const QDate &start, const QDate &end);
272 virtual void showEvents(QPtrList<Event> eventList); 279 virtual void showEvents(Q3PtrList<Event> eventList);
273 280
274 void changeEventDisplay(Event *, int); 281 void changeEventDisplay(Event *, int);
275 282
276 void clearSelection(); 283 void clearSelection();
277 284
278 void showContextMenu( Incidence * ); 285 void showContextMenu( Incidence * );
279 286
280 void setSelectedCell( MonthViewCell * ); 287 void setSelectedCell( MonthViewCell * );
281 void setPopupCell( MonthViewCell * ); 288 void setPopupCell( MonthViewCell * );
282 void switchView(); 289 void switchView();
283 void setKeyBFocus(); 290 void setKeyBFocus();
284 291
@@ -302,50 +309,50 @@ class KOMonthView: public KOEventView
302 protected: 309 protected:
303 void resizeEvent(QResizeEvent *); 310 void resizeEvent(QResizeEvent *);
304 void viewChanged(); 311 void viewChanged();
305 void updateDayLabels(); 312 void updateDayLabels();
306 int mapWeekLayout( int, bool ); 313 int mapWeekLayout( int, bool );
307 314
308 private: 315 private:
309 int mKBFcounter; 316 int mKBFcounter;
310 QTimer* mComputeLayoutTimer; 317 QTimer* mComputeLayoutTimer;
311 NavigatorBar* mNavigatorBar; 318 NavigatorBar* mNavigatorBar;
312 int currentWeek(); 319 int currentWeek();
313 bool clPending; 320 bool clPending;
314 QWidgetStack * mWidStack; 321 Q3WidgetStack * mWidStack;
315 QWidget* mMonthView; 322 QWidget* mMonthView;
316 QWidget* mWeekView; 323 QWidget* mWeekView;
317 bool mShowWeekView; 324 bool mShowWeekView;
318 bool updatePossible; 325 bool updatePossible;
319 int mDaysPerWeek; 326 int mDaysPerWeek;
320 int mNumWeeks; 327 int mNumWeeks;
321 int mNumCells; 328 int mNumCells;
322 //bool mWeekStartsMonday; 329 //bool mWeekStartsMonday;
323 bool mShowSatSunComp; 330 bool mShowSatSunComp;
324 void computeLayout(); 331 void computeLayout();
325 void computeLayoutWeek(); 332 void computeLayoutWeek();
326 void doComputeLayoutWeek(); 333 void doComputeLayoutWeek();
327 334
328 QPtrVector<MonthViewCell> mCells; 335 Q3PtrVector<MonthViewCell> mCells;
329 QPtrVector<QLabel> mDayLabels; 336 Q3PtrVector<QLabel> mDayLabels;
330 QPtrVector<KOWeekButton> mWeekLabels; 337 Q3PtrVector<KOWeekButton> mWeekLabels;
331 QPtrVector<MonthViewCell> mCellsW; 338 Q3PtrVector<MonthViewCell> mCellsW;
332 QPtrVector<QLabel> mDayLabelsW; 339 Q3PtrVector<QLabel> mDayLabelsW;
333 QPtrVector<KOWeekButton> mWeekLabelsW; 340 Q3PtrVector<KOWeekButton> mWeekLabelsW;
334 341
335 bool mShortDayLabelsM; 342 bool mShortDayLabelsM;
336 bool mShortDayLabelsW; 343 bool mShortDayLabelsW;
337 int mWidthLongDayLabel; 344 int mWidthLongDayLabel;
338 345
339 QDate mStartDate; 346 QDate mStartDate;
340 347
341 MonthViewCell *mSelectedCell; 348 MonthViewCell *mSelectedCell;
342 MonthViewCell *mPopupCell; 349 MonthViewCell *mPopupCell;
343 bool mFlagKeyPressed; 350 bool mFlagKeyPressed;
344 KOEventPopupMenu *mContextMenu; 351 KOEventPopupMenu *mContextMenu;
345 QPopupMenu *mNewItemMenu; 352 Q3PopupMenu *mNewItemMenu;
346 void keyPressEvent ( QKeyEvent * ) ; 353 void keyPressEvent ( QKeyEvent * ) ;
347 void keyReleaseEvent ( QKeyEvent * ) ; 354 void keyReleaseEvent ( QKeyEvent * ) ;
348 355
349}; 356};
350 357
351#endif 358#endif
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 5078c57..0bd46ea 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -17,25 +17,25 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <q3textstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kglobalsettings.h> 39#include <kglobalsettings.h>
40#include <kconfig.h> 40#include <kconfig.h>
41#include <klocale.h> 41#include <klocale.h>
@@ -296,31 +296,31 @@ KOPrefs::KOPrefs() :
296 296
297 addItemInt("Next X Days",&mNextXDays,3); 297 addItemInt("Next X Days",&mNextXDays,3);
298 298
299 KPrefs::setCurrentGroup("Printer"); 299 KPrefs::setCurrentGroup("Printer");
300 300
301 KPrefs::setCurrentGroup("Layout"); 301 KPrefs::setCurrentGroup("Layout");
302 302
303 addItemBool("CompactDialogs",&mCompactDialogs,false); 303 addItemBool("CompactDialogs",&mCompactDialogs,false);
304 addItemBool("VerticalScreen",&mVerticalScreen,true); 304 addItemBool("VerticalScreen",&mVerticalScreen,true);
305 305
306 KPrefs::setCurrentGroup("KOrganizer Plugins"); 306 KPrefs::setCurrentGroup("KOrganizer Plugins");
307 307
308 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 308 addItemStringList("SelectedPlugins",&mSelectedPlugins,QStringList("holidays"));
309 309
310 KPrefs::setCurrentGroup("Group Scheduling"); 310 KPrefs::setCurrentGroup("Group Scheduling");
311 311
312 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 312 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
313 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 313 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
314 addItemStringList("AdditionalMails",&mAdditionalMails,""); 314 addItemStringList("AdditionalMails",&mAdditionalMails,QStringList());
315 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 315 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
316 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 316 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
317 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 317 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
318 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 318 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
319 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 319 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
320 320
321 KPrefs::setCurrentGroup( "Editors" ); 321 KPrefs::setCurrentGroup( "Editors" );
322 322
323 addItemStringList( "EventTemplates", &mEventTemplates ); 323 addItemStringList( "EventTemplates", &mEventTemplates );
324 addItemStringList( "TodoTemplates", &mTodoTemplates ); 324 addItemStringList( "TodoTemplates", &mTodoTemplates );
325 325
326 addItemInt("DestinationPolicy",&mDestination,standardDestination); 326 addItemInt("DestinationPolicy",&mDestination,standardDestination);
@@ -557,25 +557,25 @@ QColor KOPrefs::defaultColor( int calNum ) const
557 return (mDefCalColors[calNum-1])->mDefaultColor; 557 return (mDefCalColors[calNum-1])->mDefaultColor;
558} 558}
559void KOPrefs::usrWriteConfig() 559void KOPrefs::usrWriteConfig()
560{ 560{
561 config()->setGroup("General"); 561 config()->setGroup("General");
562 config()->writeEntry("Custom Categories",mCustomCategories); 562 config()->writeEntry("Custom Categories",mCustomCategories);
563 563
564 config()->setGroup("Personal Settings"); 564 config()->setGroup("Personal Settings");
565 config()->writeEntry("user_name",mName); 565 config()->writeEntry("user_name",mName);
566 config()->writeEntry("user_email",mEmail); 566 config()->writeEntry("user_email",mEmail);
567 567
568 config()->setGroup("Category Colors"); 568 config()->setGroup("Category Colors");
569 QDictIterator<QColor> it(mCategoryColors); 569 Q3DictIterator<QColor> it(mCategoryColors);
570 while (it.current()) { 570 while (it.current()) {
571 config()->writeEntry(it.currentKey(),*(it.current())); 571 config()->writeEntry(it.currentKey(),*(it.current()));
572 ++it; 572 ++it;
573 } 573 }
574 KConfig fc (locateLocal("config","kopicalendarrc")); 574 KConfig fc (locateLocal("config","kopicalendarrc"));
575 fc.setGroup("CC"); 575 fc.setGroup("CC");
576 fc.deleteGroup( "CC"); 576 fc.deleteGroup( "CC");
577 fc.setGroup("CC"); 577 fc.setGroup("CC");
578 fc.writeEntry("NumberCalendars",mCalendars.count()); 578 fc.writeEntry("NumberCalendars",mCalendars.count());
579 int numCal = 1; 579 int numCal = 1;
580 int writeCal = 0; 580 int writeCal = 0;
581 while ( numCal < mNextAvailableCalendar ) { 581 while ( numCal < mNextAvailableCalendar ) {
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 94bdd33..35c6110 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -16,27 +16,30 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOPREFS_H 23#ifndef KOPREFS_H
24#define KOPREFS_H 24#define KOPREFS_H
25 25
26 26
27#include <libkdepim/kpimprefs.h> 27#include <libkdepim/kpimprefs.h>
28#include <qdict.h> 28#include <q3dict.h>
29#include <qdir.h> 29#include <qdir.h>
30#include <qobject.h> 30#include <qobject.h>
31#include <QDateTime>
32//Added by qt3to4:
33#include <Q3PtrList>
31 34
32class KConfig; 35class KConfig;
33class QFont; 36class QFont;
34class QColor; 37class QColor;
35class QStringList; 38class QStringList;
36 39
37#define VIEW_WN_VIEW 1 40#define VIEW_WN_VIEW 1
38#define VIEW_NX_VIEW 2 41#define VIEW_NX_VIEW 2
39#define VIEW_J_VIEW 3 42#define VIEW_J_VIEW 3
40#define VIEW_A_VIEW 4 43#define VIEW_A_VIEW 4
41#define VIEW_ML_VIEW 5 44#define VIEW_ML_VIEW 5
42#define VIEW_M_VIEW 6 45#define VIEW_M_VIEW 6
@@ -338,40 +341,40 @@ class KOPrefs : public KPimPrefs
338 QString mActiveSyncPort; 341 QString mActiveSyncPort;
339 QString mActiveSyncIP; 342 QString mActiveSyncIP;
340 343
341 // settings for eventviewer 344 // settings for eventviewer
342 bool mEVshowDetails; 345 bool mEVshowDetails;
343 bool mEVshowCreated; 346 bool mEVshowCreated;
344 bool mEVshowChanged; 347 bool mEVshowChanged;
345 bool mWTshowDetails; 348 bool mWTshowDetails;
346 bool mWTshowCreated; 349 bool mWTshowCreated;
347 bool mWTshowChanged; 350 bool mWTshowChanged;
348 351
349 int mCurrentDisplayedView; 352 int mCurrentDisplayedView;
350 QPtrList<KopiCalendarFile> mCalendars; 353 Q3PtrList<KopiCalendarFile> mCalendars;
351 int mNextAvailableCalendar; 354 int mNextAvailableCalendar;
352 bool mGlobalUpdateDisabled; 355 bool mGlobalUpdateDisabled;
353 356
354 357
355 bool mDetectConflicts; 358 bool mDetectConflicts;
356 bool mIncludeFree; 359 bool mIncludeFree;
357 bool mCheckConflictsAllDayAllDay; 360 bool mCheckConflictsAllDayAllDay;
358 bool mCheckConflictsAllDayNonAD; 361 bool mCheckConflictsAllDayNonAD;
359 bool mCheckConflictsNonADAllDay; 362 bool mCheckConflictsNonADAllDay;
360 bool mCheckConflictsNonADNonAD; 363 bool mCheckConflictsNonADNonAD;
361 QString mFilterConflictEditItem; 364 QString mFilterConflictEditItem;
362 QString mFilterConflictAllItem; 365 QString mFilterConflictAllItem;
363 366
364 private: 367 private:
365 QDict<QColor> mCategoryColors; 368 Q3Dict<QColor> mCategoryColors;
366 QArray<KopiCalendarFile*> mDefCalColors; 369 QVector<KopiCalendarFile*> mDefCalColors;
367 QColor mDefaultCategoryColor; 370 QColor mDefaultCategoryColor;
368 371
369 QFont mDefaultTimeBarFont; 372 QFont mDefaultTimeBarFont;
370 QFont mDefaultViewFont; 373 QFont mDefaultViewFont;
371 QFont mDefaultMonthViewFont; 374 QFont mDefaultMonthViewFont;
372 375
373 QString mName; 376 QString mName;
374 QString mEmail; 377 QString mEmail;
375}; 378};
376 379
377#endif 380#endif
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index f1a6c3d..43c488f 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -14,42 +14,48 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <q3groupbox.h>
27#include <qbuttongroup.h> 27#include <q3buttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <q3textstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <q3vbox.h>
35#include <qhbox.h> 35#include <q3hbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <q3strlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44#include <QDesktopWidget>
45//Added by qt3to4:
46#include <Q3HBoxLayout>
47#include <Q3GridLayout>
48#include <QPixmap>
49#include <Q3Frame>
44 50
45#include <kcolorbutton.h> 51#include <kcolorbutton.h>
46#include <kdebug.h> 52#include <kdebug.h>
47#include <klocale.h> 53#include <klocale.h>
48#include <kglobal.h> 54#include <kglobal.h>
49#include <kfontdialog.h> 55#include <kfontdialog.h>
50#include <kfiledialog.h> 56#include <kfiledialog.h>
51#include <kmessagebox.h> 57#include <kmessagebox.h>
52#include <kcolordialog.h> 58#include <kcolordialog.h>
53#include <kiconloader.h> 59#include <kiconloader.h>
54#include <kemailsettings.h> 60#include <kemailsettings.h>
55#include <kstandarddirs.h> 61#include <kstandarddirs.h>
@@ -107,26 +113,26 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
107 113
108KOPrefsDialog::~KOPrefsDialog() 114KOPrefsDialog::~KOPrefsDialog()
109{ 115{
110} 116}
111void KOPrefsDialog::setupGlobalTab() 117void KOPrefsDialog::setupGlobalTab()
112{ 118{
113 119
114 120
115} 121}
116void KOPrefsDialog::setupLocaleDateTab() 122void KOPrefsDialog::setupLocaleDateTab()
117{ 123{
118#if 0 124#if 0
119QFrame *topFrame = addPage(i18n("Date Format"),0,0); 125Q3Frame *topFrame = addPage(i18n("Date Format"),0,0);
120 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 126 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,2);
121 topLayout->setSpacing(mSpacingHint); 127 topLayout->setSpacing(mSpacingHint);
122 topLayout->setMargin(mMarginHint); 128 topLayout->setMargin(mMarginHint);
123 int iii = 0; 129 int iii = 0;
124 130
125 131
126 KPrefsDialogWidRadios *syncPrefsGroup = 132 KPrefsDialogWidRadios *syncPrefsGroup =
127 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 133 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
128 QString format; 134 QString format;
129 if ( QApplication::desktop()->width() < 480 ) 135 if ( QApplication::desktop()->width() < 480 )
130 format = "(%d.%m.%Y)"; 136 format = "(%d.%m.%Y)";
131 else 137 else
132 format = "(%d.%m.%Y|%A %d %B %Y)"; 138 format = "(%d.%m.%Y|%A %d %B %Y)";
@@ -163,26 +169,26 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0);
163 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 169 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
164 ++iii; 170 ++iii;
165 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 171 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
166 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 172 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
167 ++iii; 173 ++iii;
168#endif 174#endif
169 175
170} 176}
171 177
172void KOPrefsDialog::setupLocaleTab() 178void KOPrefsDialog::setupLocaleTab()
173{ 179{
174#if 0 180#if 0
175 QFrame *topFrame = addPage(i18n("Locale"),0,0); 181 Q3Frame *topFrame = addPage(i18n("Locale"),0,0);
176 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 182 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2);
177 topLayout->setSpacing(mSpacingHint); 183 topLayout->setSpacing(mSpacingHint);
178 topLayout->setMargin(mMarginHint); 184 topLayout->setMargin(mMarginHint);
179 int iii = 0; 185 int iii = 0;
180 KPrefsDialogWidRadios *syncPrefsGroup = 186 KPrefsDialogWidRadios *syncPrefsGroup =
181 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 187 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
182 syncPrefsGroup->addRadio(i18n("English")); 188 syncPrefsGroup->addRadio(i18n("English"));
183 syncPrefsGroup->addRadio(i18n("German")); 189 syncPrefsGroup->addRadio(i18n("German"));
184 syncPrefsGroup->addRadio(i18n("French")); 190 syncPrefsGroup->addRadio(i18n("French"));
185 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 191 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
186 if ( QApplication::desktop()->width() < 300 ) 192 if ( QApplication::desktop()->width() < 300 )
187 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 193 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
188 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 194 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
@@ -202,53 +208,53 @@ void KOPrefsDialog::setupLocaleTab()
202 sb = 208 sb =
203 addWidBool(i18n("Week starts on Sunday"), 209 addWidBool(i18n("Week starts on Sunday"),
204 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 210 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 211 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
206 ++iii; 212 ++iii;
207 sb = 213 sb =
208 addWidBool(i18n("Use short date in (WN/E) view"), 214 addWidBool(i18n("Use short date in (WN/E) view"),
209 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 215 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
210 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 216 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
211 } 217 }
212 else { 218 else {
213 QWidget * hb = new QWidget( topFrame ); 219 QWidget * hb = new QWidget( topFrame );
214 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 220 Q3HBoxLayout *hbLayout = new Q3HBoxLayout(hb);
215 sb = 221 sb =
216 addWidBool(i18n("Week starts on Sunday"), 222 addWidBool(i18n("Week starts on Sunday"),
217 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 223 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
218 hbLayout->addWidget(sb->checkBox() ); 224 hbLayout->addWidget(sb->checkBox() );
219 sb = 225 sb =
220 addWidBool(i18n("Use short date in (WN/E) view"), 226 addWidBool(i18n("Use short date in (WN/E) view"),
221 &(KOPrefs::instance()->mShortDateInViewer),hb); 227 &(KOPrefs::instance()->mShortDateInViewer),hb);
222 hbLayout->addWidget(sb->checkBox() ); 228 hbLayout->addWidget(sb->checkBox() );
223 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 229 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
224 230
225 } 231 }
226 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION 232 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
227#if 0 233#if 0
228 ++iii; 234 ++iii;
229 sb = 235 sb =
230 addWidBool(i18n("Quick load/save (w/o Unicode)"), 236 addWidBool(i18n("Quick load/save (w/o Unicode)"),
231 &(KOPrefs::instance()->mUseQuicksave),topFrame); 237 &(KOPrefs::instance()->mUseQuicksave),topFrame);
232 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 238 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
233#endif 239#endif
234#endif 240#endif
235} 241}
236 242
237void KOPrefsDialog::setupMainTab() 243void KOPrefsDialog::setupMainTab()
238{ 244{
239 QFrame *topFrame = addPage(i18n("General"),0,0); 245 Q3Frame *topFrame = addPage(i18n("General"),0,0);
240 // DesktopIcon("identity",KIcon::SizeMedium)); 246 // DesktopIcon("identity",KIcon::SizeMedium));
241 247
242 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 248 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2);
243 topLayout->setSpacing(mSpacingHint); 249 topLayout->setSpacing(mSpacingHint);
244 topLayout->setMargin(mMarginHint); 250 topLayout->setMargin(mMarginHint);
245 251
246 // KPrefsDialogWidBool *emailControlCenter = 252 // KPrefsDialogWidBool *emailControlCenter =
247// addWidBool(i18n("&Use email settings from Control Center"), 253// addWidBool(i18n("&Use email settings from Control Center"),
248// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 254// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
249// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 255// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
250 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 256 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
251 // SLOT(toggleEmailSettings(bool))); 257 // SLOT(toggleEmailSettings(bool)));
252 258
253 mNameEdit = new QLineEdit(topFrame); 259 mNameEdit = new QLineEdit(topFrame);
254 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 260 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
@@ -278,51 +284,51 @@ void KOPrefsDialog::setupMainTab()
278 &(KOPrefs::instance()->mVerticalScreen),topFrame); 284 &(KOPrefs::instance()->mVerticalScreen),topFrame);
279 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); 285 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
280 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); 286 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1);
281 287
282 288
283 int iii = 5; 289 int iii = 5;
284 widbool = addWidBool(i18n("Block popup until mouse button release"), 290 widbool = addWidBool(i18n("Block popup until mouse button release"),
285 &(KOPrefs::instance()->mBlockPopupMenu),topFrame); 291 &(KOPrefs::instance()->mBlockPopupMenu),topFrame);
286 topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1); 292 topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1);
287 ++iii; 293 ++iii;
288 if ( QApplication::desktop()->height() <= 240 ) { 294 if ( QApplication::desktop()->height() <= 240 ) {
289 topFrame = addPage(i18n("General") +" 2",0,0); 295 topFrame = addPage(i18n("General") +" 2",0,0);
290 topLayout = new QGridLayout(topFrame,4,2); 296 topLayout = new Q3GridLayout(topFrame,4,2);
291 topLayout->setSpacing(2); 297 topLayout->setSpacing(2);
292 topLayout->setMargin(3); 298 topLayout->setMargin(3);
293 iii = 0; 299 iii = 0;
294 } 300 }
295 QHBox *dummy = new QHBox(topFrame); 301 Q3HBox *dummy = new Q3HBox(topFrame);
296 new QLabel(i18n("Days in Next-X-Days:"),dummy); 302 new QLabel(i18n("Days in Next-X-Days:"),dummy);
297 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 303 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
298 304
299 topLayout->addMultiCellWidget(dummy,iii,iii,0,1); 305 topLayout->addMultiCellWidget(dummy,iii,iii,0,1);
300 306
301 ++iii; 307 ++iii;
302 308
303 309
304 // KPrefsDialogWidBool *bcc = 310 // KPrefsDialogWidBool *bcc =
305// addWidBool(i18n("Send copy to owner when mailing events"), 311// addWidBool(i18n("Send copy to owner when mailing events"),
306// &(KOPrefs::instance()->mBcc),topFrame); 312// &(KOPrefs::instance()->mBcc),topFrame);
307// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 313// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
308 314
309 315
310 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 316 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
311 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 317 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
312 318
313 // addWidBool(i18n("Enable automatic saving of calendar"), 319 // addWidBool(i18n("Enable automatic saving of calendar"),
314 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 320 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
315 321
316 QHBox *intervalBox = new QHBox(topFrame); 322 Q3HBox *intervalBox = new Q3HBox(topFrame);
317 // intervalBox->setSpacing(mSpacingHint); 323 // intervalBox->setSpacing(mSpacingHint);
318 topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); 324 topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1);
319 ++iii; 325 ++iii;
320 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 326 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
321 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 327 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
322 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 328 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
323 /* 329 /*
324 QHBox * agendasize = new QHBox ( topFrame ); 330 QHBox * agendasize = new QHBox ( topFrame );
325 331
326 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 332 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
327 333
328 334
@@ -393,32 +399,32 @@ void KOPrefsDialog::setupMainTab()
393 topFrame); 399 topFrame);
394 destinationGroup->addRadio(i18n("be added to the standard resource")); 400 destinationGroup->addRadio(i18n("be added to the standard resource"));
395 destinationGroup->addRadio(i18n("be asked which resource to use")); 401 destinationGroup->addRadio(i18n("be asked which resource to use"));
396 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 402 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
397 403
398 topLayout->setRowStretch(14,1); 404 topLayout->setRowStretch(14,1);
399 */ 405 */
400} 406}
401 407
402 408
403void KOPrefsDialog::setupTimeTab() 409void KOPrefsDialog::setupTimeTab()
404{ 410{
405 QFrame *topFrame = addPage(i18n("Time"),0,0); 411 Q3Frame *topFrame = addPage(i18n("Time"),0,0);
406 // DesktopIcon("clock",KIcon::SizeMedium)); 412 // DesktopIcon("clock",KIcon::SizeMedium));
407 413
408 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 414 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2);
409 topLayout->setSpacing(mSpacingHint); 415 topLayout->setSpacing(mSpacingHint);
410 topLayout->setMargin(mMarginHint); 416 topLayout->setMargin(mMarginHint);
411 417
412 QHBox *dummy = new QHBox(topFrame); 418 Q3HBox *dummy = new Q3HBox(topFrame);
413 KPrefsDialogWidTime *dayBegins = 419 KPrefsDialogWidTime *dayBegins =
414 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 420 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
415 dummy); 421 dummy);
416 //topLayout->addWidget(dayBegins->label(),2,0); 422 //topLayout->addWidget(dayBegins->label(),2,0);
417 423
418 //topLayout->addWidget(dayBegins->spinBox(),2,1); 424 //topLayout->addWidget(dayBegins->spinBox(),2,1);
419 topLayout->addMultiCellWidget(dummy,0,0,0,1); 425 topLayout->addMultiCellWidget(dummy,0,0,0,1);
420 426
421 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 427 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
422 topFrame),1,0); 428 topFrame),1,0);
423 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 429 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
424 mStartTimeSpin->setSuffix(":00"); 430 mStartTimeSpin->setSuffix(":00");
@@ -432,69 +438,69 @@ void KOPrefsDialog::setupTimeTab()
432 438
433 QStringList alarmList; 439 QStringList alarmList;
434 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 440 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
435 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 441 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
436 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 442 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
437 3,0); 443 3,0);
438 mAlarmTimeCombo = new QComboBox(topFrame); 444 mAlarmTimeCombo = new QComboBox(topFrame);
439 mAlarmTimeCombo->insertStringList(alarmList); 445 mAlarmTimeCombo->insertStringList(alarmList);
440 topLayout->addWidget(mAlarmTimeCombo,3,1); 446 topLayout->addWidget(mAlarmTimeCombo,3,1);
441 int iii = 4; 447 int iii = 4;
442 if ( QApplication::desktop()->height() <= 240 ) { 448 if ( QApplication::desktop()->height() <= 240 ) {
443 topFrame = addPage(i18n("Time") +" 2",0,0); 449 topFrame = addPage(i18n("Time") +" 2",0,0);
444 topLayout = new QGridLayout(topFrame,1,2); 450 topLayout = new Q3GridLayout(topFrame,1,2);
445 topLayout->setSpacing(2); 451 topLayout->setSpacing(2);
446 topLayout->setMargin(3); 452 topLayout->setMargin(3);
447 iii = 0; 453 iii = 0;
448 } 454 }
449 455
450 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 456 Q3GroupBox *workingHoursGroup = new Q3GroupBox(1,Qt::Horizontal,
451 i18n("Working Hours"), 457 i18n("Working Hours"),
452 topFrame); 458 topFrame);
453 topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1); 459 topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1);
454 workingHoursGroup->layout()->setSpacing( 0 ); 460 workingHoursGroup->layout()->setSpacing( 0 );
455 workingHoursGroup->layout()->setMargin( 4 ); 461 workingHoursGroup->layout()->setMargin( 4 );
456 QHBox *workStartBox = new QHBox(workingHoursGroup); 462 Q3HBox *workStartBox = new Q3HBox(workingHoursGroup);
457 // workStartBox->setMargin( 0 ); 463 // workStartBox->setMargin( 0 );
458 addWidTime(i18n("Daily starting hour:"), 464 addWidTime(i18n("Daily starting hour:"),
459 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 465 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
460 466
461 QHBox *workEndBox = new QHBox(workingHoursGroup); 467 Q3HBox *workEndBox = new Q3HBox(workingHoursGroup);
462 //workEndBox->setMargin( 0 ); 468 //workEndBox->setMargin( 0 );
463 addWidTime(i18n("Daily ending hour:"), 469 addWidTime(i18n("Daily ending hour:"),
464 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 470 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
465 QVBox *excludeBox = new QVBox(workingHoursGroup); 471 Q3VBox *excludeBox = new Q3VBox(workingHoursGroup);
466 //excludeBox->setMargin( 0 ); 472 //excludeBox->setMargin( 0 );
467 addWidBool(i18n("Exclude holidays"), 473 addWidBool(i18n("Exclude holidays"),
468 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 474 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
469 475
470 addWidBool(i18n("Exclude Saturdays"), 476 addWidBool(i18n("Exclude Saturdays"),
471 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 477 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
472 478
473// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 479// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
474 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 480 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
475 // topFrame); 481 // topFrame);
476// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 482// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
477 483
478 // topLayout->setRowStretch(6,1); 484 // topLayout->setRowStretch(6,1);
479} 485}
480 486
481 487
482void KOPrefsDialog::setupViewsTab() 488void KOPrefsDialog::setupViewsTab()
483{ 489{
484 490
485 QFrame *topFrame = addPage(i18n("Views"),0,0); 491 Q3Frame *topFrame = addPage(i18n("Views"),0,0);
486 // DesktopIcon("viewmag",KIcon::SizeMedium)); 492 // DesktopIcon("viewmag",KIcon::SizeMedium));
487 493
488 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 494 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,1);
489 topLayout->setSpacing(mSpacingHint); 495 topLayout->setSpacing(mSpacingHint);
490 topLayout->setMargin(mMarginHint); 496 topLayout->setMargin(mMarginHint);
491 497
492// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 498// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
493// topLayout->addLayout(dayBeginsLayout,0,0); 499// topLayout->addLayout(dayBeginsLayout,0,0);
494 500
495// KPrefsDialogWidTime *dayBegins = 501// KPrefsDialogWidTime *dayBegins =
496// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 502// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
497// topFrame); 503// topFrame);
498// dayBeginsLayout->addWidget(dayBegins->label()); 504// dayBeginsLayout->addWidget(dayBegins->label());
499// dayBeginsLayout->addStretch(1); 505// dayBeginsLayout->addStretch(1);
500// dayBeginsLayout->addWidget(dayBegins->spinBox()); 506// dayBeginsLayout->addWidget(dayBegins->spinBox());
@@ -521,25 +527,25 @@ void KOPrefsDialog::setupViewsTab()
521 // topLayout->addWidget(hourSizeGroup,ii++,0); 527 // topLayout->addWidget(hourSizeGroup,ii++,0);
522 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 528 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
523 //topLayout->setRowStretch(11,1); 529 //topLayout->setRowStretch(11,1);
524 530
525 531
526 532
527 533
528#if 0 534#if 0
529 535
530 topFrame = addPage(i18n("ViewChange"),0,0); 536 topFrame = addPage(i18n("ViewChange"),0,0);
531 // DesktopIcon("viewmag",KIcon::SizeMedium)); 537 // DesktopIcon("viewmag",KIcon::SizeMedium));
532 538
533 topLayout = new QGridLayout(topFrame,6,1); 539 topLayout = new Q3GridLayout(topFrame,6,1);
534 topLayout->setSpacing(mSpacingHint); 540 topLayout->setSpacing(mSpacingHint);
535 topLayout->setMargin(mMarginHint); 541 topLayout->setMargin(mMarginHint);
536 ii = 0; 542 ii = 0;
537 543
538#endif 544#endif
539 545
540 dummy = 546 dummy =
541 addWidBool(i18n("Hold fullscreen on view change"), 547 addWidBool(i18n("Hold fullscreen on view change"),
542 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 548 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
543 topLayout->addWidget(dummy->checkBox(),ii++,0); 549 topLayout->addWidget(dummy->checkBox(),ii++,0);
544 550
545 dummy = 551 dummy =
@@ -585,25 +591,25 @@ void KOPrefsDialog::setupViewsTab()
585 591
586#ifdef DESKTOP_VERSION 592#ifdef DESKTOP_VERSION
587 KPrefsDialogWidBool *enableToolTips = 593 KPrefsDialogWidBool *enableToolTips =
588 addWidBool(i18n("Enable tooltips displaying summary of ev."), 594 addWidBool(i18n("Enable tooltips displaying summary of ev."),
589 &(KOPrefs::instance()->mEnableToolTips),topFrame); 595 &(KOPrefs::instance()->mEnableToolTips),topFrame);
590 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 596 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
591#endif 597#endif
592 // ********************************************************* 598 // *********************************************************
593 599
594 topFrame = addPage(i18n("Agenda View"),0,0); 600 topFrame = addPage(i18n("Agenda View"),0,0);
595 // DesktopIcon("viewmag",KIcon::SizeMedium)); 601 // DesktopIcon("viewmag",KIcon::SizeMedium));
596 602
597 topLayout = new QGridLayout(topFrame,5,1); 603 topLayout = new Q3GridLayout(topFrame,5,1);
598 topLayout->setSpacing(mSpacingHint); 604 topLayout->setSpacing(mSpacingHint);
599 topLayout->setMargin(mMarginHint); 605 topLayout->setMargin(mMarginHint);
600 ii = 0; 606 ii = 0;
601 607
602 608
603 dummy = 609 dummy =
604 addWidBool(i18n("Show time in agenda items"), 610 addWidBool(i18n("Show time in agenda items"),
605 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); 611 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
606 topLayout->addWidget(dummy->checkBox(),ii++,0); 612 topLayout->addWidget(dummy->checkBox(),ii++,0);
607 613
608 dummy = 614 dummy =
609 addWidBool(i18n("Highlight current day in agenda"), 615 addWidBool(i18n("Highlight current day in agenda"),
@@ -643,50 +649,50 @@ void KOPrefsDialog::setupViewsTab()
643 dummy = 649 dummy =
644 addWidBool(i18n("Agenda view shows completed todos"), 650 addWidBool(i18n("Agenda view shows completed todos"),
645 &(KOPrefs::instance()->mShowCompletedTodoInAgenda),topFrame); 651 &(KOPrefs::instance()->mShowCompletedTodoInAgenda),topFrame);
646 topLayout->addWidget(dummy->checkBox(),ii++,0); 652 topLayout->addWidget(dummy->checkBox(),ii++,0);
647 653
648 654
649 655
650 656
651 657
652 topFrame = addPage(i18n("Month View"),0,0); 658 topFrame = addPage(i18n("Month View"),0,0);
653 // DesktopIcon("viewmag",KIcon::SizeMedium)); 659 // DesktopIcon("viewmag",KIcon::SizeMedium));
654 660
655 topLayout = new QGridLayout(topFrame,5,1); 661 topLayout = new Q3GridLayout(topFrame,5,1);
656 topLayout->setSpacing(mSpacingHint); 662 topLayout->setSpacing(mSpacingHint);
657 topLayout->setMargin(mMarginHint); 663 topLayout->setMargin(mMarginHint);
658 ii = 0; 664 ii = 0;
659 QLabel *lab; 665 QLabel *lab;
660 QHBox *habo = new QHBox( topFrame ); 666 Q3HBox *habo = new Q3HBox( topFrame );
661 if ( QApplication::desktop()->width() <= 480 ) { 667 if ( QApplication::desktop()->width() <= 480 ) {
662 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 668 lab = new QLabel ( i18n("Show events that recur "), topFrame );
663 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 669 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
664 ii++; 670 ii++;
665 } else { 671 } else {
666 new QLabel ( i18n("Show events that recur "), habo ); 672 new QLabel ( i18n("Show events that recur "), habo );
667 } 673 }
668 dailyRecur = 674 dailyRecur =
669 addWidBool(i18n("daily"), 675 addWidBool(i18n("daily"),
670 &(KOPrefs::instance()->mMonthDailyRecur),habo); 676 &(KOPrefs::instance()->mMonthDailyRecur),habo);
671 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 677 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
672 678
673 weeklyRecur = 679 weeklyRecur =
674 addWidBool(i18n("weekly"), 680 addWidBool(i18n("weekly"),
675 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 681 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
676 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 682 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
677 ii++; 683 ii++;
678 684
679 685
680 habo = new QHBox( topFrame ); 686 habo = new Q3HBox( topFrame );
681 if ( QApplication::desktop()->width() <= 480 ) { 687 if ( QApplication::desktop()->width() <= 480 ) {
682 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 688 lab = new QLabel (i18n("Show in every cell ") , topFrame );
683 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 689 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
684 ii++; 690 ii++;
685 691
686 } else { 692 } else {
687 new QLabel ( i18n("Show in every cell "), habo ); 693 new QLabel ( i18n("Show in every cell "), habo );
688 } 694 }
689 weeklyRecur = 695 weeklyRecur =
690 addWidBool(i18n("short month"), 696 addWidBool(i18n("short month"),
691 &(KOPrefs::instance()->mMonthShowShort),habo); 697 &(KOPrefs::instance()->mMonthShowShort),habo);
692 weeklyRecur = 698 weeklyRecur =
@@ -721,25 +727,25 @@ void KOPrefsDialog::setupViewsTab()
721 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 727 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
722 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 728 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
723 729
724 dummy = 730 dummy =
725 addWidBool(i18n("Category colors are applied to text"), 731 addWidBool(i18n("Category colors are applied to text"),
726 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 732 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
727 topLayout->addWidget(dummy->checkBox(),ii++,0); 733 topLayout->addWidget(dummy->checkBox(),ii++,0);
728 734
729 735
730 736
731 if ( QApplication::desktop()->height() <= 240 ) { 737 if ( QApplication::desktop()->height() <= 240 ) {
732 topFrame = addPage(i18n("Month View") +" 2",0,0); 738 topFrame = addPage(i18n("Month View") +" 2",0,0);
733 topLayout = new QGridLayout(topFrame,4,1); 739 topLayout = new Q3GridLayout(topFrame,4,1);
734 topLayout->setSpacing(2); 740 topLayout->setSpacing(2);
735 topLayout->setMargin(1); 741 topLayout->setMargin(1);
736 ii = 0; 742 ii = 0;
737 } 743 }
738 744
739 745
740 coloredCategoriesInMonthView = 746 coloredCategoriesInMonthView =
741 addWidBool(i18n("Month view uses day colors"), 747 addWidBool(i18n("Month view uses day colors"),
742 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 748 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
743 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 749 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
744 750
745 KPrefsDialogWidColor *holidayColor = 751 KPrefsDialogWidColor *holidayColor =
@@ -755,37 +761,37 @@ void KOPrefsDialog::setupViewsTab()
755 topLayout->addWidget(holidayColor->button(),ii++,1); 761 topLayout->addWidget(holidayColor->button(),ii++,1);
756 762
757 763
758 holidayColor = 764 holidayColor =
759 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 765 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
760 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 766 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
761 topLayout->addWidget(holidayColor->label(),ii,0); 767 topLayout->addWidget(holidayColor->label(),ii,0);
762 topLayout->addWidget(holidayColor->button(),ii++,1); 768 topLayout->addWidget(holidayColor->button(),ii++,1);
763 // *********************** What'sNext View 769 // *********************** What'sNext View
764 topFrame = addPage(i18n("What's Next View"),0,0); 770 topFrame = addPage(i18n("What's Next View"),0,0);
765 // DesktopIcon("viewmag",KIcon::SizeMedium)); 771 // DesktopIcon("viewmag",KIcon::SizeMedium));
766 772
767 topLayout = new QGridLayout(topFrame,4,1); 773 topLayout = new Q3GridLayout(topFrame,4,1);
768 topLayout->setSpacing(mSpacingHint); 774 topLayout->setSpacing(mSpacingHint);
769 topLayout->setMargin(mMarginHint); 775 topLayout->setMargin(mMarginHint);
770 ii = 0; 776 ii = 0;
771 777
772 778
773 QHBox* hdummy = new QHBox(topFrame); 779 Q3HBox* hdummy = new Q3HBox(topFrame);
774 new QLabel(i18n("Days in What's Next:"),hdummy); 780 new QLabel(i18n("Days in What's Next:"),hdummy);
775 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); 781 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy);
776 782
777 topLayout->addWidget(hdummy,ii++,0); 783 topLayout->addWidget(hdummy,ii++,0);
778 784
779 QHBox *prioBox = new QHBox(topFrame); 785 Q3HBox *prioBox = new Q3HBox(topFrame);
780 // intervalBox->setSpacing(mSpacingHint); 786 // intervalBox->setSpacing(mSpacingHint);
781 topLayout->addWidget(prioBox,ii++,0); 787 topLayout->addWidget(prioBox,ii++,0);
782 788
783 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox); 789 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox);
784 mPrioSpin = new QSpinBox(0,5,1,prioBox); 790 mPrioSpin = new QSpinBox(0,5,1,prioBox);
785 if ( QApplication::desktop()->width() < 300 ) 791 if ( QApplication::desktop()->width() < 300 )
786 mPrioSpin->setFixedWidth( 40 ); 792 mPrioSpin->setFixedWidth( 40 );
787 KPrefsDialogWidBool *passwdk = 793 KPrefsDialogWidBool *passwdk =
788 794
789 addWidBool(i18n("Show times on two lines"), 795 addWidBool(i18n("Show times on two lines"),
790 &(KOPrefs::instance()->mWhatsNextTime2Lines),topFrame); 796 &(KOPrefs::instance()->mWhatsNextTime2Lines),topFrame);
791 topLayout->addWidget(passwdk->checkBox(), ii++,0); 797 topLayout->addWidget(passwdk->checkBox(), ii++,0);
@@ -809,25 +815,25 @@ void KOPrefsDialog::setupViewsTab()
809 addWidBool(i18n("Use short date in WN+Event view"), 815 addWidBool(i18n("Use short date in WN+Event view"),
810 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 816 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
811 topLayout->addWidget(passwdk->checkBox(), ii++,0); 817 topLayout->addWidget(passwdk->checkBox(), ii++,0);
812 818
813 819
814 820
815 821
816 // *********************** Todo View 822 // *********************** Todo View
817 823
818 topFrame = addPage(i18n("Todo View"),0,0); 824 topFrame = addPage(i18n("Todo View"),0,0);
819 // DesktopIcon("viewmag",KIcon::SizeMedium)); 825 // DesktopIcon("viewmag",KIcon::SizeMedium));
820 826
821 topLayout = new QGridLayout(topFrame,4,1); 827 topLayout = new Q3GridLayout(topFrame,4,1);
822 topLayout->setSpacing(mSpacingHint); 828 topLayout->setSpacing(mSpacingHint);
823 topLayout->setMargin(mMarginHint); 829 topLayout->setMargin(mMarginHint);
824 ii = 0; 830 ii = 0;
825dummy = 831dummy =
826 addWidBool(i18n("Hide not running Todos in To-do view"), 832 addWidBool(i18n("Hide not running Todos in To-do view"),
827 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); 833 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame);
828 topLayout->addWidget(dummy->checkBox(),ii++,0); 834 topLayout->addWidget(dummy->checkBox(),ii++,0);
829 835
830 836
831 KPrefsDialogWidBool *showCompletedTodo = 837 KPrefsDialogWidBool *showCompletedTodo =
832 addWidBool(i18n("To-do view shows completed Todos"), 838 addWidBool(i18n("To-do view shows completed Todos"),
833 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 839 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
@@ -846,60 +852,60 @@ dummy =
846 852
847 dummy = 853 dummy =
848 addWidBool(i18n("Todo view uses category colors"), 854 addWidBool(i18n("Todo view uses category colors"),
849 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 855 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
850 topLayout->addWidget(dummy->checkBox(),ii++,0); 856 topLayout->addWidget(dummy->checkBox(),ii++,0);
851 857
852 858
853 QWidget* wid = new QWidget( topFrame ); 859 QWidget* wid = new QWidget( topFrame );
854 // Todo run today color 860 // Todo run today color
855 KPrefsDialogWidColor *todoRunColor = 861 KPrefsDialogWidColor *todoRunColor =
856 addWidColor(i18n("Color for running todos:"), 862 addWidColor(i18n("Color for running todos:"),
857 &(KOPrefs::instance()->mTodoRunColor),wid); 863 &(KOPrefs::instance()->mTodoRunColor),wid);
858 QHBoxLayout *widLayout = new QHBoxLayout(wid); 864 Q3HBoxLayout *widLayout = new Q3HBoxLayout(wid);
859 widLayout->addWidget( todoRunColor->label() ); 865 widLayout->addWidget( todoRunColor->label() );
860 widLayout->addWidget( todoRunColor->button() ); 866 widLayout->addWidget( todoRunColor->button() );
861 topLayout->addWidget(wid,ii++,0); 867 topLayout->addWidget(wid,ii++,0);
862 868
863 wid = new QWidget( topFrame ); 869 wid = new QWidget( topFrame );
864 // Todo due today color 870 // Todo due today color
865 KPrefsDialogWidColor *todoDueTodayColor = 871 KPrefsDialogWidColor *todoDueTodayColor =
866 addWidColor(i18n("Todo due today color:"), 872 addWidColor(i18n("Todo due today color:"),
867 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 873 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
868 widLayout = new QHBoxLayout(wid); 874 widLayout = new Q3HBoxLayout(wid);
869 widLayout->addWidget( todoDueTodayColor->label() ); 875 widLayout->addWidget( todoDueTodayColor->label() );
870 widLayout->addWidget( todoDueTodayColor->button() ); 876 widLayout->addWidget( todoDueTodayColor->button() );
871 topLayout->addWidget(wid,ii++,0); 877 topLayout->addWidget(wid,ii++,0);
872 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 878 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
873 879
874 // Todo overdue color 880 // Todo overdue color
875 wid = new QWidget( topFrame ); 881 wid = new QWidget( topFrame );
876 widLayout = new QHBoxLayout(wid); 882 widLayout = new Q3HBoxLayout(wid);
877 KPrefsDialogWidColor *todoOverdueColor = 883 KPrefsDialogWidColor *todoOverdueColor =
878 addWidColor(i18n("Todo overdue color:"), 884 addWidColor(i18n("Todo overdue color:"),
879 &(KOPrefs::instance()->mTodoOverdueColor),wid); 885 &(KOPrefs::instance()->mTodoOverdueColor),wid);
880 widLayout->addWidget(todoOverdueColor->label()); 886 widLayout->addWidget(todoOverdueColor->label());
881 widLayout->addWidget(todoOverdueColor->button()); 887 widLayout->addWidget(todoOverdueColor->button());
882 topLayout->addWidget(wid,ii++,0); 888 topLayout->addWidget(wid,ii++,0);
883 889
884 dummy = 890 dummy =
885 addWidBool(i18n("Colors are applied to text"), 891 addWidBool(i18n("Colors are applied to text"),
886 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 892 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
887 topLayout->addWidget(dummy->checkBox(),ii++,0); 893 topLayout->addWidget(dummy->checkBox(),ii++,0);
888 894
889 895
890 896
891 topFrame = addPage(i18n("View Options"),0,0); 897 topFrame = addPage(i18n("View Options"),0,0);
892 898
893 topLayout = new QGridLayout(topFrame,4,1); 899 topLayout = new Q3GridLayout(topFrame,4,1);
894 topLayout->setSpacing(mSpacingHint); 900 topLayout->setSpacing(mSpacingHint);
895 topLayout->setMargin(mMarginHint); 901 topLayout->setMargin(mMarginHint);
896 ii = 0; 902 ii = 0;
897 903
898 dummy = 904 dummy =
899 addWidBool(i18n("Show Sync Events"), 905 addWidBool(i18n("Show Sync Events"),
900 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 906 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
901 topLayout->addWidget(dummy->checkBox(), ii++,0); 907 topLayout->addWidget(dummy->checkBox(), ii++,0);
902 908
903 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); 909 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame);
904 topLayout->addWidget(lab ,ii++,0); 910 topLayout->addWidget(lab ,ii++,0);
905 911
@@ -920,34 +926,34 @@ dummy =
920 dummy = addWidBool(i18n("Details"), 926 dummy = addWidBool(i18n("Details"),
921 &(KOPrefs::instance()->mWTshowDetails),topFrame); 927 &(KOPrefs::instance()->mWTshowDetails),topFrame);
922 topLayout->addWidget(dummy->checkBox(),ii++,0); 928 topLayout->addWidget(dummy->checkBox(),ii++,0);
923 dummy = addWidBool(i18n("Created time"), 929 dummy = addWidBool(i18n("Created time"),
924 &(KOPrefs::instance()->mWTshowCreated),topFrame); 930 &(KOPrefs::instance()->mWTshowCreated),topFrame);
925 topLayout->addWidget(dummy->checkBox(),ii++,0); 931 topLayout->addWidget(dummy->checkBox(),ii++,0);
926 dummy = addWidBool(i18n("Last modified time"), 932 dummy = addWidBool(i18n("Last modified time"),
927 &(KOPrefs::instance()->mWTshowChanged),topFrame); 933 &(KOPrefs::instance()->mWTshowChanged),topFrame);
928 topLayout->addWidget(dummy->checkBox(),ii++,0); 934 topLayout->addWidget(dummy->checkBox(),ii++,0);
929 935
930 topFrame = addPage(i18n("Conflict detection"),0,0); 936 topFrame = addPage(i18n("Conflict detection"),0,0);
931 937
932 topLayout = new QGridLayout(topFrame,2,1); 938 topLayout = new Q3GridLayout(topFrame,2,1);
933 topLayout->setSpacing(mSpacingHint); 939 topLayout->setSpacing(mSpacingHint);
934 topLayout->setMargin(mMarginHint); 940 topLayout->setMargin(mMarginHint);
935 ii = 0; 941 ii = 0;
936 dummy = addWidBool(i18n("Enable conflict detection"), 942 dummy = addWidBool(i18n("Enable conflict detection"),
937 &(KOPrefs::instance()->mDetectConflicts),topFrame); 943 &(KOPrefs::instance()->mDetectConflicts),topFrame);
938 topLayout->addWidget(dummy->checkBox(), ii++,0); 944 topLayout->addWidget(dummy->checkBox(), ii++,0);
939 topFrame = new QFrame( topFrame ); 945 topFrame = new Q3Frame( topFrame );
940 topLayout->addWidget(topFrame ,ii++,0); 946 topLayout->addWidget(topFrame ,ii++,0);
941 topLayout = new QGridLayout(topFrame,4,1); 947 topLayout = new Q3GridLayout(topFrame,4,1);
942 connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) ); 948 connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) );
943 dummy = addWidBool(i18n("Include events which \"show as free\""), 949 dummy = addWidBool(i18n("Include events which \"show as free\""),
944 &(KOPrefs::instance()->mIncludeFree),topFrame); 950 &(KOPrefs::instance()->mIncludeFree),topFrame);
945 topLayout->addWidget(dummy->checkBox(), ii++,0); 951 topLayout->addWidget(dummy->checkBox(), ii++,0);
946 topLayout->addWidget( new QLabel ( i18n("Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping."), topFrame ) , ii++,0); 952 topLayout->addWidget( new QLabel ( i18n("Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping."), topFrame ) , ii++,0);
947 953
948 topLayout->addWidget( new QLabel ( i18n("Filter for the edited event"), topFrame ) , ii++,0); 954 topLayout->addWidget( new QLabel ( i18n("Filter for the edited event"), topFrame ) , ii++,0);
949 mFilterEditItem = new QComboBox( topFrame ); 955 mFilterEditItem = new QComboBox( topFrame );
950 topLayout->addWidget(mFilterEditItem,ii++,0); 956 topLayout->addWidget(mFilterEditItem,ii++,0);
951 topLayout->addWidget( new QLabel ( i18n("Filter for other events"), topFrame ) , ii++,0); 957 topLayout->addWidget( new QLabel ( i18n("Filter for other events"), topFrame ) , ii++,0);
952 mFilterAllItem = new QComboBox( topFrame ); 958 mFilterAllItem = new QComboBox( topFrame );
953 topLayout->addWidget(mFilterAllItem,ii++,0); 959 topLayout->addWidget(mFilterAllItem,ii++,0);
@@ -961,70 +967,70 @@ dummy =
961 &(KOPrefs::instance()->mCheckConflictsNonADAllDay),topFrame); 967 &(KOPrefs::instance()->mCheckConflictsNonADAllDay),topFrame);
962 topLayout->addWidget(dummy->checkBox(), ii++,0); 968 topLayout->addWidget(dummy->checkBox(), ii++,0);
963 dummy = addWidBool(i18n("Check NonAllday with NonAllday"), 969 dummy = addWidBool(i18n("Check NonAllday with NonAllday"),
964 &(KOPrefs::instance()->mCheckConflictsNonADNonAD),topFrame); 970 &(KOPrefs::instance()->mCheckConflictsNonADNonAD),topFrame);
965 topLayout->addWidget(dummy->checkBox(), ii++,0); 971 topLayout->addWidget(dummy->checkBox(), ii++,0);
966 972
967 973
968 974
969 975
970 topFrame = addPage(i18n("Alarm"),0,0); 976 topFrame = addPage(i18n("Alarm"),0,0);
971 // DesktopIcon("viewmag",KIcon::SizeMedium)); 977 // DesktopIcon("viewmag",KIcon::SizeMedium));
972 978
973 topLayout = new QGridLayout(topFrame,2,1); 979 topLayout = new Q3GridLayout(topFrame,2,1);
974 topLayout->setSpacing(mSpacingHint); 980 topLayout->setSpacing(mSpacingHint);
975 topLayout->setMargin(mMarginHint); 981 topLayout->setMargin(mMarginHint);
976 int iii = 0; 982 int iii = 0;
977 983
978 dummy = 984 dummy =
979 addWidBool(i18n("Use internal alarm notification"), 985 addWidBool(i18n("Use internal alarm notification"),
980 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 986 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
981 topLayout->addWidget(dummy->checkBox(),iii++,0); 987 topLayout->addWidget(dummy->checkBox(),iii++,0);
982 988
983 if ( QApplication::desktop()->height() > 240 ) { 989 if ( QApplication::desktop()->height() > 240 ) {
984 990
985 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 991 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
986 992
987 topLayout->addWidget(lab ,iii++,0); 993 topLayout->addWidget(lab ,iii++,0);
988 } 994 }
989#ifndef DESKTOP_VERSION 995#ifndef DESKTOP_VERSION
990 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 996 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
991#else 997#else
992 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 998 lab->setAlignment( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop);
993 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 999 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
994#endif 1000#endif
995 1001
996 QHBox* dummyBox = new QHBox(topFrame); 1002 Q3HBox* dummyBox = new Q3HBox(topFrame);
997 new QLabel(i18n("Play beeps count:"),dummyBox); 1003 new QLabel(i18n("Play beeps count:"),dummyBox);
998 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 1004 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
999 topLayout->addWidget(dummyBox,iii++,0); 1005 topLayout->addWidget(dummyBox,iii++,0);
1000 1006
1001 dummyBox = new QHBox(topFrame); 1007 dummyBox = new Q3HBox(topFrame);
1002 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 1008 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
1003 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 1009 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
1004 topLayout->addWidget(dummyBox,iii++,0); 1010 topLayout->addWidget(dummyBox,iii++,0);
1005 1011
1006 dummyBox = new QHBox(topFrame); 1012 dummyBox = new Q3HBox(topFrame);
1007 new QLabel(i18n("Default suspend time in min:"),dummyBox); 1013 new QLabel(i18n("Default suspend time in min:"),dummyBox);
1008 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 1014 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
1009 topLayout->addWidget(dummyBox,iii++,0); 1015 topLayout->addWidget(dummyBox,iii++,0);
1010 1016
1011 dummyBox = new QHBox(topFrame); 1017 dummyBox = new Q3HBox(topFrame);
1012 new QLabel(i18n("Auto suspend count:"),dummyBox); 1018 new QLabel(i18n("Auto suspend count:"),dummyBox);
1013 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 1019 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
1014 topLayout->addWidget(dummyBox,iii++,0); 1020 topLayout->addWidget(dummyBox,iii++,0);
1015 1021
1016 1022
1017 1023
1018 QHBox* hbo = new QHBox ( topFrame ); 1024 Q3HBox* hbo = new Q3HBox ( topFrame );
1019 mDefaultAlarmFile = new QLineEdit(hbo); 1025 mDefaultAlarmFile = new QLineEdit(hbo);
1020 QPushButton * loadTemplate = new QPushButton(hbo); 1026 QPushButton * loadTemplate = new QPushButton(hbo);
1021 QPixmap icon; 1027 QPixmap icon;
1022 if ( QApplication::desktop()->width() < 321 ) 1028 if ( QApplication::desktop()->width() < 321 )
1023 icon = SmallIcon("fileimport16"); 1029 icon = SmallIcon("fileimport16");
1024 else 1030 else
1025 icon = SmallIcon("fileimport"); 1031 icon = SmallIcon("fileimport");
1026 loadTemplate->setIconSet (icon ) ; 1032 loadTemplate->setIconSet (icon ) ;
1027 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 1033 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
1028 int size = loadTemplate->sizeHint().height(); 1034 int size = loadTemplate->sizeHint().height();
1029 loadTemplate->setFixedSize( size, size ); 1035 loadTemplate->setFixedSize( size, size );
1030 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 1036 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
@@ -1046,28 +1052,28 @@ dummy =
1046} 1052}
1047 1053
1048void KOPrefsDialog::selectSoundFile() 1054void KOPrefsDialog::selectSoundFile()
1049{ 1055{
1050 QString fileName = mDefaultAlarmFile->text(); 1056 QString fileName = mDefaultAlarmFile->text();
1051 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 1057 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
1052 if ( fileName.length() > 0 ) 1058 if ( fileName.length() > 0 )
1053 mDefaultAlarmFile->setText( fileName ); 1059 mDefaultAlarmFile->setText( fileName );
1054} 1060}
1055void KOPrefsDialog::setupFontsTab() 1061void KOPrefsDialog::setupFontsTab()
1056{ 1062{
1057 1063
1058 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 1064 Q3Frame *topFrame = addPage(i18n("Fonts"),0,0);
1059 // DesktopIcon("fonts",KIcon::SizeMedium)); 1065 // DesktopIcon("fonts",KIcon::SizeMedium));
1060 1066
1061 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 1067 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,7,3);
1062 topLayout->setSpacing(1); 1068 topLayout->setSpacing(1);
1063 topLayout->setMargin(3); 1069 topLayout->setMargin(3);
1064 KPrefsDialogWidFont * tVFont; 1070 KPrefsDialogWidFont * tVFont;
1065 int i = 0; 1071 int i = 0;
1066 KPrefsDialogWidFont *timeLabelsFont = 1072 KPrefsDialogWidFont *timeLabelsFont =
1067 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 1073 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
1068 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 1074 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
1069 topLayout->addWidget(timeLabelsFont->label(),i,0); 1075 topLayout->addWidget(timeLabelsFont->label(),i,0);
1070 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1076 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1071 topLayout->addWidget(timeLabelsFont->button(),i,2); 1077 topLayout->addWidget(timeLabelsFont->button(),i,2);
1072 ++i; 1078 ++i;
1073 1079
@@ -1116,25 +1122,25 @@ void KOPrefsDialog::setupFontsTab()
1116 ++i; 1122 ++i;
1117 1123
1118 1124
1119 1125
1120 topLayout->setColStretch(1,1); 1126 topLayout->setColStretch(1,1);
1121 topLayout->setRowStretch(4,1); 1127 topLayout->setRowStretch(4,1);
1122 1128
1123 1129
1124 i = 0; 1130 i = 0;
1125 topFrame = addPage(i18n("View Fonts"),0, 1131 topFrame = addPage(i18n("View Fonts"),0,
1126 DesktopIcon("fonts",KIcon::SizeMedium)); 1132 DesktopIcon("fonts",KIcon::SizeMedium));
1127 1133
1128 topLayout = new QGridLayout(topFrame,7,3); 1134 topLayout = new Q3GridLayout(topFrame,7,3);
1129 topLayout->setSpacing(1); 1135 topLayout->setSpacing(1);
1130 topLayout->setMargin(3); 1136 topLayout->setMargin(3);
1131 1137
1132 tVFont = 1138 tVFont =
1133 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1139 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1134 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1140 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1135 topLayout->addWidget(tVFont->label(),i,0); 1141 topLayout->addWidget(tVFont->label(),i,0);
1136 topLayout->addWidget(tVFont->preview(),i,1); 1142 topLayout->addWidget(tVFont->preview(),i,1);
1137 topLayout->addWidget(tVFont->button(),i,2); 1143 topLayout->addWidget(tVFont->button(),i,2);
1138 ++i; 1144 ++i;
1139 KPrefsDialogWidFont *agendaViewFont = 1145 KPrefsDialogWidFont *agendaViewFont =
1140 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1146 addWidFont(i18n("Event text"),i18n("Agenda view:"),
@@ -1184,38 +1190,38 @@ void KOPrefsDialog::setupFontsTab()
1184 1190
1185 1191
1186 topLayout->setColStretch(1,1); 1192 topLayout->setColStretch(1,1);
1187 topLayout->setRowStretch(4,1); 1193 topLayout->setRowStretch(4,1);
1188 1194
1189 1195
1190 1196
1191 1197
1192} 1198}
1193 1199
1194void KOPrefsDialog::setupColorsTab() 1200void KOPrefsDialog::setupColorsTab()
1195{ 1201{
1196 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1202 Q3Frame *topFrame = addPage(i18n("Colors"),0,0);
1197 // DesktopIcon("colorize",KIcon::SizeMedium)); 1203 // DesktopIcon("colorize",KIcon::SizeMedium));
1198 1204
1199 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1205 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2);
1200 // topLayout->setSpacing(mSpacingHint); 1206 // topLayout->setSpacing(mSpacingHint);
1201 // topLayout->setMargin(mMarginHint); 1207 // topLayout->setMargin(mMarginHint);
1202 1208
1203 topLayout->setSpacing(2); 1209 topLayout->setSpacing(2);
1204 topLayout->setMargin(3); 1210 topLayout->setMargin(3);
1205 1211
1206 int ii = 1; 1212 int ii = 1;
1207 QGroupBox *categoryGroup ; 1213 Q3GroupBox *categoryGroup ;
1208 1214
1209 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), 1215 categoryGroup = new Q3GroupBox(1,Qt::Vertical,i18n("Categories"),
1210 topFrame); 1216 topFrame);
1211 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); 1217 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
1212 1218
1213 mCategoryCombo = new QComboBox(categoryGroup); 1219 mCategoryCombo = new QComboBox(categoryGroup);
1214 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1220 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1215 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); 1221 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
1216 1222
1217 mCategoryButton = new KColorButton(categoryGroup); 1223 mCategoryButton = new KColorButton(categoryGroup);
1218 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); 1224 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
1219 updateCategoryColor(); 1225 updateCategoryColor();
1220 1226
1221 1227
@@ -1241,25 +1247,25 @@ void KOPrefsDialog::setupColorsTab()
1241 topLayout->addWidget(eventColor->label(),ii,0); 1247 topLayout->addWidget(eventColor->label(),ii,0);
1242 topLayout->addWidget(eventColor->button(),ii++,1); 1248 topLayout->addWidget(eventColor->button(),ii++,1);
1243 eventColor = 1249 eventColor =
1244 addWidColor(i18n("Default todo done color:"), 1250 addWidColor(i18n("Default todo done color:"),
1245 &(KOPrefs::instance()->mTodoDoneColor),topFrame); 1251 &(KOPrefs::instance()->mTodoDoneColor),topFrame);
1246 topLayout->addWidget(eventColor->label(),ii,0); 1252 topLayout->addWidget(eventColor->label(),ii,0);
1247 topLayout->addWidget(eventColor->button(),ii++,1); 1253 topLayout->addWidget(eventColor->button(),ii++,1);
1248 1254
1249 if ( QApplication::desktop()->height() <= 240 ) { 1255 if ( QApplication::desktop()->height() <= 240 ) {
1250 topFrame = addPage(i18n("Colors") +" 2",0,0); 1256 topFrame = addPage(i18n("Colors") +" 2",0,0);
1251 // DesktopIcon("colorize",KIcon::SizeMedium)); 1257 // DesktopIcon("colorize",KIcon::SizeMedium));
1252 1258
1253 topLayout = new QGridLayout(topFrame,5,2); 1259 topLayout = new Q3GridLayout(topFrame,5,2);
1254 // topLayout->setSpacing(mSpacingHint); 1260 // topLayout->setSpacing(mSpacingHint);
1255 // topLayout->setMargin(mMarginHint); 1261 // topLayout->setMargin(mMarginHint);
1256 1262
1257 topLayout->setSpacing(2); 1263 topLayout->setSpacing(2);
1258 topLayout->setMargin(3); 1264 topLayout->setMargin(3);
1259 } 1265 }
1260 1266
1261 1267
1262 // agenda view background color 1268 // agenda view background color
1263 KPrefsDialogWidColor *agendaBgColor = 1269 KPrefsDialogWidColor *agendaBgColor =
1264 addWidColor(i18n("Agenda view background color:"), 1270 addWidColor(i18n("Agenda view background color:"),
1265 &(KOPrefs::instance()->mAgendaBgColor),topFrame); 1271 &(KOPrefs::instance()->mAgendaBgColor),topFrame);
@@ -1308,89 +1314,89 @@ void KOPrefsDialog::updateCategoryColor()
1308 color = KOPrefs::instance()->categoryColor(cat); 1314 color = KOPrefs::instance()->categoryColor(cat);
1309 } 1315 }
1310 if (color) { 1316 if (color) {
1311 mCategoryButton->setColor(*color); 1317 mCategoryButton->setColor(*color);
1312 } 1318 }
1313} 1319}
1314 1320
1315void KOPrefsDialog::setupPrinterTab() 1321void KOPrefsDialog::setupPrinterTab()
1316{ 1322{
1317 mPrinterTab = addPage(i18n("Printing"),0, 1323 mPrinterTab = addPage(i18n("Printing"),0,
1318 DesktopIcon("fileprint",KIcon::SizeMedium)); 1324 DesktopIcon("fileprint",KIcon::SizeMedium));
1319 1325
1320 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1326 Q3GridLayout *topLayout = new Q3GridLayout(mPrinterTab,5,2);
1321 topLayout->setSpacing(mSpacingHint); 1327 topLayout->setSpacing(mSpacingHint);
1322 topLayout->setMargin(mMarginHint); 1328 topLayout->setMargin(mMarginHint);
1323 1329
1324 topLayout->setRowStretch(4,1); 1330 topLayout->setRowStretch(4,1);
1325} 1331}
1326 1332
1327void KOPrefsDialog::setupGroupSchedulingTab() 1333void KOPrefsDialog::setupGroupSchedulingTab()
1328{ 1334{
1329#if 0 1335#if 0
1330 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1336 Q3Frame *topFrame = addPage(i18n("Group Scheduling"),0,
1331 DesktopIcon("personal",KIcon::SizeMedium)); 1337 DesktopIcon("personal",KIcon::SizeMedium));
1332 1338
1333 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1339 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2);
1334 topLayout->setSpacing(mSpacingHint); 1340 topLayout->setSpacing(mSpacingHint);
1335 topLayout->setMargin(mMarginHint); 1341 topLayout->setMargin(mMarginHint);
1336 1342
1337#if 0 1343#if 0
1338 KPrefsDialogWidRadios *schedulerGroup = 1344 KPrefsDialogWidRadios *schedulerGroup =
1339 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1345 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1340 topFrame); 1346 topFrame);
1341 schedulerGroup->addRadio("Dummy"); // Only for debugging 1347 schedulerGroup->addRadio("Dummy"); // Only for debugging
1342 schedulerGroup->addRadio(i18n("Mail client")); 1348 schedulerGroup->addRadio(i18n("Mail client"));
1343 1349
1344 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1350 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1345#endif 1351#endif
1346 1352
1347 KPrefsDialogWidRadios *sendGroup = 1353 KPrefsDialogWidRadios *sendGroup =
1348 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1354 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1349 topFrame); 1355 topFrame);
1350 sendGroup->addRadio(i18n("Send to outbox")); 1356 sendGroup->addRadio(i18n("Send to outbox"));
1351 sendGroup->addRadio(i18n("Send directly")); 1357 sendGroup->addRadio(i18n("Send directly"));
1352 1358
1353 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1359 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1354 1360
1355 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1361 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1356 mAMails = new QListView(topFrame); 1362 mAMails = new Q3ListView(topFrame);
1357 mAMails->addColumn(i18n("Email"),300); 1363 mAMails->addColumn(i18n("Email"),300);
1358 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1364 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1359 1365
1360 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1366 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1361 aEmailsEdit = new QLineEdit(topFrame); 1367 aEmailsEdit = new QLineEdit(topFrame);
1362 aEmailsEdit->setEnabled(false); 1368 aEmailsEdit->setEnabled(false);
1363 topLayout->addWidget(aEmailsEdit,4,1); 1369 topLayout->addWidget(aEmailsEdit,4,1);
1364 1370
1365 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1371 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1366 topLayout->addWidget(add,5,0); 1372 topLayout->addWidget(add,5,0);
1367 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1373 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1368 topLayout->addWidget(del,5,1); 1374 topLayout->addWidget(del,5,1);
1369 1375
1370 //topLayout->setRowStretch(2,1); 1376 //topLayout->setRowStretch(2,1);
1371 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1377 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1372 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1378 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1373 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1379 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1374 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1380 connect(mAMails,SIGNAL(selectionChanged(Q3ListViewItem *)),SLOT(updateInput()));
1375#endif 1381#endif
1376} 1382}
1377 1383
1378void KOPrefsDialog::setupGroupAutomationTab() 1384void KOPrefsDialog::setupGroupAutomationTab()
1379{ 1385{
1380 return; 1386 return;
1381 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1387 Q3Frame *topFrame = addPage(i18n("Group Automation"),0,
1382 DesktopIcon("personal",KIcon::SizeMedium)); 1388 DesktopIcon("personal",KIcon::SizeMedium));
1383 1389
1384 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1390 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,1);
1385 topLayout->setSpacing(mSpacingHint); 1391 topLayout->setSpacing(mSpacingHint);
1386 topLayout->setMargin(mMarginHint); 1392 topLayout->setMargin(mMarginHint);
1387 1393
1388 KPrefsDialogWidRadios *autoRefreshGroup = 1394 KPrefsDialogWidRadios *autoRefreshGroup =
1389 addWidRadios(i18n("Auto Send Refresh"), 1395 addWidRadios(i18n("Auto Send Refresh"),
1390 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1396 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1391 autoRefreshGroup->addRadio(i18n("Never")); 1397 autoRefreshGroup->addRadio(i18n("Never"));
1392 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1398 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1393 //autoRefreshGroup->addRadio(i18n("selected emails")); 1399 //autoRefreshGroup->addRadio(i18n("selected emails"));
1394 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1400 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1395 1401
1396 KPrefsDialogWidRadios *autoInsertGroup = 1402 KPrefsDialogWidRadios *autoInsertGroup =
@@ -1506,25 +1512,25 @@ void KOPrefsDialog::usrWriteConfig()
1506 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1512 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1507 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1513 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1508 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1514 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1509 if ( mCatDefaultColor != KOPrefs::instance()->mEventColor ) { 1515 if ( mCatDefaultColor != KOPrefs::instance()->mEventColor ) {
1510 QStringList cat = KOPrefs::instance()->mCustomCategories; 1516 QStringList cat = KOPrefs::instance()->mCustomCategories;
1511 int iii = 0; 1517 int iii = 0;
1512 while ( iii < cat.count() ) { 1518 while ( iii < cat.count() ) {
1513 if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor ) 1519 if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor )
1514 KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor ); 1520 KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor );
1515 ++iii; 1521 ++iii;
1516 } 1522 }
1517 } 1523 }
1518 QDictIterator<QColor> it(mCategoryDict); 1524 Q3DictIterator<QColor> it(mCategoryDict);
1519 while (it.current()) { 1525 while (it.current()) {
1520 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1526 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1521 ++it; 1527 ++it;
1522 } 1528 }
1523 1529
1524 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1530 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1525 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1531 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1526 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1532 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1527 1533
1528 KOPrefs::instance()->mAdditionalMails.clear(); 1534 KOPrefs::instance()->mAdditionalMails.clear();
1529 // QListViewItem *item; 1535 // QListViewItem *item;
1530 // item = mAMails->firstChild(); 1536 // item = mAMails->firstChild();
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h
index ee7a7aa..ccc1726 100644
--- a/korganizer/koprefsdialog.h
+++ b/korganizer/koprefsdialog.h
@@ -14,28 +14,30 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOPREFSDIALOG_H 23#ifndef _KOPREFSDIALOG_H
24#define _KOPREFSDIALOG_H 24#define _KOPREFSDIALOG_H
25 25
26#include <qframe.h> 26#include <q3frame.h>
27#include <qdict.h> 27#include <q3dict.h>
28#include <qcolor.h> 28#include <qcolor.h>
29#include <qlistview.h> 29#include <q3listview.h>
30//Added by qt3to4:
31#include <QLabel>
30 32
31#include <kdialogbase.h> 33#include <kdialogbase.h>
32 34
33#include <libkdepim/kprefsdialog.h> 35#include <libkdepim/kprefsdialog.h>
34#include <libkdepim/kdateedit.h> 36#include <libkdepim/kdateedit.h>
35#include <kcmconfigs/kdepimconfigwidget.h> 37#include <kcmconfigs/kdepimconfigwidget.h>
36 38
37class KColorButton; 39class KColorButton;
38class QSpinBox; 40class QSpinBox;
39class QSlider; 41class QSlider;
40class KURLRequester; 42class KURLRequester;
41class QComboBox; 43class QComboBox;
@@ -85,25 +87,25 @@ class KOPrefsDialog : public KPrefsDialog
85 void setupPrinterTab(); 87 void setupPrinterTab();
86 void setupGroupSchedulingTab(); 88 void setupGroupSchedulingTab();
87 void setupGroupAutomationTab(); 89 void setupGroupAutomationTab();
88 90
89 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); 91 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
90 92
91 93
92 private: 94 private:
93 QColor mCatDefaultColor; 95 QColor mCatDefaultColor;
94 KPrefsDialogWidBool *mEnableGroupScheduling; 96 KPrefsDialogWidBool *mEnableGroupScheduling;
95 KPrefsDialogWidBool *mEnableProjectView; 97 KPrefsDialogWidBool *mEnableProjectView;
96 98
97 QFrame *mPrinterTab; 99 Q3Frame *mPrinterTab;
98 100
99 QLineEdit *nameEdit; 101 QLineEdit *nameEdit;
100 QLineEdit *emailEdit; 102 QLineEdit *emailEdit;
101 103
102 QComboBox *timeCombo; 104 QComboBox *timeCombo;
103 QComboBox *tzCombo; 105 QComboBox *tzCombo;
104 106
105 // widgets holding preferences data 107 // widgets holding preferences data
106 QLineEdit *mNameEdit; 108 QLineEdit *mNameEdit;
107 QLineEdit *mEmailEdit; 109 QLineEdit *mEmailEdit;
108 QLabel *mNameLabel; 110 QLabel *mNameLabel;
109 QLabel *mEmailLabel; 111 QLabel *mEmailLabel;
@@ -112,25 +114,25 @@ class KOPrefsDialog : public KPrefsDialog
112 QSpinBox *mPrioSpin; 114 QSpinBox *mPrioSpin;
113 // QListView *mAMails; 115 // QListView *mAMails;
114 QLineEdit *aEmailsEdit; 116 QLineEdit *aEmailsEdit;
115 117
116 QComboBox *mTimeZoneCombo; 118 QComboBox *mTimeZoneCombo;
117 QStringList tzonenames; 119 QStringList tzonenames;
118 QSpinBox *mStartTimeSpin; 120 QSpinBox *mStartTimeSpin;
119 QSpinBox *mDefaultDurationSpin; 121 QSpinBox *mDefaultDurationSpin;
120 QComboBox *mAlarmTimeCombo; 122 QComboBox *mAlarmTimeCombo;
121 123
122 QComboBox *mCategoryCombo; 124 QComboBox *mCategoryCombo;
123 KColorButton *mCategoryButton; 125 KColorButton *mCategoryButton;
124 QDict<QColor> mCategoryDict; 126 Q3Dict<QColor> mCategoryDict;
125 127
126 QSlider *mHourSizeSlider; 128 QSlider *mHourSizeSlider;
127 129
128 QSpinBox *mNextXDaysSpin; 130 QSpinBox *mNextXDaysSpin;
129 QSpinBox *mWhatsNextSpin; 131 QSpinBox *mWhatsNextSpin;
130 132
131 QLineEdit * mRemoteIPEdit; 133 QLineEdit * mRemoteIPEdit;
132 QLineEdit * mRemoteUser; 134 QLineEdit * mRemoteUser;
133 QLineEdit * mRemotePassWd; 135 QLineEdit * mRemotePassWd;
134 QLineEdit * mRemoteFile; 136 QLineEdit * mRemoteFile;
135 QLineEdit * mLocalTempFile; 137 QLineEdit * mLocalTempFile;
136 QWidget* mSetupSyncAlgTab; 138 QWidget* mSetupSyncAlgTab;
diff --git a/korganizer/korganizer.pro b/korganizer/korganizer.pro
index df8f8d7..0f3b328 100644
--- a/korganizer/korganizer.pro
+++ b/korganizer/korganizer.pro
@@ -1,67 +1,67 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on 2 CONFIG += qt warn_on
3 TARGET = kopi 3 TARGET = kopi
4OBJECTS_DIR = _obj/ 4OBJECTS_DIR = _obj/
5MOC_DIR = _moc 5MOC_DIR = _moc
6DESTDIR= ../bin 6DESTDIR= ../bin
7 7
8include( ../variables.pri ) 8include( ../variables.pri )
9 9
10INCLUDEPATH += ../microkde ../ interfaces ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim 10INCLUDEPATH += ../microkde ../ interfaces ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim
11#../qtcompat 11#../qtcompat
12DEFINES += KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL 12DEFINES += KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL
13DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER 13DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER
14#KORG_NOPRINTER KORG_NOKABC KORG_NODND 14#KORG_NOPRINTER KORG_NOKABC KORG_NODND
15DEFINES += KORG_NOLVALTERNATION 15DEFINES += KORG_NOLVALTERNATION
16DEFINES += DESKTOP_VERSION 16DEFINES += DESKTOP_VERSION
17unix : { 17unix : {
18staticlib: { 18staticlib: {
19 TARGET = kopi_linux 19 TARGET = kopi_linux
20LIBS += ../bin/libmicrokabc_qtopia.a 20LIBS += ../bin/libxmicrokabc_qtopia.a
21LIBS += ../bin/libmicrokabc_file.a 21LIBS += ../bin/libxmicrokabc_file.a
22LIBS += ../bin/libmicrokabc_dir.a 22LIBS += ../bin/libxmicrokabc_dir.a
23LIBS += ../bin/libmicrokdepim.a 23LIBS += ../bin/libxmicrokdepim.a
24LIBS += ../bin/libmicrokcal.a 24LIBS += ../bin/libxmicrokcal.a
25LIBS += ../bin/libmicrokabc.a 25LIBS += ../bin/libxmicrokabc.a
26LIBS += ../bin/libmicrokde.a 26LIBS += ../bin/libxmicrokde.a
27LIBS += ../bin/libmicrokabc_qtopia.a 27LIBS += ../bin/libxmicrokabc_qtopia.a
28LIBS += ../bin/libmicrokabc_file.a 28LIBS += ../bin/libxmicrokabc_file.a
29LIBS += ../bin/libmicrokabc_dir.a 29LIBS += ../bin/libxmicrokabc_dir.a
30LIBS += ../bin/libmicrokdepim.a 30LIBS += ../bin/libxmicrokdepim.a
31LIBS += ../bin/libmicrokcal.a 31LIBS += ../bin/libxmicrokcal.a
32LIBS += ../bin/libmicrokabc.a 32LIBS += ../bin/libxmicrokabc.a
33LIBS += ../bin/libmicrokde.a 33LIBS += ../bin/libxmicrokde.a
34LIBS += ../libical/lib/libical.a 34LIBS += ../libical/lib/libical.a
35LIBS += ../libical/lib/libicalss.a 35LIBS += ../libical/lib/libicalss.a
36} else { 36} else {
37LIBS += ../bin/libmicrokdepim.so 37LIBS += ../bin/libxmicrokdepim.so
38LIBS += ../bin/libmicrokcal.so 38LIBS += ../bin/libxmicrokcal.so
39LIBS += ../bin/libmicrokde.so 39LIBS += ../bin/libxmicrokde.so
40LIBS += ../bin/libmicrokabc.so 40LIBS += ../bin/libxmicrokabc.so
41#LIBS += -lbluetooth 41#LIBS += -lbluetooth
42#LIBS += -lsdp 42#LIBS += -lsdp
43 43
44#LIBS += -lldap 44#LIBS += -lldap
45} 45}
46OBJECTS_DIR = obj/unix 46OBJECTS_DIR = obj/unix
47MOC_DIR = moc/unix 47MOC_DIR = moc/unix
48} 48}
49win32: { 49win32: {
50RC_FILE = winicons.rc 50RC_FILE = winicons.rc
51DEFINES += _WIN32_ 51DEFINES += _WIN32_
52LIBS += ../bin/microkdepim.lib 52LIBS += ../bin/xmicrokdepim.lib
53LIBS += ../bin/microkcal.lib 53LIBS += ../bin/xmicrokcal.lib
54LIBS += ../bin/microkde.lib 54LIBS += ../bin/xmicrokde.lib
55LIBS += ../bin/microkabc.lib 55LIBS += ../bin/xmicrokabc.lib
56LIBS += ../libical/lib/ical.lib 56LIBS += ../libical/lib/ical.lib
57LIBS += ../libical/lib/icalss.lib 57LIBS += ../libical/lib/icalss.lib
58#LIBS += atls.lib 58#LIBS += atls.lib
59QMAKE_LINK += /NODEFAULTLIB:LIBC 59QMAKE_LINK += /NODEFAULTLIB:LIBC
60OBJECTS_DIR = obj/win 60OBJECTS_DIR = obj/win
61MOC_DIR = moc/win 61MOC_DIR = moc/win
62#olimport section 62#olimport section
63importol: { 63importol: {
64debug: { 64debug: {
65LIBS += mfc71ud.lib 65LIBS += mfc71ud.lib
66QMAKE_LINK += /NODEFAULTLIB:MSVCRT 66QMAKE_LINK += /NODEFAULTLIB:MSVCRT
67QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib 67QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib
@@ -76,25 +76,26 @@ HEADERS += ../outport/msoutl9.h \
76 76
77SOURCES += ../outport/msoutl9.cpp \ 77SOURCES += ../outport/msoutl9.cpp \
78 koimportoldialog.cpp 78 koimportoldialog.cpp
79#olimport section end 79#olimport section end
80 TARGET = kopi_xp 80 TARGET = kopi_xp
81} else { 81} else {
82 TARGET = kopi_me 82 TARGET = kopi_me
83} 83}
84 84
85} 85}
86 86
87 87
88INTERFACES = kofilterview_base.ui 88#The following line was changed from INTERFACES to FORMS3 by qt3to4
89FORMS3 = kofilterview_base.ui
89#filteredit_base.ui 90#filteredit_base.ui
90 91
91# kdateedit.h \ 92# kdateedit.h \
92 93
93HEADERS += datenavigatorcontainer.h \ 94HEADERS += datenavigatorcontainer.h \
94 filteredit_base.h \ 95 filteredit_base.h \
95 alarmclient.h \ 96 alarmclient.h \
96 calendarview.h \ 97 calendarview.h \
97 customlistviewitem.h \ 98 customlistviewitem.h \
98 datenavigator.h \ 99 datenavigator.h \
99 docprefs.h \ 100 docprefs.h \
100 filtereditdialog.h \ 101 filtereditdialog.h \
@@ -201,18 +202,24 @@ filteredit_base.cpp \
201 outgoingdialog.cpp \ 202 outgoingdialog.cpp \
202 outgoingdialog_base.cpp \ 203 outgoingdialog_base.cpp \
203 publishdialog.cpp \ 204 publishdialog.cpp \
204 publishdialog_base.cpp \ 205 publishdialog_base.cpp \
205 savetemplatedialog.cpp \ 206 savetemplatedialog.cpp \
206 searchdialog.cpp \ 207 searchdialog.cpp \
207 statusdialog.cpp \ 208 statusdialog.cpp \
208 timeline.cpp \ 209 timeline.cpp \
209 timespanview.cpp \ 210 timespanview.cpp \
210 ../kalarmd/alarmdialog.cpp 211 ../kalarmd/alarmdialog.cpp
211 212
212HEADERS += calprintbase.h calprinter.h calprintplugins.h cellitem.h 213HEADERS += calprintbase.h calprinter.h calprintplugins.h cellitem.h
213INTERFACES += calprintdayconfig_base.ui \ 214#The following line was changed from INTERFACES to FORMS3 by qt3to4
215FORMS3 += calprintdayconfig_base.ui \
214 calprintmonthconfig_base.ui \ 216 calprintmonthconfig_base.ui \
215 calprinttodoconfig_base.ui \ 217 calprinttodoconfig_base.ui \
216 calprintweekconfig_base.ui 218 calprintweekconfig_base.ui
217SOURCES += calprintbase.cpp calprinter.cpp calprintplugins.cpp cellitem.cpp 219SOURCES += calprintbase.cpp calprinter.cpp calprintplugins.cpp cellitem.cpp
218 220
221#The following line was inserted by qt3to4
222QT += xml qt3support
223#The following line was inserted by qt3to4
224CONFIG += uic3
225
diff --git a/korganizer/korganizerE.pro b/korganizer/korganizerE.pro
index 553c265..2c1cd42 100644
--- a/korganizer/korganizerE.pro
+++ b/korganizer/korganizerE.pro
@@ -2,27 +2,27 @@ TEMPLATE = app
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3 TARGET = kopi 3 TARGET = kopi
4OBJECTS_DIR = obj/$(PLATFORM) 4OBJECTS_DIR = obj/$(PLATFORM)
5MOC_DIR = moc/$(PLATFORM) 5MOC_DIR = moc/$(PLATFORM)
6DESTDIR=$(QPEDIR)/bin 6DESTDIR=$(QPEDIR)/bin
7 7
8INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kdeui $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/libkdepim interfaces $(KDEPIMDIR)/kabc $(QPEDIR)/include 8INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kdeui $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/libkdepim interfaces $(KDEPIMDIR)/kabc $(QPEDIR)/include
9 9
10DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL 10DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL
11DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER 11DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER
12DEFINES += KORG_NOLVALTERNATION 12DEFINES += KORG_NOLVALTERNATION
13#KORG_NOKABC 13#KORG_NOKABC
14LIBS += -lmicrokdepim 14LIBS += -lxmicrokdepim
15LIBS += -lmicrokcal 15LIBS += -lxmicrokcal
16LIBS += -lmicrokde 16LIBS += -lxmicrokde
17LIBS += -lmicroqtcompat 17LIBS += -lmicroqtcompat
18 18
19LIBS += $(GCC3EXTRALIB1) 19LIBS += $(GCC3EXTRALIB1)
20LIBS += $(GCC3EXTRALIB2) 20LIBS += $(GCC3EXTRALIB2)
21 21
22 22
23LIBS += -lqpe 23LIBS += -lqpe
24LIBS += -ljpeg 24LIBS += -ljpeg
25LIBS += $(QTOPIALIB) 25LIBS += $(QTOPIALIB)
26LIBS += -L$(QPEDIR)/lib 26LIBS += -L$(QPEDIR)/lib
27 27
28INTERFACES = kofilterview_base.ui 28INTERFACES = kofilterview_base.ui
diff --git a/korganizer/kotimespanview.cpp b/korganizer/kotimespanview.cpp
index 3265a3a..a214720 100644
--- a/korganizer/kotimespanview.cpp
+++ b/korganizer/kotimespanview.cpp
@@ -1,109 +1,113 @@
1#include <qlayout.h> 1#include <qlayout.h>
2//Added by qt3to4:
3#include <Q3VBoxLayout>
4#include <Q3ValueList>
5#include <Q3PtrList>
2 6
3#include <kconfig.h> 7#include <kconfig.h>
4 8
5#include "timespanview.h" 9#include "timespanview.h"
6#include "koglobals.h" 10#include "koglobals.h"
7 11
8#include "kotimespanview.h" 12#include "kotimespanview.h"
9 13
10KOTimeSpanView::KOTimeSpanView(Calendar *calendar, QWidget *parent, 14KOTimeSpanView::KOTimeSpanView(Calendar *calendar, QWidget *parent,
11 const char *name) : 15 const char *name) :
12 KOEventView( calendar, parent, name ) 16 KOEventView( calendar, parent, name )
13{ 17{
14 QBoxLayout *topLayout = new QVBoxLayout( this ); 18 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
15 19
16 mTimeSpanView = new TimeSpanView( this ); 20 mTimeSpanView = new TimeSpanView( this );
17 topLayout->addWidget( mTimeSpanView ); 21 topLayout->addWidget( mTimeSpanView );
18 22
19 connect( mTimeSpanView, SIGNAL( dateRangeChanged() ), SLOT( updateView() ) ); 23 connect( mTimeSpanView, SIGNAL( dateRangeChanged() ), SLOT( updateView() ) );
20} 24}
21 25
22KOTimeSpanView::~KOTimeSpanView() 26KOTimeSpanView::~KOTimeSpanView()
23{ 27{
24} 28}
25 29
26void KOTimeSpanView::readSettings() 30void KOTimeSpanView::readSettings()
27{ 31{
28 readSettings(KOGlobals::config()); 32 readSettings(KOGlobals::config());
29} 33}
30 34
31void KOTimeSpanView::readSettings(KConfig *config) 35void KOTimeSpanView::readSettings(KConfig *config)
32{ 36{
33// kdDebug() << "KOTimeSpanView::readSettings()" << endl; 37// kdDebug() << "KOTimeSpanView::readSettings()" << endl;
34 38
35 config->setGroup("Views"); 39 config->setGroup("Views");
36 40
37 QValueList<int> sizes = config->readIntListEntry("Separator TimeSpanView"); 41 Q3ValueList<int> sizes = config->readIntListEntry("Separator TimeSpanView");
38 if (sizes.count() == 2) { 42 if (sizes.count() == 2) {
39 mTimeSpanView->setSplitterSizes(sizes); 43 mTimeSpanView->setSplitterSizes(sizes);
40 } 44 }
41} 45}
42 46
43void KOTimeSpanView::writeSettings(KConfig *config) 47void KOTimeSpanView::writeSettings(KConfig *config)
44{ 48{
45// kdDebug() << "KOTimeSpanView::writeSettings()" << endl; 49// kdDebug() << "KOTimeSpanView::writeSettings()" << endl;
46 50
47 config->setGroup("Views"); 51 config->setGroup("Views");
48 52
49 QValueList<int> list = mTimeSpanView->splitterSizes(); 53 Q3ValueList<int> list = mTimeSpanView->splitterSizes();
50 config->writeEntry("Separator TimeSpanView",list); 54 config->writeEntry("Separator TimeSpanView",list);
51} 55}
52 56
53int KOTimeSpanView::maxDatesHint() 57int KOTimeSpanView::maxDatesHint()
54{ 58{
55 return 0; 59 return 0;
56} 60}
57 61
58int KOTimeSpanView::currentDateCount() 62int KOTimeSpanView::currentDateCount()
59{ 63{
60 return 0; 64 return 0;
61} 65}
62 66
63QPtrList<Incidence> KOTimeSpanView::selectedIncidences() 67Q3PtrList<Incidence> KOTimeSpanView::selectedIncidences()
64{ 68{
65 QPtrList<Incidence> selected; 69 Q3PtrList<Incidence> selected;
66 70
67 return selected; 71 return selected;
68} 72}
69 73
70void KOTimeSpanView::updateView() 74void KOTimeSpanView::updateView()
71{ 75{
72 insertItems( mTimeSpanView->startDateTime().date(), 76 insertItems( mTimeSpanView->startDateTime().date(),
73 mTimeSpanView->endDateTime().date() ); 77 mTimeSpanView->endDateTime().date() );
74} 78}
75 79
76void KOTimeSpanView::showDates(const QDate &start, const QDate &end) 80void KOTimeSpanView::showDates(const QDate &start, const QDate &end)
77{ 81{
78 QDate s = start.addDays( -2 ); 82 QDate s = start.addDays( -2 );
79 QDate e = end.addDays( 2 ); 83 QDate e = end.addDays( 2 );
80 84
81 insertItems( s, e ); 85 insertItems( s, e );
82} 86}
83 87
84void KOTimeSpanView::insertItems(const QDate &start, const QDate &end) 88void KOTimeSpanView::insertItems(const QDate &start, const QDate &end)
85{ 89{
86 mTimeSpanView->clear(); 90 mTimeSpanView->clear();
87 mTimeSpanView->setDateRange( start, end ); 91 mTimeSpanView->setDateRange( (QDateTime)start, (QDateTime)end );
88 92
89 QPtrList<Event> events = calendar()->events( start, end ); 93 Q3PtrList<Event> events = calendar()->events( start, end );
90 Event *event = events.first(); 94 Event *event = events.first();
91 while( event ) { 95 while( event ) {
92// kdDebug() << "KOTimeSpanView::showDates() add event: " << event->summary() 96// kdDebug() << "KOTimeSpanView::showDates() add event: " << event->summary()
93// << endl; 97// << endl;
94 98
95 mTimeSpanView->addItem( event ); 99 mTimeSpanView->addItem( event );
96 100
97 event = events.next(); 101 event = events.next();
98 } 102 }
99 103
100 mTimeSpanView->updateView(); 104 mTimeSpanView->updateView();
101} 105}
102 106
103void KOTimeSpanView::showEvents(QPtrList<Event> eventList) 107void KOTimeSpanView::showEvents(Q3PtrList<Event> eventList)
104{ 108{
105} 109}
106 110
107void KOTimeSpanView::changeEventDisplay(Event *, int) 111void KOTimeSpanView::changeEventDisplay(Event *, int)
108{ 112{
109} 113}
diff --git a/korganizer/kotimespanview.h b/korganizer/kotimespanview.h
index c682ed8..c3e4b41 100644
--- a/korganizer/kotimespanview.h
+++ b/korganizer/kotimespanview.h
@@ -1,41 +1,43 @@
1#ifndef KOTIMESPANVIEW_H 1#ifndef KOTIMESPANVIEW_H
2#define KOTIMESPANVIEW_H 2#define KOTIMESPANVIEW_H
3 3
4#include "koeventview.h" 4#include "koeventview.h"
5//Added by qt3to4:
6#include <Q3PtrList>
5 7
6class KConfig; 8class KConfig;
7class TimeSpanView; 9class TimeSpanView;
8 10
9class KOTimeSpanView : public KOEventView 11class KOTimeSpanView : public KOEventView
10{ 12{
11 Q_OBJECT 13 Q_OBJECT
12 public: 14 public:
13 KOTimeSpanView(Calendar *calendar, QWidget *parent = 0, 15 KOTimeSpanView(Calendar *calendar, QWidget *parent = 0,
14 const char *name = 0); 16 const char *name = 0);
15 ~KOTimeSpanView(); 17 ~KOTimeSpanView();
16 18
17 virtual int maxDatesHint(); 19 virtual int maxDatesHint();
18 virtual int currentDateCount(); 20 virtual int currentDateCount();
19 virtual QPtrList<Incidence> selectedIncidences(); 21 virtual Q3PtrList<Incidence> selectedIncidences();
20 DateList selectedDates() 22 DateList selectedDates()
21 {DateList q; 23 {DateList q;
22 return q;} 24 return q;}
23 25
24 void readSettings(); 26 void readSettings();
25 void readSettings( KConfig * ); 27 void readSettings( KConfig * );
26 void writeSettings( KConfig * ); 28 void writeSettings( KConfig * );
27 29
28 public slots: 30 public slots:
29 virtual void updateView(); 31 virtual void updateView();
30 virtual void showDates(const QDate &start, const QDate &end); 32 virtual void showDates(const QDate &start, const QDate &end);
31 virtual void showEvents(QPtrList<Event> eventList); 33 virtual void showEvents(Q3PtrList<Event> eventList);
32 34
33 void changeEventDisplay(Event *, int); 35 void changeEventDisplay(Event *, int);
34 36
35 private: 37 private:
36 void insertItems( const QDate &start, const QDate & end ); 38 void insertItems( const QDate &start, const QDate & end );
37 39
38 TimeSpanView *mTimeSpanView; 40 TimeSpanView *mTimeSpanView;
39}; 41};
40 42
41#endif 43#endif
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index 20a35d2..aeab92a 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -14,33 +14,38 @@
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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 <qtooltip.h> 25#include <qtooltip.h>
26#include <qframe.h> 26#include <q3frame.h>
27#include <qpixmap.h> 27#include <qpixmap.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qhbox.h> 29#include <q3hbox.h>
30#include <qtimer.h> 30#include <qtimer.h>
31#include <qdir.h> 31#include <qdir.h>
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <qapplication.h> 33#include <qapplication.h>
34#include <QDesktopWidget>
34#include <qtabwidget.h> 35#include <qtabwidget.h>
36//Added by qt3to4:
37#include <Q3HBoxLayout>
38#include <Q3PtrList>
39#include <Q3VBoxLayout>
35 40
36#include <kiconloader.h> 41#include <kiconloader.h>
37#include <klocale.h> 42#include <klocale.h>
38#include <kfiledialog.h> 43#include <kfiledialog.h>
39#include <kstandarddirs.h> 44#include <kstandarddirs.h>
40#include <kmessagebox.h> 45#include <kmessagebox.h>
41 46
42#include <libkdepim/categoryselectdialog.h> 47#include <libkdepim/categoryselectdialog.h>
43#include <libkcal/calendarlocal.h> 48#include <libkcal/calendarlocal.h>
44#include <libkcal/calendarresources.h> 49#include <libkcal/calendarresources.h>
45#include <libkcal/resourcecalendar.h> 50#include <libkcal/resourcecalendar.h>
46#include <libkcal/icalformat.h> 51#include <libkcal/icalformat.h>
@@ -72,26 +77,26 @@ KOTodoEditor::~KOTodoEditor()
72void KOTodoEditor::init() 77void KOTodoEditor::init()
73{ 78{
74 setupGeneral(); 79 setupGeneral();
75 setupAttendeesTab(); 80 setupAttendeesTab();
76 setupRecurrence(); 81 setupRecurrence();
77 connect(mGeneral,SIGNAL(datesChecked()),this ,SLOT(checkRecurrence())); 82 connect(mGeneral,SIGNAL(datesChecked()),this ,SLOT(checkRecurrence()));
78 mRecurrence->setDateTimeStr( i18n("<i>The recurrence is computed from the start datetime!</i>") ); 83 mRecurrence->setDateTimeStr( i18n("<i>The recurrence is computed from the start datetime!</i>") );
79 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), 84 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)),
80 mRecurrence,SLOT(setDefaultsDates(QDateTime,QDateTime))); 85 mRecurrence,SLOT(setDefaultsDates(QDateTime,QDateTime)));
81} 86}
82void KOTodoEditor::setupRecurrence() 87void KOTodoEditor::setupRecurrence()
83{ 88{
84 QFrame *topFrame = addPage( i18n("Recurrence") ); 89 Q3Frame *topFrame = addPage( i18n("Recurrence") );
85 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 90 Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame );
86 91
87 mRecurrence = new KOEditorRecurrence( topFrame ); 92 mRecurrence = new KOEditorRecurrence( topFrame );
88 topLayout->addWidget( mRecurrence ); 93 topLayout->addWidget( mRecurrence );
89} 94}
90 95
91void KOTodoEditor::setCategories( QString s ) 96void KOTodoEditor::setCategories( QString s )
92{ 97{
93 mGeneral->setCategories(s); 98 mGeneral->setCategories(s);
94} 99}
95void KOTodoEditor::setSecrecy( int sec ) 100void KOTodoEditor::setSecrecy( int sec )
96{ 101{
97 mGeneral->setSecrecy( sec ); 102 mGeneral->setSecrecy( sec );
@@ -102,110 +107,110 @@ void KOTodoEditor::reload()
102} 107}
103 108
104void KOTodoEditor::setupGeneral() 109void KOTodoEditor::setupGeneral()
105{ 110{
106 mGeneral = new KOEditorGeneralTodo(this); 111 mGeneral = new KOEditorGeneralTodo(this);
107 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); 112 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
108 113
109 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); 114 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show()));
110 //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)), 115 //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)),
111 // mGeneral,SLOT(setCategories(const QString &))); 116 // mGeneral,SLOT(setCategories(const QString &)));
112 117
113 if (KOPrefs::instance()->mCompactDialogs) { 118 if (KOPrefs::instance()->mCompactDialogs) {
114 QFrame *topFrame = addPage(i18n("General")); 119 Q3Frame *topFrame = addPage(i18n("General"));
115 120
116 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 121 Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
117 if ( QApplication::desktop()->width() < 480 ) { 122 if ( QApplication::desktop()->width() < 480 ) {
118 topLayout->setMargin(marginHintSmall()); 123 topLayout->setMargin(marginHintSmall());
119 topLayout->setSpacing(spacingHintSmall()); 124 topLayout->setSpacing(spacingHintSmall());
120 } else { 125 } else {
121 topLayout->setMargin(marginHint()); 126 topLayout->setMargin(marginHint());
122 topLayout->setSpacing(spacingHint()); 127 topLayout->setSpacing(spacingHint());
123 } 128 }
124 topLayout->addStretch( 1 ); 129 topLayout->addStretch( 1 );
125 mGeneral->initHeader(topFrame,topLayout); 130 mGeneral->initHeader(topFrame,topLayout);
126 topLayout->addStretch( 1 ); 131 topLayout->addStretch( 1 );
127 mGeneral->initTime(topFrame,topLayout); 132 mGeneral->initTime(topFrame,topLayout);
128 topLayout->addStretch( 1 ); 133 topLayout->addStretch( 1 );
129 mGeneral->initAlarm(topFrame,topLayout); 134 mGeneral->initAlarm(topFrame,topLayout);
130 topLayout->addStretch( 1 ); 135 topLayout->addStretch( 1 );
131 mGeneral->enableAlarm( false ); 136 mGeneral->enableAlarm( false );
132 137
133 138
134 QBoxLayout *priorityLayout; 139 Q3BoxLayout *priorityLayout;
135 if ( QApplication::desktop()->width() < 500 ) 140 if ( QApplication::desktop()->width() < 500 )
136 priorityLayout = new QVBoxLayout( topLayout ); 141 priorityLayout = new Q3VBoxLayout( topLayout );
137 else 142 else
138 priorityLayout = new QHBoxLayout( topLayout ); 143 priorityLayout = new Q3HBoxLayout( topLayout );
139 QWidget* prioWidget = new QWidget (topFrame); 144 QWidget* prioWidget = new QWidget (topFrame);
140 priorityLayout->addWidget( prioWidget ); 145 priorityLayout->addWidget( prioWidget );
141 QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget); 146 Q3HBoxLayout* priorityLayout2 = new Q3HBoxLayout( prioWidget);
142 147
143 148
144 QIconSet icon; 149 QIcon icon;
145 if ( QApplication::desktop()->width() < 321 ) 150 if ( QApplication::desktop()->width() < 321 )
146 icon = SmallIcon("fileimport16"); 151 icon = SmallIcon("fileimport16");
147 else 152 else
148 icon = SmallIcon("fileimport"); 153 icon = SmallIcon("fileimport");
149 QPushButton * loadTemplate = new QPushButton( prioWidget); 154 QPushButton * loadTemplate = new QPushButton( prioWidget);
150 loadTemplate->setIconSet (icon ) ; 155 loadTemplate->setIconSet (icon ) ;
151 int size = loadTemplate->sizeHint().height(); 156 int size = loadTemplate->sizeHint().height();
152 loadTemplate->setFixedSize( size, size ); 157 loadTemplate->setFixedSize( size, size );
153 if ( QApplication::desktop()->width() < 321 ) 158 if ( QApplication::desktop()->width() < 321 )
154 icon = SmallIcon("fileexport16"); 159 icon = SmallIcon("fileexport16");
155 else 160 else
156 icon = SmallIcon("fileexport"); 161 icon = SmallIcon("fileexport");
157 QPushButton * saveTemplate = new QPushButton( prioWidget); 162 QPushButton * saveTemplate = new QPushButton( prioWidget);
158 saveTemplate->setIconSet (icon ) ; 163 saveTemplate->setIconSet (icon ) ;
159 saveTemplate->setFixedSize( size, size ); 164 saveTemplate->setFixedSize( size, size );
160 165
161 priorityLayout2->addWidget(loadTemplate); 166 priorityLayout2->addWidget(loadTemplate);
162 priorityLayout2->addWidget(saveTemplate); 167 priorityLayout2->addWidget(saveTemplate);
163 mGeneral->initPriority(prioWidget,priorityLayout2); 168 mGeneral->initPriority(prioWidget,priorityLayout2);
164 mGeneral->initCategories( topFrame, priorityLayout ); 169 mGeneral->initCategories( topFrame, priorityLayout );
165 topLayout->addStretch(1); 170 topLayout->addStretch(1);
166 171
167 QFrame *topFrame2 = addPage(i18n("Details")); 172 Q3Frame *topFrame2 = addPage(i18n("Details"));
168 173
169 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); 174 Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2);
170 topLayout2->setMargin(marginHint()); 175 topLayout2->setMargin(marginHint());
171 topLayout2->setSpacing(spacingHint()); 176 topLayout2->setSpacing(spacingHint());
172 177
173 QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 ); 178 Q3HBoxLayout *completionLayout = new Q3HBoxLayout( topLayout2 );
174 mGeneral->initCompletion(topFrame2,completionLayout); 179 mGeneral->initCompletion(topFrame2,completionLayout);
175 180
176 181
177 mGeneral->initSecrecy( topFrame2, topLayout2 ); 182 mGeneral->initSecrecy( topFrame2, topLayout2 );
178 mGeneral->initDescription(topFrame2,topLayout2); 183 mGeneral->initDescription(topFrame2,topLayout2);
179 184
180 // QHBox * hb = new QHBox ( topFrame2 ); 185 // QHBox * hb = new QHBox ( topFrame2 );
181 // topLayout2->addWidget(hb); 186 // topLayout2->addWidget(hb);
182 // hb->setSpacing( 3 ); 187 // hb->setSpacing( 3 );
183 188
184 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 189 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
185 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); 190 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
186 191
187 } else { 192 } else {
188 QFrame *topFrame = addPage(i18n("General")); 193 Q3Frame *topFrame = addPage(i18n("General"));
189 194
190 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 195 Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
191 topLayout->setSpacing(spacingHint()); 196 topLayout->setSpacing(spacingHint());
192 197
193 mGeneral->initHeader(topFrame,topLayout); 198 mGeneral->initHeader(topFrame,topLayout);
194 mGeneral->initTime(topFrame,topLayout); 199 mGeneral->initTime(topFrame,topLayout);
195 mGeneral->initStatus(topFrame,topLayout); 200 mGeneral->initStatus(topFrame,topLayout);
196 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 201 Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout);
197 mGeneral->initAlarm(topFrame,alarmLineLayout); 202 mGeneral->initAlarm(topFrame,alarmLineLayout);
198 mGeneral->initDescription(topFrame,topLayout); 203 mGeneral->initDescription(topFrame,topLayout);
199 QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); 204 Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout);
200 mGeneral->initCategories( topFrame, detailsLayout ); 205 mGeneral->initCategories( topFrame, detailsLayout );
201 mGeneral->initSecrecy( topFrame, detailsLayout ); 206 mGeneral->initSecrecy( topFrame, detailsLayout );
202 } 207 }
203 mGeneral->finishSetup(); 208 mGeneral->finishSetup();
204 209
205} 210}
206 211
207void KOTodoEditor::editTodo(Todo *todo, bool editDescription) 212void KOTodoEditor::editTodo(Todo *todo, bool editDescription)
208{ 213{
209 //init(); 214 //init();
210 215
211 mTodo = todo; 216 mTodo = todo;
@@ -418,25 +423,25 @@ void KOTodoEditor::slotLoadTemplate()
418 t_dir.mkdir ( fileName ); 423 t_dir.mkdir ( fileName );
419 fileName += "/todo"; 424 fileName += "/todo";
420 fileName = KFileDialog::getSaveFileName( fileName , "Load Todo template", this ); 425 fileName = KFileDialog::getSaveFileName( fileName , "Load Todo template", this );
421 if ( fileName.length() == 0 ) 426 if ( fileName.length() == 0 )
422 return; 427 return;
423 CalendarLocal cal; 428 CalendarLocal cal;
424 ICalFormat format; 429 ICalFormat format;
425 if ( !format.load( &cal, fileName ) ) { 430 if ( !format.load( &cal, fileName ) ) {
426 KMessageBox::error( this, i18n("Error loading template file\n '%1'.") 431 KMessageBox::error( this, i18n("Error loading template file\n '%1'.")
427 .arg( fileName ) ); 432 .arg( fileName ) );
428 return ; 433 return ;
429 } 434 }
430 QPtrList<Todo> todos = cal.todos(); 435 Q3PtrList<Todo> todos = cal.todos();
431 Todo * todo = todos.first(); 436 Todo * todo = todos.first();
432 if ( !todo ) { 437 if ( !todo ) {
433 KMessageBox::error( this, 438 KMessageBox::error( this,
434 i18n("Template does not\ncontain a valid Todo.")); 439 i18n("Template does not\ncontain a valid Todo."));
435 } else { 440 } else {
436 readTodo( todo ); 441 readTodo( todo );
437 } 442 }
438 443
439} 444}
440 445
441void KOTodoEditor::slotSaveTemplate() 446void KOTodoEditor::slotSaveTemplate()
442{ 447{
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index ba94057..2b8fbd3 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -12,35 +12,51 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <QDesktopWidget>
25
24#include <qlayout.h> 26#include <qlayout.h>
25#include <qheader.h> 27#include <q3header.h>
26#include <qcursor.h> 28#include <qcursor.h>
27#include <qwhatsthis.h> 29#include <q3whatsthis.h>
28#include <qdialog.h> 30#include <qdialog.h>
29#include <qlabel.h> 31#include <qlabel.h>
30#include <qpushbutton.h> 32#include <qpushbutton.h>
31 33
32#include <qinputdialog.h> 34#include <qinputdialog.h>
33 35
34#include <qvbox.h> 36#include <q3vbox.h>
37//Added by qt3to4:
38#include <QWheelEvent>
39#include <QFocusEvent>
40#include <QDragLeaveEvent>
41#include <QMouseEvent>
42#include <QDragEnterEvent>
43#include <QKeyEvent>
44#include <Q3HBoxLayout>
45#include <Q3VBoxLayout>
46#include <QDropEvent>
47#include <QDragMoveEvent>
48#include <QPaintEvent>
49#include <Q3PopupMenu>
50#include <Q3PtrList>
35#include <kdebug.h> 51#include <kdebug.h>
36#include "koprefs.h" 52#include "koprefs.h"
37#include <klocale.h> 53#include <klocale.h>
38#include <kglobal.h> 54#include <kglobal.h>
39#include <kdateedit.h> 55#include <kdateedit.h>
40#include "ktimeedit.h" 56#include "ktimeedit.h"
41#include <kiconloader.h> 57#include <kiconloader.h>
42#include <kmessagebox.h> 58#include <kmessagebox.h>
43 59
44#include <libkcal/icaldrag.h> 60#include <libkcal/icaldrag.h>
45#include <libkcal/vcaldrag.h> 61#include <libkcal/vcaldrag.h>
46#include <libkcal/calfilter.h> 62#include <libkcal/calfilter.h>
@@ -59,68 +75,68 @@
59#endif 75#endif
60#include "docprefs.h" 76#include "docprefs.h"
61 77
62#include "kotodoview.h" 78#include "kotodoview.h"
63using namespace KOrg; 79using namespace KOrg;
64 80
65 81
66KOStartTodoPrefs::KOStartTodoPrefs( QString sum, QWidget *parent, const char *name ) : 82KOStartTodoPrefs::KOStartTodoPrefs( QString sum, QWidget *parent, const char *name ) :
67 QDialog( parent, name, true ) 83 QDialog( parent, name, true )
68{ 84{
69 mStopAll = true; 85 mStopAll = true;
70 setCaption( i18n("Start todo") ); 86 setCaption( i18n("Start todo") );
71 QVBoxLayout* lay = new QVBoxLayout( this ); 87 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
72 lay->setSpacing( 3 ); 88 lay->setSpacing( 3 );
73 lay->setMargin( 3 ); 89 lay->setMargin( 3 );
74 QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( sum ), this ); 90 QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( sum ), this );
75 lay->addWidget( lab ); 91 lay->addWidget( lab );
76 lab->setAlignment( AlignCenter ); 92 lab->setAlignment( Qt::AlignCenter );
77 93
78 QPushButton * ok = new QPushButton( i18n("Start this todo\nand stop all running"), this ); 94 QPushButton * ok = new QPushButton( i18n("Start this todo\nand stop all running"), this );
79 lay->addWidget( ok ); 95 lay->addWidget( ok );
80 ok->setDefault( true ); 96 ok->setDefault( true );
81 QPushButton * start = new QPushButton( i18n("Start todo"), this ); 97 QPushButton * start = new QPushButton( i18n("Start todo"), this );
82 lay->addWidget( start ); 98 lay->addWidget( start );
83 QPushButton * cancel = new QPushButton( i18n("Cancel - do not start"), this ); 99 QPushButton * cancel = new QPushButton( i18n("Cancel - do not start"), this );
84 lay->addWidget( cancel ); 100 lay->addWidget( cancel );
85 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 101 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
86 connect ( start,SIGNAL(clicked() ),this , SLOT ( doStop() ) ); 102 connect ( start,SIGNAL(clicked() ),this , SLOT ( doStop() ) );
87 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 103 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
88 resize( sizeHint() ); 104 resize( sizeHint() );
89 105
90} 106}
91void KOStartTodoPrefs::doStop() 107void KOStartTodoPrefs::doStop()
92{ 108{
93 mStopAll = false; 109 mStopAll = false;
94 accept(); 110 accept();
95} 111}
96KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name ) : 112KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name ) :
97 QDialog( parent, name, true ) 113 QDialog( parent, name, true )
98{ 114{
99 mTodo = todo; 115 mTodo = todo;
100 setCaption( i18n("Stop todo") ); 116 setCaption( i18n("Stop todo") );
101 QVBoxLayout* lay = new QVBoxLayout( this ); 117 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
102 lay->setSpacing( 3 ); 118 lay->setSpacing( 3 );
103 lay->setMargin( 3 ); 119 lay->setMargin( 3 );
104 QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( todo->summary() ), this ); 120 QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( todo->summary() ), this );
105 lay->addWidget( lab ); 121 lay->addWidget( lab );
106 lab->setAlignment( AlignHCenter ); 122 lab->setAlignment( Qt::AlignHCenter );
107 lab = new QLabel( i18n("Additional Comment:"), this ); 123 lab = new QLabel( i18n("Additional Comment:"), this );
108 lay->addWidget( lab ); 124 lay->addWidget( lab );
109 mComment = new QLineEdit( this ); 125 mComment = new QLineEdit( this );
110 lay->addWidget( mComment ); 126 lay->addWidget( mComment );
111 QHBox * start = new QHBox ( this ); 127 Q3HBox * start = new Q3HBox ( this );
112 lay->addWidget( start ); 128 lay->addWidget( start );
113 lab = new QLabel( i18n("Start:"), start ); 129 lab = new QLabel( i18n("Start:"), start );
114 QHBox * end = new QHBox ( this ); 130 Q3HBox * end = new Q3HBox ( this );
115 lay->addWidget( end ); 131 lay->addWidget( end );
116 lab = new QLabel( i18n("End:"), end ); 132 lab = new QLabel( i18n("End:"), end );
117 sde = new KDateEdit( start ); 133 sde = new KDateEdit( start );
118 ste = new KOTimeEdit( start ); 134 ste = new KOTimeEdit( start );
119 connect ( sde,SIGNAL(setTimeTo( QTime ) ),ste , SLOT ( setTime(QTime ) ) ); 135 connect ( sde,SIGNAL(setTimeTo( QTime ) ),ste , SLOT ( setTime(QTime ) ) );
120 ede = new KDateEdit( end ); 136 ede = new KDateEdit( end );
121 ete = new KOTimeEdit(end ); 137 ete = new KOTimeEdit(end );
122 connect ( ede,SIGNAL(setTimeTo( QTime ) ),ete , SLOT ( setTime(QTime ) ) ); 138 connect ( ede,SIGNAL(setTimeTo( QTime ) ),ete , SLOT ( setTime(QTime ) ) );
123 sde->setDate( mTodo->runStart().date() ); 139 sde->setDate( mTodo->runStart().date() );
124 ste->setTime( mTodo->runStart().time() ); 140 ste->setTime( mTodo->runStart().time() );
125 mStop = QDateTime::currentDateTime(); 141 mStop = QDateTime::currentDateTime();
126 ede->setDate( mStop.date()); 142 ede->setDate( mStop.date());
@@ -164,28 +180,28 @@ void KOStopTodoPrefs::accept()
164 QDialog::accept(); 180 QDialog::accept();
165} 181}
166void KOStopTodoPrefs::doNotSave() 182void KOStopTodoPrefs::doNotSave()
167{ 183{
168 int result = KMessageBox::warningContinueCancel(this, 184 int result = KMessageBox::warningContinueCancel(this,
169 i18n("Do you really want to set\nthe state to stopped\nwithout saving the data?"),mTodo->summary(),i18n("Yes, stop todo") ); 185 i18n("Do you really want to set\nthe state to stopped\nwithout saving the data?"),mTodo->summary(),i18n("Yes, stop todo") );
170 if (result != KMessageBox::Continue) return; 186 if (result != KMessageBox::Continue) return;
171 mTodo->stopRunning(); 187 mTodo->stopRunning();
172 QDialog::accept(); 188 QDialog::accept();
173} 189}
174 190
175 191
176class KOTodoViewWhatsThis :public QWhatsThis 192class KOTodoViewWhatsThis :public Q3WhatsThis
177{ 193{
178public: 194public:
179 KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; 195 KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : Q3WhatsThis( wid ), _wid(wid),_view (view) { };
180 196
181protected: 197protected:
182 virtual QString text( const QPoint& p) 198 virtual QString text( const QPoint& p)
183 { 199 {
184 return _view->getWhatsThisText(p) ; 200 return _view->getWhatsThisText(p) ;
185 } 201 }
186private: 202private:
187 QWidget* _wid; 203 QWidget* _wid;
188 KOTodoView * _view; 204 KOTodoView * _view;
189}; 205};
190 206
191KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, 207KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent,
@@ -205,66 +221,66 @@ KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent,
205 int size = 16; 221 int size = 16;
206 if (qApp->desktop()->width() < 300 ) 222 if (qApp->desktop()->width() < 300 )
207 size = 12; 223 size = 12;
208 setTreeStepSize( size + 6 ); 224 setTreeStepSize( size + 6 );
209 225
210} 226}
211 227
212void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) 228void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e)
213{ 229{
214#ifndef KORG_NODND 230#ifndef KORG_NODND
215// kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; 231// kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl;
216 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 232 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
217 !QTextDrag::canDecode( e ) ) { 233 !Q3TextDrag::canDecode( e ) ) {
218 e->ignore(); 234 e->ignore();
219 return; 235 return;
220 } 236 }
221 237
222 mOldCurrent = currentItem(); 238 mOldCurrent = currentItem();
223#endif 239#endif
224} 240}
225 241
226 242
227void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) 243void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e)
228{ 244{
229#ifndef KORG_NODND 245#ifndef KORG_NODND
230// kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; 246// kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl;
231 247
232 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 248 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
233 !QTextDrag::canDecode( e ) ) { 249 !Q3TextDrag::canDecode( e ) ) {
234 e->ignore(); 250 e->ignore();
235 return; 251 return;
236 } 252 }
237 253
238 e->accept(); 254 e->accept();
239#endif 255#endif
240} 256}
241 257
242void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *) 258void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *)
243{ 259{
244#ifndef KORG_NODND 260#ifndef KORG_NODND
245// kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl; 261// kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl;
246 262
247 setCurrentItem(mOldCurrent); 263 setCurrentItem(mOldCurrent);
248 setSelected(mOldCurrent,true); 264 setSelected(mOldCurrent,true);
249#endif 265#endif
250} 266}
251 267
252void KOTodoListView::contentsDropEvent(QDropEvent *e) 268void KOTodoListView::contentsDropEvent(QDropEvent *e)
253{ 269{
254#ifndef KORG_NODND 270#ifndef KORG_NODND
255// kdDebug() << "KOTodoListView::contentsDropEvent" << endl; 271// kdDebug() << "KOTodoListView::contentsDropEvent" << endl;
256 272
257 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 273 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
258 !QTextDrag::canDecode( e ) ) { 274 !Q3TextDrag::canDecode( e ) ) {
259 e->ignore(); 275 e->ignore();
260 return; 276 return;
261 } 277 }
262 278
263 DndFactory factory( mCalendar ); 279 DndFactory factory( mCalendar );
264 Todo *todo = factory.createDropTodo(e); 280 Todo *todo = factory.createDropTodo(e);
265 281
266 if (todo) { 282 if (todo) {
267 e->acceptAction(); 283 e->acceptAction();
268 284
269 KOTodoViewItem *destination = 285 KOTodoViewItem *destination =
270 (KOTodoViewItem *)itemAt(contentsToViewport(e->pos())); 286 (KOTodoViewItem *)itemAt(contentsToViewport(e->pos()));
@@ -291,101 +307,101 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e)
291 else 307 else
292 unparentTodoSignal(existingTodo); 308 unparentTodoSignal(existingTodo);
293 delete todo; 309 delete todo;
294 } else { 310 } else {
295 mCalendar->addTodo(todo); 311 mCalendar->addTodo(todo);
296 emit todoDropped(todo, KOGlobals::EVENTADDED); 312 emit todoDropped(todo, KOGlobals::EVENTADDED);
297 if ( destinationEvent ) 313 if ( destinationEvent )
298 reparentTodoSignal( destinationEvent, todo ); 314 reparentTodoSignal( destinationEvent, todo );
299 } 315 }
300 } 316 }
301 else { 317 else {
302 QString text; 318 QString text;
303 if (QTextDrag::decode(e,text)) { 319 if (Q3TextDrag::decode(e,text)) {
304 //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); 320 //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) );
305 KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) )); 321 KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) ));
306 qDebug("Dropped : " + text); 322 qDebug("Dropped : " + text);
307 QStringList emails = QStringList::split(",",text); 323 QStringList emails = QStringList::split(",",text);
308 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { 324 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) {
309 int pos = (*it).find("<"); 325 int pos = (*it).find("<");
310 QString name = (*it).left(pos); 326 QString name = (*it).left(pos);
311 QString email = (*it).mid(pos); 327 QString email = (*it).mid(pos);
312 if (!email.isEmpty() && todoi) { 328 if (!email.isEmpty() && todoi) {
313 todoi->todo()->addAttendee(new Attendee(name,email)); 329 todoi->todo()->addAttendee(new Attendee(name,email));
314 } 330 }
315 } 331 }
316 } 332 }
317 else { 333 else {
318 qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable "); 334 qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable ");
319 e->ignore(); 335 e->ignore();
320 } 336 }
321 } 337 }
322#endif 338#endif
323} 339}
324void KOTodoListView::wheelEvent (QWheelEvent *e) 340void KOTodoListView::wheelEvent (QWheelEvent *e)
325{ 341{
326 QListView::wheelEvent (e); 342 Q3ListView::wheelEvent (e);
327} 343}
328 344
329void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) 345void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
330{ 346{
331 347
332 QPoint p(contentsToViewport(e->pos())); 348 QPoint p(contentsToViewport(e->pos()));
333 QListViewItem *i = itemAt(p); 349 Q3ListViewItem *i = itemAt(p);
334 bool rootClicked = true; 350 bool rootClicked = true;
335 if (i) { 351 if (i) {
336 // if the user clicked into the root decoration of the item, don't 352 // if the user clicked into the root decoration of the item, don't
337 // try to start a drag! 353 // try to start a drag!
338 int X = p.x(); 354 int X = p.x();
339 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); 355 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() );
340 if (X > header()->sectionPos(0) + 356 if (X > header()->sectionPos(0) +
341 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + 357 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) +
342 itemMargin() +i->height()|| 358 itemMargin() +i->height()||
343 X < header()->sectionPos(0)) { 359 X < header()->sectionPos(0)) {
344 rootClicked = false; 360 rootClicked = false;
345 } 361 }
346 } else { 362 } else {
347 rootClicked = false; 363 rootClicked = false;
348 } 364 }
349#ifndef KORG_NODND 365#ifndef KORG_NODND
350 mMousePressed = false; 366 mMousePressed = false;
351 if (! rootClicked && !( e->button() == RightButton) ) { 367 if (! rootClicked && !( e->button() == Qt::RightButton) ) {
352 mPressPos = e->pos(); 368 mPressPos = e->pos();
353 mMousePressed = true; 369 mMousePressed = true;
354 } else { 370 } else {
355 mMousePressed = false; 371 mMousePressed = false;
356 } 372 }
357#endif 373#endif
358 //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); 374 //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked);
359#ifndef DESKTOP_VERSION 375#ifndef DESKTOP_VERSION
360 if (!( e->button() == RightButton && rootClicked) ) 376 if (!( e->button() == RightButton && rootClicked) )
361 QListView::contentsMousePressEvent(e); 377 Q3ListView::contentsMousePressEvent(e);
362#else 378#else
363 QListView::contentsMousePressEvent(e); 379 Q3ListView::contentsMousePressEvent(e);
364#endif 380#endif
365} 381}
366void KOTodoListView::paintEvent(QPaintEvent* e) 382void KOTodoListView::paintEvent(QPaintEvent* e)
367{ 383{
368 emit paintNeeded(); 384 emit paintNeeded();
369 QListView::paintEvent( e); 385 Q3ListView::paintEvent( e);
370} 386}
371void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) 387void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
372{ 388{
373 389
374#ifndef KORG_NODND 390#ifndef KORG_NODND
375 //QListView::contentsMouseMoveEvent(e); 391 //QListView::contentsMouseMoveEvent(e);
376 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > 392 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() >
377 QApplication::startDragDistance()*3) { 393 QApplication::startDragDistance()*3) {
378 mMousePressed = false; 394 mMousePressed = false;
379 QListViewItem *item = itemAt(contentsToViewport(mPressPos)); 395 Q3ListViewItem *item = itemAt(contentsToViewport(mPressPos));
380 if (item) { 396 if (item) {
381 DndFactory factory( mCalendar ); 397 DndFactory factory( mCalendar );
382 ICalDrag *vd = factory.createDrag( 398 ICalDrag *vd = factory.createDrag(
383 ((KOTodoViewItem *)item)->todo(),viewport()); 399 ((KOTodoViewItem *)item)->todo(),viewport());
384 internalDrop = false; 400 internalDrop = false;
385 // we cannot do any senseful here, because the DnD is still broken in Qt 401 // we cannot do any senseful here, because the DnD is still broken in Qt
386 if (vd->drag()) { 402 if (vd->drag()) {
387 if ( !internalDrop ) { 403 if ( !internalDrop ) {
388 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() ); 404 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() );
389 qDebug("Dnd: External move: Delete drag source "); 405 qDebug("Dnd: External move: Delete drag source ");
390 } else 406 } else
391 qDebug("Dnd: Internal move "); 407 qDebug("Dnd: Internal move ");
@@ -413,95 +429,95 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e )
413 qApp->processEvents(); 429 qApp->processEvents();
414 if ( !isVisible() ) { 430 if ( !isVisible() ) {
415 e->ignore(); 431 e->ignore();
416 return; 432 return;
417 } 433 }
418 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 434 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
419 e->ignore(); 435 e->ignore();
420 // qDebug(" ignore %d",e->isAutoRepeat() ); 436 // qDebug(" ignore %d",e->isAutoRepeat() );
421 return; 437 return;
422 } 438 }
423 if (! e->isAutoRepeat() ) 439 if (! e->isAutoRepeat() )
424 mFlagKeyPressed = true; 440 mFlagKeyPressed = true;
425 QListViewItem* cn; 441 Q3ListViewItem* cn;
426 if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") { 442 if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") {
427 cn = currentItem(); 443 cn = currentItem();
428 if ( cn ) { 444 if ( cn ) {
429 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 445 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
430 if ( ci ){ 446 if ( ci ){
431 if ( e->state() == ShiftButton ) 447 if ( e->state() == Qt::ShiftButton )
432 ci->setOn( false ); 448 ci->setOn( false );
433 else 449 else
434 ci->setOn( true ); 450 ci->setOn( true );
435 cn = cn->itemBelow(); 451 cn = cn->itemBelow();
436 if ( cn ) { 452 if ( cn ) {
437 setCurrentItem ( cn ); 453 setCurrentItem ( cn );
438 ensureItemVisible ( cn ); 454 ensureItemVisible ( cn );
439 } 455 }
440 456
441 } 457 }
442 } 458 }
443 459
444 e->accept(); 460 e->accept();
445 return; 461 return;
446 } 462 }
447 463
448 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { 464 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
449 switch ( e->key() ) { 465 switch ( e->key() ) {
450 case Qt::Key_Down: 466 case Qt::Key_Down:
451 case Qt::Key_Up: 467 case Qt::Key_Up:
452 QListView::keyPressEvent ( e ); 468 Q3ListView::keyPressEvent ( e );
453 e->accept(); 469 e->accept();
454 break; 470 break;
455 case Qt::Key_Left: 471 case Qt::Key_Left:
456 case Qt::Key_Right: 472 case Qt::Key_Right:
457 QListView::keyPressEvent ( e ); 473 Q3ListView::keyPressEvent ( e );
458 e->accept(); 474 e->accept();
459 return; 475 return;
460 break; 476 break;
461 default: 477 default:
462 e->ignore(); 478 e->ignore();
463 break; 479 break;
464 } 480 }
465 return; 481 return;
466 } 482 }
467 e->ignore(); 483 e->ignore();
468} 484}
469void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) 485void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
470{ 486{
471 QListView::contentsMouseReleaseEvent(e); 487 Q3ListView::contentsMouseReleaseEvent(e);
472 mMousePressed = false; 488 mMousePressed = false;
473} 489}
474 490
475void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 491void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
476{ 492{
477 if (!e) return; 493 if (!e) return;
478 494
479 QPoint vp = contentsToViewport(e->pos()); 495 QPoint vp = contentsToViewport(e->pos());
480 496
481 QListViewItem *item = itemAt(vp); 497 Q3ListViewItem *item = itemAt(vp);
482 498
483 emit double_Clicked(item); 499 emit double_Clicked(item);
484 if (!item) return; 500 if (!item) return;
485 501
486 emit doubleClicked(item,vp,0); 502 emit doubleClicked(item,vp,0);
487} 503}
488 504
489///////////////////////////////////////////////////////////////////////////// 505/////////////////////////////////////////////////////////////////////////////
490 506
491KOQuickTodo::KOQuickTodo(QWidget *parent) : 507KOQuickTodo::KOQuickTodo(QWidget *parent) :
492 QLineEdit(parent) 508 QLineEdit(parent)
493{ 509{
494 setText(i18n("Click to add new Todo")); 510 setText(i18n("Click to add new Todo"));
495 setFocusPolicy ( QWidget::ClickFocus ); 511 setFocusPolicy ( Qt::ClickFocus );
496} 512}
497 513
498void KOQuickTodo::focusInEvent(QFocusEvent *ev) 514void KOQuickTodo::focusInEvent(QFocusEvent *ev)
499{ 515{
500 if ( text()==i18n("Click to add new Todo") ) 516 if ( text()==i18n("Click to add new Todo") )
501 setText(""); 517 setText("");
502 QLineEdit::focusInEvent(ev); 518 QLineEdit::focusInEvent(ev);
503} 519}
504 520
505void KOQuickTodo::focusOutEvent(QFocusEvent *ev) 521void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
506{ 522{
507 setText(i18n("Click to add new Todo")); 523 setText(i18n("Click to add new Todo"));
@@ -514,32 +530,32 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
514 KOrg::BaseView(calendar,parent,name) 530 KOrg::BaseView(calendar,parent,name)
515{ 531{
516 mIsActiveWindow = false; 532 mIsActiveWindow = false;
517 mCurItem = 0; 533 mCurItem = 0;
518 mCurItemRootParent = 0; 534 mCurItemRootParent = 0;
519 mCurItemParent = 0; 535 mCurItemParent = 0;
520 mCurItemAbove = 0; 536 mCurItemAbove = 0;
521 mActiveItem = 0; 537 mActiveItem = 0;
522 mCategoryPopupMenu = 0; 538 mCategoryPopupMenu = 0;
523 mPendingUpdateBeforeRepaint = false; 539 mPendingUpdateBeforeRepaint = false;
524 isFlatDisplay = false; 540 isFlatDisplay = false;
525 mNavigator = 0; 541 mNavigator = 0;
526 QBoxLayout *topLayout = new QVBoxLayout(this); 542 Q3BoxLayout *topLayout = new Q3VBoxLayout(this);
527 mName = QString ( name ); 543 mName = QString ( name );
528 mBlockUpdate = false; 544 mBlockUpdate = false;
529 mQuickBar = new QWidget( this ); 545 mQuickBar = new QWidget( this );
530 topLayout->addWidget(mQuickBar); 546 topLayout->addWidget(mQuickBar);
531 547
532 mQuickAdd = new KOQuickTodo(mQuickBar); 548 mQuickAdd = new KOQuickTodo(mQuickBar);
533 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); 549 Q3BoxLayout *quickLayout = new Q3HBoxLayout(mQuickBar);
534 quickLayout->addWidget( mQuickAdd ); 550 quickLayout->addWidget( mQuickAdd );
535 mNewSubBut = new QPushButton( "sub",mQuickBar ); 551 mNewSubBut = new QPushButton( "sub",mQuickBar );
536 QPushButton * s_done = new QPushButton( "D",mQuickBar ); 552 QPushButton * s_done = new QPushButton( "D",mQuickBar );
537 QPushButton * s_run = new QPushButton( "R",mQuickBar ); 553 QPushButton * s_run = new QPushButton( "R",mQuickBar );
538 QPushButton * allopen = new QPushButton( "O",mQuickBar ); 554 QPushButton * allopen = new QPushButton( "O",mQuickBar );
539 QPushButton * allclose = new QPushButton( "C",mQuickBar ); 555 QPushButton * allclose = new QPushButton( "C",mQuickBar );
540 QPushButton * flat = new QPushButton( "F",mQuickBar ); 556 QPushButton * flat = new QPushButton( "F",mQuickBar );
541 557
542 int fixwid = mQuickAdd->sizeHint().height(); 558 int fixwid = mQuickAdd->sizeHint().height();
543 int fixhei = fixwid; 559 int fixhei = fixwid;
544 if ( QApplication::desktop()->width() > 800 ) 560 if ( QApplication::desktop()->width() > 800 )
545 fixwid = (fixwid*3)/2; 561 fixwid = (fixwid*3)/2;
@@ -559,122 +575,122 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
559 s_done->setFixedWidth( fixwid ); 575 s_done->setFixedWidth( fixwid );
560 allopen->setFixedWidth( fixwid ); 576 allopen->setFixedWidth( fixwid );
561 allclose->setFixedWidth( fixwid ); 577 allclose->setFixedWidth( fixwid );
562 s_run->setFixedWidth( fixwid ); 578 s_run->setFixedWidth( fixwid );
563 579
564 flat->setFixedHeight(fixhei ); 580 flat->setFixedHeight(fixhei );
565 s_done->setFixedHeight(fixhei ); 581 s_done->setFixedHeight(fixhei );
566 allopen->setFixedHeight(fixhei ); 582 allopen->setFixedHeight(fixhei );
567 allclose->setFixedHeight(fixhei ); 583 allclose->setFixedHeight(fixhei );
568 s_run->setFixedHeight(fixhei ); 584 s_run->setFixedHeight(fixhei );
569 mNewSubBut->setFixedHeight(fixhei ); 585 mNewSubBut->setFixedHeight(fixhei );
570 586
571 flat->setFocusPolicy( NoFocus ); 587 flat->setFocusPolicy( Qt::NoFocus );
572 s_done->setFocusPolicy( NoFocus ); 588 s_done->setFocusPolicy( Qt::NoFocus );
573 allopen->setFocusPolicy( NoFocus ); 589 allopen->setFocusPolicy( Qt::NoFocus );
574 allclose->setFocusPolicy( NoFocus ); 590 allclose->setFocusPolicy( Qt::NoFocus );
575 s_run->setFocusPolicy( NoFocus ); 591 s_run->setFocusPolicy( Qt::NoFocus );
576 mNewSubBut->setFocusPolicy( NoFocus ); 592 mNewSubBut->setFocusPolicy( Qt::NoFocus );
577 593
578 QWhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) ); 594 Q3WhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) );
579 QWhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) ); 595 Q3WhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) );
580 QWhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) ); 596 Q3WhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) );
581 QWhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) ); 597 Q3WhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) );
582 QWhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) ); 598 Q3WhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) );
583 QWhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) ); 599 Q3WhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) );
584 600
585 quickLayout->addWidget( mNewSubBut ); 601 quickLayout->addWidget( mNewSubBut );
586 quickLayout->addWidget( s_done ); 602 quickLayout->addWidget( s_done );
587 quickLayout->addWidget( s_run ); 603 quickLayout->addWidget( s_run );
588 quickLayout->addWidget( allopen ); 604 quickLayout->addWidget( allopen );
589 quickLayout->addWidget( allclose ); 605 quickLayout->addWidget( allclose );
590 quickLayout->addWidget( flat ); 606 quickLayout->addWidget( flat );
591 607
592 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); 608 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide();
593 609
594 mTodoListView = new KOTodoListView(calendar,this, name ); 610 mTodoListView = new KOTodoListView(calendar,this, name );
595 topLayout->addWidget(mTodoListView); 611 topLayout->addWidget(mTodoListView);
596 //mTodoListView->header()->setMaximumHeight(30); 612 //mTodoListView->header()->setMaximumHeight(30);
597 mTodoListView->setRootIsDecorated(true); 613 mTodoListView->setRootIsDecorated(true);
598 mTodoListView->setAllColumnsShowFocus(true); 614 mTodoListView->setAllColumnsShowFocus(true);
599 615
600 mTodoListView->setShowSortIndicator(true); 616 mTodoListView->setShowSortIndicator(true);
601 617
602 mTodoListView->addColumn(i18n("Todo")); 618 mTodoListView->addColumn(i18n("Todo"));
603 mTodoListView->addColumn(i18n("Prio")); 619 mTodoListView->addColumn(i18n("Prio"));
604 mTodoListView->setColumnAlignment(1,AlignHCenter); 620 mTodoListView->setColumnAlignment(1,Qt::AlignHCenter);
605 mTodoListView->addColumn(i18n("Complete")); 621 mTodoListView->addColumn(i18n("Complete"));
606 mTodoListView->setColumnAlignment(2,AlignCenter); 622 mTodoListView->setColumnAlignment(2,Qt::AlignCenter);
607 623
608 mTodoListView->addColumn(i18n("Due Date")); 624 mTodoListView->addColumn(i18n("Due Date"));
609 mTodoListView->setColumnAlignment(3,AlignLeft); 625 mTodoListView->setColumnAlignment(3,Qt::AlignLeft);
610 mTodoListView->addColumn(i18n("Due Time")); 626 mTodoListView->addColumn(i18n("Due Time"));
611 mTodoListView->setColumnAlignment(4,AlignHCenter); 627 mTodoListView->setColumnAlignment(4,Qt::AlignHCenter);
612 628
613 mTodoListView->addColumn(i18n("Start Date")); 629 mTodoListView->addColumn(i18n("Start Date"));
614 mTodoListView->setColumnAlignment(5,AlignLeft); 630 mTodoListView->setColumnAlignment(5,Qt::AlignLeft);
615 mTodoListView->addColumn(i18n("Start Time")); 631 mTodoListView->addColumn(i18n("Start Time"));
616 mTodoListView->setColumnAlignment(6,AlignHCenter); 632 mTodoListView->setColumnAlignment(6,Qt::AlignHCenter);
617 633
618 //mTodoListView->addColumn(i18n("Cancelled")); 634 //mTodoListView->addColumn(i18n("Cancelled"));
619 mTodoListView->addColumn(i18n("Categories")); 635 mTodoListView->addColumn(i18n("Categories"));
620 mTodoListView->addColumn(i18n("Calendar")); 636 mTodoListView->addColumn(i18n("Calendar"));
621 mTodoListView->addColumn(i18n("Last Modified")); 637 mTodoListView->addColumn(i18n("Last Modified"));
622 mTodoListView->addColumn(i18n("Created")); 638 mTodoListView->addColumn(i18n("Created"));
623 mTodoListView->addColumn(i18n("Last Modified Sub")); 639 mTodoListView->addColumn(i18n("Last Modified Sub"));
624#if 0 640#if 0
625 mTodoListView->addColumn(i18n("Sort Id")); 641 mTodoListView->addColumn(i18n("Sort Id"));
626 mTodoListView->setColumnAlignment(4,AlignHCenter); 642 mTodoListView->setColumnAlignment(4,Qt::AlignHCenter);
627#endif 643#endif
628 644
629 mTodoListView->setMinimumHeight( 60 ); 645 mTodoListView->setMinimumHeight( 60 );
630 mTodoListView->setItemsRenameable( true ); 646 mTodoListView->setItemsRenameable( true );
631 mTodoListView->setRenameable( 0 ); 647 mTodoListView->setRenameable( 0 );
632 mTodoListView->setColumnWidth( 0, 120 ); 648 mTodoListView->setColumnWidth( 0, 120 );
633 int iii = 0; 649 int iii = 0;
634 for ( iii = 0; iii< 12 ; ++iii ) 650 for ( iii = 0; iii< 12 ; ++iii )
635 mTodoListView->setColumnWidthMode( iii, QListView::Manual ); 651 mTodoListView->setColumnWidthMode( iii, Q3ListView::Manual );
636 652
637 653
638 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); 654 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
639 655
640 mPriorityPopupMenu = new QPopupMenu(this); 656 mPriorityPopupMenu = new Q3PopupMenu(this);
641 for (int i = 1; i <= 5; i++) { 657 for (int i = 1; i <= 5; i++) {
642 QString label = QString ("%1").arg (i); 658 QString label = QString ("%1").arg (i);
643 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 659 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
644 } 660 }
645 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 661 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
646 662
647 mPercentageCompletedPopupMenu = new QPopupMenu(this); 663 mPercentageCompletedPopupMenu = new Q3PopupMenu(this);
648 for (int i = 0; i <= 100; i+=20) { 664 for (int i = 0; i <= 100; i+=20) {
649 QString label = QString ("%1 %").arg (i); 665 QString label = QString ("%1 %").arg (i);
650 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 666 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
651 } 667 }
652 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 668 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
653 669
654 670
655 mCategoryPopupMenu = new QPopupMenu (this); 671 mCategoryPopupMenu = new Q3PopupMenu (this);
656 mCategoryPopupMenu->setCheckable (true); 672 mCategoryPopupMenu->setCheckable (true);
657 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); 673 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
658 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); 674 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ()));
659 675
660 mCalPopupMenu = new QPopupMenu (this); 676 mCalPopupMenu = new Q3PopupMenu (this);
661 mCalPopupMenu->setCheckable (true); 677 mCalPopupMenu->setCheckable (true);
662 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); 678 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int)));
663 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); 679 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ()));
664 680
665 681
666 682
667 683
668 mItemPopupMenu = new QPopupMenu(this); 684 mItemPopupMenu = new Q3PopupMenu(this);
669 mItemPopupMenu->insertItem(i18n("Show"), this, 685 mItemPopupMenu->insertItem(i18n("Show"), this,
670 SLOT (showTodo())); 686 SLOT (showTodo()));
671 mItemPopupMenu->insertItem(i18n("Edit..."), this, 687 mItemPopupMenu->insertItem(i18n("Edit..."), this,
672 SLOT (editTodo())); 688 SLOT (editTodo()));
673 mItemPopupMenu->insertItem( i18n("Delete..."), this, 689 mItemPopupMenu->insertItem( i18n("Delete..."), this,
674 SLOT (deleteTodo())); 690 SLOT (deleteTodo()));
675 mItemPopupMenu->insertItem( i18n("Clone..."), this, 691 mItemPopupMenu->insertItem( i18n("Clone..."), this,
676 SLOT (cloneTodo())); 692 SLOT (cloneTodo()));
677 mItemPopupMenu->insertItem( i18n("Move..."), this, 693 mItemPopupMenu->insertItem( i18n("Move..."), this,
678 SLOT (moveTodo())); 694 SLOT (moveTodo()));
679#ifndef DESKTOP_VERSION 695#ifndef DESKTOP_VERSION
680 mItemPopupMenu->insertItem( i18n("Beam..."), this, 696 mItemPopupMenu->insertItem( i18n("Beam..."), this,
@@ -701,25 +717,25 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
701 mItemPopupMenu->insertSeparator(); 717 mItemPopupMenu->insertSeparator();
702#if 0 718#if 0
703 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."), 719 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."),
704 this, SLOT( purgeCompleted() ) ); 720 this, SLOT( purgeCompleted() ) );
705 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), 721 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
706 this, SLOT( toggleCompleted() ),0, 33 ); 722 this, SLOT( toggleCompleted() ),0, 33 );
707 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 723 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
708 this, SLOT( toggleQuickTodo() ),0, 34 ); 724 this, SLOT( toggleQuickTodo() ),0, 34 );
709 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 725 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
710 this, SLOT( toggleRunning() ),0, 35 ); 726 this, SLOT( toggleRunning() ),0, 35 );
711 727
712#endif 728#endif
713 mPopupMenu = new QPopupMenu(this); 729 mPopupMenu = new Q3PopupMenu(this);
714 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, 730 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
715 SLOT (newTodo()),0,1); 731 SLOT (newTodo()),0,1);
716 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), 732 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."),
717 this, SLOT(purgeCompleted()),0,2); 733 this, SLOT(purgeCompleted()),0,2);
718 mPopupMenu->insertItem(i18n("Show Completed"), 734 mPopupMenu->insertItem(i18n("Show Completed"),
719 this, SLOT( toggleCompleted() ),0,3 ); 735 this, SLOT( toggleCompleted() ),0,3 );
720 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 736 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
721 this, SLOT( toggleRunning() ),0,5 ); 737 this, SLOT( toggleRunning() ),0,5 );
722 mPopupMenu->insertItem(i18n(" set all open","Display all opened"), 738 mPopupMenu->insertItem(i18n(" set all open","Display all opened"),
723 this, SLOT( setAllOpen() ),0,6 ); 739 this, SLOT( setAllOpen() ),0,6 );
724 mPopupMenu->insertItem(i18n(" set all close","Display all closed"), 740 mPopupMenu->insertItem(i18n(" set all close","Display all closed"),
725 this, SLOT( setAllClose() ),0,7 ); 741 this, SLOT( setAllClose() ),0,7 );
@@ -737,56 +753,56 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
737 753
738 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 754 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
739 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 755 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
740 756
741 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 757 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
742 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 758 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
743 759
744 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); 760 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
745 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); 761 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
746 762
747 763
748 // Double clicking conflicts with opening/closing the subtree 764 // Double clicking conflicts with opening/closing the subtree
749 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), 765 connect( mTodoListView, SIGNAL( doubleClicked( Q3ListViewItem *) ),
750 SLOT( editItem( QListViewItem *) ) ); 766 SLOT( editItem( Q3ListViewItem *) ) );
751 /* 767 /*
752 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, 768 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
753 const QPoint &,int ) ), 769 const QPoint &,int ) ),
754 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 770 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
755 */ 771 */
756 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, 772 connect( mTodoListView, SIGNAL( contextRequest ( Q3ListViewItem *,
757 const QPoint &,int ) ), 773 const QPoint &,int ) ),
758 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 774 SLOT( popupMenu( Q3ListViewItem *, const QPoint & ,int) ) );
759 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), 775 connect( mTodoListView, SIGNAL( clicked( Q3ListViewItem * ) ),
760 SLOT( itemClicked( QListViewItem * ) ) ); 776 SLOT( itemClicked( Q3ListViewItem * ) ) );
761 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), 777 connect( mTodoListView, SIGNAL( double_Clicked( Q3ListViewItem * ) ),
762 SLOT( itemDoubleClicked( QListViewItem * ) ) ); 778 SLOT( itemDoubleClicked( Q3ListViewItem * ) ) );
763 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 779 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
764 SLOT( updateView() ) ); 780 SLOT( updateView() ) );
765 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 781 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
766 SLOT( todoModified(Todo *, int) ) ); 782 SLOT( todoModified(Todo *, int) ) );
767 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), 783 connect( mTodoListView, SIGNAL( expanded( Q3ListViewItem * ) ),
768 SLOT( itemStateChanged( QListViewItem * ) ) ); 784 SLOT( itemStateChanged( Q3ListViewItem * ) ) );
769 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), 785 connect( mTodoListView, SIGNAL( collapsed( Q3ListViewItem * ) ),
770 SLOT( itemStateChanged( QListViewItem * ) ) ); 786 SLOT( itemStateChanged( Q3ListViewItem * ) ) );
771 connect( mTodoListView, SIGNAL( paintNeeded() ), 787 connect( mTodoListView, SIGNAL( paintNeeded() ),
772 SLOT( paintNeeded()) ); 788 SLOT( paintNeeded()) );
773 789
774#if 0 790#if 0
775 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), 791 connect(mTodoListView,SIGNAL(selectionChanged(Q3ListViewItem *)),
776 SLOT(selectionChanged(QListViewItem *))); 792 SLOT(selectionChanged(Q3ListViewItem *)));
777 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), 793 connect(mTodoListView,SIGNAL(clicked(Q3ListViewItem *)),
778 SLOT(selectionChanged(QListViewItem *))); 794 SLOT(selectionChanged(Q3ListViewItem *)));
779 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), 795 connect(mTodoListView,SIGNAL(pressed(Q3ListViewItem *)),
780 SLOT(selectionChanged(QListViewItem *))); 796 SLOT(selectionChanged(Q3ListViewItem *)));
781#endif 797#endif
782 798
783 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); 799 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
784 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); 800 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
785 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); 801 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) ));
786 802
787 connect( mTodoListView, SIGNAL(selectionChanged() ), 803 connect( mTodoListView, SIGNAL(selectionChanged() ),
788 SLOT( processSelectionChange() ) ); 804 SLOT( processSelectionChange() ) );
789 connect( mQuickAdd, SIGNAL( returnPressed () ), 805 connect( mQuickAdd, SIGNAL( returnPressed () ),
790 SLOT( addQuickTodo() ) ); 806 SLOT( addQuickTodo() ) );
791 807
792} 808}
@@ -872,25 +888,25 @@ void KOTodoView::updateView()
872 if ( mName == "todolistsmall" ) { 888 if ( mName == "todolistsmall" ) {
873 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { 889 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {
874 int ps = fo.pointSize() -2; 890 int ps = fo.pointSize() -2;
875 if ( ps > 12 ) 891 if ( ps > 12 )
876 ps -= 2; 892 ps -= 2;
877 fo.setPointSize( ps ); 893 fo.setPointSize( ps );
878 } 894 }
879 } 895 }
880 896
881 mTodoListView->setFont( fo ); 897 mTodoListView->setFont( fo );
882 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); 898 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont );
883 //mTodoListView->header()->setMaximumHeight(fm.height()); 899 //mTodoListView->header()->setMaximumHeight(fm.height());
884 QPtrList<Todo> todoList = calendar()->todos(); 900 Q3PtrList<Todo> todoList = calendar()->todos();
885 901
886/* 902/*
887 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; 903 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl;
888 Event *t; 904 Event *t;
889 for(t = todoList.first(); t; t = todoList.next()) { 905 for(t = todoList.first(); t; t = todoList.next()) {
890 kdDebug() << " " << t->getSummary() << endl; 906 kdDebug() << " " << t->getSummary() << endl;
891 907
892 if (t->getRelatedTo()) { 908 if (t->getRelatedTo()) {
893 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; 909 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl;
894 } 910 }
895 911
896 QPtrList<Event> l = t->getRelations(); 912 QPtrList<Event> l = t->getRelations();
@@ -1035,25 +1051,25 @@ bool KOTodoView::checkTodo( Todo * todo )
1035 } 1051 }
1036 if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) { 1052 if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) {
1037 if ( todo->hasStartDate() ) 1053 if ( todo->hasStartDate() )
1038 if ( mNavigator->selectedDates().last() < todo->dtStart().date() ) 1054 if ( mNavigator->selectedDates().last() < todo->dtStart().date() )
1039 return false; 1055 return false;
1040 if ( todo->hasDueDate() ) 1056 if ( todo->hasDueDate() )
1041 if ( mNavigator->selectedDates().first() > todo->dtDue().date() ) 1057 if ( mNavigator->selectedDates().first() > todo->dtDue().date() )
1042 return false; 1058 return false;
1043 } 1059 }
1044 return true; 1060 return true;
1045} 1061}
1046 1062
1047void KOTodoView::restoreItemState( QListViewItem *item ) 1063void KOTodoView::restoreItemState( Q3ListViewItem *item )
1048{ 1064{
1049 pendingSubtodo = 0; 1065 pendingSubtodo = 0;
1050 while( item ) { 1066 while( item ) {
1051 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1067 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1052 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); 1068 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) );
1053 if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); 1069 if( item->childCount() > 0 ) restoreItemState( item->firstChild() );
1054 item = item->nextSibling(); 1070 item = item->nextSibling();
1055 } 1071 }
1056} 1072}
1057 1073
1058 1074
1059QMap<Todo *,KOTodoViewItem *>::ConstIterator 1075QMap<Todo *,KOTodoViewItem *>::ConstIterator
@@ -1087,81 +1103,81 @@ KOTodoView::insertTodoItem(Todo *todo)
1087 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); 1103 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
1088 return mTodoMap.insert(todo,todoItem); 1104 return mTodoMap.insert(todo,todoItem);
1089 } 1105 }
1090} 1106}
1091 1107
1092 1108
1093void KOTodoView::updateConfig() 1109void KOTodoView::updateConfig()
1094{ 1110{
1095 updateView(); 1111 updateView();
1096 mTodoListView->repaintContents(); 1112 mTodoListView->repaintContents();
1097} 1113}
1098 1114
1099QPtrList<Incidence> KOTodoView::selectedIncidences() 1115Q3PtrList<Incidence> KOTodoView::selectedIncidences()
1100{ 1116{
1101 QPtrList<Incidence> selected; 1117 Q3PtrList<Incidence> selected;
1102 1118
1103 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 1119 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
1104// if (!item) item = mActiveItem; 1120// if (!item) item = mActiveItem;
1105 if (item) selected.append(item->todo()); 1121 if (item) selected.append(item->todo());
1106 1122
1107 return selected; 1123 return selected;
1108} 1124}
1109 1125
1110QPtrList<Todo> KOTodoView::selectedTodos() 1126Q3PtrList<Todo> KOTodoView::selectedTodos()
1111{ 1127{
1112 QPtrList<Todo> selected; 1128 Q3PtrList<Todo> selected;
1113 1129
1114 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 1130 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
1115// if (!item) item = mActiveItem; 1131// if (!item) item = mActiveItem;
1116 if (item) selected.append(item->todo()); 1132 if (item) selected.append(item->todo());
1117 1133
1118 return selected; 1134 return selected;
1119} 1135}
1120 1136
1121void KOTodoView::changeEventDisplay(Event *, int) 1137void KOTodoView::changeEventDisplay(Event *, int)
1122{ 1138{
1123 updateView(); 1139 updateView();
1124} 1140}
1125 1141
1126void KOTodoView::showDates(const QDate &, const QDate &) 1142void KOTodoView::showDates(const QDate &, const QDate &)
1127{ 1143{
1128} 1144}
1129 1145
1130void KOTodoView::showEvents(QPtrList<Event>) 1146void KOTodoView::showEvents(Q3PtrList<Event>)
1131{ 1147{
1132 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; 1148 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl;
1133} 1149}
1134 1150
1135void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, 1151void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
1136 const QDate &td) 1152 const QDate &td)
1137{ 1153{
1138#ifndef KORG_NOPRINTER 1154#ifndef KORG_NOPRINTER
1139 calPrinter->preview(CalPrinter::Todolist, fd, td); 1155 calPrinter->preview(CalPrinter::Todolist, fd, td);
1140#endif 1156#endif
1141} 1157}
1142 1158
1143void KOTodoView::editItem(QListViewItem *item ) 1159void KOTodoView::editItem(Q3ListViewItem *item )
1144{ 1160{
1145 if ( item ) 1161 if ( item )
1146 emit editTodoSignal(((KOTodoViewItem *)item)->todo()); 1162 emit editTodoSignal(((KOTodoViewItem *)item)->todo());
1147} 1163}
1148 1164
1149void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) 1165void KOTodoView::showItem(Q3ListViewItem *item,const QPoint &,int)
1150{ 1166{
1151 if ( item ) 1167 if ( item )
1152 emit showTodoSignal(((KOTodoViewItem *)item)->todo()); 1168 emit showTodoSignal(((KOTodoViewItem *)item)->todo());
1153} 1169}
1154 1170
1155void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) 1171void KOTodoView::popupMenu(Q3ListViewItem *item,const QPoint &p,int column)
1156{ 1172{
1157 pendingSubtodo = 0; 1173 pendingSubtodo = 0;
1158 mActiveItem = (KOTodoViewItem *)item; 1174 mActiveItem = (KOTodoViewItem *)item;
1159 if (item) { 1175 if (item) {
1160 switch (column){ 1176 switch (column){
1161 case 1: 1177 case 1:
1162 mPriorityPopupMenu->popup(QCursor::pos ()); break; 1178 mPriorityPopupMenu->popup(QCursor::pos ()); break;
1163 case 2: 1179 case 2:
1164 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; 1180 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
1165 case 3: 1181 case 3:
1166 moveTodo(); 1182 moveTodo();
1167 break; 1183 break;
@@ -1352,25 +1368,25 @@ void KOTodoView::toggleRunningItemQuick()
1352 topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!")); 1368 topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!"));
1353 return; 1369 return;
1354 } 1370 }
1355 else 1371 else
1356 toggleRunningItem(); 1372 toggleRunningItem();
1357 return; 1373 return;
1358 } else { 1374 } else {
1359 t->setRunning( true ); 1375 t->setRunning( true );
1360 mActiveItem->construct(); 1376 mActiveItem->construct();
1361 topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); 1377 topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!"));
1362 } 1378 }
1363} 1379}
1364void KOTodoView::itemDoubleClicked(QListViewItem *item) 1380void KOTodoView::itemDoubleClicked(Q3ListViewItem *item)
1365{ 1381{
1366 if ( pendingSubtodo != 0 ) { 1382 if ( pendingSubtodo != 0 ) {
1367 topLevelWidget()->setCaption(i18n("Reparenting aborted!")); 1383 topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
1368 } 1384 }
1369 pendingSubtodo = 0; 1385 pendingSubtodo = 0;
1370 //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); 1386 //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() );
1371 int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); 1387 int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() );
1372 //qDebug("ROW %d ", row); 1388 //qDebug("ROW %d ", row);
1373 if (!item) { 1389 if (!item) {
1374 newTodo(); 1390 newTodo();
1375 return; 1391 return;
1376 } else { 1392 } else {
@@ -1419,38 +1435,38 @@ void KOTodoView::toggleRunningItem()
1419 if ( !tp.exec() ) return; 1435 if ( !tp.exec() ) return;
1420 if ( tp.stopAll() ) { 1436 if ( tp.stopAll() ) {
1421 mCalendar->stopAllTodos(); 1437 mCalendar->stopAllTodos();
1422 t->setRunning( true ); 1438 t->setRunning( true );
1423 updateView(); 1439 updateView();
1424 } else { 1440 } else {
1425 t->setRunning( true ); 1441 t->setRunning( true );
1426 updateTodo ( t, KOGlobals::EVENTEDITED ); 1442 updateTodo ( t, KOGlobals::EVENTEDITED );
1427 } 1443 }
1428 } 1444 }
1429} 1445}
1430 1446
1431void KOTodoView::itemClicked(QListViewItem *item) 1447void KOTodoView::itemClicked(Q3ListViewItem *item)
1432{ 1448{
1433 //qDebug("KOTodoView::itemClicked %d", item); 1449 //qDebug("KOTodoView::itemClicked %d", item);
1434 if (!item) { 1450 if (!item) {
1435 if ( pendingSubtodo != 0 ) { 1451 if ( pendingSubtodo != 0 ) {
1436 topLevelWidget()->setCaption(i18n("Reparenting aborted!")); 1452 topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
1437 } 1453 }
1438 pendingSubtodo = 0; 1454 pendingSubtodo = 0;
1439 return; 1455 return;
1440 } 1456 }
1441 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1457 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1442 if ( pendingSubtodo != 0 ) { 1458 if ( pendingSubtodo != 0 ) {
1443 bool allowReparent = true; 1459 bool allowReparent = true;
1444 QListViewItem *par = item; 1460 Q3ListViewItem *par = item;
1445 while ( par ) { 1461 while ( par ) {
1446 if ( par == pendingSubtodo ) { 1462 if ( par == pendingSubtodo ) {
1447 allowReparent = false; 1463 allowReparent = false;
1448 break; 1464 break;
1449 } 1465 }
1450 par = par->parent(); 1466 par = par->parent();
1451 } 1467 }
1452 if ( !allowReparent ) { 1468 if ( !allowReparent ) {
1453 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); 1469 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!"));
1454 pendingSubtodo = 0; 1470 pendingSubtodo = 0;
1455 } else { 1471 } else {
1456 Todo* newParent = todoItem->todo(); 1472 Todo* newParent = todoItem->todo();
@@ -1460,25 +1476,25 @@ void KOTodoView::itemClicked(QListViewItem *item)
1460 return; 1476 return;
1461 } 1477 }
1462 } 1478 }
1463 1479
1464} 1480}
1465 1481
1466void KOTodoView::setDocumentId( const QString &id ) 1482void KOTodoView::setDocumentId( const QString &id )
1467{ 1483{
1468 1484
1469 mDocPrefs->setDoc( id ); 1485 mDocPrefs->setDoc( id );
1470} 1486}
1471 1487
1472void KOTodoView::itemStateChanged( QListViewItem *item ) 1488void KOTodoView::itemStateChanged( Q3ListViewItem *item )
1473{ 1489{
1474 if (!item) return; 1490 if (!item) return;
1475 1491
1476 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1492 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1477 1493
1478// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; 1494// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl;
1479 1495
1480 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); 1496 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() );
1481} 1497}
1482 1498
1483void KOTodoView::saveLayout(KConfig *config, const QString &group) const 1499void KOTodoView::saveLayout(KConfig *config, const QString &group) const
1484{ 1500{
@@ -1533,46 +1549,46 @@ void KOTodoView::setAllOpen()
1533void KOTodoView::setAllClose() 1549void KOTodoView::setAllClose()
1534{ 1550{
1535 if ( isFlatDisplay ) { 1551 if ( isFlatDisplay ) {
1536 isFlatDisplay = false; 1552 isFlatDisplay = false;
1537 mPopupMenu->setItemChecked( 8,false ); 1553 mPopupMenu->setItemChecked( 8,false );
1538 updateView(); 1554 updateView();
1539 } else { 1555 } else {
1540 storeCurrentItem(); 1556 storeCurrentItem();
1541 } 1557 }
1542 setOpen(mTodoListView->firstChild(), false); 1558 setOpen(mTodoListView->firstChild(), false);
1543 resetCurrentItem(); 1559 resetCurrentItem();
1544} 1560}
1545void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) 1561void KOTodoView::setOpen( Q3ListViewItem* item, bool setOpenI)
1546{ 1562{
1547 1563
1548 while ( item ) { 1564 while ( item ) {
1549 setOpen( item->firstChild(), setOpenI ); 1565 setOpen( item->firstChild(), setOpenI );
1550 item->setOpen( setOpenI ); 1566 item->setOpen( setOpenI );
1551 item = item->nextSibling(); 1567 item = item->nextSibling();
1552 } 1568 }
1553} 1569}
1554 1570
1555void KOTodoView::displayAllFlat() 1571void KOTodoView::displayAllFlat()
1556{ 1572{
1557 1573
1558 mActiveItem = 0; 1574 mActiveItem = 0;
1559 pendingSubtodo = 0; 1575 pendingSubtodo = 0;
1560 if ( mBlockUpdate ) { 1576 if ( mBlockUpdate ) {
1561 return; 1577 return;
1562 } 1578 }
1563 clearList (); 1579 clearList ();
1564 mPopupMenu->setItemChecked( 8,true ); 1580 mPopupMenu->setItemChecked( 8,true );
1565 isFlatDisplay = true; 1581 isFlatDisplay = true;
1566 QPtrList<Todo> todoList = calendar()->todos(); 1582 Q3PtrList<Todo> todoList = calendar()->todos();
1567 Todo *todo; 1583 Todo *todo;
1568 for(todo = todoList.first(); todo; todo = todoList.next()) { 1584 for(todo = todoList.first(); todo; todo = todoList.next()) {
1569 if ( checkTodo( todo ) ) { 1585 if ( checkTodo( todo ) ) {
1570 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); 1586 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
1571 mTodoMap.insert(todo,todoItem); 1587 mTodoMap.insert(todo,todoItem);
1572 } 1588 }
1573 } 1589 }
1574 resetCurrentItem(); 1590 resetCurrentItem();
1575} 1591}
1576 1592
1577void KOTodoView::setAllFlat() 1593void KOTodoView::setAllFlat()
1578{ 1594{
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 0cbc087..a9e7f30 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -17,33 +17,43 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOTODOVIEW_H 23#ifndef KOTODOVIEW_H
24#define KOTODOVIEW_H 24#define KOTODOVIEW_H
25 25
26#include <qfont.h> 26#include <qfont.h>
27#include <qfontmetrics.h> 27#include <qfontmetrics.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qptrlist.h> 29#include <q3ptrlist.h>
30#include <qstrlist.h> 30#include <q3strlist.h>
31#include <qlistbox.h> 31#include <q3listbox.h>
32#include <qpopupmenu.h> 32#include <q3popupmenu.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qmap.h> 34#include <qmap.h>
35#include <qdialog.h> 35#include <qdialog.h>
36#include <qlabel.h> 36#include <qlabel.h>
37#include <qlistview.h> 37#include <q3listview.h>
38//Added by qt3to4:
39#include <QDragMoveEvent>
40#include <QDropEvent>
41#include <QDragLeaveEvent>
42#include <QWheelEvent>
43#include <QPaintEvent>
44#include <QFocusEvent>
45#include <QMouseEvent>
46#include <QKeyEvent>
47#include <QDragEnterEvent>
38#include <klistview.h> 48#include <klistview.h>
39 49
40#include <libkcal/calendar.h> 50#include <libkcal/calendar.h>
41#include <libkcal/todo.h> 51#include <libkcal/todo.h>
42 52
43#include <korganizer/baseview.h> 53#include <korganizer/baseview.h>
44 54
45#include "kotodoviewitem.h" 55#include "kotodoviewitem.h"
46#include "koprefs.h" 56#include "koprefs.h"
47#include "koglobals.h" 57#include "koglobals.h"
48#include "datenavigator.h" 58#include "datenavigator.h"
49 59
@@ -92,48 +102,48 @@ private:
92}; 102};
93 103
94class KOTodoListView : public KListView 104class KOTodoListView : public KListView
95{ 105{
96 Q_OBJECT 106 Q_OBJECT
97 public: 107 public:
98 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); 108 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0);
99 virtual ~KOTodoListView() {} 109 virtual ~KOTodoListView() {}
100 110
101 signals: 111 signals:
102 void paintNeeded(); 112 void paintNeeded();
103 void todoDropped(Todo *, int); 113 void todoDropped(Todo *, int);
104 void double_Clicked(QListViewItem *item); 114 void double_Clicked(Q3ListViewItem *item);
105 void reparentTodoSignal( Todo *,Todo * ); 115 void reparentTodoSignal( Todo *,Todo * );
106 void unparentTodoSignal(Todo *); 116 void unparentTodoSignal(Todo *);
107 void deleteTodo( Todo * ); 117 void deleteTodo( Todo * );
108 protected: 118 protected:
109 void wheelEvent (QWheelEvent *e); 119 void wheelEvent (QWheelEvent *e);
110 void contentsDragEnterEvent(QDragEnterEvent *); 120 void contentsDragEnterEvent(QDragEnterEvent *);
111 void contentsDragMoveEvent(QDragMoveEvent *); 121 void contentsDragMoveEvent(QDragMoveEvent *);
112 void contentsDragLeaveEvent(QDragLeaveEvent *); 122 void contentsDragLeaveEvent(QDragLeaveEvent *);
113 void contentsDropEvent(QDropEvent *); 123 void contentsDropEvent(QDropEvent *);
114 124
115 void contentsMousePressEvent(QMouseEvent *); 125 void contentsMousePressEvent(QMouseEvent *);
116 void contentsMouseMoveEvent(QMouseEvent *); 126 void contentsMouseMoveEvent(QMouseEvent *);
117 void contentsMouseReleaseEvent(QMouseEvent *); 127 void contentsMouseReleaseEvent(QMouseEvent *);
118 void contentsMouseDoubleClickEvent(QMouseEvent *); 128 void contentsMouseDoubleClickEvent(QMouseEvent *);
119 129
120 private: 130 private:
121 void paintEvent(QPaintEvent * pevent); 131 void paintEvent(QPaintEvent * pevent);
122 bool internalDrop; 132 bool internalDrop;
123 QString mName; 133 QString mName;
124 Calendar *mCalendar; 134 Calendar *mCalendar;
125 QPoint mPressPos; 135 QPoint mPressPos;
126 bool mMousePressed; 136 bool mMousePressed;
127 QListViewItem *mOldCurrent; 137 Q3ListViewItem *mOldCurrent;
128 bool mFlagKeyPressed; 138 bool mFlagKeyPressed;
129 void keyPressEvent ( QKeyEvent * ) ; 139 void keyPressEvent ( QKeyEvent * ) ;
130 void keyReleaseEvent ( QKeyEvent * ) ; 140 void keyReleaseEvent ( QKeyEvent * ) ;
131}; 141};
132 142
133 143
134/** 144/**
135 This is the line-edit on top of the todoview for fast addition of new todos 145 This is the line-edit on top of the todoview for fast addition of new todos
136*/ 146*/
137class KOQuickTodo : public QLineEdit 147class KOQuickTodo : public QLineEdit
138{ 148{
139 public: 149 public:
@@ -148,26 +158,26 @@ class KOQuickTodo : public QLineEdit
148 This class provides a multi-column list view of todo events. 158 This class provides a multi-column list view of todo events.
149 159
150 @short multi-column list view of todo events. 160 @short multi-column list view of todo events.
151 @author Cornelius Schumacher <schumacher@kde.org> 161 @author Cornelius Schumacher <schumacher@kde.org>
152*/ 162*/
153class KOTodoView : public KOrg::BaseView 163class KOTodoView : public KOrg::BaseView
154{ 164{
155 Q_OBJECT 165 Q_OBJECT
156 public: 166 public:
157 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); 167 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 );
158 ~KOTodoView(); 168 ~KOTodoView();
159 169
160 QPtrList<Incidence> selectedIncidences(); 170 Q3PtrList<Incidence> selectedIncidences();
161 QPtrList<Todo> selectedTodos(); 171 Q3PtrList<Todo> selectedTodos();
162 172
163 DateList selectedDates() 173 DateList selectedDates()
164 {DateList q; 174 {DateList q;
165 return q;} 175 return q;}
166 176
167 /** Return number of shown dates. TodoView does not show dates, */ 177 /** Return number of shown dates. TodoView does not show dates, */
168 int currentDateCount() { return 0; } 178 int currentDateCount() { return 0; }
169 179
170 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); 180 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td);
171 181
172 void setDocumentId( const QString & ); 182 void setDocumentId( const QString & );
173 183
@@ -175,32 +185,32 @@ class KOTodoView : public KOrg::BaseView
175 void restoreLayout(KConfig *config, const QString &group); 185 void restoreLayout(KConfig *config, const QString &group);
176 void setNavigator( DateNavigator* nav ) {mNavigator = nav;} 186 void setNavigator( DateNavigator* nav ) {mNavigator = nav;}
177 QString getWhatsThisText(QPoint p); 187 QString getWhatsThisText(QPoint p);
178 void clearList( bool saveCurrentItem = true ); 188 void clearList( bool saveCurrentItem = true );
179 189
180 public slots: 190 public slots:
181 void updateView(); 191 void updateView();
182 void updateConfig(); 192 void updateConfig();
183 193
184 void changeEventDisplay(Event *, int); 194 void changeEventDisplay(Event *, int);
185 195
186 void showDates(const QDate &start, const QDate &end); 196 void showDates(const QDate &start, const QDate &end);
187 void showEvents(QPtrList<Event> eventList); 197 void showEvents(Q3PtrList<Event> eventList);
188 198
189 void clearSelection(); 199 void clearSelection();
190 void jumpToDate (); 200 void jumpToDate ();
191 201
192 void editItem(QListViewItem *item); 202 void editItem(Q3ListViewItem *item);
193 void showItem(QListViewItem *item,const QPoint &,int); 203 void showItem(Q3ListViewItem *item,const QPoint &,int);
194 void popupMenu(QListViewItem *item,const QPoint &,int); 204 void popupMenu(Q3ListViewItem *item,const QPoint &,int);
195 void newTodo(); 205 void newTodo();
196 void newSubTodo(); 206 void newSubTodo();
197 void unparentTodo(); 207 void unparentTodo();
198 void reparentTodo(); 208 void reparentTodo();
199 void showTodo(); 209 void showTodo();
200 void editTodo(); 210 void editTodo();
201 void cloneTodo(); 211 void cloneTodo();
202 void cancelTodo(); 212 void cancelTodo();
203 void moveTodo(); 213 void moveTodo();
204 void beamTodo(); 214 void beamTodo();
205 void deleteTodo(); 215 void deleteTodo();
206 216
@@ -210,28 +220,28 @@ class KOTodoView : public KOrg::BaseView
210 220
211 void setAllOpen(); 221 void setAllOpen();
212 void setAllClose(); 222 void setAllClose();
213 void setAllFlat(); 223 void setAllFlat();
214 void displayAllFlat(); 224 void displayAllFlat();
215 225
216 void purgeCompleted(); 226 void purgeCompleted();
217 void toggleCompleted(); 227 void toggleCompleted();
218 void toggleRunning(); 228 void toggleRunning();
219 void toggleQuickTodo(); 229 void toggleQuickTodo();
220 void updateTodo( Todo *, int ); 230 void updateTodo( Todo *, int );
221 231
222 void itemClicked(QListViewItem *); 232 void itemClicked(Q3ListViewItem *);
223 void itemStateChanged(QListViewItem *); 233 void itemStateChanged(Q3ListViewItem *);
224 void modified(bool); 234 void modified(bool);
225 void itemDoubleClicked(QListViewItem *item); 235 void itemDoubleClicked(Q3ListViewItem *item);
226 void resetFocusToList(); 236 void resetFocusToList();
227 void fillCategories (); 237 void fillCategories ();
228 void fillCal (); 238 void fillCal ();
229 void changedCal (int); 239 void changedCal (int);
230 240
231 signals: 241 signals:
232 void newTodoSignal(); 242 void newTodoSignal();
233 void newSubTodoSignal(Todo *); 243 void newSubTodoSignal(Todo *);
234 void unparentTodoSignal(Todo *); 244 void unparentTodoSignal(Todo *);
235 void reparentTodoSignal( Todo *,Todo * ); 245 void reparentTodoSignal( Todo *,Todo * );
236 void showTodoSignal(Todo *); 246 void showTodoSignal(Todo *);
237 247
@@ -264,36 +274,36 @@ class KOTodoView : public KOrg::BaseView
264 * Korganizer keeps it in memory and we need to update 274 * Korganizer keeps it in memory and we need to update
265 * 1. make KOTodoViewItem a QObject again? 275 * 1. make KOTodoViewItem a QObject again?
266 * 2. add a public method for setting one todo modified? 276 * 2. add a public method for setting one todo modified?
267 * 3. add a private method for setting a todo modified + friend here? 277 * 3. add a private method for setting a todo modified + friend here?
268 * -- zecke 2002-07-08 278 * -- zecke 2002-07-08
269 */ 279 */
270 KOTodoViewWhatsThis* mKOTodoViewWhatsThis; 280 KOTodoViewWhatsThis* mKOTodoViewWhatsThis;
271 friend class KOTodoListView; 281 friend class KOTodoListView;
272 void paintEvent(QPaintEvent * pevent); 282 void paintEvent(QPaintEvent * pevent);
273 bool mPendingUpdateBeforeRepaint; 283 bool mPendingUpdateBeforeRepaint;
274 friend class KOTodoViewItem; 284 friend class KOTodoViewItem;
275 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); 285 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo);
276 void restoreItemState( QListViewItem * ); 286 void restoreItemState( Q3ListViewItem * );
277 287
278 bool checkTodo( Todo * ); 288 bool checkTodo( Todo * );
279 bool isFlatDisplay; 289 bool isFlatDisplay;
280 void setOpen( QListViewItem*, bool setOpen); 290 void setOpen( Q3ListViewItem*, bool setOpen);
281 KOTodoListView *mTodoListView; 291 KOTodoListView *mTodoListView;
282 QPopupMenu *mItemPopupMenu; 292 Q3PopupMenu *mItemPopupMenu;
283 QPopupMenu *mPopupMenu; 293 Q3PopupMenu *mPopupMenu;
284 QPopupMenu *mPriorityPopupMenu; 294 Q3PopupMenu *mPriorityPopupMenu;
285 QPopupMenu *mPercentageCompletedPopupMenu; 295 Q3PopupMenu *mPercentageCompletedPopupMenu;
286 QPopupMenu *mCategoryPopupMenu; 296 Q3PopupMenu *mCategoryPopupMenu;
287 QPopupMenu *mCalPopupMenu; 297 Q3PopupMenu *mCalPopupMenu;
288 298
289 QMap<int, int> mPercentage; 299 QMap<int, int> mPercentage;
290 QMap<int, int> mPriority; 300 QMap<int, int> mPriority;
291 QMap<int, QString> mCategory; 301 QMap<int, QString> mCategory;
292 KOTodoViewItem *mActiveItem; 302 KOTodoViewItem *mActiveItem;
293 303
294 QMap<Todo *,KOTodoViewItem *> mTodoMap; 304 QMap<Todo *,KOTodoViewItem *> mTodoMap;
295 QString mName; 305 QString mName;
296 QWidget* mQuickBar; 306 QWidget* mQuickBar;
297 307
298 DocPrefs *mDocPrefs; 308 DocPrefs *mDocPrefs;
299 QString mCurrentDoc; 309 QString mCurrentDoc;
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 519bb16..c21816d 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -10,40 +10,44 @@
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <klocale.h> 20#include <klocale.h>
21#include <kdebug.h> 21#include <kdebug.h>
22#include <qapp.h> 22#include <qapplication.h>
23#include <QDesktopWidget>
24//Added by qt3to4:
25#include <Q3PointArray>
26#include <QPixmap>
23#include <kglobal.h> 27#include <kglobal.h>
24 28
25#include <kiconloader.h> 29#include <kiconloader.h>
26#include "kotodoviewitem.h" 30#include "kotodoviewitem.h"
27#include "kotodoview.h" 31#include "kotodoview.h"
28#include "koprefs.h" 32#include "koprefs.h"
29 33
30KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) 34KOTodoViewItem::KOTodoViewItem( Q3ListView *parent, Todo *todo, KOTodoView *kotodo)
31 : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) 35 : Q3CheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
32{ 36{
33 construct(); 37 construct();
34} 38}
35 39
36KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) 40KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo )
37 : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) 41 : Q3CheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
38{ 42{
39 construct(); 43 construct();
40} 44}
41 45
42QString KOTodoViewItem::key(int column,bool) const 46QString KOTodoViewItem::key(int column,bool) const
43{ 47{
44 if ( column == 0 ) 48 if ( column == 0 )
45 return text(0).lower(); 49 return text(0).lower();
46 if ( column == 1 ) { 50 if ( column == 1 ) {
47 if ( mTodo->isCompleted() ) { 51 if ( mTodo->isCompleted() ) {
48 return "6"+QString::number(mTodo->priority())+text(0).lower(); 52 return "6"+QString::number(mTodo->priority())+text(0).lower();
49 } 53 }
@@ -71,25 +75,25 @@ void KOTodoViewItem:: setup()
71 setHeight( h ); 75 setHeight( h );
72 76
73} 77}
74void KOTodoViewItem::setSortKey(int column,const QString &key) 78void KOTodoViewItem::setSortKey(int column,const QString &key)
75{ 79{
76 mKeyMap.insert(column,key); 80 mKeyMap.insert(column,key);
77} 81}
78 82
79#if QT_VERSION >= 0x030000 83#if QT_VERSION >= 0x030000
80void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, 84void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w,
81 int y,int h) 85 int y,int h)
82{ 86{
83 QListViewItem::paintBranches(p,cg,w,y,h); 87 Q3ListViewItem::paintBranches(p,cg,w,y,h);
84} 88}
85#else 89#else
86#endif 90#endif
87 91
88void KOTodoViewItem::construct() 92void KOTodoViewItem::construct()
89{ 93{
90 // qDebug("KOTodoViewItem::construct() "); 94 // qDebug("KOTodoViewItem::construct() ");
91 m_init = true; 95 m_init = true;
92 QString keyd = "=="; 96 QString keyd = "==";
93 QString keyt = "=="; 97 QString keyt = "==";
94 QString skeyd = "=="; 98 QString skeyd = "==";
95 QString skeyt = "=="; 99 QString skeyt = "==";
@@ -307,34 +311,34 @@ void KOTodoViewItem::stateChange(bool state)
307 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); 311 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
308 312
309 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); 313 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete())));
310 if (mTodo->percentComplete()<100) { 314 if (mTodo->percentComplete()<100) {
311 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 315 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
312 else setSortKey(2,QString::number(mTodo->percentComplete())); 316 else setSortKey(2,QString::number(mTodo->percentComplete()));
313 } 317 }
314 else { 318 else {
315 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 319 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
316 else setSortKey(2,QString::number(99)); 320 else setSortKey(2,QString::number(99));
317 } 321 }
318 if ( state ) { 322 if ( state ) {
319 QListViewItem * myChild = firstChild(); 323 Q3ListViewItem * myChild = firstChild();
320 KOTodoViewItem *item; 324 KOTodoViewItem *item;
321 while( myChild ) { 325 while( myChild ) {
322 //qDebug("stateCH "); 326 //qDebug("stateCH ");
323 item = static_cast<KOTodoViewItem*>(myChild); 327 item = static_cast<KOTodoViewItem*>(myChild);
324 item->stateChange(state); 328 item->stateChange(state);
325 myChild = myChild->nextSibling(); 329 myChild = myChild->nextSibling();
326 } 330 }
327 } else { 331 } else {
328 QListViewItem * myChild = parent(); 332 Q3ListViewItem * myChild = parent();
329 if ( myChild ) 333 if ( myChild )
330 (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); 334 (static_cast<KOTodoViewItem*>(myChild))->stateChange(state);
331 } 335 }
332 mTodoView->modified(true); 336 mTodoView->modified(true);
333 setMyPixmap(); 337 setMyPixmap();
334 mTodoView->setTodoModified( mTodo ); 338 mTodoView->setTodoModified( mTodo );
335} 339}
336 340
337bool KOTodoViewItem::isAlternate() 341bool KOTodoViewItem::isAlternate()
338{ 342{
339#if 0 343#if 0
340 //if ( m_known ) return m_odd; 344 //if ( m_known ) return m_odd;
@@ -374,30 +378,30 @@ bool KOTodoViewItem::isAlternate()
374 //if (lv && lv->alternateBackground().isValid()) 378 //if (lv && lv->alternateBackground().isValid())
375 { 379 {
376 KOTodoViewItem *above = static_cast<KOTodoViewItem *>(itemAbove()); 380 KOTodoViewItem *above = static_cast<KOTodoViewItem *>(itemAbove());
377 m_known = above ? above->m_known : true; 381 m_known = above ? above->m_known : true;
378 if (m_known) 382 if (m_known)
379 { 383 {
380 m_odd = above ? !above->m_odd : false; 384 m_odd = above ? !above->m_odd : false;
381 } 385 }
382 else 386 else
383 { 387 {
384 KOTodoViewItem *item; 388 KOTodoViewItem *item;
385 bool previous = true; 389 bool previous = true;
386 if (QListViewItem::parent()) 390 if (Q3ListViewItem::parent())
387 { 391 {
388 item = static_cast<KOTodoViewItem *>(QListViewItem::parent()); 392 item = static_cast<KOTodoViewItem *>(Q3ListViewItem::parent());
389 if (item) 393 if (item)
390 previous = item->m_odd; 394 previous = item->m_odd;
391 item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); 395 item = static_cast<KOTodoViewItem *>(Q3ListViewItem::parent()->firstChild());
392 } 396 }
393 else 397 else
394 { 398 {
395 KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); 399 KOTodoListView *lv = static_cast<KOTodoListView *>(listView());
396 item = static_cast<KOTodoViewItem *>(lv->firstChild()); 400 item = static_cast<KOTodoViewItem *>(lv->firstChild());
397 } 401 }
398 402
399 while(item) 403 while(item)
400 { 404 {
401 item->m_odd = previous = !previous; 405 item->m_odd = previous = !previous;
402 item->m_known = true; 406 item->m_known = true;
403 item = static_cast<KOTodoViewItem *>(item->nextSibling()); 407 item = static_cast<KOTodoViewItem *>(item->nextSibling());
@@ -467,113 +471,113 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i
467 } 471 }
468 //#endif 472 //#endif
469 if ( column > 0 ){ 473 if ( column > 0 ){
470 if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) { 474 if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) {
471 p->save(); 475 p->save();
472 int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5); 476 int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5);
473 477
474 p->fillRect( 0, 0, width, height(), _cg.base() ); // background 478 p->fillRect( 0, 0, width, height(), _cg.base() ); // background
475 // p->setPen(Qt::black ); //border 479 // p->setPen(Qt::black ); //border
476 // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling 480 // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling
477 QColor fc = KOPrefs::instance()->mHighlightColor; 481 QColor fc = KOPrefs::instance()->mHighlightColor;
478 if ( mTodo->percentComplete() == 100 ) 482 if ( mTodo->percentComplete() == 100 )
479 fc = darkGreen; 483 fc = Qt::darkGreen;
480 p->drawRect( 2, 2, width-4, height()-4); 484 p->drawRect( 2, 2, width-4, height()-4);
481 p->fillRect( 3, 3, progress, height()-6, 485 p->fillRect( 3, 3, progress, height()-6,
482 fc ); 486 fc );
483 p->restore(); 487 p->restore();
484 } else { 488 } else {
485 QCheckListItem::paintCell(p, _cg, column, width, alignment); 489 Q3CheckListItem::paintCell(p, _cg, column, width, alignment);
486 } 490 }
487 return; 491 return;
488 } 492 }
489 493
490 int align = alignment; 494 int align = alignment;
491 495
492 if ( !p ) 496 if ( !p )
493 return; 497 return;
494 498
495 p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); 499 p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) );
496 500
497 QListView *lv = listView(); 501 Q3ListView *lv = listView();
498 if ( !lv ) 502 if ( !lv )
499 return; 503 return;
500 int marg = 2;//lv->itemMargin(); 504 int marg = 2;//lv->itemMargin();
501 int r = 0; 505 int r = 0;
502 QCheckListItem::Type myType = QCheckListItem::CheckBox; 506 Q3CheckListItem::Type myType = Q3CheckListItem::CheckBox;
503 int BoxSize = 20; 507 int BoxSize = 20;
504 int boxOffset = 2; 508 int boxOffset = 2;
505 int xOffset = 2; 509 int xOffset = 2;
506 if (qApp->desktop()->width() < 300 ) { 510 if (qApp->desktop()->width() < 300 ) {
507 BoxSize = 14; 511 BoxSize = 14;
508 boxOffset = -1; 512 boxOffset = -1;
509 xOffset = 1; 513 xOffset = 1;
510 // marg = 0; 514 // marg = 0;
511 } 515 }
512 if ( height() < BoxSize ) { 516 if ( height() < BoxSize ) {
513 boxOffset = boxOffset - ((BoxSize - height())/2) ; 517 boxOffset = boxOffset - ((BoxSize - height())/2) ;
514 // qDebug("boxOffset %d height %d", boxOffset, height() ); 518 // qDebug("boxOffset %d height %d", boxOffset, height() );
515 BoxSize = height(); 519 BoxSize = height();
516 520
517 } 521 }
518 //bool winStyle = lv->style() == WindowsStyle; 522 //bool winStyle = lv->style() == WindowsStyle;
519 523
520 int lineStart = 5; 524 int lineStart = 5;
521 if ( myType == Controller ) { 525 if ( myType == Controller ) {
522 if ( !pixmap( 0 ) ) 526 if ( !pixmap( 0 ) )
523 r += BoxSize + 4; 527 r += BoxSize + 4;
524 } else { 528 } else {
525 ASSERT( lv ); //### 529 Q_ASSERT( lv ); //###
526 //QFontMetrics fm( lv->font() ); 530 //QFontMetrics fm( lv->font() );
527 //int d = fm.height(); 531 //int d = fm.height();
528 int x = 0; 532 int x = 0;
529 int y = (height() - BoxSize) / 2; 533 int y = (height() - BoxSize) / 2;
530 //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) ); 534 //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) );
531 if ( myType == CheckBox ) { 535 if ( myType == CheckBox ) {
532 if ( isEnabled() ) 536 if ( isEnabled() )
533 p->setPen( QPen( _cg.text(), 1 ) ); 537 p->setPen( QPen( _cg.text(), 1 ) );
534 else 538 else
535 p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) ); 539 p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) );
536 p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 ); 540 p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 );
537 lineStart = x+marg; 541 lineStart = x+marg;
538 ///////////////////// 542 /////////////////////
539 x++; 543 x++;
540 y++; 544 y++;
541 if ( isOn() ) { 545 if ( isOn() ) {
542 QPointArray a( 7*2 ); 546 Q3PointArray a( 7*2 );
543 int i, xx, yy; 547 int i, xx, yy;
544 xx = x+xOffset+marg+(boxOffset/2); 548 xx = x+xOffset+marg+(boxOffset/2);
545 yy = y+5+boxOffset; 549 yy = y+5+boxOffset;
546 for ( i=0; i<3; i++ ) { 550 for ( i=0; i<3; i++ ) {
547 a.setPoint( 2*i, xx, yy ); 551 a.setPoint( 2*i, xx, yy );
548 a.setPoint( 2*i+1, xx, yy+2 ); 552 a.setPoint( 2*i+1, xx, yy+2 );
549 // qDebug(" "); 553 // qDebug(" ");
550 xx++; yy++; 554 xx++; yy++;
551 } 555 }
552 yy -= 2; 556 yy -= 2;
553 for ( i=3; i<7; i++ ) { 557 for ( i=3; i<7; i++ ) {
554 a.setPoint( 2*i, xx, yy ); 558 a.setPoint( 2*i, xx, yy );
555 a.setPoint( 2*i+1, xx, yy+2 ); 559 a.setPoint( 2*i+1, xx, yy+2 );
556 xx++; yy--; 560 xx++; yy--;
557 } 561 }
558 p->setPen( darkGreen ); 562 p->setPen( Qt::darkGreen );
559 p->drawLineSegments( a ); 563 p->drawLineSegments( a );
560 } 564 }
561 //////////////////////// 565 ////////////////////////
562 } 566 }
563 r += BoxSize + 4; 567 r += BoxSize + 4;
564 } 568 }
565 569
566 p->translate( r, 0 ); 570 p->translate( r, 0 );
567 p->setPen( QPen( _cg.text() ) ); 571 p->setPen( QPen( _cg.text() ) );
568 QListViewItem::paintCell( p, _cg, column, width - r, align ); 572 Q3ListViewItem::paintCell( p, _cg, column, width - r, align );
569 if ( mTodo->cancelled () ) { 573 if ( mTodo->cancelled () ) {
570 p->setPen( black ); 574 p->setPen( Qt::black );
571 QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); 575 QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() );
572 int wid = br.width() +lineStart; 576 int wid = br.width() +lineStart;
573 if ( wid > width-3 ) 577 if ( wid > width-3 )
574 wid = width-3; 578 wid = width-3;
575 p->drawLine( lineStart, height()/2+1, wid, height()/2+1 ); 579 p->drawLine( lineStart, height()/2+1, wid, height()/2+1 );
576 580
577 } 581 }
578 582
579} 583}
diff --git a/korganizer/kotodoviewitem.h b/korganizer/kotodoviewitem.h
index bd024c8..62a635c 100644
--- a/korganizer/kotodoviewitem.h
+++ b/korganizer/kotodoviewitem.h
@@ -13,57 +13,57 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19#ifndef KOTODOVIEWITEM_H 19#ifndef KOTODOVIEWITEM_H
20#define KOTODOVIEWITEM_H 20#define KOTODOVIEWITEM_H
21 21
22#include <qfont.h> 22#include <qfont.h>
23#include <qfontmetrics.h> 23#include <qfontmetrics.h>
24#include <qlineedit.h> 24#include <qlineedit.h>
25#include <qptrlist.h> 25#include <q3ptrlist.h>
26#include <qstrlist.h> 26#include <q3strlist.h>
27#include <qlistbox.h> 27#include <q3listbox.h>
28#include <qpopupmenu.h> 28#include <q3popupmenu.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qmap.h> 30#include <qmap.h>
31#include <qlistview.h> 31#include <q3listview.h>
32#include <qpainter.h> 32#include <qpainter.h>
33 33
34#include <libkcal/calendar.h> 34#include <libkcal/calendar.h>
35#include <libkcal/todo.h> 35#include <libkcal/todo.h>
36 36
37using namespace KCal; 37using namespace KCal;
38 38
39class KOTodoView; 39class KOTodoView;
40 40
41/** 41/**
42 This class provides a way of displaying a single Event of Todo-Type in a 42 This class provides a way of displaying a single Event of Todo-Type in a
43 KTodoView. 43 KTodoView.
44 44
45 @author Cornelius Schumacher <schumacher@kde.org> 45 @author Cornelius Schumacher <schumacher@kde.org>
46 @see KOTodoView 46 @see KOTodoView
47*/ 47*/
48class KOTodoViewItem : public QCheckListItem 48class KOTodoViewItem : public Q3CheckListItem
49{ 49{
50 public: 50 public:
51 /** 51 /**
52 Constructor. 52 Constructor.
53 53
54 @param parent is the list view to which this item belongs. 54 @param parent is the list view to which this item belongs.
55 @param ev is the event to have the item display information for. 55 @param ev is the event to have the item display information for.
56 */ 56 */
57 KOTodoViewItem(QListView *parent, Todo *todo, KOTodoView *kotodo); 57 KOTodoViewItem(Q3ListView *parent, Todo *todo, KOTodoView *kotodo);
58 KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo); 58 KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo);
59 //~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );} 59 //~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );}
60 60
61 void construct(); 61 void construct();
62 62
63 Todo *todo() { return mTodo; } 63 Todo *todo() { return mTodo; }
64 64
65 QString key(int, bool) const; 65 QString key(int, bool) const;
66 66
67 void setSortKey(int column,const QString &key); 67 void setSortKey(int column,const QString &key);
68 68
69 bool isAlternate(); 69 bool isAlternate();
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 4057ae0..07c4295 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -14,25 +14,27 @@
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
15 GNU General Public License for more details. 15 GNU General Public License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 20
21 As a special exception, permission is given to link this program 21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25 25
26#include <qwidgetstack.h> 26#include <q3widgetstack.h>
27//Added by qt3to4:
28#include <Q3PtrList>
27 29
28#include <kconfig.h> 30#include <kconfig.h>
29#include <kglobal.h> 31#include <kglobal.h>
30#ifndef DESKTOP_VERSION 32#ifndef DESKTOP_VERSION
31#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
32#else 34#else
33#include <qapplication.h> 35#include <qapplication.h>
34#endif 36#endif
35#include <qdatetime.h> 37#include <qdatetime.h>
36#include "calendarview.h" 38#include "calendarview.h"
37#include "datenavigator.h" 39#include "datenavigator.h"
38#include "kotodoview.h" 40#include "kotodoview.h"
@@ -448,26 +450,26 @@ void KOViewManager::showListView()
448 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 450 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
449 connect( mListView, SIGNAL( signalNewEvent() ), 451 connect( mListView, SIGNAL( signalNewEvent() ),
450 mMainView, SLOT( newEvent() ) ); 452 mMainView, SLOT( newEvent() ) );
451 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); 453 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig()));
452 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 454 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
453 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 455 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
454 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 456 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
455 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 457 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
456 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 458 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
457 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 459 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
458 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 460 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
459 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 461 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
460 connect( mListView, SIGNAL( beamIncidenceList( QPtrList<Incidence> ) ), 462 connect( mListView, SIGNAL( beamIncidenceList( Q3PtrList<Incidence> ) ),
461 mMainView, SLOT ( beamIncidenceList( QPtrList<Incidence> ) ) ); 463 mMainView, SLOT ( beamIncidenceList( Q3PtrList<Incidence> ) ) );
462 } 464 }
463 // bool temp = mFlagShowNextxDays; 465 // bool temp = mFlagShowNextxDays;
464 //globalFlagBlockPainting = true; 466 //globalFlagBlockPainting = true;
465 globalFlagBlockAgenda = 1; 467 globalFlagBlockAgenda = 1;
466 if ( KOPrefs::instance()->mListViewMonthTimespan ) { 468 if ( KOPrefs::instance()->mListViewMonthTimespan ) {
467 mMainView->setBlockShowDates( true ); 469 mMainView->setBlockShowDates( true );
468 mMainView->dateNavigator()->selectMonth(); 470 mMainView->dateNavigator()->selectMonth();
469 mMainView->setBlockShowDates( false ); 471 mMainView->setBlockShowDates( false );
470 } 472 }
471 KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; 473 KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW;
472 showView(mListView, KOPrefs::instance()->mFullViewTodo); 474 showView(mListView, KOPrefs::instance()->mFullViewTodo);
473 //mFlagShowNextxDays = temp; 475 //mFlagShowNextxDays = temp;
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index f88403c..bfe930f 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -9,79 +9,85 @@
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <qlayout.h> 20#include <qlayout.h>
21#include <qtextbrowser.h> 21#include <q3textbrowser.h>
22#include <qtextcodec.h> 22#include <qtextcodec.h>
23#include <qfileinfo.h> 23#include <qfileinfo.h>
24#include <qlabel.h> 24#include <qlabel.h>
25 25
26#include <qapplication.h> 26#include <qapplication.h>
27#include <QDesktopWidget>
27#ifdef DESKTOP_VERSION 28#ifdef DESKTOP_VERSION
28#include <qpaintdevicemetrics.h> 29#include <q3paintdevicemetrics.h>
30//Added by qt3to4:
31#include <Q3PtrList>
32#include <QHideEvent>
33#include <Q3VBoxLayout>
34#include <QShowEvent>
29#endif 35#endif
30#include <kglobal.h> 36#include <kglobal.h>
31#include <klocale.h> 37#include <klocale.h>
32#include <kdebug.h> 38#include <kdebug.h>
33#include <kiconloader.h> 39#include <kiconloader.h>
34#include <kmessagebox.h> 40#include <kmessagebox.h>
35 41
36#include <libkcal/calendar.h> 42#include <libkcal/calendar.h>
37 43
38#ifndef KORG_NOPRINTER 44#ifndef KORG_NOPRINTER
39#include "calprinter.h" 45#include "calprinter.h"
40#endif 46#endif
41#include "koglobals.h" 47#include "koglobals.h"
42#include "koprefs.h" 48#include "koprefs.h"
43#include "koeventviewerdialog.h" 49#include "koeventviewerdialog.h"
44#include "koeventviewer.h" 50#include "koeventviewer.h"
45#include <qstylesheet.h> 51#include <q3stylesheet.h>
46#include "kowhatsnextview.h" 52#include "kowhatsnextview.h"
47using namespace KOrg; 53using namespace KOrg;
48 54
49void WhatsNextTextBrowser::setSource(const QString& n) 55void WhatsNextTextBrowser::setSource(const QString& n)
50{ 56{
51 57
52 if (n.startsWith("event:")) { 58 if (n.startsWith("event:")) {
53 emit showIncidence(n); 59 emit showIncidence(n);
54 return; 60 return;
55 } else if (n.startsWith("todo:")) { 61 } else if (n.startsWith("todo:")) {
56 emit showIncidence(n); 62 emit showIncidence(n);
57 return; 63 return;
58 } else { 64 } else {
59 QTextBrowser::setSource(n); 65 Q3TextBrowser::setSource(n);
60 } 66 }
61} 67}
62void WhatsNextTextBrowser::printMe() 68void WhatsNextTextBrowser::printMe()
63{ 69{
64#ifdef DESKTOP_VERSION 70#ifdef DESKTOP_VERSION
65 KOPrintPrefs pp ( this ); 71 KOPrintPrefs pp ( this );
66 if (!pp.exec() ) 72 if (!pp.exec() )
67 return; 73 return;
68 int scaleval = pp.printMode() ; 74 int scaleval = pp.printMode() ;
69 75
70 QPrinter printer; 76 QPrinter printer;
71 if (!printer.setup() ) 77 if (!printer.setup() )
72 return; 78 return;
73 QPainter p; 79 QPainter p;
74 p.begin ( &printer ); 80 p.begin ( &printer );
75 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 81 Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
76 float dx, dy; 82 float dx, dy;
77 int wid = (m.width() * 9)/10; 83 int wid = (m.width() * 9)/10;
78 dx = (float) wid/(float)contentsWidth (); 84 dx = (float) wid/(float)contentsWidth ();
79 dy = (float)(m.height()) / (float)contentsHeight (); 85 dy = (float)(m.height()) / (float)contentsHeight ();
80 float scale; 86 float scale;
81 // scale to fit the width or height of the paper 87 // scale to fit the width or height of the paper
82 if ( dx < dy ) 88 if ( dx < dy )
83 scale = dx; 89 scale = dx;
84 else 90 else
85 scale = dy; 91 scale = dy;
86 p.translate( m.width()/10,0 ); 92 p.translate( m.width()/10,0 );
87 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) { 93 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
@@ -94,37 +100,37 @@ void WhatsNextTextBrowser::printMe()
94 100
95KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, 101KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent,
96 const char *name) 102 const char *name)
97 : KOrg::BaseView(calendar, parent, name) 103 : KOrg::BaseView(calendar, parent, name)
98{ 104{
99 // mDateLabel = 105 // mDateLabel =
100 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); 106 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this);
101 // mDateLabel->setMargin(2); 107 // mDateLabel->setMargin(2);
102 // mDateLabel->setAlignment(AlignCenter); 108 // mDateLabel->setAlignment(AlignCenter);
103 setFont( KOPrefs::instance()->mWhatsNextFont ); 109 setFont( KOPrefs::instance()->mWhatsNextFont );
104 mView = new WhatsNextTextBrowser(this); 110 mView = new WhatsNextTextBrowser(this);
105 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); 111 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &)));
106 QStyleSheet* stsh = mView->styleSheet(); 112 Q3StyleSheet* stsh = mView->styleSheet();
107 QStyleSheetItem * style ; 113 Q3StyleSheetItem * style ;
108 style = stsh->item ("h2" ); 114 style = stsh->item ("h2" );
109 if ( style ) { 115 if ( style ) {
110 style->setMargin(QStyleSheetItem::MarginAll,0); 116 style->setMargin(Q3StyleSheetItem::MarginAll,0);
111 } 117 }
112 style = stsh->item ("h3" ); 118 style = stsh->item ("h3" );
113 if ( style ) { 119 if ( style ) {
114 style->setMargin(QStyleSheetItem::MarginAll,0); 120 style->setMargin(Q3StyleSheetItem::MarginAll,0);
115 } 121 }
116 mEventViewer = 0; 122 mEventViewer = 0;
117 123
118 QBoxLayout *topLayout = new QVBoxLayout(this); 124 Q3BoxLayout *topLayout = new Q3VBoxLayout(this);
119 // topLayout->addWidget(mDateLabel); 125 // topLayout->addWidget(mDateLabel);
120 topLayout->addWidget(mView); 126 topLayout->addWidget(mView);
121 mTimer = new QTimer( this ); 127 mTimer = new QTimer( this );
122 connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); 128 connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView()));
123 129
124 connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); 130 connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
125 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); 131 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
126} 132}
127 133
128KOWhatsNextView::~KOWhatsNextView() 134KOWhatsNextView::~KOWhatsNextView()
129{ 135{
130} 136}
@@ -135,27 +141,27 @@ int KOWhatsNextView::maxDatesHint()
135} 141}
136 142
137int KOWhatsNextView::currentDateCount() 143int KOWhatsNextView::currentDateCount()
138{ 144{
139 return 0; 145 return 0;
140} 146}
141 147
142void KOWhatsNextView::clearList() 148void KOWhatsNextView::clearList()
143{ 149{
144 mTimer->stop(); 150 mTimer->stop();
145 mView->setText(" "); 151 mView->setText(" ");
146} 152}
147QPtrList<Incidence> KOWhatsNextView::selectedIncidences() 153Q3PtrList<Incidence> KOWhatsNextView::selectedIncidences()
148{ 154{
149 QPtrList<Incidence> eventList; 155 Q3PtrList<Incidence> eventList;
150 156
151 return eventList; 157 return eventList;
152} 158}
153 159
154void KOWhatsNextView::printMe() 160void KOWhatsNextView::printMe()
155{ 161{
156#ifdef DESKTOP_VERSION 162#ifdef DESKTOP_VERSION
157 mView->printMe(); 163 mView->printMe();
158#endif 164#endif
159} 165}
160void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd, 166void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd,
161 const QDate &td) 167 const QDate &td)
@@ -210,26 +216,26 @@ void KOWhatsNextView::updateView()
210 // mText += "<img src=\""; 216 // mText += "<img src=\"";
211 // mText += ipath; 217 // mText += ipath;
212 // mText += "\">"; 218 // mText += "\">";
213 mEventDate = QDate::currentDate(); 219 mEventDate = QDate::currentDate();
214#ifdef DESKTOP_VERSION 220#ifdef DESKTOP_VERSION
215 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>"; 221 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>";
216#else 222#else
217 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; 223 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>";
218#endif 224#endif
219 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; 225 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>";
220 int iii; 226 int iii;
221 mTodos.clear(); 227 mTodos.clear();
222 QPtrList<Event> events; 228 Q3PtrList<Event> events;
223 QPtrList<Todo> todos = calendar()->todos(); 229 Q3PtrList<Todo> todos = calendar()->todos();
224 Todo * todo; 230 Todo * todo;
225 //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; 231 //mText += "<h2>" + i18n("Events: ") + "</h2>\n";
226 int daysToShow = KOPrefs::instance()->mWhatsNextDays ; 232 int daysToShow = KOPrefs::instance()->mWhatsNextDays ;
227 bool itemAdded = false; 233 bool itemAdded = false;
228 for ( iii = 0; iii < daysToShow; ++iii ) { 234 for ( iii = 0; iii < daysToShow; ++iii ) {
229 QString date; 235 QString date;
230 itemAdded = false; 236 itemAdded = false;
231 events = calendar()->events( mEventDate, true ); 237 events = calendar()->events( mEventDate, true );
232 238
233 if ( iii == 0 ) { // today !!! 239 if ( iii == 0 ) { // today !!!
234 todo = todos.first(); 240 todo = todos.first();
235 while(todo) { 241 while(todo) {
@@ -445,25 +451,25 @@ void KOWhatsNextView::appendDay( int i, QDate eventDate )
445 mText += "<h2>" + date + "</h2>\n"; 451 mText += "<h2>" + date + "</h2>\n";
446 //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; 452 //mText += "<big><big><strong>" + date + "</strong></big></big>\n";
447 mText += "<table>\n"; 453 mText += "<table>\n";
448 } 454 }
449} 455}
450 456
451 457
452void KOWhatsNextView::showDates(const QDate &, const QDate &) 458void KOWhatsNextView::showDates(const QDate &, const QDate &)
453{ 459{
454 updateView(); 460 updateView();
455} 461}
456 462
457void KOWhatsNextView::showEvents(QPtrList<Event>) 463void KOWhatsNextView::showEvents(Q3PtrList<Event>)
458{ 464{
459} 465}
460 466
461void KOWhatsNextView::changeEventDisplay(Event *, int action) 467void KOWhatsNextView::changeEventDisplay(Event *, int action)
462{ 468{
463 switch(action) { 469 switch(action) {
464 case KOGlobals::EVENTADDED: 470 case KOGlobals::EVENTADDED:
465 updateView(); 471 updateView();
466 break; 472 break;
467 case KOGlobals::EVENTEDITED: 473 case KOGlobals::EVENTEDITED:
468 updateView(); 474 updateView();
469 break; 475 break;
@@ -732,25 +738,25 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
732 if ( KOPrefs::instance()->mWNViewShowLocation ) 738 if ( KOPrefs::instance()->mWNViewShowLocation )
733 if ( !ev->location().isEmpty() ) 739 if ( !ev->location().isEmpty() )
734 mText += " ("+ev->location() +")"; 740 mText += " ("+ev->location() +")";
735 if ( !isSub ) { 741 if ( !isSub ) {
736 if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents) 742 if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents)
737 mText += " ["+ev->relatedTo()->summary() +"]"; 743 mText += " ["+ev->relatedTo()->summary() +"]";
738 mText += "</p>\n"; 744 mText += "</p>\n";
739 } 745 }
740 else { 746 else {
741 ind += "-"; 747 ind += "-";
742 mText += "</li>\n"; 748 mText += "</li>\n";
743 } 749 }
744 QPtrList<Incidence> Relations = ev->relations(); 750 Q3PtrList<Incidence> Relations = ev->relations();
745 Incidence *to; 751 Incidence *to;
746 for (to=Relations.first();to;to=Relations.next()) { 752 for (to=Relations.first();to;to=Relations.next()) {
747 if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio ) 753 if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio )
748 appendTodo( to, ind , true ); 754 appendTodo( to, ind , true );
749 } 755 }
750 756
751 return true; 757 return true;
752} 758}
753 759
754/* 760/*
755 void KOWhatsNextView::createEventViewer() 761 void KOWhatsNextView::createEventViewer()
756 { 762 {
diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h
index 93574ef..49fc448 100644
--- a/korganizer/kowhatsnextview.h
+++ b/korganizer/kowhatsnextview.h
@@ -10,76 +10,82 @@
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19#ifndef KOWHATSNEXTVIEW_H 19#ifndef KOWHATSNEXTVIEW_H
20#define KOWHATSNEXTVIEW_H 20#define KOWHATSNEXTVIEW_H
21 21
22#include <qtextbrowser.h> 22#include <q3textbrowser.h>
23#include <qtimer.h> 23#include <qtimer.h>
24//Added by qt3to4:
25#include <QShowEvent>
26#include <QHideEvent>
27#include <QLabel>
28#include <Q3ValueList>
29#include <Q3PtrList>
24 30
25#include <korganizer/baseview.h> 31#include <korganizer/baseview.h>
26 32
27class QListView; 33class Q3ListView;
28class QLabel; 34class QLabel;
29 35
30class KOEventViewerDialog; 36class KOEventViewerDialog;
31 37
32#include <qpainter.h> 38#include <qpainter.h>
33#include <qwidget.h> 39#include <qwidget.h>
34class WhatsNextTextBrowser : public QTextBrowser { 40class WhatsNextTextBrowser : public Q3TextBrowser {
35 Q_OBJECT 41 Q_OBJECT
36 public: 42 public:
37 WhatsNextTextBrowser(QWidget *parent) : QTextBrowser(parent) {}; 43 WhatsNextTextBrowser(QWidget *parent) : Q3TextBrowser(parent) {};
38 44
39 void setSource(const QString &); 45 void setSource(const QString &);
40 void printMe(); 46 void printMe();
41 47
42 signals: 48 signals:
43 void showIncidence(const QString &uid); 49 void showIncidence(const QString &uid);
44}; 50};
45 51
46 52
47/** 53/**
48 This class provides a view of the next events and todos 54 This class provides a view of the next events and todos
49*/ 55*/
50class KOWhatsNextView : public KOrg::BaseView 56class KOWhatsNextView : public KOrg::BaseView
51{ 57{
52 Q_OBJECT 58 Q_OBJECT
53 public: 59 public:
54 KOWhatsNextView(Calendar *calendar, QWidget *parent = 0, 60 KOWhatsNextView(Calendar *calendar, QWidget *parent = 0,
55 const char *name = 0); 61 const char *name = 0);
56 ~KOWhatsNextView(); 62 ~KOWhatsNextView();
57 63
58 virtual int maxDatesHint(); 64 virtual int maxDatesHint();
59 virtual int currentDateCount(); 65 virtual int currentDateCount();
60 void setEventViewer(KOEventViewerDialog* v ); 66 void setEventViewer(KOEventViewerDialog* v );
61 virtual QPtrList<Incidence> selectedIncidences(); 67 virtual Q3PtrList<Incidence> selectedIncidences();
62 void clearList(); 68 void clearList();
63 DateList selectedDates() 69 DateList selectedDates()
64 {DateList q; 70 {DateList q;
65 return q;} 71 return q;}
66 virtual void printPreview(CalPrinter *calPrinter, 72 virtual void printPreview(CalPrinter *calPrinter,
67 const QDate &, const QDate &); 73 const QDate &, const QDate &);
68 74
69 public slots: 75 public slots:
70 virtual void updateView(); 76 virtual void updateView();
71 void printMe(); 77 void printMe();
72 virtual void showDates(const QDate &start, const QDate &end); 78 virtual void showDates(const QDate &start, const QDate &end);
73 virtual void showEvents(QPtrList<Event> eventList); 79 virtual void showEvents(Q3PtrList<Event> eventList);
74 void updateConfig(); 80 void updateConfig();
75 void changeEventDisplay(Event *, int); 81 void changeEventDisplay(Event *, int);
76 82
77 protected: 83 protected:
78 bool appendEvent(Incidence *, bool reply=false, bool notRed = true, bool appendTable = false); 84 bool appendEvent(Incidence *, bool reply=false, bool notRed = true, bool appendTable = false);
79 bool appendTodo(Incidence *, QString ind = "", bool isSub = false ); 85 bool appendTodo(Incidence *, QString ind = "", bool isSub = false );
80 void appendDay( int i, QDate date ); 86 void appendDay( int i, QDate date );
81 QDate mEventDate; 87 QDate mEventDate;
82 virtual void showEvent ( QShowEvent * ); 88 virtual void showEvent ( QShowEvent * );
83 virtual void hideEvent ( QHideEvent * ); 89 virtual void hideEvent ( QHideEvent * );
84 90
85 private slots: 91 private slots:
@@ -87,16 +93,16 @@ class KOWhatsNextView : public KOrg::BaseView
87 void restartTimer(); 93 void restartTimer();
88 94
89 95
90 private: 96 private:
91 int mCurrentMaxPrio; 97 int mCurrentMaxPrio;
92 //void createEventViewer(); 98 //void createEventViewer();
93 QTimer* mTimer; 99 QTimer* mTimer;
94 WhatsNextTextBrowser *mView; 100 WhatsNextTextBrowser *mView;
95 QString mText; 101 QString mText;
96 // QLabel *mDateLabel; 102 // QLabel *mDateLabel;
97 KOEventViewerDialog *mEventViewer; 103 KOEventViewerDialog *mEventViewer;
98 104
99 QValueList<Incidence *> mTodos; 105 Q3ValueList<Incidence *> mTodos;
100}; 106};
101 107
102#endif 108#endif
diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp
index df9b2fc..e2ae4a6 100644
--- a/korganizer/ktimeedit.cpp
+++ b/korganizer/ktimeedit.cpp
@@ -12,73 +12,76 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qkeycode.h> 24#include <qnamespace.h>
25#include <qcombobox.h> 25#include <qcombobox.h>
26#include <qdatetime.h> 26#include <qdatetime.h>
27#include <qlineedit.h> 27#include <qlineedit.h>
28#include <qlistbox.h> 28#include <q3listbox.h>
29#include <qapplication.h> 29#include <qapplication.h>
30#include <QDesktopWidget>
31//Added by qt3to4:
32#include <QKeyEvent>
30 33
31#include <kmessagebox.h> 34#include <kmessagebox.h>
32#include <kglobal.h> 35#include <kglobal.h>
33#include <kdebug.h> 36#include <kdebug.h>
34#include <klocale.h> 37#include <klocale.h>
35#include <kpimglobalprefs.h> 38#include <kpimglobalprefs.h>
36 39
37#include "ktimeedit.h" 40#include "ktimeedit.h"
38#include "koprefs.h" 41#include "koprefs.h"
39#include <qvalidator.h> 42#include <qvalidator.h>
40 43
41// Validator for a time value with only hours and minutes (no seconds) 44// Validator for a time value with only hours and minutes (no seconds)
42// Mostly locale aware. Author: David Faure <faure@kde.org> 45// Mostly locale aware. Author: David Faure <faure@kde.org>
43 46
44// KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox. 47// KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox.
45// Difficult to get all in one... 48// Difficult to get all in one...
46// But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help. 49// But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help.
47KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) 50KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name)
48 : QComboBox(TRUE, parent, name) 51 : Q3ComboBox(TRUE, parent, name)
49{ 52{
50 setInsertionPolicy(NoInsertion); 53 setInsertionPolicy(NoInsertion);
51 mFlagKeyPressed = false; 54 mFlagKeyPressed = false;
52 if ( QApplication::desktop()->height() <= 480 ) { 55 if ( QApplication::desktop()->height() <= 480 ) {
53 setSizeLimit ( 6 ); 56 setSizeLimit ( 6 );
54 } else { 57 } else {
55 setSizeLimit ( 12 ); 58 setSizeLimit ( 12 );
56 } 59 }
57 mTime = qt; 60 mTime = qt;
58 61
59// mNoTimeString = i18n("No Time"); 62// mNoTimeString = i18n("No Time");
60// insertItem( mNoTimeString ); 63// insertItem( mNoTimeString );
61 64
62 // Fill combo box with selection of times in localized format. 65 // Fill combo box with selection of times in localized format.
63 QTime timeEntry(0,0,0); 66 QTime timeEntry(0,0,0);
64 do { 67 do {
65 insertItem(KGlobal::locale()->formatTime(timeEntry)); 68 insertItem(KGlobal::locale()->formatTime(timeEntry));
66 timeEntry = timeEntry.addSecs(60*15); 69 timeEntry = timeEntry.addSecs(60*15);
67 } while (!timeEntry.isNull()); 70 } while ( !( timeEntry.hour() || timeEntry.minute() ) );
68 // Add end of day. 71 // Add end of day.
69 insertItem( KGlobal::locale()->formatTime( QTime( 23, 59, 59 ) ) ); 72 insertItem( KGlobal::locale()->formatTime( QTime( 23, 59, 59 ) ) );
70 73
71 updateText(); 74 updateText();
72 setFocusPolicy(QWidget::StrongFocus); 75 setFocusPolicy(Qt::StrongFocus);
73 76
74 connect(this, SIGNAL(activated(int)), this, SLOT(activ(int))); 77 connect(this, SIGNAL(activated(int)), this, SLOT(activ(int)));
75 connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int))); 78 connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int)));
76 connect(this,SIGNAL(textChanged(const QString&)),this,SLOT(changedText())); 79 connect(this,SIGNAL(textChanged(const QString&)),this,SLOT(changedText()));
77 QFontMetrics fm ( font() ); 80 QFontMetrics fm ( font() );
78 QString timeString = "24:00"; 81 QString timeString = "24:00";
79 if ( KPimGlobalPrefs::instance()->mPreferredTime == 1 ) 82 if ( KPimGlobalPrefs::instance()->mPreferredTime == 1 )
80 timeString = "02:00pm"; 83 timeString = "02:00pm";
81 int addSpace = 32; 84 int addSpace = 32;
82 if ( QApplication::desktop()->width() > 320 ) 85 if ( QApplication::desktop()->width() > 320 )
83 timeString += ":00"; 86 timeString += ":00";
84 setFixedWidth(fm.width( timeString ) + 32 ); 87 setFixedWidth(fm.width( timeString ) + 32 );
@@ -199,42 +202,42 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e)
199 qApp->processEvents(); 202 qApp->processEvents();
200 bool hour12Format = ( KPimGlobalPrefs::instance()->mPreferredTime == 1 ); 203 bool hour12Format = ( KPimGlobalPrefs::instance()->mPreferredTime == 1 );
201 int maxpos = hour12Format?7:5; 204 int maxpos = hour12Format?7:5;
202 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 205 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
203 e->ignore(); 206 e->ignore();
204 // qDebug(" ignore %d",e->isAutoRepeat() ); 207 // qDebug(" ignore %d",e->isAutoRepeat() );
205 return; 208 return;
206 } 209 }
207 if (! e->isAutoRepeat() ) { 210 if (! e->isAutoRepeat() ) {
208 mFlagKeyPressed = true; 211 mFlagKeyPressed = true;
209 } 212 }
210 // Tap -> Focus Next Widget 213 // Tap -> Focus Next Widget
211 if ( e->key() == Key_Tab ) { 214 if ( e->key() == Qt::Key_Tab ) {
212 QComboBox::keyPressEvent(e); 215 Q3ComboBox::keyPressEvent(e);
213 return; 216 return;
214 } 217 }
215 218
216 // save Text from QLineEdit and CursorPosition 219 // save Text from QLineEdit and CursorPosition
217 QString text = lineEdit()->text(); 220 QString text = lineEdit()->text();
218 int cpos = lineEdit()->cursorPosition(); 221 int cpos = lineEdit()->cursorPosition();
219 // qDebug("cpos %d ", cpos); 222 // qDebug("cpos %d ", cpos);
220 223
221 // Switch for arrows, backspace and escape 224 // Switch for arrows, backspace and escape
222 switch(e->key()) { 225 switch(e->key()) {
223 case Key_Escape: 226 case Qt::Key_Escape:
224 lineEdit()->deselect(); 227 lineEdit()->deselect();
225 case Key_Tab: 228 case Qt::Key_Tab:
226 QComboBox::keyPressEvent(e); 229 Q3ComboBox::keyPressEvent(e);
227 break; 230 break;
228 case Key_Up: 231 case Qt::Key_Up:
229 if ( e->state () == Qt::ControlButton ) { 232 if ( e->state () == Qt::ControlButton ) {
230 addTime(QTime(0,15,0), false ); 233 addTime(QTime(0,15,0), false );
231 lineEdit()->setCursorPosition(3); 234 lineEdit()->setCursorPosition(3);
232 setSelect( 3 , 2 ); 235 setSelect( 3 , 2 );
233 } 236 }
234 else 237 else
235 if ( e->state () == Qt::ShiftButton ) { 238 if ( e->state () == Qt::ShiftButton ) {
236 addTime(QTime(1,0,0), false ); 239 addTime(QTime(1,0,0), false );
237 lineEdit()->setCursorPosition(0); 240 lineEdit()->setCursorPosition(0);
238 setSelect( 0 , 2 ); 241 setSelect( 0 , 2 );
239 } 242 }
240 else 243 else
@@ -258,25 +261,25 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e)
258 addTime(QTime(0,10,0), false ); 261 addTime(QTime(0,10,0), false );
259 setSelect ( cpos , 1 ); 262 setSelect ( cpos , 1 );
260 break; 263 break;
261 case 2: 264 case 2:
262 lineEdit()->setCursorPosition(--cpos); 265 lineEdit()->setCursorPosition(--cpos);
263 case 1: 266 case 1:
264 case 0: 267 case 0:
265 addTime(QTime(1,0,0), false ); 268 addTime(QTime(1,0,0), false );
266 setSelect ( 0, 2 ); 269 setSelect ( 0, 2 );
267 break; 270 break;
268 } 271 }
269 break; 272 break;
270 case Key_Down: 273 case Qt::Key_Down:
271 if ( e->state () == Qt::ControlButton ) { 274 if ( e->state () == Qt::ControlButton ) {
272 subTime(QTime(0,15,0), false ); 275 subTime(QTime(0,15,0), false );
273 lineEdit()->setCursorPosition(3); 276 lineEdit()->setCursorPosition(3);
274 setSelect( 3 , 2 ); 277 setSelect( 3 , 2 );
275 } 278 }
276 else 279 else
277 if ( e->state () == Qt::ShiftButton ) { 280 if ( e->state () == Qt::ShiftButton ) {
278 subTime(QTime(1,0,0), false ); 281 subTime(QTime(1,0,0), false );
279 lineEdit()->setCursorPosition(0); 282 lineEdit()->setCursorPosition(0);
280 setSelect( 0 , 2 ); 283 setSelect( 0 , 2 );
281 } 284 }
282 else 285 else
@@ -301,146 +304,146 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e)
301 setSelect ( cpos , 1 ); 304 setSelect ( cpos , 1 );
302 break; 305 break;
303 case 2: 306 case 2:
304 lineEdit()->setCursorPosition(--cpos); 307 lineEdit()->setCursorPosition(--cpos);
305 case 1: 308 case 1:
306 case 0: 309 case 0:
307 subTime(QTime(1,0,0), false ); 310 subTime(QTime(1,0,0), false );
308 setSelect ( 0 , 2 ); 311 setSelect ( 0 , 2 );
309 break; 312 break;
310 } 313 }
311 break; 314 break;
312 // set cursor to correct place 315 // set cursor to correct place
313 case Key_Left: 316 case Qt::Key_Left:
314 if ( cpos == 3 ) 317 if ( cpos == 3 )
315 --cpos; 318 --cpos;
316 if ( cpos > 0) { 319 if ( cpos > 0) {
317 lineEdit()->setCursorPosition(--cpos); 320 lineEdit()->setCursorPosition(--cpos);
318 setSelect ( cpos , 1 ); 321 setSelect ( cpos , 1 );
319 } 322 }
320 else 323 else
321 setSelect ( 0 , 1 ); 324 setSelect ( 0 , 1 );
322 break; 325 break;
323 // set cursor to correct place 326 // set cursor to correct place
324 case Key_Right: 327 case Qt::Key_Right:
325 if ( cpos == 1 ) 328 if ( cpos == 1 )
326 ++cpos; 329 ++cpos;
327 if ( cpos < maxpos ) { 330 if ( cpos < maxpos ) {
328 lineEdit()->setCursorPosition(++cpos); 331 lineEdit()->setCursorPosition(++cpos);
329 setSelect ( cpos , 1 ); 332 setSelect ( cpos , 1 );
330 } 333 }
331 break; 334 break;
332 // rest 335 // rest
333 case Key_Prior: 336 case Qt::Key_Prior:
334 subTime(QTime(1,0,0)); 337 subTime(QTime(1,0,0));
335 break; 338 break;
336 case Key_Next: 339 case Qt::Key_Next:
337 addTime(QTime(1,0,0)); 340 addTime(QTime(1,0,0));
338 break; 341 break;
339 case Key_Backspace: 342 case Qt::Key_Backspace:
340 if ( cpos > 0) { 343 if ( cpos > 0) {
341 if ( cpos == 3 ) 344 if ( cpos == 3 )
342 --cpos; 345 --cpos;
343 if ( cpos > 5) 346 if ( cpos > 5)
344 cpos = 5; 347 cpos = 5;
345 text.at( cpos-1 ) = '0'; 348 text[ cpos-1 ] = '0';
346 lineEdit()->setText( text ); 349 lineEdit()->setText( text );
347 lineEdit()->setCursorPosition(--cpos); 350 lineEdit()->setCursorPosition(--cpos);
348 setSelect ( cpos , 1 ); 351 setSelect ( cpos , 1 );
349 changedText(); 352 changedText();
350 } 353 }
351 break; 354 break;
352 } // switch arrows 355 } // switch arrows
353 356
354 // if cursor at string end, alltext market and keyEvent don't ArrowLeft -> deselect and cpos 357 // if cursor at string end, alltext market and keyEvent don't ArrowLeft -> deselect and cpos
355 if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Key_Left ) { 358 if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Qt::Key_Left ) {
356 lineEdit()->deselect(); 359 lineEdit()->deselect();
357 cpos = 0; 360 cpos = 0;
358 lineEdit()->setCursorPosition(cpos); 361 lineEdit()->setCursorPosition(cpos);
359 setSelect(cpos , 1); 362 setSelect(cpos , 1);
360 } 363 }
361 364
362 if ( cpos == 2 ) { 365 if ( cpos == 2 ) {
363 lineEdit()->setCursorPosition(++cpos); 366 lineEdit()->setCursorPosition(++cpos);
364 } 367 }
365 368
366 // num keys when cursorPos preEnd 369 // num keys when cursorPos preEnd
367 if ( cpos < 5 ) { 370 if ( cpos < 5 ) {
368 // switch another keys 371 // switch another keys
369 switch(e->key()) { 372 switch(e->key()) {
370 case Key_Delete: 373 case Qt::Key_Delete:
371 text.at( cpos ) = '0'; 374 text[ cpos ] = '0';
372 lineEdit()->setText( text ); 375 lineEdit()->setText( text );
373 lineEdit()->setCursorPosition(cpos); 376 lineEdit()->setCursorPosition(cpos);
374 setSelect ( cpos , 1 ); 377 setSelect ( cpos , 1 );
375 changedText(); 378 changedText();
376 break; 379 break;
377 case Key_9: 380 case Qt::Key_9:
378 case Key_8: 381 case Qt::Key_8:
379 case Key_7: 382 case Qt::Key_7:
380 case Key_6: 383 case Qt::Key_6:
381 if ( !(cpos == 1 || cpos == 4) ) 384 if ( !(cpos == 1 || cpos == 4) )
382 return; 385 return;
383 if ( cpos == 1 && text.at( 0 ) > '1') 386 if ( cpos == 1 && text.at( 0 ) > '1')
384 text.at( 0 ) = '1'; 387 text[ 0 ] = '1';
385 case Key_5: 388 case Qt::Key_5:
386 case Key_4: 389 case Qt::Key_4:
387 case Key_3: 390 case Qt::Key_3:
388 if ( cpos < 1 ) 391 if ( cpos < 1 )
389 return; 392 return;
390 if ( hour12Format && cpos == 1 ) 393 if ( hour12Format && cpos == 1 )
391 return; 394 return;
392 case Key_2: 395 case Qt::Key_2:
393 if ( hour12Format && cpos == 0 ) 396 if ( hour12Format && cpos == 0 )
394 return; 397 return;
395 if ( cpos == 0 && text.at( 1 ) > '3') 398 if ( cpos == 0 && text.at( 1 ) > '3')
396 text.at( 1 ) = '3'; 399 text[ 1 ] = '3';
397 case Key_1: 400 case Qt::Key_1:
398 case Key_0: 401 case Qt::Key_0:
399 if ( hour12Format ) { 402 if ( hour12Format ) {
400 if ( e->key() == Key_0 && cpos == 1 && text.at( 0 ) == '0' ) 403 if ( e->key() == Qt::Key_0 && cpos == 1 && text.at( 0 ) == '0' )
401 return; 404 return;
402 if ( e->key() == Key_0 && cpos == 0 && text.at( 1 ) == '0' ) 405 if ( e->key() == Qt::Key_0 && cpos == 0 && text.at( 1 ) == '0' )
403 text.at( 1 ) = '1'; 406 text[ 1 ] = '1';
404 } 407 }
405 text.at( cpos ) = QChar ( e->key() ); 408 text[ cpos ] = QChar ( e->key() );
406 lineEdit()->setText( text ); 409 lineEdit()->setText( text );
407 if ( cpos == 1 ) 410 if ( cpos == 1 )
408 ++cpos; 411 ++cpos;
409 if ( cpos < 5) 412 if ( cpos < 5)
410 lineEdit()->setCursorPosition(++cpos); 413 lineEdit()->setCursorPosition(++cpos);
411 setSelect( cpos , 1 ); 414 setSelect( cpos , 1 );
412 changedText(); 415 changedText();
413 break; 416 break;
414 case Key_Home: 417 case Qt::Key_Home:
415 lineEdit()->setCursorPosition(0); 418 lineEdit()->setCursorPosition(0);
416 setSelect( cpos , 1 ); 419 setSelect( cpos , 1 );
417 break; 420 break;
418 case Key_End: 421 case Qt::Key_End:
419 lineEdit()->setCursorPosition(5); 422 lineEdit()->setCursorPosition(5);
420 lineEdit()->deselect(); 423 lineEdit()->deselect();
421 break; 424 break;
422 default: 425 default:
423// QComboBox::keyPressEvent(e); 426// QComboBox::keyPressEvent(e);
424 break; 427 break;
425 } // switch num keys 428 } // switch num keys
426 } else if ( cpos == 5 ) {// if cpos < 5 429 } else if ( cpos == 5 ) {// if cpos < 5
427 if ( hour12Format ) { 430 if ( hour12Format ) {
428 if ( e->key() == Key_A ) { 431 if ( e->key() == Qt::Key_A ) {
429 text.at( 5 ) = 'a'; 432 text[ 5 ] = 'a';
430 lineEdit()->setText( text ); 433 lineEdit()->setText( text );
431 lineEdit()->setCursorPosition(5); 434 lineEdit()->setCursorPosition(5);
432 435
433 } else if ( e->key() == Key_P ) { 436 } else if ( e->key() == Qt::Key_P ) {
434 text.at( 5 ) = 'p'; 437 text[ 5 ] = 'p';
435 lineEdit()->setText( text ); 438 lineEdit()->setText( text );
436 lineEdit()->setCursorPosition(5); 439 lineEdit()->setCursorPosition(5);
437 440
438 } 441 }
439 } 442 }
440 } 443 }
441 444
442 445
443} 446}
444 447
445void KOTimeEdit::updateText() 448void KOTimeEdit::updateText()
446{ 449{
diff --git a/korganizer/ktimeedit.h b/korganizer/ktimeedit.h
index b3d842d..1c7d18d 100644
--- a/korganizer/ktimeedit.h
+++ b/korganizer/ktimeedit.h
@@ -15,39 +15,42 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KTIMEEDIT_H 23#ifndef _KTIMEEDIT_H
24#define _KTIMEEDIT_H 24#define _KTIMEEDIT_H
25 25
26#include <qevent.h> 26#include <qevent.h>
27#include <qkeycode.h> 27#include <qnamespace.h>
28#include <qstring.h> 28#include <qstring.h>
29#include <qdatetime.h> 29#include <qdatetime.h>
30#include <qcombobox.h> 30#include <qcombobox.h>
31#include <Q3ComboBox>
32//Added by qt3to4:
33#include <QKeyEvent>
31 34
32#include <kapplication.h> 35#include <kapplication.h>
33 36
34/** 37/**
35 This is a class that provides an easy, user friendly way to edit times. 38 This is a class that provides an easy, user friendly way to edit times.
36 up/down/ increase or decrease time, respectively. 39 up/down/ increase or decrease time, respectively.
37 40
38 @short Provides a way to edit times in a user-friendly manner. 41 @short Provides a way to edit times in a user-friendly manner.
39 @author Preston Brown, Ian Dawes 42 @author Preston Brown, Ian Dawes
40*/ 43*/
41class KOTimeEdit : public QComboBox 44class KOTimeEdit : public Q3ComboBox
42{ 45{
43 Q_OBJECT 46 Q_OBJECT
44 public: 47 public:
45 /** constructs a new time edit. */ 48 /** constructs a new time edit. */
46 KOTimeEdit(QWidget *parent=0, QTime qt=QTime(12,0), const char *name=0); 49 KOTimeEdit(QWidget *parent=0, QTime qt=QTime(12,0), const char *name=0);
47 50
48 virtual ~KOTimeEdit(); 51 virtual ~KOTimeEdit();
49 52
50 /** 53 /**
51 Returns, if a time is selected. Can not return false anymore.... 54 Returns, if a time is selected. Can not return false anymore....
52 */ 55 */
53 bool hasTime() const; 56 bool hasTime() const;
diff --git a/korganizer/lineview.cpp b/korganizer/lineview.cpp
index e72e41c..012455e 100644
--- a/korganizer/lineview.cpp
+++ b/korganizer/lineview.cpp
@@ -1,22 +1,22 @@
1#include <qpainter.h> 1#include <qpainter.h>
2 2
3#include <kdebug.h> 3#include <kdebug.h>
4 4
5#include "koprefs.h" 5#include "koprefs.h"
6 6
7#include "lineview.h" 7#include "lineview.h"
8 8
9LineView::LineView( QWidget *parent, const char *name ) : 9LineView::LineView( QWidget *parent, const char *name ) :
10 QScrollView( parent, name ) 10 Q3ScrollView( parent, name )
11{ 11{
12 mPixelWidth = 1000; 12 mPixelWidth = 1000;
13 13
14 mLines.setAutoDelete( true ); 14 mLines.setAutoDelete( true );
15 15
16 resizeContents( mPixelWidth, contentsHeight() ); 16 resizeContents( mPixelWidth, contentsHeight() );
17 17
18 viewport()->setBackgroundColor(KOPrefs::instance()->mAgendaBgColor); 18 viewport()->setBackgroundColor(KOPrefs::instance()->mAgendaBgColor);
19} 19}
20 20
21LineView::~LineView() 21LineView::~LineView()
22{ 22{
diff --git a/korganizer/lineview.h b/korganizer/lineview.h
index aa34dbc..52ae9cf 100644
--- a/korganizer/lineview.h
+++ b/korganizer/lineview.h
@@ -1,36 +1,36 @@
1#ifndef LINEVIEW_H 1#ifndef LINEVIEW_H
2#define LINEVIEW_H 2#define LINEVIEW_H
3 3
4#include <qscrollview.h> 4#include <q3scrollview.h>
5#include <qptrlist.h> 5#include <q3ptrlist.h>
6 6
7class LineView : public QScrollView 7class LineView : public Q3ScrollView
8{ 8{
9 Q_OBJECT 9 Q_OBJECT
10 public: 10 public:
11 LineView( QWidget *parent = 0, const char *name = 0 ); 11 LineView( QWidget *parent = 0, const char *name = 0 );
12 virtual ~LineView(); 12 virtual ~LineView();
13 13
14 int pixelWidth(); 14 int pixelWidth();
15 15
16 void addLine( int start, int end ); 16 void addLine( int start, int end );
17 17
18 void clear(); 18 void clear();
19 19
20 protected: 20 protected:
21 void drawContents(QPainter* p, int cx, int cy, int cw, int ch); 21 void drawContents(QPainter* p, int cx, int cy, int cw, int ch);
22 22
23 private: 23 private:
24 struct Line { 24 struct Line {
25 Line( int c, int s, int e ) : column( c ), start( s ), end( e ) {} 25 Line( int c, int s, int e ) : column( c ), start( s ), end( e ) {}
26 int column; 26 int column;
27 int start; 27 int start;
28 int end; 28 int end;
29 }; 29 };
30 30
31 QPtrList<Line> mLines; 31 Q3PtrList<Line> mLines;
32 int mPixelWidth; 32 int mPixelWidth;
33}; 33};
34 34
35#endif 35#endif
36 36
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index 4a0e24f..211fde6 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -1,46 +1,46 @@
1 1
2 2
3#ifndef DESKTOP_VERSION 3#ifndef DESKTOP_VERSION
4#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
5#include <qcopchannel_qws.h> 5#include <qcopchannel_qws.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7//Added by qt3to4:
8#include <Q3CString>
7#include <stdlib.h> 9#include <stdlib.h>
8#else 10#else
9#include <qapplication.h> 11#include <qapplication.h>
10#include <qstring.h> 12#include <qstring.h>
11#include <qwindowsstyle.h> 13#include <qwindowsstyle.h>
12#include <qplatinumstyle.h>
13#include <qsgistyle.h>
14#include <stdlib.h> 14#include <stdlib.h>
15#endif 15#endif
16#include <qtextcodec.h> 16#include <qtextcodec.h>
17 17
18#include <qdir.h> 18#include <qdir.h>
19#include <kstandarddirs.h> 19#include <kstandarddirs.h>
20#include <kglobal.h> 20#include <kglobal.h>
21#include <stdio.h> 21#include <stdio.h>
22#include "mainwindow.h" 22#include "mainwindow.h"
23#include <libkdepim/kpimglobalprefs.h> 23#include <libkdepim/kpimglobalprefs.h>
24void dumpMissing(); 24void dumpMissing();
25 25
26 26
27int main( int argc, char **argv ) 27int main( int argc, char **argv )
28{ 28{
29 if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi");
29#ifndef DESKTOP_VERSION 30#ifndef DESKTOP_VERSION
30 QPEApplication a( argc, argv ); 31 QPEApplication a( argc, argv );
31 a.setKeepRunning (); 32 a.setKeepRunning ();
32#else 33#else
33 QApplication a( argc, argv ); 34 QApplication a( argc, argv );
34 QApplication::setStyle( new QPlatinumStyle ());
35#ifdef _WIN32_ 35#ifdef _WIN32_
36 QString hdir ( getenv( "HOME") ); 36 QString hdir ( getenv( "HOME") );
37 if ( hdir.isEmpty() ) { 37 if ( hdir.isEmpty() ) {
38 QString hd ("C:/" ); 38 QString hd ("C:/" );
39 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); 39 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd );
40 if ( QDir::homeDirPath().lower() == hd.lower() ) { 40 if ( QDir::homeDirPath().lower() == hd.lower() ) {
41 _putenv( "HOME=C:"); 41 _putenv( "HOME=C:");
42 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); 42 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) );
43 } 43 }
44 } else { 44 } else {
45 QDir app_dir; 45 QDir app_dir;
46 if ( !app_dir.exists(hdir) ) 46 if ( !app_dir.exists(hdir) )
@@ -80,34 +80,34 @@ int main( int argc, char **argv )
80 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); 80 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/");
81#else 81#else
82 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; 82 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/";
83 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 83 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
84#endif 84#endif
85 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); 85 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer")));
86 86
87 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); 87 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
88 KPimGlobalPrefs::instance()->setGlobalConfig(); 88 KPimGlobalPrefs::instance()->setGlobalConfig();
89 MainWindow m; 89 MainWindow m;
90#ifndef DESKTOP_VERSION 90#ifndef DESKTOP_VERSION
91 91
92 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(receiveStart( const QCString&, const QByteArray& ))); 92 QObject::connect( &a, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )),&m, SLOT(receiveStart( const Q3CString&, const QByteArray& )));
93 a.showMainWidget(&m ); 93 a.showMainWidget(&m );
94#else 94#else
95 a.setMainWidget(&m ); 95 a.setMainWidget(&m );
96 m.show(); 96 m.show();
97 //m.resize( 800, 600 ); 97 //m.resize( 800, 600 );
98 //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); 98 //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
99#endif 99#endif
100 if ( argc > 1 ) { 100 if ( argc > 1 ) {
101 QCString command = argv[1]; 101 Q3CString command = argv[1];
102 if ( argc > 2 ) 102 if ( argc > 2 )
103 command += argv[2]; 103 command += argv[2];
104 m.recieve(command, QByteArray() ); 104 m.recieve(command, QByteArray() );
105 105
106 } 106 }
107 107
108#ifndef DESKTOP_VERSION 108#ifndef DESKTOP_VERSION
109 // QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); 109 // QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable );
110#endif 110#endif
111 a.exec(); 111 a.exec();
112 dumpMissing(); 112 dumpMissing();
113 113
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 69ccde1..2004939 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1,44 +1,54 @@
1#include <stdlib.h> 1#include <stdlib.h>
2 2
3#include <qaction.h> 3#include <qaction.h>
4#include <qpopupmenu.h> 4#include <Q3Action>
5#include <q3popupmenu.h>
5#include <qpainter.h> 6#include <qpainter.h>
6#include <qwhatsthis.h> 7#include <q3whatsthis.h>
7#include <qpushbutton.h> 8#include <qpushbutton.h>
8#include <qmessagebox.h> 9#include <qmessagebox.h>
9#include <qlineedit.h> 10#include <qlineedit.h>
10#include <qtextcodec.h> 11#include <qtextcodec.h>
11#include <qfile.h> 12#include <qfile.h>
12#include <qdir.h> 13#include <qdir.h>
13#include <qapp.h> 14#include <qapplication.h>
14#include <qfileinfo.h> 15#include <qfileinfo.h>
15#include <qlabel.h> 16#include <qlabel.h>
16#include <qspinbox.h> 17#include <qspinbox.h>
17#include <qcheckbox.h> 18#include <qcheckbox.h>
18#include <qmap.h> 19#include <qmap.h>
19#include <qwmatrix.h> 20#include <qmatrix.h>
20#include <qtextbrowser.h> 21#include <q3textbrowser.h>
21#include <qtextstream.h> 22#include <q3textstream.h>
22#ifndef DESKTOP_VERSION 23#ifndef DESKTOP_VERSION
23#include <qpe/global.h> 24#include <qpe/global.h>
24#include <qpe/qpetoolbar.h> 25#include <qpe/qpetoolbar.h>
25#include <qpe/resource.h> 26#include <qpe/resource.h>
26#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
27#include <qtopia/alarmserver.h> 28#include <qtopia/alarmserver.h>
28#include <qtopia/qcopenvelope_qws.h> 29#include <qtopia/qcopenvelope_qws.h>
29//#include <unistd.h> // for sleep 30//#include <unistd.h> // for sleep
30#else 31#else
31#include <qtoolbar.h> 32#include <q3toolbar.h>
32#include <qapplication.h> 33#include <qapplication.h>
34//Added by qt3to4:
35#include <QResizeEvent>
36#include <QPixmap>
37#include <QCloseEvent>
38#include <QKeyEvent>
39#include <Q3VBoxLayout>
40#include <QHideEvent>
41#include <Q3CString>
42#include <Q3PtrList>
33//#include <resource.h> 43//#include <resource.h>
34 44
35#endif 45#endif
36#include <libkcal/calendarlocal.h> 46#include <libkcal/calendarlocal.h>
37#include <libkcal/todo.h> 47#include <libkcal/todo.h>
38#include <libkcal/phoneformat.h> 48#include <libkcal/phoneformat.h>
39#include <libkdepim/ksyncprofile.h> 49#include <libkdepim/ksyncprofile.h>
40#include <libkdepim/phoneaccess.h> 50#include <libkdepim/phoneaccess.h>
41#include <libkcal/kincidenceformatter.h> 51#include <libkcal/kincidenceformatter.h>
42#include <libkdepim/kpimglobalprefs.h> 52#include <libkdepim/kpimglobalprefs.h>
43 53
44#include "calendarview.h" 54#include "calendarview.h"
@@ -71,53 +81,53 @@ using namespace KCal;
71#endif 81#endif
72#endif 82#endif
73#include "mainwindow.h" 83#include "mainwindow.h"
74 84
75 85
76class KOex2phonePrefs : public QDialog 86class KOex2phonePrefs : public QDialog
77{ 87{
78 public: 88 public:
79 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 89 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
80 QDialog( parent, name, true ) 90 QDialog( parent, name, true )
81 { 91 {
82 setCaption( i18n("Export to phone options") ); 92 setCaption( i18n("Export to phone options") );
83 QVBoxLayout* lay = new QVBoxLayout( this ); 93 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
84 lay->setSpacing( 3 ); 94 lay->setSpacing( 3 );
85 lay->setMargin( 3 ); 95 lay->setMargin( 3 );
86 QLabel *lab; 96 QLabel *lab;
87 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 97 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
88 lab->setAlignment (AlignHCenter ); 98 lab->setAlignment (Qt::AlignHCenter );
89 QHBox* temphb; 99 Q3HBox* temphb;
90 temphb = new QHBox( this ); 100 temphb = new Q3HBox( this );
91 new QLabel( i18n("I/O device: "), temphb ); 101 new QLabel( i18n("I/O device: "), temphb );
92 mPhoneDevice = new QLineEdit( temphb); 102 mPhoneDevice = new QLineEdit( temphb);
93 lay->addWidget( temphb ); 103 lay->addWidget( temphb );
94 temphb = new QHBox( this ); 104 temphb = new Q3HBox( this );
95 new QLabel( i18n("Connection: "), temphb ); 105 new QLabel( i18n("Connection: "), temphb );
96 mPhoneConnection = new QLineEdit( temphb); 106 mPhoneConnection = new QLineEdit( temphb);
97 lay->addWidget( temphb ); 107 lay->addWidget( temphb );
98 temphb = new QHBox( this ); 108 temphb = new Q3HBox( this );
99 new QLabel( i18n("Model(opt.): "), temphb ); 109 new QLabel( i18n("Model(opt.): "), temphb );
100 mPhoneModel = new QLineEdit( temphb); 110 mPhoneModel = new QLineEdit( temphb);
101 lay->addWidget( temphb ); 111 lay->addWidget( temphb );
102 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); 112 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
103 mWriteBackFuture->setChecked( true ); 113 mWriteBackFuture->setChecked( true );
104 lay->addWidget( mWriteBackFuture ); 114 lay->addWidget( mWriteBackFuture );
105 temphb = new QHBox( this ); 115 temphb = new Q3HBox( this );
106 new QLabel( i18n("Max. weeks in future: ") , temphb ); 116 new QLabel( i18n("Max. weeks in future: ") , temphb );
107 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); 117 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
108 mWriteBackFutureWeeks->setValue( 8 ); 118 mWriteBackFutureWeeks->setValue( 8 );
109 lay->addWidget( temphb ); 119 lay->addWidget( temphb );
110 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); 120 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
111 lab->setAlignment (AlignHCenter ); 121 lab->setAlignment (Qt::AlignHCenter );
112 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 122 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
113 lay->addWidget( ok ); 123 lay->addWidget( ok );
114 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 124 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
115 lay->addWidget( cancel ); 125 lay->addWidget( cancel );
116 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 126 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
117 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 127 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
118 resize( 220, 240 ); 128 resize( 220, 240 );
119 qApp->processEvents(); 129 qApp->processEvents();
120 int dw = QApplication::desktop()->width(); 130 int dw = QApplication::desktop()->width();
121 int dh = QApplication::desktop()->height(); 131 int dh = QApplication::desktop()->height();
122 move( (dw-width())/2, (dh - height() )/2 ); 132 move( (dw-width())/2, (dh - height() )/2 );
123 } 133 }
@@ -125,25 +135,25 @@ class KOex2phonePrefs : public QDialog
125public: 135public:
126 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 136 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
127 QCheckBox* mWriteBackFuture; 137 QCheckBox* mWriteBackFuture;
128 QSpinBox* mWriteBackFutureWeeks; 138 QSpinBox* mWriteBackFutureWeeks;
129}; 139};
130 140
131QPixmap* sgListViewCompletedPix[6]; 141QPixmap* sgListViewCompletedPix[6];
132QPixmap* sgListViewJournalPix; 142QPixmap* sgListViewJournalPix;
133 143
134 144
135int globalFlagBlockStartup; 145int globalFlagBlockStartup;
136MainWindow::MainWindow( QWidget *parent, const char *name ) : 146MainWindow::MainWindow( QWidget *parent, const char *name ) :
137 QMainWindow( parent, name ) 147 Q3MainWindow( parent, name )
138{ 148{
139 sgListViewCompletedPix[5] = &listviewPix; 149 sgListViewCompletedPix[5] = &listviewPix;
140 sgListViewCompletedPix[0] = &listviewPix0; 150 sgListViewCompletedPix[0] = &listviewPix0;
141 sgListViewCompletedPix[1] = &listviewPix20; 151 sgListViewCompletedPix[1] = &listviewPix20;
142 sgListViewCompletedPix[2] = &listviewPix40; 152 sgListViewCompletedPix[2] = &listviewPix40;
143 sgListViewCompletedPix[3] = &listviewPix60; 153 sgListViewCompletedPix[3] = &listviewPix60;
144 sgListViewCompletedPix[4] = &listviewPix80; 154 sgListViewCompletedPix[4] = &listviewPix80;
145 //int size = 12; 155 //int size = 12;
146 { 156 {
147 sgListViewCompletedPix[5]->resize( 11, 11 ); 157 sgListViewCompletedPix[5]->resize( 11, 11 );
148 sgListViewCompletedPix[5]->fill( Qt::white ); 158 sgListViewCompletedPix[5]->fill( Qt::white );
149 QPainter p ( sgListViewCompletedPix[5] ); 159 QPainter p ( sgListViewCompletedPix[5] );
@@ -176,70 +186,70 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
176 QString confFile = locateLocal("config","korganizerrc"); 186 QString confFile = locateLocal("config","korganizerrc");
177 QFileInfo finf ( confFile ); 187 QFileInfo finf ( confFile );
178 bool showWarning = !finf.exists(); 188 bool showWarning = !finf.exists();
179 setIcon(SmallIcon( "ko24" ) ); 189 setIcon(SmallIcon( "ko24" ) );
180 mBlockAtStartup = true; 190 mBlockAtStartup = true;
181 mFlagKeyPressed = false; 191 mFlagKeyPressed = false;
182 setCaption("KO/Pi"); 192 setCaption("KO/Pi");
183 KOPrefs *p = KOPrefs::instance(); 193 KOPrefs *p = KOPrefs::instance();
184 //KPimGlobalPrefs::instance()->setGlobalConfig(); 194 //KPimGlobalPrefs::instance()->setGlobalConfig();
185 p->mCurrentDisplayedView = 0; 195 p->mCurrentDisplayedView = 0;
186 if ( p->mHourSize > 22 ) 196 if ( p->mHourSize > 22 )
187 p->mHourSize = 22; 197 p->mHourSize = 22;
188 QMainWindow::ToolBarDock tbd; 198 Qt::ToolBarDock tbd;
189 if ( p->mToolBarHor ) { 199 if ( p->mToolBarHor ) {
190 if ( p->mToolBarUp ) 200 if ( p->mToolBarUp )
191 tbd = Bottom; 201 tbd = Qt::Bottom;
192 else 202 else
193 tbd = Top; 203 tbd = Qt::Top;
194 } 204 }
195 else { 205 else {
196 if ( p->mToolBarUp ) 206 if ( p->mToolBarUp )
197 tbd = Right; 207 tbd = Qt::Right;
198 else 208 else
199 tbd = Left; 209 tbd = Qt::Left;
200 } 210 }
201 if ( KOPrefs::instance()->mUseAppColors ) 211 if ( KOPrefs::instance()->mUseAppColors )
202 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 212 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
203 globalFlagBlockStartup = 1; 213 globalFlagBlockStartup = 1;
204 iconToolBar = new QPEToolBar( this ); 214 iconToolBar = new QPEToolBar( this );
205 addToolBar (iconToolBar , tbd ); 215 addToolBar (iconToolBar , tbd );
206 216
207#ifdef DESKTOP_VERSION 217#ifdef DESKTOP_VERSION
208 if ( KOPrefs::instance()->mShowIconFilter ) 218 if ( KOPrefs::instance()->mShowIconFilter )
209#else 219#else
210 if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) ) 220 if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) )
211#endif 221#endif
212 222
213{ 223{
214 if ( p->mToolBarHorF ) { 224 if ( p->mToolBarHorF ) {
215 if ( p->mToolBarUpF ) 225 if ( p->mToolBarUpF )
216 tbd = Bottom; 226 tbd = Qt::Bottom;
217 else 227 else
218 tbd = Top; 228 tbd = Qt::Top;
219 } 229 }
220 else { 230 else {
221 if ( p->mToolBarUpF ) 231 if ( p->mToolBarUpF )
222 tbd = Right; 232 tbd = Qt::Right;
223 else 233 else
224 tbd = Left; 234 tbd = Qt::Left;
225 } 235 }
226 filterToolBar = new QPEToolBar ( this ); 236 filterToolBar = new QPEToolBar ( this );
227 filterMenubar = new KMenuBar( 0 ); 237 filterMenubar = new KMenuBar( 0 );
228 QFontMetrics fm ( filterMenubar->font() ); 238 QFontMetrics fm ( filterMenubar->font() );
229#ifndef DESKTOP_VERSION 239#ifndef DESKTOP_VERSION
230 filterToolBar->setFocusPolicy( NoFocus ); 240 filterToolBar->setFocusPolicy( NoFocus );
231 filterMenubar->setFocusPolicy( NoFocus ); 241 filterMenubar->setFocusPolicy( NoFocus );
232#endif 242#endif
233 filterPopupMenu = new QPopupMenu( this ); 243 filterPopupMenu = new Q3PopupMenu( this );
234 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); 244 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
235 QString addTest = "A"; 245 QString addTest = "A";
236 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); 246 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
237#ifdef DESKTOP_VERSION 247#ifdef DESKTOP_VERSION
238 addTest = "AAAAAABBBCCCx"; 248 addTest = "AAAAAABBBCCCx";
239#else 249#else
240 addTest = "AAAAAx"; 250 addTest = "AAAAAx";
241#endif 251#endif
242 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); 252 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
243 addToolBar (filterToolBar , tbd ); 253 addToolBar (filterToolBar , tbd );
244 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); 254 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
245 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); 255 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
@@ -250,47 +260,47 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
250 filterMenubar = 0; 260 filterMenubar = 0;
251 filterPopupMenu = 0; 261 filterPopupMenu = 0;
252 } 262 }
253 if ( p->mShowIconOnetoolbar ) { 263 if ( p->mShowIconOnetoolbar ) {
254 viewToolBar = iconToolBar ; 264 viewToolBar = iconToolBar ;
255 navigatorToolBar = iconToolBar ; 265 navigatorToolBar = iconToolBar ;
256 } else { 266 } else {
257#ifndef DESKTOP_VERSION 267#ifndef DESKTOP_VERSION
258 setToolBarsMovable( false ); 268 setToolBarsMovable( false );
259#endif 269#endif
260 if ( p->mToolBarHorV ) { 270 if ( p->mToolBarHorV ) {
261 if ( p->mToolBarUpV ) 271 if ( p->mToolBarUpV )
262 tbd = Bottom; 272 tbd = Qt::Bottom;
263 else 273 else
264 tbd = Top; 274 tbd = Qt::Top;
265 } 275 }
266 else { 276 else {
267 if ( p->mToolBarUpV ) 277 if ( p->mToolBarUpV )
268 tbd = Right; 278 tbd = Qt::Right;
269 else 279 else
270 tbd = Left; 280 tbd = Qt::Left;
271 } 281 }
272 viewToolBar = new QPEToolBar( this ); 282 viewToolBar = new QPEToolBar( this );
273 addToolBar (viewToolBar , tbd ); 283 addToolBar (viewToolBar , tbd );
274 if ( p->mToolBarHorN ) { 284 if ( p->mToolBarHorN ) {
275 if ( p->mToolBarUpN ) 285 if ( p->mToolBarUpN )
276 tbd = Bottom; 286 tbd = Qt::Bottom;
277 else 287 else
278 tbd = Top; 288 tbd = Qt::Top;
279 } 289 }
280 else { 290 else {
281 if ( p->mToolBarUpN ) 291 if ( p->mToolBarUpN )
282 tbd = Right; 292 tbd = Qt::Right;
283 else 293 else
284 tbd = Left; 294 tbd = Qt::Left;
285 } 295 }
286 navigatorToolBar = new QPEToolBar( this ); 296 navigatorToolBar = new QPEToolBar( this );
287 addToolBar (navigatorToolBar , tbd ); 297 addToolBar (navigatorToolBar , tbd );
288 } 298 }
289 299
290 300
291 301
292 mCalendarModifiedFlag = false; 302 mCalendarModifiedFlag = false;
293 // QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 303 // QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
294 //splash->setAlignment ( AlignCenter ); 304 //splash->setAlignment ( AlignCenter );
295 //setCentralWidget( splash ); 305 //setCentralWidget( splash );
296#ifndef DESKTOP_VERSION 306#ifndef DESKTOP_VERSION
@@ -431,27 +441,27 @@ void MainWindow::loadDataAfterStart()
431 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 441 qDebug("KO: Calendar loading time: %d ms",msNeeded );
432 //QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); 442 //QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
433 mView->setModified( false ); 443 mView->setModified( false );
434 mBlockAtStartup = false; 444 mBlockAtStartup = false;
435 mView->setModified( false ); 445 mView->setModified( false );
436 connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); 446 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
437 processIncidenceSelection( 0 ); 447 processIncidenceSelection( 0 );
438 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 448 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
439 SLOT( processIncidenceSelection( Incidence * ) ) ); 449 SLOT( processIncidenceSelection( Incidence * ) ) );
440 connect( mView, SIGNAL( modifiedChanged( bool ) ), 450 connect( mView, SIGNAL( modifiedChanged( bool ) ),
441 SLOT( slotModifiedChanged( bool ) ) ); 451 SLOT( slotModifiedChanged( bool ) ) );
442#ifndef DESKTOP_VERSION 452#ifndef DESKTOP_VERSION
443 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 453 connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & )));
444 connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& ))); 454 connect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(recieve( const Q3CString&, const QByteArray& )));
445 disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& ))); 455 disconnect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(receiveStart( const Q3CString&, const QByteArray& )));
446 if ( !mCStringMess.isEmpty() ) 456 if ( !mCStringMess.isEmpty() )
447 recieve( mCStringMess, mByteData ); 457 recieve( mCStringMess, mByteData );
448#endif 458#endif
449 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); 459 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
450} 460}
451 461
452void MainWindow::slotResetFocus() 462void MainWindow::slotResetFocus()
453{ 463{
454 //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); 464 //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar);
455 mFocusLoop = 3; 465 mFocusLoop = 3;
456 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); 466 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() ));
457} 467}
@@ -500,25 +510,25 @@ void MainWindow::toggleBeamReceive()
500 return; 510 return;
501#ifndef DESKTOP_VERSION 511#ifndef DESKTOP_VERSION
502 if ( infrared ) { 512 if ( infrared ) {
503 qDebug("KO: Disable BeamReceive "); 513 qDebug("KO: Disable BeamReceive ");
504 delete infrared; 514 delete infrared;
505 infrared = 0; 515 infrared = 0;
506 brAction->setOn(false); 516 brAction->setOn(false);
507 return; 517 return;
508 } 518 }
509 qDebug("KO: Enable BeamReceive "); 519 qDebug("KO: Enable BeamReceive ");
510 brAction->setOn(true); 520 brAction->setOn(true);
511 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; 521 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ;
512 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); 522 QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(recieve( const Q3CString&, const QByteArray& )));
513#endif 523#endif
514} 524}
515void MainWindow::showMaximized () 525void MainWindow::showMaximized ()
516{ 526{
517#ifndef DESKTOP_VERSION 527#ifndef DESKTOP_VERSION
518 if ( ! globalFlagBlockStartup ) 528 if ( ! globalFlagBlockStartup )
519 if ( mClosed ) 529 if ( mClosed )
520 mView->goToday(); 530 mView->goToday();
521#endif 531#endif
522 QWidget::showMaximized () ; 532 QWidget::showMaximized () ;
523 mClosed = false; 533 mClosed = false;
524} 534}
@@ -591,40 +601,40 @@ void MainWindow::closeEvent( QCloseEvent* ce )
591 break; 601 break;
592 case 1: 602 case 1:
593 ce->ignore(); 603 ce->ignore();
594 break; 604 break;
595 case 2: 605 case 2:
596 606
597 default: 607 default:
598 break; 608 break;
599 } 609 }
600 610
601 611
602} 612}
603void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) 613void MainWindow::receiveStart( const Q3CString& cmsg, const QByteArray& data )
604{ 614{
605 qDebug("KO: QCOP start message received: %s ", cmsg.data() ); 615 qDebug("KO: QCOP start message received: %s ", cmsg.data() );
606 mCStringMess = cmsg; 616 mCStringMess = cmsg;
607 mByteData = data; 617 mByteData = data;
608} 618}
609void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 619void MainWindow::recieve( const Q3CString& cmsg, const QByteArray& data )
610{ 620{
611 QDataStream stream( data, IO_ReadOnly ); 621 QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly );
612 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); 622 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
613 //QString datamess; 623 //QString datamess;
614 //qDebug("message "); 624 //qDebug("message ");
615 qDebug("KO: QCOP message received: %s ", cmsg.data() ); 625 qDebug("KO: QCOP message received: %s ", cmsg.data() );
616 626
617 if ( cmsg == "setDocument(QString)" ) { 627 if ( cmsg == "setDocument(QString)" ) {
618 QDataStream stream( data, IO_ReadOnly ); 628 QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly );
619 QString fileName; 629 QString fileName;
620 stream >> fileName; 630 stream >> fileName;
621 //qDebug("filename %s ", fileName.latin1()); 631 //qDebug("filename %s ", fileName.latin1());
622 showMaximized(); 632 showMaximized();
623 raise(); 633 raise();
624 KOPrefs::instance()->mLastSyncedLocalFile = fileName ; 634 KOPrefs::instance()->mLastSyncedLocalFile = fileName ;
625 mSyncManager->slotSyncMenu( 1002 ); 635 mSyncManager->slotSyncMenu( 1002 );
626 return; 636 return;
627 } 637 }
628 638
629 if ( cmsg == "-writeFile" ) { 639 if ( cmsg == "-writeFile" ) {
630 // I made from the "-writeFile" an "-writeAlarm" 640 // I made from the "-writeFile" an "-writeAlarm"
@@ -735,39 +745,39 @@ void MainWindow::setUsesBigPixmaps ( bool b )
735{ 745{
736 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); 746 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b);
737 if ( b ) 747 if ( b )
738 qDebug("KO: BigPixmaps are not supported "); 748 qDebug("KO: BigPixmaps are not supported ");
739} 749}
740void MainWindow::initActions() 750void MainWindow::initActions()
741{ 751{
742 //KOPrefs::instance()->mShowFullMenu 752 //KOPrefs::instance()->mShowFullMenu
743 iconToolBar->clear(); 753 iconToolBar->clear();
744 KOPrefs *p = KOPrefs::instance(); 754 KOPrefs *p = KOPrefs::instance();
745 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 755 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
746 756
747 QPopupMenu *viewMenu = new QPopupMenu( this ); 757 Q3PopupMenu *viewMenu = new Q3PopupMenu( this );
748 QPopupMenu *actionMenu = new QPopupMenu( this ); 758 Q3PopupMenu *actionMenu = new Q3PopupMenu( this );
749 mCurrentItemMenu = new QPopupMenu ( this ); 759 mCurrentItemMenu = new Q3PopupMenu ( this );
750 QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); 760 Q3PopupMenu *nextConflictMenu = new Q3PopupMenu ( this );
751 QPopupMenu *importMenu = new QPopupMenu( this ); 761 Q3PopupMenu *importMenu = new Q3PopupMenu( this );
752 QPopupMenu *importMenu_X = new QPopupMenu( this ); 762 Q3PopupMenu *importMenu_X = new Q3PopupMenu( this );
753 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 763 Q3PopupMenu *exportMenu_X = new Q3PopupMenu( this );
754 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 764 Q3PopupMenu *beamMenu_X = new Q3PopupMenu( this );
755 selectFilterMenu = new QPopupMenu( this ); 765 selectFilterMenu = new Q3PopupMenu( this );
756 selectFilterMenu->setCheckable( true ); 766 selectFilterMenu->setCheckable( true );
757 syncMenu = new QPopupMenu( this ); 767 syncMenu = new Q3PopupMenu( this );
758 configureAgendaMenu = new QPopupMenu( this ); 768 configureAgendaMenu = new Q3PopupMenu( this );
759 configureToolBarMenu = new QPopupMenu( this ); 769 configureToolBarMenu = new Q3PopupMenu( this );
760 QPopupMenu *helpMenu = new QPopupMenu( this ); 770 Q3PopupMenu *helpMenu = new Q3PopupMenu( this );
761 QIconSet icon; 771 QIcon icon;
762 int pixWid = 22, pixHei = 22; 772 int pixWid = 22, pixHei = 22;
763 QString pathString = ""; 773 QString pathString = "";
764 if ( !p->mToolBarMiniIcons ) { 774 if ( !p->mToolBarMiniIcons ) {
765 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { 775 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
766 pathString += "icons16/"; 776 pathString += "icons16/";
767 pixWid = 18; pixHei = 16; 777 pixWid = 18; pixHei = 16;
768 } 778 }
769 } else { 779 } else {
770 pathString += "iconsmini/"; 780 pathString += "iconsmini/";
771 pixWid = 18; pixHei = 16; 781 pixWid = 18; pixHei = 16;
772 } 782 }
773 783
@@ -782,25 +792,25 @@ void MainWindow::initActions()
782#ifdef DESKTOP_VERSION 792#ifdef DESKTOP_VERSION
783 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 793 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
784 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 794 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
785#else 795#else
786 menuBar1->insertItem( i18n("Sync"), syncMenu ); 796 menuBar1->insertItem( i18n("Sync"), syncMenu );
787 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 797 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
788#endif 798#endif
789 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 799 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
790 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 800 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
791 menuBar1->insertItem( i18n("Help"), helpMenu ); 801 menuBar1->insertItem( i18n("Help"), helpMenu );
792 } else { 802 } else {
793 menuBar1 = new KMenuBar( iconToolBar ); 803 menuBar1 = new KMenuBar( iconToolBar );
794 QPopupMenu *menuBar = new QPopupMenu( this ); 804 Q3PopupMenu *menuBar = new Q3PopupMenu( this );
795 icon = loadPixmap( pathString + "z_menu" ); 805 icon = loadPixmap( pathString + "z_menu" );
796 menuBar1->insertItem( icon.pixmap(), menuBar); 806 menuBar1->insertItem( icon.pixmap(), menuBar);
797 //menuBar1->insertItem( i18n("ME"), menuBar); 807 //menuBar1->insertItem( i18n("ME"), menuBar);
798 menuBar->insertItem( i18n("File"), importMenu ); 808 menuBar->insertItem( i18n("File"), importMenu );
799 menuBar->insertItem( i18n("View"), viewMenu ); 809 menuBar->insertItem( i18n("View"), viewMenu );
800 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); 810 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu );
801 menuBar->insertItem( i18n("Action"), actionMenu ); 811 menuBar->insertItem( i18n("Action"), actionMenu );
802 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 812 menuBar->insertItem( i18n("Synchronize"), syncMenu );
803 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 813 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
804 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 814 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
805 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 815 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
806 menuBar->insertItem( i18n("Help"), helpMenu ); 816 menuBar->insertItem( i18n("Help"), helpMenu );
@@ -809,208 +819,208 @@ void MainWindow::initActions()
809 connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) ); 819 connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) );
810 } 820 }
811 connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); 821 connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) );
812 //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); 822 //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) );
813 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 823 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
814 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 824 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
815 825
816 826
817 mWeekBgColor = iconToolBar->backgroundColor(); 827 mWeekBgColor = iconToolBar->backgroundColor();
818 mWeekPixmap.resize( pixWid , pixHei ); 828 mWeekPixmap.resize( pixWid , pixHei );
819 mWeekPixmap.fill( mWeekBgColor ); 829 mWeekPixmap.fill( mWeekBgColor );
820 icon = mWeekPixmap; 830 icon = mWeekPixmap;
821 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 831 mWeekAction = new Q3Action( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
822 if ( p-> mShowIconWeekNum ) 832 if ( p-> mShowIconWeekNum )
823 mWeekAction->addTo( iconToolBar ); 833 mWeekAction->addTo( iconToolBar );
824 mWeekFont = font(); 834 mWeekFont = font();
825 835
826 int fontPoint = mWeekFont.pointSize(); 836 int fontPoint = mWeekFont.pointSize();
827 QFontMetrics f( mWeekFont ); 837 QFontMetrics f( mWeekFont );
828 int fontWid = f.width( "30" ); 838 int fontWid = f.width( "30" );
829 while ( fontWid > pixWid ) { 839 while ( fontWid > pixWid ) {
830 --fontPoint; 840 --fontPoint;
831 mWeekFont.setPointSize( fontPoint ); 841 mWeekFont.setPointSize( fontPoint );
832 QFontMetrics f( mWeekFont ); 842 QFontMetrics f( mWeekFont );
833 fontWid = f.width( "30" ); 843 fontWid = f.width( "30" );
834 //qDebug("dec-- "); 844 //qDebug("dec-- ");
835 } 845 }
836 846
837 connect( mWeekAction, SIGNAL( activated() ), 847 connect( mWeekAction, SIGNAL( activated() ),
838 this, SLOT( weekAction() ) ); 848 this, SLOT( weekAction() ) );
839 849
840 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 850 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
841 if ( p->mShowIconFilterview ) { 851 if ( p->mShowIconFilterview ) {
842 icon = loadPixmap( pathString + "filter" ); 852 icon = loadPixmap( pathString + "filter" );
843 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); 853 actionFilterMenuTB = new Q3Action( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
844 connect( actionFilterMenuTB, SIGNAL( activated() ), 854 connect( actionFilterMenuTB, SIGNAL( activated() ),
845 this, SLOT( fillFilterMenuTB() ) ); 855 this, SLOT( fillFilterMenuTB() ) );
846 actionFilterMenuTB->addTo( iconToolBar ); 856 actionFilterMenuTB->addTo( iconToolBar );
847 selectFilterMenuTB = new QPopupMenu( this ); 857 selectFilterMenuTB = new Q3PopupMenu( this );
848 selectFilterMenuTB->setCheckable( true ); 858 selectFilterMenuTB->setCheckable( true );
849 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 859 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
850 } 860 }
851 861
852 //#endif 862 //#endif
853 // ****************** 863 // ******************
854 QAction *action; 864 Q3Action *action;
855 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 865 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
856 configureToolBarMenu->setCheckable( true ); 866 configureToolBarMenu->setCheckable( true );
857 867
858 868
859 configureAgendaMenu->setCheckable( true ); 869 configureAgendaMenu->setCheckable( true );
860 int iii ; 870 int iii ;
861 for ( iii = 1;iii<= 10 ;++iii ){ 871 for ( iii = 1;iii<= 10 ;++iii ){
862 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 872 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
863 } 873 }
864 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 874 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
865 875
866 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 876 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
867 this, SLOT( showConfigureAgenda( ) ) ); 877 this, SLOT( showConfigureAgenda( ) ) );
868 icon = loadPixmap( pathString + "today" ); 878 icon = loadPixmap( pathString + "today" );
869 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 879 Q3Action* today_action = new Q3Action( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
870 today_action->addTo( actionMenu ); 880 today_action->addTo( actionMenu );
871 connect( today_action, SIGNAL( activated() ), 881 connect( today_action, SIGNAL( activated() ),
872 mView, SLOT( goToday() ) ); 882 mView, SLOT( goToday() ) );
873 883
874 icon = loadPixmap( pathString + "picker" ); 884 icon = loadPixmap( pathString + "picker" );
875 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); 885 Q3Action* dPickerAction = new Q3Action( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
876 dPickerAction->addTo( actionMenu ); 886 dPickerAction->addTo( actionMenu );
877 connect( dPickerAction, SIGNAL( activated() ), 887 connect( dPickerAction, SIGNAL( activated() ),
878 mView, SLOT( showDatePicker() ) ); 888 mView, SLOT( showDatePicker() ) );
879 889
880 icon = loadPixmap( pathString + "search" ); 890 icon = loadPixmap( pathString + "search" );
881 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 891 Q3Action* search_action = new Q3Action( i18n("Search"), icon, i18n("Search..."), 0, this );
882 search_action->addTo( actionMenu ); 892 search_action->addTo( actionMenu );
883 connect( search_action, SIGNAL( activated() ), 893 connect( search_action, SIGNAL( activated() ),
884 mView->dialogManager(), SLOT( showSearchDialog() ) ); 894 mView->dialogManager(), SLOT( showSearchDialog() ) );
885 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); 895 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu );
886 896
887 action = new QAction( "Undo Delete", i18n("All events"), 0, this ); 897 action = new Q3Action( "Undo Delete", i18n("All events"), 0, this );
888 action->addTo( nextConflictMenu ); 898 action->addTo( nextConflictMenu );
889 connect( action, SIGNAL( activated() ), 899 connect( action, SIGNAL( activated() ),
890 mView, SLOT( conflictAll() ) ); 900 mView, SLOT( conflictAll() ) );
891 901
892 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); 902 action = new Q3Action( "Undo Delete", i18n("Allday events"), 0, this );
893 action->addTo( nextConflictMenu ); 903 action->addTo( nextConflictMenu );
894 connect( action, SIGNAL( activated() ), 904 connect( action, SIGNAL( activated() ),
895 mView, SLOT( conflictAllday() ) ); 905 mView, SLOT( conflictAllday() ) );
896 906
897 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); 907 action = new Q3Action( "Undo Delete", i18n("Events with time"), 0, this );
898 action->addTo( nextConflictMenu ); 908 action->addTo( nextConflictMenu );
899 connect( action, SIGNAL( activated() ), 909 connect( action, SIGNAL( activated() ),
900 mView, SLOT( conflictNotAll() ) ); 910 mView, SLOT( conflictNotAll() ) );
901 911
902 actionMenu->insertSeparator(); 912 actionMenu->insertSeparator();
903 913
904 icon = loadPixmap( pathString + "newevent" ); 914 icon = loadPixmap( pathString + "newevent" );
905 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 915 Q3Action* ne_action = new Q3Action( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
906 ne_action->addTo( mCurrentItemMenu ); 916 ne_action->addTo( mCurrentItemMenu );
907 connect( ne_action, SIGNAL( activated() ), 917 connect( ne_action, SIGNAL( activated() ),
908 mView, SLOT( newEvent() ) ); 918 mView, SLOT( newEvent() ) );
909 icon = loadPixmap( pathString + "newtodo" ); 919 icon = loadPixmap( pathString + "newtodo" );
910 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 920 Q3Action* nt_action = new Q3Action( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
911 nt_action->addTo( mCurrentItemMenu ); 921 nt_action->addTo( mCurrentItemMenu );
912 connect( nt_action, SIGNAL( activated() ), 922 connect( nt_action, SIGNAL( activated() ),
913 mView, SLOT( newTodo() ) ); 923 mView, SLOT( newTodo() ) );
914 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 924 mNewSubTodoAction = new Q3Action( "new_subtodo", i18n("New Sub-Todo..."), 0,
915 this ); 925 this );
916 mNewSubTodoAction->addTo( mCurrentItemMenu ); 926 mNewSubTodoAction->addTo( mCurrentItemMenu );
917 connect( mNewSubTodoAction, SIGNAL( activated() ), 927 connect( mNewSubTodoAction, SIGNAL( activated() ),
918 mView, SLOT( newSubTodo() ) ); 928 mView, SLOT( newSubTodo() ) );
919 929
920 mCurrentItemMenu->insertSeparator(); 930 mCurrentItemMenu->insertSeparator();
921 icon = loadPixmap( pathString + "newevent" ); 931 icon = loadPixmap( pathString + "newevent" );
922 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 932 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
923 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 933 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
924 configureToolBarMenu->insertSeparator(); 934 configureToolBarMenu->insertSeparator();
925 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 935 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
926 configureToolBarMenu->insertSeparator(); 936 configureToolBarMenu->insertSeparator();
927 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 937 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
928 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 938 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
929 icon = loadPixmap( pathString + "newtodo" ); 939 icon = loadPixmap( pathString + "newtodo" );
930 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 940 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
931 941
932 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); 942 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
933 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); 943 mShowAction = new Q3Action( "show_incidence", i18n("Show"), 0, this );
934 mShowAction->addTo( mCurrentItemMenu ); 944 mShowAction->addTo( mCurrentItemMenu );
935 connect( mShowAction, SIGNAL( activated() ), 945 connect( mShowAction, SIGNAL( activated() ),
936 mView, SLOT( showIncidence() ) ); 946 mView, SLOT( showIncidence() ) );
937 947
938 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 948 mEditAction = new Q3Action( "edit_incidence", i18n("Edit..."), 0, this );
939 mEditAction->addTo( mCurrentItemMenu ); 949 mEditAction->addTo( mCurrentItemMenu );
940 connect( mEditAction, SIGNAL( activated() ), 950 connect( mEditAction, SIGNAL( activated() ),
941 mView, SLOT( editIncidence() ) ); 951 mView, SLOT( editIncidence() ) );
942 952
943 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 953 mDeleteAction = new Q3Action( "delete_incidence", i18n("Delete..."), 0, this );
944 mDeleteAction->addTo( mCurrentItemMenu ); 954 mDeleteAction->addTo( mCurrentItemMenu );
945 connect( mDeleteAction, SIGNAL( activated() ), 955 connect( mDeleteAction, SIGNAL( activated() ),
946 mView, SLOT( deleteIncidence() ) ); 956 mView, SLOT( deleteIncidence() ) );
947 957
948 958
949 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 959 mCloneAction = new Q3Action( "clone_incidence", i18n("Clone..."), 0, this );
950 mCloneAction->addTo( mCurrentItemMenu ); 960 mCloneAction->addTo( mCurrentItemMenu );
951 connect( mCloneAction, SIGNAL( activated() ), 961 connect( mCloneAction, SIGNAL( activated() ),
952 mView, SLOT( cloneIncidence() ) ); 962 mView, SLOT( cloneIncidence() ) );
953 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 963 mMoveAction = new Q3Action( "Move_incidence", i18n("Move..."), 0, this );
954 mMoveAction->addTo( mCurrentItemMenu ); 964 mMoveAction->addTo( mCurrentItemMenu );
955 connect( mMoveAction, SIGNAL( activated() ), 965 connect( mMoveAction, SIGNAL( activated() ),
956 mView, SLOT( moveIncidence() ) ); 966 mView, SLOT( moveIncidence() ) );
957#ifndef DESKTOP_VERSION 967#ifndef DESKTOP_VERSION
958 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 968 mBeamAction = new Q3Action( "Beam_incidence", i18n("Beam..."), 0, this );
959 mBeamAction->addTo(mCurrentItemMenu ); 969 mBeamAction->addTo(mCurrentItemMenu );
960 connect( mBeamAction, SIGNAL( activated() ), 970 connect( mBeamAction, SIGNAL( activated() ),
961 mView, SLOT( beamIncidence() ) ); 971 mView, SLOT( beamIncidence() ) );
962#endif 972#endif
963 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 973 mCancelAction = new Q3Action( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
964 mCancelAction->addTo( mCurrentItemMenu ); 974 mCancelAction->addTo( mCurrentItemMenu );
965 connect( mCancelAction, SIGNAL( activated() ), 975 connect( mCancelAction, SIGNAL( activated() ),
966 mView, SLOT( toggleCancelIncidence() ) ); 976 mView, SLOT( toggleCancelIncidence() ) );
967 977
968 978
969 mCurrentItemMenu->insertSeparator(); 979 mCurrentItemMenu->insertSeparator();
970 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 980 action = new Q3Action( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
971 action->addTo( mCurrentItemMenu ); 981 action->addTo( mCurrentItemMenu );
972 connect( action, SIGNAL( activated() ), 982 connect( action, SIGNAL( activated() ),
973 mView, SLOT( undo_delete() ) ); 983 mView, SLOT( undo_delete() ) );
974 984
975 // *********************** 985 // ***********************
976 if ( KOPrefs::instance()->mVerticalScreen ) { 986 if ( KOPrefs::instance()->mVerticalScreen ) {
977 icon = SmallIcon( "1updownarrow" ); 987 icon = SmallIcon( "1updownarrow" );
978 } else { 988 } else {
979 icon = SmallIcon("1leftrightarrow" ); 989 icon = SmallIcon("1leftrightarrow" );
980 } 990 }
981 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 991 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
982 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 992 Q3Action* FSaction = new Q3Action( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
983 FSaction->addTo( viewMenu ); 993 FSaction->addTo( viewMenu );
984 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 994 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
985 995
986 996
987 icon = loadPixmap( pathString + "filter" ); 997 icon = loadPixmap( pathString + "filter" );
988 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 998 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
989 icon = loadPixmap( pathString + "configure" ); 999 icon = loadPixmap( pathString + "configure" );
990 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); 1000 action = new Q3Action( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this );
991 action->addTo( viewMenu ); 1001 action->addTo( viewMenu );
992 connect( action, SIGNAL( activated() ), 1002 connect( action, SIGNAL( activated() ),
993 mView, SLOT( toggleFilter() ) ); 1003 mView, SLOT( toggleFilter() ) );
994 mToggleFilter = action; 1004 mToggleFilter = action;
995 icon = loadPixmap( pathString + "navi" ); 1005 icon = loadPixmap( pathString + "navi" );
996 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 1006 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
997 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 1007 action = new Q3Action( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
998 action->addTo( viewMenu ); 1008 action->addTo( viewMenu );
999 connect( action, SIGNAL( activated() ), 1009 connect( action, SIGNAL( activated() ),
1000 mView, SLOT( toggleDateNavigatorWidget() ) ); 1010 mView, SLOT( toggleDateNavigatorWidget() ) );
1001 mToggleNav = action ; 1011 mToggleNav = action ;
1002 icon = loadPixmap( pathString + "allday" ); 1012 icon = loadPixmap( pathString + "allday" );
1003 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 1013 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
1004 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 1014 action = new Q3Action( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
1005 action->addTo( viewMenu ); 1015 action->addTo( viewMenu );
1006 connect( action, SIGNAL( activated() ), 1016 connect( action, SIGNAL( activated() ),
1007 mView, SLOT( toggleAllDaySize() ) ); 1017 mView, SLOT( toggleAllDaySize() ) );
1008 mToggleAllday = action; 1018 mToggleAllday = action;
1009 1019
1010 1020
1011 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 1021 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
1012 mToggleNav, SLOT( setEnabled ( bool ) ) ); 1022 mToggleNav, SLOT( setEnabled ( bool ) ) );
1013 //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 1023 //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
1014 // mToggleFilter, SLOT( setEnabled ( bool ) ) ); 1024 // mToggleFilter, SLOT( setEnabled ( bool ) ) );
1015 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 1025 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
1016 mToggleAllday, SLOT( setEnabled ( bool ) ) ); 1026 mToggleAllday, SLOT( setEnabled ( bool ) ) );
@@ -1022,403 +1032,403 @@ void MainWindow::initActions()
1022 viewMenu->insertSeparator(); 1032 viewMenu->insertSeparator();
1023 1033
1024 if ( p-> mShowIconToggleFull ) 1034 if ( p-> mShowIconToggleFull )
1025 FSaction->addTo( iconToolBar ); 1035 FSaction->addTo( iconToolBar );
1026 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); 1036 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
1027 1037
1028 //******************** 1038 //********************
1029 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); 1039 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
1030 1040
1031 1041
1032 icon = loadPixmap( pathString + "whatsnext" ); 1042 icon = loadPixmap( pathString + "whatsnext" );
1033 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 1043 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
1034 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 1044 Q3Action* whatsnext_action = new Q3Action( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
1035 whatsnext_action->addTo( viewMenu ); 1045 whatsnext_action->addTo( viewMenu );
1036 connect( whatsnext_action, SIGNAL( activated() ), 1046 connect( whatsnext_action, SIGNAL( activated() ),
1037 mView->viewManager(), SLOT( showWhatsNextView() ) ); 1047 mView->viewManager(), SLOT( showWhatsNextView() ) );
1038 1048
1039 icon = loadPixmap( pathString + "xdays" ); 1049 icon = loadPixmap( pathString + "xdays" );
1040 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); 1050 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
1041 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 1051 Q3Action* xdays_action = new Q3Action( i18n("Next days"), icon, i18n("Next days"), 0, this );
1042 xdays_action->addTo( viewMenu ); 1052 xdays_action->addTo( viewMenu );
1043 connect( xdays_action, SIGNAL( activated() ), 1053 connect( xdays_action, SIGNAL( activated() ),
1044 mView->viewManager(), SLOT( showNextXView() ) ); 1054 mView->viewManager(), SLOT( showNextXView() ) );
1045 1055
1046 1056
1047 icon = loadPixmap( pathString + "journal" ); 1057 icon = loadPixmap( pathString + "journal" );
1048 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 1058 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
1049 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 1059 Q3Action* viewjournal_action = new Q3Action( i18n("Journal"), icon, i18n("Journal"), 0, this );
1050 viewjournal_action->addTo( viewMenu ); 1060 viewjournal_action->addTo( viewMenu );
1051 connect( viewjournal_action, SIGNAL( activated() ), 1061 connect( viewjournal_action, SIGNAL( activated() ),
1052 mView->viewManager(), SLOT( showJournalView() ) ); 1062 mView->viewManager(), SLOT( showJournalView() ) );
1053 1063
1054 1064
1055 icon = loadPixmap( pathString + "day" ); 1065 icon = loadPixmap( pathString + "day" );
1056 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 1066 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
1057 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 1067 Q3Action* day1_action = new Q3Action( i18n("Day View"), icon, i18n("Day View"), 0, this );
1058 day1_action->addTo( viewMenu ); 1068 day1_action->addTo( viewMenu );
1059 // action->addTo( toolBar ); 1069 // action->addTo( toolBar );
1060 connect( day1_action, SIGNAL( activated() ), 1070 connect( day1_action, SIGNAL( activated() ),
1061 mView->viewManager(), SLOT( showDayView() ) ); 1071 mView->viewManager(), SLOT( showDayView() ) );
1062 1072
1063 icon = loadPixmap( pathString + "workweek" ); 1073 icon = loadPixmap( pathString + "workweek" );
1064 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 1074 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
1065 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 1075 Q3Action* day5_action = new Q3Action( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
1066 day5_action->addTo( viewMenu ); 1076 day5_action->addTo( viewMenu );
1067 connect( day5_action, SIGNAL( activated() ), 1077 connect( day5_action, SIGNAL( activated() ),
1068 mView->viewManager(), SLOT( showWorkWeekView() ) ); 1078 mView->viewManager(), SLOT( showWorkWeekView() ) );
1069 1079
1070 icon = loadPixmap( pathString + "week" ); 1080 icon = loadPixmap( pathString + "week" );
1071 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 1081 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
1072 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 1082 Q3Action* day7_action = new Q3Action( i18n("Week"), icon, i18n("Week"), 0, this );
1073 day7_action->addTo( viewMenu ); 1083 day7_action->addTo( viewMenu );
1074 connect( day7_action, SIGNAL( activated() ), 1084 connect( day7_action, SIGNAL( activated() ),
1075 mView->viewManager(), SLOT( showWeekView() ) ); 1085 mView->viewManager(), SLOT( showWeekView() ) );
1076 1086
1077 icon = loadPixmap( pathString + "workweek2" ); 1087 icon = loadPixmap( pathString + "workweek2" );
1078 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); 1088 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 );
1079 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); 1089 Q3Action* day6_action = new Q3Action( i18n("List week"), icon, i18n("List week"), 0, this );
1080 day6_action->addTo( viewMenu ); 1090 day6_action->addTo( viewMenu );
1081 connect( day6_action, SIGNAL( activated() ), 1091 connect( day6_action, SIGNAL( activated() ),
1082 mView->viewManager(), SLOT( showMonthViewWeek() ) ); 1092 mView->viewManager(), SLOT( showMonthViewWeek() ) );
1083 1093
1084 icon = loadPixmap( pathString + "month" ); 1094 icon = loadPixmap( pathString + "month" );
1085 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 1095 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
1086 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 1096 Q3Action* month_action = new Q3Action( i18n("Month"), icon, i18n("Month"), 0, this );
1087 month_action->addTo( viewMenu ); 1097 month_action->addTo( viewMenu );
1088 connect( month_action, SIGNAL( activated() ), 1098 connect( month_action, SIGNAL( activated() ),
1089 mView->viewManager(), SLOT( showMonthView() ) ); 1099 mView->viewManager(), SLOT( showMonthView() ) );
1090 1100
1091 icon = loadPixmap( pathString + "list" ); 1101 icon = loadPixmap( pathString + "list" );
1092 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 1102 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
1093 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 1103 Q3Action* showlist_action = new Q3Action( i18n("List View"), icon, i18n("List View"), 0, this );
1094 showlist_action->addTo( viewMenu ); 1104 showlist_action->addTo( viewMenu );
1095 connect( showlist_action, SIGNAL( activated() ), 1105 connect( showlist_action, SIGNAL( activated() ),
1096 mView->viewManager(), SLOT( showListView() ) ); 1106 mView->viewManager(), SLOT( showListView() ) );
1097 1107
1098 icon = loadPixmap( pathString + "todo" ); 1108 icon = loadPixmap( pathString + "todo" );
1099 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 1109 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
1100 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 1110 Q3Action* todoview_action = new Q3Action( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
1101 todoview_action->addTo( viewMenu ); 1111 todoview_action->addTo( viewMenu );
1102 connect( todoview_action, SIGNAL( activated() ), 1112 connect( todoview_action, SIGNAL( activated() ),
1103 mView->viewManager(), SLOT( showTodoView() ) ); 1113 mView->viewManager(), SLOT( showTodoView() ) );
1104 1114
1105 1115
1106 1116
1107#if 0 1117#if 0
1108 action = new QAction( "view_timespan", "Time Span", 0, this ); 1118 action = new Q3Action( "view_timespan", "Time Span", 0, this );
1109 action->addTo( viewMenu ); 1119 action->addTo( viewMenu );
1110 connect( action, SIGNAL( activated() ), 1120 connect( action, SIGNAL( activated() ),
1111 mView->viewManager(), SLOT( showTimeSpanView() ) ); 1121 mView->viewManager(), SLOT( showTimeSpanView() ) );
1112#endif 1122#endif
1113 1123
1114 1124
1115 1125
1116 action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, 1126 action = new Q3Action( "purge_completed", i18n("Purge Completed..."), 0,
1117 this ); 1127 this );
1118 action->addTo( actionMenu ); 1128 action->addTo( actionMenu );
1119 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 1129 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
1120 1130
1121 1131
1122 icon = loadPixmap( pathString + "search" ); 1132 icon = loadPixmap( pathString + "search" );
1123 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); 1133 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
1124 1134
1125 1135
1126 1136
1127 actionMenu->insertSeparator(); 1137 actionMenu->insertSeparator();
1128 action = new QAction( "manage cat", i18n("Edit category list..."), 0, 1138 action = new Q3Action( "manage cat", i18n("Edit category list..."), 0,
1129 this ); 1139 this );
1130 action->addTo( actionMenu ); 1140 action->addTo( actionMenu );
1131 connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); 1141 connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) );
1132 1142
1133 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 1143 action = new Q3Action( "manage cat", i18n("Manage new categories..."), 0,
1134 this ); 1144 this );
1135 action->addTo( actionMenu ); 1145 action->addTo( actionMenu );
1136 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 1146 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
1137 1147
1138 1148
1139 actionMenu->insertSeparator(); 1149 actionMenu->insertSeparator();
1140 icon = loadPixmap( pathString + "configure" ); 1150 icon = loadPixmap( pathString + "configure" );
1141 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); 1151 action = new Q3Action( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this );
1142 action->addTo( actionMenu ); 1152 action->addTo( actionMenu );
1143 connect( action, SIGNAL( activated() ), 1153 connect( action, SIGNAL( activated() ),
1144 mView, SLOT( edit_options() ) ); 1154 mView, SLOT( edit_options() ) );
1145 action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); 1155 action = new Q3Action( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this );
1146 action->addTo( actionMenu ); 1156 action->addTo( actionMenu );
1147 connect( action, SIGNAL( activated() ), 1157 connect( action, SIGNAL( activated() ),
1148 this, SLOT( calHint() ) ); 1158 this, SLOT( calHint() ) );
1149 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); 1159 action = new Q3Action( i18n("Configure"),icon, i18n("Global Settings..."), 0, this );
1150 action->addTo( actionMenu ); 1160 action->addTo( actionMenu );
1151 connect( action, SIGNAL( activated() ), 1161 connect( action, SIGNAL( activated() ),
1152 mView, SLOT( edit_global_options() ) ); 1162 mView, SLOT( edit_global_options() ) );
1153 if ( KOPrefs::instance()->mShowFullMenu ) { 1163 if ( KOPrefs::instance()->mShowFullMenu ) {
1154 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 1164 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
1155 1165
1156 } 1166 }
1157 // actionMenu->insertSeparator(); 1167 // actionMenu->insertSeparator();
1158 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 1168 action = new Q3Action( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
1159 this ); 1169 this );
1160 action->addTo( importMenu_X ); 1170 action->addTo( importMenu_X );
1161 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 1171 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
1162 action = new QAction( "import_quick", i18n("Import last file"), 0, 1172 action = new Q3Action( "import_quick", i18n("Import last file"), 0,
1163 this ); 1173 this );
1164 action->addTo( importMenu_X ); 1174 action->addTo( importMenu_X );
1165 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 1175 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
1166 importMenu_X->insertSeparator(); 1176 importMenu_X->insertSeparator();
1167 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 1177 action = new Q3Action( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
1168 this ); 1178 this );
1169 action->addTo( importMenu_X ); 1179 action->addTo( importMenu_X );
1170 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 1180 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
1171 //#ifndef DESKTOP_VERSION 1181 //#ifndef DESKTOP_VERSION
1172 importMenu_X->insertSeparator(); 1182 importMenu_X->insertSeparator();
1173 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 1183 action = new Q3Action( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
1174 this ); 1184 this );
1175 action->addTo( importMenu_X ); 1185 action->addTo( importMenu_X );
1176 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 1186 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
1177 //#else 1187 //#else
1178#ifdef _OL_IMPORT_ 1188#ifdef _OL_IMPORT_
1179 importMenu_X->insertSeparator(); 1189 importMenu_X->insertSeparator();
1180 action = new QAction( "import_ol", i18n("Import from OL"), 0, 1190 action = new Q3Action( "import_ol", i18n("Import from OL"), 0,
1181 this ); 1191 this );
1182 action->addTo( importMenu_X ); 1192 action->addTo( importMenu_X );
1183 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 1193 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
1184#endif 1194#endif
1185 //#endif 1195 //#endif
1186 1196
1187 //importMenu->insertSeparator(); 1197 //importMenu->insertSeparator();
1188#if 0 1198#if 0
1189 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 1199 action = new Q3Action( "load_cal", i18n("Load Calendar Backup"), 0,
1190 this ); 1200 this );
1191 action->addTo( importMenu ); 1201 action->addTo( importMenu );
1192 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 1202 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
1193#endif 1203#endif
1194 action = new QAction( "save_cal", i18n("Save Backup..."), 0, 1204 action = new Q3Action( "save_cal", i18n("Save Backup..."), 0,
1195 this ); 1205 this );
1196 action->addTo( importMenu ); 1206 action->addTo( importMenu );
1197 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 1207 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
1198 importMenu->insertSeparator(); 1208 importMenu->insertSeparator();
1199 importMenu->insertItem( i18n("Import"), importMenu_X ); 1209 importMenu->insertItem( i18n("Import"), importMenu_X );
1200 //importMenu->insertSeparator(); 1210 //importMenu->insertSeparator();
1201 action = new QAction( "export ical", i18n("Export All Data"), 0, 1211 action = new Q3Action( "export ical", i18n("Export All Data"), 0,
1202 this ); 1212 this );
1203 action->addTo( exportMenu_X ); 1213 action->addTo( exportMenu_X );
1204 connect( action, SIGNAL( activated() ), SLOT( exportICalendar() ) ); 1214 connect( action, SIGNAL( activated() ), SLOT( exportICalendar() ) );
1205 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 1215 action = new Q3Action( "import_qtopia", i18n("Export VCalendar"), 0,
1206 this ); 1216 this );
1207 action->addTo( exportMenu_X ); 1217 action->addTo( exportMenu_X );
1208 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 1218 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
1209 1219
1210 1220
1211 //LR 1221 //LR
1212 QPopupMenu *ex2phone = new QPopupMenu( this ); 1222 Q3PopupMenu *ex2phone = new Q3PopupMenu( this );
1213 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1223 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1214 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1224 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1215 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 1225 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
1216 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); 1226 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone );
1217 1227
1218 importMenu->insertItem( i18n("Export"), exportMenu_X ); 1228 importMenu->insertItem( i18n("Export"), exportMenu_X );
1219 mPrintSelAction = 0; 1229 mPrintSelAction = 0;
1220#ifndef DESKTOP_VERSION 1230#ifndef DESKTOP_VERSION
1221 //importMenu->insertSeparator(); 1231 //importMenu->insertSeparator();
1222 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 1232 brAction = new Q3Action( "beam toggle", i18n("Beam receive enabled"), 0,
1223 this ); 1233 this );
1224 brAction->addTo( beamMenu_X ); 1234 brAction->addTo( beamMenu_X );
1225 brAction->setToggleAction (true ) ; 1235 brAction->setToggleAction (true ) ;
1226 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 1236 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
1227 1237
1228 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 1238 action = new Q3Action( "beam all", i18n("Beam complete calendar..."), 0,
1229 this ); 1239 this );
1230 action->addTo( beamMenu_X ); 1240 action->addTo( beamMenu_X );
1231 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 1241 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
1232 1242
1233 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 1243 action = new Q3Action( "beam all", i18n("Beam filtered calendar..."), 0,
1234 this ); 1244 this );
1235 action->addTo( beamMenu_X ); 1245 action->addTo( beamMenu_X );
1236 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 1246 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
1237 importMenu->insertItem( i18n("Beam"), beamMenu_X ); 1247 importMenu->insertItem( i18n("Beam"), beamMenu_X );
1238#else 1248#else
1239 //importMenu->insertSeparator(); 1249 //importMenu->insertSeparator();
1240 icon = loadPixmap( pathString + "print" ); 1250 icon = loadPixmap( pathString + "print" );
1241 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 1251 action = new Q3Action( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
1242 action->addTo( beamMenu_X ); 1252 action->addTo( beamMenu_X );
1243 connect( action, SIGNAL( activated() ), 1253 connect( action, SIGNAL( activated() ),
1244 this, SLOT( printCal() ) ); 1254 this, SLOT( printCal() ) );
1245 1255
1246 icon = loadPixmap( pathString + "week" ); 1256 icon = loadPixmap( pathString + "week" );
1247 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 1257 action = new Q3Action( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
1248 action->addTo( beamMenu_X ); 1258 action->addTo( beamMenu_X );
1249 connect( action, SIGNAL( activated() ), 1259 connect( action, SIGNAL( activated() ),
1250 this, SLOT( printSel() ) ); 1260 this, SLOT( printSel() ) );
1251 icon = loadPixmap( pathString + "whatsnext" ); 1261 icon = loadPixmap( pathString + "whatsnext" );
1252 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); 1262 action = new Q3Action( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
1253 action->addTo( beamMenu_X ); 1263 action->addTo( beamMenu_X );
1254 connect( action, SIGNAL( activated() ), 1264 connect( action, SIGNAL( activated() ),
1255 mView->viewManager(), SLOT( slotprintWNV() ) ); 1265 mView->viewManager(), SLOT( slotprintWNV() ) );
1256 1266
1257 1267
1258 icon = loadPixmap( pathString + "list" ); 1268 icon = loadPixmap( pathString + "list" );
1259 action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); 1269 action = new Q3Action( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this );
1260 action->addTo( beamMenu_X ); 1270 action->addTo( beamMenu_X );
1261 connect( action, SIGNAL( activated() ), 1271 connect( action, SIGNAL( activated() ),
1262 this, SLOT( printListView() ) ); 1272 this, SLOT( printListView() ) );
1263 1273
1264 icon = loadPixmap( pathString + "newevent" ); 1274 icon = loadPixmap( pathString + "newevent" );
1265 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); 1275 action = new Q3Action( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this );
1266 action->addTo( beamMenu_X ); 1276 action->addTo( beamMenu_X );
1267 connect( action, SIGNAL( activated() ), 1277 connect( action, SIGNAL( activated() ),
1268 mView, SLOT( slotprintSelInc() ) ); 1278 mView, SLOT( slotprintSelInc() ) );
1269 mPrintSelAction = action; 1279 mPrintSelAction = action;
1270 importMenu->insertItem( i18n("Print"), beamMenu_X ); 1280 importMenu->insertItem( i18n("Print"), beamMenu_X );
1271#endif 1281#endif
1272 1282
1273 importMenu->insertSeparator(); 1283 importMenu->insertSeparator();
1274 action = new QAction( "beam all", i18n("Save"), 0, 1284 action = new Q3Action( "beam all", i18n("Save"), 0,
1275 this ); 1285 this );
1276 action->addTo( importMenu ); 1286 action->addTo( importMenu );
1277 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 1287 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
1278 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 1288 action = new Q3Action( "beam all", i18n("Exit (+save)"), 0,
1279 this ); 1289 this );
1280 action->addTo( importMenu ); 1290 action->addTo( importMenu );
1281 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 1291 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
1282 1292
1283 //menuBar->insertItem( "Configure",configureMenu ); 1293 //menuBar->insertItem( "Configure",configureMenu );
1284 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 1294 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
1285 icon = loadPixmap( "korganizer/korganizer" ); 1295 icon = loadPixmap( "korganizer/korganizer" );
1286 1296
1287 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 1297 action = new Q3Action( "Whats New", i18n("What's new?"), 0,this );
1288 action->addTo( helpMenu ); 1298 action->addTo( helpMenu );
1289 connect( action, SIGNAL( activated() ), 1299 connect( action, SIGNAL( activated() ),
1290 SLOT( whatsNew() ) ); 1300 SLOT( whatsNew() ) );
1291 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 1301 action = new Q3Action( "featureHowto", i18n("Features + hints..."), 0,this );
1292 action->addTo( helpMenu ); 1302 action->addTo( helpMenu );
1293 connect( action, SIGNAL( activated() ), 1303 connect( action, SIGNAL( activated() ),
1294 SLOT( features() ) ); 1304 SLOT( features() ) );
1295 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 1305 action = new Q3Action( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
1296 action->addTo( helpMenu ); 1306 action->addTo( helpMenu );
1297 connect( action, SIGNAL( activated() ), 1307 connect( action, SIGNAL( activated() ),
1298 SLOT( keyBindings() ) ); 1308 SLOT( keyBindings() ) );
1299 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); 1309 action = new Q3Action( "Storage Howto", i18n("Storage HowTo..."), 0,this );
1300 action->addTo( helpMenu ); 1310 action->addTo( helpMenu );
1301 connect( action, SIGNAL( activated() ), 1311 connect( action, SIGNAL( activated() ),
1302 SLOT( storagehowto() ) ); 1312 SLOT( storagehowto() ) );
1303 action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); 1313 action = new Q3Action( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this );
1304 action->addTo( helpMenu ); 1314 action->addTo( helpMenu );
1305 connect( action, SIGNAL( activated() ), 1315 connect( action, SIGNAL( activated() ),
1306 SLOT( timetrackinghowto() ) ); 1316 SLOT( timetrackinghowto() ) );
1307 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 1317 action = new Q3Action( "Sync Howto", i18n("Sync HowTo..."), 0,this );
1308 action->addTo( helpMenu ); 1318 action->addTo( helpMenu );
1309 connect( action, SIGNAL( activated() ), 1319 connect( action, SIGNAL( activated() ),
1310 SLOT( synchowto() ) ); 1320 SLOT( synchowto() ) );
1311 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 1321 action = new Q3Action( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
1312 action->addTo( helpMenu ); 1322 action->addTo( helpMenu );
1313 connect( action, SIGNAL( activated() ), 1323 connect( action, SIGNAL( activated() ),
1314 SLOT( kdesynchowto() ) ); 1324 SLOT( kdesynchowto() ) );
1315 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 1325 action = new Q3Action( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
1316 action->addTo( helpMenu ); 1326 action->addTo( helpMenu );
1317 connect( action, SIGNAL( activated() ), 1327 connect( action, SIGNAL( activated() ),
1318 SLOT( multisynchowto() ) ); 1328 SLOT( multisynchowto() ) );
1319 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 1329 action = new Q3Action( "Auto saving", i18n("Auto saving..."), 0, this );
1320 action->addTo( helpMenu ); 1330 action->addTo( helpMenu );
1321 connect( action, SIGNAL( activated() ), 1331 connect( action, SIGNAL( activated() ),
1322 SLOT( aboutAutoSaving() ) ); 1332 SLOT( aboutAutoSaving() ) );
1323 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 1333 action = new Q3Action( "Problemd", i18n("Known Problems..."), 0,this );
1324 action->addTo( helpMenu ); 1334 action->addTo( helpMenu );
1325 connect( action, SIGNAL( activated() ), 1335 connect( action, SIGNAL( activated() ),
1326 SLOT( aboutKnownBugs() ) ); 1336 SLOT( aboutKnownBugs() ) );
1327 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 1337 action = new Q3Action( "Translate Howto", i18n("User translation..."), 0,this );
1328 action->addTo( helpMenu ); 1338 action->addTo( helpMenu );
1329 connect( action, SIGNAL( activated() ), 1339 connect( action, SIGNAL( activated() ),
1330 SLOT( usertrans() ) ); 1340 SLOT( usertrans() ) );
1331 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 1341 action = new Q3Action( "Frequently asked questions", i18n("FAQ..."), 0,this );
1332 action->addTo( helpMenu ); 1342 action->addTo( helpMenu );
1333 connect( action, SIGNAL( activated() ), 1343 connect( action, SIGNAL( activated() ),
1334 SLOT( faq() ) ); 1344 SLOT( faq() ) );
1335 action = new QAction( "licence", i18n("Licence..."), 0, this ); 1345 action = new Q3Action( "licence", i18n("Licence..."), 0, this );
1336 action->addTo( helpMenu ); 1346 action->addTo( helpMenu );
1337 connect( action, SIGNAL( activated() ), 1347 connect( action, SIGNAL( activated() ),
1338 SLOT( licence() ) ); 1348 SLOT( licence() ) );
1339 action = new QAction( "about", i18n("About..."), 0, this ); 1349 action = new Q3Action( "about", i18n("About..."), 0, this );
1340 action->addTo( helpMenu ); 1350 action->addTo( helpMenu );
1341 connect( action, SIGNAL( activated() ), 1351 connect( action, SIGNAL( activated() ),
1342 SLOT( about() ) ); 1352 SLOT( about() ) );
1343 //menuBar->insertSeparator(); 1353 //menuBar->insertSeparator();
1344 1354
1345 // ****************************************************** 1355 // ******************************************************
1346 // menubar icons 1356 // menubar icons
1347 1357
1348 1358
1349 1359
1350 //menuBar->insertItem( iconToolBar ); 1360 //menuBar->insertItem( iconToolBar );
1351 //xdays_action 1361 //xdays_action
1352 if (p-> mShowIconNewEvent) 1362 if (p-> mShowIconNewEvent)
1353 ne_action->addTo( iconToolBar ); 1363 ne_action->addTo( iconToolBar );
1354 if (p->mShowIconNewTodo ) 1364 if (p->mShowIconNewTodo )
1355 nt_action->addTo( iconToolBar ); 1365 nt_action->addTo( iconToolBar );
1356 if (p-> mShowIconSearch) 1366 if (p-> mShowIconSearch)
1357 search_action->addTo( iconToolBar ); 1367 search_action->addTo( iconToolBar );
1358 if (p-> mShowIconWhatsThis) 1368 if (p-> mShowIconWhatsThis)
1359 QWhatsThis::whatsThisButton ( iconToolBar ); 1369 Q3WhatsThis::whatsThisButton ( iconToolBar );
1360 if (p-> mShowIconNext) 1370 if (p-> mShowIconNext)
1361 whatsnext_action->addTo( viewToolBar ); 1371 whatsnext_action->addTo( viewToolBar );
1362 if (p-> mShowIconNextDays) 1372 if (p-> mShowIconNextDays)
1363 xdays_action->addTo( viewToolBar ); 1373 xdays_action->addTo( viewToolBar );
1364 if (p-> mShowIconJournal) 1374 if (p-> mShowIconJournal)
1365 viewjournal_action->addTo( viewToolBar ); 1375 viewjournal_action->addTo( viewToolBar );
1366 if (p-> mShowIconDay1) 1376 if (p-> mShowIconDay1)
1367 day1_action->addTo( viewToolBar ); 1377 day1_action->addTo( viewToolBar );
1368 if (p-> mShowIconDay5) 1378 if (p-> mShowIconDay5)
1369 day5_action->addTo( viewToolBar ); 1379 day5_action->addTo( viewToolBar );
1370 if (p-> mShowIconDay7) 1380 if (p-> mShowIconDay7)
1371 day7_action->addTo( viewToolBar ); 1381 day7_action->addTo( viewToolBar );
1372 if (p-> mShowIconDay6) 1382 if (p-> mShowIconDay6)
1373 day6_action->addTo( viewToolBar ); 1383 day6_action->addTo( viewToolBar );
1374 if (p-> mShowIconMonth) 1384 if (p-> mShowIconMonth)
1375 month_action->addTo( viewToolBar ); 1385 month_action->addTo( viewToolBar );
1376 if (p-> mShowIconList) 1386 if (p-> mShowIconList)
1377 showlist_action->addTo( viewToolBar ); 1387 showlist_action->addTo( viewToolBar );
1378 if (p-> mShowIconTodoview) 1388 if (p-> mShowIconTodoview)
1379 todoview_action->addTo( viewToolBar ); 1389 todoview_action->addTo( viewToolBar );
1380 1390
1381 icon = loadPixmap( pathString + "2leftarrowB" ); 1391 icon = loadPixmap( pathString + "2leftarrowB" );
1382 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); 1392 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200);
1383 if (p-> mShowIconBackFast) { 1393 if (p-> mShowIconBackFast) {
1384 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1394 action = new Q3Action( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1385 connect( action, SIGNAL( activated() ), 1395 connect( action, SIGNAL( activated() ),
1386 mView, SLOT( goPreviousMonth() ) ); 1396 mView, SLOT( goPreviousMonth() ) );
1387 action->addTo( navigatorToolBar ); 1397 action->addTo( navigatorToolBar );
1388 } 1398 }
1389 icon = loadPixmap( pathString + "1leftarrowB" ); 1399 icon = loadPixmap( pathString + "1leftarrowB" );
1390 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); 1400 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210);
1391 if (p-> mShowIconBack) { 1401 if (p-> mShowIconBack) {
1392 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1402 action = new Q3Action( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1393 connect( action, SIGNAL( activated() ), 1403 connect( action, SIGNAL( activated() ),
1394 mView, SLOT( goPrevious() ) ); 1404 mView, SLOT( goPrevious() ) );
1395 action->addTo( navigatorToolBar ); 1405 action->addTo( navigatorToolBar );
1396 } 1406 }
1397 icon = loadPixmap( pathString + "today" ); 1407 icon = loadPixmap( pathString + "today" );
1398 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1408 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1399 if (p-> mShowIconToday) 1409 if (p-> mShowIconToday)
1400 today_action->addTo( navigatorToolBar ); 1410 today_action->addTo( navigatorToolBar );
1401 icon = loadPixmap( pathString + "1rightarrowB" ); 1411 icon = loadPixmap( pathString + "1rightarrowB" );
1402 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1412 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1403 if (p-> mShowIconForward) { 1413 if (p-> mShowIconForward) {
1404 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1414 action = new Q3Action( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1405 connect( action, SIGNAL( activated() ), 1415 connect( action, SIGNAL( activated() ),
1406 mView, SLOT( goNext() ) ); 1416 mView, SLOT( goNext() ) );
1407 action->addTo( navigatorToolBar ); 1417 action->addTo( navigatorToolBar );
1408 } 1418 }
1409 icon = loadPixmap( pathString + "2rightarrowB" ); 1419 icon = loadPixmap( pathString + "2rightarrowB" );
1410 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 1420 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
1411 if (p-> mShowIconForwardFast) { 1421 if (p-> mShowIconForwardFast) {
1412 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1422 action = new Q3Action( i18n("Next month"), icon, i18n("Next month"),0 , this );
1413 connect( action, SIGNAL( activated() ), 1423 connect( action, SIGNAL( activated() ),
1414 mView, SLOT( goNextMonth() ) ); 1424 mView, SLOT( goNextMonth() ) );
1415 action->addTo( navigatorToolBar ); 1425 action->addTo( navigatorToolBar );
1416 } 1426 }
1417 1427
1418 1428
1419 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); 1429 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6);
1420 1430
1421 1431
1422 if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); 1432 if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true);
1423 if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); 1433 if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true);
1424 if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); 1434 if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true);
@@ -1515,25 +1525,25 @@ void MainWindow::exportToPhone( int mode )
1515 ex2phone.setCaption(i18n("Export filtered calendar")); 1525 ex2phone.setCaption(i18n("Export filtered calendar"));
1516 1526
1517 if ( !ex2phone.exec() ) { 1527 if ( !ex2phone.exec() ) {
1518 return; 1528 return;
1519 } 1529 }
1520 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1530 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1521 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1531 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1522 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1532 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1523 1533
1524 int inFuture = 0; 1534 int inFuture = 0;
1525 if ( ex2phone.mWriteBackFuture->isChecked() ) 1535 if ( ex2phone.mWriteBackFuture->isChecked() )
1526 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1536 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1527 QPtrList<Incidence> delSel; 1537 Q3PtrList<Incidence> delSel;
1528 if ( mode == 1 ) 1538 if ( mode == 1 )
1529 delSel = mCalendar->rawIncidences(); 1539 delSel = mCalendar->rawIncidences();
1530 if ( mode == 2 ) 1540 if ( mode == 2 )
1531 delSel = mCalendar->incidences(); 1541 delSel = mCalendar->incidences();
1532 CalendarLocal* cal = new CalendarLocal(); 1542 CalendarLocal* cal = new CalendarLocal();
1533 cal->setLocalTime(); 1543 cal->setLocalTime();
1534 Incidence *incidence = delSel.first(); 1544 Incidence *incidence = delSel.first();
1535 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1545 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1536 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1546 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1537 while ( incidence ) { 1547 while ( incidence ) {
1538 if ( incidence->typeID() != journalID ) { 1548 if ( incidence->typeID() != journalID ) {
1539 bool add = true; 1549 bool add = true;
@@ -1586,28 +1596,28 @@ void MainWindow::setDefaultPreferences()
1586 1596
1587} 1597}
1588 1598
1589QString MainWindow::resourcePath() 1599QString MainWindow::resourcePath()
1590{ 1600{
1591 return KGlobal::iconLoader()->iconPath(); 1601 return KGlobal::iconLoader()->iconPath();
1592} 1602}
1593 1603
1594void MainWindow::displayText( QString text ,QString cap ) 1604void MainWindow::displayText( QString text ,QString cap )
1595{ 1605{
1596 QDialog dia( this, "name", true ); ; 1606 QDialog dia( this, "name", true ); ;
1597 dia.setCaption( cap ); 1607 dia.setCaption( cap );
1598 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1608 Q3VBoxLayout* lay = new Q3VBoxLayout( &dia );
1599 lay->setSpacing( 3 ); 1609 lay->setSpacing( 3 );
1600 lay->setMargin( 3 ); 1610 lay->setMargin( 3 );
1601 QTextBrowser tb ( &dia ); 1611 Q3TextBrowser tb ( &dia );
1602 lay->addWidget( &tb ); 1612 lay->addWidget( &tb );
1603 tb.setText( text ); 1613 tb.setText( text );
1604#ifdef DESKTOP_VERSION 1614#ifdef DESKTOP_VERSION
1605 dia.resize( 640, 480); 1615 dia.resize( 640, 480);
1606#else 1616#else
1607 dia.showMaximized(); 1617 dia.showMaximized();
1608#endif 1618#endif
1609 dia.exec(); 1619 dia.exec();
1610} 1620}
1611 1621
1612void MainWindow::features() 1622void MainWindow::features()
1613{ 1623{
@@ -1768,27 +1778,27 @@ QString MainWindow::syncFileName()
1768#else 1778#else
1769 return QString( "/tmp/synccalendar.ics" ); 1779 return QString( "/tmp/synccalendar.ics" );
1770#endif 1780#endif
1771} 1781}
1772#include "koglobals.h" 1782#include "koglobals.h"
1773#include <kcalendarsystem.h> 1783#include <kcalendarsystem.h>
1774void MainWindow::updateWeek(QDate seda) 1784void MainWindow::updateWeek(QDate seda)
1775{ 1785{
1776 int weekNum = KGlobal::locale()->weekNum ( seda ); 1786 int weekNum = KGlobal::locale()->weekNum ( seda );
1777 mWeekPixmap.fill( mWeekBgColor ); 1787 mWeekPixmap.fill( mWeekBgColor );
1778 QPainter p ( &mWeekPixmap ); 1788 QPainter p ( &mWeekPixmap );
1779 p.setFont( mWeekFont ); 1789 p.setFont( mWeekFont );
1780 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1790 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),Qt::AlignCenter, QString::number( weekNum) );
1781 p.end(); 1791 p.end();
1782 QIconSet icon3 ( mWeekPixmap ); 1792 QIcon icon3 ( mWeekPixmap );
1783 mWeekAction->setIconSet ( icon3 ); 1793 mWeekAction->setIconSet ( icon3 );
1784 1794
1785} 1795}
1786void MainWindow::updateWeekNum(const DateList &selectedDates) 1796void MainWindow::updateWeekNum(const DateList &selectedDates)
1787{ 1797{
1788 updateWeek( selectedDates.first() ); 1798 updateWeek( selectedDates.first() );
1789} 1799}
1790void MainWindow::processIncidenceSelection( Incidence *incidence ) 1800void MainWindow::processIncidenceSelection( Incidence *incidence )
1791{ 1801{
1792 if ( !incidence ) { 1802 if ( !incidence ) {
1793 mShowAction->setMenuText( i18n("Show") ); 1803 mShowAction->setMenuText( i18n("Show") );
1794 enableIncidenceActions( false ); 1804 enableIncidenceActions( false );
@@ -1803,25 +1813,25 @@ void MainWindow::processIncidenceSelection( Incidence *incidence )
1803 startString += ": "+incidence->dtStartDateStr( true ); 1813 startString += ": "+incidence->dtStartDateStr( true );
1804 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1814 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1805 } else { 1815 } else {
1806 startString = ": "+incidence->dtStartStr(true); 1816 startString = ": "+incidence->dtStartStr(true);
1807 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1817 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1808 } 1818 }
1809 } else { 1819 } else {
1810 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1820 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1811 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1821 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1812 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1822 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1813 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1823 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1814 bool ok; 1824 bool ok;
1815 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1825 QDateTime noc = incidence->getNextOccurence( (QDateTime)mView->startDate().addDays(-1), &ok );
1816 if ( ok ) { 1826 if ( ok ) {
1817 int years = noc.date().year() - incidence->dtStart().date().year(); 1827 int years = noc.date().year() - incidence->dtStart().date().year();
1818 startString += i18n(" (%1 y.)"). arg( years ); 1828 startString += i18n(" (%1 y.)"). arg( years );
1819 } 1829 }
1820 } 1830 }
1821 else 1831 else
1822 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1832 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1823 } 1833 }
1824 } 1834 }
1825 else { 1835 else {
1826 if ( (( KCal::Todo*)incidence)->percentComplete() == 100 ) 1836 if ( (( KCal::Todo*)incidence)->percentComplete() == 100 )
1827 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) ); 1837 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) );
@@ -1837,31 +1847,31 @@ void MainWindow::processIncidenceSelection( Incidence *incidence )
1837 mNewSubTodoAction->setEnabled( false ); 1847 mNewSubTodoAction->setEnabled( false );
1838 } else if ( incidence->typeID() == todoID ) { 1848 } else if ( incidence->typeID() == todoID ) {
1839 mShowAction->setMenuText( i18n("Show Todo") ); 1849 mShowAction->setMenuText( i18n("Show Todo") );
1840 mNewSubTodoAction->setEnabled( true ); 1850 mNewSubTodoAction->setEnabled( true );
1841 } else { 1851 } else {
1842 mShowAction->setMenuText( i18n("Show") ); 1852 mShowAction->setMenuText( i18n("Show") );
1843 mNewSubTodoAction->setEnabled( false ); 1853 mNewSubTodoAction->setEnabled( false );
1844 } 1854 }
1845#ifdef DESKTOP_VERSION 1855#ifdef DESKTOP_VERSION
1846 static QPixmap jP = SmallIcon( "journal" ); 1856 static QPixmap jP = SmallIcon( "journal" );
1847 static QPixmap eP = SmallIcon( "newevent" ); 1857 static QPixmap eP = SmallIcon( "newevent" );
1848 static QPixmap tP = SmallIcon( "newtodo" ); 1858 static QPixmap tP = SmallIcon( "newtodo" );
1849 QIconSet icon; 1859 QIcon icon;
1850 if ( incidence->typeID() == todoID ) 1860 if ( incidence->typeID() == todoID )
1851 icon = QIconSet ( tP ); 1861 icon = QIcon ( tP );
1852 else if ( incidence->typeID() == eventID ) 1862 else if ( incidence->typeID() == eventID )
1853 icon = QIconSet ( eP ); 1863 icon = QIcon ( eP );
1854 else if ( incidence->typeID() == journalID ) 1864 else if ( incidence->typeID() == journalID )
1855 icon = QIconSet ( jP ); 1865 icon = QIcon ( jP );
1856 mPrintSelAction->setIconSet ( icon ); 1866 mPrintSelAction->setIconSet ( icon );
1857#endif 1867#endif
1858} 1868}
1859 1869
1860void MainWindow::enableIncidenceActions( bool enabled ) 1870void MainWindow::enableIncidenceActions( bool enabled )
1861{ 1871{
1862 mShowAction->setEnabled( enabled ); 1872 mShowAction->setEnabled( enabled );
1863 mEditAction->setEnabled( enabled ); 1873 mEditAction->setEnabled( enabled );
1864 mDeleteAction->setEnabled( enabled ); 1874 mDeleteAction->setEnabled( enabled );
1865 1875
1866 mCloneAction->setEnabled( enabled ); 1876 mCloneAction->setEnabled( enabled );
1867 mMoveAction->setEnabled( enabled ); 1877 mMoveAction->setEnabled( enabled );
@@ -2036,25 +2046,25 @@ void MainWindow::backupAllFiles()
2036 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 2046 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
2037 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 2047 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
2038 bupDir = KGlobalSettings::backupDataDir(); 2048 bupDir = KGlobalSettings::backupDataDir();
2039 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 2049 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
2040 if ( retval == 0 ) { 2050 if ( retval == 0 ) {
2041 setCaption(i18n("Backup cancelled" )); 2051 setCaption(i18n("Backup cancelled" ));
2042 qDebug("KO: Backup cancelled. Will try again tomorrow "); 2052 qDebug("KO: Backup cancelled. Will try again tomorrow ");
2043 // retval == 0 : backup skipped for today, try again tomorrow 2053 // retval == 0 : backup skipped for today, try again tomorrow
2044 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; 2054 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1;
2045 } else if ( retval == 1 ){ 2055 } else if ( retval == 1 ){
2046 qDebug("KO: Backup created."); 2056 qDebug("KO: Backup created.");
2047 // backup ok 2057 // backup ok
2048 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2058 Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2049 KopiCalendarFile * cal = calendars.first(); 2059 KopiCalendarFile * cal = calendars.first();
2050 cal = calendars.next(); 2060 cal = calendars.next();
2051 while ( cal ) { 2061 while ( cal ) {
2052 if ( !cal->mErrorOnLoad ) { 2062 if ( !cal->mErrorOnLoad ) {
2053 KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 2063 KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
2054 } 2064 }
2055 cal = calendars.next(); 2065 cal = calendars.next();
2056 } 2066 }
2057 KOPrefs::instance()->mLastBackupDate = daysTo; 2067 KOPrefs::instance()->mLastBackupDate = daysTo;
2058 setCaption(i18n("Backup succesfully finished" )); 2068 setCaption(i18n("Backup succesfully finished" ));
2059 } else if ( retval == 2 ){ 2069 } else if ( retval == 2 ){
2060 setCaption(i18n("Backup globally disabled" )); 2070 setCaption(i18n("Backup globally disabled" ));
@@ -2332,25 +2342,25 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
2332 ;// setCaptionToDates(); 2342 ;// setCaptionToDates();
2333 } 2343 }
2334 2344
2335} 2345}
2336void MainWindow::fillFilterMenuTB() 2346void MainWindow::fillFilterMenuTB()
2337{ 2347{
2338 selectFilterMenuTB->clear(); 2348 selectFilterMenuTB->clear();
2339 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); 2349 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
2340 selectFilterMenuTB->insertSeparator(); 2350 selectFilterMenuTB->insertSeparator();
2341 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); 2351 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
2342 2352
2343 selectFilterMenuTB->insertSeparator(); 2353 selectFilterMenuTB->insertSeparator();
2344 QPtrList<CalFilter> fili = mView->filters(); 2354 Q3PtrList<CalFilter> fili = mView->filters();
2345 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2355 CalFilter *curfilter = mView->filterView()->selectedFilter();
2346 CalFilter *filter = fili.first(); 2356 CalFilter *filter = fili.first();
2347 int iii = 2; 2357 int iii = 2;
2348 bool checkitem = mView->filterView()->filtersEnabled(); 2358 bool checkitem = mView->filterView()->filtersEnabled();
2349 while(filter) { 2359 while(filter) {
2350 selectFilterMenuTB->insertItem( filter->name(), iii ); 2360 selectFilterMenuTB->insertItem( filter->name(), iii );
2351 if ( filter == curfilter) 2361 if ( filter == curfilter)
2352 selectFilterMenuTB->setItemChecked( iii, checkitem ); 2362 selectFilterMenuTB->setItemChecked( iii, checkitem );
2353 filter = fili.next(); 2363 filter = fili.next();
2354 ++iii; 2364 ++iii;
2355 } 2365 }
2356 if ( !checkitem ) 2366 if ( !checkitem )
@@ -2377,46 +2387,46 @@ void MainWindow::fillFilterMenuTB()
2377 } 2387 }
2378 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2388 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2379 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); 2389 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2380} 2390}
2381void MainWindow::fillFilterMenu() 2391void MainWindow::fillFilterMenu()
2382{ 2392{
2383 selectFilterMenu->clear(); 2393 selectFilterMenu->clear();
2384 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2394 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
2385 selectFilterMenu->insertSeparator(); 2395 selectFilterMenu->insertSeparator();
2386 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2396 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
2387 2397
2388 selectFilterMenu->insertSeparator(); 2398 selectFilterMenu->insertSeparator();
2389 QPtrList<CalFilter> fili = mView->filters(); 2399 Q3PtrList<CalFilter> fili = mView->filters();
2390 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2400 CalFilter *curfilter = mView->filterView()->selectedFilter();
2391 CalFilter *filter = fili.first(); 2401 CalFilter *filter = fili.first();
2392 int iii = 2; 2402 int iii = 2;
2393 bool checkitem = mView->filterView()->filtersEnabled(); 2403 bool checkitem = mView->filterView()->filtersEnabled();
2394 while(filter) { 2404 while(filter) {
2395 selectFilterMenu->insertItem( filter->name(), iii ); 2405 selectFilterMenu->insertItem( filter->name(), iii );
2396 if ( filter == curfilter) 2406 if ( filter == curfilter)
2397 selectFilterMenu->setItemChecked( iii, checkitem ); 2407 selectFilterMenu->setItemChecked( iii, checkitem );
2398 filter = fili.next(); 2408 filter = fili.next();
2399 ++iii; 2409 ++iii;
2400 } 2410 }
2401 if ( !checkitem ) 2411 if ( !checkitem )
2402 selectFilterMenu->setItemChecked( 1, true ); 2412 selectFilterMenu->setItemChecked( 1, true );
2403} 2413}
2404void MainWindow::fillFilterMenuPopup() 2414void MainWindow::fillFilterMenuPopup()
2405{ 2415{
2406 filterPopupMenu->clear(); 2416 filterPopupMenu->clear();
2407 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2417 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2408 2418
2409 filterPopupMenu->insertSeparator(); 2419 filterPopupMenu->insertSeparator();
2410 QPtrList<CalFilter> fili = mView->filters(); 2420 Q3PtrList<CalFilter> fili = mView->filters();
2411 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2421 CalFilter *curfilter = mView->filterView()->selectedFilter();
2412 CalFilter *filter = fili.first(); 2422 CalFilter *filter = fili.first();
2413 int iii = 1; 2423 int iii = 1;
2414 bool checkitem = mView->filterView()->filtersEnabled(); 2424 bool checkitem = mView->filterView()->filtersEnabled();
2415 while(filter) { 2425 while(filter) {
2416 filterPopupMenu->insertItem( filter->name(), iii ); 2426 filterPopupMenu->insertItem( filter->name(), iii );
2417 if ( filter == curfilter) 2427 if ( filter == curfilter)
2418 filterPopupMenu->setItemChecked( iii, checkitem ); 2428 filterPopupMenu->setItemChecked( iii, checkitem );
2419 filter = fili.next(); 2429 filter = fili.next();
2420 ++iii; 2430 ++iii;
2421 } 2431 }
2422 if ( !checkitem ) 2432 if ( !checkitem )
@@ -2810,14 +2820,14 @@ void MainWindow::hideEvent ( QHideEvent * )
2810void MainWindow::resizeEvent( QResizeEvent* e) 2820void MainWindow::resizeEvent( QResizeEvent* e)
2811{ 2821{
2812#ifndef DESKTOP_VERSION 2822#ifndef DESKTOP_VERSION
2813 if ( filterToolBar ) { 2823 if ( filterToolBar ) {
2814 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) { 2824 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) {
2815 if (QApplication::desktop()->width() > QApplication::desktop()->height() ) 2825 if (QApplication::desktop()->width() > QApplication::desktop()->height() )
2816 filterToolBar->hide(); 2826 filterToolBar->hide();
2817 else 2827 else
2818 filterToolBar->show(); 2828 filterToolBar->show();
2819 } 2829 }
2820 } 2830 }
2821#endif 2831#endif
2822 QMainWindow::resizeEvent( e); 2832 Q3MainWindow::resizeEvent( e);
2823} 2833}
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index a533d8b..6756216 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -1,65 +1,73 @@
1#ifndef KORGE_MAINWINDOW_H 1#ifndef KORGE_MAINWINDOW_H
2#define KORGE_MAINWINDOW_H 2#define KORGE_MAINWINDOW_H
3 3
4#include <qmainwindow.h> 4#include <q3mainwindow.h>
5#include <qtimer.h> 5#include <qtimer.h>
6#include <qdict.h> 6#include <q3dict.h>
7#include <qfile.h> 7#include <qfile.h>
8#include <qmenubar.h> 8#include <qmenubar.h>
9#include <qtextstream.h> 9#include <q3textstream.h>
10#include <qregexp.h> 10#include <qregexp.h>
11//Added by qt3to4:
12#include <Q3CString>
13#include <QCloseEvent>
14#include <QResizeEvent>
15#include <QPixmap>
16#include <Q3PopupMenu>
17#include <QHideEvent>
18#include <QKeyEvent>
11 19
12#include <libkcal/incidence.h> 20#include <libkcal/incidence.h>
13#include <ksyncmanager.h> 21#include <ksyncmanager.h>
14#include <kpopupmenu.h> 22#include <kpopupmenu.h>
15#ifndef DESKTOP_VERSION 23#ifndef DESKTOP_VERSION
16#include <qcopchannel_qws.h> 24#include <qcopchannel_qws.h>
17#endif 25#endif
18class QAction; 26class Q3Action;
19class CalendarView; 27class CalendarView;
20class KSyncProfile; 28class KSyncProfile;
21#ifdef DESKTOP_VERSION 29#ifdef DESKTOP_VERSION
22 30
23#define QPEToolBar QToolBar 31#define QPEToolBar Q3ToolBar
24#endif 32#endif
25class QPEToolBar; 33class QPEToolBar;
26 34
27 35
28namespace KCal { 36namespace KCal {
29class CalendarLocal; 37class CalendarLocal;
30} 38}
31 39
32using namespace KCal; 40using namespace KCal;
33 41
34class MainWindow : public QMainWindow 42class MainWindow : public Q3MainWindow
35{ 43{
36 Q_OBJECT 44 Q_OBJECT
37 public: 45 public:
38 MainWindow( QWidget *parent = 0, const char *name = 0 ); 46 MainWindow( QWidget *parent = 0, const char *name = 0 );
39 ~MainWindow(); 47 ~MainWindow();
40 bool beamReceiveEnabled(); 48 bool beamReceiveEnabled();
41 static QString defaultFileName(); 49 static QString defaultFileName();
42 static QString syncFileName(); 50 static QString syncFileName();
43 static QString resourcePath(); 51 static QString resourcePath();
44 public slots: 52 public slots:
45 void setUsesBigPixmaps ( bool ); 53 void setUsesBigPixmaps ( bool );
46 void setCaption ( const QString & ); 54 void setCaption ( const QString & );
47 void updateWeekNum(const KCal::DateList &); 55 void updateWeekNum(const KCal::DateList &);
48 void updateWeek(QDate); 56 void updateWeek(QDate);
49 void updateFilterToolbar(); 57 void updateFilterToolbar();
50 virtual void showMaximized (); 58 virtual void showMaximized ();
51 void configureAgenda( int ); 59 void configureAgenda( int );
52 void recieve( const QCString& msg, const QByteArray& data ); 60 void recieve( const Q3CString& msg, const QByteArray& data );
53 void receiveStart( const QCString& msg, const QByteArray& data ); 61 void receiveStart( const Q3CString& msg, const QByteArray& data );
54 protected slots: 62 protected slots:
55 void autoSaveWarning(); 63 void autoSaveWarning();
56 void loadDataAfterStart(); 64 void loadDataAfterStart();
57 void calHint(); 65 void calHint();
58 void startMultiSync(); 66 void startMultiSync();
59 void setCaptionToDates(); 67 void setCaptionToDates();
60 void weekAction(); 68 void weekAction();
61 void about(); 69 void about();
62 void licence(); 70 void licence();
63 void faq(); 71 void faq();
64 void usertrans(); 72 void usertrans();
65 void features(); 73 void features();
@@ -115,76 +123,76 @@ class MainWindow : public QMainWindow
115 123
116 protected: 124 protected:
117 int mFocusLoop; 125 int mFocusLoop;
118 void hideEvent ( QHideEvent * ); 126 void hideEvent ( QHideEvent * );
119 QString sentSyncFile(); 127 QString sentSyncFile();
120 void displayText( QString, QString); 128 void displayText( QString, QString);
121 void enableIncidenceActions( bool ); 129 void enableIncidenceActions( bool );
122 bool askForQuitOnSaveError(); 130 bool askForQuitOnSaveError();
123 131
124 private: 132 private:
125 bool mAutoSaveDisabled; 133 bool mAutoSaveDisabled;
126 bool checkAutosave(); 134 bool checkAutosave();
127 QCString mCStringMess; 135 Q3CString mCStringMess;
128 QByteArray mByteData; 136 QByteArray mByteData;
129 137
130 //void setMenuBar( QMenuBar * ); 138 //void setMenuBar( QMenuBar * );
131 bool mBRdisabled; 139 bool mBRdisabled;
132#ifndef DESKTOP_VERSION 140#ifndef DESKTOP_VERSION
133 QCopChannel* infrared; 141 QCopChannel* infrared;
134#endif 142#endif
135 QAction* brAction; 143 Q3Action* brAction;
136 KSyncManager* mSyncManager; 144 KSyncManager* mSyncManager;
137 bool mClosed; 145 bool mClosed;
138 void saveOnClose(); 146 void saveOnClose();
139 bool mFlagKeyPressed; 147 bool mFlagKeyPressed;
140 bool mBlockAtStartup; 148 bool mBlockAtStartup;
141 KMenuBar *menuBar1; 149 KMenuBar *menuBar1;
142 QPEToolBar *iconToolBar; 150 QPEToolBar *iconToolBar;
143 QPEToolBar *viewToolBar; 151 QPEToolBar *viewToolBar;
144 QPEToolBar *navigatorToolBar; 152 QPEToolBar *navigatorToolBar;
145 QPEToolBar *filterToolBar; 153 QPEToolBar *filterToolBar;
146 KMenuBar *filterMenubar; 154 KMenuBar *filterMenubar;
147 QPopupMenu * filterPopupMenu; 155 Q3PopupMenu * filterPopupMenu;
148 QPopupMenu * mCurrentItemMenu; 156 Q3PopupMenu * mCurrentItemMenu;
149 void initActions(); 157 void initActions();
150 void setDefaultPreferences(); 158 void setDefaultPreferences();
151 void resizeEvent( QResizeEvent* e); 159 void resizeEvent( QResizeEvent* e);
152 void keyPressEvent ( QKeyEvent * ) ; 160 void keyPressEvent ( QKeyEvent * ) ;
153 void keyReleaseEvent ( QKeyEvent * ) ; 161 void keyReleaseEvent ( QKeyEvent * ) ;
154 QPopupMenu *configureToolBarMenu; 162 Q3PopupMenu *configureToolBarMenu;
155 QPopupMenu *selectFilterMenu; 163 Q3PopupMenu *selectFilterMenu;
156 QPopupMenu *selectFilterMenuTB; 164 Q3PopupMenu *selectFilterMenuTB;
157 QPopupMenu *configureAgendaMenu, *syncMenu; 165 Q3PopupMenu *configureAgendaMenu, *syncMenu;
158 CalendarLocal *mCalendar; 166 CalendarLocal *mCalendar;
159 CalendarView *mView; 167 CalendarView *mView;
160 QAction *mNewSubTodoAction; 168 Q3Action *mNewSubTodoAction;
161 QAction *mWeekAction; 169 Q3Action *mWeekAction;
162 QFont mWeekFont; 170 QFont mWeekFont;
163 QPixmap mWeekPixmap; 171 QPixmap mWeekPixmap;
164 QColor mWeekBgColor; 172 QColor mWeekBgColor;
165 173
166 QAction *mShowAction; 174 Q3Action *mShowAction;
167 QAction *mEditAction; 175 Q3Action *mEditAction;
168 QAction *mDeleteAction; 176 Q3Action *mDeleteAction;
169 QAction *mCloneAction; 177 Q3Action *mCloneAction;
170 QAction *mMoveAction; 178 Q3Action *mMoveAction;
171 QAction *mBeamAction; 179 Q3Action *mBeamAction;
172 QAction *mCancelAction; 180 Q3Action *mCancelAction;
173 QAction *mPrintSelAction; 181 Q3Action *mPrintSelAction;
174 182
175 QAction *mToggleNav; 183 Q3Action *mToggleNav;
176 QAction *mToggleFilter; 184 Q3Action *mToggleFilter;
177 QAction *mToggleAllday; 185 Q3Action *mToggleAllday;
178 QAction *actionFilterMenuTB; 186 Q3Action *actionFilterMenuTB;
179 187
180 void closeEvent( QCloseEvent* ce ); 188 void closeEvent( QCloseEvent* ce );
181 QTimer mSaveTimer; 189 QTimer mSaveTimer;
182 QDateTime mSaveTimerStart; 190 QDateTime mSaveTimerStart;
183 int mSaveDelay; 191 int mSaveDelay;
184 //bool mBlockSaveFlag; 192 //bool mBlockSaveFlag;
185 bool mCalendarModifiedFlag; 193 bool mCalendarModifiedFlag;
186 QPixmap loadPixmap( QString ); 194 QPixmap loadPixmap( QString );
187 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix; 195 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix;
188}; 196};
189 197
190 198
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index f6a1a6a..59c3e45 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -17,56 +17,59 @@
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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 <qstring.h> 25#include <qstring.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qframe.h> 29#include <q3frame.h>
30#include <qlabel.h> 30#include <qlabel.h>
31#include <qpopupmenu.h> 31#include <q3popupmenu.h>
32#include <qapplication.h> 32#include <qapplication.h>
33#include <QDesktopWidget>
34//Added by qt3to4:
35#include <Q3HBoxLayout>
33 36
34#include <kdebug.h> 37#include <kdebug.h>
35#include <klocale.h> 38#include <klocale.h>
36#include <kglobal.h> 39#include <kglobal.h>
37#include <kiconloader.h> 40#include <kiconloader.h>
38#include "libkdepim/kdatepicker.h" 41#include "libkdepim/kdatepicker.h"
39#include <knotifyclient.h> 42#include <knotifyclient.h>
40#include "kdatetbl.h" 43#include "kdatetbl.h"
41 44
42#include "koglobals.h" 45#include "koglobals.h"
43#include <kglobalsettings.h> 46#include <kglobalsettings.h>
44#include "koprefs.h" 47#include "koprefs.h"
45#ifndef KORG_NOPLUGINS 48#ifndef KORG_NOPLUGINS
46#include "kocore.h" 49#include "kocore.h"
47#endif 50#endif
48 51
49#include <kcalendarsystem.h> 52#include <kcalendarsystem.h>
50 53
51#include "navigatorbar.h" 54#include "navigatorbar.h"
52 55
53NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name ) 56NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name )
54 : QWidget( parent, name ) 57 : QWidget( parent, name )
55{ 58{
56 QBoxLayout *topLayout = new QHBoxLayout( this ); 59 Q3BoxLayout *topLayout = new Q3HBoxLayout( this );
57 60
58 // Set up the control buttons and date label 61 // Set up the control buttons and date label
59 mCtrlFrame = new QFrame( this ); 62 mCtrlFrame = new Q3Frame( this );
60 mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised); 63 mCtrlFrame->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised);
61 mCtrlFrame->setLineWidth(1); 64 mCtrlFrame->setLineWidth(1);
62 65
63 topLayout->addWidget( mCtrlFrame ); 66 topLayout->addWidget( mCtrlFrame );
64 67
65 68
66 69
67 bool isRTL = KOGlobals::self()->reverseLayout(); 70 bool isRTL = KOGlobals::self()->reverseLayout();
68#ifndef DESKTOP_VERSION 71#ifndef DESKTOP_VERSION
69 bool isDesktop = false; 72 bool isDesktop = false;
70#else 73#else
71 bool isDesktop = true; 74 bool isDesktop = true;
72#endif 75#endif
@@ -120,52 +123,52 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
120 mPrevWeek->setAutoRepeat( true ); 123 mPrevWeek->setAutoRepeat( true );
121 mNextWeek->setAutoRepeat( true ); 124 mNextWeek->setAutoRepeat( true );
122 mNextYear->setAutoRepeat( true ); 125 mNextYear->setAutoRepeat( true );
123 } else { 126 } else {
124 mPrevWeek->hide(); 127 mPrevWeek->hide();
125 mNextWeek->hide(); 128 mNextWeek->hide();
126 } 129 }
127 130
128 resetFont( font() ); 131 resetFont( font() );
129 132
130 133
131 // set up control frame layout 134 // set up control frame layout
132 QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); 135 Q3BoxLayout *ctrlLayout = new Q3HBoxLayout( mCtrlFrame, 1 );
133 ctrlLayout->addWidget( mPrevYear, 3 ); 136 ctrlLayout->addWidget( mPrevYear, 3 );
134 ctrlLayout->addWidget( mPrevMonth, 3 ); 137 ctrlLayout->addWidget( mPrevMonth, 3 );
135 ctrlLayout->addWidget( mPrevWeek, 3 ); 138 ctrlLayout->addWidget( mPrevWeek, 3 );
136 //ctrlLayout->addStretch( 1 ); 139 //ctrlLayout->addStretch( 1 );
137 // ctrlLayout->addSpacing( 1 ); 140 // ctrlLayout->addSpacing( 1 );
138 // ctrlLayout->addWidget( mDateLabel ); 141 // ctrlLayout->addWidget( mDateLabel );
139 ctrlLayout->addWidget( mSelectMonth ); 142 ctrlLayout->addWidget( mSelectMonth );
140 // ctrlLayout->addSpacing( 1 ); 143 // ctrlLayout->addSpacing( 1 );
141 // ctrlLayout->addStretch( 1 ); 144 // ctrlLayout->addStretch( 1 );
142 ctrlLayout->addWidget( mNextWeek, 3 ); 145 ctrlLayout->addWidget( mNextWeek, 3 );
143 ctrlLayout->addWidget( mNextMonth, 3 ); 146 ctrlLayout->addWidget( mNextMonth, 3 );
144 ctrlLayout->addWidget( mNextYear, 3 ); 147 ctrlLayout->addWidget( mNextYear, 3 );
145 148
146 connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); 149 connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) );
147 connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); 150 connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) );
148 connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); 151 connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) );
149 connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) ); 152 connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) );
150 connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); 153 connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) );
151 connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); 154 connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) );
152 connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); 155 connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) );
153 mPrevYear->setFocusPolicy(NoFocus); 156 mPrevYear->setFocusPolicy(Qt::NoFocus);
154 mPrevMonth->setFocusPolicy(NoFocus); 157 mPrevMonth->setFocusPolicy(Qt::NoFocus);
155 mNextMonth->setFocusPolicy(NoFocus); 158 mNextMonth->setFocusPolicy(Qt::NoFocus);
156 mPrevWeek->setFocusPolicy(NoFocus); 159 mPrevWeek->setFocusPolicy(Qt::NoFocus);
157 mNextWeek->setFocusPolicy(NoFocus); 160 mNextWeek->setFocusPolicy(Qt::NoFocus);
158 mNextYear->setFocusPolicy(NoFocus); 161 mNextYear->setFocusPolicy(Qt::NoFocus);
159 mSelectMonth->setFocusPolicy(NoFocus); 162 mSelectMonth->setFocusPolicy(Qt::NoFocus);
160 setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); 163 setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) );
161 164
162} 165}
163 166
164NavigatorBar::~NavigatorBar() 167NavigatorBar::~NavigatorBar()
165{ 168{
166} 169}
167QSize NavigatorBar::sizeHint() const 170QSize NavigatorBar::sizeHint() const
168{ 171{
169 int wid = mCurrentMinWid ; 172 int wid = mCurrentMinWid ;
170 if ( mPrevYear->isVisible() ) 173 if ( mPrevYear->isVisible() )
171 wid += mCurrentButtonMinWid; 174 wid += mCurrentButtonMinWid;
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h
index 9ccef14..a1880f5 100644
--- a/korganizer/navigatorbar.h
+++ b/korganizer/navigatorbar.h
@@ -18,27 +18,30 @@
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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#ifndef NAVIGATORBAR_H 24#ifndef NAVIGATORBAR_H
25#define NAVIGATORBAR_H 25#define NAVIGATORBAR_H
26 26
27#include <libkcal/incidencebase.h> 27#include <libkcal/incidencebase.h>
28 28
29#include <qwidget.h> 29#include <qwidget.h>
30//Added by qt3to4:
31#include <Q3Frame>
32#include <QLabel>
30 33
31class QPushButton; 34class QPushButton;
32class QFrame; 35class Q3Frame;
33class QLabel; 36class QLabel;
34 37
35class NavigatorBar: public QWidget 38class NavigatorBar: public QWidget
36{ 39{
37 Q_OBJECT 40 Q_OBJECT
38 public: 41 public:
39 NavigatorBar( const QDate & date, QWidget *parent = 0, const char *name = 0 ); 42 NavigatorBar( const QDate & date, QWidget *parent = 0, const char *name = 0 );
40 ~NavigatorBar(); 43 ~NavigatorBar();
41 void showButtons( bool left, bool right ); 44 void showButtons( bool left, bool right );
42 void resetFont ( QFont fo ); 45 void resetFont ( QFont fo );
43 QSize sizeHint() const; 46 QSize sizeHint() const;
44 QSize sizeHintTwoButtons( int butNum = 2 ) const; 47 QSize sizeHintTwoButtons( int butNum = 2 ) const;
@@ -51,25 +54,25 @@ class NavigatorBar: public QWidget
51 void goNextMonth(); 54 void goNextMonth();
52 void goPrevMonth(); 55 void goPrevMonth();
53 void goNextWeek(); 56 void goNextWeek();
54 void goPrevWeek(); 57 void goPrevWeek();
55 void goNextYear(); 58 void goNextYear();
56 void goPrevYear(); 59 void goPrevYear();
57 void monthSelected( int ); 60 void monthSelected( int );
58 61
59 private: 62 private:
60 int mCurrentHei; 63 int mCurrentHei;
61 int mCurrentMinWid; 64 int mCurrentMinWid;
62 int mCurrentButtonMinWid; 65 int mCurrentButtonMinWid;
63 QFrame *mCtrlFrame; 66 Q3Frame *mCtrlFrame;
64 67
65 QPushButton *mPrevYear; 68 QPushButton *mPrevYear;
66 QPushButton *mPrevMonth; 69 QPushButton *mPrevMonth;
67 QPushButton *mNextMonth; 70 QPushButton *mNextMonth;
68 QPushButton *mPrevWeek; 71 QPushButton *mPrevWeek;
69 QPushButton *mNextWeek; 72 QPushButton *mNextWeek;
70 QPushButton *mNextYear; 73 QPushButton *mNextYear;
71 QPushButton *mSelectMonth; 74 QPushButton *mSelectMonth;
72 75
73 //QLabel *mDateLabel; 76 //QLabel *mDateLabel;
74}; 77};
75 78
diff --git a/korganizer/outgoingdialog.cpp b/korganizer/outgoingdialog.cpp
index 7253c8e..ab31274 100644
--- a/korganizer/outgoingdialog.cpp
+++ b/korganizer/outgoingdialog.cpp
@@ -12,51 +12,51 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <kdebug.h> 20#include <kdebug.h>
21 21
22#include <qfile.h> 22#include <qfile.h>
23#include <qdir.h> 23#include <qdir.h>
24#include <qtextstream.h> 24#include <q3textstream.h>
25 25
26#include <kglobal.h> 26#include <kglobal.h>
27#include <klocale.h> 27#include <klocale.h>
28#include <ktempfile.h> 28#include <ktempfile.h>
29#include <kstandarddirs.h> 29#include <kstandarddirs.h>
30 30
31#include <libkcal/event.h> 31#include <libkcal/event.h>
32#include <libkcal/freebusy.h> 32#include <libkcal/freebusy.h>
33//#include <libkcal/imipscheduler.h> 33//#include <libkcal/imipscheduler.h>
34#include <libkcal/dummyscheduler.h> 34#include <libkcal/dummyscheduler.h>
35#include <libkcal/icalformat.h> 35#include <libkcal/icalformat.h>
36#include <libkcal/calendar.h> 36#include <libkcal/calendar.h>
37 37
38#ifndef KORG_NOMAIL 38#ifndef KORG_NOMAIL
39#include "mailscheduler.h" 39#include "mailscheduler.h"
40#endif 40#endif
41 41
42#include "koprefs.h" 42#include "koprefs.h"
43#include "outgoingdialog.h" 43#include "outgoingdialog.h"
44#include "koeventviewerdialog.h" 44#include "koeventviewerdialog.h"
45#include "docprefs.h" 45#include "docprefs.h"
46 46
47ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, 47ScheduleItemOut::ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev,
48 Scheduler::Method method, 48 Scheduler::Method method,
49 const QString &recipients) 49 const QString &recipients)
50 : QListViewItem(parent) 50 : Q3ListViewItem(parent)
51{ 51{
52 mIncidence = ev; 52 mIncidence = ev;
53 mMethod = method; 53 mMethod = method;
54 mRecipients = recipients; 54 mRecipients = recipients;
55 55
56// kdDebug() << "ScheduleItemOut: setting the summary" << endl; 56// kdDebug() << "ScheduleItemOut: setting the summary" << endl;
57 //Set the summary 57 //Set the summary
58 if(ev->typeID() != freebusyID ) { 58 if(ev->typeID() != freebusyID ) {
59 Incidence *incidence = static_cast<Incidence *>(ev); 59 Incidence *incidence = static_cast<Incidence *>(ev);
60 setText(0,incidence->summary()); 60 setText(0,incidence->summary());
61 } else { 61 } else {
62 setText(0,i18n("Free Busy Object")); 62 setText(0,i18n("Free Busy Object"));
@@ -114,46 +114,46 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
114 //Must try and get this to the users local settings 114 //Must try and get this to the users local settings
115 setText(3,KGlobal::locale()->formatDate( freebusy->dtEnd().date() ) ); 115 setText(3,KGlobal::locale()->formatDate( freebusy->dtEnd().date() ) );
116 setText(4,KGlobal::locale()->formatTime( freebusy->dtEnd().time() ) ); 116 setText(4,KGlobal::locale()->formatTime( freebusy->dtEnd().time() ) );
117 } 117 }
118 118
119// kdDebug() << "ScheduleItemOut: Setting the method" << endl; 119// kdDebug() << "ScheduleItemOut: Setting the method" << endl;
120 //Set the Method 120 //Set the Method
121 setText(5,Scheduler::translatedMethodName(mMethod)); 121 setText(5,Scheduler::translatedMethodName(mMethod));
122} 122}
123 123
124OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, 124OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent,
125 const char* name,bool modal, 125 const char* name,bool modal,
126 WFlags fl) 126 Qt::WFlags fl)
127 : OutgoingDialog_base(parent,name,modal,fl) 127 : OutgoingDialog_base(parent,name,modal,fl)
128{ 128{
129 mCalendar = calendar; 129 mCalendar = calendar;
130 130
131 mFormat = new ICalFormat; 131 mFormat = new ICalFormat;
132 132
133 if (KOPrefs::instance()->mIMIPScheduler == KOPrefs::IMIPDummy ) { 133 if (KOPrefs::instance()->mIMIPScheduler == KOPrefs::IMIPDummy ) {
134 mScheduler = new DummyScheduler(mCalendar); 134 mScheduler = new DummyScheduler(mCalendar);
135 } else { 135 } else {
136#ifndef KORG_NOMAIL 136#ifndef KORG_NOMAIL
137 mScheduler = new MailScheduler(mCalendar); 137 mScheduler = new MailScheduler(mCalendar);
138#else 138#else
139 mScheduler = new DummyScheduler(mCalendar); 139 mScheduler = new DummyScheduler(mCalendar);
140#endif 140#endif
141 } 141 }
142 mMessageListView->setColumnAlignment(1,AlignHCenter); 142 mMessageListView->setColumnAlignment(1,Qt::AlignHCenter);
143 mMessageListView->setColumnAlignment(2,AlignHCenter); 143 mMessageListView->setColumnAlignment(2,Qt::AlignHCenter);
144 mMessageListView->setColumnAlignment(3,AlignHCenter); 144 mMessageListView->setColumnAlignment(3,Qt::AlignHCenter);
145 mMessageListView->setColumnAlignment(4,AlignHCenter); 145 mMessageListView->setColumnAlignment(4,Qt::AlignHCenter);
146 QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)), 146 QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)),
147 this,SLOT(showEvent(QListViewItem *))); 147 this,SLOT(showEvent(Q3ListViewItem *)));
148 mDocPrefs = new DocPrefs("groupschedule"); 148 mDocPrefs = new DocPrefs("groupschedule");
149 loadMessages(); 149 loadMessages();
150} 150}
151 151
152OutgoingDialog::~OutgoingDialog() 152OutgoingDialog::~OutgoingDialog()
153{ 153{
154 delete mDocPrefs; 154 delete mDocPrefs;
155 delete mFormat; 155 delete mFormat;
156} 156}
157 157
158bool OutgoingDialog::addMessage(IncidenceBase *incidence,Scheduler::Method method) 158bool OutgoingDialog::addMessage(IncidenceBase *incidence,Scheduler::Method method)
159{ 159{
@@ -227,25 +227,25 @@ void OutgoingDialog::send()
227 227
228void OutgoingDialog::deleteItem() 228void OutgoingDialog::deleteItem()
229{ 229{
230 ScheduleItemOut *item = (ScheduleItemOut *)(mMessageListView->selectedItem()); 230 ScheduleItemOut *item = (ScheduleItemOut *)(mMessageListView->selectedItem());
231 if(!item) 231 if(!item)
232 return; 232 return;
233 deleteMessage(item->event()); 233 deleteMessage(item->event());
234 delete(item->event()); 234 delete(item->event());
235 mMessageListView->takeItem(item); 235 mMessageListView->takeItem(item);
236 emit numMessagesChanged(mMessageListView->childCount()); 236 emit numMessagesChanged(mMessageListView->childCount());
237} 237}
238 238
239void OutgoingDialog::showEvent(QListViewItem *qitem) 239void OutgoingDialog::showEvent(Q3ListViewItem *qitem)
240{ 240{
241 ScheduleItemOut *item = (ScheduleItemOut *)qitem; 241 ScheduleItemOut *item = (ScheduleItemOut *)qitem;
242 Event *event = 0; 242 Event *event = 0;
243 Todo *todo = 0; 243 Todo *todo = 0;
244 if ( item->event()->typeID() == eventID ) { 244 if ( item->event()->typeID() == eventID ) {
245 event = static_cast<Event *>(item->event()); 245 event = static_cast<Event *>(item->event());
246 } 246 }
247 if ( item->event()->typeID() == todoID ) { 247 if ( item->event()->typeID() == todoID ) {
248 todo = static_cast<Todo *>(item->event()); 248 todo = static_cast<Todo *>(item->event());
249 } 249 }
250 QString sendText; 250 QString sendText;
251 if (event || todo) { 251 if (event || todo) {
@@ -285,25 +285,25 @@ void OutgoingDialog::showEvent(QListViewItem *qitem)
285 sendText = ""; 285 sendText = "";
286 } 286 }
287 eventViewer->addText(sendText); 287 eventViewer->addText(sendText);
288 eventViewer->show(); 288 eventViewer->show();
289 } 289 }
290} 290}
291 291
292bool OutgoingDialog::saveMessage(IncidenceBase *incidence,Scheduler::Method method, 292bool OutgoingDialog::saveMessage(IncidenceBase *incidence,Scheduler::Method method,
293 const QString &recipients) 293 const QString &recipients)
294{ 294{
295 KTempFile ktfile(locateLocal("data","korganizer/outgoing/"),"ics"); 295 KTempFile ktfile(locateLocal("data","korganizer/outgoing/"),"ics");
296 QString messageText = mFormat->createScheduleMessage(incidence,method); 296 QString messageText = mFormat->createScheduleMessage(incidence,method);
297 QTextStream *qts = ktfile.textStream(); 297 Q3TextStream *qts = ktfile.textStream();
298 *qts << messageText; 298 *qts << messageText;
299 *qts << "METHOD-BEGIN:" << endl << method << endl << ":METHOD-END" << endl; 299 *qts << "METHOD-BEGIN:" << endl << method << endl << ":METHOD-END" << endl;
300 *qts << "RECIPIENTS-BEGIN:" << endl << recipients << endl << ":RECIPIENTS-END" << endl; 300 *qts << "RECIPIENTS-BEGIN:" << endl << recipients << endl << ":RECIPIENTS-END" << endl;
301 mMessageMap[incidence]=ktfile.name(); 301 mMessageMap[incidence]=ktfile.name();
302 302
303 return true; 303 return true;
304} 304}
305 305
306bool OutgoingDialog::deleteMessage(IncidenceBase *incidence) 306bool OutgoingDialog::deleteMessage(IncidenceBase *incidence)
307{ 307{
308 QFile f( mMessageMap[incidence] ); 308 QFile f( mMessageMap[incidence] );
309 mMessageMap.remove(incidence); 309 mMessageMap.remove(incidence);
@@ -321,29 +321,29 @@ void OutgoingDialog::loadMessages()
321 QDir outgoingDir(outgoingDirName); 321 QDir outgoingDir(outgoingDirName);
322 QStringList outgoing = outgoingDir.entryList(QDir::Files); 322 QStringList outgoing = outgoingDir.entryList(QDir::Files);
323 QStringList::ConstIterator it; 323 QStringList::ConstIterator it;
324 for(it = outgoing.begin(); it != outgoing.end(); ++it) { 324 for(it = outgoing.begin(); it != outgoing.end(); ++it) {
325 kdDebug() << "-- File: " << (*it) << endl; 325 kdDebug() << "-- File: " << (*it) << endl;
326 QFile f(outgoingDirName + "/" + (*it)); 326 QFile f(outgoingDirName + "/" + (*it));
327 bool inserted = false; 327 bool inserted = false;
328 QMap<IncidenceBase*, QString>::Iterator iter; 328 QMap<IncidenceBase*, QString>::Iterator iter;
329 for ( iter = mMessageMap.begin(); iter != mMessageMap.end(); ++iter ) { 329 for ( iter = mMessageMap.begin(); iter != mMessageMap.end(); ++iter ) {
330 if (iter.data() == outgoingDirName + "/" + (*it)) inserted = true; 330 if (iter.data() == outgoingDirName + "/" + (*it)) inserted = true;
331 } 331 }
332 if (!inserted) { 332 if (!inserted) {
333 if (!f.open(IO_ReadOnly)) { 333 if (!f.open(QIODevice::ReadOnly)) {
334 kdDebug() << "OutgoingDialog::loadMessage(): Can't open file'" 334 kdDebug() << "OutgoingDialog::loadMessage(): Can't open file'"
335 << (*it) << "'" << endl; 335 << (*it) << "'" << endl;
336 } else { 336 } else {
337 QTextStream t(&f); 337 Q3TextStream t(&f);
338 QString messageString = t.read(); 338 QString messageString = t.read();
339 ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar, 339 ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar,
340 messageString); 340 messageString);
341 int begin_pos = messageString.find("METHOD-BEGIN:"); 341 int begin_pos = messageString.find("METHOD-BEGIN:");
342 begin_pos = messageString.find('\n',begin_pos)+1; 342 begin_pos = messageString.find('\n',begin_pos)+1;
343 QString meth = messageString.mid(begin_pos,1); 343 QString meth = messageString.mid(begin_pos,1);
344 switch (meth.toInt()) { 344 switch (meth.toInt()) {
345 case 0:method=Scheduler::Publish; break; 345 case 0:method=Scheduler::Publish; break;
346 case 1:method=Scheduler::Request; break; 346 case 1:method=Scheduler::Request; break;
347 case 2:method=Scheduler::Refresh; break; 347 case 2:method=Scheduler::Refresh; break;
348 case 3:method=Scheduler::Cancel; break; 348 case 3:method=Scheduler::Cancel; break;
349 case 4:method=Scheduler::Add; break; 349 case 4:method=Scheduler::Add; break;
diff --git a/korganizer/outgoingdialog.h b/korganizer/outgoingdialog.h
index a3d561a..e727087 100644
--- a/korganizer/outgoingdialog.h
+++ b/korganizer/outgoingdialog.h
@@ -14,74 +14,74 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef OUTGOINGDIALOG_H 23#ifndef OUTGOINGDIALOG_H
24#define OUTGOINGDIALOG_H 24#define OUTGOINGDIALOG_H
25 25
26#include <qlistview.h> 26#include <q3listview.h>
27#include <qmap.h> 27#include <qmap.h>
28#include <qstring.h> 28#include <qstring.h>
29 29
30#include <libkcal/scheduler.h> 30#include <libkcal/scheduler.h>
31 31
32#include "docprefs.h" 32#include "docprefs.h"
33#include "outgoingdialog_base.h" 33#include "outgoingdialog_base.h"
34 34
35using namespace KCal; 35using namespace KCal;
36 36
37class ScheduleItemOut : public QListViewItem 37class ScheduleItemOut : public Q3ListViewItem
38{ 38{
39 public: 39 public:
40 ScheduleItemOut(QListView *parent,IncidenceBase *ev, 40 ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev,
41 Scheduler::Method method, const QString &recipients=QString::null); 41 Scheduler::Method method, const QString &recipients=QString::null);
42 virtual ~ScheduleItemOut() {} 42 virtual ~ScheduleItemOut() {}
43 43
44 IncidenceBase *event() { return mIncidence; } 44 IncidenceBase *event() { return mIncidence; }
45 Scheduler::Method method() { return mMethod; } 45 Scheduler::Method method() { return mMethod; }
46 QString recipients() { return mRecipients; } 46 QString recipients() { return mRecipients; }
47 47
48 private: 48 private:
49 IncidenceBase *mIncidence; 49 IncidenceBase *mIncidence;
50 Scheduler::Method mMethod; 50 Scheduler::Method mMethod;
51 QString mRecipients; 51 QString mRecipients;
52}; 52};
53 53
54class OutgoingDialog : public OutgoingDialog_base 54class OutgoingDialog : public OutgoingDialog_base
55{ 55{
56 Q_OBJECT 56 Q_OBJECT
57 public: 57 public:
58 OutgoingDialog(Calendar *,QWidget* parent=0,const char* name=0, 58 OutgoingDialog(Calendar *,QWidget* parent=0,const char* name=0,
59 bool modal=false,WFlags fl=0); 59 bool modal=false,Qt::WFlags fl=0);
60 ~OutgoingDialog(); 60 ~OutgoingDialog();
61 61
62 bool addMessage(IncidenceBase *,Scheduler::Method); 62 bool addMessage(IncidenceBase *,Scheduler::Method);
63 bool addMessage(IncidenceBase *,Scheduler::Method,const QString &recipients); 63 bool addMessage(IncidenceBase *,Scheduler::Method,const QString &recipients);
64 void setDocumentId( const QString &id ); 64 void setDocumentId( const QString &id );
65 65
66 public slots: 66 public slots:
67 void loadMessages(); 67 void loadMessages();
68 68
69 signals: 69 signals:
70 void numMessagesChanged(int); 70 void numMessagesChanged(int);
71 71
72 protected slots: 72 protected slots:
73 void send(); 73 void send();
74 void deleteItem(); 74 void deleteItem();
75 void showEvent(QListViewItem *); 75 void showEvent(Q3ListViewItem *);
76 76
77 private: 77 private:
78 bool saveMessage(IncidenceBase *,Scheduler::Method,const QString &recipients=0); 78 bool saveMessage(IncidenceBase *,Scheduler::Method,const QString &recipients=0);
79 bool deleteMessage(IncidenceBase *); 79 bool deleteMessage(IncidenceBase *);
80 80
81 Calendar *mCalendar; 81 Calendar *mCalendar;
82 ICalFormat *mFormat; 82 ICalFormat *mFormat;
83 Scheduler *mScheduler; 83 Scheduler *mScheduler;
84 QMap<IncidenceBase*, QString> mMessageMap; 84 QMap<IncidenceBase*, QString> mMessageMap;
85 DocPrefs *mDocPrefs; 85 DocPrefs *mDocPrefs;
86}; 86};
87 87
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
@@ -2,55 +2,57 @@
2/**************************************************************************** 2/****************************************************************************
3** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/outgoingdialog_base.ui' 3** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/outgoingdialog_base.ui'
4** 4**
5** Created: Sat Mar 29 22:31:21 2003 5** Created: Sat Mar 29 22:31:21 2003
6** by: The User Interface Compiler () 6** by: The User Interface Compiler ()
7** 7**
8** WARNING! All changes made in this file will be lost! 8** WARNING! All changes made in this file will be lost!
9****************************************************************************/ 9****************************************************************************/
10 10
11#include "outgoingdialog_base.h" 11#include "outgoingdialog_base.h"
12 12
13#include <qvariant.h> 13#include <qvariant.h>
14#include <qheader.h> 14#include <q3header.h>
15#include <qlistview.h> 15#include <q3listview.h>
16#include <qpushbutton.h> 16#include <qpushbutton.h>
17#include <qlayout.h> 17#include <qlayout.h>
18#include <qtooltip.h> 18#include <qtooltip.h>
19#include <qwhatsthis.h> 19#include <q3whatsthis.h>
20//Added by qt3to4:
21#include <Q3GridLayout>
20 22
21/* 23/*
22 * Constructs a OutgoingDialog_base as a child of 'parent', with the 24 * Constructs a OutgoingDialog_base as a child of 'parent', with the
23 * name 'name' and widget flags set to 'f'. 25 * name 'name' and widget flags set to 'f'.
24 * 26 *
25 * The dialog will by default be modeless, unless you set 'modal' to 27 * The dialog will by default be modeless, unless you set 'modal' to
26 * TRUE to construct a modal dialog. 28 * TRUE to construct a modal dialog.
27 */ 29 */
28OutgoingDialog_base::OutgoingDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) 30OutgoingDialog_base::OutgoingDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl )
29 : QDialog( parent, name, modal, fl ) 31 : QDialog( parent, name, modal, fl )
30 32
31{ 33{
32 if ( !name ) 34 if ( !name )
33 setName( "OutgoingDialog_base" ); 35 setName( "OutgoingDialog_base" );
34 OutgoingDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "OutgoingDialog_baseLayout"); 36 OutgoingDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "OutgoingDialog_baseLayout");
35 37
36 mMessageListView = new QListView( this, "mMessageListView" ); 38 mMessageListView = new Q3ListView( this, "mMessageListView" );
37 mMessageListView->addColumn( tr2i18n( "Summary" ) ); 39 mMessageListView->addColumn( tr2i18n( "Summary" ) );
38 mMessageListView->addColumn( tr2i18n( "Start Date" ) ); 40 mMessageListView->addColumn( tr2i18n( "Start Date" ) );
39 mMessageListView->addColumn( tr2i18n( "Start Time" ) ); 41 mMessageListView->addColumn( tr2i18n( "Start Time" ) );
40 mMessageListView->addColumn( tr2i18n( "End Date" ) ); 42 mMessageListView->addColumn( tr2i18n( "End Date" ) );
41 mMessageListView->addColumn( tr2i18n( "End Time" ) ); 43 mMessageListView->addColumn( tr2i18n( "End Time" ) );
42 mMessageListView->addColumn( tr2i18n( "Method" ) ); 44 mMessageListView->addColumn( tr2i18n( "Method" ) );
43 mMessageListView->setFrameShape( QListView::StyledPanel ); 45 mMessageListView->setFrameShape( Q3ListView::StyledPanel );
44 mMessageListView->setFrameShadow( QListView::Sunken ); 46 mMessageListView->setFrameShadow( Q3ListView::Sunken );
45 mMessageListView->setAllColumnsShowFocus( TRUE ); 47 mMessageListView->setAllColumnsShowFocus( TRUE );
46 48
47 OutgoingDialog_baseLayout->addMultiCellWidget( mMessageListView, 0, 3, 0, 0 ); 49 OutgoingDialog_baseLayout->addMultiCellWidget( mMessageListView, 0, 3, 0, 0 );
48 50
49 PushButton5 = new QPushButton( this, "PushButton5" ); 51 PushButton5 = new QPushButton( this, "PushButton5" );
50 PushButton5->setDefault( FALSE ); 52 PushButton5->setDefault( FALSE );
51 53
52 OutgoingDialog_baseLayout->addWidget( PushButton5, 0, 1 ); 54 OutgoingDialog_baseLayout->addWidget( PushButton5, 0, 1 );
53 55
54 PushButton7 = new QPushButton( this, "PushButton7" ); 56 PushButton7 = new QPushButton( this, "PushButton7" );
55 57
56 OutgoingDialog_baseLayout->addWidget( PushButton7, 1, 1 ); 58 OutgoingDialog_baseLayout->addWidget( PushButton7, 1, 1 );
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
@@ -3,45 +3,49 @@
3** 3**
4** Created: Sat Mar 29 22:24:26 2003 4** Created: Sat Mar 29 22:24:26 2003
5** by: The User Interface Compiler () 5** by: The User Interface Compiler ()
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9 9
10#ifndef OUTGOINGDIALOG_BASE_H 10#ifndef OUTGOINGDIALOG_BASE_H
11#define OUTGOINGDIALOG_BASE_H 11#define OUTGOINGDIALOG_BASE_H
12 12
13#include <qvariant.h> 13#include <qvariant.h>
14#include <qdialog.h> 14#include <qdialog.h>
15 15//Added by qt3to4:
16class QVBoxLayout; 16#include <Q3GridLayout>
17class QHBoxLayout; 17#include <Q3HBoxLayout>
18class QGridLayout; 18#include <Q3VBoxLayout>
19class QListView; 19
20class QListViewItem; 20class Q3VBoxLayout;
21class Q3HBoxLayout;
22class Q3GridLayout;
23class Q3ListView;
24class Q3ListViewItem;
21class QPushButton; 25class QPushButton;
22 26
23class OutgoingDialog_base : public QDialog 27class OutgoingDialog_base : public QDialog
24{ 28{
25 Q_OBJECT 29 Q_OBJECT
26 30
27public: 31public:
28 OutgoingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 32 OutgoingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
29 ~OutgoingDialog_base(); 33 ~OutgoingDialog_base();
30 34
31 QListView* mMessageListView; 35 Q3ListView* mMessageListView;
32 QPushButton* PushButton5; 36 QPushButton* PushButton5;
33 QPushButton* PushButton7; 37 QPushButton* PushButton7;
34 QPushButton* PushButton6; 38 QPushButton* PushButton6;
35 39
36protected: 40protected:
37 QGridLayout* OutgoingDialog_baseLayout; 41 Q3GridLayout* OutgoingDialog_baseLayout;
38 42
39protected slots: 43protected slots:
40 virtual void languageChange(); 44 virtual void languageChange();
41 45
42 virtual void send(); 46 virtual void send();
43 virtual void deleteItem(); 47 virtual void deleteItem();
44 48
45}; 49};
46 50
47#endif // OUTGOINGDIALOG_BASE_H 51#endif // OUTGOINGDIALOG_BASE_H
diff --git a/korganizer/publishdialog.cpp b/korganizer/publishdialog.cpp
index 2ae6720..ede9840 100644
--- a/korganizer/publishdialog.cpp
+++ b/korganizer/publishdialog.cpp
@@ -26,79 +26,79 @@
26 26
27#include <kglobal.h> 27#include <kglobal.h>
28#include <klocale.h> 28#include <klocale.h>
29#ifndef KORG_NOKABC 29#ifndef KORG_NOKABC
30#define KORG_NOKABC 30#define KORG_NOKABC
31//#include <kabc/addresseedialog.h> 31//#include <kabc/addresseedialog.h>
32#endif 32#endif
33 33
34#include "koprefs.h" 34#include "koprefs.h"
35#include "publishdialog.h" 35#include "publishdialog.h"
36 36
37PublishDialog::PublishDialog(QWidget* parent, const char* name, 37PublishDialog::PublishDialog(QWidget* parent, const char* name,
38 bool modal, WFlags fl) 38 bool modal, Qt::WFlags fl)
39 : PublishDialog_base(parent,name,modal,fl) 39 : PublishDialog_base(parent,name,modal,fl)
40{ 40{
41 setCaption(i18n("Select Addresses")); 41 setCaption(i18n("Select Addresses"));
42 mNameLineEdit->setEnabled(false); 42 mNameLineEdit->setEnabled(false);
43 mEmailLineEdit->setEnabled(false); 43 mEmailLineEdit->setEnabled(false);
44 connect(mAddressListView,SIGNAL(selectionChanged(QListViewItem *)), 44 connect(mAddressListView,SIGNAL(selectionChanged(Q3ListViewItem *)),
45 SLOT(updateInput())); 45 SLOT(updateInput()));
46} 46}
47 47
48PublishDialog::~PublishDialog() 48PublishDialog::~PublishDialog()
49{ 49{
50} 50}
51 51
52void PublishDialog::addAttendee(Attendee *attendee) 52void PublishDialog::addAttendee(Attendee *attendee)
53{ 53{
54 mNameLineEdit->setEnabled(true); 54 mNameLineEdit->setEnabled(true);
55 mEmailLineEdit->setEnabled(true); 55 mEmailLineEdit->setEnabled(true);
56 QListViewItem *item = new QListViewItem(mAddressListView); 56 Q3ListViewItem *item = new Q3ListViewItem(mAddressListView);
57 item->setText(0,attendee->name()); 57 item->setText(0,attendee->name());
58 item->setText(1,attendee->email()); 58 item->setText(1,attendee->email());
59 mAddressListView->insertItem(item); 59 mAddressListView->insertItem(item);
60} 60}
61 61
62QString PublishDialog::addresses() 62QString PublishDialog::addresses()
63{ 63{
64 QString to = ""; 64 QString to = "";
65 QListViewItem *item; 65 Q3ListViewItem *item;
66 int i, count; 66 int i, count;
67 count = mAddressListView->childCount(); 67 count = mAddressListView->childCount();
68 for (i=0;i<count;i++) { 68 for (i=0;i<count;i++) {
69 item = mAddressListView->firstChild(); 69 item = mAddressListView->firstChild();
70 mAddressListView->takeItem(item); 70 mAddressListView->takeItem(item);
71 to += item->text(1); 71 to += item->text(1);
72 if (i<count-1) { 72 if (i<count-1) {
73 to += ", "; 73 to += ", ";
74 } 74 }
75 } 75 }
76 return to; 76 return to;
77} 77}
78 78
79void PublishDialog::addItem() 79void PublishDialog::addItem()
80{ 80{
81 mNameLineEdit->setEnabled(true); 81 mNameLineEdit->setEnabled(true);
82 mEmailLineEdit->setEnabled(true); 82 mEmailLineEdit->setEnabled(true);
83 QListViewItem *item = new QListViewItem(mAddressListView); 83 Q3ListViewItem *item = new Q3ListViewItem(mAddressListView);
84 mAddressListView->insertItem(item); 84 mAddressListView->insertItem(item);
85 mAddressListView->setSelected(item,true); 85 mAddressListView->setSelected(item,true);
86 mNameLineEdit->setText(i18n("(EmptyName)")); 86 mNameLineEdit->setText(i18n("(EmptyName)"));
87 mEmailLineEdit->setText(i18n("(EmptyEmail)")); 87 mEmailLineEdit->setText(i18n("(EmptyEmail)"));
88} 88}
89 89
90void PublishDialog::removeItem() 90void PublishDialog::removeItem()
91{ 91{
92 QListViewItem *item; 92 Q3ListViewItem *item;
93 item = mAddressListView->selectedItem(); 93 item = mAddressListView->selectedItem();
94 if (!item) return; 94 if (!item) return;
95 mAddressListView->takeItem(item); 95 mAddressListView->takeItem(item);
96 item = mAddressListView->selectedItem(); 96 item = mAddressListView->selectedItem();
97 if (!item) { 97 if (!item) {
98 mNameLineEdit->setText(""); 98 mNameLineEdit->setText("");
99 mEmailLineEdit->setText(""); 99 mEmailLineEdit->setText("");
100 mNameLineEdit->setEnabled(false); 100 mNameLineEdit->setEnabled(false);
101 mEmailLineEdit->setEnabled(false); 101 mEmailLineEdit->setEnabled(false);
102 } 102 }
103 if (mAddressListView->childCount() == 0) { 103 if (mAddressListView->childCount() == 0) {
104 mNameLineEdit->setEnabled(false); 104 mNameLineEdit->setEnabled(false);
@@ -110,42 +110,42 @@ void PublishDialog::openAddressbook()
110{ 110{
111#ifndef KORG_NOKABC 111#ifndef KORG_NOKABC
112 KABC::Addressee::List addressList; 112 KABC::Addressee::List addressList;
113 addressList = KABC::AddresseeDialog::getAddressees(this); 113 addressList = KABC::AddresseeDialog::getAddressees(this);
114 //KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); 114 //KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this);
115 KABC::Addressee a = addressList.first(); 115 KABC::Addressee a = addressList.first();
116 if (!a.isEmpty()) { 116 if (!a.isEmpty()) {
117 uint i; 117 uint i;
118 for (i=0;i<addressList.count();i++) { 118 for (i=0;i<addressList.count();i++) {
119 a = addressList[i]; 119 a = addressList[i];
120 mNameLineEdit->setEnabled(true); 120 mNameLineEdit->setEnabled(true);
121 mEmailLineEdit->setEnabled(true); 121 mEmailLineEdit->setEnabled(true);
122 QListViewItem *item = new QListViewItem(mAddressListView); 122 Q3ListViewItem *item = new Q3ListViewItem(mAddressListView);
123 mAddressListView->setSelected(item,true); 123 mAddressListView->setSelected(item,true);
124 mNameLineEdit->setText(a.realName()); 124 mNameLineEdit->setText(a.realName());
125 mEmailLineEdit->setText(a.preferredEmail()); 125 mEmailLineEdit->setText(a.preferredEmail());
126 mAddressListView->insertItem(item); 126 mAddressListView->insertItem(item);
127 } 127 }
128 } 128 }
129#endif 129#endif
130} 130}
131 131
132void PublishDialog::updateItem() 132void PublishDialog::updateItem()
133{ 133{
134 QListViewItem *item; 134 Q3ListViewItem *item;
135 item = mAddressListView->selectedItem(); 135 item = mAddressListView->selectedItem();
136 if (!item) return; 136 if (!item) return;
137 item->setText(0,mNameLineEdit->text()); 137 item->setText(0,mNameLineEdit->text());
138 item->setText(1,mEmailLineEdit->text()); 138 item->setText(1,mEmailLineEdit->text());
139} 139}
140 140
141void PublishDialog::updateInput() 141void PublishDialog::updateInput()
142{ 142{
143 QListViewItem *item; 143 Q3ListViewItem *item;
144 item = mAddressListView->selectedItem(); 144 item = mAddressListView->selectedItem();
145 if (!item) return; 145 if (!item) return;
146 mNameLineEdit->setEnabled(true); 146 mNameLineEdit->setEnabled(true);
147 mEmailLineEdit->setEnabled(true); 147 mEmailLineEdit->setEnabled(true);
148 QString mail = item->text(1); 148 QString mail = item->text(1);
149 mNameLineEdit->setText(item->text(0)); 149 mNameLineEdit->setText(item->text(0));
150 mEmailLineEdit->setText(mail); 150 mEmailLineEdit->setText(mail);
151} 151}
diff --git a/korganizer/publishdialog.h b/korganizer/publishdialog.h
index 338603c..3ffeec4 100644
--- a/korganizer/publishdialog.h
+++ b/korganizer/publishdialog.h
@@ -14,37 +14,37 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef PUBLISHDIALOG_H 23#ifndef PUBLISHDIALOG_H
24#define PUBLISHDIALOG_H 24#define PUBLISHDIALOG_H
25 25
26#include <qlistview.h> 26#include <q3listview.h>
27#include <libkcal/attendee.h> 27#include <libkcal/attendee.h>
28 28
29#include "publishdialog_base.h" 29#include "publishdialog_base.h"
30 30
31using namespace KCal; 31using namespace KCal;
32 32
33class PublishDialog : public PublishDialog_base 33class PublishDialog : public PublishDialog_base
34{ 34{
35 Q_OBJECT 35 Q_OBJECT
36 public: 36 public:
37 PublishDialog(QWidget* parent=0,const char* name=0, 37 PublishDialog(QWidget* parent=0,const char* name=0,
38 bool modal=true,WFlags fl=0); 38 bool modal=true,Qt::WFlags fl=0);
39 ~PublishDialog(); 39 ~PublishDialog();
40 40
41 void addAttendee(Attendee *attendee); 41 void addAttendee(Attendee *attendee);
42 QString addresses(); 42 QString addresses();
43 43
44 signals: 44 signals:
45 void numMessagesChanged(int); 45 void numMessagesChanged(int);
46 46
47 protected slots: 47 protected slots:
48 void addItem(); 48 void addItem();
49 void removeItem(); 49 void removeItem();
50 void openAddressbook(); 50 void openAddressbook();
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
@@ -2,50 +2,53 @@
2/**************************************************************************** 2/****************************************************************************
3** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/publishdialog_base.ui' 3** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/korganizer/publishdialog_base.ui'
4** 4**
5** Created: Sat Mar 29 22:31:35 2003 5** Created: Sat Mar 29 22:31:35 2003
6** by: The User Interface Compiler () 6** by: The User Interface Compiler ()
7** 7**
8** WARNING! All changes made in this file will be lost! 8** WARNING! All changes made in this file will be lost!
9****************************************************************************/ 9****************************************************************************/
10 10
11#include "publishdialog_base.h" 11#include "publishdialog_base.h"
12 12
13#include <qvariant.h> 13#include <qvariant.h>
14#include <qframe.h> 14#include <q3frame.h>
15#include <qheader.h> 15#include <q3header.h>
16#include <qlabel.h> 16#include <qlabel.h>
17#include <qlineedit.h> 17#include <qlineedit.h>
18#include <qlistview.h> 18#include <q3listview.h>
19#include <qpushbutton.h> 19#include <qpushbutton.h>
20#include <qlayout.h> 20#include <qlayout.h>
21#include <qtooltip.h> 21#include <qtooltip.h>
22#include <qwhatsthis.h> 22#include <q3whatsthis.h>
23//Added by qt3to4:
24#include <Q3GridLayout>
25#include <Q3HBoxLayout>
23 26
24/* 27/*
25 * Constructs a PublishDialog_base as a child of 'parent', with the 28 * Constructs a PublishDialog_base as a child of 'parent', with the
26 * name 'name' and widget flags set to 'f'. 29 * name 'name' and widget flags set to 'f'.
27 * 30 *
28 * The dialog will by default be modeless, unless you set 'modal' to 31 * The dialog will by default be modeless, unless you set 'modal' to
29 * TRUE to construct a modal dialog. 32 * TRUE to construct a modal dialog.
30 */ 33 */
31PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) 34PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl )
32 : QDialog( parent, name, modal, fl ) 35 : QDialog( parent, name, modal, fl )
33 36
34{ 37{
35 if ( !name ) 38 if ( !name )
36 setName( "PublishDialog_base" ); 39 setName( "PublishDialog_base" );
37 PublishDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "PublishDialog_baseLayout"); 40 PublishDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "PublishDialog_baseLayout");
38 41
39 mAddressListView = new QListView( this, "mAddressListView" ); 42 mAddressListView = new Q3ListView( this, "mAddressListView" );
40 mAddressListView->addColumn( tr2i18n( "Name" ) ); 43 mAddressListView->addColumn( tr2i18n( "Name" ) );
41 mAddressListView->addColumn( tr2i18n( "Email" ) ); 44 mAddressListView->addColumn( tr2i18n( "Email" ) );
42 45
43 PublishDialog_baseLayout->addMultiCellWidget( mAddressListView, 0, 3, 0, 1 ); 46 PublishDialog_baseLayout->addMultiCellWidget( mAddressListView, 0, 3, 0, 1 );
44 47
45 TextLabel1 = new QLabel( this, "TextLabel1" ); 48 TextLabel1 = new QLabel( this, "TextLabel1" );
46 49
47 PublishDialog_baseLayout->addWidget( TextLabel1, 4, 0 ); 50 PublishDialog_baseLayout->addWidget( TextLabel1, 4, 0 );
48 51
49 TextLabel2 = new QLabel( this, "TextLabel2" ); 52 TextLabel2 = new QLabel( this, "TextLabel2" );
50 53
51 PublishDialog_baseLayout->addWidget( TextLabel2, 5, 0 ); 54 PublishDialog_baseLayout->addWidget( TextLabel2, 5, 0 );
@@ -63,32 +66,32 @@ PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool
63 PublishDialog_baseLayout->addWidget( PushButton10, 0, 2 ); 66 PublishDialog_baseLayout->addWidget( PushButton10, 0, 2 );
64 67
65 PushButton12 = new QPushButton( this, "PushButton12" ); 68 PushButton12 = new QPushButton( this, "PushButton12" );
66 69
67 PublishDialog_baseLayout->addWidget( PushButton12, 2, 2 ); 70 PublishDialog_baseLayout->addWidget( PushButton12, 2, 2 );
68 71
69 PushButton11 = new QPushButton( this, "PushButton11" ); 72 PushButton11 = new QPushButton( this, "PushButton11" );
70 73
71 PublishDialog_baseLayout->addWidget( PushButton11, 1, 2 ); 74 PublishDialog_baseLayout->addWidget( PushButton11, 1, 2 );
72 QSpacerItem* spacer = new QSpacerItem( 20, 241, QSizePolicy::Minimum, QSizePolicy::Expanding ); 75 QSpacerItem* spacer = new QSpacerItem( 20, 241, QSizePolicy::Minimum, QSizePolicy::Expanding );
73 PublishDialog_baseLayout->addMultiCell( spacer, 3, 5, 2, 2 ); 76 PublishDialog_baseLayout->addMultiCell( spacer, 3, 5, 2, 2 );
74 77
75 Line2 = new QFrame( this, "Line2" ); 78 Line2 = new Q3Frame( this, "Line2" );
76 Line2->setFrameShape( QFrame::HLine ); 79 Line2->setFrameShape( Q3Frame::HLine );
77 Line2->setFrameShadow( QFrame::Sunken ); 80 Line2->setFrameShadow( Q3Frame::Sunken );
78 Line2->setFrameShape( QFrame::HLine ); 81 Line2->setFrameShape( Q3Frame::HLine );
79 82
80 PublishDialog_baseLayout->addMultiCellWidget( Line2, 6, 6, 0, 2 ); 83 PublishDialog_baseLayout->addMultiCellWidget( Line2, 6, 6, 0, 2 );
81 84
82 layout95 = new QHBoxLayout( 0, 0, 6, "layout95"); 85 layout95 = new Q3HBoxLayout( 0, 0, 6, "layout95");
83 QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); 86 QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
84 layout95->addItem( spacer_2 ); 87 layout95->addItem( spacer_2 );
85 88
86 PushButton9 = new QPushButton( this, "PushButton9" ); 89 PushButton9 = new QPushButton( this, "PushButton9" );
87 PushButton9->setDefault( TRUE ); 90 PushButton9->setDefault( TRUE );
88 layout95->addWidget( PushButton9 ); 91 layout95->addWidget( PushButton9 );
89 92
90 PushButton8 = new QPushButton( this, "PushButton8" ); 93 PushButton8 = new QPushButton( this, "PushButton8" );
91 layout95->addWidget( PushButton8 ); 94 layout95->addWidget( PushButton8 );
92 95
93 PublishDialog_baseLayout->addMultiCellLayout( layout95, 7, 7, 0, 2 ); 96 PublishDialog_baseLayout->addMultiCellLayout( layout95, 7, 7, 0, 2 );
94 languageChange(); 97 languageChange();
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
@@ -3,58 +3,64 @@
3** 3**
4** Created: Sat Mar 29 22:24:27 2003 4** Created: Sat Mar 29 22:24:27 2003
5** by: The User Interface Compiler () 5** by: The User Interface Compiler ()
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9 9
10#ifndef PUBLISHDIALOG_BASE_H 10#ifndef PUBLISHDIALOG_BASE_H
11#define PUBLISHDIALOG_BASE_H 11#define PUBLISHDIALOG_BASE_H
12 12
13#include <qvariant.h> 13#include <qvariant.h>
14#include <qdialog.h> 14#include <qdialog.h>
15//Added by qt3to4:
16#include <Q3VBoxLayout>
17#include <Q3Frame>
18#include <Q3GridLayout>
19#include <Q3HBoxLayout>
20#include <QLabel>
15 21
16class QVBoxLayout; 22class Q3VBoxLayout;
17class QHBoxLayout; 23class Q3HBoxLayout;
18class QGridLayout; 24class Q3GridLayout;
19class QFrame; 25class Q3Frame;
20class QLabel; 26class QLabel;
21class QLineEdit; 27class QLineEdit;
22class QListView; 28class Q3ListView;
23class QListViewItem; 29class Q3ListViewItem;
24class QPushButton; 30class QPushButton;
25 31
26class PublishDialog_base : public QDialog 32class PublishDialog_base : public QDialog
27{ 33{
28 Q_OBJECT 34 Q_OBJECT
29 35
30public: 36public:
31 PublishDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 37 PublishDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
32 ~PublishDialog_base(); 38 ~PublishDialog_base();
33 39
34 QListView* mAddressListView; 40 Q3ListView* mAddressListView;
35 QLabel* TextLabel1; 41 QLabel* TextLabel1;
36 QLabel* TextLabel2; 42 QLabel* TextLabel2;
37 QLineEdit* mEmailLineEdit; 43 QLineEdit* mEmailLineEdit;
38 QLineEdit* mNameLineEdit; 44 QLineEdit* mNameLineEdit;
39 QPushButton* PushButton10; 45 QPushButton* PushButton10;
40 QPushButton* PushButton12; 46 QPushButton* PushButton12;
41 QPushButton* PushButton11; 47 QPushButton* PushButton11;
42 QFrame* Line2; 48 Q3Frame* Line2;
43 QPushButton* PushButton9; 49 QPushButton* PushButton9;
44 QPushButton* PushButton8; 50 QPushButton* PushButton8;
45 51
46protected: 52protected:
47 QGridLayout* PublishDialog_baseLayout; 53 Q3GridLayout* PublishDialog_baseLayout;
48 QHBoxLayout* layout95; 54 Q3HBoxLayout* layout95;
49 55
50protected slots: 56protected slots:
51 virtual void languageChange(); 57 virtual void languageChange();
52 58
53 virtual void addItem(); 59 virtual void addItem();
54 virtual void removeItem(); 60 virtual void removeItem();
55 virtual void openAddressbook(); 61 virtual void openAddressbook();
56 virtual void updateItem(); 62 virtual void updateItem();
57 63
58}; 64};
59 65
60#endif // PUBLISHDIALOG_BASE_H 66#endif // PUBLISHDIALOG_BASE_H
diff --git a/korganizer/savetemplatedialog.cpp b/korganizer/savetemplatedialog.cpp
index 3544081..35bedba 100644
--- a/korganizer/savetemplatedialog.cpp
+++ b/korganizer/savetemplatedialog.cpp
@@ -13,39 +13,42 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25//Added by qt3to4:
26#include <Q3VBoxLayout>
27#include <Q3Frame>
25 28
26#include <keditlistbox.h> 29#include <keditlistbox.h>
27#include <klocale.h> 30#include <klocale.h>
28 31
29#include "koprefs.h" 32#include "koprefs.h"
30 33
31#include "savetemplatedialog.h" 34#include "savetemplatedialog.h"
32 35
33SaveTemplateDialog::SaveTemplateDialog( IncidenceType type, QWidget *parent ) 36SaveTemplateDialog::SaveTemplateDialog( IncidenceType type, QWidget *parent )
34 : KDialogBase( Plain, i18n("Save Template"), Ok | Cancel, Ok, parent, 0, 37 : KDialogBase( Plain, i18n("Save Template"), Ok | Cancel, Ok, parent, 0,
35 true, false ), 38 true, false ),
36 mType( type ) 39 mType( type )
37{ 40{
38 QFrame *topFrame = plainPage(); 41 Q3Frame *topFrame = plainPage();
39 QVBoxLayout *topLayout = new QVBoxLayout( topFrame, 0, spacingHint() ); 42 Q3VBoxLayout *topLayout = new Q3VBoxLayout( topFrame, 0, spacingHint() );
40 43
41 mEditListBox = new KEditListBox( i18n("Select Template Name"), topFrame, 44 mEditListBox = new KEditListBox( i18n("Select Template Name"), topFrame,
42 0, false, KEditListBox::Add | 45 0, false, KEditListBox::Add |
43 KEditListBox::Remove ); 46 KEditListBox::Remove );
44 topLayout->addWidget( mEditListBox ); 47 topLayout->addWidget( mEditListBox );
45 connect( mEditListBox, SIGNAL( changed() ), SLOT( slotChanged() ) ); 48 connect( mEditListBox, SIGNAL( changed() ), SLOT( slotChanged() ) );
46 49
47 QStringList templates; 50 QStringList templates;
48 51
49 if ( mType == EventType ) { 52 if ( mType == EventType ) {
50 templates = KOPrefs::instance()->mEventTemplates; 53 templates = KOPrefs::instance()->mEventTemplates;
51 } else if( mType == TodoType ) { 54 } else if( mType == TodoType ) {
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 9cfdc35..105b844 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -15,55 +15,62 @@
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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 <qlayout.h> 25#include <qlayout.h>
26#include <qcheckbox.h> 26#include <qcheckbox.h>
27#include <qgroupbox.h> 27#include <q3groupbox.h>
28#include <qapplication.h> 28#include <qapplication.h>
29#include <QDesktopWidget>
29#include <qlabel.h> 30#include <qlabel.h>
30#include <qlistview.h> 31#include <q3listview.h>
31#include <qwhatsthis.h> 32#include <q3whatsthis.h>
32#include <qlineedit.h> 33#include <qlineedit.h>
33#include <qpushbutton.h> 34#include <qpushbutton.h>
34#include <qhbuttongroup.h> 35//#include <qhbuttongroup.h>
36//Added by qt3to4:
37#include <Q3HBoxLayout>
38#include <Q3Frame>
39#include <Q3PtrList>
40#include <QKeyEvent>
41#include <Q3VBoxLayout>
35#include <klocale.h> 42#include <klocale.h>
36#include <kmessagebox.h> 43#include <kmessagebox.h>
37 44
38#include <libkdepim/kdateedit.h> 45#include <libkdepim/kdateedit.h>
39 46
40#include "koglobals.h" 47#include "koglobals.h"
41#include "koprefs.h" 48#include "koprefs.h"
42#include "klineedit.h" 49#include "klineedit.h"
43 50
44#include "calendarview.h" 51#include "calendarview.h"
45#include "koviewmanager.h" 52#include "koviewmanager.h"
46#include "searchdialog.h" 53#include "searchdialog.h"
47 54
48SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) 55SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
49 : QVBox( 0 ) 56 : Q3VBox( 0 )
50 57
51{ 58{
52 mCalendar = calendar; 59 mCalendar = calendar;
53 QFrame *topFrame = new QFrame( this ) ;//plainPage(); 60 Q3Frame *topFrame = new Q3Frame( this ) ;//plainPage();
54 QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); 61 Q3VBoxLayout *layout = new Q3VBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint());
55 62
56 // Search expression 63 // Search expression
57 QHBoxLayout *subLayout = new QHBoxLayout(); 64 Q3HBoxLayout *subLayout = new Q3HBoxLayout();
58 layout->addLayout(subLayout); 65 layout->addLayout(subLayout);
59 /* 66 /*
60 searchLabel = new QLabel(topFrame); 67 searchLabel = new QLabel(topFrame);
61 searchLabel->setText(i18n("Search for:")); 68 searchLabel->setText(i18n("Search for:"));
62 subLayout->addWidget(searchLabel); 69 subLayout->addWidget(searchLabel);
63 */ 70 */
64 QPushButton *OkButton = new QPushButton( i18n("Search for:"), topFrame ); 71 QPushButton *OkButton = new QPushButton( i18n("Search for:"), topFrame );
65 //OkButton->setDefault( true ); 72 //OkButton->setDefault( true );
66 connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); 73 connect(OkButton,SIGNAL(clicked()),SLOT(doSearch()));
67 subLayout->addWidget(OkButton); 74 subLayout->addWidget(OkButton);
68 searchEdit = new KLineEdit(topFrame); 75 searchEdit = new KLineEdit(topFrame);
69 subLayout->addWidget(searchEdit); 76 subLayout->addWidget(searchEdit);
@@ -89,62 +96,62 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
89 connect(togButton,SIGNAL(clicked()),SLOT(toggleCheckboxes())); 96 connect(togButton,SIGNAL(clicked()),SLOT(toggleCheckboxes()));
90 togButton->setPixmap(SmallIcon("1updownarrow")); 97 togButton->setPixmap(SmallIcon("1updownarrow"));
91 togButton->setMinimumWidth( togButton->sizeHint().height() ); 98 togButton->setMinimumWidth( togButton->sizeHint().height() );
92 99
93 searchEdit->setText("*"); // Find all events by default 100 searchEdit->setText("*"); // Find all events by default
94 searchEdit->setFocus(); 101 searchEdit->setFocus();
95 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); 102 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & )));
96 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); 103 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch()));
97 // Subjects to search 104 // Subjects to search
98 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), 105 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"),
99 // topFrame); 106 // topFrame);
100 107
101 incidenceGroup = new QHBox( topFrame ); 108 incidenceGroup = new Q3HBox( topFrame );
102 layout->addWidget(incidenceGroup); 109 layout->addWidget(incidenceGroup);
103 110
104 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); 111 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup);
105 //mSearchEvent->setChecked(true); 112 //mSearchEvent->setChecked(true);
106 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); 113 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup);
107 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); 114 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup);
108 115
109 subjectGroup = new QHBox( topFrame ); 116 subjectGroup = new Q3HBox( topFrame );
110 layout->addWidget(subjectGroup); 117 layout->addWidget(subjectGroup);
111 118
112 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); 119 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup);
113 mSummaryCheck->setChecked(true); 120 mSummaryCheck->setChecked(true);
114 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); 121 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup);
115 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); 122 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup);
116 123
117 attendeeGroup = new QHBox( topFrame ); 124 attendeeGroup = new Q3HBox( topFrame );
118 layout->addWidget(attendeeGroup ); 125 layout->addWidget(attendeeGroup );
119 new QLabel( i18n("Attendee:"),attendeeGroup ); 126 new QLabel( i18n("Attendee:"),attendeeGroup );
120 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); 127 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup );
121 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); 128 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup );
122 // Date range 129 // Date range
123 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), 130 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"),
124 // topFrame); 131 // topFrame);
125 // layout->addWidget(rangeGroup); 132 // layout->addWidget(rangeGroup);
126 133
127 QWidget *rangeWidget = new QWidget(topFrame); 134 QWidget *rangeWidget = new QWidget(topFrame);
128 int space = KDialog::spacingHint(); 135 int space = KDialog::spacingHint();
129 if ( QApplication::desktop()->width() <= 240 ) space = 1; 136 if ( QApplication::desktop()->width() <= 240 ) space = 1;
130 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,space); 137 Q3HBoxLayout *rangeLayout = new Q3HBoxLayout(rangeWidget,0,space);
131 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); 138 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget));
132 mStartDate = new KDateEdit(rangeWidget); 139 mStartDate = new KDateEdit(rangeWidget);
133 rangeLayout->addWidget(mStartDate); 140 rangeLayout->addWidget(mStartDate);
134 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); 141 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget));
135 mEndDate = new KDateEdit(rangeWidget); 142 mEndDate = new KDateEdit(rangeWidget);
136 mEndDate->setDate(QDate::currentDate().addDays(365)); 143 mEndDate->setDate(QDate::currentDate().addDays(365));
137 rangeLayout->addWidget(mEndDate); 144 rangeLayout->addWidget(mEndDate);
138 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); 145 QToolButton *wt = Q3WhatsThis::whatsThisButton ( rangeWidget );
139 rangeLayout->addWidget( (QWidget*)wt ); 146 rangeLayout->addWidget( (QWidget*)wt );
140 layout->addWidget(rangeWidget); 147 layout->addWidget(rangeWidget);
141 // Results list view 148 // Results list view
142 listView = new KOListView(mCalendar,topFrame); 149 listView = new KOListView(mCalendar,topFrame);
143 layout->addWidget(listView); 150 layout->addWidget(listView);
144 listView->showCompletedTodos(); 151 listView->showCompletedTodos();
145 //layout->setStretchFactor( listView, 333 ); 152 //layout->setStretchFactor( listView, 333 );
146 //listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) ); 153 //listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) );
147 //listView->setMaximumHeight( 50 ); 154 //listView->setMaximumHeight( 50 );
148 listView->readSettings(KOGlobals::config(),"SearchListView Layout"); 155 listView->readSettings(KOGlobals::config(),"SearchListView Layout");
149 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); 156 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList()));
150 157
@@ -332,25 +339,25 @@ void SearchDialog::updateView()
332 mMatchedJournals.clear(); 339 mMatchedJournals.clear();
333 if (re.isValid()) { 340 if (re.isValid()) {
334 search(re); 341 search(re);
335 } 342 }
336 listView->setStartDate( mStartDate->date() ); 343 listView->setStartDate( mStartDate->date() );
337 listView->showEvents(mMatchedEvents); 344 listView->showEvents(mMatchedEvents);
338 listView->addTodos(mMatchedTodos); 345 listView->addTodos(mMatchedTodos);
339 listView->addJournals(mMatchedJournals); 346 listView->addJournals(mMatchedJournals);
340} 347}
341 348
342void SearchDialog::search(const QRegExp &re) 349void SearchDialog::search(const QRegExp &re)
343{ 350{
344 QPtrList<Event> events; 351 Q3PtrList<Event> events;
345 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { 352 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) {
346 if ( mRefineItems->isChecked() ) events = mMatchedEvents; 353 if ( mRefineItems->isChecked() ) events = mMatchedEvents;
347 mMatchedEvents.clear(); 354 mMatchedEvents.clear();
348 } 355 }
349 if ( mSearchEvent->isChecked() ) { 356 if ( mSearchEvent->isChecked() ) {
350 if ( !mRefineItems->isChecked() ) 357 if ( !mRefineItems->isChecked() )
351 events = mCalendar->events( mStartDate->date(), 358 events = mCalendar->events( mStartDate->date(),
352 mEndDate->date(), 359 mEndDate->date(),
353 false /*mInclusiveCheck->isChecked()*/ ); 360 false /*mInclusiveCheck->isChecked()*/ );
354 361
355 362
356 Event *ev; 363 Event *ev;
@@ -410,25 +417,25 @@ void SearchDialog::search(const QRegExp &re)
410 { 417 {
411 418
412 if ( mSubItems->isChecked() ) 419 if ( mSubItems->isChecked() )
413 mMatchedEvents.remove(ev); 420 mMatchedEvents.remove(ev);
414 else{ 421 else{
415 if ( !mMatchedEvents.contains( ev ) ) 422 if ( !mMatchedEvents.contains( ev ) )
416 mMatchedEvents.append(ev); 423 mMatchedEvents.append(ev);
417 } 424 }
418 continue; 425 continue;
419 } 426 }
420 } 427 }
421 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { 428 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
422 QPtrList<Attendee> tmpAList = ev->attendees(); 429 Q3PtrList<Attendee> tmpAList = ev->attendees();
423 Attendee *a; 430 Attendee *a;
424 for (a = tmpAList.first(); a; a = tmpAList.next()) { 431 for (a = tmpAList.first(); a; a = tmpAList.next()) {
425 if (mSearchAName->isChecked()) { 432 if (mSearchAName->isChecked()) {
426#if QT_VERSION >= 0x030000 433#if QT_VERSION >= 0x030000
427 if (re.search(a->name()) != -1) 434 if (re.search(a->name()) != -1)
428#else 435#else
429 if (re.match(a->name()) != -1) 436 if (re.match(a->name()) != -1)
430#endif 437#endif
431 { 438 {
432 if ( mSubItems->isChecked() ) 439 if ( mSubItems->isChecked() )
433 mMatchedEvents.remove(ev); 440 mMatchedEvents.remove(ev);
434 else{ 441 else{
@@ -449,25 +456,25 @@ void SearchDialog::search(const QRegExp &re)
449 mMatchedEvents.remove(ev); 456 mMatchedEvents.remove(ev);
450 else{ 457 else{
451 if ( !mMatchedEvents.contains( ev ) ) 458 if ( !mMatchedEvents.contains( ev ) )
452 mMatchedEvents.append(ev); 459 mMatchedEvents.append(ev);
453 } 460 }
454 break; 461 break;
455 } 462 }
456 } 463 }
457 } 464 }
458 } 465 }
459 } 466 }
460 } 467 }
461 QPtrList<Todo> todos; 468 Q3PtrList<Todo> todos;
462 469
463 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { 470 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) {
464 if ( mRefineItems->isChecked() ) todos = mMatchedTodos ; 471 if ( mRefineItems->isChecked() ) todos = mMatchedTodos ;
465 mMatchedTodos.clear(); 472 mMatchedTodos.clear();
466 } 473 }
467 474
468 if ( mSearchTodo->isChecked() ) { 475 if ( mSearchTodo->isChecked() ) {
469 if ( !mRefineItems->isChecked() ) todos = mCalendar->todos( ); 476 if ( !mRefineItems->isChecked() ) todos = mCalendar->todos( );
470 Todo *tod; 477 Todo *tod;
471 for(tod=todos.first();tod;tod=todos.next()) { 478 for(tod=todos.first();tod;tod=todos.next()) {
472 if (mSummaryCheck->isChecked()) { 479 if (mSummaryCheck->isChecked()) {
473#if QT_VERSION >= 0x030000 480#if QT_VERSION >= 0x030000
@@ -503,25 +510,25 @@ void SearchDialog::search(const QRegExp &re)
503#else 510#else
504 if (re.match(tod->categoriesStr()) != -1) 511 if (re.match(tod->categoriesStr()) != -1)
505#endif 512#endif
506 { 513 {
507 if ( mSubItems->isChecked() ) 514 if ( mSubItems->isChecked() )
508 mMatchedTodos.remove(tod); 515 mMatchedTodos.remove(tod);
509 else if (!mMatchedTodos.contains( tod )) 516 else if (!mMatchedTodos.contains( tod ))
510 mMatchedTodos.append(tod); 517 mMatchedTodos.append(tod);
511 continue; 518 continue;
512 } 519 }
513 } 520 }
514 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { 521 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
515 QPtrList<Attendee> tmpAList = tod->attendees(); 522 Q3PtrList<Attendee> tmpAList = tod->attendees();
516 Attendee *a; 523 Attendee *a;
517 for (a = tmpAList.first(); a; a = tmpAList.next()) { 524 for (a = tmpAList.first(); a; a = tmpAList.next()) {
518 if (mSearchAName->isChecked()) { 525 if (mSearchAName->isChecked()) {
519#if QT_VERSION >= 0x030000 526#if QT_VERSION >= 0x030000
520 if (re.search(a->name()) != -1) 527 if (re.search(a->name()) != -1)
521#else 528#else
522 if (re.match(a->name()) != -1) 529 if (re.match(a->name()) != -1)
523#endif 530#endif
524 { 531 {
525 if ( mSubItems->isChecked() ) 532 if ( mSubItems->isChecked() )
526 mMatchedTodos.remove(tod); 533 mMatchedTodos.remove(tod);
527 else if (!mMatchedTodos.contains( tod )) 534 else if (!mMatchedTodos.contains( tod ))
@@ -539,25 +546,25 @@ void SearchDialog::search(const QRegExp &re)
539 if ( mSubItems->isChecked() ) 546 if ( mSubItems->isChecked() )
540 mMatchedTodos.remove(tod); 547 mMatchedTodos.remove(tod);
541 else if (!mMatchedTodos.contains( tod )) 548 else if (!mMatchedTodos.contains( tod ))
542 mMatchedTodos.append(tod); 549 mMatchedTodos.append(tod);
543 break; 550 break;
544 } 551 }
545 } 552 }
546 } 553 }
547 } 554 }
548 } 555 }
549 } 556 }
550 557
551 QPtrList<Journal> journals; 558 Q3PtrList<Journal> journals;
552 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { 559 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) {
553 if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; 560 if ( mRefineItems->isChecked() ) journals = mMatchedJournals ;
554 mMatchedJournals.clear(); 561 mMatchedJournals.clear();
555 } 562 }
556 if (mSearchJournal->isChecked() ) { 563 if (mSearchJournal->isChecked() ) {
557 if ( ! mRefineItems->isChecked() ) journals = mCalendar->journals(); 564 if ( ! mRefineItems->isChecked() ) journals = mCalendar->journals();
558 Journal* journ; 565 Journal* journ;
559 566
560 for(journ=journals.first();journ;journ=journals.next()) { 567 for(journ=journals.first();journ;journ=journals.next()) {
561 if ( journ->dtStart().date() <= mEndDate->date() 568 if ( journ->dtStart().date() <= mEndDate->date()
562 &&journ->dtStart().date() >= mStartDate->date()) { 569 &&journ->dtStart().date() >= mStartDate->date()) {
563 if (mDescriptionCheck->isChecked()) { 570 if (mDescriptionCheck->isChecked()) {
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h
index 945ff65..5df6116 100644
--- a/korganizer/searchdialog.h
+++ b/korganizer/searchdialog.h
@@ -17,40 +17,44 @@
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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#ifndef SEARCHDIALOG_H 24#ifndef SEARCHDIALOG_H
25#define SEARCHDIALOG_H 25#define SEARCHDIALOG_H
26 26
27#include <qregexp.h> 27#include <qregexp.h>
28#include <qradiobutton.h> 28#include <qradiobutton.h>
29//Added by qt3to4:
30#include <QLabel>
31#include <QKeyEvent>
32#include <Q3PtrList>
29#include <kdialogbase.h> 33#include <kdialogbase.h>
30#include <qvbox.h> 34#include <q3vbox.h>
31 35
32#include <libkcal/calendar.h> 36#include <libkcal/calendar.h>
33 37
34#include "kolistview.h" 38#include "kolistview.h"
35 39
36class KDateEdit; 40class KDateEdit;
37class QCheckBox; 41class QCheckBox;
38class QLineEdit; 42class QLineEdit;
39class KLineEdit; 43class KLineEdit;
40class QLabel; 44class QLabel;
41class CalendarView; 45class CalendarView;
42 46
43using namespace KCal; 47using namespace KCal;
44class SearchDialog : public QVBox 48class SearchDialog : public Q3VBox
45{ 49{
46 Q_OBJECT 50 Q_OBJECT
47 public: 51 public:
48 SearchDialog(Calendar *calendar,CalendarView *parent=0); 52 SearchDialog(Calendar *calendar,CalendarView *parent=0);
49 virtual ~SearchDialog(); 53 virtual ~SearchDialog();
50 KOListView *listview(){ return listView;} 54 KOListView *listview(){ return listView;}
51 void updateView(); 55 void updateView();
52 void raiseAndSelect(); 56 void raiseAndSelect();
53 57
54 public slots: 58 public slots:
55 void changeEventDisplay(Event *, int) { updateView(); } 59 void changeEventDisplay(Event *, int) { updateView(); }
56 void updateConfig(); 60 void updateConfig();
@@ -63,32 +67,32 @@ class SearchDialog : public QVBox
63 void toggleCheckboxes(); 67 void toggleCheckboxes();
64 void slot_add( bool ); 68 void slot_add( bool );
65 void slot_sub( bool ); 69 void slot_sub( bool );
66 void slot_refine( bool ); 70 void slot_refine( bool );
67 71
68 signals: 72 signals:
69 void showEventSignal(Event *); 73 void showEventSignal(Event *);
70 void editEventSignal(Event *); 74 void editEventSignal(Event *);
71 void deleteEventSignal(Event *); 75 void deleteEventSignal(Event *);
72 76
73 private: 77 private:
74 78
75 QHBox *incidenceGroup ,*subjectGroup ,*attendeeGroup; 79 Q3HBox *incidenceGroup ,*subjectGroup ,*attendeeGroup;
76 void search(const QRegExp &); 80 void search(const QRegExp &);
77 81
78 Calendar *mCalendar; 82 Calendar *mCalendar;
79 83
80 QPtrList<Event> mMatchedEvents; 84 Q3PtrList<Event> mMatchedEvents;
81 QPtrList<Todo> mMatchedTodos; 85 Q3PtrList<Todo> mMatchedTodos;
82 QPtrList<Journal> mMatchedJournals; 86 Q3PtrList<Journal> mMatchedJournals;
83 87
84 QLabel *searchLabel; 88 QLabel *searchLabel;
85 KLineEdit *searchEdit; 89 KLineEdit *searchEdit;
86 KOListView *listView; 90 KOListView *listView;
87 91
88 KDateEdit *mStartDate; 92 KDateEdit *mStartDate;
89 KDateEdit *mEndDate; 93 KDateEdit *mEndDate;
90 QCheckBox *mSummaryCheck; 94 QCheckBox *mSummaryCheck;
91 QCheckBox *mDescriptionCheck; 95 QCheckBox *mDescriptionCheck;
92 QCheckBox *mCategoryCheck; 96 QCheckBox *mCategoryCheck;
93 QCheckBox *mSearchEvent; 97 QCheckBox *mSearchEvent;
94 QCheckBox *mSearchTodo; 98 QCheckBox *mSearchTodo;
diff --git a/korganizer/statusdialog.cpp b/korganizer/statusdialog.cpp
index 7137c49..8186ebb 100644
--- a/korganizer/statusdialog.cpp
+++ b/korganizer/statusdialog.cpp
@@ -12,49 +12,52 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <qlabel.h> 20#include <qlabel.h>
21#include <qpushbutton.h> 21#include <qpushbutton.h>
22#include <qstringlist.h> 22#include <qstringlist.h>
23#include <qlayout.h> 23#include <qlayout.h>
24//Added by qt3to4:
25#include <Q3VBoxLayout>
26#include <Q3HBoxLayout>
24 27
25#include <kdebug.h> 28#include <kdebug.h>
26#include <klocale.h> 29#include <klocale.h>
27 30
28#include "statusdialog.h" 31#include "statusdialog.h"
29 32
30StatusDialog::StatusDialog(QWidget* parent, const char* name) : 33StatusDialog::StatusDialog(QWidget* parent, const char* name) :
31 KDialog(parent,name,true) 34 KDialog(parent,name,true)
32{ 35{
33 setCaption(i18n("Set Your Status")); 36 setCaption(i18n("Set Your Status"));
34 37
35 QBoxLayout *topLayout = new QVBoxLayout( this ); 38 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
36 topLayout->setSpacing( spacingHint() ); 39 topLayout->setSpacing( spacingHint() );
37 topLayout->setMargin( marginHint() ); 40 topLayout->setMargin( marginHint() );
38 41
39 QBoxLayout *statusLayout = new QHBoxLayout( topLayout ); 42 Q3BoxLayout *statusLayout = new Q3HBoxLayout( topLayout );
40 43
41 QLabel *text = new QLabel(i18n("Set your status"),this); 44 QLabel *text = new QLabel(i18n("Set your status"),this);
42 statusLayout->addWidget( text ); 45 statusLayout->addWidget( text );
43 46
44 mStatus = new QComboBox(false,this); 47 mStatus = new QComboBox(false,this);
45 mStatus->insertStringList(Attendee::statusList()); 48 mStatus->insertStringList(Attendee::statusList());
46 statusLayout->addWidget( mStatus ); 49 statusLayout->addWidget( mStatus );
47 50
48 QBoxLayout *buttonLayout = new QHBoxLayout( topLayout ); 51 Q3BoxLayout *buttonLayout = new Q3HBoxLayout( topLayout );
49 52
50 QPushButton *ok = new QPushButton(i18n("&OK"), this); 53 QPushButton *ok = new QPushButton(i18n("&OK"), this);
51 connect ( ok,SIGNAL(clicked()), this,SLOT(accept()) ); 54 connect ( ok,SIGNAL(clicked()), this,SLOT(accept()) );
52 buttonLayout->addWidget( ok ); 55 buttonLayout->addWidget( ok );
53 56
54 QPushButton *cancel = new QPushButton(i18n("&Cancel"), this); 57 QPushButton *cancel = new QPushButton(i18n("&Cancel"), this);
55 connect ( cancel,SIGNAL(clicked()), this,SLOT(reject()) ); 58 connect ( cancel,SIGNAL(clicked()), this,SLOT(reject()) );
56 buttonLayout->addWidget( cancel ); 59 buttonLayout->addWidget( cancel );
57} 60}
58 61
59StatusDialog::~StatusDialog() 62StatusDialog::~StatusDialog()
60{ 63{
diff --git a/korganizer/timeline.cpp b/korganizer/timeline.cpp
index 11be432..a6c3cdc 100644
--- a/korganizer/timeline.cpp
+++ b/korganizer/timeline.cpp
@@ -1,26 +1,26 @@
1#include <qpainter.h> 1#include <qpainter.h>
2 2
3#include <kdebug.h> 3#include <kdebug.h>
4 4
5#include "timeline.h" 5#include "timeline.h"
6 6
7TimeLine::TimeLine( QWidget *parent, const char *name ) : 7TimeLine::TimeLine( QWidget *parent, const char *name ) :
8 QScrollView( parent, name ) 8 Q3ScrollView( parent, name )
9{ 9{
10 mPixelWidth = 1000; 10 mPixelWidth = 1000;
11 11
12 resizeContents( mPixelWidth, 20 ); 12 resizeContents( mPixelWidth, 20 );
13 13
14 viewport()->setBackgroundMode( PaletteBackground ); 14 viewport()->setBackgroundMode( Qt::PaletteBackground );
15 15
16 setHScrollBarMode(AlwaysOff); 16 setHScrollBarMode(AlwaysOff);
17 setVScrollBarMode(AlwaysOff); 17 setVScrollBarMode(AlwaysOff);
18} 18}
19 19
20TimeLine::~TimeLine() 20TimeLine::~TimeLine()
21{ 21{
22} 22}
23 23
24void TimeLine::drawContents(QPainter* p, int cx, int cy, int cw, int ch) 24void TimeLine::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
25{ 25{
26 int spacingX = mDaySpacing; 26 int spacingX = mDaySpacing;
@@ -49,14 +49,14 @@ void TimeLine::setDateRange( const QDateTime &start, const QDateTime &end )
49 mSecsPerPixel = mStartDate.secsTo( mEndDate ) / mPixelWidth; 49 mSecsPerPixel = mStartDate.secsTo( mEndDate ) / mPixelWidth;
50 50
51 mDaySpacing = 60 * 60 * 24 / mSecsPerPixel; 51 mDaySpacing = 60 * 60 * 24 / mSecsPerPixel;
52 52
53 mDayOffset = QDateTime( mStartDate.date() ).secsTo( mStartDate ) / mSecsPerPixel; 53 mDayOffset = QDateTime( mStartDate.date() ).secsTo( mStartDate ) / mSecsPerPixel;
54 54
55 kdDebug() << "TimeLines::setDateRange(): mDaySpacing: " << mDaySpacing << " mDayOffset: " 55 kdDebug() << "TimeLines::setDateRange(): mDaySpacing: " << mDaySpacing << " mDayOffset: "
56 << mDayOffset << " mSecsPerPixel: " << mSecsPerPixel << endl; 56 << mDayOffset << " mSecsPerPixel: " << mSecsPerPixel << endl;
57} 57}
58 58
59void TimeLine::setContentsPos( int pos ) 59void TimeLine::setContentsPos( int pos )
60{ 60{
61 QScrollView::setContentsPos ( pos, 0 ); 61 Q3ScrollView::setContentsPos ( pos, 0 );
62} 62}
diff --git a/korganizer/timeline.h b/korganizer/timeline.h
index ab3e5d3..bf301fa 100644
--- a/korganizer/timeline.h
+++ b/korganizer/timeline.h
@@ -1,19 +1,19 @@
1#ifndef TIMELINE_H 1#ifndef TIMELINE_H
2#define TIMELINE_H 2#define TIMELINE_H
3 3
4#include <qscrollview.h> 4#include <q3scrollview.h>
5#include <qdatetime.h> 5#include <qdatetime.h>
6 6
7class TimeLine : public QScrollView 7class TimeLine : public Q3ScrollView
8{ 8{
9 Q_OBJECT 9 Q_OBJECT
10 public: 10 public:
11 TimeLine( QWidget *parent = 0, const char *name = 0 ); 11 TimeLine( QWidget *parent = 0, const char *name = 0 );
12 virtual ~TimeLine(); 12 virtual ~TimeLine();
13 13
14 void setDateRange( const QDateTime &start, const QDateTime &end ); 14 void setDateRange( const QDateTime &start, const QDateTime &end );
15 15
16 public slots: 16 public slots:
17 void setContentsPos( int pos ); 17 void setContentsPos( int pos );
18 18
19 protected: 19 protected:
diff --git a/korganizer/timespanview.cpp b/korganizer/timespanview.cpp
index df8ff88..0908056 100644
--- a/korganizer/timespanview.cpp
+++ b/korganizer/timespanview.cpp
@@ -1,91 +1,95 @@
1 1
2#ifndef DESKTOP_VERSION 2#ifndef DESKTOP_VERSION
3#include <qksplitter.h> 3#include <qksplitter.h>
4#else 4#else
5#include <qsplitter.h> 5#include <qsplitter.h>
6#endif 6#endif
7#include <qlistview.h> 7#include <q3listview.h>
8#include <qlayout.h> 8#include <qlayout.h>
9#include <qheader.h> 9#include <q3header.h>
10#include <qpushbutton.h> 10#include <qpushbutton.h>
11//Added by qt3to4:
12#include <Q3HBoxLayout>
13#include <Q3VBoxLayout>
14#include <Q3ValueList>
11 15
12#include <klocale.h> 16#include <klocale.h>
13#include <kdebug.h> 17#include <kdebug.h>
14 18
15#include "lineview.h" 19#include "lineview.h"
16#include "timeline.h" 20#include "timeline.h"
17 21
18#include "timespanview.h" 22#include "timespanview.h"
19 23
20 24
21TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) : 25TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) :
22 QWidget( parent, name ) 26 QWidget( parent, name )
23{ 27{
24 QBoxLayout *topLayout = new QVBoxLayout( this ); 28 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
25#ifndef DESKTOP_VERSION 29#ifndef DESKTOP_VERSION
26 mSplitter = new QKSplitter( this ); 30 mSplitter = new QKSplitter( this );
27#else 31#else
28 mSplitter = new QSplitter( this ); 32 mSplitter = new QSplitter( this );
29#endif 33#endif
30 topLayout->addWidget( mSplitter ); 34 topLayout->addWidget( mSplitter );
31 35
32 mList = new QListView( mSplitter ); 36 mList = new Q3ListView( mSplitter );
33 mList->addColumn( i18n("Summary") ); 37 mList->addColumn( i18n("Summary") );
34 38
35 QWidget *rightPane = new QWidget( mSplitter ); 39 QWidget *rightPane = new QWidget( mSplitter );
36 QBoxLayout *rightPaneLayout = new QVBoxLayout( rightPane ); 40 Q3BoxLayout *rightPaneLayout = new Q3VBoxLayout( rightPane );
37 41
38 mTimeLine = new TimeLine( rightPane ); 42 mTimeLine = new TimeLine( rightPane );
39 mTimeLine->setFixedHeight( mList->header()->height() ); 43 mTimeLine->setFixedHeight( mList->header()->height() );
40 rightPaneLayout->addWidget( mTimeLine ); 44 rightPaneLayout->addWidget( mTimeLine );
41 45
42 mLineView = new LineView( rightPane ); 46 mLineView = new LineView( rightPane );
43 rightPaneLayout->addWidget( mLineView ); 47 rightPaneLayout->addWidget( mLineView );
44 48
45 QBoxLayout *buttonLayout = new QHBoxLayout( rightPaneLayout ); 49 Q3BoxLayout *buttonLayout = new Q3HBoxLayout( rightPaneLayout );
46 50
47 QPushButton *zoomInButton = new QPushButton( i18n("Zoom In"), rightPane ); 51 QPushButton *zoomInButton = new QPushButton( i18n("Zoom In"), rightPane );
48 connect( zoomInButton, SIGNAL( clicked() ), SLOT( zoomIn() ) ); 52 connect( zoomInButton, SIGNAL( clicked() ), SLOT( zoomIn() ) );
49 buttonLayout->addWidget( zoomInButton ); 53 buttonLayout->addWidget( zoomInButton );
50 54
51 QPushButton *zoomOutButton = new QPushButton( i18n("Zoom Out"), rightPane ); 55 QPushButton *zoomOutButton = new QPushButton( i18n("Zoom Out"), rightPane );
52 connect( zoomOutButton, SIGNAL( clicked() ), SLOT( zoomOut() ) ); 56 connect( zoomOutButton, SIGNAL( clicked() ), SLOT( zoomOut() ) );
53 buttonLayout->addWidget( zoomOutButton ); 57 buttonLayout->addWidget( zoomOutButton );
54 58
55 QPushButton *centerButton = new QPushButton( i18n("Center View"), rightPane ); 59 QPushButton *centerButton = new QPushButton( i18n("Center View"), rightPane );
56 connect( centerButton, SIGNAL( clicked() ), SLOT( centerView() ) ); 60 connect( centerButton, SIGNAL( clicked() ), SLOT( centerView() ) );
57 buttonLayout->addWidget( centerButton ); 61 buttonLayout->addWidget( centerButton );
58 62
59 connect(mLineView->horizontalScrollBar(),SIGNAL(valueChanged(int)), 63 connect(mLineView->horizontalScrollBar(),SIGNAL(valueChanged(int)),
60 mTimeLine,SLOT(setContentsPos(int))); 64 mTimeLine,SLOT(setContentsPos(int)));
61} 65}
62 66
63TimeSpanView::~TimeSpanView() 67TimeSpanView::~TimeSpanView()
64{ 68{
65} 69}
66 70
67QValueList<int> TimeSpanView::splitterSizes() 71Q3ValueList<int> TimeSpanView::splitterSizes()
68{ 72{
69 return mSplitter->sizes(); 73 return mSplitter->sizes();
70} 74}
71 75
72void TimeSpanView::setSplitterSizes( QValueList<int> sizes ) 76void TimeSpanView::setSplitterSizes( Q3ValueList<int> sizes )
73{ 77{
74 mSplitter->setSizes( sizes ); 78 mSplitter->setSizes( sizes );
75} 79}
76 80
77void TimeSpanView::addItem( KCal::Event *event ) 81void TimeSpanView::addItem( KCal::Event *event )
78{ 82{
79 new QListViewItem( mList, event->summary() ); 83 new Q3ListViewItem( mList, event->summary() );
80 84
81 QDateTime startDt = event->dtStart(); 85 QDateTime startDt = event->dtStart();
82 QDateTime endDt = event->dtEnd(); 86 QDateTime endDt = event->dtEnd();
83 87
84// kdDebug() << "TimeSpanView::addItem(): start: " << startDt.toString() 88// kdDebug() << "TimeSpanView::addItem(): start: " << startDt.toString()
85// << " end: " << endDt.toString() << endl; 89// << " end: " << endDt.toString() << endl;
86 90
87 int startSecs = mStartDate.secsTo( startDt ); 91 int startSecs = mStartDate.secsTo( startDt );
88 int durationSecs = startDt.secsTo( endDt ); 92 int durationSecs = startDt.secsTo( endDt );
89 93
90// kdDebug() << "--- startSecs: " << startSecs << " dur: " << durationSecs << endl; 94// kdDebug() << "--- startSecs: " << startSecs << " dur: " << durationSecs << endl;
91 95
diff --git a/korganizer/timespanview.h b/korganizer/timespanview.h
index 34cb1f7..f652374 100644
--- a/korganizer/timespanview.h
+++ b/korganizer/timespanview.h
@@ -1,60 +1,62 @@
1#ifndef TIMESPANVIEW_H 1#ifndef TIMESPANVIEW_H
2#define TIMESPANVIEW_H 2#define TIMESPANVIEW_H
3 3
4#include <qwidget.h> 4#include <qwidget.h>
5//Added by qt3to4:
6#include <Q3ValueList>
5 7
6#include <libkcal/event.h> 8#include <libkcal/event.h>
7 9
8//class QSplitter; 10//class QSplitter;
9#ifndef DESKTOP_VERSION 11#ifndef DESKTOP_VERSION
10class QKSplitter; 12class QKSplitter;
11#else 13#else
12class QSplitter; 14class QSplitter;
13#define QKSplitter QSplitter 15#define QKSplitter QSplitter
14#endif 16#endif
15class QListView; 17class Q3ListView;
16class LineView; 18class LineView;
17class TimeLine; 19class TimeLine;
18 20
19 21
20class TimeSpanView : public QWidget 22class TimeSpanView : public QWidget
21{ 23{
22 Q_OBJECT 24 Q_OBJECT
23 public: 25 public:
24 TimeSpanView( QWidget *parent=0, const char *name=0 ); 26 TimeSpanView( QWidget *parent=0, const char *name=0 );
25 virtual ~TimeSpanView(); 27 virtual ~TimeSpanView();
26 28
27 void addItem( KCal::Event * ); 29 void addItem( KCal::Event * );
28 30
29 QValueList<int> splitterSizes(); 31 Q3ValueList<int> splitterSizes();
30 void setSplitterSizes( QValueList<int> ); 32 void setSplitterSizes( Q3ValueList<int> );
31 33
32 void clear(); 34 void clear();
33 35
34 void setDateRange( const QDateTime &start, const QDateTime &end ); 36 void setDateRange( const QDateTime &start, const QDateTime &end );
35 37
36 QDateTime startDateTime(); 38 QDateTime startDateTime();
37 QDateTime endDateTime(); 39 QDateTime endDateTime();
38 40
39 public slots: 41 public slots:
40 void updateView(); 42 void updateView();
41 43
42 void zoomIn(); 44 void zoomIn();
43 void zoomOut(); 45 void zoomOut();
44 void centerView(); 46 void centerView();
45 47
46 signals: 48 signals:
47 void dateRangeChanged(); 49 void dateRangeChanged();
48 50
49 private: 51 private:
50 QKSplitter *mSplitter; 52 QKSplitter *mSplitter;
51 QListView *mList; 53 Q3ListView *mList;
52 TimeLine *mTimeLine; 54 TimeLine *mTimeLine;
53 LineView *mLineView; 55 LineView *mLineView;
54 56
55 QDateTime mStartDate; 57 QDateTime mStartDate;
56 QDateTime mEndDate; 58 QDateTime mEndDate;
57 int mSecsPerPixel; 59 int mSecsPerPixel;
58}; 60};
59 61
60#endif 62#endif
diff --git a/libetpan/libetpan.pro b/libetpan/libetpan.pro
index 10f51da..909d064 100644
--- a/libetpan/libetpan.pro
+++ b/libetpan/libetpan.pro
@@ -1,18 +1,19 @@
1include( ../variables.pri )
1###################################################################### 2######################################################################
2# Automatically generated by qmake (1.07a) Fri Mar 18 19:27:39 2005 3# Automatically generated by qmake (1.07a) Fri Mar 18 19:27:39 2005
3###################################################################### 4######################################################################
4 5
5TEMPLATE = lib 6TEMPLATE = lib
6 TARGET = microlibetpan 7 TARGET = xmicrolibetpan
7OBJECTS_DIR = obj 8OBJECTS_DIR = obj
8MOC_DIR = moc 9MOC_DIR = moc
9DESTDIR=../bin 10DESTDIR=../bin
10DEPENDPATH += include/libetpan \ 11DEPENDPATH += include/libetpan \
11 src/data-types \ 12 src/data-types \
12 src/engine \ 13 src/engine \
13 src/main \ 14 src/main \
14 src/driver/interface \ 15 src/driver/interface \
15 src/driver/tools \ 16 src/driver/tools \
16 src/low-level/imap \ 17 src/low-level/imap \
17 src/low-level/imf \ 18 src/low-level/imf \
18 src/low-level/maildir \ 19 src/low-level/maildir \
@@ -439,12 +440,14 @@ SOURCES += src/data-types/base64.c \
439 src/driver/implementation/nntp/nntpdriver.c \ 440 src/driver/implementation/nntp/nntpdriver.c \
440 src/driver/implementation/nntp/nntpdriver_cached.c \ 441 src/driver/implementation/nntp/nntpdriver_cached.c \
441 src/driver/implementation/nntp/nntpdriver_cached_message.c \ 442 src/driver/implementation/nntp/nntpdriver_cached_message.c \
442 src/driver/implementation/nntp/nntpdriver_message.c \ 443 src/driver/implementation/nntp/nntpdriver_message.c \
443 src/driver/implementation/nntp/nntpdriver_tools.c \ 444 src/driver/implementation/nntp/nntpdriver_tools.c \
444 src/driver/implementation/nntp/nntpstorage.c \ 445 src/driver/implementation/nntp/nntpstorage.c \
445 src/driver/implementation/pop3/pop3driver.c \ 446 src/driver/implementation/pop3/pop3driver.c \
446 src/driver/implementation/pop3/pop3driver_cached.c \ 447 src/driver/implementation/pop3/pop3driver_cached.c \
447 src/driver/implementation/pop3/pop3driver_cached_message.c \ 448 src/driver/implementation/pop3/pop3driver_cached_message.c \
448 src/driver/implementation/pop3/pop3driver_message.c \ 449 src/driver/implementation/pop3/pop3driver_message.c \
449 src/driver/implementation/pop3/pop3driver_tools.c \ 450 src/driver/implementation/pop3/pop3driver_tools.c \
450 src/driver/implementation/pop3/pop3storage.c 451 src/driver/implementation/pop3/pop3storage.c
452#The following line was inserted by qt3to4
453QT += xml qt3support
diff --git a/libetpan/libetpanE.pro b/libetpan/libetpanE.pro
index 4b82196..9ba1a6d 100644
--- a/libetpan/libetpanE.pro
+++ b/libetpan/libetpanE.pro
@@ -1,18 +1,18 @@
1###################################################################### 1######################################################################
2# Automatically generated by qmake (1.07a) Fri Mar 18 19:27:39 2005 2# Automatically generated by qmake (1.07a) Fri Mar 18 19:27:39 2005
3###################################################################### 3######################################################################
4 4
5TEMPLATE = lib 5TEMPLATE = lib
6 TARGET = microlibetpan 6 TARGET = xmicrolibetpan
7OBJECTS_DIR = obj/$(PLATFORM) 7OBJECTS_DIR = obj/$(PLATFORM)
8MOC_DIR = moc/$(PLATFORM) 8MOC_DIR = moc/$(PLATFORM)
9DESTDIR=$(QPEDIR)/lib 9DESTDIR=$(QPEDIR)/lib
10DEPENDPATH += include/libetpan \ 10DEPENDPATH += include/libetpan \
11 src/data-types \ 11 src/data-types \
12 src/engine \ 12 src/engine \
13 src/main \ 13 src/main \
14 src/driver/interface \ 14 src/driver/interface \
15 src/driver/tools \ 15 src/driver/tools \
16 src/low-level/imap \ 16 src/low-level/imap \
17 src/low-level/imf \ 17 src/low-level/imf \
18 src/low-level/maildir \ 18 src/low-level/maildir \
diff --git a/libical/src/libical/libical.pro b/libical/src/libical/libical.pro
index b794f04..24f02af 100644
--- a/libical/src/libical/libical.pro
+++ b/libical/src/libical/libical.pro
@@ -60,12 +60,14 @@ SOURCES += caldate.c \
60 icalproperty.c \ 60 icalproperty.c \
61 icalrecur.c \ 61 icalrecur.c \
62 icalrestriction.c \ 62 icalrestriction.c \
63 icaltime.c \ 63 icaltime.c \
64 icaltimezone.c \ 64 icaltimezone.c \
65 icaltypes.c \ 65 icaltypes.c \
66 icalvalue.c \ 66 icalvalue.c \
67 pvl.c \ 67 pvl.c \
68 sspm.c 68 sspm.c
69 69
70 70
71# vsnprintf.c 71# vsnprintf.c
72#The following line was inserted by qt3to4
73QT += xml qt3support
diff --git a/libical/src/libicalss/libicalss.pro b/libical/src/libicalss/libicalss.pro
index 7fb8a64..27170bf 100644
--- a/libical/src/libicalss/libicalss.pro
+++ b/libical/src/libicalss/libicalss.pro
@@ -33,12 +33,14 @@ HEADERS += icalcalendar.h \
33 icalssyacc.h 33 icalssyacc.h
34SOURCES += icalcalendar.c \ 34SOURCES += icalcalendar.c \
35 icalclassify.c \ 35 icalclassify.c \
36 icalcluster.c \ 36 icalcluster.c \
37 icaldirset.c \ 37 icaldirset.c \
38 icalfileset.c \ 38 icalfileset.c \
39 icalgauge.c \ 39 icalgauge.c \
40 icalmessage.c \ 40 icalmessage.c \
41 icalset.c \ 41 icalset.c \
42 icalspanlist.c \ 42 icalspanlist.c \
43 icalsslexer.c \ 43 icalsslexer.c \
44 icalssyacc.c 44 icalssyacc.c
45#The following line was inserted by qt3to4
46QT += xml qt3support
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 3157214..3c4a81c 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -17,24 +17,26 @@
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <kdebug.h> 22#include <kdebug.h>
23#include <klocale.h> 23#include <klocale.h>
24 24
25#include "incidence.h" 25#include "incidence.h"
26#include "todo.h" 26#include "todo.h"
27 27
28#include "alarm.h" 28#include "alarm.h"
29//Added by qt3to4:
30#include <Q3ValueList>
29 31
30using namespace KCal; 32using namespace KCal;
31#include <qwidget.h> 33#include <qwidget.h>
32Alarm::Alarm(Incidence *parent) 34Alarm::Alarm(Incidence *parent)
33 : mParent(parent), 35 : mParent(parent),
34 mType(Audio), 36 mType(Audio),
35 mDescription(""), // to make operator==() not fail 37 mDescription(""), // to make operator==() not fail
36 mFile(""), // to make operator==() not fail 38 mFile(""), // to make operator==() not fail
37 mMailSubject(""), // to make operator==() not fail 39 mMailSubject(""), // to make operator==() not fail
38 mAlarmSnoozeTime(5), 40 mAlarmSnoozeTime(5),
39 mAlarmRepeatCount(0), 41 mAlarmRepeatCount(0),
40 mEndOffset(false), 42 mEndOffset(false),
@@ -203,62 +205,62 @@ void Alarm::setProgramArguments(const QString &arguments)
203 if (mType == Procedure) { 205 if (mType == Procedure) {
204 mDescription = arguments; 206 mDescription = arguments;
205 mParent->updated(); 207 mParent->updated();
206 } 208 }
207} 209}
208 210
209QString Alarm::programArguments() const 211QString Alarm::programArguments() const
210{ 212{
211 return (mType == Procedure) ? mDescription : QString::null; 213 return (mType == Procedure) ? mDescription : QString::null;
212} 214}
213 215
214void Alarm::setEmailAlarm(const QString &subject, const QString &text, 216void Alarm::setEmailAlarm(const QString &subject, const QString &text,
215 const QValueList<Person> &addressees, const QStringList &attachments) 217 const Q3ValueList<Person> &addressees, const QStringList &attachments)
216{ 218{
217 mType = Email; 219 mType = Email;
218 mMailSubject = subject; 220 mMailSubject = subject;
219 mDescription = text; 221 mDescription = text;
220 mMailAddresses = addressees; 222 mMailAddresses = addressees;
221 mMailAttachFiles = attachments; 223 mMailAttachFiles = attachments;
222 mParent->updated(); 224 mParent->updated();
223} 225}
224 226
225void Alarm::setMailAddress(const Person &mailAddress) 227void Alarm::setMailAddress(const Person &mailAddress)
226{ 228{
227 if (mType == Email) { 229 if (mType == Email) {
228 mMailAddresses.clear(); 230 mMailAddresses.clear();
229 mMailAddresses += mailAddress; 231 mMailAddresses += mailAddress;
230 mParent->updated(); 232 mParent->updated();
231 } 233 }
232} 234}
233 235
234void Alarm::setMailAddresses(const QValueList<Person> &mailAddresses) 236void Alarm::setMailAddresses(const Q3ValueList<Person> &mailAddresses)
235{ 237{
236 if (mType == Email) { 238 if (mType == Email) {
237 mMailAddresses = mailAddresses; 239 mMailAddresses = mailAddresses;
238 mParent->updated(); 240 mParent->updated();
239 } 241 }
240} 242}
241 243
242void Alarm::addMailAddress(const Person &mailAddress) 244void Alarm::addMailAddress(const Person &mailAddress)
243{ 245{
244 if (mType == Email) { 246 if (mType == Email) {
245 mMailAddresses += mailAddress; 247 mMailAddresses += mailAddress;
246 mParent->updated(); 248 mParent->updated();
247 } 249 }
248} 250}
249 251
250QValueList<Person> Alarm::mailAddresses() const 252Q3ValueList<Person> Alarm::mailAddresses() const
251{ 253{
252 return (mType == Email) ? mMailAddresses : QValueList<Person>(); 254 return (mType == Email) ? mMailAddresses : Q3ValueList<Person>();
253} 255}
254 256
255void Alarm::setMailSubject(const QString &mailAlarmSubject) 257void Alarm::setMailSubject(const QString &mailAlarmSubject)
256{ 258{
257 if (mType == Email) { 259 if (mType == Email) {
258 mMailSubject = mailAlarmSubject; 260 mMailSubject = mailAlarmSubject;
259 mParent->updated(); 261 mParent->updated();
260 } 262 }
261} 263}
262 264
263QString Alarm::mailSubject() const 265QString Alarm::mailSubject() const
264{ 266{
diff --git a/libkcal/alarm.h b/libkcal/alarm.h
index ac6ea0d..b24f0f7 100644
--- a/libkcal/alarm.h
+++ b/libkcal/alarm.h
@@ -13,42 +13,42 @@
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#ifndef KCAL_ALARM_H 21#ifndef KCAL_ALARM_H
22#define KCAL_ALARM_H 22#define KCAL_ALARM_H
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qvaluelist.h> 25#include <q3valuelist.h>
26 26
27#include "customproperties.h" 27#include "customproperties.h"
28#include "duration.h" 28#include "duration.h"
29#include "person.h" 29#include "person.h"
30 30
31namespace KCal { 31namespace KCal {
32 32
33class Incidence; 33class Incidence;
34 34
35/** 35/**
36 This class represents an alarm notification. 36 This class represents an alarm notification.
37*/ 37*/
38class Alarm : public CustomProperties 38class Alarm : public CustomProperties
39{ 39{
40 public: 40 public:
41 enum Type { Invalid, Display, Procedure, Email, Audio }; 41 enum Type { Invalid, Display, Procedure, Email, Audio };
42 typedef QValueList<Alarm *> List; 42 typedef Q3ValueList<Alarm *> List;
43 43
44 /** Construct a new alarm with variables initialized to "sane" values. */ 44 /** Construct a new alarm with variables initialized to "sane" values. */
45 explicit Alarm(Incidence *parent); 45 explicit Alarm(Incidence *parent);
46 /** Destruct Alarm object. */ 46 /** Destruct Alarm object. */
47 ~Alarm(); 47 ~Alarm();
48 48
49 /** Compare this alarm with another one. */ 49 /** Compare this alarm with another one. */
50 bool operator==(const Alarm &) const; 50 bool operator==(const Alarm &) const;
51 bool operator!=(const Alarm &a) const { return !operator==(a); } 51 bool operator!=(const Alarm &a) const { return !operator==(a); }
52 52
53 /** Set the type of the alarm. 53 /** Set the type of the alarm.
54 If the specified type is different from the current type of the alarm, 54 If the specified type is different from the current type of the alarm,
@@ -103,41 +103,41 @@ class Alarm : public CustomProperties
103 void setProgramArguments(const QString &arguments); 103 void setProgramArguments(const QString &arguments);
104 /** Return the arguments to the program to run when the alarm is triggered. 104 /** Return the arguments to the program to run when the alarm is triggered.
105 @return the program arguments, or QString::null if not a procedure alarm. 105 @return the program arguments, or QString::null if not a procedure alarm.
106 */ 106 */
107 QString programArguments() const; 107 QString programArguments() const;
108 108
109 /** Set the alarm to be an email alarm. 109 /** Set the alarm to be an email alarm.
110 @param subject subject line of email. 110 @param subject subject line of email.
111 @param text body of email. 111 @param text body of email.
112 @param addressees email addresses of recipient(s). 112 @param addressees email addresses of recipient(s).
113 @param attachments optional names of files to attach to the email. 113 @param attachments optional names of files to attach to the email.
114 */ 114 */
115 void setEmailAlarm(const QString &subject, const QString &text, const QValueList<Person> &addressees, 115 void setEmailAlarm(const QString &subject, const QString &text, const Q3ValueList<Person> &addressees,
116 const QStringList &attachments = QStringList()); 116 const QStringList &attachments = QStringList());
117 117
118 /** Send mail to this address when the alarm is triggered. 118 /** Send mail to this address when the alarm is triggered.
119 Ignored if the alarm is not an email alarm. 119 Ignored if the alarm is not an email alarm.
120 */ 120 */
121 void setMailAddress(const Person &mailAlarmAddress); 121 void setMailAddress(const Person &mailAlarmAddress);
122 /** Send mail to these addresses when the alarm is triggered. 122 /** Send mail to these addresses when the alarm is triggered.
123 Ignored if the alarm is not an email alarm. 123 Ignored if the alarm is not an email alarm.
124 */ 124 */
125 void setMailAddresses(const QValueList<Person> &mailAlarmAddresses); 125 void setMailAddresses(const Q3ValueList<Person> &mailAlarmAddresses);
126 /** Add this address to the list of addresses to send mail to when the alarm is triggered. 126 /** Add this address to the list of addresses to send mail to when the alarm is triggered.
127 Ignored if the alarm is not an email alarm. 127 Ignored if the alarm is not an email alarm.
128 */ 128 */
129 void addMailAddress(const Person &mailAlarmAddress); 129 void addMailAddress(const Person &mailAlarmAddress);
130 /** return the addresses to send mail to when an alarm goes off */ 130 /** return the addresses to send mail to when an alarm goes off */
131 QValueList<Person> mailAddresses() const; 131 Q3ValueList<Person> mailAddresses() const;
132 132
133 /** Set the subject line of the mail. 133 /** Set the subject line of the mail.
134 Ignored if the alarm is not an email alarm. 134 Ignored if the alarm is not an email alarm.
135 */ 135 */
136 void setMailSubject(const QString &mailAlarmSubject); 136 void setMailSubject(const QString &mailAlarmSubject);
137 /** return the subject line of the mail */ 137 /** return the subject line of the mail */
138 QString mailSubject() const; 138 QString mailSubject() const;
139 139
140 /** Attach this filename to the email. 140 /** Attach this filename to the email.
141 Ignored if the alarm is not an email alarm. 141 Ignored if the alarm is not an email alarm.
142 */ 142 */
143 void setMailAttachment(const QString &mailAttachFile); 143 void setMailAttachment(const QString &mailAttachFile);
@@ -217,25 +217,25 @@ class Alarm : public CustomProperties
217 217
218 /** Set the alarm's parent incidence */ 218 /** Set the alarm's parent incidence */
219 void setParent( Incidence * ); 219 void setParent( Incidence * );
220 /** get the alarm's parent incidence */ 220 /** get the alarm's parent incidence */
221 Incidence *parent() const { return mParent; } 221 Incidence *parent() const { return mParent; }
222 222
223 private: 223 private:
224 Incidence *mParent; // the incidence which this alarm belongs to 224 Incidence *mParent; // the incidence which this alarm belongs to
225 Type mType; // type of alarm 225 Type mType; // type of alarm
226 QString mDescription; // text to display/email body/procedure arguments 226 QString mDescription; // text to display/email body/procedure arguments
227 QString mFile; // procedure program to run/optional audio file to play 227 QString mFile; // procedure program to run/optional audio file to play
228 QStringList mMailAttachFiles; // filenames to attach to email 228 QStringList mMailAttachFiles; // filenames to attach to email
229 QValueList<Person> mMailAddresses; // who to mail for reminder 229 Q3ValueList<Person> mMailAddresses; // who to mail for reminder
230 QString mMailSubject; // subject of email 230 QString mMailSubject; // subject of email
231 231
232 int mAlarmSnoozeTime; // number of minutes after alarm to 232 int mAlarmSnoozeTime; // number of minutes after alarm to
233 // snooze before ringing again 233 // snooze before ringing again
234 int mAlarmRepeatCount; // number of times for alarm to repeat 234 int mAlarmRepeatCount; // number of times for alarm to repeat
235 // after the initial time 235 // after the initial time
236 236
237 QDateTime mAlarmTime; // time at which to trigger the alarm 237 QDateTime mAlarmTime; // time at which to trigger the alarm
238 Duration mOffset; // time relative to incidence DTSTART to trigger the alarm 238 Duration mOffset; // time relative to incidence DTSTART to trigger the alarm
239 bool mEndOffset; // if true, mOffset relates to DTEND, not DTSTART 239 bool mEndOffset; // if true, mOffset relates to DTEND, not DTSTART
240 bool mHasTime; // use mAlarmTime, not mOffset 240 bool mHasTime; // use mAlarmTime, not mOffset
241 bool mAlarmEnabled; 241 bool mAlarmEnabled;
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp
index 9b38d3f..bf095cf 100644
--- a/libkcal/calendar.cpp
+++ b/libkcal/calendar.cpp
@@ -21,24 +21,26 @@
21#include <stdlib.h> 21#include <stdlib.h>
22#include <time.h> 22#include <time.h>
23 23
24#include <kdebug.h> 24#include <kdebug.h>
25#include <kglobal.h> 25#include <kglobal.h>
26#include <klocale.h> 26#include <klocale.h>
27 27
28#include "exceptions.h" 28#include "exceptions.h"
29#include "calfilter.h" 29#include "calfilter.h"
30 30
31#include "calendar.h" 31#include "calendar.h"
32#include "syncdefines.h" 32#include "syncdefines.h"
33//Added by qt3to4:
34#include <Q3PtrList>
33 35
34using namespace KCal; 36using namespace KCal;
35 37
36Calendar::Calendar() 38Calendar::Calendar()
37{ 39{
38 40
39 init(); 41 init();
40 setTimeZoneId( " 00:00 Europe/London(UTC)" ); 42 setTimeZoneId( " 00:00 Europe/London(UTC)" );
41} 43}
42 44
43Calendar::Calendar( const QString &timeZoneId ) 45Calendar::Calendar( const QString &timeZoneId )
44{ 46{
@@ -262,123 +264,123 @@ void Calendar::setEmail(const QString &e)
262} 264}
263 265
264void Calendar::setFilter(CalFilter *filter) 266void Calendar::setFilter(CalFilter *filter)
265{ 267{
266 mFilter = filter; 268 mFilter = filter;
267} 269}
268 270
269CalFilter *Calendar::filter() 271CalFilter *Calendar::filter()
270{ 272{
271 return mFilter; 273 return mFilter;
272} 274}
273 275
274QPtrList<Incidence> Calendar::incidences() 276Q3PtrList<Incidence> Calendar::incidences()
275{ 277{
276 QPtrList<Incidence> incidences; 278 Q3PtrList<Incidence> incidences;
277 279
278 Incidence *i; 280 Incidence *i;
279 281
280 QPtrList<Event> e = events(); 282 Q3PtrList<Event> e = events();
281 for( i = e.first(); i; i = e.next() ) incidences.append( i ); 283 for( i = e.first(); i; i = e.next() ) incidences.append( i );
282 284
283 QPtrList<Todo> t = todos(); 285 Q3PtrList<Todo> t = todos();
284 for( i = t.first(); i; i = t.next() ) incidences.append( i ); 286 for( i = t.first(); i; i = t.next() ) incidences.append( i );
285 287
286 QPtrList<Journal> j = journals(); 288 Q3PtrList<Journal> j = journals();
287 for( i = j.first(); i; i = j.next() ) incidences.append( i ); 289 for( i = j.first(); i; i = j.next() ) incidences.append( i );
288 290
289 return incidences; 291 return incidences;
290} 292}
291 293
292void Calendar::resetPilotStat(int id ) 294void Calendar::resetPilotStat(int id )
293{ 295{
294 QPtrList<Incidence> incidences; 296 Q3PtrList<Incidence> incidences;
295 297
296 Incidence *i; 298 Incidence *i;
297 299
298 QPtrList<Event> e = rawEvents(); 300 Q3PtrList<Event> e = rawEvents();
299 for( i = e.first(); i; i = e.next() ) i->setPilotId( id ); 301 for( i = e.first(); i; i = e.next() ) i->setPilotId( id );
300 302
301 QPtrList<Todo> t = rawTodos(); 303 Q3PtrList<Todo> t = rawTodos();
302 for( i = t.first(); i; i = t.next() ) i->setPilotId( id ); 304 for( i = t.first(); i; i = t.next() ) i->setPilotId( id );
303 305
304 QPtrList<Journal> j = journals(); 306 Q3PtrList<Journal> j = journals();
305 for( i = j.first(); i; i = j.next() ) i->setPilotId( id ); 307 for( i = j.first(); i; i = j.next() ) i->setPilotId( id );
306} 308}
307void Calendar::resetTempSyncStat() 309void Calendar::resetTempSyncStat()
308{ 310{
309 QPtrList<Incidence> incidences; 311 Q3PtrList<Incidence> incidences;
310 312
311 Incidence *i; 313 Incidence *i;
312 314
313 QPtrList<Event> e = rawEvents(); 315 Q3PtrList<Event> e = rawEvents();
314 for( i = e.first(); i; i = e.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 316 for( i = e.first(); i; i = e.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
315 317
316 QPtrList<Todo> t = rawTodos(); 318 Q3PtrList<Todo> t = rawTodos();
317 for( i = t.first(); i; i = t.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 319 for( i = t.first(); i; i = t.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
318 320
319 QPtrList<Journal> j = journals(); 321 Q3PtrList<Journal> j = journals();
320 for( i = j.first(); i; i = j.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 322 for( i = j.first(); i; i = j.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
321} 323}
322QPtrList<Incidence> Calendar::rawIncidences() 324Q3PtrList<Incidence> Calendar::rawIncidences()
323{ 325{
324 QPtrList<Incidence> incidences; 326 Q3PtrList<Incidence> incidences;
325 327
326 Incidence *i; 328 Incidence *i;
327 329
328 QPtrList<Event> e = rawEvents(); 330 Q3PtrList<Event> e = rawEvents();
329 for( i = e.first(); i; i = e.next() ) incidences.append( i ); 331 for( i = e.first(); i; i = e.next() ) incidences.append( i );
330 332
331 QPtrList<Todo> t = rawTodos(); 333 Q3PtrList<Todo> t = rawTodos();
332 for( i = t.first(); i; i = t.next() ) incidences.append( i ); 334 for( i = t.first(); i; i = t.next() ) incidences.append( i );
333 335
334 QPtrList<Journal> j = journals(); 336 Q3PtrList<Journal> j = journals();
335 for( i = j.first(); i; i = j.next() ) incidences.append( i ); 337 for( i = j.first(); i; i = j.next() ) incidences.append( i );
336 338
337 return incidences; 339 return incidences;
338} 340}
339 341
340QPtrList<Event> Calendar::events( const QDate &date, bool sorted ) 342Q3PtrList<Event> Calendar::events( const QDate &date, bool sorted )
341{ 343{
342 QPtrList<Event> el = rawEventsForDate(date,sorted); 344 Q3PtrList<Event> el = rawEventsForDate(date,sorted);
343 mFilter->apply(&el); 345 mFilter->apply(&el);
344 return el; 346 return el;
345} 347}
346 348
347QPtrList<Event> Calendar::events( const QDateTime &qdt ) 349Q3PtrList<Event> Calendar::events( const QDateTime &qdt )
348{ 350{
349 QPtrList<Event> el = rawEventsForDate(qdt); 351 Q3PtrList<Event> el = rawEventsForDate(qdt);
350 mFilter->apply(&el); 352 mFilter->apply(&el);
351 return el; 353 return el;
352} 354}
353 355
354QPtrList<Event> Calendar::events( const QDate &start, const QDate &end, 356Q3PtrList<Event> Calendar::events( const QDate &start, const QDate &end,
355 bool inclusive) 357 bool inclusive)
356{ 358{
357 QPtrList<Event> el = rawEvents(start,end,inclusive); 359 Q3PtrList<Event> el = rawEvents(start,end,inclusive);
358 mFilter->apply(&el); 360 mFilter->apply(&el);
359 return el; 361 return el;
360} 362}
361 363
362QPtrList<Event> Calendar::events() 364Q3PtrList<Event> Calendar::events()
363{ 365{
364 QPtrList<Event> el = rawEvents(); 366 Q3PtrList<Event> el = rawEvents();
365 mFilter->apply(&el); 367 mFilter->apply(&el);
366 return el; 368 return el;
367} 369}
368void Calendar::addIncidenceBranch(Incidence *i) 370void Calendar::addIncidenceBranch(Incidence *i)
369{ 371{
370 addIncidence( i ); 372 addIncidence( i );
371 Incidence * inc; 373 Incidence * inc;
372 QPtrList<Incidence> Relations = i->relations(); 374 Q3PtrList<Incidence> Relations = i->relations();
373 for (inc=Relations.first();inc;inc=Relations.next()) { 375 for (inc=Relations.first();inc;inc=Relations.next()) {
374 addIncidenceBranch( inc ); 376 addIncidenceBranch( inc );
375 } 377 }
376} 378}
377 379
378bool Calendar::addIncidence(Incidence *i) 380bool Calendar::addIncidence(Incidence *i)
379{ 381{
380 Incidence::AddVisitor<Calendar> v(this); 382 Incidence::AddVisitor<Calendar> v(this);
381 if ( i->calID() == 0 ) 383 if ( i->calID() == 0 )
382 i->setCalID_block( mDefaultCalendar ); 384 i->setCalID_block( mDefaultCalendar );
383 i->setCalEnabled( true ); 385 i->setCalEnabled( true );
384 return i->accept(v); 386 return i->accept(v);
@@ -398,27 +400,27 @@ Incidence* Calendar::incidence( const QString& uid )
398 Incidence* i; 400 Incidence* i;
399 401
400 if( (i = todo( uid )) != 0 ) 402 if( (i = todo( uid )) != 0 )
401 return i; 403 return i;
402 if( (i = event( uid )) != 0 ) 404 if( (i = event( uid )) != 0 )
403 return i; 405 return i;
404 if( (i = journal( uid )) != 0 ) 406 if( (i = journal( uid )) != 0 )
405 return i; 407 return i;
406 408
407 return 0; 409 return 0;
408} 410}
409 411
410QPtrList<Todo> Calendar::todos() 412Q3PtrList<Todo> Calendar::todos()
411{ 413{
412 QPtrList<Todo> tl = rawTodos(); 414 Q3PtrList<Todo> tl = rawTodos();
413 mFilter->apply( &tl ); 415 mFilter->apply( &tl );
414 return tl; 416 return tl;
415} 417}
416 418
417// When this is called, the todo have already been added to the calendar. 419// When this is called, the todo have already been added to the calendar.
418// This method is only about linking related todos 420// This method is only about linking related todos
419void Calendar::setupRelations( Incidence *incidence ) 421void Calendar::setupRelations( Incidence *incidence )
420{ 422{
421 QString uid = incidence->uid(); 423 QString uid = incidence->uid();
422 qDebug("Calendar::setupRelations %s", incidence->summary().latin1()); 424 qDebug("Calendar::setupRelations %s", incidence->summary().latin1());
423 // First, go over the list of orphans and see if this is their parent 425 // First, go over the list of orphans and see if this is their parent
424 while( Incidence* i = mOrphans[ uid ] ) { 426 while( Incidence* i = mOrphans[ uid ] ) {
@@ -446,57 +448,57 @@ void Calendar::setupRelations( Incidence *incidence )
446 mOrphans.insert( incidence->relatedToUid(), incidence ); 448 mOrphans.insert( incidence->relatedToUid(), incidence );
447 mOrphanUids.insert( incidence->uid(), incidence ); 449 mOrphanUids.insert( incidence->uid(), incidence );
448 } 450 }
449 } 451 }
450} 452}
451 453
452// If a task with subtasks is deleted, move it's subtasks to the orphans list 454// If a task with subtasks is deleted, move it's subtasks to the orphans list
453void Calendar::removeRelations( Incidence *incidence ) 455void Calendar::removeRelations( Incidence *incidence )
454{ 456{
455 // qDebug("Calendar::removeRelations "); 457 // qDebug("Calendar::removeRelations ");
456 QString uid = incidence->uid(); 458 QString uid = incidence->uid();
457 459
458 QPtrList<Incidence> relations = incidence->relations(); 460 Q3PtrList<Incidence> relations = incidence->relations();
459 for( Incidence* i = relations.first(); i; i = relations.next() ) 461 for( Incidence* i = relations.first(); i; i = relations.next() )
460 if( !mOrphanUids.find( i->uid() ) ) { 462 if( !mOrphanUids.find( i->uid() ) ) {
461 mOrphans.insert( uid, i ); 463 mOrphans.insert( uid, i );
462 mOrphanUids.insert( i->uid(), i ); 464 mOrphanUids.insert( i->uid(), i );
463 i->setRelatedTo( 0 ); 465 i->setRelatedTo( 0 );
464 i->setRelatedToUid( uid ); 466 i->setRelatedToUid( uid );
465 } 467 }
466 468
467 // If this incidence is related to something else, tell that about it 469 // If this incidence is related to something else, tell that about it
468 if( incidence->relatedTo() ) 470 if( incidence->relatedTo() )
469 incidence->relatedTo()->removeRelation( incidence ); 471 incidence->relatedTo()->removeRelation( incidence );
470 472
471 // Remove this one from the orphans list 473 // Remove this one from the orphans list
472 if( mOrphanUids.remove( uid ) ) { 474 if( mOrphanUids.remove( uid ) ) {
473 QString r2uid = incidence->relatedToUid(); 475 QString r2uid = incidence->relatedToUid();
474 QPtrList<Incidence> tempList; 476 Q3PtrList<Incidence> tempList;
475 while( Incidence* i = mOrphans[ r2uid ] ) { 477 while( Incidence* i = mOrphans[ r2uid ] ) {
476 mOrphans.remove( r2uid ); 478 mOrphans.remove( r2uid );
477 if ( i != incidence ) tempList.append( i ); 479 if ( i != incidence ) tempList.append( i );
478 } 480 }
479 Incidence* inc = tempList.first(); 481 Incidence* inc = tempList.first();
480 while ( inc ) { 482 while ( inc ) {
481 mOrphans.insert( r2uid, inc ); 483 mOrphans.insert( r2uid, inc );
482 inc = tempList.next(); 484 inc = tempList.next();
483 } 485 }
484 } 486 }
485 // LR: and another big bad bug found 487 // LR: and another big bad bug found
486#if 0 488#if 0
487 // This incidence is located in the orphans list - it should be removed 489 // This incidence is located in the orphans list - it should be removed
488 if( !( incidence->relatedTo() != 0 && mOrphans.remove( incidence->relatedTo()->uid() ) ) ) { 490 if( !( incidence->relatedTo() != 0 && mOrphans.remove( incidence->relatedTo()->uid() ) ) ) {
489 // Removing wasn't that easy 491 // Removing wasn't that easy
490 for( QDictIterator<Incidence> it( mOrphans ); it.current(); ++it ) { 492 for( Q3DictIterator<Incidence> it( mOrphans ); it.current(); ++it ) {
491 if( it.current()->uid() == uid ) { 493 if( it.current()->uid() == uid ) {
492 mOrphans.remove( it.currentKey() ); 494 mOrphans.remove( it.currentKey() );
493 break; 495 break;
494 } 496 }
495 } 497 }
496 } 498 }
497#endif 499#endif
498} 500}
499 501
500void Calendar::registerObserver( Observer *observer ) 502void Calendar::registerObserver( Observer *observer )
501{ 503{
502 mObserver = observer; 504 mObserver = observer;
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index fbc40ad..5845f44 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -16,26 +16,26 @@
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#ifndef CALENDAR_H 22#ifndef CALENDAR_H
23#define CALENDAR_H 23#define CALENDAR_H
24 24
25#include <qobject.h> 25#include <qobject.h>
26#include <qstring.h> 26#include <qstring.h>
27#include <qdatetime.h> 27#include <qdatetime.h>
28#include <qptrlist.h> 28#include <q3ptrlist.h>
29#include <qdict.h> 29#include <q3dict.h>
30 30
31#include "customproperties.h" 31#include "customproperties.h"
32#include "event.h" 32#include "event.h"
33#include "todo.h" 33#include "todo.h"
34#include "journal.h" 34#include "journal.h"
35#include "calfilter.h" 35#include "calfilter.h"
36 36
37//#define _TIME_ZONE "-0500" /* hardcoded, overridden in config file. */ 37//#define _TIME_ZONE "-0500" /* hardcoded, overridden in config file. */
38 38
39class KConfig; 39class KConfig;
40 40
41namespace KCal { 41namespace KCal {
@@ -79,25 +79,25 @@ public:
79 virtual bool mergeCalendarFile( QString name ) = 0; 79 virtual bool mergeCalendarFile( QString name ) = 0;
80 virtual Incidence* incidenceForUid( const QString& uid, bool doNotCheckDuplicates , bool enabledOnly = false ,int * isDup = 0 ) = 0; 80 virtual Incidence* incidenceForUid( const QString& uid, bool doNotCheckDuplicates , bool enabledOnly = false ,int * isDup = 0 ) = 0;
81 virtual Todo* todoForUid( const QString& uid, bool doNotCheckDuplicates = true, bool enabledOnly = false ,int * isDup = 0) = 0; 81 virtual Todo* todoForUid( const QString& uid, bool doNotCheckDuplicates = true, bool enabledOnly = false ,int * isDup = 0) = 0;
82 virtual void setSyncEventsReadOnly() = 0; 82 virtual void setSyncEventsReadOnly() = 0;
83 virtual void setSyncEventsEnabled() = 0; 83 virtual void setSyncEventsEnabled() = 0;
84 virtual void stopAllTodos() = 0; 84 virtual void stopAllTodos() = 0;
85 virtual void clearUndo( Incidence * newUndo ); 85 virtual void clearUndo( Incidence * newUndo );
86 86
87 /** 87 /**
88 Sync changes in memory to persistant storage. 88 Sync changes in memory to persistant storage.
89 */ 89 */
90 virtual void save() = 0; 90 virtual void save() = 0;
91 virtual QPtrList<Event> getExternLastSyncEvents() = 0; 91 virtual Q3PtrList<Event> getExternLastSyncEvents() = 0;
92 virtual void removeSyncInfo( QString syncProfile) = 0; 92 virtual void removeSyncInfo( QString syncProfile) = 0;
93 virtual bool isSaving() { return false; } 93 virtual bool isSaving() { return false; }
94 94
95 /** 95 /**
96 Return the owner of the calendar's full name. 96 Return the owner of the calendar's full name.
97 */ 97 */
98 const QString &getOwner() const; 98 const QString &getOwner() const;
99 /** 99 /**
100 Set the owner of the calendar. Should be owner's full name. 100 Set the owner of the calendar. Should be owner's full name.
101 */ 101 */
102 void setOwner( const QString &os ); 102 void setOwner( const QString &os );
103 /** 103 /**
@@ -146,126 +146,126 @@ public:
146 /** 146 /**
147 Add an incidence to calendar. 147 Add an incidence to calendar.
148 148
149 @return true on success, false on error. 149 @return true on success, false on error.
150 */ 150 */
151 virtual bool addIncidence( Incidence * ); 151 virtual bool addIncidence( Incidence * );
152 152
153 // Adds an incidence and all relatedto incidences to the cal 153 // Adds an incidence and all relatedto incidences to the cal
154 void addIncidenceBranch( Incidence * ); 154 void addIncidenceBranch( Incidence * );
155 /** 155 /**
156 Return filtered list of all incidences of this calendar. 156 Return filtered list of all incidences of this calendar.
157 */ 157 */
158 virtual QPtrList<Incidence> incidences(); 158 virtual Q3PtrList<Incidence> incidences();
159 159
160 /** 160 /**
161 Return unfiltered list of all incidences of this calendar. 161 Return unfiltered list of all incidences of this calendar.
162 */ 162 */
163 virtual QPtrList<Incidence> rawIncidences(); 163 virtual Q3PtrList<Incidence> rawIncidences();
164 164
165 /** 165 /**
166 Adds a Event to this calendar object. 166 Adds a Event to this calendar object.
167 @param anEvent a pointer to the event to add 167 @param anEvent a pointer to the event to add
168 168
169 @return true on success, false on error. 169 @return true on success, false on error.
170 */ 170 */
171 virtual bool addEventNoDup( Event *event ) = 0; 171 virtual bool addEventNoDup( Event *event ) = 0;
172 virtual bool addAnniversaryNoDup( Event *event ) = 0; 172 virtual bool addAnniversaryNoDup( Event *event ) = 0;
173 virtual bool addEvent( Event *anEvent ) = 0; 173 virtual bool addEvent( Event *anEvent ) = 0;
174 /** 174 /**
175 Delete event from calendar. 175 Delete event from calendar.
176 */ 176 */
177 virtual void deleteEvent( Event * ) = 0; 177 virtual void deleteEvent( Event * ) = 0;
178 /** 178 /**
179 Retrieves an event on the basis of the unique string ID. 179 Retrieves an event on the basis of the unique string ID.
180 */ 180 */
181 virtual Event *event( const QString &UniqueStr ) = 0; 181 virtual Event *event( const QString &UniqueStr ) = 0;
182 virtual Event *event( QString, QString ) = 0; 182 virtual Event *event( QString, QString ) = 0;
183 /** 183 /**
184 Builds and then returns a list of all events that match for the 184 Builds and then returns a list of all events that match for the
185 date specified. useful for dayView, etc. etc. 185 date specified. useful for dayView, etc. etc.
186 The calendar filter is applied. 186 The calendar filter is applied.
187 */ 187 */
188 QPtrList<Event> events( const QDate &date, bool sorted = false); 188 Q3PtrList<Event> events( const QDate &date, bool sorted = false);
189 /** 189 /**
190 Get events, which occur on the given date. 190 Get events, which occur on the given date.
191 The calendar filter is applied. 191 The calendar filter is applied.
192 */ 192 */
193 QPtrList<Event> events( const QDateTime &qdt ); 193 Q3PtrList<Event> events( const QDateTime &qdt );
194 /** 194 /**
195 Get events in a range of dates. If inclusive is set to true, only events 195 Get events in a range of dates. If inclusive is set to true, only events
196 are returned, which are completely included in the range. 196 are returned, which are completely included in the range.
197 The calendar filter is applied. 197 The calendar filter is applied.
198 */ 198 */
199 QPtrList<Event> events( const QDate &start, const QDate &end, 199 Q3PtrList<Event> events( const QDate &start, const QDate &end,
200 bool inclusive = false); 200 bool inclusive = false);
201 /** 201 /**
202 Return filtered list of all events in calendar. 202 Return filtered list of all events in calendar.
203 */ 203 */
204 virtual QPtrList<Event> events(); 204 virtual Q3PtrList<Event> events();
205 /** 205 /**
206 Return unfiltered list of all events in calendar. 206 Return unfiltered list of all events in calendar.
207 */ 207 */
208 virtual QPtrList<Event> rawEvents() = 0; 208 virtual Q3PtrList<Event> rawEvents() = 0;
209 209
210 /** 210 /**
211 Add a todo to the todolist. 211 Add a todo to the todolist.
212 212
213 @return true on success, false on error. 213 @return true on success, false on error.
214 */ 214 */
215 virtual bool addTodo( Todo *todo ) = 0; 215 virtual bool addTodo( Todo *todo ) = 0;
216 virtual bool addTodoNoDup( Todo *todo ) = 0; 216 virtual bool addTodoNoDup( Todo *todo ) = 0;
217 /** 217 /**
218 Remove a todo from the todolist. 218 Remove a todo from the todolist.
219 */ 219 */
220 virtual void deleteTodo( Todo * ) = 0; 220 virtual void deleteTodo( Todo * ) = 0;
221 virtual void deleteJournal( Journal * ) = 0; 221 virtual void deleteJournal( Journal * ) = 0;
222 /** 222 /**
223 Return filterd list of todos. 223 Return filterd list of todos.
224 */ 224 */
225 virtual QPtrList<Todo> todos(); 225 virtual Q3PtrList<Todo> todos();
226 /** 226 /**
227 Searches todolist for an event with this unique string identifier, 227 Searches todolist for an event with this unique string identifier,
228 returns a pointer or null. 228 returns a pointer or null.
229 */ 229 */
230 virtual Todo *todo( const QString &uid ) = 0; 230 virtual Todo *todo( const QString &uid ) = 0;
231 virtual Todo *todo( QString, QString ) = 0; 231 virtual Todo *todo( QString, QString ) = 0;
232 /** 232 /**
233 Returns list of todos due on the specified date. 233 Returns list of todos due on the specified date.
234 */ 234 */
235 virtual QPtrList<Todo> todos( const QDate &date ) = 0; 235 virtual Q3PtrList<Todo> todos( const QDate &date ) = 0;
236 /** 236 /**
237 Return unfiltered list of todos. 237 Return unfiltered list of todos.
238 */ 238 */
239 virtual QPtrList<Todo> rawTodos() = 0; 239 virtual Q3PtrList<Todo> rawTodos() = 0;
240 240
241 /** 241 /**
242 Add a Journal entry to calendar. 242 Add a Journal entry to calendar.
243 243
244 @return true on success, false on error. 244 @return true on success, false on error.
245 */ 245 */
246 virtual bool addJournal( Journal * ) = 0; 246 virtual bool addJournal( Journal * ) = 0;
247 /** 247 /**
248 Return Journal for given date. 248 Return Journal for given date.
249 */ 249 */
250 virtual Journal *journal( const QDate & ) = 0; 250 virtual Journal *journal( const QDate & ) = 0;
251 virtual QPtrList<Journal> journals4Date( const QDate & ) = 0; 251 virtual Q3PtrList<Journal> journals4Date( const QDate & ) = 0;
252 /** 252 /**
253 Return Journal with given UID. 253 Return Journal with given UID.
254 */ 254 */
255 virtual Journal *journal( const QString &UID ) = 0; 255 virtual Journal *journal( const QString &UID ) = 0;
256 /** 256 /**
257 Return list of all Journal entries. 257 Return list of all Journal entries.
258 */ 258 */
259 virtual QPtrList<Journal> journals() = 0; 259 virtual Q3PtrList<Journal> journals() = 0;
260 260
261 /** 261 /**
262 Searches all incidence types for an incidence with this unique 262 Searches all incidence types for an incidence with this unique
263 string identifier, returns a pointer or null. 263 string identifier, returns a pointer or null.
264 */ 264 */
265 Incidence* incidence( const QString&UID ); 265 Incidence* incidence( const QString&UID );
266 266
267 /** 267 /**
268 Setup relations for an incidence. 268 Setup relations for an incidence.
269 */ 269 */
270 virtual void setupRelations( Incidence * ); 270 virtual void setupRelations( Incidence * );
271 /** 271 /**
@@ -326,35 +326,35 @@ public:
326 326
327 signals: 327 signals:
328 void calendarChanged(); 328 void calendarChanged();
329 void calendarSaved(); 329 void calendarSaved();
330 void calendarLoaded(); 330 void calendarLoaded();
331 void addAlarm(const QDateTime &qdt, const QString &noti ); 331 void addAlarm(const QDateTime &qdt, const QString &noti );
332 void removeAlarm(const QDateTime &qdt, const QString &noti ); 332 void removeAlarm(const QDateTime &qdt, const QString &noti );
333 333
334 protected: 334 protected:
335 /** 335 /**
336 Get unfiltered events, which occur on the given date. 336 Get unfiltered events, which occur on the given date.
337 */ 337 */
338 virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; 338 virtual Q3PtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0;
339 /** 339 /**
340 Get unfiltered events, which occur on the given date. 340 Get unfiltered events, which occur on the given date.
341 */ 341 */
342 virtual QPtrList<Event> rawEventsForDate( const QDate &date, 342 virtual Q3PtrList<Event> rawEventsForDate( const QDate &date,
343 bool sorted = false ) = 0; 343 bool sorted = false ) = 0;
344 /** 344 /**
345 Get events in a range of dates. If inclusive is set to true, only events 345 Get events in a range of dates. If inclusive is set to true, only events
346 are returned, which are completely included in the range. 346 are returned, which are completely included in the range.
347 */ 347 */
348 virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end, 348 virtual Q3PtrList<Event> rawEvents( const QDate &start, const QDate &end,
349 bool inclusive = false ) = 0; 349 bool inclusive = false ) = 0;
350 350
351 Incidence *mNextAlarmIncidence; 351 Incidence *mNextAlarmIncidence;
352 Incidence *mUndoIncidence; 352 Incidence *mUndoIncidence;
353 int mDefaultCalendar; 353 int mDefaultCalendar;
354 bool mDeleteIncidencesOnClose; 354 bool mDeleteIncidencesOnClose;
355 355
356private: 356private:
357 void init(); 357 void init();
358 358
359 QString mOwner; // who the calendar belongs to 359 QString mOwner; // who the calendar belongs to
360 QString mOwnerEmail; // email address of the owner 360 QString mOwnerEmail; // email address of the owner
@@ -367,19 +367,19 @@ private:
367 367
368 368
369 QString mTimeZoneId; 369 QString mTimeZoneId;
370 370
371 Observer *mObserver; 371 Observer *mObserver;
372 bool mNewObserver; 372 bool mNewObserver;
373 373
374 bool mModified; 374 bool mModified;
375 375
376 QString mLoadedProductId; 376 QString mLoadedProductId;
377 377
378 // This list is used to put together related todos 378 // This list is used to put together related todos
379 QDict<Incidence> mOrphans; 379 Q3Dict<Incidence> mOrphans;
380 QDict<Incidence> mOrphanUids; 380 Q3Dict<Incidence> mOrphanUids;
381}; 381};
382 382
383} 383}
384 384
385#endif 385#endif
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index ce3cd09..cb52b7c 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -13,25 +13,25 @@
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details. 15 Library General Public License for more details.
16 16
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22 22
23#include <qdatetime.h> 23#include <qdatetime.h>
24#include <qstring.h> 24#include <qstring.h>
25#include <qptrlist.h> 25#include <q3ptrlist.h>
26 26
27#include <kdebug.h> 27#include <kdebug.h>
28#include <kconfig.h> 28#include <kconfig.h>
29#include <kglobal.h> 29#include <kglobal.h>
30#include <klocale.h> 30#include <klocale.h>
31 31
32#include "vcaldrag.h" 32#include "vcaldrag.h"
33#include "vcalformat.h" 33#include "vcalformat.h"
34#include "icalformat.h" 34#include "icalformat.h"
35#include "exceptions.h" 35#include "exceptions.h"
36#include "incidence.h" 36#include "incidence.h"
37#include "journal.h" 37#include "journal.h"
@@ -183,33 +183,33 @@ Incidence* CalendarLocal::incidenceForUid( const QString& uid , bool doNotCheckD
183 } 183 }
184 } 184 }
185 return retVal; 185 return retVal;
186} 186}
187 187
188bool CalendarLocal::mergeCalendar( Calendar* remote ) 188bool CalendarLocal::mergeCalendar( Calendar* remote )
189{ 189{
190 // 1 look for raw inc in local 190 // 1 look for raw inc in local
191 // if inc not in remote, delete in local 191 // if inc not in remote, delete in local
192 // 2 look for raw inc in remote 192 // 2 look for raw inc in remote
193 // if inc in local, replace it 193 // if inc in local, replace it
194 // if not in local, add it to default calendar 194 // if not in local, add it to default calendar
195 QPtrList<Incidence> localInc = rawIncidences(); 195 Q3PtrList<Incidence> localInc = rawIncidences();
196 Incidence* inL = localInc.first(); 196 Incidence* inL = localInc.first();
197 while ( inL ) { 197 while ( inL ) {
198 if ( ! inL->isReadOnly () ) 198 if ( ! inL->isReadOnly () )
199 if ( !remote->incidenceForUid( inL->uid(), true )) 199 if ( !remote->incidenceForUid( inL->uid(), true ))
200 deleteIncidence( inL ); 200 deleteIncidence( inL );
201 inL = localInc.next(); 201 inL = localInc.next();
202 } 202 }
203 QPtrList<Incidence> er = remote->rawIncidences(); 203 Q3PtrList<Incidence> er = remote->rawIncidences();
204 Incidence* inR = er.first(); 204 Incidence* inR = er.first();
205 while ( inR ) { 205 while ( inR ) {
206 inL = incidenceForUid( inR->uid(),false ); 206 inL = incidenceForUid( inR->uid(),false );
207 if ( inL ) { 207 if ( inL ) {
208 if ( ! inL->isReadOnly () || inL->uid().left(15) == QString("last-syncEvent-") ) { 208 if ( ! inL->isReadOnly () || inL->uid().left(15) == QString("last-syncEvent-") ) {
209 int calID = inL->calID(); 209 int calID = inL->calID();
210 deleteIncidence( inL ); 210 deleteIncidence( inL );
211 inL = inR->clone(); 211 inL = inR->clone();
212 inL->setCalID_block( calID ); 212 inL->setCalID_block( calID );
213 addIncidence( inL ); 213 addIncidence( inL );
214 } 214 }
215 } else { 215 } else {
@@ -250,65 +250,65 @@ void CalendarLocal::setSyncEventsReadOnly()
250 while ( ev ) { 250 while ( ev ) {
251 if ( ev->uid().left(15) == QString("last-syncEvent-") ) { 251 if ( ev->uid().left(15) == QString("last-syncEvent-") ) {
252 ev->setReadOnly( true ); 252 ev->setReadOnly( true );
253 } 253 }
254 ev = mEventList.next(); 254 ev = mEventList.next();
255 } 255 }
256} 256}
257 257
258void CalendarLocal::addCalendar( Calendar* cal ) 258void CalendarLocal::addCalendar( Calendar* cal )
259{ 259{
260 cal->setDontDeleteIncidencesOnClose(); 260 cal->setDontDeleteIncidencesOnClose();
261 setSyncEventsEnabled(); 261 setSyncEventsEnabled();
262 QPtrList<Incidence> incList; 262 Q3PtrList<Incidence> incList;
263 { 263 {
264 QPtrList<Event> EventList = cal->rawEvents(); 264 Q3PtrList<Event> EventList = cal->rawEvents();
265 Event * ev = EventList.first(); 265 Event * ev = EventList.first();
266 while ( ev ) { 266 while ( ev ) {
267 if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) { 267 if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) {
268 ev->setCalID_block( 1 ); 268 ev->setCalID_block( 1 );
269 } 269 }
270 Event * se = event( ev->uid() ); 270 Event * se = event( ev->uid() );
271 if ( se ) 271 if ( se )
272 incList.append( se ); 272 incList.append( se );
273 ev->unRegisterObserver( cal ); 273 ev->unRegisterObserver( cal );
274 ev->registerObserver( this ); 274 ev->registerObserver( this );
275 mEventList.append( ev ); 275 mEventList.append( ev );
276 ev = EventList.next(); 276 ev = EventList.next();
277 } 277 }
278 278
279 } 279 }
280 { 280 {
281 281
282 QPtrList<Todo> TodoList = cal->rawTodos(); 282 Q3PtrList<Todo> TodoList = cal->rawTodos();
283 Todo * ev = TodoList.first(); 283 Todo * ev = TodoList.first();
284 while ( ev ) { 284 while ( ev ) {
285 ev->resetRelatedTo(); 285 ev->resetRelatedTo();
286 Todo * se = todo( ev->uid() ); 286 Todo * se = todo( ev->uid() );
287 if ( se ) 287 if ( se )
288 deleteTodo( se ); 288 deleteTodo( se );
289 ev = TodoList.next(); 289 ev = TodoList.next();
290 } 290 }
291 //TodoList = cal->rawTodos(); 291 //TodoList = cal->rawTodos();
292 ev = TodoList.first(); 292 ev = TodoList.first();
293 while ( ev ) { 293 while ( ev ) {
294 ev->unRegisterObserver( cal ); 294 ev->unRegisterObserver( cal );
295 ev->registerObserver( this ); 295 ev->registerObserver( this );
296 mTodoList.append( ev ); 296 mTodoList.append( ev );
297 setupRelations( ev ); 297 setupRelations( ev );
298 ev = TodoList.next(); 298 ev = TodoList.next();
299 } 299 }
300 } 300 }
301 { 301 {
302 QPtrList<Journal> JournalList = cal->journals(); 302 Q3PtrList<Journal> JournalList = cal->journals();
303 Journal * ev = JournalList.first(); 303 Journal * ev = JournalList.first();
304 while ( ev ) { 304 while ( ev ) {
305 Journal * se = journal( ev->uid() ); 305 Journal * se = journal( ev->uid() );
306 if ( se ) 306 if ( se )
307 incList.append( se ); 307 incList.append( se );
308 ev->unRegisterObserver( cal ); 308 ev->unRegisterObserver( cal );
309 ev->registerObserver( this ); 309 ev->registerObserver( this );
310 mJournalList.append( ev ); 310 mJournalList.append( ev );
311 ev = JournalList.next(); 311 ev = JournalList.next();
312 } 312 }
313 } 313 }
314 { 314 {
@@ -472,66 +472,66 @@ void CalendarLocal::deleteTodo( Todo *todo )
472 // Handle orphaned children 472 // Handle orphaned children
473 removeRelations( todo ); 473 removeRelations( todo );
474 clearUndo(todo); 474 clearUndo(todo);
475 475
476 if ( mTodoList.removeRef( todo ) ) { 476 if ( mTodoList.removeRef( todo ) ) {
477 setModified( true ); 477 setModified( true );
478 } 478 }
479 Todo* dup = todoForUid( uid ); 479 Todo* dup = todoForUid( uid );
480 if ( dup ) 480 if ( dup )
481 setupRelations( dup ); 481 setupRelations( dup );
482} 482}
483 483
484QPtrList<Todo> CalendarLocal::rawTodos() 484Q3PtrList<Todo> CalendarLocal::rawTodos()
485{ 485{
486 QPtrList<Todo> el; 486 Q3PtrList<Todo> el;
487 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) 487 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
488 if ( it->calEnabled() ) el.append( it ); 488 if ( it->calEnabled() ) el.append( it );
489 return el; 489 return el;
490} 490}
491Todo *CalendarLocal::todo( QString syncProf, QString id ) 491Todo *CalendarLocal::todo( QString syncProf, QString id )
492{ 492{
493 Todo *todo; 493 Todo *todo;
494 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { 494 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) {
495 if ( todo->calEnabled() && todo->getID( syncProf ) == id ) return todo; 495 if ( todo->calEnabled() && todo->getID( syncProf ) == id ) return todo;
496 } 496 }
497 497
498 return 0; 498 return 0;
499} 499}
500void CalendarLocal::removeSyncInfo( QString syncProfile) 500void CalendarLocal::removeSyncInfo( QString syncProfile)
501{ 501{
502 QPtrList<Incidence> all = rawIncidences() ; 502 Q3PtrList<Incidence> all = rawIncidences() ;
503 Incidence *inc; 503 Incidence *inc;
504 for ( inc = all.first(); inc; inc = all.next() ) { 504 for ( inc = all.first(); inc; inc = all.next() ) {
505 inc->removeID( syncProfile ); 505 inc->removeID( syncProfile );
506 } 506 }
507 if ( syncProfile.isEmpty() ) { 507 if ( syncProfile.isEmpty() ) {
508 QPtrList<Event> el; 508 Q3PtrList<Event> el;
509 Event *todo; 509 Event *todo;
510 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { 510 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
511 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) 511 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
512 el.append( todo ); 512 el.append( todo );
513 } 513 }
514 for ( todo = el.first(); todo; todo = el.next() ) { 514 for ( todo = el.first(); todo; todo = el.next() ) {
515 deleteIncidence ( todo ); 515 deleteIncidence ( todo );
516 } 516 }
517 } else { 517 } else {
518 Event *lse = event( "last-syncEvent-"+ syncProfile); 518 Event *lse = event( "last-syncEvent-"+ syncProfile);
519 if ( lse ) 519 if ( lse )
520 deleteIncidence ( lse ); 520 deleteIncidence ( lse );
521 } 521 }
522} 522}
523QPtrList<Event> CalendarLocal::getExternLastSyncEvents() 523Q3PtrList<Event> CalendarLocal::getExternLastSyncEvents()
524{ 524{
525 QPtrList<Event> el; 525 Q3PtrList<Event> el;
526 Event *todo; 526 Event *todo;
527 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { 527 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
528 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) 528 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
529 if ( todo->summary().left(3) == "E: " ) 529 if ( todo->summary().left(3) == "E: " )
530 el.append( todo ); 530 el.append( todo );
531 } 531 }
532 532
533 return el; 533 return el;
534 534
535} 535}
536Event *CalendarLocal::event( QString syncProf, QString id ) 536Event *CalendarLocal::event( QString syncProf, QString id )
537{ 537{
@@ -676,27 +676,27 @@ void CalendarLocal::deRegisterAlarm()
676{ 676{
677 if ( mLastAlarmNotificationString.isNull() ) 677 if ( mLastAlarmNotificationString.isNull() )
678 return; 678 return;
679 //qDebug("-- deregister Alarm %s ", mLastAlarmNotificationString.latin1() ); 679 //qDebug("-- deregister Alarm %s ", mLastAlarmNotificationString.latin1() );
680 680
681 emit removeAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString ); 681 emit removeAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString );
682 mNextAlarmEventDateTime = QDateTime(); 682 mNextAlarmEventDateTime = QDateTime();
683// #ifndef DESKTOP_VERSION 683// #ifndef DESKTOP_VERSION
684// AlarmServer::deleteAlarm (mNextAlarmDateTime ,"koalarm" ,mLastAlarmNotificationString.latin1() ); 684// AlarmServer::deleteAlarm (mNextAlarmDateTime ,"koalarm" ,mLastAlarmNotificationString.latin1() );
685// #endif 685// #endif
686} 686}
687 687
688QPtrList<Todo> CalendarLocal::todos( const QDate &date ) 688Q3PtrList<Todo> CalendarLocal::todos( const QDate &date )
689{ 689{
690 QPtrList<Todo> todos; 690 Q3PtrList<Todo> todos;
691 691
692 Todo *todo; 692 Todo *todo;
693 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { 693 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) {
694 if ( !todo->calEnabled() ) continue; 694 if ( !todo->calEnabled() ) continue;
695 if ( todo->hasDueDate() && todo->dtDue().date() == date ) { 695 if ( todo->hasDueDate() && todo->dtDue().date() == date ) {
696 todos.append( todo ); 696 todos.append( todo );
697 } 697 }
698 } 698 }
699 699
700 filter()->apply( &todos ); 700 filter()->apply( &todos );
701 return todos; 701 return todos;
702} 702}
@@ -777,44 +777,44 @@ Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to )
777 Todo *t; 777 Todo *t;
778 for( t = mTodoList.first(); t; t = mTodoList.next() ) { 778 for( t = mTodoList.first(); t; t = mTodoList.next() ) {
779 if ( !t->calEnabled() ) continue; 779 if ( !t->calEnabled() ) continue;
780 appendAlarms( alarms, t, from, to ); 780 appendAlarms( alarms, t, from, to );
781 } 781 }
782 782
783 return alarms; 783 return alarms;
784} 784}
785 785
786void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence, 786void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence,
787 const QDateTime &from, const QDateTime &to ) 787 const QDateTime &from, const QDateTime &to )
788{ 788{
789 QPtrList<Alarm> alarmList = incidence->alarms(); 789 Q3PtrList<Alarm> alarmList = incidence->alarms();
790 Alarm *alarm; 790 Alarm *alarm;
791 for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) { 791 for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) {
792// kdDebug(5800) << "CalendarLocal::appendAlarms() '" << alarm->text() 792// kdDebug(5800) << "CalendarLocal::appendAlarms() '" << alarm->text()
793// << "': " << alarm->time().toString() << " - " << alarm->enabled() << endl; 793// << "': " << alarm->time().toString() << " - " << alarm->enabled() << endl;
794 if ( alarm->enabled() ) { 794 if ( alarm->enabled() ) {
795 if ( alarm->time() >= from && alarm->time() <= to ) { 795 if ( alarm->time() >= from && alarm->time() <= to ) {
796 alarms.append( alarm ); 796 alarms.append( alarm );
797 } 797 }
798 } 798 }
799 } 799 }
800} 800}
801 801
802void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms, 802void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms,
803 Incidence *incidence, 803 Incidence *incidence,
804 const QDateTime &from, 804 const QDateTime &from,
805 const QDateTime &to ) 805 const QDateTime &to )
806{ 806{
807 807
808 QPtrList<Alarm> alarmList = incidence->alarms(); 808 Q3PtrList<Alarm> alarmList = incidence->alarms();
809 Alarm *alarm; 809 Alarm *alarm;
810 QDateTime qdt; 810 QDateTime qdt;
811 for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) { 811 for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) {
812 if (incidence->recursOn(from.date())) { 812 if (incidence->recursOn(from.date())) {
813 qdt.setTime(alarm->time().time()); 813 qdt.setTime(alarm->time().time());
814 qdt.setDate(from.date()); 814 qdt.setDate(from.date());
815 } 815 }
816 else qdt = alarm->time(); 816 else qdt = alarm->time();
817 // qDebug("1 %s %s %s", qdt.toString().latin1(), from.toString().latin1(), to.toString().latin1()); 817 // qDebug("1 %s %s %s", qdt.toString().latin1(), from.toString().latin1(), to.toString().latin1());
818 if ( alarm->enabled() ) { 818 if ( alarm->enabled() ) {
819 if ( qdt >= from && qdt <= to ) { 819 if ( qdt >= from && qdt <= to ) {
820 alarms.append( alarm ); 820 alarms.append( alarm );
@@ -835,27 +835,27 @@ void CalendarLocal::update( IncidenceBase *incidence )
835 // or internally in the Event itself when certain things change. 835 // or internally in the Event itself when certain things change.
836 // need to verify with ical documentation. 836 // need to verify with ical documentation.
837 837
838 setModified( true ); 838 setModified( true );
839} 839}
840 840
841void CalendarLocal::insertEvent( Event *event ) 841void CalendarLocal::insertEvent( Event *event )
842{ 842{
843 if ( mEventList.findRef( event ) < 0 ) mEventList.append( event ); 843 if ( mEventList.findRef( event ) < 0 ) mEventList.append( event );
844} 844}
845 845
846 846
847QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) 847Q3PtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted )
848{ 848{
849 QPtrList<Event> eventList; 849 Q3PtrList<Event> eventList;
850 850
851 Event *event; 851 Event *event;
852 for( event = mEventList.first(); event; event = mEventList.next() ) { 852 for( event = mEventList.first(); event; event = mEventList.next() ) {
853 if ( !event->calEnabled() ) continue; 853 if ( !event->calEnabled() ) continue;
854 if ( event->doesRecur() ) { 854 if ( event->doesRecur() ) {
855 if ( event->isMultiDay() ) { 855 if ( event->isMultiDay() ) {
856 int extraDays = event->dtStart().date().daysTo( event->dtEnd().date() ); 856 int extraDays = event->dtStart().date().daysTo( event->dtEnd().date() );
857 int i; 857 int i;
858 for ( i = 0; i <= extraDays; i++ ) { 858 for ( i = 0; i <= extraDays; i++ ) {
859 if ( event->recursOn( qd.addDays( -i ) ) ) { 859 if ( event->recursOn( qd.addDays( -i ) ) ) {
860 eventList.append( event ); 860 eventList.append( event );
861 break; 861 break;
@@ -869,70 +869,70 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted )
869 if ( event->dtStart().date() <= qd && event->dtEnd().date() >= qd ) { 869 if ( event->dtStart().date() <= qd && event->dtEnd().date() >= qd ) {
870 eventList.append( event ); 870 eventList.append( event );
871 } 871 }
872 } 872 }
873 } 873 }
874 874
875 if ( !sorted ) { 875 if ( !sorted ) {
876 return eventList; 876 return eventList;
877 } 877 }
878 878
879 // kdDebug(5800) << "Sorting events for date\n" << endl; 879 // kdDebug(5800) << "Sorting events for date\n" << endl;
880 // now, we have to sort it based on dtStart.time() 880 // now, we have to sort it based on dtStart.time()
881 QPtrList<Event> eventListSorted; 881 Q3PtrList<Event> eventListSorted;
882 Event *sortEvent; 882 Event *sortEvent;
883 for ( event = eventList.first(); event; event = eventList.next() ) { 883 for ( event = eventList.first(); event; event = eventList.next() ) {
884 sortEvent = eventListSorted.first(); 884 sortEvent = eventListSorted.first();
885 int i = 0; 885 int i = 0;
886 while ( sortEvent && event->dtStart().time()>=sortEvent->dtStart().time() ) 886 while ( sortEvent && event->dtStart().time()>=sortEvent->dtStart().time() )
887 { 887 {
888 i++; 888 i++;
889 sortEvent = eventListSorted.next(); 889 sortEvent = eventListSorted.next();
890 } 890 }
891 eventListSorted.insert( i, event ); 891 eventListSorted.insert( i, event );
892 } 892 }
893 return eventListSorted; 893 return eventListSorted;
894} 894}
895 895
896 896
897QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, 897Q3PtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end,
898 bool inclusive ) 898 bool inclusive )
899{ 899{
900 Event *event = 0; 900 Event *event = 0;
901 901
902 QPtrList<Event> eventList; 902 Q3PtrList<Event> eventList;
903 903
904 // Get non-recurring events 904 // Get non-recurring events
905 for( event = mEventList.first(); event; event = mEventList.next() ) { 905 for( event = mEventList.first(); event; event = mEventList.next() ) {
906 if ( !event->calEnabled() ) continue; 906 if ( !event->calEnabled() ) continue;
907 if ( event->doesRecur() ) { 907 if ( event->doesRecur() ) {
908 QDate rStart = event->dtStart().date(); 908 QDate rStart = event->dtStart().date();
909 bool found = false; 909 bool found = false;
910 if ( inclusive ) { 910 if ( inclusive ) {
911 if ( rStart >= start && rStart <= end ) { 911 if ( rStart >= start && rStart <= end ) {
912 // Start date of event is in range. Now check for end date. 912 // Start date of event is in range. Now check for end date.
913 // if duration is negative, event recurs forever, so do not include it. 913 // if duration is negative, event recurs forever, so do not include it.
914 if ( event->recurrence()->duration() == 0 ) { // End date set 914 if ( event->recurrence()->duration() == 0 ) { // End date set
915 QDate rEnd = event->recurrence()->endDate(); 915 QDate rEnd = event->recurrence()->endDate();
916 if ( rEnd >= start && rEnd <= end ) { // End date within range 916 if ( rEnd >= start && rEnd <= end ) { // End date within range
917 found = true; 917 found = true;
918 } 918 }
919 } else if ( event->recurrence()->duration() > 0 ) { // Duration set 919 } else if ( event->recurrence()->duration() > 0 ) { // Duration set
920 // TODO: Calculate end date from duration. Should be done in Event 920 // TODO: Calculate end date from duration. Should be done in Event
921 // For now exclude all events with a duration. 921 // For now exclude all events with a duration.
922 } 922 }
923 } 923 }
924 } else { 924 } else {
925 bool founOne; 925 bool founOne;
926 QDate next = event->getNextOccurence( start, &founOne ).date(); 926 QDate next = event->getNextOccurence( (QDateTime)start, &founOne ).date();
927 if ( founOne ) { 927 if ( founOne ) {
928 if ( next <= end ) { 928 if ( next <= end ) {
929 found = true; 929 found = true;
930 } 930 }
931 } 931 }
932 932
933 /* 933 /*
934 // crap !!! 934 // crap !!!
935 if ( rStart <= end ) { // Start date not after range 935 if ( rStart <= end ) { // Start date not after range
936 if ( rStart >= start ) { // Start date within range 936 if ( rStart >= start ) { // Start date within range
937 found = true; 937 found = true;
938 } else if ( event->recurrence()->duration() == -1 ) { // Recurs forever 938 } else if ( event->recurrence()->duration() == -1 ) { // Recurs forever
@@ -963,32 +963,32 @@ QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end,
963 } 963 }
964 } else { 964 } else {
965 if ( ( e >= start && s <= end ) ) { 965 if ( ( e >= start && s <= end ) ) {
966 eventList.append( event ); 966 eventList.append( event );
967 } 967 }
968 } 968 }
969 } 969 }
970 } 970 }
971 971
972 return eventList; 972 return eventList;
973} 973}
974 974
975QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) 975Q3PtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt )
976{ 976{
977 return rawEventsForDate( qdt.date() ); 977 return rawEventsForDate( qdt.date() );
978} 978}
979 979
980QPtrList<Event> CalendarLocal::rawEvents() 980Q3PtrList<Event> CalendarLocal::rawEvents()
981{ 981{
982 QPtrList<Event> el; 982 Q3PtrList<Event> el;
983 for ( Event *it = mEventList.first(); it; it = mEventList.next() ) 983 for ( Event *it = mEventList.first(); it; it = mEventList.next() )
984 if ( it->calEnabled() ) el.append( it ); 984 if ( it->calEnabled() ) el.append( it );
985 return el; 985 return el;
986} 986}
987 987
988bool CalendarLocal::addJournal(Journal *journal) 988bool CalendarLocal::addJournal(Journal *journal)
989{ 989{
990 mJournalList.append(journal); 990 mJournalList.append(journal);
991 991
992 journal->registerObserver( this ); 992 journal->registerObserver( this );
993 993
994 setModified( true ); 994 setModified( true );
@@ -997,27 +997,27 @@ bool CalendarLocal::addJournal(Journal *journal)
997 journal->setCalEnabled( true ); 997 journal->setCalEnabled( true );
998 return true; 998 return true;
999} 999}
1000 1000
1001void CalendarLocal::deleteJournal( Journal *journal ) 1001void CalendarLocal::deleteJournal( Journal *journal )
1002{ 1002{
1003 clearUndo(journal); 1003 clearUndo(journal);
1004 if ( mJournalList.removeRef(journal) ) { 1004 if ( mJournalList.removeRef(journal) ) {
1005 setModified( true ); 1005 setModified( true );
1006 } 1006 }
1007} 1007}
1008 1008
1009QPtrList<Journal> CalendarLocal::journals4Date( const QDate & date ) 1009Q3PtrList<Journal> CalendarLocal::journals4Date( const QDate & date )
1010{ 1010{
1011 QPtrList<Journal> el; 1011 Q3PtrList<Journal> el;
1012 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 1012 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1013 if ( it->calEnabled() && it->dtStart().date() == date) el.append( it ); 1013 if ( it->calEnabled() && it->dtStart().date() == date) el.append( it );
1014 return el; 1014 return el;
1015} 1015}
1016Journal *CalendarLocal::journal( const QDate &date ) 1016Journal *CalendarLocal::journal( const QDate &date )
1017{ 1017{
1018// kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; 1018// kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl;
1019 1019
1020 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 1020 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1021 if ( it->calEnabled() && it->dtStart().date() == date ) 1021 if ( it->calEnabled() && it->dtStart().date() == date )
1022 return it; 1022 return it;
1023 1023
@@ -1031,55 +1031,55 @@ Journal *CalendarLocal::journal( const QString &uid )
1031 if ( it->calEnabled() && it->uid() == uid ) { 1031 if ( it->calEnabled() && it->uid() == uid ) {
1032 if ( retVal ) { 1032 if ( retVal ) {
1033 if ( retVal->calID() > it->calID() ) { 1033 if ( retVal->calID() > it->calID() ) {
1034 retVal = it; 1034 retVal = it;
1035 } 1035 }
1036 } else { 1036 } else {
1037 retVal = it; 1037 retVal = it;
1038 } 1038 }
1039 } 1039 }
1040 return retVal; 1040 return retVal;
1041} 1041}
1042 1042
1043QPtrList<Journal> CalendarLocal::journals() 1043Q3PtrList<Journal> CalendarLocal::journals()
1044{ 1044{
1045 QPtrList<Journal> el; 1045 Q3PtrList<Journal> el;
1046 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 1046 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1047 if ( it->calEnabled() ) el.append( it ); 1047 if ( it->calEnabled() ) el.append( it );
1048 return el; 1048 return el;
1049} 1049}
1050void CalendarLocal::setCalendarRemove( int id ) 1050void CalendarLocal::setCalendarRemove( int id )
1051{ 1051{
1052 1052
1053 { 1053 {
1054 QPtrList<Event> EventList = mEventList; 1054 Q3PtrList<Event> EventList = mEventList;
1055 Event * ev = EventList.first(); 1055 Event * ev = EventList.first();
1056 while ( ev ) { 1056 while ( ev ) {
1057 if ( ev->calID() == id && ev->uid().left( 15 ) != QString("last-syncEvent-") ) 1057 if ( ev->calID() == id && ev->uid().left( 15 ) != QString("last-syncEvent-") )
1058 deleteEvent( ev ); 1058 deleteEvent( ev );
1059 ev = EventList.next(); 1059 ev = EventList.next();
1060 } 1060 }
1061 } 1061 }
1062 { 1062 {
1063 1063
1064 QPtrList<Todo> TodoList = mTodoList; 1064 Q3PtrList<Todo> TodoList = mTodoList;
1065 Todo * ev = TodoList.first(); 1065 Todo * ev = TodoList.first();
1066 while ( ev ) { 1066 while ( ev ) {
1067 if ( ev->calID() == id ) 1067 if ( ev->calID() == id )
1068 deleteTodo( ev ); 1068 deleteTodo( ev );
1069 ev = TodoList.next(); 1069 ev = TodoList.next();
1070 } 1070 }
1071 } 1071 }
1072 { 1072 {
1073 QPtrList<Journal> JournalList = mJournalList; 1073 Q3PtrList<Journal> JournalList = mJournalList;
1074 Journal * ev = JournalList.first(); 1074 Journal * ev = JournalList.first();
1075 while ( ev ) { 1075 while ( ev ) {
1076 if ( ev->calID() == id ) 1076 if ( ev->calID() == id )
1077 deleteJournal( ev ); 1077 deleteJournal( ev );
1078 ev = JournalList.next(); 1078 ev = JournalList.next();
1079 } 1079 }
1080 } 1080 }
1081 1081
1082 clearUndo(0); 1082 clearUndo(0);
1083 1083
1084} 1084}
1085 1085
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index 1ceabce..1df65c7 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -14,24 +14,26 @@
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details. 15 Library General Public License for more details.
16 16
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22#ifndef KCAL_CALENDARLOCAL_H 22#ifndef KCAL_CALENDARLOCAL_H
23#define KCAL_CALENDARLOCAL_H 23#define KCAL_CALENDARLOCAL_H
24 24
25#include "calendar.h" 25#include "calendar.h"
26//Added by qt3to4:
27#include <Q3PtrList>
26 28
27namespace KCal { 29namespace KCal {
28 30
29class CalFormat; 31class CalFormat;
30 32
31/** 33/**
32 This class provides a calendar stored as a local file. 34 This class provides a calendar stored as a local file.
33*/ 35*/
34class CalendarLocal : public Calendar 36class CalendarLocal : public Calendar
35{ 37{
36 public: 38 public:
37 /** 39 /**
@@ -84,76 +86,76 @@ class CalendarLocal : public Calendar
84 /** 86 /**
85 Deletes an event from this calendar. 87 Deletes an event from this calendar.
86 */ 88 */
87 void deleteEvent( Event *event ); 89 void deleteEvent( Event *event );
88 90
89 /** 91 /**
90 Retrieves an event on the basis of the unique string ID. 92 Retrieves an event on the basis of the unique string ID.
91 */ 93 */
92 Event *event( const QString &uid ); 94 Event *event( const QString &uid );
93 /** 95 /**
94 Return unfiltered list of all events in calendar. 96 Return unfiltered list of all events in calendar.
95 */ 97 */
96 QPtrList<Event> rawEvents(); 98 Q3PtrList<Event> rawEvents();
97 QPtrList<Event> getExternLastSyncEvents(); 99 Q3PtrList<Event> getExternLastSyncEvents();
98 /** 100 /**
99 Add a todo to the todolist. 101 Add a todo to the todolist.
100 */ 102 */
101 bool addTodo( Todo *todo ); 103 bool addTodo( Todo *todo );
102 bool addTodoNoDup( Todo *todo ); 104 bool addTodoNoDup( Todo *todo );
103 /** 105 /**
104 Remove a todo from the todolist. 106 Remove a todo from the todolist.
105 */ 107 */
106 void deleteTodo( Todo * ); 108 void deleteTodo( Todo * );
107 /** 109 /**
108 Searches todolist for an event with this unique string identifier, 110 Searches todolist for an event with this unique string identifier,
109 returns a pointer or null. 111 returns a pointer or null.
110 */ 112 */
111 Todo *todo( const QString &uid ); 113 Todo *todo( const QString &uid );
112 /** 114 /**
113 Return list of all todos. 115 Return list of all todos.
114 */ 116 */
115 QPtrList<Todo> rawTodos(); 117 Q3PtrList<Todo> rawTodos();
116 /** 118 /**
117 Returns list of todos due on the specified date. 119 Returns list of todos due on the specified date.
118 */ 120 */
119 QPtrList<Todo> todos( const QDate &date ); 121 Q3PtrList<Todo> todos( const QDate &date );
120 /** 122 /**
121 Return list of all todos. 123 Return list of all todos.
122 124
123 Workaround because compiler does not recognize function of base class. 125 Workaround because compiler does not recognize function of base class.
124 */ 126 */
125 QPtrList<Todo> todos() { return Calendar::todos(); } 127 Q3PtrList<Todo> todos() { return Calendar::todos(); }
126 128
127 /** 129 /**
128 Add a Journal entry to calendar. 130 Add a Journal entry to calendar.
129 */ 131 */
130 bool addJournal( Journal * ); 132 bool addJournal( Journal * );
131 /** 133 /**
132 Remove a Journal from the calendar. 134 Remove a Journal from the calendar.
133 */ 135 */
134 void deleteJournal( Journal * ); 136 void deleteJournal( Journal * );
135 /** 137 /**
136 Return Journal for given date. 138 Return Journal for given date.
137 */ 139 */
138 Journal *journal( const QDate & ); 140 Journal *journal( const QDate & );
139 QPtrList<Journal> journals4Date( const QDate & ); 141 Q3PtrList<Journal> journals4Date( const QDate & );
140 /** 142 /**
141 Return Journal with given UID. 143 Return Journal with given UID.
142 */ 144 */
143 Journal *journal( const QString &uid ); 145 Journal *journal( const QString &uid );
144 /** 146 /**
145 Return list of all Journals stored in calendar. 147 Return list of all Journals stored in calendar.
146 */ 148 */
147 QPtrList<Journal> journals(); 149 Q3PtrList<Journal> journals();
148 150
149 /** 151 /**
150 Return all alarms, which ocur in the given time interval. 152 Return all alarms, which ocur in the given time interval.
151 */ 153 */
152 Alarm::List alarms( const QDateTime &from, const QDateTime &to ); 154 Alarm::List alarms( const QDateTime &from, const QDateTime &to );
153 155
154 /** 156 /**
155 Return all alarms, which ocur before given date. 157 Return all alarms, which ocur before given date.
156 */ 158 */
157 Alarm::List alarmsTo( const QDateTime &to ); 159 Alarm::List alarmsTo( const QDateTime &to );
158 160
159 QDateTime nextAlarm( int daysTo ) ; 161 QDateTime nextAlarm( int daysTo ) ;
@@ -165,34 +167,34 @@ class CalendarLocal : public Calendar
165 QString nextSummary() const ; 167 QString nextSummary() const ;
166 /** 168 /**
167 This method should be called whenever a Event is modified directly 169 This method should be called whenever a Event is modified directly
168 via it's pointer. It makes sure that the calendar is internally 170 via it's pointer. It makes sure that the calendar is internally
169 consistent. 171 consistent.
170 */ 172 */
171 void update( IncidenceBase *incidence ); 173 void update( IncidenceBase *incidence );
172 174
173 /** 175 /**
174 Builds and then returns a list of all events that match for the 176 Builds and then returns a list of all events that match for the
175 date specified. useful for dayView, etc. etc. 177 date specified. useful for dayView, etc. etc.
176 */ 178 */
177 QPtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false ); 179 Q3PtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false );
178 /** 180 /**
179 Get unfiltered events for date \a qdt. 181 Get unfiltered events for date \a qdt.
180 */ 182 */
181 QPtrList<Event> rawEventsForDate( const QDateTime &qdt ); 183 Q3PtrList<Event> rawEventsForDate( const QDateTime &qdt );
182 /** 184 /**
183 Get unfiltered events in a range of dates. If inclusive is set to true, 185 Get unfiltered events in a range of dates. If inclusive is set to true,
184 only events are returned, which are completely included in the range. 186 only events are returned, which are completely included in the range.
185 */ 187 */
186 QPtrList<Event> rawEvents( const QDate &start, const QDate &end, 188 Q3PtrList<Event> rawEvents( const QDate &start, const QDate &end,
187 bool inclusive = false ); 189 bool inclusive = false );
188 Todo *todo( QString, QString ); 190 Todo *todo( QString, QString );
189 Event *event( QString, QString ); 191 Event *event( QString, QString );
190 void getIncidenceCount( int calId, int& events, int & todos, int & journals); 192 void getIncidenceCount( int calId, int& events, int & todos, int & journals);
191 193
192public slots: 194public slots:
193 void setCalendarEnabled( int id, bool enable ); 195 void setCalendarEnabled( int id, bool enable );
194 void setAlarmEnabled( int id, bool enable ); 196 void setAlarmEnabled( int id, bool enable );
195 void setReadOnly( int id, bool enable ); 197 void setReadOnly( int id, bool enable );
196 void setDefaultCalendarEnabledOnly(); 198 void setDefaultCalendarEnabledOnly();
197 void setCalendarRemove( int id ); 199 void setCalendarRemove( int id );
198 void setAllCalendarEnabled( bool enable ); 200 void setAllCalendarEnabled( bool enable );
@@ -215,20 +217,20 @@ public slots:
215 217
216 /** Append alarms of incidence in interval to list of alarms. */ 218 /** Append alarms of incidence in interval to list of alarms. */
217 void appendAlarms( Alarm::List &alarms, Incidence *incidence, 219 void appendAlarms( Alarm::List &alarms, Incidence *incidence,
218 const QDateTime &from, const QDateTime &to ); 220 const QDateTime &from, const QDateTime &to );
219 221
220 /** Append alarms of recurring events in interval to list of alarms. */ 222 /** Append alarms of recurring events in interval to list of alarms. */
221 void appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence, 223 void appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence,
222 const QDateTime &from, const QDateTime &to ); 224 const QDateTime &from, const QDateTime &to );
223 225
224 private: 226 private:
225 void init(); 227 void init();
226 228
227 QPtrList<Event> mEventList; 229 Q3PtrList<Event> mEventList;
228 QPtrList<Todo> mTodoList; 230 Q3PtrList<Todo> mTodoList;
229 QPtrList<Journal> mJournalList; 231 Q3PtrList<Journal> mJournalList;
230}; 232};
231 233
232} 234}
233 235
234#endif 236#endif
diff --git a/libkcal/calfilter.cpp b/libkcal/calfilter.cpp
index 72f70c2..fa1dbd5 100644
--- a/libkcal/calfilter.cpp
+++ b/libkcal/calfilter.cpp
@@ -12,65 +12,67 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <kdebug.h> 21#include <kdebug.h>
22 22
23#include "calfilter.h" 23#include "calfilter.h"
24//Added by qt3to4:
25#include <Q3PtrList>
24 26
25using namespace KCal; 27using namespace KCal;
26 28
27CalFilter::CalFilter() 29CalFilter::CalFilter()
28{ 30{
29 mEnabled = true; 31 mEnabled = true;
30 mCriteria = ShowPublic | ShowPrivate| ShowConfidential ; 32 mCriteria = ShowPublic | ShowPrivate| ShowConfidential ;
31} 33}
32 34
33CalFilter::CalFilter(const QString &name) 35CalFilter::CalFilter(const QString &name)
34{ 36{
35 mName = name; 37 mName = name;
36 mEnabled = true; 38 mEnabled = true;
37 mCriteria = ShowPublic | ShowPrivate| ShowConfidential ; 39 mCriteria = ShowPublic | ShowPrivate| ShowConfidential ;
38} 40}
39 41
40CalFilter::~CalFilter() 42CalFilter::~CalFilter()
41{ 43{
42} 44}
43 45
44void CalFilter::apply(QPtrList<Event> *eventlist) 46void CalFilter::apply(Q3PtrList<Event> *eventlist)
45{ 47{
46 if (!mEnabled) return; 48 if (!mEnabled) return;
47 49
48// kdDebug(5800) << "CalFilter::apply()" << endl; 50// kdDebug(5800) << "CalFilter::apply()" << endl;
49 51
50 Event *event = eventlist->first(); 52 Event *event = eventlist->first();
51 while(event) { 53 while(event) {
52 if (!filterEvent(event)) { 54 if (!filterEvent(event)) {
53 eventlist->remove(); 55 eventlist->remove();
54 event = eventlist->current(); 56 event = eventlist->current();
55 } else { 57 } else {
56 event = eventlist->next(); 58 event = eventlist->next();
57 } 59 }
58 } 60 }
59 61
60// kdDebug(5800) << "CalFilter::apply() done" << endl; 62// kdDebug(5800) << "CalFilter::apply() done" << endl;
61} 63}
62 64
63// TODO: avoid duplicating apply() code 65// TODO: avoid duplicating apply() code
64void CalFilter::apply(QPtrList<Todo> *eventlist) 66void CalFilter::apply(Q3PtrList<Todo> *eventlist)
65{ 67{
66 if (!mEnabled) return; 68 if (!mEnabled) return;
67 Todo *event = eventlist->first(); 69 Todo *event = eventlist->first();
68 while(event) { 70 while(event) {
69 if (!filterTodo(event)) { 71 if (!filterTodo(event)) {
70 eventlist->remove(); 72 eventlist->remove();
71 event = eventlist->current(); 73 event = eventlist->current();
72 } else { 74 } else {
73 event = eventlist->next(); 75 event = eventlist->next();
74 } 76 }
75 } 77 }
76 78
diff --git a/libkcal/calfilter.h b/libkcal/calfilter.h
index e349770..821149f 100644
--- a/libkcal/calfilter.h
+++ b/libkcal/calfilter.h
@@ -13,25 +13,25 @@
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#ifndef _CALFILTER_H 21#ifndef _CALFILTER_H
22#define _CALFILTER_H 22#define _CALFILTER_H
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qptrlist.h> 25#include <q3ptrlist.h>
26 26
27#include "event.h" 27#include "event.h"
28#include "todo.h" 28#include "todo.h"
29#include "journal.h" 29#include "journal.h"
30 30
31namespace KCal { 31namespace KCal {
32 32
33/** 33/**
34 Filter for calendar objects. 34 Filter for calendar objects.
35*/ 35*/
36class CalFilter { 36class CalFilter {
37 public: 37 public:
@@ -46,33 +46,33 @@ class CalFilter {
46 Set name of filter. 46 Set name of filter.
47 */ 47 */
48 void setName(const QString &name) { mName = name; } 48 void setName(const QString &name) { mName = name; }
49 /** 49 /**
50 Return name of filter. 50 Return name of filter.
51 */ 51 */
52 QString name() const { return mName; } 52 QString name() const { return mName; }
53 53
54 /** 54 /**
55 Apply filter to eventlist, all events not matching filter criterias are 55 Apply filter to eventlist, all events not matching filter criterias are
56 removed from the list. 56 removed from the list.
57 */ 57 */
58 void apply(QPtrList<Event> *eventlist); 58 void apply(Q3PtrList<Event> *eventlist);
59 59
60 /** 60 /**
61 Apply filter to todolist, all todos not matching filter criterias are 61 Apply filter to todolist, all todos not matching filter criterias are
62 removed from the list. 62 removed from the list.
63 */ 63 */
64 void apply(QPtrList<Todo> *todolist); 64 void apply(Q3PtrList<Todo> *todolist);
65 bool CalFilter::filterCalendarItem(Incidence *in); 65 bool filterCalendarItem(Incidence *in);
66 bool CalFilter::filterJournal(Journal *in); 66 bool filterJournal(Journal *in);
67 /** 67 /**
68 Apply filter criteria on the specified event. Return true, if event passes 68 Apply filter criteria on the specified event. Return true, if event passes
69 criteria, otherwise return false. 69 criteria, otherwise return false.
70 */ 70 */
71 bool filterEvent(Event *); 71 bool filterEvent(Event *);
72 72
73 /** 73 /**
74 Apply filter criteria on the specified todo. Return true, if event passes 74 Apply filter criteria on the specified todo. Return true, if event passes
75 criteria, otherwise return false. 75 criteria, otherwise return false.
76 */ 76 */
77 bool filterTodo(Todo *); 77 bool filterTodo(Todo *);
78 78
diff --git a/libkcal/customproperties.cpp b/libkcal/customproperties.cpp
index adc1710..16f4a28 100644
--- a/libkcal/customproperties.cpp
+++ b/libkcal/customproperties.cpp
@@ -10,99 +10,101 @@
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include "customproperties.h" 21#include "customproperties.h"
22//Added by qt3to4:
23#include <Q3CString>
22 24
23using namespace KCal; 25using namespace KCal;
24 26
25CustomProperties::CustomProperties() 27CustomProperties::CustomProperties()
26{ 28{
27} 29}
28 30
29CustomProperties::CustomProperties(const CustomProperties &cp) 31CustomProperties::CustomProperties(const CustomProperties &cp)
30 : mProperties(cp.mProperties) 32 : mProperties(cp.mProperties)
31{ 33{
32} 34}
33 35
34CustomProperties::~CustomProperties() 36CustomProperties::~CustomProperties()
35{ 37{
36} 38}
37 39
38void CustomProperties::setCustomProperty(const QCString &app, const QCString &key, 40void CustomProperties::setCustomProperty(const Q3CString &app, const Q3CString &key,
39 const QString &value) 41 const QString &value)
40{ 42{
41 if (value.isNull() || key.isEmpty() || app.isEmpty()) 43 if (value.isNull() || key.isEmpty() || app.isEmpty())
42 return; 44 return;
43 QCString property = "X-KDE-" + app + "-" + key; 45 Q3CString property = "X-KDE-" + app + "-" + key;
44 if (!checkName(property)) 46 if (!checkName(property))
45 return; 47 return;
46 mProperties[property] = value; 48 mProperties[property] = value;
47} 49}
48 50
49void CustomProperties::removeCustomProperty(const QCString &app, const QCString &key) 51void CustomProperties::removeCustomProperty(const Q3CString &app, const Q3CString &key)
50{ 52{
51 removeNonKDECustomProperty(QCString("X-KDE-" + app + "-" + key)); 53 removeNonKDECustomProperty(Q3CString("X-KDE-" + app + "-" + key));
52} 54}
53 55
54QString CustomProperties::customProperty(const QCString &app, const QCString &key) const 56QString CustomProperties::customProperty(const Q3CString &app, const Q3CString &key) const
55{ 57{
56 return nonKDECustomProperty(QCString("X-KDE-" + app + "-" + key)); 58 return nonKDECustomProperty(Q3CString("X-KDE-" + app + "-" + key));
57} 59}
58 60
59void CustomProperties::setNonKDECustomProperty(const QCString &name, const QString &value) 61void CustomProperties::setNonKDECustomProperty(const Q3CString &name, const QString &value)
60{ 62{
61 if (value.isNull() || !checkName(name)) 63 if (value.isNull() || !checkName(name))
62 return; 64 return;
63 mProperties[name] = value; 65 mProperties[name] = value;
64} 66}
65 67
66void CustomProperties::removeNonKDECustomProperty(const QCString &name) 68void CustomProperties::removeNonKDECustomProperty(const Q3CString &name)
67{ 69{
68 QMap<QCString, QString>::Iterator it = mProperties.find(name); 70 QMap<Q3CString, QString>::Iterator it = mProperties.find(name);
69 if (it != mProperties.end()) 71 if (it != mProperties.end())
70 mProperties.remove(it); 72 mProperties.remove(it);
71} 73}
72 74
73QString CustomProperties::nonKDECustomProperty(const QCString &name) const 75QString CustomProperties::nonKDECustomProperty(const Q3CString &name) const
74{ 76{
75 QMap<QCString, QString>::ConstIterator it = mProperties.find(name); 77 QMap<Q3CString, QString>::ConstIterator it = mProperties.find(name);
76 if (it == mProperties.end()) 78 if (it == mProperties.end())
77 return QString::null; 79 return QString::null;
78 return it.data(); 80 return it.data();
79} 81}
80 82
81void CustomProperties::setCustomProperties(const QMap<QCString, QString> &properties) 83void CustomProperties::setCustomProperties(const QMap<Q3CString, QString> &properties)
82{ 84{
83 for (QMap<QCString, QString>::ConstIterator it = properties.begin(); it != properties.end(); ++it) { 85 for (QMap<Q3CString, QString>::ConstIterator it = properties.begin(); it != properties.end(); ++it) {
84 // Validate the property name and convert any null string to empty string 86 // Validate the property name and convert any null string to empty string
85 if (checkName(it.key())) { 87 if (checkName(it.key())) {
86 mProperties[it.key()] = it.data().isNull() ? QString("") : it.data(); 88 mProperties[it.key()] = it.data().isNull() ? QString("") : it.data();
87 } 89 }
88 } 90 }
89} 91}
90 92
91QMap<QCString, QString> CustomProperties::customProperties() const 93QMap<Q3CString, QString> CustomProperties::customProperties() const
92{ 94{
93 return mProperties; 95 return mProperties;
94} 96}
95 97
96bool CustomProperties::checkName(const QCString &name) 98bool CustomProperties::checkName(const Q3CString &name)
97{ 99{
98 // Check that the property name starts with 'X-' and contains 100 // Check that the property name starts with 'X-' and contains
99 // only the permitted characters 101 // only the permitted characters
100 const char* n = name; 102 const char* n = name;
101 int len = name.length(); 103 int len = name.length();
102 if (len < 2 || n[0] != 'X' || n[1] != '-') 104 if (len < 2 || n[0] != 'X' || n[1] != '-')
103 return false; 105 return false;
104 for (int i = 2; i < len; ++i) { 106 for (int i = 2; i < len; ++i) {
105 char ch = n[i]; 107 char ch = n[i];
106 if (ch >= 'A' && ch <= 'Z' 108 if (ch >= 'A' && ch <= 'Z'
107 || ch >= 'a' && ch <= 'z' 109 || ch >= 'a' && ch <= 'z'
108 || ch >= '0' && ch <= '9' 110 || ch >= '0' && ch <= '9'
diff --git a/libkcal/customproperties.h b/libkcal/customproperties.h
index 0cbfdcd..75eb3ad 100644
--- a/libkcal/customproperties.h
+++ b/libkcal/customproperties.h
@@ -14,24 +14,26 @@
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#ifndef KCAL_CUSTOM_PROPERTIES_H 21#ifndef KCAL_CUSTOM_PROPERTIES_H
22#define KCAL_CUSTOM_PROPERTIES_H 22#define KCAL_CUSTOM_PROPERTIES_H
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qmap.h> 25#include <qmap.h>
26//Added by qt3to4:
27#include <Q3CString>
26 28
27namespace KCal { 29namespace KCal {
28 30
29/** 31/**
30 This class represents custom calendar properties. 32 This class represents custom calendar properties.
31 It is used as a base class for classes which represent calendar components. 33 It is used as a base class for classes which represent calendar components.
32 A custom property name written by libkcal has the form X-KDE-APP-KEY where 34 A custom property name written by libkcal has the form X-KDE-APP-KEY where
33 APP represents the application name, and KEY distinguishes individual 35 APP represents the application name, and KEY distinguishes individual
34 properties for the application. 36 properties for the application.
35 In keeping with RFC2445, property names must be composed only of the 37 In keeping with RFC2445, property names must be composed only of the
36 characters A-Z, a-z, 0-9 and '-'. 38 characters A-Z, a-z, 0-9 and '-'.
37*/ 39*/
@@ -40,58 +42,58 @@ class CustomProperties
40 public: 42 public:
41 /** Construct a new empty custom properties instance */ 43 /** Construct a new empty custom properties instance */
42 CustomProperties(); 44 CustomProperties();
43 CustomProperties(const CustomProperties &); 45 CustomProperties(const CustomProperties &);
44 ~CustomProperties(); 46 ~CustomProperties();
45 47
46 /** Create or modify a custom calendar property. 48 /** Create or modify a custom calendar property.
47 @param app Application name as it appears in the custom property name. 49 @param app Application name as it appears in the custom property name.
48 @param key Property identifier specific to the application. 50 @param key Property identifier specific to the application.
49 @param value The property's value. A call with a value of QString::null 51 @param value The property's value. A call with a value of QString::null
50 will be ignored. 52 will be ignored.
51 */ 53 */
52 void setCustomProperty(const QCString &app, const QCString &key, 54 void setCustomProperty(const Q3CString &app, const Q3CString &key,
53 const QString &value); 55 const QString &value);
54 /** Delete a custom calendar property. 56 /** Delete a custom calendar property.
55 @param app Application name as it appears in the custom property name. 57 @param app Application name as it appears in the custom property name.
56 @param key Property identifier specific to the application. 58 @param key Property identifier specific to the application.
57 */ 59 */
58 void removeCustomProperty(const QCString &app, const QCString &key); 60 void removeCustomProperty(const Q3CString &app, const Q3CString &key);
59 /** Return the value of a custom calendar property. 61 /** Return the value of a custom calendar property.
60 @param app Application name as it appears in the custom property name. 62 @param app Application name as it appears in the custom property name.
61 @param key Property identifier specific to the application. 63 @param key Property identifier specific to the application.
62 @return Property value, or QString::null if (and only if) the property does not exist. 64 @return Property value, or QString::null if (and only if) the property does not exist.
63 */ 65 */
64 QString customProperty(const QCString &app, const QCString &key) const; 66 QString customProperty(const Q3CString &app, const Q3CString &key) const;
65 67
66 /** Create or modify a non-KDE or non-standard custom calendar property. 68 /** Create or modify a non-KDE or non-standard custom calendar property.
67 @param name Full property name 69 @param name Full property name
68 @param value The property's value. A call with a value of QString::null 70 @param value The property's value. A call with a value of QString::null
69 will be ignored. 71 will be ignored.
70 */ 72 */
71 void setNonKDECustomProperty(const QCString &name, const QString &value); 73 void setNonKDECustomProperty(const Q3CString &name, const QString &value);
72 /** Delete a non-KDE or non-standard custom calendar property. 74 /** Delete a non-KDE or non-standard custom calendar property.
73 @param name Full property name 75 @param name Full property name
74 */ 76 */
75 void removeNonKDECustomProperty(const QCString &name); 77 void removeNonKDECustomProperty(const Q3CString &name);
76 /** Return the value of a non-KDE or non-standard custom calendar property. 78 /** Return the value of a non-KDE or non-standard custom calendar property.
77 @param name Full property name 79 @param name Full property name
78 @return Property value, or QString::null if (and only if) the property does not exist. 80 @return Property value, or QString::null if (and only if) the property does not exist.
79 */ 81 */
80 QString nonKDECustomProperty(const QCString& name) const; 82 QString nonKDECustomProperty(const Q3CString& name) const;
81 83
82 /** Initialise the alarm's custom calendar properties to the specified 84 /** Initialise the alarm's custom calendar properties to the specified
83 key/value pairs. 85 key/value pairs.
84 */ 86 */
85 void setCustomProperties(const QMap<QCString, QString> &properties); 87 void setCustomProperties(const QMap<Q3CString, QString> &properties);
86 /** Return all custom calendar property key/value pairs. */ 88 /** Return all custom calendar property key/value pairs. */
87 QMap<QCString, QString> customProperties() const; 89 QMap<Q3CString, QString> customProperties() const;
88 90
89 private: 91 private:
90 static bool checkName(const QCString& name); 92 static bool checkName(const Q3CString& name);
91 93
92 QMap<QCString, QString> mProperties; // custom calendar properties 94 QMap<Q3CString, QString> mProperties; // custom calendar properties
93}; 95};
94 96
95} 97}
96 98
97#endif 99#endif
diff --git a/libkcal/dndfactory.cpp b/libkcal/dndfactory.cpp
index cdcfae4..ca7e212 100644
--- a/libkcal/dndfactory.cpp
+++ b/libkcal/dndfactory.cpp
@@ -13,24 +13,27 @@
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details. 15 Library General Public License for more details.
16 16
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22 22
23#include <qapplication.h> 23#include <qapplication.h>
24#include <qclipboard.h> 24#include <qclipboard.h>
25//Added by qt3to4:
26#include <QDropEvent>
27#include <Q3PtrList>
25 28
26#include <kiconloader.h> 29#include <kiconloader.h>
27#include <kdebug.h> 30#include <kdebug.h>
28#include <kmessagebox.h> 31#include <kmessagebox.h>
29#include <klocale.h> 32#include <klocale.h>
30 33
31#include "vcaldrag.h" 34#include "vcaldrag.h"
32#include "icaldrag.h" 35#include "icaldrag.h"
33#include "calendar.h" 36#include "calendar.h"
34#include "vcalformat.h" 37#include "vcalformat.h"
35#include "icalformat.h" 38#include "icalformat.h"
36#include "calendarlocal.h" 39#include "calendarlocal.h"
@@ -59,44 +62,44 @@ ICalDrag *DndFactory::createDrag( Incidence *incidence, QWidget *owner )
59 return icd; 62 return icd;
60} 63}
61 64
62Event *DndFactory::createDrop(QDropEvent *de) 65Event *DndFactory::createDrop(QDropEvent *de)
63{ 66{
64 kdDebug(5800) << "DndFactory::createDrop()" << endl; 67 kdDebug(5800) << "DndFactory::createDrop()" << endl;
65 68
66 CalendarLocal cal( mCalendar->timeZoneId() ); 69 CalendarLocal cal( mCalendar->timeZoneId() );
67 70
68 if ( ICalDrag::decode( de, &cal ) || VCalDrag::decode( de, &cal ) ) { 71 if ( ICalDrag::decode( de, &cal ) || VCalDrag::decode( de, &cal ) ) {
69 de->accept(); 72 de->accept();
70 73
71 QPtrList<Event> events = cal.events(); 74 Q3PtrList<Event> events = cal.events();
72 if ( !events.isEmpty() ) { 75 if ( !events.isEmpty() ) {
73 Event *event = new Event( *events.first() ); 76 Event *event = new Event( *events.first() );
74 return event; 77 return event;
75 } 78 }
76 } 79 }
77 80
78 return 0; 81 return 0;
79} 82}
80 83
81Todo *DndFactory::createDropTodo(QDropEvent *de) 84Todo *DndFactory::createDropTodo(QDropEvent *de)
82{ 85{
83 kdDebug(5800) << "VCalFormat::createDropTodo()" << endl; 86 kdDebug(5800) << "VCalFormat::createDropTodo()" << endl;
84 87
85 CalendarLocal cal( mCalendar->timeZoneId() ); 88 CalendarLocal cal( mCalendar->timeZoneId() );
86 89
87 if ( ICalDrag::decode( de, &cal ) || VCalDrag::decode( de, &cal ) ) { 90 if ( ICalDrag::decode( de, &cal ) || VCalDrag::decode( de, &cal ) ) {
88 de->accept(); 91 de->accept();
89 92
90 QPtrList<Todo> todos = cal.todos(); 93 Q3PtrList<Todo> todos = cal.todos();
91 if ( !todos.isEmpty() ) { 94 if ( !todos.isEmpty() ) {
92 Todo *todo = new Todo( *todos.first() ); 95 Todo *todo = new Todo( *todos.first() );
93 return todo; 96 return todo;
94 } 97 }
95 } 98 }
96 99
97 return 0; 100 return 0;
98} 101}
99 102
100 103
101void DndFactory::cutIncidence( Incidence *selectedInc ) 104void DndFactory::cutIncidence( Incidence *selectedInc )
102{ 105{
@@ -124,25 +127,25 @@ Incidence *DndFactory::pasteIncidence(const QDate &newDate, const QTime *newTime
124// kdDebug(5800) << "DnDFactory::pasteEvent()" << endl; 127// kdDebug(5800) << "DnDFactory::pasteEvent()" << endl;
125 128
126 CalendarLocal cal( mCalendar->timeZoneId() ); 129 CalendarLocal cal( mCalendar->timeZoneId() );
127 130
128 QClipboard *cb = QApplication::clipboard(); 131 QClipboard *cb = QApplication::clipboard();
129 132
130 if ( !ICalDrag::decode( cb->data(), &cal ) && 133 if ( !ICalDrag::decode( cb->data(), &cal ) &&
131 !VCalDrag::decode( cb->data(), &cal ) ) { 134 !VCalDrag::decode( cb->data(), &cal ) ) {
132 kdDebug(5800) << "Can't parse clipboard" << endl; 135 kdDebug(5800) << "Can't parse clipboard" << endl;
133 return 0; 136 return 0;
134 } 137 }
135 138
136 QPtrList<Incidence> incList = cal.incidences(); 139 Q3PtrList<Incidence> incList = cal.incidences();
137 Incidence *inc = incList.first(); 140 Incidence *inc = incList.first();
138 141
139 if ( !incList.isEmpty() && inc ) { 142 if ( !incList.isEmpty() && inc ) {
140 inc = inc->clone(); 143 inc = inc->clone();
141 144
142 inc->recreate(); 145 inc->recreate();
143 146
144 if ( inc->type() == "Event" ) { 147 if ( inc->type() == "Event" ) {
145 148
146 Event *anEvent = static_cast<Event*>( inc ); 149 Event *anEvent = static_cast<Event*>( inc );
147 // Calculate length of event 150 // Calculate length of event
148 int daysOffset = anEvent->dtStart().date().daysTo( 151 int daysOffset = anEvent->dtStart().date().daysTo(
diff --git a/libkcal/dndfactory.h b/libkcal/dndfactory.h
index 2df5259..a873c37 100644
--- a/libkcal/dndfactory.h
+++ b/libkcal/dndfactory.h
@@ -1,12 +1,14 @@
1//Added by qt3to4:
2#include <QDropEvent>
1/* 3/*
2 This file is part of libkcal. 4 This file is part of libkcal.
3 5
4 Copyright (c) 1998 Preston Brown 6 Copyright (c) 1998 Preston Brown
5 Copyright (c) 2001,2002,2003 Cornelius Schumacher <schumacher@kde.org> 7 Copyright (c) 2001,2002,2003 Cornelius Schumacher <schumacher@kde.org>
6 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> 8 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
7 9
8 This library is free software; you can redistribute it and/or 10 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 11 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 12 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version. 13 version 2 of the License, or (at your option) any later version.
12 14
diff --git a/libkcal/dndfactory_dummy.h b/libkcal/dndfactory_dummy.h
index 44cc114..3ab6adf 100644
--- a/libkcal/dndfactory_dummy.h
+++ b/libkcal/dndfactory_dummy.h
@@ -16,24 +16,26 @@
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22// $Id$ 22// $Id$
23 23
24#ifndef KCAL_DNDFACTORY_H 24#ifndef KCAL_DNDFACTORY_H
25#define KCAL_DNDFACTORY_H 25#define KCAL_DNDFACTORY_H
26 26
27#include "vcalformat.h" 27#include "vcalformat.h"
28//Added by qt3to4:
29#include <QDropEvent>
28 30
29class QDropEvent; 31class QDropEvent;
30 32
31namespace KCal { 33namespace KCal {
32 34
33/** 35/**
34 This class implements functions to create Drag and Drop objects used for 36 This class implements functions to create Drag and Drop objects used for
35 Drag-and-Drop and Copy-and-Paste. 37 Drag-and-Drop and Copy-and-Paste.
36 38
37 @short vCalendar Drag-and-Drop object factory. 39 @short vCalendar Drag-and-Drop object factory.
38*/ 40*/
39class DndFactory { 41class DndFactory {
diff --git a/libkcal/dummyscheduler.cpp b/libkcal/dummyscheduler.cpp
index ae40e6d..73eb3d0 100644
--- a/libkcal/dummyscheduler.cpp
+++ b/libkcal/dummyscheduler.cpp
@@ -14,25 +14,27 @@
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21// 21//
22// DummyScheduler - iMIP implementation of iTIP methods 22// DummyScheduler - iMIP implementation of iTIP methods
23// 23//
24 24
25#include <qfile.h> 25#include <qfile.h>
26#include <qtextstream.h> 26#include <q3textstream.h>
27//Added by qt3to4:
28#include <Q3PtrList>
27 29
28#include <kdebug.h> 30#include <kdebug.h>
29 31
30#include "event.h" 32#include "event.h"
31#include "icalformat.h" 33#include "icalformat.h"
32 34
33#include "dummyscheduler.h" 35#include "dummyscheduler.h"
34 36
35using namespace KCal; 37using namespace KCal;
36 38
37DummyScheduler::DummyScheduler(Calendar *calendar) 39DummyScheduler::DummyScheduler(Calendar *calendar)
38 : Scheduler(calendar) 40 : Scheduler(calendar)
@@ -59,44 +61,44 @@ bool DummyScheduler::performTransaction(IncidenceBase *incidence,Method method,c
59} 61}
60 62
61bool DummyScheduler::performTransaction(IncidenceBase *incidence,Method method) 63bool DummyScheduler::performTransaction(IncidenceBase *incidence,Method method)
62{ 64{
63 QString messageText = mFormat->createScheduleMessage(incidence,method); 65 QString messageText = mFormat->createScheduleMessage(incidence,method);
64 66
65 return saveMessage(messageText); 67 return saveMessage(messageText);
66} 68}
67 69
68bool DummyScheduler::saveMessage(const QString &message) 70bool DummyScheduler::saveMessage(const QString &message)
69{ 71{
70 QFile f("dummyscheduler.store"); 72 QFile f("dummyscheduler.store");
71 if (f.open(IO_WriteOnly | IO_Append)) { 73 if (f.open(QIODevice::WriteOnly | QIODevice::Append)) {
72 QTextStream t(&f); 74 Q3TextStream t(&f);
73 t << message << endl; 75 t << message << endl;
74 f.close(); 76 f.close();
75 return true; 77 return true;
76 } else { 78 } else {
77 return false; 79 return false;
78 } 80 }
79} 81}
80 82
81QPtrList<ScheduleMessage> DummyScheduler::retrieveTransactions() 83Q3PtrList<ScheduleMessage> DummyScheduler::retrieveTransactions()
82{ 84{
83 QPtrList<ScheduleMessage> messageList; 85 Q3PtrList<ScheduleMessage> messageList;
84 86
85 QFile f("dummyscheduler.store"); 87 QFile f("dummyscheduler.store");
86 if (!f.open(IO_ReadOnly)) { 88 if (!f.open(QIODevice::ReadOnly)) {
87 kdDebug(5800) << "DummyScheduler::retrieveTransactions(): Can't open file" 89 kdDebug(5800) << "DummyScheduler::retrieveTransactions(): Can't open file"
88 << endl; 90 << endl;
89 } else { 91 } else {
90 QTextStream t(&f); 92 Q3TextStream t(&f);
91 QString messageString; 93 QString messageString;
92 QString messageLine = t.readLine(); 94 QString messageLine = t.readLine();
93 while (!messageLine.isNull()) { 95 while (!messageLine.isNull()) {
94// kdDebug(5800) << "++++++++" << messageLine << endl; 96// kdDebug(5800) << "++++++++" << messageLine << endl;
95 messageString += messageLine + "\n"; 97 messageString += messageLine + "\n";
96 if (messageLine.find("END:VCALENDAR") >= 0) { 98 if (messageLine.find("END:VCALENDAR") >= 0) {
97 kdDebug(5800) << "---------------" << messageString << endl; 99 kdDebug(5800) << "---------------" << messageString << endl;
98 ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar, 100 ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar,
99 messageString); 101 messageString);
100 kdDebug(5800) << "--Parsed" << endl; 102 kdDebug(5800) << "--Parsed" << endl;
101 if (message) { 103 if (message) {
102 messageList.append(message); 104 messageList.append(message);
diff --git a/libkcal/dummyscheduler.h b/libkcal/dummyscheduler.h
index df42153..f86d583 100644
--- a/libkcal/dummyscheduler.h
+++ b/libkcal/dummyscheduler.h
@@ -15,37 +15,39 @@
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef DUMMYSCHEDULER_H 20#ifndef DUMMYSCHEDULER_H
21#define DUMMYSCHEDULER_H 21#define DUMMYSCHEDULER_H
22// 22//
23// Dummy implementation of iTIP methods 23// Dummy implementation of iTIP methods
24// 24//
25 25
26#include "scheduler.h" 26#include "scheduler.h"
27//Added by qt3to4:
28#include <Q3PtrList>
27 29
28namespace KCal { 30namespace KCal {
29 31
30/** 32/**
31 This class implements the iTIP interface as a primitive local version for 33 This class implements the iTIP interface as a primitive local version for
32 testing. It uses a file dummyscheduler.store as inbox/outbox. 34 testing. It uses a file dummyscheduler.store as inbox/outbox.
33*/ 35*/
34class DummyScheduler : public Scheduler { 36class DummyScheduler : public Scheduler {
35 public: 37 public:
36 DummyScheduler(Calendar *); 38 DummyScheduler(Calendar *);
37 virtual ~DummyScheduler(); 39 virtual ~DummyScheduler();
38 40
39 bool publish (IncidenceBase *incidence,const QString &recipients); 41 bool publish (IncidenceBase *incidence,const QString &recipients);
40 bool performTransaction(IncidenceBase *incidence,Method method); 42 bool performTransaction(IncidenceBase *incidence,Method method);
41 bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients); 43 bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients);
42 QPtrList<ScheduleMessage> retrieveTransactions(); 44 Q3PtrList<ScheduleMessage> retrieveTransactions();
43 45
44 protected: 46 protected:
45 bool saveMessage(const QString &); 47 bool saveMessage(const QString &);
46}; 48};
47 49
48} 50}
49 51
50#endif // DUMMYSCHEDULER_H 52#endif // DUMMYSCHEDULER_H
51 53
diff --git a/libkcal/event.cpp b/libkcal/event.cpp
index fdf5657..060df81 100644
--- a/libkcal/event.cpp
+++ b/libkcal/event.cpp
@@ -375,25 +375,25 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_
375 *ok = false; 375 *ok = false;
376 return QDateTime (); 376 return QDateTime ();
377 } 377 }
378 378
379 bool enabled = false; 379 bool enabled = false;
380 Alarm* alarm; 380 Alarm* alarm;
381 int off = 0; 381 int off = 0;
382 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; 382 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );;
383 // if ( QDateTime::currentDateTime() > incidenceStart ){ 383 // if ( QDateTime::currentDateTime() > incidenceStart ){
384// *ok = false; 384// *ok = false;
385// return incidenceStart; 385// return incidenceStart;
386// } 386// }
387 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { 387 for (Q3PtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) {
388 if (alarm->enabled()) { 388 if (alarm->enabled()) {
389 if ( alarm->hasTime () ) { 389 if ( alarm->hasTime () ) {
390 if ( alarm->time() < alarmStart ) { 390 if ( alarm->time() < alarmStart ) {
391 alarmStart = alarm->time(); 391 alarmStart = alarm->time();
392 enabled = true; 392 enabled = true;
393 off = alarmStart.secsTo( incidenceStart ); 393 off = alarmStart.secsTo( incidenceStart );
394 } 394 }
395 395
396 } else { 396 } else {
397 int secs = alarm->startOffset().asSeconds(); 397 int secs = alarm->startOffset().asSeconds();
398 if ( incidenceStart.addSecs( secs ) < alarmStart ) { 398 if ( incidenceStart.addSecs( secs ) < alarmStart ) {
399 alarmStart = incidenceStart.addSecs( secs ); 399 alarmStart = incidenceStart.addSecs( secs );
diff --git a/libkcal/event.h b/libkcal/event.h
index 6a58618..da44f81 100644
--- a/libkcal/event.h
+++ b/libkcal/event.h
@@ -16,40 +16,42 @@
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#ifndef EVENT_H 21#ifndef EVENT_H
22#define EVENT_H 22#define EVENT_H
23// 23//
24// Event component, representing a VEVENT object 24// Event component, representing a VEVENT object
25// 25//
26 26
27#include "incidence.h" 27#include "incidence.h"
28//Added by qt3to4:
29#include <Q3CString>
28namespace KCal { 30namespace KCal {
29 31
30/** 32/**
31 This class provides an Event in the sense of RFC2445. 33 This class provides an Event in the sense of RFC2445.
32*/ 34*/
33class Event : public Incidence 35class Event : public Incidence
34{ 36{
35 public: 37 public:
36 enum Transparency { Opaque, Transparent }; 38 enum Transparency { Opaque, Transparent };
37 typedef ListBase<Event> List; 39 typedef ListBase<Event> List;
38 Event(); 40 Event();
39 Event(const Event &); 41 Event(const Event &);
40 ~Event(); 42 ~Event();
41 bool matchTime(QDateTime*startDT, QDateTime* endDT); 43 bool matchTime(QDateTime*startDT, QDateTime* endDT);
42 44
43 QCString type() const { return "Event"; } 45 Q3CString type() const { return "Event"; }
44 IncTypeID typeID() const { return eventID; } 46 IncTypeID typeID() const { return eventID; }
45 47
46 Incidence *clone(); 48 Incidence *clone();
47 QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const; 49 QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const;
48 50
49 /** for setting an event's ending date/time with a QDateTime. */ 51 /** for setting an event's ending date/time with a QDateTime. */
50 void setDtEnd(const QDateTime &dtEnd); 52 void setDtEnd(const QDateTime &dtEnd);
51 /** Return the event's ending date/time as a QDateTime. */ 53 /** Return the event's ending date/time as a QDateTime. */
52 virtual QDateTime dtEnd() const; 54 virtual QDateTime dtEnd() const;
53 /** returns an event's end time as a string formatted according to the 55 /** returns an event's end time as a string formatted according to the
54 users locale settings */ 56 users locale settings */
55 QString dtEndTimeStr() const; 57 QString dtEndTimeStr() const;
diff --git a/libkcal/filestorage.cpp b/libkcal/filestorage.cpp
index a139124..3d1309f 100644
--- a/libkcal/filestorage.cpp
+++ b/libkcal/filestorage.cpp
@@ -13,25 +13,25 @@
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <stdlib.h> 21#include <stdlib.h>
22 22
23#include <qdatetime.h> 23#include <qdatetime.h>
24#include <qstring.h> 24#include <qstring.h>
25#include <qptrlist.h> 25#include <q3ptrlist.h>
26 26
27#include <kdebug.h> 27#include <kdebug.h>
28 28
29#include "calendar.h" 29#include "calendar.h"
30#include "vcaldrag.h" 30#include "vcaldrag.h"
31#include "vcalformat.h" 31#include "vcalformat.h"
32#include "icalformat.h" 32#include "icalformat.h"
33 33
34#include "filestorage.h" 34#include "filestorage.h"
35 35
36using namespace KCal; 36using namespace KCal;
37 37
diff --git a/libkcal/freebusy.cpp b/libkcal/freebusy.cpp
index ba15d6d..e4e9ec9 100644
--- a/libkcal/freebusy.cpp
+++ b/libkcal/freebusy.cpp
@@ -12,47 +12,50 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <kdebug.h> 21#include <kdebug.h>
22 22
23#include "freebusy.h" 23#include "freebusy.h"
24//Added by qt3to4:
25#include <Q3ValueList>
26#include <Q3PtrList>
24 27
25using namespace KCal; 28using namespace KCal;
26 29
27FreeBusy::FreeBusy() 30FreeBusy::FreeBusy()
28{ 31{
29} 32}
30 33
31FreeBusy::FreeBusy(const QDateTime &start, const QDateTime &end) 34FreeBusy::FreeBusy(const QDateTime &start, const QDateTime &end)
32{ 35{
33 setDtStart(start); 36 setDtStart(start);
34 setDtEnd(end); 37 setDtEnd(end);
35} 38}
36 39
37FreeBusy::FreeBusy( Calendar *calendar, const QDateTime &start, const QDateTime &end ) 40FreeBusy::FreeBusy( Calendar *calendar, const QDateTime &start, const QDateTime &end )
38{ 41{
39 kdDebug() << "FreeBusy::FreeBusy" << endl; 42 kdDebug() << "FreeBusy::FreeBusy" << endl;
40 mCalendar = calendar; 43 mCalendar = calendar;
41 44
42 setDtStart(start); 45 setDtStart(start);
43 setDtEnd(end); 46 setDtEnd(end);
44 47
45 //Gets all the events in the calendar 48 //Gets all the events in the calendar
46 QPtrList<Event> eventList = mCalendar->events(); 49 Q3PtrList<Event> eventList = mCalendar->events();
47 Event *event; 50 Event *event;
48 51
49 int extraDays, i, x, duration; 52 int extraDays, i, x, duration;
50 duration = start.daysTo(end); 53 duration = start.daysTo(end);
51 QDate day; 54 QDate day;
52 QDateTime tmpStart; 55 QDateTime tmpStart;
53 QDateTime tmpEnd; 56 QDateTime tmpEnd;
54 //Loops through every event in the calendar 57 //Loops through every event in the calendar
55 for( event = eventList.first(); event; event = eventList.next() ) { 58 for( event = eventList.first(); event; event = eventList.next() ) {
56 //This whole for loop is for recurring events, it loops through 59 //This whole for loop is for recurring events, it loops through
57 //each of the days of the freebusy request 60 //each of the days of the freebusy request
58 61
@@ -104,25 +107,25 @@ FreeBusy::~FreeBusy()
104 107
105bool FreeBusy::setDtEnd( const QDateTime &end ) 108bool FreeBusy::setDtEnd( const QDateTime &end )
106{ 109{
107 mDtEnd = end; 110 mDtEnd = end;
108 return true; 111 return true;
109} 112}
110 113
111QDateTime FreeBusy::dtEnd() const 114QDateTime FreeBusy::dtEnd() const
112{ 115{
113 return mDtEnd; 116 return mDtEnd;
114} 117}
115 118
116QValueList<Period> FreeBusy::busyPeriods() const 119Q3ValueList<Period> FreeBusy::busyPeriods() const
117{ 120{
118 return mBusyPeriods; 121 return mBusyPeriods;
119} 122}
120 123
121bool FreeBusy::addLocalPeriod(const QDateTime &eventStart, const QDateTime &eventEnd ) { 124bool FreeBusy::addLocalPeriod(const QDateTime &eventStart, const QDateTime &eventEnd ) {
122 QDateTime tmpStart; 125 QDateTime tmpStart;
123 QDateTime tmpEnd; 126 QDateTime tmpEnd;
124 127
125 //Check to see if the start *or* end of the event is 128 //Check to see if the start *or* end of the event is
126 //between the start and end of the freebusy dates. 129 //between the start and end of the freebusy dates.
127 if (!((((this->dtStart()).secsTo(eventStart)>=0)&&(eventStart.secsTo(this->dtEnd())>=0)) 130 if (!((((this->dtStart()).secsTo(eventStart)>=0)&&(eventStart.secsTo(this->dtEnd())>=0))
128 ||(((this->dtStart()).secsTo(eventEnd) >= 0)&&(eventEnd.secsTo(this->dtEnd()) >= 0)))) 131 ||(((this->dtStart()).secsTo(eventEnd) >= 0)&&(eventEnd.secsTo(this->dtEnd()) >= 0))))
@@ -137,32 +140,32 @@ bool FreeBusy::addLocalPeriod(const QDateTime &eventStart, const QDateTime &even
137 if ( eventEnd.secsTo(this->dtEnd())<=0 ) { 140 if ( eventEnd.secsTo(this->dtEnd())<=0 ) {
138 tmpEnd = this->dtEnd(); 141 tmpEnd = this->dtEnd();
139 } else { 142 } else {
140 tmpEnd = eventEnd; 143 tmpEnd = eventEnd;
141 } 144 }
142 145
143 Period p(tmpStart, tmpEnd); 146 Period p(tmpStart, tmpEnd);
144 mBusyPeriods.append( p ); 147 mBusyPeriods.append( p );
145 148
146 return true; 149 return true;
147} 150}
148 151
149FreeBusy::FreeBusy(QValueList<Period> busyPeriods) 152FreeBusy::FreeBusy(Q3ValueList<Period> busyPeriods)
150{ 153{
151 mBusyPeriods = busyPeriods; 154 mBusyPeriods = busyPeriods;
152} 155}
153 156
154void FreeBusy::sortList() 157void FreeBusy::sortList()
155{ 158{
156 typedef QValueList<Period> PeriodList; 159 typedef Q3ValueList<Period> PeriodList;
157 160
158 PeriodList::Iterator tmpPeriod, earlyPeriod; 161 PeriodList::Iterator tmpPeriod, earlyPeriod;
159 PeriodList sortedList; 162 PeriodList sortedList;
160 QDateTime earlyTime; 163 QDateTime earlyTime;
161 164
162 while( mBusyPeriods.count() > 0 ) { 165 while( mBusyPeriods.count() > 0 ) {
163 earlyTime=(*mBusyPeriods.begin()).start(); 166 earlyTime=(*mBusyPeriods.begin()).start();
164 for (tmpPeriod=mBusyPeriods.begin(); tmpPeriod!=mBusyPeriods.end(); tmpPeriod++) { 167 for (tmpPeriod=mBusyPeriods.begin(); tmpPeriod!=mBusyPeriods.end(); tmpPeriod++) {
165 if (earlyTime.secsTo((*tmpPeriod).start()) <= 0) { 168 if (earlyTime.secsTo((*tmpPeriod).start()) <= 0) {
166 earlyTime=(*tmpPeriod).start(); 169 earlyTime=(*tmpPeriod).start();
167 earlyPeriod=tmpPeriod; 170 earlyPeriod=tmpPeriod;
168 } 171 }
diff --git a/libkcal/freebusy.h b/libkcal/freebusy.h
index d741c72..bd14cb7 100644
--- a/libkcal/freebusy.h
+++ b/libkcal/freebusy.h
@@ -15,59 +15,61 @@
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef KCAL_FREEBUSY_H 20#ifndef KCAL_FREEBUSY_H
21#define KCAL_FREEBUSY_H 21#define KCAL_FREEBUSY_H
22// 22//
23// FreeBusy - information about free/busy times 23// FreeBusy - information about free/busy times
24// 24//
25 25
26#include <qdatetime.h> 26#include <qdatetime.h>
27#include <qvaluelist.h> 27#include <q3valuelist.h>
28#include <qptrlist.h> 28#include <q3ptrlist.h>
29//Added by qt3to4:
30#include <Q3CString>
29 31
30#include "period.h" 32#include "period.h"
31#include "calendar.h" 33#include "calendar.h"
32 34
33#include "incidencebase.h" 35#include "incidencebase.h"
34 36
35namespace KCal { 37namespace KCal {
36 38
37/** 39/**
38 This class provides information about free/busy time of a calendar user. 40 This class provides information about free/busy time of a calendar user.
39*/ 41*/
40class FreeBusy : public IncidenceBase 42class FreeBusy : public IncidenceBase
41{ 43{
42 public: 44 public:
43 FreeBusy(); 45 FreeBusy();
44 FreeBusy(const QDateTime &start, const QDateTime &end); 46 FreeBusy(const QDateTime &start, const QDateTime &end);
45 FreeBusy(Calendar *calendar, const QDateTime &start, const QDateTime &end); 47 FreeBusy(Calendar *calendar, const QDateTime &start, const QDateTime &end);
46 FreeBusy(QValueList<Period> busyPeriods); 48 FreeBusy(Q3ValueList<Period> busyPeriods);
47 49
48 ~FreeBusy(); 50 ~FreeBusy();
49 51
50 QCString type() const { return "FreeBusy"; } 52 Q3CString type() const { return "FreeBusy"; }
51 IncTypeID typeID() const { return freebusyID; } 53 IncTypeID typeID() const { return freebusyID; }
52 54
53 virtual QDateTime dtEnd() const; 55 virtual QDateTime dtEnd() const;
54 bool setDtEnd( const QDateTime &end ); 56 bool setDtEnd( const QDateTime &end );
55 57
56 QValueList<Period> busyPeriods() const; 58 Q3ValueList<Period> busyPeriods() const;
57 59
58 void addPeriod(const QDateTime &start, const QDateTime &end); 60 void addPeriod(const QDateTime &start, const QDateTime &end);
59 void sortList(); 61 void sortList();
60 62
61 private: 63 private:
62 64
63 //This is used for creating a freebusy object for the current user 65 //This is used for creating a freebusy object for the current user
64 bool addLocalPeriod(const QDateTime &start, const QDateTime &end); 66 bool addLocalPeriod(const QDateTime &start, const QDateTime &end);
65 67
66 QDateTime mDtEnd; 68 QDateTime mDtEnd;
67 QValueList<Period> mBusyPeriods; 69 Q3ValueList<Period> mBusyPeriods;
68 Calendar *mCalendar; 70 Calendar *mCalendar;
69}; 71};
70 72
71} 73}
72 74
73#endif 75#endif
diff --git a/libkcal/icaldrag.cpp b/libkcal/icaldrag.cpp
index 446a115..7f5a796 100644
--- a/libkcal/icaldrag.cpp
+++ b/libkcal/icaldrag.cpp
@@ -19,25 +19,25 @@
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include "icaldrag.h" 22#include "icaldrag.h"
23 23
24#include "icalformat.h" 24#include "icalformat.h"
25 25
26#include <kdebug.h> 26#include <kdebug.h>
27 27
28using namespace KCal; 28using namespace KCal;
29 29
30ICalDrag::ICalDrag( Calendar *cal, QWidget *parent, const char *name ) 30ICalDrag::ICalDrag( Calendar *cal, QWidget *parent, const char *name )
31 : QStoredDrag( "text/calendar", parent, name ) 31 : Q3StoredDrag( "text/calendar", parent, name )
32{ 32{
33 ICalFormat icf; 33 ICalFormat icf;
34 QString scal = icf.toString( cal ); 34 QString scal = icf.toString( cal );
35 35
36 setEncodedData( scal.utf8() ); 36 setEncodedData( scal.utf8() );
37} 37}
38 38
39bool ICalDrag::canDecode( QMimeSource *me ) 39bool ICalDrag::canDecode( QMimeSource *me )
40{ 40{
41 return me->provides( "text/calendar" ); 41 return me->provides( "text/calendar" );
42} 42}
43 43
diff --git a/libkcal/icaldrag.h b/libkcal/icaldrag.h
index fdf32b7..c1f73f4 100644
--- a/libkcal/icaldrag.h
+++ b/libkcal/icaldrag.h
@@ -13,31 +13,31 @@
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#ifndef ICALDRAG_H 22#ifndef ICALDRAG_H
23#define ICALDRAG_H 23#define ICALDRAG_H
24 24
25#include <qdragobject.h> 25#include <q3dragobject.h>
26#include "calendar.h" 26#include "calendar.h"
27 27
28namespace KCal { 28namespace KCal {
29 29
30/** iCalendar drag&drop class. */ 30/** iCalendar drag&drop class. */
31class ICalDrag : public QStoredDrag 31class ICalDrag : public Q3StoredDrag
32{ 32{
33 public: 33 public:
34 /** Create a drag&drop object for iCalendar component \a ical. */ 34 /** Create a drag&drop object for iCalendar component \a ical. */
35 ICalDrag( Calendar *cal, QWidget *parent = 0, const char *name = 0 ); 35 ICalDrag( Calendar *cal, QWidget *parent = 0, const char *name = 0 );
36 ~ICalDrag() {}; 36 ~ICalDrag() {};
37 37
38 /** Return, if drag&drop object can be decode to iCalendar. */ 38 /** Return, if drag&drop object can be decode to iCalendar. */
39 static bool canDecode( QMimeSource * ); 39 static bool canDecode( QMimeSource * );
40 /** Decode drag&drop object to iCalendar component \a cal. */ 40 /** Decode drag&drop object to iCalendar component \a cal. */
41 static bool decode( QMimeSource *e, Calendar *cal ); 41 static bool decode( QMimeSource *e, Calendar *cal );
42}; 42};
43 43
diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp
index 6f3a799..3829bc1 100644
--- a/libkcal/icalformat.cpp
+++ b/libkcal/icalformat.cpp
@@ -11,29 +11,29 @@
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qdatetime.h> 21#include <qdatetime.h>
22#include <qstring.h> 22#include <qstring.h>
23#include <qptrlist.h> 23#include <q3ptrlist.h>
24#include <qregexp.h> 24#include <qregexp.h>
25#include <qclipboard.h> 25#include <qclipboard.h>
26#include <qfile.h> 26#include <qfile.h>
27#include <qtextstream.h> 27#include <q3textstream.h>
28#include <qtextcodec.h> 28#include <qtextcodec.h>
29#include <stdlib.h> 29#include <stdlib.h>
30 30
31#include <kdebug.h> 31#include <kdebug.h>
32#include <kglobal.h> 32#include <kglobal.h>
33#include <klocale.h> 33#include <klocale.h>
34 34
35extern "C" { 35extern "C" {
36 #include <ical.h> 36 #include <ical.h>
37 #include <icalss.h> 37 #include <icalss.h>
38 #include <icalparser.h> 38 #include <icalparser.h>
39 #include <icalrestriction.h> 39 #include <icalrestriction.h>
@@ -61,60 +61,60 @@ ICalFormat::ICalFormat( bool pe )
61ICalFormat::~ICalFormat() 61ICalFormat::~ICalFormat()
62{ 62{
63 delete mImpl; 63 delete mImpl;
64 //qDebug("delete ICalFormat "); 64 //qDebug("delete ICalFormat ");
65} 65}
66 66
67bool ICalFormat::load( Calendar *calendar, const QString &fileName) 67bool ICalFormat::load( Calendar *calendar, const QString &fileName)
68{ 68{
69 69
70 clearException(); 70 clearException();
71 71
72 QFile file( fileName ); 72 QFile file( fileName );
73 if (!file.open( IO_ReadOnly ) ) { 73 if (!file.open( QIODevice::ReadOnly ) ) {
74 setException(new ErrorFormat(ErrorFormat::LoadError)); 74 setException(new ErrorFormat(ErrorFormat::LoadError));
75 return false; 75 return false;
76 } 76 }
77 QTextStream ts( &file ); 77 Q3TextStream ts( &file );
78 QString text; 78 QString text;
79 79
80 ts.setEncoding( QTextStream::Latin1 ); 80 ts.setEncoding( Q3TextStream::Latin1 );
81 text = ts.read(); 81 text = ts.read();
82 file.close(); 82 file.close();
83 83
84 return fromString( calendar, text ); 84 return fromString( calendar, text );
85} 85}
86 86
87//#include <qdatetime.h> 87//#include <qdatetime.h>
88bool ICalFormat::save( Calendar *calendar, const QString &fileName ) 88bool ICalFormat::save( Calendar *calendar, const QString &fileName )
89{ 89{
90 //kdDebug(5800) << "ICalFormat::save(): " << fileName << endl; 90 //kdDebug(5800) << "ICalFormat::save(): " << fileName << endl;
91 //qDebug("ICalFormat::save "); 91 //qDebug("ICalFormat::save ");
92 clearException(); 92 clearException();
93 QString text = toString( calendar ); 93 QString text = toString( calendar );
94 //return false; 94 //return false;
95 // qDebug("to string takes ms: %d ",is.elapsed() ); 95 // qDebug("to string takes ms: %d ",is.elapsed() );
96 if ( text.isNull() ) return false; 96 if ( text.isNull() ) return false;
97 97
98 // TODO: write backup file 98 // TODO: write backup file
99 //is.restart(); 99 //is.restart();
100 QFile file( fileName ); 100 QFile file( fileName );
101 if (!file.open( IO_WriteOnly ) ) { 101 if (!file.open( QIODevice::WriteOnly ) ) {
102 setException(new ErrorFormat(ErrorFormat::SaveError, 102 setException(new ErrorFormat(ErrorFormat::SaveError,
103 i18n("Could not open file '%1'").arg(fileName))); 103 i18n("Could not open file '%1'").arg(fileName)));
104 return false; 104 return false;
105 } 105 }
106 QTextStream ts( &file ); 106 Q3TextStream ts( &file );
107 107
108 ts.setEncoding( QTextStream::Latin1 ); 108 ts.setEncoding( Q3TextStream::Latin1 );
109 ts << text; 109 ts << text;
110 file.close(); 110 file.close();
111 //qDebug("saving file takes ms: %d ", is.elapsed() ); 111 //qDebug("saving file takes ms: %d ", is.elapsed() );
112 return true; 112 return true;
113} 113}
114 114
115bool ICalFormat::fromString( Calendar *cal, const QString &text ) 115bool ICalFormat::fromString( Calendar *cal, const QString &text )
116{ 116{
117 setTimeZone( cal->timeZoneId(), !cal->isLocalTime() ); 117 setTimeZone( cal->timeZoneId(), !cal->isLocalTime() );
118 // qDebug("ICalFormat::fromString tz: %s ", cal->timeZoneId().latin1()); 118 // qDebug("ICalFormat::fromString tz: %s ", cal->timeZoneId().latin1());
119 // Get first VCALENDAR component. 119 // Get first VCALENDAR component.
120 // TODO: Handle more than one VCALENDAR or non-VCALENDAR top components 120 // TODO: Handle more than one VCALENDAR or non-VCALENDAR top components
@@ -147,76 +147,76 @@ bool ICalFormat::fromString( Calendar *cal, const QString &text )
147 icalcomponent_free( calendar ); 147 icalcomponent_free( calendar );
148 icalmemory_free_ring(); 148 icalmemory_free_ring();
149 149
150 return success; 150 return success;
151} 151}
152 152
153Incidence *ICalFormat::fromString( const QString &text ) 153Incidence *ICalFormat::fromString( const QString &text )
154{ 154{
155 CalendarLocal cal( mTimeZoneId ); 155 CalendarLocal cal( mTimeZoneId );
156 fromString(&cal, text); 156 fromString(&cal, text);
157 157
158 Incidence *ical = 0; 158 Incidence *ical = 0;
159 QPtrList<Event> elist = cal.events(); 159 Q3PtrList<Event> elist = cal.events();
160 if ( elist.count() > 0 ) { 160 if ( elist.count() > 0 ) {
161 ical = elist.first(); 161 ical = elist.first();
162 } else { 162 } else {
163 QPtrList<Todo> tlist = cal.todos(); 163 Q3PtrList<Todo> tlist = cal.todos();
164 if ( tlist.count() > 0 ) { 164 if ( tlist.count() > 0 ) {
165 ical = tlist.first(); 165 ical = tlist.first();
166 } else { 166 } else {
167 QPtrList<Journal> jlist = cal.journals(); 167 Q3PtrList<Journal> jlist = cal.journals();
168 if ( jlist.count() > 0 ) { 168 if ( jlist.count() > 0 ) {
169 ical = jlist.first(); 169 ical = jlist.first();
170 } 170 }
171 } 171 }
172 } 172 }
173 return ical; 173 return ical;
174} 174}
175#include <qapp.h> 175#include <qapplication.h>
176 176
177QString ICalFormat::toString( Calendar *cal ) 177QString ICalFormat::toString( Calendar *cal )
178{ 178{
179 179
180 setTimeZone( cal->timeZoneId(), !cal->isLocalTime() ); 180 setTimeZone( cal->timeZoneId(), !cal->isLocalTime() );
181 181
182 icalcomponent *calendar = mImpl->createCalendarComponent(cal); 182 icalcomponent *calendar = mImpl->createCalendarComponent(cal);
183 183
184 icalcomponent *component; 184 icalcomponent *component;
185 185
186 // todos 186 // todos
187 QPtrList<Todo> todoList = cal->rawTodos(); 187 Q3PtrList<Todo> todoList = cal->rawTodos();
188 QPtrListIterator<Todo> qlt(todoList); 188 Q3PtrListIterator<Todo> qlt(todoList);
189 for (; qlt.current(); ++qlt) { 189 for (; qlt.current(); ++qlt) {
190 component = mImpl->writeTodo(qlt.current()); 190 component = mImpl->writeTodo(qlt.current());
191 icalcomponent_add_component(calendar,component); 191 icalcomponent_add_component(calendar,component);
192 //qDebug(" todos "); 192 //qDebug(" todos ");
193 if ( mProcessEvents ) { 193 if ( mProcessEvents ) {
194 //qDebug("mProcessEvents "); 194 //qDebug("mProcessEvents ");
195 qApp->processEvents(); 195 qApp->processEvents();
196 } 196 }
197 } 197 }
198 // events 198 // events
199 QPtrList<Event> events = cal->rawEvents(); 199 Q3PtrList<Event> events = cal->rawEvents();
200 Event *ev; 200 Event *ev;
201 for(ev=events.first();ev;ev=events.next()) { 201 for(ev=events.first();ev;ev=events.next()) {
202 component = mImpl->writeEvent(ev); 202 component = mImpl->writeEvent(ev);
203 icalcomponent_add_component(calendar,component); 203 icalcomponent_add_component(calendar,component);
204 //qDebug("events "); 204 //qDebug("events ");
205 if ( mProcessEvents ) 205 if ( mProcessEvents )
206 qApp->processEvents(); 206 qApp->processEvents();
207 } 207 }
208 208
209 // journals 209 // journals
210 QPtrList<Journal> journals = cal->journals(); 210 Q3PtrList<Journal> journals = cal->journals();
211 Journal *j; 211 Journal *j;
212 for(j=journals.first();j;j=journals.next()) { 212 for(j=journals.first();j;j=journals.next()) {
213 component = mImpl->writeJournal(j); 213 component = mImpl->writeJournal(j);
214 icalcomponent_add_component(calendar,component); 214 icalcomponent_add_component(calendar,component);
215 //qDebug("journals "); 215 //qDebug("journals ");
216 if ( mProcessEvents ) 216 if ( mProcessEvents )
217 qApp->processEvents(); 217 qApp->processEvents();
218 } 218 }
219 const char *text; 219 const char *text;
220 QString ret =""; 220 QString ret ="";
221 text = icalcomponent_as_ical_string( calendar ); 221 text = icalcomponent_as_ical_string( calendar );
222 if ( mProcessEvents ) 222 if ( mProcessEvents )
diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h
index a770dbb..a454b35 100644
--- a/libkcal/icalformat.h
+++ b/libkcal/icalformat.h
@@ -12,24 +12,26 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef ICALFORMAT_H 20#ifndef ICALFORMAT_H
21#define ICALFORMAT_H 21#define ICALFORMAT_H
22 22
23#include <qstring.h> 23#include <qstring.h>
24//Added by qt3to4:
25#include <Q3CString>
24 26
25#include "scheduler.h" 27#include "scheduler.h"
26 28
27#include "calformat.h" 29#include "calformat.h"
28 30
29namespace KCal { 31namespace KCal {
30 32
31class ICalFormatImpl; 33class ICalFormatImpl;
32 34
33/** 35/**
34 This class implements the iCalendar format. It provides methods for 36 This class implements the iCalendar format. It provides methods for
35 loading/saving/converting iCalendar format data into the internal KOrganizer 37 loading/saving/converting iCalendar format data into the internal KOrganizer
@@ -97,20 +99,20 @@ class ICalFormat : public CalFormat {
97 99
98 /** Set id of used time zone and whether this time zone is UTC or not. */ 100 /** Set id of used time zone and whether this time zone is UTC or not. */
99 void setTimeZone( const QString &id, bool utc ); 101 void setTimeZone( const QString &id, bool utc );
100 QString timeZoneId() const; 102 QString timeZoneId() const;
101 int timeOffset(); 103 int timeOffset();
102 const char * tzString(); 104 const char * tzString();
103 bool utc() const; 105 bool utc() const;
104 106
105 private: 107 private:
106 bool mProcessEvents; 108 bool mProcessEvents;
107 ICalFormatImpl *mImpl; 109 ICalFormatImpl *mImpl;
108 QString mTimeZoneId; 110 QString mTimeZoneId;
109 QCString mTzString; 111 Q3CString mTzString;
110 int tzOffsetMin; 112 int tzOffsetMin;
111 bool mUtc; 113 bool mUtc;
112}; 114};
113 115
114} 116}
115 117
116#endif 118#endif
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index 65eabc8..ea144ee 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -11,26 +11,29 @@
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qdatetime.h> 21#include <qdatetime.h>
22#include <qstring.h> 22#include <qstring.h>
23#include <qptrlist.h> 23#include <q3ptrlist.h>
24#include <qfile.h> 24#include <qfile.h>
25//Added by qt3to4:
26#include <Q3ValueList>
27#include <Q3CString>
25 28
26#include <kdebug.h> 29#include <kdebug.h>
27#include <klocale.h> 30#include <klocale.h>
28#include <kglobal.h> 31#include <kglobal.h>
29 32
30extern "C" { 33extern "C" {
31 #include <ical.h> 34 #include <ical.h>
32 #include <icalss.h> 35 #include <icalss.h>
33 #include <icalparser.h> 36 #include <icalparser.h>
34 #include <icalrestriction.h> 37 #include <icalrestriction.h>
35} 38}
36 39
@@ -212,26 +215,26 @@ icalcomponent *ICalFormatImpl::writeFreeBusy(FreeBusy *freebusy,
212 icalcomponent_add_property(vfreebusy, icalproperty_new_dtstart( 215 icalcomponent_add_property(vfreebusy, icalproperty_new_dtstart(
213 writeICalDateTime(freebusy->dtStart()))); 216 writeICalDateTime(freebusy->dtStart())));
214 217
215 icalcomponent_add_property(vfreebusy, icalproperty_new_dtend( 218 icalcomponent_add_property(vfreebusy, icalproperty_new_dtend(
216 writeICalDateTime(freebusy->dtEnd()))); 219 writeICalDateTime(freebusy->dtEnd())));
217 220
218 if (method == Scheduler::Request) { 221 if (method == Scheduler::Request) {
219 icalcomponent_add_property(vfreebusy,icalproperty_new_uid( 222 icalcomponent_add_property(vfreebusy,icalproperty_new_uid(
220 freebusy->uid().utf8())); 223 freebusy->uid().utf8()));
221 } 224 }
222 225
223 //Loops through all the periods in the freebusy object 226 //Loops through all the periods in the freebusy object
224 QValueList<Period> list = freebusy->busyPeriods(); 227 Q3ValueList<Period> list = freebusy->busyPeriods();
225 QValueList<Period>::Iterator it; 228 Q3ValueList<Period>::Iterator it;
226 icalperiodtype period; 229 icalperiodtype period;
227 for (it = list.begin(); it!= list.end(); ++it) { 230 for (it = list.begin(); it!= list.end(); ++it) {
228 period.start = writeICalDateTime((*it).start()); 231 period.start = writeICalDateTime((*it).start());
229 period.end = writeICalDateTime((*it).end()); 232 period.end = writeICalDateTime((*it).end());
230 icalcomponent_add_property(vfreebusy, icalproperty_new_freebusy(period) ); 233 icalcomponent_add_property(vfreebusy, icalproperty_new_freebusy(period) );
231 } 234 }
232 235
233 return vfreebusy; 236 return vfreebusy;
234} 237}
235 238
236icalcomponent *ICalFormatImpl::writeJournal(Journal *journal) 239icalcomponent *ICalFormatImpl::writeJournal(Journal *journal)
237{ 240{
@@ -375,30 +378,30 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence)
375 if (incidence->doesRecur()) { 378 if (incidence->doesRecur()) {
376 icalcomponent_add_property(parent,writeRecurrenceRule(incidence->recurrence())); 379 icalcomponent_add_property(parent,writeRecurrenceRule(incidence->recurrence()));
377 // recurrence excpetion dates 380 // recurrence excpetion dates
378 DateList dateList = incidence->exDates(); 381 DateList dateList = incidence->exDates();
379 DateList::ConstIterator exIt; 382 DateList::ConstIterator exIt;
380 for(exIt = dateList.begin(); exIt != dateList.end(); ++exIt) { 383 for(exIt = dateList.begin(); exIt != dateList.end(); ++exIt) {
381 icalcomponent_add_property(parent,icalproperty_new_exdate( 384 icalcomponent_add_property(parent,icalproperty_new_exdate(
382 writeICalDate(*exIt))); 385 writeICalDate(*exIt)));
383 } 386 }
384 } 387 }
385 388
386 // attachments 389 // attachments
387 QPtrList<Attachment> attachments = incidence->attachments(); 390 Q3PtrList<Attachment> attachments = incidence->attachments();
388 for (Attachment *at = attachments.first(); at; at = attachments.next()) 391 for (Attachment *at = attachments.first(); at; at = attachments.next())
389 icalcomponent_add_property(parent,writeAttachment(at)); 392 icalcomponent_add_property(parent,writeAttachment(at));
390 393
391 // alarms 394 // alarms
392 QPtrList<Alarm> alarms = incidence->alarms(); 395 Q3PtrList<Alarm> alarms = incidence->alarms();
393 Alarm* alarm; 396 Alarm* alarm;
394 for (alarm = alarms.first(); alarm; alarm = alarms.next()) { 397 for (alarm = alarms.first(); alarm; alarm = alarms.next()) {
395 if (alarm->enabled()) { 398 if (alarm->enabled()) {
396 kdDebug(5800) << "Write alarm for " << incidence->summary() << endl; 399 kdDebug(5800) << "Write alarm for " << incidence->summary() << endl;
397 icalcomponent_add_component(parent,writeAlarm(alarm)); 400 icalcomponent_add_component(parent,writeAlarm(alarm));
398 } 401 }
399 } 402 }
400 if( incidence->hasRecurrenceID() ) { 403 if( incidence->hasRecurrenceID() ) {
401 icalcomponent_add_property(parent, 404 icalcomponent_add_property(parent,
402 icalproperty_new_recurrenceid( writeICalDateTime( incidence->recurrenceID()))); 405 icalproperty_new_recurrenceid( writeICalDateTime( incidence->recurrenceID())));
403 } 406 }
404 // duration 407 // duration
@@ -414,39 +417,39 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence)
414 417
415void ICalFormatImpl::writeIncidenceBase(icalcomponent *parent,IncidenceBase *incidenceBase) 418void ICalFormatImpl::writeIncidenceBase(icalcomponent *parent,IncidenceBase *incidenceBase)
416{ 419{
417 icalcomponent_add_property(parent,icalproperty_new_dtstamp( 420 icalcomponent_add_property(parent,icalproperty_new_dtstamp(
418 writeICalDateTime(QDateTime::currentDateTime()))); 421 writeICalDateTime(QDateTime::currentDateTime())));
419 422
420 // organizer stuff 423 // organizer stuff
421 icalcomponent_add_property(parent,icalproperty_new_organizer( 424 icalcomponent_add_property(parent,icalproperty_new_organizer(
422 ("MAILTO:" + incidenceBase->organizer()).utf8())); 425 ("MAILTO:" + incidenceBase->organizer()).utf8()));
423 426
424 // attendees 427 // attendees
425 if (incidenceBase->attendeeCount() != 0) { 428 if (incidenceBase->attendeeCount() != 0) {
426 QPtrList<Attendee> al = incidenceBase->attendees(); 429 Q3PtrList<Attendee> al = incidenceBase->attendees();
427 QPtrListIterator<Attendee> ai(al); 430 Q3PtrListIterator<Attendee> ai(al);
428 for (; ai.current(); ++ai) { 431 for (; ai.current(); ++ai) {
429 icalcomponent_add_property(parent,writeAttendee(ai.current())); 432 icalcomponent_add_property(parent,writeAttendee(ai.current()));
430 } 433 }
431 } 434 }
432 435
433 // custom properties 436 // custom properties
434 writeCustomProperties(parent, incidenceBase); 437 writeCustomProperties(parent, incidenceBase);
435} 438}
436 439
437void ICalFormatImpl::writeCustomProperties(icalcomponent *parent,CustomProperties *properties) 440void ICalFormatImpl::writeCustomProperties(icalcomponent *parent,CustomProperties *properties)
438{ 441{
439 QMap<QCString, QString> custom = properties->customProperties(); 442 QMap<Q3CString, QString> custom = properties->customProperties();
440 for (QMap<QCString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) { 443 for (QMap<Q3CString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) {
441 icalproperty *p = icalproperty_new_x(c.data().utf8()); 444 icalproperty *p = icalproperty_new_x(c.data().utf8());
442 icalproperty_set_x_name(p,c.key()); 445 icalproperty_set_x_name(p,c.key());
443 icalcomponent_add_property(parent,p); 446 icalcomponent_add_property(parent,p);
444 } 447 }
445} 448}
446 449
447icalproperty *ICalFormatImpl::writeAttendee(Attendee *attendee) 450icalproperty *ICalFormatImpl::writeAttendee(Attendee *attendee)
448{ 451{
449 icalproperty *p = icalproperty_new_attendee("mailto:" + attendee->email().utf8()); 452 icalproperty *p = icalproperty_new_attendee("mailto:" + attendee->email().utf8());
450 453
451 if (!attendee->name().isEmpty()) { 454 if (!attendee->name().isEmpty()) {
452 icalproperty_add_parameter(p,icalparameter_new_cn(attendee->name().utf8())); 455 icalproperty_add_parameter(p,icalparameter_new_cn(attendee->name().utf8()));
@@ -537,26 +540,26 @@ icalproperty *ICalFormatImpl::writeAttachment(Attachment *att)
537 540
538icalproperty *ICalFormatImpl::writeRecurrenceRule(Recurrence *recur) 541icalproperty *ICalFormatImpl::writeRecurrenceRule(Recurrence *recur)
539{ 542{
540// kdDebug(5800) << "ICalFormatImpl::writeRecurrenceRule()" << endl; 543// kdDebug(5800) << "ICalFormatImpl::writeRecurrenceRule()" << endl;
541 544
542 icalrecurrencetype r; 545 icalrecurrencetype r;
543 546
544 icalrecurrencetype_clear(&r); 547 icalrecurrencetype_clear(&r);
545 548
546 int index = 0; 549 int index = 0;
547 int index2 = 0; 550 int index2 = 0;
548 551
549 QPtrList<Recurrence::rMonthPos> tmpPositions; 552 Q3PtrList<Recurrence::rMonthPos> tmpPositions;
550 QPtrList<int> tmpDays; 553 Q3PtrList<int> tmpDays;
551 int *tmpDay; 554 int *tmpDay;
552 Recurrence::rMonthPos *tmpPos; 555 Recurrence::rMonthPos *tmpPos;
553 bool datetime = false; 556 bool datetime = false;
554 int day; 557 int day;
555 int i; 558 int i;
556 559
557 switch(recur->doesRecur()) { 560 switch(recur->doesRecur()) {
558 case Recurrence::rMinutely: 561 case Recurrence::rMinutely:
559 r.freq = ICAL_MINUTELY_RECURRENCE; 562 r.freq = ICAL_MINUTELY_RECURRENCE;
560 datetime = true; 563 datetime = true;
561 break; 564 break;
562 case Recurrence::rHourly: 565 case Recurrence::rHourly:
@@ -695,26 +698,26 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm)
695 icalattach_unref( attach ); 698 icalattach_unref( attach );
696 break; 699 break;
697 case Alarm::Audio: 700 case Alarm::Audio:
698 action = ICAL_ACTION_AUDIO; 701 action = ICAL_ACTION_AUDIO;
699 if (!alarm->audioFile().isEmpty()) { 702 if (!alarm->audioFile().isEmpty()) {
700 attach = icalattach_new_from_url(QFile::encodeName( alarm->audioFile() ).data()); 703 attach = icalattach_new_from_url(QFile::encodeName( alarm->audioFile() ).data());
701 icalcomponent_add_property(a,icalproperty_new_attach(attach)); 704 icalcomponent_add_property(a,icalproperty_new_attach(attach));
702 icalattach_unref( attach ); 705 icalattach_unref( attach );
703 } 706 }
704 break; 707 break;
705 case Alarm::Email: { 708 case Alarm::Email: {
706 action = ICAL_ACTION_EMAIL; 709 action = ICAL_ACTION_EMAIL;
707 QValueList<Person> addresses = alarm->mailAddresses(); 710 Q3ValueList<Person> addresses = alarm->mailAddresses();
708 for (QValueList<Person>::Iterator ad = addresses.begin(); ad != addresses.end(); ++ad) { 711 for (Q3ValueList<Person>::Iterator ad = addresses.begin(); ad != addresses.end(); ++ad) {
709 icalproperty *p = icalproperty_new_attendee("MAILTO:" + (*ad).email().utf8()); 712 icalproperty *p = icalproperty_new_attendee("MAILTO:" + (*ad).email().utf8());
710 if (!(*ad).name().isEmpty()) { 713 if (!(*ad).name().isEmpty()) {
711 icalproperty_add_parameter(p,icalparameter_new_cn((*ad).name().utf8())); 714 icalproperty_add_parameter(p,icalparameter_new_cn((*ad).name().utf8()));
712 } 715 }
713 icalcomponent_add_property(a,p); 716 icalcomponent_add_property(a,p);
714 } 717 }
715 icalcomponent_add_property(a,icalproperty_new_summary(alarm->mailSubject().utf8())); 718 icalcomponent_add_property(a,icalproperty_new_summary(alarm->mailSubject().utf8()));
716 icalcomponent_add_property(a,icalproperty_new_description(alarm->text().utf8())); 719 icalcomponent_add_property(a,icalproperty_new_description(alarm->text().utf8()));
717 QStringList attachments = alarm->mailAttachments(); 720 QStringList attachments = alarm->mailAttachments();
718 if (attachments.count() > 0) { 721 if (attachments.count() > 0) {
719 for (QStringList::Iterator at = attachments.begin(); at != attachments.end(); ++at) { 722 for (QStringList::Iterator at = attachments.begin(); at != attachments.end(); ++at) {
720 attach = icalattach_new_from_url(QFile::encodeName( *at ).data()); 723 attach = icalattach_new_from_url(QFile::encodeName( *at ).data());
@@ -754,26 +757,26 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm)
754 if ( alarm->hasEndOffset() ) 757 if ( alarm->hasEndOffset() )
755 icalproperty_add_parameter(p,icalparameter_new_related(ICAL_RELATED_END)); 758 icalproperty_add_parameter(p,icalparameter_new_related(ICAL_RELATED_END));
756 icalcomponent_add_property(a,p); 759 icalcomponent_add_property(a,p);
757 760
758 // Repeat count and duration 761 // Repeat count and duration
759 if (alarm->repeatCount()) { 762 if (alarm->repeatCount()) {
760 icalcomponent_add_property(a,icalproperty_new_repeat(alarm->repeatCount())); 763 icalcomponent_add_property(a,icalproperty_new_repeat(alarm->repeatCount()));
761 icalcomponent_add_property(a,icalproperty_new_duration( 764 icalcomponent_add_property(a,icalproperty_new_duration(
762 icaldurationtype_from_int(alarm->snoozeTime()*60))); 765 icaldurationtype_from_int(alarm->snoozeTime()*60)));
763 } 766 }
764 767
765 // Custom properties 768 // Custom properties
766 QMap<QCString, QString> custom = alarm->customProperties(); 769 QMap<Q3CString, QString> custom = alarm->customProperties();
767 for (QMap<QCString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) { 770 for (QMap<Q3CString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) {
768 icalproperty *p = icalproperty_new_x(c.data().utf8()); 771 icalproperty *p = icalproperty_new_x(c.data().utf8());
769 icalproperty_set_x_name(p,c.key()); 772 icalproperty_set_x_name(p,c.key());
770 icalcomponent_add_property(a,p); 773 icalcomponent_add_property(a,p);
771 } 774 }
772 775
773 return a; 776 return a;
774} 777}
775 778
776Todo *ICalFormatImpl::readTodo(icalcomponent *vtodo) 779Todo *ICalFormatImpl::readTodo(icalcomponent *vtodo)
777{ 780{
778 Todo *todo = new Todo; 781 Todo *todo = new Todo;
779 782
@@ -1330,25 +1333,25 @@ void ICalFormatImpl::readIncidenceBase(icalcomponent *parent,IncidenceBase *inci
1330 break; 1333 break;
1331 } 1334 }
1332 1335
1333 p = icalcomponent_get_next_property(parent,ICAL_ANY_PROPERTY); 1336 p = icalcomponent_get_next_property(parent,ICAL_ANY_PROPERTY);
1334 } 1337 }
1335 1338
1336 // custom properties 1339 // custom properties
1337 readCustomProperties(parent, incidenceBase); 1340 readCustomProperties(parent, incidenceBase);
1338} 1341}
1339 1342
1340void ICalFormatImpl::readCustomProperties(icalcomponent *parent,CustomProperties *properties) 1343void ICalFormatImpl::readCustomProperties(icalcomponent *parent,CustomProperties *properties)
1341{ 1344{
1342 QMap<QCString, QString> customProperties; 1345 QMap<Q3CString, QString> customProperties;
1343 1346
1344 icalproperty *p = icalcomponent_get_first_property(parent,ICAL_X_PROPERTY); 1347 icalproperty *p = icalcomponent_get_first_property(parent,ICAL_X_PROPERTY);
1345 1348
1346 while (p) { 1349 while (p) {
1347 QString value = QString::fromUtf8(icalproperty_get_x(p)); 1350 QString value = QString::fromUtf8(icalproperty_get_x(p));
1348 customProperties[icalproperty_get_x_name(p)] = value; 1351 customProperties[icalproperty_get_x_name(p)] = value;
1349 //qDebug("ICalFormatImpl::readCustomProperties %s %s",value.latin1(), icalproperty_get_x_name(p) ); 1352 //qDebug("ICalFormatImpl::readCustomProperties %s %s",value.latin1(), icalproperty_get_x_name(p) );
1350 1353
1351 p = icalcomponent_get_next_property(parent,ICAL_X_PROPERTY); 1354 p = icalcomponent_get_next_property(parent,ICAL_X_PROPERTY);
1352 } 1355 }
1353 1356
1354 properties->setCustomProperties(customProperties); 1357 properties->setCustomProperties(customProperties);
diff --git a/libkcal/icalformatimpl.h b/libkcal/icalformatimpl.h
index 203c302..3a35b4c 100644
--- a/libkcal/icalformatimpl.h
+++ b/libkcal/icalformatimpl.h
@@ -12,24 +12,26 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef ICALFORMATIMPL_H 20#ifndef ICALFORMATIMPL_H
21#define ICALFORMATIMPL_H 21#define ICALFORMATIMPL_H
22 22
23#include <qstring.h> 23#include <qstring.h>
24//Added by qt3to4:
25#include <Q3PtrList>
24 26
25#include "scheduler.h" 27#include "scheduler.h"
26#include "freebusy.h" 28#include "freebusy.h"
27 29
28extern "C" { 30extern "C" {
29 #include <ical.h> 31 #include <ical.h>
30 #include <icalss.h> 32 #include <icalss.h>
31} 33}
32 34
33namespace KCal { 35namespace KCal {
34 36
35class Compat; 37class Compat;
@@ -84,26 +86,26 @@ class ICalFormatImpl {
84 void writeIncidenceBase(icalcomponent *parent,IncidenceBase *); 86 void writeIncidenceBase(icalcomponent *parent,IncidenceBase *);
85 void readIncidenceBase(icalcomponent *parent,IncidenceBase *); 87 void readIncidenceBase(icalcomponent *parent,IncidenceBase *);
86 void writeCustomProperties(icalcomponent *parent,CustomProperties *); 88 void writeCustomProperties(icalcomponent *parent,CustomProperties *);
87 void readCustomProperties(icalcomponent *parent,CustomProperties *); 89 void readCustomProperties(icalcomponent *parent,CustomProperties *);
88 void dumpIcalRecurrence(icalrecurrencetype); 90 void dumpIcalRecurrence(icalrecurrencetype);
89 91
90 ICalFormat *mParent; 92 ICalFormat *mParent;
91 Calendar *mCalendar; 93 Calendar *mCalendar;
92 94
93 QString mLoadedProductId; // PRODID string loaded from calendar file 95 QString mLoadedProductId; // PRODID string loaded from calendar file
94 int mCalendarVersion; // determines backward compatibility mode on read 96 int mCalendarVersion; // determines backward compatibility mode on read
95 97
96 QPtrList<Event> mEventsRelate; // events with relations 98 Q3PtrList<Event> mEventsRelate; // events with relations
97 QPtrList<Todo> mTodosRelate; // todos with relations 99 Q3PtrList<Todo> mTodosRelate; // todos with relations
98 100
99 static const int mSecondsPerWeek; 101 static const int mSecondsPerWeek;
100 static const int mSecondsPerDay; 102 static const int mSecondsPerDay;
101 static const int mSecondsPerHour; 103 static const int mSecondsPerHour;
102 static const int mSecondsPerMinute; 104 static const int mSecondsPerMinute;
103 105
104 Compat *mCompat; 106 Compat *mCompat;
105}; 107};
106 108
107} 109}
108 110
109#endif 111#endif
diff --git a/libkcal/imipscheduler.cpp b/libkcal/imipscheduler.cpp
index e186f8e..e6d56a6 100644
--- a/libkcal/imipscheduler.cpp
+++ b/libkcal/imipscheduler.cpp
@@ -17,42 +17,44 @@
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21// 21//
22// IMIPScheduler - iMIP implementation of iTIP methods 22// IMIPScheduler - iMIP implementation of iTIP methods
23// 23//
24 24
25#include "event.h" 25#include "event.h"
26#include "icalformat.h" 26#include "icalformat.h"
27 27
28#include "imipscheduler.h" 28#include "imipscheduler.h"
29//Added by qt3to4:
30#include <Q3PtrList>
29 31
30using namespace KCal; 32using namespace KCal;
31 33
32IMIPScheduler::IMIPScheduler(Calendar *calendar) 34IMIPScheduler::IMIPScheduler(Calendar *calendar)
33 : Scheduler(calendar) 35 : Scheduler(calendar)
34{ 36{
35} 37}
36 38
37IMIPScheduler::~IMIPScheduler() 39IMIPScheduler::~IMIPScheduler()
38{ 40{
39} 41}
40 42
41bool IMIPScheduler::publish (IncidenceBase *incidence,const QString &recipients) 43bool IMIPScheduler::publish (IncidenceBase *incidence,const QString &recipients)
42{ 44{
43 return false; 45 return false;
44} 46}
45 47
46bool IMIPScheduler::performTransaction(IncidenceBase *incidence,Method method) 48bool IMIPScheduler::performTransaction(IncidenceBase *incidence,Method method)
47{ 49{
48 mFormat->createScheduleMessage(incidence,method); 50 mFormat->createScheduleMessage(incidence,method);
49 51
50 return false; 52 return false;
51} 53}
52 54
53QPtrList<ScheduleMessage> IMIPScheduler::retrieveTransactions() 55Q3PtrList<ScheduleMessage> IMIPScheduler::retrieveTransactions()
54{ 56{
55 QPtrList<ScheduleMessage> messageList; 57 Q3PtrList<ScheduleMessage> messageList;
56 58
57 return messageList; 59 return messageList;
58} 60}
diff --git a/libkcal/imipscheduler.h b/libkcal/imipscheduler.h
index f142060..5a2d38e 100644
--- a/libkcal/imipscheduler.h
+++ b/libkcal/imipscheduler.h
@@ -14,36 +14,36 @@
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef IMIPSCHEDULER_H 20#ifndef IMIPSCHEDULER_H
21#define IMIPSCHEDULER_H 21#define IMIPSCHEDULER_H
22// 22//
23// iMIP implementation of iTIP methods 23// iMIP implementation of iTIP methods
24// 24//
25 25
26#include <qptrlist.h> 26#include <q3ptrlist.h>
27 27
28#include "scheduler.h" 28#include "scheduler.h"
29 29
30namespace KCal { 30namespace KCal {
31 31
32/* 32/*
33 This class implements the iTIP interface using the email interface specified 33 This class implements the iTIP interface using the email interface specified
34 as iMIP. 34 as iMIP.
35*/ 35*/
36class IMIPScheduler : public Scheduler { 36class IMIPScheduler : public Scheduler {
37 public: 37 public:
38 IMIPScheduler(Calendar *); 38 IMIPScheduler(Calendar *);
39 virtual ~IMIPScheduler(); 39 virtual ~IMIPScheduler();
40 40
41 bool publish (IncidenceBase *incidence,const QString &recipients); 41 bool publish (IncidenceBase *incidence,const QString &recipients);
42 bool performTransaction(IncidenceBase *incidence,Method method); 42 bool performTransaction(IncidenceBase *incidence,Method method);
43 QPtrList<ScheduleMessage> retrieveTransactions(); 43 Q3PtrList<ScheduleMessage> retrieveTransactions();
44}; 44};
45 45
46} 46}
47 47
48#endif // IMIPSCHEDULER_H 48#endif // IMIPSCHEDULER_H
49 49
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 7dd9bd2..8fcdc69 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -17,24 +17,26 @@
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <kglobal.h> 21#include <kglobal.h>
22#include <klocale.h> 22#include <klocale.h>
23#include <kdebug.h> 23#include <kdebug.h>
24 24
25#include "calformat.h" 25#include "calformat.h"
26 26
27#include "incidence.h" 27#include "incidence.h"
28#include "todo.h" 28#include "todo.h"
29//Added by qt3to4:
30#include <Q3PtrList>
29 31
30using namespace KCal; 32using namespace KCal;
31 33
32Incidence::Incidence() : 34Incidence::Incidence() :
33 IncidenceBase(), 35 IncidenceBase(),
34 mRelatedTo(0), mSecrecy(SecrecyPublic), mPriority(3) 36 mRelatedTo(0), mSecrecy(SecrecyPublic), mPriority(3)
35{ 37{
36 mRecurrence = 0;//new Recurrence(this); 38 mRecurrence = 0;//new Recurrence(this);
37 mCancelled = false; 39 mCancelled = false;
38 recreate(); 40 recreate();
39 mHasStartDate = true; 41 mHasStartDate = true;
40 mAlarms.setAutoDelete(true); 42 mAlarms.setAutoDelete(true);
@@ -50,64 +52,64 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
50{ 52{
51// TODO: reenable attributes currently commented out. 53// TODO: reenable attributes currently commented out.
52 mRevision = i.mRevision; 54 mRevision = i.mRevision;
53 mCreated = i.mCreated; 55 mCreated = i.mCreated;
54 mDescription = i.mDescription; 56 mDescription = i.mDescription;
55 mSummary = i.mSummary; 57 mSummary = i.mSummary;
56 mCategories = i.mCategories; 58 mCategories = i.mCategories;
57// Incidence *mRelatedTo; Incidence *mRelatedTo; 59// Incidence *mRelatedTo; Incidence *mRelatedTo;
58 mRelatedTo = 0; 60 mRelatedTo = 0;
59 mRelatedToUid = i.mRelatedToUid; 61 mRelatedToUid = i.mRelatedToUid;
60// QPtrList<Incidence> mRelations; QPtrList<Incidence> mRelations; 62// QPtrList<Incidence> mRelations; QPtrList<Incidence> mRelations;
61 mExDates = i.mExDates; 63 mExDates = i.mExDates;
62 QPtrListIterator<Attachment> itat( i.mAttachments ); 64 Q3PtrListIterator<Attachment> itat( i.mAttachments );
63 Attachment *at; 65 Attachment *at;
64 while( (at = itat.current()) ) { 66 while( (at = itat.current()) ) {
65 Attachment *a = new Attachment( *at ); 67 Attachment *a = new Attachment( *at );
66 mAttachments.append( a ); 68 mAttachments.append( a );
67 ++itat; 69 ++itat;
68 } 70 }
69 mAttachments.setAutoDelete( true ); 71 mAttachments.setAutoDelete( true );
70 mResources = i.mResources; 72 mResources = i.mResources;
71 mSecrecy = i.mSecrecy; 73 mSecrecy = i.mSecrecy;
72 mPriority = i.mPriority; 74 mPriority = i.mPriority;
73 mLocation = i.mLocation; 75 mLocation = i.mLocation;
74 mCancelled = i.mCancelled; 76 mCancelled = i.mCancelled;
75 mHasStartDate = i.mHasStartDate; 77 mHasStartDate = i.mHasStartDate;
76 QPtrListIterator<Alarm> it( i.mAlarms ); 78 Q3PtrListIterator<Alarm> it( i.mAlarms );
77 const Alarm *a; 79 const Alarm *a;
78 while( (a = it.current()) ) { 80 while( (a = it.current()) ) {
79 Alarm *b = new Alarm( *a ); 81 Alarm *b = new Alarm( *a );
80 b->setParent( this ); 82 b->setParent( this );
81 mAlarms.append( b ); 83 mAlarms.append( b );
82 84
83 ++it; 85 ++it;
84 } 86 }
85 mAlarms.setAutoDelete(true); 87 mAlarms.setAutoDelete(true);
86 mHasRecurrenceID = i.mHasRecurrenceID; 88 mHasRecurrenceID = i.mHasRecurrenceID;
87 mRecurrenceID = i.mRecurrenceID; 89 mRecurrenceID = i.mRecurrenceID;
88 if ( i.mRecurrence ) 90 if ( i.mRecurrence )
89 mRecurrence = new Recurrence( *(i.mRecurrence), this ); 91 mRecurrence = new Recurrence( *(i.mRecurrence), this );
90 else 92 else
91 mRecurrence = 0; 93 mRecurrence = 0;
92 mHoliday = i.mHoliday ; 94 mHoliday = i.mHoliday ;
93 mBirthday = i.mBirthday; 95 mBirthday = i.mBirthday;
94 mAnniversary = i.mAnniversary; 96 mAnniversary = i.mAnniversary;
95} 97}
96 98
97Incidence::~Incidence() 99Incidence::~Incidence()
98{ 100{
99 101
100 Incidence *ev; 102 Incidence *ev;
101 QPtrList<Incidence> Relations = relations(); 103 Q3PtrList<Incidence> Relations = relations();
102 for (ev=Relations.first();ev;ev=Relations.next()) { 104 for (ev=Relations.first();ev;ev=Relations.next()) {
103 if (ev->relatedTo() == this) ev->setRelatedTo(0); 105 if (ev->relatedTo() == this) ev->setRelatedTo(0);
104 } 106 }
105 if (relatedTo()) relatedTo()->removeRelation(this); 107 if (relatedTo()) relatedTo()->removeRelation(this);
106 if ( mRecurrence ) 108 if ( mRecurrence )
107 delete mRecurrence; 109 delete mRecurrence;
108 110
109} 111}
110QString Incidence::durationText() 112QString Incidence::durationText()
111{ 113{
112 return "---"; 114 return "---";
113} 115}
@@ -207,26 +209,26 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
207 209
208 if( i1.alarms().count() != i2.alarms().count() ) { 210 if( i1.alarms().count() != i2.alarms().count() ) {
209 return false; // no need to check further 211 return false; // no need to check further
210 } 212 }
211 if ( i1.alarms().count() > 0 ) { 213 if ( i1.alarms().count() > 0 ) {
212 if ( !( *(i1.alarms().first()) == *(i2.alarms().first())) ) 214 if ( !( *(i1.alarms().first()) == *(i2.alarms().first())) )
213 { 215 {
214 qDebug("alarm not equal "); 216 qDebug("alarm not equal ");
215 return false; 217 return false;
216 } 218 }
217 } 219 }
218#if 0 220#if 0
219 QPtrListIterator<Alarm> a1( i1.alarms() ); 221 Q3PtrListIterator<Alarm> a1( i1.alarms() );
220 QPtrListIterator<Alarm> a2( i2.alarms() ); 222 Q3PtrListIterator<Alarm> a2( i2.alarms() );
221 for( ; a1.current() && a2.current(); ++a1, ++a2 ) { 223 for( ; a1.current() && a2.current(); ++a1, ++a2 ) {
222 if( *a1.current() == *a2.current() ) { 224 if( *a1.current() == *a2.current() ) {
223 continue; 225 continue;
224 } 226 }
225 else { 227 else {
226 return false; 228 return false;
227 } 229 }
228 } 230 }
229#endif 231#endif
230 232
231 if ( i1.hasRecurrenceID() == i2.hasRecurrenceID() ) { 233 if ( i1.hasRecurrenceID() == i2.hasRecurrenceID() ) {
232 if ( i1.hasRecurrenceID() ) { 234 if ( i1.hasRecurrenceID() ) {
@@ -313,25 +315,25 @@ void Incidence::recreate()
313 315
314 setUid(CalFormat::createUniqueId()); 316 setUid(CalFormat::createUniqueId());
315 317
316 setRevision(0); 318 setRevision(0);
317 setIDStr( ":" ); 319 setIDStr( ":" );
318 setLastModified(QDateTime::currentDateTime()); 320 setLastModified(QDateTime::currentDateTime());
319} 321}
320void Incidence::cloneRelations( Incidence * newInc ) 322void Incidence::cloneRelations( Incidence * newInc )
321{ 323{
322 // newInc is already a clone of this incidence 324 // newInc is already a clone of this incidence
323 Incidence * inc; 325 Incidence * inc;
324 Incidence * cloneInc; 326 Incidence * cloneInc;
325 QPtrList<Incidence> Relations = relations(); 327 Q3PtrList<Incidence> Relations = relations();
326 for (inc=Relations.first();inc;inc=Relations.next()) { 328 for (inc=Relations.first();inc;inc=Relations.next()) {
327 cloneInc = inc->clone(); 329 cloneInc = inc->clone();
328 cloneInc->recreate(); 330 cloneInc->recreate();
329 cloneInc->setRelatedTo( newInc ); 331 cloneInc->setRelatedTo( newInc );
330 inc->cloneRelations( cloneInc ); 332 inc->cloneRelations( cloneInc );
331 } 333 }
332} 334}
333void Incidence::setReadOnly( bool readOnly ) 335void Incidence::setReadOnly( bool readOnly )
334{ 336{
335 IncidenceBase::setReadOnly( readOnly ); 337 IncidenceBase::setReadOnly( readOnly );
336 if ( mRecurrence ) 338 if ( mRecurrence )
337 mRecurrence->setRecurReadOnly( readOnly); 339 mRecurrence->setRecurReadOnly( readOnly);
@@ -347,25 +349,25 @@ QString Incidence::lastModifiedSubSortKey() const
347 if ( mLastModifiedSubSortKey.isEmpty() ) 349 if ( mLastModifiedSubSortKey.isEmpty() )
348 return lastModifiedSortKey(); 350 return lastModifiedSortKey();
349 return mLastModifiedSubSortKey; 351 return mLastModifiedSubSortKey;
350} 352}
351QDateTime Incidence::lastModifiedSub() 353QDateTime Incidence::lastModifiedSub()
352{ 354{
353 if ( !mRelations.count() ) 355 if ( !mRelations.count() )
354 return lastModified(); 356 return lastModified();
355 if ( mLastModifiedSub.isValid() ) 357 if ( mLastModifiedSub.isValid() )
356 return mLastModifiedSub; 358 return mLastModifiedSub;
357 mLastModifiedSub = lastModified(); 359 mLastModifiedSub = lastModified();
358 Incidence * inc; 360 Incidence * inc;
359 QPtrList<Incidence> Relations = relations(); 361 Q3PtrList<Incidence> Relations = relations();
360 for (inc=Relations.first();inc;inc=Relations.next()) { 362 for (inc=Relations.first();inc;inc=Relations.next()) {
361 if ( inc->lastModifiedSub() > mLastModifiedSub ) 363 if ( inc->lastModifiedSub() > mLastModifiedSub )
362 mLastModifiedSub = inc->lastModifiedSub(); 364 mLastModifiedSub = inc->lastModifiedSub();
363 } 365 }
364 mLastModifiedSubSortKey.sprintf("%04d%02d%02d%02d%02d%02d", 366 mLastModifiedSubSortKey.sprintf("%04d%02d%02d%02d%02d%02d",
365 mLastModifiedSub.date().year(), 367 mLastModifiedSub.date().year(),
366 mLastModifiedSub.date().month(), 368 mLastModifiedSub.date().month(),
367 mLastModifiedSub.date().day(), 369 mLastModifiedSub.date().day(),
368 mLastModifiedSub.time().hour(), 370 mLastModifiedSub.time().hour(),
369 mLastModifiedSub.time().minute(), 371 mLastModifiedSub.time().minute(),
370 mLastModifiedSub.time().second() ); 372 mLastModifiedSub.time().second() );
371 return mLastModifiedSub; 373 return mLastModifiedSub;
@@ -438,40 +440,40 @@ void Incidence::checkCategories()
438void Incidence::addCategories(const QStringList &categories, bool addToRelations ) //addToRelations = false 440void Incidence::addCategories(const QStringList &categories, bool addToRelations ) //addToRelations = false
439{ 441{
440 if (mReadOnly) return; 442 if (mReadOnly) return;
441 int i; 443 int i;
442 for( i = 0; i < categories.count(); ++i ) { 444 for( i = 0; i < categories.count(); ++i ) {
443 if ( !mCategories.contains (categories[i])) 445 if ( !mCategories.contains (categories[i]))
444 mCategories.append( categories[i] ); 446 mCategories.append( categories[i] );
445 } 447 }
446 checkCategories(); 448 checkCategories();
447 updated(); 449 updated();
448 if ( addToRelations ) { 450 if ( addToRelations ) {
449 Incidence * inc; 451 Incidence * inc;
450 QPtrList<Incidence> Relations = relations(); 452 Q3PtrList<Incidence> Relations = relations();
451 for (inc=Relations.first();inc;inc=Relations.next()) { 453 for (inc=Relations.first();inc;inc=Relations.next()) {
452 inc->addCategories( categories, true ); 454 inc->addCategories( categories, true );
453 } 455 }
454 } 456 }
455} 457}
456 458
457void Incidence::setCategories(const QStringList &categories, bool setForRelations ) //setForRelations = false 459void Incidence::setCategories(const QStringList &categories, bool setForRelations ) //setForRelations = false
458{ 460{
459 if (mReadOnly) return; 461 if (mReadOnly) return;
460 mCategories = categories; 462 mCategories = categories;
461 checkCategories(); 463 checkCategories();
462 updated(); 464 updated();
463 if ( setForRelations ) { 465 if ( setForRelations ) {
464 Incidence * inc; 466 Incidence * inc;
465 QPtrList<Incidence> Relations = relations(); 467 Q3PtrList<Incidence> Relations = relations();
466 for (inc=Relations.first();inc;inc=Relations.next()) { 468 for (inc=Relations.first();inc;inc=Relations.next()) {
467 inc->setCategories( categories, true ); 469 inc->setCategories( categories, true );
468 } 470 }
469 } 471 }
470} 472}
471 473
472// TODO: remove setCategories(QString) function 474// TODO: remove setCategories(QString) function
473void Incidence::setCategories(const QString &catStr) 475void Incidence::setCategories(const QString &catStr)
474{ 476{
475 if (mReadOnly) return; 477 if (mReadOnly) return;
476 mCategories.clear(); 478 mCategories.clear();
477 479
@@ -541,33 +543,33 @@ void Incidence::setRelatedTo(Incidence *relatedTo)
541 mRelatedTo->addRelation(this); 543 mRelatedTo->addRelation(this);
542 mRelatedToUid = mRelatedTo->uid(); 544 mRelatedToUid = mRelatedTo->uid();
543 } else { 545 } else {
544 mRelatedToUid = ""; 546 mRelatedToUid = "";
545 } 547 }
546} 548}
547 549
548Incidence *Incidence::relatedTo() const 550Incidence *Incidence::relatedTo() const
549{ 551{
550 return mRelatedTo; 552 return mRelatedTo;
551} 553}
552 554
553QPtrList<Incidence> Incidence::relations() const 555Q3PtrList<Incidence> Incidence::relations() const
554{ 556{
555 return mRelations; 557 return mRelations;
556} 558}
557 559
558void Incidence::addRelationsToList(QPtrList<Incidence> *rel) 560void Incidence::addRelationsToList(Q3PtrList<Incidence> *rel)
559{ 561{
560 Incidence* inc; 562 Incidence* inc;
561 QPtrList<Incidence> Relations = relations(); 563 Q3PtrList<Incidence> Relations = relations();
562 for (inc=Relations.first();inc;inc=Relations.next()) { 564 for (inc=Relations.first();inc;inc=Relations.next()) {
563 inc->addRelationsToList( rel ); 565 inc->addRelationsToList( rel );
564 } 566 }
565 if ( rel->findRef( this ) == -1 ) 567 if ( rel->findRef( this ) == -1 )
566 rel->append( this ); 568 rel->append( this );
567} 569}
568 570
569void Incidence::addRelation(Incidence *event) 571void Incidence::addRelation(Incidence *event)
570{ 572{
571 setLastModifiedSubInvalid(); 573 setLastModifiedSubInvalid();
572 if( mRelations.findRef( event ) == -1 ) { 574 if( mRelations.findRef( event ) == -1 ) {
573 mRelations.append(event); 575 mRelations.append(event);
@@ -638,33 +640,33 @@ void Incidence::deleteAttachment(Attachment *attachment)
638 640
639void Incidence::deleteAttachments(const QString& mime) 641void Incidence::deleteAttachments(const QString& mime)
640{ 642{
641 Attachment *at = mAttachments.first(); 643 Attachment *at = mAttachments.first();
642 while (at) { 644 while (at) {
643 if (at->mimeType() == mime) 645 if (at->mimeType() == mime)
644 mAttachments.remove(); 646 mAttachments.remove();
645 else 647 else
646 at = mAttachments.next(); 648 at = mAttachments.next();
647 } 649 }
648} 650}
649 651
650QPtrList<Attachment> Incidence::attachments() const 652Q3PtrList<Attachment> Incidence::attachments() const
651{ 653{
652 return mAttachments; 654 return mAttachments;
653} 655}
654 656
655QPtrList<Attachment> Incidence::attachments(const QString& mime) const 657Q3PtrList<Attachment> Incidence::attachments(const QString& mime) const
656{ 658{
657 QPtrList<Attachment> attachments; 659 Q3PtrList<Attachment> attachments;
658 QPtrListIterator<Attachment> it( mAttachments ); 660 Q3PtrListIterator<Attachment> it( mAttachments );
659 Attachment *at; 661 Attachment *at;
660 while ( (at = it.current()) ) { 662 while ( (at = it.current()) ) {
661 if (at->mimeType() == mime) 663 if (at->mimeType() == mime)
662 attachments.append(at); 664 attachments.append(at);
663 ++it; 665 ++it;
664 } 666 }
665 667
666 return attachments; 668 return attachments;
667} 669}
668 670
669void Incidence::setResources(const QStringList &resources) 671void Incidence::setResources(const QStringList &resources)
670{ 672{
@@ -728,25 +730,25 @@ QString Incidence::secrecyName(int secrecy)
728 730
729QStringList Incidence::secrecyList() 731QStringList Incidence::secrecyList()
730{ 732{
731 QStringList list; 733 QStringList list;
732 list << secrecyName(SecrecyPublic); 734 list << secrecyName(SecrecyPublic);
733 list << secrecyName(SecrecyPrivate); 735 list << secrecyName(SecrecyPrivate);
734 list << secrecyName(SecrecyConfidential); 736 list << secrecyName(SecrecyConfidential);
735 737
736 return list; 738 return list;
737} 739}
738 740
739 741
740QPtrList<Alarm> Incidence::alarms() const 742Q3PtrList<Alarm> Incidence::alarms() const
741{ 743{
742 return mAlarms; 744 return mAlarms;
743} 745}
744 746
745Alarm* Incidence::newAlarm() 747Alarm* Incidence::newAlarm()
746{ 748{
747 Alarm* alarm = new Alarm(this); 749 Alarm* alarm = new Alarm(this);
748 mAlarms.append(alarm); 750 mAlarms.append(alarm);
749// updated(); 751// updated();
750 return alarm; 752 return alarm;
751} 753}
752 754
@@ -762,25 +764,25 @@ void Incidence::removeAlarm(Alarm *alarm)
762 updated(); 764 updated();
763} 765}
764 766
765void Incidence::clearAlarms() 767void Incidence::clearAlarms()
766{ 768{
767 mAlarms.clear(); 769 mAlarms.clear();
768 updated(); 770 updated();
769} 771}
770 772
771bool Incidence::isAlarmEnabled() const 773bool Incidence::isAlarmEnabled() const
772{ 774{
773 Alarm* alarm; 775 Alarm* alarm;
774 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { 776 for (Q3PtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) {
775 if (alarm->enabled()) 777 if (alarm->enabled())
776 return true; 778 return true;
777 } 779 }
778 return false; 780 return false;
779} 781}
780#include <stdlib.h> 782#include <stdlib.h>
781Recurrence *Incidence::recurrence() 783Recurrence *Incidence::recurrence()
782{ 784{
783 if ( ! mRecurrence ) { 785 if ( ! mRecurrence ) {
784 mRecurrence = new Recurrence(this); 786 mRecurrence = new Recurrence(this);
785 mRecurrence->setRecurStart( dtStart() ); 787 mRecurrence->setRecurStart( dtStart() );
786 mRecurrence->setRecurReadOnly( isReadOnly()); 788 mRecurrence->setRecurReadOnly( isReadOnly());
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index f89942f..2940129 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -16,25 +16,27 @@
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef INCIDENCE_H 20#ifndef INCIDENCE_H
21#define INCIDENCE_H 21#define INCIDENCE_H
22// 22//
23// Incidence - base class of calendaring components 23// Incidence - base class of calendaring components
24// 24//
25 25
26#include <qdatetime.h> 26#include <qdatetime.h>
27#include <qstringlist.h> 27#include <qstringlist.h>
28#include <qvaluelist.h> 28#include <q3valuelist.h>
29//Added by qt3to4:
30#include <Q3PtrList>
29 31
30#include "recurrence.h" 32#include "recurrence.h"
31#include "alarm.h" 33#include "alarm.h"
32#include "attachment.h" 34#include "attachment.h"
33#include "listbase.h" 35#include "listbase.h"
34#include "incidencebase.h" 36#include "incidencebase.h"
35 37
36namespace KCal { 38namespace KCal {
37 39
38class Event; 40class Event;
39class Todo; 41class Todo;
40class Journal; 42class Journal;
@@ -104,25 +106,25 @@ class Incidence : public IncidenceBase
104 106
105 /** 107 /**
106 Accept IncidenceVisitor. A class taking part in the visitor mechanism has to 108 Accept IncidenceVisitor. A class taking part in the visitor mechanism has to
107 provide this implementation: 109 provide this implementation:
108 <pre> 110 <pre>
109 bool accept(Visitor &v) { return v.visit(this); } 111 bool accept(Visitor &v) { return v.visit(this); }
110 </pre> 112 </pre>
111 */ 113 */
112 virtual bool accept(Visitor &) { return false; } 114 virtual bool accept(Visitor &) { return false; }
113 115
114 virtual Incidence *clone() = 0; 116 virtual Incidence *clone() = 0;
115 virtual void cloneRelations( Incidence * ); 117 virtual void cloneRelations( Incidence * );
116 void addRelationsToList(QPtrList<Incidence> *rel); 118 void addRelationsToList(Q3PtrList<Incidence> *rel);
117 void clearRelations(); 119 void clearRelations();
118 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; 120 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0;
119 void setReadOnly( bool ); 121 void setReadOnly( bool );
120 122
121 /** 123 /**
122 Recreate event. The event is made a new unique event, but already stored 124 Recreate event. The event is made a new unique event, but already stored
123 event information is preserved. Sets uniquie id, creation date, last 125 event information is preserved. Sets uniquie id, creation date, last
124 modification date and revision number. 126 modification date and revision number.
125 */ 127 */
126 void recreate(); 128 void recreate();
127 Incidence* recreateCloneException(QDate); 129 Incidence* recreateCloneException(QDate);
128 130
@@ -168,52 +170,52 @@ class Incidence : public IncidenceBase
168 * exists. */ 170 * exists. */
169 void setRelatedToUid(const QString &); 171 void setRelatedToUid(const QString &);
170 /** what event does this one relate to? This function should 172 /** what event does this one relate to? This function should
171 * only be used when constructing a calendar before the related Event 173 * only be used when constructing a calendar before the related Event
172 * exists. */ 174 * exists. */
173 QString relatedToUid() const; 175 QString relatedToUid() const;
174 /** point at some other event to which the event relates */ 176 /** point at some other event to which the event relates */
175 void setRelatedTo(Incidence *relatedTo); 177 void setRelatedTo(Incidence *relatedTo);
176 void resetRelatedTo(); 178 void resetRelatedTo();
177 /** what event does this one relate to? */ 179 /** what event does this one relate to? */
178 Incidence *relatedTo() const; 180 Incidence *relatedTo() const;
179 /** All events that are related to this event */ 181 /** All events that are related to this event */
180 QPtrList<Incidence> relations() const; 182 Q3PtrList<Incidence> relations() const;
181 /** Add an event which is related to this event */ 183 /** Add an event which is related to this event */
182 void addRelation(Incidence *); 184 void addRelation(Incidence *);
183 /** Remove event that is related to this event */ 185 /** Remove event that is related to this event */
184 void removeRelation(Incidence *); 186 void removeRelation(Incidence *);
185 187
186 /** returns the list of dates which are exceptions to the recurrence rule */ 188 /** returns the list of dates which are exceptions to the recurrence rule */
187 DateList exDates() const; 189 DateList exDates() const;
188 /** sets the list of dates which are exceptions to the recurrence rule */ 190 /** sets the list of dates which are exceptions to the recurrence rule */
189 void setExDates(const DateList &_exDates); 191 void setExDates(const DateList &_exDates);
190 void setExDates(const char *dates); 192 void setExDates(const char *dates);
191 /** Add a date to the list of exceptions of the recurrence rule. */ 193 /** Add a date to the list of exceptions of the recurrence rule. */
192 void addExDate(const QDate &date); 194 void addExDate(const QDate &date);
193 195
194 /** returns true if there is an exception for this date in the recurrence 196 /** returns true if there is an exception for this date in the recurrence
195 rule set, or false otherwise. */ 197 rule set, or false otherwise. */
196 bool isException(const QDate &qd) const; 198 bool isException(const QDate &qd) const;
197 199
198 /** add attachment to this event */ 200 /** add attachment to this event */
199 void addAttachment(Attachment *attachment); 201 void addAttachment(Attachment *attachment);
200 /** remove and delete a specific attachment */ 202 /** remove and delete a specific attachment */
201 void deleteAttachment(Attachment *attachment); 203 void deleteAttachment(Attachment *attachment);
202 /** remove and delete all attachments with this mime type */ 204 /** remove and delete all attachments with this mime type */
203 void deleteAttachments(const QString& mime); 205 void deleteAttachments(const QString& mime);
204 /** return list of all associated attachments */ 206 /** return list of all associated attachments */
205 QPtrList<Attachment> attachments() const; 207 Q3PtrList<Attachment> attachments() const;
206 /** find a list of attachments with this mime type */ 208 /** find a list of attachments with this mime type */
207 QPtrList<Attachment> attachments(const QString& mime) const; 209 Q3PtrList<Attachment> attachments(const QString& mime) const;
208 210
209 /** sets the event's status the value specified. See the enumeration 211 /** sets the event's status the value specified. See the enumeration
210 * above for possible values. */ 212 * above for possible values. */
211 void setSecrecy(int); 213 void setSecrecy(int);
212 /** return the event's secrecy. */ 214 /** return the event's secrecy. */
213 int secrecy() const; 215 int secrecy() const;
214 /** return the event's secrecy in string format. */ 216 /** return the event's secrecy in string format. */
215 QString secrecyStr() const; 217 QString secrecyStr() const;
216 /** return list of all availbale secrecy classes */ 218 /** return list of all availbale secrecy classes */
217 static QStringList secrecyList(); 219 static QStringList secrecyList();
218 /** return human-readable name of secrecy class */ 220 /** return human-readable name of secrecy class */
219 static QString secrecyName(int); 221 static QString secrecyName(int);
@@ -226,25 +228,25 @@ class Incidence : public IncidenceBase
226 228
227 /** set resources used, such as Office, Car, etc. */ 229 /** set resources used, such as Office, Car, etc. */
228 void setResources(const QStringList &resources); 230 void setResources(const QStringList &resources);
229 /** return list of current resources */ 231 /** return list of current resources */
230 QStringList resources() const; 232 QStringList resources() const;
231 233
232 /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */ 234 /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */
233 void setPriority(int priority); 235 void setPriority(int priority);
234 /** get the event's priority */ 236 /** get the event's priority */
235 int priority() const; 237 int priority() const;
236 238
237 /** All alarms that are associated with this incidence */ 239 /** All alarms that are associated with this incidence */
238 QPtrList<Alarm> alarms() const; 240 Q3PtrList<Alarm> alarms() const;
239 /** Create a new alarm which is associated with this incidence */ 241 /** Create a new alarm which is associated with this incidence */
240 Alarm* newAlarm(); 242 Alarm* newAlarm();
241 /** Add an alarm which is associated with this incidence */ 243 /** Add an alarm which is associated with this incidence */
242 void addAlarm(Alarm*); 244 void addAlarm(Alarm*);
243 /** Remove an alarm that is associated with this incidence */ 245 /** Remove an alarm that is associated with this incidence */
244 void removeAlarm(Alarm*); 246 void removeAlarm(Alarm*);
245 /** Remove all alarms that are associated with this incidence */ 247 /** Remove all alarms that are associated with this incidence */
246 void clearAlarms(); 248 void clearAlarms();
247 /** return whether any alarm associated with this incidence is enabled */ 249 /** return whether any alarm associated with this incidence is enabled */
248 bool isAlarmEnabled() const; 250 bool isAlarmEnabled() const;
249 251
250 /** 252 /**
@@ -279,45 +281,45 @@ class Incidence : public IncidenceBase
279 bool isHoliday() const; 281 bool isHoliday() const;
280 bool isBirthday() const; 282 bool isBirthday() const;
281 bool isAnniversary() const; 283 bool isAnniversary() const;
282 QDateTime lastModifiedSub(); 284 QDateTime lastModifiedSub();
283 QString lastModifiedSubSortKey() const; 285 QString lastModifiedSubSortKey() const;
284 QString recurrenceText() const; 286 QString recurrenceText() const;
285 void setLastModifiedSubInvalid(); 287 void setLastModifiedSubInvalid();
286 288
287 virtual QString durationText(); 289 virtual QString durationText();
288 QString durationText4Time( int secs ); 290 QString durationText4Time( int secs );
289 Recurrence *mRecurrence; 291 Recurrence *mRecurrence;
290protected: 292protected:
291 QPtrList<Alarm> mAlarms; 293 Q3PtrList<Alarm> mAlarms;
292 QPtrList<Incidence> mRelations; 294 Q3PtrList<Incidence> mRelations;
293 QDateTime mRecurrenceID; 295 QDateTime mRecurrenceID;
294 bool mHasRecurrenceID; 296 bool mHasRecurrenceID;
295 private: 297 private:
296 void checkCategories(); 298 void checkCategories();
297 QString mLastModifiedSubSortKey; 299 QString mLastModifiedSubSortKey;
298 bool mHoliday, mBirthday, mAnniversary; 300 bool mHoliday, mBirthday, mAnniversary;
299 int mRevision; 301 int mRevision;
300 bool mCancelled; 302 bool mCancelled;
301 303
302 // base components of jounal, event and todo 304 // base components of jounal, event and todo
303 QDateTime mCreated; 305 QDateTime mCreated;
304 QDateTime mLastModifiedSub; 306 QDateTime mLastModifiedSub;
305 QString mDescription; 307 QString mDescription;
306 QString mSummary; 308 QString mSummary;
307 QStringList mCategories; 309 QStringList mCategories;
308 Incidence *mRelatedTo; 310 Incidence *mRelatedTo;
309 QString mRelatedToUid; 311 QString mRelatedToUid;
310 DateList mExDates; 312 DateList mExDates;
311 QPtrList<Attachment> mAttachments; 313 Q3PtrList<Attachment> mAttachments;
312 QStringList mResources; 314 QStringList mResources;
313 bool mHasStartDate; // if todo has associated start date 315 bool mHasStartDate; // if todo has associated start date
314 316
315 int mSecrecy; 317 int mSecrecy;
316 int mPriority; // 1 = highest, 2 = less, etc. 318 int mPriority; // 1 = highest, 2 = less, etc.
317 319
318 //QPtrList<Alarm> mAlarms; 320 //QPtrList<Alarm> mAlarms;
319 321
320 QString mLocation; 322 QString mLocation;
321}; 323};
322 324
323bool operator==( const Incidence&, const Incidence& ); 325bool operator==( const Incidence&, const Incidence& );
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index 56c0560..f11ec54 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -18,24 +18,26 @@
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <kglobal.h> 21#include <kglobal.h>
22#include <klocale.h> 22#include <klocale.h>
23#include <kdebug.h> 23#include <kdebug.h>
24#include <kidmanager.h> 24#include <kidmanager.h>
25 25
26#include "calformat.h" 26#include "calformat.h"
27#include "syncdefines.h" 27#include "syncdefines.h"
28 28
29#include "incidencebase.h" 29#include "incidencebase.h"
30//Added by qt3to4:
31#include <Q3PtrList>
30 32
31using namespace KCal; 33using namespace KCal;
32 34
33IncidenceBase::IncidenceBase() : 35IncidenceBase::IncidenceBase() :
34 mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false), 36 mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false),
35 mPilotId(0), mSyncStatus(SYNCMOD) 37 mPilotId(0), mSyncStatus(SYNCMOD)
36{ 38{
37 blockLastModified = false; 39 blockLastModified = false;
38 setUid(CalFormat::createUniqueId()); 40 setUid(CalFormat::createUniqueId());
39 mOrganizer = ""; 41 mOrganizer = "";
40 mFloats = false; 42 mFloats = false;
41 mDuration = 0; 43 mDuration = 0;
@@ -55,25 +57,25 @@ IncidenceBase::IncidenceBase(const IncidenceBase &i) :
55{ 57{
56 58
57 blockLastModified = false; 59 blockLastModified = false;
58 mReadOnly = i.mReadOnly; 60 mReadOnly = i.mReadOnly;
59 mDtStart = i.mDtStart; 61 mDtStart = i.mDtStart;
60 mDuration = i.mDuration; 62 mDuration = i.mDuration;
61 mHasDuration = i.mHasDuration; 63 mHasDuration = i.mHasDuration;
62 mOrganizer = i.mOrganizer; 64 mOrganizer = i.mOrganizer;
63 mUid = i.mUid; 65 mUid = i.mUid;
64 mCalEnabled = i.mCalEnabled; 66 mCalEnabled = i.mCalEnabled;
65 mAlarmEnabled = i.mAlarmEnabled; 67 mAlarmEnabled = i.mAlarmEnabled;
66 mCalID = i.mCalID; 68 mCalID = i.mCalID;
67 QPtrList<Attendee> attendees = i.attendees(); 69 Q3PtrList<Attendee> attendees = i.attendees();
68 for( Attendee *a = attendees.first(); a; a = attendees.next() ) { 70 for( Attendee *a = attendees.first(); a; a = attendees.next() ) {
69 mAttendees.append( new Attendee( *a ) ); 71 mAttendees.append( new Attendee( *a ) );
70 } 72 }
71 mFloats = i.mFloats; 73 mFloats = i.mFloats;
72 mLastModified = i.mLastModified; 74 mLastModified = i.mLastModified;
73 mPilotId = i.mPilotId; 75 mPilotId = i.mPilotId;
74 mTempSyncStat = i.mTempSyncStat; 76 mTempSyncStat = i.mTempSyncStat;
75 mSyncStatus = i.mSyncStatus; 77 mSyncStatus = i.mSyncStatus;
76 mExternalId = i.mExternalId; 78 mExternalId = i.mExternalId;
77 // The copied object is a new one, so it isn't observed by the observer 79 // The copied object is a new one, so it isn't observed by the observer
78 // of the original object. 80 // of the original object.
79 mObservers.clear(); 81 mObservers.clear();
@@ -291,25 +293,25 @@ void IncidenceBase::setFloats(bool f)
291 if (mReadOnly) return; 293 if (mReadOnly) return;
292 mFloats = f; 294 mFloats = f;
293 updated(); 295 updated();
294} 296}
295 297
296 298
297bool IncidenceBase::addAttendee(Attendee *a, bool doupdate) 299bool IncidenceBase::addAttendee(Attendee *a, bool doupdate)
298{ 300{
299 if (mReadOnly) return false; 301 if (mReadOnly) return false;
300 if (a->name().left(7).upper() == "MAILTO:") 302 if (a->name().left(7).upper() == "MAILTO:")
301 a->setName(a->name().remove(0,7)); 303 a->setName(a->name().remove(0,7));
302 304
303 QPtrListIterator<Attendee> qli(mAttendees); 305 Q3PtrListIterator<Attendee> qli(mAttendees);
304 306
305 qli.toFirst(); 307 qli.toFirst();
306 while (qli) { 308 while (qli) {
307 if (*qli.current() == *a) 309 if (*qli.current() == *a)
308 return false; 310 return false;
309 ++qli; 311 ++qli;
310 } 312 }
311 mAttendees.append(a); 313 mAttendees.append(a);
312 if (doupdate) updated(); 314 if (doupdate) updated();
313 return true; 315 return true;
314} 316}
315 317
@@ -334,52 +336,52 @@ void IncidenceBase::removeAttendee(const char *n)
334} 336}
335#endif 337#endif
336 338
337void IncidenceBase::clearAttendees() 339void IncidenceBase::clearAttendees()
338{ 340{
339 if (mReadOnly) return; 341 if (mReadOnly) return;
340 mAttendees.clear(); 342 mAttendees.clear();
341} 343}
342 344
343#if 0 345#if 0
344Attendee *IncidenceBase::getAttendee(const char *n) const 346Attendee *IncidenceBase::getAttendee(const char *n) const
345{ 347{
346 QPtrListIterator<Attendee> qli(mAttendees); 348 Q3PtrListIterator<Attendee> qli(mAttendees);
347 349
348 qli.toFirst(); 350 qli.toFirst();
349 while (qli) { 351 while (qli) {
350 if (qli.current()->getName() == n) 352 if (qli.current()->getName() == n)
351 return qli.current(); 353 return qli.current();
352 ++qli; 354 ++qli;
353 } 355 }
354 return 0L; 356 return 0L;
355} 357}
356#endif 358#endif
357 359
358Attendee *IncidenceBase::attendeeByMail(const QString &email) 360Attendee *IncidenceBase::attendeeByMail(const QString &email)
359{ 361{
360 QPtrListIterator<Attendee> qli(mAttendees); 362 Q3PtrListIterator<Attendee> qli(mAttendees);
361 363
362 qli.toFirst(); 364 qli.toFirst();
363 while (qli) { 365 while (qli) {
364 if (qli.current()->email().lower() == email.lower()) 366 if (qli.current()->email().lower() == email.lower())
365 return qli.current(); 367 return qli.current();
366 ++qli; 368 ++qli;
367 } 369 }
368 return 0L; 370 return 0L;
369} 371}
370 372
371Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email) 373Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email)
372{ 374{
373 QPtrListIterator<Attendee> qli(mAttendees); 375 Q3PtrListIterator<Attendee> qli(mAttendees);
374 376
375 QStringList mails = emails; 377 QStringList mails = emails;
376 if (!email.isEmpty()) { 378 if (!email.isEmpty()) {
377 mails.append(email); 379 mails.append(email);
378 } 380 }
379 qli.toFirst(); 381 qli.toFirst();
380 while (qli) { 382 while (qli) {
381 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) { 383 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) {
382 if (qli.current()->email().lower() == (*it).lower()) 384 if (qli.current()->email().lower() == (*it).lower())
383 return qli.current(); 385 return qli.current();
384 } 386 }
385 387
@@ -482,19 +484,19 @@ QString IncidenceBase::IDStr() const
482void IncidenceBase::registerObserver( IncidenceBase::Observer *observer ) 484void IncidenceBase::registerObserver( IncidenceBase::Observer *observer )
483{ 485{
484 if( !mObservers.contains(observer) ) mObservers.append( observer ); 486 if( !mObservers.contains(observer) ) mObservers.append( observer );
485} 487}
486 488
487void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer ) 489void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer )
488{ 490{
489 mObservers.remove( observer ); 491 mObservers.remove( observer );
490} 492}
491 493
492void IncidenceBase::updated() 494void IncidenceBase::updated()
493{ 495{
494 QPtrListIterator<Observer> it(mObservers); 496 Q3PtrListIterator<Observer> it(mObservers);
495 while( it.current() ) { 497 while( it.current() ) {
496 Observer *o = it.current(); 498 Observer *o = it.current();
497 ++it; 499 ++it;
498 o->incidenceUpdated( this ); 500 o->incidenceUpdated( this );
499 } 501 }
500} 502}
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h
index 3edc03b..d97f524 100644
--- a/libkcal/incidencebase.h
+++ b/libkcal/incidencebase.h
@@ -16,51 +16,53 @@
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef KCAL_INCIDENCEBASE_H 20#ifndef KCAL_INCIDENCEBASE_H
21#define KCAL_INCIDENCEBASE_H 21#define KCAL_INCIDENCEBASE_H
22// 22//
23// Incidence - base class of calendaring components 23// Incidence - base class of calendaring components
24// 24//
25 25
26#include <qdatetime.h> 26#include <qdatetime.h>
27#include <qstringlist.h> 27#include <qstringlist.h>
28#include <qvaluelist.h> 28#include <q3valuelist.h>
29#include <qptrlist.h> 29#include <q3ptrlist.h>
30//Added by qt3to4:
31#include <Q3CString>
30 32
31#include "customproperties.h" 33#include "customproperties.h"
32#include "attendee.h" 34#include "attendee.h"
33 35
34namespace KCal { 36namespace KCal {
35 37
36typedef QValueList<QDate> DateList; 38typedef Q3ValueList<QDate> DateList;
37 enum IncTypeID { eventID,todoID,journalID,freebusyID }; 39 enum IncTypeID { eventID,todoID,journalID,freebusyID };
38 40
39/** 41/**
40 This class provides the base class common to all calendar components. 42 This class provides the base class common to all calendar components.
41*/ 43*/
42class IncidenceBase : public CustomProperties 44class IncidenceBase : public CustomProperties
43{ 45{
44 public: 46 public:
45 class Observer { 47 class Observer {
46 public: 48 public:
47 virtual void incidenceUpdated( IncidenceBase * ) = 0; 49 virtual void incidenceUpdated( IncidenceBase * ) = 0;
48 }; 50 };
49 51
50 IncidenceBase(); 52 IncidenceBase();
51 IncidenceBase(const IncidenceBase &); 53 IncidenceBase(const IncidenceBase &);
52 virtual ~IncidenceBase(); 54 virtual ~IncidenceBase();
53 55
54 virtual QCString type() const = 0; 56 virtual Q3CString type() const = 0;
55 virtual IncTypeID typeID() const = 0; 57 virtual IncTypeID typeID() const = 0;
56 58
57 /** Set the unique id for the event */ 59 /** Set the unique id for the event */
58 void setUid(const QString &); 60 void setUid(const QString &);
59 /** Return the unique id for the event */ 61 /** Return the unique id for the event */
60 QString uid() const; 62 QString uid() const;
61 63
62 /** Sets the time the incidence was last modified. */ 64 /** Sets the time the incidence was last modified. */
63 void setLastModified(const QDateTime &lm); 65 void setLastModified(const QDateTime &lm);
64 /** Return the time the incidence was last modified. */ 66 /** Return the time the incidence was last modified. */
65 QDateTime lastModified() const; 67 QDateTime lastModified() const;
66 QString lastModifiedSortKey() const; 68 QString lastModifiedSortKey() const;
@@ -100,25 +102,25 @@ class IncidenceBase : public CustomProperties
100 void setFloats(bool f); 102 void setFloats(bool f);
101 103
102 /** 104 /**
103 Add Attendee to this incidence. IncidenceBase takes ownership of the 105 Add Attendee to this incidence. IncidenceBase takes ownership of the
104 Attendee object. 106 Attendee object.
105 */ 107 */
106 bool addAttendee(Attendee *a, bool doupdate=true ); 108 bool addAttendee(Attendee *a, bool doupdate=true );
107// void removeAttendee(Attendee *a); 109// void removeAttendee(Attendee *a);
108// void removeAttendee(const char *n); 110// void removeAttendee(const char *n);
109 /** Remove all Attendees. */ 111 /** Remove all Attendees. */
110 void clearAttendees(); 112 void clearAttendees();
111 /** Return list of attendees. */ 113 /** Return list of attendees. */
112 QPtrList<Attendee> attendees() const { return mAttendees; }; 114 Q3PtrList<Attendee> attendees() const { return mAttendees; };
113 /** Return number of attendees. */ 115 /** Return number of attendees. */
114 int attendeeCount() const { return mAttendees.count(); }; 116 int attendeeCount() const { return mAttendees.count(); };
115 /** Return the Attendee with this email */ 117 /** Return the Attendee with this email */
116 Attendee* attendeeByMail(const QString &); 118 Attendee* attendeeByMail(const QString &);
117 /** Return first Attendee with one of this emails */ 119 /** Return first Attendee with one of this emails */
118 Attendee* attendeeByMails(const QStringList &, const QString& email = QString::null); 120 Attendee* attendeeByMails(const QStringList &, const QString& email = QString::null);
119 121
120 /** pilot syncronization states */ 122 /** pilot syncronization states */
121 enum { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 }; 123 enum { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 };
122 /** Set synchronisation satus. */ 124 /** Set synchronisation satus. */
123 void setSyncStatus(int stat); 125 void setSyncStatus(int stat);
124 /** Return synchronisation status. */ 126 /** Return synchronisation status. */
@@ -159,32 +161,32 @@ class IncidenceBase : public CustomProperties
159 bool mReadOnly; 161 bool mReadOnly;
160 QDateTime getEvenTime( QDateTime ); 162 QDateTime getEvenTime( QDateTime );
161 163
162 private: 164 private:
163 // base components 165 // base components
164 QString mOrganizer; 166 QString mOrganizer;
165 QString mLastModifiedKey; 167 QString mLastModifiedKey;
166 QString mUid; 168 QString mUid;
167 int mCalID; 169 int mCalID;
168 bool mCalEnabled; 170 bool mCalEnabled;
169 bool mAlarmEnabled; 171 bool mAlarmEnabled;
170 QDateTime mLastModified; 172 QDateTime mLastModified;
171 QPtrList<Attendee> mAttendees; 173 Q3PtrList<Attendee> mAttendees;
172 174
173 bool mFloats; 175 bool mFloats;
174 176
175 int mDuration; 177 int mDuration;
176 bool mHasDuration; 178 bool mHasDuration;
177 QString mExternalId; 179 QString mExternalId;
178 int mTempSyncStat; 180 int mTempSyncStat;
179 181
180 // PILOT SYNCHRONIZATION STUFF 182 // PILOT SYNCHRONIZATION STUFF
181 int mPilotId; // unique id for pilot sync 183 int mPilotId; // unique id for pilot sync
182 int mSyncStatus; // status (for sync) 184 int mSyncStatus; // status (for sync)
183 185
184 QPtrList<Observer> mObservers; 186 Q3PtrList<Observer> mObservers;
185}; 187};
186 188
187bool operator==( const IncidenceBase&, const IncidenceBase& ); 189bool operator==( const IncidenceBase&, const IncidenceBase& );
188} 190}
189 191
190#endif 192#endif
diff --git a/libkcal/journal.h b/libkcal/journal.h
index 1cd0a22..c83356f 100644
--- a/libkcal/journal.h
+++ b/libkcal/journal.h
@@ -15,37 +15,39 @@
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef JOURNAL_H 20#ifndef JOURNAL_H
21#define JOURNAL_H 21#define JOURNAL_H
22// 22//
23// Journal component, representing a VJOURNAL object 23// Journal component, representing a VJOURNAL object
24// 24//
25 25
26#include "incidence.h" 26#include "incidence.h"
27//Added by qt3to4:
28#include <Q3CString>
27 29
28namespace KCal { 30namespace KCal {
29 31
30/** 32/**
31 This class provides a Journal in the sense of RFC2445. 33 This class provides a Journal in the sense of RFC2445.
32*/ 34*/
33class Journal : public Incidence 35class Journal : public Incidence
34{ 36{
35 public: 37 public:
36 Journal(); 38 Journal();
37 ~Journal(); 39 ~Journal();
38 40
39 QCString type() const { return "Journal"; } 41 Q3CString type() const { return "Journal"; }
40 IncTypeID typeID() const { return journalID; } 42 IncTypeID typeID() const { return journalID; }
41 43
42 Incidence *clone(); 44 Incidence *clone();
43 QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const; 45 QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const;
44private: 46private:
45 bool accept(Visitor &v) { return v.visit(this); } 47 bool accept(Visitor &v) { return v.visit(this); }
46}; 48};
47 49
48 bool operator==( const Journal&, const Journal& ); 50 bool operator==( const Journal&, const Journal& );
49} 51}
50 52
51#endif 53#endif
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 733b897..bce68b0 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -1,18 +1,20 @@
1#include "kincidenceformatter.h" 1#include "kincidenceformatter.h"
2#include <kstaticdeleter.h> 2#include <kstaticdeleter.h>
3#include <kglobal.h> 3#include <kglobal.h>
4#include <klocale.h> 4#include <klocale.h>
5#ifdef DEKTOP_VERSION 5#ifdef DEKTOP_VERSION
6#include <kabc/stdaddressbook.h> 6#include <kabc/stdaddressbook.h>
7//Added by qt3to4:
8#include <Q3PtrList>
7#define size count 9#define size count
8#endif 10#endif
9 11
10KIncidenceFormatter* KIncidenceFormatter::mInstance = 0; 12KIncidenceFormatter* KIncidenceFormatter::mInstance = 0;
11static KStaticDeleter<KIncidenceFormatter> insd; 13static KStaticDeleter<KIncidenceFormatter> insd;
12 14
13QString KIncidenceFormatter::getFormattedText( Incidence * inc, bool details, bool created , bool modified ) 15QString KIncidenceFormatter::getFormattedText( Incidence * inc, bool details, bool created , bool modified )
14{ 16{
15// #ifndef QT_NO_INPUTDIALOG 17// #ifndef QT_NO_INPUTDIALOG
16// return QInputDialog::getItem( caption, label, items, current, editable ); 18// return QInputDialog::getItem( caption, label, items, current, editable );
17// #else 19// #else
18// return QString::null; 20// return QString::null;
@@ -301,25 +303,25 @@ void KIncidenceFormatter::setJournal(Journal* )
301 303
302} 304}
303 305
304void KIncidenceFormatter::formatCategories(Incidence *event) 306void KIncidenceFormatter::formatCategories(Incidence *event)
305{ 307{
306 if (!event->categoriesStr().isEmpty()) { 308 if (!event->categoriesStr().isEmpty()) {
307 addTag("p",i18n("<b>Categories: </b>")+event->categoriesStrWithSpace() ); 309 addTag("p",i18n("<b>Categories: </b>")+event->categoriesStrWithSpace() );
308 //mText.append(event->categoriesStr()); 310 //mText.append(event->categoriesStr());
309 } 311 }
310} 312}
311void KIncidenceFormatter::addTag(const QString & tag,const QString & text) 313void KIncidenceFormatter::addTag(const QString & tag,const QString & text)
312{ 314{
313 int number=text.contains("\n"); 315 int number=text.count("\n");
314 QString str = "<" + tag + ">"; 316 QString str = "<" + tag + ">";
315 QString tmpText=text; 317 QString tmpText=text;
316 QString tmpStr=str; 318 QString tmpStr=str;
317 if(number !=-1) 319 if(number !=-1)
318 { 320 {
319 if (number > 0) { 321 if (number > 0) {
320 int pos=0; 322 int pos=0;
321 QString tmp; 323 QString tmp;
322 for(int i=0;i<=number;i++) { 324 for(int i=0;i<=number;i++) {
323 pos=tmpText.find("\n"); 325 pos=tmpText.find("\n");
324 tmp=tmpText.left(pos); 326 tmp=tmpText.left(pos);
325 tmpText=tmpText.right(tmpText.length()-pos-1); 327 tmpText=tmpText.right(tmpText.length()-pos-1);
@@ -330,48 +332,48 @@ void KIncidenceFormatter::addTag(const QString & tag,const QString & text)
330 tmpStr+="</" + tag + ">"; 332 tmpStr+="</" + tag + ">";
331 mText.append(tmpStr); 333 mText.append(tmpStr);
332 } 334 }
333 else 335 else
334 { 336 {
335 str += text + "</" + tag + ">"; 337 str += text + "</" + tag + ">";
336 mText.append(str); 338 mText.append(str);
337 } 339 }
338} 340}
339 341
340void KIncidenceFormatter::formatAttendees(Incidence *event) 342void KIncidenceFormatter::formatAttendees(Incidence *event)
341{ 343{
342 QPtrList<Attendee> attendees = event->attendees(); 344 Q3PtrList<Attendee> attendees = event->attendees();
343 if (attendees.count()) { 345 if (attendees.count()) {
344 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); 346 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
345 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); 347 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
346 addTag("h3",i18n("Organizer")); 348 addTag("h3",i18n("Organizer"));
347 mText.append("<ul><li>"); 349 mText.append("<ul><li>");
348#if 0 350#if 0
349 //ndef KORG_NOKABC 351 //ndef KORG_NOKABC
350 352
351 KABC::AddressBook *add_book = KABC::StdAddressBook::self(); 353 KABC::AddressBook *add_book = KABC::StdAddressBook::self();
352 KABC::Addressee::List addressList; 354 KABC::Addressee::List addressList;
353 addressList = add_book->findByEmail(event->organizer()); 355 addressList = add_book->findByEmail(event->organizer());
354 KABC::Addressee o = addressList.first(); 356 KABC::Addressee o = addressList.first();
355 if (!o.isEmpty() && addressList.size()<2) { 357 if (!o.isEmpty() && addressList.size()<2) {
356 mText += "<a href=\"uid:" + o.uid() + "\">"; 358 mText += "<a href=\"uid:" + o.uid() + "\">";
357 mText += o.formattedName(); 359 mText += o.formattedName();
358 mText += "</a>\n"; 360 mText += "</a>\n";
359 } else { 361 } else {
360 mText.append(event->organizer()); 362 mText.append(event->organizer());
361 } 363 }
362#else 364#else
363 mText.append(event->organizer()); 365 mText.append(event->organizer());
364#endif 366#endif
365 if (iconPath) { 367 if (!iconPath.isEmpty()) {
366 mText += " <a href=\"mailto:" + event->organizer() + "\">"; 368 mText += " <a href=\"mailto:" + event->organizer() + "\">";
367 mText += "<IMG src=\"" + iconPath + "\">"; 369 mText += "<IMG src=\"" + iconPath + "\">";
368 mText += "</a>\n"; 370 mText += "</a>\n";
369 } 371 }
370 mText.append("</li></ul>"); 372 mText.append("</li></ul>");
371 373
372 addTag("h3",i18n("Attendees")); 374 addTag("h3",i18n("Attendees"));
373 Attendee *a; 375 Attendee *a;
374 mText.append("<ul>"); 376 mText.append("<ul>");
375 for(a=attendees.first();a;a=attendees.next()) { 377 for(a=attendees.first();a;a=attendees.next()) {
376#if 0 378#if 0
377//ndef KORG_NOKABC 379//ndef KORG_NOKABC
@@ -393,25 +395,25 @@ void KIncidenceFormatter::formatAttendees(Incidence *event)
393 else mText += a->email(); 395 else mText += a->email();
394 mText += "</a>\n"; 396 mText += "</a>\n";
395 } 397 }
396#else 398#else
397 //qDebug("nokabc "); 399 //qDebug("nokabc ");
398 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 400 mText += "<li><a href=\"uid:" + a->uid() + "\">";
399 if (!a->name().isEmpty()) mText += a->name(); 401 if (!a->name().isEmpty()) mText += a->name();
400 else mText += a->email(); 402 else mText += a->email();
401 mText += "</a>\n"; 403 mText += "</a>\n";
402#endif 404#endif
403 405
404 if (!a->email().isEmpty()) { 406 if (!a->email().isEmpty()) {
405 if (iconPath) { 407 if (!iconPath.isEmpty()) {
406 mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">"; 408 mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">";
407 if ( a->RSVP() ) 409 if ( a->RSVP() )
408 mText += "<IMG src=\"" + iconPath + "\">"; 410 mText += "<IMG src=\"" + iconPath + "\">";
409 else 411 else
410 mText += "<IMG src=\"" + NOiconPath + "\">"; 412 mText += "<IMG src=\"" + NOiconPath + "\">";
411 mText += "</a>\n"; 413 mText += "</a>\n";
412 } 414 }
413 } 415 }
414 if (a->status() != Attendee::NeedsAction ) 416 if (a->status() != Attendee::NeedsAction )
415 mText +="[" + a->statusStr() + "] "; 417 mText +="[" + a->statusStr() + "] ";
416 if (a->role() == Attendee::Chair ) 418 if (a->role() == Attendee::Chair )
417 mText +="(" + a->roleStr().left(1) + ".)"; 419 mText +="(" + a->roleStr().left(1) + ".)";
diff --git a/libkcal/libkcal.pro b/libkcal/libkcal.pro
index 33c63c3..1f43b10 100644
--- a/libkcal/libkcal.pro
+++ b/libkcal/libkcal.pro
@@ -1,15 +1,15 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3 TARGET = microkcal 3 TARGET = xmicrokcal
4 4
5include( ../variables.pri ) 5include( ../variables.pri )
6 6
7INCLUDEPATH += ../libkdepim ../microkde versit ../microkde/kdecore 7INCLUDEPATH += ../libkdepim ../microkde versit ../microkde/kdecore
8#../qtcompat 8#../qtcompat
9INCLUDEPATH += ../libical/src/libical 9INCLUDEPATH += ../libical/src/libical
10INCLUDEPATH += ../libical/src/libicalss 10INCLUDEPATH += ../libical/src/libicalss
11DESTDIR = ../bin 11DESTDIR = ../bin
12DEFINES += DESKTOP_VERSION 12DEFINES += DESKTOP_VERSION
13unix: { 13unix: {
14LIBS += ../libical/lib/libical.a 14LIBS += ../libical/lib/libical.a
15LIBS += ../libical/lib/libicalss.a 15LIBS += ../libical/lib/libicalss.a
@@ -97,12 +97,16 @@ SOURCES = \
97 person.cpp \ 97 person.cpp \
98 qtopiaformat.cpp \ 98 qtopiaformat.cpp \
99 recurrence.cpp \ 99 recurrence.cpp \
100 scheduler.cpp \ 100 scheduler.cpp \
101 todo.cpp \ 101 todo.cpp \
102dndfactory.cpp \ 102dndfactory.cpp \
103 vcaldrag.cpp \ 103 vcaldrag.cpp \
104 vcalformat.cpp \ 104 vcalformat.cpp \
105 versit/vcc.c \ 105 versit/vcc.c \
106 versit/vobject.c \ 106 versit/vobject.c \
107 phoneformat.cpp \ 107 phoneformat.cpp \
108 108
109#The following line was inserted by qt3to4
110QT += xml qt3support
111#The following line was inserted by qt3to4
112QT +=
diff --git a/libkcal/libkcalE.pro b/libkcal/libkcalE.pro
index 737be53..fe46656 100644
--- a/libkcal/libkcalE.pro
+++ b/libkcal/libkcalE.pro
@@ -1,15 +1,15 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3 TARGET = microkcal 3 TARGET = xmicrokcal
4 4
5INCLUDEPATH += ../libkdepim ../microkde ../qtcompat versit ../microkde/kdecore $(QPEDIR)/include 5INCLUDEPATH += ../libkdepim ../microkde ../qtcompat versit ../microkde/kdecore $(QPEDIR)/include
6INCLUDEPATH += ../libical/src/libical 6INCLUDEPATH += ../libical/src/libical
7INCLUDEPATH += ../libical/src/libicalss 7INCLUDEPATH += ../libical/src/libicalss
8OBJECTS_DIR = obj/$(PLATFORM) 8OBJECTS_DIR = obj/$(PLATFORM)
9MOC_DIR = moc/$(PLATFORM) 9MOC_DIR = moc/$(PLATFORM)
10DESTDIR = $(QPEDIR)/lib 10DESTDIR = $(QPEDIR)/lib
11#LIBS += ../libical/lib/$(PLATFORM)/libical.a 11#LIBS += ../libical/lib/$(PLATFORM)/libical.a
12#LIBS += ../libical/lib/$(PLATFORM)/libicalss.a 12#LIBS += ../libical/lib/$(PLATFORM)/libicalss.a
13LIBS += ../dest$(LIBICAL_PATH)/libical.a 13LIBS += ../dest$(LIBICAL_PATH)/libical.a
14LIBS += ../dest$(LIBICAL_PATH)/libicalss.a 14LIBS += ../dest$(LIBICAL_PATH)/libicalss.a
15 15
diff --git a/libkcal/listbase.h b/libkcal/listbase.h
index 085b13d..6c942ef 100644
--- a/libkcal/listbase.h
+++ b/libkcal/listbase.h
@@ -12,82 +12,84 @@
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21#ifndef KCAL_LISTBASE_H 21#ifndef KCAL_LISTBASE_H
22#define KCAL_LISTBASE_H 22#define KCAL_LISTBASE_H
23 23
24#include <qvaluelist.h> 24#include <q3valuelist.h>
25//Added by qt3to4:
26#include <Q3PtrList>
25 27
26namespace KCal { 28namespace KCal {
27 class Event; 29 class Event;
28 class Todo; 30 class Todo;
29/** 31/**
30 This class provides a template for lists of pointers. It extends QValueList<T 32 This class provides a template for lists of pointers. It extends QValueList<T
31 *> by auto delete funtionality known from QPtrList. 33 *> by auto delete funtionality known from QPtrList.
32*/ 34*/
33template<class T> 35template<class T>
34class ListBase : public QValueList<T *> 36class ListBase : public Q3ValueList<T *>
35{ 37{
36 public: 38 public:
37 ListBase() 39 ListBase()
38 : QValueList<T *>(), mAutoDelete( false ) 40 : Q3ValueList<T *>(), mAutoDelete( false )
39 { 41 {
40 } 42 }
41 43
42 ListBase( const ListBase &l ) 44 ListBase( const ListBase &l )
43 : QValueList<T *>( l ), mAutoDelete( false ) 45 : Q3ValueList<T *>( l ), mAutoDelete( false )
44 { 46 {
45 } 47 }
46 48
47 ~ListBase() 49 ~ListBase()
48 { 50 {
49 if ( mAutoDelete ) { 51 if ( mAutoDelete ) {
50 QValueListIterator<T *> it; 52 Q3ValueListIterator<T *> it;
51 for( it = QValueList<T*>::begin(); it != QValueList<T*>::end(); ++it ) { 53 for( it = Q3ValueList<T*>::begin(); it != Q3ValueList<T*>::end(); ++it ) {
52 delete *it; 54 delete *it;
53 } 55 }
54 } 56 }
55 } 57 }
56 58
57 ListBase &operator=( const ListBase &l ) 59 ListBase &operator=( const ListBase &l )
58 { 60 {
59 if ( this == &l ) return *this; 61 if ( this == &l ) return *this;
60 QValueList<T *>::operator=( l ); 62 Q3ValueList<T *>::operator=( l );
61 return *this; 63 return *this;
62 } 64 }
63 65
64 void setAutoDelete( bool autoDelete ) 66 void setAutoDelete( bool autoDelete )
65 { 67 {
66 mAutoDelete = autoDelete; 68 mAutoDelete = autoDelete;
67 } 69 }
68 70
69 bool removeRef( T *t ) 71 bool removeRef( T *t )
70 { 72 {
71 QValueListIterator<T *> it = find( t ); 73 Q3ValueListIterator<T *> it = find( t );
72 if ( it == QValueList<T*>::end() ) { 74 if ( it == Q3ValueList<T*>::end() ) {
73 return false; 75 return false;
74 } else { 76 } else {
75 if ( mAutoDelete ) delete t; 77 if ( mAutoDelete ) delete t;
76 remove( it ); 78 remove( it );
77 return true; 79 return true;
78 } 80 }
79 } 81 }
80 void fill ( QPtrList<T> list ) { 82 void fill ( Q3PtrList<T> list ) {
81 QPtrListIterator<T> it (list); 83 Q3PtrListIterator<T> it (list);
82 T *item; 84 T *item;
83 while ( (item = it.current()) != 0 ) { 85 while ( (item = it.current()) != 0 ) {
84 append( item ); 86 append( item );
85 ++it; 87 ++it;
86 } 88 }
87 89
88 } 90 }
89 91
90 92
91 private: 93 private:
92 bool mAutoDelete; 94 bool mAutoDelete;
93}; 95};
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index 900fc04..794e4b4 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -13,33 +13,34 @@
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <qdatetime.h> 22#include <qdatetime.h>
23#include <qstring.h> 23#include <qstring.h>
24#include <qapplication.h> 24#include <qapplication.h>
25#include <qptrlist.h> 25#include <q3ptrlist.h>
26#include <qregexp.h> 26#include <qregexp.h>
27#include <qmessagebox.h> 27#include <qmessagebox.h>
28#include <qclipboard.h> 28#include <qclipboard.h>
29#include <qfile.h> 29#include <qfile.h>
30#include <qtextstream.h> 30#include <q3textstream.h>
31#include <qtextcodec.h> 31#include <qtextcodec.h>
32#include <qdir.h> 32#include <qdir.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <QDesktopWidget>
34 35
35#include <kdebug.h> 36#include <kdebug.h>
36#include <klocale.h> 37#include <klocale.h>
37#include <kglobal.h> 38#include <kglobal.h>
38#include <kmessagebox.h> 39#include <kmessagebox.h>
39#include <phoneaccess.h> 40#include <phoneaccess.h>
40 41
41#include "calendar.h" 42#include "calendar.h"
42#include "alarm.h" 43#include "alarm.h"
43#include "recurrence.h" 44#include "recurrence.h"
44#include "calendarlocal.h" 45#include "calendarlocal.h"
45 46
@@ -192,25 +193,25 @@ ulong PhoneFormat::getCsumEvent( Event* event )
192 } 193 }
193 //pending weekdays 194 //pending weekdays
194 writeEndDate = true; 195 writeEndDate = true;
195 196
196 break; 197 break;
197 case Recurrence::rMonthlyPos:// 2 198 case Recurrence::rMonthlyPos:// 2
198 list.append( "2" ); 199 list.append( "2" );
199 list.append( QString::number( rec->frequency()) );//12 200 list.append( QString::number( rec->frequency()) );//12
200 201
201 writeEndDate = true; 202 writeEndDate = true;
202 { 203 {
203 int count = 1; 204 int count = 1;
204 QPtrList<Recurrence::rMonthPos> rmp; 205 Q3PtrList<Recurrence::rMonthPos> rmp;
205 rmp = rec->monthPositions(); 206 rmp = rec->monthPositions();
206 if ( rmp.first()->negative ) 207 if ( rmp.first()->negative )
207 count = 5 - rmp.first()->rPos - 1; 208 count = 5 - rmp.first()->rPos - 1;
208 else 209 else
209 count = rmp.first()->rPos - 1; 210 count = rmp.first()->rPos - 1;
210 list.append( QString::number( count ) ); 211 list.append( QString::number( count ) );
211 212
212 } 213 }
213 214
214 list.append( "0" ); 215 list.append( "0" );
215 break; 216 break;
216 case Recurrence::rMonthlyDay:// 3 217 case Recurrence::rMonthlyDay:// 3
@@ -232,25 +233,25 @@ ulong PhoneFormat::getCsumEvent( Event* event )
232 list.append( "255" ); 233 list.append( "255" );
233 list.append( QString() ); 234 list.append( QString() );
234 list.append( "0" ); 235 list.append( "0" );
235 list.append( QString() ); 236 list.append( QString() );
236 list.append( "0" ); 237 list.append( "0" );
237 list.append( "20991231T000000" ); 238 list.append( "20991231T000000" );
238 break; 239 break;
239 } 240 }
240 if ( writeEndDate ) { 241 if ( writeEndDate ) {
241 242
242 if ( rec->endDate().isValid() ) { // 15 + 16 243 if ( rec->endDate().isValid() ) { // 15 + 16
243 list.append( "1" ); 244 list.append( "1" );
244 list.append( PhoneParser::dtToString( rec->endDate()) ); 245 list.append( PhoneParser::dtToString( (QDateTime)rec->endDate()) );
245 } else { 246 } else {
246 list.append( "0" ); 247 list.append( "0" );
247 list.append( "20991231T000000" ); 248 list.append( "20991231T000000" );
248 } 249 }
249 250
250 } 251 }
251 attList << list.join(""); 252 attList << list.join("");
252 attList << event->categoriesStr(); 253 attList << event->categoriesStr();
253 //qDebug("csum cat %s", event->categoriesStr().latin1()); 254 //qDebug("csum cat %s", event->categoriesStr().latin1());
254 255
255 attList << event->secrecyStr(); 256 attList << event->secrecyStr();
256 return PhoneFormat::getCsum(attList ); 257 return PhoneFormat::getCsum(attList );
@@ -296,25 +297,25 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
296 fileName = "/tmp/phonefile.vcs"; 297 fileName = "/tmp/phonefile.vcs";
297#endif 298#endif
298 QString command; 299 QString command;
299 if ( ! PhoneAccess::readFromPhone( fileName )) { 300 if ( ! PhoneAccess::readFromPhone( fileName )) {
300 return false; 301 return false;
301 } 302 }
302 VCalFormat vfload; 303 VCalFormat vfload;
303 vfload.setLocalTime ( true ); 304 vfload.setLocalTime ( true );
304 qDebug("loading file ..."); 305 qDebug("loading file ...");
305 306
306 if ( ! vfload.load( calendar, fileName ) ) 307 if ( ! vfload.load( calendar, fileName ) )
307 return false; 308 return false;
308 QPtrList<Event> er = calendar->rawEvents(); 309 Q3PtrList<Event> er = calendar->rawEvents();
309 Event* ev = er.first(); 310 Event* ev = er.first();
310 qDebug("reading events... "); 311 qDebug("reading events... ");
311 while ( ev ) { 312 while ( ev ) {
312 QStringList cat = ev->categories(); 313 QStringList cat = ev->categories();
313 if ( cat.contains( "MeetingDEF" )) { 314 if ( cat.contains( "MeetingDEF" )) {
314 ev->setCategories( QStringList() ); 315 ev->setCategories( QStringList() );
315 } else 316 } else
316 if ( cat.contains( "Birthday" )) { 317 if ( cat.contains( "Birthday" )) {
317 ev->setFloats( true ); 318 ev->setFloats( true );
318 QDate da = ev->dtStart().date(); 319 QDate da = ev->dtStart().date();
319 ev->setDtStart( QDateTime( da) ); 320 ev->setDtStart( QDateTime( da) );
320 ev->setDtEnd( QDateTime( da.addDays(1)) ); 321 ev->setDtEnd( QDateTime( da.addDays(1)) );
@@ -331,25 +332,25 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
331 calendar->deleteEvent( ev ); 332 calendar->deleteEvent( ev );
332 calendar->addEvent( event); 333 calendar->addEvent( event);
333 } 334 }
334 else 335 else
335 event = ev; 336 event = ev;
336 event->setCsum( mProfileName, QString::number( cSum )); 337 event->setCsum( mProfileName, QString::number( cSum ));
337 event->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); 338 event->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL );
338 event->setID( mProfileName,QString::number( id ) ); 339 event->setID( mProfileName,QString::number( id ) );
339 ev = er.next(); 340 ev = er.next();
340 } 341 }
341 { 342 {
342 qDebug("reading todos... "); 343 qDebug("reading todos... ");
343 QPtrList<Todo> tr = calendar->rawTodos(); 344 Q3PtrList<Todo> tr = calendar->rawTodos();
344 Todo* ev = tr.first(); 345 Todo* ev = tr.first();
345 while ( ev ) { 346 while ( ev ) {
346 347
347 QStringList cat = ev->categories(); 348 QStringList cat = ev->categories();
348 if ( cat.contains( "MeetingDEF" )) { 349 if ( cat.contains( "MeetingDEF" )) {
349 ev->setCategories( QStringList() ); 350 ev->setCategories( QStringList() );
350 } 351 }
351 int id = ev->pilotId(); 352 int id = ev->pilotId();
352 uint cSum; 353 uint cSum;
353 cSum = PhoneFormat::getCsumTodo( ev ); 354 cSum = PhoneFormat::getCsumTodo( ev );
354 Todo *event; 355 Todo *event;
355 event = existingCal->todo( mProfileName ,QString::number( id ) ); 356 event = existingCal->todo( mProfileName ,QString::number( id ) );
@@ -456,25 +457,25 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from )
456 // set percentcomplete only, if to->isCompleted() 457 // set percentcomplete only, if to->isCompleted()
457 if ( to->isCompleted() ) 458 if ( to->isCompleted() )
458 to->setPercentComplete(from->percentComplete()); 459 to->setPercentComplete(from->percentComplete());
459 } 460 }
460 if( to->priority() == 2 && from->priority() == 1 ) 461 if( to->priority() == 2 && from->priority() == 1 )
461 ; //skip 462 ; //skip
462 else if (to->priority() == 4 && from->priority() == 5 ) 463 else if (to->priority() == 4 && from->priority() == 5 )
463 ; 464 ;
464 else 465 else
465 to->setPriority(from->priority()); 466 to->setPriority(from->priority());
466 467
467} 468}
468#include <qcstring.h> 469#include <q3cstring.h>
469 470
470void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum) 471void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum)
471{ 472{
472 inc->setID( mProfileName, id ); 473 inc->setID( mProfileName, id );
473 inc->setCsum( mProfileName, csum); 474 inc->setCsum( mProfileName, csum);
474 inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); 475 inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
475 476
476} 477}
477 478
478bool PhoneFormat::writeToPhone( Calendar * calendar) 479bool PhoneFormat::writeToPhone( Calendar * calendar)
479{ 480{
480#ifdef DESKTOP_VERSION 481#ifdef DESKTOP_VERSION
@@ -488,36 +489,36 @@ bool PhoneFormat::writeToPhone( Calendar * calendar)
488 QString id = calendar->timeZoneId(); 489 QString id = calendar->timeZoneId();
489 calendar->setLocalTime(); 490 calendar->setLocalTime();
490 if ( ! vfsave.save( calendar, fileName ) ) 491 if ( ! vfsave.save( calendar, fileName ) )
491 return false; 492 return false;
492 calendar->setTimeZoneId( id ); 493 calendar->setTimeZoneId( id );
493 return PhoneAccess::writeToPhone( fileName ); 494 return PhoneAccess::writeToPhone( fileName );
494} 495}
495bool PhoneFormat::save( Calendar *calendar) 496bool PhoneFormat::save( Calendar *calendar)
496{ 497{
497 498
498 499
499 // 1 remove events which should be deleted 500 // 1 remove events which should be deleted
500 QPtrList<Event> er = calendar->rawEvents(); 501 Q3PtrList<Event> er = calendar->rawEvents();
501 Event* ev = er.first(); 502 Event* ev = er.first();
502 while ( ev ) { 503 while ( ev ) {
503 if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { 504 if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) {
504 calendar->deleteEvent( ev ); 505 calendar->deleteEvent( ev );
505 } else { 506 } else {
506 507
507 } 508 }
508 ev = er.next(); 509 ev = er.next();
509 } 510 }
510 // 2 remove todos which should be deleted 511 // 2 remove todos which should be deleted
511 QPtrList<Todo> tl = calendar->rawTodos(); 512 Q3PtrList<Todo> tl = calendar->rawTodos();
512 Todo* to = tl.first(); 513 Todo* to = tl.first();
513 while ( to ) { 514 while ( to ) {
514 if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { 515 if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) {
515 calendar->deleteTodo( to ); 516 calendar->deleteTodo( to );
516 } else { 517 } else {
517 if ( to->isCompleted()) { 518 if ( to->isCompleted()) {
518 calendar->deleteTodo( to ); 519 calendar->deleteTodo( to );
519 } 520 }
520 } 521 }
521 to = tl.next(); 522 to = tl.next();
522 } 523 }
523 // 3 save file 524 // 3 save file
@@ -543,25 +544,25 @@ bool PhoneFormat::save( Calendar *calendar)
543 calendarTemp->setTimeZoneId( calendar->timeZoneId()); 544 calendarTemp->setTimeZoneId( calendar->timeZoneId());
544 if ( ! load( calendarTemp,calendar) ){ 545 if ( ! load( calendarTemp,calendar) ){
545 qDebug("error reloading calendar "); 546 qDebug("error reloading calendar ");
546 delete calendarTemp; 547 delete calendarTemp;
547 return false; 548 return false;
548 } 549 }
549 // 6 compare data 550 // 6 compare data
550 551
551//algo 6 compare event 552//algo 6 compare event
552 er = calendar->rawEvents(); 553 er = calendar->rawEvents();
553 ev = er.first(); 554 ev = er.first();
554 message = i18n(" Comparing event # "); 555 message = i18n(" Comparing event # ");
555 QPtrList<Event> er1 = calendarTemp->rawEvents(); 556 Q3PtrList<Event> er1 = calendarTemp->rawEvents();
556 Event* ev1; 557 Event* ev1;
557 int procCount = 0; 558 int procCount = 0;
558 while ( ev ) { 559 while ( ev ) {
559 //qDebug("event new ID %s",ev->summary().latin1()); 560 //qDebug("event new ID %s",ev->summary().latin1());
560 status.setText ( message + QString::number ( ++procCount ) ); 561 status.setText ( message + QString::number ( ++procCount ) );
561 qApp->processEvents(); 562 qApp->processEvents();
562 ev1 = er1.first(); 563 ev1 = er1.first();
563 while ( ev1 ) { 564 while ( ev1 ) {
564 if ( ev->contains( ev1 ) ) { 565 if ( ev->contains( ev1 ) ) {
565 afterSave( ev ,ev1->getID(mProfileName),ev1->getCsum(mProfileName)); 566 afterSave( ev ,ev1->getID(mProfileName),ev1->getCsum(mProfileName));
566 er1.remove( ev1 ); 567 er1.remove( ev1 );
567 break; 568 break;
@@ -571,25 +572,25 @@ bool PhoneFormat::save( Calendar *calendar)
571 if ( ! ev1 ) { 572 if ( ! ev1 ) {
572 // ev->removeID(mProfileName); 573 // ev->removeID(mProfileName);
573 qDebug("ERROR: No event found on phone for %s ", ev->summary().latin1()); 574 qDebug("ERROR: No event found on phone for %s ", ev->summary().latin1());
574 } 575 }
575 576
576 577
577 ev = er.next(); 578 ev = er.next();
578 } 579 }
579 //algo 6 compare todo 580 //algo 6 compare todo
580 tl = calendar->rawTodos(); 581 tl = calendar->rawTodos();
581 to = tl.first(); 582 to = tl.first();
582 procCount = 0; 583 procCount = 0;
583 QPtrList<Todo> tl1 = calendarTemp->rawTodos(); 584 Q3PtrList<Todo> tl1 = calendarTemp->rawTodos();
584 Todo* to1 ; 585 Todo* to1 ;
585 message = i18n(" Comparing todo # "); 586 message = i18n(" Comparing todo # ");
586 while ( to ) { 587 while ( to ) {
587 status.setText ( message + QString::number ( ++procCount ) ); 588 status.setText ( message + QString::number ( ++procCount ) );
588 qApp->processEvents(); 589 qApp->processEvents();
589 Todo* to1 = tl1.first(); 590 Todo* to1 = tl1.first();
590 while ( to1 ) { 591 while ( to1 ) {
591 if ( to->contains( to1 ) ) { 592 if ( to->contains( to1 ) ) {
592 afterSave( to ,to1->getID(mProfileName),to1->getCsum(mProfileName)); 593 afterSave( to ,to1->getID(mProfileName),to1->getCsum(mProfileName));
593 tl1.remove( to1 ); 594 tl1.remove( to1 );
594 break; 595 break;
595 } 596 }
diff --git a/libkcal/qtopiaformat.cpp b/libkcal/qtopiaformat.cpp
index 0a4a031..2dfe1a4 100644
--- a/libkcal/qtopiaformat.cpp
+++ b/libkcal/qtopiaformat.cpp
@@ -12,29 +12,29 @@
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <qdatetime.h> 22#include <qdatetime.h>
23#include <qstring.h> 23#include <qstring.h>
24#include <qptrlist.h> 24#include <q3ptrlist.h>
25#include <qregexp.h> 25#include <qregexp.h>
26#include <qclipboard.h> 26#include <qclipboard.h>
27#include <qfile.h> 27#include <qfile.h>
28#include <qtextstream.h> 28#include <q3textstream.h>
29#include <qxml.h> 29#include <qxml.h>
30 30
31#include <kdebug.h> 31#include <kdebug.h>
32#include <klocale.h> 32#include <klocale.h>
33 33
34#include "calendar.h" 34#include "calendar.h"
35#include "calendarlocal.h" 35#include "calendarlocal.h"
36 36
37#include "qtopiaformat.h" 37#include "qtopiaformat.h"
38 38
39using namespace KCal; 39using namespace KCal;
40 40
@@ -300,30 +300,30 @@ bool QtopiaFormat::load( Calendar *calendar, const QString &fileName )
300bool QtopiaFormat::save( Calendar *calendar, const QString &fileName ) 300bool QtopiaFormat::save( Calendar *calendar, const QString &fileName )
301{ 301{
302 302
303 clearException(); 303 clearException();
304 304
305 QString text = toString( calendar ); 305 QString text = toString( calendar );
306 306
307 if ( text.isNull() ) return false; 307 if ( text.isNull() ) return false;
308 308
309 // TODO: write backup file 309 // TODO: write backup file
310 310
311 QFile file( fileName ); 311 QFile file( fileName );
312 if (!file.open( IO_WriteOnly ) ) { 312 if (!file.open( QIODevice::WriteOnly ) ) {
313 setException(new ErrorFormat(ErrorFormat::SaveError, 313 setException(new ErrorFormat(ErrorFormat::SaveError,
314 i18n("Could not open file '%1'").arg(fileName))); 314 i18n("Could not open file '%1'").arg(fileName)));
315 return false; 315 return false;
316 } 316 }
317 QTextStream ts( &file ); 317 Q3TextStream ts( &file );
318 ts << text; 318 ts << text;
319 file.close(); 319 file.close();
320 320
321 return true; 321 return true;
322} 322}
323 323
324bool QtopiaFormat::fromString( Calendar *, const QString & ) 324bool QtopiaFormat::fromString( Calendar *, const QString & )
325{ 325{
326 326
327 return false; 327 return false;
328} 328}
329 329
diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp
index 6ee5499..9a4e540 100644
--- a/libkcal/recurrence.cpp
+++ b/libkcal/recurrence.cpp
@@ -20,24 +20,27 @@
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22 22
23#include <limits.h> 23#include <limits.h>
24 24
25#include <kdebug.h> 25#include <kdebug.h>
26#include <kglobal.h> 26#include <kglobal.h>
27#include <klocale.h> 27#include <klocale.h>
28 28
29#include "incidence.h" 29#include "incidence.h"
30 30
31#include "recurrence.h" 31#include "recurrence.h"
32//Added by qt3to4:
33#include <Q3ValueList>
34#include <Q3PtrList>
32 35
33using namespace KCal; 36using namespace KCal;
34 37
35Recurrence::Feb29Type Recurrence::mFeb29YearlyDefaultType = Recurrence::rMar1; 38Recurrence::Feb29Type Recurrence::mFeb29YearlyDefaultType = Recurrence::rMar1;
36 39
37 40
38Recurrence::Recurrence(Incidence *parent, int compatVersion) 41Recurrence::Recurrence(Incidence *parent, int compatVersion)
39: recurs(rNone), // by default, it's not a recurring event 42: recurs(rNone), // by default, it's not a recurring event
40 rWeekStart(1), // default is Monday 43 rWeekStart(1), // default is Monday
41 rDays(7), 44 rDays(7),
42 mFloats(parent ? parent->doesFloat() : false), 45 mFloats(parent ? parent->doesFloat() : false),
43 mRecurReadOnly(false), 46 mRecurReadOnly(false),
@@ -47,51 +50,51 @@ Recurrence::Recurrence(Incidence *parent, int compatVersion)
47 mCompatRecurs(rNone), 50 mCompatRecurs(rNone),
48 mCompatDuration(0), 51 mCompatDuration(0),
49 mParent(parent) 52 mParent(parent)
50{ 53{
51 rMonthDays.setAutoDelete( true ); 54 rMonthDays.setAutoDelete( true );
52 rMonthPositions.setAutoDelete( true ); 55 rMonthPositions.setAutoDelete( true );
53 rYearNums.setAutoDelete( true ); 56 rYearNums.setAutoDelete( true );
54} 57}
55 58
56Recurrence::Recurrence(const Recurrence &r, Incidence *parent) 59Recurrence::Recurrence(const Recurrence &r, Incidence *parent)
57: recurs(r.recurs), 60: recurs(r.recurs),
58 rWeekStart(r.rWeekStart), 61 rWeekStart(r.rWeekStart),
59 rDays(r.rDays.copy()), 62 rDays(r.rDays),
60 rFreq(r.rFreq), 63 rFreq(r.rFreq),
61 rDuration(r.rDuration), 64 rDuration(r.rDuration),
62 rEndDateTime(r.rEndDateTime), 65 rEndDateTime(r.rEndDateTime),
63 mRecurStart(r.mRecurStart), 66 mRecurStart(r.mRecurStart),
64 mFloats(r.mFloats), 67 mFloats(r.mFloats),
65 mRecurReadOnly(r.mRecurReadOnly), 68 mRecurReadOnly(r.mRecurReadOnly),
66 mRecurExDatesCount(r.mRecurExDatesCount), 69 mRecurExDatesCount(r.mRecurExDatesCount),
67 mFeb29YearlyType(r.mFeb29YearlyType), 70 mFeb29YearlyType(r.mFeb29YearlyType),
68 mCompatVersion(r.mCompatVersion), 71 mCompatVersion(r.mCompatVersion),
69 mCompatRecurs(r.mCompatRecurs), 72 mCompatRecurs(r.mCompatRecurs),
70 mCompatDuration(r.mCompatDuration), 73 mCompatDuration(r.mCompatDuration),
71 mParent(parent) 74 mParent(parent)
72{ 75{
73 for (QPtrListIterator<rMonthPos> mp(r.rMonthPositions); mp.current(); ++mp) { 76 for (Q3PtrListIterator<rMonthPos> mp(r.rMonthPositions); mp.current(); ++mp) {
74 rMonthPos *tmp = new rMonthPos; 77 rMonthPos *tmp = new rMonthPos;
75 tmp->rPos = mp.current()->rPos; 78 tmp->rPos = mp.current()->rPos;
76 tmp->negative = mp.current()->negative; 79 tmp->negative = mp.current()->negative;
77 tmp->rDays = mp.current()->rDays.copy(); 80 tmp->rDays = mp.current()->rDays;
78 rMonthPositions.append(tmp); 81 rMonthPositions.append(tmp);
79 } 82 }
80 for (QPtrListIterator<int> md(r.rMonthDays); md.current(); ++md) { 83 for (Q3PtrListIterator<int> md(r.rMonthDays); md.current(); ++md) {
81 int *tmp = new int; 84 int *tmp = new int;
82 *tmp = *md.current(); 85 *tmp = *md.current();
83 rMonthDays.append(tmp); 86 rMonthDays.append(tmp);
84 } 87 }
85 for (QPtrListIterator<int> yn(r.rYearNums); yn.current(); ++yn) { 88 for (Q3PtrListIterator<int> yn(r.rYearNums); yn.current(); ++yn) {
86 int *tmp = new int; 89 int *tmp = new int;
87 *tmp = *yn.current(); 90 *tmp = *yn.current();
88 rYearNums.append(tmp); 91 rYearNums.append(tmp);
89 } 92 }
90 rMonthDays.setAutoDelete( true ); 93 rMonthDays.setAutoDelete( true );
91 rMonthPositions.setAutoDelete( true ); 94 rMonthPositions.setAutoDelete( true );
92 rYearNums.setAutoDelete( true ); 95 rYearNums.setAutoDelete( true );
93} 96}
94 97
95Recurrence::~Recurrence() 98Recurrence::~Recurrence()
96{ 99{
97} 100}
@@ -115,64 +118,64 @@ bool Recurrence::operator==( const Recurrence& r2 ) const
115 || mFloats != r2.mFloats 118 || mFloats != r2.mFloats
116 || mRecurReadOnly != r2.mRecurReadOnly 119 || mRecurReadOnly != r2.mRecurReadOnly
117 || mRecurExDatesCount != r2.mRecurExDatesCount ) 120 || mRecurExDatesCount != r2.mRecurExDatesCount )
118 return false; 121 return false;
119 // no need to compare mCompat* and mParent 122 // no need to compare mCompat* and mParent
120 // OK to compare the pointers 123 // OK to compare the pointers
121 switch ( recurs ) 124 switch ( recurs )
122 { 125 {
123 case rWeekly: 126 case rWeekly:
124 return rDays == r2.rDays 127 return rDays == r2.rDays
125 && rWeekStart == r2.rWeekStart; 128 && rWeekStart == r2.rWeekStart;
126 case rMonthlyPos: { 129 case rMonthlyPos: {
127 QPtrList<rMonthPos> MonthPositions = rMonthPositions; 130 Q3PtrList<rMonthPos> MonthPositions = rMonthPositions;
128 QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; 131 Q3PtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions;
129 if ( !MonthPositions.count() ) 132 if ( !MonthPositions.count() )
130 return false; 133 return false;
131 if ( !MonthPositions2.count() ) 134 if ( !MonthPositions2.count() )
132 return false; 135 return false;
133 return MonthPositions.first()->rPos == MonthPositions2.first()->rPos; 136 return MonthPositions.first()->rPos == MonthPositions2.first()->rPos;
134 } 137 }
135 case rMonthlyDay: { 138 case rMonthlyDay: {
136 QPtrList<int> MonthDays = rMonthDays ; 139 Q3PtrList<int> MonthDays = rMonthDays ;
137 QPtrList<int> MonthDays2 = r2.rMonthDays ; 140 Q3PtrList<int> MonthDays2 = r2.rMonthDays ;
138 if ( !MonthDays.count() ) 141 if ( !MonthDays.count() )
139 return false; 142 return false;
140 if ( !MonthDays2.count() ) 143 if ( !MonthDays2.count() )
141 return false; 144 return false;
142 return *MonthDays.first() == *MonthDays2.first() ; 145 return *MonthDays.first() == *MonthDays2.first() ;
143 } 146 }
144 case rYearlyPos: { 147 case rYearlyPos: {
145 148
146 QPtrList<int> YearNums = rYearNums; 149 Q3PtrList<int> YearNums = rYearNums;
147 QPtrList<int> YearNums2 = r2.rYearNums; 150 Q3PtrList<int> YearNums2 = r2.rYearNums;
148 if ( *YearNums.first() != *YearNums2.first() ) 151 if ( *YearNums.first() != *YearNums2.first() )
149 return false; 152 return false;
150 QPtrList<rMonthPos> MonthPositions = rMonthPositions; 153 Q3PtrList<rMonthPos> MonthPositions = rMonthPositions;
151 QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; 154 Q3PtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions;
152 if ( !MonthPositions.count() ) 155 if ( !MonthPositions.count() )
153 return false; 156 return false;
154 if ( !MonthPositions2.count() ) 157 if ( !MonthPositions2.count() )
155 return false; 158 return false;
156 return MonthPositions.first()->rPos == MonthPositions2.first()->rPos; 159 return MonthPositions.first()->rPos == MonthPositions2.first()->rPos;
157 160
158 } 161 }
159 case rYearlyMonth: { 162 case rYearlyMonth: {
160 QPtrList<int> YearNums = rYearNums; 163 Q3PtrList<int> YearNums = rYearNums;
161 QPtrList<int> YearNums2 = r2.rYearNums; 164 Q3PtrList<int> YearNums2 = r2.rYearNums;
162 return ( *YearNums.first() == *YearNums2.first() && mFeb29YearlyType == r2.mFeb29YearlyType); 165 return ( *YearNums.first() == *YearNums2.first() && mFeb29YearlyType == r2.mFeb29YearlyType);
163 } 166 }
164 case rYearlyDay: { 167 case rYearlyDay: {
165 QPtrList<int> YearNums = rYearNums; 168 Q3PtrList<int> YearNums = rYearNums;
166 QPtrList<int> YearNums2 = r2.rYearNums; 169 Q3PtrList<int> YearNums2 = r2.rYearNums;
167 return ( *YearNums.first() == *YearNums2.first() ); 170 return ( *YearNums.first() == *YearNums2.first() );
168 } 171 }
169 case rNone: 172 case rNone:
170 case rMinutely: 173 case rMinutely:
171 case rHourly: 174 case rHourly:
172 case rDaily: 175 case rDaily:
173 default: 176 default:
174 return true; 177 return true;
175 } 178 }
176} 179}
177/* 180/*
178bool Recurrence::compareLists( const QPtrList<int> &l1 ,const QPtrList<int> &l2) 181bool Recurrence::compareLists( const QPtrList<int> &l1 ,const QPtrList<int> &l2)
@@ -348,25 +351,25 @@ QDateTime Recurrence::endDateTime() const
348 if (rDuration == 0) 351 if (rDuration == 0)
349 return rEndDateTime; 352 return rEndDateTime;
350 353
351 // The end date is determined by the recurrence count 354 // The end date is determined by the recurrence count
352 QDate dStart = mRecurStart.date(); 355 QDate dStart = mRecurStart.date();
353 switch (recurs) 356 switch (recurs)
354 { 357 {
355 case rMinutely: 358 case rMinutely:
356 return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*60); 359 return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*60);
357 case rHourly: 360 case rHourly:
358 return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*3600); 361 return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*3600);
359 case rDaily: 362 case rDaily:
360 return dStart.addDays((rDuration-1+mRecurExDatesCount)*rFreq); 363 return (QDateTime)dStart.addDays((rDuration-1+mRecurExDatesCount)*rFreq);
361 364
362 case rWeekly: 365 case rWeekly:
363 count = weeklyCalc(END_DATE_AND_COUNT, end); 366 count = weeklyCalc(END_DATE_AND_COUNT, end);
364 break; 367 break;
365 case rMonthlyPos: 368 case rMonthlyPos:
366 case rMonthlyDay: 369 case rMonthlyDay:
367 count = monthlyCalc(END_DATE_AND_COUNT, end); 370 count = monthlyCalc(END_DATE_AND_COUNT, end);
368 break; 371 break;
369 case rYearlyMonth: 372 case rYearlyMonth:
370 count = yearlyMonthCalc(END_DATE_AND_COUNT, end); 373 count = yearlyMonthCalc(END_DATE_AND_COUNT, end);
371 break; 374 break;
372 case rYearlyDay: 375 case rYearlyDay:
@@ -497,35 +500,35 @@ void Recurrence::setDuration(int _rDuration)
497} 500}
498 501
499QString Recurrence::endDateStr(bool shortfmt) const 502QString Recurrence::endDateStr(bool shortfmt) const
500{ 503{
501 return KGlobal::locale()->formatDate(rEndDateTime.date(),shortfmt); 504 return KGlobal::locale()->formatDate(rEndDateTime.date(),shortfmt);
502} 505}
503 506
504const QBitArray &Recurrence::days() const 507const QBitArray &Recurrence::days() const
505{ 508{
506 return rDays; 509 return rDays;
507} 510}
508 511
509const QPtrList<Recurrence::rMonthPos> &Recurrence::monthPositions() const 512const Q3PtrList<Recurrence::rMonthPos> &Recurrence::monthPositions() const
510{ 513{
511 return rMonthPositions; 514 return rMonthPositions;
512} 515}
513 516
514const QPtrList<Recurrence::rMonthPos> &Recurrence::yearMonthPositions() const 517const Q3PtrList<Recurrence::rMonthPos> &Recurrence::yearMonthPositions() const
515{ 518{
516 return rMonthPositions; 519 return rMonthPositions;
517} 520}
518 521
519const QPtrList<int> &Recurrence::monthDays() const 522const Q3PtrList<int> &Recurrence::monthDays() const
520{ 523{
521 return rMonthDays; 524 return rMonthDays;
522} 525}
523 526
524void Recurrence::setMinutely(int _rFreq, int _rDuration) 527void Recurrence::setMinutely(int _rFreq, int _rDuration)
525{ 528{
526 if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) 529 if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1)
527 return; 530 return;
528 setDailySub(rMinutely, _rFreq, _rDuration); 531 setDailySub(rMinutely, _rFreq, _rDuration);
529} 532}
530 533
531void Recurrence::setMinutely(int _rFreq, const QDateTime &_rEndDateTime) 534void Recurrence::setMinutely(int _rFreq, const QDateTime &_rEndDateTime)
@@ -750,25 +753,25 @@ void Recurrence::setYearlyByDate(Feb29Type type, int _rFreq, const QDate &_rEndD
750 rEndDateTime.setDate(_rEndDate); 753 rEndDateTime.setDate(_rEndDate);
751 rEndDateTime.setTime(mRecurStart.time()); 754 rEndDateTime.setTime(mRecurStart.time());
752 mCompatDuration = 0; 755 mCompatDuration = 0;
753 setYearly_(rYearlyMonth, type, _rFreq, 0); 756 setYearly_(rYearlyMonth, type, _rFreq, 0);
754} 757}
755 758
756void Recurrence::addYearlyMonthPos(short _rPos, const QBitArray &_rDays) 759void Recurrence::addYearlyMonthPos(short _rPos, const QBitArray &_rDays)
757{ 760{
758 if (recurs == rYearlyPos) 761 if (recurs == rYearlyPos)
759 addMonthlyPos_(_rPos, _rDays); 762 addMonthlyPos_(_rPos, _rDays);
760} 763}
761 764
762const QPtrList<int> &Recurrence::yearNums() const 765const Q3PtrList<int> &Recurrence::yearNums() const
763{ 766{
764 return rYearNums; 767 return rYearNums;
765} 768}
766void Recurrence::addYearlyMonth(short _rPos ) 769void Recurrence::addYearlyMonth(short _rPos )
767{ 770{
768 if (mRecurReadOnly || recurs != rYearlyMonth) // invalid day/month number 771 if (mRecurReadOnly || recurs != rYearlyMonth) // invalid day/month number
769 return; 772 return;
770 rMonthPos *tmpPos = new rMonthPos; 773 rMonthPos *tmpPos = new rMonthPos;
771 if ( _rPos > 0) { 774 if ( _rPos > 0) {
772 tmpPos->rPos = _rPos; 775 tmpPos->rPos = _rPos;
773 tmpPos->negative = false; 776 tmpPos->negative = false;
774 } else { 777 } else {
@@ -1038,31 +1041,31 @@ bool Recurrence::recursMonthly(const QDate &qd) const
1038 int month = qd.month(); 1041 int month = qd.month();
1039 int day = qd.day(); 1042 int day = qd.day();
1040 // calculate how many months ahead this date is from the original 1043 // calculate how many months ahead this date is from the original
1041 // event's date 1044 // event's date
1042 int monthsAhead = (year - dStart.year()) * 12 + (month - dStart.month()); 1045 int monthsAhead = (year - dStart.year()) * 12 + (month - dStart.month());
1043 if ((monthsAhead % rFreq) == 0) { 1046 if ((monthsAhead % rFreq) == 0) {
1044 // The date is in a month which recurs 1047 // The date is in a month which recurs
1045 if (qd >= dStart 1048 if (qd >= dStart
1046 && ((rDuration > 0 && qd <= endDate()) || 1049 && ((rDuration > 0 && qd <= endDate()) ||
1047 (rDuration == 0 && qd <= rEndDateTime.date()) || 1050 (rDuration == 0 && qd <= rEndDateTime.date()) ||
1048 rDuration == -1)) { 1051 rDuration == -1)) {
1049 // The date queried falls within the range of the event. 1052 // The date queried falls within the range of the event.
1050 QValueList<int> days; 1053 Q3ValueList<int> days;
1051 int daysInMonth = qd.daysInMonth(); 1054 int daysInMonth = qd.daysInMonth();
1052 if (recurs == rMonthlyDay) 1055 if (recurs == rMonthlyDay)
1053 getMonthlyDayDays(days, daysInMonth); 1056 getMonthlyDayDays(days, daysInMonth);
1054 else if (recurs == rMonthlyPos) 1057 else if (recurs == rMonthlyPos)
1055 getMonthlyPosDays(days, daysInMonth, QDate(year, month, 1).dayOfWeek()); 1058 getMonthlyPosDays(days, daysInMonth, QDate(year, month, 1).dayOfWeek());
1056 for (QValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) { 1059 for (Q3ValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) {
1057 if (*it == day) 1060 if (*it == day)
1058 return true; 1061 return true;
1059 } 1062 }
1060 // no dates matched 1063 // no dates matched
1061 } 1064 }
1062 } 1065 }
1063 return false; 1066 return false;
1064} 1067}
1065 1068
1066bool Recurrence::recursYearlyByMonth(const QDate &qd) const 1069bool Recurrence::recursYearlyByMonth(const QDate &qd) const
1067{ 1070{
1068 QDate dStart = mRecurStart.date(); 1071 QDate dStart = mRecurStart.date();
@@ -1092,25 +1095,25 @@ bool Recurrence::recursYearlyByMonth(const QDate &qd) const
1092 if (match) { 1095 if (match) {
1093 // The day of the month matches. Calculate how many years ahead 1096 // The day of the month matches. Calculate how many years ahead
1094 // this date is from the original event's date. 1097 // this date is from the original event's date.
1095 int yearsAhead = (qyear - dStart.year()); 1098 int yearsAhead = (qyear - dStart.year());
1096 if (yearsAhead % rFreq == 0) { 1099 if (yearsAhead % rFreq == 0) {
1097 // The date is in a year which recurs 1100 // The date is in a year which recurs
1098 if (qd >= dStart 1101 if (qd >= dStart
1099 && ((rDuration > 0 && qd <= endDate()) || 1102 && ((rDuration > 0 && qd <= endDate()) ||
1100 (rDuration == 0 && qd <= rEndDateTime.date()) || 1103 (rDuration == 0 && qd <= rEndDateTime.date()) ||
1101 rDuration == -1)) { 1104 rDuration == -1)) {
1102 // The date queried falls within the range of the event. 1105 // The date queried falls within the range of the event.
1103 int i = qmonth; 1106 int i = qmonth;
1104 for (QPtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { 1107 for (Q3PtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) {
1105 if (i == *qlin.current()) 1108 if (i == *qlin.current())
1106 return true; 1109 return true;
1107 } 1110 }
1108 } 1111 }
1109 } 1112 }
1110 } 1113 }
1111 return false; 1114 return false;
1112} 1115}
1113 1116
1114bool Recurrence::recursYearlyByPos(const QDate &qd) const 1117bool Recurrence::recursYearlyByPos(const QDate &qd) const
1115{ 1118{
1116 QDate dStart = mRecurStart.date(); 1119 QDate dStart = mRecurStart.date();
@@ -1118,55 +1121,55 @@ bool Recurrence::recursYearlyByPos(const QDate &qd) const
1118 int month = qd.month(); 1121 int month = qd.month();
1119 int day = qd.day(); 1122 int day = qd.day();
1120 // calculate how many years ahead this date is from the original 1123 // calculate how many years ahead this date is from the original
1121 // event's date 1124 // event's date
1122 int yearsAhead = (year - dStart.year()); 1125 int yearsAhead = (year - dStart.year());
1123 if (yearsAhead % rFreq == 0) { 1126 if (yearsAhead % rFreq == 0) {
1124 // The date is in a year which recurs 1127 // The date is in a year which recurs
1125 if (qd >= dStart 1128 if (qd >= dStart
1126 && ((rDuration > 0 && qd <= endDate()) || 1129 && ((rDuration > 0 && qd <= endDate()) ||
1127 (rDuration == 0 && qd <= rEndDateTime.date()) || 1130 (rDuration == 0 && qd <= rEndDateTime.date()) ||
1128 rDuration == -1)) { 1131 rDuration == -1)) {
1129 // The date queried falls within the range of the event. 1132 // The date queried falls within the range of the event.
1130 for (QPtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { 1133 for (Q3PtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) {
1131 if (month == *qlin.current()) { 1134 if (month == *qlin.current()) {
1132 // The month recurs 1135 // The month recurs
1133 QValueList<int> days; 1136 Q3ValueList<int> days;
1134 getMonthlyPosDays(days, qd.daysInMonth(), QDate(year, month, 1).dayOfWeek()); 1137 getMonthlyPosDays(days, qd.daysInMonth(), QDate(year, month, 1).dayOfWeek());
1135 for (QValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) { 1138 for (Q3ValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) {
1136 if (*it == day) 1139 if (*it == day)
1137 return true; 1140 return true;
1138 } 1141 }
1139 } 1142 }
1140 } 1143 }
1141 } 1144 }
1142 } 1145 }
1143 return false; 1146 return false;
1144} 1147}
1145 1148
1146bool Recurrence::recursYearlyByDay(const QDate &qd) const 1149bool Recurrence::recursYearlyByDay(const QDate &qd) const
1147{ 1150{
1148 QDate dStart = mRecurStart.date(); 1151 QDate dStart = mRecurStart.date();
1149 // calculate how many years ahead this date is from the original 1152 // calculate how many years ahead this date is from the original
1150 // event's date 1153 // event's date
1151 int yearsAhead = (qd.year() - dStart.year()); 1154 int yearsAhead = (qd.year() - dStart.year());
1152 if (yearsAhead % rFreq == 0) { 1155 if (yearsAhead % rFreq == 0) {
1153 // The date is in a year which recurs 1156 // The date is in a year which recurs
1154 if (qd >= dStart 1157 if (qd >= dStart
1155 && ((rDuration > 0 && qd <= endDate()) || 1158 && ((rDuration > 0 && qd <= endDate()) ||
1156 (rDuration == 0 && qd <= rEndDateTime.date()) || 1159 (rDuration == 0 && qd <= rEndDateTime.date()) ||
1157 rDuration == -1)) { 1160 rDuration == -1)) {
1158 // The date queried falls within the range of the event. 1161 // The date queried falls within the range of the event.
1159 int i = qd.dayOfYear(); 1162 int i = qd.dayOfYear();
1160 for (QPtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { 1163 for (Q3PtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) {
1161 if (i == *qlin.current()) 1164 if (i == *qlin.current())
1162 return true; 1165 return true;
1163 } 1166 }
1164 } 1167 }
1165 } 1168 }
1166 return false; 1169 return false;
1167} 1170}
1168 1171
1169/* Get the date of the next recurrence, after the specified date. 1172/* Get the date of the next recurrence, after the specified date.
1170 * If 'last' is non-null, '*last' is set to true if the next recurrence is the 1173 * If 'last' is non-null, '*last' is set to true if the next recurrence is the
1171 * last recurrence, else false. 1174 * last recurrence, else false.
1172 * Reply = date of next recurrence, or invalid date if none. 1175 * Reply = date of next recurrence, or invalid date if none.
@@ -1540,25 +1543,25 @@ int Recurrence::recurCalc(PeriodFunc func, QDate &enddate) const
1540 break; 1543 break;
1541 case rYearlyDay: 1544 case rYearlyDay:
1542 count = yearlyDayCalc(func, enddate); 1545 count = yearlyDayCalc(func, enddate);
1543 break; 1546 break;
1544 default: 1547 default:
1545 break; 1548 break;
1546 } 1549 }
1547 1550
1548 switch (func) { 1551 switch (func) {
1549 case END_DATE_AND_COUNT: 1552 case END_DATE_AND_COUNT:
1550 case NEXT_AFTER_DATE: 1553 case NEXT_AFTER_DATE:
1551 if (count == 0) 1554 if (count == 0)
1552 endtime = QDate(); 1555 endtime = QDateTime();
1553 else if (timed) 1556 else if (timed)
1554 enddate = endtime.date(); 1557 enddate = endtime.date();
1555 break; 1558 break;
1556 case COUNT_TO_DATE: 1559 case COUNT_TO_DATE:
1557 break; 1560 break;
1558 } 1561 }
1559 return count; 1562 return count;
1560} 1563}
1561 1564
1562/* Find count and, depending on 'func', the end date/time of a secondly recurrence. 1565/* Find count and, depending on 'func', the end date/time of a secondly recurrence.
1563 * Reply = total number of occurrences up to 'endtime', or 0 if error. 1566 * Reply = total number of occurrences up to 'endtime', or 0 if error.
1564 * If 'func' = END_DATE_AND_COUNT or NEXT_AFTER_DATE, 'endtime' is updated to the 1567 * If 'func' = END_DATE_AND_COUNT or NEXT_AFTER_DATE, 'endtime' is updated to the
@@ -1784,42 +1787,42 @@ ex:
1784/* Find count and, depending on 'func', the end date of a monthly recurrence. 1787/* Find count and, depending on 'func', the end date of a monthly recurrence.
1785 * Reply = total number of occurrences up to 'enddate', or 0 if error. 1788 * Reply = total number of occurrences up to 'enddate', or 0 if error.
1786 * If 'func' = END_DATE_AND_COUNT or NEXT_AFTER_DATE, 'enddate' is updated to the 1789 * If 'func' = END_DATE_AND_COUNT or NEXT_AFTER_DATE, 'enddate' is updated to the
1787 * recurrence end date. 1790 * recurrence end date.
1788 */ 1791 */
1789struct Recurrence::MonthlyData { 1792struct Recurrence::MonthlyData {
1790 const Recurrence *recurrence; 1793 const Recurrence *recurrence;
1791 int year; // current year 1794 int year; // current year
1792 int month; // current month 0..11 1795 int month; // current month 0..11
1793 int day; // current day of month 1..31 1796 int day; // current day of month 1..31
1794 bool varies; // true if recurring days vary between different months 1797 bool varies; // true if recurring days vary between different months
1795 private: 1798 private:
1796 QValueList<int> days28, days29, days30, days31; // recurring days in months of each length 1799 Q3ValueList<int> days28, days29, days30, days31; // recurring days in months of each length
1797 QValueList<int> *recurDays[4]; 1800 Q3ValueList<int> *recurDays[4];
1798 public: 1801 public:
1799 MonthlyData(const Recurrence* r, const QDate &date) 1802 MonthlyData(const Recurrence* r, const QDate &date)
1800 : recurrence(r), year(date.year()), month(date.month()-1), day(date.day()) 1803 : recurrence(r), year(date.year()), month(date.month()-1), day(date.day())
1801 { recurDays[0] = &days28; 1804 { recurDays[0] = &days28;
1802 recurDays[1] = &days29; 1805 recurDays[1] = &days29;
1803 recurDays[2] = &days30; 1806 recurDays[2] = &days30;
1804 recurDays[3] = &days31; 1807 recurDays[3] = &days31;
1805 varies = (recurrence->recurs == rMonthlyPos) 1808 varies = (recurrence->recurs == rMonthlyPos)
1806 ? true : recurrence->getMonthlyDayDays(days31, 31); 1809 ? true : recurrence->getMonthlyDayDays(days31, 31);
1807 } 1810 }
1808 const QValueList<int>* dayList() const { 1811 const Q3ValueList<int>* dayList() const {
1809 if (!varies) 1812 if (!varies)
1810 return &days31; 1813 return &days31;
1811 QDate startOfMonth(year, month + 1, 1); 1814 QDate startOfMonth(year, month + 1, 1);
1812 int daysInMonth = startOfMonth.daysInMonth(); 1815 int daysInMonth = startOfMonth.daysInMonth();
1813 QValueList<int>* days = recurDays[daysInMonth - 28]; 1816 Q3ValueList<int>* days = recurDays[daysInMonth - 28];
1814 if (recurrence->recurs == rMonthlyPos) 1817 if (recurrence->recurs == rMonthlyPos)
1815 recurrence->getMonthlyPosDays(*days, daysInMonth, startOfMonth.dayOfWeek()); 1818 recurrence->getMonthlyPosDays(*days, daysInMonth, startOfMonth.dayOfWeek());
1816 else if (days->isEmpty()) 1819 else if (days->isEmpty())
1817 recurrence->getMonthlyDayDays(*days, daysInMonth); 1820 recurrence->getMonthlyDayDays(*days, daysInMonth);
1818 return days; 1821 return days;
1819 } 1822 }
1820 int yearMonth() const { return year*12 + month; } 1823 int yearMonth() const { return year*12 + month; }
1821 void addMonths(int diff) { month += diff; year += month / 12; month %= 12; } 1824 void addMonths(int diff) { month += diff; year += month / 12; month %= 12; }
1822 QDate date() const { return QDate(year, month + 1, day); } 1825 QDate date() const { return QDate(year, month + 1, day); }
1823}; 1826};
1824 1827
1825int Recurrence::monthlyCalc(PeriodFunc func, QDate &enddate) const 1828int Recurrence::monthlyCalc(PeriodFunc func, QDate &enddate) const
@@ -1835,26 +1838,26 @@ int Recurrence::monthlyCalc(PeriodFunc func, QDate &enddate) const
1835 case COUNT_TO_DATE: 1838 case COUNT_TO_DATE:
1836 return monthlyCalcToDate(enddate, data); 1839 return monthlyCalcToDate(enddate, data);
1837 case NEXT_AFTER_DATE: 1840 case NEXT_AFTER_DATE:
1838 return monthlyCalcNextAfter(enddate, data); 1841 return monthlyCalcNextAfter(enddate, data);
1839 } 1842 }
1840 return 0; 1843 return 0;
1841} 1844}
1842 1845
1843int Recurrence::monthlyCalcEndDate(QDate &enddate, MonthlyData &data) const 1846int Recurrence::monthlyCalcEndDate(QDate &enddate, MonthlyData &data) const
1844{ 1847{
1845 uint countTogo = rDuration + mRecurExDatesCount; 1848 uint countTogo = rDuration + mRecurExDatesCount;
1846 int countGone = 0; 1849 int countGone = 0;
1847 QValueList<int>::ConstIterator it; 1850 Q3ValueList<int>::ConstIterator it;
1848 const QValueList<int>* days = data.dayList(); 1851 const Q3ValueList<int>* days = data.dayList();
1849 1852
1850 if (data.day > 1) { 1853 if (data.day > 1) {
1851 // Check what remains of the start month 1854 // Check what remains of the start month
1852 for (it = days->begin(); it != days->end(); ++it) { 1855 for (it = days->begin(); it != days->end(); ++it) {
1853 if (*it >= data.day) { 1856 if (*it >= data.day) {
1854 ++countGone; 1857 ++countGone;
1855 if (--countTogo == 0) { 1858 if (--countTogo == 0) {
1856 data.day = *it; 1859 data.day = *it;
1857 break; 1860 break;
1858 } 1861 }
1859 } 1862 }
1860 } 1863 }
@@ -1901,26 +1904,26 @@ int Recurrence::monthlyCalcEndDate(QDate &enddate, MonthlyData &data) const
1901 enddate = data.date(); 1904 enddate = data.date();
1902 return countGone; 1905 return countGone;
1903} 1906}
1904 1907
1905int Recurrence::monthlyCalcToDate(const QDate &enddate, MonthlyData &data) const 1908int Recurrence::monthlyCalcToDate(const QDate &enddate, MonthlyData &data) const
1906{ 1909{
1907 int countGone = 0; 1910 int countGone = 0;
1908 int countMax = (rDuration > 0) ? rDuration + mRecurExDatesCount : INT_MAX; 1911 int countMax = (rDuration > 0) ? rDuration + mRecurExDatesCount : INT_MAX;
1909 int endYear = enddate.year(); 1912 int endYear = enddate.year();
1910 int endMonth = enddate.month() - 1; // zero-based 1913 int endMonth = enddate.month() - 1; // zero-based
1911 int endDay = enddate.day(); 1914 int endDay = enddate.day();
1912 int endYearMonth = endYear*12 + endMonth; 1915 int endYearMonth = endYear*12 + endMonth;
1913 QValueList<int>::ConstIterator it; 1916 Q3ValueList<int>::ConstIterator it;
1914 const QValueList<int>* days = data.dayList(); 1917 const Q3ValueList<int>* days = data.dayList();
1915 1918
1916 if (data.day > 1) { 1919 if (data.day > 1) {
1917 // Check what remains of the start month 1920 // Check what remains of the start month
1918 for (it = days->begin(); it != days->end(); ++it) { 1921 for (it = days->begin(); it != days->end(); ++it) {
1919 if (*it >= data.day) { 1922 if (*it >= data.day) {
1920 if (data.yearMonth() == endYearMonth && *it > endDay) 1923 if (data.yearMonth() == endYearMonth && *it > endDay)
1921 return countGone; 1924 return countGone;
1922 if (++countGone >= countMax) 1925 if (++countGone >= countMax)
1923 return countMax; 1926 return countMax;
1924 } 1927 }
1925 } 1928 }
1926 data.day = 1; 1929 data.day = 1;
@@ -1960,26 +1963,26 @@ int Recurrence::monthlyCalcToDate(const QDate &enddate, MonthlyData &data) const
1960 return countMax; 1963 return countMax;
1961 } 1964 }
1962 return countGone; 1965 return countGone;
1963} 1966}
1964 1967
1965int Recurrence::monthlyCalcNextAfter(QDate &enddate, MonthlyData &data) const 1968int Recurrence::monthlyCalcNextAfter(QDate &enddate, MonthlyData &data) const
1966{ 1969{
1967 uint countTogo = (rDuration > 0) ? rDuration + mRecurExDatesCount : UINT_MAX; 1970 uint countTogo = (rDuration > 0) ? rDuration + mRecurExDatesCount : UINT_MAX;
1968 int countGone = 0; 1971 int countGone = 0;
1969 int endYear = enddate.year(); 1972 int endYear = enddate.year();
1970 int endDay = enddate.day(); 1973 int endDay = enddate.day();
1971 int endYearMonth = endYear*12 + enddate.month() - 1; 1974 int endYearMonth = endYear*12 + enddate.month() - 1;
1972 QValueList<int>::ConstIterator it; 1975 Q3ValueList<int>::ConstIterator it;
1973 const QValueList<int>* days = data.dayList(); 1976 const Q3ValueList<int>* days = data.dayList();
1974 1977
1975 if (data.day > 1) { 1978 if (data.day > 1) {
1976 // Check what remains of the start month 1979 // Check what remains of the start month
1977 for (it = days->begin(); it != days->end(); ++it) { 1980 for (it = days->begin(); it != days->end(); ++it) {
1978 if (*it >= data.day) { 1981 if (*it >= data.day) {
1979 ++countGone; 1982 ++countGone;
1980 if (data.yearMonth() == endYearMonth && *it > endDay) { 1983 if (data.yearMonth() == endYearMonth && *it > endDay) {
1981 data.day = *it; 1984 data.day = *it;
1982 goto ex; 1985 goto ex;
1983 } 1986 }
1984 if (--countTogo == 0) 1987 if (--countTogo == 0)
1985 return 0; 1988 return 0;
@@ -2043,35 +2046,35 @@ ex:
2043 * Reply = total number of occurrences up to 'enddate', or 0 if error. 2046 * Reply = total number of occurrences up to 'enddate', or 0 if error.
2044 * If 'func' = END_DATE_AND_COUNT or NEXT_AFTER_DATE, 'enddate' is updated to the 2047 * If 'func' = END_DATE_AND_COUNT or NEXT_AFTER_DATE, 'enddate' is updated to the
2045 * recurrence end date. 2048 * recurrence end date.
2046 */ 2049 */
2047struct Recurrence::YearlyMonthData { 2050struct Recurrence::YearlyMonthData {
2048 const Recurrence *recurrence; 2051 const Recurrence *recurrence;
2049 int year; // current year 2052 int year; // current year
2050 int month; // current month 1..12 2053 int month; // current month 1..12
2051 int day; // current day of month 1..31 2054 int day; // current day of month 1..31
2052 bool leapyear; // true if February 29th recurs and current year is a leap year 2055 bool leapyear; // true if February 29th recurs and current year is a leap year
2053 bool feb29; // true if February 29th recurs 2056 bool feb29; // true if February 29th recurs
2054 private: 2057 private:
2055 QValueList<int> months; // recurring months in non-leap years 1..12 2058 Q3ValueList<int> months; // recurring months in non-leap years 1..12
2056 QValueList<int> leapMonths; // recurring months in leap years 1..12 2059 Q3ValueList<int> leapMonths; // recurring months in leap years 1..12
2057 public: 2060 public:
2058 YearlyMonthData(const Recurrence* r, const QDate &date) 2061 YearlyMonthData(const Recurrence* r, const QDate &date)
2059 : recurrence(r), year(date.year()), month(date.month()), day(date.day()) 2062 : recurrence(r), year(date.year()), month(date.month()), day(date.day())
2060 { feb29 = recurrence->getYearlyMonthMonths(day, months, leapMonths); 2063 { feb29 = recurrence->getYearlyMonthMonths(day, months, leapMonths);
2061 leapyear = feb29 && QDate::leapYear(year); 2064 leapyear = feb29 && QDate::leapYear(year);
2062 } 2065 }
2063 const QValueList<int>* monthList() const 2066 const Q3ValueList<int>* monthList() const
2064 { return leapyear ? &leapMonths : &months; } 2067 { return leapyear ? &leapMonths : &months; }
2065 const QValueList<int>* leapMonthList() const { return &leapMonths; } 2068 const Q3ValueList<int>* leapMonthList() const { return &leapMonths; }
2066 QDate date() const { return QDate(year, month, day); } 2069 QDate date() const { return QDate(year, month, day); }
2067}; 2070};
2068 2071
2069int Recurrence::yearlyMonthCalc(PeriodFunc func, QDate &enddate) const 2072int Recurrence::yearlyMonthCalc(PeriodFunc func, QDate &enddate) const
2070{ 2073{
2071 if (rYearNums.isEmpty()) 2074 if (rYearNums.isEmpty())
2072 return 0; 2075 return 0;
2073 YearlyMonthData data(this, mRecurStart.date()); 2076 YearlyMonthData data(this, mRecurStart.date());
2074 switch (func) { 2077 switch (func) {
2075 case END_DATE_AND_COUNT: 2078 case END_DATE_AND_COUNT:
2076 return yearlyMonthCalcEndDate(enddate, data); 2079 return yearlyMonthCalcEndDate(enddate, data);
2077 case COUNT_TO_DATE: 2080 case COUNT_TO_DATE:
@@ -2079,26 +2082,26 @@ int Recurrence::yearlyMonthCalc(PeriodFunc func, QDate &enddate) const
2079 case NEXT_AFTER_DATE: 2082 case NEXT_AFTER_DATE:
2080 return yearlyMonthCalcNextAfter(enddate, data); 2083 return yearlyMonthCalcNextAfter(enddate, data);
2081 } 2084 }
2082 return 0; 2085 return 0;
2083} 2086}
2084 2087
2085// Find total count and end date of an annual recurrence by date. 2088// Find total count and end date of an annual recurrence by date.
2086// Reply = total number of occurrences. 2089// Reply = total number of occurrences.
2087int Recurrence::yearlyMonthCalcEndDate(QDate &enddate, YearlyMonthData &data) const 2090int Recurrence::yearlyMonthCalcEndDate(QDate &enddate, YearlyMonthData &data) const
2088{ 2091{
2089 uint countTogo = rDuration + mRecurExDatesCount; 2092 uint countTogo = rDuration + mRecurExDatesCount;
2090 int countGone = 0; 2093 int countGone = 0;
2091 QValueList<int>::ConstIterator it; 2094 Q3ValueList<int>::ConstIterator it;
2092 const QValueList<int>* mons = data.monthList(); // get recurring months for this year 2095 const Q3ValueList<int>* mons = data.monthList(); // get recurring months for this year
2093 2096
2094 if (data.month > 1) { 2097 if (data.month > 1) {
2095 // Check what remains of the start year 2098 // Check what remains of the start year
2096 for (it = mons->begin(); it != mons->end(); ++it) { 2099 for (it = mons->begin(); it != mons->end(); ++it) {
2097 if (*it >= data.month) { 2100 if (*it >= data.month) {
2098 ++countGone; 2101 ++countGone;
2099 if (--countTogo == 0) { 2102 if (--countTogo == 0) {
2100 data.month = *it; 2103 data.month = *it;
2101 if (data.month == 2 && data.feb29 && !data.leapyear) { 2104 if (data.month == 2 && data.feb29 && !data.leapyear) {
2102 // The recurrence should end on February 29th, but it's a non-leap year 2105 // The recurrence should end on February 29th, but it's a non-leap year
2103 switch (mFeb29YearlyType) { 2106 switch (mFeb29YearlyType) {
2104 case rFeb28: 2107 case rFeb28:
@@ -2190,26 +2193,26 @@ int Recurrence::yearlyMonthCalcToDate(const QDate &enddate, YearlyMonthData &dat
2190 * if enddate is Feb 28th on a non-leap year. 2193 * if enddate is Feb 28th on a non-leap year.
2191 * 2) it recurs on Mar 1st in non-leap years, allow the end month to be 2194 * 2) it recurs on Mar 1st in non-leap years, allow the end month to be
2192 * adjusted to February, to simplify calculations. 2195 * adjusted to February, to simplify calculations.
2193 */ 2196 */
2194 if (data.feb29 && !QDate::leapYear(endYear) 2197 if (data.feb29 && !QDate::leapYear(endYear)
2195 && mFeb29YearlyType == rFeb28 && endDay == 28 && endMonth == 2) { 2198 && mFeb29YearlyType == rFeb28 && endDay == 28 && endMonth == 2) {
2196 } 2199 }
2197 else if (--endMonth == 0) { 2200 else if (--endMonth == 0) {
2198 endMonth = 12; 2201 endMonth = 12;
2199 --endYear; 2202 --endYear;
2200 } 2203 }
2201 } 2204 }
2202 QValueList<int>::ConstIterator it; 2205 Q3ValueList<int>::ConstIterator it;
2203 const QValueList<int>* mons = data.monthList(); 2206 const Q3ValueList<int>* mons = data.monthList();
2204 2207
2205 if (data.month > 1) { 2208 if (data.month > 1) {
2206 // Check what remains of the start year 2209 // Check what remains of the start year
2207 for (it = mons->begin(); it != mons->end(); ++it) { 2210 for (it = mons->begin(); it != mons->end(); ++it) {
2208 if (*it >= data.month) { 2211 if (*it >= data.month) {
2209 if (data.year == endYear && *it > endMonth) 2212 if (data.year == endYear && *it > endMonth)
2210 return countGone; 2213 return countGone;
2211 if (++countGone >= countMax) 2214 if (++countGone >= countMax)
2212 return countMax; 2215 return countMax;
2213 } 2216 }
2214 } 2217 }
2215 data.month = 1; 2218 data.month = 1;
@@ -2261,26 +2264,26 @@ int Recurrence::yearlyMonthCalcNextAfter(QDate &enddate, YearlyMonthData &data)
2261 bool mar1TooEarly = false; 2264 bool mar1TooEarly = false;
2262 bool feb28ok = false; 2265 bool feb28ok = false;
2263 if (endDay < data.day) { 2266 if (endDay < data.day) {
2264 if (data.feb29 && mFeb29YearlyType == rMar1 && endMonth == 3) 2267 if (data.feb29 && mFeb29YearlyType == rMar1 && endMonth == 3)
2265 mar1TooEarly = true; 2268 mar1TooEarly = true;
2266 if (data.feb29 && mFeb29YearlyType == rFeb28 && endMonth == 2 && endDay == 28) 2269 if (data.feb29 && mFeb29YearlyType == rFeb28 && endMonth == 2 && endDay == 28)
2267 feb28ok = true; 2270 feb28ok = true;
2268 else if (--endMonth == 0) { 2271 else if (--endMonth == 0) {
2269 endMonth = 12; 2272 endMonth = 12;
2270 --endYear; 2273 --endYear;
2271 } 2274 }
2272 } 2275 }
2273 QValueList<int>::ConstIterator it; 2276 Q3ValueList<int>::ConstIterator it;
2274 const QValueList<int>* mons = data.monthList(); 2277 const Q3ValueList<int>* mons = data.monthList();
2275 2278
2276 if (data.month > 1) { 2279 if (data.month > 1) {
2277 // Check what remains of the start year 2280 // Check what remains of the start year
2278 for (it = mons->begin(); it != mons->end(); ++it) { 2281 for (it = mons->begin(); it != mons->end(); ++it) {
2279 if (*it >= data.month) { 2282 if (*it >= data.month) {
2280 ++countGone; 2283 ++countGone;
2281 if (data.year == endYear 2284 if (data.year == endYear
2282 && ( *it > endMonth && (*it > 3 || !mar1TooEarly) 2285 && ( *it > endMonth && (*it > 3 || !mar1TooEarly)
2283 || *it == 2 && feb28ok && data.leapyear)) { 2286 || *it == 2 && feb28ok && data.leapyear)) {
2284 if (*it == 2 && data.feb29 && !data.leapyear) { 2287 if (*it == 2 && data.feb29 && !data.leapyear) {
2285 // The next recurrence should be on February 29th, but it's a non-leap year 2288 // The next recurrence should be on February 29th, but it's a non-leap year
2286 switch (mFeb29YearlyType) { 2289 switch (mFeb29YearlyType) {
@@ -2381,33 +2384,33 @@ ex:
2381 * If 'func' = END_DATE_AND_COUNT or NEXT_AFTER_DATE, 'enddate' is updated to the 2384 * If 'func' = END_DATE_AND_COUNT or NEXT_AFTER_DATE, 'enddate' is updated to the
2382 * recurrence end date. 2385 * recurrence end date.
2383 */ 2386 */
2384struct Recurrence::YearlyPosData { 2387struct Recurrence::YearlyPosData {
2385 const Recurrence *recurrence; 2388 const Recurrence *recurrence;
2386 int year; // current year 2389 int year; // current year
2387 int month; // current month 1..12 2390 int month; // current month 1..12
2388 int day; // current day of month 1..31 2391 int day; // current day of month 1..31
2389 int daysPerMonth; // number of days which recur each month, or -1 if variable 2392 int daysPerMonth; // number of days which recur each month, or -1 if variable
2390 int count; // number of days which recur each year, or -1 if variable 2393 int count; // number of days which recur each year, or -1 if variable
2391 bool varies; // true if number of days varies from year to year 2394 bool varies; // true if number of days varies from year to year
2392 private: 2395 private:
2393 mutable QValueList<int> days; 2396 mutable Q3ValueList<int> days;
2394 public: 2397 public:
2395 YearlyPosData(const Recurrence* r, const QDate &date) 2398 YearlyPosData(const Recurrence* r, const QDate &date)
2396 : recurrence(r), year(date.year()), month(date.month()), day(date.day()), count(-1) 2399 : recurrence(r), year(date.year()), month(date.month()), day(date.day()), count(-1)
2397 { if ((daysPerMonth = r->countMonthlyPosDays()) > 0) 2400 { if ((daysPerMonth = r->countMonthlyPosDays()) > 0)
2398 count = daysPerMonth * r->rYearNums.count(); 2401 count = daysPerMonth * r->rYearNums.count();
2399 varies = (daysPerMonth < 0); 2402 varies = (daysPerMonth < 0);
2400 } 2403 }
2401 const QValueList<int>* dayList() const { 2404 const Q3ValueList<int>* dayList() const {
2402 QDate startOfMonth(year, month, 1); 2405 QDate startOfMonth(year, month, 1);
2403 recurrence->getMonthlyPosDays(days, startOfMonth.daysInMonth(), startOfMonth.dayOfWeek()); 2406 recurrence->getMonthlyPosDays(days, startOfMonth.daysInMonth(), startOfMonth.dayOfWeek());
2404 return &days; 2407 return &days;
2405 } 2408 }
2406 int yearMonth() const { return year*12 + month - 1; } 2409 int yearMonth() const { return year*12 + month - 1; }
2407 void addMonths(int diff) { month += diff - 1; year += month / 12; month = month % 12 + 1; } 2410 void addMonths(int diff) { month += diff - 1; year += month / 12; month = month % 12 + 1; }
2408 QDate date() const { return QDate(year, month, day); } 2411 QDate date() const { return QDate(year, month, day); }
2409}; 2412};
2410 2413
2411int Recurrence::yearlyPosCalc(PeriodFunc func, QDate &enddate) const 2414int Recurrence::yearlyPosCalc(PeriodFunc func, QDate &enddate) const
2412{ 2415{
2413 if (rYearNums.isEmpty() || rMonthPositions.isEmpty()) 2416 if (rYearNums.isEmpty() || rMonthPositions.isEmpty())
@@ -2419,30 +2422,30 @@ int Recurrence::yearlyPosCalc(PeriodFunc func, QDate &enddate) const
2419 case COUNT_TO_DATE: 2422 case COUNT_TO_DATE:
2420 return yearlyPosCalcToDate(enddate, data); 2423 return yearlyPosCalcToDate(enddate, data);
2421 case NEXT_AFTER_DATE: 2424 case NEXT_AFTER_DATE:
2422 return yearlyPosCalcNextAfter(enddate, data); 2425 return yearlyPosCalcNextAfter(enddate, data);
2423 } 2426 }
2424 return 0; 2427 return 0;
2425} 2428}
2426 2429
2427int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const 2430int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const
2428{ 2431{
2429 uint countTogo = rDuration + mRecurExDatesCount; 2432 uint countTogo = rDuration + mRecurExDatesCount;
2430 int countGone = 0; 2433 int countGone = 0;
2431 QValueList<int>::ConstIterator id; 2434 Q3ValueList<int>::ConstIterator id;
2432 const QValueList<int>* days; 2435 const Q3ValueList<int>* days;
2433 2436
2434 if (data.month > 1 || data.day > 1) { 2437 if (data.month > 1 || data.day > 1) {
2435 // Check what remains of the start year 2438 // Check what remains of the start year
2436 for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { 2439 for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) {
2437 if (*im.current() >= data.month) { 2440 if (*im.current() >= data.month) {
2438 // Check what remains of the start month 2441 // Check what remains of the start month
2439 if (data.day > 1 || data.varies 2442 if (data.day > 1 || data.varies
2440 || static_cast<uint>(data.daysPerMonth) >= countTogo) { 2443 || static_cast<uint>(data.daysPerMonth) >= countTogo) {
2441 data.month = *im.current(); 2444 data.month = *im.current();
2442 days = data.dayList(); 2445 days = data.dayList();
2443 for (id = days->begin(); id != days->end(); ++id) { 2446 for (id = days->begin(); id != days->end(); ++id) {
2444 if (*id >= data.day) { 2447 if (*id >= data.day) {
2445 ++countGone; 2448 ++countGone;
2446 if (--countTogo == 0) { 2449 if (--countTogo == 0) {
2447 data.month = *im.current(); 2450 data.month = *im.current();
2448 data.day = *id; 2451 data.day = *id;
@@ -2457,25 +2460,25 @@ int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const
2457 countTogo -= data.daysPerMonth; 2460 countTogo -= data.daysPerMonth;
2458 countGone += data.daysPerMonth; 2461 countGone += data.daysPerMonth;
2459 } 2462 }
2460 } 2463 }
2461 } 2464 }
2462 data.month = 1; 2465 data.month = 1;
2463 data.year += rFreq; 2466 data.year += rFreq;
2464 } 2467 }
2465 2468
2466 if (data.varies) { 2469 if (data.varies) {
2467 // The number of recurrences varies from year to year. 2470 // The number of recurrences varies from year to year.
2468 for ( ; ; ) { 2471 for ( ; ; ) {
2469 for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { 2472 for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) {
2470 data.month = *im.current(); 2473 data.month = *im.current();
2471 days = data.dayList(); 2474 days = data.dayList();
2472 int n = days->count(); 2475 int n = days->count();
2473 if (static_cast<uint>(n) >= countTogo) { 2476 if (static_cast<uint>(n) >= countTogo) {
2474 // Check the last month in the recurrence 2477 // Check the last month in the recurrence
2475 for (id = days->begin(); id != days->end(); ++id) { 2478 for (id = days->begin(); id != days->end(); ++id) {
2476 ++countGone; 2479 ++countGone;
2477 if (--countTogo == 0) { 2480 if (--countTogo == 0) {
2478 data.day = *id; 2481 data.day = *id;
2479 goto ex; 2482 goto ex;
2480 } 2483 }
2481 } 2484 }
@@ -2487,25 +2490,25 @@ int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const
2487 } 2490 }
2488 } else { 2491 } else {
2489 // The number of recurrences is the same every year, 2492 // The number of recurrences is the same every year,
2490 // so skip the year-by-year check. 2493 // so skip the year-by-year check.
2491 // Skip the remaining whole years, but leave at least 2494 // Skip the remaining whole years, but leave at least
2492 // 1 recurrence remaining, in order to get its date. 2495 // 1 recurrence remaining, in order to get its date.
2493 int wholeYears = (countTogo - 1) / data.count; 2496 int wholeYears = (countTogo - 1) / data.count;
2494 data.year += wholeYears * rFreq; 2497 data.year += wholeYears * rFreq;
2495 countGone += wholeYears * data.count; 2498 countGone += wholeYears * data.count;
2496 countTogo -= wholeYears * data.count; 2499 countTogo -= wholeYears * data.count;
2497 2500
2498 // Check the last year in the recurrence. 2501 // Check the last year in the recurrence.
2499 for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { 2502 for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) {
2500 if (static_cast<uint>(data.daysPerMonth) >= countTogo) { 2503 if (static_cast<uint>(data.daysPerMonth) >= countTogo) {
2501 // Check the last month in the recurrence 2504 // Check the last month in the recurrence
2502 data.month = *im.current(); 2505 data.month = *im.current();
2503 days = data.dayList(); 2506 days = data.dayList();
2504 for (id = days->begin(); id != days->end(); ++id) { 2507 for (id = days->begin(); id != days->end(); ++id) {
2505 ++countGone; 2508 ++countGone;
2506 if (--countTogo == 0) { 2509 if (--countTogo == 0) {
2507 data.day = *id; 2510 data.day = *id;
2508 goto ex; 2511 goto ex;
2509 } 2512 }
2510 } 2513 }
2511 } 2514 }
@@ -2522,30 +2525,30 @@ ex:
2522int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) const 2525int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) const
2523{ 2526{
2524 int countGone = 0; 2527 int countGone = 0;
2525 int countMax = (rDuration > 0) ? rDuration + mRecurExDatesCount : INT_MAX; 2528 int countMax = (rDuration > 0) ? rDuration + mRecurExDatesCount : INT_MAX;
2526 int endYear = enddate.year(); 2529 int endYear = enddate.year();
2527 int endMonth = enddate.month(); 2530 int endMonth = enddate.month();
2528 int endDay = enddate.day(); 2531 int endDay = enddate.day();
2529 if (endDay < data.day && --endMonth == 0) { 2532 if (endDay < data.day && --endMonth == 0) {
2530 endMonth = 12; 2533 endMonth = 12;
2531 --endYear; 2534 --endYear;
2532 } 2535 }
2533 int endYearMonth = endYear*12 + endMonth; 2536 int endYearMonth = endYear*12 + endMonth;
2534 QValueList<int>::ConstIterator id; 2537 Q3ValueList<int>::ConstIterator id;
2535 const QValueList<int>* days; 2538 const Q3ValueList<int>* days;
2536 2539
2537 if (data.month > 1 || data.day > 1) { 2540 if (data.month > 1 || data.day > 1) {
2538 // Check what remains of the start year 2541 // Check what remains of the start year
2539 for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { 2542 for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) {
2540 if (*im.current() >= data.month) { 2543 if (*im.current() >= data.month) {
2541 data.month = *im.current(); 2544 data.month = *im.current();
2542 if (data.yearMonth() > endYearMonth) 2545 if (data.yearMonth() > endYearMonth)
2543 return countGone; 2546 return countGone;
2544 // Check what remains of the start month 2547 // Check what remains of the start month
2545 bool lastMonth = (data.yearMonth() == endYearMonth); 2548 bool lastMonth = (data.yearMonth() == endYearMonth);
2546 if (lastMonth || data.day > 1 || data.varies) { 2549 if (lastMonth || data.day > 1 || data.varies) {
2547 days = data.dayList(); 2550 days = data.dayList();
2548 if (lastMonth || data.day > 1) { 2551 if (lastMonth || data.day > 1) {
2549 for (id = days->begin(); id != days->end(); ++id) { 2552 for (id = days->begin(); id != days->end(); ++id) {
2550 if (*id >= data.day) { 2553 if (*id >= data.day) {
2551 if (lastMonth && *id > endDay) 2554 if (lastMonth && *id > endDay)
@@ -2567,25 +2570,25 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c
2567 if (countGone >= countMax) 2570 if (countGone >= countMax)
2568 return countMax; 2571 return countMax;
2569 } 2572 }
2570 } 2573 }
2571 } 2574 }
2572 data.month = 1; 2575 data.month = 1;
2573 data.year += rFreq; 2576 data.year += rFreq;
2574 } 2577 }
2575 2578
2576 if (data.varies) { 2579 if (data.varies) {
2577 // The number of recurrences varies from year to year. 2580 // The number of recurrences varies from year to year.
2578 for ( ; ; ) { 2581 for ( ; ; ) {
2579 for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { 2582 for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) {
2580 data.month = *im.current(); 2583 data.month = *im.current();
2581 days = data.dayList(); 2584 days = data.dayList();
2582 if (data.yearMonth() >= endYearMonth) { 2585 if (data.yearMonth() >= endYearMonth) {
2583 if (data.yearMonth() > endYearMonth) 2586 if (data.yearMonth() > endYearMonth)
2584 return countGone; 2587 return countGone;
2585 // Check the last month in the recurrence 2588 // Check the last month in the recurrence
2586 for (id = days->begin(); id != days->end(); ++id) { 2589 for (id = days->begin(); id != days->end(); ++id) {
2587 if (*id > endDay) 2590 if (*id > endDay)
2588 return countGone; 2591 return countGone;
2589 if (++countGone >= countMax) 2592 if (++countGone >= countMax)
2590 return countMax; 2593 return countMax;
2591 } 2594 }
@@ -2602,25 +2605,25 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c
2602 // so skip the year-by-year check. 2605 // so skip the year-by-year check.
2603 // Skip the remaining whole years, but leave at least 2606 // Skip the remaining whole years, but leave at least
2604 // 1 recurrence remaining, in order to get its date. 2607 // 1 recurrence remaining, in order to get its date.
2605 int wholeYears = endYear - data.year; 2608 int wholeYears = endYear - data.year;
2606 countGone += (wholeYears / rFreq) * data.count; 2609 countGone += (wholeYears / rFreq) * data.count;
2607 if (countGone >= countMax) 2610 if (countGone >= countMax)
2608 return countMax; 2611 return countMax;
2609 if (wholeYears % rFreq) 2612 if (wholeYears % rFreq)
2610 return countGone; // end year isn't a recurrence year 2613 return countGone; // end year isn't a recurrence year
2611 data.year = endYear; 2614 data.year = endYear;
2612 2615
2613 // Check the last year in the recurrence. 2616 // Check the last year in the recurrence.
2614 for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { 2617 for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) {
2615 data.month = *im.current(); 2618 data.month = *im.current();
2616 if (data.month >= endMonth) { 2619 if (data.month >= endMonth) {
2617 if (data.month > endMonth) 2620 if (data.month > endMonth)
2618 return countGone; 2621 return countGone;
2619 // Check the last month in the recurrence 2622 // Check the last month in the recurrence
2620 days = data.dayList(); 2623 days = data.dayList();
2621 for (id = days->begin(); id != days->end(); ++id) { 2624 for (id = days->begin(); id != days->end(); ++id) {
2622 if (*id > endDay) 2625 if (*id > endDay)
2623 return countGone; 2626 return countGone;
2624 if (++countGone >= countMax) 2627 if (++countGone >= countMax)
2625 return countMax; 2628 return countMax;
2626 } 2629 }
@@ -2637,32 +2640,32 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c
2637int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) const 2640int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) const
2638{ 2641{
2639 uint countTogo = (rDuration > 0) ? rDuration + mRecurExDatesCount : UINT_MAX; 2642 uint countTogo = (rDuration > 0) ? rDuration + mRecurExDatesCount : UINT_MAX;
2640 int countGone = 0; 2643 int countGone = 0;
2641 int endYear = enddate.year(); 2644 int endYear = enddate.year();
2642 int endMonth = enddate.month(); 2645 int endMonth = enddate.month();
2643 int endDay = enddate.day(); 2646 int endDay = enddate.day();
2644 if (endDay < data.day && --endMonth == 0) { 2647 if (endDay < data.day && --endMonth == 0) {
2645 endMonth = 12; 2648 endMonth = 12;
2646 --endYear; 2649 --endYear;
2647 } 2650 }
2648 int endYearMonth = endYear*12 + endMonth; 2651 int endYearMonth = endYear*12 + endMonth;
2649 QValueList<int>::ConstIterator id; 2652 Q3ValueList<int>::ConstIterator id;
2650 const QValueList<int>* days; 2653 const Q3ValueList<int>* days;
2651 2654
2652 if (data.varies) { 2655 if (data.varies) {
2653 // The number of recurrences varies from year to year. 2656 // The number of recurrences varies from year to year.
2654 for ( ; ; ) { 2657 for ( ; ; ) {
2655 // Check the next year 2658 // Check the next year
2656 for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { 2659 for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) {
2657 if (*im.current() >= data.month) { 2660 if (*im.current() >= data.month) {
2658 // Check the next month 2661 // Check the next month
2659 data.month = *im.current(); 2662 data.month = *im.current();
2660 int ended = data.yearMonth() - endYearMonth; 2663 int ended = data.yearMonth() - endYearMonth;
2661 days = data.dayList(); 2664 days = data.dayList();
2662 if (ended >= 0 || data.day > 1) { 2665 if (ended >= 0 || data.day > 1) {
2663 // This is the start or end month, so check each day 2666 // This is the start or end month, so check each day
2664 for (id = days->begin(); id != days->end(); ++id) { 2667 for (id = days->begin(); id != days->end(); ++id) {
2665 if (*id >= data.day) { 2668 if (*id >= data.day) {
2666 ++countGone; 2669 ++countGone;
2667 if (ended > 0 || (ended == 0 && *id > endDay)) { 2670 if (ended > 0 || (ended == 0 && *id > endDay)) {
2668 data.day = *id; 2671 data.day = *id;
@@ -2680,25 +2683,25 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons
2680 countGone += n; 2683 countGone += n;
2681 } 2684 }
2682 data.day = 1; // we've checked the start month now 2685 data.day = 1; // we've checked the start month now
2683 } 2686 }
2684 } 2687 }
2685 data.month = 1; // we've checked the start year now 2688 data.month = 1; // we've checked the start year now
2686 data.year += rFreq; 2689 data.year += rFreq;
2687 } 2690 }
2688 } else { 2691 } else {
2689 // The number of recurrences is the same every year. 2692 // The number of recurrences is the same every year.
2690 if (data.month > 1 || data.day > 1) { 2693 if (data.month > 1 || data.day > 1) {
2691 // Check what remains of the start year 2694 // Check what remains of the start year
2692 for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { 2695 for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) {
2693 if (*im.current() >= data.month) { 2696 if (*im.current() >= data.month) {
2694 // Check what remains of the start month 2697 // Check what remains of the start month
2695 data.month = *im.current(); 2698 data.month = *im.current();
2696 int ended = data.yearMonth() - endYearMonth; 2699 int ended = data.yearMonth() - endYearMonth;
2697 if (ended >= 0 || data.day > 1) { 2700 if (ended >= 0 || data.day > 1) {
2698 // This is the start or end month, so check each day 2701 // This is the start or end month, so check each day
2699 days = data.dayList(); 2702 days = data.dayList();
2700 for (id = days->begin(); id != days->end(); ++id) { 2703 for (id = days->begin(); id != days->end(); ++id) {
2701 if (*id >= data.day) { 2704 if (*id >= data.day) {
2702 ++countGone; 2705 ++countGone;
2703 if (ended > 0 || (ended == 0 && *id > endDay)) { 2706 if (ended > 0 || (ended == 0 && *id > endDay)) {
2704 data.day = *id; 2707 data.day = *id;
@@ -2725,25 +2728,25 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons
2725 && *rYearNums.getLast() <= endMonth) 2728 && *rYearNums.getLast() <= endMonth)
2726 ++recurYears; // required year is after endYear 2729 ++recurYears; // required year is after endYear
2727 if (recurYears) { 2730 if (recurYears) {
2728 int n = recurYears * data.count; 2731 int n = recurYears * data.count;
2729 if (static_cast<uint>(n) > countTogo) 2732 if (static_cast<uint>(n) > countTogo)
2730 return 0; // reached end of recurrence 2733 return 0; // reached end of recurrence
2731 countTogo -= n; 2734 countTogo -= n;
2732 countGone += n; 2735 countGone += n;
2733 data.year += recurYears * rFreq; 2736 data.year += recurYears * rFreq;
2734 } 2737 }
2735 2738
2736 // Check the last year in the recurrence 2739 // Check the last year in the recurrence
2737 for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { 2740 for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) {
2738 data.month = *im.current(); 2741 data.month = *im.current();
2739 int ended = data.yearMonth() - endYearMonth; 2742 int ended = data.yearMonth() - endYearMonth;
2740 if (ended >= 0) { 2743 if (ended >= 0) {
2741 // This is the end month, so check each day 2744 // This is the end month, so check each day
2742 days = data.dayList(); 2745 days = data.dayList();
2743 for (id = days->begin(); id != days->end(); ++id) { 2746 for (id = days->begin(); id != days->end(); ++id) {
2744 ++countGone; 2747 ++countGone;
2745 if (ended > 0 || (ended == 0 && *id > endDay)) { 2748 if (ended > 0 || (ended == 0 && *id > endDay)) {
2746 data.day = *id; 2749 data.day = *id;
2747 goto ex; 2750 goto ex;
2748 } 2751 }
2749 if (--countTogo == 0) 2752 if (--countTogo == 0)
@@ -2799,25 +2802,25 @@ int Recurrence::yearlyDayCalc(PeriodFunc func, QDate &enddate) const
2799 } 2802 }
2800 return 0; 2803 return 0;
2801} 2804}
2802 2805
2803int Recurrence::yearlyDayCalcEndDate(QDate &enddate, YearlyDayData &data) const 2806int Recurrence::yearlyDayCalcEndDate(QDate &enddate, YearlyDayData &data) const
2804{ 2807{
2805 uint countTogo = rDuration + mRecurExDatesCount; 2808 uint countTogo = rDuration + mRecurExDatesCount;
2806 int countGone = 0; 2809 int countGone = 0;
2807 2810
2808 if (data.day > 1) { 2811 if (data.day > 1) {
2809 // Check what remains of the start year 2812 // Check what remains of the start year
2810 bool leapOK = data.isMaxDayCount(); 2813 bool leapOK = data.isMaxDayCount();
2811 for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { 2814 for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) {
2812 int d = *it.current(); 2815 int d = *it.current();
2813 if (d >= data.day && (leapOK || d < 366)) { 2816 if (d >= data.day && (leapOK || d < 366)) {
2814 ++countGone; 2817 ++countGone;
2815 if (--countTogo == 0) { 2818 if (--countTogo == 0) {
2816 data.day = d; 2819 data.day = d;
2817 goto ex; 2820 goto ex;
2818 } 2821 }
2819 } 2822 }
2820 } 2823 }
2821 data.day = 1; 2824 data.day = 1;
2822 data.year += rFreq; 2825 data.year += rFreq;
2823 } 2826 }
@@ -2837,48 +2840,48 @@ int Recurrence::yearlyDayCalcEndDate(QDate &enddate, YearlyDayData &data) const
2837 // The number of recurrences is the same every year, 2840 // The number of recurrences is the same every year,
2838 // so skip the year-by-year check. 2841 // so skip the year-by-year check.
2839 // Skip the remaining whole years, but leave at least 2842 // Skip the remaining whole years, but leave at least
2840 // 1 recurrence remaining, in order to get its date. 2843 // 1 recurrence remaining, in order to get its date.
2841 int daysPerYear = rYearNums.count(); 2844 int daysPerYear = rYearNums.count();
2842 int wholeYears = (countTogo - 1) / daysPerYear; 2845 int wholeYears = (countTogo - 1) / daysPerYear;
2843 data.year += wholeYears * rFreq; 2846 data.year += wholeYears * rFreq;
2844 countGone += wholeYears * daysPerYear; 2847 countGone += wholeYears * daysPerYear;
2845 countTogo -= wholeYears * daysPerYear; 2848 countTogo -= wholeYears * daysPerYear;
2846 } 2849 }
2847 if (countTogo) { 2850 if (countTogo) {
2848 // Check the last year in the recurrence 2851 // Check the last year in the recurrence
2849 for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { 2852 for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) {
2850 ++countGone; 2853 ++countGone;
2851 if (--countTogo == 0) { 2854 if (--countTogo == 0) {
2852 data.day = *it.current(); 2855 data.day = *it.current();
2853 break; 2856 break;
2854 } 2857 }
2855 } 2858 }
2856 } 2859 }
2857ex: 2860ex:
2858 enddate = data.date(); 2861 enddate = data.date();
2859 return countGone; 2862 return countGone;
2860} 2863}
2861 2864
2862int Recurrence::yearlyDayCalcToDate(const QDate &enddate, YearlyDayData &data) const 2865int Recurrence::yearlyDayCalcToDate(const QDate &enddate, YearlyDayData &data) const
2863{ 2866{
2864 int countGone = 0; 2867 int countGone = 0;
2865 int countMax = (rDuration > 0) ? rDuration + mRecurExDatesCount : INT_MAX; 2868 int countMax = (rDuration > 0) ? rDuration + mRecurExDatesCount : INT_MAX;
2866 int endYear = enddate.year(); 2869 int endYear = enddate.year();
2867 int endDay = enddate.dayOfYear(); 2870 int endDay = enddate.dayOfYear();
2868 2871
2869 if (data.day > 1) { 2872 if (data.day > 1) {
2870 // Check what remains of the start year 2873 // Check what remains of the start year
2871 bool leapOK = data.isMaxDayCount(); 2874 bool leapOK = data.isMaxDayCount();
2872 for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { 2875 for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) {
2873 int d = *it.current(); 2876 int d = *it.current();
2874 if (d >= data.day && (leapOK || d < 366)) { 2877 if (d >= data.day && (leapOK || d < 366)) {
2875 if (data.year == endYear && d > endDay) 2878 if (data.year == endYear && d > endDay)
2876 return countGone; 2879 return countGone;
2877 if (++countGone >= countMax) 2880 if (++countGone >= countMax)
2878 return countMax; 2881 return countMax;
2879 } 2882 }
2880 } 2883 }
2881 data.day = 1; 2884 data.day = 1;
2882 data.year += rFreq; 2885 data.year += rFreq;
2883 } 2886 }
2884 2887
@@ -2899,45 +2902,45 @@ int Recurrence::yearlyDayCalcToDate(const QDate &enddate, YearlyDayData &data) c
2899 // Skip the remaining whole years. 2902 // Skip the remaining whole years.
2900 int wholeYears = endYear - data.year; 2903 int wholeYears = endYear - data.year;
2901 countGone += (wholeYears / rFreq) * rYearNums.count(); 2904 countGone += (wholeYears / rFreq) * rYearNums.count();
2902 if (countGone >= countMax) 2905 if (countGone >= countMax)
2903 return countMax; 2906 return countMax;
2904 if (wholeYears % rFreq) 2907 if (wholeYears % rFreq)
2905 return countGone; // end year isn't a recurrence year 2908 return countGone; // end year isn't a recurrence year
2906 data.year = endYear; 2909 data.year = endYear;
2907 } 2910 }
2908 2911
2909 if (data.year <= endYear) { 2912 if (data.year <= endYear) {
2910 // Check the last year in the recurrence 2913 // Check the last year in the recurrence
2911 for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { 2914 for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) {
2912 if (*it.current() > endDay) 2915 if (*it.current() > endDay)
2913 return countGone; 2916 return countGone;
2914 if (++countGone >= countMax) 2917 if (++countGone >= countMax)
2915 return countMax; 2918 return countMax;
2916 } 2919 }
2917 } 2920 }
2918 return countGone; 2921 return countGone;
2919} 2922}
2920 2923
2921int Recurrence::yearlyDayCalcNextAfter(QDate &enddate, YearlyDayData &data) const 2924int Recurrence::yearlyDayCalcNextAfter(QDate &enddate, YearlyDayData &data) const
2922{ 2925{
2923 uint countTogo = (rDuration > 0) ? rDuration + mRecurExDatesCount : UINT_MAX; 2926 uint countTogo = (rDuration > 0) ? rDuration + mRecurExDatesCount : UINT_MAX;
2924 int countGone = 0; 2927 int countGone = 0;
2925 int endYear = enddate.year(); 2928 int endYear = enddate.year();
2926 int endDay = enddate.dayOfYear(); 2929 int endDay = enddate.dayOfYear();
2927 2930
2928 if (data.day > 1) { 2931 if (data.day > 1) {
2929 // Check what remains of the start year 2932 // Check what remains of the start year
2930 bool leapOK = data.isMaxDayCount(); 2933 bool leapOK = data.isMaxDayCount();
2931 for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { 2934 for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) {
2932 int d = *it.current(); 2935 int d = *it.current();
2933 if (d >= data.day && (leapOK || d < 366)) { 2936 if (d >= data.day && (leapOK || d < 366)) {
2934 ++countGone; 2937 ++countGone;
2935 if (data.year == endYear && d > endDay) { 2938 if (data.year == endYear && d > endDay) {
2936 data.day = d; 2939 data.day = d;
2937 goto ex; 2940 goto ex;
2938 } 2941 }
2939 if (--countTogo == 0) 2942 if (--countTogo == 0)
2940 return 0; 2943 return 0;
2941 } 2944 }
2942 } 2945 }
2943 data.day = 1; 2946 data.day = 1;
@@ -2968,49 +2971,49 @@ int Recurrence::yearlyDayCalcNextAfter(QDate &enddate, YearlyDayData &data) cons
2968 ++recurYears; // required year is after endYear 2971 ++recurYears; // required year is after endYear
2969 if (recurYears) { 2972 if (recurYears) {
2970 int n = recurYears * daysPerYear; 2973 int n = recurYears * daysPerYear;
2971 if (static_cast<uint>(n) > countTogo) 2974 if (static_cast<uint>(n) > countTogo)
2972 return 0; // reached end of recurrence 2975 return 0; // reached end of recurrence
2973 countTogo -= n; 2976 countTogo -= n;
2974 countGone += n; 2977 countGone += n;
2975 data.year += recurYears * rFreq; 2978 data.year += recurYears * rFreq;
2976 } 2979 }
2977 } 2980 }
2978 2981
2979 // Check the last year in the recurrence 2982 // Check the last year in the recurrence
2980 for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { 2983 for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) {
2981 ++countGone; 2984 ++countGone;
2982 int d = *it.current(); 2985 int d = *it.current();
2983 if (data.year > endYear || d > endDay) { 2986 if (data.year > endYear || d > endDay) {
2984 data.day = d; 2987 data.day = d;
2985 break; 2988 break;
2986 } 2989 }
2987 if (--countTogo == 0) 2990 if (--countTogo == 0)
2988 return 0; 2991 return 0;
2989 } 2992 }
2990ex: 2993ex:
2991 enddate = data.date(); 2994 enddate = data.date();
2992 return countGone; 2995 return countGone;
2993} 2996}
2994 2997
2995// Get the days in this month which recur, in numerical order. 2998// Get the days in this month which recur, in numerical order.
2996// Parameters: daysInMonth = number of days in this month 2999// Parameters: daysInMonth = number of days in this month
2997// startDayOfWeek = day of week for first day of month. 3000// startDayOfWeek = day of week for first day of month.
2998void Recurrence::getMonthlyPosDays(QValueList<int> &list, int daysInMonth, int startDayOfWeek) const 3001void Recurrence::getMonthlyPosDays(Q3ValueList<int> &list, int daysInMonth, int startDayOfWeek) const
2999{ 3002{
3000 list.clear(); 3003 list.clear();
3001 int endDayOfWeek = (startDayOfWeek + daysInMonth - 2) % 7 + 1; 3004 int endDayOfWeek = (startDayOfWeek + daysInMonth - 2) % 7 + 1;
3002 // Go through the list, compiling a bit list of actual day numbers 3005 // Go through the list, compiling a bit list of actual day numbers
3003 Q_UINT32 days = 0; 3006 Q_UINT32 days = 0;
3004 for (QPtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) { 3007 for (Q3PtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) {
3005 int weeknum = pos.current()->rPos - 1; // get 0-based week number 3008 int weeknum = pos.current()->rPos - 1; // get 0-based week number
3006 QBitArray &rdays = pos.current()->rDays; 3009 QBitArray &rdays = pos.current()->rDays;
3007 if (pos.current()->negative) { 3010 if (pos.current()->negative) {
3008 // nth days before the end of the month 3011 // nth days before the end of the month
3009 for (uint i = 1; i <= 7; ++i) { 3012 for (uint i = 1; i <= 7; ++i) {
3010 if (rdays.testBit(i - 1)) { 3013 if (rdays.testBit(i - 1)) {
3011 int day = daysInMonth - weeknum*7 - (endDayOfWeek - i + 7) % 7; 3014 int day = daysInMonth - weeknum*7 - (endDayOfWeek - i + 7) % 7;
3012 if (day > 0) 3015 if (day > 0)
3013 days |= 1 << (day - 1); 3016 days |= 1 << (day - 1);
3014 } 3017 }
3015 } 3018 }
3016 } else { 3019 } else {
@@ -3030,25 +3033,25 @@ void Recurrence::getMonthlyPosDays(QValueList<int> &list, int daysInMonth, int s
3030 if (days & mask) 3033 if (days & mask)
3031 list.append(i + 1); 3034 list.append(i + 1);
3032 } 3035 }
3033} 3036}
3034 3037
3035// Get the number of days in the month which recur. 3038// Get the number of days in the month which recur.
3036// Reply = -1 if the number varies from month to month. 3039// Reply = -1 if the number varies from month to month.
3037int Recurrence::countMonthlyPosDays() const 3040int Recurrence::countMonthlyPosDays() const
3038{ 3041{
3039 int count = 0; 3042 int count = 0;
3040 Q_UINT8 positive[5] = { 0, 0, 0, 0, 0 }; 3043 Q_UINT8 positive[5] = { 0, 0, 0, 0, 0 };
3041 Q_UINT8 negative[4] = { 0, 0, 0, 0 }; 3044 Q_UINT8 negative[4] = { 0, 0, 0, 0 };
3042 for (QPtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) { 3045 for (Q3PtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) {
3043 int weeknum = pos.current()->rPos; 3046 int weeknum = pos.current()->rPos;
3044 Q_UINT8* wk; 3047 Q_UINT8* wk;
3045 if (pos.current()->negative) { 3048 if (pos.current()->negative) {
3046 // nth days before the end of the month 3049 // nth days before the end of the month
3047 if (weeknum > 4) 3050 if (weeknum > 4)
3048 return -1; // days in 5th week are often missing 3051 return -1; // days in 5th week are often missing
3049 wk = &negative[4 - weeknum]; 3052 wk = &negative[4 - weeknum];
3050 } else { 3053 } else {
3051 // nth days after the start of the month 3054 // nth days after the start of the month
3052 if (weeknum > 4) 3055 if (weeknum > 4)
3053 return -1; // days in 5th week are often missing 3056 return -1; // days in 5th week are often missing
3054 wk = &positive[weeknum - 1]; 3057 wk = &positive[weeknum - 1];
@@ -3063,30 +3066,30 @@ int Recurrence::countMonthlyPosDays() const
3063 } 3066 }
3064 // Check for any possible days which could be duplicated by 3067 // Check for any possible days which could be duplicated by
3065 // a positive and a negative position. 3068 // a positive and a negative position.
3066 for (int i = 0; i < 4; ++i) { 3069 for (int i = 0; i < 4; ++i) {
3067 if (negative[i] & (positive[i] | positive[i+1])) 3070 if (negative[i] & (positive[i] | positive[i+1]))
3068 return -1; 3071 return -1;
3069 } 3072 }
3070 return count; 3073 return count;
3071} 3074}
3072 3075
3073// Get the days in this month which recur, in numerical order. 3076// Get the days in this month which recur, in numerical order.
3074// Reply = true if day numbers varies from month to month. 3077// Reply = true if day numbers varies from month to month.
3075bool Recurrence::getMonthlyDayDays(QValueList<int> &list, int daysInMonth) const 3078bool Recurrence::getMonthlyDayDays(Q3ValueList<int> &list, int daysInMonth) const
3076{ 3079{
3077 list.clear(); 3080 list.clear();
3078 bool variable = false; 3081 bool variable = false;
3079 Q_UINT32 days = 0; 3082 Q_UINT32 days = 0;
3080 for (QPtrListIterator<int> it(rMonthDays); it.current(); ++it) { 3083 for (Q3PtrListIterator<int> it(rMonthDays); it.current(); ++it) {
3081 int day = *it.current(); 3084 int day = *it.current();
3082 if (day > 0) { 3085 if (day > 0) {
3083 // date in the month 3086 // date in the month
3084 if (day <= daysInMonth) 3087 if (day <= daysInMonth)
3085 days |= 1 << (day - 1); 3088 days |= 1 << (day - 1);
3086 if (day > 28 && day <= 31) 3089 if (day > 28 && day <= 31)
3087 variable = true; // this date does not appear in some months 3090 variable = true; // this date does not appear in some months
3088 } else if (day < 0) { 3091 } else if (day < 0) {
3089 // days before the end of the month 3092 // days before the end of the month
3090 variable = true; // this date varies depending on the month length 3093 variable = true; // this date varies depending on the month length
3091 day = daysInMonth + day; // zero-based day of month 3094 day = daysInMonth + day; // zero-based day of month
3092 if (day >= 0) 3095 if (day >= 0)
@@ -3097,30 +3100,30 @@ bool Recurrence::getMonthlyDayDays(QValueList<int> &list, int daysInMonth) const
3097 Q_UINT32 mask = 1; 3100 Q_UINT32 mask = 1;
3098 for (int i = 0; i < daysInMonth; mask <<= 1, ++i) { 3101 for (int i = 0; i < daysInMonth; mask <<= 1, ++i) {
3099 if (days & mask) 3102 if (days & mask)
3100 list.append(i + 1); 3103 list.append(i + 1);
3101 } 3104 }
3102 return variable; 3105 return variable;
3103} 3106}
3104 3107
3105// Get the months which recur, in numerical order, for both leap years and non-leap years. 3108// Get the months which recur, in numerical order, for both leap years and non-leap years.
3106// N.B. If February 29th recurs on March 1st in non-leap years, February (not March) is 3109// N.B. If February 29th recurs on March 1st in non-leap years, February (not March) is
3107// included in the non-leap year month list. 3110// included in the non-leap year month list.
3108// Reply = true if February 29th also recurs. 3111// Reply = true if February 29th also recurs.
3109bool Recurrence::getYearlyMonthMonths(int day, QValueList<int> &list, QValueList<int> &leaplist) const 3112bool Recurrence::getYearlyMonthMonths(int day, Q3ValueList<int> &list, Q3ValueList<int> &leaplist) const
3110{ 3113{
3111 list.clear(); 3114 list.clear();
3112 leaplist.clear(); 3115 leaplist.clear();
3113 bool feb29 = false; 3116 bool feb29 = false;
3114 for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { 3117 for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) {
3115 int month = *it.current(); 3118 int month = *it.current();
3116 if (month == 2) { 3119 if (month == 2) {
3117 if (day <= 28) { 3120 if (day <= 28) {
3118 list.append(month); // date appears in February 3121 list.append(month); // date appears in February
3119 leaplist.append(month); 3122 leaplist.append(month);
3120 } 3123 }
3121 else if (day == 29) { 3124 else if (day == 29) {
3122 // February 29th 3125 // February 29th
3123 leaplist.append(month); 3126 leaplist.append(month);
3124 switch (mFeb29YearlyType) { 3127 switch (mFeb29YearlyType) {
3125 case rFeb28: 3128 case rFeb28:
3126 case rMar1: 3129 case rMar1:
@@ -3178,94 +3181,94 @@ int Recurrence::getLastDayInWeek(int endDay, bool useWeekStart) const
3178 3181
3179/* From the recurrence monthly day number list or monthly day of week/week of 3182/* From the recurrence monthly day number list or monthly day of week/week of
3180 * month list, get the earliest day in the specified month which is >= the 3183 * month list, get the earliest day in the specified month which is >= the
3181 * earliestDate. 3184 * earliestDate.
3182 */ 3185 */
3183QDate Recurrence::getFirstDateInMonth(const QDate &earliestDate) const 3186QDate Recurrence::getFirstDateInMonth(const QDate &earliestDate) const
3184{ 3187{
3185 int earliestDay = earliestDate.day(); 3188 int earliestDay = earliestDate.day();
3186 int daysInMonth = earliestDate.daysInMonth(); 3189 int daysInMonth = earliestDate.daysInMonth();
3187 switch (recurs) { 3190 switch (recurs) {
3188 case rMonthlyDay: { 3191 case rMonthlyDay: {
3189 int minday = daysInMonth + 1; 3192 int minday = daysInMonth + 1;
3190 for (QPtrListIterator<int> it(rMonthDays); it.current(); ++it) { 3193 for (Q3PtrListIterator<int> it(rMonthDays); it.current(); ++it) {
3191 int day = *it.current(); 3194 int day = *it.current();
3192 if (day < 0) 3195 if (day < 0)
3193 day = daysInMonth + day + 1; 3196 day = daysInMonth + day + 1;
3194 if (day >= earliestDay && day < minday) 3197 if (day >= earliestDay && day < minday)
3195 minday = day; 3198 minday = day;
3196 } 3199 }
3197 if (minday <= daysInMonth) 3200 if (minday <= daysInMonth)
3198 return earliestDate.addDays(minday - earliestDay); 3201 return earliestDate.addDays(minday - earliestDay);
3199 break; 3202 break;
3200 } 3203 }
3201 case rMonthlyPos: 3204 case rMonthlyPos:
3202 case rYearlyPos: { 3205 case rYearlyPos: {
3203 QDate monthBegin(earliestDate.addDays(1 - earliestDay)); 3206 QDate monthBegin(earliestDate.addDays(1 - earliestDay));
3204 QValueList<int> dayList; 3207 Q3ValueList<int> dayList;
3205 getMonthlyPosDays(dayList, daysInMonth, monthBegin.dayOfWeek()); 3208 getMonthlyPosDays(dayList, daysInMonth, monthBegin.dayOfWeek());
3206 for (QValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) { 3209 for (Q3ValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) {
3207 if (*id >= earliestDay) 3210 if (*id >= earliestDay)
3208 return monthBegin.addDays(*id - 1); 3211 return monthBegin.addDays(*id - 1);
3209 } 3212 }
3210 break; 3213 break;
3211 } 3214 }
3212 } 3215 }
3213 return QDate(); 3216 return QDate();
3214} 3217}
3215 3218
3216/* From the recurrence monthly day number list or monthly day of week/week of 3219/* From the recurrence monthly day number list or monthly day of week/week of
3217 * month list, get the latest day in the specified month which is <= the 3220 * month list, get the latest day in the specified month which is <= the
3218 * latestDate. 3221 * latestDate.
3219 */ 3222 */
3220QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const 3223QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const
3221{ 3224{
3222 int latestDay = latestDate.day(); 3225 int latestDay = latestDate.day();
3223 int daysInMonth = latestDate.daysInMonth(); 3226 int daysInMonth = latestDate.daysInMonth();
3224 switch (recurs) { 3227 switch (recurs) {
3225 case rMonthlyDay: { 3228 case rMonthlyDay: {
3226 int maxday = -1; 3229 int maxday = -1;
3227 for (QPtrListIterator<int> it(rMonthDays); it.current(); ++it) { 3230 for (Q3PtrListIterator<int> it(rMonthDays); it.current(); ++it) {
3228 int day = *it.current(); 3231 int day = *it.current();
3229 if (day < 0) 3232 if (day < 0)
3230 day = daysInMonth + day + 1; 3233 day = daysInMonth + day + 1;
3231 if (day <= latestDay && day > maxday) 3234 if (day <= latestDay && day > maxday)
3232 maxday = day; 3235 maxday = day;
3233 } 3236 }
3234 if (maxday > 0) 3237 if (maxday > 0)
3235 return QDate(latestDate.year(), latestDate.month(), maxday); 3238 return QDate(latestDate.year(), latestDate.month(), maxday);
3236 break; 3239 break;
3237 } 3240 }
3238 case rMonthlyPos: 3241 case rMonthlyPos:
3239 case rYearlyPos: { 3242 case rYearlyPos: {
3240 QDate monthBegin(latestDate.addDays(1 - latestDay)); 3243 QDate monthBegin(latestDate.addDays(1 - latestDay));
3241 QValueList<int> dayList; 3244 Q3ValueList<int> dayList;
3242 getMonthlyPosDays(dayList, daysInMonth, monthBegin.dayOfWeek()); 3245 getMonthlyPosDays(dayList, daysInMonth, monthBegin.dayOfWeek());
3243 for (QValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) { 3246 for (Q3ValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) {
3244 if (*id <= latestDay) 3247 if (*id <= latestDay)
3245 return monthBegin.addDays(*id - 1); 3248 return monthBegin.addDays(*id - 1);
3246 } 3249 }
3247 break; 3250 break;
3248 } 3251 }
3249 } 3252 }
3250 return QDate(); 3253 return QDate();
3251} 3254}
3252 3255
3253/* From the recurrence yearly month list or yearly day list, get the earliest 3256/* From the recurrence yearly month list or yearly day list, get the earliest
3254 * month or day in the specified year which is >= the earliestDate. 3257 * month or day in the specified year which is >= the earliestDate.
3255 * Note that rYearNums is sorted in numerical order. 3258 * Note that rYearNums is sorted in numerical order.
3256 */ 3259 */
3257QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const 3260QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const
3258{ 3261{
3259 QPtrListIterator<int> it(rYearNums); 3262 Q3PtrListIterator<int> it(rYearNums);
3260 switch (recurs) { 3263 switch (recurs) {
3261 case rYearlyMonth: { 3264 case rYearlyMonth: {
3262 int day = recurStart().date().day(); 3265 int day = recurStart().date().day();
3263 int earliestYear = earliestDate.year(); 3266 int earliestYear = earliestDate.year();
3264 int earliestMonth = earliestDate.month(); 3267 int earliestMonth = earliestDate.month();
3265 int earliestDay = earliestDate.day(); 3268 int earliestDay = earliestDate.day();
3266 if (earliestDay > day) { 3269 if (earliestDay > day) {
3267 // The earliest date is later in the month than the recurrence date, 3270 // The earliest date is later in the month than the recurrence date,
3268 // so skip to the next month before starting to check 3271 // so skip to the next month before starting to check
3269 if (++earliestMonth > 12) 3272 if (++earliestMonth > 12)
3270 return QDate(); 3273 return QDate();
3271 } 3274 }
@@ -3283,34 +3286,34 @@ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const
3283 if (earliestDay <= 28) 3286 if (earliestDay <= 28)
3284 return QDate(earliestYear, 2, 28); 3287 return QDate(earliestYear, 2, 28);
3285 break; 3288 break;
3286 case rFeb29: 3289 case rFeb29:
3287 break; 3290 break;
3288 } 3291 }
3289 } 3292 }
3290 } 3293 }
3291 } 3294 }
3292 break; 3295 break;
3293 } 3296 }
3294 case rYearlyPos: { 3297 case rYearlyPos: {
3295 QValueList<int> dayList; 3298 Q3ValueList<int> dayList;
3296 int earliestYear = earliestDate.year(); 3299 int earliestYear = earliestDate.year();
3297 int earliestMonth = earliestDate.month(); 3300 int earliestMonth = earliestDate.month();
3298 int earliestDay = earliestDate.day(); 3301 int earliestDay = earliestDate.day();
3299 for ( ; it.current(); ++it) { 3302 for ( ; it.current(); ++it) {
3300 int month = *it.current(); 3303 int month = *it.current();
3301 if (month >= earliestMonth) { 3304 if (month >= earliestMonth) {
3302 QDate monthBegin(earliestYear, month, 1); 3305 QDate monthBegin(earliestYear, month, 1);
3303 getMonthlyPosDays(dayList, monthBegin.daysInMonth(), monthBegin.dayOfWeek()); 3306 getMonthlyPosDays(dayList, monthBegin.daysInMonth(), monthBegin.dayOfWeek());
3304 for (QValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) { 3307 for (Q3ValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) {
3305 if (*id >= earliestDay) 3308 if (*id >= earliestDay)
3306 return monthBegin.addDays(*id - 1); 3309 return monthBegin.addDays(*id - 1);
3307 } 3310 }
3308 earliestDay = 1; 3311 earliestDay = 1;
3309 } 3312 }
3310 } 3313 }
3311 break; 3314 break;
3312 } 3315 }
3313 case rYearlyDay: { 3316 case rYearlyDay: {
3314 int earliestDay = earliestDate.dayOfYear(); 3317 int earliestDay = earliestDate.dayOfYear();
3315 for ( ; it.current(); ++it) { 3318 for ( ; it.current(); ++it) {
3316 int day = *it.current(); 3319 int day = *it.current();
@@ -3320,25 +3323,25 @@ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const
3320 break; 3323 break;
3321 } 3324 }
3322 } 3325 }
3323 return QDate(); 3326 return QDate();
3324} 3327}
3325 3328
3326/* From the recurrence yearly month list or yearly day list, get the latest 3329/* From the recurrence yearly month list or yearly day list, get the latest
3327 * month or day in the specified year which is <= the latestDate. 3330 * month or day in the specified year which is <= the latestDate.
3328 * Note that rYearNums is sorted in numerical order. 3331 * Note that rYearNums is sorted in numerical order.
3329 */ 3332 */
3330QDate Recurrence::getLastDateInYear(const QDate &latestDate) const 3333QDate Recurrence::getLastDateInYear(const QDate &latestDate) const
3331{ 3334{
3332 QPtrListIterator<int> it(rYearNums); 3335 Q3PtrListIterator<int> it(rYearNums);
3333 switch (recurs) { 3336 switch (recurs) {
3334 case rYearlyMonth: { 3337 case rYearlyMonth: {
3335 int day = recurStart().date().day(); 3338 int day = recurStart().date().day();
3336 int latestYear = latestDate.year(); 3339 int latestYear = latestDate.year();
3337 int latestMonth = latestDate.month(); 3340 int latestMonth = latestDate.month();
3338 if (latestDate.day() > day) { 3341 if (latestDate.day() > day) {
3339 // The latest date is earlier in the month than the recurrence date, 3342 // The latest date is earlier in the month than the recurrence date,
3340 // so skip to the previous month before starting to check 3343 // so skip to the previous month before starting to check
3341 if (--latestMonth <= 0) 3344 if (--latestMonth <= 0)
3342 return QDate(); 3345 return QDate();
3343 } 3346 }
3344 for (it.toLast(); it.current(); --it) { 3347 for (it.toLast(); it.current(); --it) {
@@ -3355,34 +3358,34 @@ QDate Recurrence::getLastDateInYear(const QDate &latestDate) const
3355 break; 3358 break;
3356 case rFeb28: 3359 case rFeb28:
3357 return QDate(latestYear, 2, 28); 3360 return QDate(latestYear, 2, 28);
3358 case rFeb29: 3361 case rFeb29:
3359 break; 3362 break;
3360 } 3363 }
3361 } 3364 }
3362 } 3365 }
3363 } 3366 }
3364 break; 3367 break;
3365 } 3368 }
3366 case rYearlyPos: { 3369 case rYearlyPos: {
3367 QValueList<int> dayList; 3370 Q3ValueList<int> dayList;
3368 int latestYear = latestDate.year(); 3371 int latestYear = latestDate.year();
3369 int latestMonth = latestDate.month(); 3372 int latestMonth = latestDate.month();
3370 int latestDay = latestDate.day(); 3373 int latestDay = latestDate.day();
3371 for (it.toLast(); it.current(); --it) { 3374 for (it.toLast(); it.current(); --it) {
3372 int month = *it.current(); 3375 int month = *it.current();
3373 if (month <= latestMonth) { 3376 if (month <= latestMonth) {
3374 QDate monthBegin(latestYear, month, 1); 3377 QDate monthBegin(latestYear, month, 1);
3375 getMonthlyPosDays(dayList, monthBegin.daysInMonth(), monthBegin.dayOfWeek()); 3378 getMonthlyPosDays(dayList, monthBegin.daysInMonth(), monthBegin.dayOfWeek());
3376 for (QValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) { 3379 for (Q3ValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) {
3377 if (*id <= latestDay) 3380 if (*id <= latestDay)
3378 return monthBegin.addDays(*id - 1); 3381 return monthBegin.addDays(*id - 1);
3379 } 3382 }
3380 latestDay = 31; 3383 latestDay = 31;
3381 } 3384 }
3382 } 3385 }
3383 break; 3386 break;
3384 } 3387 }
3385 case rYearlyDay: { 3388 case rYearlyDay: {
3386 int latestDay = latestDate.dayOfYear(); 3389 int latestDay = latestDate.dayOfYear();
3387 for (it.toLast(); it.current(); --it) { 3390 for (it.toLast(); it.current(); --it) {
3388 int day = *it.current(); 3391 int day = *it.current();
diff --git a/libkcal/recurrence.h b/libkcal/recurrence.h
index b13d14f..5b5aab1 100644
--- a/libkcal/recurrence.h
+++ b/libkcal/recurrence.h
@@ -15,25 +15,27 @@
15 Library General Public License for more details. 15 Library General Public License for more details.
16 16
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22#ifndef KCAL_RECURRENCE_H 22#ifndef KCAL_RECURRENCE_H
23#define KCAL_RECURRENCE_H 23#define KCAL_RECURRENCE_H
24 24
25#include <qstring.h> 25#include <qstring.h>
26#include <qbitarray.h> 26#include <qbitarray.h>
27#include <qptrlist.h> 27#include <q3ptrlist.h>
28//Added by qt3to4:
29#include <Q3ValueList>
28 30
29namespace KCal { 31namespace KCal {
30 32
31class Incidence; 33class Incidence;
32 34
33/** 35/**
34 This class represents a recurrence rule for a calendar incidence. 36 This class represents a recurrence rule for a calendar incidence.
35*/ 37*/
36class Recurrence 38class Recurrence
37{ 39{
38 public: 40 public:
39 /** enumeration for describing how an event recurs, if at all. */ 41 /** enumeration for describing how an event recurs, if at all. */
@@ -239,27 +241,27 @@ class Recurrence
239 * @var _rPos the position in the month for the recurrence, with valid 241 * @var _rPos the position in the month for the recurrence, with valid
240 * values being 1-5 (5 weeks max in a month). 242 * values being 1-5 (5 weeks max in a month).
241 * @var _rDays the days for the position to recur on (bit 0 = Monday). 243 * @var _rDays the days for the position to recur on (bit 0 = Monday).
242 * Example: _rPos = 2, and bits 0 and 2 are set in _rDays: 244 * Example: _rPos = 2, and bits 0 and 2 are set in _rDays:
243 * the rule is to repeat every 2nd Monday and Wednesday in the month. 245 * the rule is to repeat every 2nd Monday and Wednesday in the month.
244 */ 246 */
245 void addMonthlyPos(short _rPos, const QBitArray &_rDays); 247 void addMonthlyPos(short _rPos, const QBitArray &_rDays);
246 /** Adds a position the the recursMonthlyDay list. 248 /** Adds a position the the recursMonthlyDay list.
247 * @var _rDay the date in the month to recur. 249 * @var _rDay the date in the month to recur.
248 */ 250 */
249 void addMonthlyDay(short _rDay); 251 void addMonthlyDay(short _rDay);
250 /** Returns list of day positions in months. */ 252 /** Returns list of day positions in months. */
251 const QPtrList<rMonthPos> &monthPositions() const; 253 const Q3PtrList<rMonthPos> &monthPositions() const;
252 /** Returns list of day numbers of a month. */ 254 /** Returns list of day numbers of a month. */
253 const QPtrList<int> &monthDays() const; 255 const Q3PtrList<int> &monthDays() const;
254 256
255 /** Sets an event to recur yearly. 257 /** Sets an event to recur yearly.
256 * @var type rYearlyMonth, rYearlyPos or rYearlyDay 258 * @var type rYearlyMonth, rYearlyPos or rYearlyDay
257 * @var freq the frequency to recur, e.g. 3 for every third year. 259 * @var freq the frequency to recur, e.g. 3 for every third year.
258 * @var duration the number of times the event is to occur, or -1 to recur indefinitely. 260 * @var duration the number of times the event is to occur, or -1 to recur indefinitely.
259 */ 261 */
260 void setYearly(int type, int freq, int duration); 262 void setYearly(int type, int freq, int duration);
261 /** Sets an event to recur yearly ending at \a endDate. */ 263 /** Sets an event to recur yearly ending at \a endDate. */
262 void setYearly(int type, int freq, const QDate &endDate); 264 void setYearly(int type, int freq, const QDate &endDate);
263 /** Sets an event to recur yearly on specified dates. 265 /** Sets an event to recur yearly on specified dates.
264 * The dates must be specified by calling addYearlyNum(). 266 * The dates must be specified by calling addYearlyNum().
265 * @var type the way recurrences of February 29th are to be handled in non-leap years. 267 * @var type the way recurrences of February 29th are to be handled in non-leap years.
@@ -270,41 +272,41 @@ class Recurrence
270 /** Sets an event to recur yearly ending at \a endDate. */ 272 /** Sets an event to recur yearly ending at \a endDate. */
271 void setYearlyByDate(Feb29Type type, int freq, const QDate &endDate); 273 void setYearlyByDate(Feb29Type type, int freq, const QDate &endDate);
272 /** Adds position of day or month in year. 274 /** Adds position of day or month in year.
273 * N.B. for recursYearlyPos, addYearlyMonthPos() must also be called 275 * N.B. for recursYearlyPos, addYearlyMonthPos() must also be called
274 * to add positions within the month. */ 276 * to add positions within the month. */
275 void addYearlyNum(short _rNum); 277 void addYearlyNum(short _rNum);
276 /** Adds a position to the recursYearlyPos recurrence rule, if it is set. 278 /** Adds a position to the recursYearlyPos recurrence rule, if it is set.
277 * N.B. addYearlyNum() must also be called to add recurrence months. 279 * N.B. addYearlyNum() must also be called to add recurrence months.
278 * Parameters are the same as for addMonthlyPos(). 280 * Parameters are the same as for addMonthlyPos().
279 */ 281 */
280 void addYearlyMonthPos(short _rPos, const QBitArray &_rDays); 282 void addYearlyMonthPos(short _rPos, const QBitArray &_rDays);
281 /** Returns positions of days or months in year. */ 283 /** Returns positions of days or months in year. */
282 const QPtrList<int> &yearNums() const; 284 const Q3PtrList<int> &yearNums() const;
283 /** Returns list of day positions in months, for a recursYearlyPos recurrence rule. */ 285 /** Returns list of day positions in months, for a recursYearlyPos recurrence rule. */
284 const QPtrList<rMonthPos> &yearMonthPositions() const; 286 const Q3PtrList<rMonthPos> &yearMonthPositions() const;
285 /** Returns how yearly recurrences of February 29th are handled. */ 287 /** Returns how yearly recurrences of February 29th are handled. */
286 Feb29Type feb29YearlyType() const { return mFeb29YearlyType; } 288 Feb29Type feb29YearlyType() const { return mFeb29YearlyType; }
287 /** Sets the default method for handling yearly recurrences of February 29th. */ 289 /** Sets the default method for handling yearly recurrences of February 29th. */
288 static void setFeb29YearlyTypeDefault(Feb29Type t) { mFeb29YearlyDefaultType = t; } 290 static void setFeb29YearlyTypeDefault(Feb29Type t) { mFeb29YearlyDefaultType = t; }
289 /** Returns the default method for handling yearly recurrences of February 29th. */ 291 /** Returns the default method for handling yearly recurrences of February 29th. */
290 static Feb29Type setFeb29YearlyTypeDefault() { return mFeb29YearlyDefaultType; } 292 static Feb29Type setFeb29YearlyTypeDefault() { return mFeb29YearlyDefaultType; }
291 void addYearlyMonth(short _rPos ); // added LR 293 void addYearlyMonth(short _rPos ); // added LR
292 /** 294 /**
293 Debug output. 295 Debug output.
294 */ 296 */
295 void dump() const; 297 void dump() const;
296 QString recurrenceText() const; 298 QString recurrenceText() const;
297 bool getYearlyMonthMonths(int day, QValueList<int>&, 299 bool getYearlyMonthMonths(int day, Q3ValueList<int>&,
298 QValueList<int> &leaplist) const; 300 Q3ValueList<int> &leaplist) const;
299 301
300 protected: 302 protected:
301 enum PeriodFunc { END_DATE_AND_COUNT, COUNT_TO_DATE, NEXT_AFTER_DATE }; 303 enum PeriodFunc { END_DATE_AND_COUNT, COUNT_TO_DATE, NEXT_AFTER_DATE };
302 struct MonthlyData; friend struct MonthlyData; 304 struct MonthlyData; friend struct MonthlyData;
303 struct YearlyMonthData; friend struct YearlyMonthData; 305 struct YearlyMonthData; friend struct YearlyMonthData;
304 struct YearlyPosData; friend struct YearlyPosData; 306 struct YearlyPosData; friend struct YearlyPosData;
305 struct YearlyDayData; friend struct YearlyDayData; 307 struct YearlyDayData; friend struct YearlyDayData;
306 308
307 bool recursSecondly(const QDate &, int secondFreq) const; 309 bool recursSecondly(const QDate &, int secondFreq) const;
308 bool recursMinutelyAt(const QDateTime &dt, int minuteFreq) const; 310 bool recursMinutelyAt(const QDateTime &dt, int minuteFreq) const;
309 bool recursDaily(const QDate &) const; 311 bool recursDaily(const QDate &) const;
310 bool recursWeekly(const QDate &) const; 312 bool recursWeekly(const QDate &) const;
@@ -336,52 +338,52 @@ class Recurrence
336 int yearlyMonthCalcToDate(const QDate& enddate, YearlyMonthData&) const; 338 int yearlyMonthCalcToDate(const QDate& enddate, YearlyMonthData&) const;
337 int yearlyMonthCalcNextAfter(QDate& enddate, YearlyMonthData&) const; 339 int yearlyMonthCalcNextAfter(QDate& enddate, YearlyMonthData&) const;
338 int yearlyPosCalc(PeriodFunc, QDate &enddate) const; 340 int yearlyPosCalc(PeriodFunc, QDate &enddate) const;
339 int yearlyPosCalcEndDate(QDate& enddate, YearlyPosData&) const; 341 int yearlyPosCalcEndDate(QDate& enddate, YearlyPosData&) const;
340 int yearlyPosCalcToDate(const QDate& enddate, YearlyPosData&) const; 342 int yearlyPosCalcToDate(const QDate& enddate, YearlyPosData&) const;
341 int yearlyPosCalcNextAfter(QDate& enddate, YearlyPosData&) const; 343 int yearlyPosCalcNextAfter(QDate& enddate, YearlyPosData&) const;
342 int yearlyDayCalc(PeriodFunc, QDate &enddate) const; 344 int yearlyDayCalc(PeriodFunc, QDate &enddate) const;
343 int yearlyDayCalcEndDate(QDate& enddate, YearlyDayData&) const; 345 int yearlyDayCalcEndDate(QDate& enddate, YearlyDayData&) const;
344 int yearlyDayCalcToDate(const QDate& enddate, YearlyDayData&) const; 346 int yearlyDayCalcToDate(const QDate& enddate, YearlyDayData&) const;
345 int yearlyDayCalcNextAfter(QDate& enddate, YearlyDayData&) const; 347 int yearlyDayCalcNextAfter(QDate& enddate, YearlyDayData&) const;
346 348
347 int countMonthlyPosDays() const; 349 int countMonthlyPosDays() const;
348 void getMonthlyPosDays(QValueList<int>&, int daysInMonth, 350 void getMonthlyPosDays(Q3ValueList<int>&, int daysInMonth,
349 int startDayOfWeek) const; 351 int startDayOfWeek) const;
350 bool getMonthlyDayDays(QValueList<int>&, int daysInMonth) const; 352 bool getMonthlyDayDays(Q3ValueList<int>&, int daysInMonth) const;
351 353
352 int getFirstDayInWeek(int startDay, bool useWeekStart = true) const; 354 int getFirstDayInWeek(int startDay, bool useWeekStart = true) const;
353 int getLastDayInWeek(int endDay, bool useWeekStart = true) const; 355 int getLastDayInWeek(int endDay, bool useWeekStart = true) const;
354 QDate getFirstDateInMonth(const QDate& earliestDate) const; 356 QDate getFirstDateInMonth(const QDate& earliestDate) const;
355 QDate getLastDateInMonth(const QDate& latestDate) const; 357 QDate getLastDateInMonth(const QDate& latestDate) const;
356 QDate getFirstDateInYear(const QDate& earliestDate) const; 358 QDate getFirstDateInYear(const QDate& earliestDate) const;
357 QDate getLastDateInYear(const QDate& latestDate) const; 359 QDate getLastDateInYear(const QDate& latestDate) const;
358 360
359 private: 361 private:
360 // Prohibit copying 362 // Prohibit copying
361 Recurrence(const Recurrence&); 363 Recurrence(const Recurrence&);
362 Recurrence &operator=(const Recurrence&); 364 Recurrence &operator=(const Recurrence&);
363 365
364 short recurs; // should be one of the enums. 366 short recurs; // should be one of the enums.
365 367
366 int rWeekStart; // day which starts the week, Monday=1 .. Sunday=7 368 int rWeekStart; // day which starts the week, Monday=1 .. Sunday=7
367 QBitArray rDays; // array of days during week it recurs 369 QBitArray rDays; // array of days during week it recurs
368 370
369 QPtrList<rMonthPos> rMonthPositions; // list of positions during a month 371 Q3PtrList<rMonthPos> rMonthPositions; // list of positions during a month
370 // on which an event recurs 372 // on which an event recurs
371 373
372 QPtrList<int> rMonthDays; // list of days during a month on 374 Q3PtrList<int> rMonthDays; // list of days during a month on
373 // which the event recurs 375 // which the event recurs
374 376
375 QPtrList<int> rYearNums; // either months/days to recur on for rYearly, 377 Q3PtrList<int> rYearNums; // either months/days to recur on for rYearly,
376 // sorted in numerical order 378 // sorted in numerical order
377 379
378 int rFreq; // frequency of period 380 int rFreq; // frequency of period
379 381
380 // one of the following must be specified 382 // one of the following must be specified
381 int rDuration; // num times to recur (inc. first occurrence), -1 = infinite 383 int rDuration; // num times to recur (inc. first occurrence), -1 = infinite
382 QDateTime rEndDateTime; // date/time at which to end recurrence 384 QDateTime rEndDateTime; // date/time at which to end recurrence
383 385
384 QDateTime mRecurStart; // date/time of first recurrence 386 QDateTime mRecurStart; // date/time of first recurrence
385 bool mFloats; // the recurrence has no time, just a date 387 bool mFloats; // the recurrence has no time, just a date
386 bool mRecurReadOnly; 388 bool mRecurReadOnly;
387 int mRecurExDatesCount; // number of recurrences (in addition to rDuration) which are excluded 389 int mRecurExDatesCount; // number of recurrences (in addition to rDuration) which are excluded
diff --git a/libkcal/scheduler.cpp b/libkcal/scheduler.cpp
index 253d8b7..234cfcf 100644
--- a/libkcal/scheduler.cpp
+++ b/libkcal/scheduler.cpp
@@ -11,25 +11,27 @@
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qdir.h> 21#include <qdir.h>
22#include <qfile.h> 22#include <qfile.h>
23#include <qtextstream.h> 23#include <q3textstream.h>
24//Added by qt3to4:
25#include <Q3PtrList>
24 26
25#include <klocale.h> 27#include <klocale.h>
26#include <kdebug.h> 28#include <kdebug.h>
27#include <kstandarddirs.h> 29#include <kstandarddirs.h>
28 30
29#include "event.h" 31#include "event.h"
30#include "todo.h" 32#include "todo.h"
31#include "freebusy.h" 33#include "freebusy.h"
32#include "icalformat.h" 34#include "icalformat.h"
33#include "calendar.h" 35#include "calendar.h"
34 36
35#include "scheduler.h" 37#include "scheduler.h"
@@ -255,26 +257,26 @@ bool Scheduler::acceptDeclineCounter(IncidenceBase *incidence,ScheduleMessage::S
255 257
256bool Scheduler::acceptReply(IncidenceBase *incidence,ScheduleMessage::Status status, Method method) 258bool Scheduler::acceptReply(IncidenceBase *incidence,ScheduleMessage::Status status, Method method)
257{ 259{
258 if(incidence->type()=="FreeBusy") { 260 if(incidence->type()=="FreeBusy") {
259 return acceptFreeBusy(incidence, method); 261 return acceptFreeBusy(incidence, method);
260 } 262 }
261 bool ret = false; 263 bool ret = false;
262 Event *ev = mCalendar->event(incidence->uid()); 264 Event *ev = mCalendar->event(incidence->uid());
263 Todo *to = mCalendar->todo(incidence->uid()); 265 Todo *to = mCalendar->todo(incidence->uid());
264 if (ev || to) { 266 if (ev || to) {
265 //get matching attendee in calendar 267 //get matching attendee in calendar
266 kdDebug(5800) << "Scheduler::acceptTransaction match found!" << endl; 268 kdDebug(5800) << "Scheduler::acceptTransaction match found!" << endl;
267 QPtrList<Attendee> attendeesIn = incidence->attendees(); 269 Q3PtrList<Attendee> attendeesIn = incidence->attendees();
268 QPtrList<Attendee> attendeesEv; 270 Q3PtrList<Attendee> attendeesEv;
269 if (ev) attendeesEv = ev->attendees(); 271 if (ev) attendeesEv = ev->attendees();
270 if (to) attendeesEv = to->attendees(); 272 if (to) attendeesEv = to->attendees();
271 Attendee *attIn; 273 Attendee *attIn;
272 Attendee *attEv; 274 Attendee *attEv;
273 for ( attIn = attendeesIn.first(); attIn; attIn = attendeesIn.next() ) { 275 for ( attIn = attendeesIn.first(); attIn; attIn = attendeesIn.next() ) {
274 for ( attEv = attendeesEv.first(); attEv; attEv = attendeesEv.next() ) { 276 for ( attEv = attendeesEv.first(); attEv; attEv = attendeesEv.next() ) {
275 if (attIn->email()==attEv->email()) { 277 if (attIn->email()==attEv->email()) {
276 //update attendee-info 278 //update attendee-info
277 kdDebug(5800) << "Scheduler::acceptTransaction update attendee" << endl; 279 kdDebug(5800) << "Scheduler::acceptTransaction update attendee" << endl;
278 attEv->setStatus(attIn->status()); 280 attEv->setStatus(attIn->status());
279 attEv->setRSVP(false); 281 attEv->setRSVP(false);
280 // better to not update the sequence number with replys 282 // better to not update the sequence number with replys
@@ -333,23 +335,23 @@ bool Scheduler::acceptFreeBusy(IncidenceBase *incidence, Method method)
333 filename += "/"; 335 filename += "/";
334 filename += from; 336 filename += from;
335 filename += ".ifb"; 337 filename += ".ifb";
336 QFile f(filename); 338 QFile f(filename);
337 339
338 kdDebug() << "acceptFreeBusy: filename" << filename << endl; 340 kdDebug() << "acceptFreeBusy: filename" << filename << endl;
339 341
340 freebusy->clearAttendees(); 342 freebusy->clearAttendees();
341 freebusy->setOrganizer(from); 343 freebusy->setOrganizer(from);
342 344
343 QString messageText = mFormat->createScheduleMessage(freebusy, Publish); 345 QString messageText = mFormat->createScheduleMessage(freebusy, Publish);
344 346
345 if (!f.open(IO_ReadWrite)) { 347 if (!f.open(QIODevice::ReadWrite)) {
346 kdDebug() << "acceptFreeBusy: Can't open:" << filename << " for writing" << endl; 348 kdDebug() << "acceptFreeBusy: Can't open:" << filename << " for writing" << endl;
347 return false; 349 return false;
348 } 350 }
349 QTextStream t(&f); 351 Q3TextStream t(&f);
350 t << messageText; 352 t << messageText;
351 f.close(); 353 f.close();
352 354
353 deleteTransaction(incidence); 355 deleteTransaction(incidence);
354 return true; 356 return true;
355} 357}
diff --git a/libkcal/scheduler.h b/libkcal/scheduler.h
index a9f43b9..357e98e 100644
--- a/libkcal/scheduler.h
+++ b/libkcal/scheduler.h
@@ -14,25 +14,25 @@
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef SCHEDULER_H 20#ifndef SCHEDULER_H
21#define SCHEDULER_H 21#define SCHEDULER_H
22 22
23// iTIP transactions base class 23// iTIP transactions base class
24 24
25#include <qstring.h> 25#include <qstring.h>
26#include <qptrlist.h> 26#include <q3ptrlist.h>
27 27
28namespace KCal { 28namespace KCal {
29 29
30class IncidenceBase; 30class IncidenceBase;
31class Event; 31class Event;
32class Calendar; 32class Calendar;
33class ICalFormat; 33class ICalFormat;
34 34
35/** 35/**
36 This class provides an encapsulation of a scheduling message. It associates an 36 This class provides an encapsulation of a scheduling message. It associates an
37 incidence with a method and status information. This class is used by the 37 incidence with a method and status information. This class is used by the
38 Scheduler class. 38 Scheduler class.
@@ -86,25 +86,25 @@ class Scheduler {
86 virtual ~Scheduler(); 86 virtual ~Scheduler();
87 87
88 /** iTIP publish action */ 88 /** iTIP publish action */
89 virtual bool publish (IncidenceBase *incidence,const QString &recipients) = 0; 89 virtual bool publish (IncidenceBase *incidence,const QString &recipients) = 0;
90 /** Perform iTIP transaction on incidence. The method is specified as the 90 /** Perform iTIP transaction on incidence. The method is specified as the
91 method argumanet and can be any valid iTIP method. */ 91 method argumanet and can be any valid iTIP method. */
92 virtual bool performTransaction(IncidenceBase *incidence,Method method) = 0; 92 virtual bool performTransaction(IncidenceBase *incidence,Method method) = 0;
93 /** Perform iTIP transaction on incidence to specified recipient(s). The 93 /** Perform iTIP transaction on incidence to specified recipient(s). The
94 method is specified as the method argumanet and can be any valid iTIP 94 method is specified as the method argumanet and can be any valid iTIP
95 method. */ 95 method. */
96 virtual bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients) = 0; 96 virtual bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients) = 0;
97 /** Retrieve incoming iTIP transactions */ 97 /** Retrieve incoming iTIP transactions */
98 virtual QPtrList<ScheduleMessage> retrieveTransactions() = 0; 98 virtual Q3PtrList<ScheduleMessage> retrieveTransactions() = 0;
99 99
100 /** 100 /**
101 Accept transaction. The incidence argument specifies the iCal compoennt 101 Accept transaction. The incidence argument specifies the iCal compoennt
102 on which the transaction acts. The status is the result of processing a 102 on which the transaction acts. The status is the result of processing a
103 iTIP message with the current calendar and specifies the action to be 103 iTIP message with the current calendar and specifies the action to be
104 taken for this incidence. 104 taken for this incidence.
105 */ 105 */
106 bool acceptTransaction(IncidenceBase *,Method method,ScheduleMessage::Status status); 106 bool acceptTransaction(IncidenceBase *,Method method,ScheduleMessage::Status status);
107 107
108 /** Return a machine-readable name for a iTIP method. */ 108 /** Return a machine-readable name for a iTIP method. */
109 static QString methodName(Method); 109 static QString methodName(Method);
110 /** Return a translated and human-readable name for a iTIP method. */ 110 /** Return a translated and human-readable name for a iTIP method. */
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index 9b757f7..b8c2aa7 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -13,30 +13,30 @@
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <qdatetime.h> 22#include <qdatetime.h>
23#include <qstring.h> 23#include <qstring.h>
24#include <qapplication.h> 24#include <qapplication.h>
25#include <qptrlist.h> 25#include <q3ptrlist.h>
26#include <qregexp.h> 26#include <qregexp.h>
27#include <qmessagebox.h> 27#include <qmessagebox.h>
28#include <qclipboard.h> 28#include <qclipboard.h>
29#include <qfile.h> 29#include <qfile.h>
30#include <qtextstream.h> 30#include <q3textstream.h>
31#include <qtextcodec.h> 31#include <qtextcodec.h>
32#include <qxml.h> 32#include <qxml.h>
33#include <qlabel.h> 33#include <qlabel.h>
34 34
35#include <kdebug.h> 35#include <kdebug.h>
36#include <klocale.h> 36#include <klocale.h>
37#include <kglobal.h> 37#include <kglobal.h>
38 38
39#include "calendar.h" 39#include "calendar.h"
40#include "alarm.h" 40#include "alarm.h"
41#include "recurrence.h" 41#include "recurrence.h"
42#include "calendarlocal.h" 42#include "calendarlocal.h"
@@ -357,47 +357,47 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal )
357 status.raise(); 357 status.raise();
358 qApp->processEvents(); 358 qApp->processEvents();
359 QString fileName; 359 QString fileName;
360 if ( ! debug ) { 360 if ( ! debug ) {
361 fileName = "/tmp/kopitempout"; 361 fileName = "/tmp/kopitempout";
362 QString command ="db2file datebook -r -c "+ codec + " > " + fileName; 362 QString command ="db2file datebook -r -c "+ codec + " > " + fileName;
363 system ( command.latin1() ); 363 system ( command.latin1() );
364 } else { 364 } else {
365 fileName = "/tmp/events.txt"; 365 fileName = "/tmp/events.txt";
366 366
367 } 367 }
368 QFile file( fileName ); 368 QFile file( fileName );
369 if (!file.open( IO_ReadOnly ) ) { 369 if (!file.open( QIODevice::ReadOnly ) ) {
370 return false; 370 return false;
371 371
372 } 372 }
373 QTextStream ts( &file ); 373 Q3TextStream ts( &file );
374 ts.setCodec( QTextCodec::codecForName("utf8") ); 374 ts.setCodec( QTextCodec::codecForName("utf8") );
375 text = ts.read(); 375 text = ts.read();
376 file.close(); 376 file.close();
377 status.setText( i18n("Processing events ...") ); 377 status.setText( i18n("Processing events ...") );
378 status.raise(); 378 status.raise();
379 qApp->processEvents(); 379 qApp->processEvents();
380 fromString2Cal( calendar, existngCal, text, "Event" ); 380 fromString2Cal( calendar, existngCal, text, "Event" );
381 status.setText( i18n("Reading todos ...") ); 381 status.setText( i18n("Reading todos ...") );
382 qApp->processEvents(); 382 qApp->processEvents();
383 if ( ! debug ) { 383 if ( ! debug ) {
384 fileName = "/tmp/kopitempout"; 384 fileName = "/tmp/kopitempout";
385 QString command = "db2file todo -r -c " + codec+ " > " + fileName; 385 QString command = "db2file todo -r -c " + codec+ " > " + fileName;
386 system ( command.latin1() ); 386 system ( command.latin1() );
387 } else { 387 } else {
388 fileName = "/tmp/todo.txt"; 388 fileName = "/tmp/todo.txt";
389 } 389 }
390 file.setName( fileName ); 390 file.setName( fileName );
391 if (!file.open( IO_ReadOnly ) ) { 391 if (!file.open( QIODevice::ReadOnly ) ) {
392 return false; 392 return false;
393 393
394 } 394 }
395 ts.setDevice( &file ); 395 ts.setDevice( &file );
396 text = ts.read(); 396 text = ts.read();
397 file.close(); 397 file.close();
398 398
399 status.setText( i18n("Processing todos ...") ); 399 status.setText( i18n("Processing todos ...") );
400 status.raise(); 400 status.raise();
401 qApp->processEvents(); 401 qApp->processEvents();
402 fromString2Cal( calendar, existngCal, text, "Todo" ); 402 fromString2Cal( calendar, existngCal, text, "Todo" );
403 return true; 403 return true;
@@ -466,25 +466,25 @@ bool SharpFormat::save( Calendar *calendar)
466 int dh = QApplication::desktop()->height(); 466 int dh = QApplication::desktop()->height();
467 status.setCaption(i18n("Writing DTM Data") ); 467 status.setCaption(i18n("Writing DTM Data") );
468 status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 468 status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
469 status.show(); 469 status.show();
470 status.raise(); 470 status.raise();
471 qApp->processEvents(); 471 qApp->processEvents();
472 bool debug = DEBUGMODE; 472 bool debug = DEBUGMODE;
473 QString codec = "utf8"; 473 QString codec = "utf8";
474 QString answer; 474 QString answer;
475 QString ePrefix = "CARDID,CATEGORY,DSRP,PLCE,MEM1,TIM1,TIM2,ADAY,ARON,ARMN,ARSD,RTYP,RFRQ,RPOS,RDYS,REND,REDT,ALSD,ALED,MDAY\n"; 475 QString ePrefix = "CARDID,CATEGORY,DSRP,PLCE,MEM1,TIM1,TIM2,ADAY,ARON,ARMN,ARSD,RTYP,RFRQ,RPOS,RDYS,REND,REDT,ALSD,ALED,MDAY\n";
476 QString tPrefix = "CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1\n"; 476 QString tPrefix = "CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1\n";
477 QString command; 477 QString command;
478 QPtrList<Event> er = calendar->rawEvents(); 478 Q3PtrList<Event> er = calendar->rawEvents();
479 Event* ev = er.first(); 479 Event* ev = er.first();
480 QString fileName = "/tmp/kopitempout"; 480 QString fileName = "/tmp/kopitempout";
481 int i = 0; 481 int i = 0;
482 QString changeString = ePrefix; 482 QString changeString = ePrefix;
483 QString deleteString = ePrefix; 483 QString deleteString = ePrefix;
484 bool deleteEnt = false; 484 bool deleteEnt = false;
485 bool changeEnt = false; 485 bool changeEnt = false;
486 QString message = i18n("Processing event # "); 486 QString message = i18n("Processing event # ");
487 int procCount = 0; 487 int procCount = 0;
488 while ( ev ) { 488 while ( ev ) {
489 //qDebug("i %d ", ++i); 489 //qDebug("i %d ", ++i);
490 if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { 490 if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) {
@@ -494,186 +494,186 @@ bool SharpFormat::save( Calendar *calendar)
494 if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete 494 if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete
495 // deleting empty strings does not work. 495 // deleting empty strings does not work.
496 // we write first and x and then delete the record with the x 496 // we write first and x and then delete the record with the x
497 eString = eString.replace( QRegExp(",\"\""),",\"x\"" ); 497 eString = eString.replace( QRegExp(",\"\""),",\"x\"" );
498 changeString += eString + "\n"; 498 changeString += eString + "\n";
499 deleteString += eString + "\n"; 499 deleteString += eString + "\n";
500 deleteEnt = true; 500 deleteEnt = true;
501 changeEnt = true; 501 changeEnt = true;
502 } 502 }
503 else if ( ev->getID("Sharp_DTM").isEmpty() ) { // add new 503 else if ( ev->getID("Sharp_DTM").isEmpty() ) { // add new
504 QString fileNameIn = "/tmp/kopitempin"; 504 QString fileNameIn = "/tmp/kopitempin";
505 QFile fileIn( fileNameIn ); 505 QFile fileIn( fileNameIn );
506 if (!fileIn.open( IO_WriteOnly ) ) { 506 if (!fileIn.open( QIODevice::WriteOnly ) ) {
507 return false; 507 return false;
508 } 508 }
509 QTextStream tsIn( &fileIn ); 509 Q3TextStream tsIn( &fileIn );
510 tsIn.setCodec( QTextCodec::codecForName("utf8") ); 510 tsIn.setCodec( QTextCodec::codecForName("utf8") );
511 tsIn << ePrefix << eString ; 511 tsIn << ePrefix << eString ;
512 fileIn.close(); 512 fileIn.close();
513 //command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName; 513 //command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName;
514 command = "(cat /tmp/kopitempin | db2file datebook -w -g -c " + codec+ ") > "+ fileName; 514 command = "(cat /tmp/kopitempin | db2file datebook -w -g -c " + codec+ ") > "+ fileName;
515 //qDebug("command ++++++++ "); 515 //qDebug("command ++++++++ ");
516 //qDebug("%s ",command.latin1()); 516 //qDebug("%s ",command.latin1());
517 //qDebug("command -------- "); 517 //qDebug("command -------- ");
518 system ( command.utf8() ); 518 system ( command.utf8() );
519 QFile file( fileName ); 519 QFile file( fileName );
520 if (!file.open( IO_ReadOnly ) ) { 520 if (!file.open( QIODevice::ReadOnly ) ) {
521 return false; 521 return false;
522 522
523 } 523 }
524 QTextStream ts( &file ); 524 Q3TextStream ts( &file );
525 ts.setCodec( QTextCodec::codecForName("utf8") ); 525 ts.setCodec( QTextCodec::codecForName("utf8") );
526 answer = ts.read(); 526 answer = ts.read();
527 file.close(); 527 file.close();
528 //qDebug("answer \n%s ", answer.latin1()); 528 //qDebug("answer \n%s ", answer.latin1());
529 getNumFromRecord( answer, ev ) ; 529 getNumFromRecord( answer, ev ) ;
530 530
531 } 531 }
532 else { // change existing 532 else { // change existing
533 //qDebug("canging %d %d",ev->zaurusStat() ,ev->zaurusId() ); 533 //qDebug("canging %d %d",ev->zaurusStat() ,ev->zaurusId() );
534 //command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName; 534 //command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName;
535 changeString += eString + "\n"; 535 changeString += eString + "\n";
536 changeEnt = true; 536 changeEnt = true;
537 537
538 } 538 }
539 } 539 }
540 ev = er.next(); 540 ev = er.next();
541 } 541 }
542 status.setText ( i18n("Changing events ...") ); 542 status.setText ( i18n("Changing events ...") );
543 qApp->processEvents(); 543 qApp->processEvents();
544 //qDebug("changing... "); 544 //qDebug("changing... ");
545 if ( changeEnt ) { 545 if ( changeEnt ) {
546 QFile file( fileName ); 546 QFile file( fileName );
547 if (!file.open( IO_WriteOnly ) ) { 547 if (!file.open( QIODevice::WriteOnly ) ) {
548 return false; 548 return false;
549 549
550 } 550 }
551 QTextStream ts( &file ); 551 Q3TextStream ts( &file );
552 ts.setCodec( QTextCodec::codecForName("utf8") ); 552 ts.setCodec( QTextCodec::codecForName("utf8") );
553 ts << changeString ; 553 ts << changeString ;
554 file.close(); 554 file.close();
555 command = "db2file datebook -w -g -c " + codec+ " < "+ fileName; 555 command = "db2file datebook -w -g -c " + codec+ " < "+ fileName;
556 system ( command.latin1() ); 556 system ( command.latin1() );
557 //qDebug("command %s file :\n%s ", command.latin1(), changeString.latin1()); 557 //qDebug("command %s file :\n%s ", command.latin1(), changeString.latin1());
558 558
559 } 559 }
560 status.setText ( i18n("Deleting events ...") ); 560 status.setText ( i18n("Deleting events ...") );
561 qApp->processEvents(); 561 qApp->processEvents();
562 //qDebug("deleting... "); 562 //qDebug("deleting... ");
563 if ( deleteEnt ) { 563 if ( deleteEnt ) {
564 QFile file( fileName ); 564 QFile file( fileName );
565 if (!file.open( IO_WriteOnly ) ) { 565 if (!file.open( QIODevice::WriteOnly ) ) {
566 return false; 566 return false;
567 567
568 } 568 }
569 QTextStream ts( &file ); 569 Q3TextStream ts( &file );
570 ts.setCodec( QTextCodec::codecForName("utf8") ); 570 ts.setCodec( QTextCodec::codecForName("utf8") );
571 ts << deleteString; 571 ts << deleteString;
572 file.close(); 572 file.close();
573 command = "db2file datebook -d -c " + codec+ " < "+ fileName; 573 command = "db2file datebook -d -c " + codec+ " < "+ fileName;
574 system ( command.latin1() ); 574 system ( command.latin1() );
575 // qDebug("command %s file :\n%s ", command.latin1(), deleteString.latin1()); 575 // qDebug("command %s file :\n%s ", command.latin1(), deleteString.latin1());
576 } 576 }
577 577
578 578
579 changeString = tPrefix; 579 changeString = tPrefix;
580 deleteString = tPrefix; 580 deleteString = tPrefix;
581 status.setText ( i18n("Processing todos ...") ); 581 status.setText ( i18n("Processing todos ...") );
582 qApp->processEvents(); 582 qApp->processEvents();
583 QPtrList<Todo> tl = calendar->rawTodos(); 583 Q3PtrList<Todo> tl = calendar->rawTodos();
584 Todo* to = tl.first(); 584 Todo* to = tl.first();
585 i = 0; 585 i = 0;
586 message = i18n("Processing todo # "); 586 message = i18n("Processing todo # ");
587 procCount = 0; 587 procCount = 0;
588 while ( to ) { 588 while ( to ) {
589 if ( to->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { 589 if ( to->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) {
590 status.setText ( message + QString::number ( ++procCount ) ); 590 status.setText ( message + QString::number ( ++procCount ) );
591 qApp->processEvents(); 591 qApp->processEvents();
592 QString eString = getTodoString( to ); 592 QString eString = getTodoString( to );
593 if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete 593 if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete
594 // deleting empty strings does not work. 594 // deleting empty strings does not work.
595 // we write first and x and then delete the record with the x 595 // we write first and x and then delete the record with the x
596 eString = eString.replace( QRegExp(",\"\""),",\"x\"" ); 596 eString = eString.replace( QRegExp(",\"\""),",\"x\"" );
597 changeString += eString + "\n"; 597 changeString += eString + "\n";
598 deleteString += eString + "\n"; 598 deleteString += eString + "\n";
599 deleteEnt = true; 599 deleteEnt = true;
600 changeEnt = true; 600 changeEnt = true;
601 } 601 }
602 else if ( to->getID("Sharp_DTM").isEmpty() ) { // add new 602 else if ( to->getID("Sharp_DTM").isEmpty() ) { // add new
603 603
604 604
605 605
606 QString fileNameIn = "/tmp/kopitempin"; 606 QString fileNameIn = "/tmp/kopitempin";
607 QFile fileIn( fileNameIn ); 607 QFile fileIn( fileNameIn );
608 if (!fileIn.open( IO_WriteOnly ) ) { 608 if (!fileIn.open( QIODevice::WriteOnly ) ) {
609 return false; 609 return false;
610 } 610 }
611 QTextStream tsIn( &fileIn ); 611 Q3TextStream tsIn( &fileIn );
612 tsIn.setCodec( QTextCodec::codecForName("utf8") ); 612 tsIn.setCodec( QTextCodec::codecForName("utf8") );
613 tsIn << tPrefix << eString ; 613 tsIn << tPrefix << eString ;
614 fileIn.close(); 614 fileIn.close();
615 command = "(cat /tmp/kopitempin | db2file todo -w -g -c " + codec+ ") > "+ fileName; 615 command = "(cat /tmp/kopitempin | db2file todo -w -g -c " + codec+ ") > "+ fileName;
616 system ( command.utf8() ); 616 system ( command.utf8() );
617 QFile file( fileName ); 617 QFile file( fileName );
618 if (!file.open( IO_ReadOnly ) ) { 618 if (!file.open( QIODevice::ReadOnly ) ) {
619 return false; 619 return false;
620 } 620 }
621 QTextStream ts( &file ); 621 Q3TextStream ts( &file );
622 ts.setCodec( QTextCodec::codecForName("utf8") ); 622 ts.setCodec( QTextCodec::codecForName("utf8") );
623 answer = ts.read(); 623 answer = ts.read();
624 file.close(); 624 file.close();
625 //qDebug("answer \n%s ", answer.latin1()); 625 //qDebug("answer \n%s ", answer.latin1());
626 getNumFromRecord( answer, to ) ; 626 getNumFromRecord( answer, to ) ;
627 627
628 } 628 }
629 else { // change existing 629 else { // change existing
630 //qDebug("canging %d %d",to->zaurusStat() ,to->zaurusId() ); 630 //qDebug("canging %d %d",to->zaurusStat() ,to->zaurusId() );
631 //command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName; 631 //command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName;
632 changeString += eString + "\n"; 632 changeString += eString + "\n";
633 changeEnt = true; 633 changeEnt = true;
634 634
635 } 635 }
636 } 636 }
637 637
638 to = tl.next(); 638 to = tl.next();
639 } 639 }
640 status.setText ( i18n("Changing todos ...") ); 640 status.setText ( i18n("Changing todos ...") );
641 qApp->processEvents(); 641 qApp->processEvents();
642 //qDebug("changing... "); 642 //qDebug("changing... ");
643 if ( changeEnt ) { 643 if ( changeEnt ) {
644 QFile file( fileName ); 644 QFile file( fileName );
645 if (!file.open( IO_WriteOnly ) ) { 645 if (!file.open( QIODevice::WriteOnly ) ) {
646 return false; 646 return false;
647 647
648 } 648 }
649 QTextStream ts( &file ); 649 Q3TextStream ts( &file );
650 ts.setCodec( QTextCodec::codecForName("utf8") ); 650 ts.setCodec( QTextCodec::codecForName("utf8") );
651 ts << changeString ; 651 ts << changeString ;
652 file.close(); 652 file.close();
653 command = "db2file todo -w -g -c " + codec+ " < "+ fileName; 653 command = "db2file todo -w -g -c " + codec+ " < "+ fileName;
654 system ( command.latin1() ); 654 system ( command.latin1() );
655 //qDebug("command %s file :\n%s ", command.latin1(), changeString.latin1()); 655 //qDebug("command %s file :\n%s ", command.latin1(), changeString.latin1());
656 656
657 } 657 }
658 status.setText ( i18n("Deleting todos ...") ); 658 status.setText ( i18n("Deleting todos ...") );
659 qApp->processEvents(); 659 qApp->processEvents();
660 //qDebug("deleting... "); 660 //qDebug("deleting... ");
661 if ( deleteEnt ) { 661 if ( deleteEnt ) {
662 QFile file( fileName ); 662 QFile file( fileName );
663 if (!file.open( IO_WriteOnly ) ) { 663 if (!file.open( QIODevice::WriteOnly ) ) {
664 return false; 664 return false;
665 665
666 } 666 }
667 QTextStream ts( &file ); 667 Q3TextStream ts( &file );
668 ts.setCodec( QTextCodec::codecForName("utf8") ); 668 ts.setCodec( QTextCodec::codecForName("utf8") );
669 ts << deleteString; 669 ts << deleteString;
670 file.close(); 670 file.close();
671 command = "db2file todo -d -c " + codec+ " < "+ fileName; 671 command = "db2file todo -d -c " + codec+ " < "+ fileName;
672 system ( command.latin1() ); 672 system ( command.latin1() );
673 // qDebug("command %s file :\n%s ", command.latin1(), deleteString.latin1()); 673 // qDebug("command %s file :\n%s ", command.latin1(), deleteString.latin1());
674 } 674 }
675 675
676 return true; 676 return true;
677} 677}
678QString SharpFormat::dtToString( const QDateTime& dti, bool useTZ ) 678QString SharpFormat::dtToString( const QDateTime& dti, bool useTZ )
679{ 679{
@@ -774,25 +774,25 @@ QString SharpFormat::getEventString( Event* event )
774 } 774 }
775 //pending weekdays 775 //pending weekdays
776 writeEndDate = true; 776 writeEndDate = true;
777 777
778 break; 778 break;
779 case Recurrence::rMonthlyPos:// 2 779 case Recurrence::rMonthlyPos:// 2
780 list.append( "2" ); 780 list.append( "2" );
781 list.append( QString::number( rec->frequency()) );//12 781 list.append( QString::number( rec->frequency()) );//12
782 782
783 writeEndDate = true; 783 writeEndDate = true;
784 { 784 {
785 int count = 1; 785 int count = 1;
786 QPtrList<Recurrence::rMonthPos> rmp; 786 Q3PtrList<Recurrence::rMonthPos> rmp;
787 rmp = rec->monthPositions(); 787 rmp = rec->monthPositions();
788 if ( rmp.first()->negative ) 788 if ( rmp.first()->negative )
789 count = 5 - rmp.first()->rPos - 1; 789 count = 5 - rmp.first()->rPos - 1;
790 else 790 else
791 count = rmp.first()->rPos - 1; 791 count = rmp.first()->rPos - 1;
792 list.append( QString::number( count ) ); 792 list.append( QString::number( count ) );
793 793
794 } 794 }
795 795
796 list.append( "0" ); 796 list.append( "0" );
797 break; 797 break;
798 case Recurrence::rMonthlyDay:// 3 798 case Recurrence::rMonthlyDay:// 3
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index cc1c5ae..5a0c32e 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -614,25 +614,25 @@ QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_d
614 return QDateTime (); 614 return QDateTime ();
615 } 615 }
616 QDateTime incidenceStart; 616 QDateTime incidenceStart;
617 incidenceStart = dtDue(); 617 incidenceStart = dtDue();
618 bool enabled = false; 618 bool enabled = false;
619 Alarm* alarm; 619 Alarm* alarm;
620 int off = 0; 620 int off = 0;
621 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; 621 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );;
622 // if ( QDateTime::currentDateTime() > incidenceStart ){ 622 // if ( QDateTime::currentDateTime() > incidenceStart ){
623// *ok = false; 623// *ok = false;
624// return incidenceStart; 624// return incidenceStart;
625// } 625// }
626 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { 626 for (Q3PtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) {
627 if (alarm->enabled()) { 627 if (alarm->enabled()) {
628 if ( alarm->hasTime () ) { 628 if ( alarm->hasTime () ) {
629 if ( alarm->time() < alarmStart ) { 629 if ( alarm->time() < alarmStart ) {
630 alarmStart = alarm->time(); 630 alarmStart = alarm->time();
631 enabled = true; 631 enabled = true;
632 off = alarmStart.secsTo( incidenceStart ); 632 off = alarmStart.secsTo( incidenceStart );
633 } 633 }
634 634
635 } else { 635 } else {
636 int secs = alarm->startOffset().asSeconds(); 636 int secs = alarm->startOffset().asSeconds();
637 if ( incidenceStart.addSecs( secs ) < alarmStart ) { 637 if ( incidenceStart.addSecs( secs ) < alarmStart ) {
638 alarmStart = incidenceStart.addSecs( secs ); 638 alarmStart = incidenceStart.addSecs( secs );
diff --git a/libkcal/todo.h b/libkcal/todo.h
index 2131732..cea976c 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -17,39 +17,41 @@
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef TODO_H 20#ifndef TODO_H
21#define TODO_H 21#define TODO_H
22// 22//
23// Todo component, representing a VTODO object 23// Todo component, representing a VTODO object
24// 24//
25 25
26#include "incidence.h" 26#include "incidence.h"
27 27
28#include <qtimer.h> 28#include <qtimer.h>
29//Added by qt3to4:
30#include <Q3CString>
29 31
30namespace KCal { 32namespace KCal {
31 33
32/** 34/**
33 This class provides a Todo in the sense of RFC2445. 35 This class provides a Todo in the sense of RFC2445.
34*/ 36*/
35 class Todo : public QObject,public Incidence 37 class Todo : public QObject,public Incidence
36{ 38{
37 Q_OBJECT 39 Q_OBJECT
38 public: 40 public:
39 Todo(); 41 Todo();
40 Todo(const Todo &); 42 Todo(const Todo &);
41 ~Todo(); 43 ~Todo();
42 typedef ListBase<Todo> List; 44 typedef ListBase<Todo> List;
43 QCString type() const { return "Todo"; } 45 Q3CString type() const { return "Todo"; }
44 IncTypeID typeID() const { return todoID; } 46 IncTypeID typeID() const { return todoID; }
45 47
46 /** Return an exact copy of this todo. */ 48 /** Return an exact copy of this todo. */
47 Incidence *clone(); 49 Incidence *clone();
48 QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const; 50 QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const;
49 51
50 /** for setting the todo's due date/time with a QDateTime. */ 52 /** for setting the todo's due date/time with a QDateTime. */
51 void setDtDue(const QDateTime &dtDue); 53 void setDtDue(const QDateTime &dtDue);
52 /** returns an event's Due date/time as a QDateTime. */ 54 /** returns an event's Due date/time as a QDateTime. */
53 QDateTime dtDue() const; 55 QDateTime dtDue() const;
54 /** returns an event's due time as a string formatted according to the 56 /** returns an event's due time as a string formatted according to the
55 users locale settings */ 57 users locale settings */
diff --git a/libkcal/vcaldrag.cpp b/libkcal/vcaldrag.cpp
index f01f332..324981e 100644
--- a/libkcal/vcaldrag.cpp
+++ b/libkcal/vcaldrag.cpp
@@ -17,25 +17,25 @@
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include "vcaldrag.h" 22#include "vcaldrag.h"
23 23
24#include "vcalformat.h" 24#include "vcalformat.h"
25 25
26using namespace KCal; 26using namespace KCal;
27 27
28VCalDrag::VCalDrag( Calendar *cal, QWidget *parent, const char *name ) 28VCalDrag::VCalDrag( Calendar *cal, QWidget *parent, const char *name )
29 : QStoredDrag( "text/x-vCalendar", parent, name ) 29 : Q3StoredDrag( "text/x-vCalendar", parent, name )
30{ 30{
31 VCalFormat format; 31 VCalFormat format;
32 setEncodedData( format.toString( cal ).utf8() ); 32 setEncodedData( format.toString( cal ).utf8() );
33} 33}
34 34
35bool VCalDrag::canDecode( QMimeSource *me ) 35bool VCalDrag::canDecode( QMimeSource *me )
36{ 36{
37 return me->provides( "text/x-vCalendar" ); 37 return me->provides( "text/x-vCalendar" );
38} 38}
39 39
40bool VCalDrag::decode( QMimeSource *de, Calendar *cal ) 40bool VCalDrag::decode( QMimeSource *de, Calendar *cal )
41{ 41{
diff --git a/libkcal/vcaldrag.h b/libkcal/vcaldrag.h
index 3048124..68a320d 100644
--- a/libkcal/vcaldrag.h
+++ b/libkcal/vcaldrag.h
@@ -13,33 +13,33 @@
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#ifndef VCALDRAG_H 22#ifndef VCALDRAG_H
23#define VCALDRAG_H 23#define VCALDRAG_H
24 24
25#include <qdragobject.h> 25#include <q3dragobject.h>
26 26
27 27
28namespace KCal { 28namespace KCal {
29 29
30class Calendar; 30class Calendar;
31 31
32/** vCalendar drag&drop class. */ 32/** vCalendar drag&drop class. */
33class VCalDrag : public QStoredDrag { 33class VCalDrag : public Q3StoredDrag {
34 public: 34 public:
35 /** Create a drag&drop object for vCalendar component \a vcal. */ 35 /** Create a drag&drop object for vCalendar component \a vcal. */
36 VCalDrag( Calendar *vcal, QWidget *parent = 0, const char *name = 0 ); 36 VCalDrag( Calendar *vcal, QWidget *parent = 0, const char *name = 0 );
37 ~VCalDrag() {}; 37 ~VCalDrag() {};
38 38
39 /** Return, if drag&drop object can be decode to vCalendar. */ 39 /** Return, if drag&drop object can be decode to vCalendar. */
40 static bool canDecode( QMimeSource * ); 40 static bool canDecode( QMimeSource * );
41 /** Decode drag&drop object to vCalendar component \a vcal. */ 41 /** Decode drag&drop object to vCalendar component \a vcal. */
42 static bool decode( QMimeSource *e, Calendar *cal ); 42 static bool decode( QMimeSource *e, Calendar *cal );
43}; 43};
44 44
45} 45}
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp
index 2e19740..9cbaf16 100644
--- a/libkcal/vcalformat.cpp
+++ b/libkcal/vcalformat.cpp
@@ -13,29 +13,31 @@
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <qapplication.h> 22#include <qapplication.h>
23#include <qdatetime.h> 23#include <qdatetime.h>
24#include <qstring.h> 24#include <qstring.h>
25#include <qptrlist.h> 25#include <q3ptrlist.h>
26#include <qregexp.h> 26#include <qregexp.h>
27#include <qclipboard.h> 27#include <qclipboard.h>
28#include <qdialog.h> 28#include <qdialog.h>
29#include <qfile.h> 29#include <qfile.h>
30//Added by qt3to4:
31#include <Q3CString>
30 32
31#include <kdebug.h> 33#include <kdebug.h>
32#include <kglobal.h> 34#include <kglobal.h>
33#include <kmessagebox.h> 35#include <kmessagebox.h>
34#include <kiconloader.h> 36#include <kiconloader.h>
35#include <klocale.h> 37#include <klocale.h>
36 38
37#include "vcc.h" 39#include "vcc.h"
38#include "vobject.h" 40#include "vobject.h"
39 41
40#include "vcaldrag.h" 42#include "vcaldrag.h"
41#include "calendar.h" 43#include "calendar.h"
@@ -99,55 +101,55 @@ bool VCalFormat::save(Calendar *calendar, const QString &fileName)
99 101
100 102
101 vcal = newVObject(VCCalProp); 103 vcal = newVObject(VCCalProp);
102 104
103 // addPropValue(vcal,VCLocationProp, "0.0"); 105 // addPropValue(vcal,VCLocationProp, "0.0");
104 addPropValue(vcal,VCProdIdProp, productId()); 106 addPropValue(vcal,VCProdIdProp, productId());
105 tmpStr = mCalendar->getTimeZoneStr(); 107 tmpStr = mCalendar->getTimeZoneStr();
106 //qDebug("mCalendar->getTimeZoneStr() %s",tmpStr.latin1() ); 108 //qDebug("mCalendar->getTimeZoneStr() %s",tmpStr.latin1() );
107 addPropValue(vcal,VCTimeZoneProp, tmpStr.local8Bit()); 109 addPropValue(vcal,VCTimeZoneProp, tmpStr.local8Bit());
108 addPropValue(vcal,VCVersionProp, _VCAL_VERSION); 110 addPropValue(vcal,VCVersionProp, _VCAL_VERSION);
109 111
110 // TODO STUFF 112 // TODO STUFF
111 QPtrList<Todo> todoList = mCalendar->rawTodos(); 113 Q3PtrList<Todo> todoList = mCalendar->rawTodos();
112 QPtrListIterator<Todo> qlt(todoList); 114 Q3PtrListIterator<Todo> qlt(todoList);
113 for (; qlt.current(); ++qlt) { 115 for (; qlt.current(); ++qlt) {
114 vo = eventToVTodo(qlt.current()); 116 vo = eventToVTodo(qlt.current());
115 addVObjectProp(vcal, vo); 117 addVObjectProp(vcal, vo);
116 } 118 }
117 119
118 // EVENT STUFF 120 // EVENT STUFF
119 QPtrList<Event> events = mCalendar->rawEvents(); 121 Q3PtrList<Event> events = mCalendar->rawEvents();
120 Event *ev; 122 Event *ev;
121 for(ev=events.first();ev;ev=events.next()) { 123 for(ev=events.first();ev;ev=events.next()) {
122 vo = eventToVEvent(ev); 124 vo = eventToVEvent(ev);
123 addVObjectProp(vcal, vo); 125 addVObjectProp(vcal, vo);
124 } 126 }
125 127
126 writeVObjectToFile(QFile::encodeName(fileName).data() ,vcal); 128 writeVObjectToFile(QFile::encodeName(fileName).data() ,vcal);
127 cleanVObjects(vcal); 129 cleanVObjects(vcal);
128 cleanStrTbl(); 130 cleanStrTbl();
129 131
130 if (QFile::exists(fileName)) { 132 if (QFile::exists(fileName)) {
131 return true; 133 return true;
132 } else { 134 } else {
133 return false; // error 135 return false; // error
134 } 136 }
135} 137}
136 138
137bool VCalFormat::fromString( Calendar *calendar, const QString &text ) 139bool VCalFormat::fromString( Calendar *calendar, const QString &text )
138{ 140{
139 // TODO: Factor out VCalFormat::fromString() 141 // TODO: Factor out VCalFormat::fromString()
140 142
141 QCString data = text.utf8(); 143 Q3CString data = text.utf8();
142 144
143 if ( !data.size() ) return false; 145 if ( !data.size() ) return false;
144 146
145 VObject *vcal = Parse_MIME( data.data(), data.size()); 147 VObject *vcal = Parse_MIME( data.data(), data.size());
146 if ( !vcal ) return false; 148 if ( !vcal ) return false;
147 149
148 VObjectIterator i; 150 VObjectIterator i;
149 VObject *curvo; 151 VObject *curvo;
150 initPropIterator( &i, vcal ); 152 initPropIterator( &i, vcal );
151 153
152 // we only take the first object. TODO: parse all incidences. 154 // we only take the first object. TODO: parse all incidences.
153 do { 155 do {
@@ -201,25 +203,25 @@ QString VCalFormat::todoToString( Todo * todo, Calendar *calendar, bool useLocal
201QString VCalFormat::toString( Calendar *calendar ) 203QString VCalFormat::toString( Calendar *calendar )
202{ 204{
203 // TODO: Factor out VCalFormat::asString() 205 // TODO: Factor out VCalFormat::asString()
204 206
205 VObject *vcal = newVObject(VCCalProp); 207 VObject *vcal = newVObject(VCCalProp);
206 208
207 addPropValue( vcal, VCProdIdProp, CalFormat::productId() ); 209 addPropValue( vcal, VCProdIdProp, CalFormat::productId() );
208 QString tmpStr = mCalendar->getTimeZoneStr(); 210 QString tmpStr = mCalendar->getTimeZoneStr();
209 addPropValue( vcal, VCTimeZoneProp, tmpStr.local8Bit() ); 211 addPropValue( vcal, VCTimeZoneProp, tmpStr.local8Bit() );
210 addPropValue( vcal, VCVersionProp, _VCAL_VERSION ); 212 addPropValue( vcal, VCVersionProp, _VCAL_VERSION );
211 213
212 // TODO: Use all data. 214 // TODO: Use all data.
213 QPtrList<Event> events = calendar->events(); 215 Q3PtrList<Event> events = calendar->events();
214 Event *event = events.first(); 216 Event *event = events.first();
215 if ( !event ) return QString::null; 217 if ( !event ) return QString::null;
216 218
217 VObject *vevent = eventToVEvent( event ); 219 VObject *vevent = eventToVEvent( event );
218 220
219 addVObjectProp( vcal, vevent ); 221 addVObjectProp( vcal, vevent );
220 222
221 char *buf = writeMemVObject( 0, 0, vcal ); 223 char *buf = writeMemVObject( 0, 0, vcal );
222 224
223 QString result( buf ); 225 QString result( buf );
224 226
225 cleanVObject( vcal ); 227 cleanVObject( vcal );
@@ -262,26 +264,26 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
262 addPropValue(vtodo, VCSequenceProp, tmpStr.local8Bit()); 264 addPropValue(vtodo, VCSequenceProp, tmpStr.local8Bit());
263 265
264 // last modification date 266 // last modification date
265 tmpStr = qDateTimeToISO(anEvent->lastModified()); 267 tmpStr = qDateTimeToISO(anEvent->lastModified());
266 addPropValue(vtodo, VCLastModifiedProp, tmpStr.local8Bit()); 268 addPropValue(vtodo, VCLastModifiedProp, tmpStr.local8Bit());
267 269
268 // organizer stuff 270 // organizer stuff
269 tmpStr = "MAILTO:" + anEvent->organizer(); 271 tmpStr = "MAILTO:" + anEvent->organizer();
270 addPropValue(vtodo, ICOrganizerProp, tmpStr.local8Bit()); 272 addPropValue(vtodo, ICOrganizerProp, tmpStr.local8Bit());
271 273
272 // attendees 274 // attendees
273 if (anEvent->attendeeCount() != 0) { 275 if (anEvent->attendeeCount() != 0) {
274 QPtrList<Attendee> al = anEvent->attendees(); 276 Q3PtrList<Attendee> al = anEvent->attendees();
275 QPtrListIterator<Attendee> ai(al); 277 Q3PtrListIterator<Attendee> ai(al);
276 Attendee *curAttendee; 278 Attendee *curAttendee;
277 279
278 for (; ai.current(); ++ai) { 280 for (; ai.current(); ++ai) {
279 curAttendee = ai.current(); 281 curAttendee = ai.current();
280 if (!curAttendee->email().isEmpty() && 282 if (!curAttendee->email().isEmpty() &&
281 !curAttendee->name().isEmpty()) 283 !curAttendee->name().isEmpty())
282 tmpStr = "MAILTO:" + curAttendee->name() + " <" + 284 tmpStr = "MAILTO:" + curAttendee->name() + " <" +
283 curAttendee->email() + ">"; 285 curAttendee->email() + ">";
284 else if (curAttendee->name().isEmpty()) 286 else if (curAttendee->name().isEmpty())
285 tmpStr = "MAILTO: " + curAttendee->email(); 287 tmpStr = "MAILTO: " + curAttendee->email();
286 else if (curAttendee->email().isEmpty()) 288 else if (curAttendee->email().isEmpty())
287 tmpStr = "MAILTO: " + curAttendee->name(); 289 tmpStr = "MAILTO: " + curAttendee->name();
@@ -317,25 +319,25 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
317 "NEEDS_ACTION"); 319 "NEEDS_ACTION");
318 // completion date 320 // completion date
319 if (anEvent->hasCompletedDate()) { 321 if (anEvent->hasCompletedDate()) {
320 tmpStr = qDateTimeToISO(anEvent->completed()); 322 tmpStr = qDateTimeToISO(anEvent->completed());
321 addPropValue(vtodo, VCCompletedProp, tmpStr.local8Bit()); 323 addPropValue(vtodo, VCCompletedProp, tmpStr.local8Bit());
322 } 324 }
323 325
324 // priority 326 // priority
325 tmpStr.sprintf("%i",anEvent->priority()); 327 tmpStr.sprintf("%i",anEvent->priority());
326 addPropValue(vtodo, VCPriorityProp, tmpStr.local8Bit()); 328 addPropValue(vtodo, VCPriorityProp, tmpStr.local8Bit());
327 329
328 // related event 330 // related event
329 if (anEvent->relatedToUid()) { 331 if (!anEvent->relatedToUid().isEmpty()) {
330 addPropValue(vtodo, VCRelatedToProp, 332 addPropValue(vtodo, VCRelatedToProp,
331 anEvent->relatedToUid().local8Bit()); 333 anEvent->relatedToUid().local8Bit());
332 } 334 }
333 335
334 // categories 336 // categories
335 QStringList tmpStrList = anEvent->categories(); 337 QStringList tmpStrList = anEvent->categories();
336 tmpStr = ""; 338 tmpStr = "";
337 QString catStr; 339 QString catStr;
338 for ( QStringList::Iterator it = tmpStrList.begin(); 340 for ( QStringList::Iterator it = tmpStrList.begin();
339 it != tmpStrList.end(); 341 it != tmpStrList.end();
340 ++it ) { 342 ++it ) {
341 catStr = *it; 343 catStr = *it;
@@ -346,25 +348,25 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
346 // this must be a ';' character as the vCalendar specification requires! 348 // this must be a ';' character as the vCalendar specification requires!
347 // vcc.y has been hacked to translate the ';' to a ',' when the vcal is 349 // vcc.y has been hacked to translate the ';' to a ',' when the vcal is
348 // read in. 350 // read in.
349 tmpStr += ";"; 351 tmpStr += ";";
350 } 352 }
351 if (!tmpStr.isEmpty()) { 353 if (!tmpStr.isEmpty()) {
352 tmpStr.truncate(tmpStr.length()-1); 354 tmpStr.truncate(tmpStr.length()-1);
353 addPropValue(vtodo, VCCategoriesProp, tmpStr.local8Bit()); 355 addPropValue(vtodo, VCCategoriesProp, tmpStr.local8Bit());
354 } 356 }
355 357
356 // alarm stuff 358 // alarm stuff
357 kdDebug(5800) << "vcalformat::eventToVTodo was called" << endl; 359 kdDebug(5800) << "vcalformat::eventToVTodo was called" << endl;
358 QPtrList<Alarm> alarms = anEvent->alarms(); 360 Q3PtrList<Alarm> alarms = anEvent->alarms();
359 Alarm* alarm; 361 Alarm* alarm;
360 for (alarm = alarms.first(); alarm; alarm = alarms.next()) { 362 for (alarm = alarms.first(); alarm; alarm = alarms.next()) {
361 if (alarm->enabled()) { 363 if (alarm->enabled()) {
362 VObject *a; 364 VObject *a;
363 tmpStr = qDateTimeToISO(alarm->time()); 365 tmpStr = qDateTimeToISO(alarm->time());
364 if (alarm->type() == Alarm::Audio) { 366 if (alarm->type() == Alarm::Audio) {
365 a = addProp(vtodo, VCAAlarmProp); 367 a = addProp(vtodo, VCAAlarmProp);
366 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); 368 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
367 addPropValue(a, VCRepeatCountProp, "1"); 369 addPropValue(a, VCRepeatCountProp, "1");
368 addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); 370 addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile()));
369 } 371 }
370 else if (alarm->type() == Alarm::Procedure) { 372 else if (alarm->type() == Alarm::Procedure) {
@@ -424,26 +426,26 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
424 tmpStr.sprintf("%i", anEvent->revision()); 426 tmpStr.sprintf("%i", anEvent->revision());
425 addPropValue(vevent, VCSequenceProp, tmpStr.local8Bit()); 427 addPropValue(vevent, VCSequenceProp, tmpStr.local8Bit());
426 428
427 // last modification date 429 // last modification date
428 tmpStr = qDateTimeToISO(anEvent->lastModified()); 430 tmpStr = qDateTimeToISO(anEvent->lastModified());
429 addPropValue(vevent, VCLastModifiedProp, tmpStr.local8Bit()); 431 addPropValue(vevent, VCLastModifiedProp, tmpStr.local8Bit());
430 432
431 // attendee and organizer stuff 433 // attendee and organizer stuff
432 tmpStr = "MAILTO:" + anEvent->organizer(); 434 tmpStr = "MAILTO:" + anEvent->organizer();
433 addPropValue(vevent, ICOrganizerProp, tmpStr.local8Bit()); 435 addPropValue(vevent, ICOrganizerProp, tmpStr.local8Bit());
434 436
435 if (anEvent->attendeeCount() != 0) { 437 if (anEvent->attendeeCount() != 0) {
436 QPtrList<Attendee> al = anEvent->attendees(); 438 Q3PtrList<Attendee> al = anEvent->attendees();
437 QPtrListIterator<Attendee> ai(al); 439 Q3PtrListIterator<Attendee> ai(al);
438 Attendee *curAttendee; 440 Attendee *curAttendee;
439 441
440 // TODO: Put this functionality into Attendee class 442 // TODO: Put this functionality into Attendee class
441 for (; ai.current(); ++ai) { 443 for (; ai.current(); ++ai) {
442 curAttendee = ai.current(); 444 curAttendee = ai.current();
443 if (!curAttendee->email().isEmpty() && 445 if (!curAttendee->email().isEmpty() &&
444 !curAttendee->name().isEmpty()) 446 !curAttendee->name().isEmpty())
445 tmpStr = "MAILTO:" + curAttendee->name() + " <" + 447 tmpStr = "MAILTO:" + curAttendee->name() + " <" +
446 curAttendee->email() + ">"; 448 curAttendee->email() + ">";
447 else if (curAttendee->name().isEmpty()) 449 else if (curAttendee->name().isEmpty())
448 tmpStr = "MAILTO: " + curAttendee->email(); 450 tmpStr = "MAILTO: " + curAttendee->email();
449 else if (curAttendee->email().isEmpty()) 451 else if (curAttendee->email().isEmpty())
@@ -452,26 +454,26 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
452 curAttendee->email().isEmpty()) 454 curAttendee->email().isEmpty())
453 kdDebug(5800) << "warning! this Event has an attendee w/o name or email!" << endl; 455 kdDebug(5800) << "warning! this Event has an attendee w/o name or email!" << endl;
454 VObject *aProp = addPropValue(vevent, VCAttendeeProp, tmpStr.local8Bit()); 456 VObject *aProp = addPropValue(vevent, VCAttendeeProp, tmpStr.local8Bit());
455 addPropValue(aProp, VCRoleProp, writeRole(curAttendee->role())); 457 addPropValue(aProp, VCRoleProp, writeRole(curAttendee->role()));
456 addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE"); 458 addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE");
457 addPropValue(aProp, VCStatusProp, writeStatus(curAttendee->status())); 459 addPropValue(aProp, VCStatusProp, writeStatus(curAttendee->status()));
458 } 460 }
459 } 461 }
460 462
461 // recurrence rule stuff 463 // recurrence rule stuff
462 if (anEvent->doesRecur()) { 464 if (anEvent->doesRecur()) {
463 // some more variables 465 // some more variables
464 QPtrList<Recurrence::rMonthPos> tmpPositions; 466 Q3PtrList<Recurrence::rMonthPos> tmpPositions;
465 QPtrList<int> tmpDays; 467 Q3PtrList<int> tmpDays;
466 int *tmpDay; 468 int *tmpDay;
467 Recurrence::rMonthPos *tmpPos; 469 Recurrence::rMonthPos *tmpPos;
468 QString tmpStr2; 470 QString tmpStr2;
469 int i; 471 int i;
470 472
471 switch(anEvent->recurrence()->doesRecur()) { 473 switch(anEvent->recurrence()->doesRecur()) {
472 case Recurrence::rDaily: 474 case Recurrence::rDaily:
473 tmpStr.sprintf("D%i ",anEvent->recurrence()->frequency()); 475 tmpStr.sprintf("D%i ",anEvent->recurrence()->frequency());
474// if (anEvent->rDuration > 0) 476// if (anEvent->rDuration > 0)
475 //tmpStr += "#"; 477 //tmpStr += "#";
476 break; 478 break;
477 case Recurrence::rWeekly: 479 case Recurrence::rWeekly:
@@ -536,25 +538,25 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
536 break; 538 break;
537 default: 539 default:
538 kdDebug(5800) << "ERROR, it should never get here in eventToVEvent!" << endl; 540 kdDebug(5800) << "ERROR, it should never get here in eventToVEvent!" << endl;
539 break; 541 break;
540 } // switch 542 } // switch
541 543
542 if (anEvent->recurrence()->duration() > 0) { 544 if (anEvent->recurrence()->duration() > 0) {
543 tmpStr2.sprintf("#%i",anEvent->recurrence()->duration()); 545 tmpStr2.sprintf("#%i",anEvent->recurrence()->duration());
544 tmpStr += tmpStr2; 546 tmpStr += tmpStr2;
545 } else if (anEvent->recurrence()->duration() == -1) { 547 } else if (anEvent->recurrence()->duration() == -1) {
546 tmpStr += "#0"; // defined as repeat forever 548 tmpStr += "#0"; // defined as repeat forever
547 } else { 549 } else {
548 tmpStr += qDateTimeToISO(anEvent->recurrence()->endDate(), FALSE); 550 tmpStr += qDateTimeToISO((QDateTime)anEvent->recurrence()->endDate(), FALSE);
549 } 551 }
550 addPropValue(vevent,VCRRuleProp, tmpStr.local8Bit()); 552 addPropValue(vevent,VCRRuleProp, tmpStr.local8Bit());
551 553
552 } // event repeats 554 } // event repeats
553 555
554 // exceptions to recurrence 556 // exceptions to recurrence
555 DateList dateList = anEvent->exDates(); 557 DateList dateList = anEvent->exDates();
556 DateList::ConstIterator it; 558 DateList::ConstIterator it;
557 QString tmpStr2; 559 QString tmpStr2;
558 560
559 for (it = dateList.begin(); it != dateList.end(); ++it) { 561 for (it = dateList.begin(); it != dateList.end(); ++it) {
560 tmpStr = qDateToISO(*it) + ";"; 562 tmpStr = qDateToISO(*it) + ";";
@@ -616,36 +618,36 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
616 // this must be a ';' character as the vCalendar specification requires! 618 // this must be a ';' character as the vCalendar specification requires!
617 // vcc.y has been hacked to translate the ';' to a ',' when the vcal is 619 // vcc.y has been hacked to translate the ';' to a ',' when the vcal is
618 // read in. 620 // read in.
619 tmpStr += ";"; 621 tmpStr += ";";
620 } 622 }
621 if (!tmpStr.isEmpty()) { 623 if (!tmpStr.isEmpty()) {
622 tmpStr.truncate(tmpStr.length()-1); 624 tmpStr.truncate(tmpStr.length()-1);
623 addPropValue(vevent, VCCategoriesProp, tmpStr.local8Bit()); 625 addPropValue(vevent, VCCategoriesProp, tmpStr.local8Bit());
624 } 626 }
625 627
626 // attachments 628 // attachments
627 // TODO: handle binary attachments! 629 // TODO: handle binary attachments!
628 QPtrList<Attachment> attachments = anEvent->attachments(); 630 Q3PtrList<Attachment> attachments = anEvent->attachments();
629 for ( Attachment *at = attachments.first(); at; at = attachments.next() ) 631 for ( Attachment *at = attachments.first(); at; at = attachments.next() )
630 addPropValue(vevent, VCAttachProp, at->uri().local8Bit()); 632 addPropValue(vevent, VCAttachProp, at->uri().local8Bit());
631 633
632 // resources 634 // resources
633 tmpStrList = anEvent->resources(); 635 tmpStrList = anEvent->resources();
634 tmpStr = tmpStrList.join(";"); 636 tmpStr = tmpStrList.join(";");
635 if (!tmpStr.isEmpty()) 637 if (!tmpStr.isEmpty())
636 addPropValue(vevent, VCResourcesProp, tmpStr.local8Bit()); 638 addPropValue(vevent, VCResourcesProp, tmpStr.local8Bit());
637 639
638 // alarm stuff 640 // alarm stuff
639 QPtrList<Alarm> alarms = anEvent->alarms(); 641 Q3PtrList<Alarm> alarms = anEvent->alarms();
640 Alarm* alarm; 642 Alarm* alarm;
641 for (alarm = alarms.first(); alarm; alarm = alarms.next()) { 643 for (alarm = alarms.first(); alarm; alarm = alarms.next()) {
642 if (alarm->enabled()) { 644 if (alarm->enabled()) {
643 VObject *a ; 645 VObject *a ;
644 tmpStr = qDateTimeToISO(alarm->time()); 646 tmpStr = qDateTimeToISO(alarm->time());
645 if (alarm->type() == Alarm::Audio) { 647 if (alarm->type() == Alarm::Audio) {
646 a = addProp(vevent, VCAAlarmProp); 648 a = addProp(vevent, VCAAlarmProp);
647 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); 649 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
648 addPropValue(a, VCRepeatCountProp, "1"); 650 addPropValue(a, VCRepeatCountProp, "1");
649 addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); 651 addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile()));
650 } 652 }
651 if (alarm->type() == Alarm::Procedure) { 653 if (alarm->type() == Alarm::Procedure) {
@@ -663,25 +665,25 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent)
663 } 665 }
664 } 666 }
665 667
666 // priority 668 // priority
667 tmpStr.sprintf("%i",anEvent->priority()); 669 tmpStr.sprintf("%i",anEvent->priority());
668 addPropValue(vevent, VCPriorityProp, tmpStr.local8Bit()); 670 addPropValue(vevent, VCPriorityProp, tmpStr.local8Bit());
669 671
670 // transparency 672 // transparency
671 tmpStr.sprintf("%i",anEvent->transparency()); 673 tmpStr.sprintf("%i",anEvent->transparency());
672 addPropValue(vevent, VCTranspProp, tmpStr.local8Bit()); 674 addPropValue(vevent, VCTranspProp, tmpStr.local8Bit());
673 675
674 // related event 676 // related event
675 if (anEvent->relatedToUid()) { 677 if (!anEvent->relatedToUid().isEmpty()) {
676 addPropValue(vevent, VCRelatedToProp, 678 addPropValue(vevent, VCRelatedToProp,
677 anEvent->relatedToUid().local8Bit()); 679 anEvent->relatedToUid().local8Bit());
678 } 680 }
679 681
680 if (anEvent->pilotId()) { 682 if (anEvent->pilotId()) {
681 // pilot sync stuff 683 // pilot sync stuff
682 tmpStr.sprintf("%i",anEvent->pilotId()); 684 tmpStr.sprintf("%i",anEvent->pilotId());
683 addPropValue(vevent, XPilotIdProp, tmpStr.local8Bit()); 685 addPropValue(vevent, XPilotIdProp, tmpStr.local8Bit());
684 tmpStr.sprintf("%i",anEvent->syncStatus()); 686 tmpStr.sprintf("%i",anEvent->syncStatus());
685 addPropValue(vevent, XPilotStatusProp, tmpStr.local8Bit()); 687 addPropValue(vevent, XPilotStatusProp, tmpStr.local8Bit());
686 } 688 }
687 689
@@ -1399,38 +1401,38 @@ Event* VCalFormat::VEventToEvent(VObject *vevent)
1399 } 1401 }
1400 else 1402 else
1401 anEvent->setSyncStatus(Event::SYNCMOD); 1403 anEvent->setSyncStatus(Event::SYNCMOD);
1402 1404
1403 return anEvent; 1405 return anEvent;
1404} 1406}
1405 1407
1406 1408
1407QString VCalFormat::qDateToISO(const QDate &qd) 1409QString VCalFormat::qDateToISO(const QDate &qd)
1408{ 1410{
1409 QString tmpStr; 1411 QString tmpStr;
1410 1412
1411 ASSERT(qd.isValid()); 1413 Q_ASSERT(qd.isValid());
1412 1414
1413 tmpStr.sprintf("%.2d%.2d%.2d", 1415 tmpStr.sprintf("%.2d%.2d%.2d",
1414 qd.year(), qd.month(), qd.day()); 1416 qd.year(), qd.month(), qd.day());
1415 return tmpStr; 1417 return tmpStr;
1416 1418
1417} 1419}
1418 1420
1419QString VCalFormat::qDateTimeToISO(const QDateTime &qdt, bool zulu) 1421QString VCalFormat::qDateTimeToISO(const QDateTime &qdt, bool zulu)
1420{ 1422{
1421 QString tmpStr; 1423 QString tmpStr;
1422 1424
1423 ASSERT(qdt.date().isValid()); 1425 Q_ASSERT(qdt.date().isValid());
1424 ASSERT(qdt.time().isValid()); 1426 Q_ASSERT(qdt.time().isValid());
1425 if (zulu && !useLocalTime ) { 1427 if (zulu && !useLocalTime ) {
1426 QDateTime tmpDT = qdt.addSecs ( -KGlobal::locale()->localTimeOffset( qdt )*60); 1428 QDateTime tmpDT = qdt.addSecs ( -KGlobal::locale()->localTimeOffset( qdt )*60);
1427 tmpStr.sprintf("%.2d%.2d%.2dT%.2d%.2d%.2dZ", 1429 tmpStr.sprintf("%.2d%.2d%.2dT%.2d%.2d%.2dZ",
1428 tmpDT.date().year(), tmpDT.date().month(), 1430 tmpDT.date().year(), tmpDT.date().month(),
1429 tmpDT.date().day(), tmpDT.time().hour(), 1431 tmpDT.date().day(), tmpDT.time().hour(),
1430 tmpDT.time().minute(), tmpDT.time().second()); 1432 tmpDT.time().minute(), tmpDT.time().second());
1431 } else { 1433 } else {
1432 tmpStr.sprintf("%.2d%.2d%.2dT%.2d%.2d%.2d", 1434 tmpStr.sprintf("%.2d%.2d%.2dT%.2d%.2d%.2d",
1433 qdt.date().year(), qdt.date().month(), 1435 qdt.date().year(), qdt.date().month(),
1434 qdt.date().day(), qdt.time().hour(), 1436 qdt.date().day(), qdt.time().hour(),
1435 qdt.time().minute(), qdt.time().second()); 1437 qdt.time().minute(), qdt.time().second());
1436 } 1438 }
@@ -1445,26 +1447,26 @@ QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr)
1445 int year, month, day, hour, minute, second; 1447 int year, month, day, hour, minute, second;
1446 1448
1447 tmpStr = dtStr; 1449 tmpStr = dtStr;
1448 year = tmpStr.left(4).toInt(); 1450 year = tmpStr.left(4).toInt();
1449 month = tmpStr.mid(4,2).toInt(); 1451 month = tmpStr.mid(4,2).toInt();
1450 day = tmpStr.mid(6,2).toInt(); 1452 day = tmpStr.mid(6,2).toInt();
1451 hour = tmpStr.mid(9,2).toInt(); 1453 hour = tmpStr.mid(9,2).toInt();
1452 minute = tmpStr.mid(11,2).toInt(); 1454 minute = tmpStr.mid(11,2).toInt();
1453 second = tmpStr.mid(13,2).toInt(); 1455 second = tmpStr.mid(13,2).toInt();
1454 tmpDate.setYMD(year, month, day); 1456 tmpDate.setYMD(year, month, day);
1455 tmpTime.setHMS(hour, minute, second); 1457 tmpTime.setHMS(hour, minute, second);
1456 1458
1457 ASSERT(tmpDate.isValid()); 1459 Q_ASSERT(tmpDate.isValid());
1458 ASSERT(tmpTime.isValid()); 1460 Q_ASSERT(tmpTime.isValid());
1459 QDateTime tmpDT(tmpDate, tmpTime); 1461 QDateTime tmpDT(tmpDate, tmpTime);
1460 // correct for GMT if string is in Zulu format 1462 // correct for GMT if string is in Zulu format
1461 if (dtStr.at(dtStr.length()-1) == 'Z') 1463 if (dtStr.at(dtStr.length()-1) == 'Z')
1462 tmpDT = tmpDT.addSecs (KGlobal::locale()->localTimeOffset( tmpDT )*60); 1464 tmpDT = tmpDT.addSecs (KGlobal::locale()->localTimeOffset( tmpDT )*60);
1463 return tmpDT; 1465 return tmpDT;
1464} 1466}
1465 1467
1466QDate VCalFormat::ISOToQDate(const QString &dateStr) 1468QDate VCalFormat::ISOToQDate(const QString &dateStr)
1467{ 1469{
1468 int year, month, day; 1470 int year, month, day;
1469 1471
1470 year = dateStr.left(4).toInt(); 1472 year = dateStr.left(4).toInt();
@@ -1639,25 +1641,25 @@ Attendee::Role VCalFormat::readRole(const char *s) const
1639{ 1641{
1640 QString statStr = s; 1642 QString statStr = s;
1641 statStr = statStr.upper(); 1643 statStr = statStr.upper();
1642 Attendee::Role role = Attendee::ReqParticipant; 1644 Attendee::Role role = Attendee::ReqParticipant;
1643 1645
1644 if ( statStr == "OWNER") 1646 if ( statStr == "OWNER")
1645 role = Attendee::Chair; 1647 role = Attendee::Chair;
1646 // enum Role { ReqParticipant, OptParticipant, NonParticipant, Chair }; 1648 // enum Role { ReqParticipant, OptParticipant, NonParticipant, Chair };
1647 1649
1648 return role; 1650 return role;
1649} 1651}
1650 1652
1651QCString VCalFormat::writeRole(Attendee::Role role) const 1653Q3CString VCalFormat::writeRole(Attendee::Role role) const
1652{ 1654{
1653 if ( role == Attendee::Chair ) 1655 if ( role == Attendee::Chair )
1654 return "OWNER"; 1656 return "OWNER";
1655 return "ATTENDEE"; 1657 return "ATTENDEE";
1656} 1658}
1657Attendee::PartStat VCalFormat::readStatus(const char *s) const 1659Attendee::PartStat VCalFormat::readStatus(const char *s) const
1658{ 1660{
1659 QString statStr = s; 1661 QString statStr = s;
1660 statStr = statStr.upper(); 1662 statStr = statStr.upper();
1661 Attendee::PartStat status; 1663 Attendee::PartStat status;
1662 1664
1663 if (statStr == "X-ACTION") 1665 if (statStr == "X-ACTION")
@@ -1677,25 +1679,25 @@ Attendee::PartStat VCalFormat::readStatus(const char *s) const
1677 else if (statStr== "COMPLETED") 1679 else if (statStr== "COMPLETED")
1678 status = Attendee::Completed; 1680 status = Attendee::Completed;
1679 else if (statStr== "DELEGATED") 1681 else if (statStr== "DELEGATED")
1680 status = Attendee::Delegated; 1682 status = Attendee::Delegated;
1681 else { 1683 else {
1682 kdDebug(5800) << "error setting attendee mStatus, unknown mStatus!" << endl; 1684 kdDebug(5800) << "error setting attendee mStatus, unknown mStatus!" << endl;
1683 status = Attendee::NeedsAction; 1685 status = Attendee::NeedsAction;
1684 } 1686 }
1685 1687
1686 return status; 1688 return status;
1687} 1689}
1688 1690
1689QCString VCalFormat::writeStatus(Attendee::PartStat status) const 1691Q3CString VCalFormat::writeStatus(Attendee::PartStat status) const
1690{ 1692{
1691 switch(status) { 1693 switch(status) {
1692 default: 1694 default:
1693 case Attendee::NeedsAction: 1695 case Attendee::NeedsAction:
1694 return "NEEDS ACTION"; 1696 return "NEEDS ACTION";
1695 break; 1697 break;
1696 case Attendee::Accepted: 1698 case Attendee::Accepted:
1697 return "ACCEPTED"; 1699 return "ACCEPTED";
1698 break; 1700 break;
1699 case Attendee::Declined: 1701 case Attendee::Declined:
1700 return "DECLINED"; 1702 return "DECLINED";
1701 break; 1703 break;
diff --git a/libkcal/vcalformat.h b/libkcal/vcalformat.h
index 6dae3d2..cac9634 100644
--- a/libkcal/vcalformat.h
+++ b/libkcal/vcalformat.h
@@ -14,24 +14,27 @@
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#ifndef _VCALFORMAT_H 22#ifndef _VCALFORMAT_H
23#define _VCALFORMAT_H 23#define _VCALFORMAT_H
24 24
25#include "calformat.h" 25#include "calformat.h"
26//Added by qt3to4:
27#include <Q3CString>
28#include <Q3PtrList>
26 29
27#define _VCAL_VERSION "1.0" 30#define _VCAL_VERSION "1.0"
28 31
29class VObject; 32class VObject;
30 33
31namespace KCal { 34namespace KCal {
32 35
33/** 36/**
34 This class implements the vCalendar format. It provides methods for 37 This class implements the vCalendar format. It provides methods for
35 loading/saving/converting vCalendar format data into the internal KOrganizer 38 loading/saving/converting vCalendar format data into the internal KOrganizer
36 representation as Calendar and Events. 39 representation as Calendar and Events.
37 40
@@ -86,28 +89,28 @@ class VCalFormat : public CalFormat {
86 /** takes a string in the format YYYYMMDD and returns a 89 /** takes a string in the format YYYYMMDD and returns a
87 * valid QDate. */ 90 * valid QDate. */
88 QDate ISOToQDate(const QString & dtStr); 91 QDate ISOToQDate(const QString & dtStr);
89 /** takes a vCalendar tree of VObjects, and puts all of them that have 92 /** takes a vCalendar tree of VObjects, and puts all of them that have
90 * the "event" property into the dictionary, todos in the todo-list, etc. */ 93 * the "event" property into the dictionary, todos in the todo-list, etc. */
91 void populate(VObject *vcal); 94 void populate(VObject *vcal);
92 95
93 /** takes a number 0 - 6 and returns the two letter string of that day, 96 /** takes a number 0 - 6 and returns the two letter string of that day,
94 * i.e. MO, TU, WE, etc. */ 97 * i.e. MO, TU, WE, etc. */
95 const char *dayFromNum(int day); 98 const char *dayFromNum(int day);
96 /** the reverse of the above function. */ 99 /** the reverse of the above function. */
97 int numFromDay(const QString &day); 100 int numFromDay(const QString &day);
98 Attendee::Role VCalFormat::readRole(const char *s) const; 101 Attendee::Role readRole(const char *s) const;
99 QCString writeRole(Attendee::Role role) const; 102 Q3CString writeRole(Attendee::Role role) const;
100 Attendee::PartStat readStatus(const char *s) const; 103 Attendee::PartStat readStatus(const char *s) const;
101 QCString writeStatus(Attendee::PartStat status) const; 104 Q3CString writeStatus(Attendee::PartStat status) const;
102 105
103 private: 106 private:
104 Calendar *mCalendar; 107 Calendar *mCalendar;
105 bool useLocalTime; 108 bool useLocalTime;
106 109
107 QPtrList<Event> mEventsRelate; // events with relations 110 Q3PtrList<Event> mEventsRelate; // events with relations
108 QPtrList<Todo> mTodosRelate; // todos with relations 111 Q3PtrList<Todo> mTodosRelate; // todos with relations
109}; 112};
110 113
111} 114}
112 115
113#endif 116#endif
diff --git a/libkdepim/categoryeditdialog.cpp b/libkdepim/categoryeditdialog.cpp
index e2325d2..92a1737 100644
--- a/libkdepim/categoryeditdialog.cpp
+++ b/libkdepim/categoryeditdialog.cpp
@@ -14,53 +14,54 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qstringlist.h> 24#include <qstringlist.h>
25#include <qlineedit.h> 25#include <qlineedit.h>
26#include <qlistview.h> 26#include <q3listview.h>
27#include <qheader.h> 27#include <q3header.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qapplication.h> 29#include <qapplication.h>
30#include <QDesktopWidget>
30 31
31#include "kpimprefs.h" 32#include "kpimprefs.h"
32 33
33#include "categoryeditdialog.h" 34#include "categoryeditdialog.h"
34 35
35using namespace KPIM; 36using namespace KPIM;
36 37
37CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent, 38CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent,
38 const char* name, bool modal, 39 const char* name, bool modal,
39 WFlags fl ) 40 Qt::WFlags fl )
40 : CategoryEditDialog_base( parent, name, modal, fl ), 41 : CategoryEditDialog_base( parent, name, modal, fl ),
41 mPrefs( prefs ) 42 mPrefs( prefs )
42{ 43{
43 mCategories->header()->hide(); 44 mCategories->header()->hide();
44 45
45 QStringList::Iterator it; 46 QStringList::Iterator it;
46 bool categoriesExist=false; 47 bool categoriesExist=false;
47 for (it = mPrefs->mCustomCategories.begin(); 48 for (it = mPrefs->mCustomCategories.begin();
48 it != mPrefs->mCustomCategories.end(); ++it ) { 49 it != mPrefs->mCustomCategories.end(); ++it ) {
49 new QListViewItem(mCategories,*it); 50 new Q3ListViewItem(mCategories,*it);
50 categoriesExist=true; 51 categoriesExist=true;
51 } 52 }
52 53
53 connect(mCategories,SIGNAL(selectionChanged(QListViewItem *)), 54 connect(mCategories,SIGNAL(selectionChanged(Q3ListViewItem *)),
54 SLOT(editItem(QListViewItem *))); 55 SLOT(editItem(Q3ListViewItem *)));
55 connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &))); 56 connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &)));
56 mButtonRemove->setEnabled(categoriesExist); 57 mButtonRemove->setEnabled(categoriesExist);
57 mButtonModify->setEnabled(categoriesExist); 58 mButtonModify->setEnabled(categoriesExist);
58#ifndef DESKTOP_VERSION 59#ifndef DESKTOP_VERSION
59 mButtonOk->hide(); 60 mButtonOk->hide();
60 mButtonCancel->hide(); 61 mButtonCancel->hide();
61#endif 62#endif
62 mButtonAdd->setEnabled(!mEdit->text().isEmpty()); 63 mButtonAdd->setEnabled(!mEdit->text().isEmpty());
63 if ( QApplication::desktop()->width() > 460 ) 64 if ( QApplication::desktop()->width() > 460 )
64 resize( 300, 360 ); 65 resize( 300, 360 );
65 else 66 else
66 showMaximized(); 67 showMaximized();
@@ -73,25 +74,25 @@ CategoryEditDialog::~CategoryEditDialog()
73{ 74{
74 // no need to delete child widgets, Qt does it all for us 75 // no need to delete child widgets, Qt does it all for us
75} 76}
76 77
77void CategoryEditDialog::slotTextChanged(const QString &text) 78void CategoryEditDialog::slotTextChanged(const QString &text)
78{ 79{
79 mButtonAdd->setEnabled(!text.isEmpty()); 80 mButtonAdd->setEnabled(!text.isEmpty());
80} 81}
81 82
82void CategoryEditDialog::add() 83void CategoryEditDialog::add()
83{ 84{
84 if (!mEdit->text().isEmpty()) { 85 if (!mEdit->text().isEmpty()) {
85 new QListViewItem(mCategories,mEdit->text()); 86 new Q3ListViewItem(mCategories,mEdit->text());
86 mEdit->setText(""); 87 mEdit->setText("");
87 mButtonRemove->setEnabled(mCategories->childCount()>0); 88 mButtonRemove->setEnabled(mCategories->childCount()>0);
88 mButtonModify->setEnabled(mCategories->childCount()>0); 89 mButtonModify->setEnabled(mCategories->childCount()>0);
89 } 90 }
90} 91}
91 92
92void CategoryEditDialog::remove() 93void CategoryEditDialog::remove()
93{ 94{
94 if (mCategories->currentItem()) { 95 if (mCategories->currentItem()) {
95 delete mCategories->currentItem(); 96 delete mCategories->currentItem();
96 mButtonRemove->setEnabled(mCategories->childCount()>0); 97 mButtonRemove->setEnabled(mCategories->childCount()>0);
97 mButtonModify->setEnabled(mCategories->childCount()>0); 98 mButtonModify->setEnabled(mCategories->childCount()>0);
@@ -112,30 +113,30 @@ void CategoryEditDialog::accept()
112} 113}
113 114
114void CategoryEditDialog::slotOk() 115void CategoryEditDialog::slotOk()
115{ 116{
116 slotApply(); 117 slotApply();
117 QDialog::accept(); 118 QDialog::accept();
118} 119}
119 120
120void CategoryEditDialog::slotApply() 121void CategoryEditDialog::slotApply()
121{ 122{
122 mPrefs->mCustomCategories.clear(); 123 mPrefs->mCustomCategories.clear();
123 124
124 QListViewItem *item = mCategories->firstChild(); 125 Q3ListViewItem *item = mCategories->firstChild();
125 while(item) { 126 while(item) {
126 mPrefs->mCustomCategories.append(item->text(0)); 127 mPrefs->mCustomCategories.append(item->text(0));
127 item = item->nextSibling(); 128 item = item->nextSibling();
128 } 129 }
129 mPrefs->writeConfig(); 130 mPrefs->writeConfig();
130 131
131 emit categoryConfigChanged(); 132 emit categoryConfigChanged();
132} 133}
133 134
134void CategoryEditDialog::editItem(QListViewItem *item) 135void CategoryEditDialog::editItem(Q3ListViewItem *item)
135{ 136{
136 mEdit->setText(item->text(0)); 137 mEdit->setText(item->text(0));
137 mButtonRemove->setEnabled(true); 138 mButtonRemove->setEnabled(true);
138 mButtonModify->setEnabled(true); 139 mButtonModify->setEnabled(true);
139} 140}
140 141
141//US #include "categoryeditdialog.moc" 142//US #include "categoryeditdialog.moc"
diff --git a/libkdepim/categoryeditdialog.h b/libkdepim/categoryeditdialog.h
index 9bb3201..828894f 100644
--- a/libkdepim/categoryeditdialog.h
+++ b/libkdepim/categoryeditdialog.h
@@ -15,72 +15,72 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KPIM_CATEGORYEDITDIALOG_H 23#ifndef KPIM_CATEGORYEDITDIALOG_H
24#define KPIM_CATEGORYEDITDIALOG_H 24#define KPIM_CATEGORYEDITDIALOG_H
25 25
26#include <categoryeditdialog_base.h> 26#include <categoryeditdialog_base.h>
27#include <qlistview.h> 27#include <q3listview.h>
28 28
29class KPimPrefs; 29class KPimPrefs;
30 30
31namespace KPIM { 31namespace KPIM {
32 32
33 class CategorySelectItem :public QObject, public QCheckListItem 33 class CategorySelectItem :public QObject, public Q3CheckListItem
34{ 34{
35 35
36 Q_OBJECT 36 Q_OBJECT
37 public: 37 public:
38 38
39 CategorySelectItem(QListView * parent, const QString & text, Type tt) : QObject( parent ), 39 CategorySelectItem(Q3ListView * parent, const QString & text, Type tt) : QObject( parent ),
40 QCheckListItem (parent, text, tt ) 40 Q3CheckListItem (parent, text, tt )
41 {;} 41 {;}
42 42
43 signals: 43 signals:
44 void stateChanged( QListViewItem*); 44 void stateChanged( Q3ListViewItem*);
45 45
46 protected: 46 protected:
47 47
48 virtual void stateChange(bool b) 48 virtual void stateChange(bool b)
49 { 49 {
50 QCheckListItem::stateChange(b); 50 Q3CheckListItem::stateChange(b);
51 emit stateChanged( this ); 51 emit stateChanged( this );
52 } 52 }
53}; 53};
54 54
55 55
56class CategoryEditDialog : public CategoryEditDialog_base 56class CategoryEditDialog : public CategoryEditDialog_base
57{ 57{
58 Q_OBJECT 58 Q_OBJECT
59 public: 59 public:
60 CategoryEditDialog( KPimPrefs *prefs, QWidget* parent = 0, 60 CategoryEditDialog( KPimPrefs *prefs, QWidget* parent = 0,
61 const char* name = 0, 61 const char* name = 0,
62 bool modal = FALSE, WFlags fl = 0 ); 62 bool modal = FALSE, Qt::WFlags fl = 0 );
63 ~CategoryEditDialog(); 63 ~CategoryEditDialog();
64 64
65 public slots: 65 public slots:
66 void add(); 66 void add();
67 void remove(); 67 void remove();
68 void modify(); 68 void modify();
69 void accept(); 69 void accept();
70 70
71 void slotOk(); 71 void slotOk();
72 void slotApply(); 72 void slotApply();
73 73
74 signals: 74 signals:
75 void categoryConfigChanged(); 75 void categoryConfigChanged();
76 76
77 private slots: 77 private slots:
78 void editItem(QListViewItem *item); 78 void editItem(Q3ListViewItem *item);
79 void slotTextChanged(const QString &text); 79 void slotTextChanged(const QString &text);
80 80 private:
81 KPimPrefs *mPrefs; 81 KPimPrefs *mPrefs;
82}; 82};
83 83
84} 84}
85 85
86#endif 86#endif
diff --git a/libkdepim/categoryeditdialog_base.cpp b/libkdepim/categoryeditdialog_base.cpp
index 1908576..c85f6e5 100644
--- a/libkdepim/categoryeditdialog_base.cpp
+++ b/libkdepim/categoryeditdialog_base.cpp
@@ -2,79 +2,83 @@
2/**************************************************************************** 2/****************************************************************************
3** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/libkdepim/categoryeditdialog_base.ui' 3** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/libkdepim/categoryeditdialog_base.ui'
4** 4**
5** Created: Sat Mar 29 21:46:09 2003 5** Created: Sat Mar 29 21:46:09 2003
6** by: The User Interface Compiler () 6** by: The User Interface Compiler ()
7** 7**
8** WARNING! All changes made in this file will be lost! 8** WARNING! All changes made in this file will be lost!
9****************************************************************************/ 9****************************************************************************/
10 10
11#include "categoryeditdialog_base.h" 11#include "categoryeditdialog_base.h"
12 12
13#include <qvariant.h> 13#include <qvariant.h>
14#include <qheader.h> 14#include <q3header.h>
15#include <qlineedit.h> 15#include <qlineedit.h>
16#include <qlistview.h> 16#include <q3listview.h>
17#include <qpushbutton.h> 17#include <qpushbutton.h>
18#include <qlayout.h> 18#include <qlayout.h>
19#include <qtooltip.h> 19#include <qtooltip.h>
20#include <qwhatsthis.h> 20#include <q3whatsthis.h>
21//Added by qt3to4:
22#include <Q3GridLayout>
23#include <Q3HBoxLayout>
24#include <Q3VBoxLayout>
21 25
22/* 26/*
23 * Constructs a CategoryEditDialog_base as a child of 'parent', with the 27 * Constructs a CategoryEditDialog_base as a child of 'parent', with the
24 * name 'name' and widget flags set to 'f'. 28 * name 'name' and widget flags set to 'f'.
25 * 29 *
26 * The dialog will by default be modeless, unless you set 'modal' to 30 * The dialog will by default be modeless, unless you set 'modal' to
27 * TRUE to construct a modal dialog. 31 * TRUE to construct a modal dialog.
28 */ 32 */
29CategoryEditDialog_base::CategoryEditDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) 33CategoryEditDialog_base::CategoryEditDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl )
30 : QDialog( parent, name, true, fl ) 34 : QDialog( parent, name, true, fl )
31 35
32{ 36{
33 if ( !name ) 37 if ( !name )
34 setName( "CategoryEditDialog_base" ); 38 setName( "CategoryEditDialog_base" );
35 CategoryEditDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "CategoryEditDialog_baseLayout"); 39 CategoryEditDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "CategoryEditDialog_baseLayout");
36 40
37 mEdit = new QLineEdit( this, "mEdit" ); 41 mEdit = new QLineEdit( this, "mEdit" );
38 42
39 CategoryEditDialog_baseLayout->addMultiCellWidget( mEdit, 1, 1, 0, 0 ); 43 CategoryEditDialog_baseLayout->addMultiCellWidget( mEdit, 1, 1, 0, 0 );
40 44
41 Layout13 = new QHBoxLayout( 0, 0, 6, "Layout13"); 45 Layout13 = new Q3HBoxLayout( 0, 0, 6, "Layout13");
42 46
43 // mButtonHelp = new QPushButton( this, "mButtonHelp" ); 47 // mButtonHelp = new QPushButton( this, "mButtonHelp" );
44 //mButtonHelp->setAutoDefault( TRUE ); 48 //mButtonHelp->setAutoDefault( TRUE );
45 //Layout13->addWidget( mButtonHelp ); 49 //Layout13->addWidget( mButtonHelp );
46 //QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); 50 //QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
47 //Layout13->addItem( spacer ); 51 //Layout13->addItem( spacer );
48 52
49 //mApply = new QPushButton( this, "mApply" ); 53 //mApply = new QPushButton( this, "mApply" );
50 // Layout13->addWidget( mApply ); 54 // Layout13->addWidget( mApply );
51 55
52 mButtonOk = new QPushButton( this, "mButtonOk" ); 56 mButtonOk = new QPushButton( this, "mButtonOk" );
53 mButtonOk->setAutoDefault( TRUE ); 57 mButtonOk->setAutoDefault( TRUE );
54 mButtonOk->setDefault( TRUE ); 58 mButtonOk->setDefault( TRUE );
55 Layout13->addWidget( mButtonOk ); 59 Layout13->addWidget( mButtonOk );
56 60
57 mButtonCancel = new QPushButton( this, "mButtonCancel" ); 61 mButtonCancel = new QPushButton( this, "mButtonCancel" );
58 mButtonCancel->setAutoDefault( TRUE ); 62 mButtonCancel->setAutoDefault( TRUE );
59 Layout13->addWidget( mButtonCancel ); 63 Layout13->addWidget( mButtonCancel );
60 64
61 CategoryEditDialog_baseLayout->addMultiCellLayout( Layout13, 2, 2, 0, 1 ); 65 CategoryEditDialog_baseLayout->addMultiCellLayout( Layout13, 2, 2, 0, 1 );
62 66
63 mCategories = new QListView( this, "mCategories" ); 67 mCategories = new Q3ListView( this, "mCategories" );
64 mCategories->addColumn( tr2i18n( "Category" ) ); 68 mCategories->addColumn( tr2i18n( "Category" ) );
65 69
66 CategoryEditDialog_baseLayout->addWidget( mCategories, 0, 0 ); 70 CategoryEditDialog_baseLayout->addWidget( mCategories, 0, 0 );
67 71
68 layout103 = new QVBoxLayout( 0, 0, 6, "layout103"); 72 layout103 = new Q3VBoxLayout( 0, 0, 6, "layout103");
69 73
70 mButtonAdd = new QPushButton( this, "mButtonAdd" ); 74 mButtonAdd = new QPushButton( this, "mButtonAdd" );
71 CategoryEditDialog_baseLayout->addMultiCellWidget(mButtonAdd , 1, 1, 1, 1 ); 75 CategoryEditDialog_baseLayout->addMultiCellWidget(mButtonAdd , 1, 1, 1, 1 );
72 //layout103->addWidget( mButtonAdd ); 76 //layout103->addWidget( mButtonAdd );
73 77
74 mButtonModify = new QPushButton( this, "mButtonModify" ); 78 mButtonModify = new QPushButton( this, "mButtonModify" );
75 layout103->addWidget( mButtonModify ); 79 layout103->addWidget( mButtonModify );
76 80
77 mButtonRemove = new QPushButton( this, "mButtonRemove" ); 81 mButtonRemove = new QPushButton( this, "mButtonRemove" );
78 layout103->addWidget( mButtonRemove ); 82 layout103->addWidget( mButtonRemove );
79 QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); 83 QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
80 layout103->addItem( spacer_2 ); 84 layout103->addItem( spacer_2 );
diff --git a/libkdepim/categoryeditdialog_base.h b/libkdepim/categoryeditdialog_base.h
index 5557ad0..cd577b0 100644
--- a/libkdepim/categoryeditdialog_base.h
+++ b/libkdepim/categoryeditdialog_base.h
@@ -3,56 +3,60 @@
3** 3**
4** Created: Sat Mar 29 21:45:20 2003 4** Created: Sat Mar 29 21:45:20 2003
5** by: The User Interface Compiler () 5** by: The User Interface Compiler ()
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9 9
10#ifndef CATEGORYEDITDIALOG_BASE_H 10#ifndef CATEGORYEDITDIALOG_BASE_H
11#define CATEGORYEDITDIALOG_BASE_H 11#define CATEGORYEDITDIALOG_BASE_H
12 12
13#include <qvariant.h> 13#include <qvariant.h>
14#include <qdialog.h> 14#include <qdialog.h>
15 15//Added by qt3to4:
16class QVBoxLayout; 16#include <Q3VBoxLayout>
17class QHBoxLayout; 17#include <Q3GridLayout>
18class QGridLayout; 18#include <Q3HBoxLayout>
19
20class Q3VBoxLayout;
21class Q3HBoxLayout;
22class Q3GridLayout;
19class QLineEdit; 23class QLineEdit;
20class QListView; 24class Q3ListView;
21class QListViewItem; 25class Q3ListViewItem;
22class QPushButton; 26class QPushButton;
23 27
24class CategoryEditDialog_base : public QDialog 28class CategoryEditDialog_base : public QDialog
25{ 29{
26 Q_OBJECT 30 Q_OBJECT
27 31
28public: 32public:
29 CategoryEditDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 33 CategoryEditDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
30 ~CategoryEditDialog_base(); 34 ~CategoryEditDialog_base();
31 35
32 QLineEdit* mEdit; 36 QLineEdit* mEdit;
33 QPushButton* mButtonHelp; 37 QPushButton* mButtonHelp;
34 QPushButton* mApply; 38 QPushButton* mApply;
35 QPushButton* mButtonOk; 39 QPushButton* mButtonOk;
36 QPushButton* mButtonCancel; 40 QPushButton* mButtonCancel;
37 QListView* mCategories; 41 Q3ListView* mCategories;
38 QPushButton* mButtonAdd; 42 QPushButton* mButtonAdd;
39 QPushButton* mButtonModify; 43 QPushButton* mButtonModify;
40 QPushButton* mButtonRemove; 44 QPushButton* mButtonRemove;
41 45
42public slots: 46public slots:
43 virtual void add(); 47 virtual void add();
44 virtual void modify(); 48 virtual void modify();
45 virtual void slotApply(); 49 virtual void slotApply();
46 virtual void remove(); 50 virtual void remove();
47 virtual void slotOk(); 51 virtual void slotOk();
48 52
49protected: 53protected:
50 QGridLayout* CategoryEditDialog_baseLayout; 54 Q3GridLayout* CategoryEditDialog_baseLayout;
51 QHBoxLayout* Layout13; 55 Q3HBoxLayout* Layout13;
52 QVBoxLayout* layout103; 56 Q3VBoxLayout* layout103;
53 57
54protected slots: 58protected slots:
55 virtual void languageChange(); 59 virtual void languageChange();
56}; 60};
57 61
58#endif // CATEGORYEDITDIALOG_BASE_H 62#endif // CATEGORYEDITDIALOG_BASE_H
diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp
index 2a9b43e..4f72880 100644
--- a/libkdepim/categoryselectdialog.cpp
+++ b/libkdepim/categoryselectdialog.cpp
@@ -12,42 +12,45 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlistview.h> 24#include <q3listview.h>
25#include <qpushbutton.h> 25#include <qpushbutton.h>
26#include <qheader.h> 26#include <q3header.h>
27#include <qapp.h> 27#include <qapplication.h>
28#include <qmessagebox.h> 28#include <qmessagebox.h>
29//Added by qt3to4:
30#include <QPixmap>
31#include <QDesktopWidget>
29#include <kmessagebox.h> 32#include <kmessagebox.h>
30 33
31 34
32#include "categoryeditdialog.h" 35#include "categoryeditdialog.h"
33#include "categoryselectdialog.h" 36#include "categoryselectdialog.h"
34 37
35#include "kpimprefs.h" 38#include "kpimprefs.h"
36 39
37using namespace KPIM; 40using namespace KPIM;
38 41
39CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent, 42CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent,
40 const char* name, 43 const char* name,
41 bool modal, WFlags fl ) 44 bool modal, Qt::WFlags fl )
42 : CategorySelectDialog_base( parent, name, true, fl ), 45 : CategorySelectDialog_base( parent, name, true, fl ),
43 mPrefs( prefs ) 46 mPrefs( prefs )
44{ 47{
45 Q_UNUSED( modal ); 48 Q_UNUSED( modal );
46 mColorItem = 0; 49 mColorItem = 0;
47 mColorEnabled = false; 50 mColorEnabled = false;
48 mCategories->header()->hide(); 51 mCategories->header()->hide();
49 52
50 setCategories(); 53 setCategories();
51 54
52 connect(mButtonEdit,SIGNAL(clicked()),this, SLOT(editCategoriesDialog())); 55 connect(mButtonEdit,SIGNAL(clicked()),this, SLOT(editCategoriesDialog()));
53 if ( QApplication::desktop()->width() > 460 ) 56 if ( QApplication::desktop()->width() > 460 )
@@ -72,53 +75,53 @@ void CategorySelectDialog::editCategoriesDialog()
72 setCategories(); 75 setCategories();
73 setSelected( temp ); 76 setSelected( temp );
74} 77}
75void CategorySelectDialog::setCategories() 78void CategorySelectDialog::setCategories()
76{ 79{
77 mColorItem = 0; 80 mColorItem = 0;
78 mCategories->clear(); 81 mCategories->clear();
79 mCategoryList.clear(); 82 mCategoryList.clear();
80 83
81 QStringList::Iterator it; 84 QStringList::Iterator it;
82 for (it = mPrefs->mCustomCategories.begin(); 85 for (it = mPrefs->mCustomCategories.begin();
83 it != mPrefs->mCustomCategories.end(); ++it ) { 86 it != mPrefs->mCustomCategories.end(); ++it ) {
84 CategorySelectItem * item = new CategorySelectItem(mCategories,*it,QCheckListItem::CheckBox); 87 CategorySelectItem * item = new CategorySelectItem(mCategories,*it,Q3CheckListItem::CheckBox);
85 QObject::connect( item, SIGNAL( stateChanged(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) ); 88 QObject::connect( item, SIGNAL( stateChanged(Q3ListViewItem *) ), this, SLOT( clicked(Q3ListViewItem *) ) );
86 89
87 } 90 }
88} 91}
89 92
90CategorySelectDialog::~CategorySelectDialog() 93CategorySelectDialog::~CategorySelectDialog()
91{ 94{
92} 95}
93 96
94void CategorySelectDialog::setSelected(const QStringList &selList) 97void CategorySelectDialog::setSelected(const QStringList &selList)
95{ 98{
96 clear(); 99 clear();
97 100
98 QStringList::ConstIterator it; 101 QStringList::ConstIterator it;
99 QStringList notFound; 102 QStringList notFound;
100 bool found = false; 103 bool found = false;
101 for (it=selList.begin();it!=selList.end();++it) { 104 for (it=selList.begin();it!=selList.end();++it) {
102 //qDebug(" CategorySelectDialog::setSelected("); 105 //qDebug(" CategorySelectDialog::setSelected(");
103 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 106 Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild();
104 while (item) { 107 while (item) {
105 if (item->text() == *it) { 108 if (item->text() == *it) {
106 item->setOn(true); 109 item->setOn(true);
107 if ( ! found ) 110 if ( ! found )
108 setColorItem( item ); 111 setColorItem( item );
109 found = true; 112 found = true;
110 break; 113 break;
111 } 114 }
112 item = (QCheckListItem *)item->nextSibling(); 115 item = (Q3CheckListItem *)item->nextSibling();
113 } 116 }
114// if ( ! found ) { 117// if ( ! found ) {
115 118
116//emit updateCategoriesGlobal(); 119//emit updateCategoriesGlobal();
117// QMessageBox::information( this, "KO/E: Information!", 120// QMessageBox::information( this, "KO/E: Information!",
118// "Categories found, which were not\n" 121// "Categories found, which were not\n"
119// "in list of categories!\n" 122// "in list of categories!\n"
120// "message", 123// "message",
121// "OK", "", 0, 124// "OK", "", 0,
122// 0, 1 ); 125// 0, 1 );
123// setSelected(selList); 126// setSelected(selList);
124// return; 127// return;
@@ -128,119 +131,119 @@ void CategorySelectDialog::setSelected(const QStringList &selList)
128 131
129QStringList CategorySelectDialog::selectedCategories() const 132QStringList CategorySelectDialog::selectedCategories() const
130{ 133{
131 return mCategoryList; 134 return mCategoryList;
132} 135}
133void CategorySelectDialog::setColorEnabled() 136void CategorySelectDialog::setColorEnabled()
134{ 137{
135 mColorEnabled = true; 138 mColorEnabled = true;
136 mSetColorCat->show(); 139 mSetColorCat->show();
137} 140}
138void CategorySelectDialog::setColorCat() 141void CategorySelectDialog::setColorCat()
139{ 142{
140 QCheckListItem * newColorItem = (QCheckListItem * )mCategories->currentItem (); 143 Q3CheckListItem * newColorItem = (Q3CheckListItem * )mCategories->currentItem ();
141 if ( !newColorItem ) { 144 if ( !newColorItem ) {
142 KMessageBox::error(this,i18n("There is no current item.")); 145 KMessageBox::error(this,i18n("There is no current item."));
143 return; 146 return;
144 } 147 }
145 if ( !newColorItem->isOn() ) 148 if ( !newColorItem->isOn() )
146 newColorItem->setOn( true ); 149 newColorItem->setOn( true );
147 setColorItem( newColorItem ); 150 setColorItem( newColorItem );
148 151
149} 152}
150void CategorySelectDialog::clicked ( QListViewItem * it ) 153void CategorySelectDialog::clicked ( Q3ListViewItem * it )
151{ 154{
152 if ( ! it ) 155 if ( ! it )
153 return; 156 return;
154 QCheckListItem *i = (QCheckListItem *) it; 157 Q3CheckListItem *i = (Q3CheckListItem *) it;
155 if ( !i->isOn() && i==mColorItem) { 158 if ( !i->isOn() && i==mColorItem) {
156 setColorItem( 0); 159 setColorItem( 0);
157 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 160 Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild();
158 while (item) { 161 while (item) {
159 if (item->isOn()) { 162 if (item->isOn()) {
160 setColorItem( item ); 163 setColorItem( item );
161 break; 164 break;
162 } 165 }
163 item = (QCheckListItem *)item->nextSibling(); 166 item = (Q3CheckListItem *)item->nextSibling();
164 } 167 }
165 } else if ( i->isOn() && !mColorItem) { 168 } else if ( i->isOn() && !mColorItem) {
166 setColorItem( i); 169 setColorItem( i);
167 } 170 }
168} 171}
169void CategorySelectDialog::setColorItem( QCheckListItem * newColorItem ) 172void CategorySelectDialog::setColorItem( Q3CheckListItem * newColorItem )
170{ 173{
171 if ( !mColorEnabled ) 174 if ( !mColorEnabled )
172 return; 175 return;
173 if ( mColorItem == newColorItem) 176 if ( mColorItem == newColorItem)
174 return; 177 return;
175 if ( mColorItem ) { 178 if ( mColorItem ) {
176 mColorItem->setPixmap ( 0, QPixmap() ); 179 mColorItem->setPixmap ( 0, QPixmap() );
177 mColorItem = 0; 180 mColorItem = 0;
178 } 181 }
179 if ( newColorItem ) { 182 if ( newColorItem ) {
180 QPixmap pix (newColorItem->height()/2, newColorItem->height()/2 ); 183 QPixmap pix (newColorItem->height()/2, newColorItem->height()/2 );
181 pix.fill(Qt::red ); 184 pix.fill(Qt::red );
182 newColorItem->setPixmap ( 0, pix ); 185 newColorItem->setPixmap ( 0, pix );
183 mColorItem = newColorItem; 186 mColorItem = newColorItem;
184 } 187 }
185} 188}
186void CategorySelectDialog::slotApply() 189void CategorySelectDialog::slotApply()
187{ 190{
188 QStringList categories; 191 QStringList categories;
189 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 192 Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild();
190 QString colcat; 193 QString colcat;
191 while (item) { 194 while (item) {
192 if (item->isOn()) { 195 if (item->isOn()) {
193 if ( item == mColorItem) 196 if ( item == mColorItem)
194 colcat = item->text(); 197 colcat = item->text();
195 else 198 else
196 categories.append(item->text()); 199 categories.append(item->text());
197 } 200 }
198 item = (QCheckListItem *)item->nextSibling(); 201 item = (Q3CheckListItem *)item->nextSibling();
199 } 202 }
200 categories.sort(); 203 categories.sort();
201 if ( ! colcat.isEmpty() ) 204 if ( ! colcat.isEmpty() )
202 categories.prepend( colcat ); 205 categories.prepend( colcat );
203 // QString categoriesStr = categories.join(","); 206 // QString categoriesStr = categories.join(",");
204 207
205 mCategoryList = categories; 208 mCategoryList = categories;
206 209
207} 210}
208void CategorySelectDialog::accept() 211void CategorySelectDialog::accept()
209{ 212{
210 slotOk(); 213 slotOk();
211} 214}
212 215
213void CategorySelectDialog::slotOk() 216void CategorySelectDialog::slotOk()
214{ 217{
215 slotApply(); 218 slotApply();
216 emit categoriesSelected(mCategoryList); 219 emit categoriesSelected(mCategoryList);
217 emit categoriesSelected(mCategoryList.join(",")); 220 emit categoriesSelected(mCategoryList.join(","));
218 QDialog::accept(); 221 QDialog::accept();
219} 222}
220 223
221void CategorySelectDialog::clear() 224void CategorySelectDialog::clear()
222{ 225{
223 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 226 Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild();
224 while (item) { 227 while (item) {
225 item->setOn(false); 228 item->setOn(false);
226 item = (QCheckListItem *)item->nextSibling(); 229 item = (Q3CheckListItem *)item->nextSibling();
227 } 230 }
228} 231}
229 232
230void CategorySelectDialog::updateCategoryConfig() 233void CategorySelectDialog::updateCategoryConfig()
231{ 234{
232 QStringList selected; 235 QStringList selected;
233 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 236 Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild();
234 while (item) { 237 while (item) {
235 if (item->isOn()) { 238 if (item->isOn()) {
236 selected.append(item->text()); 239 selected.append(item->text());
237 } 240 }
238 item = (QCheckListItem *)item->nextSibling(); 241 item = (Q3CheckListItem *)item->nextSibling();
239 } 242 }
240 243
241 setCategories(); 244 setCategories();
242 245
243 setSelected(selected); 246 setSelected(selected);
244} 247}
245 248
246//#include "categoryselectdialog.moc" 249//#include "categoryselectdialog.moc"
diff --git a/libkdepim/categoryselectdialog.h b/libkdepim/categoryselectdialog.h
index 680a093..ff7ac58 100644
--- a/libkdepim/categoryselectdialog.h
+++ b/libkdepim/categoryselectdialog.h
@@ -17,59 +17,59 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KPIM_CATEGORYSELECTDIALOG_H 23#ifndef KPIM_CATEGORYSELECTDIALOG_H
24#define KPIM_CATEGORYSELECTDIALOG_H 24#define KPIM_CATEGORYSELECTDIALOG_H
25 25
26#include <categoryselectdialog_base.h> 26#include <categoryselectdialog_base.h>
27 27
28class KPimPrefs; 28class KPimPrefs;
29class QCheckListItem; 29class Q3CheckListItem;
30 30
31namespace KPIM { 31namespace KPIM {
32 32
33class CategorySelectDialog : public CategorySelectDialog_base 33class CategorySelectDialog : public CategorySelectDialog_base
34{ 34{
35 Q_OBJECT 35 Q_OBJECT
36 public: 36 public:
37 CategorySelectDialog( KPimPrefs *prefs, QWidget* parent = 0, 37 CategorySelectDialog( KPimPrefs *prefs, QWidget* parent = 0,
38 const char* name = 0, 38 const char* name = 0,
39 bool modal = FALSE, WFlags fl = 0 ); 39 bool modal = FALSE, Qt::WFlags fl = 0 );
40 ~CategorySelectDialog(); 40 ~CategorySelectDialog();
41 41
42 void setCategories(); 42 void setCategories();
43 void setColorEnabled(); 43 void setColorEnabled();
44 void setSelected(const QStringList &selList); 44 void setSelected(const QStringList &selList);
45 45
46 QStringList selectedCategories() const; 46 QStringList selectedCategories() const;
47 47
48 public slots: 48 public slots:
49 void slotOk(); 49 void slotOk();
50 void slotApply(); 50 void slotApply();
51 void clear(); 51 void clear();
52 void accept(); 52 void accept();
53 void editCategoriesDialog(); 53 void editCategoriesDialog();
54 void updateCategoryConfig(); 54 void updateCategoryConfig();
55 void setColorCat(); 55 void setColorCat();
56 void clicked ( QListViewItem * ); 56 void clicked ( Q3ListViewItem * );
57 signals: 57 signals:
58 void categoriesSelected(const QString &); 58 void categoriesSelected(const QString &);
59 void categoriesSelected(const QStringList &); 59 void categoriesSelected(const QStringList &);
60 void editCategories(); 60 void editCategories();
61 61
62 private: 62 private:
63 bool mColorEnabled; 63 bool mColorEnabled;
64 KPimPrefs *mPrefs; 64 KPimPrefs *mPrefs;
65 QStringList mCategoryList; 65 QStringList mCategoryList;
66 QCheckListItem *mColorItem; 66 Q3CheckListItem *mColorItem;
67 void setColorItem( QCheckListItem * ); 67 void setColorItem( Q3CheckListItem * );
68 68
69 class CategorySelectDialogPrivate; 69 class CategorySelectDialogPrivate;
70 CategorySelectDialogPrivate *d; 70 CategorySelectDialogPrivate *d;
71}; 71};
72 72
73} 73}
74 74
75#endif 75#endif
diff --git a/libkdepim/categoryselectdialog_base.cpp b/libkdepim/categoryselectdialog_base.cpp
index 4793fd7..5d53ac4 100644
--- a/libkdepim/categoryselectdialog_base.cpp
+++ b/libkdepim/categoryselectdialog_base.cpp
@@ -2,63 +2,66 @@
2/**************************************************************************** 2/****************************************************************************
3** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/libkdepim/categoryselectdialog_base.ui' 3** Form implementation generated from reading ui file '/build/kde/cvs/korge/kdepim/libkdepim/categoryselectdialog_base.ui'
4** 4**
5** Created: Sat Mar 29 21:46:05 2003 5** Created: Sat Mar 29 21:46:05 2003
6** by: The User Interface Compiler () 6** by: The User Interface Compiler ()
7** 7**
8** WARNING! All changes made in this file will be lost! 8** WARNING! All changes made in this file will be lost!
9****************************************************************************/ 9****************************************************************************/
10 10
11#include "categoryselectdialog_base.h" 11#include "categoryselectdialog_base.h"
12 12
13#include <qvariant.h> 13#include <qvariant.h>
14#include <qheader.h> 14#include <q3header.h>
15#include <qlistview.h> 15#include <q3listview.h>
16#include <qpushbutton.h> 16#include <qpushbutton.h>
17#include <qlayout.h> 17#include <qlayout.h>
18#include <qtooltip.h> 18#include <qtooltip.h>
19#include <qwhatsthis.h> 19#include <q3whatsthis.h>
20//Added by qt3to4:
21#include <Q3VBoxLayout>
22#include <Q3HBoxLayout>
20 23
21/* 24/*
22 * Constructs a CategorySelectDialog_base as a child of 'parent', with the 25 * Constructs a CategorySelectDialog_base as a child of 'parent', with the
23 * name 'name' and widget flags set to 'f'. 26 * name 'name' and widget flags set to 'f'.
24 * 27 *
25 * The dialog will by default be modeless, unless you set 'modal' to 28 * The dialog will by default be modeless, unless you set 'modal' to
26 * TRUE to construct a modal dialog. 29 * TRUE to construct a modal dialog.
27 */ 30 */
28CategorySelectDialog_base::CategorySelectDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) 31CategorySelectDialog_base::CategorySelectDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl )
29 : QDialog( parent, name, modal, fl ) 32 : QDialog( parent, name, modal, fl )
30 33
31{ 34{
32 if ( !name ) 35 if ( !name )
33 setName( "CategorySelectDialog_base" ); 36 setName( "CategorySelectDialog_base" );
34 CategorySelectDialog_baseLayout = new QVBoxLayout( this, 11, 6, "CategorySelectDialog_baseLayout"); 37 CategorySelectDialog_baseLayout = new Q3VBoxLayout( this, 11, 6, "CategorySelectDialog_baseLayout");
35 38
36 mCategories = new QListView( this, "mCategories" ); 39 mCategories = new Q3ListView( this, "mCategories" );
37 mCategories->addColumn( i18n( "Category" ) ); 40 mCategories->addColumn( i18n( "Category" ) );
38 CategorySelectDialog_baseLayout->addWidget( mCategories ); 41 CategorySelectDialog_baseLayout->addWidget( mCategories );
39 mSetColorCat = new QPushButton( this, "msetColor" ); 42 mSetColorCat = new QPushButton( this, "msetColor" );
40 CategorySelectDialog_baseLayout->addWidget( mSetColorCat ); 43 CategorySelectDialog_baseLayout->addWidget( mSetColorCat );
41 Layout12 = new QHBoxLayout( 0, 0, 4, "Layout12"); 44 Layout12 = new Q3HBoxLayout( 0, 0, 4, "Layout12");
42 45
43 mClear = new QPushButton( this, "mClear" ); 46 mClear = new QPushButton( this, "mClear" );
44 Layout12->addWidget( mClear ); 47 Layout12->addWidget( mClear );
45 // QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); 48 // QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
46 //Layout12->addItem( spacer ); 49 //Layout12->addItem( spacer );
47 50
48 mButtonEdit = new QPushButton( this, "mButtonEdit" ); 51 mButtonEdit = new QPushButton( this, "mButtonEdit" );
49 Layout12->addWidget( mButtonEdit ); 52 Layout12->addWidget( mButtonEdit );
50 CategorySelectDialog_baseLayout->addLayout( Layout12 ); 53 CategorySelectDialog_baseLayout->addLayout( Layout12 );
51 54
52 Layout11 = new QHBoxLayout( 0, 0, 4, "Layout11"); 55 Layout11 = new Q3HBoxLayout( 0, 0, 4, "Layout11");
53 56
54 //mButtonHelp = new QPushButton( this, "mButtonHelp" ); 57 //mButtonHelp = new QPushButton( this, "mButtonHelp" );
55 //Layout11->addWidget( mButtonHelp ); 58 //Layout11->addWidget( mButtonHelp );
56 //QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); 59 //QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
57 // Layout11->addItem( spacer_2 ); 60 // Layout11->addItem( spacer_2 );
58 61
59 //mApply = new QPushButton( this, "mApply" ); 62 //mApply = new QPushButton( this, "mApply" );
60 // Layout11->addWidget( mApply ); 63 // Layout11->addWidget( mApply );
61 64
62 mButtonOk = new QPushButton( this, "mButtonOk" ); 65 mButtonOk = new QPushButton( this, "mButtonOk" );
63 mButtonOk->setOn( FALSE ); 66 mButtonOk->setOn( FALSE );
64 mButtonOk->setDefault( TRUE ); 67 mButtonOk->setDefault( TRUE );
diff --git a/libkdepim/categoryselectdialog_base.h b/libkdepim/categoryselectdialog_base.h
index 59ffa22..71d4ce9 100644
--- a/libkdepim/categoryselectdialog_base.h
+++ b/libkdepim/categoryselectdialog_base.h
@@ -3,52 +3,56 @@
3** 3**
4** Created: Sat Mar 29 21:45:20 2003 4** Created: Sat Mar 29 21:45:20 2003
5** by: The User Interface Compiler () 5** by: The User Interface Compiler ()
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9 9
10#ifndef CATEGORYSELECTDIALOG_BASE_H 10#ifndef CATEGORYSELECTDIALOG_BASE_H
11#define CATEGORYSELECTDIALOG_BASE_H 11#define CATEGORYSELECTDIALOG_BASE_H
12 12
13#include <qvariant.h> 13#include <qvariant.h>
14#include <qdialog.h> 14#include <qdialog.h>
15 15//Added by qt3to4:
16class QVBoxLayout; 16#include <Q3VBoxLayout>
17class QHBoxLayout; 17#include <Q3GridLayout>
18class QGridLayout; 18#include <Q3HBoxLayout>
19class QListView; 19
20class QListViewItem; 20class Q3VBoxLayout;
21class Q3HBoxLayout;
22class Q3GridLayout;
23class Q3ListView;
24class Q3ListViewItem;
21class QPushButton; 25class QPushButton;
22 26
23class CategorySelectDialog_base : public QDialog 27class CategorySelectDialog_base : public QDialog
24{ 28{
25 Q_OBJECT 29 Q_OBJECT
26 30
27public: 31public:
28 CategorySelectDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 32 CategorySelectDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
29 ~CategorySelectDialog_base(); 33 ~CategorySelectDialog_base();
30 34
31 QListView* mCategories; 35 Q3ListView* mCategories;
32 QPushButton* mClear; 36 QPushButton* mClear;
33 QPushButton* mButtonEdit; 37 QPushButton* mButtonEdit;
34 QPushButton* mButtonHelp; 38 QPushButton* mButtonHelp;
35 QPushButton* mApply; 39 QPushButton* mApply;
36 QPushButton* mButtonOk; 40 QPushButton* mButtonOk;
37 QPushButton* mButtonCancel; 41 QPushButton* mButtonCancel;
38 QPushButton* mSetColorCat; 42 QPushButton* mSetColorCat;
39 43
40public slots: 44public slots:
41 virtual void clear(); 45 virtual void clear();
42 virtual void slotApply(); 46 virtual void slotApply();
43 virtual void slotOk(); 47 virtual void slotOk();
44 48
45protected: 49protected:
46 QVBoxLayout* CategorySelectDialog_baseLayout; 50 Q3VBoxLayout* CategorySelectDialog_baseLayout;
47 QHBoxLayout* Layout12; 51 Q3HBoxLayout* Layout12;
48 QHBoxLayout* Layout11; 52 Q3HBoxLayout* Layout11;
49 53
50protected slots: 54protected slots:
51 virtual void languageChange(); 55 virtual void languageChange();
52}; 56};
53 57
54#endif // CATEGORYSELECTDIALOG_BASE_H 58#endif // CATEGORYSELECTDIALOG_BASE_H
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index f376e6c..3fc548a 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -30,25 +30,27 @@ $Id$
30#include <stdlib.h> 30#include <stdlib.h>
31 31
32#include <qfile.h> 32#include <qfile.h>
33#include <qtimer.h> 33#include <qtimer.h>
34#include <qmap.h> 34#include <qmap.h>
35#include <qregexp.h> 35#include <qregexp.h>
36 36
37#ifndef DESKTOP_VERSION 37#ifndef DESKTOP_VERSION
38#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
39#include <qtopia/qcopenvelope_qws.h> 39#include <qtopia/qcopenvelope_qws.h>
40#else 40#else
41#include <qapplication.h> 41#include <qapplication.h>
42#include <qprocess.h> 42#include <q3process.h>
43//Added by qt3to4:
44#include <Q3CString>
43#endif 45#endif
44 46
45#include <kstaticdeleter.h> 47#include <kstaticdeleter.h>
46#include <kmessagebox.h> 48#include <kmessagebox.h>
47 49
48 50
49#include "externalapphandler.h" 51#include "externalapphandler.h"
50 52
51#include "kpimglobalprefs.h" 53#include "kpimglobalprefs.h"
52 54
53//uncomment line to get debug output 55//uncomment line to get debug output
54//#define DEBUG_EXT_APP_HANDLER 56//#define DEBUG_EXT_APP_HANDLER
@@ -114,48 +116,48 @@ bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& pa
114 116
115 117
116/*********************************************************************************/ 118/*********************************************************************************/
117void QCopTransferItem::setSourceChannel(const QString& sourceChannel) 119void QCopTransferItem::setSourceChannel(const QString& sourceChannel)
118{ 120{
119 121
120 if ( !sourceChannel.isEmpty()) 122 if ( !sourceChannel.isEmpty())
121 _sourceChannel = sourceChannel; 123 _sourceChannel = sourceChannel;
122} 124}
123 125
124 126
125/*********************************************************************************/ 127/*********************************************************************************/
126bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 128bool QCopTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data )
127{ 129{
128 130
129 // copied from old mail2 131 // copied from old mail2
130/* 132/*
131 static int ii = 0; 133 static int ii = 0;
132 134
133 // block second call 135 // block second call
134 if ( ii < 2 ) { 136 if ( ii < 2 ) {
135 ++ii; 137 ++ii;
136 if ( ii > 1 ) { 138 if ( ii > 1 ) {
137 qDebug("qcop call blocked "); 139 qDebug("qcop call blocked ");
138 return true; 140 return true;
139 } 141 }
140 } 142 }
141*/ 143*/
142 144
143// qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() ); 145// qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() );
144 146
145 //we are in the target and get a request from the source 147 //we are in the target and get a request from the source
146 if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data()) 148 if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data())
147 { 149 {
148 150
149 QDataStream stream( data, IO_ReadOnly ); 151 QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly );
150 152
151 153
152 QString sourceChannel; 154 QString sourceChannel;
153 QString uid; 155 QString uid;
154 QString param1; 156 QString param1;
155 QString param2; 157 QString param2;
156 QString param3; 158 QString param3;
157 159
158 stream >> sourceChannel >> uid; 160 stream >> sourceChannel >> uid;
159 161
160 if (_usedSourceParameters == 0) 162 if (_usedSourceParameters == 0)
161 { 163 {
@@ -217,31 +219,31 @@ bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QSt
217 219
218 return true; 220 return true;
219 221
220#else 222#else
221 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 223 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
222 return false; 224 return false;
223#endif 225#endif
224 226
225} 227}
226 228
227 229
228/*********************************************************************************/ 230/*********************************************************************************/
229bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 231bool QCopMapTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data )
230{ 232{
231 bool res = QCopTransferItem::appMessage( cmsg, data ); 233 bool res = QCopTransferItem::appMessage( cmsg, data );
232 234
233 if (res == false) 235 if (res == false)
234 { 236 {
235 QDataStream stream( data, IO_ReadOnly ); 237 QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly );
236 238
237// qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); 239// qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() );
238 240
239 //we are in the source and get an answer from the target 241 //we are in the source and get an answer from the target
240 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 242 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
241 { 243 {
242 QMap<QString,QString> adrMap; 244 QMap<QString,QString> adrMap;
243 QString uid; 245 QString uid;
244 246
245 stream >> uid >> adrMap; 247 stream >> uid >> adrMap;
246 248
247 emit receivedMessageFromTarget(uid, adrMap); 249 emit receivedMessageFromTarget(uid, adrMap);
@@ -296,34 +298,34 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString
296 298
297 return true; 299 return true;
298 300
299#else 301#else
300 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 302 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
301 return false; 303 return false;
302#endif 304#endif
303 305
304} 306}
305 307
306 308
307/*********************************************************************************/ 309/*********************************************************************************/
308bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 310bool QCopListTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data )
309{ 311{
310 bool res = QCopTransferItem::appMessage( cmsg, data ); 312 bool res = QCopTransferItem::appMessage( cmsg, data );
311#ifdef DEBUG_EXT_APP_HANDLER 313#ifdef DEBUG_EXT_APP_HANDLER
312 qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 314 qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
313#endif 315#endif
314 316
315 if (res == false) 317 if (res == false)
316 { 318 {
317 QDataStream stream( data, IO_ReadOnly ); 319 QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly );
318 320
319#ifdef DEBUG_EXT_APP_HANDLER 321#ifdef DEBUG_EXT_APP_HANDLER
320 qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 322 qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
321#endif 323#endif
322 324
323 //we are in the source and get an answer from the target 325 //we are in the source and get an answer from the target
324 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 326 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
325 { 327 {
326 QStringList list1; 328 QStringList list1;
327 QStringList list2; 329 QStringList list2;
328 QStringList list3; 330 QStringList list3;
329 QStringList list4; 331 QStringList list4;
@@ -509,27 +511,27 @@ ExternalAppHandler *ExternalAppHandler::instance()
509 511
510 return sInstance; 512 return sInstance;
511} 513}
512 514
513void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2) 515void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2)
514{ 516{
515 DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2); 517 DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2);
516 // qDebug("%d %d %s %s ", type, id, label.latin1(), channel.latin1() ); 518 // qDebug("%d %d %s %s ", type, id, label.latin1(), channel.latin1() );
517 mDefaultItems.append(dai); 519 mDefaultItems.append(dai);
518} 520}
519 521
520 522
521QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) 523Q3PtrList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type)
522{ 524{
523 QList<DefaultAppItem> list; 525 Q3PtrList<DefaultAppItem> list;
524 526
525 DefaultAppItem* dai; 527 DefaultAppItem* dai;
526 528
527 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) 529 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() )
528 { 530 {
529 if (dai->_type == type) 531 if (dai->_type == type)
530 list.append(dai); 532 list.append(dai);
531 } 533 }
532 534
533 return list; 535 return list;
534} 536}
535 537
@@ -737,25 +739,25 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS
737 message = dai->_message; 739 message = dai->_message;
738 parameters = dai->_parameters; 740 parameters = dai->_parameters;
739 } 741 }
740 742
741 //first check if one of the mailers need the emails right in the message. 743 //first check if one of the mailers need the emails right in the message.
742 message2 = translateMessage(message2, emails, urls); 744 message2 = translateMessage(message2, emails, urls);
743#ifdef DEBUG_EXT_APP_HANDLER 745#ifdef DEBUG_EXT_APP_HANDLER
744 qDebug("4Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1()); 746 qDebug("4Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1());
745 qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1()); 747 qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1());
746#endif 748#endif
747 qDebug("%s --- %s %s --- %s %s", channel.latin1(), message.latin1(),message2.latin1(), parameters.latin1(), parameters2.latin1() ); 749 qDebug("%s --- %s %s --- %s %s", channel.latin1(), message.latin1(),message2.latin1(), parameters.latin1(), parameters2.latin1() );
748 //KMessageBox::sorry( 0, message2 ); 750 //KMessageBox::sorry( 0, message2 );
749 QProcess * proc = new QProcess( this ); 751 Q3Process * proc = new Q3Process( this );
750 int i = 0; 752 int i = 0;
751 proc->addArgument( channel ); 753 proc->addArgument( channel );
752 754
753 if ( message.find (" " ) > 0 ) { 755 if ( message.find (" " ) > 0 ) {
754 QStringList list = QStringList::split( " ", message ); 756 QStringList list = QStringList::split( " ", message );
755 int i = 0; 757 int i = 0;
756 while ( i < list.count ( ) ) { 758 while ( i < list.count ( ) ) {
757 //qDebug("add%sdd ",list[i].latin1() ); 759 //qDebug("add%sdd ",list[i].latin1() );
758 proc->addArgument( list[i] ); 760 proc->addArgument( list[i] );
759 //KMessageBox::sorry( 0,list[i]); 761 //KMessageBox::sorry( 0,list[i]);
760 ++i; 762 ++i;
761 } 763 }
@@ -763,25 +765,25 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS
763 proc->addArgument(message ); 765 proc->addArgument(message );
764 //KMessageBox::sorry( 0, message ); 766 //KMessageBox::sorry( 0, message );
765 767
766 } 768 }
767 769
768 parameters2 = translateMessage(parameters2, urls, "" ); 770 parameters2 = translateMessage(parameters2, urls, "" );
769 QString arg = "to='%1'"; 771 QString arg = "to='%1'";
770 arg = arg.arg( emails ) + ","+parameters2;; 772 arg = arg.arg( emails ) + ","+parameters2;;
771 773
772 //KMessageBox::sorry( 0,arg ); 774 //KMessageBox::sorry( 0,arg );
773 //qDebug("2add%sdd ",arg.latin1() ); 775 //qDebug("2add%sdd ",arg.latin1() );
774 proc->addArgument( arg); 776 proc->addArgument( arg);
775 proc->launch(""); 777 proc->launch(QString());
776#endif 778#endif
777 779
778 return true; 780 return true;
779} 781}
780 782
781/************************************************************************** 783/**************************************************************************
782 * 784 *
783 **************************************************************************/ 785 **************************************************************************/
784 786
785 787
786//calls the emailapplication and creates a mail with parameter emails as recipients 788//calls the emailapplication and creates a mail with parameter emails as recipients
787bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& emailadress ) 789bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& emailadress )
@@ -822,44 +824,44 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e
822 qDebug("5Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 824 qDebug("5Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
823 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1()); 825 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1());
824#endif 826#endif
825 827
826#ifndef DESKTOP_VERSION 828#ifndef DESKTOP_VERSION
827 QCopEnvelope e(channel.latin1(), message.latin1()); 829 QCopEnvelope e(channel.latin1(), message.latin1());
828 //US we need no names in the To field. The emailadresses are enough 830 //US we need no names in the To field. The emailadresses are enough
829 831
830 passParameters(&e, parameters, name, emailadress); 832 passParameters(&e, parameters, name, emailadress);
831#else // DESKTOP_VERSION 833#else // DESKTOP_VERSION
832 834
833 //KMessageBox::sorry( 0,channel ); 835 //KMessageBox::sorry( 0,channel );
834 QProcess * proc = new QProcess( this ); 836 Q3Process * proc = new Q3Process( this );
835 proc->addArgument( channel ); 837 proc->addArgument( channel );
836 if ( message.find (" " ) > 0 ) { 838 if ( message.find (" " ) > 0 ) {
837 QStringList list = QStringList::split( " ", message ); 839 QStringList list = QStringList::split( " ", message );
838 int i = 0; 840 int i = 0;
839 while ( i < list.count ( ) ) { 841 while ( i < list.count ( ) ) {
840 //qDebug("add%sdd ",list[i].latin1() ); 842 //qDebug("add%sdd ",list[i].latin1() );
841 proc->addArgument( list[i] ); 843 proc->addArgument( list[i] );
842 //KMessageBox::sorry( 0,list[i]); 844 //KMessageBox::sorry( 0,list[i]);
843 ++i; 845 ++i;
844 } 846 }
845 } else { 847 } else {
846 proc->addArgument(message ); 848 proc->addArgument(message );
847 849
848 } 850 }
849 parameters = translateMessage(parameters, name, emailadress); 851 parameters = translateMessage(parameters, name, emailadress);
850 852
851 //KMessageBox::information(0,parameters); 853 //KMessageBox::information(0,parameters);
852 proc->addArgument( parameters ); 854 proc->addArgument( parameters );
853 proc->launch(""); 855 proc->launch(QString());
854#endif 856#endif
855 857
856 return true; 858 return true;
857} 859}
858 860
859/************************************************************************** 861/**************************************************************************
860 * 862 *
861 **************************************************************************/ 863 **************************************************************************/
862 864
863//calls the emailapplication and creates a mail with parameter as recipients 865//calls the emailapplication and creates a mail with parameter as recipients
864// parameters format is 866// parameters format is
865// NAME <EMAIL>:SUBJECT 867// NAME <EMAIL>:SUBJECT
@@ -1223,25 +1225,25 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete
1223 (*e) << valmap; 1225 (*e) << valmap;
1224 1226
1225#endif 1227#endif
1226 1228
1227} 1229}
1228 1230
1229 1231
1230 1232
1231/************************************************************************** 1233/**************************************************************************
1232 * 1234 *
1233 **************************************************************************/ 1235 **************************************************************************/
1234 1236
1235void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) 1237void ExternalAppHandler::appMessage( const Q3CString& cmsg, const QByteArray& data )
1236{ 1238{
1237 qDebug("ExternalAppHandler::appMessage %s %x", cmsg.data(), this); 1239 qDebug("ExternalAppHandler::appMessage %s %x", cmsg.data(), this);
1238 if ( cmsg == "nextView()" ) { 1240 if ( cmsg == "nextView()" ) {
1239 qDebug("nextView()"); 1241 qDebug("nextView()");
1240 QTimer::singleShot( 0, this, SIGNAL ( nextView() )); 1242 QTimer::singleShot( 0, this, SIGNAL ( nextView() ));
1241 return; 1243 return;
1242 } 1244 }
1243 if ( cmsg == "callContactdialog()" ) { 1245 if ( cmsg == "callContactdialog()" ) {
1244 qDebug("callContactdialog()"); 1246 qDebug("callContactdialog()");
1245 QTimer::singleShot( 0, this, SIGNAL ( callContactdialog() )); 1247 QTimer::singleShot( 0, this, SIGNAL ( callContactdialog() ));
1246 return; 1248 return;
1247 } 1249 }
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h
index b899ad7..3247fe4 100644
--- a/libkdepim/externalapphandler.h
+++ b/libkdepim/externalapphandler.h
@@ -25,41 +25,44 @@
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#ifndef EXTERNALAPPHANDLER_H 31#ifndef EXTERNALAPPHANDLER_H
32#define EXTERNALAPPHANDLER_H 32#define EXTERNALAPPHANDLER_H
33 33
34#include <qobject.h> 34#include <qobject.h>
35#include <qlist.h> 35#include <qlist.h>
36#include <qmap.h> 36#include <qmap.h>
37#include <Q3PtrList>
38//Added by qt3to4:
39#include <Q3CString>
37 40
38class QCopEnvelope; 41class QCopEnvelope;
39 42
40 43
41class ExternalAppHandler; 44class ExternalAppHandler;
42class QCopTransferItem : public QObject 45class QCopTransferItem : public QObject
43{ 46{
44 Q_OBJECT 47 Q_OBJECT
45 public: 48 public:
46 QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); 49 QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
47 QCopTransferItem(); 50 QCopTransferItem();
48 51
49 bool sendMessageToTarget(const QString& uid, const QString& param1 = QString::null, const QString& param2 = QString::null, const QString& param3 = QString::null); 52 bool sendMessageToTarget(const QString& uid, const QString& param1 = QString::null, const QString& param2 = QString::null, const QString& param3 = QString::null);
50 53
51 void setSourceChannel(const QString& sourceChannel); 54 void setSourceChannel(const QString& sourceChannel);
52 55
53 virtual bool appMessage( const QCString& msg, const QByteArray& data ); 56 virtual bool appMessage( const Q3CString& msg, const QByteArray& data );
54 57
55 58
56 signals: 59 signals:
57 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid); 60 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid);
58 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1); 61 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1);
59 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2); 62 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2);
60 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2, const QString& param3); 63 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2, const QString& param3);
61 64
62 public: 65 public:
63 int _usedSourceParameters; 66 int _usedSourceParameters;
64 QString _sourceChannel; 67 QString _sourceChannel;
65 QString _sourceMessage; 68 QString _sourceMessage;
@@ -74,46 +77,46 @@ class QCopTransferItem : public QObject
74 * 77 *
75 ********************************************************************************/ 78 ********************************************************************************/
76 79
77class QCopMapTransferItem : public QCopTransferItem 80class QCopMapTransferItem : public QCopTransferItem
78{ 81{
79 Q_OBJECT 82 Q_OBJECT
80 public: 83 public:
81 QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); 84 QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
82 85
83 bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap); 86 bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap);
84 87
85 88
86 virtual bool appMessage( const QCString& msg, const QByteArray& data ); 89 virtual bool appMessage( const Q3CString& msg, const QByteArray& data );
87 90
88 91
89 signals: 92 signals:
90 void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap); 93 void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap);
91 94
92}; 95};
93 96
94/********************************************************************************* 97/*********************************************************************************
95 * 98 *
96 ********************************************************************************/ 99 ********************************************************************************/
97 100
98class QCopListTransferItem : public QCopTransferItem 101class QCopListTransferItem : public QCopTransferItem
99{ 102{
100 Q_OBJECT 103 Q_OBJECT
101 public: 104 public:
102 QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); 105 QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
103 ~QCopListTransferItem(); 106 ~QCopListTransferItem();
104 bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6); 107 bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6);
105 108
106 109
107 virtual bool appMessage( const QCString& msg, const QByteArray& data ); 110 virtual bool appMessage( const Q3CString& msg, const QByteArray& data );
108 111
109 112
110 signals: 113 signals:
111 void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4 , const QStringList& list5, const QStringList& list6); 114 void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4 , const QStringList& list5, const QStringList& list6);
112 115
113}; 116};
114 117
115/********************************************************************************* 118/*********************************************************************************
116 * 119 *
117 ********************************************************************************/ 120 ********************************************************************************/
118 121
119 122
@@ -216,29 +219,29 @@ class ExternalAppHandler : public QObject
216 219
217 220
218 bool requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid); 221 bool requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid);
219 bool returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid, 222 bool returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid,
220 const QStringList& birthdayList, const QStringList& anniversaryList, 223 const QStringList& birthdayList, const QStringList& anniversaryList,
221 const QStringList& realNameList, const QStringList& emailList, 224 const QStringList& realNameList, const QStringList& emailList,
222 const QStringList& assembledNameList, const QStringList& uidList); 225 const QStringList& assembledNameList, const QStringList& uidList);
223 226
224 227
225 //loadConfig clears the cache and checks again if the applications are available or not 228 //loadConfig clears the cache and checks again if the applications are available or not
226 void loadConfig(); 229 void loadConfig();
227 230
228 QList<DefaultAppItem> getAvailableDefaultItems(Types); 231 Q3PtrList<DefaultAppItem> getAvailableDefaultItems(Types);
229 DefaultAppItem* getDefaultItem(Types, int); 232 DefaultAppItem* getDefaultItem(Types, int);
230 233
231 public slots: 234 public slots:
232 void appMessage( const QCString& msg, const QByteArray& data ); 235 void appMessage( const Q3CString& msg, const QByteArray& data );
233 236
234 237
235 signals: 238 signals:
236 void callContactdialog(); 239 void callContactdialog();
237 void nextView(); 240 void nextView();
238 void doRingSync(); 241 void doRingSync();
239 // Emmitted when the target app receives a request from the source app 242 // Emmitted when the target app receives a request from the source app
240 void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid); 243 void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid);
241 244
242 // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi 245 // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi
243 // The first parameter is a uniqueid. It can be used to identify the event 246 // The first parameter is a uniqueid. It can be used to identify the event
244 void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); 247 void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList);
@@ -253,25 +256,25 @@ class ExternalAppHandler : public QObject
253 void requestForBirthdayList(const QString& sourceChannel, const QString& uid); 256 void requestForBirthdayList(const QString& sourceChannel, const QString& uid);
254 257
255 // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi 258 // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi
256 // The first parameter is a uniqueid. It can be used to identify the event 259 // The first parameter is a uniqueid. It can be used to identify the event
257 void receivedBirthdayListEvent(const QString& uid, const QStringList& birthdayList, 260 void receivedBirthdayListEvent(const QString& uid, const QStringList& birthdayList,
258 const QStringList& anniversaryList, const QStringList& realNameList, 261 const QStringList& anniversaryList, const QStringList& realNameList,
259 const QStringList& emailList, const QStringList& assembledNameList, 262 const QStringList& emailList, const QStringList& assembledNameList,
260 const QStringList& uidList); 263 const QStringList& uidList);
261 264
262 265
263 private: 266 private:
264 ExternalAppHandler(); 267 ExternalAppHandler();
265 QList<DefaultAppItem> mDefaultItems; 268 Q3PtrList<DefaultAppItem> mDefaultItems;
266 269
267 Availability mEmailAppAvailable; 270 Availability mEmailAppAvailable;
268 Availability mPhoneAppAvailable; 271 Availability mPhoneAppAvailable;
269 Availability mFaxAppAvailable; 272 Availability mFaxAppAvailable;
270 Availability mSMSAppAvailable; 273 Availability mSMSAppAvailable;
271 Availability mPagerAppAvailable; 274 Availability mPagerAppAvailable;
272 Availability mSIPAppAvailable; 275 Availability mSIPAppAvailable;
273 276
274 QCopListTransferItem* mNameEmailUidListFromKAPITransfer; 277 QCopListTransferItem* mNameEmailUidListFromKAPITransfer;
275 QCopListTransferItem* mFindByEmailFromKAPITransfer; 278 QCopListTransferItem* mFindByEmailFromKAPITransfer;
276 QCopTransferItem* mDisplayDetails; 279 QCopTransferItem* mDisplayDetails;
277 QCopListTransferItem* mBirthdayListFromKAPITransfer; 280 QCopListTransferItem* mBirthdayListFromKAPITransfer;
diff --git a/libkdepim/kcmconfigs/kcmkdepimconfig.cpp b/libkdepim/kcmconfigs/kcmkdepimconfig.cpp
index 5094830..9f47766 100644
--- a/libkdepim/kcmconfigs/kcmkdepimconfig.cpp
+++ b/libkdepim/kcmconfigs/kcmkdepimconfig.cpp
@@ -21,49 +21,51 @@
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31 31
32#include <qlayout.h> 32#include <qlayout.h>
33//Added by qt3to4:
34#include <Q3VBoxLayout>
33 35
34#include <kdebug.h> 36#include <kdebug.h>
35//#include <klocale.h> 37//#include <klocale.h>
36//#include <stdlib.h> 38//#include <stdlib.h>
37 39
38#include "kdepimconfigwidget.h" 40#include "kdepimconfigwidget.h"
39 41
40#include "kcmkdepimconfig.h" 42#include "kcmkdepimconfig.h"
41#include "kprefs.h" 43#include "kprefs.h"
42#include "kpimglobalprefs.h" 44#include "kpimglobalprefs.h"
43 45
44#ifndef _WIN32_ 46#ifndef _WIN32_
45extern "C" 47extern "C"
46{ 48{
47 KCModule *create_kdepimconfig(QWidget *parent, const char * ) { 49 KCModule *create_kdepimconfig(QWidget *parent, const char * ) {
48 return new KCMKdePimConfig(parent, "kcmkdepimconfig" ); 50 return new KCMKdePimConfig(parent, "kcmkdepimconfig" );
49 } 51 }
50} 52}
51#endif 53#endif
52 54
53KCMKdePimConfig::KCMKdePimConfig(QWidget *parent, const char *name ) 55KCMKdePimConfig::KCMKdePimConfig(QWidget *parent, const char *name )
54 : KCModule( KPimGlobalPrefs::instance(), parent, name ) 56 : KCModule( KPimGlobalPrefs::instance(), parent, name )
55{ 57{
56 //abort(); 58 //abort();
57 QVBoxLayout *layout = new QVBoxLayout( this ); 59 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
58 mConfigWidget = new KDEPIMConfigWidget( (KPimGlobalPrefs*)getPreferences(), this, "KDEPIMConfigWidget" ); 60 mConfigWidget = new KDEPIMConfigWidget( (KPimGlobalPrefs*)getPreferences(), this, "KDEPIMConfigWidget" );
59 layout->addWidget( mConfigWidget ); 61 layout->addWidget( mConfigWidget );
60 layout->setSpacing( 0 ); 62 layout->setSpacing( 0 );
61 layout->setMargin( 0 ); 63 layout->setMargin( 0 );
62 64
63 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); 65 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) );
64} 66}
65 67
66void KCMKdePimConfig::load() 68void KCMKdePimConfig::load()
67{ 69{
68 mConfigWidget->readConfig(); 70 mConfigWidget->readConfig();
69} 71}
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 292951b..11a2b45 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -22,34 +22,39 @@
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qtabwidget.h> 32#include <qtabwidget.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qgroupbox.h> 34#include <q3groupbox.h>
35#include <qlabel.h> 35#include <qlabel.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37#include <qbuttongroup.h> 37#include <q3buttongroup.h>
38#include <qcheckbox.h> 38#include <qcheckbox.h>
39#include <qfile.h> 39#include <qfile.h>
40#include <qvbox.h> 40#include <q3vbox.h>
41#include <qdir.h> 41#include <qdir.h>
42#include <qregexp.h> 42#include <qregexp.h>
43#include <qspinbox.h> 43#include <qspinbox.h>
44#include <QDesktopWidget>
45//Added by qt3to4:
46#include <Q3HBoxLayout>
47#include <Q3GridLayout>
48#include <Q3VBoxLayout>
44 49
45#include <kdialog.h> 50#include <kdialog.h>
46#include <kprefsdialog.h> 51#include <kprefsdialog.h>
47#include <klocale.h> 52#include <klocale.h>
48#include <kglobalsettings.h> 53#include <kglobalsettings.h>
49#include <kdateedit.h> 54#include <kdateedit.h>
50#include <kglobal.h> 55#include <kglobal.h>
51#include <stdlib.h> 56#include <stdlib.h>
52 57
53/*US 58/*US
54#include <qcheckbox.h> 59#include <qcheckbox.h>
55#include <qframe.h> 60#include <qframe.h>
@@ -92,124 +97,124 @@ $Id$
92 97
93KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 98KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
94 : KPrefsWidget(prefs, parent, name ) 99 : KPrefsWidget(prefs, parent, name )
95{ 100{
96 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 101 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
97 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 102 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
98 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 103 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
99 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 104 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
100 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 105 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
101 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 106 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
102 107
103 108
104 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 109 Q3VBoxLayout *topLayout = new Q3VBoxLayout( this, 0,
105 KDialog::spacingHint() ); 110 KDialog::spacingHint() );
106 111
107 tabWidget = new QTabWidget( this ); 112 tabWidget = new QTabWidget( this );
108 topLayout->addWidget( tabWidget ); 113 topLayout->addWidget( tabWidget );
109 114
110 115
111 setupLocaleTab(); 116 setupLocaleTab();
112 setupLocaleDateTab(); 117 setupLocaleDateTab();
113 setupTimeZoneTab(); 118 setupTimeZoneTab();
114 setupExternalAppTab(); 119 setupExternalAppTab();
115 setupStoreTab(); 120 setupStoreTab();
116 setupBackupTab(); 121 setupBackupTab();
117} 122}
118void KDEPIMConfigWidget::showTimeZoneTab() 123void KDEPIMConfigWidget::showTimeZoneTab()
119{ 124{
120 tabWidget->setCurrentPage ( 3 ) ; 125 tabWidget->setCurrentPage ( 3 ) ;
121} 126}
122void KDEPIMConfigWidget::setupBackupTab() 127void KDEPIMConfigWidget::setupBackupTab()
123{ 128{
124 QVBox *colorPage = new QVBox( this ); 129 Q3VBox *colorPage = new Q3VBox( this );
125 tabWidget->addTab( colorPage, i18n( "Backup" ) ); 130 tabWidget->addTab( colorPage, i18n( "Backup" ) );
126 QWidget* topFrame = new QWidget( colorPage ); 131 QWidget* topFrame = new QWidget( colorPage );
127 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 132 Q3VBoxLayout *topLayout = new Q3VBoxLayout(topFrame);
128 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), 133 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"),
129 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); 134 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame);
130 topLayout->addWidget((QWidget*)sb->checkBox()); 135 topLayout->addWidget((QWidget*)sb->checkBox());
131 QWidget* bupFrame = new QWidget( topFrame ); 136 QWidget* bupFrame = new QWidget( topFrame );
132 topLayout->addWidget((bupFrame)); 137 topLayout->addWidget((bupFrame));
133 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); 138 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) );
134 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); 139 Q3VBoxLayout *bupLayout = new Q3VBoxLayout(bupFrame);
135 sb = addWidBool(i18n("Use standard backup dir"), 140 sb = addWidBool(i18n("Use standard backup dir"),
136 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); 141 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame);
137 bupLayout->addWidget((QWidget*)sb->checkBox()); 142 bupLayout->addWidget((QWidget*)sb->checkBox());
138 mBackupUrl = new KURLRequester( bupFrame ); 143 mBackupUrl = new KURLRequester( bupFrame );
139 mBackupUrl->setPathIsDir(); 144 mBackupUrl->setPathIsDir();
140 mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); 145 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
141 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); 146 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) );
142 bupLayout->addWidget( mBackupUrl ); 147 bupLayout->addWidget( mBackupUrl );
143 148
144 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); 149 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir );
145 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); 150 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled );
146 QHBox *dummy = new QHBox(bupFrame); 151 Q3HBox *dummy = new Q3HBox(bupFrame);
147 new QLabel(i18n("Number of Backups:"),dummy); 152 new QLabel(i18n("Number of Backups:"),dummy);
148 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); 153 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy);
149 new QLabel(i18n(" "),dummy); 154 new QLabel(i18n(" "),dummy);
150 bupLayout->addWidget( dummy ); 155 bupLayout->addWidget( dummy );
151 156
152 dummy = new QHBox(bupFrame); 157 dummy = new Q3HBox(bupFrame);
153 new QLabel(i18n("Make backup every "),dummy); 158 new QLabel(i18n("Make backup every "),dummy);
154 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); 159 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy);
155 new QLabel(i18n(" days"),dummy); 160 new QLabel(i18n(" days"),dummy);
156 new QLabel(i18n(" "),dummy); 161 new QLabel(i18n(" "),dummy);
157 bupLayout->addWidget( dummy ); 162 bupLayout->addWidget( dummy );
158 QString localKdeDir; 163 QString localKdeDir;
159 localKdeDir = readEnvPath("LOCALMICROKDEHOME"); 164 localKdeDir = readEnvPath("LOCALMICROKDEHOME");
160 if ( ! localKdeDir.isEmpty() ) { 165 if ( ! localKdeDir.isEmpty() ) {
161 sb->checkBox()->setEnabled( false ); 166 sb->checkBox()->setEnabled( false );
162 sb->checkBox()->setChecked( true ); 167 sb->checkBox()->setChecked( true );
163 mBackupUrl->setEnabled( false ); 168 mBackupUrl->setEnabled( false );
164 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; 169 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true;
165 } 170 }
166 171
167} 172}
168void KDEPIMConfigWidget::setupStoreTab() 173void KDEPIMConfigWidget::setupStoreTab()
169{ 174{
170 QVBox *colorPage = new QVBox( this ); 175 Q3VBox *colorPage = new Q3VBox( this );
171 tabWidget->addTab( colorPage, i18n( "Colors" ) ); 176 tabWidget->addTab( colorPage, i18n( "Colors" ) );
172 QWidget* cw = new QWidget( colorPage ); 177 QWidget* cw = new QWidget( colorPage );
173 KPrefsWidColor *holidayColor = 178 KPrefsWidColor *holidayColor =
174 addWidColor(i18n("Alternating background of list views"), 179 addWidColor(i18n("Alternating background of list views"),
175 &(KPimGlobalPrefs::instance()->mAlternateColor),cw); 180 &(KPimGlobalPrefs::instance()->mAlternateColor),cw);
176 QHBoxLayout *topLayout = new QHBoxLayout(cw); 181 Q3HBoxLayout *topLayout = new Q3HBoxLayout(cw);
177 topLayout->addWidget(holidayColor->label()); 182 topLayout->addWidget(holidayColor->label());
178 topLayout->addWidget( (QWidget* )holidayColor->button()); 183 topLayout->addWidget( (QWidget* )holidayColor->button());
179 184
180 185
181 QVBox *storePage = new QVBox( this ); 186 Q3VBox *storePage = new Q3VBox( this );
182 if ( QApplication::desktop()->height() > 240 ) 187 if ( QApplication::desktop()->height() > 240 )
183 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); 188 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage );
184 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 189 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
185 mStoreUrl = new KURLRequester( storePage ); 190 mStoreUrl = new KURLRequester( storePage );
186 mStoreUrl->setPathIsDir(); 191 mStoreUrl->setPathIsDir();
187 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 192 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
188#ifdef DESKTOP_VERSION 193#ifdef DESKTOP_VERSION
189 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; 194 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ;
190 QFileInfo fi ( confFile ); 195 QFileInfo fi ( confFile );
191 if ( fi.exists() ) { 196 if ( fi.exists() ) {
192 KConfig cfg ( confFile ); 197 KConfig cfg ( confFile );
193 cfg.setGroup("Global"); 198 cfg.setGroup("Global");
194 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); 199 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" );
195 if ( localKdeDir != "x_x_x" ) { 200 if ( localKdeDir != "x_x_x" ) {
196 mStoreUrl->setURL( localKdeDir ); 201 mStoreUrl->setURL( localKdeDir );
197 qDebug("Reading config from %s ", confFile.latin1()); 202 qDebug("Reading config from %s ", confFile.latin1());
198 } 203 }
199 } 204 }
200 205
201#endif 206#endif
202 new QLabel( i18n("New dirs are created automatically"), storePage ); 207 new QLabel( i18n("New dirs are created automatically"), storePage );
203 QHBox *bb = new QHBox( storePage ); 208 Q3HBox *bb = new Q3HBox( storePage );
204 QPushButton * pb; 209 QPushButton * pb;
205 if ( QApplication::desktop()->width() < 640 ) 210 if ( QApplication::desktop()->width() < 640 )
206 pb = new QPushButton ( i18n("Save"), bb ); 211 pb = new QPushButton ( i18n("Save"), bb );
207 else 212 else
208 pb = new QPushButton ( i18n("Save settings"), bb ); 213 pb = new QPushButton ( i18n("Save settings"), bb );
209 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 214 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
210 pb = new QPushButton ( i18n("Save standard"), bb ); 215 pb = new QPushButton ( i18n("Save standard"), bb );
211 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 216 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
212#ifdef DESKTOP_VERSION 217#ifdef DESKTOP_VERSION
213 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); 218 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb );
214 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); 219 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) );
215#endif 220#endif
@@ -261,41 +266,41 @@ void KDEPIMConfigWidget::saveStoreSettings()
261 cfg.writeEntry( "MICROKDEHOME", url ); 266 cfg.writeEntry( "MICROKDEHOME", url );
262 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); 267 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
263 cfg.sync(); 268 cfg.sync();
264 mDataStoragePath->setText( i18n("Settings are stored in\n%1").arg( path+"/.microkdehome" )); 269 mDataStoragePath->setText( i18n("Settings are stored in\n%1").arg( path+"/.microkdehome" ));
265 } else { 270 } else {
266 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 271 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
267 saveStoreSettings(); 272 saveStoreSettings();
268 } 273 }
269} 274}
270void KDEPIMConfigWidget::setupExternalAppTab() 275void KDEPIMConfigWidget::setupExternalAppTab()
271{ 276{
272 QWidget *externalAppsPage = new QWidget( this ); 277 QWidget *externalAppsPage = new QWidget( this );
273 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 278 Q3VBoxLayout* layout = new Q3VBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
274 KDialog::spacingHintSmall() ); 279 KDialog::spacingHintSmall() );
275 280
276 mExternalApps = new QComboBox( externalAppsPage ); 281 mExternalApps = new QComboBox( externalAppsPage );
277 282
278 QMap<ExternalAppHandler::Types, QString>::Iterator it; 283 QMap<ExternalAppHandler::Types, QString>::Iterator it;
279 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 284 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
280 mExternalApps->insertItem( it.data(), it.key() ); 285 mExternalApps->insertItem( it.data(), it.key() );
281 286
282 layout->addWidget( mExternalApps ); 287 layout->addWidget( mExternalApps );
283 288
284 connect( mExternalApps, SIGNAL( activated( int ) ), 289 connect( mExternalApps, SIGNAL( activated( int ) ),
285 this, SLOT (externalapp_changed( int ) ) ); 290 this, SLOT (externalapp_changed( int ) ) );
286 291
287 292
288 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 293 mExternalAppGroupBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
289 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 294 Q3GridLayout *boxLayout = new Q3GridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
290 mExternalAppGroupBox->layout()->setMargin(4); 295 mExternalAppGroupBox->layout()->setMargin(4);
291 296
292 mClient = new QComboBox( mExternalAppGroupBox ); 297 mClient = new QComboBox( mExternalAppGroupBox );
293 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 298 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
294 299
295 connect( mClient, SIGNAL( activated( int ) ), 300 connect( mClient, SIGNAL( activated( int ) ),
296 this, SLOT (client_changed( int ) ) ); 301 this, SLOT (client_changed( int ) ) );
297 302
298 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 303 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
299 boxLayout->addWidget( lab, 1, 0 ); 304 boxLayout->addWidget( lab, 1, 0 );
300 mChannel = new QLineEdit(mExternalAppGroupBox); 305 mChannel = new QLineEdit(mExternalAppGroupBox);
301 mChannel->setReadOnly(true); 306 mChannel->setReadOnly(true);
@@ -343,25 +348,25 @@ void KDEPIMConfigWidget::setupExternalAppTab()
343 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 348 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
344 349
345 350
346 layout->addWidget( mExternalAppGroupBox ); 351 layout->addWidget( mExternalAppGroupBox );
347 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 352 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
348 353
349} 354}
350 355
351 356
352void KDEPIMConfigWidget::setupLocaleDateTab() 357void KDEPIMConfigWidget::setupLocaleDateTab()
353{ 358{
354 QWidget *topFrame = new QWidget( this ); 359 QWidget *topFrame = new QWidget( this );
355 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 360 Q3GridLayout *topLayout = new Q3GridLayout( topFrame, 3, 2);
356 361
357 topLayout->setSpacing(KDialog::spacingHintSmall()); 362 topLayout->setSpacing(KDialog::spacingHintSmall());
358 topLayout->setMargin(KDialog::marginHintSmall()); 363 topLayout->setMargin(KDialog::marginHintSmall());
359 int iii = 0; 364 int iii = 0;
360 365
361 366
362 KPrefsWidRadios *syncPrefsGroup = 367 KPrefsWidRadios *syncPrefsGroup =
363 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 368 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
364 QString format; 369 QString format;
365 if ( QApplication::desktop()->width() < 480 ) 370 if ( QApplication::desktop()->width() < 480 )
366 format = "(%d.%m.%Y)"; 371 format = "(%d.%m.%Y)";
367 else 372 else
@@ -411,47 +416,47 @@ void KDEPIMConfigWidget::setupLocaleDateTab()
411 416
412 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 417 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
413 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 418 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
414 419
415 420
416 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 421 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
417} 422}
418 423
419void KDEPIMConfigWidget::setupLocaleTab() 424void KDEPIMConfigWidget::setupLocaleTab()
420{ 425{
421 426
422 QWidget *topFrame = new QWidget( this ); 427 QWidget *topFrame = new QWidget( this );
423 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 428 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2);
424 429
425 topLayout->setSpacing(KDialog::spacingHint()); 430 topLayout->setSpacing(KDialog::spacingHint());
426 topLayout->setMargin(KDialog::marginHint()); 431 topLayout->setMargin(KDialog::marginHint());
427 int iii = 0; 432 int iii = 0;
428 KPrefsWidRadios *syncPrefsGroup = 433 KPrefsWidRadios *syncPrefsGroup =
429 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 434 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
430 syncPrefsGroup->addRadio(i18n("English")); 435 syncPrefsGroup->addRadio(i18n("English"));
431 syncPrefsGroup->addRadio(i18n("German")); 436 syncPrefsGroup->addRadio(i18n("German"));
432 syncPrefsGroup->addRadio(i18n("French")); 437 syncPrefsGroup->addRadio(i18n("French"));
433 syncPrefsGroup->addRadio(i18n("Italian")); 438 syncPrefsGroup->addRadio(i18n("Italian"));
434 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 439 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
435 if ( QApplication::desktop()->width() < 300 ) { 440 if ( QApplication::desktop()->width() < 300 ) {
436 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 441 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
437 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 442 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
438 } 443 }
439 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 444 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
440 ++iii; 445 ++iii;
441 446
442 447
443 tabWidget->addTab( topFrame, i18n( "Language" ) ); 448 tabWidget->addTab( topFrame, i18n( "Language" ) );
444 topFrame = new QWidget( this ); 449 topFrame = new QWidget( this );
445 topLayout = new QGridLayout(topFrame,4,2); 450 topLayout = new Q3GridLayout(topFrame,4,2);
446 451
447 topLayout->setSpacing(KDialog::spacingHint()); 452 topLayout->setSpacing(KDialog::spacingHint());
448 topLayout->setMargin(KDialog::marginHint()); 453 topLayout->setMargin(KDialog::marginHint());
449 iii = 0; 454 iii = 0;
450 syncPrefsGroup = 455 syncPrefsGroup =
451 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 456 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
452 if ( QApplication::desktop()->width() > 300 ) 457 if ( QApplication::desktop()->width() > 300 )
453 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 458 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
454 syncPrefsGroup->addRadio(i18n("24:00")); 459 syncPrefsGroup->addRadio(i18n("24:00"));
455 syncPrefsGroup->addRadio(i18n("12:00am")); 460 syncPrefsGroup->addRadio(i18n("12:00am"));
456 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 461 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
457 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 462 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
@@ -462,37 +467,37 @@ void KDEPIMConfigWidget::setupLocaleTab()
462 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 467 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
463 ++iii; 468 ++iii;
464 469
465 470
466 tabWidget->addTab( topFrame, i18n( "Time Format" ) ); 471 tabWidget->addTab( topFrame, i18n( "Time Format" ) );
467 472
468} 473}
469 474
470 475
471void KDEPIMConfigWidget::setupTimeZoneTab() 476void KDEPIMConfigWidget::setupTimeZoneTab()
472{ 477{
473 QWidget *topFrame; 478 QWidget *topFrame;
474 QGridLayout *topLayout ; 479 Q3GridLayout *topLayout ;
475 480
476 481
477 482
478 483
479 484
480 485
481 topFrame = new QWidget( this ); 486 topFrame = new QWidget( this );
482 topLayout = new QGridLayout( topFrame, 5, 2); 487 topLayout = new Q3GridLayout( topFrame, 5, 2);
483 topLayout->setSpacing(KDialog::spacingHintSmall()); 488 topLayout->setSpacing(KDialog::spacingHintSmall());
484 topLayout->setMargin(KDialog::marginHintSmall()); 489 topLayout->setMargin(KDialog::marginHintSmall());
485 490
486 QHBox *timeZoneBox = new QHBox( topFrame ); 491 Q3HBox *timeZoneBox = new Q3HBox( topFrame );
487 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 492 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
488 493
489 new QLabel( i18n("Timezone:"), timeZoneBox ); 494 new QLabel( i18n("Timezone:"), timeZoneBox );
490 mTimeZoneCombo = new QComboBox( timeZoneBox ); 495 mTimeZoneCombo = new QComboBox( timeZoneBox );
491 if ( QApplication::desktop()->width() < 300 ) { 496 if ( QApplication::desktop()->width() < 300 ) {
492 mTimeZoneCombo->setMaximumWidth(150); 497 mTimeZoneCombo->setMaximumWidth(150);
493 } 498 }
494 499
495 QStringList list; 500 QStringList list;
496 list = KGlobal::locale()->timeZoneList(); 501 list = KGlobal::locale()->timeZoneList();
497 mTimeZoneCombo->insertStringList(list); 502 mTimeZoneCombo->insertStringList(list);
498 503
@@ -541,25 +546,25 @@ void KDEPIMConfigWidget::setupTimeZoneTab()
541 ++iii; 546 ++iii;
542 QDate current ( 2001, 1,1); 547 QDate current ( 2001, 1,1);
543 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); 548 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1));
544 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); 549 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1));
545 550
546 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 551 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
547 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 552 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
548 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); 553 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) );
549 tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); 554 tabWidget->addTab( topFrame, i18n( "Time Zone" ) );
550 555
551 556
552 topFrame = new QWidget( this ); 557 topFrame = new QWidget( this );
553 topLayout = new QGridLayout( topFrame, 3, 2); 558 topLayout = new Q3GridLayout( topFrame, 3, 2);
554 topLayout->setSpacing(KDialog::spacingHintSmall()); 559 topLayout->setSpacing(KDialog::spacingHintSmall());
555 topLayout->setMargin(KDialog::marginHintSmall()); 560 topLayout->setMargin(KDialog::marginHintSmall());
556 tabWidget->addTab( topFrame, i18n( "Fonts" ) ); 561 tabWidget->addTab( topFrame, i18n( "Fonts" ) );
557 562
558 QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame ); 563 QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame );
559 topLayout->addMultiCellWidget(labb,0,0,0,2); 564 topLayout->addMultiCellWidget(labb,0,0,0,2);
560 int i = 1; 565 int i = 1;
561 KPrefsWidFont *timeLabelsFont = 566 KPrefsWidFont *timeLabelsFont =
562 addWidFont(i18n("Kx/Pi"),i18n("Application Font"), 567 addWidFont(i18n("Kx/Pi"),i18n("Application Font"),
563 &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame); 568 &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame);
564 topLayout->addWidget(timeLabelsFont->label(),i,0); 569 topLayout->addWidget(timeLabelsFont->label(),i,0);
565 topLayout->addWidget(timeLabelsFont->preview(),i,1); 570 topLayout->addWidget(timeLabelsFont->preview(),i,1);
@@ -702,25 +707,25 @@ void KDEPIMConfigWidget::updateClientWidgets()
702 707
703 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display 708 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display
704 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); 709 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp );
705 if (it == mExternalAppsMap.end()) 710 if (it == mExternalAppsMap.end())
706 return; 711 return;
707 712
708 // update group box 713 // update group box
709 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); 714 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data()));
710 715
711 //update the entries in the client combobox 716 //update the entries in the client combobox
712 mClient->clear(); 717 mClient->clear();
713 718
714 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); 719 Q3PtrList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp);
715 DefaultAppItem* dai; 720 DefaultAppItem* dai;
716 for ( dai=items.first(); dai != 0; dai=items.next() ) 721 for ( dai=items.first(); dai != 0; dai=items.next() )
717 { 722 {
718 mClient->insertItem( i18n(dai->_label), dai->_id ); 723 mClient->insertItem( i18n(dai->_label), dai->_id );
719 724
720 if (dai->_id == mCurrentClient) 725 if (dai->_id == mCurrentClient)
721 { 726 {
722 //restore the edit fields with the data of the local membervariables if we had set it to "other". 727 //restore the edit fields with the data of the local membervariables if we had set it to "other".
723 //Otherwise take the default data from externalapphandler. 728 //Otherwise take the default data from externalapphandler.
724 mChannel->setText(dai->_channel); 729 mChannel->setText(dai->_channel);
725 mMessage->setText(dai->_message); 730 mMessage->setText(dai->_message);
726 mParameters->setText(dai->_parameters); 731 mParameters->setText(dai->_parameters);
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h
index 824ef79..d693015 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.h
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h
@@ -25,32 +25,34 @@
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#ifndef KDEPIMCONFIGWIDGET_H 31#ifndef KDEPIMCONFIGWIDGET_H
32#define KDEPIMCONFIGWIDGET_H 32#define KDEPIMCONFIGWIDGET_H
33 33
34#include <kprefswidget.h> 34#include <kprefswidget.h>
35#include <kio/kfile/kurlrequester.h> 35#include <kio/kfile/kurlrequester.h>
36#include <qmap.h> 36#include <qmap.h>
37//Added by qt3to4:
38#include <QLabel>
37 39
38#include "externalapphandler.h" 40#include "externalapphandler.h"
39 41
40 42
41class QComboBox; 43class QComboBox;
42class QLineEdit; 44class QLineEdit;
43class KPimGlobalPrefs; 45class KPimGlobalPrefs;
44class QGroupBox; 46class Q3GroupBox;
45class QTabWidget; 47class QTabWidget;
46class KDateEdit; 48class KDateEdit;
47 49
48class KDEPIMConfigWidget : public KPrefsWidget 50class KDEPIMConfigWidget : public KPrefsWidget
49{ 51{
50 Q_OBJECT 52 Q_OBJECT
51 53
52 public: 54 public:
53 KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name = 0 ); 55 KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name = 0 );
54 56
55 public slots: 57 public slots:
56 void textChanged( const QString& text ); 58 void textChanged( const QString& text );
@@ -97,25 +99,25 @@ class KDEPIMConfigWidget : public KPrefsWidget
97 KDateEdit* mStartDateSavingEdit; 99 KDateEdit* mStartDateSavingEdit;
98 KDateEdit* mEndDateSavingEdit; 100 KDateEdit* mEndDateSavingEdit;
99 101
100// void restoreExtensionSettings(); 102// void restoreExtensionSettings();
101// void saveExtensionSettings(); 103// void saveExtensionSettings();
102 104
103// KListView *mExtensionView; 105// KListView *mExtensionView;
104 106
105// QCheckBox *mNameParsing; 107// QCheckBox *mNameParsing;
106// QCheckBox *mViewsSingleClickBox; 108// QCheckBox *mViewsSingleClickBox;
107// QPushButton *mConfigureButton; 109// QPushButton *mConfigureButton;
108 QComboBox* mExternalApps; 110 QComboBox* mExternalApps;
109 QGroupBox* mExternalAppGroupBox; 111 Q3GroupBox* mExternalAppGroupBox;
110 112
111 113
112 QComboBox* mClient; 114 QComboBox* mClient;
113 QLineEdit* mChannel; 115 QLineEdit* mChannel;
114 QLineEdit* mMessage; 116 QLineEdit* mMessage;
115 QLineEdit* mParameters; 117 QLineEdit* mParameters;
116 QLineEdit* mMessage2; 118 QLineEdit* mMessage2;
117 QLineEdit* mParameters2; 119 QLineEdit* mParameters2;
118 120
119 ExternalAppHandler::Types mCurrentApp; 121 ExternalAppHandler::Types mCurrentApp;
120 int mCurrentClient; 122 int mCurrentClient;
121 123
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp
index bf38479..28c88d4 100644
--- a/libkdepim/kdateedit.cpp
+++ b/libkdepim/kdateedit.cpp
@@ -18,39 +18,43 @@
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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 <qapplication.h> 25#include <qapplication.h>
26#include <qevent.h> 26#include <qevent.h>
27#include <qlineedit.h> 27#include <qlineedit.h>
28#include <qpixmap.h> 28#include <qpixmap.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30//Added by qt3to4:
31#include <Q3Frame>
32#include <QKeyEvent>
30 33
31#include <kdatepicker.h> 34#include <kdatepicker.h>
32#include <kdebug.h> 35#include <kdebug.h>
33#include <kglobal.h> 36#include <kglobal.h>
34#include <kiconloader.h> 37#include <kiconloader.h>
35#include <klocale.h> 38#include <klocale.h>
36#include <kmessagebox.h> 39#include <kmessagebox.h>
37#include <knotifyclient.h> 40#include <knotifyclient.h>
38#include <qpalette.h> 41#include <qpalette.h>
42#include <QDesktopWidget>
39 43
40#include "kdateedit.h" 44#include "kdateedit.h"
41//#include "kdateedit.moc" 45//#include "kdateedit.moc"
42 46
43KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) 47KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP )
44 : QHBox(parent, name) 48 : Q3HBox(parent, name)
45{ 49{
46 dateFormShort = true; 50 dateFormShort = true;
47 withoutDp = withoutDP; 51 withoutDp = withoutDP;
48 mDateEdit = new QLineEdit(this); 52 mDateEdit = new QLineEdit(this);
49 mDateEdit->setText(KGlobal::locale()->formatDate(QDate::currentDate(),dateFormShort)); 53 mDateEdit->setText(KGlobal::locale()->formatDate(QDate::currentDate(),dateFormShort));
50 setFocusProxy(mDateEdit); 54 setFocusProxy(mDateEdit);
51 mDateEdit->installEventFilter(this); 55 mDateEdit->installEventFilter(this);
52 56
53 // Highlight Background and Textcolor 57 // Highlight Background and Textcolor
54 QPalette palette = QWidget::palette(); 58 QPalette palette = QWidget::palette();
55 unsigned char red, green, blue; 59 unsigned char red, green, blue;
56 red = palette.color( QPalette::Normal , QColorGroup::Background ).red() - 10; 60 red = palette.color( QPalette::Normal , QColorGroup::Background ).red() - 10;
@@ -63,39 +67,39 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP )
63 if ( withoutDP ) { 67 if ( withoutDP ) {
64 mDateFrame = 0; 68 mDateFrame = 0;
65 mDateButton = 0; 69 mDateButton = 0;
66 mDatePicker = 0; 70 mDatePicker = 0;
67 } else { 71 } else {
68 QPixmap pixmap = SmallIcon("smallcal"); 72 QPixmap pixmap = SmallIcon("smallcal");
69 mDateButton = new QPushButton(this); 73 mDateButton = new QPushButton(this);
70 mDateButton->setPixmap(pixmap); 74 mDateButton->setPixmap(pixmap);
71 QPixmap pixmap2 = SmallIcon("today_small"); 75 QPixmap pixmap2 = SmallIcon("today_small");
72 QPushButton* nowButton = new QPushButton(this); 76 QPushButton* nowButton = new QPushButton(this);
73 nowButton->setPixmap(pixmap2); 77 nowButton->setPixmap(pixmap2);
74 78
75 mDateFrame = new QVBox(0,0,WType_Popup); 79 mDateFrame = new Q3VBox(0,0,Qt::WType_Popup);
76 // mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 80 // mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
77 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 81 mDateFrame->setFrameStyle( Q3Frame::WinPanel |Q3Frame::Raised );
78 mDateFrame->setLineWidth(3); 82 mDateFrame->setLineWidth(3);
79 mDateFrame->hide(); 83 mDateFrame->hide();
80 84
81 mDatePicker = new KDatePicker(mDateFrame,QDate::currentDate()); 85 mDatePicker = new KDatePicker(mDateFrame,QDate::currentDate());
82 connect(mDatePicker,SIGNAL(dateEntered(QDate)),SLOT(setDate(QDate))); 86 connect(mDatePicker,SIGNAL(dateEntered(QDate)),SLOT(setDate(QDate)));
83 connect(mDatePicker,SIGNAL(dateEntered(QDate)),SIGNAL(dateChanged(QDate))); 87 connect(mDatePicker,SIGNAL(dateEntered(QDate)),SIGNAL(dateChanged(QDate)));
84 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(setDate(QDate))); 88 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(setDate(QDate)));
85 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SIGNAL(dateChanged(QDate))); 89 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SIGNAL(dateChanged(QDate)));
86 connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide())); 90 connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide()));
87 connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker())); 91 connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker()));
88 connect(nowButton,SIGNAL(clicked()),SLOT(goToNow())); 92 connect(nowButton,SIGNAL(clicked()),SLOT(goToNow()));
89 mDateButton->setFocusPolicy( QWidget::NoFocus ); 93 mDateButton->setFocusPolicy( Qt::NoFocus );
90 mDateButton->setAutoDefault( false ); 94 mDateButton->setAutoDefault( false );
91 //mDateFrame->resize( 400, 300 ); 95 //mDateFrame->resize( 400, 300 );
92 96
93 } 97 }
94 connect(mDateEdit,SIGNAL(returnPressed()),SLOT(lineEnterPressed())); 98 connect(mDateEdit,SIGNAL(returnPressed()),SLOT(lineEnterPressed()));
95 connect(mDateEdit,SIGNAL(textChanged(const QString &)), 99 connect(mDateEdit,SIGNAL(textChanged(const QString &)),
96 SLOT(textChanged(const QString &))); 100 SLOT(textChanged(const QString &)));
97 101
98 // Create the keyword list. This will be used to match against when the user 102 // Create the keyword list. This will be used to match against when the user
99 // enters information. 103 // enters information.
100 mKeywordMap[i18n("tomorrow")] = 1; 104 mKeywordMap[i18n("tomorrow")] = 1;
101 mKeywordMap[i18n("today")] = 0; 105 mKeywordMap[i18n("today")] = 0;
@@ -216,53 +220,53 @@ void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateForm
216 if( ( (space + allStrLength) <= *cpos && *cpos <= (space + allStrLength + strLength) ) || *cpos < begin ) { 220 if( ( (space + allStrLength) <= *cpos && *cpos <= (space + allStrLength + strLength) ) || *cpos < begin ) {
217 break; 221 break;
218 } 222 }
219 allStrLength += strLength; 223 allStrLength += strLength;
220 begin = dateForm.find("%", begin +1); 224 begin = dateForm.find("%", begin +1);
221 } 225 }
222 226
223 // set date 227 // set date
224 switch ( dateForm.at(begin + 1).latin1() ) { 228 switch ( dateForm.at(begin + 1).latin1() ) {
225 case 'd': 229 case 'd':
226 case 'a': 230 case 'a':
227 case 'A': 231 case 'A':
228 if(key == Key_Up) { 232 if(key == Qt::Key_Up) {
229 setDate( date.addDays( 1 ) ); 233 setDate( date.addDays( 1 ) );
230 } 234 }
231 else if(key == Key_Down) { 235 else if(key == Qt::Key_Down) {
232 setDate( date.addDays( -1 ) ); 236 setDate( date.addDays( -1 ) );
233 } 237 }
234 maxDay = readDate().day(); 238 maxDay = readDate().day();
235 break; 239 break;
236 case 'm': 240 case 'm':
237 case 'b': 241 case 'b':
238 case 'B': 242 case 'B':
239 if(key == Key_Up) { 243 if(key == Qt::Key_Up) {
240 int year = ((date.month()+1)>12)?date.year()+1:date.year(); 244 int year = ((date.month()+1)>12)?date.year()+1:date.year();
241 int month = ((date.month()+1)>12)?1:date.month()+1; 245 int month = ((date.month()+1)>12)?1:date.month()+1;
242 int day = (QDate(year,month,1).daysInMonth()<maxDay)?QDate(year,month,1).daysInMonth():maxDay; 246 int day = (QDate(year,month,1).daysInMonth()<maxDay)?QDate(year,month,1).daysInMonth():maxDay;
243 setDate( QDate( year, month, day ) ); 247 setDate( QDate( year, month, day ) );
244 } else if(key == Key_Down) { 248 } else if(key == Qt::Key_Down) {
245 int year = ((date.month()-1)<1)?date.year()-1:date.year(); 249 int year = ((date.month()-1)<1)?date.year()-1:date.year();
246 int month = ((date.month()-1)<1)?12:date.month()-1; 250 int month = ((date.month()-1)<1)?12:date.month()-1;
247 int day = (QDate(year,month,1).daysInMonth()<maxDay)?QDate(year,month,1).daysInMonth():maxDay; 251 int day = (QDate(year,month,1).daysInMonth()<maxDay)?QDate(year,month,1).daysInMonth():maxDay;
248 setDate( QDate( year, month, day ) ); 252 setDate( QDate( year, month, day ) );
249 } 253 }
250 break; 254 break;
251 case 'y': 255 case 'y':
252 case 'Y': 256 case 'Y':
253 if(key == Key_Up) { 257 if(key == Qt::Key_Up) {
254 setDate( QDate( date.year() + 1, date.month() , date.day()) ); 258 setDate( QDate( date.year() + 1, date.month() , date.day()) );
255 } 259 }
256 else if(key == Key_Down) { 260 else if(key == Qt::Key_Down) {
257 setDate( QDate( date.year() - 1, date.month() , date.day()) ); 261 setDate( QDate( date.year() - 1, date.month() , date.day()) );
258 } 262 }
259 break; 263 break;
260/* default: 264/* default:
261 if(key == Key_Up) { 265 if(key == Key_Up) {
262 setDate( date.addDays( 1 ) ); 266 setDate( date.addDays( 1 ) );
263 } else if(key == Key_Down) { 267 } else if(key == Key_Down) {
264 setDate( date.addDays( -1 ) ); 268 setDate( date.addDays( -1 ) );
265 } 269 }
266 break;*/ 270 break;*/
267 } 271 }
268 272
@@ -335,57 +339,57 @@ QDate KDateEdit::date() const
335 KNotifyClient::beep(); 339 KNotifyClient::beep();
336 return QDate::currentDate(); 340 return QDate::currentDate();
337 } 341 }
338} 342}
339 343
340void KDateEdit::keyPressEvent(QKeyEvent *e) 344void KDateEdit::keyPressEvent(QKeyEvent *e)
341{ 345{
342 QDate date = readDate(); 346 QDate date = readDate();
343 int cpos = mDateEdit->cursorPosition(); 347 int cpos = mDateEdit->cursorPosition();
344 348
345 switch(e->key()) 349 switch(e->key())
346 { 350 {
347 case Key_Escape: 351 case Qt::Key_Escape:
348 mDateEdit->deselect(); 352 mDateEdit->deselect();
349 case Key_Tab: 353 case Qt::Key_Tab:
350 QHBox::keyPressEvent(e); 354 Q3HBox::keyPressEvent(e);
351 break; 355 break;
352 case Key_Up: 356 case Qt::Key_Up:
353 // when date invalid then set to currend and return 357 // when date invalid then set to currend and return
354 if(!date.isValid()) { 358 if(!date.isValid()) {
355 date = QDate::currentDate(); 359 date = QDate::currentDate();
356 setDate(date); 360 setDate(date);
357 mDateEdit->setCursorPosition(cpos); 361 mDateEdit->setCursorPosition(cpos);
358 emit(dateChanged(date)); 362 emit(dateChanged(date));
359 QString text = i18n( "You entered an invalid date!\n Date changed to current date." ); 363 QString text = i18n( "You entered an invalid date!\n Date changed to current date." );
360 KMessageBox::information( 0, text ); 364 KMessageBox::information( 0, text );
361 return; 365 return;
362 } 366 }
363 setDate(date, &cpos, Key_Up, dateFormShort); 367 setDate(date, &cpos, Qt::Key_Up, dateFormShort);
364 break; 368 break;
365 case Key_Down: 369 case Qt::Key_Down:
366 // when date invalid then set to current and return 370 // when date invalid then set to current and return
367 if(!date.isValid()) { 371 if(!date.isValid()) {
368 date = QDate::currentDate(); 372 date = QDate::currentDate();
369 setDate(date); 373 setDate(date);
370 mDateEdit->setCursorPosition(cpos); 374 mDateEdit->setCursorPosition(cpos);
371 emit(dateChanged(date)); 375 emit(dateChanged(date));
372 QString text = i18n( "You entered an invalid date!\n Date changed to current date." ); 376 QString text = i18n( "You entered an invalid date!\n Date changed to current date." );
373 KMessageBox::information( 0, text ); 377 KMessageBox::information( 0, text );
374 return; 378 return;
375 } 379 }
376 setDate(date, &cpos, Key_Down, dateFormShort); 380 setDate(date, &cpos, Qt::Key_Down, dateFormShort);
377 break; 381 break;
378 default: 382 default:
379 QHBox::keyPressEvent(e); 383 Q3HBox::keyPressEvent(e);
380 break; 384 break;
381 } // switch 385 } // switch
382 mDateEdit->setCursorPosition(cpos); 386 mDateEdit->setCursorPosition(cpos);
383} 387}
384 388
385void KDateEdit::setSelect( int from, int to ) 389void KDateEdit::setSelect( int from, int to )
386{ 390{
387// return; 391// return;
388 mDateEdit->setSelection( from , to ); 392 mDateEdit->setSelection( from , to );
389} 393}
390 394
391void KDateEdit::toggleDatePicker() 395void KDateEdit::toggleDatePicker()
diff --git a/libkdepim/kdateedit.h b/libkdepim/kdateedit.h
index 2d8c452..38eacde 100644
--- a/libkdepim/kdateedit.h
+++ b/libkdepim/kdateedit.h
@@ -15,50 +15,53 @@
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
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#ifndef KDATEEDIT_H 24#ifndef KDATEEDIT_H
25#define KDATEEDIT_H 25#define KDATEEDIT_H
26 26
27#include <qhbox.h> 27#include <q3hbox.h>
28#include <qvbox.h> 28#include <q3vbox.h>
29#include <qdatetime.h> 29#include <qdatetime.h>
30#include <qmap.h> 30#include <qmap.h>
31//Added by qt3to4:
32#include <QKeyEvent>
33#include <QEvent>
31 34
32class QLineEdit; 35class QLineEdit;
33class QPushButton; 36class QPushButton;
34class QObject; 37class QObject;
35class QEvent; 38class QEvent;
36class KDatePicker; 39class KDatePicker;
37class KDateValidator; 40class KDateValidator;
38 41
39/** 42/**
40* A date editing widget that consists of a line edit followed by 43* A date editing widget that consists of a line edit followed by
41* a small push button. The line edit contains the date in text form, 44* a small push button. The line edit contains the date in text form,
42* and the push button will display a 'popup' style date picker. 45* and the push button will display a 'popup' style date picker.
43* 46*
44* This widget also supports advanced features like allowing the user 47* This widget also supports advanced features like allowing the user
45* to type in the day name to get the date. The following keywords 48* to type in the day name to get the date. The following keywords
46* are supported (in the native language): tomorrow, yesturday, today, 49* are supported (in the native language): tomorrow, yesturday, today,
47* monday, tuesday, wednesday, thursday, friday, saturday, sunday. 50* monday, tuesday, wednesday, thursday, friday, saturday, sunday.
48* 51*
49* @author Cornelius Schumacher <schumacher@kde.org> 52* @author Cornelius Schumacher <schumacher@kde.org>
50* @author Mike Pilone <mpilone@slac.com> 53* @author Mike Pilone <mpilone@slac.com>
51*/ 54*/
52class KDateEdit : public QHBox 55class KDateEdit : public Q3HBox
53{ 56{
54 Q_OBJECT 57 Q_OBJECT
55 public: 58 public:
56 KDateEdit(QWidget *parent=0, const char *name=0, bool withoutDP = false ); 59 KDateEdit(QWidget *parent=0, const char *name=0, bool withoutDP = false );
57 virtual ~KDateEdit(); 60 virtual ~KDateEdit();
58 61
59 /** @return True if the date in the text edit is valid, 62 /** @return True if the date in the text edit is valid,
60 * false otherwise. This will not modify the display of the date, 63 * false otherwise. This will not modify the display of the date,
61 * but only check for validity. 64 * but only check for validity.
62 */ 65 */
63 bool inputIsValid(); 66 bool inputIsValid();
64 67
@@ -119,25 +122,25 @@ class KDateEdit : public QHBox
119 QDate readDate() const; 122 QDate readDate() const;
120 123
121 /** Maps the text that the user can enter to the offset in days from 124 /** Maps the text that the user can enter to the offset in days from
122 * today. For example, the text 'tomorrow' is mapped to +1. 125 * today. For example, the text 'tomorrow' is mapped to +1.
123 */ 126 */
124 QMap<QString, int> mKeywordMap; 127 QMap<QString, int> mKeywordMap;
125 bool mTextChanged; 128 bool mTextChanged;
126 bool mHandleInvalid; 129 bool mHandleInvalid;
127 130
128 QPushButton *mDateButton; 131 QPushButton *mDateButton;
129 QLineEdit *mDateEdit; 132 QLineEdit *mDateEdit;
130 KDatePicker *mDatePicker; 133 KDatePicker *mDatePicker;
131 QVBox *mDateFrame; 134 Q3VBox *mDateFrame;
132 int maxDay; 135 int maxDay;
133 bool withoutDp; 136 bool withoutDp;
134 137
135 protected: 138 protected:
136 virtual void keyPressEvent(QKeyEvent *qke); 139 virtual void keyPressEvent(QKeyEvent *qke);
137 void setSelect ( int, int ); 140 void setSelect ( int, int );
138 bool dateFormShort; 141 bool dateFormShort;
139 char lengthMonthName; 142 char lengthMonthName;
140 143
141}; 144};
142 145
143#endif 146#endif
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp
index 68ef943..28b65cf 100644
--- a/libkdepim/kdatepicker.cpp
+++ b/libkdepim/kdatepicker.cpp
@@ -14,42 +14,46 @@
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include "kdatepicker.h" 21#include "kdatepicker.h"
22#include <kglobal.h> 22#include <kglobal.h>
23#include <kapplication.h> 23#include <kapplication.h>
24#include <klocale.h> 24#include <klocale.h>
25#include <kiconloader.h> 25#include <kiconloader.h>
26#include <qframe.h> 26#include <q3frame.h>
27#include <qpainter.h> 27#include <qpainter.h>
28#include <qdialog.h> 28#include <qdialog.h>
29#include <qtoolbutton.h> 29#include <qtoolbutton.h>
30#include <qfont.h> 30#include <qfont.h>
31#include <qapplication.h> 31#include <qapplication.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qvalidator.h> 33#include <qvalidator.h>
34//Added by qt3to4:
35#include <QResizeEvent>
36#include <QKeyEvent>
37#include <QDesktopWidget>
34#include <kdebug.h> 38#include <kdebug.h>
35#include <knotifyclient.h> 39#include <knotifyclient.h>
36#include <kglobalsettings.h> 40#include <kglobalsettings.h>
37#include "kdatetbl.h" 41#include "kdatetbl.h"
38#include "kdateedit.h" 42#include "kdateedit.h"
39//#include "kdatepicker.moc" 43//#include "kdatepicker.moc"
40 44
41 45
42KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) 46KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name)
43 : QFrame(parent,name), 47 : Q3Frame(parent,name),
44 yearForward(new QToolButton(this)), 48 yearForward(new QToolButton(this)),
45 yearBackward(new QToolButton(this)), 49 yearBackward(new QToolButton(this)),
46 monthForward(new QToolButton(this)), 50 monthForward(new QToolButton(this)),
47 monthBackward(new QToolButton(this)), 51 monthBackward(new QToolButton(this)),
48 selectMonth(new QToolButton(this)), 52 selectMonth(new QToolButton(this)),
49 selectYear(new QToolButton(this)), 53 selectYear(new QToolButton(this)),
50 todayBut(new QToolButton(this)), 54 todayBut(new QToolButton(this)),
51 //line(new QLineEdit(this)), 55 //line(new QLineEdit(this)),
52 val(new KDateValidator(this)) 56 val(new KDateValidator(this))
53 //table(new KDateTable(this)), 57 //table(new KDateTable(this)),
54 //fontsize(1) 58 //fontsize(1)
55{ 59{
diff --git a/libkdepim/kdatepicker.h b/libkdepim/kdatepicker.h
index 3db9a89..4d904da 100644
--- a/libkdepim/kdatepicker.h
+++ b/libkdepim/kdatepicker.h
@@ -11,26 +11,29 @@
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef MICROKDE_KDATEPICKER_H 20#ifndef MICROKDE_KDATEPICKER_H
21#define MICROKDE_KDATEPICKER_H 21#define MICROKDE_KDATEPICKER_H
22#include <qdatetime.h> 22#include <qdatetime.h>
23#include <qframe.h> 23#include <q3frame.h>
24#include <qevent.h> 24#include <qevent.h>
25//Added by qt3to4:
26#include <QResizeEvent>
27#include <QKeyEvent>
25 28
26class QLineEdit; 29class QLineEdit;
27class QToolButton; 30class QToolButton;
28class KDateValidator; 31class KDateValidator;
29class KDateTable; 32class KDateTable;
30class KDateEdit; 33class KDateEdit;
31 34
32/** 35/**
33 * Provides a widget for calendar date input. 36 * Provides a widget for calendar date input.
34 * 37 *
35 * Different from the 38 * Different from the
36 * previous versions, it now emits two types of signals, either 39 * previous versions, it now emits two types of signals, either
@@ -39,25 +42,25 @@ class KDateEdit;
39 * 42 *
40 * A line edit has been added in the newer versions to allow the user 43 * A line edit has been added in the newer versions to allow the user
41 * to select a date directly by entering numbers like 19990101 44 * to select a date directly by entering numbers like 19990101
42 * or 990101. 45 * or 990101.
43 * 46 *
44 * @image kdatepicker.png KDatePicker 47 * @image kdatepicker.png KDatePicker
45 * 48 *
46 * @version $Id$ 49 * @version $Id$
47 * @author Tim Gilman, Mirko Boehm 50 * @author Tim Gilman, Mirko Boehm
48 * 51 *
49 * @short A date selection widget. 52 * @short A date selection widget.
50 **/ 53 **/
51class KDatePicker: public QFrame 54class KDatePicker: public Q3Frame
52{ 55{
53 Q_OBJECT 56 Q_OBJECT
54public: 57public:
55 /** The usual constructor. The given date will be displayed 58 /** The usual constructor. The given date will be displayed
56 * initially. 59 * initially.
57 **/ 60 **/
58 KDatePicker(QWidget *parent=0, 61 KDatePicker(QWidget *parent=0,
59 QDate=QDate::currentDate(), 62 QDate=QDate::currentDate(),
60 const char *name=0); 63 const char *name=0);
61 /** 64 /**
62 * The destructor. 65 * The destructor.
63 **/ 66 **/
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 9c28425..3677e87 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -29,25 +29,25 @@ $Id$
29*/ 29*/
30 30
31#include <kglobal.h> 31#include <kglobal.h>
32#include <kconfig.h> 32#include <kconfig.h>
33#include <klocale.h> 33#include <klocale.h>
34#include <kdebug.h> 34#include <kdebug.h>
35#include <kglobalsettings.h> 35#include <kglobalsettings.h>
36#include <kstaticdeleter.h> 36#include <kstaticdeleter.h>
37 37
38#include <qregexp.h> 38#include <qregexp.h>
39#include <qfile.h> 39#include <qfile.h>
40#include <stdlib.h> 40#include <stdlib.h>
41#include <qtextstream.h> 41#include <q3textstream.h>
42#include <qapplication.h> 42#include <qapplication.h>
43#include "kpimglobalprefs.h" 43#include "kpimglobalprefs.h"
44 44
45KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; 45KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0;
46static KStaticDeleter<KPimGlobalPrefs> staticDeleterGP; 46static KStaticDeleter<KPimGlobalPrefs> staticDeleterGP;
47 47
48 48
49KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) 49KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
50 : KPrefs("microkdeglobalrc") 50 : KPrefs("microkdeglobalrc")
51{ 51{
52 mLocaleDict = 0; 52 mLocaleDict = 0;
53 KPrefs::setCurrentGroup("Fonts"); 53 KPrefs::setCurrentGroup("Fonts");
@@ -133,41 +133,41 @@ void KPimGlobalPrefs::setGlobalConfig()
133 mLocaleDict = 0; 133 mLocaleDict = 0;
134 if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { 134 if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) {
135 135
136 if ( mPreferredLanguage == 1 ) 136 if ( mPreferredLanguage == 1 )
137 fileName = fileName+"germantranslation.txt"; 137 fileName = fileName+"germantranslation.txt";
138 else if ( mPreferredLanguage == 4 ) 138 else if ( mPreferredLanguage == 4 )
139 fileName = fileName+"usertranslation.txt"; 139 fileName = fileName+"usertranslation.txt";
140 else if ( mPreferredLanguage == 2 ) 140 else if ( mPreferredLanguage == 2 )
141 fileName = fileName+"frenchtranslation.txt"; 141 fileName = fileName+"frenchtranslation.txt";
142 else if ( mPreferredLanguage == 3 ) 142 else if ( mPreferredLanguage == 3 )
143 fileName = fileName+"italiantranslation.txt"; 143 fileName = fileName+"italiantranslation.txt";
144 QFile file( fileName ); 144 QFile file( fileName );
145 if (file.open( IO_ReadOnly ) ) { 145 if (file.open( QIODevice::ReadOnly ) ) {
146 QTextStream ts( &file ); 146 Q3TextStream ts( &file );
147 ts.setEncoding( QTextStream::Latin1 ); 147 ts.setEncoding( Q3TextStream::Latin1 );
148 //ts.setCodec( QTextCodec::latin1 ); 148 //ts.setCodec( QTextCodec::latin1 );
149 QString text = ts.read(); 149 QString text = ts.read();
150 file.close(); 150 file.close();
151 text.replace( QRegExp("\\\\n"), "\n" ); 151 text.replace( QRegExp("\\\\n"), "\n" );
152 QString line; 152 QString line;
153 QString we; 153 QString we;
154 QString wt; 154 QString wt;
155 int br = 0; 155 int br = 0;
156 int nbr; 156 int nbr;
157 nbr = text.find ( "},", br ); 157 nbr = text.find ( "},", br );
158 line = text.mid( br, nbr - br ); 158 line = text.mid( br, nbr - br );
159 br = nbr+1; 159 br = nbr+1;
160 int se, ee, st, et; 160 int se, ee, st, et;
161 mLocaleDict = new QDict<QString>; 161 mLocaleDict = new Q3Dict<QString>;
162 mLocaleDict->setAutoDelete( true ); 162 mLocaleDict->setAutoDelete( true );
163 QString end = "{ \"\",\"\" }"; 163 QString end = "{ \"\",\"\" }";
164 while ( (line != end) && (br > 1) ) { 164 while ( (line != end) && (br > 1) ) {
165 //qDebug("%d *%s* ", br, line.latin1()); 165 //qDebug("%d *%s* ", br, line.latin1());
166 se = line.find("\"")+1; 166 se = line.find("\"")+1;
167 et = line.findRev("\"",-1); 167 et = line.findRev("\"",-1);
168 ee = line.find("\",\""); 168 ee = line.find("\",\"");
169 st = ee+3; 169 st = ee+3;
170 we = line.mid( se, ee-se ); 170 we = line.mid( se, ee-se );
171 if ( mPreferredLanguage == 4 ) 171 if ( mPreferredLanguage == 4 )
172 wt = QString::fromUtf8(line.mid( st, et-st ).latin1()); 172 wt = QString::fromUtf8(line.mid( st, et-st ).latin1());
173 else 173 else
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h
index 94ac8ae..01f5ab0 100644
--- a/libkdepim/kpimglobalprefs.h
+++ b/libkdepim/kpimglobalprefs.h
@@ -23,25 +23,25 @@
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#ifndef KPIMGLOBALPREFS_H 31#ifndef KPIMGLOBALPREFS_H
32#define KPIMGLOBALPREFS_H 32#define KPIMGLOBALPREFS_H
33 33
34#include "kprefs.h" 34#include "kprefs.h"
35#include <qdict.h> 35#include <q3dict.h>
36 36
37class KPimGlobalPrefs : public KPrefs 37class KPimGlobalPrefs : public KPrefs
38{ 38{
39 public: 39 public:
40 40
41 void setGlobalConfig(); 41 void setGlobalConfig();
42 static KPimGlobalPrefs *instance(); 42 static KPimGlobalPrefs *instance();
43 43
44 44
45 virtual ~KPimGlobalPrefs(); 45 virtual ~KPimGlobalPrefs();
46 46
47 47
@@ -76,25 +76,25 @@ class KPimGlobalPrefs : public KPrefs
76 }; 76 };
77 77
78 enum SIPClients { 78 enum SIPClients {
79 NONE_SIC = 0, 79 NONE_SIC = 0,
80 OTHER_SIC = 1, 80 OTHER_SIC = 1,
81 KPPI_SIC = 2 81 KPPI_SIC = 2
82 }; 82 };
83 83
84 private: 84 private:
85 KPimGlobalPrefs( const QString &name = QString::null ); 85 KPimGlobalPrefs( const QString &name = QString::null );
86 86
87 static KPimGlobalPrefs *sInstance; 87 static KPimGlobalPrefs *sInstance;
88 QDict<QString> *mLocaleDict; 88 Q3Dict<QString> *mLocaleDict;
89 89
90 90
91 public: 91 public:
92 //US I copied the following "locale" settings from KOPrefs 92 //US I copied the following "locale" settings from KOPrefs
93 int mPreferredDate; 93 int mPreferredDate;
94 QString mUserDateFormatLong; 94 QString mUserDateFormatLong;
95 QString mUserDateFormatShort; 95 QString mUserDateFormatShort;
96 int mPreferredLanguage; 96 int mPreferredLanguage;
97 int mPreferredTime; 97 int mPreferredTime;
98 bool mWeekStartsOnSunday; 98 bool mWeekStartsOnSunday;
99 QString mTimeZoneId; 99 QString mTimeZoneId;
100 bool mUseDaylightsaving; 100 bool mUseDaylightsaving;
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp
index 6dc741d..358acbd 100644
--- a/libkdepim/kprefsdialog.cpp
+++ b/libkdepim/kprefsdialog.cpp
@@ -16,41 +16,42 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24// $Id$ 24// $Id$
25 25
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qgroupbox.h> 28#include <q3groupbox.h>
29#include <qbuttongroup.h> 29#include <q3buttongroup.h>
30#include <qlineedit.h> 30#include <qlineedit.h>
31#include <qfont.h> 31#include <qfont.h>
32#include <qslider.h> 32#include <qslider.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qtextstream.h> 34#include <q3textstream.h>
35#include <qvbox.h> 35#include <q3vbox.h>
36#include <qhbox.h> 36#include <q3hbox.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qframe.h> 39#include <q3frame.h>
40#include <qcombobox.h> 40#include <qcombobox.h>
41#include <qcheckbox.h> 41#include <qcheckbox.h>
42#include <qradiobutton.h> 42#include <qradiobutton.h>
43#include <qpushbutton.h> 43#include <qpushbutton.h>
44#include <qapplication.h> 44#include <qapplication.h>
45#include <QDesktopWidget>
45 46
46#include <kcolorbutton.h> 47#include <kcolorbutton.h>
47#include <kdebug.h> 48#include <kdebug.h>
48#include <klocale.h> 49#include <klocale.h>
49#include <kglobal.h> 50#include <kglobal.h>
50#include <kglobalsettings.h> 51#include <kglobalsettings.h>
51#include <kfontdialog.h> 52#include <kfontdialog.h>
52#include <kmessagebox.h> 53#include <kmessagebox.h>
53#include <kcolordialog.h> 54#include <kcolordialog.h>
54#include <kiconloader.h> 55#include <kiconloader.h>
55 56
56#include "kprefs.h" 57#include "kprefs.h"
@@ -119,25 +120,25 @@ KColorButton *KPrefsDialogWidColor::button()
119{ 120{
120 return mButton; 121 return mButton;
121} 122}
122 123
123KPrefsDialogWidFont::KPrefsDialogWidFont(const QString &sampleText,const QString &labelText, 124KPrefsDialogWidFont::KPrefsDialogWidFont(const QString &sampleText,const QString &labelText,
124 QFont *reference,QWidget *parent) 125 QFont *reference,QWidget *parent)
125{ 126{
126 mReference = reference; 127 mReference = reference;
127 128
128 mLabel = new QLabel(labelText, parent); 129 mLabel = new QLabel(labelText, parent);
129 130
130 mPreview = new QLabel(sampleText,parent); 131 mPreview = new QLabel(sampleText,parent);
131 mPreview->setFrameStyle(QFrame::Panel|QFrame::Sunken); 132 mPreview->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken);
132 133
133 mButton = new QPushButton(i18n("Choose..."), parent); 134 mButton = new QPushButton(i18n("Choose..."), parent);
134 connect(mButton,SIGNAL(clicked()),SLOT(selectFont())); 135 connect(mButton,SIGNAL(clicked()),SLOT(selectFont()));
135 mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 ); 136 mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 );
136 mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 ); 137 mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 );
137} 138}
138 139
139KPrefsDialogWidFont::~KPrefsDialogWidFont() 140KPrefsDialogWidFont::~KPrefsDialogWidFont()
140{ 141{
141} 142}
142 143
143void KPrefsDialogWidFont::readConfig() 144void KPrefsDialogWidFont::readConfig()
@@ -203,37 +204,37 @@ QLabel *KPrefsDialogWidTime::label()
203 204
204QSpinBox *KPrefsDialogWidTime::spinBox() 205QSpinBox *KPrefsDialogWidTime::spinBox()
205{ 206{
206 return mSpin; 207 return mSpin;
207} 208}
208 209
209 210
210KPrefsDialogWidRadios::KPrefsDialogWidRadios(const QString &text,int *reference, 211KPrefsDialogWidRadios::KPrefsDialogWidRadios(const QString &text,int *reference,
211 QWidget *parent) 212 QWidget *parent)
212{ 213{
213 mReference = reference; 214 mReference = reference;
214 215
215 mBox = new QButtonGroup(1,Qt::Horizontal,text,parent); 216 mBox = new Q3ButtonGroup(1,Qt::Horizontal,text,parent);
216} 217}
217 218
218KPrefsDialogWidRadios::~KPrefsDialogWidRadios() 219KPrefsDialogWidRadios::~KPrefsDialogWidRadios()
219{ 220{
220} 221}
221 222
222void KPrefsDialogWidRadios::addRadio(const QString &text) 223void KPrefsDialogWidRadios::addRadio(const QString &text)
223{ 224{
224 new QRadioButton(text,mBox); 225 new QRadioButton(text,mBox);
225} 226}
226 227
227QButtonGroup *KPrefsDialogWidRadios::groupBox() 228Q3ButtonGroup *KPrefsDialogWidRadios::groupBox()
228{ 229{
229 return mBox; 230 return mBox;
230} 231}
231 232
232void KPrefsDialogWidRadios::readConfig() 233void KPrefsDialogWidRadios::readConfig()
233{ 234{
234 mBox->setButton(*mReference); 235 mBox->setButton(*mReference);
235} 236}
236 237
237void KPrefsDialogWidRadios::writeConfig() 238void KPrefsDialogWidRadios::writeConfig()
238{ 239{
239 *mReference = mBox->id(mBox->selected()); 240 *mReference = mBox->id(mBox->selected());
diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h
index 52ec809..cc95dd4 100644
--- a/libkdepim/kprefsdialog.h
+++ b/libkdepim/kprefsdialog.h
@@ -15,37 +15,39 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KPREFSDIALOG_H 23#ifndef _KPREFSDIALOG_H
24#define _KPREFSDIALOG_H 24#define _KPREFSDIALOG_H
25// $Id$ 25// $Id$
26 26
27#include <qptrlist.h> 27#include <q3ptrlist.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29//Added by qt3to4:
30#include <QLabel>
29 31
30#include <kdialogbase.h> 32#include <kdialogbase.h>
31 33
32class KPrefs; 34class KPrefs;
33class KPrefsDialog; 35class KPrefsDialog;
34 36
35class KColorButton; 37class KColorButton;
36class QCheckBox; 38class QCheckBox;
37class QLabel; 39class QLabel;
38class QSpinBox; 40class QSpinBox;
39class QButtonGroup; 41class Q3ButtonGroup;
40 42
41/** 43/**
42 @short Base class for widgets used by @ref KPrefsDialog. 44 @short Base class for widgets used by @ref KPrefsDialog.
43 @author Cornelius Schumacher 45 @author Cornelius Schumacher
44 @see KPrefsDialog 46 @see KPrefsDialog
45 47
46 This class provides the interface for the preferences widgets used by 48 This class provides the interface for the preferences widgets used by
47 KPrefsDialog. 49 KPrefsDialog.
48*/ 50*/
49class KPrefsDialogWid : public QObject 51class KPrefsDialogWid : public QObject
50{ 52{
51 public: 53 public:
@@ -249,33 +251,33 @@ class KPrefsDialogWidRadios : public KPrefsDialogWid
249 virtual ~KPrefsDialogWidRadios(); 251 virtual ~KPrefsDialogWidRadios();
250 252
251 /** 253 /**
252 Add a radio button. 254 Add a radio button.
253 255
254 @param text Text of the button. 256 @param text Text of the button.
255 */ 257 */
256 void addRadio(const QString &text); 258 void addRadio(const QString &text);
257 259
258 /** 260 /**
259 Return the box widget used by this widget. 261 Return the box widget used by this widget.
260 */ 262 */
261 QButtonGroup *groupBox(); 263 Q3ButtonGroup *groupBox();
262 264
263 void readConfig(); 265 void readConfig();
264 void writeConfig(); 266 void writeConfig();
265 267
266 private: 268 private:
267 int *mReference; 269 int *mReference;
268 270
269 QButtonGroup *mBox; 271 Q3ButtonGroup *mBox;
270}; 272};
271 273
272 274
273/** 275/**
274 @short Widget for string settings in @ref KPrefsDialog. 276 @short Widget for string settings in @ref KPrefsDialog.
275 277
276 This class provides a widget for configuring string values. It is meant to be 278 This class provides a widget for configuring string values. It is meant to be
277 used by KPrefsDialog. The user is responsible for the layout management. 279 used by KPrefsDialog. The user is responsible for the layout management.
278*/ 280*/
279class KPrefsDialogWidString : public KPrefsDialogWid 281class KPrefsDialogWidString : public KPrefsDialogWid
280{ 282{
281 public: 283 public:
@@ -430,25 +432,25 @@ class KPrefsDialog : public KDialogBase
430 /** Set preferences to default values */ 432 /** Set preferences to default values */
431 void slotDefault(); 433 void slotDefault();
432 434
433 protected: 435 protected:
434 /** Implement this to read custom configuration widgets. */ 436 /** Implement this to read custom configuration widgets. */
435 virtual void usrReadConfig() {} 437 virtual void usrReadConfig() {}
436 /** Implement this to write custom configuration widgets. */ 438 /** Implement this to write custom configuration widgets. */
437 virtual void usrWriteConfig() {} 439 virtual void usrWriteConfig() {}
438 440
439 private: 441 private:
440 KPrefs *mPrefs; 442 KPrefs *mPrefs;
441 443
442 QPtrList<KPrefsDialogWid> mPrefsWids; 444 Q3PtrList<KPrefsDialogWid> mPrefsWids;
443}; 445};
444 446
445 447
446#include "kcmconfigs/kdepimconfigwidget.h" 448#include "kcmconfigs/kdepimconfigwidget.h"
447class KPimPrefsGlobalDialog : public KPrefsDialog 449class KPimPrefsGlobalDialog : public KPrefsDialog
448{ 450{
449 Q_OBJECT 451 Q_OBJECT
450 public: 452 public:
451 KPimPrefsGlobalDialog(QWidget *parent=0,char *name=0,bool modal=true); 453 KPimPrefsGlobalDialog(QWidget *parent=0,char *name=0,bool modal=true);
452 /** 454 /**
453 Destructor. 455 Destructor.
454 */ 456 */
diff --git a/libkdepim/kprefswidget.cpp b/libkdepim/kprefswidget.cpp
index f6a0b38..51431e2 100644
--- a/libkdepim/kprefswidget.cpp
+++ b/libkdepim/kprefswidget.cpp
@@ -16,41 +16,42 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24// $Id$ 24// $Id$
25 25
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qgroupbox.h> 28#include <q3groupbox.h>
29#include <qbuttongroup.h> 29#include <q3buttongroup.h>
30#include <qlineedit.h> 30#include <qlineedit.h>
31#include <qfont.h> 31#include <qfont.h>
32#include <qslider.h> 32#include <qslider.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qtextstream.h> 34#include <q3textstream.h>
35#include <qvbox.h> 35#include <q3vbox.h>
36#include <qhbox.h> 36#include <q3hbox.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qframe.h> 39#include <q3frame.h>
40#include <qcombobox.h> 40#include <qcombobox.h>
41#include <qcheckbox.h> 41#include <qcheckbox.h>
42#include <qradiobutton.h> 42#include <qradiobutton.h>
43#include <qpushbutton.h> 43#include <qpushbutton.h>
44#include <qapplication.h> 44#include <qapplication.h>
45#include <QDesktopWidget>
45 46
46#include <kcolorbutton.h> 47#include <kcolorbutton.h>
47#include <kdebug.h> 48#include <kdebug.h>
48#include <klocale.h> 49#include <klocale.h>
49#include <kglobal.h> 50#include <kglobal.h>
50#include <kfontdialog.h> 51#include <kfontdialog.h>
51#include <kmessagebox.h> 52#include <kmessagebox.h>
52#include <kcolordialog.h> 53#include <kcolordialog.h>
53#include <kiconloader.h> 54#include <kiconloader.h>
54 55
55#include "kprefs.h" 56#include "kprefs.h"
56 57
@@ -122,25 +123,25 @@ KColorButton *KPrefsWidColor::button()
122{ 123{
123 return mButton; 124 return mButton;
124} 125}
125 126
126KPrefsWidFont::KPrefsWidFont(const QString &sampleText,const QString &labelText, 127KPrefsWidFont::KPrefsWidFont(const QString &sampleText,const QString &labelText,
127 QFont *reference,QWidget *parent) 128 QFont *reference,QWidget *parent)
128{ 129{
129 mReference = reference; 130 mReference = reference;
130 131
131 mLabel = new QLabel(labelText, parent); 132 mLabel = new QLabel(labelText, parent);
132 133
133 mPreview = new QLabel(sampleText,parent); 134 mPreview = new QLabel(sampleText,parent);
134 mPreview->setFrameStyle(QFrame::Panel|QFrame::Sunken); 135 mPreview->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken);
135 136
136 mButton = new QPushButton(i18n("Choose..."), parent); 137 mButton = new QPushButton(i18n("Choose..."), parent);
137 connect(mButton,SIGNAL(clicked()),SLOT(selectFont())); 138 connect(mButton,SIGNAL(clicked()),SLOT(selectFont()));
138 mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 ); 139 mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 );
139 mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 ); 140 mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 );
140} 141}
141 142
142KPrefsWidFont::~KPrefsWidFont() 143KPrefsWidFont::~KPrefsWidFont()
143{ 144{
144} 145}
145 146
146void KPrefsWidFont::readConfig() 147void KPrefsWidFont::readConfig()
@@ -209,38 +210,38 @@ QLabel *KPrefsWidTime::label()
209 210
210QSpinBox *KPrefsWidTime::spinBox() 211QSpinBox *KPrefsWidTime::spinBox()
211{ 212{
212 return mSpin; 213 return mSpin;
213} 214}
214 215
215 216
216KPrefsWidRadios::KPrefsWidRadios(const QString &text,int *reference, 217KPrefsWidRadios::KPrefsWidRadios(const QString &text,int *reference,
217 QWidget *parent) 218 QWidget *parent)
218{ 219{
219 mReference = reference; 220 mReference = reference;
220 221
221 mBox = new QButtonGroup(1,Qt::Horizontal,text,parent); 222 mBox = new Q3ButtonGroup(1,Qt::Horizontal,text,parent);
222 connect( mBox, SIGNAL( clicked(int)), SIGNAL( modified() ) ); 223 connect( mBox, SIGNAL( clicked(int)), SIGNAL( modified() ) );
223} 224}
224 225
225KPrefsWidRadios::~KPrefsWidRadios() 226KPrefsWidRadios::~KPrefsWidRadios()
226{ 227{
227} 228}
228 229
229void KPrefsWidRadios::addRadio(const QString &text) 230void KPrefsWidRadios::addRadio(const QString &text)
230{ 231{
231 new QRadioButton(text,mBox); 232 new QRadioButton(text,mBox);
232} 233}
233 234
234QButtonGroup *KPrefsWidRadios::groupBox() 235Q3ButtonGroup *KPrefsWidRadios::groupBox()
235{ 236{
236 return mBox; 237 return mBox;
237} 238}
238 239
239void KPrefsWidRadios::readConfig() 240void KPrefsWidRadios::readConfig()
240{ 241{
241 mBox->setButton(*mReference); 242 mBox->setButton(*mReference);
242} 243}
243 244
244void KPrefsWidRadios::writeConfig() 245void KPrefsWidRadios::writeConfig()
245{ 246{
246 *mReference = mBox->id(mBox->selected()); 247 *mReference = mBox->id(mBox->selected());
diff --git a/libkdepim/kprefswidget.h b/libkdepim/kprefswidget.h
index 8543a39..9de1be5 100644
--- a/libkdepim/kprefswidget.h
+++ b/libkdepim/kprefswidget.h
@@ -16,37 +16,39 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23// $Id$ 23// $Id$
24 24
25#ifndef _KPREFSWIDGET_H 25#ifndef _KPREFSWIDGET_H
26#define _KPREFSWIDGET_H 26#define _KPREFSWIDGET_H
27 27
28#include <qptrlist.h> 28#include <q3ptrlist.h>
29#include <qlineedit.h> 29#include <qlineedit.h>
30#include <qpushbutton.h> 30#include <qpushbutton.h>
31 31
32#include <qwidget.h> 32#include <qwidget.h>
33//Added by qt3to4:
34#include <QLabel>
33 35
34class KPrefs; 36class KPrefs;
35 37
36class KColorButton; 38class KColorButton;
37class QCheckBox; 39class QCheckBox;
38class QLabel; 40class QLabel;
39class QSpinBox; 41class QSpinBox;
40class QButtonGroup; 42class Q3ButtonGroup;
41 43
42/** 44/**
43 @short Base class for widgets used by @ref KPrefsDialog. 45 @short Base class for widgets used by @ref KPrefsDialog.
44 @author Cornelius Schumacher 46 @author Cornelius Schumacher
45 @see KPrefsDialog 47 @see KPrefsDialog
46 48
47 This class provides the interface for the preferences widgets used by 49 This class provides the interface for the preferences widgets used by
48 KPrefsDialog. 50 KPrefsDialog.
49*/ 51*/
50class KPrefsWid : public QObject 52class KPrefsWid : public QObject
51{ 53{
52 Q_OBJECT 54 Q_OBJECT
@@ -256,33 +258,33 @@ class KPrefsWidRadios : public KPrefsWid
256 virtual ~KPrefsWidRadios(); 258 virtual ~KPrefsWidRadios();
257 259
258 /** 260 /**
259 Add a radio button. 261 Add a radio button.
260 262
261 @param text Text of the button. 263 @param text Text of the button.
262 */ 264 */
263 void addRadio(const QString &text); 265 void addRadio(const QString &text);
264 266
265 /** 267 /**
266 Return the box widget used by this widget. 268 Return the box widget used by this widget.
267 */ 269 */
268 QButtonGroup *groupBox(); 270 Q3ButtonGroup *groupBox();
269 271
270 void readConfig(); 272 void readConfig();
271 void writeConfig(); 273 void writeConfig();
272 274
273 private: 275 private:
274 int *mReference; 276 int *mReference;
275 277
276 QButtonGroup *mBox; 278 Q3ButtonGroup *mBox;
277}; 279};
278 280
279 281
280/** 282/**
281 @short Widget for string settings in @ref KPrefsDialog. 283 @short Widget for string settings in @ref KPrefsDialog.
282 284
283 This class provides a widget for configuring string values. It is meant to be 285 This class provides a widget for configuring string values. It is meant to be
284 used by KPrefsDialog. The user is responsible for the layout management. 286 used by KPrefsDialog. The user is responsible for the layout management.
285*/ 287*/
286class KPrefsWidString : public KPrefsWid 288class KPrefsWidString : public KPrefsWid
287{ 289{
288 public: 290 public:
@@ -440,16 +442,16 @@ class KPrefsWidget : public QWidget
440 /** Set preferences to default values */ 442 /** Set preferences to default values */
441 //US void slotDefault(); 443 //US void slotDefault();
442 444
443 protected: 445 protected:
444 /** Implement this to read custom configuration widgets. */ 446 /** Implement this to read custom configuration widgets. */
445 virtual void usrReadConfig() {} 447 virtual void usrReadConfig() {}
446 /** Implement this to write custom configuration widgets. */ 448 /** Implement this to write custom configuration widgets. */
447 virtual void usrWriteConfig() {} 449 virtual void usrWriteConfig() {}
448 450
449 private: 451 private:
450 KPrefs *mPrefs; 452 KPrefs *mPrefs;
451 453
452 QPtrList<KPrefsWid> mPrefsWids; 454 Q3PtrList<KPrefsWid> mPrefsWids;
453}; 455};
454 456
455#endif 457#endif
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 5708dfc..c844627 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -26,53 +26,56 @@
26 26
27#ifndef _WIN32_ 27#ifndef _WIN32_
28#include <unistd.h> 28#include <unistd.h>
29#endif 29#endif
30 30
31 31
32#include "ksyncprofile.h" 32#include "ksyncprofile.h"
33#include "ksyncprefsdialog.h" 33#include "ksyncprefsdialog.h"
34#include "kpimprefs.h" 34#include "kpimprefs.h"
35#include <kmessagebox.h> 35#include <kmessagebox.h>
36 36
37#include <qdir.h> 37#include <qdir.h>
38#include <qprogressbar.h> 38#include <q3progressbar.h>
39#include <qpopupmenu.h> 39#include <q3popupmenu.h>
40#include <qpushbutton.h> 40#include <qpushbutton.h>
41#include <qradiobutton.h> 41#include <qradiobutton.h>
42#include <qbuttongroup.h> 42#include <q3buttongroup.h>
43#include <qtimer.h> 43#include <qtimer.h>
44#include <qmessagebox.h> 44#include <qmessagebox.h>
45#include <qapplication.h> 45#include <qapplication.h>
46#include <qlineedit.h> 46#include <qlineedit.h>
47#include <qdialog.h> 47#include <qdialog.h>
48#include <qlayout.h> 48#include <qlayout.h>
49#include <qtextcodec.h> 49#include <qtextcodec.h>
50#include <qlabel.h> 50#include <qlabel.h>
51#include <qcheckbox.h> 51#include <qcheckbox.h>
52#include <qapplication.h> 52#include <qapplication.h>
53#include <QDesktopWidget>
54//Added by qt3to4:
55#include <Q3VBoxLayout>
53 56
54#include <klocale.h> 57#include <klocale.h>
55#include <kglobal.h> 58#include <kglobal.h>
56#include <kconfig.h> 59#include <kconfig.h>
57#include <kfiledialog.h> 60#include <kfiledialog.h>
58 61
59QDateTime KSyncManager::mRequestedSyncEvent; 62QDateTime KSyncManager::mRequestedSyncEvent;
60 63
61 64
62KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) 65KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, Q3PopupMenu* syncmenu)
63 : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) 66 : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu)
64{ 67{
65 mServerSocket = 0; 68 mServerSocket = 0;
66 bar = new QProgressBar ( 1, 0 ); 69 bar = new Q3ProgressBar ( 1, 0 );
67 bar->setCaption (""); 70 bar->setCaption ("");
68 mWriteBackInPast = 2; 71 mWriteBackInPast = 2;
69 72
70 73
71} 74}
72 75
73KSyncManager::~KSyncManager() 76KSyncManager::~KSyncManager()
74{ 77{
75 delete bar; 78 delete bar;
76} 79}
77 80
78void KSyncManager::setDefaultFileName( QString s) 81void KSyncManager::setDefaultFileName( QString s)
@@ -80,25 +83,25 @@ void KSyncManager::setDefaultFileName( QString s)
80 mDefFileName = s ; 83 mDefFileName = s ;
81 if ( mPrefs->mPassiveSyncAutoStart ) 84 if ( mPrefs->mPassiveSyncAutoStart )
82 enableQuick( false ); 85 enableQuick( false );
83} 86}
84 87
85void KSyncManager::fillSyncMenu() 88void KSyncManager::fillSyncMenu()
86{ 89{
87 if ( mSyncMenu->count() ) 90 if ( mSyncMenu->count() )
88 mSyncMenu->clear(); 91 mSyncMenu->clear();
89 92
90 mSyncMenu->insertItem( i18n("Configure..."), 0 ); 93 mSyncMenu->insertItem( i18n("Configure..."), 0 );
91 mSyncMenu->insertSeparator(); 94 mSyncMenu->insertSeparator();
92 QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); 95 Q3PopupMenu *clearMenu = new Q3PopupMenu ( mSyncMenu );
93 mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); 96 mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 );
94 clearMenu->insertItem( i18n("For all profiles"), 1 ); 97 clearMenu->insertItem( i18n("For all profiles"), 1 );
95 clearMenu->insertSeparator(); 98 clearMenu->insertSeparator();
96 connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) ); 99 connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) );
97 mSyncMenu->insertSeparator(); 100 mSyncMenu->insertSeparator();
98 if ( mServerSocket == 0 ) { 101 if ( mServerSocket == 0 ) {
99 mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); 102 mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 );
100 } else { 103 } else {
101 mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); 104 mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 );
102 } 105 }
103 mSyncMenu->insertSeparator(); 106 mSyncMenu->insertSeparator();
104 mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); 107 mSyncMenu->insertItem( i18n("Multiple sync"), 1 );
@@ -346,25 +349,25 @@ void KSyncManager::slotSyncMenu( int action )
346 } 349 }
347 delete temp; 350 delete temp;
348 setBlockSave(false); 351 setBlockSave(false);
349} 352}
350 353
351void KSyncManager::enableQuick( bool ask ) 354void KSyncManager::enableQuick( bool ask )
352{ 355{
353 bool autoStart; 356 bool autoStart;
354 bool changed = false; 357 bool changed = false;
355 if ( ask ) { 358 if ( ask ) {
356 QDialog dia ( 0, "input-dialog", true ); 359 QDialog dia ( 0, "input-dialog", true );
357 QLineEdit lab ( &dia ); 360 QLineEdit lab ( &dia );
358 QVBoxLayout lay( &dia ); 361 Q3VBoxLayout lay( &dia );
359 lab.setText( mPrefs->mPassiveSyncPort ); 362 lab.setText( mPrefs->mPassiveSyncPort );
360 lay.setMargin(7); 363 lay.setMargin(7);
361 lay.setSpacing(7); 364 lay.setSpacing(7);
362 int po = 9197+mTargetApp; 365 int po = 9197+mTargetApp;
363 QLabel label ( i18n("Port number (Default: %1)\nValid range from 1 to 65535").arg(po), &dia ); 366 QLabel label ( i18n("Port number (Default: %1)\nValid range from 1 to 65535").arg(po), &dia );
364 lay.addWidget( &label); 367 lay.addWidget( &label);
365 lay.addWidget( &lab); 368 lay.addWidget( &lab);
366 369
367 QLineEdit lepw ( &dia ); 370 QLineEdit lepw ( &dia );
368 lepw.setText( mPrefs->mPassiveSyncPw ); 371 lepw.setText( mPrefs->mPassiveSyncPw );
369 QLabel label2 ( i18n("Password to enable\naccess from remote:"), &dia ); 372 QLabel label2 ( i18n("Password to enable\naccess from remote:"), &dia );
370 lay.addWidget( &label2); 373 lay.addWidget( &label2);
@@ -795,25 +798,25 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask)
795 return; 798 return;
796 } else { 799 } else {
797 mParent->topLevelWidget()->setCaption ( i18n( "Syncronization sucessfully completed" ) ); 800 mParent->topLevelWidget()->setCaption ( i18n( "Syncronization sucessfully completed" ) );
798 } 801 }
799 } 802 }
800 } 803 }
801 return; 804 return;
802} 805}
803bool KSyncManager::edit_pisync_options() 806bool KSyncManager::edit_pisync_options()
804{ 807{
805 QDialog dia( mParent, "dia", true ); 808 QDialog dia( mParent, "dia", true );
806 dia.setCaption( i18n("Pi-Sync options for device: " ) +mCurrentSyncDevice ); 809 dia.setCaption( i18n("Pi-Sync options for device: " ) +mCurrentSyncDevice );
807 QVBoxLayout lay ( &dia ); 810 Q3VBoxLayout lay ( &dia );
808 lay.setSpacing( 5 ); 811 lay.setSpacing( 5 );
809 lay.setMargin( 3 ); 812 lay.setMargin( 3 );
810 QLabel lab1 ( i18n("Password for remote access:"), &dia); 813 QLabel lab1 ( i18n("Password for remote access:"), &dia);
811 lay.addWidget( &lab1 ); 814 lay.addWidget( &lab1 );
812 QLineEdit le1 (&dia ); 815 QLineEdit le1 (&dia );
813 lay.addWidget( &le1 ); 816 lay.addWidget( &le1 );
814 QLabel lab2 ( i18n("Remote IP address:"), &dia); 817 QLabel lab2 ( i18n("Remote IP address:"), &dia);
815 lay.addWidget( &lab2 ); 818 lay.addWidget( &lab2 );
816 QLineEdit le2 (&dia ); 819 QLineEdit le2 (&dia );
817 lay.addWidget( &le2 ); 820 lay.addWidget( &le2 );
818 QLabel lab3 ( i18n("Remote port number:\n(May be: 1 - 65535)"), &dia); 821 QLabel lab3 ( i18n("Remote port number:\n(May be: 1 - 65535)"), &dia);
819 lay.addWidget( &lab3 ); 822 lay.addWidget( &lab3 );
@@ -829,26 +832,26 @@ bool KSyncManager::edit_pisync_options()
829 mPassWordPiSync = le1.text(); 832 mPassWordPiSync = le1.text();
830 mActiveSyncPort = le3.text(); 833 mActiveSyncPort = le3.text();
831 mActiveSyncIP = le2.text(); 834 mActiveSyncIP = le2.text();
832 return true; 835 return true;
833 } 836 }
834 return false; 837 return false;
835} 838}
836bool KSyncManager::edit_sync_options() 839bool KSyncManager::edit_sync_options()
837{ 840{
838 841
839 QDialog dia( mParent, "dia", true ); 842 QDialog dia( mParent, "dia", true );
840 dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice ); 843 dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice );
841 QButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia); 844 Q3ButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia);
842 QVBoxLayout lay ( &dia ); 845 Q3VBoxLayout lay ( &dia );
843 lay.setSpacing( 2 ); 846 lay.setSpacing( 2 );
844 lay.setMargin( 3 ); 847 lay.setMargin( 3 );
845 lay.addWidget(&gr); 848 lay.addWidget(&gr);
846 QRadioButton loc ( i18n("Take local entry on conflict"), &gr ); 849 QRadioButton loc ( i18n("Take local entry on conflict"), &gr );
847 QRadioButton rem ( i18n("Take remote entry on conflict"), &gr ); 850 QRadioButton rem ( i18n("Take remote entry on conflict"), &gr );
848 QRadioButton newest( i18n("Take newest entry on conflict"), &gr ); 851 QRadioButton newest( i18n("Take newest entry on conflict"), &gr );
849 QRadioButton ask( i18n("Ask for every entry on conflict"), &gr ); 852 QRadioButton ask( i18n("Ask for every entry on conflict"), &gr );
850 QRadioButton f_loc( i18n("Force: Take local entry always"), &gr ); 853 QRadioButton f_loc( i18n("Force: Take local entry always"), &gr );
851 QRadioButton f_rem( i18n("Force: Take remote entry always"), &gr ); 854 QRadioButton f_rem( i18n("Force: Take remote entry always"), &gr );
852 //QRadioButton both( i18n("Take both on conflict"), &gr ); 855 //QRadioButton both( i18n("Take both on conflict"), &gr );
853 QPushButton pb ( "OK", &dia); 856 QPushButton pb ( "OK", &dia);
854 lay.addWidget( &pb ); 857 lay.addWidget( &pb );
@@ -882,25 +885,25 @@ bool KSyncManager::edit_sync_options()
882 mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; 885 mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ;
883 return true; 886 return true;
884 } 887 }
885 return false; 888 return false;
886} 889}
887 890
888QString KSyncManager::getPassword( ) 891QString KSyncManager::getPassword( )
889{ 892{
890 QString retfile = ""; 893 QString retfile = "";
891 QDialog dia ( mParent, "input-dialog", true ); 894 QDialog dia ( mParent, "input-dialog", true );
892 QLineEdit lab ( &dia ); 895 QLineEdit lab ( &dia );
893 lab.setEchoMode( QLineEdit::Password ); 896 lab.setEchoMode( QLineEdit::Password );
894 QVBoxLayout lay( &dia ); 897 Q3VBoxLayout lay( &dia );
895 lay.setMargin(7); 898 lay.setMargin(7);
896 lay.setSpacing(7); 899 lay.setSpacing(7);
897 lay.addWidget( &lab); 900 lay.addWidget( &lab);
898 dia.setFixedSize( 230,50 ); 901 dia.setFixedSize( 230,50 );
899 dia.setCaption( i18n("Enter password") ); 902 dia.setCaption( i18n("Enter password") );
900 QPushButton pb ( "OK", &dia); 903 QPushButton pb ( "OK", &dia);
901 lay.addWidget( &pb ); 904 lay.addWidget( &pb );
902 connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); 905 connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) );
903 dia.show(); 906 dia.show();
904 int res = dia.exec(); 907 int res = dia.exec();
905 if ( res ) 908 if ( res )
906 retfile = lab.text(); 909 retfile = lab.text();
@@ -1325,63 +1328,63 @@ void KSyncManager::readFileFromSocket()
1325 if ( mWriteBackFile && syncOK ) { 1328 if ( mWriteBackFile && syncOK ) {
1326 mParent->topLevelWidget()->setCaption( i18n("Sending back file ...") ); 1329 mParent->topLevelWidget()->setCaption( i18n("Sending back file ...") );
1327 commandSocket->writeFile( fileName ); 1330 commandSocket->writeFile( fileName );
1328 } 1331 }
1329 else { 1332 else {
1330 commandSocket->sendStop(); 1333 commandSocket->sendStop();
1331 if ( syncOK ) 1334 if ( syncOK )
1332 mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); 1335 mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") );
1333 mPisyncFinished = true; 1336 mPisyncFinished = true;
1334 } 1337 }
1335} 1338}
1336 1339
1337KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : QServerSocket( port, backlog, parent, name ) 1340KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : Q3ServerSocket( port, backlog, parent, name )
1338{ 1341{
1339 mPendingConnect = 0; 1342 mPendingConnect = 0;
1340 mPassWord = pw; 1343 mPassWord = pw;
1341 mSocket = 0; 1344 mSocket = 0;
1342 mSyncActionDialog = 0; 1345 mSyncActionDialog = 0;
1343 blockRC = false; 1346 blockRC = false;
1344 mErrorMessage = 0; 1347 mErrorMessage = 0;
1345} 1348}
1346void KServerSocket::waitForSocketFinish() 1349void KServerSocket::waitForSocketFinish()
1347{ 1350{
1348 if ( mSocket ) { 1351 if ( mSocket ) {
1349 //qDebug("KSS:: waiting for finish operation"); 1352 //qDebug("KSS:: waiting for finish operation");
1350 QTimer::singleShot( 250, this , SLOT ( waitForSocketFinish())); 1353 QTimer::singleShot( 250, this , SLOT ( waitForSocketFinish()));
1351 return; 1354 return;
1352 } 1355 }
1353 mSocket = new QSocket( this ); 1356 mSocket = new Q3Socket( this );
1354 connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); 1357 connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) );
1355 connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); 1358 connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) );
1356 mSocket->setSocket( mPendingConnect ); 1359 mSocket->setSocket( mPendingConnect );
1357 mPendingConnect = 0; 1360 mPendingConnect = 0;
1358} 1361}
1359void KServerSocket::newConnection ( int socket ) 1362void KServerSocket::newConnection ( int socket )
1360{ 1363{
1361 // qDebug("KServerSocket:New connection %d ", socket); 1364 // qDebug("KServerSocket:New connection %d ", socket);
1362 if ( mPendingConnect ) { 1365 if ( mPendingConnect ) {
1363 qDebug("KSS::Error : new Connection"); 1366 qDebug("KSS::Error : new Connection");
1364 return; 1367 return;
1365 } 1368 }
1366 if ( mSocket ) { 1369 if ( mSocket ) {
1367 mPendingConnect = socket; 1370 mPendingConnect = socket;
1368 QTimer::singleShot( 250, this , SLOT ( waitForSocketFinish())); 1371 QTimer::singleShot( 250, this , SLOT ( waitForSocketFinish()));
1369 return; 1372 return;
1370 qDebug("KSS::newConnection Socket deleted! "); 1373 qDebug("KSS::newConnection Socket deleted! ");
1371 delete mSocket; 1374 delete mSocket;
1372 mSocket = 0; 1375 mSocket = 0;
1373 } 1376 }
1374 mPendingConnect = 0; 1377 mPendingConnect = 0;
1375 mSocket = new QSocket( this ); 1378 mSocket = new Q3Socket( this );
1376 connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); 1379 connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) );
1377 connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); 1380 connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) );
1378 mSocket->setSocket( socket ); 1381 mSocket->setSocket( socket );
1379} 1382}
1380 1383
1381void KServerSocket::discardClient() 1384void KServerSocket::discardClient()
1382{ 1385{
1383 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1386 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1384} 1387}
1385void KServerSocket::deleteSocket() 1388void KServerSocket::deleteSocket()
1386{ 1389{
1387 //qDebug("KSS::deleteSocket"); 1390 //qDebug("KSS::deleteSocket");
@@ -1453,47 +1456,47 @@ void KServerSocket::displayErrorMessage()
1453{ 1456{
1454 if ( mErrorMessage == 1 ) { 1457 if ( mErrorMessage == 1 ) {
1455 KMessageBox::error( 0, i18n("Got send file request\nwith invalid password"), i18n("Pi-Sync Error")); 1458 KMessageBox::error( 0, i18n("Got send file request\nwith invalid password"), i18n("Pi-Sync Error"));
1456 mErrorMessage = 0; 1459 mErrorMessage = 0;
1457 } 1460 }
1458 else if ( mErrorMessage == 2 ) { 1461 else if ( mErrorMessage == 2 ) {
1459 KMessageBox::error( 0, i18n("Got receive file request\nwith invalid password"), i18n("Pi-Sync Error")); 1462 KMessageBox::error( 0, i18n("Got receive file request\nwith invalid password"), i18n("Pi-Sync Error"));
1460 mErrorMessage = 0; 1463 mErrorMessage = 0;
1461 } 1464 }
1462} 1465}
1463void KServerSocket::error_connect( QString errmess ) 1466void KServerSocket::error_connect( QString errmess )
1464{ 1467{
1465 QTextStream os( mSocket ); 1468 Q3TextStream os( mSocket );
1466 os.setEncoding( QTextStream::Latin1 ); 1469 os.setEncoding( Q3TextStream::Latin1 );
1467 os << errmess ; 1470 os << errmess ;
1468 mSocket->close(); 1471 mSocket->close();
1469 if ( mSocket->state() == QSocket::Idle ) { 1472 if ( mSocket->state() == Q3Socket::Idle ) {
1470 QTimer::singleShot( 0, this , SLOT ( discardClient())); 1473 QTimer::singleShot( 0, this , SLOT ( discardClient()));
1471 } 1474 }
1472} 1475}
1473void KServerSocket::end_connect() 1476void KServerSocket::end_connect()
1474{ 1477{
1475 delete mSyncActionDialog; 1478 delete mSyncActionDialog;
1476 mSyncActionDialog = 0; 1479 mSyncActionDialog = 0;
1477} 1480}
1478void KServerSocket::send_file() 1481void KServerSocket::send_file()
1479{ 1482{
1480 //qDebug("MainWindow::sendFile(QSocket* s) "); 1483 //qDebug("MainWindow::sendFile(QSocket* s) ");
1481 if ( mSyncActionDialog ) 1484 if ( mSyncActionDialog )
1482 delete mSyncActionDialog; 1485 delete mSyncActionDialog;
1483 mSyncActionDialog = new QDialog ( 0, "input-dialog", true ); 1486 mSyncActionDialog = new QDialog ( 0, "input-dialog", true );
1484 mSyncActionDialog->setCaption(i18n("Received sync request")); 1487 mSyncActionDialog->setCaption(i18n("Received sync request"));
1485 QLabel* label = new QLabel( i18n("Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog."), mSyncActionDialog ); 1488 QLabel* label = new QLabel( i18n("Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog."), mSyncActionDialog );
1486 label->setAlignment ( Qt::AlignHCenter ); 1489 label->setAlignment ( Qt::AlignHCenter );
1487 QVBoxLayout* lay = new QVBoxLayout( mSyncActionDialog ); 1490 Q3VBoxLayout* lay = new Q3VBoxLayout( mSyncActionDialog );
1488 lay->addWidget( label); 1491 lay->addWidget( label);
1489 lay->setMargin(7); 1492 lay->setMargin(7);
1490 lay->setSpacing(7); 1493 lay->setSpacing(7);
1491 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 1494 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
1492 int secs = QDateTime::currentDateTime().secsTo( KSyncManager::mRequestedSyncEvent ); 1495 int secs = QDateTime::currentDateTime().secsTo( KSyncManager::mRequestedSyncEvent );
1493 //secs = 333; 1496 //secs = 333;
1494 if ( secs < 0 ) 1497 if ( secs < 0 )
1495 secs = secs * (-1); 1498 secs = secs * (-1);
1496 if ( secs > 30 ) 1499 if ( secs > 30 )
1497 //if ( true ) 1500 //if ( true )
1498 { 1501 {
1499 QString warning = i18n("Clock skew of\nsyncing devices\nis %1 seconds!").arg( secs ); 1502 QString warning = i18n("Clock skew of\nsyncing devices\nis %1 seconds!").arg( secs );
@@ -1527,45 +1530,45 @@ void KServerSocket::send_file()
1527 } else { 1530 } else {
1528 mSyncActionDialog->setFixedSize( 230, 120); 1531 mSyncActionDialog->setFixedSize( 230, 120);
1529 } 1532 }
1530 } else 1533 } else
1531 mSyncActionDialog->setFixedSize( 230, 120); 1534 mSyncActionDialog->setFixedSize( 230, 120);
1532 mSyncActionDialog->show(); 1535 mSyncActionDialog->show();
1533 mSyncActionDialog->raise(); 1536 mSyncActionDialog->raise();
1534 emit request_file(mResource); 1537 emit request_file(mResource);
1535 //emit request_file(); 1538 //emit request_file();
1536 qApp->processEvents(); 1539 qApp->processEvents();
1537 QString fileName = mFileName; 1540 QString fileName = mFileName;
1538 QFile file( fileName ); 1541 QFile file( fileName );
1539 if (!file.open( IO_ReadOnly ) ) { 1542 if (!file.open( QIODevice::ReadOnly ) ) {
1540 mErrorMessage = 0; 1543 mErrorMessage = 0;
1541 end_connect(); 1544 end_connect();
1542 error_connect("ERROR_FI\r\n\r\n"); 1545 error_connect("ERROR_FI\r\n\r\n");
1543 return ; 1546 return ;
1544 } 1547 }
1545 mSyncActionDialog->setCaption( i18n("Sending file...") ); 1548 mSyncActionDialog->setCaption( i18n("Sending file...") );
1546 QTextStream ts( &file ); 1549 Q3TextStream ts( &file );
1547 ts.setEncoding( QTextStream::Latin1 ); 1550 ts.setEncoding( Q3TextStream::Latin1 );
1548 1551
1549 QTextStream os( mSocket ); 1552 Q3TextStream os( mSocket );
1550 os.setEncoding( QTextStream::Latin1 ); 1553 os.setEncoding( Q3TextStream::Latin1 );
1551 while ( ! ts.atEnd() ) { 1554 while ( ! ts.atEnd() ) {
1552 os << ts.readLine() << "\r\n"; 1555 os << ts.readLine() << "\r\n";
1553 } 1556 }
1554 os << "\r\n"; 1557 os << "\r\n";
1555 //os << ts.read(); 1558 //os << ts.read();
1556 file.close(); 1559 file.close();
1557 mSyncActionDialog->setCaption( i18n("Waiting for synced file...") ); 1560 mSyncActionDialog->setCaption( i18n("Waiting for synced file...") );
1558 mSocket->close(); 1561 mSocket->close();
1559 if ( mSocket->state() == QSocket::Idle ) 1562 if ( mSocket->state() == Q3Socket::Idle )
1560 QTimer::singleShot( 10, this , SLOT ( discardClient())); 1563 QTimer::singleShot( 10, this , SLOT ( discardClient()));
1561} 1564}
1562void KServerSocket::get_file() 1565void KServerSocket::get_file()
1563{ 1566{
1564 mSyncActionDialog->setCaption( i18n("Receiving synced file...") ); 1567 mSyncActionDialog->setCaption( i18n("Receiving synced file...") );
1565 1568
1566 piTime.start(); 1569 piTime.start();
1567 piFileString = ""; 1570 piFileString = "";
1568 QTimer::singleShot( 1, this , SLOT (readBackFileFromSocket( ) )); 1571 QTimer::singleShot( 1, this , SLOT (readBackFileFromSocket( ) ));
1569} 1572}
1570 1573
1571 1574
@@ -1579,43 +1582,43 @@ void KServerSocket::readBackFileFromSocket()
1579 //qDebug("readline: %s ", line.latin1()); 1582 //qDebug("readline: %s ", line.latin1());
1580 mSyncActionDialog->setCaption( i18n("Received %1 bytes").arg( piFileString.length() ) ); 1583 mSyncActionDialog->setCaption( i18n("Received %1 bytes").arg( piFileString.length() ) );
1581 1584
1582 } 1585 }
1583 if ( piTime.elapsed () < 3000 ) { 1586 if ( piTime.elapsed () < 3000 ) {
1584 // wait for more 1587 // wait for more
1585 //qDebug("waitformore "); 1588 //qDebug("waitformore ");
1586 QTimer::singleShot( 100, this , SLOT (readBackFileFromSocket( ) )); 1589 QTimer::singleShot( 100, this , SLOT (readBackFileFromSocket( ) ));
1587 return; 1590 return;
1588 } 1591 }
1589 QString fileName = mFileName; 1592 QString fileName = mFileName;
1590 QFile file ( fileName ); 1593 QFile file ( fileName );
1591 if (!file.open( IO_WriteOnly ) ) { 1594 if (!file.open( QIODevice::WriteOnly ) ) {
1592 delete mSyncActionDialog; 1595 delete mSyncActionDialog;
1593 mSyncActionDialog = 0; 1596 mSyncActionDialog = 0;
1594 qDebug("KSS:Error open read back file "); 1597 qDebug("KSS:Error open read back file ");
1595 piFileString = ""; 1598 piFileString = "";
1596 emit file_received( false, mResource); 1599 emit file_received( false, mResource);
1597 emit file_received( false); 1600 emit file_received( false);
1598 blockRC = false; 1601 blockRC = false;
1599 return ; 1602 return ;
1600 1603
1601 } 1604 }
1602 1605
1603 // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); 1606 // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1));
1604 QTextStream ts ( &file ); 1607 Q3TextStream ts ( &file );
1605 ts.setEncoding( QTextStream::Latin1 ); 1608 ts.setEncoding( Q3TextStream::Latin1 );
1606 mSyncActionDialog->setCaption( i18n("Writing file to disk...") ); 1609 mSyncActionDialog->setCaption( i18n("Writing file to disk...") );
1607 ts << piFileString; 1610 ts << piFileString;
1608 mSocket->close(); 1611 mSocket->close();
1609 if ( mSocket->state() == QSocket::Idle ) 1612 if ( mSocket->state() == Q3Socket::Idle )
1610 QTimer::singleShot( 10, this , SLOT ( discardClient())); 1613 QTimer::singleShot( 10, this , SLOT ( discardClient()));
1611 file.close(); 1614 file.close();
1612 piFileString = ""; 1615 piFileString = "";
1613 emit file_received( true, mResource ); 1616 emit file_received( true, mResource );
1614 emit file_received( true); 1617 emit file_received( true);
1615 delete mSyncActionDialog; 1618 delete mSyncActionDialog;
1616 mSyncActionDialog = 0; 1619 mSyncActionDialog = 0;
1617 blockRC = false; 1620 blockRC = false;
1618 1621
1619} 1622}
1620 1623
1621KCommandSocket::KCommandSocket ( QString remres, QString password, Q_UINT16 port, QString host, QObject * parent, QWidget * cap, const char * name ): QObject( parent, name ) 1624KCommandSocket::KCommandSocket ( QString remres, QString password, Q_UINT16 port, QString host, QObject * parent, QWidget * cap, const char * name ): QObject( parent, name )
@@ -1639,35 +1642,35 @@ KCommandSocket::KCommandSocket ( QString remres, QString password, Q_UINT16 port
1639 connect( &mConnectProgress, SIGNAL ( cancelled () ), this, SLOT ( deleteSocket() ) ); 1642 connect( &mConnectProgress, SIGNAL ( cancelled () ), this, SLOT ( deleteSocket() ) );
1640 mConnectCount = -1; 1643 mConnectCount = -1;
1641} 1644}
1642void KCommandSocket::sendFileRequest() 1645void KCommandSocket::sendFileRequest()
1643{ 1646{
1644 if ( tlw ) 1647 if ( tlw )
1645 tlw->setCaption( i18n("Connected! Sending request for remote file ...") ); 1648 tlw->setCaption( i18n("Connected! Sending request for remote file ...") );
1646 mConnectProgress.hide(); 1649 mConnectProgress.hide();
1647 mConnectCount = 300;mConnectMax = 300; 1650 mConnectCount = 300;mConnectMax = 300;
1648 mConnectProgress.setCaption( i18n("Pi-Sync: Connected!") ); 1651 mConnectProgress.setCaption( i18n("Pi-Sync: Connected!") );
1649 mConnectProgress.setLabelText( i18n("Waiting for remote file...") ); 1652 mConnectProgress.setLabelText( i18n("Waiting for remote file...") );
1650 mTimerSocket->start( 100, true ); 1653 mTimerSocket->start( 100, true );
1651 QTextStream os( mSocket ); 1654 Q3TextStream os( mSocket );
1652 os.setEncoding( QTextStream::Latin1 ); 1655 os.setEncoding( Q3TextStream::Latin1 );
1653 1656
1654 QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); 1657 QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate );
1655 os << "GET " << mPassWord << curDt << " " << mRemoteResource << "\r\n\r\n"; 1658 os << "GET " << mPassWord << curDt << " " << mRemoteResource << "\r\n\r\n";
1656} 1659}
1657 1660
1658void KCommandSocket::readFile( QString fn ) 1661void KCommandSocket::readFile( QString fn )
1659{ 1662{
1660 if ( !mSocket ) { 1663 if ( !mSocket ) {
1661 mSocket = new QSocket( this ); 1664 mSocket = new Q3Socket( this );
1662 //qDebug("KCS: read file - new socket"); 1665 //qDebug("KCS: read file - new socket");
1663 connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) ); 1666 connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) );
1664 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1667 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1665 connect( mSocket, SIGNAL(connected ()), this, SLOT(sendFileRequest() )); 1668 connect( mSocket, SIGNAL(connected ()), this, SLOT(sendFileRequest() ));
1666 } 1669 }
1667 mFileString = ""; 1670 mFileString = "";
1668 mFileName = fn; 1671 mFileName = fn;
1669 mFirst = true; 1672 mFirst = true;
1670 if ( tlw ) 1673 if ( tlw )
1671 tlw->setCaption( i18n("Trying to connect to remote...") ); 1674 tlw->setCaption( i18n("Trying to connect to remote...") );
1672 mConnectCount = 30;mConnectMax = 30; 1675 mConnectCount = 30;mConnectMax = 30;
1673 mTimerSocket->start( 1000, true ); 1676 mTimerSocket->start( 1000, true );
@@ -1687,92 +1690,92 @@ void KCommandSocket::updateConnectDialog()
1687 mConnectProgress.raise(); 1690 mConnectProgress.raise();
1688 mConnectProgress.setProgress( (mConnectMax - mConnectCount)%30 ); 1691 mConnectProgress.setProgress( (mConnectMax - mConnectCount)%30 );
1689 --mConnectCount; 1692 --mConnectCount;
1690 if ( mConnectCount > 0 ) 1693 if ( mConnectCount > 0 )
1691 mTimerSocket->start( 1000, true ); 1694 mTimerSocket->start( 1000, true );
1692 else 1695 else
1693 deleteSocket(); 1696 deleteSocket();
1694 1697
1695} 1698}
1696void KCommandSocket::writeFile( QString fileName ) 1699void KCommandSocket::writeFile( QString fileName )
1697{ 1700{
1698 if ( !mSocket ) { 1701 if ( !mSocket ) {
1699 mSocket = new QSocket( this ); 1702 mSocket = new Q3Socket( this );
1700 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1703 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1701 connect( mSocket, SIGNAL(connected ()), this, SLOT(writeFileToSocket()) ); 1704 connect( mSocket, SIGNAL(connected ()), this, SLOT(writeFileToSocket()) );
1702 } 1705 }
1703 mFileName = fileName ; 1706 mFileName = fileName ;
1704 mConnectCount = 30;mConnectMax = 30; 1707 mConnectCount = 30;mConnectMax = 30;
1705 mTimerSocket->start( 1000, true ); 1708 mTimerSocket->start( 1000, true );
1706 mSocket->connectToHost( mHost, mPort ); 1709 mSocket->connectToHost( mHost, mPort );
1707} 1710}
1708void KCommandSocket::writeFileToSocket() 1711void KCommandSocket::writeFileToSocket()
1709{ 1712{
1710 mTimerSocket->stop(); 1713 mTimerSocket->stop();
1711 QFile file2( mFileName ); 1714 QFile file2( mFileName );
1712 if (!file2.open( IO_ReadOnly ) ) { 1715 if (!file2.open( QIODevice::ReadOnly ) ) {
1713 mConnectProgress.hide(); 1716 mConnectProgress.hide();
1714 mConnectCount = -1; 1717 mConnectCount = -1;
1715 mRetVal= errorW; 1718 mRetVal= errorW;
1716 mSocket->close(); 1719 mSocket->close();
1717 if ( mSocket->state() == QSocket::Idle ) 1720 if ( mSocket->state() == Q3Socket::Idle )
1718 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1721 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1719 return ; 1722 return ;
1720 } 1723 }
1721 mConnectProgress.setTotalSteps ( file2.size() ); 1724 mConnectProgress.setTotalSteps ( file2.size() );
1722 mConnectProgress.show(); 1725 mConnectProgress.show();
1723 int count = 0; 1726 int count = 0;
1724 mConnectProgress.setLabelText( i18n("Sending back synced file...") ); 1727 mConnectProgress.setLabelText( i18n("Sending back synced file...") );
1725 mConnectProgress.setProgress( count ); 1728 mConnectProgress.setProgress( count );
1726 mConnectProgress.blockSignals( true ); 1729 mConnectProgress.blockSignals( true );
1727 QTextStream ts2( &file2 ); 1730 Q3TextStream ts2( &file2 );
1728 ts2.setEncoding( QTextStream::Latin1 ); 1731 ts2.setEncoding( Q3TextStream::Latin1 );
1729 QTextStream os2( mSocket ); 1732 Q3TextStream os2( mSocket );
1730 os2.setEncoding( QTextStream::Latin1 ); 1733 os2.setEncoding( Q3TextStream::Latin1 );
1731 os2 << "PUT " << mPassWord << " " << mRemoteResource << "\r\n\r\n";; 1734 os2 << "PUT " << mPassWord << " " << mRemoteResource << "\r\n\r\n";;
1732 int byteCount = 0; 1735 int byteCount = 0;
1733 int byteMax = file2.size()/53; 1736 int byteMax = file2.size()/53;
1734 while ( ! ts2.atEnd() ) { 1737 while ( ! ts2.atEnd() ) {
1735 qApp->processEvents(); 1738 qApp->processEvents();
1736 if ( byteCount > byteMax ) { 1739 if ( byteCount > byteMax ) {
1737 byteCount = 0; 1740 byteCount = 0;
1738 mConnectProgress.setProgress( count ); 1741 mConnectProgress.setProgress( count );
1739 } 1742 }
1740 QString temp = ts2.readLine(); 1743 QString temp = ts2.readLine();
1741 count += temp.length(); 1744 count += temp.length();
1742 byteCount += temp.length(); 1745 byteCount += temp.length();
1743 os2 << temp << "\r\n"; 1746 os2 << temp << "\r\n";
1744 } 1747 }
1745 file2.close(); 1748 file2.close();
1746 mConnectProgress.hide(); 1749 mConnectProgress.hide();
1747 mConnectCount = -1; 1750 mConnectCount = -1;
1748 os2 << "\r\n"; 1751 os2 << "\r\n";
1749 mRetVal= successW; 1752 mRetVal= successW;
1750 mSocket->close(); 1753 mSocket->close();
1751 if ( mSocket->state() == QSocket::Idle ) 1754 if ( mSocket->state() == Q3Socket::Idle )
1752 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1755 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1753 mConnectProgress.blockSignals( false ); 1756 mConnectProgress.blockSignals( false );
1754} 1757}
1755void KCommandSocket::sendStop() 1758void KCommandSocket::sendStop()
1756{ 1759{
1757 if ( !mSocket ) { 1760 if ( !mSocket ) {
1758 mSocket = new QSocket( this ); 1761 mSocket = new Q3Socket( this );
1759 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1762 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1760 } 1763 }
1761 mSocket->connectToHost( mHost, mPort ); 1764 mSocket->connectToHost( mHost, mPort );
1762 QTextStream os2( mSocket ); 1765 Q3TextStream os2( mSocket );
1763 os2.setEncoding( QTextStream::Latin1 ); 1766 os2.setEncoding( Q3TextStream::Latin1 );
1764 os2 << "STOP\r\n\r\n"; 1767 os2 << "STOP\r\n\r\n";
1765 mSocket->close(); 1768 mSocket->close();
1766 if ( mSocket->state() == QSocket::Idle ) 1769 if ( mSocket->state() == Q3Socket::Idle )
1767 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1770 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1768} 1771}
1769 1772
1770void KCommandSocket::startReadFileFromSocket() 1773void KCommandSocket::startReadFileFromSocket()
1771{ 1774{
1772 if ( ! mFirst ) 1775 if ( ! mFirst )
1773 return; 1776 return;
1774 mConnectProgress.setLabelText( i18n("Receiving file from remote...") ); 1777 mConnectProgress.setLabelText( i18n("Receiving file from remote...") );
1775 mFirst = false; 1778 mFirst = false;
1776 mFileString = ""; 1779 mFileString = "";
1777 mTime.start(); 1780 mTime.start();
1778 mFirstLine = true; 1781 mFirstLine = true;
@@ -1820,43 +1823,43 @@ void KCommandSocket::readFileFromSocket()
1820 } 1823 }
1821 if ( mTime.elapsed () < 3000 ) { 1824 if ( mTime.elapsed () < 3000 ) {
1822 // wait for more 1825 // wait for more
1823 //qDebug("waitformore "); 1826 //qDebug("waitformore ");
1824 QTimer::singleShot( 100, this , SLOT (readFileFromSocket( ) )); 1827 QTimer::singleShot( 100, this , SLOT (readFileFromSocket( ) ));
1825 return; 1828 return;
1826 } 1829 }
1827 mTimerSocket->stop(); 1830 mTimerSocket->stop();
1828 mConnectCount = -1; 1831 mConnectCount = -1;
1829 mConnectProgress.hide(); 1832 mConnectProgress.hide();
1830 QString fileName = mFileName; 1833 QString fileName = mFileName;
1831 QFile file ( fileName ); 1834 QFile file ( fileName );
1832 if (!file.open( IO_WriteOnly ) ) { 1835 if (!file.open( QIODevice::WriteOnly ) ) {
1833 mFileString = ""; 1836 mFileString = "";
1834 mRetVal = errorR; 1837 mRetVal = errorR;
1835 qDebug("KSS:Error open temp sync file for writing: %s",fileName.latin1() ); 1838 qDebug("KSS:Error open temp sync file for writing: %s",fileName.latin1() );
1836 deleteSocket(); 1839 deleteSocket();
1837 return ; 1840 return ;
1838 1841
1839 } 1842 }
1840 // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); 1843 // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1));
1841 QTextStream ts ( &file ); 1844 Q3TextStream ts ( &file );
1842 ts.setEncoding( QTextStream::Latin1 ); 1845 ts.setEncoding( Q3TextStream::Latin1 );
1843 ts << mFileString; 1846 ts << mFileString;
1844 file.close(); 1847 file.close();
1845 mFileString = ""; 1848 mFileString = "";
1846 mRetVal = successR; 1849 mRetVal = successR;
1847 mSocket->close(); 1850 mSocket->close();
1848 // if state is not idle, deleteSocket(); is called via 1851 // if state is not idle, deleteSocket(); is called via
1849 // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1852 // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1850 if ( mSocket->state() == QSocket::Idle ) 1853 if ( mSocket->state() == Q3Socket::Idle )
1851 deleteSocket(); 1854 deleteSocket();
1852} 1855}
1853 1856
1854void KCommandSocket::deleteSocket() 1857void KCommandSocket::deleteSocket()
1855{ 1858{
1856 //qDebug("KCommandSocket::deleteSocket() "); 1859 //qDebug("KCommandSocket::deleteSocket() ");
1857 mConnectProgress.hide(); 1860 mConnectProgress.hide();
1858 1861
1859 if ( mConnectCount >= 0 ) { 1862 if ( mConnectCount >= 0 ) {
1860 mTimerSocket->stop(); 1863 mTimerSocket->stop();
1861 mRetVal = errorTO; 1864 mRetVal = errorTO;
1862 qDebug("KCS::Connection to remote host timed out"); 1865 qDebug("KCS::Connection to remote host timed out");
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 71d17e9..32c6557 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -15,42 +15,44 @@
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 19
20 $Id$ 20 $Id$
21*/ 21*/
22#ifndef _KSYNCMANAGER_H 22#ifndef _KSYNCMANAGER_H
23#define _KSYNCMANAGER_H 23#define _KSYNCMANAGER_H
24 24
25#include <qobject.h> 25#include <qobject.h>
26#include <qstring.h> 26#include <qstring.h>
27#include <qsocket.h> 27#include <q3socket.h>
28#include <qdatetime.h> 28#include <qdatetime.h>
29#include <qserversocket.h> 29#include <q3serversocket.h>
30#include <qtextstream.h> 30#include <q3textstream.h>
31#include <qregexp.h> 31#include <qregexp.h>
32#include <qprogressdialog.h> 32#include <q3progressdialog.h>
33//Added by qt3to4:
34#include <Q3PopupMenu>
33#include <kdialog.h> 35#include <kdialog.h>
34 36
35class QPopupMenu; 37class Q3PopupMenu;
36class KSyncProfile; 38class KSyncProfile;
37class KPimPrefs; 39class KPimPrefs;
38class QWidget; 40class QWidget;
39class KSyncManager; 41class KSyncManager;
40class KSyncInterface; 42class KSyncInterface;
41class QProgressBar; 43class Q3ProgressBar;
42 44
43 45
44class KServerSocket : public QServerSocket 46class KServerSocket : public Q3ServerSocket
45{ 47{
46 Q_OBJECT 48 Q_OBJECT
47 49
48 public: 50 public:
49 KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ); 51 KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 );
50 52
51 void newConnection ( int socket ) ; 53 void newConnection ( int socket ) ;
52 void setFileName( QString fn ) {mFileName = fn;}; 54 void setFileName( QString fn ) {mFileName = fn;};
53 signals: 55 signals:
54 void file_received( bool ); 56 void file_received( bool );
55 void request_file(); 57 void request_file();
56 void file_received( bool, const QString &); 58 void file_received( bool, const QString &);
@@ -65,25 +67,25 @@ class KServerSocket : public QServerSocket
65 void displayErrorMessage(); 67 void displayErrorMessage();
66 void readBackFileFromSocket(); 68 void readBackFileFromSocket();
67 private : 69 private :
68 int mPendingConnect; 70 int mPendingConnect;
69 QString mResource; 71 QString mResource;
70 int mErrorMessage; 72 int mErrorMessage;
71 bool blockRC; 73 bool blockRC;
72 void send_file(); 74 void send_file();
73 void get_file(); 75 void get_file();
74 void end_connect(); 76 void end_connect();
75 void error_connect( QString ); 77 void error_connect( QString );
76 QDialog* mSyncActionDialog; 78 QDialog* mSyncActionDialog;
77 QSocket* mSocket; 79 Q3Socket* mSocket;
78 QString mPassWord; 80 QString mPassWord;
79 QString mFileName; 81 QString mFileName;
80 QTime piTime; 82 QTime piTime;
81 QString piFileString; 83 QString piFileString;
82}; 84};
83 85
84class KCommandSocket : public QObject 86class KCommandSocket : public QObject
85{ 87{
86 Q_OBJECT 88 Q_OBJECT
87 public: 89 public:
88 enum state { successR, errorR, successW, errorW, errorTO, errorPW, errorCA, errorFI, errorUN, errorED,quiet }; 90 enum state { successR, errorR, successW, errorW, errorTO, errorPW, errorCA, errorFI, errorUN, errorED,quiet };
89 KCommandSocket (QString remoteResource, QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 ); 91 KCommandSocket (QString remoteResource, QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 );
@@ -99,49 +101,49 @@ class KCommandSocket : public QObject
99 void commandFinished( KCommandSocket*, int ); 101 void commandFinished( KCommandSocket*, int );
100 private slots: 102 private slots:
101 void startReadFileFromSocket(); 103 void startReadFileFromSocket();
102 void readFileFromSocket(); 104 void readFileFromSocket();
103 void deleteSocket(); 105 void deleteSocket();
104 void writeFileToSocket(); 106 void writeFileToSocket();
105 private : 107 private :
106 QString mRemoteResource; 108 QString mRemoteResource;
107 int mConnectCount; 109 int mConnectCount;
108 int mConnectMax; 110 int mConnectMax;
109 KProgressDialog mConnectProgress; 111 KProgressDialog mConnectProgress;
110 QWidget* tlw; 112 QWidget* tlw;
111 QSocket* mSocket; 113 Q3Socket* mSocket;
112 QString mPassWord; 114 QString mPassWord;
113 Q_UINT16 mPort; 115 Q_UINT16 mPort;
114 QString mHost; 116 QString mHost;
115 QString mFileName; 117 QString mFileName;
116 QTimer* mTimerSocket; 118 QTimer* mTimerSocket;
117 int mRetVal; 119 int mRetVal;
118 QTime mTime; 120 QTime mTime;
119 QString mFileString; 121 QString mFileString;
120 bool mFirst; 122 bool mFirst;
121 bool mFirstLine; 123 bool mFirstLine;
122}; 124};
123 125
124 126
125class KSyncManager : public QObject 127class KSyncManager : public QObject
126{ 128{
127 Q_OBJECT 129 Q_OBJECT
128 130
129 public: 131 public:
130 enum TargetApp { 132 enum TargetApp {
131 KOPI = 0, 133 KOPI = 0,
132 KAPI = 1, 134 KAPI = 1,
133 PWMPI = 2 }; 135 PWMPI = 2 };
134 136
135 KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); 137 KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, Q3PopupMenu* syncmenu);
136 ~KSyncManager() ; 138 ~KSyncManager() ;
137 139
138 void multiSync( bool askforPrefs ); 140 void multiSync( bool askforPrefs );
139 bool blockSave() { return mBlockSaveFlag; } 141 bool blockSave() { return mBlockSaveFlag; }
140 void setBlockSave(bool sa) { mBlockSaveFlag = sa; } 142 void setBlockSave(bool sa) { mBlockSaveFlag = sa; }
141 void setDefaultFileName( QString s) ; 143 void setDefaultFileName( QString s) ;
142 QString defaultFileName() { return mDefFileName ;} 144 QString defaultFileName() { return mDefFileName ;}
143 QString syncFileName(); 145 QString syncFileName();
144 void enableQuick( bool ask = true); 146 void enableQuick( bool ask = true);
145 147
146 bool syncWithDesktop () { return mSyncWithDesktop;} 148 bool syncWithDesktop () { return mSyncWithDesktop;}
147 QString getCurrentSyncDevice() { return mCurrentSyncDevice; } 149 QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
@@ -210,26 +212,26 @@ class KSyncManager : public QObject
210 bool edit_sync_options(); 212 bool edit_sync_options();
211 bool edit_pisync_options(); 213 bool edit_pisync_options();
212 int ringSync(); 214 int ringSync();
213 QString getPassword( ); 215 QString getPassword( );
214 bool mPisyncFinished; 216 bool mPisyncFinished;
215 QStringList mSpecificResources; 217 QStringList mSpecificResources;
216 QString mCurrentResourceLocal; 218 QString mCurrentResourceLocal;
217 QString mCurrentResourceRemote; 219 QString mCurrentResourceRemote;
218 bool mBlockSaveFlag; 220 bool mBlockSaveFlag;
219 QWidget* mParent; 221 QWidget* mParent;
220 KSyncInterface* mImplementation; 222 KSyncInterface* mImplementation;
221 TargetApp mTargetApp; 223 TargetApp mTargetApp;
222 QPopupMenu* mSyncMenu; 224 Q3PopupMenu* mSyncMenu;
223 QProgressBar* bar; 225 Q3ProgressBar* bar;
224 bool mSyncWithDesktop; 226 bool mSyncWithDesktop;
225 227
226private slots: 228private slots:
227 void displayErrorPort(); 229 void displayErrorPort();
228 void confSync(); 230 void confSync();
229 231
230 232
231}; 233};
232 234
233 235
234class KSyncInterface 236class KSyncInterface
235{ 237{
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 2b87298..fd5bbca 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -14,46 +14,50 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <q3groupbox.h>
27#include <qbuttongroup.h> 27#include <q3buttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qdir.h> 32#include <qdir.h>
33#include <qtextstream.h> 33#include <q3textstream.h>
34#include <qcombobox.h> 34#include <qcombobox.h>
35#include <qvbox.h> 35#include <q3vbox.h>
36#include <qhbox.h> 36#include <q3hbox.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <q3strlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44#include <qlayout.h> 44#include <qlayout.h>
45#include <qscrollview.h> 45#include <q3scrollview.h>
46#include <qvgroupbox.h> 46#include <q3vgroupbox.h>
47#include <qhgroupbox.h> 47#include <q3hgroupbox.h>
48//Added by qt3to4:
49#include <Q3HBoxLayout>
50#include <Q3GridLayout>
51#include <Q3Frame>
48 52
49#include <kcolorbutton.h> 53#include <kcolorbutton.h>
50#include <kdebug.h> 54#include <kdebug.h>
51#include <klocale.h> 55#include <klocale.h>
52#include <kglobal.h> 56#include <kglobal.h>
53#include <kfontdialog.h> 57#include <kfontdialog.h>
54#include <kmessagebox.h> 58#include <kmessagebox.h>
55#include <kcolordialog.h> 59#include <kcolordialog.h>
56#include <kiconloader.h> 60#include <kiconloader.h>
57#include <kemailsettings.h> 61#include <kemailsettings.h>
58#include <kstandarddirs.h> 62#include <kstandarddirs.h>
59#include <kfiledialog.h> 63#include <kfiledialog.h>
@@ -80,314 +84,314 @@ KSyncPrefsDialog::KSyncPrefsDialog(QWidget *parent, char *name, bool modal) :
80 setupSyncAlgTab(); 84 setupSyncAlgTab();
81} 85}
82 86
83 87
84KSyncPrefsDialog::~KSyncPrefsDialog() 88KSyncPrefsDialog::~KSyncPrefsDialog()
85{ 89{
86} 90}
87 91
88void KSyncPrefsDialog::setupSyncAlgTab() 92void KSyncPrefsDialog::setupSyncAlgTab()
89{ 93{
90 QLabel * lab; 94 QLabel * lab;
91 //QFrame *page = addPage(i18n("Sync Prefs"),0,0); 95 //QFrame *page = addPage(i18n("Sync Prefs"),0,0);
92 QVBox * mainbox = new QVBox( this ); 96 Q3VBox * mainbox = new Q3VBox( this );
93 QScrollView* sv = new QScrollView( mainbox ); 97 Q3ScrollView* sv = new Q3ScrollView( mainbox );
94 QHBoxLayout * lay = new QHBoxLayout( this ); 98 Q3HBoxLayout * lay = new Q3HBoxLayout( this );
95 lay->addWidget( mainbox ); 99 lay->addWidget( mainbox );
96 QHBox * b_box = new QHBox( mainbox ); 100 Q3HBox * b_box = new Q3HBox( mainbox );
97 101
98 QPushButton* button = new QPushButton( i18n("Ok"), b_box ); 102 QPushButton* button = new QPushButton( i18n("Ok"), b_box );
99 connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) ); 103 connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) );
100 button = new QPushButton( i18n("Cancel"), b_box ); 104 button = new QPushButton( i18n("Cancel"), b_box );
101 connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) ); 105 connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) );
102 //QBoxLayout * sl = new QVBoxLayout(this ); 106 //QBoxLayout * sl = new QVBoxLayout(this );
103 //sl->addWidget ( sv ); 107 //sl->addWidget ( sv );
104 sv->setResizePolicy ( QScrollView::AutoOneFit ); 108 sv->setResizePolicy ( Q3ScrollView::AutoOneFit );
105 QFrame *topFrame = new QFrame ( sv ); 109 Q3Frame *topFrame = new Q3Frame ( sv );
106 sv->addChild( topFrame ); 110 sv->addChild( topFrame );
107 mSetupSyncAlgTab = topFrame; 111 mSetupSyncAlgTab = topFrame;
108 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 112 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2);
109 topLayout->setSpacing(spacingHint()); 113 topLayout->setSpacing(spacingHint());
110 topLayout->setMargin(marginHint()); 114 topLayout->setMargin(marginHint());
111 115
112 //lab = new QLabel(i18n("Sync settings not yet implemented. DO NOT USE!"), topFrame); 116 //lab = new QLabel(i18n("Sync settings not yet implemented. DO NOT USE!"), topFrame);
113 int iii = 0; 117 int iii = 0;
114 //topLayout->addMultiCellWidget(lab , iii,iii,0,1); 118 //topLayout->addMultiCellWidget(lab , iii,iii,0,1);
115 //++iii; 119 //++iii;
116 120
117 mMyMachineName = new QLineEdit(topFrame); 121 mMyMachineName = new QLineEdit(topFrame);
118 lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame); 122 lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame);
119 topLayout->addWidget(lab ,iii,0); 123 topLayout->addWidget(lab ,iii,0);
120 topLayout->addWidget(mMyMachineName,iii,1); 124 topLayout->addWidget(mMyMachineName,iii,1);
121 ++iii; 125 ++iii;
122 126
123 QHBox* buttonbox = new QHBox( topFrame); 127 Q3HBox* buttonbox = new Q3HBox( topFrame);
124 topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1); 128 topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1);
125 ++iii; 129 ++iii;
126 button = new QPushButton( i18n("New profile"), buttonbox ); 130 button = new QPushButton( i18n("New profile"), buttonbox );
127 connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) ); 131 connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) );
128 132
129 button = new QPushButton( i18n("Clone profile"), buttonbox ); 133 button = new QPushButton( i18n("Clone profile"), buttonbox );
130 connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) ); 134 connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) );
131 135
132 button = new QPushButton( i18n("Delete profile"), buttonbox ); 136 button = new QPushButton( i18n("Delete profile"), buttonbox );
133 connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) ); 137 connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) );
134 138
135 mProfileBox = new QComboBox(topFrame); 139 mProfileBox = new QComboBox(topFrame);
136 mProfileBox->setEditable ( true ); 140 mProfileBox->setEditable ( true );
137 mProfileBox->setInsertionPolicy(QComboBox::NoInsertion); 141 mProfileBox->setInsertionPolicy(QComboBox::NoInsertion);
138 connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) ); 142 connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) );
139 connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) ); 143 connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) );
140 144
141 lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame); 145 lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame);
142 topLayout->addWidget(lab ,iii,0); 146 topLayout->addWidget(lab ,iii,0);
143 topLayout->addWidget(mProfileBox, iii,1); 147 topLayout->addWidget(mProfileBox, iii,1);
144 ++iii; 148 ++iii;
145 149
146 150
147 151
148 QHGroupBox *iims = new QHGroupBox( i18n("Multiple Sync options"), topFrame); 152 Q3HGroupBox *iims = new Q3HGroupBox( i18n("Multiple Sync options"), topFrame);
149 new QLabel( i18n("Include in multiple "), iims ); 153 new QLabel( i18n("Include in multiple "), iims );
150 mIncludeInRing = new QCheckBox( i18n("calendar "), iims ); 154 mIncludeInRing = new QCheckBox( i18n("calendar "), iims );
151 mIncludeInRingAB = new QCheckBox( i18n("addressbook "), iims ); 155 mIncludeInRingAB = new QCheckBox( i18n("addressbook "), iims );
152 mIncludeInRingPWM = new QCheckBox( i18n("pwmanager"), iims ); 156 mIncludeInRingPWM = new QCheckBox( i18n("pwmanager"), iims );
153 new QLabel( i18n(" sync"), iims ); 157 new QLabel( i18n(" sync"), iims );
154 topLayout->addMultiCellWidget(iims, iii,iii,0,1); 158 topLayout->addMultiCellWidget(iims, iii,iii,0,1);
155 ++iii; 159 ++iii;
156 QVGroupBox* gb0 = new QVGroupBox( i18n("Sync algo options"), topFrame); 160 Q3VGroupBox* gb0 = new Q3VGroupBox( i18n("Sync algo options"), topFrame);
157 topLayout->addMultiCellWidget(gb0, iii,iii,0,1); 161 topLayout->addMultiCellWidget(gb0, iii,iii,0,1);
158 ++iii; 162 ++iii;
159 QButtonGroup* gr; 163 Q3ButtonGroup* gr;
160 { 164 {
161 QVGroupBox* topFrame = gb0; 165 Q3VGroupBox* topFrame = gb0;
162 166
163 167
164 168
165 mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); 169 mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame );
166 //topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); 170 //topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1);
167 //++iii; 171 //++iii;
168 gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); 172 gr = new Q3ButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame);
169 //topLayout->addMultiCellWidget(gr, iii,iii,0,1); 173 //topLayout->addMultiCellWidget(gr, iii,iii,0,1);
170 //++iii; 174 //++iii;
171 loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); 175 loc = new QRadioButton ( i18n("Take local entry on conflict"), gr );
172 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); 176 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr );
173 newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); 177 newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr );
174 ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); 178 ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr );
175 f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); 179 f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr );
176 f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); 180 f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr );
177 // both = new QRadioButton ( i18n("Take both on conflict"), gr ); 181 // both = new QRadioButton ( i18n("Take both on conflict"), gr );
178 182
179 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); 183 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame );
180 //topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); 184 //topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1);
181 //++iii; 185 //++iii;
182 186
183#if 0 187#if 0
184 QHGroupBox* gb51 = new QHGroupBox( i18n("Local resources to sync with:"), topFrame); 188 Q3HGroupBox* gb51 = new Q3HGroupBox( i18n("Local resources to sync with:"), topFrame);
185 { 189 {
186 QVBox * fibo2 = new QVBox ( gb51 ); 190 Q3VBox * fibo2 = new Q3VBox ( gb51 );
187 new QLabel ( i18n("Calendar resources:"), fibo2 ); 191 new QLabel ( i18n("Calendar resources:"), fibo2 );
188 //mFilterInCal = new QComboBox( fibo2 ); 192 //mFilterInCal = new QComboBox( fibo2 );
189 fibo2 = new QVBox ( gb51 ); 193 fibo2 = new Q3VBox ( gb51 );
190 new QLabel ( i18n("Addressbook resources:"), fibo2 ); 194 new QLabel ( i18n("Addressbook resources:"), fibo2 );
191 //mFilterInAB = new QComboBox( fibo2 ); 195 //mFilterInAB = new QComboBox( fibo2 );
192 } 196 }
193#endif 197#endif
194 QHGroupBox* gb5 = new QHGroupBox( i18n("Apply filter when adding data to local:"), topFrame); 198 Q3HGroupBox* gb5 = new Q3HGroupBox( i18n("Apply filter when adding data to local:"), topFrame);
195 QVBox * fibo2 = new QVBox ( gb5 ); 199 Q3VBox * fibo2 = new Q3VBox ( gb5 );
196 new QLabel ( i18n("Incoming calendar filter:"), fibo2 ); 200 new QLabel ( i18n("Incoming calendar filter:"), fibo2 );
197 mFilterInCal = new QComboBox( fibo2 ); 201 mFilterInCal = new QComboBox( fibo2 );
198 fibo2 = new QVBox ( gb5 ); 202 fibo2 = new Q3VBox ( gb5 );
199 new QLabel ( i18n("Incoming addressbook filter:"), fibo2 ); 203 new QLabel ( i18n("Incoming addressbook filter:"), fibo2 );
200 mFilterInAB = new QComboBox( fibo2 ); 204 mFilterInAB = new QComboBox( fibo2 );
201 205
202 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); 206 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame );
203 // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); 207 // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1);
204 // ++iii; 208 // ++iii;
205 209
206 QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame); 210 Q3VGroupBox* gb2 = new Q3VGroupBox( i18n("Write back options"), topFrame);
207 //topLayout->addMultiCellWidget(gb2, iii,iii,0,1); 211 //topLayout->addMultiCellWidget(gb2, iii,iii,0,1);
208 //++iii; 212 //++iii;
209 { 213 {
210 QVGroupBox*topFrame = gb2; 214 Q3VGroupBox*topFrame = gb2;
211 mWriteBackExisting= new QCheckBox( i18n("Write back (on remote) existing entries only"), topFrame ); 215 mWriteBackExisting= new QCheckBox( i18n("Write back (on remote) existing entries only"), topFrame );
212 QHGroupBox* gb4 = new QHGroupBox( i18n("Apply filter when adding data to remote:"), topFrame); 216 Q3HGroupBox* gb4 = new Q3HGroupBox( i18n("Apply filter when adding data to remote:"), topFrame);
213 QVBox * fibo = new QVBox ( gb4 ); 217 Q3VBox * fibo = new Q3VBox ( gb4 );
214 new QLabel ( i18n("Outgoing calendar filter:"), fibo ); 218 new QLabel ( i18n("Outgoing calendar filter:"), fibo );
215 mFilterOutCal = new QComboBox( fibo ); 219 mFilterOutCal = new QComboBox( fibo );
216 fibo = new QVBox ( gb4 ); 220 fibo = new Q3VBox ( gb4 );
217 new QLabel ( i18n("Outgoing addressbook filter:"), fibo ); 221 new QLabel ( i18n("Outgoing addressbook filter:"), fibo );
218 mFilterOutAB = new QComboBox( fibo ); 222 mFilterOutAB = new QComboBox( fibo );
219 //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); 223 //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
220 //++iii; 224 //++iii;
221 mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame ); 225 mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame );
222 //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); 226 //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1);
223 //++iii; 227 //++iii;
224 QVGroupBox* gb3 = new QVGroupBox( i18n("Time period"), topFrame); 228 Q3VGroupBox* gb3 = new Q3VGroupBox( i18n("Time period"), topFrame);
225 connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) ); 229 connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) );
226 230
227 new QLabel( i18n("From ") , gb3 ); 231 new QLabel( i18n("From ") , gb3 );
228 QHBox * tf1 = new QHBox ( gb3 ); 232 Q3HBox * tf1 = new Q3HBox ( gb3 );
229 mWriteBackPastWeeks= new QSpinBox(1,104, 1, tf1 ); 233 mWriteBackPastWeeks= new QSpinBox(1,104, 1, tf1 );
230 mWriteBackPastWeeks->setMaximumWidth( 100 ); 234 mWriteBackPastWeeks->setMaximumWidth( 100 );
231 new QLabel( i18n(" weeks in the past to ") ,tf1 ); 235 new QLabel( i18n(" weeks in the past to ") ,tf1 );
232 QHBox * tf2 = new QHBox ( gb3 ); 236 Q3HBox * tf2 = new Q3HBox ( gb3 );
233 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, tf2); 237 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, tf2);
234 mWriteBackFutureWeeks->setMaximumWidth( 100 ); 238 mWriteBackFutureWeeks->setMaximumWidth( 100 );
235 new QLabel( i18n(" weeks in the future ") , tf2 ); 239 new QLabel( i18n(" weeks in the future ") , tf2 );
236 //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); 240 //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1);
237 //++iii; 241 //++iii;
238 gb3->setEnabled( false ); 242 gb3->setEnabled( false );
239 connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) ); 243 connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) );
240 } 244 }
241 connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) ); 245 connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) );
242 246
243 } 247 }
244 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); 248 proGr = new Q3ButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame);
245 gr = proGr; 249 gr = proGr;
246 topLayout->addMultiCellWidget(gr, iii,iii,0,1); 250 topLayout->addMultiCellWidget(gr, iii,iii,0,1);
247 ++iii; 251 ++iii;
248 mIsLocal = new QRadioButton ( i18n("Local file"), gr ); 252 mIsLocal = new QRadioButton ( i18n("Local file"), gr );
249 mIsPi = new QRadioButton ( i18n("Pi-Sync - all calendars ( direct Kx/Pi to Kx/Pi sync )"), gr ); 253 mIsPi = new QRadioButton ( i18n("Pi-Sync - all calendars ( direct Kx/Pi to Kx/Pi sync )"), gr );
250 connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 254 connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
251 mIsPiSpecific = new QRadioButton ( i18n("Pi-Sync - selected calendars ( direct Kx/Pi to Kx/Pi sync )"), gr ); 255 mIsPiSpecific = new QRadioButton ( i18n("Pi-Sync - selected calendars ( direct Kx/Pi to Kx/Pi sync )"), gr );
252 connect (mIsPiSpecific, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 256 connect (mIsPiSpecific, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
253 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); 257 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr );
254 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 258 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
255 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); 259 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr );
256 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 260 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
257 261
258 QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame); 262 Q3VGroupBox* gb1 = new Q3VGroupBox( i18n("Profile kind specific settings"), topFrame);
259 topLayout->addMultiCellWidget(gb1, iii,iii,0,1); 263 topLayout->addMultiCellWidget(gb1, iii,iii,0,1);
260 ++iii; 264 ++iii;
261 265
262 // ****************************************** 266 // ******************************************
263 // Profile kind specific settings 267 // Profile kind specific settings
264 { 268 {
265 // *** phone ******************************* 269 // *** phone *******************************
266 QVGroupBox* topFrame = gb1; 270 Q3VGroupBox* topFrame = gb1;
267 phoneWidget = new QVBox( topFrame); 271 phoneWidget = new Q3VBox( topFrame);
268 //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); 272 //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1);
269 //++iii; 273 //++iii;
270 mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); 274 mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget );
271 QHBox* temphb = new QHBox( phoneWidget ); 275 Q3HBox* temphb = new Q3HBox( phoneWidget );
272 new QLabel( i18n("I/O device: "), temphb ); 276 new QLabel( i18n("I/O device: "), temphb );
273 mPhoneDevice = new QLineEdit( temphb); 277 mPhoneDevice = new QLineEdit( temphb);
274 button = new QPushButton( i18n("Help..."), temphb ); 278 button = new QPushButton( i18n("Help..."), temphb );
275 connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); 279 connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) );
276 280
277 281
278 temphb = new QHBox( phoneWidget ); 282 temphb = new Q3HBox( phoneWidget );
279 new QLabel( i18n("Connection: "), temphb ); 283 new QLabel( i18n("Connection: "), temphb );
280 mPhoneConnection = new QLineEdit( temphb); 284 mPhoneConnection = new QLineEdit( temphb);
281 button = new QPushButton( i18n("Help..."), temphb ); 285 button = new QPushButton( i18n("Help..."), temphb );
282 connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); 286 connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) );
283 287
284 288
285 temphb = new QHBox( phoneWidget ); 289 temphb = new Q3HBox( phoneWidget );
286 new QLabel( i18n("Model(opt.): "), temphb ); 290 new QLabel( i18n("Model(opt.): "), temphb );
287 mPhoneModel = new QLineEdit( temphb); 291 mPhoneModel = new QLineEdit( temphb);
288 button = new QPushButton( i18n("Help..."), temphb ); 292 button = new QPushButton( i18n("Help..."), temphb );
289 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); 293 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) );
290 294
291 // *** local******************************* 295 // *** local*******************************
292 localFileWidget = new QVBox( topFrame); 296 localFileWidget = new Q3VBox( topFrame);
293 //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); 297 //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1);
294 //++iii; 298 //++iii;
295 temphb = new QHBox( localFileWidget ); 299 temphb = new Q3HBox( localFileWidget );
296 300
297 lab = new QLabel( i18n("Local file Cal:"), temphb ); 301 lab = new QLabel( i18n("Local file Cal:"), temphb );
298 lab = new QLabel( i18n("Local file ABook:"), temphb ); 302 lab = new QLabel( i18n("Local file ABook:"), temphb );
299 lab = new QLabel( i18n("Local file PWMgr:"), temphb ); 303 lab = new QLabel( i18n("Local file PWMgr:"), temphb );
300 temphb = new QHBox( localFileWidget ); 304 temphb = new Q3HBox( localFileWidget );
301 button = new QPushButton( i18n("Choose..."), temphb ); 305 button = new QPushButton( i18n("Choose..."), temphb );
302 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); 306 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) );
303 button = new QPushButton( i18n("Choose..."), temphb ); 307 button = new QPushButton( i18n("Choose..."), temphb );
304 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); 308 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) );
305 button = new QPushButton( i18n("Choose..."), temphb ); 309 button = new QPushButton( i18n("Choose..."), temphb );
306 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); 310 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) );
307 temphb = new QHBox( localFileWidget ); 311 temphb = new Q3HBox( localFileWidget );
308 312
309 mRemoteFile = new QLineEdit( temphb); 313 mRemoteFile = new QLineEdit( temphb);
310 mRemoteFileAB = new QLineEdit( temphb); 314 mRemoteFileAB = new QLineEdit( temphb);
311 mRemoteFilePWM = new QLineEdit( temphb); 315 mRemoteFilePWM = new QLineEdit( temphb);
312 mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget ); 316 mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget );
313 317
314 318
315 // *** remote******************************* 319 // *** remote*******************************
316 remoteFileWidget = new QVBox( topFrame); 320 remoteFileWidget = new Q3VBox( topFrame);
317 //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); 321 //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
318 //++iii; 322 //++iii;
319 temphb = new QHBox( remoteFileWidget ); 323 temphb = new Q3HBox( remoteFileWidget );
320 new QLabel( i18n("Calendar:"), temphb); 324 new QLabel( i18n("Calendar:"), temphb);
321 new QLabel( i18n("AddressBook:"), temphb); 325 new QLabel( i18n("AddressBook:"), temphb);
322 new QLabel( i18n("PWManager:"), temphb); 326 new QLabel( i18n("PWManager:"), temphb);
323 327
324 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); 328 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget);
325 temphb = new QHBox( remoteFileWidget ); 329 temphb = new Q3HBox( remoteFileWidget );
326 mRemotePrecommand = new QLineEdit(temphb); 330 mRemotePrecommand = new QLineEdit(temphb);
327 mRemotePrecommandAB = new QLineEdit(temphb); 331 mRemotePrecommandAB = new QLineEdit(temphb);
328 mRemotePrecommandPWM = new QLineEdit(temphb); 332 mRemotePrecommandPWM = new QLineEdit(temphb);
329 333
330 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); 334 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget);
331 temphb = new QHBox( remoteFileWidget ); 335 temphb = new Q3HBox( remoteFileWidget );
332 mLocalTempFile = new QLineEdit(temphb); 336 mLocalTempFile = new QLineEdit(temphb);
333 mLocalTempFileAB = new QLineEdit(temphb); 337 mLocalTempFileAB = new QLineEdit(temphb);
334 mLocalTempFilePWM = new QLineEdit(temphb); 338 mLocalTempFilePWM = new QLineEdit(temphb);
335 339
336 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); 340 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget);
337 temphb = new QHBox( remoteFileWidget ); 341 temphb = new Q3HBox( remoteFileWidget );
338 mRemotePostcommand = new QLineEdit(temphb ); 342 mRemotePostcommand = new QLineEdit(temphb );
339 mRemotePostcommandAB = new QLineEdit(temphb ); 343 mRemotePostcommandAB = new QLineEdit(temphb );
340 mRemotePostcommandPWM = new QLineEdit(temphb ); 344 mRemotePostcommandPWM = new QLineEdit(temphb );
341 mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget ); 345 mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget );
342 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); 346 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget);
343 temphb = new QHBox( remoteFileWidget ); 347 temphb = new Q3HBox( remoteFileWidget );
344 button = new QPushButton( i18n("ssh/scp"), temphb ); 348 button = new QPushButton( i18n("ssh/scp"), temphb );
345 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); 349 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) );
346 button = new QPushButton( i18n("ftp"), temphb ); 350 button = new QPushButton( i18n("ftp"), temphb );
347 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); 351 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) );
348 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); 352 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget);
349 353
350 // *** pi-sync******************************* 354 // *** pi-sync*******************************
351 piWidget = new QVBox( topFrame); 355 piWidget = new Q3VBox( topFrame);
352 //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); 356 //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1);
353 //++iii; 357 //++iii;
354 temphb = new QHBox( piWidget ); 358 temphb = new Q3HBox( piWidget );
355 new QLabel( i18n("Calendar:"), temphb); 359 new QLabel( i18n("Calendar:"), temphb);
356 new QLabel( i18n("AddressBook:"), temphb); 360 new QLabel( i18n("AddressBook:"), temphb);
357 new QLabel( i18n("PWManager:"), temphb); 361 new QLabel( i18n("PWManager:"), temphb);
358 362
359 lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget); 363 lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget);
360 temphb = new QHBox( piWidget ); 364 temphb = new Q3HBox( piWidget );
361 mRemotePw = new QLineEdit(temphb); 365 mRemotePw = new QLineEdit(temphb);
362 mRemotePwAB = new QLineEdit(temphb); 366 mRemotePwAB = new QLineEdit(temphb);
363 mRemotePwPWM = new QLineEdit(temphb); 367 mRemotePwPWM = new QLineEdit(temphb);
364 368
365 lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget); 369 lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget);
366 temphb = new QHBox( piWidget ); 370 temphb = new Q3HBox( piWidget );
367 mRemoteIP = new QLineEdit(temphb); 371 mRemoteIP = new QLineEdit(temphb);
368 mRemoteIPAB = new QLineEdit(temphb); 372 mRemoteIPAB = new QLineEdit(temphb);
369 mRemoteIPPWM = new QLineEdit(temphb); 373 mRemoteIPPWM = new QLineEdit(temphb);
370 374
371 lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget); 375 lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget);
372 temphb = new QHBox( piWidget ); 376 temphb = new Q3HBox( piWidget );
373 mRemotePort = new QLineEdit(temphb); 377 mRemotePort = new QLineEdit(temphb);
374 mRemotePortAB = new QLineEdit(temphb); 378 mRemotePortAB = new QLineEdit(temphb);
375 mRemotePortPWM = new QLineEdit(temphb); 379 mRemotePortPWM = new QLineEdit(temphb);
376 380
377 lab = new QLabel( i18n("Local/remote Resource sync partners (Leave empty to not sync)"), piWidget); 381 lab = new QLabel( i18n("Local/remote Resource sync partners (Leave empty to not sync)"), piWidget);
378 mTableBox = new QHBox( piWidget ); 382 mTableBox = new Q3HBox( piWidget );
379 mResTableKopi = new QTable( 1, 1, mTableBox ); 383 mResTableKopi = new Q3Table( 1, 1, mTableBox );
380 mResTableKapi = new QTable( 1, 1, mTableBox ); 384 mResTableKapi = new Q3Table( 1, 1, mTableBox );
381 mResTablePwmpi = new QTable( 1, 1, mTableBox ); 385 mResTablePwmpi = new Q3Table( 1, 1, mTableBox );
382 mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") ); 386 mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") );
383 mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") ); 387 mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") );
384 mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); 388 mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") );
385 mResTableKopi->setLeftMargin( 80 ); 389 mResTableKopi->setLeftMargin( 80 );
386 mResTableKapi->setLeftMargin( 80 ); 390 mResTableKapi->setLeftMargin( 80 );
387 } 391 }
388 // ****************************************** 392 // ******************************************
389 // Profile kind specific settings END 393 // Profile kind specific settings END
390 394
391} 395}
392 396
393void KSyncPrefsDialog::readResources() 397void KSyncPrefsDialog::readResources()
@@ -459,25 +463,25 @@ void KSyncPrefsDialog::readFilter()
459 mFilterOutAB->insertStringList( temp ); 463 mFilterOutAB->insertStringList( temp );
460 mFilterInAB->insertStringList( temp ); 464 mFilterInAB->insertStringList( temp );
461} 465}
462 466
463void KSyncPrefsDialog::slotOK() 467void KSyncPrefsDialog::slotOK()
464{ 468{
465 if ( mMyMachineName->text() == "undefined" ) { 469 if ( mMyMachineName->text() == "undefined" ) {
466 KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); 470 KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error"));
467 return; 471 return;
468 } 472 }
469 int i; 473 int i;
470 for (i = 0; i < mSyncProfileNames.count(); ++ i) { 474 for (i = 0; i < mSyncProfileNames.count(); ++ i) {
471 if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { 475 if ( mSyncProfileNames.count( mSyncProfileNames[i]) > 1 ) {
472 KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); 476 KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error"));
473 return; 477 return;
474 } 478 }
475 } 479 }
476 usrWriteConfig(); 480 usrWriteConfig();
477 QDialog::accept(); 481 QDialog::accept();
478} 482}
479void KSyncPrefsDialog::accept() 483void KSyncPrefsDialog::accept()
480{ 484{
481 slotOK(); 485 slotOK();
482} 486}
483void KSyncPrefsDialog::chooseFile() 487void KSyncPrefsDialog::chooseFile()
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h
index d8c02de..1d7503e 100644
--- a/libkdepim/ksyncprefsdialog.h
+++ b/libkdepim/ksyncprefsdialog.h
@@ -16,40 +16,40 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KSYNCPREFSDIALOG_H 23#ifndef _KSYNCPREFSDIALOG_H
24#define _KSYNCPREFSDIALOG_H 24#define _KSYNCPREFSDIALOG_H
25 25
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28#include <qptrlist.h> 28#include <q3ptrlist.h>
29#include <qtable.h> 29#include <q3table.h>
30#include <qhbox.h> 30#include <q3hbox.h>
31 31
32//#include <libkdepim/kprefsdialog.h> 32//#include <libkdepim/kprefsdialog.h>
33 33
34class KColorButton; 34class KColorButton;
35class QSpinBox;; 35class QSpinBox;;
36class QRadioButton; 36class QRadioButton;
37class QCheckBox; 37class QCheckBox;
38class QSlider; 38class QSlider;
39class KURLRequester; 39class KURLRequester;
40class QComboBox; 40class QComboBox;
41class QButtonGroup; 41class Q3ButtonGroup;
42class QLineEdit; 42class QLineEdit;
43class QVBox; 43class Q3VBox;
44class QStringList; 44class QStringList;
45class KSyncProfile; 45class KSyncProfile;
46 46
47/** Dialog to change the korganizer configuration. 47/** Dialog to change the korganizer configuration.
48 */ 48 */
49class KSyncPrefsDialog : public KDialog 49class KSyncPrefsDialog : public KDialog
50{ 50{
51 Q_OBJECT 51 Q_OBJECT
52 public: 52 public:
53 /** Initialize dialog and pages */ 53 /** Initialize dialog and pages */
54 KSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); 54 KSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false);
55 ~KSyncPrefsDialog(); 55 ~KSyncPrefsDialog();
@@ -77,48 +77,48 @@ class KSyncPrefsDialog : public KDialog
77 void helpDevice(); 77 void helpDevice();
78 void helpModel(); 78 void helpModel();
79 void helpConnection(); 79 void helpConnection();
80 80
81 protected: 81 protected:
82 void usrWriteConfig(); 82 void usrWriteConfig();
83 void setupSyncAlgTab(); 83 void setupSyncAlgTab();
84 void readFilter(); 84 void readFilter();
85 void readResources(); 85 void readResources();
86 private: 86 private:
87 void updateMyCaption(); 87 void updateMyCaption();
88 int currentSelection; 88 int currentSelection;
89 QPtrList<KSyncProfile> mSyncProfiles; 89 Q3PtrList<KSyncProfile> mSyncProfiles;
90 QStringList mSyncProfileNames; 90 QStringList mSyncProfileNames;
91 QStringList mFilterKapi; 91 QStringList mFilterKapi;
92 QStringList mFilterKopi; 92 QStringList mFilterKopi;
93 QStringList mResourcesKopi; 93 QStringList mResourcesKopi;
94 QStringList mResourcesKapi; 94 QStringList mResourcesKapi;
95 QLineEdit * mMyMachineName; 95 QLineEdit * mMyMachineName;
96 QComboBox * mProfileBox; 96 QComboBox * mProfileBox;
97 QRadioButton* mIsLocal; 97 QRadioButton* mIsLocal;
98 QRadioButton* mIsNotLocal; 98 QRadioButton* mIsNotLocal;
99 QRadioButton* mIsPhone; 99 QRadioButton* mIsPhone;
100 QRadioButton* mIsPi; 100 QRadioButton* mIsPi;
101 QRadioButton* mIsPiSpecific; 101 QRadioButton* mIsPiSpecific;
102 QCheckBox* mIncludeInRing; 102 QCheckBox* mIncludeInRing;
103 QCheckBox* mIncludeInRingAB; 103 QCheckBox* mIncludeInRingAB;
104 QCheckBox* mIncludeInRingPWM; 104 QCheckBox* mIncludeInRingPWM;
105 void addProfile ( KSyncProfile* ); 105 void addProfile ( KSyncProfile* );
106 void insertProfiles(); 106 void insertProfiles();
107 void saveProfile(); 107 void saveProfile();
108 QButtonGroup* proGr; 108 Q3ButtonGroup* proGr;
109 QHBox * mTableBox; 109 Q3HBox * mTableBox;
110 QTable* mResTableKopi; 110 Q3Table* mResTableKopi;
111 QTable* mResTableKapi; 111 Q3Table* mResTableKapi;
112 QTable* mResTablePwmpi; 112 Q3Table* mResTablePwmpi;
113 113
114 QComboBox * mFilterOutCal; 114 QComboBox * mFilterOutCal;
115 QComboBox * mFilterInCal; 115 QComboBox * mFilterInCal;
116 QComboBox * mFilterOutAB; 116 QComboBox * mFilterOutAB;
117 QComboBox * mFilterInAB; 117 QComboBox * mFilterInAB;
118 118
119 QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both; 119 QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both;
120 120
121 121
122 QLineEdit * mRemotePostcommand; 122 QLineEdit * mRemotePostcommand;
123 QLineEdit * mRemotePrecommand; 123 QLineEdit * mRemotePrecommand;
124 QLineEdit * mRemoteFile; 124 QLineEdit * mRemoteFile;
@@ -143,28 +143,28 @@ class KSyncPrefsDialog : public KDialog
143 QLineEdit * mRemoteIPAB; 143 QLineEdit * mRemoteIPAB;
144 QLineEdit * mRemotePortAB; 144 QLineEdit * mRemotePortAB;
145 145
146 QLineEdit * mRemotePwPWM; 146 QLineEdit * mRemotePwPWM;
147 QLineEdit * mRemoteIPPWM; 147 QLineEdit * mRemoteIPPWM;
148 QLineEdit * mRemotePortPWM; 148 QLineEdit * mRemotePortPWM;
149 149
150 QLineEdit * mPhoneDevice; 150 QLineEdit * mPhoneDevice;
151 QLineEdit * mPhoneConnection; 151 QLineEdit * mPhoneConnection;
152 QLineEdit * mPhoneModel; 152 QLineEdit * mPhoneModel;
153 153
154 QWidget* mSetupSyncAlgTab; 154 QWidget* mSetupSyncAlgTab;
155 QVBox* localFileWidget; 155 Q3VBox* localFileWidget;
156 QVBox* remoteFileWidget; 156 Q3VBox* remoteFileWidget;
157 QVBox* phoneWidget; 157 Q3VBox* phoneWidget;
158 QVBox* piWidget; 158 Q3VBox* piWidget;
159 QCheckBox* mWriteBackFile; 159 QCheckBox* mWriteBackFile;
160 QCheckBox* mWriteBackFuture; 160 QCheckBox* mWriteBackFuture;
161 QSpinBox* mWriteBackFutureWeeks; 161 QSpinBox* mWriteBackFutureWeeks;
162 QSpinBox* mWriteBackPastWeeks; 162 QSpinBox* mWriteBackPastWeeks;
163 QCheckBox* mWriteBackExisting; 163 QCheckBox* mWriteBackExisting;
164 QCheckBox* mAskForPreferences; 164 QCheckBox* mAskForPreferences;
165 QCheckBox* mShowSummaryAfterSync; 165 QCheckBox* mShowSummaryAfterSync;
166 QCheckBox* mWriteContactToSIM; 166 QCheckBox* mWriteContactToSIM;
167 QCheckBox* mIsKapiFileL; 167 QCheckBox* mIsKapiFileL;
168 QCheckBox* mIsKapiFileR; 168 QCheckBox* mIsKapiFileR;
169}; 169};
170 170
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h
index 91fcfc5..1e41662 100644
--- a/libkdepim/ksyncprofile.h
+++ b/libkdepim/ksyncprofile.h
@@ -11,25 +11,25 @@
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef _KSYNCPROFILE_H 20#ifndef _KSYNCPROFILE_H
21#define _KSYNCPROFILE_H 21#define _KSYNCPROFILE_H
22 22
23#include <qptrlist.h> 23#include <q3ptrlist.h>
24#include <qcolor.h> 24#include <qcolor.h>
25#include <qfont.h> 25#include <qfont.h>
26#include <qstringlist.h> 26#include <qstringlist.h>
27#include <qobject.h> 27#include <qobject.h>
28#include <qstring.h> 28#include <qstring.h>
29 29
30#include <libkcal/syncdefines.h> 30#include <libkcal/syncdefines.h>
31 31
32 32
33 33
34class KConfig; 34class KConfig;
35 35
diff --git a/libkdepim/libkdepim.pro b/libkdepim/libkdepim.pro
index 7160d0e..fb27311 100644
--- a/libkdepim/libkdepim.pro
+++ b/libkdepim/libkdepim.pro
@@ -1,16 +1,16 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG = qt warn_on 2 CONFIG = qt warn_on
3DEFINES +=KORG_NOKABC 3DEFINES +=KORG_NOKABC
4TARGET = microkdepim 4TARGET = xmicrokdepim
5INCLUDEPATH += ../microkde ../microkde/kdecore ../microkde/kdeui . .. 5INCLUDEPATH += ../microkde ../microkde/kdecore ../microkde/kdeui . ..
6DESTDIR=../bin 6DESTDIR=../bin
7 7
8DEFINES += DESKTOP_VERSION 8DEFINES += DESKTOP_VERSION
9include( ../variables.pri ) 9include( ../variables.pri )
10unix : { 10unix : {
11OBJECTS_DIR = obj/unix 11OBJECTS_DIR = obj/unix
12MOC_DIR = moc/unix 12MOC_DIR = moc/unix
13} 13}
14win32: { 14win32: {
15DEFINES += _WIN32_ 15DEFINES += _WIN32_
16OBJECTS_DIR = obj/win 16OBJECTS_DIR = obj/win
@@ -65,12 +65,14 @@ importol {
65debug: { 65debug: {
66LIBS += mfc71ud.lib 66LIBS += mfc71ud.lib
67} 67}
68release: { 68release: {
69LIBS += mfc71u.lib 69LIBS += mfc71u.lib
70} 70}
71DEFINES += _OL_IMPORT_ 71DEFINES += _OL_IMPORT_
72HEADERS += ol_access.h 72HEADERS += ol_access.h
73SOURCES += ol_access.cpp 73SOURCES += ol_access.cpp
74#olimport section end 74#olimport section end
75} 75}
76} 76}
77#The following line was inserted by qt3to4
78QT += xml qt3support
diff --git a/libkdepim/libkdepimE.pro b/libkdepim/libkdepimE.pro
index f3db68e..4b42184 100644
--- a/libkdepim/libkdepimE.pro
+++ b/libkdepim/libkdepimE.pro
@@ -1,18 +1,18 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3TARGET = microkdepim 3TARGET = xmicrokdepim
4INCLUDEPATH += . $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(QPEDIR)/include 4INCLUDEPATH += . $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(QPEDIR)/include
5LIBS += -lmicrokde 5LIBS += -lxmicrokde
6#LIBS += -lmicrokcal 6#LIBS += -lxmicrokcal
7LIBS += -L$(QPEDIR)/lib 7LIBS += -L$(QPEDIR)/lib
8OBJECTS_DIR = obj/$(PLATFORM) 8OBJECTS_DIR = obj/$(PLATFORM)
9MOC_DIR = moc/$(PLATFORM) 9MOC_DIR = moc/$(PLATFORM)
10DESTDIR=$(QPEDIR)/lib 10DESTDIR=$(QPEDIR)/lib
11 11
12 12
13INTERFACES = \ 13INTERFACES = \
14 14
15HEADERS = \ 15HEADERS = \
16 categoryeditdialog.h \ 16 categoryeditdialog.h \
17 categoryeditdialog_base.h \ 17 categoryeditdialog_base.h \
18 categoryselectdialog.h \ 18 categoryselectdialog.h \
diff --git a/libkdepim/ol_access.cpp b/libkdepim/ol_access.cpp
index 1b05693..821f148 100755
--- a/libkdepim/ol_access.cpp
+++ b/libkdepim/ol_access.cpp
@@ -13,89 +13,89 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qframe.h> 25#include <q3frame.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qprogressbar.h> 28#include <q3progressbar.h>
29#include <qprogressdialog.h> 29#include <q3progressdialog.h>
30#include <qwidgetstack.h> 30#include <q3widgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qdir.h> 32#include <qdir.h>
33#include <qpushbutton.h> 33#include <qpushbutton.h>
34#include <qregexp.h> 34#include <qregexp.h>
35#include <qapplication.h> 35#include <qapplication.h>
36#include <qhbox.h> 36#include <q3hbox.h>
37#include <qheader.h> 37#include <q3header.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qlistview.h> 39#include <q3listview.h>
40 40
41#include <kdebug.h> 41#include <kdebug.h>
42#include <klocale.h> 42#include <klocale.h>
43#include <kstandarddirs.h> 43#include <kstandarddirs.h>
44#include <kmessagebox.h> 44#include <kmessagebox.h>
45#include <kfiledialog.h> 45#include <kfiledialog.h>
46#include <kstaticdeleter.h> 46#include <kstaticdeleter.h>
47#include <kdialogbase.h> 47#include <kdialogbase.h>
48 48
49 49
50#include <ol_access.h> 50#include <ol_access.h>
51 51
52#include "../outport/msoutl9.h" 52#include "../outport/msoutl9.h"
53#include <ole2.h> 53#include <ole2.h>
54#include <comutil.h> 54#include <comutil.h>
55 55
56 56
57class OLEListViewItem : public QCheckListItem 57class OLEListViewItem : public Q3CheckListItem
58{ 58{
59public: 59public:
60 OLEListViewItem( QListView *parent, QString text ) : 60 OLEListViewItem( Q3ListView *parent, QString text ) :
61 QCheckListItem( parent, text, QCheckListItem::CheckBox ) { ; }; 61 Q3CheckListItem( parent, text, Q3CheckListItem::CheckBox ) { ; };
62 OLEListViewItem( QListViewItem *after, QString text ) : 62 OLEListViewItem( Q3ListViewItem *after, QString text ) :
63 QCheckListItem( after, text, QCheckListItem::CheckBox ) { ; }; 63 Q3CheckListItem( after, text, Q3CheckListItem::CheckBox ) { ; };
64 ~OLEListViewItem() {}; 64 ~OLEListViewItem() {};
65 void setData( DWORD data ) {mData= data; }; 65 void setData( DWORD data ) {mData= data; };
66 void setDataID( QString data ){ mDataID = data ;} 66 void setDataID( QString data ){ mDataID = data ;}
67 QString dataID() { return mDataID;} 67 QString dataID() { return mDataID;}
68 DWORD data() { return mData ;}; 68 DWORD data() { return mData ;};
69private: 69private:
70 DWORD mData; 70 DWORD mData;
71 QString mDataID; 71 QString mDataID;
72}; 72};
73 73
74class OLEFolderSelect : public KDialogBase 74class OLEFolderSelect : public KDialogBase
75{ 75{
76 public: 76 public:
77 OLEFolderSelect() : 77 OLEFolderSelect() :
78 KDialogBase( Plain, "", Ok | Cancel, Ok, 78 KDialogBase( Plain, "", Ok | Cancel, Ok,
79 0, "", true, false, i18n("Import!") ) 79 0, "", true, false, i18n("Import!") )
80 { 80 {
81 QHBox * mw = new QHBox( this ); 81 Q3HBox * mw = new Q3HBox( this );
82 setMainWidget( mw ); 82 setMainWidget( mw );
83 mListView = new QListView( mw ); 83 mListView = new Q3ListView( mw );
84 mListView->addColumn(i18n("Select Folder")); 84 mListView->addColumn(i18n("Select Folder"));
85 mListView->addColumn(i18n("Content Type")); 85 mListView->addColumn(i18n("Content Type"));
86 } 86 }
87 QListView* listView() { return mListView;} 87 Q3ListView* listView() { return mListView;}
88private: 88private:
89 QListView* mListView; 89 Q3ListView* mListView;
90}; 90};
91 91
92OL_access *OL_access::sInstance = 0; 92OL_access *OL_access::sInstance = 0;
93static KStaticDeleter<OL_access> staticDeleterPim; 93static KStaticDeleter<OL_access> staticDeleterPim;
94 94
95OL_access *OL_access::instance() 95OL_access *OL_access::instance()
96{ 96{
97 if ( !sInstance ) { 97 if ( !sInstance ) {
98 sInstance = staticDeleterPim.setObject( new OL_access() ); 98 sInstance = staticDeleterPim.setObject( new OL_access() );
99 } 99 }
100 return sInstance; 100 return sInstance;
101} 101}
@@ -140,49 +140,49 @@ void OL_access::readContactData( LPDISPATCH dispItem, KABC::Addressee::List* li
140 dispItem->AddRef(); 140 dispItem->AddRef();
141 MAPIFolder mf(dispItem); 141 MAPIFolder mf(dispItem);
142 mf.m_lpDispatch->AddRef(); 142 mf.m_lpDispatch->AddRef();
143 _Items folderItems; 143 _Items folderItems;
144 _variant_t indx((long)0); 144 _variant_t indx((long)0);
145 LPDISPATCH itm; 145 LPDISPATCH itm;
146 int i; 146 int i;
147 folderItems = mf.GetItems(); 147 folderItems = mf.GetItems();
148 QString cap = i18n("Importing contact data"); 148 QString cap = i18n("Importing contact data");
149 if ( syncMode ) { 149 if ( syncMode ) {
150 cap = i18n("Reading contact data..."); 150 cap = i18n("Reading contact data...");
151 } 151 }
152 QProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(), 0 ); 152 Q3ProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(), 0 );
153 bar.setCaption (i18n("Accessing OL") ); 153 bar.setCaption (i18n("Accessing OL") );
154 int h = bar.sizeHint().height() ; 154 int h = bar.sizeHint().height() ;
155 int w = 300; 155 int w = 300;
156 int dw = QApplication::desktop()->width(); 156 int dw = QApplication::desktop()->width();
157 int dh = QApplication::desktop()->height(); 157 int dh = QApplication::desktop()->height();
158 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 158 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
159 bar.show(); 159 bar.show();
160 for(i=1; i <= folderItems.GetCount(); ++i) 160 for(i=1; i <= folderItems.GetCount(); ++i)
161 { 161 {
162 qApp->processEvents(); 162 qApp->processEvents();
163 if ( ! bar.isVisible() ) 163 if ( ! bar.isVisible() )
164 return ; 164 return ;
165 bar.setProgress( i ); 165 bar.setProgress( i );
166 indx = (long)i; 166 indx = (long)i;
167 itm = folderItems.Item(indx.Detach()); 167 itm = folderItems.Item(indx.Detach());
168 _ContactItem * pItem = (_ContactItem *)&itm; 168 _ContactItem * pItem = (_ContactItem *)&itm;
169 list->append( ol2kapiContact( pItem, syncMode ) ); 169 list->append( ol2kapiContact( pItem, syncMode ) );
170 itm->Release(); 170 itm->Release();
171 } 171 }
172} 172}
173QStringList OL_access::getFolderSelection( int type , QString caption ) 173QStringList OL_access::getFolderSelection( int type , QString caption )
174{ 174{
175 OLEFolderSelect folder_dialog; 175 OLEFolderSelect folder_dialog;
176 QListView * listView = folder_dialog.listView(); 176 Q3ListView * listView = folder_dialog.listView();
177 MAPIFolder mfInbox; 177 MAPIFolder mfInbox;
178 MAPIFolder mfRoot; 178 MAPIFolder mfRoot;
179 CString szName; 179 CString szName;
180 _NameSpace olNS; 180 _NameSpace olNS;
181 olNS = gOlAppAB.GetNamespace(_T("MAPI")); 181 olNS = gOlAppAB.GetNamespace(_T("MAPI"));
182 mfInbox = olNS.GetDefaultFolder(6); 182 mfInbox = olNS.GetDefaultFolder(6);
183 mfRoot = mfInbox.GetParent(); 183 mfRoot = mfInbox.GetParent();
184 szName = mfRoot.GetName(); 184 szName = mfRoot.GetName();
185 long iType = mfRoot.GetDefaultItemType(); 185 long iType = mfRoot.GetDefaultItemType();
186 QString mes; 186 QString mes;
187 mes = QString::fromUcs2( szName.GetBuffer() ); 187 mes = QString::fromUcs2( szName.GetBuffer() );
188 OLEListViewItem * root = new OLEListViewItem( listView, mes ); 188 OLEListViewItem * root = new OLEListViewItem( listView, mes );
@@ -1126,51 +1126,51 @@ QDateTime mDdate2Qdtr( DATE dt)
1126 return qdt; 1126 return qdt;
1127} 1127}
1128DATE Qdt2date( QDateTime dt ) 1128DATE Qdt2date( QDateTime dt )
1129{ 1129{
1130 DATE ddd; 1130 DATE ddd;
1131 COleDateTime odt; 1131 COleDateTime odt;
1132 odt.SetDateTime(dt.date().year(), dt.date().month(),dt.date().day(), 1132 odt.SetDateTime(dt.date().year(), dt.date().month(),dt.date().day(),
1133 dt.time().hour(), dt.time().minute(), dt.time().second() ); 1133 dt.time().hour(), dt.time().minute(), dt.time().second() );
1134 ddd = odt; 1134 ddd = odt;
1135 return ddd; 1135 return ddd;
1136} 1136}
1137 1137
1138class OLEListViewItem : public QCheckListItem 1138class OLEListViewItem : public Q3CheckListItem
1139{ 1139{
1140 public: 1140 public:
1141 OLEListViewItem( QListView *parent, QString text ) : 1141 OLEListViewItem( Q3ListView *parent, QString text ) :
1142 QCheckListItem( parent, text, QCheckListItem::CheckBox ) { ; }; 1142 Q3CheckListItem( parent, text, Q3CheckListItem::CheckBox ) { ; };
1143 OLEListViewItem( QListViewItem *after, QString text ) : 1143 OLEListViewItem( Q3ListViewItem *after, QString text ) :
1144 QCheckListItem( after, text, QCheckListItem::CheckBox ) { ; }; 1144 Q3CheckListItem( after, text, Q3CheckListItem::CheckBox ) { ; };
1145 ~OLEListViewItem() {}; 1145 ~OLEListViewItem() {};
1146 void setData( DWORD data ) {mData= data; }; 1146 void setData( DWORD data ) {mData= data; };
1147 void setDataID( QString data ){ mDataID = data ;} 1147 void setDataID( QString data ){ mDataID = data ;}
1148 QString dataID() { return mDataID;} 1148 QString dataID() { return mDataID;}
1149 DWORD data() { return mData ;}; 1149 DWORD data() { return mData ;};
1150 private: 1150 private:
1151 DWORD mData; 1151 DWORD mData;
1152 QString mDataID; 1152 QString mDataID;
1153}; 1153};
1154bool KAImportOLdialog::sOLDispatch = false; 1154bool KAImportOLdialog::sOLDispatch = false;
1155 1155
1156KAImportOLdialog::KAImportOLdialog( const QString &caption, 1156KAImportOLdialog::KAImportOLdialog( const QString &caption,
1157 KABC::AddressBook * aBook, QWidget *parent ) : 1157 KABC::AddressBook * aBook, QWidget *parent ) :
1158 KDialogBase( Plain, caption, User1 | Close, Ok, 1158 KDialogBase( Plain, caption, User1 | Close, Ok,
1159 parent, caption, true, false, i18n("Import!") ) 1159 parent, caption, true, false, i18n("Import!") )
1160{ 1160{
1161 mSyncMode = false; 1161 mSyncMode = false;
1162 QHBox * mw = new QHBox( this ); 1162 Q3HBox * mw = new Q3HBox( this );
1163 setMainWidget( mw ); 1163 setMainWidget( mw );
1164 mListView = new QListView( mw ); 1164 mListView = new Q3ListView( mw );
1165 mListView->addColumn(i18n("Select Folder")); 1165 mListView->addColumn(i18n("Select Folder"));
1166 mListView->addColumn(i18n("Content Type")); 1166 mListView->addColumn(i18n("Content Type"));
1167 mABook = aBook; 1167 mABook = aBook;
1168 connect( this, SIGNAL( user1Clicked() ),SLOT ( slotApply())); 1168 connect( this, SIGNAL( user1Clicked() ),SLOT ( slotApply()));
1169 setupFolderView(); 1169 setupFolderView();
1170 resize( sizeHint().width()+50, sizeHint().height()+50 ); 1170 resize( sizeHint().width()+50, sizeHint().height()+50 );
1171} 1171}
1172 1172
1173KAImportOLdialog::~KAImportOLdialog() 1173KAImportOLdialog::~KAImportOLdialog()
1174{ 1174{
1175 1175
1176} 1176}
@@ -1294,25 +1294,25 @@ void KAImportOLdialog::readContactData( DWORD folder )
1294 dispItem->AddRef(); 1294 dispItem->AddRef();
1295 MAPIFolder mf(dispItem); 1295 MAPIFolder mf(dispItem);
1296 mf.m_lpDispatch->AddRef(); 1296 mf.m_lpDispatch->AddRef();
1297 _Items folderItems; 1297 _Items folderItems;
1298 _variant_t indx((long)0); 1298 _variant_t indx((long)0);
1299 LPDISPATCH itm; 1299 LPDISPATCH itm;
1300 int i; 1300 int i;
1301 folderItems = mf.GetItems(); 1301 folderItems = mf.GetItems();
1302 QString cap = i18n("Importing contact data"); 1302 QString cap = i18n("Importing contact data");
1303 if ( mSyncMode ) { 1303 if ( mSyncMode ) {
1304 cap = i18n("Reading contact data..."); 1304 cap = i18n("Reading contact data...");
1305 } 1305 }
1306 QProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(),this); 1306 Q3ProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(),this);
1307 bar.setCaption (i18n("Accessing OL") ); 1307 bar.setCaption (i18n("Accessing OL") );
1308 int h = bar.sizeHint().height() ; 1308 int h = bar.sizeHint().height() ;
1309 int w = 300; 1309 int w = 300;
1310 int dw = QApplication::desktop()->width(); 1310 int dw = QApplication::desktop()->width();
1311 int dh = QApplication::desktop()->height(); 1311 int dh = QApplication::desktop()->height();
1312 //bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1312 //bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1313 bar.show(); 1313 bar.show();
1314 for(i=1; i <= folderItems.GetCount(); ++i) 1314 for(i=1; i <= folderItems.GetCount(); ++i)
1315 { 1315 {
1316 qApp->processEvents(); 1316 qApp->processEvents();
1317 if ( ! bar.isVisible() ) 1317 if ( ! bar.isVisible() )
1318 return ; 1318 return ;
diff --git a/libkdepim/ol_access.h b/libkdepim/ol_access.h
index 85dbc6c..3422f65 100755
--- a/libkdepim/ol_access.h
+++ b/libkdepim/ol_access.h
@@ -28,25 +28,25 @@
28#include <kdialogbase.h> 28#include <kdialogbase.h>
29#include <kabc/addressee.h> 29#include <kabc/addressee.h>
30#include <kabc/addressbook.h> 30#include <kabc/addressbook.h>
31 31
32#include <afxdisp.h> 32#include <afxdisp.h>
33 33
34#include "../outport/msoutl9.h" 34#include "../outport/msoutl9.h"
35 35
36#define OL_CONTACT_DATA 2 36#define OL_CONTACT_DATA 2
37#define OL_CALENDAR_DATA 1 //pending is this the right number 37#define OL_CALENDAR_DATA 1 //pending is this the right number
38 38
39class QDateTime; 39class QDateTime;
40class QListView; 40class Q3ListView;
41class OLEListViewItem; 41class OLEListViewItem;
42class _ContactItem; 42class _ContactItem;
43class OL_access : public QObject 43class OL_access : public QObject
44{ 44{
45 Q_OBJECT 45 Q_OBJECT
46 public: 46 public:
47 static OL_access *instance(); 47 static OL_access *instance();
48 ~OL_access(); 48 ~OL_access();
49 //static converter methods 49 //static converter methods
50 static QDateTime mDdate2Qdtr( DATE dt); 50 static QDateTime mDdate2Qdtr( DATE dt);
51 static DATE Qdt2date( QDateTime dt ); 51 static DATE Qdt2date( QDateTime dt );
52 static KABC::Addressee ol2kapiContact( _ContactItem * aItem , bool syncMode); 52 static KABC::Addressee ol2kapiContact( _ContactItem * aItem , bool syncMode);
@@ -123,25 +123,25 @@ class KAImportOLdialog : public KDialogBase
123 123
124 prote_cted slo_ts: 124 prote_cted slo_ts:
125 void slotApply(); 125 void slotApply();
126 void slotOk(); 126 void slotOk();
127 void slotCancel(); 127 void slotCancel();
128 128
129 protected: 129 protected:
130 void setupFolderView(); 130 void setupFolderView();
131 void addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent); 131 void addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent);
132 void readContactData( DWORD folder ); 132 void readContactData( DWORD folder );
133 133
134 KABC::AddressBook * mABook; 134 KABC::AddressBook * mABook;
135 QListView * mListView; 135 Q3ListView * mListView;
136 KABC::Addressee::List mAList; 136 KABC::Addressee::List mAList;
137 bool addAddressee( KABC::Addressee a ); 137 bool addAddressee( KABC::Addressee a );
138 private: 138 private:
139 int importedItems; 139 int importedItems;
140 bool mSyncMode; 140 bool mSyncMode;
141 QString mSelectedFolderID; 141 QString mSelectedFolderID;
142}; 142};
143class KAwritebackOL : public QObject 143class KAwritebackOL : public QObject
144{ 144{
145 Q__OBJECT 145 Q__OBJECT
146 public: 146 public:
147 KAwritebackOL( const QString &olFolderID ); 147 KAwritebackOL( const QString &olFolderID );
diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp
index 89db22b..0ea73f5 100644
--- a/libkdepim/phoneaccess.cpp
+++ b/libkdepim/phoneaccess.cpp
@@ -13,54 +13,57 @@
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22 22
23#include <qstring.h> 23#include <qstring.h>
24#include <qapplication.h> 24#include <qapplication.h>
25#include <qptrlist.h> 25#include <QDesktopWidget>
26#include <q3ptrlist.h>
26#include <qregexp.h> 27#include <qregexp.h>
27#include <qfile.h> 28#include <qfile.h>
28#include <qlabel.h> 29#include <qlabel.h>
29#include <qtextstream.h> 30#include <q3textstream.h>
30#include <qtextcodec.h> 31#include <qtextcodec.h>
31#include <qdir.h> 32#include <qdir.h>
32#include <kmessagebox.h> 33#include <kmessagebox.h>
33#include <stdlib.h> 34#include <stdlib.h>
34#include "phoneaccess.h" 35#include "phoneaccess.h"
35 36
36void PhoneAccess::writeConfig( QString device, QString connection, QString model ) 37void PhoneAccess::writeConfig( QString device, QString connection, QString model )
37{ 38{
38#ifdef _WIN32_ 39#ifdef _WIN32_
39 QString fileName = qApp->applicationDirPath () +"\\gammurc"; 40 QString fileName = qApp->applicationDirPath () +"\\gammurc";
40#else 41#else
41 QString fileName = QDir::homeDirPath() +"/.gammurc"; 42 QString fileName = QDir::homeDirPath() +"/.gammurc";
42#endif 43#endif
43 //qDebug("save %d ", load ); 44 //qDebug("save %d ", load );
44 QString content = "[gammu]\n";; 45 QString content = "[gammu]\n";;
45 bool write = false; 46 bool write = false;
46 bool addPort = true, addConnection = true, addModel = true; 47 bool addPort = true, addConnection = true, addModel = true;
47 QFile file( fileName ); 48 QFile file( fileName );
48 if ( QFile::exists( fileName) ) { 49 if ( QFile::exists( fileName) ) {
49 if (!file.open( IO_ReadOnly ) ) { 50 if (!file.open( QIODevice::ReadOnly ) ) {
50 qDebug("Error: cannot open %s ", fileName.latin1() ); 51 qDebug("Error: cannot open %s ", fileName.latin1() );
51 return; 52 return;
52 } 53 }
53 QString line; 54 QString line;
54 while ( file.readLine( line, 1024 ) > 0 ) { 55 char tmp[1024];
56 while ( file.readLine( tmp, 1024 ) > 0 ) {
57 line = tmp;
55 //qDebug("*%s* ", line.latin1() ); 58 //qDebug("*%s* ", line.latin1() );
56 if ( line.left(7 ) == "[gammu]" ) { 59 if ( line.left(7 ) == "[gammu]" ) {
57 ; 60 ;
58 } else 61 } else
59 if ( line.left(4 ) == "port" ) { 62 if ( line.left(4 ) == "port" ) {
60 if ( line == "port = " + device+"\n" ) { 63 if ( line == "port = " + device+"\n" ) {
61 content += line ; 64 content += line ;
62 addPort = false; 65 addPort = false;
63 //qDebug("port found" ); 66 //qDebug("port found" );
64 } 67 }
65 68
66 } else if ( line.left(5 ) == "model" ) { 69 } else if ( line.left(5 ) == "model" ) {
@@ -106,30 +109,30 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model
106 content += "port = "; 109 content += "port = ";
107 content += device; 110 content += device;
108 content += "\n"; 111 content += "\n";
109 112
110 } 113 }
111 if ( addModel ) { 114 if ( addModel ) {
112 write = true; 115 write = true;
113 content += "model = "; 116 content += "model = ";
114 content += model; 117 content += model;
115 content += "\n"; 118 content += "\n";
116 } 119 }
117 if ( write ) { 120 if ( write ) {
118 if (!file.open( IO_WriteOnly ) ) { 121 if (!file.open( QIODevice::WriteOnly ) ) {
119 qDebug("Error: cannot write file %s ", fileName.latin1() ); 122 qDebug("Error: cannot write file %s ", fileName.latin1() );
120 return; 123 return;
121 } 124 }
122 qDebug("Writing file %s ", fileName.latin1() ); 125 qDebug("Writing file %s ", fileName.latin1() );
123 QTextStream ts( &file ); 126 Q3TextStream ts( &file );
124 ts << content ; 127 ts << content ;
125 file.close(); 128 file.close();
126 } 129 }
127 130
128} 131}
129 132
130 133
131bool PhoneAccess::writeToPhone( QString fileName) 134bool PhoneAccess::writeToPhone( QString fileName)
132{ 135{
133 136
134#ifdef DESKTOP_VERSION 137#ifdef DESKTOP_VERSION
135#ifdef _WIN32_ 138#ifdef _WIN32_
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index 72c4e60..4172cd0 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -29,142 +29,152 @@
29 ** with any edition of Qt, and distribute the resulting executable, 29 ** with any edition of Qt, and distribute the resulting executable,
30 ** without including the source code for Qt in the source distribution. 30 ** without including the source code for Qt in the source distribution.
31 ** 31 **
32 **********************************************************************/ 32 **********************************************************************/
33 33
34#include "KDGanttMinimizeSplitter.h" 34#include "KDGanttMinimizeSplitter.h"
35#ifndef QT_NO_SPLITTER___ 35#ifndef QT_NO_SPLITTER___
36 36
37#include "qpainter.h" 37#include "qpainter.h"
38#include "qdrawutil.h" 38#include "qdrawutil.h"
39#include "qbitmap.h" 39#include "qbitmap.h"
40#if QT_VERSION >= 0x030000 40#if QT_VERSION >= 0x030000
41#include "qptrlist.h" 41#include "q3ptrlist.h"
42#include "qmemarray.h" 42#include "q3memarray.h"
43#else 43#else
44#include <qlist.h> 44#include <qlist.h>
45#include <qarray.h> 45#include <qarray.h>
46#define QPtrList QList 46#define Q3PtrList QList
47#define QMemArray QArray 47#define Q3MemArray QArray
48#endif 48#endif
49#include "qlayoutengine_p.h" 49#include "qlayoutengine_p.h"
50#include "qobjectlist.h" 50#include "qobject.h"
51#include "qstyle.h" 51#include "qstyle.h"
52#include "qapplication.h" //sendPostedEvents 52#include "qapplication.h" //sendPostedEvents
53#include <qvaluelist.h> 53#include <q3valuelist.h>
54#include <qcursor.h> 54#include <qcursor.h>
55#include <qframe.h> 55#include <q3frame.h>
56#include <QDesktopWidget>
57//Added by qt3to4:
58#include <Q3PointArray>
59#include <QPixmap>
60#include <QResizeEvent>
61#include <QMouseEvent>
62#include <QChildEvent>
63#include <QEvent>
64#include <QPaintEvent>
56#ifndef KDGANTT_MASTER_CVS 65#ifndef KDGANTT_MASTER_CVS
57//#include "KDGanttMinimizeSplitter.moc" 66//#include "KDGanttMinimizeSplitter.moc"
58#endif 67#endif
59 68
60 69
61 70
62#ifndef DOXYGEN_SKIP_INTERNAL 71#ifndef DOXYGEN_SKIP_INTERNAL
63 72
64#if QT_VERSION >= 232 73#if QT_VERSION >= 232
65static int mouseOffset; 74static int mouseOffset;
66static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky 75static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky
67 76
68class KDRubberBand: public QFrame 77class KDRubberBand: public Q3Frame
69{ 78{
70public: 79public:
71 KDRubberBand( QWidget *parent, const char * name, WFlags f ) :QFrame ( parent, name, f ) {;} 80 KDRubberBand( QWidget *parent, const char * name, Qt::WFlags f ) :Q3Frame ( parent, name, f ) {;}
72 81
73protected: 82protected:
74 virtual void mousePressEvent ( QMouseEvent * ) 83 virtual void mousePressEvent ( QMouseEvent * )
75 { 84 {
76 close(); 85 close();
77 }; 86 };
78 87
79}; 88};
80 89
81KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, 90KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o,
82 KDGanttMinimizeSplitter *parent, const char * name ) 91 KDGanttMinimizeSplitter *parent, const char * name )
83 : QWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) 92 : _activeButton( 0 ), _collapsed( false )
84{ 93{
85 94 setObjectName(name);
95 setParent(parent);
86 if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->width() < 650 ) { 96 if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->width() < 650 ) {
87 mSizeHint = QSize(7,7); 97 mSizeHint = QSize(7,7);
88 mUseOffset = true; 98 mUseOffset = true;
89 } else { 99 } else {
90 mSizeHint = QSize(6,6); 100 mSizeHint = QSize(6,6);
91 mUseOffset = false; 101 mUseOffset = false;
92 } 102 }
93 s = parent; 103 s = parent;
94 setOrientation(o); 104 setOrientation(o);
95 setMouseTracking( true ); 105 setMouseTracking( true );
96 mMouseDown = false; 106 mMouseDown = false;
97 //setMaximumHeight( 5 ); // test only 107 //setMaximumHeight( 5 ); // test only
98} 108}
99 109
100QSize KDGanttSplitterHandle::sizeHint() const 110QSize KDGanttSplitterHandle::sizeHint() const
101{ 111{
102 return mSizeHint; 112 return mSizeHint;
103} 113}
104 114
105void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) 115void KDGanttSplitterHandle::setOrientation( Qt::Orientation o )
106{ 116{
107 orient = o; 117 orient = o;
108#ifndef QT_NO_CURSOR 118#ifndef QT_NO_CURSOR
109 if ( o == KDGanttMinimizeSplitter::Horizontal ) 119 if ( o == Qt::Horizontal )
110 setCursor( splitHCursor ); 120 setCursor( Qt::splitHCursor );
111 else 121 else
112 setCursor( splitVCursor ); 122 setCursor( Qt::splitVCursor );
113#endif 123#endif
114} 124}
115 125
116 126
117void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) 127void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e )
118{ 128{
119 updateCursor( e->pos() ); 129 updateCursor( e->pos() );
120 if ( !(e->state()&LeftButton) ) 130 if ( !(e->state()&Qt::LeftButton) )
121 return; 131 return;
122 132
123 if ( _activeButton != 0) 133 if ( _activeButton != 0)
124 return; 134 return;
125 135
126 QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) 136 QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos()))
127 - mouseOffset; 137 - mouseOffset;
128 if ( opaque() ) { 138 if ( opaque() ) {
129 s->moveSplitter( pos, id() ); 139 s->moveSplitter( pos, id() );
130 } else { 140 } else {
131 int min = pos; int max = pos; 141 int min = pos; int max = pos;
132 s->getRange( id(), &min, &max ); 142 s->getRange( id(), &min, &max );
133 s->setRubberband( QMAX( min, QMIN(max, pos ))); 143 s->setRubberband( QMAX( min, QMIN(max, pos )));
134 } 144 }
135 _collapsed = false; 145 _collapsed = false;
136} 146}
137 147
138void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) 148void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e )
139{ 149{
140 if ( e->button() == LeftButton ) { 150 if ( e->button() == Qt::LeftButton ) {
141 _activeButton = onButton( e->pos() ); 151 _activeButton = onButton( e->pos() );
142 mouseOffset = s->pick(e->pos()); 152 mouseOffset = s->pick(e->pos());
143 mMouseDown = true; 153 mMouseDown = true;
144 repaint(); 154 repaint();
145 updateCursor( e->pos() ); 155 updateCursor( e->pos() );
146 } 156 }
147} 157}
148 158
149void KDGanttSplitterHandle::updateCursor( const QPoint& p) 159void KDGanttSplitterHandle::updateCursor( const QPoint& p)
150{ 160{
151 if ( onButton( p ) != 0 ) { 161 if ( onButton( p ) != 0 ) {
152 setCursor( arrowCursor ); 162 setCursor( Qt::arrowCursor );
153 } 163 }
154 else { 164 else {
155 if ( orient == KDGanttMinimizeSplitter::Horizontal ) 165 if ( orient == Qt::Horizontal )
156 setCursor( splitHCursor ); 166 setCursor( Qt::splitHCursor );
157 else 167 else
158 setCursor( splitVCursor ); 168 setCursor( Qt::splitVCursor );
159 } 169 }
160} 170}
161void KDGanttSplitterHandle::toggle() 171void KDGanttSplitterHandle::toggle()
162{ 172{
163 int pos; 173 int pos;
164 int min, max; 174 int min, max;
165 if ( !_collapsed ) { 175 if ( !_collapsed ) {
166 s->expandPos( id(), &min, &max ); 176 s->expandPos( id(), &min, &max );
167 if ( s->minimizeDirection() == KDGanttMinimizeSplitter::Left 177 if ( s->minimizeDirection() == KDGanttMinimizeSplitter::Left
168 || s->minimizeDirection() == KDGanttMinimizeSplitter::Up ) { 178 || s->minimizeDirection() == KDGanttMinimizeSplitter::Up ) {
169 pos = min; 179 pos = min;
170 } 180 }
@@ -186,68 +196,68 @@ void KDGanttSplitterHandle::toggle()
186void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) 196void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e )
187{ 197{
188 mMouseDown = false; 198 mMouseDown = false;
189 if ( _activeButton != 0 ) { 199 if ( _activeButton != 0 ) {
190 if ( onButton( e->pos() ) == _activeButton ) 200 if ( onButton( e->pos() ) == _activeButton )
191 { 201 {
192 toggle(); 202 toggle();
193 } 203 }
194 _activeButton = 0; 204 _activeButton = 0;
195 updateCursor( e->pos() ); 205 updateCursor( e->pos() );
196 } 206 }
197 else { 207 else {
198 if ( !opaque() && e->button() == LeftButton ) { 208 if ( !opaque() && e->button() == Qt::LeftButton ) {
199 QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) 209 QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos()))
200 - mouseOffset; 210 - mouseOffset;
201 s->setRubberband( -1 ); 211 s->setRubberband( -1 );
202 s->moveSplitter( pos, id() ); 212 s->moveSplitter( pos, id() );
203 } 213 }
204 } 214 }
205 if ( s->rubberBand() ) { 215 if ( s->rubberBand() ) {
206 //qDebug("hide rubberband "); 216 //qDebug("hide rubberband ");
207 s->rubberBand()->close(); 217 s->rubberBand()->close();
208 } 218 }
209 repaint(); 219 repaint();
210} 220}
211 221
212int KDGanttSplitterHandle::onButton( const QPoint& p ) 222int KDGanttSplitterHandle::onButton( const QPoint& p )
213{ 223{
214 QValueList<QPointArray> list = buttonRegions(); 224 Q3ValueList<Q3PointArray> list = buttonRegions();
215 int index = 1; 225 int index = 1;
216 int add = 12; 226 int add = 12;
217 for( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { 227 for( Q3ValueList<Q3PointArray>::Iterator it = list.begin(); it != list.end(); ++it ) {
218 QRect rect = (*it).boundingRect(); 228 QRect rect = (*it).boundingRect();
219 rect.setLeft( rect.left()- add ); 229 rect.setLeft( rect.left()- add );
220 rect.setRight( rect.right() + add); 230 rect.setRight( rect.right() + add);
221 rect.setTop( rect.top()- add ); 231 rect.setTop( rect.top()- add );
222 rect.setBottom( rect.bottom() + add); 232 rect.setBottom( rect.bottom() + add);
223 if ( rect.contains( p ) ) { 233 if ( rect.contains( p ) ) {
224 return index; 234 return index;
225 } 235 }
226 index++; 236 index++;
227 } 237 }
228 return 0; 238 return 0;
229} 239}
230 240
231 241
232QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions() 242Q3ValueList<Q3PointArray> KDGanttSplitterHandle::buttonRegions()
233{ 243{
234 QValueList<QPointArray> list; 244 Q3ValueList<Q3PointArray> list;
235 245
236 int sw = 8; 246 int sw = 8;
237 int yyy = 1; 247 int yyy = 1;
238 int xxx = 1; 248 int xxx = 1;
239 int voffset[] = { (int) -sw*3, (int) sw*3 }; 249 int voffset[] = { (int) -sw*3, (int) sw*3 };
240 for ( int i = 0; i < 2; i++ ) { 250 for ( int i = 0; i < 2; i++ ) {
241 QPointArray arr; 251 Q3PointArray arr;
242 if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right || 252 if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right ||
243 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left) { 253 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left) {
244 int mid = height()/2 + voffset[i]; 254 int mid = height()/2 + voffset[i];
245 arr.setPoints( 3, 255 arr.setPoints( 3,
246 1-xxx, mid - sw + 4, 256 1-xxx, mid - sw + 4,
247 sw-3-xxx, mid, 257 sw-3-xxx, mid,
248 1-xxx, mid + sw -4); 258 1-xxx, mid + sw -4);
249 } 259 }
250 else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left || 260 else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left ||
251 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right ) { 261 _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right ) {
252 int mid = height()/2 + voffset[i]; 262 int mid = height()/2 + voffset[i];
253 arr.setPoints( 3, 263 arr.setPoints( 3,
@@ -302,29 +312,29 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * )
302 if ( _activeButton ) 312 if ( _activeButton )
303 col = colorGroup().background().dark( 250 ); 313 col = colorGroup().background().dark( 250 );
304 else { 314 else {
305 if ( mMouseDown ) 315 if ( mMouseDown )
306 col = Qt::white; 316 col = Qt::white;
307 else 317 else
308 col = colorGroup().background().dark( 150 ); 318 col = colorGroup().background().dark( 150 );
309 } 319 }
310 //QColor col = backgroundColor().dark( 130 ); 320 //QColor col = backgroundColor().dark( 130 );
311 p.setBrush( col ); 321 p.setBrush( col );
312 p.setPen( col ); 322 p.setPen( col );
313 323
314 QValueList<QPointArray> list = buttonRegions(); 324 Q3ValueList<Q3PointArray> list = buttonRegions();
315 int index = 1; 325 int index = 1;
316 if ( mUseOffset ) 326 if ( mUseOffset )
317 p.translate( 0, 1 ); 327 p.translate( 0, 1 );
318 for ( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { 328 for ( Q3ValueList<Q3PointArray>::Iterator it = list.begin(); it != list.end(); ++it ) {
319 if ( index == _activeButton ) { 329 if ( index == _activeButton ) {
320 330
321 /* 331 /*
322 if ( ! _collapsed ) { 332 if ( ! _collapsed ) {
323 p.save(); 333 p.save();
324 // p.translate( parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftHorizontal ), 334 // p.translate( parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftHorizontal ),
325 // parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftVertical ) ); 335 // parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftVertical ) );
326 p.translate( -1, 0 ); 336 p.translate( -1, 0 );
327 p.drawPolygon( *it, true ); 337 p.drawPolygon( *it, true );
328 p.restore(); } else 338 p.restore(); } else
329 */ 339 */
330 p.drawPolygon( *it, true ); 340 p.drawPolygon( *it, true );
@@ -368,30 +378,30 @@ class QSplitterLayoutStruct
368public: 378public:
369 KDGanttMinimizeSplitter::ResizeMode mode; 379 KDGanttMinimizeSplitter::ResizeMode mode;
370 QCOORD sizer; 380 QCOORD sizer;
371 bool isSplitter; 381 bool isSplitter;
372 QWidget *wid; 382 QWidget *wid;
373}; 383};
374 384
375class QSplitterData 385class QSplitterData
376{ 386{
377public: 387public:
378 QSplitterData() : opaque( FALSE ), firstShow( TRUE ) {} 388 QSplitterData() : opaque( FALSE ), firstShow( TRUE ) {}
379 389
380 QPtrList<QSplitterLayoutStruct> list; 390 Q3PtrList<QSplitterLayoutStruct> list;
381 bool opaque; 391 bool opaque;
382 bool firstShow; 392 bool firstShow;
383}; 393};
384 394
385void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, 395void kdganttGeomCalc( Q3MemArray<QLayoutStruct> &chain, int start, int count, int pos,
386 int space, int spacer ); 396 int space, int spacer );
387#endif // DOXYGEN_SKIP_INTERNAL 397#endif // DOXYGEN_SKIP_INTERNAL
388 398
389 399
390/*! 400/*!
391 \class KDGanttMinimizeSplitter KDGanttMinimizeSplitter.h 401 \class KDGanttMinimizeSplitter KDGanttMinimizeSplitter.h
392 \brief The KDGanttMinimizeSplitter class implements a splitter 402 \brief The KDGanttMinimizeSplitter class implements a splitter
393 widget with minimize buttons. 403 widget with minimize buttons.
394 404
395 This class (and its documentation) is largely a copy of Qt's 405 This class (and its documentation) is largely a copy of Qt's
396 QSplitter; the copying was necessary because QSplitter is not 406 QSplitter; the copying was necessary because QSplitter is not
397 extensible at all. QSplitter and its documentation are licensed 407 extensible at all. QSplitter and its documentation are licensed
@@ -452,42 +462,43 @@ static QSize minSizeHint( const QWidget* w )
452 s.setHeight( min.height() ); 462 s.setHeight( min.height() );
453 if ( min.width() > 0 ) 463 if ( min.width() > 0 )
454 s.setWidth( min.width() ); 464 s.setWidth( min.width() );
455 return s.expandedTo(QSize(0,0)); 465 return s.expandedTo(QSize(0,0));
456} 466}
457 467
458 468
459/*! 469/*!
460 Constructs a horizontal splitter with the \a parent and \a 470 Constructs a horizontal splitter with the \a parent and \a
461 name arguments being passed on to the QFrame constructor. 471 name arguments being passed on to the QFrame constructor.
462*/ 472*/
463KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *name ) 473KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *name )
464 :QFrame(parent,name,WPaintUnclipped) 474 :Q3Frame(parent,name)
465{ 475{
476 setAttribute(Qt::WA_PaintUnclipped);
466 mRubberBand = 0; 477 mRubberBand = 0;
467 mFirstHandle = 0; 478 mFirstHandle = 0;
468#if QT_VERSION >= 232 479#if QT_VERSION >= 232
469 orient = Horizontal; 480 orient = Qt::Horizontal;
470 init(); 481 init();
471#endif 482#endif
472} 483}
473 484
474/*! 485/*!
475 Constructs a splitter with orientation \a o with the \a parent 486 Constructs a splitter with orientation \a o with the \a parent
476 and \a name arguments being passed on to the QFrame constructor. 487 and \a name arguments being passed on to the QFrame constructor.
477*/ 488*/
478KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent, const char *name ) 489KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Qt::Orientation o, QWidget *parent, const char *name )
479 :QFrame(parent,name,WPaintUnclipped) 490 :Q3Frame(parent,name)
480{ 491{
481 492 setAttribute(Qt::WA_PaintUnclipped);
482 mRubberBand = 0; 493 mRubberBand = 0;
483 mFirstHandle = 0; 494 mFirstHandle = 0;
484#if QT_VERSION >= 232 495#if QT_VERSION >= 232
485 orient = o; 496 orient = o;
486 init(); 497 init();
487#endif 498#endif
488} 499}
489 500
490/*! 501/*!
491 Destroys the splitter and any children. 502 Destroys the splitter and any children.
492*/ 503*/
493KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() 504KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter()
@@ -496,25 +507,25 @@ KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter()
496 data->list.setAutoDelete( TRUE ); 507 data->list.setAutoDelete( TRUE );
497 delete data; 508 delete data;
498#endif 509#endif
499 if ( mRubberBand ) 510 if ( mRubberBand )
500 delete mRubberBand; 511 delete mRubberBand;
501} 512}
502 513
503 514
504#if QT_VERSION >= 232 515#if QT_VERSION >= 232
505void KDGanttMinimizeSplitter::init() 516void KDGanttMinimizeSplitter::init()
506{ 517{
507 data = new QSplitterData; 518 data = new QSplitterData;
508 if ( orient == Horizontal ) 519 if ( orient == Qt::Horizontal )
509 setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) ); 520 setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) );
510 else 521 else
511 setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) ); 522 setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) );
512#ifndef DESKTOP_VERSION 523#ifndef DESKTOP_VERSION
513 setOpaqueResize( false ); 524 setOpaqueResize( false );
514#else 525#else
515 setOpaqueResize( true ); 526 setOpaqueResize( true );
516#endif 527#endif
517} 528}
518#endif 529#endif
519 530
520 531
@@ -525,32 +536,32 @@ void KDGanttMinimizeSplitter::toggle()
525 else 536 else
526 qDebug("KDGanttMinimizeSplitter::toggle::sorry, handle not available "); 537 qDebug("KDGanttMinimizeSplitter::toggle::sorry, handle not available ");
527 538
528} 539}
529 540
530 541
531/*! 542/*!
532 \brief the orientation of the splitter 543 \brief the orientation of the splitter
533 544
534 By default the orientation is horizontal (the widgets are side by side). 545 By default the orientation is horizontal (the widgets are side by side).
535 The possible orientations are Qt:Vertical and Qt::Horizontal (the default). 546 The possible orientations are Qt:Vertical and Qt::Horizontal (the default).
536*/ 547*/
537void KDGanttMinimizeSplitter::setOrientation( Orientation o ) 548void KDGanttMinimizeSplitter::setOrientation( Qt::Orientation o )
538{ 549{
539#if QT_VERSION >= 232 550#if QT_VERSION >= 232
540 if ( orient == o ) 551 if ( orient == o )
541 return; 552 return;
542 orient = o; 553 orient = o;
543 554
544 if ( orient == Horizontal ) 555 if ( orient == Qt::Horizontal )
545 setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); 556 setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) );
546 else 557 else
547 setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) ); 558 setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
548 559
549 QSplitterLayoutStruct *s = data->list.first(); 560 QSplitterLayoutStruct *s = data->list.first();
550 while ( s ) { 561 while ( s ) {
551 if ( s->isSplitter ) 562 if ( s->isSplitter )
552 ((KDGanttSplitterHandle*)s->wid)->setOrientation( o ); 563 ((KDGanttSplitterHandle*)s->wid)->setOrientation( o );
553 s = data->list.next(); // ### next at end of loop, no iterator 564 s = data->list.next(); // ### next at end of loop, no iterator
554 } 565 }
555 recalc( isVisible() ); 566 recalc( isVisible() );
556#endif 567#endif
@@ -577,73 +588,79 @@ void KDGanttMinimizeSplitter::resizeEvent( QResizeEvent * )
577 needed.) 588 needed.)
578*/ 589*/
579QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( QWidget *w, bool first ) 590QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( QWidget *w, bool first )
580{ 591{
581 QSplitterLayoutStruct *s; 592 QSplitterLayoutStruct *s;
582 KDGanttSplitterHandle *newHandle = 0; 593 KDGanttSplitterHandle *newHandle = 0;
583 if ( data->list.count() > 0 ) { 594 if ( data->list.count() > 0 ) {
584 s = new QSplitterLayoutStruct; 595 s = new QSplitterLayoutStruct;
585 s->mode = KeepSize; 596 s->mode = KeepSize;
586 QString tmp = "qt_splithandle_"; 597 QString tmp = "qt_splithandle_";
587 tmp += w->name(); 598 tmp += w->name();
588 newHandle = new KDGanttSplitterHandle( orientation(), this, tmp.latin1() ); 599 newHandle = new KDGanttSplitterHandle( orientation(), this, tmp.latin1() );
589 if ( ! mFirstHandle ) 600 if ( ! mFirstHandle )
590 mFirstHandle = newHandle; 601 mFirstHandle = newHandle;
591 s->wid = newHandle; 602 s->wid = newHandle;
592 newHandle->setId(data->list.count()); 603 newHandle->setId(data->list.count());
593 s->isSplitter = TRUE; 604 s->isSplitter = TRUE;
594 s->sizer = pick( newHandle->sizeHint() ); 605 s->sizer = pick( newHandle->sizeHint() );
595 if ( first ) 606 if ( first )
596 data->list.insert( 0, s ); 607 data->list.insert( 0, s );
597 else 608 else
598 data->list.append( s ); 609 data->list.append( s );
599 } 610 }
600 s = new QSplitterLayoutStruct; 611 s = new QSplitterLayoutStruct;
601 s->mode = Stretch; 612 s->mode = Stretch;
602 s->wid = w; 613 s->wid = w;
603 if ( !testWState( WState_Resized ) && w->sizeHint().isValid() ) 614 if ( !testAttribute( Qt::WA_Resized ) && w->sizeHint().isValid() )
604 s->sizer = pick( w->sizeHint() ); 615 s->sizer = pick( w->sizeHint() );
605 else 616 else
606 s->sizer = pick( w->size() ); 617 s->sizer = pick( w->size() );
607 s->isSplitter = FALSE; 618 s->isSplitter = FALSE;
608 if ( first ) 619 if ( first )
609 data->list.insert( 0, s ); 620 data->list.insert( 0, s );
610 else 621 else
611 data->list.append( s ); 622 data->list.append( s );
612 if ( newHandle && isVisible() ) 623 if ( newHandle && isVisible() )
613 newHandle->show(); //will trigger sending of post events 624 newHandle->show(); //will trigger sending of post events
614 return s; 625 return s;
615} 626}
616 627
617 628
618/*! 629/*!
619 Tells the splitter that a child widget has been inserted or removed. 630 Tells the splitter that a child widget has been inserted or removed.
620 The event is passed in \a c. 631 The event is passed in \a c.
621*/ 632*/
622void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) 633void KDGanttMinimizeSplitter::childEvent( QChildEvent *c )
623{ 634{
624 if ( c->type() == QEvent::ChildInserted ) { 635 if ( c->type() == QEvent::ChildAdded ) {
625 if ( !c->child()->isWidgetType() ) 636 if ( !c->child()->isWidgetType() )
626 return; 637 return;
627 638
628 if ( ((QWidget*)c->child())->testWFlags( WType_TopLevel ) ) 639 QWidget *cw = (QWidget*)c->child();
640
641 if ( (cw->windowFlags())&Qt::Window )
642 return;
643
644 // avoid infinite recursion
645 if(cw->objectName().startsWith("qt_splithandle_"))
629 return; 646 return;
630 647
631 QSplitterLayoutStruct *s = data->list.first(); 648 QSplitterLayoutStruct *s = data->list.first();
632 while ( s ) { 649 while ( s ) {
633 if ( s->wid == c->child() ) 650 if ( s->wid == cw )
634 return; 651 return;
635 s = data->list.next(); 652 s = data->list.next();
636 } 653 }
637 addWidget( (QWidget*)c->child() ); 654 addWidget( cw );
638 recalc( isVisible() ); 655 recalc( isVisible() );
639 656
640 } else if ( c->type() == QEvent::ChildRemoved ) { 657 } else if ( c->type() == QEvent::ChildRemoved ) {
641 QSplitterLayoutStruct *p = 0; 658 QSplitterLayoutStruct *p = 0;
642 if ( data->list.count() > 1 ) 659 if ( data->list.count() > 1 )
643 p = data->list.at(1); //remove handle _after_ first widget. 660 p = data->list.at(1); //remove handle _after_ first widget.
644 QSplitterLayoutStruct *s = data->list.first(); 661 QSplitterLayoutStruct *s = data->list.first();
645 while ( s ) { 662 while ( s ) {
646 if ( s->wid == c->child() ) { 663 if ( s->wid == c->child() ) {
647 data->list.removeRef( s ); 664 data->list.removeRef( s );
648 delete s; 665 delete s;
649 if ( p && p->isSplitter ) { 666 if ( p && p->isSplitter ) {
@@ -661,110 +678,110 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c )
661 } 678 }
662} 679}
663 680
664 681
665/*! 682/*!
666 Shows a rubber band at position \a p. If \a p is negative, the 683 Shows a rubber band at position \a p. If \a p is negative, the
667 rubber band is removed. 684 rubber band is removed.
668*/ 685*/
669void KDGanttMinimizeSplitter::setRubberband( int p ) 686void KDGanttMinimizeSplitter::setRubberband( int p )
670{ 687{
671#ifdef DESKTOP_VERSION 688#ifdef DESKTOP_VERSION
672 QPainter paint( this ); 689 QPainter paint( this );
673 paint.setPen( gray ); 690 paint.setPen( Qt::gray );
674 paint.setBrush( gray ); 691 paint.setBrush( Qt::gray );
675 paint.setRasterOp( XorROP ); 692 paint.setCompositionMode( QPainter::CompositionMode_Xor );
676 QRect r = contentsRect(); 693 QRect r = contentsRect();
677 const int rBord = 3; //Themable???? 694 const int rBord = 3; //Themable????
678#if QT_VERSION >= 0x030000 695#if QT_VERSION >= 0x030000
679 int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); 696 int sw = style()->pixelMetric(QStyle::PM_SplitterWidth, 0, this);
680#else 697#else
681 int sw = style().splitterWidth(); 698 int sw = style().splitterWidth();
682#endif 699#endif
683 if ( orient == Horizontal ) { 700 if ( orient == Qt::Horizontal ) {
684 if ( opaqueOldPos >= 0 ) 701 if ( opaqueOldPos >= 0 )
685 paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(), 702 paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(),
686 2*rBord, r.height() ); 703 2*rBord, r.height() );
687 if ( p >= 0 ) 704 if ( p >= 0 )
688 paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() ); 705 paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() );
689 } else { 706 } else {
690 if ( opaqueOldPos >= 0 ) 707 if ( opaqueOldPos >= 0 )
691 paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord, 708 paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord,
692 r.width(), 2*rBord ); 709 r.width(), 2*rBord );
693 if ( p >= 0 ) 710 if ( p >= 0 )
694 paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord ); 711 paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );
695 } 712 }
696 opaqueOldPos = p; 713 opaqueOldPos = p;
697#else 714#else
698 if ( !mRubberBand ) { 715 if ( !mRubberBand ) {
699 mRubberBand = new KDRubberBand( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); 716 mRubberBand = new KDRubberBand( 0, "rubber", Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop);
700 mRubberBand->setFrameStyle( Box | Raised ); 717 mRubberBand->setFrameStyle( Box | Raised );
701 //mRubberBand->setPalette( QPalette ( Qt::red.light(),Qt::red.dark() ) ); 718 //mRubberBand->setPalette( QPalette ( Qt::red.light(),Qt::red.dark() ) );
702 mRubberBand->setPalette( QPalette ( colorGroup().background().light(), colorGroup().background().dark() )); 719 mRubberBand->setPalette( QPalette ( colorGroup().background().light(), colorGroup().background().dark() ));
703 } 720 }
704 QRect r = contentsRect(); 721 QRect r = contentsRect();
705 static int rBord = 0; //Themable???? 722 static int rBord = 0; //Themable????
706 if ( !rBord ) { 723 if ( !rBord ) {
707 if (QApplication::desktop()->width() <= 320 ) 724 if (QApplication::desktop()->width() <= 320 )
708 rBord = 3; 725 rBord = 3;
709 else 726 else
710 rBord = 4; 727 rBord = 4;
711 } 728 }
712 int sw = style().splitterWidth(); 729 int sw = style().splitterWidth();
713 if ( orient == Horizontal ) { 730 if ( orient == Qt::Horizontal ) {
714 if ( p >= 0 ) { 731 if ( p >= 0 ) {
715 QPoint geo = mapToGlobal (QPoint ( p + sw/2 - rBord, r.y())); 732 QPoint geo = mapToGlobal (QPoint ( p + sw/2 - rBord, r.y()));
716 mRubberBand->setGeometry( geo.x(), geo.y(), 2*rBord, r.height() ); 733 mRubberBand->setGeometry( geo.x(), geo.y(), 2*rBord, r.height() );
717 } 734 }
718 } else { 735 } else {
719 if ( p >= 0 ) { 736 if ( p >= 0 ) {
720 QPoint geo = mapToGlobal (QPoint ( r.x(), p + sw/2 - rBord)); 737 QPoint geo = mapToGlobal (QPoint ( r.x(), p + sw/2 - rBord));
721 mRubberBand->setGeometry( geo.x(), geo.y(), r.width(), 2*rBord); 738 mRubberBand->setGeometry( geo.x(), geo.y(), r.width(), 2*rBord);
722 } 739 }
723 } 740 }
724 opaqueOldPos = p; 741 opaqueOldPos = p;
725 if ( ! mRubberBand->isVisible() ) { 742 if ( ! mRubberBand->isVisible() ) {
726 mRubberBand->show(); 743 mRubberBand->show();
727 } 744 }
728#endif 745#endif
729} 746}
730 747
731 748
732/*! \reimp */ 749/*! \reimp */
733bool KDGanttMinimizeSplitter::event( QEvent *e ) 750bool KDGanttMinimizeSplitter::event( QEvent *e )
734{ 751{
735 if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) { 752 if ( e->type() == QEvent::LayoutRequest || ( e->type() == QEvent::Show && data->firstShow ) ) {
736 recalc( isVisible() ); 753 recalc( isVisible() );
737 if ( e->type() == QEvent::Show ) 754 if ( e->type() == QEvent::Show )
738 data->firstShow = FALSE; 755 data->firstShow = FALSE;
739 } 756 }
740 return QWidget::event( e ); 757 return QWidget::event( e );
741} 758}
742 759
743 760
744/*! 761/*!
745 \obsolete 762 \obsolete
746 763
747 Draws the splitter handle in the rectangle described by \a x, \a y, 764 Draws the splitter handle in the rectangle described by \a x, \a y,
748 \a w, \a h using painter \a p. 765 \a w, \a h using painter \a p.
749 \sa QStyle::drawPrimitive() 766 \sa QStyle::drawPrimitive()
750*/ 767*/
751void KDGanttMinimizeSplitter::drawSplitter( QPainter *p, 768void KDGanttMinimizeSplitter::drawSplitter( QPainter *p,
752 QCOORD x, QCOORD y, QCOORD w, QCOORD h ) 769 QCOORD x, QCOORD y, QCOORD w, QCOORD h )
753{ 770{
754#if 0 771#if 0
755 // LR 772 // LR
756 style().drawPrimitive(QStyle::PE_Splitter, p, QRect(x, y, w, h), colorGroup(), 773 style().drawPrimitive(QStyle::PE_Splitter, p, QRect(x, y, w, h), colorGroup(),
757 (orientation() == Qt::Horizontal ? 774 (orientation() == Qt::Horizontal ?
758 QStyle::Style_Horizontal : 0)); 775 QStyle::State_Horizontal : 0));
759#endif 776#endif
760} 777}
761 778
762 779
763/*! 780/*!
764 Returns the id of the splitter to the right of or below the widget \a w, 781 Returns the id of the splitter to the right of or below the widget \a w,
765 or 0 if there is no such splitter 782 or 0 if there is no such splitter
766 (i.e. it is either not in this KDGanttMinimizeSplitter or it is at the end). 783 (i.e. it is either not in this KDGanttMinimizeSplitter or it is at the end).
767*/ 784*/
768int KDGanttMinimizeSplitter::idAfter( QWidget* w ) const 785int KDGanttMinimizeSplitter::idAfter( QWidget* w ) const
769{ 786{
770 QSplitterLayoutStruct *s = data->list.first(); 787 QSplitterLayoutStruct *s = data->list.first();
@@ -787,43 +804,43 @@ int KDGanttMinimizeSplitter::idAfter( QWidget* w ) const
787 804
788 For Arabic and Hebrew the layout is reversed, and using this 805 For Arabic and Hebrew the layout is reversed, and using this
789 function to set the position of the splitter might lead to 806 function to set the position of the splitter might lead to
790 unexpected results, since in Arabic and Hebrew the position of 807 unexpected results, since in Arabic and Hebrew the position of
791 splitter one is to the left of the position of splitter zero. 808 splitter one is to the left of the position of splitter zero.
792 809
793 \sa idAfter() 810 \sa idAfter()
794*/ 811*/
795void KDGanttMinimizeSplitter::moveSplitter( QCOORD p, int id ) 812void KDGanttMinimizeSplitter::moveSplitter( QCOORD p, int id )
796{ 813{
797 p = adjustPos( p, id ); 814 p = adjustPos( p, id );
798 QSplitterLayoutStruct *s = data->list.at(id); 815 QSplitterLayoutStruct *s = data->list.at(id);
799 int oldP = orient == Horizontal ? s->wid->x() : s->wid->y(); 816 int oldP = orient == Qt::Horizontal ? s->wid->x() : s->wid->y();
800 bool upLeft; 817 bool upLeft;
801 if ( false && orient == Horizontal ) { 818 if ( false && orient == Qt::Horizontal ) {
802 p += s->wid->width(); 819 p += s->wid->width();
803 upLeft = p > oldP; 820 upLeft = p > oldP;
804 } else 821 } else
805 upLeft = p < oldP; 822 upLeft = p < oldP;
806 823
807 moveAfter( p, id, upLeft ); 824 moveAfter( p, id, upLeft );
808 moveBefore( p-1, id-1, upLeft ); 825 moveBefore( p-1, id-1, upLeft );
809 826
810 storeSizes(); 827 storeSizes();
811} 828}
812 829
813 830
814void KDGanttMinimizeSplitter::setG( QWidget *w, int p, int s, bool isSplitter ) 831void KDGanttMinimizeSplitter::setG( QWidget *w, int p, int s, bool isSplitter )
815{ 832{
816 if ( orient == Horizontal ) { 833 if ( orient == Qt::Horizontal ) {
817 if ( false && orient == Horizontal && !isSplitter ) 834 if ( false && orient == Qt::Horizontal && !isSplitter )
818 p = contentsRect().width() - p - s; 835 p = contentsRect().width() - p - s;
819 w->setGeometry( p, contentsRect().y(), s, contentsRect().height() ); 836 w->setGeometry( p, contentsRect().y(), s, contentsRect().height() );
820 } else 837 } else
821 w->setGeometry( contentsRect().x(), p, contentsRect().width(), s ); 838 w->setGeometry( contentsRect().x(), p, contentsRect().width(), s );
822} 839}
823 840
824 841
825/* 842/*
826 Places the right/bottom edge of the widget at \a id at position \a pos. 843 Places the right/bottom edge of the widget at \a id at position \a pos.
827 844
828 \sa idAfter() 845 \sa idAfter()
829*/ 846*/
@@ -831,41 +848,41 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft )
831{ 848{
832 if( id < 0 ) 849 if( id < 0 )
833 return; 850 return;
834 QSplitterLayoutStruct *s = data->list.at(id); 851 QSplitterLayoutStruct *s = data->list.at(id);
835 if ( !s ) 852 if ( !s )
836 return; 853 return;
837 QWidget *w = s->wid; 854 QWidget *w = s->wid;
838 if ( w->isHidden() ) { 855 if ( w->isHidden() ) {
839 moveBefore( pos, id-1, upLeft ); 856 moveBefore( pos, id-1, upLeft );
840 } else if ( s->isSplitter ) { 857 } else if ( s->isSplitter ) {
841 int pos1, pos2; 858 int pos1, pos2;
842 int dd = s->sizer; 859 int dd = s->sizer;
843 if( false && orient == Horizontal ) { 860 if( false && orient == Qt::Horizontal ) {
844 pos1 = pos; 861 pos1 = pos;
845 pos2 = pos + dd; 862 pos2 = pos + dd;
846 } else { 863 } else {
847 pos2 = pos - dd; 864 pos2 = pos - dd;
848 pos1 = pos2 + 1; 865 pos1 = pos2 + 1;
849 } 866 }
850 if ( upLeft ) { 867 if ( upLeft ) {
851 setG( w, pos1, dd, TRUE ); 868 setG( w, pos1, dd, TRUE );
852 moveBefore( pos2, id-1, upLeft ); 869 moveBefore( pos2, id-1, upLeft );
853 } else { 870 } else {
854 moveBefore( pos2, id-1, upLeft ); 871 moveBefore( pos2, id-1, upLeft );
855 setG( w, pos1, dd, TRUE ); 872 setG( w, pos1, dd, TRUE );
856 } 873 }
857 } else { 874 } else {
858 int dd, newLeft, nextPos; 875 int dd, newLeft, nextPos;
859 if( false && orient == Horizontal ) { 876 if( false && orient == Qt::Horizontal ) {
860 dd = w->geometry().right() - pos; 877 dd = w->geometry().right() - pos;
861 dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); 878 dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize())));
862 newLeft = pos+1; 879 newLeft = pos+1;
863 nextPos = newLeft + dd; 880 nextPos = newLeft + dd;
864 } else { 881 } else {
865 dd = pos - pick( w->pos() ) + 1; 882 dd = pos - pick( w->pos() ) + 1;
866 dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); 883 dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize())));
867 newLeft = pos-dd+1; 884 newLeft = pos-dd+1;
868 nextPos = newLeft - 1; 885 nextPos = newLeft - 1;
869 } 886 }
870 setG( w, newLeft, dd, TRUE ); 887 setG( w, newLeft, dd, TRUE );
871 moveBefore( nextPos, id-1, upLeft ); 888 moveBefore( nextPos, id-1, upLeft );
@@ -884,42 +901,42 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft )
884 data->list.at(id) : 0; 901 data->list.at(id) : 0;
885 if ( !s ) 902 if ( !s )
886 return; 903 return;
887 QWidget *w = s->wid; 904 QWidget *w = s->wid;
888 if ( w->isHidden() ) { 905 if ( w->isHidden() ) {
889 moveAfter( pos, id+1, upLeft ); 906 moveAfter( pos, id+1, upLeft );
890 } else if ( pick( w->pos() ) == pos ) { 907 } else if ( pick( w->pos() ) == pos ) {
891 //No need to do anything if it's already there. 908 //No need to do anything if it's already there.
892 return; 909 return;
893 } else if ( s->isSplitter ) { 910 } else if ( s->isSplitter ) {
894 int dd = s->sizer; 911 int dd = s->sizer;
895 int pos1, pos2; 912 int pos1, pos2;
896 if( false && orient == Horizontal ) { 913 if( false && orient == Qt::Horizontal ) {
897 pos2 = pos - dd; 914 pos2 = pos - dd;
898 pos1 = pos2 + 1; 915 pos1 = pos2 + 1;
899 } else { 916 } else {
900 pos1 = pos; 917 pos1 = pos;
901 pos2 = pos + dd; 918 pos2 = pos + dd;
902 } 919 }
903 if ( upLeft ) { 920 if ( upLeft ) {
904 setG( w, pos1, dd, TRUE ); 921 setG( w, pos1, dd, TRUE );
905 moveAfter( pos2, id+1, upLeft ); 922 moveAfter( pos2, id+1, upLeft );
906 } else { 923 } else {
907 moveAfter( pos2, id+1, upLeft ); 924 moveAfter( pos2, id+1, upLeft );
908 setG( w, pos1, dd, TRUE ); 925 setG( w, pos1, dd, TRUE );
909 } 926 }
910 } else { 927 } else {
911 int left = pick( w->pos() ); 928 int left = pick( w->pos() );
912 int right, dd,/* newRight,*/ newLeft, nextPos; 929 int right, dd,/* newRight,*/ newLeft, nextPos;
913 if ( false && orient == Horizontal ) { 930 if ( false && orient == Qt::Horizontal ) {
914 dd = pos - left + 1; 931 dd = pos - left + 1;
915 dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); 932 dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize())));
916 newLeft = pos-dd+1; 933 newLeft = pos-dd+1;
917 nextPos = newLeft - 1; 934 nextPos = newLeft - 1;
918 } else { 935 } else {
919 right = pick( w->geometry().bottomRight() ); 936 right = pick( w->geometry().bottomRight() );
920 dd = right - pos + 1; 937 dd = right - pos + 1;
921 dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); 938 dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize())));
922 /*newRight = pos+dd-1;*/ 939 /*newRight = pos+dd-1;*/
923 newLeft = pos; 940 newLeft = pos;
924 nextPos = newLeft + dd; 941 nextPos = newLeft + dd;
925 } 942 }
@@ -979,27 +996,27 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max )
979 QSplitterLayoutStruct *s = data->list.at(i); 996 QSplitterLayoutStruct *s = data->list.at(i);
980 if ( s->wid->isHidden() ) { 997 if ( s->wid->isHidden() ) {
981 //ignore 998 //ignore
982 } else if ( s->isSplitter ) { 999 } else if ( s->isSplitter ) {
983 minA += s->sizer; 1000 minA += s->sizer;
984 maxA += s->sizer; 1001 maxA += s->sizer;
985 } else { 1002 } else {
986 minA += pick( minSize(s->wid) ); 1003 minA += pick( minSize(s->wid) );
987 maxA += pick( s->wid->maximumSize() ); 1004 maxA += pick( s->wid->maximumSize() );
988 } 1005 }
989 } 1006 }
990 QRect r = contentsRect(); 1007 QRect r = contentsRect();
991 if ( orient == Horizontal && false ) { 1008 if ( orient == Qt::Horizontal && false ) {
992#if QT_VERSION >= 0x030000 1009#if QT_VERSION >= 0x030000
993 int splitterWidth = style().pixelMetric(QStyle::PM_SplitterWidth, this); 1010 int splitterWidth = style()->pixelMetric(QStyle::PM_SplitterWidth, 0,this);
994#else 1011#else
995 int splitterWidth = style().splitterWidth(); 1012 int splitterWidth = style().splitterWidth();
996#endif 1013#endif
997 1014
998 if ( min ) 1015 if ( min )
999 *min = pick(r.topRight()) - QMIN( maxB, pick(r.size())-minA ) - splitterWidth; 1016 *min = pick(r.topRight()) - QMIN( maxB, pick(r.size())-minA ) - splitterWidth;
1000 if ( max ) 1017 if ( max )
1001 *max = pick(r.topRight()) - QMAX( minB, pick(r.size())-maxA ) - splitterWidth; 1018 *max = pick(r.topRight()) - QMAX( minB, pick(r.size())-maxA ) - splitterWidth;
1002 } else { 1019 } else {
1003 if ( min ) 1020 if ( min )
1004 *min = pick(r.topLeft()) + QMAX( minB, pick(r.size())-maxA ); 1021 *min = pick(r.topLeft()) + QMAX( minB, pick(r.size())-maxA );
1005 if ( max ) 1022 if ( max )
@@ -1021,25 +1038,25 @@ int KDGanttMinimizeSplitter::adjustPos( int p, int id )
1021 getRange( id, &min, &max ); 1038 getRange( id, &min, &max );
1022 p = QMAX( min, QMIN( p, max ) ); 1039 p = QMAX( min, QMIN( p, max ) );
1023 1040
1024 return p; 1041 return p;
1025} 1042}
1026 1043
1027 1044
1028void KDGanttMinimizeSplitter::doResize() 1045void KDGanttMinimizeSplitter::doResize()
1029{ 1046{
1030 QRect r = contentsRect(); 1047 QRect r = contentsRect();
1031 int i; 1048 int i;
1032 int n = data->list.count(); 1049 int n = data->list.count();
1033 QMemArray<QLayoutStruct> a( n ); 1050 Q3MemArray<QLayoutStruct> a( n );
1034 for ( i = 0; i< n; i++ ) { 1051 for ( i = 0; i< n; i++ ) {
1035 a[i].init(); 1052 a[i].init();
1036 QSplitterLayoutStruct *s = data->list.at(i); 1053 QSplitterLayoutStruct *s = data->list.at(i);
1037 if ( s->wid->isHidden() ) { 1054 if ( s->wid->isHidden() ) {
1038 a[i].stretch = 0; 1055 a[i].stretch = 0;
1039 a[i].sizeHint = a[i].minimumSize = 0; 1056 a[i].sizeHint = a[i].minimumSize = 0;
1040 a[i].maximumSize = 0; 1057 a[i].maximumSize = 0;
1041 } else if ( s->isSplitter ) { 1058 } else if ( s->isSplitter ) {
1042 a[i].stretch = 0; 1059 a[i].stretch = 0;
1043 a[i].sizeHint = a[i].minimumSize = a[i].maximumSize = s->sizer; 1060 a[i].sizeHint = a[i].minimumSize = a[i].maximumSize = s->sizer;
1044 a[i].empty = FALSE; 1061 a[i].empty = FALSE;
1045 } else if ( s->mode == KeepSize ) { 1062 } else if ( s->mode == KeepSize ) {
@@ -1123,25 +1140,25 @@ void KDGanttMinimizeSplitter::recalc( bool update )
1123 // nested splitters; be nice 1140 // nested splitters; be nice
1124 maxl = maxt = 0; 1141 maxl = maxt = 0;
1125 } else { 1142 } else {
1126 // KDGanttMinimizeSplitter with no children yet 1143 // KDGanttMinimizeSplitter with no children yet
1127 maxl = QWIDGETSIZE_MAX; 1144 maxl = QWIDGETSIZE_MAX;
1128 } 1145 }
1129 } else { 1146 } else {
1130 maxl = QMIN( maxl, QWIDGETSIZE_MAX ); 1147 maxl = QMIN( maxl, QWIDGETSIZE_MAX );
1131 } 1148 }
1132 if ( maxt < mint ) 1149 if ( maxt < mint )
1133 maxt = mint; 1150 maxt = mint;
1134 1151
1135 if ( orient == Horizontal ) { 1152 if ( orient == Qt::Horizontal ) {
1136 setMaximumSize( maxl, maxt ); 1153 setMaximumSize( maxl, maxt );
1137 setMinimumSize( minl, mint ); 1154 setMinimumSize( minl, mint );
1138 } else { 1155 } else {
1139 setMaximumSize( maxt, maxl ); 1156 setMaximumSize( maxt, maxl );
1140 setMinimumSize( mint, minl ); 1157 setMinimumSize( mint, minl );
1141 } 1158 }
1142 if ( update ) 1159 if ( update )
1143 doResize(); 1160 doResize();
1144} 1161}
1145 1162
1146/*! 1163/*!
1147 Sets resize mode of \a w to \a mode. 1164 Sets resize mode of \a w to \a mode.
@@ -1258,72 +1275,66 @@ void KDGanttMinimizeSplitter::recalcId()
1258 ((KDGanttSplitterHandle*)s->wid)->setId(i); 1275 ((KDGanttSplitterHandle*)s->wid)->setId(i);
1259 } 1276 }
1260} 1277}
1261 1278
1262 1279
1263/*!\reimp 1280/*!\reimp
1264*/ 1281*/
1265QSize KDGanttMinimizeSplitter::sizeHint() const 1282QSize KDGanttMinimizeSplitter::sizeHint() const
1266{ 1283{
1267 constPolish(); 1284 constPolish();
1268 int l = 0; 1285 int l = 0;
1269 int t = 0; 1286 int t = 0;
1270 if ( children() ) { 1287 if ( !children().empty() ) {
1271 const QObjectList * c = children(); 1288 const QObjectList c = children();
1272 QObjectListIt it( *c ); 1289 for(QObjectList::const_iterator i=c.begin();i!=c.end();++i) {
1273 QObject * o; 1290 QObject * o = *i;
1274
1275 while( (o=it.current()) != 0 ) {
1276 ++it;
1277 if ( o->isWidgetType() && 1291 if ( o->isWidgetType() &&
1278 !((QWidget*)o)->isHidden() ) { 1292 !((QWidget*)o)->isHidden() ) {
1279 QSize s = ((QWidget*)o)->sizeHint(); 1293 QSize s = ((QWidget*)o)->sizeHint();
1280 if ( s.isValid() ) { 1294 if ( s.isValid() ) {
1281 l += pick( s ); 1295 l += pick( s );
1282 t = QMAX( t, trans( s ) ); 1296 t = QMAX( t, trans( s ) );
1283 } 1297 }
1284 } 1298 }
1285 } 1299 }
1286 } 1300 }
1287 return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); 1301 return orientation() == Qt::Horizontal ? QSize( l, t ) : QSize( t, l );
1288} 1302}
1289 1303
1290 1304
1291/*! 1305/*!
1292\reimp 1306\reimp
1293*/ 1307*/
1294 1308
1295QSize KDGanttMinimizeSplitter::minimumSizeHint() const 1309QSize KDGanttMinimizeSplitter::minimumSizeHint() const
1296{ 1310{
1297 constPolish(); 1311 constPolish();
1298 int l = 0; 1312 int l = 0;
1299 int t = 0; 1313 int t = 0;
1300 if ( children() ) { 1314 if ( !children().empty() ) {
1301 const QObjectList * c = children(); 1315 const QObjectList c = children();
1302 QObjectListIt it( *c ); 1316 for(QObjectList::const_iterator i=c.begin();i!=c.end();++i) {
1303 QObject * o; 1317 QObject * o = *i;
1304
1305 while( (o=it.current()) != 0 ) {
1306 ++it;
1307 if ( o->isWidgetType() && 1318 if ( o->isWidgetType() &&
1308 !((QWidget*)o)->isHidden() ) { 1319 !((QWidget*)o)->isHidden() ) {
1309 QSize s = minSizeHint((QWidget*)o); 1320 QSize s = minSizeHint((QWidget*)o);
1310 if ( s.isValid() ) { 1321 if ( s.isValid() ) {
1311 l += pick( s ); 1322 l += pick( s );
1312 t = QMAX( t, trans( s ) ); 1323 t = QMAX( t, trans( s ) );
1313 } 1324 }
1314 } 1325 }
1315 } 1326 }
1316 } 1327 }
1317 return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); 1328 return orientation() == Qt::Horizontal ? QSize( l, t ) : QSize( t, l );
1318} 1329}
1319 1330
1320 1331
1321/* 1332/*
1322 Calculates stretch parameters from current sizes 1333 Calculates stretch parameters from current sizes
1323*/ 1334*/
1324 1335
1325void KDGanttMinimizeSplitter::storeSizes() 1336void KDGanttMinimizeSplitter::storeSizes()
1326{ 1337{
1327 QSplitterLayoutStruct *s = data->list.first(); 1338 QSplitterLayoutStruct *s = data->list.first();
1328 while ( s ) { 1339 while ( s ) {
1329 if ( !s->isSplitter ) 1340 if ( !s->isSplitter )
@@ -1393,102 +1404,103 @@ bool KDGanttMinimizeSplitter::isHidden( QWidget *w ) const
1393 \code 1404 \code
1394 QValueList<int> list = mySplitter.sizes(); 1405 QValueList<int> list = mySplitter.sizes();
1395 QValueList<int>::Iterator it = list.begin(); 1406 QValueList<int>::Iterator it = list.begin();
1396 while( it != list.end() ) { 1407 while( it != list.end() ) {
1397 myProcessing( *it ); 1408 myProcessing( *it );
1398 ++it; 1409 ++it;
1399 } 1410 }
1400 \endcode 1411 \endcode
1401 1412
1402 \sa setSizes() 1413 \sa setSizes()
1403*/ 1414*/
1404 1415
1405QValueList<int> KDGanttMinimizeSplitter::sizes() const 1416Q3ValueList<int> KDGanttMinimizeSplitter::sizes() const
1406{ 1417{
1418 /* TODO: hacker
1407 if ( !testWState(WState_Polished) ) { 1419 if ( !testWState(WState_Polished) ) {
1408 QWidget* that = (QWidget*) this; 1420 QWidget* that = (QWidget*) this;
1409 that->polish(); 1421 that->polish();
1410 } 1422 } */
1411 QValueList<int> list; 1423 Q3ValueList<int> list;
1412 QSplitterLayoutStruct *s = data->list.first(); 1424 QSplitterLayoutStruct *s = data->list.first();
1413 while ( s ) { 1425 while ( s ) {
1414 if ( !s->isSplitter ) 1426 if ( !s->isSplitter )
1415 list.append( s->sizer ); 1427 list.append( s->sizer );
1416 s = data->list.next(); 1428 s = data->list.next();
1417 } 1429 }
1418 return list; 1430 return list;
1419} 1431}
1420 1432
1421 1433
1422 1434
1423/*! 1435/*!
1424 Sets the size parameters to the values given in \a list. 1436 Sets the size parameters to the values given in \a list.
1425 If the splitter is horizontal, the values set the sizes from 1437 If the splitter is horizontal, the values set the sizes from
1426 left to right. If it is vertical, the sizes are applied from 1438 left to right. If it is vertical, the sizes are applied from
1427 top to bottom. 1439 top to bottom.
1428 Extra values in \a list are ignored. 1440 Extra values in \a list are ignored.
1429 1441
1430 If \a list contains too few values, the result is undefined 1442 If \a list contains too few values, the result is undefined
1431 but the program will still be well-behaved. 1443 but the program will still be well-behaved.
1432 1444
1433 \sa sizes() 1445 \sa sizes()
1434*/ 1446*/
1435 1447
1436void KDGanttMinimizeSplitter::setSizes( QValueList<int> list ) 1448void KDGanttMinimizeSplitter::setSizes( Q3ValueList<int> list )
1437{ 1449{
1438 processChildEvents(); 1450 processChildEvents();
1439 QValueList<int>::Iterator it = list.begin(); 1451 Q3ValueList<int>::Iterator it = list.begin();
1440 QSplitterLayoutStruct *s = data->list.first(); 1452 QSplitterLayoutStruct *s = data->list.first();
1441 while ( s && it != list.end() ) { 1453 while ( s && it != list.end() ) {
1442 if ( !s->isSplitter ) { 1454 if ( !s->isSplitter ) {
1443 s->sizer = *it; 1455 s->sizer = *it;
1444 ++it; 1456 ++it;
1445 } 1457 }
1446 s = data->list.next(); 1458 s = data->list.next();
1447 } 1459 }
1448 doResize(); 1460 doResize();
1449} 1461}
1450 1462
1451 1463
1452/*! 1464/*!
1453 Gets all posted child events, ensuring that the internal state of 1465 Gets all posted child events, ensuring that the internal state of
1454 the splitter is consistent. 1466 the splitter is consistent.
1455*/ 1467*/
1456 1468
1457void KDGanttMinimizeSplitter::processChildEvents() 1469void KDGanttMinimizeSplitter::processChildEvents()
1458{ 1470{
1459 QApplication::sendPostedEvents( this, QEvent::ChildInserted ); 1471 QApplication::sendPostedEvents( this, QEvent::ChildAdded );
1460} 1472}
1461 1473
1462 1474
1463/*! 1475/*!
1464 \reimp 1476 \reimp
1465*/ 1477*/
1466 1478
1467void KDGanttMinimizeSplitter::styleChange( QStyle& old ) 1479void KDGanttMinimizeSplitter::styleChange( QStyle& old )
1468{ 1480{
1469 1481
1470#if QT_VERSION >= 0x030000 1482#if QT_VERSION >= 0x030000
1471 int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); 1483 int sw = style()->pixelMetric(QStyle::PM_SplitterWidth, 0, this);
1472#else 1484#else
1473 int sw = style().splitterWidth(); 1485 int sw = style().splitterWidth();
1474#endif 1486#endif
1475 QSplitterLayoutStruct *s = data->list.first(); 1487 QSplitterLayoutStruct *s = data->list.first();
1476 while ( s ) { 1488 while ( s ) {
1477 if ( s->isSplitter ) 1489 if ( s->isSplitter )
1478 s->sizer = sw; 1490 s->sizer = sw;
1479 s = data->list.next(); 1491 s = data->list.next();
1480 } 1492 }
1481 doResize(); 1493 doResize();
1482 QFrame::styleChange( old ); 1494 Q3Frame::styleChange( old );
1483} 1495}
1484 1496
1485#endif 1497#endif
1486 1498
1487/*! 1499/*!
1488 Specifies the direction of the minimize buttons. 1500 Specifies the direction of the minimize buttons.
1489 If the orientation of the splitter is horizontal then with 1501 If the orientation of the splitter is horizontal then with
1490 KDGanttMinimizeSplitter::Left or KDGanttMinimizeSplitter::Right should be used, 1502 KDGanttMinimizeSplitter::Left or KDGanttMinimizeSplitter::Right should be used,
1491 otherwise either KDGanttMinimizeSplitter::Up or KDGanttMinimizeSplitter::Down 1503 otherwise either KDGanttMinimizeSplitter::Up or KDGanttMinimizeSplitter::Down
1492 should be used. 1504 should be used.
1493*/ 1505*/
1494void KDGanttMinimizeSplitter::setMinimizeDirection( Direction direction ) 1506void KDGanttMinimizeSplitter::setMinimizeDirection( Direction direction )
@@ -1503,25 +1515,25 @@ KDGanttMinimizeSplitter::Direction KDGanttMinimizeSplitter::minimizeDirection()
1503{ 1515{
1504 return _direction; 1516 return _direction;
1505} 1517}
1506 1518
1507/* 1519/*
1508 This is a copy of qGeomCalc() in qlayoutengine.cpp which 1520 This is a copy of qGeomCalc() in qlayoutengine.cpp which
1509 unfortunately isn't exported. 1521 unfortunately isn't exported.
1510*/ 1522*/
1511static inline int toFixed( int i ) { return i * 256; } 1523static inline int toFixed( int i ) { return i * 256; }
1512static inline int fRound( int i ) { 1524static inline int fRound( int i ) {
1513 return ( i % 256 < 128 ) ? i / 256 : 1 + i / 256; 1525 return ( i % 256 < 128 ) ? i / 256 : 1 + i / 256;
1514} 1526}
1515void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, 1527void kdganttGeomCalc( Q3MemArray<QLayoutStruct> &chain, int start, int count, int pos,
1516 int space, int spacer ) 1528 int space, int spacer )
1517{ 1529{
1518 typedef int fixed; 1530 typedef int fixed;
1519 int cHint = 0; 1531 int cHint = 0;
1520 int cMin = 0; 1532 int cMin = 0;
1521 int cMax = 0; 1533 int cMax = 0;
1522 int sumStretch = 0; 1534 int sumStretch = 0;
1523 int spacerCount = 0; 1535 int spacerCount = 0;
1524 1536
1525 bool wannaGrow = FALSE; // anyone who really wants to grow? 1537 bool wannaGrow = FALSE; // anyone who really wants to grow?
1526 // bool canShrink = FALSE; // anyone who could be persuaded to shrink? 1538 // bool canShrink = FALSE; // anyone who could be persuaded to shrink?
1527 1539
diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h
index 3042e0a..338d965 100644
--- a/microkde/KDGanttMinimizeSplitter.h
+++ b/microkde/KDGanttMinimizeSplitter.h
@@ -1,12 +1,19 @@
1//Added by qt3to4:
2#include <Q3PointArray>
3#include <QPaintEvent>
4#include <QResizeEvent>
5#include <QChildEvent>
6#include <QMouseEvent>
7#include <QEvent>
1/* -*- Mode: C++ -*- 8/* -*- Mode: C++ -*-
2 $Id$ 9 $Id$
3*/ 10*/
4 11
5/**************************************************************************** 12/****************************************************************************
6 ** Copyright (C) 2001-2004 Klarälvdalens Datakonsult AB. All rights reserved. 13 ** Copyright (C) 2001-2004 Klarälvdalens Datakonsult AB. All rights reserved.
7 ** 14 **
8 ** This file is part of the KDGantt library. 15 ** This file is part of the KDGantt library.
9 ** 16 **
10 ** This file may be distributed and/or modified under the terms of the 17 ** This file may be distributed and/or modified under the terms of the
11 ** GNU General Public License version 2 as published by the Free Software 18 ** GNU General Public License version 2 as published by the Free Software
12 ** Foundation and appearing in the file LICENSE.GPL included in the 19 ** Foundation and appearing in the file LICENSE.GPL included in the
@@ -26,68 +33,68 @@
26 ** licensing are not clear to you. 33 ** licensing are not clear to you.
27 ** 34 **
28 ** As a special exception, permission is given to link this program 35 ** As a special exception, permission is given to link this program
29 ** with any edition of Qt, and distribute the resulting executable, 36 ** with any edition of Qt, and distribute the resulting executable,
30 ** without including the source code for Qt in the source distribution. 37 ** without including the source code for Qt in the source distribution.
31 ** 38 **
32 **********************************************************************/ 39 **********************************************************************/
33 40
34#ifndef KDGANTTMINIMIZESPLITTER_H 41#ifndef KDGANTTMINIMIZESPLITTER_H
35#define KDGANTTMINIMIZESPLITTER_H 42#define KDGANTTMINIMIZESPLITTER_H
36 43
37#ifndef QT_H 44#ifndef QT_H
38#include "qframe.h" 45#include "q3frame.h"
39#include "qvaluelist.h" 46#include "q3valuelist.h"
40#endif // QT_H 47#endif // QT_H
41 48
42#ifndef QT_NO_SPLITTER___ 49#ifndef QT_NO_SPLITTER___
43class QSplitterData; 50class QSplitterData;
44class QSplitterLayoutStruct; 51class QSplitterLayoutStruct;
45class KDGanttSplitterHandle; 52class KDGanttSplitterHandle;
46class KDRubberBand; 53class KDRubberBand;
47class KDGanttMinimizeSplitter : public QFrame 54class KDGanttMinimizeSplitter : public Q3Frame
48{ 55{
49 Q_OBJECT 56 Q_OBJECT
50 // Q_ENUMS( Direction ) 57 // Q_ENUMS( Direction )
51 // Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) 58 // Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation )
52 // Q_PROPERTY( Direction minimizeDirection READ minimizeDirection WRITE setMinimizeDirection ) 59 // Q_PROPERTY( Direction minimizeDirection READ minimizeDirection WRITE setMinimizeDirection )
53 60
54public: 61public:
55 enum ResizeMode { Stretch, KeepSize, FollowSizeHint }; 62 enum ResizeMode { Stretch, KeepSize, FollowSizeHint };
56 enum Direction { Left, Right, Up, Down }; 63 enum Direction { Left, Right, Up, Down };
57 64
58 KDGanttMinimizeSplitter( QWidget* parent=0, const char* name=0 ); 65 KDGanttMinimizeSplitter( QWidget* parent=0, const char* name=0 );
59 KDGanttMinimizeSplitter( Orientation, QWidget* parent=0, const char* name=0 ); 66 KDGanttMinimizeSplitter( Qt::Orientation, QWidget* parent=0, const char* name=0 );
60 ~KDGanttMinimizeSplitter(); 67 ~KDGanttMinimizeSplitter();
61 68
62 virtual void setOrientation( Orientation ); 69 virtual void setOrientation( Qt::Orientation );
63 Orientation orientation() const { return orient; } 70 Qt::Orientation orientation() const { return orient; }
64 71
65 void setMinimizeDirection( Direction ); 72 void setMinimizeDirection( Direction );
66 Direction minimizeDirection() const; 73 Direction minimizeDirection() const;
67 74
68#if QT_VERSION >= 232 75#if QT_VERSION >= 232
69 virtual void setResizeMode( QWidget *w, ResizeMode ); 76 virtual void setResizeMode( QWidget *w, ResizeMode );
70 virtual void setOpaqueResize( bool = TRUE ); 77 virtual void setOpaqueResize( bool = TRUE );
71 bool opaqueResize() const; 78 bool opaqueResize() const;
72 79
73 void moveToFirst( QWidget * ); 80 void moveToFirst( QWidget * );
74 void moveToLast( QWidget * ); 81 void moveToLast( QWidget * );
75 82
76 void refresh() { recalc( TRUE ); } 83 void refresh() { recalc( TRUE ); }
77 QSize sizeHint() const; 84 QSize sizeHint() const;
78 QSize minimumSizeHint() const; 85 QSize minimumSizeHint() const;
79 86
80 QValueList<int> sizes() const; 87 Q3ValueList<int> sizes() const;
81 void setSizes( QValueList<int> ); 88 void setSizes( Q3ValueList<int> );
82 KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} 89 KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;}
83 void expandPos( int id, int* min, int* max ); 90 void expandPos( int id, int* min, int* max );
84 KDRubberBand* rubberBand() { return mRubberBand ;} 91 KDRubberBand* rubberBand() { return mRubberBand ;}
85public slots: 92public slots:
86 void toggle(); 93 void toggle();
87protected: 94protected:
88 void childEvent( QChildEvent * ); 95 void childEvent( QChildEvent * );
89 96
90 bool event( QEvent * ); 97 bool event( QEvent * );
91 void resizeEvent( QResizeEvent * ); 98 void resizeEvent( QResizeEvent * );
92 99
93 int idAfter( QWidget* ) const; 100 int idAfter( QWidget* ) const;
@@ -105,38 +112,38 @@ private:
105 void init(); 112 void init();
106 void recalc( bool update = FALSE ); 113 void recalc( bool update = FALSE );
107 void doResize(); 114 void doResize();
108 void storeSizes(); 115 void storeSizes();
109 void processChildEvents(); 116 void processChildEvents();
110 QSplitterLayoutStruct *addWidget( QWidget*, bool first = FALSE ); 117 QSplitterLayoutStruct *addWidget( QWidget*, bool first = FALSE );
111 void recalcId(); 118 void recalcId();
112 void moveBefore( int pos, int id, bool upLeft ); 119 void moveBefore( int pos, int id, bool upLeft );
113 void moveAfter( int pos, int id, bool upLeft ); 120 void moveAfter( int pos, int id, bool upLeft );
114 void setG( QWidget *w, int p, int s, bool isSplitter = FALSE ); 121 void setG( QWidget *w, int p, int s, bool isSplitter = FALSE );
115 122
116 QCOORD pick( const QPoint &p ) const 123 QCOORD pick( const QPoint &p ) const
117 { return orient == Horizontal ? p.x() : p.y(); } 124 { return orient == Qt::Horizontal ? p.x() : p.y(); }
118 QCOORD pick( const QSize &s ) const 125 QCOORD pick( const QSize &s ) const
119 { return orient == Horizontal ? s.width() : s.height(); } 126 { return orient == Qt::Horizontal ? s.width() : s.height(); }
120 127
121 QCOORD trans( const QPoint &p ) const 128 QCOORD trans( const QPoint &p ) const
122 { return orient == Vertical ? p.x() : p.y(); } 129 { return orient == Qt::Vertical ? p.x() : p.y(); }
123 QCOORD trans( const QSize &s ) const 130 QCOORD trans( const QSize &s ) const
124 { return orient == Vertical ? s.width() : s.height(); } 131 { return orient == Qt::Vertical ? s.width() : s.height(); }
125 KDGanttSplitterHandle* mFirstHandle; 132 KDGanttSplitterHandle* mFirstHandle;
126 QSplitterData *data; 133 QSplitterData *data;
127#endif 134#endif
128 135
129private: 136private:
130 Orientation orient; 137 Qt::Orientation orient;
131 Direction _direction; 138 Direction _direction;
132#ifndef DOXYGEN_SKIP_INTERNAL 139#ifndef DOXYGEN_SKIP_INTERNAL
133 friend class KDGanttSplitterHandle; 140 friend class KDGanttSplitterHandle;
134#endif 141#endif
135 private:// Disabled copy constructor and operator= 142 private:// Disabled copy constructor and operator=
136#if defined(Q_DISABLE_COPY) 143#if defined(Q_DISABLE_COPY)
137 KDGanttMinimizeSplitter( const KDGanttMinimizeSplitter & ); 144 KDGanttMinimizeSplitter( const KDGanttMinimizeSplitter & );
138 KDGanttMinimizeSplitter& operator=( const KDGanttMinimizeSplitter & ); 145 KDGanttMinimizeSplitter& operator=( const KDGanttMinimizeSplitter & );
139#endif 146#endif
140}; 147};
141 148
142#ifndef DOXYGEN_SKIP_INTERNAL 149#ifndef DOXYGEN_SKIP_INTERNAL
@@ -154,25 +161,25 @@ public:
154 void setOrientation( Qt::Orientation o ); 161 void setOrientation( Qt::Orientation o );
155 Qt::Orientation orientation() const { return orient; } 162 Qt::Orientation orientation() const { return orient; }
156 163
157 bool opaque() const { return s->opaqueResize(); } 164 bool opaque() const { return s->opaqueResize(); }
158 165
159 QSize sizeHint() const; 166 QSize sizeHint() const;
160 void toggle(); 167 void toggle();
161 168
162 int id() const { return myId; } // data->list.at(id())->wid == this 169 int id() const { return myId; } // data->list.at(id())->wid == this
163 void setId( int i ) { myId = i; } 170 void setId( int i ) { myId = i; }
164 171
165protected: 172protected:
166 QValueList<QPointArray> buttonRegions(); 173 Q3ValueList<Q3PointArray> buttonRegions();
167 void paintEvent( QPaintEvent * ); 174 void paintEvent( QPaintEvent * );
168 void mouseMoveEvent( QMouseEvent * ); 175 void mouseMoveEvent( QMouseEvent * );
169 void mousePressEvent( QMouseEvent * ); 176 void mousePressEvent( QMouseEvent * );
170 void mouseReleaseEvent( QMouseEvent * ); 177 void mouseReleaseEvent( QMouseEvent * );
171 int onButton( const QPoint& p ); 178 int onButton( const QPoint& p );
172 void updateCursor( const QPoint& p ); 179 void updateCursor( const QPoint& p );
173 180
174private: 181private:
175 bool mMouseDown; 182 bool mMouseDown;
176 QSize mSizeHint; 183 QSize mSizeHint;
177 bool mUseOffset; 184 bool mUseOffset;
178 Qt::Orientation orient; 185 Qt::Orientation orient;
diff --git a/microkde/fncolordialog.h b/microkde/fncolordialog.h
index 615d2ed..52356be 100755
--- a/microkde/fncolordialog.h
+++ b/microkde/fncolordialog.h
@@ -26,30 +26,30 @@
26#include <qwidget.h> 26#include <qwidget.h>
27#include <qpixmap.h> 27#include <qpixmap.h>
28#include <qpainter.h> 28#include <qpainter.h>
29#include <qcolor.h> 29#include <qcolor.h>
30#include <qdialog.h> 30#include <qdialog.h>
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qslider.h> 32#include <qslider.h>
33#include <qspinbox.h> 33#include <qspinbox.h>
34 34
35//----------------------------------------------------------------------------- 35//-----------------------------------------------------------------------------
36// FNPaletteBase 36// FNPaletteBase
37//----------------------------------------------------------------------------- 37//-----------------------------------------------------------------------------
38class Q_EXPORT FNPaletteBase : public QWidget 38class /* Q_EXPORT */ FNPaletteBase : public QWidget
39{ 39{
40 Q_OBJECT 40 Q_OBJECT
41public: 41public:
42 42
43 FNPaletteBase(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); 43 FNPaletteBase(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0);
44 44
45 45
46 virtual ~FNPaletteBase(); 46 virtual ~FNPaletteBase();
47 47
48 48
49 void setBGColor(QColor c) { 49 void setBGColor(QColor c) {
50 bgcolor_ = c; 50 bgcolor_ = c;
51 selection_ = c; 51 selection_ = c;
52 redraw(); 52 redraw();
53 }; 53 };
54 QColor color() const { 54 QColor color() const {
55 return selection_; 55 return selection_;
@@ -69,62 +69,62 @@ private:
69 bool _isblock; 69 bool _isblock;
70 70
71signals: 71signals:
72 void clicked(FNPaletteBase* sender); 72 void clicked(FNPaletteBase* sender);
73}; 73};
74 74
75 75
76 76
77 77
78//----------------------------------------------------------------------------- 78//-----------------------------------------------------------------------------
79// FNColorPalette 79// FNColorPalette
80//----------------------------------------------------------------------------- 80//-----------------------------------------------------------------------------
81class Q_EXPORT FNColorPalette : public FNPaletteBase 81class /* Q_EXPORT */ FNColorPalette : public FNPaletteBase
82{ 82{
83 Q_OBJECT 83 Q_OBJECT
84public: 84public:
85 FNColorPalette(QColor c, QWidget* parent = 0, const char* name = 0, WFlags fl = 0); 85 FNColorPalette(QColor c, QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0);
86 virtual ~FNColorPalette(); 86 virtual ~FNColorPalette();
87}; 87};
88 88
89 89
90 90
91 91
92//----------------------------------------------------------------------------- 92//-----------------------------------------------------------------------------
93// FNHSVPalette 93// FNHSVPalette
94//----------------------------------------------------------------------------- 94//-----------------------------------------------------------------------------
95class Q_EXPORT FNHSVPalette : public FNPaletteBase 95class /*Q_EXPORT */ FNHSVPalette : public FNPaletteBase
96{ 96{
97 Q_OBJECT 97 Q_OBJECT
98public: 98public:
99 FNHSVPalette(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); 99 FNHSVPalette(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0);
100 virtual ~FNHSVPalette(); 100 virtual ~FNHSVPalette();
101public slots: 101public slots:
102 void hueChanged(int v); 102 void hueChanged(int v);
103protected: 103protected:
104 virtual void drawImpl(QPainter& pa); 104 virtual void drawImpl(QPainter& pa);
105 int _hue; 105 int _hue;
106}; 106};
107 107
108 108
109 109
110 110
111//----------------------------------------------------------------------------- 111//-----------------------------------------------------------------------------
112// FNColorDialog 112// FNColorDialog
113//----------------------------------------------------------------------------- 113//-----------------------------------------------------------------------------
114class Q_EXPORT FNColorDialog : public QDialog 114class /*Q_EXPORT */FNColorDialog : public QDialog
115{ 115{
116 Q_OBJECT 116 Q_OBJECT
117public: 117public:
118 FNColorDialog(QWidget* parent=0, const char* name=0, WFlags f=0); 118 FNColorDialog(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
119 virtual ~FNColorDialog(); 119 virtual ~FNColorDialog();
120 void setColor(QColor c); 120 void setColor(QColor c);
121 QColor color() const; 121 QColor color() const;
122public slots: 122public slots:
123 virtual void basePaletteClicked(FNPaletteBase*); 123 virtual void basePaletteClicked(FNPaletteBase*);
124 virtual void hsvPaletteClicked(FNPaletteBase*); 124 virtual void hsvPaletteClicked(FNPaletteBase*);
125 void rgbChanged(int); 125 void rgbChanged(int);
126private: 126private:
127 FNHSVPalette* _palette; 127 FNHSVPalette* _palette;
128 FNColorPalette* _base[16]; 128 FNColorPalette* _base[16];
129 QSlider* _hue; 129 QSlider* _hue;
130 FNColorPalette* _select; 130 FNColorPalette* _select;
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp
index d7c12bb..b058d54 100644
--- a/microkde/kapplication.cpp
+++ b/microkde/kapplication.cpp
@@ -1,25 +1,28 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <stdio.h> 2#include <stdio.h>
3 3
4#include "kapplication.h" 4#include "kapplication.h"
5#include "ktextedit.h" 5#include "ktextedit.h"
6#include <qapplication.h> 6#include <qapplication.h>
7#include <qstring.h> 7#include <qstring.h>
8#include <qfile.h> 8#include <qfile.h>
9#include <qtextstream.h> 9#include <q3textstream.h>
10#include <qdialog.h> 10#include <qdialog.h>
11#include <qlayout.h> 11#include <qlayout.h>
12#include <qtextbrowser.h> 12#include <q3textbrowser.h>
13#include <qregexp.h> 13#include <qregexp.h>
14#include <QDesktopWidget>
15//Added by qt3to4:
16#include <Q3VBoxLayout>
14 17
15int KApplication::random() 18int KApplication::random()
16{ 19{
17 return rand(); 20 return rand();
18} 21}
19 22
20//US 23//US
21QString KApplication::randomString(int length) 24QString KApplication::randomString(int length)
22{ 25{
23 if (length <=0 ) return QString::null; 26 if (length <=0 ) return QString::null;
24 27
25 QString str; 28 QString str;
@@ -66,99 +69,99 @@ void KApplication::testCoords( int* x, int* y, int* wid, int * hei )
66} 69}
67void KApplication::showFile(QString caption, QString fn) 70void KApplication::showFile(QString caption, QString fn)
68{ 71{
69 QString text; 72 QString text;
70 QString fileName; 73 QString fileName;
71#ifndef DESKTOP_VERSION 74#ifndef DESKTOP_VERSION
72 fileName = getenv("QPEDIR"); 75 fileName = getenv("QPEDIR");
73 fileName += "/pics/" + fn ; 76 fileName += "/pics/" + fn ;
74#else 77#else
75 fileName = qApp->applicationDirPath () + "/" + fn; 78 fileName = qApp->applicationDirPath () + "/" + fn;
76#endif 79#endif
77 QFile file( fileName ); 80 QFile file( fileName );
78 if (!file.open( IO_ReadOnly ) ) { 81 if (!file.open( QIODevice::ReadOnly ) ) {
79 return ; 82 return ;
80 } 83 }
81 QTextStream ts( &file ); 84 Q3TextStream ts( &file );
82 text = ts.read(); 85 text = ts.read();
83 file.close(); 86 file.close();
84 KApplication::showText( caption, text ); 87 KApplication::showText( caption, text );
85 88
86} 89}
87 90
88bool KApplication::convert2latin1(QString fileName) 91bool KApplication::convert2latin1(QString fileName)
89{ 92{
90 QString text; 93 QString text;
91 QFile file( fileName ); 94 QFile file( fileName );
92 if (!file.open( IO_ReadOnly ) ) { 95 if (!file.open( QIODevice::ReadOnly ) ) {
93 return false; 96 return false;
94 97
95 } 98 }
96 QTextStream ts( &file ); 99 Q3TextStream ts( &file );
97 ts.setEncoding( QTextStream::UnicodeUTF8 ); 100 ts.setEncoding( Q3TextStream::UnicodeUTF8 );
98 text = ts.read(); 101 text = ts.read();
99 file.close(); 102 file.close();
100 if (!file.open( IO_WriteOnly ) ) { 103 if (!file.open( QIODevice::WriteOnly ) ) {
101 return false; 104 return false;
102 } 105 }
103 QTextStream tsIn( &file ); 106 Q3TextStream tsIn( &file );
104 tsIn.setEncoding( QTextStream::Latin1 ); 107 tsIn.setEncoding( Q3TextStream::Latin1 );
105 tsIn << text.latin1(); 108 tsIn << text.latin1();
106 file.close(); 109 file.close();
107 return true; 110 return true;
108 111
109 112
110} 113}
111void KApplication::showText(QString caption, QString text) 114void KApplication::showText(QString caption, QString text)
112{ 115{
113 QDialog dia( 0, "name", true ); ; 116 QDialog dia( 0, "name", true ); ;
114 dia.setCaption( caption ); 117 dia.setCaption( caption );
115 QVBoxLayout* lay = new QVBoxLayout( &dia ); 118 Q3VBoxLayout* lay = new Q3VBoxLayout( &dia );
116 lay->setSpacing( 3 ); 119 lay->setSpacing( 3 );
117 lay->setMargin( 3 ); 120 lay->setMargin( 3 );
118 KTextEdit tb ( &dia ); 121 KTextEdit tb ( &dia );
119 tb.setWordWrap( QMultiLineEdit::WidgetWidth ); 122 tb.setWordWrap( Q3MultiLineEdit::WidgetWidth );
120 lay->addWidget( &tb ); 123 lay->addWidget( &tb );
121 tb.setText( text ); 124 tb.setText( text );
122#ifdef DESKTOP_VERSION 125#ifdef DESKTOP_VERSION
123 dia.resize( 640, 480); 126 dia.resize( 640, 480);
124#else 127#else
125 dia.showMaximized(); 128 dia.showMaximized();
126#endif 129#endif
127 dia.exec(); 130 dia.exec();
128 131
129} 132}
130 133
131#include <qlabel.h> 134#include <qlabel.h>
132#include <qpushbutton.h> 135#include <qpushbutton.h>
133#include <qlayout.h> 136#include <qlayout.h>
134#include <qdir.h> 137#include <qdir.h>
135#include <qradiobutton.h> 138#include <qradiobutton.h>
136#include <qbuttongroup.h> 139#include <q3buttongroup.h>
137#include "kglobal.h" 140#include "kglobal.h"
138#include "klocale.h" 141#include "klocale.h"
139 142
140class KBackupPrefs : public QDialog 143class KBackupPrefs : public QDialog
141{ 144{
142 public: 145 public:
143 KBackupPrefs( QString message , QWidget *parent=0, const char *name=0 ) : 146 KBackupPrefs( QString message , QWidget *parent=0, const char *name=0 ) :
144 QDialog( parent, name, true ) 147 QDialog( parent, name, true )
145 { 148 {
146 setCaption( i18n("Backup Failed!") ); 149 setCaption( i18n("Backup Failed!") );
147 QVBoxLayout* lay = new QVBoxLayout( this ); 150 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
148 lay->setSpacing( 3 ); 151 lay->setSpacing( 3 );
149 lay->setMargin( 3 ); 152 lay->setMargin( 3 );
150 QLabel * lab = new QLabel( message, this ); 153 QLabel * lab = new QLabel( message, this );
151 lay->addWidget( lab ); 154 lay->addWidget( lab );
152 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Choose action"), this ); 155 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Choose action"), this );
153 lay->addWidget( format ); 156 lay->addWidget( format );
154 format->setExclusive ( true ) ; 157 format->setExclusive ( true ) ;
155 vcal = new QRadioButton(i18n("Try again now"), format ); 158 vcal = new QRadioButton(i18n("Try again now"), format );
156 tcal = new QRadioButton(i18n("Try again later"), format ); 159 tcal = new QRadioButton(i18n("Try again later"), format );
157 ical = new QRadioButton(i18n("Try again tomorrow"), format ); 160 ical = new QRadioButton(i18n("Try again tomorrow"), format );
158 ocal = new QRadioButton(i18n("Disable backup"), format ); 161 ocal = new QRadioButton(i18n("Disable backup"), format );
159 vcal->setChecked( true ); 162 vcal->setChecked( true );
160 QPushButton * ok = new QPushButton( i18n("OK"), this ); 163 QPushButton * ok = new QPushButton( i18n("OK"), this );
161 lay->addWidget(ok ); 164 lay->addWidget(ok );
162 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 165 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
163 } 166 }
164 167
diff --git a/microkde/kcolorbutton.cpp b/microkde/kcolorbutton.cpp
index 197bea2..16618fc 100644
--- a/microkde/kcolorbutton.cpp
+++ b/microkde/kcolorbutton.cpp
@@ -1,20 +1,23 @@
1#include "kcolorbutton.h" 1#include "kcolorbutton.h"
2#include "kcolordialog.h" 2#include "kcolordialog.h"
3#include "qapplication.h" 3#include "qapplication.h"
4#include <QDesktopWidget>
4 5
5 6
6#include "qlayout.h" 7#include "qlayout.h"
7#ifdef DESKTOP_VERSION 8#ifdef DESKTOP_VERSION
8#include <qcolordialog.h> 9#include <qcolordialog.h>
10//Added by qt3to4:
11#include <QPixmap>
9#endif 12#endif
10void KColorButton:: edit() 13void KColorButton:: edit()
11{ 14{
12 15
13#ifdef DESKTOP_VERSION 16#ifdef DESKTOP_VERSION
14 QColor col = QColorDialog::getColor ( mColor ); 17 QColor col = QColorDialog::getColor ( mColor );
15 if ( col.isValid () ) { 18 if ( col.isValid () ) {
16 mColor = col; 19 mColor = col;
17 setColor ( mColor ); 20 setColor ( mColor );
18 emit changed ( mColor ); 21 emit changed ( mColor );
19 emit changedID ( mColor, id ); 22 emit changedID ( mColor, id );
20 } 23 }
diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp
index 940196e..12063ca 100644
--- a/microkde/kconfig.cpp
+++ b/microkde/kconfig.cpp
@@ -1,15 +1,17 @@
1#include <qfile.h> 1#include <qfile.h>
2#include <qtextstream.h> 2#include <q3textstream.h>
3#include <qwidget.h> 3#include <qwidget.h>
4//Added by qt3to4:
5#include <Q3ValueList>
4 6
5#include "kdebug.h" 7#include "kdebug.h"
6 8
7#include "kurl.h" 9#include "kurl.h"
8#include "kstandarddirs.h" 10#include "kstandarddirs.h"
9#include "kconfig.h" 11#include "kconfig.h"
10 12
11QString KConfig::mGroup = ""; 13QString KConfig::mGroup = "";
12//QString KConfig::mGroup = "General"; 14//QString KConfig::mGroup = "General";
13 15
14KConfig::KConfig( const QString &fileName ) 16KConfig::KConfig( const QString &fileName )
15 : mFileName( fileName ), mDirty( false ) 17 : mFileName( fileName ), mDirty( false )
@@ -44,29 +46,29 @@ void KConfig::setGroup( const QString &group )
44 46
45 mGroup = group; 47 mGroup = group;
46 48
47 if ( mGroup.right( 1 ) != "/" ) mGroup += "/"; 49 if ( mGroup.right( 1 ) != "/" ) mGroup += "/";
48} 50}
49 51
50//US 52//US
51QString KConfig::group() const { 53QString KConfig::group() const {
52 return mGroup; 54 return mGroup;
53} 55}
54 56
55//US added method 57//US added method
56QValueList<int> KConfig::readIntListEntry( const QString & key) 58Q3ValueList<int> KConfig::readIntListEntry( const QString & key)
57{ 59{
58// qDebug("KConfig::readIntListEntry key=%s:", key.latin1()); 60// qDebug("KConfig::readIntListEntry key=%s:", key.latin1());
59 61
60 QValueList<int> result; 62 Q3ValueList<int> result;
61 63
62 QMap<QString,QString>::ConstIterator mit = mStringMap.find( mGroup + key ); 64 QMap<QString,QString>::ConstIterator mit = mStringMap.find( mGroup + key );
63 65
64 if ( mit == mStringMap.end() ) { 66 if ( mit == mStringMap.end() ) {
65 return result; 67 return result;
66 } 68 }
67 69
68 QStringList valuesAsStrings = QStringList::split(":", *mit ); 70 QStringList valuesAsStrings = QStringList::split(":", *mit );
69 bool ok = false; 71 bool ok = false;
70 bool ok2 = true; 72 bool ok2 = true;
71 int val; 73 int val;
72 74
@@ -102,25 +104,25 @@ QString KConfig::readEntry( const QString &key, const QString &def )
102{ 104{
103 QMap<QString,QString>::ConstIterator it = mStringMap.find( mGroup + key ); 105 QMap<QString,QString>::ConstIterator it = mStringMap.find( mGroup + key );
104 106
105 if ( it == mStringMap.end() ) { 107 if ( it == mStringMap.end() ) {
106 return def; 108 return def;
107 } 109 }
108 110
109 return QString::fromUtf8((*it).latin1()); 111 return QString::fromUtf8((*it).latin1());
110} 112}
111 113
112QSize KConfig::readSizeEntry( const QString &key, QSize* def ) 114QSize KConfig::readSizeEntry( const QString &key, QSize* def )
113{ 115{
114 QValueList<int> intlist = readIntListEntry(key); 116 Q3ValueList<int> intlist = readIntListEntry(key);
115 117
116 if (intlist.count() < 2) 118 if (intlist.count() < 2)
117 { 119 {
118 if (def) 120 if (def)
119 return *def; 121 return *def;
120 else 122 else
121 return QSize(); 123 return QSize();
122 } 124 }
123 125
124 QSize ret; 126 QSize ret;
125 ret.setWidth(intlist[0]); 127 ret.setWidth(intlist[0]);
126 ret.setHeight(intlist[1]); 128 ret.setHeight(intlist[1]);
@@ -185,29 +187,29 @@ QDateTime KConfig::readDateTimeEntry( const QString &key, const QDateTime *def )
185{ 187{
186 QMap<QString,QDateTime>::ConstIterator it = mDateTimeMap.find( mGroup + key ); 188 QMap<QString,QDateTime>::ConstIterator it = mDateTimeMap.find( mGroup + key );
187 189
188 if ( it == mDateTimeMap.end() ) { 190 if ( it == mDateTimeMap.end() ) {
189 if ( def ) return *def; 191 if ( def ) return *def;
190 else return QDateTime(); 192 else return QDateTime();
191 } 193 }
192 194
193 return *it; 195 return *it;
194} 196}
195 197
196//US added method 198//US added method
197void KConfig::writeEntry( const QString &key, const QValueList<int> &value) 199void KConfig::writeEntry( const QString &key, const Q3ValueList<int> &value)
198{ 200{
199 QStringList valuesAsStrings; 201 QStringList valuesAsStrings;
200 202
201 QValueList<int>::ConstIterator it; 203 Q3ValueList<int>::ConstIterator it;
202 204
203 for( it = value.begin(); it != value.end(); ++it ) 205 for( it = value.begin(); it != value.end(); ++it )
204 { 206 {
205 valuesAsStrings << QString::number(*it); 207 valuesAsStrings << QString::number(*it);
206 } 208 }
207 209
208 mStringMap.insert( mGroup + key, valuesAsStrings.join(":") ); 210 mStringMap.insert( mGroup + key, valuesAsStrings.join(":") );
209 mDirty = true; 211 mDirty = true;
210} 212}
211 213
212void KConfig::writeEntry( const QString & key , int num ) 214void KConfig::writeEntry( const QString & key , int num )
213{ 215{
@@ -237,63 +239,63 @@ void KConfig::writeEntry( const QString &key, bool value)
237 239
238void KConfig::writeEntry( const QString & e, const QColor & c ) 240void KConfig::writeEntry( const QString & e, const QColor & c )
239{ 241{
240 QStringList l; 242 QStringList l;
241 l.append( QString::number ( c.red() ) ); 243 l.append( QString::number ( c.red() ) );
242 l.append( QString::number ( c.green() ) ); 244 l.append( QString::number ( c.green() ) );
243 l.append( QString::number ( c.blue() ) ); 245 l.append( QString::number ( c.blue() ) );
244 writeEntry( e.utf8(), l ); 246 writeEntry( e.utf8(), l );
245} 247}
246 248
247void KConfig::writeEntry( const QString & e, const QSize & s ) 249void KConfig::writeEntry( const QString & e, const QSize & s )
248{ 250{
249 QValueList<int> intlist; 251 Q3ValueList<int> intlist;
250 intlist << s.width() << s.height(); 252 intlist << s.width() << s.height();
251 writeEntry( e, intlist ); 253 writeEntry( e, intlist );
252} 254}
253 255
254void KConfig::writeEntry( const QString & e , const QFont & f ) 256void KConfig::writeEntry( const QString & e , const QFont & f )
255{ 257{
256 QStringList font; 258 QStringList font;
257 font.append( f.family()); 259 font.append( f.family());
258 font.append( (!f.bold ()?"nonbold":"bold") ); 260 font.append( (!f.bold ()?"nonbold":"bold") );
259 font.append( QString::number ( f.pointSize () ) ); 261 font.append( QString::number ( f.pointSize () ) );
260 font.append( !f.italic ()?"nonitalic":"italic" ); 262 font.append( !f.italic ()?"nonitalic":"italic" );
261 writeEntry( e, font ); 263 writeEntry( e, font );
262} 264}
263 265
264void KConfig::writeEntry( const QString &key, const QDateTime &dt ) 266void KConfig::writeEntry( const QString &key, const QDateTime &dt )
265{ 267{
266 mDateTimeMap.insert( mGroup + key, dt ); 268 mDateTimeMap.insert( mGroup + key, dt );
267} 269}
268 270
269void KConfig::load() 271void KConfig::load()
270{ 272{
271 273
272 274
273 QFile f( mFileName ); 275 QFile f( mFileName );
274 if ( !f.open( IO_ReadOnly ) ) { 276 if ( !f.open( QIODevice::ReadOnly ) ) {
275 //qDebug("KConfig: could not open file %s ",mFileName.latin1() ); 277 //qDebug("KConfig: could not open file %s ",mFileName.latin1() );
276 return; 278 return;
277 } 279 }
278 280
279 mBoolMap.clear(); 281 mBoolMap.clear();
280 mStringMap.clear(); 282 mStringMap.clear();
281 283
282 QTextStream t( &f ); 284 Q3TextStream t( &f );
283 t.setEncoding( QTextStream::Latin1 ); 285 t.setEncoding( Q3TextStream::Latin1 );
284 QString line = t.readLine(); 286 QString line = t.readLine();
285 287
286 while ( !line.isNull() ) { 288 while ( !line.isNull() ) {
287 QStringList tokens = QStringList::split( ",", line ); 289 QStringList tokens = line.split(',');
288 if ( tokens[0] == "bool" ) { 290 if ( tokens[0] == "bool" ) {
289 bool value = false; 291 bool value = false;
290 if ( tokens[2] == "1" ) value = true; 292 if ( tokens[2] == "1" ) value = true;
291 mBoolMap.insert( tokens[1], value ); 293 mBoolMap.insert( tokens[1], value );
292 } else if ( tokens[0] == "QString" ) { 294 } else if ( tokens[0] == "QString" ) {
293 QString value = tokens[2]; 295 QString value = tokens[2];
294 mStringMap.insert( tokens[1], value ); 296 mStringMap.insert( tokens[1], value );
295 } else if ( tokens[0] == "QDateTime" ) { 297 } else if ( tokens[0] == "QDateTime" ) {
296#if 0 298#if 0
297 int year = tokens[2].toInt(); 299 int year = tokens[2].toInt();
298 QDateTime dt( QDate( year, 300 QDateTime dt( QDate( year,
299 tokens[3].toInt(), 301 tokens[3].toInt(),
@@ -314,33 +316,33 @@ void KConfig::sync()
314 if ( !mDirty ) return; 316 if ( !mDirty ) return;
315 //qDebug("KConfig::sync() %s ",mFileName.latin1() ); 317 //qDebug("KConfig::sync() %s ",mFileName.latin1() );
316 //kdDebug() << "KConfig::sync(): " << mFileName << endl; 318 //kdDebug() << "KConfig::sync(): " << mFileName << endl;
317 319
318//US I took the following code from a newer version of KDE 320//US I took the following code from a newer version of KDE
319 // Create the containing dir if needed 321 // Create the containing dir if needed
320 KURL path; 322 KURL path;
321 path.setPath(mFileName); 323 path.setPath(mFileName);
322 QString dir=path.directory(); 324 QString dir=path.directory();
323 KStandardDirs::makeDir(dir); 325 KStandardDirs::makeDir(dir);
324 326
325 QFile f( mFileName ); 327 QFile f( mFileName );
326 if ( !f.open( IO_WriteOnly ) ) { 328 if ( !f.open( QIODevice::WriteOnly ) ) {
327 329
328 qDebug("KConfig::sync() Can't open file %s ",mFileName.latin1() ); 330 qDebug("KConfig::sync() Can't open file %s ",mFileName.latin1() );
329 331
330 return; 332 return;
331 } 333 }
332 334
333 QTextStream t( &f ); 335 Q3TextStream t( &f );
334 t.setEncoding( QTextStream::Latin1 ); 336 t.setEncoding( Q3TextStream::Latin1 );
335 QMap<QString,bool>::ConstIterator itBool; 337 QMap<QString,bool>::ConstIterator itBool;
336 for( itBool = mBoolMap.begin(); itBool != mBoolMap.end(); ++itBool ) { 338 for( itBool = mBoolMap.begin(); itBool != mBoolMap.end(); ++itBool ) {
337 t << "bool," << itBool.key() << "," << ( *itBool ? "1" : "0" ) << endl; 339 t << "bool," << itBool.key() << "," << ( *itBool ? "1" : "0" ) << endl;
338 } 340 }
339 341
340 QMap<QString,QString>::ConstIterator itString; 342 QMap<QString,QString>::ConstIterator itString;
341 for( itString = mStringMap.begin(); itString != mStringMap.end(); ++itString ) { 343 for( itString = mStringMap.begin(); itString != mStringMap.end(); ++itString ) {
342 t << "QString," << itString.key() << "," << (*itString ) << endl; 344 t << "QString," << itString.key() << "," << (*itString ) << endl;
343 } 345 }
344 346
345 QMap<QString,QDateTime>::ConstIterator itDateTime; 347 QMap<QString,QDateTime>::ConstIterator itDateTime;
346 for( itDateTime = mDateTimeMap.begin(); itDateTime != mDateTimeMap.end(); ++itDateTime ) { 348 for( itDateTime = mDateTimeMap.begin(); itDateTime != mDateTimeMap.end(); ++itDateTime ) {
diff --git a/microkde/kconfig.h b/microkde/kconfig.h
index 1a1038f..7b91e44 100644
--- a/microkde/kconfig.h
+++ b/microkde/kconfig.h
@@ -1,18 +1,18 @@
1#ifndef MINIKDE_KCONFIG_H 1#ifndef MINIKDE_KCONFIG_H
2#define MINIKDE_KCONFIG_H 2#define MINIKDE_KCONFIG_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5#include <qstringlist.h> 5#include <qstringlist.h>
6#include <qvaluelist.h> 6#include <q3valuelist.h>
7#include <qcolor.h> 7#include <qcolor.h>
8#include <qfont.h> 8#include <qfont.h>
9#include <qmap.h> 9#include <qmap.h>
10#include <qdatetime.h> 10#include <qdatetime.h>
11 11
12class KConfig 12class KConfig
13{ 13{
14 public: 14 public:
15 KConfig( const QString & ); 15 KConfig( const QString & );
16 ~KConfig(); 16 ~KConfig();
17 17
18 void setTempGroup( const QString &group ); 18 void setTempGroup( const QString &group );
@@ -48,37 +48,37 @@ class KConfig
48 /** 48 /**
49 * Returns true if the specified group is known about. 49 * Returns true if the specified group is known about.
50 * 50 *
51 * @param group The group to search for. 51 * @param group The group to search for.
52 * @return Whether the group exists. 52 * @return Whether the group exists.
53 */ 53 */
54 bool hasGroup(const QString &group) const; 54 bool hasGroup(const QString &group) const;
55 55
56 56
57 QString getFileName(); 57 QString getFileName();
58 58
59//US added method readIntListEntry 59//US added method readIntListEntry
60 QValueList<int> readIntListEntry( const QString &); 60 Q3ValueList<int> readIntListEntry( const QString &);
61 61
62 int readNumEntry( const QString &, int def=0 ); 62 int readNumEntry( const QString &, int def=0 );
63 QString readEntry( const QString &, const QString &def=QString::null ); 63 QString readEntry( const QString &, const QString &def=QString::null );
64 QStringList readListEntry( const QString & ); 64 QStringList readListEntry( const QString & );
65 bool readBoolEntry( const QString &, bool def=false ); 65 bool readBoolEntry( const QString &, bool def=false );
66 QColor readColorEntry( const QString &, QColor * ); 66 QColor readColorEntry( const QString &, QColor * );
67 QFont readFontEntry( const QString &, QFont * ); 67 QFont readFontEntry( const QString &, QFont * );
68 QDateTime readDateTimeEntry( const QString &, const QDateTime *pDefault = 0 ); 68 QDateTime readDateTimeEntry( const QString &, const QDateTime *pDefault = 0 );
69 QSize readSizeEntry(const QString &, QSize* ); 69 QSize readSizeEntry(const QString &, QSize* );
70 bool hasKey( const QString &); 70 bool hasKey( const QString &);
71 71
72 void writeEntry( const QString &, const QValueList<int>& ); 72 void writeEntry( const QString &, const Q3ValueList<int>& );
73 void writeEntry( const QString &, int ); 73 void writeEntry( const QString &, int );
74 void writeEntry( const QString &key , unsigned int value) { writeEntry( key, int( value ) ); } 74 void writeEntry( const QString &key , unsigned int value) { writeEntry( key, int( value ) ); }
75 void writeEntry( const char *key , unsigned int value) { writeEntry( QString( key ), value ); } 75 void writeEntry( const char *key , unsigned int value) { writeEntry( QString( key ), value ); }
76 void writeEntry( const char *key, int value ) { writeEntry( QString( key ), value ); } 76 void writeEntry( const char *key, int value ) { writeEntry( QString( key ), value ); }
77 void writeEntry( const QString &, const QString & ); 77 void writeEntry( const QString &, const QString & );
78 void writeEntry( const char *key, const QString &value ) { writeEntry( QString( key ), value ); } 78 void writeEntry( const char *key, const QString &value ) { writeEntry( QString( key ), value ); }
79 void writeEntry( const QString &, const QStringList & ); 79 void writeEntry( const QString &, const QStringList & );
80 void writeEntry( const QString &, bool ); 80 void writeEntry( const QString &, bool );
81 void writeEntry( const char *key, bool value ) { writeEntry( QString( key ), value ); } 81 void writeEntry( const char *key, bool value ) { writeEntry( QString( key ), value ); }
82 void writeEntry( const QString &, const QColor & ); 82 void writeEntry( const QString &, const QColor & );
83 void writeEntry( const QString &, const QFont & ); 83 void writeEntry( const QString &, const QFont & );
84 void writeEntry( const QString &, const QDateTime & ); 84 void writeEntry( const QString &, const QDateTime & );
diff --git a/microkde/kdatepickernew.cpp b/microkde/kdatepickernew.cpp
index f60a422..8f8001e 100644
--- a/microkde/kdatepickernew.cpp
+++ b/microkde/kdatepickernew.cpp
@@ -304,25 +304,25 @@ KDatePicker::weekSelected(int week)
304 304
305 setDate(date); 305 setDate(date);
306} 306}
307 307
308void 308void
309KDatePicker::selectMonthClicked() 309KDatePicker::selectMonthClicked()
310{ 310{
311 // every year can have different month names (in some calendar systems) 311 // every year can have different month names (in some calendar systems)
312 const KCalendarSystem * calendar = KGlobal::locale()->calendar(); 312 const KCalendarSystem * calendar = KGlobal::locale()->calendar();
313 QDate date = table->getDate(); 313 QDate date = table->getDate();
314 int i, month, months = calendar->monthsInYear(date); 314 int i, month, months = calendar->monthsInYear(date);
315 315
316 QPopupMenu popup(selectMonth); 316 Q3PopupMenu popup(selectMonth);
317 317
318 for (i = 1; i <= months; i++) 318 for (i = 1; i <= months; i++)
319 popup.insertItem(calendar->monthName(i, calendar->year(date)), i); 319 popup.insertItem(calendar->monthName(i, calendar->year(date)), i);
320 320
321 popup.setActiveItem(calendar->month(date) - 1); 321 popup.setActiveItem(calendar->month(date) - 1);
322 322
323 if ( (month = popup.exec(selectMonth->mapToGlobal(QPoint(0, 0)), calendar->month(date) - 1)) == -1 ) return; // canceled 323 if ( (month = popup.exec(selectMonth->mapToGlobal(QPoint(0, 0)), calendar->month(date) - 1)) == -1 ) return; // canceled
324 324
325 int day = calendar->day(date); 325 int day = calendar->day(date);
326 // ----- construct a valid date in this month: 326 // ----- construct a valid date in this month:
327 //date.setYMD(date.year(), month, 1); 327 //date.setYMD(date.year(), month, 1);
328 //date.setYMD(date.year(), month, QMIN(day, date.daysInMonth())); 328 //date.setYMD(date.year(), month, QMIN(day, date.daysInMonth()));
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp
index 353f78d..10dc449 100644
--- a/microkde/kdatetbl.cpp
+++ b/microkde/kdatetbl.cpp
@@ -35,24 +35,32 @@
35#include <kglobal.h> 35#include <kglobal.h>
36#include <kglobalsettings.h> 36#include <kglobalsettings.h>
37#include <kapplication.h> 37#include <kapplication.h>
38#include <klocale.h> 38#include <klocale.h>
39#include <kdebug.h> 39#include <kdebug.h>
40#include <knotifyclient.h> 40#include <knotifyclient.h>
41#include "kdatetbl.h" 41#include "kdatetbl.h"
42#include <qdatetime.h> 42#include <qdatetime.h>
43#include <qstring.h> 43#include <qstring.h>
44#include <qpen.h> 44#include <qpen.h>
45#include <qpainter.h> 45#include <qpainter.h>
46#include <qdialog.h> 46#include <qdialog.h>
47#include <QDesktopWidget>
48//Added by qt3to4:
49#include <QResizeEvent>
50#include <QFocusEvent>
51#include <Q3Frame>
52#include <QMouseEvent>
53#include <QKeyEvent>
54#include <QEvent>
47#include <assert.h> 55#include <assert.h>
48#include <qapplication.h> 56#include <qapplication.h>
49 57
50KDateValidator::KDateValidator(QWidget* parent, const char* name) 58KDateValidator::KDateValidator(QWidget* parent, const char* name)
51 : QValidator(parent, name) 59 : QValidator(parent, name)
52{ 60{
53} 61}
54 62
55QValidator::State 63QValidator::State
56KDateValidator::validate(QString& text, int&) const 64KDateValidator::validate(QString& text, int&) const
57{ 65{
58 QDate temp; 66 QDate temp;
@@ -60,151 +68,150 @@ KDateValidator::validate(QString& text, int&) const
60 return date(text, temp); 68 return date(text, temp);
61} 69}
62 70
63QValidator::State 71QValidator::State
64KDateValidator::date(const QString& text, QDate& d) const 72KDateValidator::date(const QString& text, QDate& d) const
65{ 73{
66 QDate tmp = KGlobal::locale()->readDate(text); 74 QDate tmp = KGlobal::locale()->readDate(text);
67 if (!tmp.isNull()) 75 if (!tmp.isNull())
68 { 76 {
69 d = tmp; 77 d = tmp;
70 return Acceptable; 78 return Acceptable;
71 } else 79 } else
72 return Valid; 80 return QValidator::Intermediate;
73} 81}
74 82
75void 83void
76KDateValidator::fixup( QString& ) const 84KDateValidator::fixup( QString& ) const
77{ 85{
78 86
79} 87}
80 88
81KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f) 89KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, Qt::WFlags f)
82 : QGridView(parent, name, f) 90 : Q3GridView(parent, name, f)
83{ 91{
84 setFont( KGlobalSettings::generalFont() ); 92 setFont( KGlobalSettings::generalFont() );
85 if(!date_.isValid()) 93 if(!date_.isValid())
86 { 94 {
87 date_=QDate::currentDate(); 95 date_=QDate::currentDate();
88 } 96 }
89 setFocusPolicy( QWidget::StrongFocus ); 97 setFocusPolicy( Qt::StrongFocus );
90 setNumRows(7); // 6 weeks max + headline 98 setNumRows(7); // 6 weeks max + headline
91 setNumCols(7); // 7 days a week 99 setNumCols(7); // 7 days a week
92 setHScrollBarMode(AlwaysOff); 100 setHScrollBarMode(AlwaysOff);
93 setVScrollBarMode(AlwaysOff); 101 setVScrollBarMode(AlwaysOff);
94 viewport()->setBackgroundColor(QColor(220,245,255)); 102 viewport()->setBackgroundColor(QColor(220,245,255));
95#if 0 103#if 0
96 viewport()->setEraseColor(lightGray); 104 viewport()->setEraseColor(Qt::lightGray);
97#endif 105#endif
98 mMarkCurrent = false; 106 mMarkCurrent = false;
99 setDate(date_); // this initializes firstday, numdays, numDaysPrevMonth 107 setDate(date_); // this initializes firstday, numdays, numDaysPrevMonth
100} 108}
101 109
102void 110void
103KDateTable::paintCell(QPainter *painter, int row, int col) 111KDateTable::paintCell(QPainter *painter, int row, int col)
104{ 112{
105 QRect rect; 113 QRect rect;
106 QString text; 114 QString text;
107 QPen pen; 115 QPen pen;
108 int w=cellWidth(); 116 int w=cellWidth();
109 int h=cellHeight(); 117 int h=cellHeight();
110 int pos; 118 int pos;
111 QBrush brushBlue(blue); 119 QBrush brushBlue(Qt::blue);
112 QBrush brushLightblue(QColor(220,245,255)); 120 QBrush brushLightblue(QColor(220,245,255));
113 QFont _font=font(); 121 QFont _font=font();
114 // ----- 122 // -----
115 if(row==0) 123 if(row==0)
116 { // we are drawing the headline 124 { // we are drawing the headline
117 _font.setBold(true); 125 _font.setBold(true);
118 painter->setFont(_font); 126 painter->setFont(_font);
119 bool normalday = true; 127 bool normalday = true;
120 QString daystr; 128 QString daystr;
121 if (KGlobal::locale()->weekStartsMonday()) 129 if (KGlobal::locale()->weekStartsMonday())
122 { 130 {
123 daystr = KGlobal::locale()->weekDayName(col+1, true); 131 daystr = KGlobal::locale()->weekDayName(col+1, true);
124 if (col == 5 || col == 6) 132 if (col == 5 || col == 6)
125 normalday = false; 133 normalday = false;
126 } else { 134 } else {
127 daystr = KGlobal::locale()->weekDayName(col==0? 7 : col, true); 135 daystr = KGlobal::locale()->weekDayName(col==0? 7 : col, true);
128 if (col == 0 || col == 6) 136 if (col == 0 || col == 6)
129 normalday = false; 137 normalday = false;
130 } 138 }
131 if (!normalday) 139 if (!normalday)
132 { 140 {
133 painter->setPen(QColor(220,245,255)); 141 painter->setPen(QColor(220,245,255));
134 painter->setBrush(brushLightblue); 142 painter->setBrush(brushLightblue);
135 painter->drawRect(0, 0, w, h); 143 painter->drawRect(0, 0, w, h);
136 painter->setPen(blue); 144 painter->setPen(Qt::blue);
137 } else { 145 } else {
138 painter->setPen(blue); 146 painter->setPen(Qt::blue);
139 painter->setBrush(brushBlue); 147 painter->setBrush(brushBlue);
140 painter->drawRect(0, 0, w, h); 148 painter->drawRect(0, 0, w, h);
141 painter->setPen(white); 149 painter->setPen(Qt::white);
142 } 150 }
143 painter->drawText(0, 0, w, h-1, AlignCenter, 151 painter->drawText(0, 0, w, h-1, Qt::AlignCenter,
144 daystr, -1, &rect); 152 daystr, -1, &rect);
145 painter->setPen(black); 153 painter->setPen(Qt::black);
146 painter->moveTo(0, h-1); 154 painter->drawLine(0, h-1, w-1, h-1);
147 painter->lineTo(w-1, h-1);
148 // ----- draw the weekday: 155 // ----- draw the weekday:
149 } else { 156 } else {
150 painter->setFont(_font); 157 painter->setFont(_font);
151 pos=7*(row-1)+col; 158 pos=7*(row-1)+col;
152 if (KGlobal::locale()->weekStartsMonday()) 159 if (KGlobal::locale()->weekStartsMonday())
153 pos++; 160 pos++;
154 if(pos<firstday || (firstday+numdays<=pos)) 161 if(pos<firstday || (firstday+numdays<=pos))
155 { // we are either 162 { // we are either
156 // ° painting a day of the previous month or 163 // ° painting a day of the previous month or
157 // ° painting a day of the following month 164 // ° painting a day of the following month
158 if(pos<firstday) 165 if(pos<firstday)
159 { // previous month 166 { // previous month
160 text.setNum(numDaysPrevMonth+pos-firstday+1); 167 text.setNum(numDaysPrevMonth+pos-firstday+1);
161 } else { // following month 168 } else { // following month
162 text.setNum(pos-firstday-numdays+1); 169 text.setNum(pos-firstday-numdays+1);
163 } 170 }
164 painter->setPen(gray); 171 painter->setPen(Qt::gray);
165 } else { // paint a day of the current month 172 } else { // paint a day of the current month
166 text.setNum(pos-firstday+1); 173 text.setNum(pos-firstday+1);
167 painter->setPen(black); 174 painter->setPen(Qt::black);
168 } 175 }
169 176
170 pen=painter->pen(); 177 pen=painter->pen();
171 if(firstday+date.day()-1==pos) 178 if(firstday+date.day()-1==pos)
172 { 179 {
173 if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos) 180 if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos)
174 painter->setPen(green); 181 painter->setPen(Qt::green);
175 else 182 else
176 painter->setPen(red); 183 painter->setPen(Qt::red);
177 if(hasFocus()) 184 if(hasFocus())
178 { 185 {
179 painter->setBrush(darkRed); 186 painter->setBrush(Qt::darkRed);
180 pen=white; 187 pen=QColor(Qt::white);
181 } else { 188 } else {
182 painter->setBrush(darkGray); 189 painter->setBrush(Qt::darkGray);
183 pen=white; 190 pen=QColor(Qt::white);
184 } 191 }
185 } else { 192 } else {
186 if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos) 193 if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos)
187 { 194 {
188 painter->setPen(green); 195 painter->setPen(Qt::green);
189 painter->setBrush(darkGreen); 196 painter->setBrush(Qt::darkGreen);
190 pen=white; 197 pen=QColor(Qt::white);
191 } else { 198 } else {
192 painter->setBrush(QColor(220,245,255)); 199 painter->setBrush(QColor(220,245,255));
193 painter->setPen(QColor(220,245,255)); 200 painter->setPen(QColor(220,245,255));
194 } 201 }
195 } 202 }
196 painter->drawRect(0, 0, w, h); 203 painter->drawRect(0, 0, w, h);
197 painter->setPen(pen); 204 painter->setPen(pen);
198 painter->drawText(0, 0, w, h, AlignCenter, text, -1, &rect); 205 painter->drawText(0, 0, w, h, Qt::AlignCenter, text, -1, &rect);
199 } 206 }
200 /* 207 /*
201 if(rect.width()>maxCell.width()) maxCell.setWidth(rect.width()); 208 if(rect.width()>maxCell.width()) maxCell.setWidth(rect.width());
202 if(rect.height()>maxCell.height()) { 209 if(rect.height()>maxCell.height()) {
203 maxCell.setHeight(rect.height()); 210 maxCell.setHeight(rect.height());
204 } 211 }
205 */ 212 */
206} 213}
207 214
208void 215void
209KDateTable::keyPressEvent( QKeyEvent *e ) 216KDateTable::keyPressEvent( QKeyEvent *e )
210{ 217{
@@ -265,25 +272,25 @@ KDateTable::keyPressEvent( QKeyEvent *e )
265 } 272 }
266 273
267 pos += add; 274 pos += add;
268 setDate(date.addDays( add )); 275 setDate(date.addDays( add ));
269 updateCell(temp/7+1, temp%7); // Update the previously selected cell 276 updateCell(temp/7+1, temp%7); // Update the previously selected cell
270 updateCell(pos/7+1, pos%7); // Update the selected cell 277 updateCell(pos/7+1, pos%7); // Update the selected cell
271 278
272} 279}
273 280
274void 281void
275KDateTable::viewportResizeEvent(QResizeEvent * e) 282KDateTable::viewportResizeEvent(QResizeEvent * e)
276{ 283{
277 QGridView::viewportResizeEvent(e); 284 Q3GridView::viewportResizeEvent(e);
278 285
279 setCellWidth(viewport()->width()/7); 286 setCellWidth(viewport()->width()/7);
280 setCellHeight(viewport()->height()/7); 287 setCellHeight(viewport()->height()/7);
281} 288}
282 289
283void 290void
284KDateTable::setFontSize(int size) 291KDateTable::setFontSize(int size)
285{ 292{
286 int count; 293 int count;
287 QRect rect; 294 QRect rect;
288 // ----- store rectangles: 295 // ----- store rectangles:
289 fontsize=size; 296 fontsize=size;
@@ -400,73 +407,73 @@ KDateTable::setDate(const QDate& date_)
400 return true; 407 return true;
401} 408}
402 409
403const QDate& 410const QDate&
404KDateTable::getDate() const 411KDateTable::getDate() const
405{ 412{
406 return date; 413 return date;
407} 414}
408 415
409void KDateTable::focusInEvent( QFocusEvent *e ) 416void KDateTable::focusInEvent( QFocusEvent *e )
410{ 417{
411 repaintContents(false); 418 repaintContents(false);
412 QGridView::focusInEvent( e ); 419 Q3GridView::focusInEvent( e );
413} 420}
414 421
415void KDateTable::focusOutEvent( QFocusEvent *e ) 422void KDateTable::focusOutEvent( QFocusEvent *e )
416{ 423{
417 repaintContents(false); 424 repaintContents(false);
418 QGridView::focusOutEvent( e ); 425 Q3GridView::focusOutEvent( e );
419} 426}
420 427
421QSize 428QSize
422KDateTable::sizeHint() const 429KDateTable::sizeHint() const
423{ 430{
424 if(maxCell.height()>0 && maxCell.width()>0) 431 if(maxCell.height()>0 && maxCell.width()>0)
425 { 432 {
426 return QSize((maxCell.width()+2)*numCols()+2*frameWidth(), 433 return QSize((maxCell.width()+2)*numCols()+2*frameWidth(),
427 (maxCell.height()+4)*numRows()+2*frameWidth()); 434 (maxCell.height()+4)*numRows()+2*frameWidth());
428 } else { 435 } else {
429 return QSize(-1, -1); 436 return QSize(-1, -1);
430 } 437 }
431} 438}
432 439
433KDateInternalMonthPicker::KDateInternalMonthPicker 440KDateInternalMonthPicker::KDateInternalMonthPicker
434(QWidget* parent, const char* name) 441(QWidget* parent, const char* name)
435 : QGridView(parent, name), 442 : Q3GridView(parent, name),
436 result(0) // invalid 443 result(0) // invalid
437{ 444{
438 QRect rect; 445 QRect rect;
439 QFont font; 446 QFont font;
440 // ----- 447 // -----
441 activeCol = -1; 448 activeCol = -1;
442 activeRow = -1; 449 activeRow = -1;
443 font=KGlobalSettings::generalFont(); 450 font=KGlobalSettings::generalFont();
444 int fontsize = 10; 451 int fontsize = 10;
445 int add = 2; 452 int add = 2;
446 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) 453 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
447 add += 8; 454 add += 8;
448 if ( QApplication::desktop()->width() > 640 ) 455 if ( QApplication::desktop()->width() > 640 )
449 add += 6; 456 add += 6;
450 font.setPointSize(fontsize+add); 457 font.setPointSize(fontsize+add);
451 setFont(font); 458 setFont(font);
452 setHScrollBarMode(AlwaysOff); 459 setHScrollBarMode(AlwaysOff);
453 setVScrollBarMode(AlwaysOff); 460 setVScrollBarMode(AlwaysOff);
454 setFrameStyle(QFrame::NoFrame); 461 setFrameStyle(Q3Frame::NoFrame);
455 setNumRows(4); 462 setNumRows(4);
456 setNumCols(3); 463 setNumCols(3);
457 // enable to find drawing failures: 464 // enable to find drawing failures:
458 // setTableFlags(Tbl_clipCellPainting); 465 // setTableFlags(Tbl_clipCellPainting);
459#if 0 466#if 0
460 viewport()->setEraseColor(lightGray); // for consistency with the datepicker 467 viewport()->setEraseColor(Qt::lightGray); // for consistency with the datepicker
461#endif 468#endif
462 // ----- find the preferred size 469 // ----- find the preferred size
463 // (this is slow, possibly, but unfortunatly it is needed here): 470 // (this is slow, possibly, but unfortunatly it is needed here):
464 QFontMetrics metrics(font); 471 QFontMetrics metrics(font);
465 for(int i=1; i <= 12; ++i) 472 for(int i=1; i <= 12; ++i)
466 { 473 {
467 rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); 474 rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false));
468 if(max.width()<rect.width()) max.setWidth(rect.width()); 475 if(max.width()<rect.width()) max.setWidth(rect.width());
469 if(max.height()<rect.height()) max.setHeight(rect.height()); 476 if(max.height()<rect.height()) max.setHeight(rect.height());
470 } 477 }
471 478
472} 479}
@@ -478,51 +485,51 @@ KDateInternalMonthPicker::sizeHint() const
478 (max.height()+6)*numRows()+2*frameWidth()); 485 (max.height()+6)*numRows()+2*frameWidth());
479} 486}
480 487
481int 488int
482KDateInternalMonthPicker::getResult() const 489KDateInternalMonthPicker::getResult() const
483{ 490{
484 return result; 491 return result;
485} 492}
486 493
487void 494void
488KDateInternalMonthPicker::setupPainter(QPainter *p) 495KDateInternalMonthPicker::setupPainter(QPainter *p)
489{ 496{
490 p->setPen(black); 497 p->setPen(Qt::black);
491} 498}
492 499
493void 500void
494KDateInternalMonthPicker::viewportResizeEvent(QResizeEvent*) 501KDateInternalMonthPicker::viewportResizeEvent(QResizeEvent*)
495{ 502{
496 setCellWidth(width()/3); 503 setCellWidth(width()/3);
497 setCellHeight(height()/4); 504 setCellHeight(height()/4);
498} 505}
499 506
500void 507void
501KDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) 508KDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col)
502{ 509{
503 int index; 510 int index;
504 QString text; 511 QString text;
505 // ----- find the number of the cell: 512 // ----- find the number of the cell:
506 index=3*row+col+1; 513 index=3*row+col+1;
507 text=KGlobal::locale()->monthName(index, false); 514 text=KGlobal::locale()->monthName(index, false);
508 painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text); 515 painter->drawText(0, 0, cellWidth(), cellHeight(), Qt::AlignCenter, text);
509 if ( activeCol == col && activeRow == row ) 516 if ( activeCol == col && activeRow == row )
510 painter->drawRect( 0, 0, cellWidth(), cellHeight() ); 517 painter->drawRect( 0, 0, cellWidth(), cellHeight() );
511} 518}
512 519
513void 520void
514KDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) 521KDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e)
515{ 522{
516 if(!isEnabled() || e->button() != LeftButton) 523 if(!isEnabled() || e->button() != Qt::LeftButton)
517 { 524 {
518 KNotifyClient::beep(); 525 KNotifyClient::beep();
519 return; 526 return;
520 } 527 }
521 // ----- 528 // -----
522 int row, col; 529 int row, col;
523 QPoint mouseCoord; 530 QPoint mouseCoord;
524 // ----- 531 // -----
525 mouseCoord = e->pos(); 532 mouseCoord = e->pos();
526 row=rowAt(mouseCoord.y()); 533 row=rowAt(mouseCoord.y());
527 col=columnAt(mouseCoord.x()); 534 col=columnAt(mouseCoord.x());
528 535
@@ -531,25 +538,25 @@ KDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e)
531 activeCol = -1; 538 activeCol = -1;
532 activeRow = -1; 539 activeRow = -1;
533 } else { 540 } else {
534 activeCol = col; 541 activeCol = col;
535 activeRow = row; 542 activeRow = row;
536 updateCell( row, col /*, false */ ); 543 updateCell( row, col /*, false */ );
537 } 544 }
538} 545}
539 546
540void 547void
541KDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) 548KDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e)
542{ 549{
543 if (e->state() & LeftButton) 550 if (e->state() & Qt::LeftButton)
544 { 551 {
545 int row, col; 552 int row, col;
546 QPoint mouseCoord; 553 QPoint mouseCoord;
547 // ----- 554 // -----
548 mouseCoord = e->pos(); 555 mouseCoord = e->pos();
549 row=rowAt(mouseCoord.y()); 556 row=rowAt(mouseCoord.y());
550 col=columnAt(mouseCoord.x()); 557 col=columnAt(mouseCoord.x());
551 int tmpRow = -1, tmpCol = -1; 558 int tmpRow = -1, tmpCol = -1;
552 if(row<0 || col<0) 559 if(row<0 || col<0)
553 { // the user clicked on the frame of the table 560 { // the user clicked on the frame of the table
554 if ( activeCol > -1 ) 561 if ( activeCol > -1 )
555 { 562 {
@@ -605,25 +612,25 @@ KDateInternalMonthPicker::contentsMouseReleaseEvent(QMouseEvent *e)
605KDateInternalYearSelector::KDateInternalYearSelector 612KDateInternalYearSelector::KDateInternalYearSelector
606(int fontsize, QWidget* parent, const char* name) 613(int fontsize, QWidget* parent, const char* name)
607 : QLineEdit(parent, name), 614 : QLineEdit(parent, name),
608 val(new QIntValidator(this)), 615 val(new QIntValidator(this)),
609 result(0) 616 result(0)
610{ 617{
611 QFont font; 618 QFont font;
612 // ----- 619 // -----
613 font=KGlobalSettings::generalFont(); 620 font=KGlobalSettings::generalFont();
614 font.setPointSize(fontsize); 621 font.setPointSize(fontsize);
615 setFont(font); 622 setFont(font);
616#if 0 623#if 0
617 setFrameStyle(QFrame::NoFrame); 624 setFrameStyle(Q3Frame::NoFrame);
618#endif 625#endif
619 // we have to respect the limits of QDate here, I fear: 626 // we have to respect the limits of QDate here, I fear:
620 val->setRange(0, 8000); 627 val->setRange(0, 8000);
621 setValidator(val); 628 setValidator(val);
622 connect(this, SIGNAL(returnPressed()), SLOT(yearEnteredSlot())); 629 connect(this, SIGNAL(returnPressed()), SLOT(yearEnteredSlot()));
623} 630}
624 631
625void 632void
626KDateInternalYearSelector::yearEnteredSlot() 633KDateInternalYearSelector::yearEnteredSlot()
627{ 634{
628 bool ok; 635 bool ok;
629 int year; 636 int year;
@@ -652,36 +659,36 @@ KDateInternalYearSelector::getYear()
652} 659}
653 660
654void 661void
655KDateInternalYearSelector::setYear(int year) 662KDateInternalYearSelector::setYear(int year)
656{ 663{
657 QString temp; 664 QString temp;
658 // ----- 665 // -----
659 temp.setNum(year); 666 temp.setNum(year);
660 setText(temp); 667 setText(temp);
661} 668}
662 669
663KPopupFrame::KPopupFrame(QWidget* parent, const char* name) 670KPopupFrame::KPopupFrame(QWidget* parent, const char* name)
664 : QFrame(parent, name, WType_Popup), 671 : Q3Frame(parent, name, Qt::WType_Popup),
665 result(0), // rejected 672 result(0), // rejected
666 main(0) 673 main(0)
667{ 674{
668 setFrameStyle(QFrame::Box|QFrame::Raised); 675 setFrameStyle(Q3Frame::Box|Q3Frame::Raised);
669 setMidLineWidth(2); 676 setMidLineWidth(2);
670} 677}
671 678
672void 679void
673KPopupFrame::keyPressEvent(QKeyEvent* e) 680KPopupFrame::keyPressEvent(QKeyEvent* e)
674{ 681{
675 if(e->key()==Key_Escape) 682 if(e->key()==Qt::Key_Escape)
676 { 683 {
677 result=0; // rejected 684 result=0; // rejected
678 qApp->exit_loop(); 685 qApp->exit_loop();
679 } 686 }
680} 687}
681 688
682void 689void
683KPopupFrame::close(int r) 690KPopupFrame::close(int r)
684{ 691{
685 result=r; 692 result=r;
686 qApp->exit_loop(); 693 qApp->exit_loop();
687} 694}
@@ -747,53 +754,53 @@ KPopupFrame::exec(int x, int y)
747 754
748void KPopupFrame::virtual_hook( int, void* ) 755void KPopupFrame::virtual_hook( int, void* )
749{ /*BASE::virtual_hook( id, data );*/ } 756{ /*BASE::virtual_hook( id, data );*/ }
750 757
751void KDateTable::virtual_hook( int, void* ) 758void KDateTable::virtual_hook( int, void* )
752{ /*BASE::virtual_hook( id, data );*/ } 759{ /*BASE::virtual_hook( id, data );*/ }
753 760
754//#include "kdatetbl.moc" 761//#include "kdatetbl.moc"
755 762
756 763
757KDateInternalWeekPicker::KDateInternalWeekPicker 764KDateInternalWeekPicker::KDateInternalWeekPicker
758(QWidget* parent, const char* name) 765(QWidget* parent, const char* name)
759 : QGridView(parent, name), 766 : Q3GridView(parent, name),
760 result(0) // invalid 767 result(0) // invalid
761{ 768{
762 QRect rect; 769 QRect rect;
763 QFont font; 770 QFont font;
764 // ----- 771 // -----
765 activeCol = -1; 772 activeCol = -1;
766 activeRow = -1; 773 activeRow = -1;
767 font=KGlobalSettings::generalFont(); 774 font=KGlobalSettings::generalFont();
768 int fontsize = 10; 775 int fontsize = 10;
769 int add = 2; 776 int add = 2;
770 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) 777 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
771 add += 6; 778 add += 6;
772 font.setPointSize(fontsize+add); 779 font.setPointSize(fontsize+add);
773 setFont(font); 780 setFont(font);
774 setHScrollBarMode(AlwaysOff); 781 setHScrollBarMode(AlwaysOff);
775 setVScrollBarMode(AlwaysOff); 782 setVScrollBarMode(AlwaysOff);
776 setFrameStyle(QFrame::NoFrame); 783 setFrameStyle(Q3Frame::NoFrame);
777 if ( QApplication::desktop()->height() > 240 ) { 784 if ( QApplication::desktop()->height() > 240 ) {
778 setNumRows(13); 785 setNumRows(13);
779 setNumCols(4); 786 setNumCols(4);
780 } else { 787 } else {
781 setNumRows(4); 788 setNumRows(4);
782 setNumCols(13); 789 setNumCols(13);
783 } 790 }
784 // enable to find drawing failures: 791 // enable to find drawing failures:
785 // setTableFlags(Tbl_clipCellPainting); 792 // setTableFlags(Tbl_clipCellPainting);
786#if 0 793#if 0
787 viewport()->setEraseColor(lightGray); // for consistency with the datepicker 794 viewport()->setEraseColor(Qt::lightGray); // for consistency with the datepicker
788#endif 795#endif
789 // ----- find the preferred size 796 // ----- find the preferred size
790 // (this is slow, possibly, but unfortunatly it is needed here): 797 // (this is slow, possibly, but unfortunatly it is needed here):
791 QFontMetrics metrics(font); 798 QFontMetrics metrics(font);
792 for(int i=1; i <= 52; ++i) 799 for(int i=1; i <= 52; ++i)
793 { 800 {
794 rect=metrics.boundingRect(QString::number( i )); 801 rect=metrics.boundingRect(QString::number( i ));
795 if(max.width()<rect.width()) max.setWidth(rect.width()); 802 if(max.width()<rect.width()) max.setWidth(rect.width());
796 if(max.height()<rect.height()) max.setHeight(rect.height()); 803 if(max.height()<rect.height()) max.setHeight(rect.height());
797 } 804 }
798 if ( QApplication::desktop()->width() > 640 ) { 805 if ( QApplication::desktop()->width() > 640 ) {
799 806
@@ -809,51 +816,51 @@ KDateInternalWeekPicker::sizeHint() const
809 (max.height()+6)*numRows()+2*frameWidth()); 816 (max.height()+6)*numRows()+2*frameWidth());
810} 817}
811 818
812int 819int
813KDateInternalWeekPicker::getResult() const 820KDateInternalWeekPicker::getResult() const
814{ 821{
815 return result; 822 return result;
816} 823}
817 824
818void 825void
819KDateInternalWeekPicker::setupPainter(QPainter *p) 826KDateInternalWeekPicker::setupPainter(QPainter *p)
820{ 827{
821 p->setPen(black); 828 p->setPen(Qt::black);
822} 829}
823 830
824void 831void
825KDateInternalWeekPicker::viewportResizeEvent(QResizeEvent*) 832KDateInternalWeekPicker::viewportResizeEvent(QResizeEvent*)
826{ 833{
827 setCellWidth(width()/ numCols()); 834 setCellWidth(width()/ numCols());
828 setCellHeight(height()/ numRows()); 835 setCellHeight(height()/ numRows());
829} 836}
830 837
831void 838void
832KDateInternalWeekPicker::paintCell(QPainter* painter, int row, int col) 839KDateInternalWeekPicker::paintCell(QPainter* painter, int row, int col)
833{ 840{
834 int index; 841 int index;
835 QString text; 842 QString text;
836 // ----- find the number of the cell: 843 // ----- find the number of the cell:
837 index=numCols()*row+col+1; 844 index=numCols()*row+col+1;
838 text=QString::number( index ); 845 text=QString::number( index );
839 painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text); 846 painter->drawText(0, 0, cellWidth(), cellHeight(), Qt::AlignCenter, text);
840 if ( activeCol == col && activeRow == row ) 847 if ( activeCol == col && activeRow == row )
841 painter->drawRect( 0, 0, cellWidth(), cellHeight() ); 848 painter->drawRect( 0, 0, cellWidth(), cellHeight() );
842} 849}
843 850
844void 851void
845KDateInternalWeekPicker::contentsMousePressEvent(QMouseEvent *e) 852KDateInternalWeekPicker::contentsMousePressEvent(QMouseEvent *e)
846{ 853{
847 if(!isEnabled() || e->button() != LeftButton) 854 if(!isEnabled() || e->button() != Qt::LeftButton)
848 { 855 {
849 KNotifyClient::beep(); 856 KNotifyClient::beep();
850 return; 857 return;
851 } 858 }
852 // ----- 859 // -----
853 int row, col; 860 int row, col;
854 QPoint mouseCoord; 861 QPoint mouseCoord;
855 // ----- 862 // -----
856 mouseCoord = e->pos(); 863 mouseCoord = e->pos();
857 row=rowAt(mouseCoord.y()); 864 row=rowAt(mouseCoord.y());
858 col=columnAt(mouseCoord.x()); 865 col=columnAt(mouseCoord.x());
859 866
@@ -862,25 +869,25 @@ KDateInternalWeekPicker::contentsMousePressEvent(QMouseEvent *e)
862 activeCol = -1; 869 activeCol = -1;
863 activeRow = -1; 870 activeRow = -1;
864 } else { 871 } else {
865 activeCol = col; 872 activeCol = col;
866 activeRow = row; 873 activeRow = row;
867 updateCell( row, col /*, false */ ); 874 updateCell( row, col /*, false */ );
868 } 875 }
869} 876}
870 877
871void 878void
872KDateInternalWeekPicker::contentsMouseMoveEvent(QMouseEvent *e) 879KDateInternalWeekPicker::contentsMouseMoveEvent(QMouseEvent *e)
873{ 880{
874 if (e->state() & LeftButton) 881 if (e->state() & Qt::LeftButton)
875 { 882 {
876 int row, col; 883 int row, col;
877 QPoint mouseCoord; 884 QPoint mouseCoord;
878 // ----- 885 // -----
879 mouseCoord = e->pos(); 886 mouseCoord = e->pos();
880 row=rowAt(mouseCoord.y()); 887 row=rowAt(mouseCoord.y());
881 col=columnAt(mouseCoord.x()); 888 col=columnAt(mouseCoord.x());
882 int tmpRow = -1, tmpCol = -1; 889 int tmpRow = -1, tmpCol = -1;
883 if(row<0 || col<0) 890 if(row<0 || col<0)
884 { // the user clicked on the frame of the table 891 { // the user clicked on the frame of the table
885 if ( activeCol > -1 ) 892 if ( activeCol > -1 )
886 { 893 {
diff --git a/microkde/kdatetbl.h b/microkde/kdatetbl.h
index 87808df..2d3d2cf 100644
--- a/microkde/kdatetbl.h
+++ b/microkde/kdatetbl.h
@@ -12,35 +12,41 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef KDATETBL_H 20#ifndef KDATETBL_H
21#define KDATETBL_H 21#define KDATETBL_H
22 22
23#include <qvalidator.h> 23#include <qvalidator.h>
24#include <qgridview.h> 24#include <q3gridview.h>
25#include <qlineedit.h> 25#include <qlineedit.h>
26#include <qdatetime.h> 26#include <qdatetime.h>
27//Added by qt3to4:
28#include <QResizeEvent>
29#include <QMouseEvent>
30#include <Q3Frame>
31#include <QKeyEvent>
32#include <QFocusEvent>
27 33
28/** 34/**
29* A table containing month names. It is used to pick a month directly. 35* A table containing month names. It is used to pick a month directly.
30* @internal 36* @internal
31* @version $Id$ 37* @version $Id$
32* @author Tim Gilman, Mirko Boehm 38* @author Tim Gilman, Mirko Boehm
33*/ 39*/
34class KDateInternalMonthPicker : public QGridView 40class KDateInternalMonthPicker : public Q3GridView
35{ 41{
36 Q_OBJECT 42 Q_OBJECT
37protected: 43protected:
38 /** 44 /**
39 * Store the month that has been clicked [1..12]. 45 * Store the month that has been clicked [1..12].
40 */ 46 */
41 int result; 47 int result;
42 /** 48 /**
43 * the cell under mouse cursor when LBM is pressed 49 * the cell under mouse cursor when LBM is pressed
44 */ 50 */
45 short int activeCol; 51 short int activeCol;
46 short int activeRow; 52 short int activeRow;
@@ -118,25 +124,25 @@ public:
118 void setYear(int year); 124 void setYear(int year);
119 125
120private: 126private:
121 class KDateInternalYearPrivate; 127 class KDateInternalYearPrivate;
122 KDateInternalYearPrivate *d; 128 KDateInternalYearPrivate *d;
123}; 129};
124 130
125/** 131/**
126 * Frame with popup menu behaviour. 132 * Frame with popup menu behaviour.
127 * @author Tim Gilman, Mirko Boehm 133 * @author Tim Gilman, Mirko Boehm
128 * @version $Id$ 134 * @version $Id$
129 */ 135 */
130class KPopupFrame : public QFrame 136class KPopupFrame : public Q3Frame
131{ 137{
132 Q_OBJECT 138 Q_OBJECT
133protected: 139protected:
134 /** 140 /**
135 * The result. It is returned from exec() when the popup window closes. 141 * The result. It is returned from exec() when the popup window closes.
136 */ 142 */
137 int result; 143 int result;
138 /** 144 /**
139 * Catch key press events. 145 * Catch key press events.
140 */ 146 */
141 void keyPressEvent(QKeyEvent* e); 147 void keyPressEvent(QKeyEvent* e);
142 /** 148 /**
@@ -173,25 +179,25 @@ public:
173 void popup(const QPoint &pos); 179 void popup(const QPoint &pos);
174 /** 180 /**
175 * Execute the popup window. 181 * Execute the popup window.
176 */ 182 */
177 int exec(QPoint p); 183 int exec(QPoint p);
178 /** 184 /**
179 * Dito. 185 * Dito.
180 */ 186 */
181 int exec(int x, int y); 187 int exec(int x, int y);
182 188
183private: 189private:
184 190
185 virtual bool close(bool alsoDelete) { return QFrame::close(alsoDelete); } 191 virtual bool close(bool alsoDelete) { return Q3Frame::close(alsoDelete); }
186protected: 192protected:
187 virtual void virtual_hook( int id, void* data ); 193 virtual void virtual_hook( int id, void* data );
188private: 194private:
189 class KPopupFramePrivate; 195 class KPopupFramePrivate;
190 KPopupFramePrivate *d; 196 KPopupFramePrivate *d;
191}; 197};
192 198
193/** 199/**
194* Validates user-entered dates. 200* Validates user-entered dates.
195*/ 201*/
196class KDateValidator : public QValidator 202class KDateValidator : public QValidator
197{ 203{
@@ -206,34 +212,34 @@ public:
206 * Date selection table. 212 * Date selection table.
207 * This is a support class for the KDatePicker class. It just 213 * This is a support class for the KDatePicker class. It just
208 * draws the calender table without titles, but could theoretically 214 * draws the calender table without titles, but could theoretically
209 * be used as a standalone. 215 * be used as a standalone.
210 * 216 *
211 * When a date is selected by the user, it emits a signal: 217 * When a date is selected by the user, it emits a signal:
212 * dateSelected(QDate) 218 * dateSelected(QDate)
213 * 219 *
214 * @internal 220 * @internal
215 * @version $Id$ 221 * @version $Id$
216 * @author Tim Gilman, Mirko Boehm 222 * @author Tim Gilman, Mirko Boehm
217 */ 223 */
218class KDateTable : public QGridView 224class KDateTable : public Q3GridView
219{ 225{
220 Q_OBJECT 226 Q_OBJECT
221public: 227public:
222 /** 228 /**
223 * The constructor. 229 * The constructor.
224 */ 230 */
225 KDateTable(QWidget *parent=0, 231 KDateTable(QWidget *parent=0,
226 QDate date=QDate::currentDate(), 232 QDate date=QDate::currentDate(),
227 const char* name=0, WFlags f=0); 233 const char* name=0, Qt::WFlags f=0);
228 /** 234 /**
229 * Returns a recommended size for the widget. 235 * Returns a recommended size for the widget.
230 * To save some time, the size of the largest used cell content is 236 * To save some time, the size of the largest used cell content is
231 * calculated in each paintCell() call, since all calculations have 237 * calculated in each paintCell() call, since all calculations have
232 * to be done there anyway. The size is stored in maxCell. The 238 * to be done there anyway. The size is stored in maxCell. The
233 * sizeHint() simply returns a multiple of maxCell. 239 * sizeHint() simply returns a multiple of maxCell.
234 */ 240 */
235 virtual QSize sizeHint() const; 241 virtual QSize sizeHint() const;
236 /** 242 /**
237 * Set the font size of the date table. 243 * Set the font size of the date table.
238 */ 244 */
239 void setFontSize(int size); 245 void setFontSize(int size);
@@ -298,25 +304,25 @@ signals:
298 * A date has been selected by clicking on the table. 304 * A date has been selected by clicking on the table.
299 */ 305 */
300 void tableClicked(); 306 void tableClicked();
301 307
302protected: 308protected:
303 virtual void virtual_hook( int id, void* data ); 309 virtual void virtual_hook( int id, void* data );
304private: 310private:
305 class KDateTablePrivate; 311 class KDateTablePrivate;
306 KDateTablePrivate *d; 312 KDateTablePrivate *d;
307}; 313};
308 314
309#endif // KDATETBL_H 315#endif // KDATETBL_H
310class KDateInternalWeekPicker : public QGridView 316class KDateInternalWeekPicker : public Q3GridView
311{ 317{
312 Q_OBJECT 318 Q_OBJECT
313protected: 319protected:
314 /** 320 /**
315 * Store the month that has been clicked [1..12]. 321 * Store the month that has been clicked [1..12].
316 */ 322 */
317 int result; 323 int result;
318 /** 324 /**
319 * the cell under mouse cursor when LBM is pressed 325 * the cell under mouse cursor when LBM is pressed
320 */ 326 */
321 short int activeCol; 327 short int activeCol;
322 short int activeRow; 328 short int activeRow;
diff --git a/microkde/kdebug.h b/microkde/kdebug.h
index bb9cfe3..534943c 100644
--- a/microkde/kdebug.h
+++ b/microkde/kdebug.h
@@ -1,18 +1,20 @@
1#ifndef MINIKDE_KDEBUG_H 1#ifndef MINIKDE_KDEBUG_H
2#define MINIKDE_KDEBUG_H 2#define MINIKDE_KDEBUG_H
3 3
4#include <stdio.h> 4#include <stdio.h>
5 5
6#include <qstring.h> 6#include <qstring.h>
7//Added by qt3to4:
8#include <Q3CString>
7 9
8 10
9 11
10class kdbgstream; 12class kdbgstream;
11typedef kdbgstream & (*KDBGFUNC)(kdbgstream &); // manipulator function 13typedef kdbgstream & (*KDBGFUNC)(kdbgstream &); // manipulator function
12 14
13class kdbgstream { 15class kdbgstream {
14 public: 16 public:
15 kdbgstream(unsigned int _area, unsigned int _level, bool _print = true) : 17 kdbgstream(unsigned int _area, unsigned int _level, bool _print = true) :
16 area(_area), level(_level), print( _print ) { print = false; } 18 area(_area), level(_level), print( _print ) { print = false; }
17 /* kdbgstream(const char * initialString, unsigned int _area, unsigned int _level, bool _print = false) : 19 /* kdbgstream(const char * initialString, unsigned int _area, unsigned int _level, bool _print = false) :
18 output(QString::fromLatin1(initialString)), area(_area), level(_level), print(_print) { print = false; }*/ 20 output(QString::fromLatin1(initialString)), area(_area), level(_level), print(_print) { print = false; }*/
@@ -55,25 +57,25 @@ class kdbgstream {
55 kdbgstream &operator<<(long) { 57 kdbgstream &operator<<(long) {
56 return *this; 58 return *this;
57 } 59 }
58 kdbgstream &operator<<(unsigned long) { 60 kdbgstream &operator<<(unsigned long) {
59 return *this; 61 return *this;
60 } 62 }
61 kdbgstream &operator<<(const QString&) { 63 kdbgstream &operator<<(const QString&) {
62 return *this; 64 return *this;
63 } 65 }
64 kdbgstream &operator<<(const char*) { 66 kdbgstream &operator<<(const char*) {
65 return *this; 67 return *this;
66 } 68 }
67 kdbgstream &operator<<(const QCString&) { 69 kdbgstream &operator<<(const Q3CString&) {
68 return *this; 70 return *this;
69 } 71 }
70 kdbgstream& operator<<(KDBGFUNC f) { 72 kdbgstream& operator<<(KDBGFUNC f) {
71 return (*f)(*this); 73 return (*f)(*this);
72 } 74 }
73 kdbgstream& operator<<(double) { 75 kdbgstream& operator<<(double) {
74 if (!print) return *this; 76 if (!print) return *this;
75 return *this; 77 return *this;
76 } 78 }
77 void flush() { 79 void flush() {
78 return; 80 return;
79 } 81 }
diff --git a/microkde/kdecore/kcatalogue.cpp b/microkde/kdecore/kcatalogue.cpp
index 97ac326..1600b08 100644
--- a/microkde/kdecore/kcatalogue.cpp
+++ b/microkde/kdecore/kcatalogue.cpp
@@ -11,24 +11,26 @@
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20//US #include <config.h> 20//US #include <config.h>
21 21
22#include <qfile.h> 22#include <qfile.h>
23//Added by qt3to4:
24#include <Q3CString>
23 25
24#include <kdebug.h> 26#include <kdebug.h>
25 27
26#include "kcatalogue.h" 28#include "kcatalogue.h"
27 29
28char *k_nl_find_msg(struct kde_loaded_l10nfile *domain_file, 30char *k_nl_find_msg(struct kde_loaded_l10nfile *domain_file,
29 const char *msgid); 31 const char *msgid);
30void k_nl_unload_domain (struct loaded_domain *domain); 32void k_nl_unload_domain (struct loaded_domain *domain);
31 33
32#ifndef KDE_USE_FINAL // with --enable-final, we're getting this from libintl.cpp 34#ifndef KDE_USE_FINAL // with --enable-final, we're getting this from libintl.cpp
33struct kde_loaded_l10nfile 35struct kde_loaded_l10nfile
34{ 36{
@@ -79,25 +81,25 @@ KCatalogue::~KCatalogue()
79QString KCatalogue::name() const 81QString KCatalogue::name() const
80{ 82{
81 return d->name; 83 return d->name;
82} 84}
83 85
84void KCatalogue::setFileName( const QString & fileName ) 86void KCatalogue::setFileName( const QString & fileName )
85{ 87{
86 // nothing to do if the file name is already the same 88 // nothing to do if the file name is already the same
87 if ( this->fileName() == fileName ) return; 89 if ( this->fileName() == fileName ) return;
88 90
89 doUnload(); 91 doUnload();
90 92
91 QCString newFileName = QFile::encodeName( fileName ); 93 Q3CString newFileName = QFile::encodeName( fileName );
92 94
93 if ( !fileName.isEmpty() ) 95 if ( !fileName.isEmpty() )
94 { 96 {
95 // set file name 97 // set file name
96 char *filename = new char[ newFileName.length() + 1 ]; 98 char *filename = new char[ newFileName.length() + 1 ];
97 ::qstrcpy( filename, newFileName ); 99 ::qstrcpy( filename, newFileName );
98 d->domain.filename = filename; 100 d->domain.filename = filename;
99 } 101 }
100} 102}
101 103
102QString KCatalogue::fileName() const 104QString KCatalogue::fileName() const
103{ 105{
diff --git a/microkde/kdecore/kconfigbase.h b/microkde/kdecore/kconfigbase.h
index 7e56d11..1ef6a04 100644
--- a/microkde/kdecore/kconfigbase.h
+++ b/microkde/kdecore/kconfigbase.h
@@ -17,24 +17,26 @@
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22 22
23// $Id$ 23// $Id$
24 24
25#ifndef _KCONFIGBASE_H 25#ifndef _KCONFIGBASE_H
26#define _KCONFIGBASE_H 26#define _KCONFIGBASE_H
27 27
28#include "kconfig.h" 28#include "kconfig.h"
29//Added by qt3to4:
30#include <Q3CString>
29 31
30/** 32/**
31 * Helper class to facilitate working with @ref KConfig / @ref KSimpleConfig 33 * Helper class to facilitate working with @ref KConfig / @ref KSimpleConfig
32 * groups. 34 * groups.
33 * 35 *
34 * Careful programmers always set the group of a 36 * Careful programmers always set the group of a
35 * @ref KConfig @ref KSimpleConfig object to the group they want to read from 37 * @ref KConfig @ref KSimpleConfig object to the group they want to read from
36 * and set it back to the old one of afterwards. This is usually 38 * and set it back to the old one of afterwards. This is usually
37 * written as: 39 * written as:
38 * <pre> 40 * <pre>
39 * 41 *
40 * QString oldgroup config->group(); 42 * QString oldgroup config->group();
@@ -73,25 +75,25 @@ public:
73 * KConfigGroupSaver works on. 75 * KConfigGroupSaver works on.
74 * @param group The new group that the config object should switch to. 76 * @param group The new group that the config object should switch to.
75 */ 77 */
76 KConfigGroupSaver( KConfig* config, QString group ) 78 KConfigGroupSaver( KConfig* config, QString group )
77 /* KDE 4 : make the second parameter const QString & */ 79 /* KDE 4 : make the second parameter const QString & */
78 : _config(config), _oldgroup(config->group()) 80 : _config(config), _oldgroup(config->group())
79 { _config->setGroup( group ); } 81 { _config->setGroup( group ); }
80 82
81 KConfigGroupSaver( KConfig* config, const char *group ) 83 KConfigGroupSaver( KConfig* config, const char *group )
82 : _config(config), _oldgroup(config->group()) 84 : _config(config), _oldgroup(config->group())
83 { _config->setGroup( group ); } 85 { _config->setGroup( group ); }
84 86
85 KConfigGroupSaver( KConfig* config, const QCString &group ) 87 KConfigGroupSaver( KConfig* config, const Q3CString &group )
86 : _config(config), _oldgroup(config->group()) 88 : _config(config), _oldgroup(config->group())
87 { _config->setGroup( group ); } 89 { _config->setGroup( group ); }
88 90
89 ~KConfigGroupSaver() { _config->setGroup( _oldgroup ); } 91 ~KConfigGroupSaver() { _config->setGroup( _oldgroup ); }
90 92
91 KConfig* config() { return _config; }; 93 KConfig* config() { return _config; };
92 94
93private: 95private:
94 KConfig* _config; 96 KConfig* _config;
95 QString _oldgroup; 97 QString _oldgroup;
96 98
97 KConfigGroupSaver(const KConfigGroupSaver&); 99 KConfigGroupSaver(const KConfigGroupSaver&);
diff --git a/microkde/kdecore/klibloader.cpp b/microkde/kdecore/klibloader.cpp
index 6d0475a..0b54eb6 100644
--- a/microkde/kdecore/klibloader.cpp
+++ b/microkde/kdecore/klibloader.cpp
@@ -11,50 +11,53 @@
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19//US #include <config.h> 19//US #include <config.h>
20#include <qclipboard.h> 20#include <qclipboard.h>
21#include <qfile.h> 21#include <qfile.h>
22#include <qtimer.h> 22#include <qtimer.h>
23#include <qobjectdict.h> 23#include <q3objectdict.h>
24#include <qwidgetlist.h>
25#include <qwidget.h> 24#include <qwidget.h>
25#include <qwidget.h>
26//Added by qt3to4:
27#include <Q3CString>
28#include <Q3PtrList>
26 29
27#include "kapplication.h" 30#include "kapplication.h"
28#include "klibloader.h" 31#include "klibloader.h"
29#include "kstandarddirs.h" 32#include "kstandarddirs.h"
30#include "kdebug.h" 33#include "kdebug.h"
31#include "klocale.h" 34#include "klocale.h"
32 35
33/*US 36/*US
34#ifndef NDEBUG 37#ifndef NDEBUG
35#include "ltdl.h" 38#include "ltdl.h"
36#endif 39#endif
37*/ 40*/
38 41
39//US do everything through qlibrary 42//US do everything through qlibrary
40#ifndef DESKTOP_VERSION 43#ifndef DESKTOP_VERSION
41#include <qpe/qpeapplication.h> 44#include <qpe/qpeapplication.h>
42#include <qtopia/qlibrary.h> 45#include <qtopia/qlibrary.h>
43#else 46#else
44#include <qlibrary.h> 47#include <qlibrary.h>
45#endif 48#endif
46 49
47 50
48template class QAsciiDict<KLibrary>; 51template class Q3AsciiDict<KLibrary>;
49 52
50#include <stdlib.h> //getenv 53#include <stdlib.h> //getenv
51 54
52/*US 55/*US
53#if HAVE_DLFCN_H 56#if HAVE_DLFCN_H
54# include <dlfcn.h> 57# include <dlfcn.h>
55#endif 58#endif
56 59
57#ifdef RTLD_GLOBAL 60#ifdef RTLD_GLOBAL
58# define LT_GLOBAL RTLD_GLOBAL 61# define LT_GLOBAL RTLD_GLOBAL
59#else 62#else
60# ifdef DL_GLOBAL 63# ifdef DL_GLOBAL
@@ -111,25 +114,25 @@ KLibrary::KLibrary( const QString& libname, const QString& filename, QLibrary* h
111 m_timer = 0; 114 m_timer = 0;
112} 115}
113 116
114KLibrary::~KLibrary() 117KLibrary::~KLibrary()
115{ 118{
116// kdDebug(150) << "Deleting KLibrary " << this << " " << m_libname << endl; 119// kdDebug(150) << "Deleting KLibrary " << this << " " << m_libname << endl;
117 if ( m_timer && m_timer->isActive() ) 120 if ( m_timer && m_timer->isActive() )
118 m_timer->stop(); 121 m_timer->stop();
119 122
120 // If any object is remaining, delete 123 // If any object is remaining, delete
121 if ( m_objs.count() > 0 ) 124 if ( m_objs.count() > 0 )
122 { 125 {
123 QPtrListIterator<QObject> it( m_objs ); 126 Q3PtrListIterator<QObject> it( m_objs );
124 for ( ; it.current() ; ++it ) 127 for ( ; it.current() ; ++it )
125 { 128 {
126 kdDebug(150) << "Factory still has object " << it.current() << " " << it.current()->name () << " Library = " << m_libname << endl; 129 kdDebug(150) << "Factory still has object " << it.current() << " " << it.current()->name () << " Library = " << m_libname << endl;
127 disconnect( it.current(), SIGNAL( destroyed() ), 130 disconnect( it.current(), SIGNAL( destroyed() ),
128 this, SLOT( slotObjectDestroyed() ) ); 131 this, SLOT( slotObjectDestroyed() ) );
129 } 132 }
130 m_objs.setAutoDelete(true); 133 m_objs.setAutoDelete(true);
131 m_objs.clear(); 134 m_objs.clear();
132 } 135 }
133 136
134 if ( m_factory ) { 137 if ( m_factory ) {
135 //kdDebug(150) << " ... deleting the factory " << m_factory << endl; 138 //kdDebug(150) << " ... deleting the factory " << m_factory << endl;
@@ -143,25 +146,25 @@ QString KLibrary::name() const
143} 146}
144 147
145QString KLibrary::fileName() const 148QString KLibrary::fileName() const
146{ 149{
147 return m_filename; 150 return m_filename;
148} 151}
149 152
150KLibFactory* KLibrary::factory() 153KLibFactory* KLibrary::factory()
151{ 154{
152 if ( m_factory ) 155 if ( m_factory )
153 return m_factory; 156 return m_factory;
154 157
155 QCString symname; 158 Q3CString symname;
156 symname.sprintf("init_%s", name().latin1() ); 159 symname.sprintf("init_%s", name().latin1() );
157 160
158 void* sym = symbol( symname ); 161 void* sym = symbol( symname );
159 if ( !sym ) 162 if ( !sym )
160 { 163 {
161 qDebug("KLibrary: The library %s does not offer an %s function", name().latin1(), symname.data()); 164 qDebug("KLibrary: The library %s does not offer an %s function", name().latin1(), symname.data());
162#ifndef NDEBUG 165#ifndef NDEBUG
163//US qDebug("KLibrary: errorcode: %s", lt_dlerror()); 166//US qDebug("KLibrary: errorcode: %s", lt_dlerror());
164#endif 167#endif
165 kdWarning(150) << "KLibrary: The library " << name().latin1() << " does not offer an init_" << name().latin1() << " function" << endl; 168 kdWarning(150) << "KLibrary: The library " << name().latin1() << " does not offer an init_" << name().latin1() << " function" << endl;
166 return 0; 169 return 0;
167 } 170 }
@@ -296,26 +299,26 @@ KLibWrapPrivate::KLibWrapPrivate(KLibrary *l, QLibrary* h)
296//US use instead: 299//US use instead:
297 if (h->resolve("__kde_do_not_unload") != 0) { 300 if (h->resolve("__kde_do_not_unload") != 0) {
298// kdDebug(150) << "Will not unload " << name << endl; 301// kdDebug(150) << "Will not unload " << name << endl;
299 unload_mode = DONT_UNLOAD; 302 unload_mode = DONT_UNLOAD;
300 } else if (h->resolve("__kde_do_unload") != 0) { 303 } else if (h->resolve("__kde_do_unload") != 0) {
301 unload_mode = UNLOAD; 304 unload_mode = UNLOAD;
302 } 305 }
303} 306}
304 307
305class KLibLoaderPrivate 308class KLibLoaderPrivate
306{ 309{
307public: 310public:
308 QPtrList<KLibWrapPrivate> loaded_stack; 311 Q3PtrList<KLibWrapPrivate> loaded_stack;
309 QPtrList<KLibWrapPrivate> pending_close; 312 Q3PtrList<KLibWrapPrivate> pending_close;
310 enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode; 313 enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode;
311 314
312 QString errorMessage; 315 QString errorMessage;
313}; 316};
314 317
315KLibLoader* KLibLoader::s_self = 0; 318KLibLoader* KLibLoader::s_self = 0;
316 319
317KLibLoader* KLibLoader::self() 320KLibLoader* KLibLoader::self()
318{ 321{
319 if ( !s_self ) 322 if ( !s_self )
320 s_self = new KLibLoader; 323 s_self = new KLibLoader;
321 return s_self; 324 return s_self;
@@ -339,41 +342,41 @@ KLibLoader::KLibLoader( QObject* parent, const char* name )
339 d->unload_mode = KLibLoaderPrivate::UNKNOWN; 342 d->unload_mode = KLibLoaderPrivate::UNKNOWN;
340 if (getenv("KDE_NOUNLOAD") != 0) 343 if (getenv("KDE_NOUNLOAD") != 0)
341 d->unload_mode = KLibLoaderPrivate::DONT_UNLOAD; 344 d->unload_mode = KLibLoaderPrivate::DONT_UNLOAD;
342 else if (getenv("KDE_DOUNLOAD") != 0) 345 else if (getenv("KDE_DOUNLOAD") != 0)
343 d->unload_mode = KLibLoaderPrivate::UNLOAD; 346 d->unload_mode = KLibLoaderPrivate::UNLOAD;
344 d->loaded_stack.setAutoDelete( true ); 347 d->loaded_stack.setAutoDelete( true );
345} 348}
346 349
347KLibLoader::~KLibLoader() 350KLibLoader::~KLibLoader()
348{ 351{
349// kdDebug(150) << "Deleting KLibLoader " << this << " " << name() << endl; 352// kdDebug(150) << "Deleting KLibLoader " << this << " " << name() << endl;
350 353
351 QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); 354 Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs );
352 for (; it.current(); ++it ) 355 for (; it.current(); ++it )
353 { 356 {
354 kdDebug(150) << "The KLibLoader contains the library " << it.current()->name 357 kdDebug(150) << "The KLibLoader contains the library " << it.current()->name
355 << " (" << it.current()->lib << ")" << endl; 358 << " (" << it.current()->lib << ")" << endl;
356 d->pending_close.append(it.current()); 359 d->pending_close.append(it.current());
357 } 360 }
358 361
359 close_pending(0); 362 close_pending(0);
360 363
361 delete d; 364 delete d;
362} 365}
363 366
364//static 367//static
365QString KLibLoader::findLibrary( const char * name/*US , const KInstance * instance*/ ) 368QString KLibLoader::findLibrary( const char * name/*US , const KInstance * instance*/ )
366{ 369{
367 QCString libname( name ); 370 Q3CString libname( name );
368 371
369 // only append ".la" if there is no extension 372 // only append ".la" if there is no extension
370 // this allows to load non-libtool libraries as well 373 // this allows to load non-libtool libraries as well
371 // (mhk, 20000228) 374 // (mhk, 20000228)
372 int pos = libname.findRev('/'); 375 int pos = libname.findRev('/');
373 if (pos < 0) 376 if (pos < 0)
374 pos = 0; 377 pos = 0;
375/*US 378/*US
376 if (libname.find('.', pos) < 0) { 379 if (libname.find('.', pos) < 0) {
377 libname += ".la"; 380 libname += ".la";
378 } 381 }
379*/ 382*/
@@ -412,25 +415,25 @@ QString KLibLoader::findLibrary( const char * name/*US , const KInstance * insta
412//US libfile = instance->dirs()->findResource( "lib", libname ); 415//US libfile = instance->dirs()->findResource( "lib", libname );
413 libfile = KGlobal::dirs()->findResource( "lib", libname ); 416 libfile = KGlobal::dirs()->findResource( "lib", libname );
414 //qDebug("libfile2 = %s ",libfile.latin1() ); 417 //qDebug("libfile2 = %s ",libfile.latin1() );
415#ifndef NDEBUG 418#ifndef NDEBUG
416 if ( !libfile.isEmpty() && libname.left(3) == "lib" ) // don't warn for kdeinit modules 419 if ( !libfile.isEmpty() && libname.left(3) == "lib" ) // don't warn for kdeinit modules
417 kdDebug(150) << "library " << libname << " not found under 'module' but under 'lib'" << endl; 420 kdDebug(150) << "library " << libname << " not found under 'module' but under 'lib'" << endl;
418#endif 421#endif
419 } 422 }
420 if ( libfile.isEmpty() ) 423 if ( libfile.isEmpty() )
421 { 424 {
422#ifndef NDEBUG 425#ifndef NDEBUG
423 kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl; 426 kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl;
424 self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname); 427 self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(QString(libname));
425 428
426 qDebug("KLibLoader::library could not find library: %s", libname.data()); 429 qDebug("KLibLoader::library could not find library: %s", libname.data());
427#endif 430#endif
428 431
429 } 432 }
430 else 433 else
431 self()->d->errorMessage = QString::null; 434 self()->d->errorMessage = QString::null;
432 } 435 }
433 436
434 //qDebug("return libfile = %s ",libfile.latin1() ); 437 //qDebug("return libfile = %s ",libfile.latin1() );
435 return libfile; 438 return libfile;
436} 439}
@@ -460,25 +463,25 @@ KLibrary* KLibLoader::library( const char *name )
460 if (!name) 463 if (!name)
461 return 0; 464 return 0;
462 465
463 KLibWrapPrivate* wrap = m_libs[name]; 466 KLibWrapPrivate* wrap = m_libs[name];
464 if (wrap) { 467 if (wrap) {
465 /* Nothing to do to load the library. */ 468 /* Nothing to do to load the library. */
466 wrap->ref_count++; 469 wrap->ref_count++;
467 return wrap->lib; 470 return wrap->lib;
468 } 471 }
469 472
470 /* Test if this library was loaded at some time, but got 473 /* Test if this library was loaded at some time, but got
471 unloaded meanwhile, whithout being dlclose()'ed. */ 474 unloaded meanwhile, whithout being dlclose()'ed. */
472 QPtrListIterator<KLibWrapPrivate> it(d->loaded_stack); 475 Q3PtrListIterator<KLibWrapPrivate> it(d->loaded_stack);
473 for (; it.current(); ++it) { 476 for (; it.current(); ++it) {
474 if (it.current()->name == name) 477 if (it.current()->name == name)
475 wrap = it.current(); 478 wrap = it.current();
476 } 479 }
477 480
478 if (wrap) { 481 if (wrap) {
479 d->pending_close.removeRef(wrap); 482 d->pending_close.removeRef(wrap);
480 if (!wrap->lib) { 483 if (!wrap->lib) {
481 /* This lib only was in loaded_stack, but not in m_libs. */ 484 /* This lib only was in loaded_stack, but not in m_libs. */
482 wrap->lib = new KLibrary( name, wrap->filename, wrap->handle ); 485 wrap->lib = new KLibrary( name, wrap->filename, wrap->handle );
483 } 486 }
484 wrap->ref_count++; 487 wrap->ref_count++;
@@ -541,44 +544,44 @@ KLibFactory* KLibLoader::factory( const char* name )
541{ 544{
542 KLibrary* lib = library( name ); 545 KLibrary* lib = library( name );
543 if ( !lib ) 546 if ( !lib )
544 return 0; 547 return 0;
545 548
546 return lib->factory(); 549 return lib->factory();
547} 550}
548 551
549void KLibLoader::slotLibraryDestroyed() 552void KLibLoader::slotLibraryDestroyed()
550{ 553{
551 const KLibrary *lib = static_cast<const KLibrary *>( sender() ); 554 const KLibrary *lib = static_cast<const KLibrary *>( sender() );
552 555
553 QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); 556 Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs );
554 for (; it.current(); ++it ) 557 for (; it.current(); ++it )
555 if ( it.current()->lib == lib ) 558 if ( it.current()->lib == lib )
556 { 559 {
557 KLibWrapPrivate *wrap = it.current(); 560 KLibWrapPrivate *wrap = it.current();
558 wrap->lib = 0; /* the KLibrary object is already away */ 561 wrap->lib = 0; /* the KLibrary object is already away */
559 m_libs.remove( it.currentKey() ); 562 m_libs.remove( it.currentKey() );
560 close_pending( wrap ); 563 close_pending( wrap );
561 return; 564 return;
562 } 565 }
563} 566}
564 567
565void KLibLoader::close_pending(KLibWrapPrivate *wrap) 568void KLibLoader::close_pending(KLibWrapPrivate *wrap)
566{ 569{
567 if (wrap && !d->pending_close.containsRef( wrap )) 570 if (wrap && !d->pending_close.containsRef( wrap ))
568 d->pending_close.append( wrap ); 571 d->pending_close.append( wrap );
569 572
570 /* First delete all KLibrary objects in pending_close, but _don't_ unload 573 /* First delete all KLibrary objects in pending_close, but _don't_ unload
571 the DSO behind it. */ 574 the DSO behind it. */
572 QPtrListIterator<KLibWrapPrivate> it(d->pending_close); 575 Q3PtrListIterator<KLibWrapPrivate> it(d->pending_close);
573 for (; it.current(); ++it) { 576 for (; it.current(); ++it) {
574 wrap = it.current(); 577 wrap = it.current();
575 if (wrap->lib) { 578 if (wrap->lib) {
576 disconnect( wrap->lib, SIGNAL( destroyed() ), 579 disconnect( wrap->lib, SIGNAL( destroyed() ),
577 this, SLOT( slotLibraryDestroyed() ) ); 580 this, SLOT( slotLibraryDestroyed() ) );
578 delete wrap->lib; 581 delete wrap->lib;
579 wrap->lib = 0; 582 wrap->lib = 0;
580 } 583 }
581 } 584 }
582 585
583 if (d->unload_mode == KLibLoaderPrivate::DONT_UNLOAD) return; 586 if (d->unload_mode == KLibLoaderPrivate::DONT_UNLOAD) return;
584 587
diff --git a/microkde/kdecore/klibloader.h b/microkde/kdecore/klibloader.h
index ed57109..53d146e 100644
--- a/microkde/kdecore/klibloader.h
+++ b/microkde/kdecore/klibloader.h
@@ -12,26 +12,26 @@
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18#ifndef KLIBLOADER_H 18#ifndef KLIBLOADER_H
19#define KLIBLOADER_H 19#define KLIBLOADER_H
20 20
21#include <qobject.h> 21#include <qobject.h>
22#include <qstring.h> 22#include <qstring.h>
23#include <qstringlist.h> 23#include <qstringlist.h>
24#include <qasciidict.h> 24#include <q3asciidict.h>
25#include <qptrlist.h> 25#include <q3ptrlist.h>
26#include <kglobal.h> 26#include <kglobal.h>
27 27
28#include <stdlib.h> // For backwards compatibility 28#include <stdlib.h> // For backwards compatibility
29 29
30class KInstance; 30class KInstance;
31class QTimer; 31class QTimer;
32class KLibrary; 32class KLibrary;
33class KLibFactory; 33class KLibFactory;
34class KLibFactoryPrivate; 34class KLibFactoryPrivate;
35class KLibLoaderPrivate; 35class KLibLoaderPrivate;
36class KLibraryPrivate; 36class KLibraryPrivate;
37 37
@@ -43,25 +43,25 @@ class QLibrary;
43/** 43/**
44 * @short Represents a dynamically loaded library. 44 * @short Represents a dynamically loaded library.
45 * 45 *
46 * KLibrary allows you to look up symbols of the shared library. 46 * KLibrary allows you to look up symbols of the shared library.
47 * Use @ref KLibLoader to create a new instance of KLibrary. 47 * Use @ref KLibLoader to create a new instance of KLibrary.
48 * 48 *
49 * @see KLibLoader 49 * @see KLibLoader
50 * @author Torben Weis <weis@kde.org> 50 * @author Torben Weis <weis@kde.org>
51 */ 51 */
52class KLibrary : public QObject 52class KLibrary : public QObject
53{ 53{
54 friend class KLibLoader; 54 friend class KLibLoader;
55 friend class QAsciiDict<KLibrary>; 55 friend class Q3AsciiDict<KLibrary>;
56 56
57 Q_OBJECT 57 Q_OBJECT
58public: 58public:
59 /** 59 /**
60 * @internal 60 * @internal
61 * Don't create KLibrary objects on your own. Instead use @ref KLibLoader. 61 * Don't create KLibrary objects on your own. Instead use @ref KLibLoader.
62 */ 62 */
63//US KLibrary( const QString& libname, const QString& filename, void * handle ); 63//US KLibrary( const QString& libname, const QString& filename, void * handle );
64 KLibrary( const QString& libname, const QString& filename, QLibrary* handle ); 64 KLibrary( const QString& libname, const QString& filename, QLibrary* handle );
65 65
66 /** 66 /**
67 * Returns the name of the library. 67 * Returns the name of the library.
@@ -118,25 +118,25 @@ private slots:
118private: 118private:
119 /** 119 /**
120 * @internal 120 * @internal
121 * Don't destruct KLibrary objects yourself. Instead use @ref unload() instead. 121 * Don't destruct KLibrary objects yourself. Instead use @ref unload() instead.
122 */ 122 */
123 ~KLibrary(); 123 ~KLibrary();
124 124
125 QString m_libname; 125 QString m_libname;
126 QString m_filename; 126 QString m_filename;
127 KLibFactory* m_factory; 127 KLibFactory* m_factory;
128//US void * m_handle; 128//US void * m_handle;
129 QLibrary* m_handle; 129 QLibrary* m_handle;
130 QPtrList<QObject> m_objs; 130 Q3PtrList<QObject> m_objs;
131 QTimer *m_timer; 131 QTimer *m_timer;
132 KLibraryPrivate *d; 132 KLibraryPrivate *d;
133}; 133};
134 134
135class KLibWrapPrivate; 135class KLibWrapPrivate;
136 136
137/** 137/**
138 * The KLibLoader allows you to load libraries dynamically at runtime. 138 * The KLibLoader allows you to load libraries dynamically at runtime.
139 * Dependent libraries are loaded automatically. 139 * Dependent libraries are loaded automatically.
140 * 140 *
141 * KLibLoader follows the singleton pattern. You can not create multiple 141 * KLibLoader follows the singleton pattern. You can not create multiple
142 * instances. Use @ref self() to get a pointer to the loader. 142 * instances. Use @ref self() to get a pointer to the loader.
@@ -278,25 +278,25 @@ public:
278 * ".la" will be appended. 278 * ".la" will be appended.
279 * @param instance a KInstance used to get the standard paths 279 * @param instance a KInstance used to get the standard paths
280 */ 280 */
281 static QString findLibrary( const char * name/*US , const KInstance * instance = KGlobal::instance()*/ ); 281 static QString findLibrary( const char * name/*US , const KInstance * instance = KGlobal::instance()*/ );
282 282
283protected: 283protected:
284 KLibLoader( QObject* parent = 0, const char* name = 0 ); 284 KLibLoader( QObject* parent = 0, const char* name = 0 );
285 285
286private slots: 286private slots:
287 void slotLibraryDestroyed(); 287 void slotLibraryDestroyed();
288private: 288private:
289 void close_pending( KLibWrapPrivate * ); 289 void close_pending( KLibWrapPrivate * );
290 QAsciiDict<KLibWrapPrivate> m_libs; 290 Q3AsciiDict<KLibWrapPrivate> m_libs;
291 291
292 static KLibLoader* s_self; 292 static KLibLoader* s_self;
293 293
294protected: 294protected:
295 virtual void virtual_hook( int id, void* data ); 295 virtual void virtual_hook( int id, void* data );
296private: 296private:
297 KLibLoaderPrivate *d; 297 KLibLoaderPrivate *d;
298}; 298};
299 299
300/** 300/**
301 * If you develop a library that is to be loaded dynamically at runtime, then 301 * If you develop a library that is to be loaded dynamically at runtime, then
302 * you should return a pointer to your factory. The K_EXPORT_COMPONENT_FACTORY 302 * you should return a pointer to your factory. The K_EXPORT_COMPONENT_FACTORY
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp
index 1d8ae9f..dd310fa 100644
--- a/microkde/kdecore/klocale.cpp
+++ b/microkde/kdecore/klocale.cpp
@@ -1,27 +1,28 @@
1#include <qregexp.h> 1#include <qregexp.h>
2#include <qapplication.h> 2#include <qapplication.h>
3#include <QDesktopWidget>
3 4
4#include "kdebug.h" 5#include "kdebug.h"
5#include "kcalendarsystemgregorian.h" 6#include "kcalendarsystemgregorian.h"
6 7
7#include "klocale.h" 8#include "klocale.h"
8 9
9#include <qstringlist.h> 10#include <qstringlist.h>
10 11
11//#define COLLECT_TRANSLATION 12//#define COLLECT_TRANSLATION
12 13
13 14
14QDict<QString> *mLocaleDict = 0; 15Q3Dict<QString> *mLocaleDict = 0;
15void setLocaleDict( QDict<QString> * dict ) 16void setLocaleDict( Q3Dict<QString> * dict )
16{ 17{
17 mLocaleDict = dict; 18 mLocaleDict = dict;
18 19
19} 20}
20 21
21#ifdef COLLECT_TRANSLATION 22#ifdef COLLECT_TRANSLATION
22 23
23QStringList missingTrans; 24QStringList missingTrans;
24QStringList existingTrans1; 25QStringList existingTrans1;
25QStringList existingTrans2; 26QStringList existingTrans2;
26 27
27void addMissing(const char *text) 28void addMissing(const char *text)
@@ -36,53 +37,53 @@ void addExist(const char *text,QString trans )
36{ 37{
37 //return; 38 //return;
38 QString mis ( text ); 39 QString mis ( text );
39 if ( !existingTrans1.contains( mis ) ) { 40 if ( !existingTrans1.contains( mis ) ) {
40 existingTrans1.append(mis); 41 existingTrans1.append(mis);
41 existingTrans2.append(trans); 42 existingTrans2.append(trans);
42 43
43 } 44 }
44 45
45} 46}
46 47
47#include <qfile.h> 48#include <qfile.h>
48#include <qtextstream.h> 49#include <q3textstream.h>
49#include <qtextcodec.h> 50#include <qtextcodec.h>
50#endif 51#endif
51void dumpMissing() 52void dumpMissing()
52{ 53{
53#ifdef COLLECT_TRANSLATION 54#ifdef COLLECT_TRANSLATION
54 QString fileName = "/tmp/usernewtrans.txt"; 55 QString fileName = "/tmp/usernewtrans.txt";
55 QFile file( fileName ); 56 QFile file( fileName );
56 if (!file.open( IO_WriteOnly ) ) { 57 if (!file.open( QIODevice::WriteOnly ) ) {
57 return ; 58 return ;
58 } 59 }
59 QTextStream ts( &file ); 60 Q3TextStream ts( &file );
60 ts.setCodec( QTextCodec::codecForName("utf8") ); 61 ts.setCodec( QTextCodec::codecForName("utf8") );
61 62
62 int i; 63 int i;
63 for ( i = 0; i< missingTrans.count(); ++i ) { 64 for ( i = 0; i< missingTrans.count(); ++i ) {
64 65
65 QString text = missingTrans[i].replace( QRegExp("\n"),"\\n" ); 66 QString text = missingTrans[i].replace( QRegExp("\n"),"\\n" );
66 ts << "{ \""<<text<< "\",\""<< text <<"\" },\n"; 67 ts << "{ \""<<text<< "\",\""<< text <<"\" },\n";
67 68
68 } 69 }
69 file.close(); 70 file.close();
70 { 71 {
71 QString fileName = "/tmp/usertrans.txt"; 72 QString fileName = "/tmp/usertrans.txt";
72 QFile file( fileName ); 73 QFile file( fileName );
73 if (!file.open( IO_WriteOnly ) ) { 74 if (!file.open( QIODevice::WriteOnly ) ) {
74 return ; 75 return ;
75 } 76 }
76 QTextStream ts( &file ); 77 Q3TextStream ts( &file );
77 ts.setCodec( QTextCodec::codecForName("utf8") ); 78 ts.setCodec( QTextCodec::codecForName("utf8") );
78 79
79 int i; 80 int i;
80 for ( i = 0; i< existingTrans1.count(); ++i ) { 81 for ( i = 0; i< existingTrans1.count(); ++i ) {
81 82
82 QString text = existingTrans1[i].replace( QRegExp("\n"),"\\n" ); 83 QString text = existingTrans1[i].replace( QRegExp("\n"),"\\n" );
83 QString text2 = existingTrans2[i].replace( QRegExp("\n"),"\\n" ); 84 QString text2 = existingTrans2[i].replace( QRegExp("\n"),"\\n" );
84 ts << "{ \""<<text<< "\",\""<< text2 <<"\" },\n"; 85 ts << "{ \""<<text<< "\",\""<< text2 <<"\" },\n";
85 86
86 } 87 }
87 file.close(); 88 file.close();
88 } 89 }
@@ -458,25 +459,25 @@ QString KLocale::formatDate(const QDate &pDate, bool shortFormat, IntDateFormat
458 459
459QString KLocale::formatDateTime(const QDateTime &pDateTime, 460QString KLocale::formatDateTime(const QDateTime &pDateTime,
460 bool shortFormat, 461 bool shortFormat,
461 bool includeSeconds, 462 bool includeSeconds,
462 IntDateFormat intIntDateFormat) const 463 IntDateFormat intIntDateFormat) const
463{ 464{
464 QString format("%1 %2"); 465 QString format("%1 %2");
465 466
466 if ( intIntDateFormat == Default ) 467 if ( intIntDateFormat == Default )
467 format = "%1 %2"; 468 format = "%1 %2";
468 else if ( intIntDateFormat == Format1 ) 469 else if ( intIntDateFormat == Format1 )
469 format = "%1 %2"; 470 format = "%1 %2";
470 else if ( intIntDateFormat == ISODate ) 471 else if ( intIntDateFormat == Qt::ISODate )
471 format = "%1T%2"; 472 format = "%1T%2";
472 473
473 QString res = format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat )) 474 QString res = format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat ))
474 .arg(formatTime( pDateTime.time(), includeSeconds , intIntDateFormat )); 475 .arg(formatTime( pDateTime.time(), includeSeconds , intIntDateFormat ));
475 476
476 //qDebug("KLocale::formatDateTime transformed %s, into %s", pDateTime.toString().latin1(), res.latin1() ); 477 //qDebug("KLocale::formatDateTime transformed %s, into %s", pDateTime.toString().latin1(), res.latin1() );
477 478
478 return res; 479 return res;
479} 480}
480 481
481QString KLocale::formatDateTime(const QDateTime &pDateTime, IntDateFormat intIntDateFormat) const 482QString KLocale::formatDateTime(const QDateTime &pDateTime, IntDateFormat intIntDateFormat) const
482{ 483{
@@ -518,25 +519,25 @@ QDate KLocale::readDate(const QString &intstr, const QString &fmt, bool* ok) con
518 if (c.isSpace()) 519 if (c.isSpace())
519 strpos++; 520 strpos++;
520 else if (c != str.at(strpos++)) 521 else if (c != str.at(strpos++))
521 goto error; 522 goto error;
522 continue; 523 continue;
523 } 524 }
524 525
525 // remove space at the begining 526 // remove space at the begining
526 if (str.length() > strpos && str.at(strpos).isSpace()) 527 if (str.length() > strpos && str.at(strpos).isSpace())
527 strpos++; 528 strpos++;
528 529
529 c = fmt.at(fmtpos++); 530 c = fmt.at(fmtpos++);
530 switch (c) 531 switch (c.unicode())
531 { 532 {
532 case 'a': 533 case 'a':
533 case 'A': 534 case 'A':
534 // this will just be ignored 535 // this will just be ignored
535 { // Cristian Tache: porting to Win: Block added because of "j" redefinition 536 { // Cristian Tache: porting to Win: Block added because of "j" redefinition
536 for (int j = 1; j < 8; j++) { 537 for (int j = 1; j < 8; j++) {
537 QString s = weekDayName(j, c == 'a').lower(); 538 QString s = weekDayName(j, c == 'a').lower();
538 int len = s.length(); 539 int len = s.length();
539 if (str.mid(strpos, len) == s) 540 if (str.mid(strpos, len) == s)
540 strpos += len; 541 strpos += len;
541 } 542 }
542 break; 543 break;
@@ -629,25 +630,25 @@ QTime KLocale::readTime(const QString &intstr, bool seconds, bool *ok) const
629 if (c.isSpace()) 630 if (c.isSpace())
630 strpos++; 631 strpos++;
631 else if (c != str.at(strpos++)) 632 else if (c != str.at(strpos++))
632 goto error; 633 goto error;
633 continue; 634 continue;
634 } 635 }
635 636
636 // remove space at the begining 637 // remove space at the begining
637 if (str.length() > strpos && str.at(strpos).isSpace()) 638 if (str.length() > strpos && str.at(strpos).isSpace())
638 strpos++; 639 strpos++;
639 640
640 c = Format.at(Formatpos++); 641 c = Format.at(Formatpos++);
641 switch (c) 642 switch (c.unicode())
642 { 643 {
643 case 'p': 644 case 'p':
644 { 645 {
645 QString s; 646 QString s;
646 s = i18n("pm").lower(); 647 s = i18n("pm").lower();
647 int len = s.length(); 648 int len = s.length();
648 if (str.mid(strpos, len) == s) 649 if (str.mid(strpos, len) == s)
649 { 650 {
650 pm = true; 651 pm = true;
651 strpos += len; 652 strpos += len;
652 } 653 }
653 else 654 else
@@ -725,25 +726,25 @@ QDateTime KLocale::readDateTime(const QString &intstr,
725 qDebug("KLocale::readDateTime, only ISODate is supported."); 726 qDebug("KLocale::readDateTime, only ISODate is supported.");
726 return QDateTime(); 727 return QDateTime();
727 } 728 }
728 729
729 int pos = intstr.find("T"); 730 int pos = intstr.find("T");
730 QString date = intstr.left(pos); 731 QString date = intstr.left(pos);
731 QString time = intstr.mid(pos+1); 732 QString time = intstr.mid(pos+1);
732 733
733 QString dformat = dateFormat(intIntDateFormat); 734 QString dformat = dateFormat(intIntDateFormat);
734 QString tformat = timeFormat(intIntDateFormat); 735 QString tformat = timeFormat(intIntDateFormat);
735 736
736 QDate m_date = readDate(date, dformat, &ok1); 737 QDate m_date = readDate(date, dformat, &ok1);
737 QTime m_time = readTime(time, tformat, &ok2); 738 QTime m_time = readTime(time, !tformat.isEmpty(), &ok2);
738 739
739 QDateTime m_dt; 740 QDateTime m_dt;
740 741
741 if (ok) 742 if (ok)
742 { 743 {
743 if ((ok1 == false) || (ok2 == false)) 744 if ((ok1 == false) || (ok2 == false))
744 *ok = false; 745 *ok = false;
745 else 746 else
746 *ok = true; 747 *ok = true;
747 } 748 }
748 749
749 //only set values if both operations returned true. 750 //only set values if both operations returned true.
diff --git a/microkde/kdecore/klocale.h b/microkde/kdecore/klocale.h
index 58e0b39..840fc9d 100644
--- a/microkde/kdecore/klocale.h
+++ b/microkde/kdecore/klocale.h
@@ -1,26 +1,26 @@
1#ifndef MINIKDE_KLOCALE_H 1#ifndef MINIKDE_KLOCALE_H
2#define MINIKDE_KLOCALE_H 2#define MINIKDE_KLOCALE_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5#include <qstringlist.h> 5#include <qstringlist.h>
6#include <qdatetime.h> 6#include <qdatetime.h>
7#include <qdict.h> 7#include <q3dict.h>
8 8
9#ifndef I18N_NOOP 9#ifndef I18N_NOOP
10#define I18N_NOOP(x) (x) 10#define I18N_NOOP(x) (x)
11#endif 11#endif
12 12
13class KCalendarSystem; 13class KCalendarSystem;
14void setLocaleDict( QDict<QString> * dict ); 14void setLocaleDict( Q3Dict<QString> * dict );
15QString i18n(const char *text); 15QString i18n(const char *text);
16QString i18n(const char *hint, const char *text); 16QString i18n(const char *hint, const char *text);
17QString i18n(const char *text1, const char *textn, int num); 17QString i18n(const char *text1, const char *textn, int num);
18 18
19// Qt3's uic generates i18n( "msg", "comment" ) calls which conflict 19// Qt3's uic generates i18n( "msg", "comment" ) calls which conflict
20// with our i18n method. we use uic -tr tr2i18n to redirect 20// with our i18n method. we use uic -tr tr2i18n to redirect
21// to the right i18n() function 21// to the right i18n() function
22inline QString tr2i18n(const char* message, const char* =0) { 22inline QString tr2i18n(const char* message, const char* =0) {
23 return i18n( message); 23 return i18n( message);
24} 24}
25 25
26class KLocale 26class KLocale
diff --git a/microkde/kdecore/kmdcodec.cpp b/microkde/kdecore/kmdcodec.cpp
index bc03569..db11e52 100644
--- a/microkde/kdecore/kmdcodec.cpp
+++ b/microkde/kdecore/kmdcodec.cpp
@@ -30,24 +30,26 @@
30 The quoted-printable codec as described in RFC 2045, section 6.7. is by 30 The quoted-printable codec as described in RFC 2045, section 6.7. is by
31 Rik Hemsley (C) 2001. 31 Rik Hemsley (C) 2001.
32*/ 32*/
33 33
34//US #include <config.h> 34//US #include <config.h>
35 35
36#include <stdio.h> 36#include <stdio.h>
37#include <string.h> 37#include <string.h>
38#include <stdlib.h> 38#include <stdlib.h>
39 39
40#include <kdebug.h> 40#include <kdebug.h>
41#include "kmdcodec.h" 41#include "kmdcodec.h"
42//Added by qt3to4:
43#include <Q3CString>
42 44
43#define KMD5_S11 7 45#define KMD5_S11 7
44#define KMD5_S12 12 46#define KMD5_S12 12
45#define KMD5_S13 17 47#define KMD5_S13 17
46#define KMD5_S14 22 48#define KMD5_S14 22
47#define KMD5_S21 5 49#define KMD5_S21 5
48#define KMD5_S22 9 50#define KMD5_S22 9
49#define KMD5_S23 14 51#define KMD5_S23 14
50#define KMD5_S24 20 52#define KMD5_S24 20
51#define KMD5_S31 4 53#define KMD5_S31 4
52#define KMD5_S32 11 54#define KMD5_S32 11
53#define KMD5_S33 16 55#define KMD5_S33 16
@@ -138,32 +140,32 @@ static int rikFindChar(register const char * _s, const char c)
138 140
139 while (true) 141 while (true)
140 { 142 {
141 if ((0 == *s) || (c == *s)) break; ++s; 143 if ((0 == *s) || (c == *s)) break; ++s;
142 if ((0 == *s) || (c == *s)) break; ++s; 144 if ((0 == *s) || (c == *s)) break; ++s;
143 if ((0 == *s) || (c == *s)) break; ++s; 145 if ((0 == *s) || (c == *s)) break; ++s;
144 if ((0 == *s) || (c == *s)) break; ++s; 146 if ((0 == *s) || (c == *s)) break; ++s;
145 } 147 }
146 148
147 return s - _s; 149 return s - _s;
148} 150}
149 151
150QCString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF) 152Q3CString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF)
151{ 153{
152 QByteArray out; 154 QByteArray out;
153 quotedPrintableEncode (in, out, useCRLF); 155 quotedPrintableEncode (in, out, useCRLF);
154 return QCString (out.data(), out.size()+1); 156 return Q3CString (out.data(), out.size()+1);
155} 157}
156 158
157QCString KCodecs::quotedPrintableEncode(const QCString& str, bool useCRLF) 159Q3CString KCodecs::quotedPrintableEncode(const Q3CString& str, bool useCRLF)
158{ 160{
159 if (str.isEmpty()) 161 if (str.isEmpty())
160 return ""; 162 return "";
161 163
162 QByteArray in (str.length()); 164 QByteArray in (str.length());
163 memcpy (in.data(), str.data(), str.length()); 165 memcpy (in.data(), str.data(), str.length());
164 return quotedPrintableEncode(in, useCRLF); 166 return quotedPrintableEncode(in, useCRLF);
165} 167}
166 168
167void KCodecs::quotedPrintableEncode(const QByteArray& in, QByteArray& out, bool useCRLF) 169void KCodecs::quotedPrintableEncode(const QByteArray& in, QByteArray& out, bool useCRLF)
168{ 170{
169 out.resize (0); 171 out.resize (0);
@@ -271,32 +273,32 @@ void KCodecs::quotedPrintableEncode(const QByteArray& in, QByteArray& out, bool
271 } else { 273 } else {
272 *cursor++ = '='; 274 *cursor++ = '=';
273 *cursor++ = '\n'; 275 *cursor++ = '\n';
274 } 276 }
275 277
276 lineLength = 0; 278 lineLength = 0;
277 } 279 }
278 } 280 }
279 281
280 out.truncate(cursor - out.data()); 282 out.truncate(cursor - out.data());
281} 283}
282 284
283QCString KCodecs::quotedPrintableDecode(const QByteArray & in) 285Q3CString KCodecs::quotedPrintableDecode(const QByteArray & in)
284{ 286{
285 QByteArray out; 287 QByteArray out;
286 quotedPrintableDecode (in, out); 288 quotedPrintableDecode (in, out);
287 return QCString (out.data(), out.size()+1); 289 return Q3CString (out.data(), out.size()+1);
288} 290}
289 291
290QCString KCodecs::quotedPrintableDecode(const QCString & str) 292Q3CString KCodecs::quotedPrintableDecode(const Q3CString & str)
291{ 293{
292 if (str.isEmpty()) 294 if (str.isEmpty())
293 return ""; 295 return "";
294 296
295 QByteArray in (str.length()); 297 QByteArray in (str.length());
296 memcpy (in.data(), str.data(), str.length()); 298 memcpy (in.data(), str.data(), str.length());
297 return quotedPrintableDecode (in); 299 return quotedPrintableDecode (in);
298} 300}
299 301
300void KCodecs::quotedPrintableDecode(const QByteArray& in, QByteArray& out) 302void KCodecs::quotedPrintableDecode(const QByteArray& in, QByteArray& out)
301{ 303{
302 // clear out the output buffer 304 // clear out the output buffer
@@ -346,39 +348,39 @@ void KCodecs::quotedPrintableDecode(const QByteArray& in, QByteArray& out)
346 } 348 }
347 } 349 }
348 } 350 }
349 else 351 else
350 { 352 {
351 *cursor++ = c; 353 *cursor++ = c;
352 } 354 }
353 } 355 }
354 356
355 out.truncate(cursor - out.data()); 357 out.truncate(cursor - out.data());
356} 358}
357 359
358QCString KCodecs::base64Encode( const QCString& str, bool insertLFs ) 360Q3CString KCodecs::base64Encode( const Q3CString& str, bool insertLFs )
359{ 361{
360 if ( str.isEmpty() ) 362 if ( str.isEmpty() )
361 return ""; 363 return "";
362 364
363 QByteArray in (str.length()); 365 QByteArray in (str.length());
364 memcpy( in.data(), str.data(), str.length() ); 366 memcpy( in.data(), str.data(), str.length() );
365 return base64Encode( in, insertLFs ); 367 return base64Encode( in, insertLFs );
366} 368}
367 369
368QCString KCodecs::base64Encode( const QByteArray& in, bool insertLFs ) 370Q3CString KCodecs::base64Encode( const QByteArray& in, bool insertLFs )
369{ 371{
370 QByteArray out; 372 QByteArray out;
371 base64Encode( in, out, insertLFs ); 373 base64Encode( in, out, insertLFs );
372 return QCString( out.data(), out.size()+1 ); 374 return Q3CString( out.data(), out.size()+1 );
373} 375}
374 376
375void KCodecs::base64Encode( const QByteArray& in, QByteArray& out, 377void KCodecs::base64Encode( const QByteArray& in, QByteArray& out,
376 bool insertLFs ) 378 bool insertLFs )
377{ 379{
378 // clear out the output buffer 380 // clear out the output buffer
379 out.resize (0); 381 out.resize (0);
380 if ( in.isEmpty() ) 382 if ( in.isEmpty() )
381 return; 383 return;
382 384
383 unsigned int sidx = 0; 385 unsigned int sidx = 0;
384 unsigned int didx = 0; 386 unsigned int didx = 0;
@@ -396,78 +398,75 @@ void KCodecs::base64Encode( const QByteArray& in, QByteArray& out,
396 398
397 int count = 0; 399 int count = 0;
398 out.resize( out_len ); 400 out.resize( out_len );
399 401
400 // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion 402 // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion
401 if ( len > 1 ) 403 if ( len > 1 )
402 { 404 {
403 while (sidx < len-2) 405 while (sidx < len-2)
404 { 406 {
405 if ( insertLFs ) 407 if ( insertLFs )
406 { 408 {
407 if ( count && (count%76) == 0 ) 409 if ( count && (count%76) == 0 )
408 out.at(didx++) = '\n'; 410 out[didx++] = '\n';
409 count += 4; 411 count += 4;
410 } 412 }
411 out.at(didx++) = Base64EncMap[(data[sidx] >> 2) & 077]; 413 out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077];
412 out.at(didx++) = Base64EncMap[(data[sidx+1] >> 4) & 017 | 414 out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 |
413 (data[sidx] << 4) & 077]; 415 (data[sidx] << 4) & 077];
414 out.at(didx++) = Base64EncMap[(data[sidx+2] >> 6) & 003 | 416 out[didx++] = Base64EncMap[(data[sidx+2] >> 6) & 003 |
415 (data[sidx+1] << 2) & 077]; 417 (data[sidx+1] << 2) & 077];
416 out.at(didx++) = Base64EncMap[data[sidx+2] & 077]; 418 out[didx++] = Base64EncMap[data[sidx+2] & 077];
417 sidx += 3; 419 sidx += 3;
418 } 420 }
419 } 421 }
420 422
421 if (sidx < len) 423 if (sidx < len)
422 { 424 {
423 if ( insertLFs && (count > 0) && (count%76) == 0 ) 425 if ( insertLFs && (count > 0) && (count%76) == 0 )
424 out.at(didx++) = '\n'; 426 out[didx++] = '\n';
425 427
426 out.at(didx++) = Base64EncMap[(data[sidx] >> 2) & 077]; 428 out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077];
427 if (sidx < len-1) 429 if (sidx < len-1)
428 { 430 {
429 out.at(didx++) = Base64EncMap[(data[sidx+1] >> 4) & 017 | 431 out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 |
430 (data[sidx] << 4) & 077]; 432 (data[sidx] << 4) & 077];
431 out.at(didx++) = Base64EncMap[(data[sidx+1] << 2) & 077]; 433 out[didx++] = Base64EncMap[(data[sidx+1] << 2) & 077];
432 } 434 }
433 else 435 else
434 { 436 {
435 out.at(didx++) = Base64EncMap[(data[sidx] << 4) & 077]; 437 out[didx++] = Base64EncMap[(data[sidx] << 4) & 077];
436 } 438 }
437 } 439 }
438 440
439 // Add padding 441 // Add padding
440 while (didx < out.size()) 442 while (didx < out.size())
441 { 443 out[didx++] = '=';
442 out.at(didx) = '=';
443 didx++;
444 }
445} 444}
446 445
447QCString KCodecs::base64Decode( const QCString& str ) 446Q3CString KCodecs::base64Decode( const Q3CString& str )
448{ 447{
449 if ( str.isEmpty() ) 448 if ( str.isEmpty() )
450 return ""; 449 return "";
451 450
452 QByteArray in( str.length() ); 451 QByteArray in( str.length() );
453 memcpy( in.data(), str.data(), str.length() ); 452 memcpy( in.data(), str.data(), str.length() );
454 return base64Decode( in ); 453 return base64Decode( in );
455} 454}
456 455
457QCString KCodecs::base64Decode( const QByteArray& in ) 456Q3CString KCodecs::base64Decode( const QByteArray& in )
458{ 457{
459 QByteArray out; 458 QByteArray out;
460 base64Decode( in, out ); 459 base64Decode( in, out );
461 return QCString( out.data(), out.size()+1 ); 460 return Q3CString( out.data(), out.size()+1 );
462} 461}
463 462
464void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) 463void KCodecs::base64Decode( const QByteArray& in, QByteArray& out )
465{ 464{
466 out.resize(0); 465 out.resize(0);
467 if ( in.isEmpty() ) 466 if ( in.isEmpty() )
468 return; 467 return;
469 468
470 unsigned int count = 0; 469 unsigned int count = 0;
471 unsigned int len = in.size(), tail = len; 470 unsigned int len = in.size(), tail = len;
472 const char* data = in.data(); 471 const char* data = in.data();
473 472
@@ -496,174 +495,174 @@ void KCodecs::base64Decode( const QByteArray& in, QByteArray& out )
496 if ( data[--tail] != '=' ) len = tail; 495 if ( data[--tail] != '=' ) len = tail;
497 496
498 unsigned int outIdx = 0; 497 unsigned int outIdx = 0;
499 out.resize( (count=len) ); 498 out.resize( (count=len) );
500 for (unsigned int idx = 0; idx < count; idx++) 499 for (unsigned int idx = 0; idx < count; idx++)
501 { 500 {
502 // Adhere to RFC 2045 and ignore characters 501 // Adhere to RFC 2045 and ignore characters
503 // that are not part of the encoding table. 502 // that are not part of the encoding table.
504 unsigned char ch = data[idx]; 503 unsigned char ch = data[idx];
505 if ((ch > 47 && ch < 58) || (ch > 64 && ch < 91) || 504 if ((ch > 47 && ch < 58) || (ch > 64 && ch < 91) ||
506 (ch > 96 && ch < 123) || ch == '+' || ch == '/' || ch == '=') 505 (ch > 96 && ch < 123) || ch == '+' || ch == '/' || ch == '=')
507 { 506 {
508 out.at(outIdx++) = Base64DecMap[ch]; 507 out[outIdx++] = Base64DecMap[ch];
509 } 508 }
510 else 509 else
511 { 510 {
512 len--; 511 len--;
513 tail--; 512 tail--;
514 } 513 }
515 } 514 }
516 515
517 // kdDebug() << "Tail size = " << tail << ", Length size = " << len << endl; 516 // kdDebug() << "Tail size = " << tail << ", Length size = " << len << endl;
518 517
519 // 4-byte to 3-byte conversion 518 // 4-byte to 3-byte conversion
520 len = (tail>(len/4)) ? tail-(len/4) : 0; 519 len = (tail>(len/4)) ? tail-(len/4) : 0;
521 unsigned int sidx = 0, didx = 0; 520 unsigned int sidx = 0, didx = 0;
522 if ( len > 1 ) 521 if ( len > 1 )
523 { 522 {
524 while (didx < len-2) 523 while (didx < len-2)
525 { 524 {
526 out.at(didx) = (((out.at(sidx) << 2) & 255) | ((out.at(sidx+1) >> 4) & 003)); 525 out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003));
527 out.at(didx+1) = (((out.at(sidx+1) << 4) & 255) | ((out.at(sidx+2) >> 2) & 017)); 526 out[didx+1] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017));
528 out.at(didx+2) = (((out.at(sidx+2) << 6) & 255) | (out.at(sidx+3) & 077)); 527 out[didx+2] = (((out[sidx+2] << 6) & 255) | (out[sidx+3] & 077));
529 sidx += 4; 528 sidx += 4;
530 didx += 3; 529 didx += 3;
531 } 530 }
532 } 531 }
533 532
534 if (didx < len) 533 if (didx < len)
535 out.at(didx) = (((out.at(sidx) << 2) & 255) | ((out.at(sidx+1) >> 4) & 003)); 534 out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003));
536 535
537 if (++didx < len ) 536 if (++didx < len )
538 out.at(didx) = (((out.at(sidx+1) << 4) & 255) | ((out.at(sidx+2) >> 2) & 017)); 537 out[didx] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017));
539 538
540 // Resize the output buffer 539 // Resize the output buffer
541 if ( len == 0 || len < out.size() ) 540 if ( len == 0 || len < out.size() )
542 out.resize(len); 541 out.resize(len);
543} 542}
544 543
545QCString KCodecs::uuencode( const QCString& str ) 544Q3CString KCodecs::uuencode( const Q3CString& str )
546{ 545{
547 if ( str.isEmpty() ) 546 if ( str.isEmpty() )
548 return ""; 547 return "";
549 548
550 QByteArray in; 549 QByteArray in;
551 in.resize( str.length() ); 550 in.resize( str.length() );
552 memcpy( in.data(), str.data(), str.length() ); 551 memcpy( in.data(), str.data(), str.length() );
553 return uuencode( in ); 552 return uuencode( in );
554} 553}
555 554
556QCString KCodecs::uuencode( const QByteArray& in ) 555Q3CString KCodecs::uuencode( const QByteArray& in )
557{ 556{
558 QByteArray out; 557 QByteArray out;
559 uuencode( in, out ); 558 uuencode( in, out );
560 return QCString( out.data(), out.size()+1 ); 559 return Q3CString( out.data(), out.size()+1 );
561} 560}
562 561
563void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) 562void KCodecs::uuencode( const QByteArray& in, QByteArray& out )
564{ 563{
565 out.resize( 0 ); 564 out.resize( 0 );
566 if( in.isEmpty() ) 565 if( in.isEmpty() )
567 return; 566 return;
568 567
569 unsigned int sidx = 0; 568 unsigned int sidx = 0;
570 unsigned int didx = 0; 569 unsigned int didx = 0;
571 unsigned int line_len = 45; 570 unsigned int line_len = 45;
572 571
573 const char nl[] = "\n"; 572 const char nl[] = "\n";
574 const char* data = in.data(); 573 const char* data = in.data();
575 const unsigned int nl_len = strlen(nl); 574 const unsigned int nl_len = strlen(nl);
576 const unsigned int len = in.size(); 575 const unsigned int len = in.size();
577 576
578 out.resize( (len+2)/3*4 + ((len+line_len-1)/line_len)*(nl_len+1) ); 577 out.resize( (len+2)/3*4 + ((len+line_len-1)/line_len)*(nl_len+1) );
579 // split into lines, adding line-length and line terminator 578 // split into lines, adding line-length and line terminator
580 while (sidx+line_len < len) 579 while (sidx+line_len < len)
581 { 580 {
582 // line length 581 // line length
583 out.at(didx++) = UUEncMap[line_len]; 582 out[didx++] = UUEncMap[line_len];
584 583
585 // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion 584 // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion
586 for (unsigned int end = sidx+line_len; sidx < end; sidx += 3) 585 for (unsigned int end = sidx+line_len; sidx < end; sidx += 3)
587 { 586 {
588 out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; 587 out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
589 out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | 588 out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 |
590 (data[sidx] << 4) & 077]; 589 (data[sidx] << 4) & 077];
591 out.at(didx++) = UUEncMap[(data[sidx+2] >> 6) & 003 | 590 out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 |
592 (data[sidx+1] << 2) & 077]; 591 (data[sidx+1] << 2) & 077];
593 out.at(didx++) = UUEncMap[data[sidx+2] & 077]; 592 out[didx++] = UUEncMap[data[sidx+2] & 077];
594 } 593 }
595 594
596 // line terminator 595 // line terminator
597 //for (unsigned int idx=0; idx < nl_len; idx++) 596 //for (unsigned int idx=0; idx < nl_len; idx++)
598 //out.at(didx++) = nl[idx]; 597 //out[didx++] = nl[idx];
599 memcpy(out.data()+didx, nl, nl_len); 598 memcpy(out.data()+didx, nl, nl_len);
600 didx += nl_len; 599 didx += nl_len;
601 } 600 }
602 601
603 // line length 602 // line length
604 out.at(didx++) = UUEncMap[len-sidx]; 603 out[didx++] = UUEncMap[len-sidx];
605 // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion 604 // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion
606 while (sidx+2 < len) 605 while (sidx+2 < len)
607 { 606 {
608 out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; 607 out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
609 out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | 608 out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 |
610 (data[sidx] << 4) & 077]; 609 (data[sidx] << 4) & 077];
611 out.at(didx++) = UUEncMap[(data[sidx+2] >> 6) & 003 | 610 out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 |
612 (data[sidx+1] << 2) & 077]; 611 (data[sidx+1] << 2) & 077];
613 out.at(didx++) = UUEncMap[data[sidx+2] & 077]; 612 out[didx++] = UUEncMap[data[sidx+2] & 077];
614 sidx += 3; 613 sidx += 3;
615 } 614 }
616 615
617 if (sidx < len-1) 616 if (sidx < len-1)
618 { 617 {
619 out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; 618 out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
620 out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | 619 out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 |
621 (data[sidx] << 4) & 077]; 620 (data[sidx] << 4) & 077];
622 out.at(didx++) = UUEncMap[(data[sidx+1] << 2) & 077]; 621 out[didx++] = UUEncMap[(data[sidx+1] << 2) & 077];
623 out.at(didx++) = UUEncMap[0]; 622 out[didx++] = UUEncMap[0];
624 } 623 }
625 else if (sidx < len) 624 else if (sidx < len)
626 { 625 {
627 out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; 626 out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
628 out.at(didx++) = UUEncMap[(data[sidx] << 4) & 077]; 627 out[didx++] = UUEncMap[(data[sidx] << 4) & 077];
629 out.at(didx++) = UUEncMap[0]; 628 out[didx++] = UUEncMap[0];
630 out.at(didx++) = UUEncMap[0]; 629 out[didx++] = UUEncMap[0];
631 } 630 }
632 631
633 // line terminator 632 // line terminator
634 memcpy(out.data()+didx, nl, nl_len); 633 memcpy(out.data()+didx, nl, nl_len);
635 didx += nl_len; 634 didx += nl_len;
636 635
637 // sanity check 636 // sanity check
638 if ( didx != out.size() ) 637 if ( didx != out.size() )
639 out.resize( 0 ); 638 out.resize( 0 );
640} 639}
641 640
642QCString KCodecs::uudecode( const QCString& str ) 641Q3CString KCodecs::uudecode( const Q3CString& str )
643{ 642{
644 if ( str.isEmpty() ) 643 if ( str.isEmpty() )
645 return ""; 644 return "";
646 645
647 QByteArray in; 646 QByteArray in;
648 in.resize( str.length() ); 647 in.resize( str.length() );
649 memcpy( in.data(), str.data(), str.length() ); 648 memcpy( in.data(), str.data(), str.length() );
650 return uudecode( in ); 649 return uudecode( in );
651} 650}
652 651
653QCString KCodecs::uudecode( const QByteArray& in ) 652Q3CString KCodecs::uudecode( const QByteArray& in )
654{ 653{
655 QByteArray out; 654 QByteArray out;
656 uudecode( in, out ); 655 uudecode( in, out );
657 return QCString( out.data(), out.size()+1 ); 656 return Q3CString( out.data(), out.size()+1 );
658} 657}
659 658
660void KCodecs::uudecode( const QByteArray& in, QByteArray& out ) 659void KCodecs::uudecode( const QByteArray& in, QByteArray& out )
661{ 660{
662 out.resize( 0 ); 661 out.resize( 0 );
663 if( in.isEmpty() ) 662 if( in.isEmpty() )
664 return; 663 return;
665 664
666 unsigned int sidx = 0; 665 unsigned int sidx = 0;
667 unsigned int didx = 0; 666 unsigned int didx = 0;
668 unsigned int len = in.size(); 667 unsigned int len = in.size();
669 unsigned int line_len, end; 668 unsigned int line_len, end;
@@ -696,43 +695,43 @@ void KCodecs::uudecode( const QByteArray& in, QByteArray& out )
696 // get line length (in number of encoded octets) 695 // get line length (in number of encoded octets)
697 line_len = UUDecMap[ (unsigned char) data[sidx++]]; 696 line_len = UUDecMap[ (unsigned char) data[sidx++]];
698 // ascii printable to 0-63 and 4-byte to 3-byte conversion 697 // ascii printable to 0-63 and 4-byte to 3-byte conversion
699 end = didx+line_len; 698 end = didx+line_len;
700 char A, B, C, D; 699 char A, B, C, D;
701 if (end > 2) { 700 if (end > 2) {
702 while (didx < end-2) 701 while (didx < end-2)
703 { 702 {
704 A = UUDecMap[(unsigned char) data[sidx]]; 703 A = UUDecMap[(unsigned char) data[sidx]];
705 B = UUDecMap[(unsigned char) data[sidx+1]]; 704 B = UUDecMap[(unsigned char) data[sidx+1]];
706 C = UUDecMap[(unsigned char) data[sidx+2]]; 705 C = UUDecMap[(unsigned char) data[sidx+2]];
707 D = UUDecMap[(unsigned char) data[sidx+3]]; 706 D = UUDecMap[(unsigned char) data[sidx+3]];
708 out.at(didx++) = ( ((A << 2) & 255) | ((B >> 4) & 003) ); 707 out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) );
709 out.at(didx++) = ( ((B << 4) & 255) | ((C >> 2) & 017) ); 708 out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) );
710 out.at(didx++) = ( ((C << 6) & 255) | (D & 077) ); 709 out[didx++] = ( ((C << 6) & 255) | (D & 077) );
711 sidx += 4; 710 sidx += 4;
712 } 711 }
713 } 712 }
714 713
715 if (didx < end) 714 if (didx < end)
716 { 715 {
717 A = UUDecMap[(unsigned char) data[sidx]]; 716 A = UUDecMap[(unsigned char) data[sidx]];
718 B = UUDecMap[(unsigned char) data[sidx+1]]; 717 B = UUDecMap[(unsigned char) data[sidx+1]];
719 out.at(didx++) = ( ((A << 2) & 255) | ((B >> 4) & 003) ); 718 out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) );
720 } 719 }
721 720
722 if (didx < end) 721 if (didx < end)
723 { 722 {
724 B = UUDecMap[(unsigned char) data[sidx+1]]; 723 B = UUDecMap[(unsigned char) data[sidx+1]];
725 C = UUDecMap[(unsigned char) data[sidx+2]]; 724 C = UUDecMap[(unsigned char) data[sidx+2]];
726 out.at(didx++) = ( ((B << 4) & 255) | ((C >> 2) & 017) ); 725 out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) );
727 } 726 }
728 727
729 // skip padding 728 // skip padding
730 while (sidx < len && data[sidx] != '\n' && data[sidx] != '\r') 729 while (sidx < len && data[sidx] != '\n' && data[sidx] != '\r')
731 sidx++; 730 sidx++;
732 731
733 // skip end of line 732 // skip end of line
734 while (sidx < len && (data[sidx] == '\n' || data[sidx] == '\r')) 733 while (sidx < len && (data[sidx] == '\n' || data[sidx] == '\r'))
735 sidx++; 734 sidx++;
736 735
737 // skip the "END" separator when present. 736 // skip the "END" separator when present.
738 if ( hasLF && QString( data+sidx).left(3).lower() == "end" ) 737 if ( hasLF && QString( data+sidx).left(3).lower() == "end" )
@@ -752,36 +751,36 @@ KMD5::KMD5()
752KMD5::KMD5(const char *in, int len) 751KMD5::KMD5(const char *in, int len)
753{ 752{
754 init(); 753 init();
755 update(in, len); 754 update(in, len);
756} 755}
757 756
758KMD5::KMD5(const QByteArray& in) 757KMD5::KMD5(const QByteArray& in)
759{ 758{
760 init(); 759 init();
761 update( in ); 760 update( in );
762} 761}
763 762
764KMD5::KMD5(const QCString& in) 763KMD5::KMD5(const Q3CString& in)
765{ 764{
766 init(); 765 init();
767 update( in ); 766 update( in );
768} 767}
769 768
770void KMD5::update(const QByteArray& in) 769void KMD5::update(const QByteArray& in)
771{ 770{
772 update(in.data(), int(in.size())); 771 update(in.data(), int(in.size()));
773} 772}
774 773
775void KMD5::update(const QCString& in) 774void KMD5::update(const Q3CString& in)
776{ 775{
777 update(in.data(), int(in.length())); 776 update(in.data(), int(in.length()));
778} 777}
779 778
780void KMD5::update(const unsigned char* in, int len) 779void KMD5::update(const unsigned char* in, int len)
781{ 780{
782 if (len < 0) 781 if (len < 0)
783 len = qstrlen(reinterpret_cast<const char*>(in)); 782 len = qstrlen(reinterpret_cast<const char*>(in));
784 783
785 if (!len) 784 if (!len)
786 return; 785 return;
787 786
@@ -864,67 +863,67 @@ void KMD5::finalize ()
864 memset ( (void *)m_buffer, 0, sizeof(*m_buffer)); 863 memset ( (void *)m_buffer, 0, sizeof(*m_buffer));
865 864
866 m_finalized = true; 865 m_finalized = true;
867} 866}
868 867
869 868
870bool KMD5::verify( const KMD5::Digest& digest) 869bool KMD5::verify( const KMD5::Digest& digest)
871{ 870{
872 finalize(); 871 finalize();
873 return (0 == memcmp(rawDigest(), digest, sizeof(KMD5::Digest))); 872 return (0 == memcmp(rawDigest(), digest, sizeof(KMD5::Digest)));
874} 873}
875 874
876bool KMD5::verify( const QCString& hexdigest) 875bool KMD5::verify( const Q3CString& hexdigest)
877{ 876{
878 finalize(); 877 finalize();
879 return (0 == strcmp(hexDigest().data(), hexdigest)); 878 return (0 == strcmp(hexDigest().data(), hexdigest));
880} 879}
881 880
882const KMD5::Digest& KMD5::rawDigest() 881const KMD5::Digest& KMD5::rawDigest()
883{ 882{
884 finalize(); 883 finalize();
885 return m_digest; 884 return m_digest;
886} 885}
887 886
888void KMD5::rawDigest( KMD5::Digest& bin ) 887void KMD5::rawDigest( KMD5::Digest& bin )
889{ 888{
890 finalize(); 889 finalize();
891 memcpy( bin, m_digest, 16 ); 890 memcpy( bin, m_digest, 16 );
892} 891}
893 892
894 893
895QCString KMD5::hexDigest() 894Q3CString KMD5::hexDigest()
896{ 895{
897 QCString s(33); 896 Q3CString s(33);
898 897
899 finalize(); 898 finalize();
900 sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", 899 sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
901 m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5], 900 m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5],
902 m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11], 901 m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11],
903 m_digest[12], m_digest[13], m_digest[14], m_digest[15]); 902 m_digest[12], m_digest[13], m_digest[14], m_digest[15]);
904 903
905 return s; 904 return s;
906} 905}
907 906
908void KMD5::hexDigest(QCString& s) 907void KMD5::hexDigest(Q3CString& s)
909{ 908{
910 finalize(); 909 finalize();
911 s.resize(33); 910 s.resize(33);
912 sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", 911 sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
913 m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5], 912 m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5],
914 m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11], 913 m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11],
915 m_digest[12], m_digest[13], m_digest[14], m_digest[15]); 914 m_digest[12], m_digest[13], m_digest[14], m_digest[15]);
916} 915}
917 916
918QCString KMD5::base64Digest() 917Q3CString KMD5::base64Digest()
919{ 918{
920 QByteArray ba(16); 919 QByteArray ba(16);
921 920
922 finalize(); 921 finalize();
923 memcpy(ba.data(), m_digest, 16); 922 memcpy(ba.data(), m_digest, 16);
924 return KCodecs::base64Encode(ba); 923 return KCodecs::base64Encode(ba);
925} 924}
926 925
927 926
928void KMD5::init() 927void KMD5::init()
929{ 928{
930 d = 0; 929 d = 0;
@@ -947,25 +946,25 @@ void KMD5::reset()
947 memset ( m_digest, 0, sizeof(*m_digest)); 946 memset ( m_digest, 0, sizeof(*m_digest));
948} 947}
949 948
950void KMD5::transform( const unsigned char block[64] ) 949void KMD5::transform( const unsigned char block[64] )
951{ 950{
952 951
953 Q_UINT32 a = m_state[0], b = m_state[1], c = m_state[2], d = m_state[3], x[16]; 952 Q_UINT32 a = m_state[0], b = m_state[1], c = m_state[2], d = m_state[3], x[16];
954 953
955 decode (x, block, 64); 954 decode (x, block, 64);
956 //memcpy( x, block, 64 ); 955 //memcpy( x, block, 64 );
957 956
958//US Q_ASSERT(!m_finalized); // not just a user error, since the method is private 957//US Q_ASSERT(!m_finalized); // not just a user error, since the method is private
959 ASSERT(!m_finalized); // not just a user error, since the method is private 958 Q_ASSERT(!m_finalized); // not just a user error, since the method is private
960 959
961 /* Round 1 */ 960 /* Round 1 */
962 FF (a, b, c, d, x[ 0], KMD5_S11, 0xd76aa478); /* 1 */ 961 FF (a, b, c, d, x[ 0], KMD5_S11, 0xd76aa478); /* 1 */
963 FF (d, a, b, c, x[ 1], KMD5_S12, 0xe8c7b756); /* 2 */ 962 FF (d, a, b, c, x[ 1], KMD5_S12, 0xe8c7b756); /* 2 */
964 FF (c, d, a, b, x[ 2], KMD5_S13, 0x242070db); /* 3 */ 963 FF (c, d, a, b, x[ 2], KMD5_S13, 0x242070db); /* 3 */
965 FF (b, c, d, a, x[ 3], KMD5_S14, 0xc1bdceee); /* 4 */ 964 FF (b, c, d, a, x[ 3], KMD5_S14, 0xc1bdceee); /* 4 */
966 FF (a, b, c, d, x[ 4], KMD5_S11, 0xf57c0faf); /* 5 */ 965 FF (a, b, c, d, x[ 4], KMD5_S11, 0xf57c0faf); /* 5 */
967 FF (d, a, b, c, x[ 5], KMD5_S12, 0x4787c62a); /* 6 */ 966 FF (d, a, b, c, x[ 5], KMD5_S12, 0x4787c62a); /* 6 */
968 FF (c, d, a, b, x[ 6], KMD5_S13, 0xa8304613); /* 7 */ 967 FF (c, d, a, b, x[ 6], KMD5_S13, 0xa8304613); /* 7 */
969 FF (b, c, d, a, x[ 7], KMD5_S14, 0xfd469501); /* 8 */ 968 FF (b, c, d, a, x[ 7], KMD5_S14, 0xfd469501); /* 8 */
970 FF (a, b, c, d, x[ 8], KMD5_S11, 0x698098d8); /* 9 */ 969 FF (a, b, c, d, x[ 8], KMD5_S11, 0x698098d8); /* 9 */
971 FF (d, a, b, c, x[ 9], KMD5_S12, 0x8b44f7af); /* 10 */ 970 FF (d, a, b, c, x[ 9], KMD5_S12, 0x8b44f7af); /* 10 */
diff --git a/microkde/kdecore/kmdcodec.h b/microkde/kdecore/kmdcodec.h
index 2c4d611..616b683 100644
--- a/microkde/kdecore/kmdcodec.h
+++ b/microkde/kdecore/kmdcodec.h
@@ -30,24 +30,26 @@
30 The quoted-printable codec as described in RFC 2045, section 6.7. is by 30 The quoted-printable codec as described in RFC 2045, section 6.7. is by
31 Rik Hemsley (C) 2001. 31 Rik Hemsley (C) 2001.
32*/ 32*/
33 33
34#ifndef _KMDBASE_H 34#ifndef _KMDBASE_H
35#define _KMDBASE_H 35#define _KMDBASE_H
36 36
37#define KBase64 KCodecs 37#define KBase64 KCodecs
38 38
39#include <qglobal.h> 39#include <qglobal.h>
40#include <qstring.h> 40#include <qstring.h>
41#include <qiodevice.h> 41#include <qiodevice.h>
42//Added by qt3to4:
43#include <Q3CString>
42 44
43/** 45/**
44 * A wrapper class for the most commonly used encoding and 46 * A wrapper class for the most commonly used encoding and
45 * decoding algorithms. Currently there is support for encoding 47 * decoding algorithms. Currently there is support for encoding
46 * and decoding input using base64, uu and the quoted-printable 48 * and decoding input using base64, uu and the quoted-printable
47 * specifications. 49 * specifications.
48 * 50 *
49 * @sect Usage: 51 * @sect Usage:
50 * 52 *
51 * <PRE> 53 * <PRE>
52 * QCString input = "Aladdin:open sesame"; 54 * QCString input = "Aladdin:open sesame";
53 * QCString result = KCodecs::base64Encode(input); 55 * QCString result = KCodecs::base64Encode(input);
@@ -72,40 +74,40 @@ class KCodecs
72{ 74{
73public: 75public:
74 76
75 /** 77 /**
76 * Encodes the given data using the quoted-printable algorithm. 78 * Encodes the given data using the quoted-printable algorithm.
77 * 79 *
78 * @param in data to be encoded. 80 * @param in data to be encoded.
79 * @param useCRLF if true the input data is expected to have 81 * @param useCRLF if true the input data is expected to have
80 * CRLF line breaks and the output will have CRLF line 82 * CRLF line breaks and the output will have CRLF line
81 * breaks, too. 83 * breaks, too.
82 * @return quoted-printable encoded data. 84 * @return quoted-printable encoded data.
83 */ 85 */
84 static QCString quotedPrintableEncode(const QByteArray & in, 86 static Q3CString quotedPrintableEncode(const QByteArray & in,
85 bool useCRLF = true); 87 bool useCRLF = true);
86 88
87 /** 89 /**
88 * @overload 90 * @overload
89 * 91 *
90 * Same as above except it accepts a null terminated 92 * Same as above except it accepts a null terminated
91 * string instead an array. 93 * string instead an array.
92 * 94 *
93 * @param str data to be encoded. 95 * @param str data to be encoded.
94 * @param useCRLF if true the input data is expected to have 96 * @param useCRLF if true the input data is expected to have
95 * CRLF line breaks and the output will have CRLF line 97 * CRLF line breaks and the output will have CRLF line
96 * breaks, too. 98 * breaks, too.
97 * @return quoted-printable encoded data. 99 * @return quoted-printable encoded data.
98 */ 100 */
99 static QCString quotedPrintableEncode(const QCString & str, 101 static Q3CString quotedPrintableEncode(const Q3CString & str,
100 bool useCRLF = true); 102 bool useCRLF = true);
101 103
102 /** 104 /**
103 * Encodes the given data using the quoted-printable algorithm. 105 * Encodes the given data using the quoted-printable algorithm.
104 * 106 *
105 * Use this function if you want the result of the encoding 107 * Use this function if you want the result of the encoding
106 * to be placed in another array which cuts down the number 108 * to be placed in another array which cuts down the number
107 * of copy operation that have to be performed in the process. 109 * of copy operation that have to be performed in the process.
108 * This is also the preferred method for encoding binary data. 110 * This is also the preferred method for encoding binary data.
109 * 111 *
110 * NOTE: the output array is first reset and then resized 112 * NOTE: the output array is first reset and then resized
111 * appropriately before use, hence, all data stored in the 113 * appropriately before use, hence, all data stored in the
@@ -120,36 +122,36 @@ public:
120 */ 122 */
121 static void quotedPrintableEncode(const QByteArray & in, QByteArray& out, 123 static void quotedPrintableEncode(const QByteArray & in, QByteArray& out,
122 bool useCRLF); 124 bool useCRLF);
123 125
124 /** 126 /**
125 * Decodes a quoted-printable encoded string. 127 * Decodes a quoted-printable encoded string.
126 * 128 *
127 * Accepts data with CRLF or standard unix line breaks. 129 * Accepts data with CRLF or standard unix line breaks.
128 * 130 *
129 * @param in the data to be decoded. 131 * @param in the data to be decoded.
130 * @return decoded data. 132 * @return decoded data.
131 */ 133 */
132 static QCString quotedPrintableDecode(const QByteArray & in); 134 static Q3CString quotedPrintableDecode(const QByteArray & in);
133 135
134 /** 136 /**
135 * @overload 137 * @overload
136 * 138 *
137 * Same as above except it accepts a null terminated 139 * Same as above except it accepts a null terminated
138 * string instead an array. 140 * string instead an array.
139 * 141 *
140 * @param str the data to be decoded. 142 * @param str the data to be decoded.
141 * @return decoded data. 143 * @return decoded data.
142 */ 144 */
143 static QCString quotedPrintableDecode(const QCString & str); 145 static Q3CString quotedPrintableDecode(const Q3CString & str);
144 146
145 /** 147 /**
146 * Decodes a quoted-printable encoded data. 148 * Decodes a quoted-printable encoded data.
147 * 149 *
148 * Accepts data with CRLF or standard unix line breaks. 150 * Accepts data with CRLF or standard unix line breaks.
149 * Use this function if you want the result of the decoding 151 * Use this function if you want the result of the decoding
150 * to be placed in another array which cuts down the number 152 * to be placed in another array which cuts down the number
151 * of copy operation that have to be performed in the process. 153 * of copy operation that have to be performed in the process.
152 * This is also the preferred method for decoding an encoded 154 * This is also the preferred method for decoding an encoded
153 * binary data. 155 * binary data.
154 * 156 *
155 * NOTE: the output array is first reset and then resized 157 * NOTE: the output array is first reset and then resized
@@ -166,36 +168,36 @@ public:
166 168
167 /** 169 /**
168 * Encodes the given data using the uuencode algorithm. 170 * Encodes the given data using the uuencode algorithm.
169 * 171 *
170 * The output is split into lines starting with the number of 172 * The output is split into lines starting with the number of
171 * encoded octets in the line and ending with a newline. No 173 * encoded octets in the line and ending with a newline. No
172 * line is longer than 45 octets (60 characters), excluding the 174 * line is longer than 45 octets (60 characters), excluding the
173 * line terminator. 175 * line terminator.
174 * 176 *
175 * @param in the data to be uuencoded 177 * @param in the data to be uuencoded
176 * @return a uuencoded data. 178 * @return a uuencoded data.
177 */ 179 */
178 static QCString uuencode( const QByteArray& in ); 180 static Q3CString uuencode( const QByteArray& in );
179 181
180 /** 182 /**
181 * @overload 183 * @overload
182 * 184 *
183 * Same as the above functions except it accepts 185 * Same as the above functions except it accepts
184 * a null terminated string instead an array. 186 * a null terminated string instead an array.
185 * 187 *
186 * @param str the string to be uuencoded. 188 * @param str the string to be uuencoded.
187 * @return the encoded string. 189 * @return the encoded string.
188 */ 190 */
189 static QCString uuencode( const QCString& str ); 191 static Q3CString uuencode( const Q3CString& str );
190 192
191 /** 193 /**
192 * Encodes the given data using the uuencode algorithm. 194 * Encodes the given data using the uuencode algorithm.
193 * 195 *
194 * Use this function if you want the result of the encoding 196 * Use this function if you want the result of the encoding
195 * to be placed in another array and cut down the number of 197 * to be placed in another array and cut down the number of
196 * copy operation that have to be performed in the process. 198 * copy operation that have to be performed in the process.
197 * This is the preffered method for encoding binary data. 199 * This is the preffered method for encoding binary data.
198 * 200 *
199 * NOTE: the output array is first reset and then resized 201 * NOTE: the output array is first reset and then resized
200 * appropriately before use, hence, all data stored in the 202 * appropriately before use, hence, all data stored in the
201 * output array will be lost. 203 * output array will be lost.
@@ -206,36 +208,36 @@ public:
206 static void uuencode( const QByteArray& in, QByteArray& out ); 208 static void uuencode( const QByteArray& in, QByteArray& out );
207 209
208 /** 210 /**
209 * Decodes the given data using the uuencode algorithm. 211 * Decodes the given data using the uuencode algorithm.
210 * 212 *
211 * Any 'begin' and 'end' lines like those generated by 213 * Any 'begin' and 'end' lines like those generated by
212 * the utilities in unix and unix-like OS will be 214 * the utilities in unix and unix-like OS will be
213 * automatically ignored. 215 * automatically ignored.
214 * 216 *
215 * @param in the data uuencoded data to be decoded. 217 * @param in the data uuencoded data to be decoded.
216 * @return a decoded string. 218 * @return a decoded string.
217 */ 219 */
218 static QCString uudecode( const QByteArray& in ); 220 static Q3CString uudecode( const QByteArray& in );
219 221
220 /** 222 /**
221 * @overload 223 * @overload
222 * 224 *
223 * Same as the above functions except it accepts 225 * Same as the above functions except it accepts
224 * a null terminated string instead an array. 226 * a null terminated string instead an array.
225 * 227 *
226 * @param str the string to be decoded. 228 * @param str the string to be decoded.
227 * @return a uudecoded string. 229 * @return a uudecoded string.
228 */ 230 */
229 static QCString uudecode( const QCString& str ); 231 static Q3CString uudecode( const Q3CString& str );
230 232
231 /** 233 /**
232 * Decodes the given data using the uudecode algorithm. 234 * Decodes the given data using the uudecode algorithm.
233 * 235 *
234 * Use this function if you want the result of the decoding 236 * Use this function if you want the result of the decoding
235 * to be placed in another array which cuts down the number 237 * to be placed in another array which cuts down the number
236 * of copy operation that have to be performed in the process. 238 * of copy operation that have to be performed in the process.
237 * This is the preferred method for decoding binary data. 239 * This is the preferred method for decoding binary data.
238 * 240 *
239 * Any 'begin' and 'end' lines like those generated by 241 * Any 'begin' and 'end' lines like those generated by
240 * the utilities in unix and unix-like OS will be 242 * the utilities in unix and unix-like OS will be
241 * automatically ignored. 243 * automatically ignored.
@@ -254,37 +256,37 @@ public:
254 * Encodes the given data using the base64 algorithm. 256 * Encodes the given data using the base64 algorithm.
255 * 257 *
256 * The boolean argument determines if the encoded data is 258 * The boolean argument determines if the encoded data is
257 * going to be restricted to 76 characters or less per line 259 * going to be restricted to 76 characters or less per line
258 * as specified by RFC 2045. If @p insertLFs is true, then 260 * as specified by RFC 2045. If @p insertLFs is true, then
259 * there will be 76 characters or less per line. 261 * there will be 76 characters or less per line.
260 * 262 *
261 * @param in the data to be encoded. 263 * @param in the data to be encoded.
262 * @param insertLFs limit the number of characters per line. 264 * @param insertLFs limit the number of characters per line.
263 * 265 *
264 * @return a base64 encoded string. 266 * @return a base64 encoded string.
265 */ 267 */
266 static QCString base64Encode( const QByteArray& in, bool insertLFs = false); 268 static Q3CString base64Encode( const QByteArray& in, bool insertLFs = false);
267 269
268 /** 270 /**
269 * @overload 271 * @overload
270 * 272 *
271 * Same as the above functions except it accepts 273 * Same as the above functions except it accepts
272 * a null terminated string instead an array. 274 * a null terminated string instead an array.
273 * 275 *
274 * @param str the string to be encoded. 276 * @param str the string to be encoded.
275 * @param insertLFs limit the number of characters per line. 277 * @param insertLFs limit the number of characters per line.
276 * @return the decoded string. 278 * @return the decoded string.
277 */ 279 */
278 static QCString base64Encode( const QCString& str, bool insertLFs = false ); 280 static Q3CString base64Encode( const Q3CString& str, bool insertLFs = false );
279 281
280 /** 282 /**
281 * Encodes the given data using the base64 algorithm. 283 * Encodes the given data using the base64 algorithm.
282 * 284 *
283 * Use this function if you want the result of the encoding 285 * Use this function if you want the result of the encoding
284 * to be placed in another array which cuts down the number 286 * to be placed in another array which cuts down the number
285 * of copy operation that have to be performed in the process. 287 * of copy operation that have to be performed in the process.
286 * This is also the preferred method for encoding binary data. 288 * This is also the preferred method for encoding binary data.
287 * 289 *
288 * The boolean argument determines if the encoded data is going 290 * The boolean argument determines if the encoded data is going
289 * to be restricted to 76 characters or less per line as specified 291 * to be restricted to 76 characters or less per line as specified
290 * by RFC 2045. If @p insertLFs is true, then there will be 76 292 * by RFC 2045. If @p insertLFs is true, then there will be 76
@@ -299,36 +301,36 @@ public:
299 * @param insertLFs limit the number of characters per line. 301 * @param insertLFs limit the number of characters per line.
300 */ 302 */
301 static void base64Encode( const QByteArray& in, QByteArray& out, 303 static void base64Encode( const QByteArray& in, QByteArray& out,
302 bool insertLFs = false ); 304 bool insertLFs = false );
303 305
304 /** 306 /**
305 * Decodes the given data that was encoded using the 307 * Decodes the given data that was encoded using the
306 * base64 algorithm. 308 * base64 algorithm.
307 * 309 *
308 * @param in the base64-encoded data to be decoded. 310 * @param in the base64-encoded data to be decoded.
309 * @return the decoded data. 311 * @return the decoded data.
310 */ 312 */
311 static QCString base64Decode( const QByteArray& in ); 313 static Q3CString base64Decode( const QByteArray& in );
312 314
313 /** 315 /**
314 * @overload 316 * @overload
315 * 317 *
316 * Same as the above functions except it accepts 318 * Same as the above functions except it accepts
317 * a null terminated string instead an array. 319 * a null terminated string instead an array.
318 * 320 *
319 * @param str the base64-encoded string. 321 * @param str the base64-encoded string.
320 * @return the decoded string. 322 * @return the decoded string.
321 */ 323 */
322 static QCString base64Decode( const QCString& str ); 324 static Q3CString base64Decode( const Q3CString& str );
323 325
324 /** 326 /**
325 * Decodes the given data that was encoded with the base64 327 * Decodes the given data that was encoded with the base64
326 * algorithm. 328 * algorithm.
327 * 329 *
328 * Use this function if you want the result of the decoding 330 * Use this function if you want the result of the decoding
329 * to be placed in another array which cuts down the number 331 * to be placed in another array which cuts down the number
330 * of copy operation that have to be performed in the process. 332 * of copy operation that have to be performed in the process.
331 * This is also the preferred method for decoding an encoded 333 * This is also the preferred method for decoding an encoded
332 * binary data. 334 * binary data.
333 * 335 *
334 * NOTE: the output array is first reset and then resized 336 * NOTE: the output array is first reset and then resized
@@ -422,25 +424,25 @@ public:
422 /** 424 /**
423 * @overload 425 * @overload
424 * 426 *
425 * Same as above except it accepts a QByteArray as its argument. 427 * Same as above except it accepts a QByteArray as its argument.
426 */ 428 */
427 KMD5(const QByteArray& a ); 429 KMD5(const QByteArray& a );
428 430
429 /** 431 /**
430 * @overload 432 * @overload
431 * 433 *
432 * Same as above except it accepts a QByteArray as its argument. 434 * Same as above except it accepts a QByteArray as its argument.
433 */ 435 */
434 KMD5(const QCString& a ); 436 KMD5(const Q3CString& a );
435 437
436 /** 438 /**
437 * Updates the message to be digested. Be sure to add all data 439 * Updates the message to be digested. Be sure to add all data
438 * before you read the digest. After reading the digest, you 440 * before you read the digest. After reading the digest, you
439 * can <b>not</b> add more data! 441 * can <b>not</b> add more data!
440 * 442 *
441 * @param in message to be added to digest 443 * @param in message to be added to digest
442 * @param len the length of the given message. 444 * @param len the length of the given message.
443 */ 445 */
444 void update(const char* in, int len = -1) { update(reinterpret_cast<const unsigned char*>(in), len); } 446 void update(const char* in, int len = -1) { update(reinterpret_cast<const unsigned char*>(in), len); }
445 447
446 /** 448 /**
@@ -451,25 +453,25 @@ public:
451 /** 453 /**
452 * @overload 454 * @overload
453 * 455 *
454 * @param in message to be added to the digest (QByteArray). 456 * @param in message to be added to the digest (QByteArray).
455 */ 457 */
456 void update(const QByteArray& in ); 458 void update(const QByteArray& in );
457 459
458 /** 460 /**
459 * @overload 461 * @overload
460 * 462 *
461 * @param in message to be added to the digest (QByteArray). 463 * @param in message to be added to the digest (QByteArray).
462 */ 464 */
463 void update(const QCString& in ); 465 void update(const Q3CString& in );
464 466
465 /** 467 /**
466 * @overload 468 * @overload
467 * 469 *
468 * reads the data from an I/O device, i.e. from a file (QFile). 470 * reads the data from an I/O device, i.e. from a file (QFile).
469 * 471 *
470 * NOTE that the file must be open for reading. 472 * NOTE that the file must be open for reading.
471 * 473 *
472 * @param file a pointer to FILE as returned by calls like f{d,re}open 474 * @param file a pointer to FILE as returned by calls like f{d,re}open
473 * 475 *
474 * @returns false if an error occured during reading. 476 * @returns false if an error occured during reading.
475 */ 477 */
@@ -493,47 +495,47 @@ public:
493 * 495 *
494 * Use this method if you do not want to worry about making 496 * Use this method if you do not want to worry about making
495 * copy of the digest once you obtain it. 497 * copy of the digest once you obtain it.
496 * 498 *
497 * @param bin an array of 16 characters ( char[16] ) 499 * @param bin an array of 16 characters ( char[16] )
498 */ 500 */
499 void rawDigest( KMD5::Digest& bin ); 501 void rawDigest( KMD5::Digest& bin );
500 502
501 /** 503 /**
502 * Returns the value of the calculated message digest in 504 * Returns the value of the calculated message digest in
503 * a hexadecimal representation. 505 * a hexadecimal representation.
504 */ 506 */
505 QCString hexDigest (); 507 Q3CString hexDigest ();
506 508
507 /** 509 /**
508 * @overload 510 * @overload
509 */ 511 */
510 void hexDigest(QCString&); 512 void hexDigest(Q3CString&);
511 513
512 /** 514 /**
513 * Returns the value of the calculated message digest in 515 * Returns the value of the calculated message digest in
514 * a base64-encoded representation. 516 * a base64-encoded representation.
515 */ 517 */
516 QCString base64Digest (); 518 Q3CString base64Digest ();
517 519
518 /** 520 /**
519 * returns true if the calculated digest for the given 521 * returns true if the calculated digest for the given
520 * message matches the given one. 522 * message matches the given one.
521 */ 523 */
522 bool verify( const KMD5::Digest& digest); 524 bool verify( const KMD5::Digest& digest);
523 525
524 /** 526 /**
525 * @overload 527 * @overload
526 */ 528 */
527 bool verify(const QCString&); 529 bool verify(const Q3CString&);
528 530
529protected: 531protected:
530 /** 532 /**
531 * Performs the real update work. Note 533 * Performs the real update work. Note
532 * that length is implied to be 64. 534 * that length is implied to be 64.
533 */ 535 */
534 void transform( const unsigned char buffer[64] ); 536 void transform( const unsigned char buffer[64] );
535 537
536 /** 538 /**
537 * finalizes the digest 539 * finalizes the digest
538 */ 540 */
539 void finalize(); 541 void finalize();
diff --git a/microkde/kdecore/kprefs.cpp b/microkde/kdecore/kprefs.cpp
index 0220a34..d4010fa 100644
--- a/microkde/kdecore/kprefs.cpp
+++ b/microkde/kdecore/kprefs.cpp
@@ -12,24 +12,26 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21// $Id$ 21// $Id$
22 22
23#include <qcolor.h> 23#include <qcolor.h>
24//Added by qt3to4:
25#include <Q3ValueList>
24 26
25#include <kconfig.h> 27#include <kconfig.h>
26#include <kstandarddirs.h> 28#include <kstandarddirs.h>
27#include <kglobal.h> 29#include <kglobal.h>
28#include <kdebug.h> 30#include <kdebug.h>
29 31
30#include "kprefs.h" 32#include "kprefs.h"
31 33
32class KPrefsItemBool : public KPrefsItem { 34class KPrefsItemBool : public KPrefsItem {
33 public: 35 public:
34 KPrefsItemBool(const QString &group,const QString &name,bool *,bool defaultValue=true); 36 KPrefsItemBool(const QString &group,const QString &name,bool *,bool defaultValue=true);
35 virtual ~KPrefsItemBool() {} 37 virtual ~KPrefsItemBool() {}
@@ -131,35 +133,35 @@ class KPrefsItemStringList : public KPrefsItem {
131 void setDefault(); 133 void setDefault();
132 void readConfig(KConfig *); 134 void readConfig(KConfig *);
133 void writeConfig(KConfig *); 135 void writeConfig(KConfig *);
134 136
135 private: 137 private:
136 QStringList *mReference; 138 QStringList *mReference;
137 QStringList mDefault; 139 QStringList mDefault;
138}; 140};
139 141
140 142
141class KPrefsItemIntList : public KPrefsItem { 143class KPrefsItemIntList : public KPrefsItem {
142 public: 144 public:
143 KPrefsItemIntList(const QString &group,const QString &name,QValueList<int> *, 145 KPrefsItemIntList(const QString &group,const QString &name,Q3ValueList<int> *,
144 const QValueList<int> &defaultValue=QValueList<int>()); 146 const Q3ValueList<int> &defaultValue=Q3ValueList<int>());
145 virtual ~KPrefsItemIntList() {} 147 virtual ~KPrefsItemIntList() {}
146 148
147 void setDefault(); 149 void setDefault();
148 void readConfig(KConfig *); 150 void readConfig(KConfig *);
149 void writeConfig(KConfig *); 151 void writeConfig(KConfig *);
150 152
151 private: 153 private:
152 QValueList<int> *mReference; 154 Q3ValueList<int> *mReference;
153 QValueList<int> mDefault; 155 Q3ValueList<int> mDefault;
154}; 156};
155 157
156 158
157KPrefsItemBool::KPrefsItemBool(const QString &group,const QString &name, 159KPrefsItemBool::KPrefsItemBool(const QString &group,const QString &name,
158 bool *reference,bool defaultValue) : 160 bool *reference,bool defaultValue) :
159 KPrefsItem(group,name) 161 KPrefsItem(group,name)
160{ 162{
161 mReference = reference; 163 mReference = reference;
162 mDefault = defaultValue; 164 mDefault = defaultValue;
163} 165}
164 166
165void KPrefsItemBool::setDefault() 167void KPrefsItemBool::setDefault()
@@ -355,25 +357,25 @@ void KPrefsItemStringList::writeConfig(KConfig *config)
355 config->setGroup(mGroup); 357 config->setGroup(mGroup);
356 config->writeEntry(mName,*mReference); 358 config->writeEntry(mName,*mReference);
357} 359}
358 360
359void KPrefsItemStringList::readConfig(KConfig *config) 361void KPrefsItemStringList::readConfig(KConfig *config)
360{ 362{
361 config->setGroup(mGroup); 363 config->setGroup(mGroup);
362 *mReference = config->readListEntry(mName); 364 *mReference = config->readListEntry(mName);
363} 365}
364 366
365 367
366KPrefsItemIntList::KPrefsItemIntList(const QString &group,const QString &name, 368KPrefsItemIntList::KPrefsItemIntList(const QString &group,const QString &name,
367 QValueList<int> *reference,const QValueList<int> &defaultValue) : 369 Q3ValueList<int> *reference,const Q3ValueList<int> &defaultValue) :
368 KPrefsItem(group,name) 370 KPrefsItem(group,name)
369{ 371{
370 mReference = reference; 372 mReference = reference;
371 mDefault = defaultValue; 373 mDefault = defaultValue;
372} 374}
373 375
374void KPrefsItemIntList::setDefault() 376void KPrefsItemIntList::setDefault()
375{ 377{
376 *mReference = mDefault; 378 *mReference = mDefault;
377} 379}
378 380
379void KPrefsItemIntList::writeConfig(KConfig *config) 381void KPrefsItemIntList::writeConfig(KConfig *config)
@@ -496,17 +498,17 @@ void KPrefs::addItemString(const QString &key,QString *reference,const QString &
496 498
497void KPrefs::addItemPassword(const QString &key,QString *reference,const QString &defaultValue) 499void KPrefs::addItemPassword(const QString &key,QString *reference,const QString &defaultValue)
498{ 500{
499 addItem(new KPrefsItemString(*mCurrentGroup,key,reference,defaultValue,true)); 501 addItem(new KPrefsItemString(*mCurrentGroup,key,reference,defaultValue,true));
500} 502}
501 503
502void KPrefs::addItemStringList(const QString &key,QStringList *reference, 504void KPrefs::addItemStringList(const QString &key,QStringList *reference,
503 const QStringList &defaultValue) 505 const QStringList &defaultValue)
504{ 506{
505 addItem(new KPrefsItemStringList(*mCurrentGroup,key,reference,defaultValue)); 507 addItem(new KPrefsItemStringList(*mCurrentGroup,key,reference,defaultValue));
506} 508}
507 509
508void KPrefs::addItemIntList(const QString &key,QValueList<int> *reference, 510void KPrefs::addItemIntList(const QString &key,Q3ValueList<int> *reference,
509 const QValueList<int> &defaultValue) 511 const Q3ValueList<int> &defaultValue)
510{ 512{
511 addItem(new KPrefsItemIntList(*mCurrentGroup,key,reference,defaultValue)); 513 addItem(new KPrefsItemIntList(*mCurrentGroup,key,reference,defaultValue));
512} 514}
diff --git a/microkde/kdecore/kprefs.h b/microkde/kdecore/kprefs.h
index 95d2724..d9d1572 100644
--- a/microkde/kdecore/kprefs.h
+++ b/microkde/kdecore/kprefs.h
@@ -12,29 +12,31 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef _KPREFS_H 20#ifndef _KPREFS_H
21#define _KPREFS_H 21#define _KPREFS_H
22// $Id$ 22// $Id$
23 23
24#include <qptrlist.h> 24#include <q3ptrlist.h>
25#include <qcolor.h> 25#include <qcolor.h>
26#include <qfont.h> 26#include <qfont.h>
27#include <qsize.h> 27#include <qsize.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29//Added by qt3to4:
30#include <Q3ValueList>
29 31
30class KConfig; 32class KConfig;
31 33
32/** 34/**
33 @short Class for storing a preferences setting 35 @short Class for storing a preferences setting
34 @author Cornelius Schumacher 36 @author Cornelius Schumacher
35 @see KPref 37 @see KPref
36 38
37 This class represents one preferences setting as used by @ref KPrefs. 39 This class represents one preferences setting as used by @ref KPrefs.
38 Subclasses of KPrefsItem implement storage functions for a certain type of 40 Subclasses of KPrefsItem implement storage functions for a certain type of
39 setting. Normally you don't have to use this class directly. Use the special 41 setting. Normally you don't have to use this class directly. Use the special
40 addItem() functions of KPrefs instead. If you subclass this class you will 42 addItem() functions of KPrefs instead. If you subclass this class you will
@@ -274,26 +276,26 @@ class KPrefs {
274 const QStringList &defaultValue=QStringList()); 276 const QStringList &defaultValue=QStringList());
275 277
276 /** 278 /**
277 Register an item of type QValueList<int>. 279 Register an item of type QValueList<int>.
278 280
279 @param key Key used in config file. 281 @param key Key used in config file.
280 @param reference Pointer to the variable, which is set by readConfig() 282 @param reference Pointer to the variable, which is set by readConfig()
281 and setDefaults() calls and read by writeConfig() calls. 283 and setDefaults() calls and read by writeConfig() calls.
282 @param defaultValue Default value, which is used by setDefaults() and 284 @param defaultValue Default value, which is used by setDefaults() and
283 when the config file does not yet contain the key of 285 when the config file does not yet contain the key of
284 this item. 286 this item.
285 */ 287 */
286 void addItemIntList(const QString &key,QValueList<int> *reference, 288 void addItemIntList(const QString &key,Q3ValueList<int> *reference,
287 const QValueList<int> &defaultValue=QValueList<int>()); 289 const Q3ValueList<int> &defaultValue=Q3ValueList<int>());
288 290
289 protected: 291 protected:
290 /** 292 /**
291 Implemented by subclasses that use special defaults. 293 Implemented by subclasses that use special defaults.
292 */ 294 */
293 virtual void usrSetDefaults() {}; 295 virtual void usrSetDefaults() {};
294 /** 296 /**
295 Implemented by subclasses that read special config values. 297 Implemented by subclasses that read special config values.
296 */ 298 */
297 virtual void usrReadConfig() {}; 299 virtual void usrReadConfig() {};
298 /** 300 /**
299 Implemented by subclasses that write special config values. 301 Implemented by subclasses that write special config values.
@@ -301,16 +303,16 @@ class KPrefs {
301 virtual void usrWriteConfig() {}; 303 virtual void usrWriteConfig() {};
302 304
303 /** 305 /**
304 Return the @ref KConfig object used for reading and writing the settings. 306 Return the @ref KConfig object used for reading and writing the settings.
305 */ 307 */
306 KConfig *config() const; 308 KConfig *config() const;
307 309
308 private: 310 private:
309 static QString *mCurrentGroup; 311 static QString *mCurrentGroup;
310 312
311 KConfig *mConfig; // pointer to KConfig object 313 KConfig *mConfig; // pointer to KConfig object
312 314
313 QPtrList<KPrefsItem> mItems; 315 Q3PtrList<KPrefsItem> mItems;
314}; 316};
315 317
316#endif 318#endif
diff --git a/microkde/kdecore/kshortcut.h b/microkde/kdecore/kshortcut.h
index 4813734..244d590 100644
--- a/microkde/kdecore/kshortcut.h
+++ b/microkde/kdecore/kshortcut.h
@@ -554,25 +554,25 @@ class KShortcut
554 * @see null() 554 * @see null()
555 * @see isNull() 555 * @see isNull()
556 * @see clear() 556 * @see clear()
557 */ 557 */
558 KShortcut() {} 558 KShortcut() {}
559 559
560 /** 560 /**
561 * Creates a new shortcut with the given Qt key code 561 * Creates a new shortcut with the given Qt key code
562 * as the only key sequence. 562 * as the only key sequence.
563 * @param keyQt the qt keycode 563 * @param keyQt the qt keycode
564 * @see Qt::Key 564 * @see Qt::Key
565 */ 565 */
566 KShortcut( int keyQt ) {} 566 KShortcut( int /*keyQt */) {}
567 567
568 /** 568 /**
569 * Creates a new shortcut that contains only the given qt key 569 * Creates a new shortcut that contains only the given qt key
570 * sequence. 570 * sequence.
571 * @param keySeq the qt key sequence to add 571 * @param keySeq the qt key sequence to add
572 */ 572 */
573 //USKShortcut( const QKeySequence& keySeq ) {} 573 //USKShortcut( const QKeySequence& keySeq ) {}
574 574
575 /** 575 /**
576 * Creates a new shortcut that contains only the given key 576 * Creates a new shortcut that contains only the given key
577 * in its only sequence. 577 * in its only sequence.
578 * @param key the key to add 578 * @param key the key to add
@@ -590,34 +590,34 @@ class KShortcut
590 * Copies the given shortcut. 590 * Copies the given shortcut.
591 * @param shortcut the shortcut to add 591 * @param shortcut the shortcut to add
592 */ 592 */
593 //USKShortcut( const KShortcut& shortcut ); 593 //USKShortcut( const KShortcut& shortcut );
594 594
595 /** 595 /**
596 * Creates a new key sequence that contains the given key sequence. 596 * Creates a new key sequence that contains the given key sequence.
597 * The description consists of semicolon-separated keys as 597 * The description consists of semicolon-separated keys as
598 * used in @ref KKeySequence::KKeySequence(const QString&). 598 * used in @ref KKeySequence::KKeySequence(const QString&).
599 * @param shortcut the description of the key 599 * @param shortcut the description of the key
600 * @see KKeySequence::KKeySequence(const QString&) 600 * @see KKeySequence::KKeySequence(const QString&)
601 */ 601 */
602 KShortcut( const char* shortcut ) {} 602 KShortcut( const char* /*shortcut */) {}
603 603
604 /** 604 /**
605 * Creates a new key sequence that contains the given key sequence. 605 * Creates a new key sequence that contains the given key sequence.
606 * The description consists of semicolon-separated keys as 606 * The description consists of semicolon-separated keys as
607 * used in @ref KKeySequence::KKeySequence(const QString&). 607 * used in @ref KKeySequence::KKeySequence(const QString&).
608 * @param shortcut the description of the key 608 * @param shortcut the description of the key
609 * @see KKeySequence::KKeySequence(const QString&) 609 * @see KKeySequence::KKeySequence(const QString&)
610 */ 610 */
611 KShortcut( const QString& shortcut ) {} 611 KShortcut( const QString& /*shortcut */) {}
612 ~KShortcut() {} 612 ~KShortcut() {}
613 613
614 /** 614 /**
615 * Clears the shortcut. The shortcut is null after calling this 615 * Clears the shortcut. The shortcut is null after calling this
616 * function. 616 * function.
617 * @see isNull() 617 * @see isNull()
618 */ 618 */
619 //USvoid clear(); 619 //USvoid clear();
620 620
621 /** 621 /**
622 * Initializes the shortcut with the given Qt key code 622 * Initializes the shortcut with the given Qt key code
623 * as the only key sequence. 623 * as the only key sequence.
@@ -807,25 +807,25 @@ class KShortcut
807 /** 807 /**
808 * Returns a description of the shortcut as semicolon-separated 808 * Returns a description of the shortcut as semicolon-separated
809 * ket sequences, as returned by @ref KKeySequence::toString(). 809 * ket sequences, as returned by @ref KKeySequence::toString().
810 * @return the string represenation of this shortcut 810 * @return the string represenation of this shortcut
811 * @see KKey::toString() 811 * @see KKey::toString()
812 * @see KKeySequence::toString() 812 * @see KKeySequence::toString()
813 */ 813 */
814 //USQString toString() const; 814 //USQString toString() const;
815 815
816 /** 816 /**
817 * @internal 817 * @internal
818 */ 818 */
819 QString toStringInternal( const KShortcut* pcutDefault = 0 ) const 819 QString toStringInternal( const KShortcut* /*pcutDefault*/ = 0 ) const
820 { 820 {
821 return "EMPTY IMPL."; 821 return "EMPTY IMPL.";
822 } 822 }
823 823
824 /** 824 /**
825 * Returns a null shortcut. 825 * Returns a null shortcut.
826 * @return the null shortcut 826 * @return the null shortcut
827 * @see isNull() 827 * @see isNull()
828 * @see clear() 828 * @see clear()
829 */ 829 */
830 //USstatic KShortcut& null(); 830 //USstatic KShortcut& null();
831 831
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp
index d5bfefd..f10934b 100644
--- a/microkde/kdecore/kstandarddirs.cpp
+++ b/microkde/kdecore/kstandarddirs.cpp
@@ -28,73 +28,75 @@
28 28
29#include <stdlib.h> 29#include <stdlib.h>
30#include <assert.h> 30#include <assert.h>
31//US#include <errno.h> 31//US#include <errno.h>
32//US #ifdef HAVE_SYS_STAT_H 32//US #ifdef HAVE_SYS_STAT_H
33//US #include <sys/stat.h> 33//US #include <sys/stat.h>
34//US #endif 34//US #endif
35//US#include <sys/types.h> 35//US#include <sys/types.h>
36//US#include <dirent.h> 36//US#include <dirent.h>
37//US#include <pwd.h> 37//US#include <pwd.h>
38 38
39#include <qregexp.h> 39#include <qregexp.h>
40#include <qasciidict.h> 40#include <q3asciidict.h>
41#include <qdict.h> 41#include <q3dict.h>
42#include <qdir.h> 42#include <qdir.h>
43#include <qfileinfo.h> 43#include <qfileinfo.h>
44#include <qstring.h> 44#include <qstring.h>
45#include <qmessagebox.h> 45#include <qmessagebox.h>
46#include <qapplication.h> 46#include <qapplication.h>
47 47
48#include <qstringlist.h> 48#include <qstringlist.h>
49//Added by qt3to4:
50#include <Q3CString>
49 51
50#include "kstandarddirs.h" 52#include "kstandarddirs.h"
51#include "kconfig.h" 53#include "kconfig.h"
52#include "kdebug.h" 54#include "kdebug.h"
53//US #include "kinstance.h" 55//US #include "kinstance.h"
54#include "kshell.h" 56#include "kshell.h"
55//US#include <sys/param.h> 57//US#include <sys/param.h>
56//US#include <unistd.h> 58//US#include <unistd.h>
57 59
58//US 60//US
59QString KStandardDirs::mAppDir = QString::null; 61QString KStandardDirs::mAppDir = QString::null;
60 62
61 63
62template class QDict<QStringList>; 64template class Q3Dict<QStringList>;
63 65
64#if 0 66#if 0
65#include <qtextedit.h> 67#include <q3textedit.h>
66void ddd( QString op ) 68void ddd( QString op )
67{ 69{
68 static QTextEdit * dot = 0; 70 static Q3TextEdit * dot = 0;
69 if ( ! dot ) 71 if ( ! dot )
70 dot = new QTextEdit(); 72 dot = new Q3TextEdit();
71 73
72 dot->show(); 74 dot->show();
73 75
74 dot->append( op ); 76 dot->append( op );
75 77
76} 78}
77#endif 79#endif
78class KStandardDirs::KStandardDirsPrivate 80class KStandardDirs::KStandardDirsPrivate
79{ 81{
80public: 82public:
81 KStandardDirsPrivate() 83 KStandardDirsPrivate()
82 : restrictionsActive(false), 84 : restrictionsActive(false),
83 dataRestrictionActive(false) 85 dataRestrictionActive(false)
84 { } 86 { }
85 87
86 bool restrictionsActive; 88 bool restrictionsActive;
87 bool dataRestrictionActive; 89 bool dataRestrictionActive;
88 QAsciiDict<bool> restrictions; 90 Q3AsciiDict<bool> restrictions;
89 QStringList xdgdata_prefixes; 91 QStringList xdgdata_prefixes;
90 QStringList xdgconf_prefixes; 92 QStringList xdgconf_prefixes;
91}; 93};
92 94
93static const char* const types[] = {"html", "icon", "apps", "sound", 95static const char* const types[] = {"html", "icon", "apps", "sound",
94 "data", "locale", "services", "mime", 96 "data", "locale", "services", "mime",
95 "servicetypes", "config", "exe", "tmp", 97 "servicetypes", "config", "exe", "tmp",
96 "wallpaper", "lib", "pixmap", "templates", 98 "wallpaper", "lib", "pixmap", "templates",
97 "module", "qtplugins", 99 "module", "qtplugins",
98 "xdgdata-apps", "xdgdata-dirs", "xdgconf-menu", 0 }; 100 "xdgdata-apps", "xdgdata-dirs", "xdgconf-menu", 0 };
99 101
100static int tokenize( QStringList& token, const QString& str, 102static int tokenize( QStringList& token, const QString& str,
@@ -436,25 +438,25 @@ static void lookupDirectory(const QString& path, const QString &relPart,
436 it++; 438 it++;
437 if ( fn.isNull() ) 439 if ( fn.isNull() )
438 break; 440 break;
439 441
440 if (fn == _dot || fn == _dotdot || fn.at(fn.length() - 1).latin1() == '~' ) 442 if (fn == _dot || fn == _dotdot || fn.at(fn.length() - 1).latin1() == '~' )
441 continue; 443 continue;
442 444
443/*US 445/*US
444 if (!recursive && !regexp.exactMatch(fn)) 446 if (!recursive && !regexp.exactMatch(fn))
445 continue; // No match 447 continue; // No match
446*/ 448*/
447//US this should do the same: 449//US this should do the same:
448 int pos = regexp.match(fn); 450 int pos = regexp.exactMatch(fn);
449 if (!recursive && !pos == 0) 451 if (!recursive && !pos == 0)
450 continue; // No match 452 continue; // No match
451 453
452 QString pathfn = path + fn; 454 QString pathfn = path + fn;
453/*US 455/*US
454 if ( stat( QFile::encodeName(pathfn), &buff ) != 0 ) { 456 if ( stat( QFile::encodeName(pathfn), &buff ) != 0 ) {
455 kdDebug() << "Error stat'ing " << pathfn << " : " << perror << endl; 457 kdDebug() << "Error stat'ing " << pathfn << " : " << perror << endl;
456 continue; // Couldn't stat (e.g. no read permissions) 458 continue; // Couldn't stat (e.g. no read permissions)
457 } 459 }
458 460
459 if ( recursive ) 461 if ( recursive )
460 { 462 {
@@ -473,25 +475,25 @@ static void lookupDirectory(const QString& path, const QString &relPart,
473 if ( recursive ) 475 if ( recursive )
474 { 476 {
475 if ( pathfnInfo.isDir()) { 477 if ( pathfnInfo.isDir()) {
476 lookupDirectory(pathfn + '/', relPart + fn + '/', regexp, list, relList, recursive, uniq); 478 lookupDirectory(pathfn + '/', relPart + fn + '/', regexp, list, relList, recursive, uniq);
477 } 479 }
478 480
479 481
480/*US 482/*US
481 if (!regexp.exactMatch(fn)) 483 if (!regexp.exactMatch(fn))
482 continue; // No match 484 continue; // No match
483*/ 485*/
484//US this should do the same: 486//US this should do the same:
485 pos = regexp.match(fn); 487 pos = regexp.exactMatch(fn);
486 if (!pos == 0) 488 if (!pos == 0)
487 continue; // No match 489 continue; // No match
488 } 490 }
489 491
490//US if ( S_ISREG( buff.st_mode)) 492//US if ( S_ISREG( buff.st_mode))
491 if ( pathfnInfo.isFile()) 493 if ( pathfnInfo.isFile())
492 { 494 {
493 if (!uniq || !relList.contains(relPart + fn)) 495 if (!uniq || !relList.contains(relPart + fn))
494 { 496 {
495 list.append( pathfn ); 497 list.append( pathfn );
496 relList.append( relPart + fn ); 498 relList.append( relPart + fn );
497 } 499 }
@@ -1099,25 +1101,25 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode)
1099 // append trailing slash if missing 1101 // append trailing slash if missing
1100 if (dir.at(len - 1) != '/') 1102 if (dir.at(len - 1) != '/')
1101 target += '/'; 1103 target += '/';
1102 1104
1103 QString base(""); 1105 QString base("");
1104 uint i = 1; 1106 uint i = 1;
1105 1107
1106 while( i < len ) 1108 while( i < len )
1107 { 1109 {
1108//US struct stat st; 1110//US struct stat st;
1109 int pos = target.find('/', i); 1111 int pos = target.find('/', i);
1110 base += target.mid(i - 1, pos - i + 1); 1112 base += target.mid(i - 1, pos - i + 1);
1111 QCString baseEncoded = QFile::encodeName(base); 1113 Q3CString baseEncoded = QFile::encodeName(base);
1112 // bail out if we encountered a problem 1114 // bail out if we encountered a problem
1113//US if (stat(baseEncoded, &st) != 0) 1115//US if (stat(baseEncoded, &st) != 0)
1114 QFileInfo baseEncodedInfo(baseEncoded); 1116 QFileInfo baseEncodedInfo(baseEncoded);
1115 if (!baseEncodedInfo.exists()) 1117 if (!baseEncodedInfo.exists())
1116 { 1118 {
1117 // Directory does not exist.... 1119 // Directory does not exist....
1118 // Or maybe a dangling symlink ? 1120 // Or maybe a dangling symlink ?
1119//US if (lstat(baseEncoded, &st) == 0) 1121//US if (lstat(baseEncoded, &st) == 0)
1120 if (baseEncodedInfo.isSymLink()) { 1122 if (baseEncodedInfo.isSymLink()) {
1121//US (void)unlink(baseEncoded); // try removing 1123//US (void)unlink(baseEncoded); // try removing
1122 QFile(baseEncoded).remove(); 1124 QFile(baseEncoded).remove();
1123 } 1125 }
@@ -1199,25 +1201,25 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode)
1199 1201
1200 i = pos + 1; 1202 i = pos + 1;
1201 } 1203 }
1202 return true; 1204 return true;
1203 1205
1204} 1206}
1205 1207
1206QString readEnvPath(const char *env) 1208QString readEnvPath(const char *env)
1207{ 1209{
1208 //#ifdef _WIN32_ 1210 //#ifdef _WIN32_
1209 // return ""; 1211 // return "";
1210 //#else 1212 //#else
1211 QCString c_path; 1213 Q3CString c_path;
1212 if ( getenv(env) != NULL ) 1214 if ( getenv(env) != NULL )
1213 c_path = QString ( getenv(env) ); 1215 c_path = QString ( getenv(env) );
1214 if (c_path.isEmpty()) 1216 if (c_path.isEmpty())
1215 return QString::null; 1217 return QString::null;
1216 return QFile::decodeName(c_path); 1218 return QFile::decodeName(c_path);
1217 //#endif 1219 //#endif
1218 1220
1219} 1221}
1220 1222
1221void KStandardDirs::addKDEDefaults() 1223void KStandardDirs::addKDEDefaults()
1222{ 1224{
1223 1225
diff --git a/microkde/kdecore/kstandarddirs.h b/microkde/kdecore/kstandarddirs.h
index 901384e..f0e28fc 100644
--- a/microkde/kdecore/kstandarddirs.h
+++ b/microkde/kdecore/kstandarddirs.h
@@ -15,25 +15,25 @@
15 Library General Public License for more details. 15 Library General Public License for more details.
16 16
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22 22
23#ifndef SSK_KSTDDIRS_H 23#ifndef SSK_KSTDDIRS_H
24#define SSK_KSTDDIRS_H 24#define SSK_KSTDDIRS_H
25 25
26#include <qstring.h> 26#include <qstring.h>
27#include <qdict.h> 27#include <q3dict.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29#include <kglobal.h> 29#include <kglobal.h>
30 30
31class KConfig; 31class KConfig;
32class KStandardDirsPrivate; 32class KStandardDirsPrivate;
33 33
34 34
35/** 35/**
36 * @short Site-independent access to standard KDE directories. 36 * @short Site-independent access to standard KDE directories.
37 * @author Stephan Kulow <coolo@kde.org> and Sirtaj Singh Kang <taj@kde.org> 37 * @author Stephan Kulow <coolo@kde.org> and Sirtaj Singh Kang <taj@kde.org>
38 * @version $Id$ 38 * @version $Id$
39 * 39 *
@@ -565,29 +565,29 @@ public:
565 * @since 3.1 565 * @since 3.1
566 */ 566 */
567 static QString realPath(const QString &dirname); 567 static QString realPath(const QString &dirname);
568 568
569 static void setAppDir( const QString & ); 569 static void setAppDir( const QString & );
570 static QString appDir(); 570 static QString appDir();
571 571
572 private: 572 private:
573 573
574 QStringList prefixes; 574 QStringList prefixes;
575 575
576 // Directory dictionaries 576 // Directory dictionaries
577 QDict<QStringList> absolutes; 577 Q3Dict<QStringList> absolutes;
578 QDict<QStringList> relatives; 578 Q3Dict<QStringList> relatives;
579 579
580 mutable QDict<QStringList> dircache; 580 mutable Q3Dict<QStringList> dircache;
581 mutable QDict<QString> savelocations; 581 mutable Q3Dict<QString> savelocations;
582 582
583 // Disallow assignment and copy-construction 583 // Disallow assignment and copy-construction
584 KStandardDirs( const KStandardDirs& ); 584 KStandardDirs( const KStandardDirs& );
585 KStandardDirs& operator= ( const KStandardDirs& ); 585 KStandardDirs& operator= ( const KStandardDirs& );
586 586
587 bool addedCustoms; 587 bool addedCustoms;
588 588
589 class KStandardDirsPrivate; 589 class KStandardDirsPrivate;
590 KStandardDirsPrivate *d; 590 KStandardDirsPrivate *d;
591//US 591//US
592 static QString mAppDir; 592 static QString mAppDir;
593 593
diff --git a/microkde/kdeui/kaction.cpp b/microkde/kdeui/kaction.cpp
index d38a6d5..c2df381 100644
--- a/microkde/kdeui/kaction.cpp
+++ b/microkde/kdeui/kaction.cpp
@@ -19,41 +19,44 @@
19 19
20 You should have received a copy of the GNU Library General Public License 20 You should have received a copy of the GNU Library General Public License
21 along with this library; see the file COPYING.LIB. If not, write to 21 along with this library; see the file COPYING.LIB. If not, write to
22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. 23 Boston, MA 02111-1307, USA.
24*/ 24*/
25 25
26#include "kaction.h" 26#include "kaction.h"
27 27
28#include <assert.h> 28#include <assert.h>
29 29
30#include <qtooltip.h> 30#include <qtooltip.h>
31//Added by qt3to4:
32#include <Q3CString>
33#include <Q3ValueList>
31//US#include <qwhatsthis.h> 34//US#include <qwhatsthis.h>
32//US#include <kaccel.h> 35//US#include <kaccel.h>
33//US#include <kaccelbase.h> 36//US#include <kaccelbase.h>
34#include <kapplication.h> 37#include <kapplication.h>
35#include <kdebug.h> 38#include <kdebug.h>
36#include <kguiitem.h> 39#include <kguiitem.h>
37//US#include <kmainwindow.h> 40//US#include <kmainwindow.h>
38//US#include <kmenubar.h> 41//US#include <kmenubar.h>
39//US#include <kpopupmenu.h> 42//US#include <kpopupmenu.h>
40#include <ktoolbar.h> 43#include <ktoolbar.h>
41#include <ktoolbarbutton.h> 44#include <ktoolbarbutton.h>
42 45
43//US added this includefiles 46//US added this includefiles
44#include <qmenubar.h> 47#include <qmenubar.h>
45#include <qtoolbar.h> 48#include <q3toolbar.h>
46#include <qpopupmenu.h> 49#include <q3popupmenu.h>
47#include <qiconset.h> 50#include <qicon.h>
48 51
49/** 52/**
50* How it works. 53* How it works.
51* KActionCollection is an organizing container for KActions. 54* KActionCollection is an organizing container for KActions.
52* KActionCollection keeps track of the information necessary to handle 55* KActionCollection keeps track of the information necessary to handle
53* configuration and shortcuts. 56* configuration and shortcuts.
54* 57*
55* Focus Widget pointer: 58* Focus Widget pointer:
56* This is the widget which is the focus for action shortcuts. 59* This is the widget which is the focus for action shortcuts.
57* It is set either by passing a QWidget* to the KActionCollection constructor 60* It is set either by passing a QWidget* to the KActionCollection constructor
58* or by calling setWidget() if the widget wasn't known when the object was 61* or by calling setWidget() if the widget wasn't known when the object was
59* initially constructed (as in KXMLGUIClient and KParts::PartBase) 62* initially constructed (as in KXMLGUIClient and KParts::PartBase)
@@ -78,68 +81,68 @@ int KAction::getToolButtonID()
78//--------------------------------------------------------------------- 81//---------------------------------------------------------------------
79 82
80class KAction::KActionPrivate : public KGuiItem 83class KAction::KActionPrivate : public KGuiItem
81{ 84{
82public: 85public:
83 KActionPrivate() : KGuiItem() 86 KActionPrivate() : KGuiItem()
84 { 87 {
85 m_kaccel = 0; 88 m_kaccel = 0;
86 m_configurable = true; 89 m_configurable = true;
87 } 90 }
88 91
89 KAccel *m_kaccel; 92 KAccel *m_kaccel;
90 QValueList<KAccel*> m_kaccelList; 93 Q3ValueList<KAccel*> m_kaccelList;
91 94
92 QString m_groupText; 95 QString m_groupText;
93 QString m_group; 96 QString m_group;
94 97
95 KShortcut m_cut; 98 KShortcut m_cut;
96 KShortcut m_cutDefault; 99 KShortcut m_cutDefault;
97 100
98 bool m_configurable; 101 bool m_configurable;
99 102
100 struct Container 103 struct Container
101 { 104 {
102 Container() { m_container = 0; m_representative = 0; m_id = 0; } 105 Container() { m_container = 0; m_representative = 0; m_id = 0; }
103 Container( const Container& s ) { m_container = s.m_container; 106 Container( const Container& s ) { m_container = s.m_container;
104 m_id = s.m_id; m_representative = s.m_representative; } 107 m_id = s.m_id; m_representative = s.m_representative; }
105 QWidget* m_container; 108 QWidget* m_container;
106 int m_id; 109 int m_id;
107 QWidget* m_representative; 110 QWidget* m_representative;
108 }; 111 };
109 112
110 QValueList<Container> m_containers; 113 Q3ValueList<Container> m_containers;
111}; 114};
112 115
113//--------------------------------------------------------------------- 116//---------------------------------------------------------------------
114// KAction 117// KAction
115//--------------------------------------------------------------------- 118//---------------------------------------------------------------------
116KAction::KAction( const QString& text, const KShortcut& cut, 119KAction::KAction( const QString& text, const KShortcut& cut,
117 const QObject* receiver, const char* slot, 120 const QObject* receiver, const char* slot,
118 KActionCollection* parent, const char* name ) 121 KActionCollection* parent, const char* name )
119: QObject( parent, name ) 122: QObject( parent, name )
120{ 123{
121 initPrivate( text, cut, receiver, slot ); 124 initPrivate( text, cut, receiver, slot );
122} 125}
123 126
124KAction::KAction( const QString& text, const QString& sIconName, const KShortcut& cut, 127KAction::KAction( const QString& text, const QString& sIconName, const KShortcut& cut,
125 const QObject* receiver, const char* slot, 128 const QObject* receiver, const char* slot,
126 KActionCollection* parent, const char* name ) 129 KActionCollection* parent, const char* name )
127: QObject( parent, name ) 130: QObject( parent, name )
128{ 131{
129 initPrivate( text, cut, receiver, slot ); 132 initPrivate( text, cut, receiver, slot );
130 d->setIconName( sIconName ); 133 d->setIconName( sIconName );
131} 134}
132 135
133KAction::KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, 136KAction::KAction( const QString& text, const QIcon& pix, const KShortcut& cut,
134 const QObject* receiver, const char* slot, 137 const QObject* receiver, const char* slot,
135 KActionCollection* parent, const char* name ) 138 KActionCollection* parent, const char* name )
136: QObject( parent, name ) 139: QObject( parent, name )
137{ 140{
138 initPrivate( text, cut, receiver, slot ); 141 initPrivate( text, cut, receiver, slot );
139 d->setIconSet( pix ); 142 d->setIconSet( pix );
140} 143}
141KAction::KAction( const KGuiItem& item, const KShortcut& cut, 144KAction::KAction( const KGuiItem& item, const KShortcut& cut,
142 const QObject* receiver, const char* slot, 145 const QObject* receiver, const char* slot,
143 KActionCollection* parent, const char* name ) 146 KActionCollection* parent, const char* name )
144: QObject( parent, name ) 147: QObject( parent, name )
145{ 148{
@@ -155,43 +158,43 @@ KAction::KAction( const QString& text, const KShortcut& cut,
155 QObject* parent, const char* name ) 158 QObject* parent, const char* name )
156 : QObject( parent, name ) 159 : QObject( parent, name )
157{ 160{
158 initPrivate( text, cut, 0, 0 ); 161 initPrivate( text, cut, 0, 0 );
159} 162}
160KAction::KAction( const QString& text, const KShortcut& cut, 163KAction::KAction( const QString& text, const KShortcut& cut,
161 const QObject* receiver, 164 const QObject* receiver,
162 const char* slot, QObject* parent, const char* name ) 165 const char* slot, QObject* parent, const char* name )
163 : QObject( parent, name ) 166 : QObject( parent, name )
164{ 167{
165 initPrivate( text, cut, receiver, slot ); 168 initPrivate( text, cut, receiver, slot );
166} 169}
167KAction::KAction( const QString& text, const QIconSet& pix, 170KAction::KAction( const QString& text, const QIcon& pix,
168 const KShortcut& cut, 171 const KShortcut& cut,
169 QObject* parent, const char* name ) 172 QObject* parent, const char* name )
170 : QObject( parent, name ) 173 : QObject( parent, name )
171{ 174{
172 initPrivate( text, cut, 0, 0 ); 175 initPrivate( text, cut, 0, 0 );
173 setIconSet( pix ); 176 setIconSet( pix );
174} 177}
175 178
176KAction::KAction( const QString& text, const QString& pix, 179KAction::KAction( const QString& text, const QString& pix,
177 const KShortcut& cut, 180 const KShortcut& cut,
178 QObject* parent, const char* name ) 181 QObject* parent, const char* name )
179: QObject( parent, name ) 182: QObject( parent, name )
180{ 183{
181 initPrivate( text, cut, 0, 0 ); 184 initPrivate( text, cut, 0, 0 );
182 d->setIconName( pix ); 185 d->setIconName( pix );
183} 186}
184 187
185KAction::KAction( const QString& text, const QIconSet& pix, 188KAction::KAction( const QString& text, const QIcon& pix,
186 const KShortcut& cut, 189 const KShortcut& cut,
187 const QObject* receiver, const char* slot, QObject* parent, 190 const QObject* receiver, const char* slot, QObject* parent,
188 const char* name ) 191 const char* name )
189 : QObject( parent, name ) 192 : QObject( parent, name )
190{ 193{
191 initPrivate( text, cut, receiver, slot ); 194 initPrivate( text, cut, receiver, slot );
192 setIconSet( pix ); 195 setIconSet( pix );
193} 196}
194 197
195KAction::KAction( const QString& text, const QString& pix, 198KAction::KAction( const QString& text, const QString& pix,
196 const KShortcut& cut, 199 const KShortcut& cut,
197 const QObject* receiver, const char* slot, QObject* parent, 200 const QObject* receiver, const char* slot, QObject* parent,
@@ -497,37 +500,37 @@ void KAction::removeKAccel( KAccel* kaccel )
497// KDE 4: remove 500// KDE 4: remove
498void KAction::setAccel( int keyQt ) 501void KAction::setAccel( int keyQt )
499{ 502{
500 setShortcut( KShortcut(keyQt) ); 503 setShortcut( KShortcut(keyQt) );
501} 504}
502// KDE 4: remove end 505// KDE 4: remove end
503 506
504void KAction::updateShortcut( int i ) 507void KAction::updateShortcut( int i )
505{ 508{
506 int id = itemId( i ); 509 int id = itemId( i );
507 510
508 QWidget* w = container( i ); 511 QWidget* w = container( i );
509 if ( w->inherits( "QPopupMenu" ) ) { 512 if ( w->inherits( "Q3PopupMenu" ) ) {
510 QPopupMenu* menu = static_cast<QPopupMenu*>(w); 513 Q3PopupMenu* menu = static_cast<Q3PopupMenu*>(w);
511 updateShortcut( menu, id ); 514 updateShortcut( menu, id );
512 } 515 }
513 else if ( w->inherits( "QMenuBar" ) ) 516 else if ( w->inherits( "QMenuBar" ) )
514//US static_cast<QMenuBar*>(w)->setAccel( d->m_cut.keyCodeQt(), id ); 517//US static_cast<QMenuBar*>(w)->setAccel( d->m_cut.keyCodeQt(), id );
515//US (QMenuBar*)(w)->setAccel( d->m_cut.keyCodeQt(), id ); 518//US (QMenuBar*)(w)->setAccel( d->m_cut.keyCodeQt(), id );
516 519
517 ; //qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed"); 520 ; //qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed");
518 521
519} 522}
520 523
521void KAction::updateShortcut( QPopupMenu* menu, int id ) 524void KAction::updateShortcut( Q3PopupMenu* menu, int id )
522{ 525{
523/*US 526/*US
524 //kdDebug(129) << "KAction::updateShortcut(): this = " << this << " d->m_kaccelList.count() = " << d->m_kaccelList.count() << endl; 527 //kdDebug(129) << "KAction::updateShortcut(): this = " << this << " d->m_kaccelList.count() = " << d->m_kaccelList.count() << endl;
525 // If the action has a KAccel object, 528 // If the action has a KAccel object,
526 // show the string representation of its shortcut. 529 // show the string representation of its shortcut.
527 if ( d->m_kaccel || d->m_kaccelList.count() ) { 530 if ( d->m_kaccel || d->m_kaccelList.count() ) {
528 QString s = menu->text( id ); 531 QString s = menu->text( id );
529 int i = s.find( '\t' ); 532 int i = s.find( '\t' );
530 if ( i >= 0 ) 533 if ( i >= 0 )
531 s.replace( i+1, s.length()-i, d->m_cut.seq(0).toString() ); 534 s.replace( i+1, s.length()-i, d->m_cut.seq(0).toString() );
532 else 535 else
533 s += "\t" + d->m_cut.seq(0).toString(); 536 s += "\t" + d->m_cut.seq(0).toString();
@@ -612,52 +615,52 @@ void KAction::setToolTip( const QString& tt )
612 int len = containerCount(); 615 int len = containerCount();
613 for( int i = 0; i < len; ++i ) 616 for( int i = 0; i < len; ++i )
614 updateToolTip( i ); 617 updateToolTip( i );
615} 618}
616 619
617void KAction::updateToolTip( int i ) 620void KAction::updateToolTip( int i )
618{ 621{
619 //qDebug("KAction::updateToolTip ...1 has top be fixed"); 622 //qDebug("KAction::updateToolTip ...1 has top be fixed");
620 QWidget *w = container( i ); 623 QWidget *w = container( i );
621 624
622 if ( w->inherits( "KToolBar" ) ) 625 if ( w->inherits( "KToolBar" ) )
623 QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); 626 QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() );
624 else if ( w->inherits( "QToolBar" ) ) 627 else if ( w->inherits( "Q3ToolBar" ) )
625 QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); 628 QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() );
626} 629}
627 630
628QString KAction::toolTip() const 631QString KAction::toolTip() const
629{ 632{
630 return d->toolTip(); 633 return d->toolTip();
631} 634}
632 635
633int KAction::plug( QWidget *w, int index ) 636int KAction::plug( QWidget *w, int index )
634{ 637{
635 //kdDebug(129) << "KAction::plug( " << w << ", " << index << " )" << endl; 638 //kdDebug(129) << "KAction::plug( " << w << ", " << index << " )" << endl;
636 if (w == 0) { 639 if (w == 0) {
637 kdWarning(129) << "KAction::plug called with 0 argument\n"; 640 kdWarning(129) << "KAction::plug called with 0 argument\n";
638 return -1; 641 return -1;
639 } 642 }
640 643
641 644
642 645
643 // Check if action is permitted 646 // Check if action is permitted
644//US if (kapp && !kapp->authorizeKAction(name())) 647//US if (kapp && !kapp->authorizeKAction(name()))
645//US return -1; 648//US return -1;
646 649
647 plugShortcut(); 650 plugShortcut();
648 651
649 if ( w->inherits("QPopupMenu") ) 652 if ( w->inherits("Q3PopupMenu") )
650 { 653 {
651 QPopupMenu* menu = static_cast<QPopupMenu*>( w ); 654 Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( w );
652 int id; 655 int id;
653 // Don't insert shortcut into menu if it's already in a KAccel object. 656 // Don't insert shortcut into menu if it's already in a KAccel object.
654 //qDebug("KAction::plug warning: real shortcuts not available yet. "); 657 //qDebug("KAction::plug warning: real shortcuts not available yet. ");
655//US int keyQt = (d->m_kaccelList.count() || d->m_kaccel) ? 0 : d->m_cut.keyCodeQt(); 658//US int keyQt = (d->m_kaccelList.count() || d->m_kaccel) ? 0 : d->m_cut.keyCodeQt();
656 int keyQt = 0; 659 int keyQt = 0;
657 660
658 if ( d->hasIcon() ) 661 if ( d->hasIcon() )
659 { 662 {
660/*US 663/*US
661 KInstance *instance; 664 KInstance *instance;
662 if ( m_parentCollection ) 665 if ( m_parentCollection )
663 instance = m_parentCollection->instance(); 666 instance = m_parentCollection->instance();
@@ -712,25 +715,25 @@ int KAction::plug( QWidget *w, int index )
712 SLOT( slotActivated() ), 715 SLOT( slotActivated() ),
713 d->isEnabled(), d->plainText(), index ); 716 d->isEnabled(), d->plainText(), index );
714 } 717 }
715 else 718 else
716 { 719 {
717 QString icon = d->iconName(); 720 QString icon = d->iconName();
718 if ( icon.isEmpty() ) 721 if ( icon.isEmpty() )
719 icon = "unknown"; 722 icon = "unknown";
720 bar->insertButton( icon, id_, SIGNAL( clicked() ), this, 723 bar->insertButton( icon, id_, SIGNAL( clicked() ), this,
721 SLOT( slotActivated() ), 724 SLOT( slotActivated() ),
722 d->isEnabled(), d->plainText(), index/*US, instance*/ ); 725 d->isEnabled(), d->plainText(), index/*US, instance*/ );
723 } 726 }
724 bar->getButton( id_ )->setName( QCString("toolbutton_")+name() ); 727 bar->getButton( id_ )->setName( Q3CString("toolbutton_")+name() );
725 728
726//US if ( !d->whatsThis().isEmpty() ) 729//US if ( !d->whatsThis().isEmpty() )
727//US QWhatsThis::add( bar->getButton(id_), whatsThisWithIcon() ); 730//US QWhatsThis::add( bar->getButton(id_), whatsThisWithIcon() );
728 if ( !d->toolTip().isEmpty() ) 731 if ( !d->toolTip().isEmpty() )
729 QToolTip::add( bar->getButton(id_), d->toolTip() ); 732 QToolTip::add( bar->getButton(id_), d->toolTip() );
730 733
731 addContainer( bar, id_ ); 734 addContainer( bar, id_ );
732 735
733 connect( bar, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) ); 736 connect( bar, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) );
734 737
735 if ( m_parentCollection ) 738 if ( m_parentCollection )
736 m_parentCollection->connectHighlight( bar, this ); 739 m_parentCollection->connectHighlight( bar, this );
@@ -740,27 +743,27 @@ int KAction::plug( QWidget *w, int index )
740 } 743 }
741 744
742 return -1; 745 return -1;
743} 746}
744 747
745void KAction::unplug( QWidget *w ) 748void KAction::unplug( QWidget *w )
746{ 749{
747 int i = findContainer( w ); 750 int i = findContainer( w );
748 if ( i == -1 ) 751 if ( i == -1 )
749 return; 752 return;
750 int id = itemId( i ); 753 int id = itemId( i );
751 754
752 if ( w->inherits( "QPopupMenu" ) ) 755 if ( w->inherits( "Q3PopupMenu" ) )
753 { 756 {
754 QPopupMenu *menu = static_cast<QPopupMenu *>( w ); 757 Q3PopupMenu *menu = static_cast<Q3PopupMenu *>( w );
755 menu->removeItem( id ); 758 menu->removeItem( id );
756 } 759 }
757 else if ( w->inherits( "KToolBar" ) ) 760 else if ( w->inherits( "KToolBar" ) )
758 { 761 {
759 KToolBar *bar = static_cast<KToolBar *>( w ); 762 KToolBar *bar = static_cast<KToolBar *>( w );
760 bar->removeItemDelayed( id ); 763 bar->removeItemDelayed( id );
761 } 764 }
762 else if ( w->inherits( "QMenuBar" ) ) 765 else if ( w->inherits( "QMenuBar" ) )
763 { 766 {
764 QMenuBar *bar = static_cast<QMenuBar *>( w ); 767 QMenuBar *bar = static_cast<QMenuBar *>( w );
765 bar->removeItem( id ); 768 bar->removeItem( id );
766 } 769 }
@@ -853,26 +856,26 @@ void KAction::setEnabled(bool enable)
853 856
854 int len = containerCount(); 857 int len = containerCount();
855 for( int i = 0; i < len; ++i ) 858 for( int i = 0; i < len; ++i )
856 updateEnabled( i ); 859 updateEnabled( i );
857 860
858 emit enabled( d->isEnabled() ); 861 emit enabled( d->isEnabled() );
859} 862}
860 863
861void KAction::updateEnabled( int i ) 864void KAction::updateEnabled( int i )
862{ 865{
863 QWidget *w = container( i ); 866 QWidget *w = container( i );
864 867
865 if ( w->inherits("QPopupMenu") ) 868 if ( w->inherits("Q3PopupMenu") )
866 static_cast<QPopupMenu*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); 869 static_cast<Q3PopupMenu*>(w)->setItemEnabled( itemId( i ), d->isEnabled() );
867 else if ( w->inherits("QMenuBar") ) 870 else if ( w->inherits("QMenuBar") )
868 static_cast<QMenuBar*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); 871 static_cast<QMenuBar*>(w)->setItemEnabled( itemId( i ), d->isEnabled() );
869 else if ( w->inherits( "KToolBar" ) ) 872 else if ( w->inherits( "KToolBar" ) )
870 { 873 {
871 static_cast<KToolBar*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); 874 static_cast<KToolBar*>(w)->setItemEnabled( itemId( i ), d->isEnabled() );
872 } 875 }
873} 876}
874 877
875void KAction::setShortcutConfigurable( bool b ) 878void KAction::setShortcutConfigurable( bool b )
876{ 879{
877 d->m_configurable = b; 880 d->m_configurable = b;
878} 881}
@@ -897,28 +900,28 @@ void KAction::setText( const QString& text )
897 d->setText( text ); 900 d->setText( text );
898 901
899 int len = containerCount(); 902 int len = containerCount();
900 for( int i = 0; i < len; ++i ) 903 for( int i = 0; i < len; ++i )
901 updateText( i ); 904 updateText( i );
902 905
903} 906}
904 907
905void KAction::updateText( int i ) 908void KAction::updateText( int i )
906{ 909{
907 QWidget *w = container( i ); 910 QWidget *w = container( i );
908 911
909 if ( w->inherits( "QPopupMenu" ) ) { 912 if ( w->inherits( "Q3PopupMenu" ) ) {
910 int id = itemId( i ); 913 int id = itemId( i );
911 static_cast<QPopupMenu*>(w)->changeItem( id, d->text() ); 914 static_cast<Q3PopupMenu*>(w)->changeItem( id, d->text() );
912 updateShortcut( static_cast<QPopupMenu*>(w), id ); 915 updateShortcut( static_cast<Q3PopupMenu*>(w), id );
913 } 916 }
914 else if ( w->inherits( "QMenuBar" ) ) 917 else if ( w->inherits( "QMenuBar" ) )
915 static_cast<QMenuBar*>(w)->changeItem( itemId( i ), d->text() ); 918 static_cast<QMenuBar*>(w)->changeItem( itemId( i ), d->text() );
916 else if ( w->inherits( "KToolBar" ) ) 919 else if ( w->inherits( "KToolBar" ) )
917 { 920 {
918 //qDebug("KAction::updateText ...3 has top be fixed"); 921 //qDebug("KAction::updateText ...3 has top be fixed");
919 QWidget *button = static_cast<KToolBar *>(w)->getWidget( itemId( i ) ); 922 QWidget *button = static_cast<KToolBar *>(w)->getWidget( itemId( i ) );
920 if ( button->inherits( "KToolBarButton" ) ) 923 if ( button->inherits( "KToolBarButton" ) )
921 static_cast<KToolBarButton *>(button)->setText( d->plainText() ); 924 static_cast<KToolBarButton *>(button)->setText( d->plainText() );
922 925
923 } 926 }
924} 927}
@@ -938,100 +941,100 @@ void KAction::setIcon( const QString &icon )
938 d->setIconName( icon ); 941 d->setIconName( icon );
939 942
940 // now handle any toolbars 943 // now handle any toolbars
941 int len = containerCount(); 944 int len = containerCount();
942 for ( int i = 0; i < len; ++i ) 945 for ( int i = 0; i < len; ++i )
943 updateIcon( i ); 946 updateIcon( i );
944} 947}
945 948
946void KAction::updateIcon( int id ) 949void KAction::updateIcon( int id )
947{ 950{
948 QWidget* w = container( id ); 951 QWidget* w = container( id );
949 952
950 if ( w->inherits( "QPopupMenu" ) ) { 953 if ( w->inherits( "Q3PopupMenu" ) ) {
951 int itemId_ = itemId( id ); 954 int itemId_ = itemId( id );
952 static_cast<QPopupMenu*>(w)->changeItem( itemId_, d->iconSet( KIcon::Small ), d->text() ); 955 static_cast<Q3PopupMenu*>(w)->changeItem( itemId_, d->iconSet( KIcon::Small ), d->text() );
953 updateShortcut( static_cast<QPopupMenu*>(w), itemId_ ); 956 updateShortcut( static_cast<Q3PopupMenu*>(w), itemId_ );
954 } 957 }
955 else if ( w->inherits( "QMenuBar" ) ) 958 else if ( w->inherits( "QMenuBar" ) )
956 static_cast<QMenuBar*>(w)->changeItem( itemId( id ), d->iconSet( KIcon::Small ), d->text() ); 959 static_cast<QMenuBar*>(w)->changeItem( itemId( id ), d->iconSet( KIcon::Small ), d->text() );
957 else if ( w->inherits( "KToolBar" ) ) 960 else if ( w->inherits( "KToolBar" ) )
958 static_cast<KToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() ); 961 static_cast<KToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() );
959 else if ( w->inherits( "QToolBar" ) ) 962 else if ( w->inherits( "Q3ToolBar" ) )
960 { 963 {
961 qDebug("KAction::updateIcon has top be fixed"); 964 qDebug("KAction::updateIcon has top be fixed");
962//US static_cast<QToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() ); 965//US static_cast<QToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() );
963 } 966 }
964} 967}
965 968
966QString KAction::icon() const 969QString KAction::icon() const
967{ 970{
968 return d->iconName( ); 971 return d->iconName( );
969} 972}
970 973
971void KAction::setIconSet( const QIconSet &iconset ) 974void KAction::setIconSet( const QIcon &iconset )
972{ 975{
973 d->setIconSet( iconset ); 976 d->setIconSet( iconset );
974 977
975 int len = containerCount(); 978 int len = containerCount();
976 for( int i = 0; i < len; ++i ) 979 for( int i = 0; i < len; ++i )
977 updateIconSet( i ); 980 updateIconSet( i );
978} 981}
979 982
980 983
981void KAction::updateIconSet( int id ) 984void KAction::updateIconSet( int id )
982{ 985{
983 QWidget *w = container( id ); 986 QWidget *w = container( id );
984 987
985 if ( w->inherits( "QPopupMenu" ) ) 988 if ( w->inherits( "Q3PopupMenu" ) )
986 { 989 {
987 int itemId_ = itemId( id ); 990 int itemId_ = itemId( id );
988 static_cast<QPopupMenu*>(w)->changeItem( itemId_, d->iconSet(), d->text() ); 991 static_cast<Q3PopupMenu*>(w)->changeItem( itemId_, d->iconSet(), d->text() );
989 updateShortcut( static_cast<QPopupMenu*>(w), itemId_ ); 992 updateShortcut( static_cast<Q3PopupMenu*>(w), itemId_ );
990 } 993 }
991 else if ( w->inherits( "QMenuBar" ) ) 994 else if ( w->inherits( "QMenuBar" ) )
992 static_cast<QMenuBar*>(w)->changeItem( itemId( id ), d->iconSet(), d->text() ); 995 static_cast<QMenuBar*>(w)->changeItem( itemId( id ), d->iconSet(), d->text() );
993 else if ( w->inherits( "KToolBar" ) ) 996 else if ( w->inherits( "KToolBar" ) )
994 { 997 {
995 if ( icon().isEmpty() && d->hasIconSet() ) // only if there is no named icon ( scales better ) 998 if ( icon().isEmpty() && d->hasIconSet() ) // only if there is no named icon ( scales better )
996 static_cast<KToolBar *>(w)->setButtonIconSet( itemId( id ), d->iconSet() ); 999 static_cast<KToolBar *>(w)->setButtonIconSet( itemId( id ), d->iconSet() );
997 else 1000 else
998 static_cast<KToolBar *>(w)->setButtonIconSet( itemId( id ), d->iconSet( KIcon::Small ) ); 1001 static_cast<KToolBar *>(w)->setButtonIconSet( itemId( id ), d->iconSet( KIcon::Small ) );
999 } 1002 }
1000} 1003}
1001 1004
1002QIconSet KAction::iconSet( KIcon::Group group, int size ) const 1005QIcon KAction::iconSet( KIcon::Group group, int size ) const
1003{ 1006{
1004 return d->iconSet( group, size ); 1007 return d->iconSet( group, size );
1005} 1008}
1006 1009
1007bool KAction::hasIcon() const 1010bool KAction::hasIcon() const
1008{ 1011{
1009 return d->hasIcon(); 1012 return d->hasIcon();
1010} 1013}
1011 1014
1012 1015
1013void KAction::setWhatsThis( const QString& text ) 1016void KAction::setWhatsThis( const QString& text )
1014{ 1017{
1015 d->setWhatsThis( text ); 1018 d->setWhatsThis( text );
1016 1019
1017 int len = containerCount(); 1020 int len = containerCount();
1018 for( int i = 0; i < len; ++i ) 1021 for( int i = 0; i < len; ++i )
1019 updateWhatsThis( i ); 1022 updateWhatsThis( i );
1020} 1023}
1021 1024
1022void KAction::updateWhatsThis( int i ) 1025void KAction::updateWhatsThis( int i )
1023{ 1026{
1024 qDebug("KAction::updateWhatsThis ...1 has top be fixed"); 1027 qDebug("KAction::updateWhatsThis ...1 has top be fixed");
1025 QPopupMenu* pm = popupMenu( i ); 1028 Q3PopupMenu* pm = popupMenu( i );
1026 if ( pm ) 1029 if ( pm )
1027 { 1030 {
1028 pm->setWhatsThis( itemId( i ), d->whatsThis() ); 1031 pm->setWhatsThis( itemId( i ), d->whatsThis() );
1029 return; 1032 return;
1030 } 1033 }
1031 1034
1032 KToolBar *tb = toolBar( i ); 1035 KToolBar *tb = toolBar( i );
1033 if ( tb ) 1036 if ( tb )
1034 { 1037 {
1035 QWidget *w = tb->getButton( itemId( i ) ); 1038 QWidget *w = tb->getButton( itemId( i ) );
1036//US QWhatsThis::remove( w ); 1039//US QWhatsThis::remove( w );
1037//US QWhatsThis::add( w, d->whatsThis() ); 1040//US QWhatsThis::add( w, d->whatsThis() );
@@ -1055,28 +1058,28 @@ QString KAction::whatsThisWithIcon() const
1055QWidget* KAction::container( int index ) const 1058QWidget* KAction::container( int index ) const
1056{ 1059{
1057 assert( index < containerCount() ); 1060 assert( index < containerCount() );
1058 return d->m_containers[ index ].m_container; 1061 return d->m_containers[ index ].m_container;
1059} 1062}
1060 1063
1061KToolBar* KAction::toolBar( int index ) const 1064KToolBar* KAction::toolBar( int index ) const
1062{ 1065{
1063//US return dynamic_cast<KToolBar *>( d->m_containers[ index ].m_container ); 1066//US return dynamic_cast<KToolBar *>( d->m_containers[ index ].m_container );
1064 return (KToolBar *)( d->m_containers[ index ].m_container ); 1067 return (KToolBar *)( d->m_containers[ index ].m_container );
1065} 1068}
1066 1069
1067QPopupMenu* KAction::popupMenu( int index ) const 1070Q3PopupMenu* KAction::popupMenu( int index ) const
1068{ 1071{
1069//US return dynamic_cast<QPopupMenu *>( d->m_containers[ index ].m_container ); 1072//US return dynamic_cast<QPopupMenu *>( d->m_containers[ index ].m_container );
1070 return (QPopupMenu *)( d->m_containers[ index ].m_container ); 1073 return (Q3PopupMenu *)( d->m_containers[ index ].m_container );
1071} 1074}
1072 1075
1073QWidget* KAction::representative( int index ) const 1076QWidget* KAction::representative( int index ) const
1074{ 1077{
1075 return d->m_containers[ index ].m_representative; 1078 return d->m_containers[ index ].m_representative;
1076} 1079}
1077 1080
1078int KAction::itemId( int index ) const 1081int KAction::itemId( int index ) const
1079{ 1082{
1080 return d->m_containers[ index ].m_id; 1083 return d->m_containers[ index ].m_id;
1081} 1084}
1082 1085
@@ -1146,40 +1149,40 @@ void KAction::slotDestroyed()
1146 do 1149 do
1147 { 1150 {
1148 i = findContainer( static_cast<const QWidget*>( o ) ); 1151 i = findContainer( static_cast<const QWidget*>( o ) );
1149 if ( i != -1 ) 1152 if ( i != -1 )
1150 removeContainer( i ); 1153 removeContainer( i );
1151 } while ( i != -1 ); 1154 } while ( i != -1 );
1152 1155
1153} 1156}
1154 1157
1155int KAction::findContainer( const QWidget* widget ) const 1158int KAction::findContainer( const QWidget* widget ) const
1156{ 1159{
1157 int pos = 0; 1160 int pos = 0;
1158 QValueList<KActionPrivate::Container>::ConstIterator it = d->m_containers.begin(); 1161 Q3ValueList<KActionPrivate::Container>::ConstIterator it = d->m_containers.begin();
1159 while( it != d->m_containers.end() ) 1162 while( it != d->m_containers.end() )
1160 { 1163 {
1161 if ( (*it).m_representative == widget || (*it).m_container == widget ) 1164 if ( (*it).m_representative == widget || (*it).m_container == widget )
1162 return pos; 1165 return pos;
1163 ++it; 1166 ++it;
1164 ++pos; 1167 ++pos;
1165 } 1168 }
1166 1169
1167 return -1; 1170 return -1;
1168} 1171}
1169 1172
1170void KAction::removeContainer( int index ) 1173void KAction::removeContainer( int index )
1171{ 1174{
1172 int i = 0; 1175 int i = 0;
1173 QValueList<KActionPrivate::Container>::Iterator it = d->m_containers.begin(); 1176 Q3ValueList<KActionPrivate::Container>::Iterator it = d->m_containers.begin();
1174 while( it != d->m_containers.end() ) 1177 while( it != d->m_containers.end() )
1175 { 1178 {
1176 if ( i == index ) 1179 if ( i == index )
1177 { 1180 {
1178 d->m_containers.remove( it ); 1181 d->m_containers.remove( it );
1179 return; 1182 return;
1180 } 1183 }
1181 ++it; 1184 ++it;
1182 ++i; 1185 ++i;
1183 } 1186 }
1184} 1187}
1185 1188
diff --git a/microkde/kdeui/kaction.h b/microkde/kdeui/kaction.h
index 13e2e1e..5c690ec 100644
--- a/microkde/kdeui/kaction.h
+++ b/microkde/kdeui/kaction.h
@@ -20,39 +20,41 @@
20 along with this library; see the file COPYING.LIB. If not, write to 20 along with this library; see the file COPYING.LIB. If not, write to
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. 22 Boston, MA 02111-1307, USA.
23*/ 23*/
24//$Id$ 24//$Id$
25 25
26#ifndef __kaction_h__ 26#ifndef __kaction_h__
27#define __kaction_h__ 27#define __kaction_h__
28 28
29 29
30//US #include <qkeysequence.h> 30//US #include <qkeysequence.h>
31#include <qobject.h> 31#include <qobject.h>
32#include <qvaluelist.h> 32#include <q3valuelist.h>
33#include <qguardedptr.h> 33#include <qpointer.h>
34//Added by qt3to4:
35#include <Q3PopupMenu>
34#include <kguiitem.h> 36#include <kguiitem.h>
35#include <kshortcut.h> 37#include <kshortcut.h>
36#include <kstdaction.h> 38#include <kstdaction.h>
37//US#include <kicontheme.h> 39//US#include <kicontheme.h>
38 40
39//US added the following files 41//US added the following files
40#include <kiconloader.h> 42#include <kiconloader.h>
41 43
42class QMenuBar; 44class QMenuBar;
43class QPopupMenu; 45class Q3PopupMenu;
44//USclass QComboBox; 46//USclass QComboBox;
45//USclass QPoint; 47//USclass QPoint;
46class QIconSet; 48class QIcon;
47class QString; 49class QString;
48class KToolBar; 50class KToolBar;
49 51
50class KAccel; 52class KAccel;
51//USclass KAccelActions; 53//USclass KAccelActions;
52//USclass KConfig; 54//USclass KConfig;
53//USclass KConfigBase; 55//USclass KConfigBase;
54//USclass KURL; 56//USclass KURL;
55//USclass KInstance; 57//USclass KInstance;
56//USclass KToolBar; 58//USclass KToolBar;
57class KActionCollection; 59class KActionCollection;
58//USclass KPopupMenu; 60//USclass KPopupMenu;
@@ -250,25 +252,25 @@ public:
250 * This is the other common KAction used. Use it when you 252 * This is the other common KAction used. Use it when you
251 * @p do have a corresponding icon. 253 * @p do have a corresponding icon.
252 * 254 *
253 * @param text The text that will be displayed. 255 * @param text The text that will be displayed.
254 * @param pix The icon to display. 256 * @param pix The icon to display.
255 * @param cut The corresponding keyboard shortcut. 257 * @param cut The corresponding keyboard shortcut.
256 * @param receiver The SLOT's parent. 258 * @param receiver The SLOT's parent.
257 * @param slot The SLOT to invoke to execute this action. 259 * @param slot The SLOT to invoke to execute this action.
258 * @param parent This action's parent. 260 * @param parent This action's parent.
259 * @param name An internal name for this action. 261 * @param name An internal name for this action.
260 */ 262 */
261 263
262 KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, 264 KAction( const QString& text, const QIcon& pix, const KShortcut& cut,
263 const QObject* receiver, const char* slot, 265 const QObject* receiver, const char* slot,
264 KActionCollection* parent, const char* name ); 266 KActionCollection* parent, const char* name );
265 267
266 /** 268 /**
267 * Constructs an action with text, icon, potential keyboard 269 * Constructs an action with text, icon, potential keyboard
268 * shortcut, and a SLOT to call when this action is invoked by 270 * shortcut, and a SLOT to call when this action is invoked by
269 * the user. The icon is loaded on demand later based on where it 271 * the user. The icon is loaded on demand later based on where it
270 * is plugged in. 272 * is plugged in.
271 * 273 *
272 * If you do not want or have a keyboard shortcut, set the 274 * If you do not want or have a keyboard shortcut, set the
273 * @p cut param to 0. 275 * @p cut param to 0.
274 * 276 *
@@ -299,35 +301,35 @@ public:
299 /** 301 /**
300 * @obsolete 302 * @obsolete
301 */ 303 */
302 KAction( const QString& text, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); 304 KAction( const QString& text, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 );
303 /** 305 /**
304 * @obsolete 306 * @obsolete
305 */ 307 */
306 KAction( const QString& text, const KShortcut& cut, 308 KAction( const QString& text, const KShortcut& cut,
307 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); 309 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
308 /** 310 /**
309 * @obsolete 311 * @obsolete
310 */ 312 */
311 KAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), 313 KAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(),
312 QObject* parent = 0, const char* name = 0 ); 314 QObject* parent = 0, const char* name = 0 );
313 /** 315 /**
314 * @obsolete 316 * @obsolete
315 */ 317 */
316 KAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), 318 KAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(),
317 QObject* parent = 0, const char* name = 0 ); 319 QObject* parent = 0, const char* name = 0 );
318 /** 320 /**
319 * @obsolete 321 * @obsolete
320 */ 322 */
321 KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, 323 KAction( const QString& text, const QIcon& pix, const KShortcut& cut,
322 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); 324 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
323 /** 325 /**
324 * @obsolete 326 * @obsolete
325 */ 327 */
326 KAction( const QString& text, const QString& pix, const KShortcut& cut, 328 KAction( const QString& text, const QString& pix, const KShortcut& cut,
327 const QObject* receiver, const char* slot, QObject* parent, 329 const QObject* receiver, const char* slot, QObject* parent,
328 const char* name = 0 ); 330 const char* name = 0 );
329 /** 331 /**
330 * @obsolete 332 * @obsolete
331 */ 333 */
332 KAction( QObject* parent = 0, const char* name = 0 ); 334 KAction( QObject* parent = 0, const char* name = 0 );
333 335
@@ -452,28 +454,28 @@ public:
452 */ 454 */
453 virtual QString whatsThis() const; 455 virtual QString whatsThis() const;
454 456
455 /** 457 /**
456 * Get the tooltip text for the action. 458 * Get the tooltip text for the action.
457 */ 459 */
458 virtual QString toolTip() const; 460 virtual QString toolTip() const;
459 461
460 /** 462 /**
461 * Get the QIconSet from which the icons used to display this action will 463 * Get the QIconSet from which the icons used to display this action will
462 * be chosen. 464 * be chosen.
463 */ 465 */
464 virtual QIconSet iconSet( KIcon::Group group, int size=0 ) const; 466 virtual QIcon iconSet( KIcon::Group group, int size=0 ) const;
465 467
466#ifndef KDE_NO_COMPAT 468#ifndef KDE_NO_COMPAT
467 QIconSet iconSet() const 469 QIcon iconSet() const
468 { 470 {
469 return iconSet( KIcon::Small ); 471 return iconSet( KIcon::Small );
470 } 472 }
471#endif 473#endif
472 474
473 virtual QString icon() const; 475 virtual QString icon() const;
474 476
475 KActionCollection *parentCollection() const; 477 KActionCollection *parentCollection() const;
476 478
477 /** 479 /**
478 * @internal 480 * @internal
479 * Generate a toolbar button id. Made public for reimplementations. 481 * Generate a toolbar button id. Made public for reimplementations.
@@ -509,25 +511,25 @@ public slots:
509 /** 511 /**
510 * Sets the tooltip text for the action. 512 * Sets the tooltip text for the action.
511 * This will be used as a tooltip for a toolbar button, as a 513 * This will be used as a tooltip for a toolbar button, as a
512 * statusbar help-text for a menu item, and it also appears 514 * statusbar help-text for a menu item, and it also appears
513 * in the toolbar editor, to describe the action. 515 * in the toolbar editor, to describe the action.
514 */ 516 */
515 virtual void setToolTip( const QString& ); 517 virtual void setToolTip( const QString& );
516 518
517 /** 519 /**
518 * Sets the QIconSet from which the icons used to display this action will 520 * Sets the QIconSet from which the icons used to display this action will
519 * be chosen. 521 * be chosen.
520 */ 522 */
521 virtual void setIconSet( const QIconSet &iconSet ); 523 virtual void setIconSet( const QIcon &iconSet );
522 524
523 virtual void setIcon( const QString& icon ); 525 virtual void setIcon( const QString& icon );
524 526
525 /** 527 /**
526 * Enables or disables this action. All uses of this action (eg. in menus 528 * Enables or disables this action. All uses of this action (eg. in menus
527 * or toolbars) will be updated to reflect the state of the action. 529 * or toolbars) will be updated to reflect the state of the action.
528 */ 530 */
529 virtual void setEnabled(bool enable); 531 virtual void setEnabled(bool enable);
530 532
531 /** 533 /**
532 * Indicate whether the user may configure the action's shortcut. 534 * Indicate whether the user may configure the action's shortcut.
533 */ 535 */
@@ -537,34 +539,34 @@ public slots:
537 * Emulate user's interaction programmatically, by activating the action. 539 * Emulate user's interaction programmatically, by activating the action.
538 * The implementation simply emits activated(). 540 * The implementation simply emits activated().
539 */ 541 */
540 virtual void activate(); 542 virtual void activate();
541 543
542protected slots: 544protected slots:
543 virtual void slotDestroyed(); 545 virtual void slotDestroyed();
544 virtual void slotKeycodeChanged(); 546 virtual void slotKeycodeChanged();
545 virtual void slotActivated(); 547 virtual void slotActivated();
546 548
547protected: 549protected:
548 KToolBar* toolBar( int index ) const; 550 KToolBar* toolBar( int index ) const;
549 QPopupMenu* popupMenu( int index ) const; 551 Q3PopupMenu* popupMenu( int index ) const;
550 void removeContainer( int index ); 552 void removeContainer( int index );
551 int findContainer( const QWidget* widget ) const; 553 int findContainer( const QWidget* widget ) const;
552 void plugMainWindowAccel( QWidget *w ); 554 void plugMainWindowAccel( QWidget *w );
553 555
554 void addContainer( QWidget* parent, int id ); 556 void addContainer( QWidget* parent, int id );
555 void addContainer( QWidget* parent, QWidget* representative ); 557 void addContainer( QWidget* parent, QWidget* representative );
556 558
557 virtual void updateShortcut( int i ); 559 virtual void updateShortcut( int i );
558 virtual void updateShortcut( QPopupMenu* menu, int id ); 560 virtual void updateShortcut( Q3PopupMenu* menu, int id );
559 virtual void updateGroup( int id ); 561 virtual void updateGroup( int id );
560 virtual void updateText(int i ); 562 virtual void updateText(int i );
561 virtual void updateEnabled(int i); 563 virtual void updateEnabled(int i);
562 virtual void updateIconSet(int i); 564 virtual void updateIconSet(int i);
563 virtual void updateIcon( int i); 565 virtual void updateIcon( int i);
564 virtual void updateToolTip( int id ); 566 virtual void updateToolTip( int id );
565 virtual void updateWhatsThis( int i ); 567 virtual void updateWhatsThis( int i );
566 568
567 KActionCollection *m_parentCollection; 569 KActionCollection *m_parentCollection;
568 QString whatsThisWithIcon() const; 570 QString whatsThisWithIcon() const;
569 571
570signals: 572signals:
diff --git a/microkde/kdeui/kactionclasses.cpp b/microkde/kdeui/kactionclasses.cpp
index 82e6c8b..c611865 100644
--- a/microkde/kdeui/kactionclasses.cpp
+++ b/microkde/kdeui/kactionclasses.cpp
@@ -19,51 +19,53 @@
19 19
20 You should have received a copy of the GNU Library General Public License 20 You should have received a copy of the GNU Library General Public License
21 along with this library; see the file COPYING.LIB. If not, write to 21 along with this library; see the file COPYING.LIB. If not, write to
22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. 23 Boston, MA 02111-1307, USA.
24*/ 24*/
25 25
26#include "kactionclasses.h" 26#include "kactionclasses.h"
27 27
28#include <assert.h> 28#include <assert.h>
29 29
30#include <qfontdatabase.h> 30#include <qfontdatabase.h>
31#include <qobjectlist.h> 31#include <qobject.h>
32//US#include <qwhatsthis.h> 32//US#include <qwhatsthis.h>
33#include <qtimer.h> 33#include <qtimer.h>
34//Added by qt3to4:
35#include <Q3ValueList>
34 36
35//US#include <kaccel.h> 37//US#include <kaccel.h>
36//US#include <kapplication.h> 38//US#include <kapplication.h>
37#include <kconfig.h> 39#include <kconfig.h>
38#include <kdebug.h> 40#include <kdebug.h>
39//US#include <kfontcombo.h> 41//US#include <kfontcombo.h>
40//US#include <kmainwindow.h> 42//US#include <kmainwindow.h>
41//US#include <kmenubar.h> 43//US#include <kmenubar.h>
42//US#include <kpopupmenu.h> 44//US#include <kpopupmenu.h>
43#include <kcombobox.h> 45#include <kcombobox.h>
44#include <ktoolbar.h> 46#include <ktoolbar.h>
45#include <ktoolbarbutton.h> 47#include <ktoolbarbutton.h>
46#include <kurl.h> 48#include <kurl.h>
47 49
48//US added the following includefiles 50//US added the following includefiles
49#include <kconfigbase.h> 51#include <kconfigbase.h>
50#include <qwidget.h> 52#include <qwidget.h>
51#include <qpopupmenu.h> 53#include <q3popupmenu.h>
52#include <qmenubar.h> 54#include <qmenubar.h>
53#include <qmainwindow.h> 55#include <q3mainwindow.h>
54#include <qtoolbar.h> 56#include <q3toolbar.h>
55#include <qcombobox.h> 57#include <qcombobox.h>
56#include <qmainwindow.h> 58#include <q3mainwindow.h>
57 59#include <qcoreapplication.h>
58 60
59static QFontDatabase *fontDataBase = 0; 61static QFontDatabase *fontDataBase = 0;
60 62
61static void cleanupFontDatabase() 63static void cleanupFontDatabase()
62{ 64{
63 delete fontDataBase; 65 delete fontDataBase;
64 fontDataBase = 0; 66 fontDataBase = 0;
65} 67}
66 68
67static void get_fonts( QStringList &lst ) 69static void get_fonts( QStringList &lst )
68{ 70{
69 if ( !fontDataBase ) { 71 if ( !fontDataBase ) {
@@ -74,25 +76,25 @@ static void get_fonts( QStringList &lst )
74 QStringList families = fontDataBase->families(); 76 QStringList families = fontDataBase->families();
75 for ( QStringList::Iterator it = families.begin(); it != families.end(); ++it ) 77 for ( QStringList::Iterator it = families.begin(); it != families.end(); ++it )
76 { 78 {
77 QString family = *it; 79 QString family = *it;
78 if ( family. contains('-') ) // remove foundry 80 if ( family. contains('-') ) // remove foundry
79 family = family.right( family.length() - family.find('-' ) - 1); 81 family = family.right( family.length() - family.find('-' ) - 1);
80 if ( !lst.contains( family ) ) 82 if ( !lst.contains( family ) )
81 lst.append( family ); 83 lst.append( family );
82 } 84 }
83 lst.sort(); 85 lst.sort();
84} 86}
85 87
86static QValueList<int> get_standard_font_sizes() 88static Q3ValueList<int> get_standard_font_sizes()
87{ 89{
88 if ( !fontDataBase ) { 90 if ( !fontDataBase ) {
89 fontDataBase = new QFontDatabase(); 91 fontDataBase = new QFontDatabase();
90 qAddPostRoutine( cleanupFontDatabase ); 92 qAddPostRoutine( cleanupFontDatabase );
91 } 93 }
92 return fontDataBase->standardSizes(); 94 return fontDataBase->standardSizes();
93} 95}
94 96
95class KToggleAction::KToggleActionPrivate 97class KToggleAction::KToggleActionPrivate
96{ 98{
97public: 99public:
98 KToggleActionPrivate() 100 KToggleActionPrivate()
@@ -111,41 +113,41 @@ KToggleAction::KToggleAction( const QString& text, const KShortcut& cut,
111{ 113{
112 d = new KToggleActionPrivate; 114 d = new KToggleActionPrivate;
113} 115}
114 116
115KToggleAction::KToggleAction( const QString& text, const KShortcut& cut, 117KToggleAction::KToggleAction( const QString& text, const KShortcut& cut,
116 const QObject* receiver, const char* slot, 118 const QObject* receiver, const char* slot,
117 QObject* parent, const char* name ) 119 QObject* parent, const char* name )
118 : KAction( text, cut, receiver, slot, parent, name ) 120 : KAction( text, cut, receiver, slot, parent, name )
119{ 121{
120 d = new KToggleActionPrivate; 122 d = new KToggleActionPrivate;
121} 123}
122 124
123KToggleAction::KToggleAction( const QString& text, const QIconSet& pix, 125KToggleAction::KToggleAction( const QString& text, const QIcon& pix,
124 const KShortcut& cut, 126 const KShortcut& cut,
125 QObject* parent, const char* name ) 127 QObject* parent, const char* name )
126 : KAction( text, pix, cut, parent, name ) 128 : KAction( text, pix, cut, parent, name )
127{ 129{
128 d = new KToggleActionPrivate; 130 d = new KToggleActionPrivate;
129} 131}
130 132
131KToggleAction::KToggleAction( const QString& text, const QString& pix, 133KToggleAction::KToggleAction( const QString& text, const QString& pix,
132 const KShortcut& cut, 134 const KShortcut& cut,
133 QObject* parent, const char* name ) 135 QObject* parent, const char* name )
134 : KAction( text, pix, cut, parent, name ) 136 : KAction( text, pix, cut, parent, name )
135{ 137{
136 d = new KToggleActionPrivate; 138 d = new KToggleActionPrivate;
137} 139}
138 140
139KToggleAction::KToggleAction( const QString& text, const QIconSet& pix, 141KToggleAction::KToggleAction( const QString& text, const QIcon& pix,
140 const KShortcut& cut, 142 const KShortcut& cut,
141 const QObject* receiver, 143 const QObject* receiver,
142 const char* slot, QObject* parent, 144 const char* slot, QObject* parent,
143 const char* name ) 145 const char* name )
144 : KAction( text, pix, cut, receiver, slot, parent, name ) 146 : KAction( text, pix, cut, receiver, slot, parent, name )
145{ 147{
146 d = new KToggleActionPrivate; 148 d = new KToggleActionPrivate;
147} 149}
148 150
149KToggleAction::KToggleAction( const QString& text, const QString& pix, 151KToggleAction::KToggleAction( const QString& text, const QString& pix,
150 const KShortcut& cut, 152 const KShortcut& cut,
151 const QObject* receiver, 153 const QObject* receiver,
@@ -160,44 +162,44 @@ KToggleAction::KToggleAction( QObject* parent, const char* name )
160 : KAction( parent, name ) 162 : KAction( parent, name )
161{ 163{
162 d = new KToggleActionPrivate; 164 d = new KToggleActionPrivate;
163} 165}
164 166
165KToggleAction::~KToggleAction() 167KToggleAction::~KToggleAction()
166{ 168{
167 delete d; 169 delete d;
168} 170}
169 171
170int KToggleAction::plug( QWidget* widget, int index ) 172int KToggleAction::plug( QWidget* widget, int index )
171{ 173{
172 if ( !widget->inherits("QPopupMenu") && !widget->inherits("KToolBar") ) 174 if ( !widget->inherits("Q3PopupMenu") && !widget->inherits("KToolBar") )
173 { 175 {
174 kdWarning() << "Can not plug KToggleAction in " << widget->className() << endl; 176 kdWarning() << "Can not plug KToggleAction in " << widget->className() << endl;
175 return -1; 177 return -1;
176 } 178 }
177 179
178/*US 180/*US
179 if (kapp && !kapp->authorizeKAction(name())) 181 if (kapp && !kapp->authorizeKAction(name()))
180 return -1; 182 return -1;
181*/ 183*/
182 184
183 int _index = KAction::plug( widget, index ); 185 int _index = KAction::plug( widget, index );
184 if ( _index == -1 ) 186 if ( _index == -1 )
185 return _index; 187 return _index;
186 188
187 if ( widget->inherits("QPopupMenu") ) 189 if ( widget->inherits("Q3PopupMenu") )
188 { 190 {
189 int id = itemId( _index ); 191 int id = itemId( _index );
190 192
191 static_cast<QPopupMenu*>(widget)->setItemChecked( id, d->m_checked ); 193 static_cast<Q3PopupMenu*>(widget)->setItemChecked( id, d->m_checked );
192 } else if ( widget->inherits( "KToolBar" ) ) { 194 } else if ( widget->inherits( "KToolBar" ) ) {
193 195
194 KToolBar *bar = static_cast<KToolBar *>( widget ); 196 KToolBar *bar = static_cast<KToolBar *>( widget );
195 197
196 bar->setToggle( itemId( _index ), true ); 198 bar->setToggle( itemId( _index ), true );
197 bar->setButton( itemId( _index ), isChecked() ); 199 bar->setButton( itemId( _index ), isChecked() );
198 } 200 }
199 201
200 return _index; 202 return _index;
201} 203}
202 204
203void KToggleAction::setChecked( bool c ) 205void KToggleAction::setChecked( bool c )
@@ -205,47 +207,46 @@ void KToggleAction::setChecked( bool c )
205 if ( c == d->m_checked ) 207 if ( c == d->m_checked )
206 return; 208 return;
207 //kdDebug(129) << "KToggleAction::setChecked(" << c << ") " << this << " " << name() << endl; 209 //kdDebug(129) << "KToggleAction::setChecked(" << c << ") " << this << " " << name() << endl;
208 210
209 d->m_checked = c; 211 d->m_checked = c;
210 212
211 int len = containerCount(); 213 int len = containerCount();
212 214
213 for( int i = 0; i < len; ++i ) 215 for( int i = 0; i < len; ++i )
214 updateChecked( i ); 216 updateChecked( i );
215 217
216 if ( c && parent() && !exclusiveGroup().isEmpty() ) { 218 if ( c && parent() && !exclusiveGroup().isEmpty() ) {
217 const QObjectList *list = parent()->children(); 219 const QObjectList list = parent()->children();
218 if ( list ) { 220 if ( !list.empty() ) {
219 QObjectListIt it( *list ); 221 for(QObjectList::const_iterator it=list.begin();it!=list.end();++it) {
220 for( ; it.current(); ++it ) { 222 if ( (*it)->inherits( "KToggleAction" ) && (*it) != this &&
221 if ( it.current()->inherits( "KToggleAction" ) && it.current() != this && 223 static_cast<KToggleAction*>((*it))->exclusiveGroup() == exclusiveGroup() ) {
222 static_cast<KToggleAction*>(it.current())->exclusiveGroup() == exclusiveGroup() ) { 224 KToggleAction *a = static_cast<KToggleAction*>(*it);
223 KToggleAction *a = static_cast<KToggleAction*>(it.current());
224 if( a->isChecked() ) { 225 if( a->isChecked() ) {
225 a->setChecked( false ); 226 a->setChecked( false );
226 emit a->toggled( false ); 227 emit a->toggled( false );
227 } 228 }
228 } 229 }
229 } 230 }
230 } 231 }
231 } 232 }
232} 233}
233 234
234void KToggleAction::updateChecked( int id ) 235void KToggleAction::updateChecked( int id )
235{ 236{
236 QWidget *w = container( id ); 237 QWidget *w = container( id );
237 238
238 if ( w->inherits( "QPopupMenu" ) ) 239 if ( w->inherits( "Q3PopupMenu" ) )
239 static_cast<QPopupMenu*>(w)->setItemChecked( itemId( id ), d->m_checked ); 240 static_cast<Q3PopupMenu*>(w)->setItemChecked( itemId( id ), d->m_checked );
240 else if ( w->inherits( "QMenuBar" ) ) 241 else if ( w->inherits( "QMenuBar" ) )
241 static_cast<QMenuBar*>(w)->setItemChecked( itemId( id ), d->m_checked ); 242 static_cast<QMenuBar*>(w)->setItemChecked( itemId( id ), d->m_checked );
242 else if ( w->inherits( "KToolBar" ) ) 243 else if ( w->inherits( "KToolBar" ) )
243 { 244 {
244 QWidget* r = static_cast<KToolBar*>( w )->getButton( itemId( id ) ); 245 QWidget* r = static_cast<KToolBar*>( w )->getButton( itemId( id ) );
245 if ( r && r->inherits( "KToolBarButton" ) ) 246 if ( r && r->inherits( "KToolBarButton" ) )
246 static_cast<KToolBar*>( w )->setButton( itemId( id ), d->m_checked ); 247 static_cast<KToolBar*>( w )->setButton( itemId( id ), d->m_checked );
247 } 248 }
248} 249}
249 250
250void KToggleAction::slotActivated() 251void KToggleAction::slotActivated()
251{ 252{
@@ -274,39 +275,39 @@ KRadioAction::KRadioAction( const QString& text, const KShortcut& cut,
274 QObject* parent, const char* name ) 275 QObject* parent, const char* name )
275: KToggleAction( text, cut, parent, name ) 276: KToggleAction( text, cut, parent, name )
276{ 277{
277} 278}
278 279
279KRadioAction::KRadioAction( const QString& text, const KShortcut& cut, 280KRadioAction::KRadioAction( const QString& text, const KShortcut& cut,
280 const QObject* receiver, const char* slot, 281 const QObject* receiver, const char* slot,
281 QObject* parent, const char* name ) 282 QObject* parent, const char* name )
282: KToggleAction( text, cut, receiver, slot, parent, name ) 283: KToggleAction( text, cut, receiver, slot, parent, name )
283{ 284{
284} 285}
285 286
286KRadioAction::KRadioAction( const QString& text, const QIconSet& pix, 287KRadioAction::KRadioAction( const QString& text, const QIcon& pix,
287 const KShortcut& cut, 288 const KShortcut& cut,
288 QObject* parent, const char* name ) 289 QObject* parent, const char* name )
289: KToggleAction( text, pix, cut, parent, name ) 290: KToggleAction( text, pix, cut, parent, name )
290{ 291{
291} 292}
292 293
293KRadioAction::KRadioAction( const QString& text, const QString& pix, 294KRadioAction::KRadioAction( const QString& text, const QString& pix,
294 const KShortcut& cut, 295 const KShortcut& cut,
295 QObject* parent, const char* name ) 296 QObject* parent, const char* name )
296: KToggleAction( text, pix, cut, parent, name ) 297: KToggleAction( text, pix, cut, parent, name )
297{ 298{
298} 299}
299 300
300KRadioAction::KRadioAction( const QString& text, const QIconSet& pix, 301KRadioAction::KRadioAction( const QString& text, const QIcon& pix,
301 const KShortcut& cut, 302 const KShortcut& cut,
302 const QObject* receiver, const char* slot, 303 const QObject* receiver, const char* slot,
303 QObject* parent, const char* name ) 304 QObject* parent, const char* name )
304: KToggleAction( text, pix, cut, receiver, slot, parent, name ) 305: KToggleAction( text, pix, cut, receiver, slot, parent, name )
305{ 306{
306} 307}
307 308
308KRadioAction::KRadioAction( const QString& text, const QString& pix, 309KRadioAction::KRadioAction( const QString& text, const QString& pix,
309 const KShortcut& cut, 310 const KShortcut& cut,
310 const QObject* receiver, const char* slot, 311 const QObject* receiver, const char* slot,
311 QObject* parent, const char* name ) 312 QObject* parent, const char* name )
312: KToggleAction( text, pix, cut, receiver, slot, parent, name ) 313: KToggleAction( text, pix, cut, receiver, slot, parent, name )
@@ -340,25 +341,25 @@ class KSelectAction::KSelectActionPrivate
340{ 341{
341public: 342public:
342 KSelectActionPrivate() 343 KSelectActionPrivate()
343 { 344 {
344 m_edit = false; 345 m_edit = false;
345 m_menuAccelsEnabled = true; 346 m_menuAccelsEnabled = true;
346 m_menu = 0; 347 m_menu = 0;
347 m_current = -1; 348 m_current = -1;
348 m_comboWidth = -1; 349 m_comboWidth = -1;
349 } 350 }
350 bool m_edit; 351 bool m_edit;
351 bool m_menuAccelsEnabled; 352 bool m_menuAccelsEnabled;
352 QPopupMenu *m_menu; 353 Q3PopupMenu *m_menu;
353 int m_current; 354 int m_current;
354 int m_comboWidth; 355 int m_comboWidth;
355 QStringList m_list; 356 QStringList m_list;
356 357
357 QString makeMenuText( const QString &_text ) 358 QString makeMenuText( const QString &_text )
358 { 359 {
359 if ( m_menuAccelsEnabled ) 360 if ( m_menuAccelsEnabled )
360 return _text; 361 return _text;
361 QString text = _text; 362 QString text = _text;
362 uint i = 0; 363 uint i = 0;
363 while ( i < text.length() ) { 364 while ( i < text.length() ) {
364 if ( text.at( i ) == '&' ) { 365 if ( text.at( i ) == '&' ) {
@@ -378,41 +379,41 @@ KSelectAction::KSelectAction( const QString& text, const KShortcut& cut,
378{ 379{
379 d = new KSelectActionPrivate; 380 d = new KSelectActionPrivate;
380} 381}
381 382
382KSelectAction::KSelectAction( const QString& text, const KShortcut& cut, 383KSelectAction::KSelectAction( const QString& text, const KShortcut& cut,
383 const QObject* receiver, const char* slot, 384 const QObject* receiver, const char* slot,
384 QObject* parent, const char* name ) 385 QObject* parent, const char* name )
385 : KAction( text, cut, receiver, slot, parent, name ) 386 : KAction( text, cut, receiver, slot, parent, name )
386{ 387{
387 d = new KSelectActionPrivate; 388 d = new KSelectActionPrivate;
388} 389}
389 390
390KSelectAction::KSelectAction( const QString& text, const QIconSet& pix, 391KSelectAction::KSelectAction( const QString& text, const QIcon& pix,
391 const KShortcut& cut, 392 const KShortcut& cut,
392 QObject* parent, const char* name ) 393 QObject* parent, const char* name )
393 : KAction( text, pix, cut, parent, name ) 394 : KAction( text, pix, cut, parent, name )
394{ 395{
395 d = new KSelectActionPrivate; 396 d = new KSelectActionPrivate;
396} 397}
397 398
398KSelectAction::KSelectAction( const QString& text, const QString& pix, 399KSelectAction::KSelectAction( const QString& text, const QString& pix,
399 const KShortcut& cut, 400 const KShortcut& cut,
400 QObject* parent, const char* name ) 401 QObject* parent, const char* name )
401 : KAction( text, pix, cut, parent, name ) 402 : KAction( text, pix, cut, parent, name )
402{ 403{
403 d = new KSelectActionPrivate; 404 d = new KSelectActionPrivate;
404} 405}
405 406
406KSelectAction::KSelectAction( const QString& text, const QIconSet& pix, 407KSelectAction::KSelectAction( const QString& text, const QIcon& pix,
407 const KShortcut& cut, 408 const KShortcut& cut,
408 const QObject* receiver, 409 const QObject* receiver,
409 const char* slot, QObject* parent, 410 const char* slot, QObject* parent,
410 const char* name ) 411 const char* name )
411 : KAction( text, pix, cut, receiver, slot, parent, name ) 412 : KAction( text, pix, cut, receiver, slot, parent, name )
412{ 413{
413 d = new KSelectActionPrivate; 414 d = new KSelectActionPrivate;
414} 415}
415 416
416KSelectAction::KSelectAction( const QString& text, const QString& pix, 417KSelectAction::KSelectAction( const QString& text, const QString& pix,
417 const KShortcut& cut, 418 const KShortcut& cut,
418 const QObject* receiver, 419 const QObject* receiver,
@@ -430,25 +431,25 @@ KSelectAction::KSelectAction( QObject* parent, const char* name )
430} 431}
431 432
432KSelectAction::~KSelectAction() 433KSelectAction::~KSelectAction()
433{ 434{
434 assert(d); 435 assert(d);
435 delete d->m_menu; 436 delete d->m_menu;
436 delete d; d = 0; 437 delete d; d = 0;
437} 438}
438 439
439void KSelectAction::setCurrentItem( int id ) 440void KSelectAction::setCurrentItem( int id )
440{ 441{
441 if ( id >= (int)d->m_list.count() ) { 442 if ( id >= (int)d->m_list.count() ) {
442 ASSERT(id < (int)d->m_list.count()); 443 Q_ASSERT(id < (int)d->m_list.count());
443 return; 444 return;
444 } 445 }
445 446
446 if ( d->m_menu ) 447 if ( d->m_menu )
447 { 448 {
448 if ( d->m_current >= 0 ) 449 if ( d->m_current >= 0 )
449 d->m_menu->setItemChecked( d->m_current, false ); 450 d->m_menu->setItemChecked( d->m_current, false );
450 if ( id >= 0 ) 451 if ( id >= 0 )
451 { 452 {
452 //US qDebug("KSelectAction::setCurrentItem %i", id); 453 //US qDebug("KSelectAction::setCurrentItem %i", id);
453 d->m_menu->setItemChecked( id, true ); 454 d->m_menu->setItemChecked( id, true );
454 } 455 }
@@ -470,31 +471,31 @@ void KSelectAction::setComboWidth( int width )
470{ 471{
471 if ( width < 0 ) 472 if ( width < 0 )
472 return; 473 return;
473 474
474 d->m_comboWidth=width; 475 d->m_comboWidth=width;
475 476
476 int len = containerCount(); 477 int len = containerCount();
477 478
478 for( int i = 0; i < len; ++i ) 479 for( int i = 0; i < len; ++i )
479 updateComboWidth( i ); 480 updateComboWidth( i );
480 481
481} 482}
482QPopupMenu* KSelectAction::popupMenu() const 483Q3PopupMenu* KSelectAction::popupMenu() const
483{ 484{
484 kdDebug(129) << "KSelectAction::popupMenu()" << endl; // remove -- ellis 485 kdDebug(129) << "KSelectAction::popupMenu()" << endl; // remove -- ellis
485 if ( !d->m_menu ) 486 if ( !d->m_menu )
486 { 487 {
487//US d->m_menu = new KPopupMenu(0L, "KSelectAction::popupMenu()"); 488//US d->m_menu = new KPopupMenu(0L, "KSelectAction::popupMenu()");
488 d->m_menu = new QPopupMenu(0L, "QSelectAction::popupMenu()"); 489 d->m_menu = new Q3PopupMenu(0L, "QSelectAction::popupMenu()");
489 setupMenu(); 490 setupMenu();
490 if ( d->m_current >= 0 ) 491 if ( d->m_current >= 0 )
491 d->m_menu->setItemChecked( d->m_current, true ); 492 d->m_menu->setItemChecked( d->m_current, true );
492 } 493 }
493 494
494 return d->m_menu; 495 return d->m_menu;
495} 496}
496 497
497void KSelectAction::setupMenu() const 498void KSelectAction::setupMenu() const
498{ 499{
499 if ( !d->m_menu ) 500 if ( !d->m_menu )
500 return; 501 return;
@@ -634,30 +635,30 @@ void KSelectAction::updateItems( int id )
634 cb->setMinimumWidth( cb->sizeHint().width() ); 635 cb->setMinimumWidth( cb->sizeHint().width() );
635 } 636 }
636 } 637 }
637 638
638} 639}
639 640
640int KSelectAction::plug( QWidget *widget, int index ) 641int KSelectAction::plug( QWidget *widget, int index )
641{ 642{
642//US if (kapp && !kapp->authorizeKAction(name())) 643//US if (kapp && !kapp->authorizeKAction(name()))
643//US return -1; 644//US return -1;
644 645
645 kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis 646 kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis
646 if ( widget->inherits("QPopupMenu") ) 647 if ( widget->inherits("Q3PopupMenu") )
647 { 648 {
648 // Create the PopupMenu and store it in m_menu 649 // Create the PopupMenu and store it in m_menu
649 (void)popupMenu(); 650 (void)popupMenu();
650 651
651 QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); 652 Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget );
652 int id; 653 int id;
653 654
654 if ( hasIconSet() ) 655 if ( hasIconSet() )
655 id = menu->insertItem( iconSet(), text(), d->m_menu, -1, index ); 656 id = menu->insertItem( iconSet(), text(), d->m_menu, -1, index );
656 else 657 else
657 id = menu->insertItem( text(), d->m_menu, -1, index ); 658 id = menu->insertItem( text(), d->m_menu, -1, index );
658 659
659 if ( !isEnabled() ) 660 if ( !isEnabled() )
660 menu->setItemEnabled( id, false ); 661 menu->setItemEnabled( id, false );
661 662
662 QString wth = whatsThis(); 663 QString wth = whatsThis();
663 if ( !wth.isEmpty() ) 664 if ( !wth.isEmpty() )
@@ -673,25 +674,25 @@ int KSelectAction::plug( QWidget *widget, int index )
673 674
674 KToolBar* bar = static_cast<KToolBar*>( widget ); 675 KToolBar* bar = static_cast<KToolBar*>( widget );
675 int id_ = KAction::getToolButtonID(); 676 int id_ = KAction::getToolButtonID();
676 bar->insertCombo( comboItems(), id_, isEditable(), 677 bar->insertCombo( comboItems(), id_, isEditable(),
677 SIGNAL( activated( const QString & ) ), this, 678 SIGNAL( activated( const QString & ) ), this,
678 SLOT( slotActivated( const QString & ) ), isEnabled(), 679 SLOT( slotActivated( const QString & ) ), isEnabled(),
679 toolTip(), -1, index ); 680 toolTip(), -1, index );
680 681
681 KComboBox *cb = bar->getCombo( id_ ); 682 KComboBox *cb = bar->getCombo( id_ );
682 if ( cb ) 683 if ( cb )
683 { 684 {
684 cb->setMaximumHeight( 34 ); 685 cb->setMaximumHeight( 34 );
685 if (!isEditable()) cb->setFocusPolicy(QWidget::NoFocus); 686 if (!isEditable()) cb->setFocusPolicy(Qt::NoFocus);
686 cb->setMinimumWidth( cb->sizeHint().width() ); 687 cb->setMinimumWidth( cb->sizeHint().width() );
687 if ( d->m_comboWidth > 0 ) 688 if ( d->m_comboWidth > 0 )
688 { 689 {
689 cb->setMinimumWidth( d->m_comboWidth ); 690 cb->setMinimumWidth( d->m_comboWidth );
690 cb->setMaximumWidth( d->m_comboWidth ); 691 cb->setMaximumWidth( d->m_comboWidth );
691 } 692 }
692 cb->setInsertionPolicy( QComboBox::NoInsertion ); 693 cb->setInsertionPolicy( QComboBox::NoInsertion );
693//US QWhatsThis::add( cb, whatsThis() ); 694//US QWhatsThis::add( cb, whatsThis() );
694 } 695 }
695 696
696 addContainer( bar, id_ ); 697 addContainer( bar, id_ );
697 698
@@ -843,41 +844,41 @@ KListAction::KListAction( const QString& text, const KShortcut& cut,
843} 844}
844 845
845KListAction::KListAction( const QString& text, const KShortcut& cut, 846KListAction::KListAction( const QString& text, const KShortcut& cut,
846 const QObject* receiver, const char* slot, 847 const QObject* receiver, const char* slot,
847 QObject* parent, const char* name ) 848 QObject* parent, const char* name )
848 : KSelectAction( text, cut, parent, name ) 849 : KSelectAction( text, cut, parent, name )
849{ 850{
850 d = new KListActionPrivate; 851 d = new KListActionPrivate;
851 if ( receiver ) 852 if ( receiver )
852 connect( this, SIGNAL( activated( int ) ), receiver, slot ); 853 connect( this, SIGNAL( activated( int ) ), receiver, slot );
853} 854}
854 855
855KListAction::KListAction( const QString& text, const QIconSet& pix, 856KListAction::KListAction( const QString& text, const QIcon& pix,
856 const KShortcut& cut, 857 const KShortcut& cut,
857 QObject* parent, const char* name ) 858 QObject* parent, const char* name )
858 : KSelectAction( text, pix, cut, parent, name ) 859 : KSelectAction( text, pix, cut, parent, name )
859{ 860{
860 d = new KListActionPrivate; 861 d = new KListActionPrivate;
861} 862}
862 863
863KListAction::KListAction( const QString& text, const QString& pix, 864KListAction::KListAction( const QString& text, const QString& pix,
864 const KShortcut& cut, 865 const KShortcut& cut,
865 QObject* parent, const char* name ) 866 QObject* parent, const char* name )
866 : KSelectAction( text, pix, cut, parent, name ) 867 : KSelectAction( text, pix, cut, parent, name )
867{ 868{
868 d = new KListActionPrivate; 869 d = new KListActionPrivate;
869} 870}
870 871
871KListAction::KListAction( const QString& text, const QIconSet& pix, 872KListAction::KListAction( const QString& text, const QIcon& pix,
872 const KShortcut& cut, const QObject* receiver, 873 const KShortcut& cut, const QObject* receiver,
873 const char* slot, QObject* parent, 874 const char* slot, QObject* parent,
874 const char* name ) 875 const char* name )
875 : KSelectAction( text, pix, cut, parent, name ) 876 : KSelectAction( text, pix, cut, parent, name )
876{ 877{
877 d = new KListActionPrivate; 878 d = new KListActionPrivate;
878 if ( receiver ) 879 if ( receiver )
879 connect( this, SIGNAL( activated( int ) ), receiver, slot ); 880 connect( this, SIGNAL( activated( int ) ), receiver, slot );
880} 881}
881 882
882KListAction::KListAction( const QString& text, const QString& pix, 883KListAction::KListAction( const QString& text, const QString& pix,
883 const KShortcut& cut, const QObject* receiver, 884 const KShortcut& cut, const QObject* receiver,
@@ -956,25 +957,25 @@ KRecentFilesAction::KRecentFilesAction( const QString& text,
956{ 957{
957 d = new KRecentFilesActionPrivate; 958 d = new KRecentFilesActionPrivate;
958 d->m_maxItems = maxItems; 959 d->m_maxItems = maxItems;
959 960
960 init(); 961 init();
961 962
962 if ( receiver ) 963 if ( receiver )
963 connect( this, SIGNAL(urlSelected(const KURL&)), 964 connect( this, SIGNAL(urlSelected(const KURL&)),
964 receiver, slot ); 965 receiver, slot );
965} 966}
966 967
967KRecentFilesAction::KRecentFilesAction( const QString& text, 968KRecentFilesAction::KRecentFilesAction( const QString& text,
968 const QIconSet& pix, 969 const QIcon& pix,
969 const KShortcut& cut, 970 const KShortcut& cut,
970 QObject* parent, const char* name, 971 QObject* parent, const char* name,
971 uint maxItems ) 972 uint maxItems )
972 : KListAction( text, pix, cut, parent, name) 973 : KListAction( text, pix, cut, parent, name)
973{ 974{
974 d = new KRecentFilesActionPrivate; 975 d = new KRecentFilesActionPrivate;
975 d->m_maxItems = maxItems; 976 d->m_maxItems = maxItems;
976 977
977 init(); 978 init();
978} 979}
979 980
980KRecentFilesAction::KRecentFilesAction( const QString& text, 981KRecentFilesAction::KRecentFilesAction( const QString& text,
@@ -982,25 +983,25 @@ KRecentFilesAction::KRecentFilesAction( const QString& text,
982 const KShortcut& cut, 983 const KShortcut& cut,
983 QObject* parent, const char* name, 984 QObject* parent, const char* name,
984 uint maxItems ) 985 uint maxItems )
985 : KListAction( text, pix, cut, parent, name) 986 : KListAction( text, pix, cut, parent, name)
986{ 987{
987 d = new KRecentFilesActionPrivate; 988 d = new KRecentFilesActionPrivate;
988 d->m_maxItems = maxItems; 989 d->m_maxItems = maxItems;
989 990
990 init(); 991 init();
991} 992}
992 993
993KRecentFilesAction::KRecentFilesAction( const QString& text, 994KRecentFilesAction::KRecentFilesAction( const QString& text,
994 const QIconSet& pix, 995 const QIcon& pix,
995 const KShortcut& cut, 996 const KShortcut& cut,
996 const QObject* receiver, 997 const QObject* receiver,
997 const char* slot, 998 const char* slot,
998 QObject* parent, const char* name, 999 QObject* parent, const char* name,
999 uint maxItems ) 1000 uint maxItems )
1000 : KListAction( text, pix, cut, parent, name) 1001 : KListAction( text, pix, cut, parent, name)
1001{ 1002{
1002 d = new KRecentFilesActionPrivate; 1003 d = new KRecentFilesActionPrivate;
1003 d->m_maxItems = maxItems; 1004 d->m_maxItems = maxItems;
1004 1005
1005 init(); 1006 init();
1006 1007
@@ -1192,47 +1193,47 @@ KFontAction::KFontAction( const QString& text,
1192 1193
1193KFontAction::KFontAction( const QString& text, const KShortcut& cut, 1194KFontAction::KFontAction( const QString& text, const KShortcut& cut,
1194 const QObject* receiver, const char* slot, 1195 const QObject* receiver, const char* slot,
1195 QObject* parent, const char* name ) 1196 QObject* parent, const char* name )
1196 : KSelectAction( text, cut, receiver, slot, parent, name ) 1197 : KSelectAction( text, cut, receiver, slot, parent, name )
1197{ 1198{
1198 d = new KFontActionPrivate; 1199 d = new KFontActionPrivate;
1199 get_fonts( d->m_fonts ); 1200 get_fonts( d->m_fonts );
1200 KSelectAction::setItems( d->m_fonts ); 1201 KSelectAction::setItems( d->m_fonts );
1201 setEditable( true ); 1202 setEditable( true );
1202} 1203}
1203 1204
1204KFontAction::KFontAction( const QString& text, const QIconSet& pix, 1205KFontAction::KFontAction( const QString& text, const QIcon& pix,
1205 const KShortcut& cut, 1206 const KShortcut& cut,
1206 QObject* parent, const char* name ) 1207 QObject* parent, const char* name )
1207 : KSelectAction( text, pix, cut, parent, name ) 1208 : KSelectAction( text, pix, cut, parent, name )
1208{ 1209{
1209 d = new KFontActionPrivate; 1210 d = new KFontActionPrivate;
1210 get_fonts( d->m_fonts ); 1211 get_fonts( d->m_fonts );
1211 KSelectAction::setItems( d->m_fonts ); 1212 KSelectAction::setItems( d->m_fonts );
1212 setEditable( true ); 1213 setEditable( true );
1213} 1214}
1214 1215
1215KFontAction::KFontAction( const QString& text, const QString& pix, 1216KFontAction::KFontAction( const QString& text, const QString& pix,
1216 const KShortcut& cut, 1217 const KShortcut& cut,
1217 QObject* parent, const char* name ) 1218 QObject* parent, const char* name )
1218 : KSelectAction( text, pix, cut, parent, name ) 1219 : KSelectAction( text, pix, cut, parent, name )
1219{ 1220{
1220 d = new KFontActionPrivate; 1221 d = new KFontActionPrivate;
1221 get_fonts( d->m_fonts ); 1222 get_fonts( d->m_fonts );
1222 KSelectAction::setItems( d->m_fonts ); 1223 KSelectAction::setItems( d->m_fonts );
1223 setEditable( true ); 1224 setEditable( true );
1224} 1225}
1225 1226
1226KFontAction::KFontAction( const QString& text, const QIconSet& pix, 1227KFontAction::KFontAction( const QString& text, const QIcon& pix,
1227 const KShortcut& cut, 1228 const KShortcut& cut,
1228 const QObject* receiver, const char* slot, 1229 const QObject* receiver, const char* slot,
1229 QObject* parent, const char* name ) 1230 QObject* parent, const char* name )
1230 : KSelectAction( text, pix, cut, receiver, slot, parent, name ) 1231 : KSelectAction( text, pix, cut, receiver, slot, parent, name )
1231{ 1232{
1232 d = new KFontActionPrivate; 1233 d = new KFontActionPrivate;
1233 get_fonts( d->m_fonts ); 1234 get_fonts( d->m_fonts );
1234 KSelectAction::setItems( d->m_fonts ); 1235 KSelectAction::setItems( d->m_fonts );
1235 setEditable( true ); 1236 setEditable( true );
1236} 1237}
1237 1238
1238KFontAction::KFontAction( const QString& text, const QString& pix, 1239KFontAction::KFontAction( const QString& text, const QString& pix,
@@ -1352,41 +1353,41 @@ KFontSizeAction::KFontSizeAction( const QString& text,
1352 init(); 1353 init();
1353} 1354}
1354 1355
1355KFontSizeAction::KFontSizeAction( const QString& text, 1356KFontSizeAction::KFontSizeAction( const QString& text,
1356 const KShortcut& cut, 1357 const KShortcut& cut,
1357 const QObject* receiver, const char* slot, 1358 const QObject* receiver, const char* slot,
1358 QObject* parent, const char* name ) 1359 QObject* parent, const char* name )
1359 : KSelectAction( text, cut, receiver, slot, parent, name ) 1360 : KSelectAction( text, cut, receiver, slot, parent, name )
1360{ 1361{
1361 init(); 1362 init();
1362} 1363}
1363 1364
1364KFontSizeAction::KFontSizeAction( const QString& text, const QIconSet& pix, 1365KFontSizeAction::KFontSizeAction( const QString& text, const QIcon& pix,
1365 const KShortcut& cut, 1366 const KShortcut& cut,
1366 QObject* parent, const char* name ) 1367 QObject* parent, const char* name )
1367 : KSelectAction( text, pix, cut, parent, name ) 1368 : KSelectAction( text, pix, cut, parent, name )
1368{ 1369{
1369 init(); 1370 init();
1370} 1371}
1371 1372
1372KFontSizeAction::KFontSizeAction( const QString& text, const QString& pix, 1373KFontSizeAction::KFontSizeAction( const QString& text, const QString& pix,
1373 const KShortcut& cut, 1374 const KShortcut& cut,
1374 QObject* parent, const char* name ) 1375 QObject* parent, const char* name )
1375 : KSelectAction( text, pix, cut, parent, name ) 1376 : KSelectAction( text, pix, cut, parent, name )
1376{ 1377{
1377 init(); 1378 init();
1378} 1379}
1379 1380
1380KFontSizeAction::KFontSizeAction( const QString& text, const QIconSet& pix, 1381KFontSizeAction::KFontSizeAction( const QString& text, const QIcon& pix,
1381 const KShortcut& cut, 1382 const KShortcut& cut,
1382 const QObject* receiver, 1383 const QObject* receiver,
1383 const char* slot, QObject* parent, 1384 const char* slot, QObject* parent,
1384 const char* name ) 1385 const char* name )
1385 : KSelectAction( text, pix, cut, receiver, slot, parent, name ) 1386 : KSelectAction( text, pix, cut, receiver, slot, parent, name )
1386{ 1387{
1387 init(); 1388 init();
1388} 1389}
1389 1390
1390KFontSizeAction::KFontSizeAction( const QString& text, const QString& pix, 1391KFontSizeAction::KFontSizeAction( const QString& text, const QString& pix,
1391 const KShortcut& cut, 1392 const KShortcut& cut,
1392 const QObject* receiver, 1393 const QObject* receiver,
@@ -1405,61 +1406,61 @@ KFontSizeAction::KFontSizeAction( QObject* parent, const char* name )
1405 1406
1406KFontSizeAction::~KFontSizeAction() 1407KFontSizeAction::~KFontSizeAction()
1407{ 1408{
1408 delete d; 1409 delete d;
1409 d = 0; 1410 d = 0;
1410} 1411}
1411 1412
1412void KFontSizeAction::init() 1413void KFontSizeAction::init()
1413{ 1414{
1414 d = new KFontSizeActionPrivate; 1415 d = new KFontSizeActionPrivate;
1415 1416
1416 setEditable( true ); 1417 setEditable( true );
1417 QValueList<int> sizes = get_standard_font_sizes(); 1418 Q3ValueList<int> sizes = get_standard_font_sizes();
1418 QStringList lst; 1419 QStringList lst;
1419 for ( QValueList<int>::Iterator it = sizes.begin(); it != sizes.end(); ++it ) 1420 for ( Q3ValueList<int>::Iterator it = sizes.begin(); it != sizes.end(); ++it )
1420 lst.append( QString::number( *it ) ); 1421 lst.append( QString::number( *it ) );
1421 1422
1422 setItems( lst ); 1423 setItems( lst );
1423} 1424}
1424 1425
1425void KFontSizeAction::setFontSize( int size ) 1426void KFontSizeAction::setFontSize( int size )
1426{ 1427{
1427 if ( size == fontSize() ) { 1428 if ( size == fontSize() ) {
1428 setCurrentItem( items().findIndex( QString::number( size ) ) ); 1429 setCurrentItem( items().findIndex( QString::number( size ) ) );
1429 return; 1430 return;
1430 } 1431 }
1431 1432
1432 if ( size < 1 ) { 1433 if ( size < 1 ) {
1433 kdWarning() << "KFontSizeAction: Size " << size << " is out of range" << endl; 1434 kdWarning() << "KFontSizeAction: Size " << size << " is out of range" << endl;
1434 return; 1435 return;
1435 } 1436 }
1436 1437
1437 int index = items().findIndex( QString::number( size ) ); 1438 int index = items().findIndex( QString::number( size ) );
1438 if ( index == -1 ) { 1439 if ( index == -1 ) {
1439 // Insert at the correct position in the list (to keep sorting) 1440 // Insert at the correct position in the list (to keep sorting)
1440 QValueList<int> lst; 1441 Q3ValueList<int> lst;
1441 // Convert to list of ints 1442 // Convert to list of ints
1442 QStringList itemsList = items(); 1443 QStringList itemsList = items();
1443 for (QStringList::Iterator it = itemsList.begin() ; it != itemsList.end() ; ++it) 1444 for (QStringList::Iterator it = itemsList.begin() ; it != itemsList.end() ; ++it)
1444 lst.append( (*it).toInt() ); 1445 lst.append( (*it).toInt() );
1445 // New size 1446 // New size
1446 lst.append( size ); 1447 lst.append( size );
1447 // Sort the list 1448 // Sort the list
1448qDebug("KFontSizeAction::setFontSize heapsort not found."); 1449qDebug("KFontSizeAction::setFontSize heapsort not found.");
1449//US has to be fixed 1450//US has to be fixed
1450//US qHeapSort( lst ); 1451//US qHeapSort( lst );
1451 // Convert back to string list 1452 // Convert back to string list
1452 QStringList strLst; 1453 QStringList strLst;
1453 for (QValueList<int>::Iterator it = lst.begin() ; it != lst.end() ; ++it) 1454 for (Q3ValueList<int>::Iterator it = lst.begin() ; it != lst.end() ; ++it)
1454 strLst.append( QString::number(*it) ); 1455 strLst.append( QString::number(*it) );
1455 KSelectAction::setItems( strLst ); 1456 KSelectAction::setItems( strLst );
1456 // Find new current item 1457 // Find new current item
1457 index = lst.findIndex( size ); 1458 index = lst.findIndex( size );
1458 setCurrentItem( index ); 1459 setCurrentItem( index );
1459 } 1460 }
1460 else 1461 else
1461 setCurrentItem( index ); 1462 setCurrentItem( index );
1462 1463
1463 1464
1464 //emit KAction::activated(); 1465 //emit KAction::activated();
1465 //emit activated( index ); 1466 //emit activated( index );
@@ -1483,55 +1484,55 @@ void KFontSizeAction::slotActivated( const QString& size )
1483{ 1484{
1484 setFontSize( size.toInt() ); // insert sorted first 1485 setFontSize( size.toInt() ); // insert sorted first
1485 KSelectAction::slotActivated( size ); 1486 KSelectAction::slotActivated( size );
1486 emit fontSizeChanged( size.toInt() ); 1487 emit fontSizeChanged( size.toInt() );
1487} 1488}
1488 1489
1489class KActionMenu::KActionMenuPrivate 1490class KActionMenu::KActionMenuPrivate
1490{ 1491{
1491public: 1492public:
1492 KActionMenuPrivate() 1493 KActionMenuPrivate()
1493 { 1494 {
1494//US m_popup = new KPopupMenu(0L,"KActionMenu::KActionMenuPrivate"); 1495//US m_popup = new KPopupMenu(0L,"KActionMenu::KActionMenuPrivate");
1495 m_popup = new QPopupMenu(0L,"KActionMenu::KActionMenuPrivate"); 1496 m_popup = new Q3PopupMenu(0L,"KActionMenu::KActionMenuPrivate");
1496 m_delayed = true; 1497 m_delayed = true;
1497 m_stickyMenu = true; 1498 m_stickyMenu = true;
1498 } 1499 }
1499 ~KActionMenuPrivate() 1500 ~KActionMenuPrivate()
1500 { 1501 {
1501 delete m_popup; m_popup = 0; 1502 delete m_popup; m_popup = 0;
1502 } 1503 }
1503 1504
1504//US KPopupMenu *m_popup; 1505//US KPopupMenu *m_popup;
1505 QPopupMenu *m_popup; 1506 Q3PopupMenu *m_popup;
1506 bool m_delayed; 1507 bool m_delayed;
1507 bool m_stickyMenu; 1508 bool m_stickyMenu;
1508}; 1509};
1509 1510
1510KActionMenu::KActionMenu( QObject* parent, const char* name ) 1511KActionMenu::KActionMenu( QObject* parent, const char* name )
1511 : KAction( parent, name ) 1512 : KAction( parent, name )
1512{ 1513{
1513 d = new KActionMenuPrivate; 1514 d = new KActionMenuPrivate;
1514 setShortcutConfigurable( false ); 1515 setShortcutConfigurable( false );
1515} 1516}
1516 1517
1517KActionMenu::KActionMenu( const QString& text, QObject* parent, 1518KActionMenu::KActionMenu( const QString& text, QObject* parent,
1518 const char* name ) 1519 const char* name )
1519 : KAction( text, 0, parent, name ) 1520 : KAction( text, 0, parent, name )
1520{ 1521{
1521 d = new KActionMenuPrivate; 1522 d = new KActionMenuPrivate;
1522 setShortcutConfigurable( false ); 1523 setShortcutConfigurable( false );
1523} 1524}
1524 1525
1525KActionMenu::KActionMenu( const QString& text, const QIconSet& icon, 1526KActionMenu::KActionMenu( const QString& text, const QIcon& icon,
1526 QObject* parent, const char* name ) 1527 QObject* parent, const char* name )
1527 : KAction( text, icon, 0, parent, name ) 1528 : KAction( text, icon, 0, parent, name )
1528{ 1529{
1529 d = new KActionMenuPrivate; 1530 d = new KActionMenuPrivate;
1530 setShortcutConfigurable( false ); 1531 setShortcutConfigurable( false );
1531} 1532}
1532 1533
1533KActionMenu::KActionMenu( const QString& text, const QString& icon, 1534KActionMenu::KActionMenu( const QString& text, const QString& icon,
1534 QObject* parent, const char* name ) 1535 QObject* parent, const char* name )
1535 : KAction( text, icon, 0, parent, name ) 1536 : KAction( text, icon, 0, parent, name )
1536{ 1537{
1537 d = new KActionMenuPrivate; 1538 d = new KActionMenuPrivate;
@@ -1543,25 +1544,25 @@ KActionMenu::~KActionMenu()
1543 unplugAll(); 1544 unplugAll();
1544 kdDebug(129) << "KActionMenu::~KActionMenu()" << endl; // ellis 1545 kdDebug(129) << "KActionMenu::~KActionMenu()" << endl; // ellis
1545 delete d; d = 0; 1546 delete d; d = 0;
1546} 1547}
1547 1548
1548void KActionMenu::popup( const QPoint& global ) 1549void KActionMenu::popup( const QPoint& global )
1549{ 1550{
1550 popupMenu()->popup( global ); 1551 popupMenu()->popup( global );
1551} 1552}
1552 1553
1553 1554
1554//US KPopupMenu* KActionMenu::popupMenu() const 1555//US KPopupMenu* KActionMenu::popupMenu() const
1555QPopupMenu* KActionMenu::popupMenu() const 1556Q3PopupMenu* KActionMenu::popupMenu() const
1556{ 1557{
1557 return d->m_popup; 1558 return d->m_popup;
1558} 1559}
1559 1560
1560void KActionMenu::insert( KAction* cmd, int index ) 1561void KActionMenu::insert( KAction* cmd, int index )
1561{ 1562{
1562 if ( cmd ) 1563 if ( cmd )
1563 cmd->plug( d->m_popup, index ); 1564 cmd->plug( d->m_popup, index );
1564} 1565}
1565 1566
1566void KActionMenu::remove( KAction* cmd ) 1567void KActionMenu::remove( KAction* cmd )
1567{ 1568{
@@ -1583,27 +1584,27 @@ bool KActionMenu::stickyMenu() const {
1583 1584
1584void KActionMenu::setStickyMenu(bool sticky) { 1585void KActionMenu::setStickyMenu(bool sticky) {
1585 d->m_stickyMenu = sticky; 1586 d->m_stickyMenu = sticky;
1586} 1587}
1587 1588
1588int KActionMenu::plug( QWidget* widget, int index ) 1589int KActionMenu::plug( QWidget* widget, int index )
1589{ 1590{
1590/*US 1591/*US
1591 if (kapp && !kapp->authorizeKAction(name())) 1592 if (kapp && !kapp->authorizeKAction(name()))
1592 return -1; 1593 return -1;
1593*/ 1594*/
1594 kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis 1595 kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis
1595 if ( widget->inherits("QPopupMenu") ) 1596 if ( widget->inherits("Q3PopupMenu") )
1596 { 1597 {
1597 QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); 1598 Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget );
1598 int id; 1599 int id;
1599 if ( hasIconSet() ) 1600 if ( hasIconSet() )
1600 id = menu->insertItem( iconSet(), text(), d->m_popup, -1, index ); 1601 id = menu->insertItem( iconSet(), text(), d->m_popup, -1, index );
1601 else 1602 else
1602 id = menu->insertItem( text(), d->m_popup, -1, index ); 1603 id = menu->insertItem( text(), d->m_popup, -1, index );
1603 1604
1604 if ( !isEnabled() ) 1605 if ( !isEnabled() )
1605 menu->setItemEnabled( id, false ); 1606 menu->setItemEnabled( id, false );
1606 1607
1607 addContainer( menu, id ); 1608 addContainer( menu, id );
1608 connect( menu, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) ); 1609 connect( menu, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) );
1609 1610
@@ -1772,30 +1773,30 @@ int KToolBarPopupAction::plug( QWidget *widget, int index )
1772/*US 1773/*US
1773 if ( !whatsThis().isEmpty() ) 1774 if ( !whatsThis().isEmpty() )
1774 QWhatsThis::add( bar->getButton( id_ ), whatsThisWithIcon() ); 1775 QWhatsThis::add( bar->getButton( id_ ), whatsThisWithIcon() );
1775*/ 1776*/
1776 return containerCount() - 1; 1777 return containerCount() - 1;
1777 } 1778 }
1778 1779
1779 1780
1780 return KAction::plug( widget, index ); 1781 return KAction::plug( widget, index );
1781} 1782}
1782 1783
1783//US KPopupMenu *KToolBarPopupAction::popupMenu() const 1784//US KPopupMenu *KToolBarPopupAction::popupMenu() const
1784QPopupMenu *KToolBarPopupAction::popupMenu() const 1785Q3PopupMenu *KToolBarPopupAction::popupMenu() const
1785{ 1786{
1786 if ( !m_popup ) { 1787 if ( !m_popup ) {
1787 KToolBarPopupAction *that = const_cast<KToolBarPopupAction*>(this); 1788 KToolBarPopupAction *that = const_cast<KToolBarPopupAction*>(this);
1788//US that->m_popup = new KPopupMenu; 1789//US that->m_popup = new KPopupMenu;
1789 that->m_popup = new QPopupMenu; 1790 that->m_popup = new Q3PopupMenu;
1790 } 1791 }
1791 return m_popup; 1792 return m_popup;
1792} 1793}
1793 1794
1794//////// 1795////////
1795 1796
1796KToggleToolBarAction::KToggleToolBarAction( const char* toolBarName, 1797KToggleToolBarAction::KToggleToolBarAction( const char* toolBarName,
1797 const QString& text, KActionCollection* parent, const char* name ) 1798 const QString& text, KActionCollection* parent, const char* name )
1798 : KToggleAction( text, KShortcut(), parent, name ) 1799 : KToggleAction( text, KShortcut(), parent, name )
1799 , m_toolBarName( toolBarName ) 1800 , m_toolBarName( toolBarName )
1800 , m_toolBar( 0L ) 1801 , m_toolBar( 0L )
1801{ 1802{
@@ -1944,48 +1945,48 @@ void KWidgetAction::unplug( QWidget *w )
1944 if ( toolBar == w ) 1945 if ( toolBar == w )
1945 { 1946 {
1946 disconnect( toolBar, SIGNAL( toolbarDestroyed() ), this, SLOT( slotToolbarDestroyed() ) ); 1947 disconnect( toolBar, SIGNAL( toolbarDestroyed() ), this, SLOT( slotToolbarDestroyed() ) );
1947 m_widget->reparent( 0L, QPoint(), false ); // false = showit 1948 m_widget->reparent( 0L, QPoint(), false ); // false = showit
1948 } 1949 }
1949 KAction::unplug( w ); 1950 KAction::unplug( w );
1950} 1951}
1951 1952
1952void KWidgetAction::slotToolbarDestroyed() 1953void KWidgetAction::slotToolbarDestroyed()
1953{ 1954{
1954 //Q_ASSERT( m_widget ); // When exiting the app the widget could be destroyed before the toolbar. 1955 //Q_ASSERT( m_widget ); // When exiting the app the widget could be destroyed before the toolbar.
1955 1956
1956 ASSERT( isPlugged() ); 1957 Q_ASSERT( isPlugged() );
1957 if( !m_widget || !isPlugged() ) 1958 if( !m_widget || !isPlugged() )
1958 return; 1959 return;
1959 1960
1960 // Don't let a toolbar being destroyed, delete my widget. 1961 // Don't let a toolbar being destroyed, delete my widget.
1961 m_widget->reparent( 0L, QPoint(), false /*showIt*/ ); 1962 m_widget->reparent( 0L, QPoint(), false /*showIt*/ );
1962} 1963}
1963 1964
1964//////// 1965////////
1965 1966
1966KActionSeparator::KActionSeparator( QObject *parent, const char *name ) 1967KActionSeparator::KActionSeparator( QObject *parent, const char *name )
1967 : KAction( parent, name ) 1968 : KAction( parent, name )
1968{ 1969{
1969} 1970}
1970 1971
1971KActionSeparator::~KActionSeparator() 1972KActionSeparator::~KActionSeparator()
1972{ 1973{
1973} 1974}
1974 1975
1975int KActionSeparator::plug( QWidget *widget, int index ) 1976int KActionSeparator::plug( QWidget *widget, int index )
1976{ 1977{
1977 if ( widget->inherits("QPopupMenu") ) 1978 if ( widget->inherits("Q3PopupMenu") )
1978 { 1979 {
1979 QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); 1980 Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget );
1980 1981
1981 int id = menu->insertSeparator( index ); 1982 int id = menu->insertSeparator( index );
1982 1983
1983 addContainer( menu, id ); 1984 addContainer( menu, id );
1984 connect( menu, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) ); 1985 connect( menu, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) );
1985 1986
1986 return containerCount() - 1; 1987 return containerCount() - 1;
1987 } 1988 }
1988 else if ( widget->inherits( "QMenuBar" ) ) 1989 else if ( widget->inherits( "QMenuBar" ) )
1989 { 1990 {
1990 QMenuBar *menuBar = static_cast<QMenuBar *>( widget ); 1991 QMenuBar *menuBar = static_cast<QMenuBar *>( widget );
1991 1992
diff --git a/microkde/kdeui/kactionclasses.h b/microkde/kdeui/kactionclasses.h
index f6e7a0f..a9b9104 100644
--- a/microkde/kdeui/kactionclasses.h
+++ b/microkde/kdeui/kactionclasses.h
@@ -25,45 +25,48 @@
25 25
26#ifndef __kactionclasses_h__ 26#ifndef __kactionclasses_h__
27#define __kactionclasses_h__ 27#define __kactionclasses_h__
28 28
29#include <kaction.h> 29#include <kaction.h>
30 30
31//US#include <qkeysequence.h> 31//US#include <qkeysequence.h>
32//US#include <qobject.h> 32//US#include <qobject.h>
33//US#include <qvaluelist.h> 33//US#include <qvaluelist.h>
34//US#include <qguardedptr.h> 34//US#include <qguardedptr.h>
35//US#include <kguiitem.h> 35//US#include <kguiitem.h>
36#include <kshortcut.h> 36#include <kshortcut.h>
37//Added by qt3to4:
38#include <Q3CString>
39#include <Q3PopupMenu>
37//US#include <kstdaction.h> 40//US#include <kstdaction.h>
38//US#include <kicontheme.h> 41//US#include <kicontheme.h>
39 42
40class QMenuBar; 43class QMenuBar;
41class QPopupMenu; 44class Q3PopupMenu;
42//USclass QComboBox; 45//USclass QComboBox;
43//USclass QPoint; 46//USclass QPoint;
44//USclass QIconSet; 47//USclass QIconSet;
45//USclass QString; 48//USclass QString;
46//USclass KToolBar; 49//USclass KToolBar;
47 50
48//USclass KAccel; 51//USclass KAccel;
49//USclass KAccelActions; 52//USclass KAccelActions;
50class KConfig; 53class KConfig;
51//USclass KConfigBase; 54//USclass KConfigBase;
52class KURL; 55class KURL;
53//USclass KInstance; 56//USclass KInstance;
54 57
55 58
56//US class KToolBar needs to be replaced 59//US class KToolBar needs to be replaced
57class KToolBar; 60#include "ktoolbar.h"
58class KActionCollection; 61class KActionCollection;
59 62
60//US class KPopupMenu needs to be replaced 63//US class KPopupMenu needs to be replaced
61//US class KPopupMenu; 64//US class KPopupMenu;
62//USclass KMainWindow; 65//USclass KMainWindow;
63 66
64/** 67/**
65 * Checkbox like action. 68 * Checkbox like action.
66 * 69 *
67 * This action provides two states: checked or not. 70 * This action provides two states: checked or not.
68 * 71 *
69 * @short Checkbox like action. 72 * @short Checkbox like action.
@@ -96,47 +99,47 @@ public:
96 * @param name An internal name for this action. 99 * @param name An internal name for this action.
97 */ 100 */
98 KToggleAction( const QString& text, const KShortcut& cut, 101 KToggleAction( const QString& text, const KShortcut& cut,
99 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); 102 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
100 103
101 /** 104 /**
102 * @param text The text that will be displayed. 105 * @param text The text that will be displayed.
103 * @param pix The icons that go with this action. 106 * @param pix The icons that go with this action.
104 * @param cut The corresponding keyboard accelerator (shortcut). 107 * @param cut The corresponding keyboard accelerator (shortcut).
105 * @param parent This action's parent. 108 * @param parent This action's parent.
106 * @param name An internal name for this action. 109 * @param name An internal name for this action.
107 */ 110 */
108 KToggleAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), 111 KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(),
109 QObject* parent = 0, const char* name = 0 ); 112 QObject* parent = 0, const char* name = 0 );
110 113
111 /** 114 /**
112 * @param text The text that will be displayed. 115 * @param text The text that will be displayed.
113 * @param pix The dynamically loaded icon that goes with this action. 116 * @param pix The dynamically loaded icon that goes with this action.
114 * @param cut The corresponding keyboard accelerator (shortcut). 117 * @param cut The corresponding keyboard accelerator (shortcut).
115 * @param parent This action's parent. 118 * @param parent This action's parent.
116 * @param name An internal name for this action. 119 * @param name An internal name for this action.
117 */ 120 */
118 KToggleAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), 121 KToggleAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(),
119 QObject* parent = 0, const char* name = 0 ); 122 QObject* parent = 0, const char* name = 0 );
120 123
121 /** 124 /**
122 * @param text The text that will be displayed. 125 * @param text The text that will be displayed.
123 * @param pix The icons that go with this action. 126 * @param pix The icons that go with this action.
124 * @param cut The corresponding keyboard accelerator (shortcut). 127 * @param cut The corresponding keyboard accelerator (shortcut).
125 * @param receiver The SLOT's parent. 128 * @param receiver The SLOT's parent.
126 * @param slot The SLOT to invoke to execute this action. 129 * @param slot The SLOT to invoke to execute this action.
127 * @param parent This action's parent. 130 * @param parent This action's parent.
128 * @param name An internal name for this action. 131 * @param name An internal name for this action.
129 */ 132 */
130 KToggleAction( const QString& text, const QIconSet& pix, const KShortcut& cut, 133 KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut,
131 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); 134 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
132 135
133 /** 136 /**
134 * @param text The text that will be displayed. 137 * @param text The text that will be displayed.
135 * @param pix The dynamically loaded icon that goes with this action. 138 * @param pix The dynamically loaded icon that goes with this action.
136 * @param cut The corresponding keyboard accelerator (shortcut). 139 * @param cut The corresponding keyboard accelerator (shortcut).
137 * @param receiver The SLOT's parent. 140 * @param receiver The SLOT's parent.
138 * @param slot The SLOT to invoke to execute this action. 141 * @param slot The SLOT to invoke to execute this action.
139 * @param parent This action's parent. 142 * @param parent This action's parent.
140 * @param name An internal name for this action. 143 * @param name An internal name for this action.
141 */ 144 */
142 KToggleAction( const QString& text, const QString& pix, const KShortcut& cut, 145 KToggleAction( const QString& text, const QString& pix, const KShortcut& cut,
@@ -237,47 +240,47 @@ public:
237 * @param name An internal name for this action. 240 * @param name An internal name for this action.
238 */ 241 */
239 KRadioAction( const QString& text, const KShortcut& cut, 242 KRadioAction( const QString& text, const KShortcut& cut,
240 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); 243 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
241 244
242 /** 245 /**
243 * @param text The text that will be displayed. 246 * @param text The text that will be displayed.
244 * @param pix The icons that go with this action. 247 * @param pix The icons that go with this action.
245 * @param cut The corresponding keyboard accelerator (shortcut). 248 * @param cut The corresponding keyboard accelerator (shortcut).
246 * @param parent This action's parent. 249 * @param parent This action's parent.
247 * @param name An internal name for this action. 250 * @param name An internal name for this action.
248 */ 251 */
249 KRadioAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), 252 KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(),
250 QObject* parent = 0, const char* name = 0 ); 253 QObject* parent = 0, const char* name = 0 );
251 254
252 /** 255 /**
253 * @param text The text that will be displayed. 256 * @param text The text that will be displayed.
254 * @param pix The dynamically loaded icon that goes with this action. 257 * @param pix The dynamically loaded icon that goes with this action.
255 * @param cut The corresponding keyboard accelerator (shortcut). 258 * @param cut The corresponding keyboard accelerator (shortcut).
256 * @param parent This action's parent. 259 * @param parent This action's parent.
257 * @param name An internal name for this action. 260 * @param name An internal name for this action.
258 */ 261 */
259 KRadioAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), 262 KRadioAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(),
260 QObject* parent = 0, const char* name = 0 ); 263 QObject* parent = 0, const char* name = 0 );
261 264
262 /** 265 /**
263 * @param text The text that will be displayed. 266 * @param text The text that will be displayed.
264 * @param pix The icons that go with this action. 267 * @param pix The icons that go with this action.
265 * @param cut The corresponding keyboard accelerator (shortcut). 268 * @param cut The corresponding keyboard accelerator (shortcut).
266 * @param receiver The SLOT's parent. 269 * @param receiver The SLOT's parent.
267 * @param slot The SLOT to invoke to execute this action. 270 * @param slot The SLOT to invoke to execute this action.
268 * @param parent This action's parent. 271 * @param parent This action's parent.
269 * @param name An internal name for this action. 272 * @param name An internal name for this action.
270 */ 273 */
271 KRadioAction( const QString& text, const QIconSet& pix, const KShortcut& cut, 274 KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut,
272 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); 275 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
273 276
274 /** 277 /**
275 * @param text The text that will be displayed. 278 * @param text The text that will be displayed.
276 * @param pix The dynamically loaded icon that goes with this action. 279 * @param pix The dynamically loaded icon that goes with this action.
277 * @param cut The corresponding keyboard accelerator (shortcut). 280 * @param cut The corresponding keyboard accelerator (shortcut).
278 * @param receiver The SLOT's parent. 281 * @param receiver The SLOT's parent.
279 * @param slot The SLOT to invoke to execute this action. 282 * @param slot The SLOT to invoke to execute this action.
280 * @param parent This action's parent. 283 * @param parent This action's parent.
281 * @param name An internal name for this action. 284 * @param name An internal name for this action.
282 */ 285 */
283 KRadioAction( const QString& text, const QString& pix, const KShortcut& cut, 286 KRadioAction( const QString& text, const QString& pix, const KShortcut& cut,
@@ -343,47 +346,47 @@ public:
343 * @param name An internal name for this action. 346 * @param name An internal name for this action.
344 */ 347 */
345 KSelectAction( const QString& text, const KShortcut& cut, 348 KSelectAction( const QString& text, const KShortcut& cut,
346 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); 349 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
347 350
348 /** 351 /**
349 * @param text The text that will be displayed. 352 * @param text The text that will be displayed.
350 * @param pix The icons that go with this action. 353 * @param pix The icons that go with this action.
351 * @param cut The corresponding keyboard accelerator (shortcut). 354 * @param cut The corresponding keyboard accelerator (shortcut).
352 * @param parent This action's parent. 355 * @param parent This action's parent.
353 * @param name An internal name for this action. 356 * @param name An internal name for this action.
354 */ 357 */
355 KSelectAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), 358 KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(),
356 QObject* parent = 0, const char* name = 0 ); 359 QObject* parent = 0, const char* name = 0 );
357 360
358 /** 361 /**
359 * @param text The text that will be displayed. 362 * @param text The text that will be displayed.
360 * @param pix The dynamically loaded icon that goes with this action. 363 * @param pix The dynamically loaded icon that goes with this action.
361 * @param cut The corresponding keyboard accelerator (shortcut). 364 * @param cut The corresponding keyboard accelerator (shortcut).
362 * @param parent This action's parent. 365 * @param parent This action's parent.
363 * @param name An internal name for this action. 366 * @param name An internal name for this action.
364 */ 367 */
365 KSelectAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), 368 KSelectAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(),
366 QObject* parent = 0, const char* name = 0 ); 369 QObject* parent = 0, const char* name = 0 );
367 370
368 /** 371 /**
369 * @param text The text that will be displayed. 372 * @param text The text that will be displayed.
370 * @param pix The icons that go with this action. 373 * @param pix The icons that go with this action.
371 * @param cut The corresponding keyboard accelerator (shortcut). 374 * @param cut The corresponding keyboard accelerator (shortcut).
372 * @param receiver The SLOT's parent. 375 * @param receiver The SLOT's parent.
373 * @param slot The SLOT to invoke to execute this action. 376 * @param slot The SLOT to invoke to execute this action.
374 * @param parent This action's parent. 377 * @param parent This action's parent.
375 * @param name An internal name for this action. 378 * @param name An internal name for this action.
376 */ 379 */
377 KSelectAction( const QString& text, const QIconSet& pix, const KShortcut& cut, 380 KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut,
378 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); 381 const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
379 382
380 /** 383 /**
381 * @param text The text that will be displayed. 384 * @param text The text that will be displayed.
382 * @param pix The dynamically loaded icon that goes with this action. 385 * @param pix The dynamically loaded icon that goes with this action.
383 * @param cut The corresponding keyboard accelerator (shortcut). 386 * @param cut The corresponding keyboard accelerator (shortcut).
384 * @param receiver The SLOT's parent. 387 * @param receiver The SLOT's parent.
385 * @param slot The SLOT to invoke to execute this action. 388 * @param slot The SLOT to invoke to execute this action.
386 * @param parent This action's parent. 389 * @param parent This action's parent.
387 * @param name An internal name for this action. 390 * @param name An internal name for this action.
388 */ 391 */
389 KSelectAction( const QString& text, const QString& pix, const KShortcut& cut, 392 KSelectAction( const QString& text, const QString& pix, const KShortcut& cut,
@@ -429,25 +432,25 @@ public:
429 virtual void changeItem( int index, const QString& text ); 432 virtual void changeItem( int index, const QString& text );
430 433
431 virtual QString currentText() const; 434 virtual QString currentText() const;
432 435
433 virtual int currentItem() const; 436 virtual int currentItem() const;
434 437
435 /** 438 /**
436 * When this action is plugged into a toolbar, it creates a combobox. 439 * When this action is plugged into a toolbar, it creates a combobox.
437 * This returns the maximum width set by setComboWidth 440 * This returns the maximum width set by setComboWidth
438 */ 441 */
439 virtual int comboWidth() const; 442 virtual int comboWidth() const;
440 443
441 QPopupMenu* popupMenu() const; 444 Q3PopupMenu* popupMenu() const;
442 445
443 /** 446 /**
444 * Deprecated. See @ref setMenuAccelsEnabled . 447 * Deprecated. See @ref setMenuAccelsEnabled .
445 * @since 3.1 448 * @since 3.1
446 */ 449 */
447 void setRemoveAmpersandsInCombo( bool b ); 450 void setRemoveAmpersandsInCombo( bool b );
448 /// @since 3.1 451 /// @since 3.1
449 bool removeAmpersandsInCombo() const; 452 bool removeAmpersandsInCombo() const;
450 453
451 /** 454 /**
452 * Sets whether any occurence of the ampersand character ( &amp; ) in items 455 * Sets whether any occurence of the ampersand character ( &amp; ) in items
453 * should be interpreted as keyboard accelerator for items displayed in a 456 * should be interpreted as keyboard accelerator for items displayed in a
@@ -558,47 +561,47 @@ public:
558 * @param name An internal name for this action. 561 * @param name An internal name for this action.
559 */ 562 */
560 KListAction( const QString& text, const KShortcut& cut, const QObject* receiver, 563 KListAction( const QString& text, const KShortcut& cut, const QObject* receiver,
561 const char* slot, QObject* parent, const char* name = 0 ); 564 const char* slot, QObject* parent, const char* name = 0 );
562 565
563 /** 566 /**
564 * @param text The text that will be displayed. 567 * @param text The text that will be displayed.
565 * @param pix The icons that go with this action. 568 * @param pix The icons that go with this action.
566 * @param cut The corresponding keyboard accelerator (shortcut). 569 * @param cut The corresponding keyboard accelerator (shortcut).
567 * @param parent This action's parent. 570 * @param parent This action's parent.
568 * @param name An internal name for this action. 571 * @param name An internal name for this action.
569 */ 572 */
570 KListAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), 573 KListAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(),
571 QObject* parent = 0, const char* name = 0 ); 574 QObject* parent = 0, const char* name = 0 );
572 575
573 /** 576 /**
574 * @param text The text that will be displayed. 577 * @param text The text that will be displayed.
575 * @param pix The dynamically loaded icon that goes with this action. 578 * @param pix The dynamically loaded icon that goes with this action.
576 * @param cut The corresponding keyboard accelerator (shortcut). 579 * @param cut The corresponding keyboard accelerator (shortcut).
577 * @param parent This action's parent. 580 * @param parent This action's parent.
578 * @param name An internal name for this action. 581 * @param name An internal name for this action.
579 */ 582 */
580 KListAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), 583 KListAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(),
581 QObject* parent = 0, const char* name = 0 ); 584 QObject* parent = 0, const char* name = 0 );
582 585
583 /** 586 /**
584 * @param text The text that will be displayed. 587 * @param text The text that will be displayed.
585 * @param pix The icons that go with this action. 588 * @param pix The icons that go with this action.
586 * @param cut The corresponding keyboard accelerator (shortcut). 589 * @param cut The corresponding keyboard accelerator (shortcut).
587 * @param receiver The SLOT's parent. 590 * @param receiver The SLOT's parent.
588 * @param slot The SLOT to invoke to execute this action. 591 * @param slot The SLOT to invoke to execute this action.
589 * @param parent This action's parent. 592 * @param parent This action's parent.
590 * @param name An internal name for this action. 593 * @param name An internal name for this action.
591 */ 594 */
592 KListAction( const QString& text, const QIconSet& pix, const KShortcut& cut, 595 KListAction( const QString& text, const QIcon& pix, const KShortcut& cut,
593 const QObject* receiver, const char* slot, QObject* parent, 596 const QObject* receiver, const char* slot, QObject* parent,
594 const char* name = 0 ); 597 const char* name = 0 );
595 598
596 /** 599 /**
597 * @param text The text that will be displayed. 600 * @param text The text that will be displayed.
598 * @param pix The dynamically loaded icon that goes with this action. 601 * @param pix The dynamically loaded icon that goes with this action.
599 * @param cut The corresponding keyboard accelerator (shortcut). 602 * @param cut The corresponding keyboard accelerator (shortcut).
600 * @param receiver The SLOT's parent. 603 * @param receiver The SLOT's parent.
601 * @param slot The SLOT to invoke to execute this action. 604 * @param slot The SLOT to invoke to execute this action.
602 * @param parent This action's parent. 605 * @param parent This action's parent.
603 * @param name An internal name for this action. 606 * @param name An internal name for this action.
604 */ 607 */
@@ -676,25 +679,25 @@ public:
676 const QObject* receiver, const char* slot, 679 const QObject* receiver, const char* slot,
677 QObject* parent, const char* name = 0, 680 QObject* parent, const char* name = 0,
678 uint maxItems = 10 ); 681 uint maxItems = 10 );
679 682
680 /** 683 /**
681 * @param text The text that will be displayed. 684 * @param text The text that will be displayed.
682 * @param pix The icons that go with this action. 685 * @param pix The icons that go with this action.
683 * @param cut The corresponding keyboard accelerator (shortcut). 686 * @param cut The corresponding keyboard accelerator (shortcut).
684 * @param parent This action's parent. 687 * @param parent This action's parent.
685 * @param name An internal name for this action. 688 * @param name An internal name for this action.
686 * @param maxItems The maximum number of files to display 689 * @param maxItems The maximum number of files to display
687 */ 690 */
688 KRecentFilesAction( const QString& text, const QIconSet& pix, const KShortcut& cut, 691 KRecentFilesAction( const QString& text, const QIcon& pix, const KShortcut& cut,
689 QObject* parent, const char* name = 0, 692 QObject* parent, const char* name = 0,
690 uint maxItems = 10 ); 693 uint maxItems = 10 );
691 694
692 /** 695 /**
693 * @param text The text that will be displayed. 696 * @param text The text that will be displayed.
694 * @param pix The dynamically loaded icon that goes with this action. 697 * @param pix The dynamically loaded icon that goes with this action.
695 * @param cut The corresponding keyboard accelerator (shortcut). 698 * @param cut The corresponding keyboard accelerator (shortcut).
696 * @param parent This action's parent. 699 * @param parent This action's parent.
697 * @param name An internal name for this action. 700 * @param name An internal name for this action.
698 * @param maxItems The maximum number of files to display 701 * @param maxItems The maximum number of files to display
699 */ 702 */
700 KRecentFilesAction( const QString& text, const QString& pix, const KShortcut& cut, 703 KRecentFilesAction( const QString& text, const QString& pix, const KShortcut& cut,
@@ -703,25 +706,25 @@ public:
703 706
704 /** 707 /**
705 * @param text The text that will be displayed. 708 * @param text The text that will be displayed.
706 * @param pix The icons that go with this action. 709 * @param pix The icons that go with this action.
707 * @param cut The corresponding keyboard accelerator (shortcut). 710 * @param cut The corresponding keyboard accelerator (shortcut).
708 * @param receiver The SLOT's parent. 711 * @param receiver The SLOT's parent.
709 * @param slot The SLOT to invoke when a URL is selected. 712 * @param slot The SLOT to invoke when a URL is selected.
710 * Its signature is of the form slotURLSelected( const KURL & ). 713 * Its signature is of the form slotURLSelected( const KURL & ).
711 * @param parent This action's parent. 714 * @param parent This action's parent.
712 * @param name An internal name for this action. 715 * @param name An internal name for this action.
713 * @param maxItems The maximum number of files to display 716 * @param maxItems The maximum number of files to display
714 */ 717 */
715 KRecentFilesAction( const QString& text, const QIconSet& pix, const KShortcut& cut, 718 KRecentFilesAction( const QString& text, const QIcon& pix, const KShortcut& cut,
716 const QObject* receiver, const char* slot, 719 const QObject* receiver, const char* slot,
717 QObject* parent, const char* name = 0, 720 QObject* parent, const char* name = 0,
718 uint maxItems = 10 ); 721 uint maxItems = 10 );
719 722
720 /** 723 /**
721 * @param text The text that will be displayed. 724 * @param text The text that will be displayed.
722 * @param pix The dynamically loaded icon that goes with this action. 725 * @param pix The dynamically loaded icon that goes with this action.
723 * @param cut The corresponding keyboard accelerator (shortcut). 726 * @param cut The corresponding keyboard accelerator (shortcut).
724 * @param receiver The SLOT's parent. 727 * @param receiver The SLOT's parent.
725 * @param slot The SLOT to invoke when a URL is selected. 728 * @param slot The SLOT to invoke when a URL is selected.
726 * Its signature is of the form slotURLSelected( const KURL & ). 729 * Its signature is of the form slotURLSelected( const KURL & ).
727 * @param parent This action's parent. 730 * @param parent This action's parent.
@@ -825,29 +828,29 @@ private:
825}; 828};
826 829
827class KFontAction : public KSelectAction 830class KFontAction : public KSelectAction
828{ 831{
829 Q_OBJECT 832 Q_OBJECT
830 Q_PROPERTY( QString font READ font WRITE setFont ) 833 Q_PROPERTY( QString font READ font WRITE setFont )
831public: 834public:
832 KFontAction( const QString& text, const KShortcut& cut = KShortcut(), QObject* parent = 0, 835 KFontAction( const QString& text, const KShortcut& cut = KShortcut(), QObject* parent = 0,
833 const char* name = 0 ); 836 const char* name = 0 );
834 KFontAction( const QString& text, const KShortcut& cut, 837 KFontAction( const QString& text, const KShortcut& cut,
835 const QObject* receiver, const char* slot, QObject* parent, 838 const QObject* receiver, const char* slot, QObject* parent,
836 const char* name = 0 ); 839 const char* name = 0 );
837 KFontAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), 840 KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(),
838 QObject* parent = 0, const char* name = 0 ); 841 QObject* parent = 0, const char* name = 0 );
839 KFontAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), 842 KFontAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(),
840 QObject* parent = 0, const char* name = 0 ); 843 QObject* parent = 0, const char* name = 0 );
841 KFontAction( const QString& text, const QIconSet& pix, const KShortcut& cut, 844 KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut,
842 const QObject* receiver, const char* slot, QObject* parent, 845 const QObject* receiver, const char* slot, QObject* parent,
843 const char* name = 0 ); 846 const char* name = 0 );
844 KFontAction( const QString& text, const QString& pix, const KShortcut& cut, 847 KFontAction( const QString& text, const QString& pix, const KShortcut& cut,
845 const QObject* receiver, const char* slot, QObject* parent, 848 const QObject* receiver, const char* slot, QObject* parent,
846 const char* name = 0 ); 849 const char* name = 0 );
847 850
848 KFontAction( QObject* parent = 0, const char* name = 0 ); 851 KFontAction( QObject* parent = 0, const char* name = 0 );
849 ~KFontAction(); 852 ~KFontAction();
850 853
851 QString font() const { 854 QString font() const {
852 return currentText(); 855 return currentText();
853 } 856 }
@@ -864,29 +867,29 @@ private:
864 KFontActionPrivate *d; 867 KFontActionPrivate *d;
865}; 868};
866 869
867class KFontSizeAction : public KSelectAction 870class KFontSizeAction : public KSelectAction
868{ 871{
869 Q_OBJECT 872 Q_OBJECT
870 Q_PROPERTY( int fontSize READ fontSize WRITE setFontSize ) 873 Q_PROPERTY( int fontSize READ fontSize WRITE setFontSize )
871public: 874public:
872 KFontSizeAction( const QString& text, const KShortcut& cut = KShortcut(), QObject* parent = 0, 875 KFontSizeAction( const QString& text, const KShortcut& cut = KShortcut(), QObject* parent = 0,
873 const char* name = 0 ); 876 const char* name = 0 );
874 KFontSizeAction( const QString& text, const KShortcut& cut, const QObject* receiver, 877 KFontSizeAction( const QString& text, const KShortcut& cut, const QObject* receiver,
875 const char* slot, QObject* parent, const char* name = 0 ); 878 const char* slot, QObject* parent, const char* name = 0 );
876 KFontSizeAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), 879 KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(),
877 QObject* parent = 0, const char* name = 0 ); 880 QObject* parent = 0, const char* name = 0 );
878 KFontSizeAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), 881 KFontSizeAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(),
879 QObject* parent = 0, const char* name = 0 ); 882 QObject* parent = 0, const char* name = 0 );
880 KFontSizeAction( const QString& text, const QIconSet& pix, const KShortcut& cut, 883 KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut,
881 const QObject* receiver, const char* slot, 884 const QObject* receiver, const char* slot,
882 QObject* parent, const char* name = 0 ); 885 QObject* parent, const char* name = 0 );
883 KFontSizeAction( const QString& text, const QString& pix, const KShortcut& cut, 886 KFontSizeAction( const QString& text, const QString& pix, const KShortcut& cut,
884 const QObject* receiver, const char* slot, 887 const QObject* receiver, const char* slot,
885 QObject* parent, const char* name = 0 ); 888 QObject* parent, const char* name = 0 );
886 KFontSizeAction( QObject* parent = 0, const char* name = 0 ); 889 KFontSizeAction( QObject* parent = 0, const char* name = 0 );
887 890
888 virtual ~KFontSizeAction(); 891 virtual ~KFontSizeAction();
889 892
890 virtual int fontSize() const; 893 virtual int fontSize() const;
891 894
892public slots: 895public slots:
@@ -922,36 +925,36 @@ private:
922 * If you want a submenu for selecting one tool among many (without icons), see KSelectAction. 925 * If you want a submenu for selecting one tool among many (without icons), see KSelectAction.
923 * See also setDelayed about the main action. 926 * See also setDelayed about the main action.
924 */ 927 */
925class KActionMenu : public KAction 928class KActionMenu : public KAction
926{ 929{
927 Q_OBJECT 930 Q_OBJECT
928 Q_PROPERTY( bool delayed READ delayed WRITE setDelayed ) 931 Q_PROPERTY( bool delayed READ delayed WRITE setDelayed )
929 Q_PROPERTY( bool stickyMenu READ stickyMenu WRITE setStickyMenu ) 932 Q_PROPERTY( bool stickyMenu READ stickyMenu WRITE setStickyMenu )
930 933
931public: 934public:
932 KActionMenu( const QString& text, QObject* parent = 0, 935 KActionMenu( const QString& text, QObject* parent = 0,
933 const char* name = 0 ); 936 const char* name = 0 );
934 KActionMenu( const QString& text, const QIconSet& icon, 937 KActionMenu( const QString& text, const QIcon& icon,
935 QObject* parent = 0, const char* name = 0 ); 938 QObject* parent = 0, const char* name = 0 );
936 KActionMenu( const QString& text, const QString& icon, 939 KActionMenu( const QString& text, const QString& icon,
937 QObject* parent = 0, const char* name = 0 ); 940 QObject* parent = 0, const char* name = 0 );
938 KActionMenu( QObject* parent = 0, const char* name = 0 ); 941 KActionMenu( QObject* parent = 0, const char* name = 0 );
939 virtual ~KActionMenu(); 942 virtual ~KActionMenu();
940 943
941 virtual void insert( KAction*, int index = -1 ); 944 virtual void insert( KAction*, int index = -1 );
942 virtual void remove( KAction* ); 945 virtual void remove( KAction* );
943 946
944//US KPopupMenu* popupMenu() const; 947//US KPopupMenu* popupMenu() const;
945 QPopupMenu* popupMenu() const; 948 Q3PopupMenu* popupMenu() const;
946 void popup( const QPoint& global ); 949 void popup( const QPoint& global );
947 950
948 /** 951 /**
949 * Returns true if this action creates a delayed popup menu 952 * Returns true if this action creates a delayed popup menu
950 * when plugged in a KToolbar. 953 * when plugged in a KToolbar.
951 */ 954 */
952 bool delayed() const; 955 bool delayed() const;
953 /** 956 /**
954 * If set to true, this action will create a delayed popup menu 957 * If set to true, this action will create a delayed popup menu
955 * when plugged in a KToolbar. Otherwise it creates a normal popup. 958 * when plugged in a KToolbar. Otherwise it creates a normal popup.
956 * Default: delayed 959 * Default: delayed
957 * 960 *
@@ -1058,25 +1061,25 @@ public:
1058 KActionCollection* parent, const char* name ); 1061 KActionCollection* parent, const char* name );
1059 1062
1060 virtual ~KToolBarPopupAction(); 1063 virtual ~KToolBarPopupAction();
1061 1064
1062 virtual int plug( QWidget *widget, int index = -1 ); 1065 virtual int plug( QWidget *widget, int index = -1 );
1063 1066
1064 /** 1067 /**
1065 * The popup menu that is shown when clicking (some time) on the toolbar 1068 * The popup menu that is shown when clicking (some time) on the toolbar
1066 * button. You may want to plug items into it on creation, or connect to 1069 * button. You may want to plug items into it on creation, or connect to
1067 * aboutToShow for a more dynamic menu. 1070 * aboutToShow for a more dynamic menu.
1068 */ 1071 */
1069//US KPopupMenu *popupMenu() const; 1072//US KPopupMenu *popupMenu() const;
1070 QPopupMenu *popupMenu() const; 1073 Q3PopupMenu *popupMenu() const;
1071 1074
1072 /** 1075 /**
1073 * Returns true if this action creates a delayed popup menu 1076 * Returns true if this action creates a delayed popup menu
1074 * when plugged in a KToolbar. 1077 * when plugged in a KToolbar.
1075 */ 1078 */
1076 bool delayed() const; 1079 bool delayed() const;
1077 /** 1080 /**
1078 * If set to true, this action will create a delayed popup menu 1081 * If set to true, this action will create a delayed popup menu
1079 * when plugged in a KToolbar. Otherwise it creates a normal popup. 1082 * when plugged in a KToolbar. Otherwise it creates a normal popup.
1080 * Default: delayed. 1083 * Default: delayed.
1081 */ 1084 */
1082 void setDelayed(bool delayed); 1085 void setDelayed(bool delayed);
@@ -1089,25 +1092,25 @@ public:
1089 * If set to true, this action will create a sticky popup menu 1092 * If set to true, this action will create a sticky popup menu
1090 * when plugged in a KToolbar. 1093 * when plugged in a KToolbar.
1091 * "Sticky", means it's visible until a selection is made or the mouse is 1094 * "Sticky", means it's visible until a selection is made or the mouse is
1092 * clicked elsewhere. This feature allows you to make a selection without 1095 * clicked elsewhere. This feature allows you to make a selection without
1093 * having to press and hold down the mouse while making a selection. 1096 * having to press and hold down the mouse while making a selection.
1094 * Only available if delayed() is true. 1097 * Only available if delayed() is true.
1095 * Default: sticky. 1098 * Default: sticky.
1096 */ 1099 */
1097 void setStickyMenu(bool sticky); 1100 void setStickyMenu(bool sticky);
1098 1101
1099private: 1102private:
1100//US KPopupMenu *m_popup; 1103//US KPopupMenu *m_popup;
1101 QPopupMenu *m_popup; 1104 Q3PopupMenu *m_popup;
1102 bool m_delayed:1; 1105 bool m_delayed:1;
1103 bool m_stickyMenu:1; 1106 bool m_stickyMenu:1;
1104protected: 1107protected:
1105 virtual void virtual_hook( int id, void* data ); 1108 virtual void virtual_hook( int id, void* data );
1106private: 1109private:
1107 class KToolBarPopupActionPrivate; 1110 class KToolBarPopupActionPrivate;
1108 KToolBarPopupActionPrivate *d; 1111 KToolBarPopupActionPrivate *d;
1109}; 1112};
1110 1113
1111/** 1114/**
1112 * An action that takes care of everything associated with 1115 * An action that takes care of everything associated with
1113 * showing or hiding a toolbar by a menu action. It will 1116 * showing or hiding a toolbar by a menu action. It will
@@ -1138,26 +1141,26 @@ public:
1138 virtual ~KToggleToolBarAction(); 1141 virtual ~KToggleToolBarAction();
1139 1142
1140 virtual int plug( QWidget*, int index = -1 ); 1143 virtual int plug( QWidget*, int index = -1 );
1141 1144
1142 KToolBar *toolBar() { 1145 KToolBar *toolBar() {
1143 return m_toolBar; 1146 return m_toolBar;
1144 } 1147 }
1145 1148
1146public slots: 1149public slots:
1147 virtual void setChecked( bool ); 1150 virtual void setChecked( bool );
1148 1151
1149private: 1152private:
1150 QCString m_toolBarName; 1153 Q3CString m_toolBarName;
1151 QGuardedPtr<KToolBar> m_toolBar; 1154 QPointer<KToolBar> m_toolBar;
1152protected: 1155protected:
1153 virtual void virtual_hook( int id, void* data ); 1156 virtual void virtual_hook( int id, void* data );
1154private: 1157private:
1155 class KToggleToolBarActionPrivate; 1158 class KToggleToolBarActionPrivate;
1156 KToggleToolBarActionPrivate *d; 1159 KToggleToolBarActionPrivate *d;
1157}; 1160};
1158 1161
1159/** 1162/**
1160 * An action that automatically embeds a widget into a 1163 * An action that automatically embeds a widget into a
1161 * toolbar. 1164 * toolbar.
1162 */ 1165 */
1163class KWidgetAction : public KAction 1166class KWidgetAction : public KAction
@@ -1186,25 +1189,25 @@ public:
1186 * Plug the action. The widget passed to the constructor 1189 * Plug the action. The widget passed to the constructor
1187 * will be reparented to w, which must inherit KToolBar. 1190 * will be reparented to w, which must inherit KToolBar.
1188 */ 1191 */
1189 virtual int plug( QWidget* w, int index = -1 ); 1192 virtual int plug( QWidget* w, int index = -1 );
1190 /** 1193 /**
1191 * Unplug the action. Ensures that the action is not 1194 * Unplug the action. Ensures that the action is not
1192 * destroyed. It will be hidden and reparented to 0L instead. 1195 * destroyed. It will be hidden and reparented to 0L instead.
1193 */ 1196 */
1194 virtual void unplug( QWidget *w ); 1197 virtual void unplug( QWidget *w );
1195protected slots: 1198protected slots:
1196 void slotToolbarDestroyed(); 1199 void slotToolbarDestroyed();
1197private: 1200private:
1198 QGuardedPtr<QWidget> m_widget; 1201 QPointer<QWidget> m_widget;
1199 bool m_autoSized; 1202 bool m_autoSized;
1200protected: 1203protected:
1201 virtual void virtual_hook( int id, void* data ); 1204 virtual void virtual_hook( int id, void* data );
1202private: 1205private:
1203 class KWidgetActionPrivate; 1206 class KWidgetActionPrivate;
1204 KWidgetActionPrivate *d; 1207 KWidgetActionPrivate *d;
1205}; 1208};
1206 1209
1207class KActionSeparator : public KAction 1210class KActionSeparator : public KAction
1208{ 1211{
1209 Q_OBJECT 1212 Q_OBJECT
1210public: 1213public:
diff --git a/microkde/kdeui/kactioncollection.cpp b/microkde/kdeui/kactioncollection.cpp
index 69e5d02..4d66c7f 100644
--- a/microkde/kdeui/kactioncollection.cpp
+++ b/microkde/kdeui/kactioncollection.cpp
@@ -17,36 +17,38 @@
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details. 18 Library General Public License for more details.
19 19
20 You should have received a copy of the GNU Library General Public License 20 You should have received a copy of the GNU Library General Public License
21 along with this library; see the file COPYING.LIB. If not, write to 21 along with this library; see the file COPYING.LIB. If not, write to
22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. 23 Boston, MA 02111-1307, USA.
24*/ 24*/
25 25
26#include "kactioncollection.h" 26#include "kactioncollection.h"
27//US#include "kactionshortcutlist.h" 27//US#include "kactionshortcutlist.h"
28 28
29#include <qptrdict.h> 29#include <q3ptrdict.h>
30//Added by qt3to4:
31#include <Q3ValueList>
30//US#include <qvariant.h> 32//US#include <qvariant.h>
31 33
32//US#include <kaccel.h> 34//US#include <kaccel.h>
33//US#include <kaccelbase.h> 35//US#include <kaccelbase.h>
34//US#include <kapplication.h> 36//US#include <kapplication.h>
35#include <kdebug.h> 37#include <kdebug.h>
36//US#include <kxmlguifactory.h> 38//US#include <kxmlguifactory.h>
37 39
38//US I included the following files 40//US I included the following files
39#include <qasciidict.h> 41#include <q3asciidict.h>
40#include <qptrlist.h> 42#include <q3ptrlist.h>
41#include "kaction.h" 43#include "kaction.h"
42#include <kglobal.h> 44#include <kglobal.h>
43#include <qobject.h> 45#include <qobject.h>
44#include <qwidget.h> 46#include <qwidget.h>
45 47
46class KActionCollection::KActionCollectionPrivate 48class KActionCollection::KActionCollectionPrivate
47{ 49{
48public: 50public:
49 KActionCollectionPrivate() 51 KActionCollectionPrivate()
50 { 52 {
51//US m_instance = 0; 53//US m_instance = 0;
52 //m_bOneKAccelOnly = false; 54 //m_bOneKAccelOnly = false;
@@ -58,31 +60,31 @@ public:
58 m_highlight = false; 60 m_highlight = false;
59 m_currentHighlightAction = 0; 61 m_currentHighlightAction = 0;
60 m_statusCleared = true; 62 m_statusCleared = true;
61 } 63 }
62 64
63//US KInstance *m_instance; 65//US KInstance *m_instance;
64//US QString m_sXMLFile; 66//US QString m_sXMLFile;
65 bool m_bAutoConnectShortcuts; 67 bool m_bAutoConnectShortcuts;
66 //bool m_bOneKAccelOnly; 68 //bool m_bOneKAccelOnly;
67 //int m_iWidgetCurrent; 69 //int m_iWidgetCurrent;
68 //QValueList<QWidget*> m_widgetList; 70 //QValueList<QWidget*> m_widgetList;
69 //QValueList<KAccel*> m_kaccelList; 71 //QValueList<KAccel*> m_kaccelList;
70 QValueList<KActionCollection*> m_docList; 72 Q3ValueList<KActionCollection*> m_docList;
71 QWidget *m_widget; 73 QWidget *m_widget;
72 KAccel *m_kaccel; 74 KAccel *m_kaccel;
73 KAccel *m_builderKAccel; 75 KAccel *m_builderKAccel;
74 76
75 QAsciiDict<KAction> m_actionDict; 77 Q3AsciiDict<KAction> m_actionDict;
76 QPtrDict< QPtrList<KAction> > m_dctHighlightContainers; 78 Q3PtrDict< Q3PtrList<KAction> > m_dctHighlightContainers;
77 bool m_highlight; 79 bool m_highlight;
78 KAction *m_currentHighlightAction; 80 KAction *m_currentHighlightAction;
79 bool m_statusCleared; 81 bool m_statusCleared;
80}; 82};
81 83
82KActionCollection::KActionCollection( QWidget *parent, const char *name /*US, 84KActionCollection::KActionCollection( QWidget *parent, const char *name /*US,
83 KInstance *instance */) 85 KInstance *instance */)
84 : QObject( (QObject*)parent, name ) 86 : QObject( (QObject*)parent, name )
85{ 87{
86 kdDebug(129) << "KActionCollection::KActionCollection( " << parent << ", " << name << " ): this = " << this << endl; // ellis 88 kdDebug(129) << "KActionCollection::KActionCollection( " << parent << ", " << name << " ): this = " << this << endl; // ellis
87 d = new KActionCollectionPrivate; 89 d = new KActionCollectionPrivate;
88 if( parent ) 90 if( parent )
@@ -124,25 +126,25 @@ KActionCollection::KActionCollection( QObject *parent, const char *name /*US,
124KActionCollection::KActionCollection( const KActionCollection &copy ) 126KActionCollection::KActionCollection( const KActionCollection &copy )
125 : QObject() 127 : QObject()
126{ 128{
127 kdWarning(129) << "KActionCollection::KActionCollection( const KActionCollection & ): function is severely deprecated." << endl; 129 kdWarning(129) << "KActionCollection::KActionCollection( const KActionCollection & ): function is severely deprecated." << endl;
128 d = new KActionCollectionPrivate; 130 d = new KActionCollectionPrivate;
129 *this = copy; 131 *this = copy;
130} 132}
131// KDE 4: remove end 133// KDE 4: remove end
132 134
133KActionCollection::~KActionCollection() 135KActionCollection::~KActionCollection()
134{ 136{
135 kdDebug(129) << "KActionCollection::~KActionCollection(): this = " << this << endl; 137 kdDebug(129) << "KActionCollection::~KActionCollection(): this = " << this << endl;
136 for ( QAsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) { 138 for ( Q3AsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) {
137 KAction* pAction = it.current(); 139 KAction* pAction = it.current();
138 if ( pAction->m_parentCollection == this ) 140 if ( pAction->m_parentCollection == this )
139 pAction->m_parentCollection = 0L; 141 pAction->m_parentCollection = 0L;
140 } 142 }
141 143
142//US delete d->m_kaccel; 144//US delete d->m_kaccel;
143//US delete d->m_builderKAccel; 145//US delete d->m_builderKAccel;
144 delete d; d = 0; 146 delete d; d = 0;
145} 147}
146 148
147void KActionCollection::setWidget( QWidget* w ) 149void KActionCollection::setWidget( QWidget* w )
148{ 150{
@@ -356,118 +358,118 @@ KAction* KActionCollection::_take( KAction* action )
356 } 358 }
357 359
358 KAction *a = d->m_actionDict.take( name ); 360 KAction *a = d->m_actionDict.take( name );
359 if ( !a || a != action ) 361 if ( !a || a != action )
360 return 0; 362 return 0;
361 363
362 emit removed( action ); 364 emit removed( action );
363 return a; 365 return a;
364} 366}
365 367
366void KActionCollection::_clear() 368void KActionCollection::_clear()
367{ 369{
368 QAsciiDictIterator<KAction> it( d->m_actionDict ); 370 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
369 while ( it.current() ) 371 while ( it.current() )
370 _remove( it.current() ); 372 _remove( it.current() );
371} 373}
372 374
373void KActionCollection::insert( KAction* action ) { _insert( action ); } 375void KActionCollection::insert( KAction* action ) { _insert( action ); }
374void KActionCollection::remove( KAction* action ) { _remove( action ); } 376void KActionCollection::remove( KAction* action ) { _remove( action ); }
375KAction* KActionCollection::take( KAction* action ) { return _take( action ); } 377KAction* KActionCollection::take( KAction* action ) { return _take( action ); }
376void KActionCollection::clear() { _clear(); } 378void KActionCollection::clear() { _clear(); }
377KAccel* KActionCollection::accel() { return kaccel(); } 379KAccel* KActionCollection::accel() { return kaccel(); }
378const KAccel* KActionCollection::accel() const { return kaccel(); } 380const KAccel* KActionCollection::accel() const { return kaccel(); }
379KAccel* KActionCollection::builderKAccel() const { return d->m_builderKAccel; } 381KAccel* KActionCollection::builderKAccel() const { return d->m_builderKAccel; }
380 382
381KAction* KActionCollection::action( const char* name, const char* classname ) const 383KAction* KActionCollection::action( const char* name, const char* classname ) const
382{ 384{
383 KAction* pAction = 0; 385 KAction* pAction = 0;
384 386
385 if ( !classname && name ) 387 if ( !classname && name )
386 pAction = d->m_actionDict[ name ]; 388 pAction = d->m_actionDict[ name ];
387 389
388 else { 390 else {
389 QAsciiDictIterator<KAction> it( d->m_actionDict ); 391 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
390 for( ; it.current(); ++it ) 392 for( ; it.current(); ++it )
391 { 393 {
392 if ( ( !name || strcmp( it.current()->name(), name ) == 0 ) && 394 if ( ( !name || strcmp( it.current()->name(), name ) == 0 ) &&
393 ( !classname || strcmp( it.current()->className(), classname ) == 0 ) ) { 395 ( !classname || strcmp( it.current()->className(), classname ) == 0 ) ) {
394 pAction = it.current(); 396 pAction = it.current();
395 break; 397 break;
396 } 398 }
397 } 399 }
398 } 400 }
399 401
400 if( !pAction ) { 402 if( !pAction ) {
401 for( uint i = 0; i < d->m_docList.count() && !pAction; i++ ) 403 for( uint i = 0; i < d->m_docList.count() && !pAction; i++ )
402 pAction = d->m_docList[i]->action( name, classname ); 404 pAction = d->m_docList[i]->action( name, classname );
403 } 405 }
404 406
405 return pAction; 407 return pAction;
406} 408}
407 409
408KAction* KActionCollection::action( int index ) const 410KAction* KActionCollection::action( int index ) const
409{ 411{
410 QAsciiDictIterator<KAction> it( d->m_actionDict ); 412 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
411 it += index; 413 it += index;
412 return it.current(); 414 return it.current();
413// return d->m_actions.at( index ); 415// return d->m_actions.at( index );
414} 416}
415/*US 417/*US
416bool KActionCollection::readShortcutSettings( const QString& sConfigGroup, KConfigBase* pConfig ) 418bool KActionCollection::readShortcutSettings( const QString& sConfigGroup, KConfigBase* pConfig )
417{ 419{
418 return KActionShortcutList(this).readSettings( sConfigGroup, pConfig ); 420 return KActionShortcutList(this).readSettings( sConfigGroup, pConfig );
419} 421}
420 422
421bool KActionCollection::writeShortcutSettings( const QString& sConfigGroup, KConfigBase* pConfig ) const 423bool KActionCollection::writeShortcutSettings( const QString& sConfigGroup, KConfigBase* pConfig ) const
422{ 424{
423 return KActionShortcutList((KActionCollection*)this).writeSettings( sConfigGroup, pConfig ); 425 return KActionShortcutList((KActionCollection*)this).writeSettings( sConfigGroup, pConfig );
424} 426}
425*/ 427*/
426uint KActionCollection::count() const 428uint KActionCollection::count() const
427{ 429{
428 return d->m_actionDict.count(); 430 return d->m_actionDict.count();
429} 431}
430 432
431QStringList KActionCollection::groups() const 433QStringList KActionCollection::groups() const
432{ 434{
433 QStringList lst; 435 QStringList lst;
434 436
435 QAsciiDictIterator<KAction> it( d->m_actionDict ); 437 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
436 for( ; it.current(); ++it ) 438 for( ; it.current(); ++it )
437 if ( !it.current()->group().isEmpty() && !lst.contains( it.current()->group() ) ) 439 if ( !it.current()->group().isEmpty() && !lst.contains( it.current()->group() ) )
438 lst.append( it.current()->group() ); 440 lst.append( it.current()->group() );
439 441
440 return lst; 442 return lst;
441} 443}
442 444
443KActionPtrList KActionCollection::actions( const QString& group ) const 445KActionPtrList KActionCollection::actions( const QString& group ) const
444{ 446{
445 KActionPtrList lst; 447 KActionPtrList lst;
446 448
447 QAsciiDictIterator<KAction> it( d->m_actionDict ); 449 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
448 for( ; it.current(); ++it ) 450 for( ; it.current(); ++it )
449 if ( it.current()->group() == group ) 451 if ( it.current()->group() == group )
450 lst.append( it.current() ); 452 lst.append( it.current() );
451 else if ( it.current()->group().isEmpty() && group.isEmpty() ) 453 else if ( it.current()->group().isEmpty() && group.isEmpty() )
452 lst.append( it.current() ); 454 lst.append( it.current() );
453 455
454 return lst; 456 return lst;
455} 457}
456 458
457KActionPtrList KActionCollection::actions() const 459KActionPtrList KActionCollection::actions() const
458{ 460{
459 KActionPtrList lst; 461 KActionPtrList lst;
460 462
461 QAsciiDictIterator<KAction> it( d->m_actionDict ); 463 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
462 for( ; it.current(); ++it ) 464 for( ; it.current(); ++it )
463 lst.append( it.current() ); 465 lst.append( it.current() );
464 466
465 return lst; 467 return lst;
466} 468}
467 469
468/*US we have no instance object. Use KGlobal instead 470/*US we have no instance object. Use KGlobal instead
469void KActionCollection::setInstance( KInstance *instance ) 471void KActionCollection::setInstance( KInstance *instance )
470{ 472{
471 if ( instance ) 473 if ( instance )
472 d->m_instance = instance; 474 d->m_instance = instance;
473qDebug("KActionCollection::setInstance has to be fixed"); 475qDebug("KActionCollection::setInstance has to be fixed");
@@ -499,59 +501,59 @@ void KActionCollection::setHighlightingEnabled( bool enable )
499} 501}
500 502
501bool KActionCollection::highlightingEnabled() const 503bool KActionCollection::highlightingEnabled() const
502{ 504{
503 return d->m_highlight; 505 return d->m_highlight;
504} 506}
505 507
506void KActionCollection::connectHighlight( QWidget *container, KAction *action ) 508void KActionCollection::connectHighlight( QWidget *container, KAction *action )
507{ 509{
508 if ( !d->m_highlight ) 510 if ( !d->m_highlight )
509 return; 511 return;
510 512
511 QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; 513 Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ];
512 514
513 if ( !actionList ) 515 if ( !actionList )
514 { 516 {
515 actionList = new QPtrList<KAction>; 517 actionList = new Q3PtrList<KAction>;
516 518
517 if ( container->inherits( "QPopupMenu" ) ) 519 if ( container->inherits( "Q3PopupMenu" ) )
518 { 520 {
519 connect( container, SIGNAL( highlighted( int ) ), 521 connect( container, SIGNAL( highlighted( int ) ),
520 this, SLOT( slotMenuItemHighlighted( int ) ) ); 522 this, SLOT( slotMenuItemHighlighted( int ) ) );
521 connect( container, SIGNAL( aboutToHide() ), 523 connect( container, SIGNAL( aboutToHide() ),
522 this, SLOT( slotMenuAboutToHide() ) ); 524 this, SLOT( slotMenuAboutToHide() ) );
523 } 525 }
524//US else if ( container->inherits( "KToolBar" ) ) 526//US else if ( container->inherits( "KToolBar" ) )
525 else if ( container->inherits( "QToolBar" ) ) 527 else if ( container->inherits( "Q3ToolBar" ) )
526 { 528 {
527 connect( container, SIGNAL( highlighted( int, bool ) ), 529 connect( container, SIGNAL( highlighted( int, bool ) ),
528 this, SLOT( slotToolBarButtonHighlighted( int, bool ) ) ); 530 this, SLOT( slotToolBarButtonHighlighted( int, bool ) ) );
529 } 531 }
530 532
531 connect( container, SIGNAL( destroyed() ), 533 connect( container, SIGNAL( destroyed() ),
532 this, SLOT( slotDestroyed() ) ); 534 this, SLOT( slotDestroyed() ) );
533 535
534 d->m_dctHighlightContainers.insert( container, actionList ); 536 d->m_dctHighlightContainers.insert( container, actionList );
535 } 537 }
536 538
537 actionList->append( action ); 539 actionList->append( action );
538} 540}
539 541
540void KActionCollection::disconnectHighlight( QWidget *container, KAction *action ) 542void KActionCollection::disconnectHighlight( QWidget *container, KAction *action )
541{ 543{
542 if ( !d->m_highlight ) 544 if ( !d->m_highlight )
543 return; 545 return;
544 546
545 QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; 547 Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ];
546 548
547 if ( !actionList ) 549 if ( !actionList )
548 return; 550 return;
549 551
550 actionList->removeRef( action ); 552 actionList->removeRef( action );
551 553
552 if ( actionList->count() == 0 ) 554 if ( actionList->count() == 0 )
553 d->m_dctHighlightContainers.remove( container ); 555 d->m_dctHighlightContainers.remove( container );
554} 556}
555 557
556void KActionCollection::slotMenuItemHighlighted( int id ) 558void KActionCollection::slotMenuItemHighlighted( int id )
557{ 559{
@@ -616,70 +618,70 @@ void KActionCollection::slotToolBarButtonHighlighted( int id, bool highlight )
616 d->m_currentHighlightAction = 0; 618 d->m_currentHighlightAction = 0;
617// emit clearStatusText(); 619// emit clearStatusText();
618 } 620 }
619} 621}
620 622
621void KActionCollection::slotDestroyed() 623void KActionCollection::slotDestroyed()
622{ 624{
623 d->m_dctHighlightContainers.remove( reinterpret_cast<void *>( const_cast<QObject *>(sender()) ) ); 625 d->m_dctHighlightContainers.remove( reinterpret_cast<void *>( const_cast<QObject *>(sender()) ) );
624} 626}
625 627
626KAction *KActionCollection::findAction( QWidget *container, int id ) 628KAction *KActionCollection::findAction( QWidget *container, int id )
627{ 629{
628 QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ reinterpret_cast<void *>( container ) ]; 630 Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ reinterpret_cast<void *>( container ) ];
629 631
630 if ( !actionList ) 632 if ( !actionList )
631 return 0; 633 return 0;
632 634
633 QPtrListIterator<KAction> it( *actionList ); 635 Q3PtrListIterator<KAction> it( *actionList );
634 for (; it.current(); ++it ) 636 for (; it.current(); ++it )
635 if ( it.current()->isPlugged( container, id ) ) 637 if ( it.current()->isPlugged( container, id ) )
636 return it.current(); 638 return it.current();
637 639
638 return 0; 640 return 0;
639} 641}
640 642
641// KDE 4: remove 643// KDE 4: remove
642KActionCollection KActionCollection::operator+(const KActionCollection &c ) const 644KActionCollection KActionCollection::operator+(const KActionCollection &c ) const
643{ 645{
644 kdWarning(129) << "KActionCollection::operator+(): function is severely deprecated." << endl; 646 kdWarning(129) << "KActionCollection::operator+(): function is severely deprecated." << endl;
645 KActionCollection ret( *this ); 647 KActionCollection ret( *this );
646 648
647 QValueList<KAction *> actions = c.actions(); 649 Q3ValueList<KAction *> actions = c.actions();
648 QValueList<KAction *>::ConstIterator it = actions.begin(); 650 Q3ValueList<KAction *>::ConstIterator it = actions.begin();
649 QValueList<KAction *>::ConstIterator end = actions.end(); 651 Q3ValueList<KAction *>::ConstIterator end = actions.end();
650 for (; it != end; ++it ) 652 for (; it != end; ++it )
651 ret.insert( *it ); 653 ret.insert( *it );
652 654
653 return ret; 655 return ret;
654} 656}
655 657
656KActionCollection &KActionCollection::operator=( const KActionCollection &copy ) 658KActionCollection &KActionCollection::operator=( const KActionCollection &copy )
657{ 659{
658 kdWarning(129) << "KActionCollection::operator=(): function is severely deprecated." << endl; 660 kdWarning(129) << "KActionCollection::operator=(): function is severely deprecated." << endl;
659 //d->m_bOneKAccelOnly = copy.d->m_bOneKAccelOnly; 661 //d->m_bOneKAccelOnly = copy.d->m_bOneKAccelOnly;
660 //d->m_iWidgetCurrent = copy.d->m_iWidgetCurrent; 662 //d->m_iWidgetCurrent = copy.d->m_iWidgetCurrent;
661 //d->m_widgetList = copy.d->m_widgetList; 663 //d->m_widgetList = copy.d->m_widgetList;
662 //d->m_kaccelList = copy.d->m_kaccelList; 664 //d->m_kaccelList = copy.d->m_kaccelList;
663 d->m_widget = copy.d->m_widget; 665 d->m_widget = copy.d->m_widget;
664 d->m_kaccel = copy.d->m_kaccel; 666 d->m_kaccel = copy.d->m_kaccel;
665 d->m_actionDict = copy.d->m_actionDict; 667 d->m_actionDict = copy.d->m_actionDict;
666//US setInstance( copy.instance() ); 668//US setInstance( copy.instance() );
667 return *this; 669 return *this;
668} 670}
669 671
670KActionCollection &KActionCollection::operator+=( const KActionCollection &c ) 672KActionCollection &KActionCollection::operator+=( const KActionCollection &c )
671{ 673{
672 kdWarning(129) << "KActionCollection::operator+=(): function is severely deprecated." << endl; 674 kdWarning(129) << "KActionCollection::operator+=(): function is severely deprecated." << endl;
673 QAsciiDictIterator<KAction> it(c.d->m_actionDict); 675 Q3AsciiDictIterator<KAction> it(c.d->m_actionDict);
674 for ( ; it.current(); ++it ) 676 for ( ; it.current(); ++it )
675 insert( it.current() ); 677 insert( it.current() );
676 678
677 return *this; 679 return *this;
678} 680}
679// KDE 4: remove end 681// KDE 4: remove end
680 682
681//--------------------------------------------------------------------- 683//---------------------------------------------------------------------
682// KActionShortcutList 684// KActionShortcutList
683//--------------------------------------------------------------------- 685//---------------------------------------------------------------------
684/*US 686/*US
685KActionShortcutList::KActionShortcutList( KActionCollection* pColl ) 687KActionShortcutList::KActionShortcutList( KActionCollection* pColl )
diff --git a/microkde/kdeui/kactioncollection.h b/microkde/kdeui/kactioncollection.h
index b9466d0..50cb02a 100644
--- a/microkde/kdeui/kactioncollection.h
+++ b/microkde/kdeui/kactioncollection.h
@@ -21,24 +21,26 @@
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. 22 Boston, MA 02111-1307, USA.
23*/ 23*/
24//$Id$ 24//$Id$
25 25
26#ifndef __kactioncollection_h__ 26#ifndef __kactioncollection_h__
27#define __kactioncollection_h__ 27#define __kactioncollection_h__
28 28
29#include <kaction.h> 29#include <kaction.h>
30 30
31//US #include <qkeysequence.h> 31//US #include <qkeysequence.h>
32#include <qobject.h> 32#include <qobject.h>
33//Added by qt3to4:
34#include <Q3ValueList>
33//US#include <qvaluelist.h> 35//US#include <qvaluelist.h>
34//US#include <qguardedptr.h> 36//US#include <qguardedptr.h>
35//US #include <kguiitem.h> 37//US #include <kguiitem.h>
36//US#include <kshortcut.h> 38//US#include <kshortcut.h>
37//US#include <kstdaction.h> 39//US#include <kstdaction.h>
38//US#include <kicontheme.h> 40//US#include <kicontheme.h>
39 41
40//USclass QMenuBar; 42//USclass QMenuBar;
41//USclass QPopupMenu; 43//USclass QPopupMenu;
42//USclass QComboBox; 44//USclass QComboBox;
43//USclass QPoint; 45//USclass QPoint;
44//USclass QIconSet; 46//USclass QIconSet;
@@ -51,25 +53,25 @@
51//USclass KConfigBase; 53//USclass KConfigBase;
52//USclass KURL; 54//USclass KURL;
53//USclass KInstance; 55//USclass KInstance;
54//USclass KToolBar; 56//USclass KToolBar;
55//USclass KActionCollection; 57//USclass KActionCollection;
56//USclass KPopupMenu; 58//USclass KPopupMenu;
57//USclass KMainWindow; 59//USclass KMainWindow;
58 60
59//US added inclidefiles 61//US added inclidefiles
60class QWidget; 62class QWidget;
61 63
62 64
63typedef QValueList<KAction *> KActionPtrList; 65typedef Q3ValueList<KAction *> KActionPtrList;
64 66
65/** 67/**
66 * A managed set of KAction objects. 68 * A managed set of KAction objects.
67 */ 69 */
68class KActionCollection : public QObject 70class KActionCollection : public QObject
69{ 71{
70 friend class KAction; 72 friend class KAction;
71 friend class KXMLGUIClient; 73 friend class KXMLGUIClient;
72 74
73 Q_OBJECT 75 Q_OBJECT
74public: 76public:
75 KActionCollection( QWidget *parent, const char *name = 0/*US , KInstance *instance = 0 */); 77 KActionCollection( QWidget *parent, const char *name = 0/*US , KInstance *instance = 0 */);
diff --git a/microkde/kdeui/kbuttonbox.cpp b/microkde/kdeui/kbuttonbox.cpp
index 83d622a..3ea6703 100644
--- a/microkde/kdeui/kbuttonbox.cpp
+++ b/microkde/kdeui/kbuttonbox.cpp
@@ -40,49 +40,51 @@
40 * 40 *
41 * 01/09/98 Mario Weilguni <mweilguni@sime.com> 41 * 01/09/98 Mario Weilguni <mweilguni@sime.com>
42 * The last button was to far right away from the right/bottom border. 42 * The last button was to far right away from the right/bottom border.
43 * Fixed this. Removed old code. Buttons get now a minimum width. 43 * Fixed this. Removed old code. Buttons get now a minimum width.
44 * Programmer may now override minimum width and height of a button. 44 * Programmer may now override minimum width and height of a button.
45 * 45 *
46 */ 46 */
47 47
48//US #include "kbuttonbox.moc" 48//US #include "kbuttonbox.moc"
49 49
50#include <kbuttonbox.h> 50#include <kbuttonbox.h>
51#include <qpushbutton.h> 51#include <qpushbutton.h>
52#include <qptrlist.h> 52#include <q3ptrlist.h>
53//Added by qt3to4:
54#include <QResizeEvent>
53#include <assert.h> 55#include <assert.h>
54 56
55#define minButtonWidth 50 57#define minButtonWidth 50
56 58
57class KButtonBox::Item { 59class KButtonBox::Item {
58public: 60public:
59 QPushButton *button; 61 QPushButton *button;
60 bool noexpand; 62 bool noexpand;
61 unsigned short stretch; 63 unsigned short stretch;
62 unsigned short actual_size; 64 unsigned short actual_size;
63}; 65};
64 66
65template class QPtrList<KButtonBox::Item>; 67template class Q3PtrList<KButtonBox::Item>;
66 68
67class KButtonBoxPrivate { 69class KButtonBoxPrivate {
68public: 70public:
69 unsigned short border; 71 unsigned short border;
70 unsigned short autoborder; 72 unsigned short autoborder;
71 unsigned short orientation; 73 unsigned short orientation;
72 bool activated; 74 bool activated;
73 QPtrList<KButtonBox::Item> buttons; 75 Q3PtrList<KButtonBox::Item> buttons;
74}; 76};
75 77
76KButtonBox::KButtonBox(QWidget *parent, Orientation _orientation, 78KButtonBox::KButtonBox(QWidget *parent, Qt::Orientation _orientation,
77 int border, int autoborder) 79 int border, int autoborder)
78 : QWidget(parent) 80 : QWidget(parent)
79{ 81{
80 data = new KButtonBoxPrivate; 82 data = new KButtonBoxPrivate;
81 assert(data != 0); 83 assert(data != 0);
82 84
83 data->orientation = _orientation; 85 data->orientation = _orientation;
84 data->border = border; 86 data->border = border;
85 data->autoborder = autoborder < 0 ? border : autoborder; 87 data->autoborder = autoborder < 0 ? border : autoborder;
86 data->buttons.setAutoDelete(TRUE); 88 data->buttons.setAutoDelete(TRUE);
87} 89}
88 90
@@ -140,25 +142,25 @@ void KButtonBox::layout() {
140 b->setFixedSize(buttonSizeHint(b)); 142 b->setFixedSize(buttonSizeHint(b));
141 else 143 else
142 b->setFixedSize(bs); 144 b->setFixedSize(bs);
143 } 145 }
144 } 146 }
145 147
146 setMinimumSize(sizeHint()); 148 setMinimumSize(sizeHint());
147} 149}
148 150
149void KButtonBox::placeButtons() { 151void KButtonBox::placeButtons() {
150 unsigned int i; 152 unsigned int i;
151 153
152 if(data->orientation == Horizontal) { 154 if(data->orientation == Qt::Horizontal) {
153 // calculate free size and stretches 155 // calculate free size and stretches
154 int fs = width() - 2 * data->border; 156 int fs = width() - 2 * data->border;
155 int stretch = 0; 157 int stretch = 0;
156 for(i = 0; i < data->buttons.count(); i++) { 158 for(i = 0; i < data->buttons.count(); i++) {
157 Item *item = data->buttons.at(i); 159 Item *item = data->buttons.at(i);
158 if(item->button != 0) { 160 if(item->button != 0) {
159 fs -= item->button->width(); 161 fs -= item->button->width();
160 162
161 // Last button? 163 // Last button?
162 if(i != data->buttons.count() - 1) 164 if(i != data->buttons.count() - 1)
163 fs -= data->autoborder; 165 fs -= data->autoborder;
164 } else 166 } else
@@ -242,44 +244,44 @@ QSize KButtonBox::sizeHint() const {
242 QSize bs = bestButtonSize(); 244 QSize bs = bestButtonSize();
243 for(i = 0; i < data->buttons.count(); i++) { 245 for(i = 0; i < data->buttons.count(); i++) {
244 KButtonBox *that = (KButtonBox*)this; 246 KButtonBox *that = (KButtonBox*)this;
245 Item *item = that->data->buttons.at(i); 247 Item *item = that->data->buttons.at(i);
246 QPushButton *b = item->button; 248 QPushButton *b = item->button;
247 if(b != 0) { 249 if(b != 0) {
248 QSize s; 250 QSize s;
249 if(item->noexpand) 251 if(item->noexpand)
250 s = that->buttonSizeHint(b); 252 s = that->buttonSizeHint(b);
251 else 253 else
252 s = bs; 254 s = bs;
253 255
254 if(data->orientation == Horizontal) 256 if(data->orientation == Qt::Horizontal)
255 dw += s.width(); 257 dw += s.width();
256 else 258 else
257 dw += s.height(); 259 dw += s.height();
258 260
259 if( i != data->buttons.count() - 1 ) 261 if( i != data->buttons.count() - 1 )
260 dw += data->autoborder; 262 dw += data->autoborder;
261 } 263 }
262 } 264 }
263 265
264 if(data->orientation == Horizontal) 266 if(data->orientation == Qt::Horizontal)
265 return QSize(dw, bs.height() + 2 * data->border); 267 return QSize(dw, bs.height() + 2 * data->border);
266 else 268 else
267 return QSize(bs.width() + 2 * data->border, dw); 269 return QSize(bs.width() + 2 * data->border, dw);
268 } 270 }
269} 271}
270 272
271QSizePolicy KButtonBox::sizePolicy() const 273QSizePolicy KButtonBox::sizePolicy() const
272{ 274{
273 return data->orientation == Horizontal? 275 return data->orientation == Qt::Horizontal?
274 QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) : 276 QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) :
275 QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); 277 QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum );
276} 278}
277 279
278/* 280/*
279 * Returns the best size for a button. If a button is less than 281 * Returns the best size for a button. If a button is less than
280 * minButtonWidth pixels wide, return minButtonWidth pixels 282 * minButtonWidth pixels wide, return minButtonWidth pixels
281 * as minimum width 283 * as minimum width
282 */ 284 */
283QSize KButtonBox::buttonSizeHint(QPushButton *b) const { 285QSize KButtonBox::buttonSizeHint(QPushButton *b) const {
284 QSize s = b->sizeHint(); 286 QSize s = b->sizeHint();
285 QSize ms = b->minimumSize(); 287 QSize ms = b->minimumSize();
diff --git a/microkde/kdeui/kbuttonbox.h b/microkde/kdeui/kbuttonbox.h
index 1104366..2e0f41d 100644
--- a/microkde/kdeui/kbuttonbox.h
+++ b/microkde/kdeui/kbuttonbox.h
@@ -12,24 +12,26 @@
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#ifndef __KBUTTONBOX__H__ 20#ifndef __KBUTTONBOX__H__
21#define __KBUTTONBOX__H__ 21#define __KBUTTONBOX__H__
22 22
23#include <qwidget.h> 23#include <qwidget.h>
24//Added by qt3to4:
25#include <QResizeEvent>
24class QPushButton; 26class QPushButton;
25 27
26class KButtonBoxPrivate; 28class KButtonBoxPrivate;
27/** 29/**
28 * Container widget for buttons. 30 * Container widget for buttons.
29 * 31 *
30 * This class uses Qt layout control to place the buttons; can handle 32 * This class uses Qt layout control to place the buttons; can handle
31 * both vertical and horizontal button placement. The default border 33 * both vertical and horizontal button placement. The default border
32 * is now @p 0 (making it easier to deal with layouts). The space 34 * is now @p 0 (making it easier to deal with layouts). The space
33 * between buttons is now more Motif compliant. 35 * between buttons is now more Motif compliant.
34 * 36 *
35 * @author Mario Weilguni <mweilguni@sime.com> 37 * @author Mario Weilguni <mweilguni@sime.com>
@@ -39,25 +41,25 @@ class KButtonBoxPrivate;
39class KButtonBox : public QWidget 41class KButtonBox : public QWidget
40{ 42{
41 Q_OBJECT 43 Q_OBJECT
42 44
43public: 45public:
44 /** 46 /**
45 * Create an empty container for buttons. 47 * Create an empty container for buttons.
46 * 48 *
47 * If @p _orientation is @p Vertical, the buttons inserted with 49 * If @p _orientation is @p Vertical, the buttons inserted with
48 * @ref addButton() are laid out from top to bottom, otherwise they 50 * @ref addButton() are laid out from top to bottom, otherwise they
49 * are laid out from left to right. 51 * are laid out from left to right.
50 */ 52 */
51 KButtonBox(QWidget *parent, Orientation _orientation = Horizontal, 53 KButtonBox(QWidget *parent, Qt::Orientation _orientation = Qt::Horizontal,
52 int border = 0, int _autoborder = 6); 54 int border = 0, int _autoborder = 6);
53 55
54 /** 56 /**
55 * Free private data field 57 * Free private data field
56 */ 58 */
57 ~KButtonBox(); 59 ~KButtonBox();
58 60
59 /** 61 /**
60 * @return The minimum size needed to fit all buttons. 62 * @return The minimum size needed to fit all buttons.
61 * 63 *
62 * This size is 64 * This size is
63 * calculated by the width/height of all buttons plus border/autoborder. 65 * calculated by the width/height of all buttons plus border/autoborder.
diff --git a/microkde/kdeui/kguiitem.cpp b/microkde/kdeui/kguiitem.cpp
index 828c5e6..c91ffb7 100644
--- a/microkde/kdeui/kguiitem.cpp
+++ b/microkde/kdeui/kguiitem.cpp
@@ -11,25 +11,25 @@
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qregexp.h> 21#include <qregexp.h>
22#include <qstring.h> 22#include <qstring.h>
23#include <qiconset.h> 23#include <qicon.h>
24#include <qpixmap.h> 24#include <qpixmap.h>
25 25
26#include <assert.h> 26#include <assert.h>
27//US #include <kiconloader.h> 27//US #include <kiconloader.h>
28#include <kdebug.h> 28#include <kdebug.h>
29 29
30#include "kguiitem.h" 30#include "kguiitem.h"
31 31
32class KGuiItem::KGuiItemPrivate 32class KGuiItem::KGuiItemPrivate
33{ 33{
34public: 34public:
35 KGuiItemPrivate() 35 KGuiItemPrivate()
@@ -53,45 +53,45 @@ public:
53 m_statusText = rhs.m_statusText; 53 m_statusText = rhs.m_statusText;
54 m_enabled = rhs.m_enabled; 54 m_enabled = rhs.m_enabled;
55 m_hasIcon = rhs.m_hasIcon; 55 m_hasIcon = rhs.m_hasIcon;
56 56
57 return *this; 57 return *this;
58 } 58 }
59 59
60 QString m_text; 60 QString m_text;
61 QString m_toolTip; 61 QString m_toolTip;
62 QString m_whatsThis; 62 QString m_whatsThis;
63 QString m_statusText; 63 QString m_statusText;
64 QString m_iconName; 64 QString m_iconName;
65 QIconSet m_iconSet; 65 QIcon m_iconSet;
66 bool m_hasIcon : 1; 66 bool m_hasIcon : 1;
67 bool m_enabled : 1; 67 bool m_enabled : 1;
68}; 68};
69 69
70 70
71KGuiItem::KGuiItem() { 71KGuiItem::KGuiItem() {
72 d = new KGuiItemPrivate; 72 d = new KGuiItemPrivate;
73} 73}
74 74
75KGuiItem::KGuiItem( const QString &text, const QString &iconName, 75KGuiItem::KGuiItem( const QString &text, const QString &iconName,
76 const QString &toolTip, const QString &whatsThis ) 76 const QString &toolTip, const QString &whatsThis )
77{ 77{
78 d = new KGuiItemPrivate; 78 d = new KGuiItemPrivate;
79 d->m_text = text; 79 d->m_text = text;
80 d->m_toolTip = toolTip; 80 d->m_toolTip = toolTip;
81 d->m_whatsThis = whatsThis; 81 d->m_whatsThis = whatsThis;
82 setIconName( iconName ); 82 setIconName( iconName );
83} 83}
84 84
85KGuiItem::KGuiItem( const QString &text, const QIconSet &iconSet, 85KGuiItem::KGuiItem( const QString &text, const QIcon &iconSet,
86 const QString &toolTip, const QString &whatsThis ) 86 const QString &toolTip, const QString &whatsThis )
87{ 87{
88 d = new KGuiItemPrivate; 88 d = new KGuiItemPrivate;
89 d->m_text = text; 89 d->m_text = text;
90 d->m_toolTip = toolTip; 90 d->m_toolTip = toolTip;
91 d->m_whatsThis = whatsThis; 91 d->m_whatsThis = whatsThis;
92 setIconSet( iconSet ); 92 setIconSet( iconSet );
93} 93}
94 94
95KGuiItem::KGuiItem( const KGuiItem &rhs ) 95KGuiItem::KGuiItem( const KGuiItem &rhs )
96 : d( 0 ) 96 : d( 0 )
97{ 97{
@@ -115,49 +115,49 @@ KGuiItem::~KGuiItem() {
115} 115}
116 116
117QString KGuiItem::text() const { 117QString KGuiItem::text() const {
118 return d->m_text; 118 return d->m_text;
119} 119}
120QString KGuiItem::plainText() const { 120QString KGuiItem::plainText() const {
121 QString stripped( d->m_text ); 121 QString stripped( d->m_text );
122 stripped.replace( QRegExp( "&(?!&)" ), QString::null ); 122 stripped.replace( QRegExp( "&(?!&)" ), QString::null );
123 123
124 return stripped; 124 return stripped;
125} 125}
126 126
127QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const 127QIcon KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const
128{ 128{
129 if( d->m_hasIcon ) 129 if( d->m_hasIcon )
130 { 130 {
131 if( !d->m_iconName.isEmpty()) 131 if( !d->m_iconName.isEmpty())
132 { 132 {
133// some caching here would(?) come handy 133// some caching here would(?) come handy
134//US return instance->iconLoader()->loadIconSet( d->m_iconName, group, size ); 134//US return instance->iconLoader()->loadIconSet( d->m_iconName, group, size );
135 return KGlobal::iconLoader()->loadIconSet( d->m_iconName); 135 return KGlobal::iconLoader()->loadIconSet( d->m_iconName);
136// here is a little problem that with delayed icon loading 136// here is a little problem that with delayed icon loading
137// we can't check if the icon really exists ... so what ... 137// we can't check if the icon really exists ... so what ...
138// if( set.isNull() ) 138// if( set.isNull() )
139// { 139// {
140// d->m_hasIcon = false; 140// d->m_hasIcon = false;
141// return QIconSet(); 141// return QIconSet();
142// } 142// }
143// return set; 143// return set;
144 } 144 }
145 else 145 else
146 { 146 {
147 return d->m_iconSet; 147 return d->m_iconSet;
148 } 148 }
149 } 149 }
150 else 150 else
151 return QIconSet(); 151 return QIcon();
152} 152}
153 153
154QString KGuiItem::iconName() const 154QString KGuiItem::iconName() const
155{ 155{
156 return d->m_iconName; 156 return d->m_iconName;
157} 157}
158 158
159QString KGuiItem::toolTip() const { 159QString KGuiItem::toolTip() const {
160 return d->m_toolTip; 160 return d->m_toolTip;
161} 161}
162QString KGuiItem::whatsThis() const { 162QString KGuiItem::whatsThis() const {
163 return d->m_whatsThis; 163 return d->m_whatsThis;
@@ -168,35 +168,35 @@ bool KGuiItem::isEnabled() const
168 return d->m_enabled; 168 return d->m_enabled;
169} 169}
170 170
171bool KGuiItem::hasIcon() const 171bool KGuiItem::hasIcon() const
172{ 172{
173 return d->m_hasIcon; 173 return d->m_hasIcon;
174} 174}
175 175
176void KGuiItem::setText( const QString &text ) { 176void KGuiItem::setText( const QString &text ) {
177 d->m_text=text; 177 d->m_text=text;
178} 178}
179 179
180void KGuiItem::setIconSet( const QIconSet &iconset ) 180void KGuiItem::setIconSet( const QIcon &iconset )
181{ 181{
182 d->m_iconSet = iconset; 182 d->m_iconSet = iconset;
183 d->m_iconName = QString::null; 183 d->m_iconName = QString::null;
184 d->m_hasIcon = !iconset.isNull(); 184 d->m_hasIcon = !iconset.isNull();
185} 185}
186 186
187void KGuiItem::setIconName( const QString &iconName ) 187void KGuiItem::setIconName( const QString &iconName )
188{ 188{
189 d->m_iconName = iconName; 189 d->m_iconName = iconName;
190 d->m_iconSet = QIconSet(); 190 d->m_iconSet = QIcon();
191 d->m_hasIcon = !iconName.isEmpty(); 191 d->m_hasIcon = !iconName.isEmpty();
192} 192}
193 193
194void KGuiItem::setToolTip( const QString &toolTip) { 194void KGuiItem::setToolTip( const QString &toolTip) {
195 d->m_toolTip = toolTip; 195 d->m_toolTip = toolTip;
196} 196}
197void KGuiItem::setWhatsThis( const QString &whatsThis ) { 197void KGuiItem::setWhatsThis( const QString &whatsThis ) {
198 d->m_whatsThis = whatsThis; 198 d->m_whatsThis = whatsThis;
199} 199}
200void KGuiItem::setEnabled( bool enabled ){ 200void KGuiItem::setEnabled( bool enabled ){
201 d->m_enabled = enabled; 201 d->m_enabled = enabled;
202} 202}
diff --git a/microkde/kdeui/kguiitem.h b/microkde/kdeui/kguiitem.h
index 0079bb4..6f92137 100644
--- a/microkde/kdeui/kguiitem.h
+++ b/microkde/kdeui/kguiitem.h
@@ -14,71 +14,71 @@
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18 18
19 Many thanks to Simon tronical Hausmann 19 Many thanks to Simon tronical Hausmann
20*/ 20*/
21 21
22#ifndef __kguiitem_h__ 22#ifndef __kguiitem_h__
23#define __kguiitem_h__ 23#define __kguiitem_h__
24 24
25#include <qstring.h> 25#include <qstring.h>
26#include <qiconset.h> 26#include <qicon.h>
27#include <qpixmap.h> 27#include <qpixmap.h>
28#include <qvaluelist.h> 28#include <q3valuelist.h>
29//US#include <kicontheme.h> 29//US#include <kicontheme.h>
30#include <kglobal.h> 30#include <kglobal.h>
31 31
32//US added the following files 32//US added the following files
33#include <kiconloader.h> 33#include <kiconloader.h>
34 34
35class KGuiItem 35class KGuiItem
36{ 36{
37public: 37public:
38 KGuiItem(); 38 KGuiItem();
39 39
40 KGuiItem( const QString &text, 40 KGuiItem( const QString &text,
41 const QString &iconName = QString::null, 41 const QString &iconName = QString::null,
42 const QString &toolTip = QString::null, 42 const QString &toolTip = QString::null,
43 const QString &whatsThis = QString::null ); 43 const QString &whatsThis = QString::null );
44 44
45 KGuiItem( const QString &text, const QIconSet &iconSet, 45 KGuiItem( const QString &text, const QIcon &iconSet,
46 const QString &toolTip = QString::null, 46 const QString &toolTip = QString::null,
47 const QString &whatsThis = QString::null ); 47 const QString &whatsThis = QString::null );
48 48
49 KGuiItem( const KGuiItem &rhs ); 49 KGuiItem( const KGuiItem &rhs );
50 KGuiItem &operator=( const KGuiItem &rhs ); 50 KGuiItem &operator=( const KGuiItem &rhs );
51 51
52 ~KGuiItem(); 52 ~KGuiItem();
53 53
54 QString text() const; 54 QString text() const;
55 QString plainText() const; 55 QString plainText() const;
56 QIconSet iconSet( KIcon::Group, int size = 0/*US , KInstance* instance = KGlobal::instance()*/) const; 56 QIcon iconSet( KIcon::Group, int size = 0/*US , KInstance* instance = KGlobal::instance()*/) const;
57 57
58#ifndef KDE_NO_COMPAT 58#ifndef KDE_NO_COMPAT
59 QIconSet iconSet() const { return iconSet( KIcon::Small); } 59 QIcon iconSet() const { return iconSet( KIcon::Small); }
60#endif 60#endif
61 61
62 QString iconName() const; 62 QString iconName() const;
63 QString toolTip() const; 63 QString toolTip() const;
64 QString whatsThis() const; 64 QString whatsThis() const;
65 bool isEnabled() const; 65 bool isEnabled() const;
66 bool hasIcon() const; 66 bool hasIcon() const;
67#ifndef KDE_NO_COMPAT 67#ifndef KDE_NO_COMPAT
68 bool hasIconSet() const { return hasIcon(); } 68 bool hasIconSet() const { return hasIcon(); }
69#endif 69#endif
70 70
71 void setText( const QString &text ); 71 void setText( const QString &text );
72 void setIconSet( const QIconSet &iconset ); 72 void setIconSet( const QIcon &iconset );
73 void setIconName( const QString &iconName ); 73 void setIconName( const QString &iconName );
74 void setToolTip( const QString &tooltip ); 74 void setToolTip( const QString &tooltip );
75 void setWhatsThis( const QString &whatsThis ); 75 void setWhatsThis( const QString &whatsThis );
76 void setEnabled( bool enable ); 76 void setEnabled( bool enable );
77 77
78private: 78private:
79 class KGuiItemPrivate; 79 class KGuiItemPrivate;
80 KGuiItemPrivate *d; 80 KGuiItemPrivate *d;
81}; 81};
82 82
83/* vim: et sw=4 83/* vim: et sw=4
84 */ 84 */
diff --git a/microkde/kdeui/kjanuswidget.cpp b/microkde/kdeui/kjanuswidget.cpp
index 462c44f..3d9173d 100644
--- a/microkde/kdeui/kjanuswidget.cpp
+++ b/microkde/kdeui/kjanuswidget.cpp
@@ -13,33 +13,41 @@
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA. 18 * Boston, MA 02111-1307, USA.
19 */ 19 */
20 20
21#include <qpixmap.h> 21#include <qpixmap.h>
22#include <qbitmap.h> 22#include <qbitmap.h>
23#include <qlayout.h> 23#include <qlayout.h>
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qwidgetstack.h> 25#include <q3widgetstack.h>
26#include <qtabwidget.h> 26#include <qtabwidget.h>
27#include <qlistview.h> 27#include <q3listview.h>
28#include <qhbox.h> 28#include <q3hbox.h>
29#include <qvbox.h> 29#include <q3vbox.h>
30#include <qgrid.h> 30#include <q3grid.h>
31#include <qpainter.h> 31#include <qpainter.h>
32#include <qobjectlist.h> 32#include <qobject.h>
33#include <qstringlist.h> 33#include <qstringlist.h>
34//Added by qt3to4:
35#include <Q3HBoxLayout>
36#include <Q3GridLayout>
37#include <Q3PtrList>
38#include <Q3Frame>
39#include <QEvent>
40#include <Q3VBoxLayout>
41#include <QShowEvent>
34/*US 42/*US
35#include <qbitmap.h> 43#include <qbitmap.h>
36#include <qgrid.h> 44#include <qgrid.h>
37#include <qhbox.h> 45#include <qhbox.h>
38#include <qheader.h> 46#include <qheader.h>
39#include <qlabel.h> 47#include <qlabel.h>
40#include <qlayout.h> 48#include <qlayout.h>
41#include <qobjectlist.h> 49#include <qobjectlist.h>
42#include <qpixmap.h> 50#include <qpixmap.h>
43#include <qsplitter.h> 51#include <qsplitter.h>
44#include <qtabwidget.h> 52#include <qtabwidget.h>
45#include <qvbox.h> 53#include <qvbox.h>
@@ -56,31 +64,31 @@
56#include "kjanuswidget.h" 64#include "kjanuswidget.h"
57#include <klistview.h> 65#include <klistview.h>
58 66
59*/ 67*/
60 68
61#include <kseparator.h> 69#include <kseparator.h>
62#include <kdialog.h> // Access to some static members 70#include <kdialog.h> // Access to some static members
63#include <kdebug.h> 71#include <kdebug.h>
64#include <klistview.h> 72#include <klistview.h>
65 73
66#include "kjanuswidget.h" 74#include "kjanuswidget.h"
67 75
68class KJanusWidget::IconListItem : public QListBoxItem 76class KJanusWidget::IconListItem : public Q3ListBoxItem
69{ 77{
70 public: 78 public:
71 IconListItem( QListBox *listbox, const QPixmap &pixmap, 79 IconListItem( Q3ListBox *listbox, const QPixmap &pixmap,
72 const QString &text ); 80 const QString &text );
73 virtual int height( const QListBox *lb ) const; 81 virtual int height( const Q3ListBox *lb ) const;
74 virtual int width( const QListBox *lb ) const; 82 virtual int width( const Q3ListBox *lb ) const;
75 int expandMinimumWidth( int width ); 83 int expandMinimumWidth( int width );
76 84
77 protected: 85 protected:
78 const QPixmap &defaultPixmap(); 86 const QPixmap &defaultPixmap();
79 void paint( QPainter *painter ); 87 void paint( QPainter *painter );
80 88
81 private: 89 private:
82 QPixmap mPixmap; 90 QPixmap mPixmap;
83 int mMinimumWidth; 91 int mMinimumWidth;
84}; 92};
85 93
86class KJanusWidget::KJanusWidgetPrivate 94class KJanusWidget::KJanusWidgetPrivate
@@ -89,39 +97,39 @@ public:
89 KJanusWidgetPrivate() : mNextPageIndex(0) { } 97 KJanusWidgetPrivate() : mNextPageIndex(0) { }
90 98
91 int mNextPageIndex; // The next page index. 99 int mNextPageIndex; // The next page index.
92 100
93 // Dictionary for multipage modes. 101 // Dictionary for multipage modes.
94 QMap<int,QWidget*> mIntToPage; 102 QMap<int,QWidget*> mIntToPage;
95 // Reverse dictionary. Used because showPage() may be performance critical. 103 // Reverse dictionary. Used because showPage() may be performance critical.
96 QMap<QWidget*,int> mPageToInt; 104 QMap<QWidget*,int> mPageToInt;
97 // Dictionary of title string associated with page. 105 // Dictionary of title string associated with page.
98 QMap<int, QString> mIntToTitle; 106 QMap<int, QString> mIntToTitle;
99}; 107};
100 108
101template class QPtrList<QListViewItem>; 109template class Q3PtrList<Q3ListViewItem>;
102 110
103 111
104KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) 112KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face )
105 : QWidget( parent, name ), 113 : QWidget( parent, name ),
106 mValid(false), mPageList(0), 114 mValid(false), mPageList(0),
107 mTitleList(0), mFace(face), mTitleLabel(0), mActivePageWidget(0), 115 mTitleList(0), mFace(face), mTitleLabel(0), mActivePageWidget(0),
108 mShowIconsInTreeList(false), d(0) 116 mShowIconsInTreeList(false), d(0)
109{ 117{
110 QVBoxLayout *topLayout = new QVBoxLayout( this ); 118 Q3VBoxLayout *topLayout = new Q3VBoxLayout( this );
111 if( mFace == TreeList || mFace == IconList ) 119 if( mFace == TreeList || mFace == IconList )
112 { 120 {
113 d = new KJanusWidgetPrivate; 121 d = new KJanusWidgetPrivate;
114 122
115 QFrame *page = 0; 123 Q3Frame *page = 0;
116 if( mFace == TreeList ) 124 if( mFace == TreeList )
117 { 125 {
118 //US 126 //US
119 qDebug("KJanusWidget::KJanusWidget TreeList not implemented yet"); 127 qDebug("KJanusWidget::KJanusWidget TreeList not implemented yet");
120/*US 128/*US
121 QSplitter *splitter = new QSplitter( this ); 129 QSplitter *splitter = new QSplitter( this );
122 topLayout->addWidget( splitter, 10 ); 130 topLayout->addWidget( splitter, 10 );
123 mTreeListResizeMode = QSplitter::KeepSize; 131 mTreeListResizeMode = QSplitter::KeepSize;
124 132
125 mTreeList = new KListView( splitter ); 133 mTreeList = new KListView( splitter );
126 mTreeList->addColumn( QString::null ); 134 mTreeList->addColumn( QString::null );
127 mTreeList->header()->hide(); 135 mTreeList->header()->hide();
@@ -136,79 +144,79 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face )
136 // 144 //
137 QFrame *p = new QFrame( splitter ); 145 QFrame *p = new QFrame( splitter );
138 146
139 QHBoxLayout *hbox = new QHBoxLayout( p, 0, 0 ); 147 QHBoxLayout *hbox = new QHBoxLayout( p, 0, 0 );
140 hbox->addSpacing( KDialog::marginHint() ); 148 hbox->addSpacing( KDialog::marginHint() );
141 149
142 page = new QFrame( p ); 150 page = new QFrame( p );
143 hbox->addWidget( page, 10 ); 151 hbox->addWidget( page, 10 );
144*/ 152*/
145 } 153 }
146 else 154 else
147 { 155 {
148 QHBoxLayout *hbox = new QHBoxLayout( topLayout ); 156 Q3HBoxLayout *hbox = new Q3HBoxLayout( topLayout );
149 mIconList = new IconListBox( this ); 157 mIconList = new IconListBox( this );
150 158
151 QFont listFont( mIconList->font() ); 159 QFont listFont( mIconList->font() );
152 listFont.setBold( true ); 160 listFont.setBold( true );
153 mIconList->setFont( listFont ); 161 mIconList->setFont( listFont );
154 162
155 mIconList->verticalScrollBar()->installEventFilter( this ); 163 mIconList->verticalScrollBar()->installEventFilter( this );
156 hbox->addWidget( mIconList ); 164 hbox->addWidget( mIconList );
157 connect( mIconList, SIGNAL(selectionChanged()), SLOT(slotShowPage())); 165 connect( mIconList, SIGNAL(selectionChanged()), SLOT(slotShowPage()));
158 hbox->addSpacing( KDialog::marginHint() ); 166 hbox->addSpacing( KDialog::marginHint() );
159 page = new QFrame( this ); 167 page = new Q3Frame( this );
160 hbox->addWidget( page, 10 ); 168 hbox->addWidget( page, 10 );
161 } 169 }
162 170
163 // 171 //
164 // Rest of page area. Title at top with a separator below and a 172 // Rest of page area. Title at top with a separator below and a
165 // pagestack using all available space at bottom. 173 // pagestack using all available space at bottom.
166 // 174 //
167 175
168 QVBoxLayout *vbox = new QVBoxLayout( page, 0, KDialog::spacingHint() ); 176 Q3VBoxLayout *vbox = new Q3VBoxLayout( page, 0, KDialog::spacingHint() );
169 177
170 mTitleLabel = new QLabel( QString::fromLatin1("Empty page"), page, "KJanusWidgetTitleLabel" ); 178 mTitleLabel = new QLabel( QString::fromLatin1("Empty page"), page, "KJanusWidgetTitleLabel" );
171 vbox->addWidget( mTitleLabel ); 179 vbox->addWidget( mTitleLabel );
172 180
173 QFont titleFont( mTitleLabel->font() ); 181 QFont titleFont( mTitleLabel->font() );
174 titleFont.setBold( true ); 182 titleFont.setBold( true );
175 mTitleLabel->setFont( titleFont ); 183 mTitleLabel->setFont( titleFont );
176 184
177 mTitleSep = new KSeparator( page ); 185 mTitleSep = new KSeparator( page );
178 mTitleSep->setFrameStyle( QFrame::HLine|QFrame::Plain ); 186 mTitleSep->setFrameStyle( Q3Frame::HLine|Q3Frame::Plain );
179 vbox->addWidget( mTitleSep ); 187 vbox->addWidget( mTitleSep );
180 188
181 mPageStack = new QWidgetStack( page ); 189 mPageStack = new Q3WidgetStack( page );
182 connect(mPageStack, SIGNAL(aboutToShow(QWidget *)), 190 connect(mPageStack, SIGNAL(aboutToShow(QWidget *)),
183 SIGNAL(aboutToShowPage(QWidget *))); 191 SIGNAL(aboutToShowPage(QWidget *)));
184 vbox->addWidget( mPageStack, 10 ); 192 vbox->addWidget( mPageStack, 10 );
185 } 193 }
186 else if( mFace == Tabbed ) 194 else if( mFace == Tabbed )
187 { 195 {
188 d = new KJanusWidgetPrivate; 196 d = new KJanusWidgetPrivate;
189 197
190 mTabControl = new QTabWidget( this ); 198 mTabControl = new QTabWidget( this );
191 mTabControl->setMargin (KDialog::marginHint()); 199 mTabControl->setMargin (KDialog::marginHint());
192 topLayout->addWidget( mTabControl, 10 ); 200 topLayout->addWidget( mTabControl, 10 );
193 } 201 }
194 else if( mFace == Swallow ) 202 else if( mFace == Swallow )
195 { 203 {
196 mSwallowPage = new QWidget( this ); 204 mSwallowPage = new QWidget( this );
197 topLayout->addWidget( mSwallowPage, 10 ); 205 topLayout->addWidget( mSwallowPage, 10 );
198 } 206 }
199 else 207 else
200 { 208 {
201 mFace = Plain; 209 mFace = Plain;
202 mPlainPage = new QFrame( this ); 210 mPlainPage = new Q3Frame( this );
203 topLayout->addWidget( mPlainPage, 10 ); 211 topLayout->addWidget( mPlainPage, 10 );
204 } 212 }
205/*US 213/*US
206 if ( kapp ) 214 if ( kapp )
207 connect(kapp,SIGNAL(kdisplayFontChanged()),SLOT(slotFontChanged())); 215 connect(kapp,SIGNAL(kdisplayFontChanged()),SLOT(slotFontChanged()));
208*/ 216*/
209 mValid = true; 217 mValid = true;
210 setSwallowedWidget(0); // Set default size if 'mFace' is Swallow. 218 setSwallowedWidget(0); // Set default size if 'mFace' is Swallow.
211} 219}
212 220
213 221
214KJanusWidget::~KJanusWidget() 222KJanusWidget::~KJanusWidget()
@@ -236,213 +244,213 @@ KJanusWidget::~KJanusWidget()
236 delete d; 244 delete d;
237 245
238 246
239} 247}
240 248
241 249
242bool KJanusWidget::isValid() const 250bool KJanusWidget::isValid() const
243{ 251{
244 return( mValid ); 252 return( mValid );
245} 253}
246 254
247 255
248QFrame *KJanusWidget::plainPage() 256Q3Frame *KJanusWidget::plainPage()
249{ 257{
250 return( mPlainPage ); 258 return( mPlainPage );
251} 259}
252 260
253 261
254int KJanusWidget::face() const 262int KJanusWidget::face() const
255{ 263{
256 return( mFace ); 264 return( mFace );
257} 265}
258 266
259QWidget *KJanusWidget::FindParent() 267QWidget *KJanusWidget::FindParent()
260{ 268{
261 if( mFace == Tabbed ) { 269 if( mFace == Tabbed ) {
262 return mTabControl; 270 return mTabControl;
263 } 271 }
264 else { 272 else {
265 return this; 273 return this;
266 } 274 }
267} 275}
268 276
269QFrame *KJanusWidget::addPage( const QStringList &items, const QString &header, 277Q3Frame *KJanusWidget::addPage( const QStringList &items, const QString &header,
270 const QPixmap &pixmap ) 278 const QPixmap &pixmap )
271{ 279{
272 if( mValid == false ) 280 if( mValid == false )
273 { 281 {
274 kdDebug() << "addPage: Invalid object" << endl; 282 kdDebug() << "addPage: Invalid object" << endl;
275 return( 0 ); 283 return( 0 );
276 } 284 }
277 285
278 QFrame *page = new QFrame( FindParent(), "page" ); 286 Q3Frame *page = new Q3Frame( FindParent(), "page" );
279 addPageWidget( page, items, header, pixmap ); 287 addPageWidget( page, items, header, pixmap );
280 288
281 return page; 289 return page;
282} 290}
283 291
284void KJanusWidget::pageGone( QObject *obj ) 292void KJanusWidget::pageGone( QObject *obj )
285{ 293{
286// QObject* obj = (QObject*)sender(); 294// QObject* obj = (QObject*)sender();
287 removePage( static_cast<QWidget*>( obj ) ); 295 removePage( static_cast<QWidget*>( obj ) );
288} 296}
289 297
290void KJanusWidget::slotReopen( QListViewItem * item ) 298void KJanusWidget::slotReopen( Q3ListViewItem * item )
291{ 299{
292 if( item ) 300 if( item )
293 item->setOpen( true ); 301 item->setOpen( true );
294} 302}
295 303
296QFrame *KJanusWidget::addPage( const QString &itemName, const QString &header, 304Q3Frame *KJanusWidget::addPage( const QString &itemName, const QString &header,
297 const QPixmap &pixmap ) 305 const QPixmap &pixmap )
298{ 306{
299 307
300 QStringList items; 308 QStringList items;
301 items << itemName; 309 items << itemName;
302 return addPage(items, header, pixmap); 310 return addPage(items, header, pixmap);
303} 311}
304 312
305 313
306 314
307QVBox *KJanusWidget::addVBoxPage( const QStringList &items, 315Q3VBox *KJanusWidget::addVBoxPage( const QStringList &items,
308 const QString &header, 316 const QString &header,
309 const QPixmap &pixmap ) 317 const QPixmap &pixmap )
310{ 318{
311 if( mValid == false ) 319 if( mValid == false )
312 { 320 {
313 qDebug("addPage: Invalid object "); 321 qDebug("addPage: Invalid object ");
314 322
315 return( 0 ); 323 return( 0 );
316 } 324 }
317 325
318 QVBox *page = new QVBox(FindParent() , "vbox_page" ); 326 Q3VBox *page = new Q3VBox(FindParent() , "vbox_page" );
319 page->setSpacing( KDialog::spacingHintSmall() ); 327 page->setSpacing( KDialog::spacingHintSmall() );
320 addPageWidget( page, items, header, pixmap ); 328 addPageWidget( page, items, header, pixmap );
321 329
322 return page; 330 return page;
323} 331}
324 332
325QVBox *KJanusWidget::addVBoxPage( const QString &itemName, 333Q3VBox *KJanusWidget::addVBoxPage( const QString &itemName,
326 const QString &header, 334 const QString &header,
327 const QPixmap &pixmap ) 335 const QPixmap &pixmap )
328{ 336{
329 QStringList items; 337 QStringList items;
330 items << itemName; 338 items << itemName;
331 return addVBoxPage(items, header, pixmap); 339 return addVBoxPage(items, header, pixmap);
332} 340}
333 341
334QHBox *KJanusWidget::addHBoxPage( const QStringList &items, 342Q3HBox *KJanusWidget::addHBoxPage( const QStringList &items,
335 const QString &header, 343 const QString &header,
336 const QPixmap &pixmap ) 344 const QPixmap &pixmap )
337{ 345{
338 if( mValid == false ) { 346 if( mValid == false ) {
339 kdDebug() << "addPage: Invalid object" << endl; 347 kdDebug() << "addPage: Invalid object" << endl;
340 return( 0 ); 348 return( 0 );
341 } 349 }
342 350
343 QHBox *page = new QHBox(FindParent(), "hbox_page"); 351 Q3HBox *page = new Q3HBox(FindParent(), "hbox_page");
344 page->setSpacing( KDialog::spacingHint() ); 352 page->setSpacing( KDialog::spacingHint() );
345 addPageWidget( page, items, header, pixmap ); 353 addPageWidget( page, items, header, pixmap );
346 354
347 return page; 355 return page;
348} 356}
349 357
350QHBox *KJanusWidget::addHBoxPage( const QString &itemName, 358Q3HBox *KJanusWidget::addHBoxPage( const QString &itemName,
351 const QString &header, 359 const QString &header,
352 const QPixmap &pixmap ) 360 const QPixmap &pixmap )
353{ 361{
354 QStringList items; 362 QStringList items;
355 items << itemName; 363 items << itemName;
356 return addHBoxPage(items, header, pixmap); 364 return addHBoxPage(items, header, pixmap);
357} 365}
358 366
359QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, 367Q3Grid *KJanusWidget::addGridPage( int n, Qt::Orientation dir,
360 const QStringList &items, 368 const QStringList &items,
361 const QString &header, 369 const QString &header,
362 const QPixmap &pixmap ) 370 const QPixmap &pixmap )
363{ 371{
364 if( mValid == false ) 372 if( mValid == false )
365 { 373 {
366 kdDebug() << "addPage: Invalid object" << endl; 374 kdDebug() << "addPage: Invalid object" << endl;
367 return( 0 ); 375 return( 0 );
368 } 376 }
369 377
370 QGrid *page = new QGrid( n, dir, FindParent(), "page" ); 378 Q3Grid *page = new Q3Grid( n, dir, FindParent(), "page" );
371 page->setSpacing( KDialog::spacingHint() ); 379 page->setSpacing( KDialog::spacingHint() );
372 addPageWidget( page, items, header, pixmap ); 380 addPageWidget( page, items, header, pixmap );
373 381
374 return page; 382 return page;
375} 383}
376 384
377 385
378QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, 386Q3Grid *KJanusWidget::addGridPage( int n, Qt::Orientation dir,
379 const QString &itemName, 387 const QString &itemName,
380 const QString &header, 388 const QString &header,
381 const QPixmap &pixmap ) 389 const QPixmap &pixmap )
382{ 390{
383 QStringList items; 391 QStringList items;
384 items << itemName; 392 items << itemName;
385 return addGridPage(n, dir, items, header, pixmap); 393 return addGridPage(n, dir, items, header, pixmap);
386} 394}
387 395
388void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page) 396void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, Q3Frame *page)
389{ 397{
390 bool isTop = true; 398 bool isTop = true;
391 QListViewItem *curTop = 0, *child, *last, *newChild; 399 Q3ListViewItem *curTop = 0, *child, *last, *newChild;
392 unsigned int index = 1; 400 unsigned int index = 1;
393 QStringList curPath; 401 QStringList curPath;
394 402
395 for ( QStringList::ConstIterator it = items.begin(); it != items.end(); ++it, index++ ) { 403 for ( QStringList::ConstIterator it = items.begin(); it != items.end(); ++it, index++ ) {
396 QString name = (*it); 404 QString name = (*it);
397 bool isPath = ( index != items.count() ); 405 bool isPath = ( index != items.count() );
398 406
399 // Find the first child. 407 // Find the first child.
400 if (isTop) { 408 if (isTop) {
401 child = mTreeList->firstChild(); 409 child = mTreeList->firstChild();
402 } 410 }
403 else { 411 else {
404 child = curTop->firstChild(); 412 child = curTop->firstChild();
405 } 413 }
406 414
407 // Now search for a child with the current Name, and if it we doesn't 415 // Now search for a child with the current Name, and if it we doesn't
408 // find it, then remember the location of the last child. 416 // find it, then remember the location of the last child.
409 for (last = 0; child && child->text(0) != name ; last = child, child = child->nextSibling()); 417 for (last = 0; child && child->text(0) != name ; last = child, child = child->nextSibling());
410 418
411 if (last == 0 && child == 0) { 419 if (last == 0 && child == 0) {
412 // This node didn't have any children at all, lets just insert the 420 // This node didn't have any children at all, lets just insert the
413 // new child. 421 // new child.
414 if (isTop) 422 if (isTop)
415 newChild = new QListViewItem(mTreeList, name); 423 newChild = new Q3ListViewItem(mTreeList, name);
416 else 424 else
417 newChild = new QListViewItem(curTop, name); 425 newChild = new Q3ListViewItem(curTop, name);
418 426
419 } 427 }
420 else if (child != 0) { 428 else if (child != 0) {
421 // we found the given name in this child. 429 // we found the given name in this child.
422 if (!isPath) { 430 if (!isPath) {
423 kdDebug() << "The element inserted was already in the TreeList box!" << endl; 431 kdDebug() << "The element inserted was already in the TreeList box!" << endl;
424 return; 432 return;
425 } 433 }
426 else { 434 else {
427 // Ok we found the folder 435 // Ok we found the folder
428 newChild = child; 436 newChild = child;
429 } 437 }
430 } 438 }
431 else { 439 else {
432 // the node had some children, but we didn't find the given name 440 // the node had some children, but we didn't find the given name
433 if (isTop) 441 if (isTop)
434 newChild = new QListViewItem(mTreeList, last, name); 442 newChild = new Q3ListViewItem(mTreeList, last, name);
435 else 443 else
436 newChild = new QListViewItem(curTop, last, name); 444 newChild = new Q3ListViewItem(curTop, last, name);
437 } 445 }
438 446
439 // Now make the element expandable if it is a path component, and make 447 // Now make the element expandable if it is a path component, and make
440 // ready for next loop 448 // ready for next loop
441 if (isPath) { 449 if (isPath) {
442 newChild->setExpandable(true); 450 newChild->setExpandable(true);
443 curTop = newChild; 451 curTop = newChild;
444 isTop = false; 452 isTop = false;
445 curPath << name; 453 curPath << name;
446 454
447 QString key = curPath.join("_/_"); 455 QString key = curPath.join("_/_");
448 if (mFolderIconMap.contains(key)) { 456 if (mFolderIconMap.contains(key)) {
@@ -450,25 +458,25 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p
450 newChild->setPixmap(0,p); 458 newChild->setPixmap(0,p);
451 } 459 }
452 } 460 }
453 else { 461 else {
454 if (mShowIconsInTreeList) { 462 if (mShowIconsInTreeList) {
455 newChild->setPixmap(0, pixmap); 463 newChild->setPixmap(0, pixmap);
456 } 464 }
457 mTreeListToPageStack.insert(newChild, page); 465 mTreeListToPageStack.insert(newChild, page);
458 } 466 }
459 } 467 }
460} 468}
461 469
462void KJanusWidget::addPageWidget( QFrame *page, const QStringList &items, 470void KJanusWidget::addPageWidget( Q3Frame *page, const QStringList &items,
463 const QString &header,const QPixmap &pixmap ) 471 const QString &header,const QPixmap &pixmap )
464{ 472{
465/*US the following signal causes a segmentation fault while closing the dialog. 473/*US the following signal causes a segmentation fault while closing the dialog.
466 Why not just remove all pages in the destructor?? 474 Why not just remove all pages in the destructor??
467*/ 475*/
468//US connect(page, SIGNAL(destroyed(QObject*)), this, SLOT(pageGone(QObject*))); 476//US connect(page, SIGNAL(destroyed(QObject*)), this, SLOT(pageGone(QObject*)));
469// we have the SIGNAL(destroyed(QObject*) only in Qt3 477// we have the SIGNAL(destroyed(QObject*) only in Qt3
470#ifdef DESKTOP_VERSION 478#ifdef DESKTOP_VERSION
471 // connect(page, SIGNAL(destroyed(QObject*)), this, SLOT(pageGone(QObject*))); 479 // connect(page, SIGNAL(destroyed(QObject*)), this, SLOT(pageGone(QObject*)));
472#endif 480#endif
473 if( mFace == Tabbed ) 481 if( mFace == Tabbed )
474 { 482 {
@@ -541,33 +549,33 @@ bool KJanusWidget::setSwallowedWidget( QWidget *widget )
541 if( mFace != Swallow || mValid == false ) 549 if( mFace != Swallow || mValid == false )
542 { 550 {
543 return( false ); 551 return( false );
544 } 552 }
545 553
546 // 554 //
547 // Remove current layout and make a new. 555 // Remove current layout and make a new.
548 // 556 //
549 if( mSwallowPage->layout() != 0 ) 557 if( mSwallowPage->layout() != 0 )
550 { 558 {
551 delete mSwallowPage->layout(); 559 delete mSwallowPage->layout();
552 } 560 }
553 QGridLayout *gbox = new QGridLayout( mSwallowPage, 1, 1, 0 ); 561 Q3GridLayout *gbox = new Q3GridLayout( mSwallowPage, 1, 1, 0 );
554 562
555 // 563 //
556 // Hide old children 564 // Hide old children
557 // 565 //
558 QObjectList *l = (QObjectList*)mSwallowPage->children(); // silence please 566 QObjectList l = mSwallowPage->children(); // silence please
559 for( uint i=0; i < l->count(); i++ ) 567 for( uint i=0; i < l.count(); i++ )
560 { 568 {
561 QObject *o = l->at(i); 569 QObject *o = l.at(i);
562 if( o->isWidgetType() ) 570 if( o->isWidgetType() )
563 { 571 {
564 ((QWidget*)o)->hide(); 572 ((QWidget*)o)->hide();
565 } 573 }
566 } 574 }
567 575
568 // 576 //
569 // Add new child or make default size 577 // Add new child or make default size
570 // 578 //
571 if( widget == 0 ) 579 if( widget == 0 )
572 { 580 {
573 gbox->addRowSpacing(0,100); 581 gbox->addRowSpacing(0,100);
@@ -588,34 +596,34 @@ bool KJanusWidget::setSwallowedWidget( QWidget *widget )
588 return( true ); 596 return( true );
589} 597}
590 598
591bool KJanusWidget::slotShowPage() 599bool KJanusWidget::slotShowPage()
592{ 600{
593 if( mValid == false ) 601 if( mValid == false )
594 { 602 {
595 return( false ); 603 return( false );
596 } 604 }
597 605
598 if( mFace == TreeList ) 606 if( mFace == TreeList )
599 { 607 {
600 QListViewItem *node = mTreeList->selectedItem(); 608 Q3ListViewItem *node = mTreeList->selectedItem();
601 if( node == 0 ) { return( false ); } 609 if( node == 0 ) { return( false ); }
602 610
603 QWidget *stackItem = mTreeListToPageStack[node]; 611 QWidget *stackItem = mTreeListToPageStack[node];
604 // Make sure to call through the virtual function showPage(int) 612 // Make sure to call through the virtual function showPage(int)
605 return showPage(d->mPageToInt[stackItem]); 613 return showPage(d->mPageToInt[stackItem]);
606 } 614 }
607 else if( mFace == IconList ) 615 else if( mFace == IconList )
608 { 616 {
609 QListBoxItem *node = mIconList->item( mIconList->currentItem() ); 617 Q3ListBoxItem *node = mIconList->item( mIconList->currentItem() );
610 if( node == 0 ) { return( false ); } 618 if( node == 0 ) { return( false ); }
611 QWidget *stackItem = mIconListToPageStack[node]; 619 QWidget *stackItem = mIconListToPageStack[node];
612 // Make sure to call through the virtual function showPage(int) 620 // Make sure to call through the virtual function showPage(int)
613 return showPage(d->mPageToInt[stackItem]); 621 return showPage(d->mPageToInt[stackItem]);
614 } 622 }
615 623
616 return( false ); 624 return( false );
617} 625}
618 626
619 627
620bool KJanusWidget::showPage( int index ) 628bool KJanusWidget::showPage( int index )
621{ 629{
@@ -637,39 +645,39 @@ bool KJanusWidget::showPage( QWidget *w )
637 return( false ); 645 return( false );
638 } 646 }
639 647
640 if( mFace == TreeList || mFace == IconList ) 648 if( mFace == TreeList || mFace == IconList )
641 { 649 {
642 mPageStack->raiseWidget( w ); 650 mPageStack->raiseWidget( w );
643 mActivePageWidget = w; 651 mActivePageWidget = w;
644 652
645 int index = d->mPageToInt[w]; 653 int index = d->mPageToInt[w];
646 mTitleLabel->setText( d->mIntToTitle[index] ); 654 mTitleLabel->setText( d->mIntToTitle[index] );
647 if( mFace == TreeList ) 655 if( mFace == TreeList )
648 { 656 {
649 QMap<QListViewItem *, QWidget *>::Iterator it; 657 QMap<Q3ListViewItem *, QWidget *>::Iterator it;
650 for (it = mTreeListToPageStack.begin(); it != mTreeListToPageStack.end(); ++it){ 658 for (it = mTreeListToPageStack.begin(); it != mTreeListToPageStack.end(); ++it){
651 QListViewItem *key = it.key(); 659 Q3ListViewItem *key = it.key();
652 QWidget *val = it.data(); 660 QWidget *val = it.data();
653 if (val == w) { 661 if (val == w) {
654 mTreeList->setSelected(key, true ); 662 mTreeList->setSelected(key, true );
655 break; 663 break;
656 } 664 }
657 } 665 }
658 } 666 }
659 else 667 else
660 { 668 {
661 QMap<QListBoxItem *, QWidget *>::Iterator it; 669 QMap<Q3ListBoxItem *, QWidget *>::Iterator it;
662 for (it = mIconListToPageStack.begin(); it != mIconListToPageStack.end(); ++it){ 670 for (it = mIconListToPageStack.begin(); it != mIconListToPageStack.end(); ++it){
663 QListBoxItem *key = it.key(); 671 Q3ListBoxItem *key = it.key();
664 QWidget *val = it.data(); 672 QWidget *val = it.data();
665 if (val == w) { 673 if (val == w) {
666 mIconList->setSelected( key, true ); 674 mIconList->setSelected( key, true );
667 break; 675 break;
668 } 676 }
669 } 677 }
670 } 678 }
671 } 679 }
672 else if( mFace == Tabbed ) 680 else if( mFace == Tabbed )
673 { 681 {
674 mTabControl->showPage(w); 682 mTabControl->showPage(w);
675 mActivePageWidget = w; 683 mActivePageWidget = w;
@@ -677,31 +685,31 @@ bool KJanusWidget::showPage( QWidget *w )
677 else 685 else
678 { 686 {
679 return( false ); 687 return( false );
680 } 688 }
681 689
682 return( true ); 690 return( true );
683} 691}
684 692
685 693
686int KJanusWidget::activePageIndex() const 694int KJanusWidget::activePageIndex() const
687{ 695{
688 if( mFace == TreeList) { 696 if( mFace == TreeList) {
689 QListViewItem *node = mTreeList->selectedItem(); 697 Q3ListViewItem *node = mTreeList->selectedItem();
690 if( node == 0 ) { return -1; } 698 if( node == 0 ) { return -1; }
691 QWidget *stackItem = mTreeListToPageStack[node]; 699 QWidget *stackItem = mTreeListToPageStack[node];
692 return d->mPageToInt[stackItem]; 700 return d->mPageToInt[stackItem];
693 } 701 }
694 else if (mFace == IconList) { 702 else if (mFace == IconList) {
695 QListBoxItem *node = mIconList->item( mIconList->currentItem() ); 703 Q3ListBoxItem *node = mIconList->item( mIconList->currentItem() );
696 if( node == 0 ) { return( false ); } 704 if( node == 0 ) { return( false ); }
697 QWidget *stackItem = mIconListToPageStack[node]; 705 QWidget *stackItem = mIconListToPageStack[node];
698 return d->mPageToInt[stackItem]; 706 return d->mPageToInt[stackItem];
699 } 707 }
700 else if( mFace == Tabbed ) { 708 else if( mFace == Tabbed ) {
701 QWidget *widget = mTabControl->currentPage(); 709 QWidget *widget = mTabControl->currentPage();
702 return( widget == 0 ? -1 : d->mPageToInt[widget] ); 710 return( widget == 0 ? -1 : d->mPageToInt[widget] );
703 } 711 }
704 else { 712 else {
705 return( -1 ); 713 return( -1 );
706 } 714 }
707} 715}
@@ -752,25 +760,25 @@ void KJanusWidget::slotFontChanged()
752 if( mFace == IconList ) 760 if( mFace == IconList )
753 { 761 {
754 QFont listFont( mIconList->font() ); 762 QFont listFont( mIconList->font() );
755 listFont.setBold( true ); 763 listFont.setBold( true );
756 mIconList->setFont( listFont ); 764 mIconList->setFont( listFont );
757 mIconList->invalidateHeight(); 765 mIconList->invalidateHeight();
758 mIconList->invalidateWidth(); 766 mIconList->invalidateWidth();
759 } 767 }
760} 768}
761*/ 769*/
762 770
763// makes the treelist behave like the list of kcontrol 771// makes the treelist behave like the list of kcontrol
764void KJanusWidget::slotItemClicked(QListViewItem *it) 772void KJanusWidget::slotItemClicked(Q3ListViewItem *it)
765{ 773{
766 if(it && (it->childCount()>0)) 774 if(it && (it->childCount()>0))
767 it->setOpen(!it->isOpen()); 775 it->setOpen(!it->isOpen());
768} 776}
769 777
770void KJanusWidget::setFocus() 778void KJanusWidget::setFocus()
771{ 779{
772 if( mValid == false ) { return; } 780 if( mValid == false ) { return; }
773 if( mFace == TreeList ) 781 if( mFace == TreeList )
774 { 782 {
775 mTreeList->setFocus(); 783 mTreeList->setFocus();
776 } 784 }
@@ -886,29 +894,29 @@ void KJanusWidget::setShowIconsInTreeList( bool state )
886void KJanusWidget::setRootIsDecorated( bool state ) 894void KJanusWidget::setRootIsDecorated( bool state )
887{ 895{
888 if( mFace == TreeList ) { 896 if( mFace == TreeList ) {
889 mTreeList->setRootIsDecorated(state); 897 mTreeList->setRootIsDecorated(state);
890 } 898 }
891} 899}
892 900
893void KJanusWidget::unfoldTreeList( bool persist ) 901void KJanusWidget::unfoldTreeList( bool persist )
894{ 902{
895 if( mFace == TreeList ) 903 if( mFace == TreeList )
896 { 904 {
897 if( persist ) 905 if( persist )
898 connect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); 906 connect( mTreeList, SIGNAL( collapsed( Q3ListViewItem * ) ), this, SLOT( slotReopen( Q3ListViewItem * ) ) );
899 else 907 else
900 disconnect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); 908 disconnect( mTreeList, SIGNAL( collapsed( Q3ListViewItem * ) ), this, SLOT( slotReopen( Q3ListViewItem * ) ) );
901 909
902 for( QListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() ) 910 for( Q3ListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() )
903 item->setOpen( true ); 911 item->setOpen( true );
904 } 912 }
905} 913}
906 914
907void KJanusWidget::showEvent( QShowEvent * ) 915void KJanusWidget::showEvent( QShowEvent * )
908{ 916{
909 if( mFace == TreeList ) 917 if( mFace == TreeList )
910 { 918 {
911/*US 919/*US
912 QSplitter *splitter = (QSplitter*)(mTreeList->parentWidget()); 920 QSplitter *splitter = (QSplitter*)(mTreeList->parentWidget());
913 splitter->setResizeMode( mTreeList, mTreeListResizeMode ); 921 splitter->setResizeMode( mTreeList, mTreeListResizeMode );
914*/ 922*/
@@ -944,58 +952,58 @@ bool KJanusWidget::eventFilter( QObject *o, QEvent *e )
944 } 952 }
945 return QWidget::eventFilter( o, e ); 953 return QWidget::eventFilter( o, e );
946} 954}
947 955
948 956
949 957
950// 958//
951// Code for the icon list box 959// Code for the icon list box
952// 960//
953 961
954 962
955KJanusWidget::IconListBox::IconListBox( QWidget *parent, const char *name, 963KJanusWidget::IconListBox::IconListBox( QWidget *parent, const char *name,
956 WFlags f ) 964 Qt::WFlags f )
957 :KListBox( parent, name, f ), mShowAll(false), mHeightValid(false), 965 :KListBox( parent, name, f ), mShowAll(false), mHeightValid(false),
958 mWidthValid(false) 966 mWidthValid(false)
959{ 967{
960} 968}
961 969
962 970
963void KJanusWidget::IconListBox::updateMinimumHeight() 971void KJanusWidget::IconListBox::updateMinimumHeight()
964{ 972{
965 if( mShowAll == true && mHeightValid == false ) 973 if( mShowAll == true && mHeightValid == false )
966 { 974 {
967 int h = frameWidth()*2; 975 int h = frameWidth()*2;
968 for( QListBoxItem *i = item(0); i != 0; i = i->next() ) 976 for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() )
969 { 977 {
970 h += i->height( this ); 978 h += i->height( this );
971 } 979 }
972 setMinimumHeight( h ); 980 setMinimumHeight( h );
973 mHeightValid = true; 981 mHeightValid = true;
974 } 982 }
975} 983}
976 984
977 985
978void KJanusWidget::IconListBox::updateWidth() 986void KJanusWidget::IconListBox::updateWidth()
979{ 987{
980 if( mWidthValid == false ) 988 if( mWidthValid == false )
981 { 989 {
982 int maxWidth = 10; 990 int maxWidth = 10;
983 for( QListBoxItem *i = item(0); i != 0; i = i->next() ) 991 for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() )
984 { 992 {
985 int w = ((IconListItem *)i)->width(this); 993 int w = ((IconListItem *)i)->width(this);
986 maxWidth = QMAX( w, maxWidth ); 994 maxWidth = QMAX( w, maxWidth );
987 } 995 }
988 996
989 for( QListBoxItem *i = item(0); i != 0; i = i->next() ) 997 for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() )
990 { 998 {
991 ((IconListItem *)i)->expandMinimumWidth( maxWidth ); 999 ((IconListItem *)i)->expandMinimumWidth( maxWidth );
992 } 1000 }
993 1001
994 if( verticalScrollBar()->isVisible() ) 1002 if( verticalScrollBar()->isVisible() )
995 { 1003 {
996 maxWidth += verticalScrollBar()->sizeHint().width(); 1004 maxWidth += verticalScrollBar()->sizeHint().width();
997 } 1005 }
998 1006
999 setFixedWidth( maxWidth + frameWidth()*2 ); 1007 setFixedWidth( maxWidth + frameWidth()*2 );
1000 mWidthValid = true; 1008 mWidthValid = true;
1001 } 1009 }
@@ -1013,27 +1021,27 @@ void KJanusWidget::IconListBox::invalidateWidth()
1013 mWidthValid = false; 1021 mWidthValid = false;
1014} 1022}
1015 1023
1016 1024
1017void KJanusWidget::IconListBox::setShowAll( bool showAll ) 1025void KJanusWidget::IconListBox::setShowAll( bool showAll )
1018{ 1026{
1019 mShowAll = showAll; 1027 mShowAll = showAll;
1020 mHeightValid = false; 1028 mHeightValid = false;
1021} 1029}
1022 1030
1023 1031
1024 1032
1025KJanusWidget::IconListItem::IconListItem( QListBox *listbox, const QPixmap &pixmap, 1033KJanusWidget::IconListItem::IconListItem( Q3ListBox *listbox, const QPixmap &pixmap,
1026 const QString &text ) 1034 const QString &text )
1027 : QListBoxItem( listbox ) 1035 : Q3ListBoxItem( listbox )
1028{ 1036{
1029 mPixmap = pixmap; 1037 mPixmap = pixmap;
1030 if( mPixmap.isNull() == true ) 1038 if( mPixmap.isNull() == true )
1031 { 1039 {
1032 mPixmap = defaultPixmap(); 1040 mPixmap = defaultPixmap();
1033 } 1041 }
1034 setText( text ); 1042 setText( text );
1035 mMinimumWidth = 0; 1043 mMinimumWidth = 0;
1036} 1044}
1037 1045
1038 1046
1039int KJanusWidget::IconListItem::expandMinimumWidth( int width ) 1047int KJanusWidget::IconListItem::expandMinimumWidth( int width )
@@ -1074,38 +1082,38 @@ void KJanusWidget::IconListItem::paint( QPainter *painter )
1074 //int wt = fm.boundingRect(text()).width(); 1082 //int wt = fm.boundingRect(text()).width();
1075 int wp = mPixmap.width(); 1083 int wp = mPixmap.width();
1076 int ht = fm.lineSpacing(); 1084 int ht = fm.lineSpacing();
1077 int hp = mPixmap.height(); 1085 int hp = mPixmap.height();
1078 1086
1079 painter->drawPixmap( (mMinimumWidth-wp)/2, 5, mPixmap ); 1087 painter->drawPixmap( (mMinimumWidth-wp)/2, 5, mPixmap );
1080 if( text().isEmpty() == false ) 1088 if( text().isEmpty() == false )
1081 { 1089 {
1082 painter->drawText( 0, hp+7, mMinimumWidth, ht, Qt::AlignCenter, text() ); 1090 painter->drawText( 0, hp+7, mMinimumWidth, ht, Qt::AlignCenter, text() );
1083 } 1091 }
1084} 1092}
1085 1093
1086int KJanusWidget::IconListItem::height( const QListBox *lb ) const 1094int KJanusWidget::IconListItem::height( const Q3ListBox *lb ) const
1087{ 1095{
1088 if( text().isEmpty() == true ) 1096 if( text().isEmpty() == true )
1089 { 1097 {
1090 return( mPixmap.height() ); 1098 return( mPixmap.height() );
1091 } 1099 }
1092 else 1100 else
1093 { 1101 {
1094 return( mPixmap.height() + lb->fontMetrics().lineSpacing()+10 ); 1102 return( mPixmap.height() + lb->fontMetrics().lineSpacing()+10 );
1095 } 1103 }
1096} 1104}
1097 1105
1098 1106
1099int KJanusWidget::IconListItem::width( const QListBox *lb ) const 1107int KJanusWidget::IconListItem::width( const Q3ListBox *lb ) const
1100{ 1108{
1101 int wt = lb->fontMetrics().boundingRect(text()).width()+10; 1109 int wt = lb->fontMetrics().boundingRect(text()).width()+10;
1102 int wp = mPixmap.width() + 10; 1110 int wp = mPixmap.width() + 10;
1103 int w = QMAX( wt, wp ); 1111 int w = QMAX( wt, wp );
1104 return( QMAX( w, mMinimumWidth ) ); 1112 return( QMAX( w, mMinimumWidth ) );
1105} 1113}
1106 1114
1107 1115
1108void KJanusWidget::virtual_hook( int, void* ) 1116void KJanusWidget::virtual_hook( int, void* )
1109{ /*BASE::virtual_hook( id, data );*/ } 1117{ /*BASE::virtual_hook( id, data );*/ }
1110 1118
1111// TODO: In TreeList, if the last child of a node is removed, and there is no corrsponding widget for that node, allow the caller to 1119// TODO: In TreeList, if the last child of a node is removed, and there is no corrsponding widget for that node, allow the caller to
@@ -1113,40 +1121,40 @@ void KJanusWidget::virtual_hook( int, void* )
1113void KJanusWidget::removePage( QWidget *page ) 1121void KJanusWidget::removePage( QWidget *page )
1114{ 1122{
1115//US qDebug("KJanusWidget::removePage 1 %lu , %lu, %lu", d, page, &(d->mPageToInt)); 1123//US qDebug("KJanusWidget::removePage 1 %lu , %lu, %lu", d, page, &(d->mPageToInt));
1116 if (!d || !(d->mPageToInt.contains(page))) 1124 if (!d || !(d->mPageToInt.contains(page)))
1117 { 1125 {
1118 return; 1126 return;
1119 } 1127 }
1120 1128
1121 int index = d->mPageToInt[page]; 1129 int index = d->mPageToInt[page];
1122 1130
1123 if ( mFace == TreeList ) 1131 if ( mFace == TreeList )
1124 { 1132 {
1125 QMap<QListViewItem*, QWidget *>::Iterator i; 1133 QMap<Q3ListViewItem*, QWidget *>::Iterator i;
1126 for( i = mTreeListToPageStack.begin(); i != mTreeListToPageStack.end(); ++i ) 1134 for( i = mTreeListToPageStack.begin(); i != mTreeListToPageStack.end(); ++i )
1127 if (i.data()==page) 1135 if (i.data()==page)
1128 { 1136 {
1129 delete i.key(); 1137 delete i.key();
1130 mPageStack->removeWidget(page); 1138 mPageStack->removeWidget(page);
1131 mTreeListToPageStack.remove(i); 1139 mTreeListToPageStack.remove(i);
1132 d->mIntToTitle.remove(index); 1140 d->mIntToTitle.remove(index);
1133 d->mPageToInt.remove(page); 1141 d->mPageToInt.remove(page);
1134 d->mIntToPage.remove(index); 1142 d->mIntToPage.remove(index);
1135 break; 1143 break;
1136 } 1144 }
1137 } 1145 }
1138 else if ( mFace == IconList ) 1146 else if ( mFace == IconList )
1139 { 1147 {
1140 QMap<QListBoxItem*, QWidget *>::Iterator i; 1148 QMap<Q3ListBoxItem*, QWidget *>::Iterator i;
1141 for( i = mIconListToPageStack.begin(); i != mIconListToPageStack.end(); ++i ) 1149 for( i = mIconListToPageStack.begin(); i != mIconListToPageStack.end(); ++i )
1142 if (i.data()==page) 1150 if (i.data()==page)
1143 { 1151 {
1144 delete i.key(); 1152 delete i.key();
1145 mPageStack->removeWidget(page); 1153 mPageStack->removeWidget(page);
1146 mIconListToPageStack.remove(i); 1154 mIconListToPageStack.remove(i);
1147 d->mIntToTitle.remove(index); 1155 d->mIntToTitle.remove(index);
1148 d->mPageToInt.remove(page); 1156 d->mPageToInt.remove(page);
1149 d->mIntToPage.remove(index); 1157 d->mIntToPage.remove(index);
1150 break; 1158 break;
1151 } 1159 }
1152 } 1160 }
diff --git a/microkde/kdeui/kjanuswidget.h b/microkde/kdeui/kjanuswidget.h
index 6d3f23d..72465ea 100644
--- a/microkde/kdeui/kjanuswidget.h
+++ b/microkde/kdeui/kjanuswidget.h
@@ -11,48 +11,54 @@
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA. 17 * Boston, MA 02111-1307, USA.
18 */ 18 */
19 19
20#ifndef _KJANUS_WIDGET_H_ 20#ifndef _KJANUS_WIDGET_H_
21#define _KJANUS_WIDGET_H_ 21#define _KJANUS_WIDGET_H_
22 22
23#include <qptrlist.h> 23#include <q3ptrlist.h>
24#include <qwidget.h> 24#include <qwidget.h>
25#include <qmap.h> 25#include <qmap.h>
26#include <qgrid.h> 26#include <q3grid.h>
27//Added by qt3to4:
28#include <QShowEvent>
29#include <Q3Frame>
30#include <QPixmap>
31#include <QLabel>
32#include <QEvent>
27#include <klistbox.h> 33#include <klistbox.h>
28 34
29/*US 35/*US
30#include <qptrlist.h> 36#include <qptrlist.h>
31#include <qpixmap.h> 37#include <qpixmap.h>
32#include <qsplitter.h> 38#include <qsplitter.h>
33 39
34#include <qstringlist.h> 40#include <qstringlist.h>
35#include <qmap.h> 41#include <qmap.h>
36 42
37*/ 43*/
38 44
39class KSeparator; 45class KSeparator;
40class KListView; 46class KListView;
41class QWidgetStack; 47class Q3WidgetStack;
42class QLabel; 48class QLabel;
43class QTabWidget; 49class QTabWidget;
44class QListViewItem; 50class Q3ListViewItem;
45class QVBox; 51class Q3VBox;
46class QHBox; 52class Q3HBox;
47 53
48/** 54/**
49 * Provides a number of ready to use layouts (faces). It is used 55 * Provides a number of ready to use layouts (faces). It is used
50 * as an internal widget in @ref KDialogBase, but can also used as a 56 * as an internal widget in @ref KDialogBase, but can also used as a
51 * widget of its own. 57 * widget of its own.
52 * 58 *
53 * It provides TreeList, IconList, Tabbed, Plain and Swallow layouts. 59 * It provides TreeList, IconList, Tabbed, Plain and Swallow layouts.
54 * 60 *
55 * The TreeList face provides a list in the left area and pages in the 61 * The TreeList face provides a list in the left area and pages in the
56 * right. The area are separated by a movable splitter. The style is somewhat 62 * right. The area are separated by a movable splitter. The style is somewhat
57 * similar to the layout in the Control Center. A page is raised by 63 * similar to the layout in the Control Center. A page is raised by
58 * selecting the corresponding tree list item. 64 * selecting the corresponding tree list item.
@@ -93,25 +99,25 @@ class QHBox;
93 * 99 *
94 * @short Easy to use widget with many layouts 100 * @short Easy to use widget with many layouts
95 * @author Espen Sand (espen@kde.org) 101 * @author Espen Sand (espen@kde.org)
96 */ 102 */
97class KJanusWidget : public QWidget 103class KJanusWidget : public QWidget
98{ 104{
99 Q_OBJECT 105 Q_OBJECT
100 106
101 private: 107 private:
102 class IconListBox : public KListBox 108 class IconListBox : public KListBox
103 { 109 {
104 public: 110 public:
105 IconListBox( QWidget *parent=0, const char *name=0, WFlags f=0 ); 111 IconListBox( QWidget *parent=0, const char *name=0, Qt::WFlags f=0 );
106 void updateMinimumHeight(); 112 void updateMinimumHeight();
107 void updateWidth(); 113 void updateWidth();
108 void invalidateHeight(); 114 void invalidateHeight();
109 void invalidateWidth(); 115 void invalidateWidth();
110 void setShowAll( bool showAll ); 116 void setShowAll( bool showAll );
111 117
112 private: 118 private:
113 bool mShowAll; 119 bool mShowAll;
114 bool mHeightValid; 120 bool mHeightValid;
115 bool mWidthValid; 121 bool mWidthValid;
116 }; 122 };
117 123
@@ -184,141 +190,141 @@ class KJanusWidget : public QWidget
184 * Returns the recommended size for the widget in order to be displayed 190 * Returns the recommended size for the widget in order to be displayed
185 * properly. 191 * properly.
186 * 192 *
187 * @return The recommended size. 193 * @return The recommended size.
188 */ 194 */
189 virtual QSize sizeHint() const; 195 virtual QSize sizeHint() const;
190 196
191 /** 197 /**
192 * Returns the empty widget that is available in Plain mode. 198 * Returns the empty widget that is available in Plain mode.
193 * 199 *
194 * @return The widget or 0 if the face in not Plain. 200 * @return The widget or 0 if the face in not Plain.
195 */ 201 */
196 virtual QFrame *plainPage(); 202 virtual Q3Frame *plainPage();
197 203
198 /** 204 /**
199 * Add a new page when the class is used in TreeList, IconList or Tabbed 205 * Add a new page when the class is used in TreeList, IconList or Tabbed
200 * mode. The returned widget is empty and you must add your widgets 206 * mode. The returned widget is empty and you must add your widgets
201 * as children to this widget. In most cases you must create a layout 207 * as children to this widget. In most cases you must create a layout
202 * manager and associate it with this widget as well. 208 * manager and associate it with this widget as well.
203 * 209 *
204 * Deleting the returned frame will cause the listitem or tab to be 210 * Deleting the returned frame will cause the listitem or tab to be
205 * removed (you can re-add a page with the same name later. 211 * removed (you can re-add a page with the same name later.
206 * 212 *
207 * @param item String used in the list or Tab item. 213 * @param item String used in the list or Tab item.
208 * @param header A longer string used in TreeList and IconList mode to 214 * @param header A longer string used in TreeList and IconList mode to
209 * describe the contents of a page. If empty, the item string 215 * describe the contents of a page. If empty, the item string
210 * will be used instead. 216 * will be used instead.
211 * @param pixmap Used in IconList mode or in TreeList mode. You should 217 * @param pixmap Used in IconList mode or in TreeList mode. You should
212 * prefer a pixmap with size 32x32 pixels. 218 * prefer a pixmap with size 32x32 pixels.
213 * 219 *
214 * @return The empty page or 0 if the face is not TreeList, IconList or 220 * @return The empty page or 0 if the face is not TreeList, IconList or
215 * Tabbed. 221 * Tabbed.
216 */ 222 */
217 virtual QFrame *addPage(const QString &item,const QString &header=QString::null, 223 virtual Q3Frame *addPage(const QString &item,const QString &header=QString::null,
218 const QPixmap &pixmap=QPixmap() ); 224 const QPixmap &pixmap=QPixmap() );
219 225
220 /** 226 /**
221 * This is like addPage just above, with the difference that the first 227 * This is like addPage just above, with the difference that the first
222 * element is a list of strings. These strings are used to form a path 228 * element is a list of strings. These strings are used to form a path
223 * of folders down to the given page. The initial elements are names 229 * of folders down to the given page. The initial elements are names
224 * for the folders, while the last element is the name of the page. 230 * for the folders, while the last element is the name of the page.
225 * Note: This does yet only work for the TreeList face. Later this may 231 * Note: This does yet only work for the TreeList face. Later this may
226 * be added for the IconList face too. In other faces than the 232 * be added for the IconList face too. In other faces than the
227 * TreeList, all the strings except the last one is ignored. 233 * TreeList, all the strings except the last one is ignored.
228 * Deleting the returned frame will cause the listitem or tab to be 234 * Deleting the returned frame will cause the listitem or tab to be
229 * removed (you can re-add a page with the same name later. 235 * removed (you can re-add a page with the same name later.
230 * 236 *
231 * Deleting the returned frame will cause the listitem or tab to be 237 * Deleting the returned frame will cause the listitem or tab to be
232 * removed (you can re-add a page with the same name later. 238 * removed (you can re-add a page with the same name later.
233 **/ 239 **/
234 virtual QFrame *addPage(const QStringList &items, const QString &header=QString::null, 240 virtual Q3Frame *addPage(const QStringList &items, const QString &header=QString::null,
235 const QPixmap &pixmap=QPixmap() ); 241 const QPixmap &pixmap=QPixmap() );
236 242
237 /** 243 /**
238 * Add a new page when the class is used in TreeList, IconList or Tabbed 244 * Add a new page when the class is used in TreeList, IconList or Tabbed
239 * mode. The returned widget is empty and you must add your widgets 245 * mode. The returned widget is empty and you must add your widgets
240 * as children to this widget. The returned widget is a @ref QVBox 246 * as children to this widget. The returned widget is a @ref QVBox
241 * so it contains a QVBoxLayout layout that lines up the child widgets 247 * so it contains a QVBoxLayout layout that lines up the child widgets
242 * are vertically. 248 * are vertically.
243 * 249 *
244 * Deleting the returned frame will cause the listitem or tab to be 250 * Deleting the returned frame will cause the listitem or tab to be
245 * removed (you can re-add a page with the same name later. 251 * removed (you can re-add a page with the same name later.
246 * 252 *
247 * @param item String used in the list or Tab item. 253 * @param item String used in the list or Tab item.
248 * @param header A longer string used in TreeList and IconList mode to 254 * @param header A longer string used in TreeList and IconList mode to
249 * describe the contents of a page. If empty, the item string 255 * describe the contents of a page. If empty, the item string
250 * will be used instead. 256 * will be used instead.
251 * @param pixmap Used in IconList mode or in TreeList mode. You should 257 * @param pixmap Used in IconList mode or in TreeList mode. You should
252 * prefer a pixmap with size 32x32 pixels. 258 * prefer a pixmap with size 32x32 pixels.
253 * 259 *
254 * @return The empty page or 0 if the face is not TreeList, IconList or 260 * @return The empty page or 0 if the face is not TreeList, IconList or
255 * Tabbed. */ 261 * Tabbed. */
256 virtual QVBox *addVBoxPage( const QString &item, 262 virtual Q3VBox *addVBoxPage( const QString &item,
257 const QString &header=QString::null, 263 const QString &header=QString::null,
258 const QPixmap &pixmap=QPixmap() ); 264 const QPixmap &pixmap=QPixmap() );
259 265
260 /** 266 /**
261 * This is like addVBoxPage just above, with the difference that the first 267 * This is like addVBoxPage just above, with the difference that the first
262 * element is a list of strings. These strings are used to form a path 268 * element is a list of strings. These strings are used to form a path
263 * of folders down to the given page. The initial elements are names 269 * of folders down to the given page. The initial elements are names
264 * for the folders, while the last element is the name of the page. 270 * for the folders, while the last element is the name of the page.
265 * Note: This does yet only work for the TreeList face. Later this may 271 * Note: This does yet only work for the TreeList face. Later this may
266 * be added for the IconList face too. In other faces than the 272 * be added for the IconList face too. In other faces than the
267 * TreeList, all the strings except the last one is ignored. 273 * TreeList, all the strings except the last one is ignored.
268 * 274 *
269 * Deleting the returned frame will cause the listitem or tab to be 275 * Deleting the returned frame will cause the listitem or tab to be
270 * removed (you can re-add a page with the same name later. 276 * removed (you can re-add a page with the same name later.
271 **/ 277 **/
272 virtual QVBox *addVBoxPage( const QStringList &items, 278 virtual Q3VBox *addVBoxPage( const QStringList &items,
273 const QString &header=QString::null, 279 const QString &header=QString::null,
274 const QPixmap &pixmap=QPixmap() ); 280 const QPixmap &pixmap=QPixmap() );
275 281
276 /** 282 /**
277 * Add a new page when the class is used in TreeList, IconList or Tabbed 283 * Add a new page when the class is used in TreeList, IconList or Tabbed
278 * mode. The returned widget is empty and you must add your widgets 284 * mode. The returned widget is empty and you must add your widgets
279 * as children to this widget. The returned widget is a @ref QHBox 285 * as children to this widget. The returned widget is a @ref QHBox
280 * so it contains a QHBoxLayout layout that lines up the child widgets 286 * so it contains a QHBoxLayout layout that lines up the child widgets
281 * are horizontally. 287 * are horizontally.
282 * 288 *
283 * Deleting the returned frame will cause the listitem or tab to be 289 * Deleting the returned frame will cause the listitem or tab to be
284 * removed (you can re-add a page with the same name later. 290 * removed (you can re-add a page with the same name later.
285 * 291 *
286 * @param item String used in the list or Tab item. 292 * @param item String used in the list or Tab item.
287 * @param header A longer string used in TreeList and IconList mode to 293 * @param header A longer string used in TreeList and IconList mode to
288 * describe the contents of a page. If empty, the item string 294 * describe the contents of a page. If empty, the item string
289 * will be used instead. 295 * will be used instead.
290 * @param pixmap Used in IconList mode or in TreeList mode. You should 296 * @param pixmap Used in IconList mode or in TreeList mode. You should
291 * prefer a pixmap with size 32x32 pixels. 297 * prefer a pixmap with size 32x32 pixels.
292 * 298 *
293 * @return The empty page or 0 if the face is not TreeList, IconList or 299 * @return The empty page or 0 if the face is not TreeList, IconList or
294 * Tabbed. 300 * Tabbed.
295 */ 301 */
296 virtual QHBox *addHBoxPage( const QString &itemName, 302 virtual Q3HBox *addHBoxPage( const QString &itemName,
297 const QString &header=QString::null, 303 const QString &header=QString::null,
298 const QPixmap &pixmap=QPixmap() ); 304 const QPixmap &pixmap=QPixmap() );
299 305
300 /** 306 /**
301 * This is like addHBoxPage just above, with the difference that the first 307 * This is like addHBoxPage just above, with the difference that the first
302 * element is a list of strings. These strings are used to form a path 308 * element is a list of strings. These strings are used to form a path
303 * of folders down to the given page. The initial elements are names 309 * of folders down to the given page. The initial elements are names
304 * for the folders, while the last element is the name of the page. 310 * for the folders, while the last element is the name of the page.
305 * Note: This does yet only work for the TreeList face. Later this may 311 * Note: This does yet only work for the TreeList face. Later this may
306 * be added for the IconList face too. In other faces than the 312 * be added for the IconList face too. In other faces than the
307 * TreeList, all the strings except the last one is ignored. 313 * TreeList, all the strings except the last one is ignored.
308 * 314 *
309 * Deleting the returned frame will cause the listitem or tab to be 315 * Deleting the returned frame will cause the listitem or tab to be
310 * removed (you can re-add a page with the same name later. 316 * removed (you can re-add a page with the same name later.
311 **/ 317 **/
312 virtual QHBox *addHBoxPage( const QStringList &items, 318 virtual Q3HBox *addHBoxPage( const QStringList &items,
313 const QString &header=QString::null, 319 const QString &header=QString::null,
314 const QPixmap &pixmap=QPixmap() ); 320 const QPixmap &pixmap=QPixmap() );
315 321
316 /** 322 /**
317 * Add a new page when the class is used in either TreeList or Tabbed 323 * Add a new page when the class is used in either TreeList or Tabbed
318 * mode. The returned widget is empty and you must add your widgets 324 * mode. The returned widget is empty and you must add your widgets
319 * as children to this widget. The returned widget is a @ref QGrid 325 * as children to this widget. The returned widget is a @ref QGrid
320 * so it contains a QGridLayout layout that places up the child widgets 326 * so it contains a QGridLayout layout that places up the child widgets
321 * in a grid. 327 * in a grid.
322 * 328 *
323 * Deleting the returned frame will cause the listitem or tab to be 329 * Deleting the returned frame will cause the listitem or tab to be
324 * removed (you can re-add a page with the same name later. 330 * removed (you can re-add a page with the same name later.
@@ -328,43 +334,43 @@ class KJanusWidget : public QWidget
328 * @param dir Can be QGrid::Horizontal or QGrid::Vertical. 334 * @param dir Can be QGrid::Horizontal or QGrid::Vertical.
329 * @param item String used in the list or Tab item. 335 * @param item String used in the list or Tab item.
330 * @param header A longer string used in TreeList and IconList mode to 336 * @param header A longer string used in TreeList and IconList mode to
331 * describe the contents of a page. If empty, the item string 337 * describe the contents of a page. If empty, the item string
332 * will be used instead. 338 * will be used instead.
333 * @param pixmap Used in IconList mode or in TreeList mode. You should 339 * @param pixmap Used in IconList mode or in TreeList mode. You should
334 * prefer a pixmap with size 32x32 pixels. 340 * prefer a pixmap with size 32x32 pixels.
335 * 341 *
336 * @return The empty page or 0 if the face is not TreeList, IconList or 342 * @return The empty page or 0 if the face is not TreeList, IconList or
337 * Tabbed. 343 * Tabbed.
338 */ 344 */
339//US changed Orientation into Direction for compatibility 345//US changed Orientation into Direction for compatibility
340 virtual QGrid *addGridPage( int n, QGrid::Direction dir, 346 virtual Q3Grid *addGridPage( int n, Qt::Orientation dir,
341 const QString &itemName, 347 const QString &itemName,
342 const QString &header=QString::null, 348 const QString &header=QString::null,
343 const QPixmap &pixmap=QPixmap() ); 349 const QPixmap &pixmap=QPixmap() );
344 350
345 /** 351 /**
346 * This is like addGridPage just above, with the difference that the first 352 * This is like addGridPage just above, with the difference that the first
347 * element is a list of strings. These strings are used to form a path 353 * element is a list of strings. These strings are used to form a path
348 * of folders down to the given page. The initial elements are names 354 * of folders down to the given page. The initial elements are names
349 * for the folders, while the last element is the name of the page. 355 * for the folders, while the last element is the name of the page.
350 * Note: This does yet only work for the TreeList face. Later this may 356 * Note: This does yet only work for the TreeList face. Later this may
351 * be added for the IconList face too. In other faces than the 357 * be added for the IconList face too. In other faces than the
352 * TreeList, all the strings except the last one is ignored. 358 * TreeList, all the strings except the last one is ignored.
353 * 359 *
354 * Deleting the returned frame will cause the listitem or tab to be 360 * Deleting the returned frame will cause the listitem or tab to be
355 * removed (you can re-add a page with the same name later. 361 * removed (you can re-add a page with the same name later.
356 **/ 362 **/
357//US changed Orientation into Direction for compatibility 363//US changed Orientation into Direction for compatibility
358 virtual QGrid *addGridPage( int n, QGrid::Direction dir, 364 virtual Q3Grid *addGridPage( int n, Qt::Orientation dir,
359 const QStringList &items, 365 const QStringList &items,
360 const QString &header=QString::null, 366 const QString &header=QString::null,
361 const QPixmap &pixmap=QPixmap() ); 367 const QPixmap &pixmap=QPixmap() );
362 368
363 /** 369 /**
364 * @short Removes a page created with @ref addPage, @ref addVBoxPage, 370 * @short Removes a page created with @ref addPage, @ref addVBoxPage,
365 * @ref addHBoxPage or @ref addGridPage. If the page has already 371 * @ref addHBoxPage or @ref addGridPage. If the page has already
366 * been deleted or has already been removed, nothing happens. The widget 372 * been deleted or has already been removed, nothing happens. The widget
367 * itself is not deleted. 373 * itself is not deleted.
368 * 374 *
369 * @param page The widget returned by @ref addPage , @ref addVBoxPage , 375 * @param page The widget returned by @ref addPage , @ref addVBoxPage ,
370 * @ref addHBoxPage or @ref addGridPage . 376 * @ref addHBoxPage or @ref addGridPage .
@@ -508,56 +514,56 @@ class KJanusWidget : public QWidget
508 * This function is used internally when in IconList mode. If you 514 * This function is used internally when in IconList mode. If you
509 * reimplement this class a make your own event filter, make sure to 515 * reimplement this class a make your own event filter, make sure to
510 * call this function from your filter. 516 * call this function from your filter.
511 * 517 *
512 * @param o Object that has received an event. 518 * @param o Object that has received an event.
513 * @param e The event. 519 * @param e The event.
514 */ 520 */
515 virtual bool eventFilter( QObject *o, QEvent *e ); 521 virtual bool eventFilter( QObject *o, QEvent *e );
516 522
517 private slots: 523 private slots:
518 bool slotShowPage(); 524 bool slotShowPage();
519//US not yet implemented void slotFontChanged(); 525//US not yet implemented void slotFontChanged();
520 void slotItemClicked(QListViewItem *it); 526 void slotItemClicked(Q3ListViewItem *it);
521 void pageGone( QObject *obj); // signal from the added page's "destroyed" signal 527 void pageGone( QObject *obj); // signal from the added page's "destroyed" signal
522 void slotReopen(QListViewItem *item); 528 void slotReopen(Q3ListViewItem *item);
523 529
524 protected: 530 protected:
525 bool showPage( QWidget *w ); 531 bool showPage( QWidget *w );
526 void addPageWidget( QFrame *page, const QStringList &items, 532 void addPageWidget( Q3Frame *page, const QStringList &items,
527 const QString &header, const QPixmap &pixmap ); 533 const QString &header, const QPixmap &pixmap );
528 void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page); 534 void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, Q3Frame *page);
529 QWidget *FindParent(); 535 QWidget *FindParent();
530 536
531 private: 537 private:
532 bool mValid; 538 bool mValid;
533 539
534 // Obsolete members. Remove in KDE 4. 540 // Obsolete members. Remove in KDE 4.
535 QPtrList<QWidget> *mPageList; 541 Q3PtrList<QWidget> *mPageList;
536 QStringList *mTitleList; 542 QStringList *mTitleList;
537 543
538 int mFace; 544 int mFace;
539 KListView *mTreeList; 545 KListView *mTreeList;
540 IconListBox *mIconList; 546 IconListBox *mIconList;
541 QWidgetStack *mPageStack; 547 Q3WidgetStack *mPageStack;
542 QLabel *mTitleLabel; 548 QLabel *mTitleLabel;
543 QTabWidget *mTabControl; 549 QTabWidget *mTabControl;
544 QFrame *mPlainPage; 550 Q3Frame *mPlainPage;
545 QWidget *mSwallowPage; 551 QWidget *mSwallowPage;
546 QWidget *mActivePageWidget; 552 QWidget *mActivePageWidget;
547 KSeparator *mTitleSep; 553 KSeparator *mTitleSep;
548//US QSplitter::ResizeMode mTreeListResizeMode; 554//US QSplitter::ResizeMode mTreeListResizeMode;
549 bool mShowIconsInTreeList; 555 bool mShowIconsInTreeList;
550 QMap<QListViewItem *, QWidget *> mTreeListToPageStack; 556 QMap<Q3ListViewItem *, QWidget *> mTreeListToPageStack;
551 QMap<QListBoxItem *, QWidget *> mIconListToPageStack; 557 QMap<Q3ListBoxItem *, QWidget *> mIconListToPageStack;
552 QMap<QString, QPixmap> mFolderIconMap; 558 QMap<QString, QPixmap> mFolderIconMap;
553 QMap<QString, QStringList> mChildrenNames; 559 QMap<QString, QStringList> mChildrenNames;
554 QMap<QString, QWidget *> mChildPages; 560 QMap<QString, QWidget *> mChildPages;
555 561
556 public: 562 public:
557 class IconListItem; 563 class IconListItem;
558 protected: 564 protected:
559 virtual void virtual_hook( int id, void* data ); 565 virtual void virtual_hook( int id, void* data );
560 private: 566 private:
561 class KJanusWidgetPrivate; 567 class KJanusWidgetPrivate;
562 KJanusWidgetPrivate *d; 568 KJanusWidgetPrivate *d;
563}; 569};
diff --git a/microkde/kdeui/klistbox.cpp b/microkde/kdeui/klistbox.cpp
index c65b892..71020b3 100644
--- a/microkde/kdeui/klistbox.cpp
+++ b/microkde/kdeui/klistbox.cpp
@@ -7,69 +7,75 @@
7 7
8 This library is distributed in the hope that it will be useful, 8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of 9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18#include <qtimer.h> 18#include <qtimer.h>
19//Added by qt3to4:
20#include <QEvent>
21#include <QMouseEvent>
22#include <QKeyEvent>
23#include <QFocusEvent>
19 24
20#include <kglobalsettings.h> 25#include <kglobalsettings.h>
21//US#include <kcursor.h> 26//US#include <kcursor.h>
22#include <kapplication.h> 27#include <kapplication.h>
23//US#include <kipc.h> 28//US#include <kipc.h>
24#include <kdebug.h> 29#include <kdebug.h>
25 30
26#include "klistbox.h" 31#include "klistbox.h"
27 32
28#ifdef Q_WS_X11 33#ifdef Q_WS_X11
34#include <QX11Info>
29#include <X11/Xlib.h> 35#include <X11/Xlib.h>
30#endif 36#endif
31#ifdef _WIN32_ 37#ifdef _WIN32_
32#define Q_WS_QWS 38#define Q_WS_QWS
33#endif 39#endif
34KListBox::KListBox( QWidget *parent, const char *name, WFlags f ) 40KListBox::KListBox( QWidget *parent, const char *name, Qt::WFlags f )
35 : QListBox( parent, name, f ) 41 : Q3ListBox( parent, name, f )
36{ 42{
37 connect( this, SIGNAL( onViewport() ), 43 connect( this, SIGNAL( onViewport() ),
38 this, SLOT( slotOnViewport() ) ); 44 this, SLOT( slotOnViewport() ) );
39 connect( this, SIGNAL( onItem( QListBoxItem * ) ), 45 connect( this, SIGNAL( onItem( Q3ListBoxItem * ) ),
40 this, SLOT( slotOnItem( QListBoxItem * ) ) ); 46 this, SLOT( slotOnItem( Q3ListBoxItem * ) ) );
41 47
42 connect( this, SIGNAL( mouseButtonClicked( int, QListBoxItem *, 48 connect( this, SIGNAL( mouseButtonClicked( int, Q3ListBoxItem *,
43 const QPoint & ) ), 49 const QPoint & ) ),
44 this, SLOT( slotMouseButtonClicked( int, QListBoxItem *, 50 this, SLOT( slotMouseButtonClicked( int, Q3ListBoxItem *,
45 const QPoint & ) ) ); 51 const QPoint & ) ) );
46/*US 52/*US
47 53
48 slotSettingsChanged(KApplication::SETTINGS_MOUSE); 54 slotSettingsChanged(KApplication::SETTINGS_MOUSE);
49 if (kapp) 55 if (kapp)
50 { 56 {
51 connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) ); 57 connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) );
52 kapp->addKipcEventMask( KIPC::SettingsChanged ); 58 kapp->addKipcEventMask( KIPC::SettingsChanged );
53 } 59 }
54*/ 60*/
55 m_pCurrentItem = 0L; 61 m_pCurrentItem = 0L;
56//US set single to true 62//US set single to true
57 m_bUseSingle = true; 63 m_bUseSingle = true;
58 m_pAutoSelect = new QTimer( this ); 64 m_pAutoSelect = new QTimer( this );
59 connect( m_pAutoSelect, SIGNAL( timeout() ), 65 connect( m_pAutoSelect, SIGNAL( timeout() ),
60 this, SLOT( slotAutoSelect() ) ); 66 this, SLOT( slotAutoSelect() ) );
61} 67}
62 68
63void KListBox::slotOnItem( QListBoxItem *item ) 69void KListBox::slotOnItem( Q3ListBoxItem *item )
64{ 70{
65/*US 71/*US
66 if ( item && m_bChangeCursorOverItem && m_bUseSingle ) 72 if ( item && m_bChangeCursorOverItem && m_bUseSingle )
67 viewport()->setCursor( KCursor().handCursor() ); 73 viewport()->setCursor( KCursor().handCursor() );
68*/ 74*/
69 if ( item && (m_autoSelectDelay > -1) && m_bUseSingle ) { 75 if ( item && (m_autoSelectDelay > -1) && m_bUseSingle ) {
70 m_pAutoSelect->start( m_autoSelectDelay, true ); 76 m_pAutoSelect->start( m_autoSelectDelay, true );
71 m_pCurrentItem = item; 77 m_pCurrentItem = item;
72 } 78 }
73} 79}
74 80
75void KListBox::slotOnViewport() 81void KListBox::slotOnViewport()
@@ -130,72 +136,72 @@ void KListBox::slotAutoSelect()
130 if( index( m_pCurrentItem ) == -1 ) 136 if( index( m_pCurrentItem ) == -1 )
131 return; 137 return;
132 138
133 //Give this widget the keyboard focus. 139 //Give this widget the keyboard focus.
134 if( !hasFocus() ) 140 if( !hasFocus() )
135 setFocus(); 141 setFocus();
136 142
137#ifdef Q_WS_X11 //FIXME 143#ifdef Q_WS_X11 //FIXME
138 Window root; 144 Window root;
139 Window child; 145 Window child;
140 int root_x, root_y, win_x, win_y; 146 int root_x, root_y, win_x, win_y;
141 uint keybstate; 147 uint keybstate;
142 XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, 148 XQueryPointer( x11Info().display(), x11Info().appRootWindow(), &root, &child,
143 &root_x, &root_y, &win_x, &win_y, &keybstate ); 149 &root_x, &root_y, &win_x, &win_y, &keybstate );
144#endif 150#endif
145 151
146 QListBoxItem* previousItem = item( currentItem() ); 152 Q3ListBoxItem* previousItem = item( currentItem() );
147 setCurrentItem( m_pCurrentItem ); 153 setCurrentItem( m_pCurrentItem );
148 154
149 if( m_pCurrentItem ) { 155 if( m_pCurrentItem ) {
150#ifndef Q_WS_QWS //FIXME 156#ifndef Q_WS_QWS //FIXME
151 //Shift pressed? 157 //Shift pressed?
152 if( (keybstate & ShiftMask) ) { 158 if( (keybstate & ShiftMask) ) {
153#endif 159#endif
154 bool block = signalsBlocked(); 160 bool block = signalsBlocked();
155 blockSignals( true ); 161 blockSignals( true );
156 162
157#ifndef Q_WS_QWS //FIXME 163#ifndef Q_WS_QWS //FIXME
158 //No Ctrl? Then clear before! 164 //No Ctrl? Then clear before!
159 if( !(keybstate & ControlMask) ) 165 if( !(keybstate & ControlMask) )
160 clearSelection(); 166 clearSelection();
161#endif 167#endif
162 168
163//US in my QT version it is called isSelected() So what is right? 169//US in my QT version it is called isSelected() So what is right?
164//US bool select = !m_pCurrentItem->isSelected(); 170//US bool select = !m_pCurrentItem->isSelected();
165 bool select = !m_pCurrentItem->selected(); 171 bool select = !m_pCurrentItem->selected();
166 bool update = viewport()->isUpdatesEnabled(); 172 bool update = viewport()->isUpdatesEnabled();
167 viewport()->setUpdatesEnabled( false ); 173 viewport()->setUpdatesEnabled( false );
168 174
169 bool down = index( previousItem ) < index( m_pCurrentItem ); 175 bool down = index( previousItem ) < index( m_pCurrentItem );
170 QListBoxItem* it = down ? previousItem : m_pCurrentItem; 176 Q3ListBoxItem* it = down ? previousItem : m_pCurrentItem;
171 for (;it ; it = it->next() ) { 177 for (;it ; it = it->next() ) {
172 if ( down && it == m_pCurrentItem ) { 178 if ( down && it == m_pCurrentItem ) {
173 setSelected( m_pCurrentItem, select ); 179 setSelected( m_pCurrentItem, select );
174 break; 180 break;
175 } 181 }
176 if ( !down && it == previousItem ) { 182 if ( !down && it == previousItem ) {
177 setSelected( previousItem, select ); 183 setSelected( previousItem, select );
178 break; 184 break;
179 } 185 }
180 setSelected( it, select ); 186 setSelected( it, select );
181 } 187 }
182 188
183 blockSignals( block ); 189 blockSignals( block );
184 viewport()->setUpdatesEnabled( update ); 190 viewport()->setUpdatesEnabled( update );
185 triggerUpdate( false ); 191 triggerUpdate( false );
186 192
187 emit selectionChanged(); 193 emit selectionChanged();
188 194
189 if( selectionMode() == QListBox::Single ) 195 if( selectionMode() == Q3ListBox::Single )
190 emit selectionChanged( m_pCurrentItem ); 196 emit selectionChanged( m_pCurrentItem );
191 } 197 }
192#ifndef Q_WS_QWS //FIXME 198#ifndef Q_WS_QWS //FIXME
193 else if( (keybstate & ControlMask) ) 199 else if( (keybstate & ControlMask) )
194 setSelected( m_pCurrentItem, !m_pCurrentItem->isSelected() ); 200 setSelected( m_pCurrentItem, !m_pCurrentItem->isSelected() );
195#endif 201#endif
196 else { 202 else {
197 bool block = signalsBlocked(); 203 bool block = signalsBlocked();
198 blockSignals( true ); 204 blockSignals( true );
199 205
200//US in my QT version it is called isSelected() So what is right? 206//US in my QT version it is called isSelected() So what is right?
201//US if( !m_pCurrentItem->isSelected() ) 207//US if( !m_pCurrentItem->isSelected() )
@@ -204,32 +210,32 @@ void KListBox::slotAutoSelect()
204 210
205 blockSignals( block ); 211 blockSignals( block );
206 212
207 setSelected( m_pCurrentItem, true ); 213 setSelected( m_pCurrentItem, true );
208 } 214 }
209#ifndef Q_WS_QWS //FIXME 215#ifndef Q_WS_QWS //FIXME
210 } 216 }
211 else 217 else
212 kdDebug() << "Thats not supposed to happen!!!!" << endl; 218 kdDebug() << "Thats not supposed to happen!!!!" << endl;
213#endif 219#endif
214} 220}
215 221
216void KListBox::emitExecute( QListBoxItem *item, const QPoint &pos ) 222void KListBox::emitExecute( Q3ListBoxItem *item, const QPoint &pos )
217{ 223{
218#ifdef Q_WS_X11 //FIXME 224#ifdef Q_WS_X11 //FIXME
219 Window root; 225 Window root;
220 Window child; 226 Window child;
221 int root_x, root_y, win_x, win_y; 227 int root_x, root_y, win_x, win_y;
222 uint keybstate; 228 uint keybstate;
223 XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, 229 XQueryPointer( x11Info().display(), x11Info().appRootWindow(), &root, &child,
224 &root_x, &root_y, &win_x, &win_y, &keybstate ); 230 &root_x, &root_y, &win_x, &win_y, &keybstate );
225#endif 231#endif
226 232
227 m_pAutoSelect->stop(); 233 m_pAutoSelect->stop();
228 234
229#ifndef Q_WS_QWS //FIXME 235#ifndef Q_WS_QWS //FIXME
230 //Dont emit executed if in SC mode and Shift or Ctrl are pressed 236 //Dont emit executed if in SC mode and Shift or Ctrl are pressed
231 if( !( m_bUseSingle && ((keybstate & ShiftMask) || (keybstate & ControlMask)) ) ) { 237 if( !( m_bUseSingle && ((keybstate & ShiftMask) || (keybstate & ControlMask)) ) ) {
232#endif 238#endif
233 emit executed( item ); 239 emit executed( item );
234 emit executed( item, pos ); 240 emit executed( item, pos );
235#ifndef Q_WS_QWS //FIXME 241#ifndef Q_WS_QWS //FIXME
@@ -237,78 +243,78 @@ void KListBox::emitExecute( QListBoxItem *item, const QPoint &pos )
237#endif 243#endif
238} 244}
239 245
240// 246//
241// 2000-16-01 Espen Sand 247// 2000-16-01 Espen Sand
242// This widget is used in dialogs. It should ignore 248// This widget is used in dialogs. It should ignore
243// F1 (and combinations) and Escape since these are used 249// F1 (and combinations) and Escape since these are used
244// to start help or close the dialog. This functionality 250// to start help or close the dialog. This functionality
245// should be done in QListView but it is not (at least now) 251// should be done in QListView but it is not (at least now)
246// 252//
247void KListBox::keyPressEvent(QKeyEvent *e) 253void KListBox::keyPressEvent(QKeyEvent *e)
248{ 254{
249 if( e->key() == Key_Escape ) 255 if( e->key() == Qt::Key_Escape )
250 { 256 {
251 e->ignore(); 257 e->ignore();
252 } 258 }
253 else if( e->key() == Key_F1 ) 259 else if( e->key() == Qt::Key_F1 )
254 { 260 {
255 e->ignore(); 261 e->ignore();
256 } 262 }
257 else 263 else
258 { 264 {
259 QListBox::keyPressEvent(e); 265 Q3ListBox::keyPressEvent(e);
260 } 266 }
261} 267}
262 268
263void KListBox::focusOutEvent( QFocusEvent *fe ) 269void KListBox::focusOutEvent( QFocusEvent *fe )
264{ 270{
265 m_pAutoSelect->stop(); 271 m_pAutoSelect->stop();
266 272
267 QListBox::focusOutEvent( fe ); 273 Q3ListBox::focusOutEvent( fe );
268} 274}
269 275
270void KListBox::leaveEvent( QEvent *e ) 276void KListBox::leaveEvent( QEvent *e )
271{ 277{
272 m_pAutoSelect->stop(); 278 m_pAutoSelect->stop();
273 279
274 QListBox::leaveEvent( e ); 280 Q3ListBox::leaveEvent( e );
275} 281}
276 282
277void KListBox::contentsMousePressEvent( QMouseEvent *e ) 283void KListBox::contentsMousePressEvent( QMouseEvent *e )
278{ 284{
279 if( (selectionMode() == Extended) && (e->state() & ShiftButton) && !(e->state() & ControlButton) ) { 285 if( (selectionMode() == Extended) && (e->state() & Qt::ShiftButton) && !(e->state() & Qt::ControlButton) ) {
280 bool block = signalsBlocked(); 286 bool block = signalsBlocked();
281 blockSignals( true ); 287 blockSignals( true );
282 288
283 clearSelection(); 289 clearSelection();
284 290
285 blockSignals( block ); 291 blockSignals( block );
286 } 292 }
287 293
288 QListBox::contentsMousePressEvent( e ); 294 Q3ListBox::contentsMousePressEvent( e );
289} 295}
290 296
291void KListBox::contentsMouseDoubleClickEvent ( QMouseEvent * e ) 297void KListBox::contentsMouseDoubleClickEvent ( QMouseEvent * e )
292{ 298{
293 QListBox::contentsMouseDoubleClickEvent( e ); 299 Q3ListBox::contentsMouseDoubleClickEvent( e );
294 300
295 QListBoxItem* item = itemAt( e->pos() ); 301 Q3ListBoxItem* item = itemAt( e->pos() );
296 302
297 if( item ) { 303 if( item ) {
298 emit doubleClicked( item, e->globalPos() ); 304 emit doubleClicked( item, e->globalPos() );
299 305
300 if( (e->button() == LeftButton) && !m_bUseSingle ) 306 if( (e->button() == Qt::LeftButton) && !m_bUseSingle )
301 emitExecute( item, e->globalPos() ); 307 emitExecute( item, e->globalPos() );
302 } 308 }
303} 309}
304 310
305void KListBox::slotMouseButtonClicked( int btn, QListBoxItem *item, const QPoint &pos ) 311void KListBox::slotMouseButtonClicked( int btn, Q3ListBoxItem *item, const QPoint &pos )
306{ 312{
307 if( (btn == LeftButton) && item ) 313 if( (btn == Qt::LeftButton) && item )
308 emitExecute( item, pos ); 314 emitExecute( item, pos );
309} 315}
310 316
311void KListBox::virtual_hook( int, void* ) 317void KListBox::virtual_hook( int, void* )
312{ /*BASE::virtual_hook( id, data );*/ } 318{ /*BASE::virtual_hook( id, data );*/ }
313 319
314//US #include "klistbox.moc" 320//US #include "klistbox.moc"
diff --git a/microkde/kdeui/klistbox.h b/microkde/kdeui/klistbox.h
index 8023780..5ec514b 100644
--- a/microkde/kdeui/klistbox.h
+++ b/microkde/kdeui/klistbox.h
@@ -9,104 +9,109 @@
9 but WITHOUT ANY WARRANTY; without even the implied warranty of 9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18#ifndef KLISTBOX_H 18#ifndef KLISTBOX_H
19#define KLISTBOX_H 19#define KLISTBOX_H
20 20
21#include <qlistbox.h> 21#include <q3listbox.h>
22//Added by qt3to4:
23#include <QMouseEvent>
24#include <QFocusEvent>
25#include <QKeyEvent>
26#include <QEvent>
22 27
23/** 28/**
24 * Extends the functionality of @ref QListBox to honor the system 29 * Extends the functionality of @ref QListBox to honor the system
25 * wide settings for Single Click/Double Click mode, Auto Selection and 30 * wide settings for Single Click/Double Click mode, Auto Selection and
26 * Change Cursor over Link. 31 * Change Cursor over Link.
27 * 32 *
28 * There is a new signal @ref executed(). It gets connected to either 33 * There is a new signal @ref executed(). It gets connected to either
29 * @ref QListBox::clicked() or @ref QListBox::doubleClicked() 34 * @ref QListBox::clicked() or @ref QListBox::doubleClicked()
30 * depending on the KDE wide Single Click/Double Click settings. It is 35 * depending on the KDE wide Single Click/Double Click settings. It is
31 * strongly recomended that you use this signal instead of the above 36 * strongly recomended that you use this signal instead of the above
32 * mentioned. This way you don't need to care about the current 37 * mentioned. This way you don't need to care about the current
33 * settings. If you want to get informed when the user selects 38 * settings. If you want to get informed when the user selects
34 * something connect to the @ref QListBox::selectionChanged() signal. 39 * something connect to the @ref QListBox::selectionChanged() signal.
35 * 40 *
36 * @short A variant of @ref QListBox that honors KDE's system-wide settings. 41 * @short A variant of @ref QListBox that honors KDE's system-wide settings.
37 **/ 42 **/
38class KListBox : public QListBox 43class KListBox : public Q3ListBox
39{ 44{
40 Q_OBJECT 45 Q_OBJECT
41 46
42public: 47public:
43 KListBox( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 48 KListBox( QWidget *parent = 0, const char *name = 0, Qt::WFlags f = 0 );
44 49
45signals: 50signals:
46 51
47 /** 52 /**
48 * Emitted whenever the user executes an listbox item. 53 * Emitted whenever the user executes an listbox item.
49 * 54 *
50 * That means depending on the KDE wide Single Click/Double Click 55 * That means depending on the KDE wide Single Click/Double Click
51 * setting the user clicked or double clicked on that item. 56 * setting the user clicked or double clicked on that item.
52 * @param item is the pointer to the executed listbox item. 57 * @param item is the pointer to the executed listbox item.
53 * 58 *
54 * Note that you may not delete any @ref QListBoxItem objects in slots 59 * Note that you may not delete any @ref QListBoxItem objects in slots
55 * connected to this signal. 60 * connected to this signal.
56 */ 61 */
57 void executed( QListBoxItem *item ); 62 void executed( Q3ListBoxItem *item );
58 63
59 /** 64 /**
60 * Emitted whenever the user executes an listbox item. 65 * Emitted whenever the user executes an listbox item.
61 * 66 *
62 * That means depending on the KDE wide Single Click/Double Click 67 * That means depending on the KDE wide Single Click/Double Click
63 * setting the user clicked or double clicked on that item. 68 * setting the user clicked or double clicked on that item.
64 * @param item is the pointer to the executed listbox item. 69 * @param item is the pointer to the executed listbox item.
65 * @param pos is the position where the user has clicked 70 * @param pos is the position where the user has clicked
66 * 71 *
67 * Note that you may not delete any @ref QListBoxItem objects in slots 72 * Note that you may not delete any @ref QListBoxItem objects in slots
68 * connected to this signal. 73 * connected to this signal.
69 */ 74 */
70 void executed( QListBoxItem *item, const QPoint &pos ); 75 void executed( Q3ListBoxItem *item, const QPoint &pos );
71 76
72 /** 77 /**
73 * This signal gets emitted whenever the user double clicks into the 78 * This signal gets emitted whenever the user double clicks into the
74 * listbox. 79 * listbox.
75 * 80 *
76 * @param item The pointer to the clicked listbox item. 81 * @param item The pointer to the clicked listbox item.
77 * @param pos The position where the user has clicked. 82 * @param pos The position where the user has clicked.
78 * 83 *
79 * Note that you may not delete any @ref QListBoxItem objects in slots 84 * Note that you may not delete any @ref QListBoxItem objects in slots
80 * connected to this signal. 85 * connected to this signal.
81 * 86 *
82 * This signal is more or less here for the sake of completeness. 87 * This signal is more or less here for the sake of completeness.
83 * You should normally not need to use this. In most cases it's better 88 * You should normally not need to use this. In most cases it's better
84 * to use @ref executed() instead. 89 * to use @ref executed() instead.
85 */ 90 */
86 void doubleClicked( QListBoxItem *item, const QPoint &pos ); 91 void doubleClicked( Q3ListBoxItem *item, const QPoint &pos );
87 92
88protected slots: 93protected slots:
89 void slotOnItem( QListBoxItem *item ); 94 void slotOnItem( Q3ListBoxItem *item );
90 void slotOnViewport(); 95 void slotOnViewport();
91 96
92//US void slotSettingsChanged(int); 97//US void slotSettingsChanged(int);
93 98
94 /** 99 /**
95 * Auto selection happend. 100 * Auto selection happend.
96 */ 101 */
97 void slotAutoSelect(); 102 void slotAutoSelect();
98 103
99protected: 104protected:
100 void emitExecute( QListBoxItem *item, const QPoint &pos ); 105 void emitExecute( Q3ListBoxItem *item, const QPoint &pos );
101 106
102 /** 107 /**
103 * @reimplemented 108 * @reimplemented
104 */ 109 */
105 virtual void keyPressEvent(QKeyEvent *e); 110 virtual void keyPressEvent(QKeyEvent *e);
106 /** 111 /**
107 * @reimplemented 112 * @reimplemented
108 */ 113 */
109 virtual void focusOutEvent( QFocusEvent *fe ); 114 virtual void focusOutEvent( QFocusEvent *fe );
110 /** 115 /**
111 * @reimplemented 116 * @reimplemented
112 */ 117 */
@@ -114,28 +119,28 @@ protected:
114 /** 119 /**
115 * @reimplemented 120 * @reimplemented
116 */ 121 */
117 virtual void contentsMousePressEvent( QMouseEvent *e ); 122 virtual void contentsMousePressEvent( QMouseEvent *e );
118 /** 123 /**
119 * @reimplemented 124 * @reimplemented
120 */ 125 */
121 virtual void contentsMouseDoubleClickEvent ( QMouseEvent *e ); 126 virtual void contentsMouseDoubleClickEvent ( QMouseEvent *e );
122 127
123 bool m_bUseSingle; 128 bool m_bUseSingle;
124//US bool m_bChangeCursorOverItem; 129//US bool m_bChangeCursorOverItem;
125 130
126 QListBoxItem* m_pCurrentItem; 131 Q3ListBoxItem* m_pCurrentItem;
127 132
128 QTimer* m_pAutoSelect; 133 QTimer* m_pAutoSelect;
129 int m_autoSelectDelay; 134 int m_autoSelectDelay;
130 135
131private slots: 136private slots:
132 void slotMouseButtonClicked( int btn, QListBoxItem *item, const QPoint &pos ); 137 void slotMouseButtonClicked( int btn, Q3ListBoxItem *item, const QPoint &pos );
133 138
134protected: 139protected:
135 virtual void virtual_hook( int id, void* data ); 140 virtual void virtual_hook( int id, void* data );
136private: 141private:
137 class KListBoxPrivate; 142 class KListBoxPrivate;
138 KListBoxPrivate *d; 143 KListBoxPrivate *d;
139}; 144};
140 145
141#endif 146#endif
diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp
index 60f3084..0e98160 100644
--- a/microkde/kdeui/klistview.cpp
+++ b/microkde/kdeui/klistview.cpp
@@ -9,74 +9,89 @@
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qdragobject.h> 21#include <q3dragobject.h>
22#include <qtimer.h> 22#include <qtimer.h>
23#include <qheader.h> 23#include <q3header.h>
24#include <qcursor.h> 24#include <qcursor.h>
25#include <qtooltip.h> 25#include <qtooltip.h>
26#include <qstyle.h> 26#include <qstyle.h>
27#include <qpainter.h> 27#include <qpainter.h>
28//Added by qt3to4:
29#include <QDragLeaveEvent>
30#include <QKeyEvent>
31#include <Q3ValueList>
32#include <Q3PtrList>
33#include <QPixmap>
34#include <QDragEnterEvent>
35#include <QDragMoveEvent>
36#include <QDropEvent>
37#include <QResizeEvent>
38#include <QFocusEvent>
39#include <QMouseEvent>
40#include <QEvent>
41#include <QPaintEvent>
28 42
29#include <kglobalsettings.h> 43#include <kglobalsettings.h>
30#include <kconfig.h> 44#include <kconfig.h>
31#include <kconfigbase.h> 45#include <kconfigbase.h>
32//US #include <kcursor.h> 46//US #include <kcursor.h>
33#include <kapplication.h> 47#include <kapplication.h>
34//US #include <kipc.h> 48//US #include <kipc.h>
35#include <kdebug.h> 49#include <kdebug.h>
36#ifdef _WIN32_ 50#ifdef _WIN32_
37#define Q_WS_QWS 51#define Q_WS_QWS
38#endif 52#endif
39#ifndef _WIN32_ 53#ifndef _WIN32_
40#define private public 54#define private public
41#include <qlistview.h> 55#include <q3listview.h>
42#undef private 56#undef private
43#endif 57#endif
44#include "klistview.h" 58#include "klistview.h"
45//US #include "klistviewlineedit.h" 59//US #include "klistviewlineedit.h"
46#ifndef DESKTOP_VERSION 60#ifndef DESKTOP_VERSION
47#include <qpe/qpeapplication.h> 61#include <qpe/qpeapplication.h>
48#endif 62#endif
63#include <Q3Action>
49 64
50// /*US 65// /*US
51class KListView::Tooltip : public QToolTip 66class KListView::Tooltip /* TODO:hacker:TODO: : public QToolTip */
52{ 67{
53public: 68public:
54 Tooltip (KListView* parent, QToolTipGroup* group = 0L); 69 Tooltip (KListView* parent, QToolTipGroup* group = 0L);
55 virtual ~Tooltip () {} 70 virtual ~Tooltip () {}
56 71
57protected: 72protected:
58 // */ 73 // */
59 /** 74 /**
60 * Reimplemented from QToolTip for internal reasons. 75 * Reimplemented from QToolTip for internal reasons.
61 */ 76 */
62 // /*US 77 // /*US
63 virtual void maybeTip (const QPoint&); 78 virtual void maybeTip (const QPoint&);
64 79
65private: 80private:
66 KListView* mParent; 81 KListView* mParent;
67}; 82};
68 83
69KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group) 84KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group)
70 : QToolTip (parent, group), 85 : /* XXX:hacker:XXX: QToolTip (parent, group), */
71 mParent (parent) 86 mParent (parent)
72{ 87{
73} 88}
74 89
75void KListView::Tooltip::maybeTip (const QPoint&) 90void KListView::Tooltip::maybeTip (const QPoint&)
76{ 91{
77 // FIXME 92 // FIXME
78} 93}
79// */ 94// */
80 95
81class KListView::KListViewPrivate 96class KListView::KListViewPrivate
82{ 97{
@@ -114,38 +129,38 @@ public:
114 showContextMenusOnPress (true),//showContextMenusOnPress (KGlobalSettings::showContextMenusOnPress()), 129 showContextMenusOnPress (true),//showContextMenusOnPress (KGlobalSettings::showContextMenusOnPress()),
115 mDropVisualizerWidth (4) 130 mDropVisualizerWidth (4)
116 { 131 {
117 renameable += 0; 132 renameable += 0;
118//US connect(editor, SIGNAL(done(QListViewItem*,int)), listview, SLOT(doneEditing(QListViewItem*,int))); 133//US connect(editor, SIGNAL(done(QListViewItem*,int)), listview, SLOT(doneEditing(QListViewItem*,int)));
119 } 134 }
120 135
121 ~KListViewPrivate () 136 ~KListViewPrivate ()
122 { 137 {
123//US delete editor; 138//US delete editor;
124 } 139 }
125 140
126 QListViewItem* pCurrentItem; 141 Q3ListViewItem* pCurrentItem;
127 142
128 QTimer autoSelect; 143 QTimer autoSelect;
129 int autoSelectDelay; 144 int autoSelectDelay;
130 145
131 QTimer dragExpand; 146 QTimer dragExpand;
132 QListViewItem* dragOverItem; 147 Q3ListViewItem* dragOverItem;
133 QPoint dragOverPoint; 148 QPoint dragOverPoint;
134 149
135 QPoint startDragPos; 150 QPoint startDragPos;
136 int dragDelay; 151 int dragDelay;
137 152
138//US KListViewLineEdit *editor; 153//US KListViewLineEdit *editor;
139 QValueList<int> renameable; 154 Q3ValueList<int> renameable;
140 155
141 bool cursorInExecuteArea:1; 156 bool cursorInExecuteArea:1;
142 bool bUseSingle:1; 157 bool bUseSingle:1;
143 bool bChangeCursorOverItem:1; 158 bool bChangeCursorOverItem:1;
144 bool itemsMovable:1; 159 bool itemsMovable:1;
145 bool selectedBySimpleMove : 1; 160 bool selectedBySimpleMove : 1;
146 bool selectedUsingMouse:1; 161 bool selectedUsingMouse:1;
147 bool itemsRenameable:1; 162 bool itemsRenameable:1;
148 bool validDrag:1; 163 bool validDrag:1;
149 bool dragEnabled:1; 164 bool dragEnabled:1;
150 bool autoOpen:1; 165 bool autoOpen:1;
151 bool dropVisualizer:1; 166 bool dropVisualizer:1;
@@ -161,26 +176,26 @@ public:
161 176
162 //+1 means downwards (y increases, -1 means upwards, 0 means not selected), aleXXX 177 //+1 means downwards (y increases, -1 means upwards, 0 means not selected), aleXXX
163 int selectionDirection; 178 int selectionDirection;
164 int tooltipColumn; 179 int tooltipColumn;
165 180
166 SelectionModeExt selectionMode; 181 SelectionModeExt selectionMode;
167 int contextMenuKey; 182 int contextMenuKey;
168 bool showContextMenusOnPress; 183 bool showContextMenusOnPress;
169 184
170 QRect mOldDropVisualizer; 185 QRect mOldDropVisualizer;
171 int mDropVisualizerWidth; 186 int mDropVisualizerWidth;
172 QRect mOldDropHighlighter; 187 QRect mOldDropHighlighter;
173 QListViewItem *afterItemDrop; 188 Q3ListViewItem *afterItemDrop;
174 QListViewItem *parentItemDrop; 189 Q3ListViewItem *parentItemDrop;
175 190
176 QColor alternateBackground; 191 QColor alternateBackground;
177}; 192};
178 193
179/*US 194/*US
180KListViewLineEdit::KListViewLineEdit(KListView *parent) 195KListViewLineEdit::KListViewLineEdit(KListView *parent)
181 : KLineEdit(parent->viewport()), item(0), col(0), p(parent) 196 : KLineEdit(parent->viewport()), item(0), col(0), p(parent)
182{ 197{
183 setFrame( false ); 198 setFrame( false );
184 hide(); 199 hide();
185 connect( parent, SIGNAL( selectionChanged() ), SLOT( slotSelectionChanged() )); 200 connect( parent, SIGNAL( selectionChanged() ), SLOT( slotSelectionChanged() ));
186} 201}
@@ -217,59 +232,59 @@ void KListViewLineEdit::load(QListViewItem *i, int c)
217 fieldW -= d; 232 fieldW -= d;
218 } 233 }
219 234
220 setGeometry(fieldX, rect.y() - 1, fieldW, rect.height() + 2); 235 setGeometry(fieldX, rect.y() - 1, fieldW, rect.height() + 2);
221 show(); 236 show();
222 setFocus(); 237 setFocus();
223} 238}
224*/ 239*/
225 /*Helper functions to for 240 /*Helper functions to for
226 *tabOrderedRename functionality. 241 *tabOrderedRename functionality.
227 */ 242 */
228 243
229static int nextCol (KListView *pl, QListViewItem *pi, int start, int dir) 244static int nextCol (KListView *pl, Q3ListViewItem *pi, int start, int dir)
230{ 245{
231 if (pi) 246 if (pi)
232 { 247 {
233 //Find the next renameable column in the current row 248 //Find the next renameable column in the current row
234 for (; ((dir == +1) ? (start < pl->columns()) : (start >= 0)); start += dir) 249 for (; ((dir == +1) ? (start < pl->columns()) : (start >= 0)); start += dir)
235 if (pl->isRenameable(start)) 250 if (pl->isRenameable(start))
236 return start; 251 return start;
237 } 252 }
238 253
239 return -1; 254 return -1;
240} 255}
241 256
242static QListViewItem *prevItem (QListViewItem *pi) 257static Q3ListViewItem *prevItem (Q3ListViewItem *pi)
243{ 258{
244 QListViewItem *pa = pi->itemAbove(); 259 Q3ListViewItem *pa = pi->itemAbove();
245 260
246 /*Does what the QListViewItem::previousSibling() 261 /*Does what the QListViewItem::previousSibling()
247 *of my dreams would do. 262 *of my dreams would do.
248 */ 263 */
249 if (pa && pa->parent() == pi->parent()) 264 if (pa && pa->parent() == pi->parent())
250 return pa; 265 return pa;
251 266
252 return NULL; 267 return NULL;
253} 268}
254 269
255static QListViewItem *lastQChild (QListViewItem *pi) 270static Q3ListViewItem *lastQChild (Q3ListViewItem *pi)
256{ 271{
257 if (pi) 272 if (pi)
258 { 273 {
259 /*Since there's no QListViewItem::lastChild(). 274 /*Since there's no QListViewItem::lastChild().
260 *This finds the last sibling for the given 275 *This finds the last sibling for the given
261 *item. 276 *item.
262 */ 277 */
263 for (QListViewItem *pt = pi->nextSibling(); pt; pt = pt->nextSibling()) 278 for (Q3ListViewItem *pt = pi->nextSibling(); pt; pt = pt->nextSibling())
264 pi = pt; 279 pi = pt;
265 } 280 }
266 281
267 return pi; 282 return pi;
268} 283}
269/*US 284/*US
270void KListViewLineEdit::selectNextCell (QListViewItem *pitem, int column, bool forward) 285void KListViewLineEdit::selectNextCell (QListViewItem *pitem, int column, bool forward)
271{ 286{
272 const int ncols = p->columns(); 287 const int ncols = p->columns();
273 const int dir = forward ? +1 : -1; 288 const int dir = forward ? +1 : -1;
274 const int restart = forward ? 0 : (ncols - 1); 289 const int restart = forward ? 0 : (ncols - 1);
275 QListViewItem *top = (pitem && pitem->parent()) 290 QListViewItem *top = (pitem && pitem->parent())
@@ -319,28 +334,28 @@ void KListViewLineEdit::selectNextCell (QListViewItem *pitem, int column, bool f
319#ifdef KeyPress 334#ifdef KeyPress
320#undef KeyPress 335#undef KeyPress
321#endif 336#endif
322 337
323bool KListViewLineEdit::event (QEvent *pe) 338bool KListViewLineEdit::event (QEvent *pe)
324{ 339{
325 if (pe->type() == QEvent::KeyPress) 340 if (pe->type() == QEvent::KeyPress)
326 { 341 {
327 QKeyEvent *k = (QKeyEvent *) pe; 342 QKeyEvent *k = (QKeyEvent *) pe;
328 343
329 if ((k->key() == Qt::Key_Backtab || k->key() == Qt::Key_Tab) && 344 if ((k->key() == Qt::Key_Backtab || k->key() == Qt::Key_Tab) &&
330 p->tabOrderedRenaming() && p->itemsRenameable() && 345 p->tabOrderedRenaming() && p->itemsRenameable() &&
331 !(k->state() & ControlButton || k->state() & AltButton)) 346 !(k->state() & Qt::ControlButton || k->state() & AltButton))
332 { 347 {
333 selectNextCell(item, col, 348 selectNextCell(item, col,
334 (k->key() == Key_Tab && !(k->state() & ShiftButton))); 349 (k->key() == Key_Tab && !(k->state() & Qt::ShiftButton)));
335 return true; 350 return true;
336 } 351 }
337 } 352 }
338 353
339 return KLineEdit::event(pe); 354 return KLineEdit::event(pe);
340} 355}
341 356
342void KListViewLineEdit::keyPressEvent(QKeyEvent *e) 357void KListViewLineEdit::keyPressEvent(QKeyEvent *e)
343{ 358{
344 if(e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) 359 if(e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter )
345 terminate(true); 360 terminate(true);
346 else if(e->key() == Qt::Key_Escape) 361 else if(e->key() == Qt::Key_Escape)
@@ -397,37 +412,37 @@ void KListViewLineEdit::paintEvent( QPaintEvent *e )
397// selection changed -> terminate. As our "item" can be already deleted, 412// selection changed -> terminate. As our "item" can be already deleted,
398// we can't call terminate(false), because that would emit done() with 413// we can't call terminate(false), because that would emit done() with
399// a dangling pointer to "item". 414// a dangling pointer to "item".
400void KListViewLineEdit::slotSelectionChanged() 415void KListViewLineEdit::slotSelectionChanged()
401{ 416{
402 item = 0; 417 item = 0;
403 col = 0; 418 col = 0;
404 hide(); 419 hide();
405} 420}
406*/ 421*/
407 422
408KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse ) 423KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse )
409 : QListView( parent, name ), 424 : Q3ListView( parent, name ),
410 d (new KListViewPrivate (this)) 425 d (new KListViewPrivate (this))
411{ 426{
412#ifndef DESKTOP_VERSION 427#ifndef DESKTOP_VERSION
413 if ( emulateRightMouse ) 428 if ( emulateRightMouse )
414 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 429 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
415#endif 430#endif
416//US setDragAutoScroll(true); 431//US setDragAutoScroll(true);
417 432
418 connect( this, SIGNAL( onViewport() ), 433 connect( this, SIGNAL( onViewport() ),
419 this, SLOT( slotOnViewport() ) ); 434 this, SLOT( slotOnViewport() ) );
420 connect( this, SIGNAL( onItem( QListViewItem * ) ), 435 connect( this, SIGNAL( onItem( Q3ListViewItem * ) ),
421 this, SLOT( slotOnItem( QListViewItem * ) ) ); 436 this, SLOT( slotOnItem( Q3ListViewItem * ) ) );
422 437
423 connect (this, SIGNAL(contentsMoving(int,int)), 438 connect (this, SIGNAL(contentsMoving(int,int)),
424 this, SLOT(cleanDropVisualizer())); 439 this, SLOT(cleanDropVisualizer()));
425 connect (this, SIGNAL(contentsMoving(int,int)), 440 connect (this, SIGNAL(contentsMoving(int,int)),
426 this, SLOT(cleanItemHighlighter())); 441 this, SLOT(cleanItemHighlighter()));
427 442
428/*US 443/*US
429 slotSettingsChanged(KApplication::SETTINGS_MOUSE); 444 slotSettingsChanged(KApplication::SETTINGS_MOUSE);
430 445
431 if (kapp) 446 if (kapp)
432 { 447 {
433 connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) ); 448 connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) );
@@ -436,83 +451,83 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse
436*/ 451*/
437 slotSettingsChanged(1); //US do this to initialize the connections 452 slotSettingsChanged(1); //US do this to initialize the connections
438 453
439 454
440 connect(&d->autoSelect, SIGNAL( timeout() ), 455 connect(&d->autoSelect, SIGNAL( timeout() ),
441 this, SLOT( slotAutoSelect() ) ); 456 this, SLOT( slotAutoSelect() ) );
442 connect(&d->dragExpand, SIGNAL( timeout() ), 457 connect(&d->dragExpand, SIGNAL( timeout() ),
443 this, SLOT( slotDragExpand() ) ); 458 this, SLOT( slotDragExpand() ) );
444 459
445 // context menu handling 460 // context menu handling
446 if (d->showContextMenusOnPress) 461 if (d->showContextMenusOnPress)
447 { 462 {
448 connect (this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)), 463 connect (this, SIGNAL (rightButtonPressed (Q3ListViewItem*, const QPoint&, int)),
449 this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); 464 this, SLOT (emitContextMenu (Q3ListViewItem*, const QPoint&, int)));
450 } 465 }
451 else 466 else
452 { 467 {
453 connect (this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)), 468 connect (this, SIGNAL (rightButtonClicked (Q3ListViewItem*, const QPoint&, int)),
454 this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); 469 this, SLOT (emitContextMenu (Q3ListViewItem*, const QPoint&, int)));
455 } 470 }
456 471
457 connect (this, SIGNAL (menuShortCutPressed (KListView*, QListViewItem*)), 472 connect (this, SIGNAL (menuShortCutPressed (KListView*, Q3ListViewItem*)),
458 this, SLOT (emitContextMenu (KListView*, QListViewItem*))); 473 this, SLOT (emitContextMenu (KListView*, Q3ListViewItem*)));
459 474
460 475
461 //qDebug("KListView::KListView make alternate color configurable"); 476 //qDebug("KListView::KListView make alternate color configurable");
462 d->alternateBackground = KGlobalSettings::alternateBackgroundColor(); 477 d->alternateBackground = KGlobalSettings::alternateBackgroundColor();
463} 478}
464 479
465 480
466 481
467KListView::~KListView() 482KListView::~KListView()
468{ 483{
469 delete d; 484 delete d;
470} 485}
471 486
472bool KListView::isExecuteArea( const QPoint& point ) 487bool KListView::isExecuteArea( const QPoint& point )
473{ 488{
474 if ( itemAt( point ) ) 489 if ( itemAt( point ) )
475 return isExecuteArea( point.x() ); 490 return isExecuteArea( point.x() );
476 491
477 return false; 492 return false;
478} 493}
479QSize KListView::sizeHint() const 494QSize KListView::sizeHint() const
480{ 495{
481 //qDebug("KListView::QSize sizeHint() "); 496 //qDebug("KListView::QSize sizeHint() ");
482#ifdef DESKTOP_VERSION 497#ifdef DESKTOP_VERSION
483 return QListView::sizeHint(); 498 return Q3ListView::sizeHint();
484#else 499#else
485 return QSize ( 40, 40 ); 500 return QSize ( 40, 40 );
486#endif 501#endif
487 502
488} 503}
489bool KListView::isExecuteArea( int x ) 504bool KListView::isExecuteArea( int x )
490{ 505{
491 if( allColumnsShowFocus() ) 506 if( allColumnsShowFocus() )
492 return true; 507 return true;
493 else { 508 else {
494 int offset = 0; 509 int offset = 0;
495 int width = columnWidth( 0 ); 510 int width = columnWidth( 0 );
496 int pos = header()->mapToIndex( 0 ); 511 int pos = header()->mapToIndex( 0 );
497 512
498 for ( int index = 0; index < pos; index++ ) 513 for ( int index = 0; index < pos; index++ )
499 offset += columnWidth( header()->mapToSection( index ) ); 514 offset += columnWidth( header()->mapToSection( index ) );
500 515
501 x += contentsX(); // in case of a horizontal scrollbar 516 x += contentsX(); // in case of a horizontal scrollbar
502 return ( x > offset && x < ( offset + width ) ); 517 return ( x > offset && x < ( offset + width ) );
503 } 518 }
504} 519}
505 520
506void KListView::slotOnItem( QListViewItem *item ) 521void KListView::slotOnItem( Q3ListViewItem *item )
507{ 522{
508 QPoint vp = viewport()->mapFromGlobal( QCursor::pos() ); 523 QPoint vp = viewport()->mapFromGlobal( QCursor::pos() );
509 if ( item && isExecuteArea( vp.x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) { 524 if ( item && isExecuteArea( vp.x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) {
510 d->autoSelect.start( d->autoSelectDelay, true ); 525 d->autoSelect.start( d->autoSelectDelay, true );
511 d->pCurrentItem = item; 526 d->pCurrentItem = item;
512 } 527 }
513} 528}
514 529
515void KListView::slotOnViewport() 530void KListView::slotOnViewport()
516{ 531{
517 if ( d->bChangeCursorOverItem ) 532 if ( d->bChangeCursorOverItem )
518 viewport()->unsetCursor(); 533 viewport()->unsetCursor();
@@ -525,30 +540,30 @@ void KListView::slotSettingsChanged(int category)
525{ 540{
526 //qDebug("KListView::slotSettingsChanged has to be verified"); 541 //qDebug("KListView::slotSettingsChanged has to be verified");
527 542
528 543
529 switch (category) 544 switch (category)
530 { 545 {
531 //US I create my private category (=1) to set the settings 546 //US I create my private category (=1) to set the settings
532 case 1: 547 case 1:
533 d->dragDelay = 2; 548 d->dragDelay = 2;
534 //US set explicitly d->bUseSingle = KGlobalSettings::singleClick(); 549 //US set explicitly d->bUseSingle = KGlobalSettings::singleClick();
535 // qDebug("KListView::slotSettingsChanged: single%i", d->bUseSingle); 550 // qDebug("KListView::slotSettingsChanged: single%i", d->bUseSingle);
536 551
537 disconnect(this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), 552 disconnect(this, SIGNAL (mouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int)),
538 this, SLOT (slotMouseButtonClicked (int, QListViewItem*, const QPoint &, int))); 553 this, SLOT (slotMouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int)));
539 554
540 if( d->bUseSingle ) 555 if( d->bUseSingle )
541 connect (this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), 556 connect (this, SIGNAL (mouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int)),
542 this, SLOT (slotMouseButtonClicked( int, QListViewItem*, const QPoint &, int))); 557 this, SLOT (slotMouseButtonClicked( int, Q3ListViewItem*, const QPoint &, int)));
543 558
544 //US d->bChangeCursorOverItem = KGlobalSettings::changeCursorOverIcon(); 559 //US d->bChangeCursorOverItem = KGlobalSettings::changeCursorOverIcon();
545 //US d->autoSelectDelay = KGlobalSettings::autoSelectDelay(); 560 //US d->autoSelectDelay = KGlobalSettings::autoSelectDelay();
546 561
547 if( !d->bUseSingle || !d->bChangeCursorOverItem ) 562 if( !d->bUseSingle || !d->bChangeCursorOverItem )
548 viewport()->unsetCursor(); 563 viewport()->unsetCursor();
549 564
550 break; 565 break;
551 566
552 /*US 567 /*US
553 case KApplication::SETTINGS_MOUSE: 568 case KApplication::SETTINGS_MOUSE:
554 d->dragDelay = KGlobalSettings::dndEventDelay(); 569 d->dragDelay = KGlobalSettings::dndEventDelay();
@@ -602,65 +617,65 @@ void KListView::slotAutoSelect()
602 return; 617 return;
603 618
604 if (!isActiveWindow()) 619 if (!isActiveWindow())
605 { 620 {
606 d->autoSelect.stop(); 621 d->autoSelect.stop();
607 return; 622 return;
608 } 623 }
609 624
610 //Give this widget the keyboard focus. 625 //Give this widget the keyboard focus.
611 if( !hasFocus() ) 626 if( !hasFocus() )
612 setFocus(); 627 setFocus();
613 628
614 QListViewItem* previousItem = currentItem(); 629 Q3ListViewItem* previousItem = currentItem();
615 setCurrentItem( d->pCurrentItem ); 630 setCurrentItem( d->pCurrentItem );
616 631
617#if 0 632#if 0
618#ifndef Q_WS_QWS 633#ifndef Q_WS_QWS
619 // FIXME(E): Implement for Qt Embedded 634 // FIXME(E): Implement for Qt Embedded
620 if( d->pCurrentItem ) { 635 if( d->pCurrentItem ) {
621 //Shift pressed? 636 //Shift pressed?
622 if( (keybstate & ShiftMask) ) { 637 if( (keybstate & ShiftMask) ) {
623 bool block = signalsBlocked(); 638 bool block = signalsBlocked();
624 blockSignals( true ); 639 blockSignals( true );
625 640
626 //No Ctrl? Then clear before! 641 //No Ctrl? Then clear before!
627 if( !(keybstate & ControlMask) ) 642 if( !(keybstate & ControlMask) )
628 clearSelection(); 643 clearSelection();
629 644
630 bool select = !d->pCurrentItem->isSelected(); 645 bool select = !d->pCurrentItem->isSelected();
631 bool update = viewport()->isUpdatesEnabled(); 646 bool update = viewport()->isUpdatesEnabled();
632 viewport()->setUpdatesEnabled( false ); 647 viewport()->setUpdatesEnabled( false );
633 648
634 bool down = previousItem->itemPos() < d->pCurrentItem->itemPos(); 649 bool down = previousItem->itemPos() < d->pCurrentItem->itemPos();
635 QListViewItemIterator lit( down ? previousItem : d->pCurrentItem ); 650 Q3ListViewItemIterator lit( down ? previousItem : d->pCurrentItem );
636 for ( ; lit.current(); ++lit ) { 651 for ( ; lit.current(); ++lit ) {
637 if ( down && lit.current() == d->pCurrentItem ) { 652 if ( down && lit.current() == d->pCurrentItem ) {
638 d->pCurrentItem->setSelected( select ); 653 d->pCurrentItem->setSelected( select );
639 break; 654 break;
640 } 655 }
641 if ( !down && lit.current() == previousItem ) { 656 if ( !down && lit.current() == previousItem ) {
642 previousItem->setSelected( select ); 657 previousItem->setSelected( select );
643 break; 658 break;
644 } 659 }
645 lit.current()->setSelected( select ); 660 lit.current()->setSelected( select );
646 } 661 }
647 662
648 blockSignals( block ); 663 blockSignals( block );
649 viewport()->setUpdatesEnabled( update ); 664 viewport()->setUpdatesEnabled( update );
650 triggerUpdate(); 665 triggerUpdate();
651 666
652 emit selectionChanged(); 667 emit selectionChanged();
653 668
654 if( selectionMode() == QListView::Single ) 669 if( selectionMode() == Q3ListView::Single )
655 emit selectionChanged( d->pCurrentItem ); 670 emit selectionChanged( d->pCurrentItem );
656 } 671 }
657 else if( (keybstate & ControlMask) ) 672 else if( (keybstate & ControlMask) )
658 setSelected( d->pCurrentItem, !d->pCurrentItem->isSelected() ); 673 setSelected( d->pCurrentItem, !d->pCurrentItem->isSelected() );
659 else { 674 else {
660 bool block = signalsBlocked(); 675 bool block = signalsBlocked();
661 blockSignals( true ); 676 blockSignals( true );
662 677
663 if( !d->pCurrentItem->isSelected() ) 678 if( !d->pCurrentItem->isSelected() )
664 clearSelection(); 679 clearSelection();
665 680
666 blockSignals( block ); 681 blockSignals( block );
@@ -675,55 +690,55 @@ void KListView::slotAutoSelect()
675} 690}
676 691
677void KListView::slotHeaderChanged() 692void KListView::slotHeaderChanged()
678{ 693{
679 if (d->fullWidth && columns()) 694 if (d->fullWidth && columns())
680 { 695 {
681 int w = 0; 696 int w = 0;
682 for (int i = 0; i < columns() - 1; ++i) w += columnWidth(i); 697 for (int i = 0; i < columns() - 1; ++i) w += columnWidth(i);
683 setColumnWidth( columns() - 1, viewport()->width() - w - 1 ); 698 setColumnWidth( columns() - 1, viewport()->width() - w - 1 );
684 } 699 }
685} 700}
686 701
687void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint &pos, int c) 702void KListView::emitExecute( int buttonstate, Q3ListViewItem *item, const QPoint &pos, int c)
688{ 703{
689 // qDebug("KListView::emitExecute buttonstate=%i", buttonstate); 704 // qDebug("KListView::emitExecute buttonstate=%i", buttonstate);
690 if( isExecuteArea( viewport()->mapFromGlobal(pos) ) ) { 705 if( isExecuteArea( viewport()->mapFromGlobal(pos) ) ) {
691 706
692 // Double click mode ? 707 // Double click mode ?
693 if ( !d->bUseSingle ) 708 if ( !d->bUseSingle )
694 { 709 {
695 emit executed( item ); 710 emit executed( item );
696 emit executed( item, pos, c ); 711 emit executed( item, pos, c );
697 } 712 }
698 else 713 else
699 { 714 {
700 //US special implementation for embedded systems 715 //US special implementation for embedded systems
701 d->autoSelect.stop(); 716 d->autoSelect.stop();
702 717
703 //Dont emit executed if in SC mode and Shift or Ctrl are pressed 718 //Dont emit executed if in SC mode and Shift or Ctrl are pressed
704 if( !( (buttonstate==ShiftButton) || (buttonstate==ControlButton) )) { 719 if( !( (buttonstate==Qt::ShiftButton) || (buttonstate==Qt::ControlButton) )) {
705 // if( !( ((keybstate & ShiftMask) || (keybstate & ControlMask)) ) ) { 720 // if( !( ((keybstate & ShiftMask) || (keybstate & ControlMask)) ) ) {
706 721
707 emit executed( item ); 722 emit executed( item );
708 emit executed( item, pos, c ); 723 emit executed( item, pos, c );
709 } 724 }
710 } 725 }
711 } 726 }
712} 727}
713 728
714void KListView::focusInEvent( QFocusEvent *fe ) 729void KListView::focusInEvent( QFocusEvent *fe )
715{ 730{
716 // kdDebug()<<"KListView::focusInEvent()"<<endl; 731 // kdDebug()<<"KListView::focusInEvent()"<<endl;
717 QListView::focusInEvent( fe ); 732 Q3ListView::focusInEvent( fe );
718 if ((d->selectedBySimpleMove) 733 if ((d->selectedBySimpleMove)
719 && (d->selectionMode == FileManager) 734 && (d->selectionMode == FileManager)
720 && (fe->reason()!=QFocusEvent::Popup) 735 && (fe->reason()!=QFocusEvent::Popup)
721 && (fe->reason()!=QFocusEvent::ActiveWindow) 736 && (fe->reason()!=QFocusEvent::ActiveWindow)
722 && (currentItem()!=0)) 737 && (currentItem()!=0))
723 { 738 {
724 currentItem()->setSelected(true); 739 currentItem()->setSelected(true);
725 currentItem()->repaint(); 740 currentItem()->repaint();
726 emit selectionChanged(); 741 emit selectionChanged();
727 }; 742 };
728} 743}
729 744
@@ -738,102 +753,102 @@ void KListView::focusOutEvent( QFocusEvent *fe )
738 && (d->selectionMode == FileManager) 753 && (d->selectionMode == FileManager)
739 && (fe->reason()!=QFocusEvent::Popup) 754 && (fe->reason()!=QFocusEvent::Popup)
740 && (fe->reason()!=QFocusEvent::ActiveWindow) 755 && (fe->reason()!=QFocusEvent::ActiveWindow)
741 && (currentItem()!=0) 756 && (currentItem()!=0)
742/*US && (!d->editor->isVisible()) */ 757/*US && (!d->editor->isVisible()) */
743 ) 758 )
744 { 759 {
745 currentItem()->setSelected(false); 760 currentItem()->setSelected(false);
746 currentItem()->repaint(); 761 currentItem()->repaint();
747 emit selectionChanged(); 762 emit selectionChanged();
748 }; 763 };
749 764
750 QListView::focusOutEvent( fe ); 765 Q3ListView::focusOutEvent( fe );
751} 766}
752 767
753void KListView::leaveEvent( QEvent *e ) 768void KListView::leaveEvent( QEvent *e )
754{ 769{
755 d->autoSelect.stop(); 770 d->autoSelect.stop();
756 771
757 QListView::leaveEvent( e ); 772 Q3ListView::leaveEvent( e );
758} 773}
759 774
760bool KListView::event( QEvent *e ) 775bool KListView::event( QEvent *e )
761{ 776{
762 if (e->type() == QEvent::ApplicationPaletteChange) { 777 if (e->type() == QEvent::ApplicationPaletteChange) {
763 //qDebug("KListView::event make alternate color configurable"); 778 //qDebug("KListView::event make alternate color configurable");
764//US d->alternateBackground=KGlobalSettings::alternateBackgroundColor(); 779//US d->alternateBackground=KGlobalSettings::alternateBackgroundColor();
765 d->alternateBackground = QColor(240, 240, 240); 780 d->alternateBackground = QColor(240, 240, 240);
766 } 781 }
767 782
768 return QListView::event(e); 783 return Q3ListView::event(e);
769} 784}
770 785
771void KListView::contentsMousePressEvent( QMouseEvent *e ) 786void KListView::contentsMousePressEvent( QMouseEvent *e )
772{ 787{
773 //qDebug("KListView::contentsMousePressEvent"); 788 //qDebug("KListView::contentsMousePressEvent");
774 if( (selectionModeExt() == Extended) && (e->state() & ShiftButton) && !(e->state() & ControlButton) ) 789 if( (selectionModeExt() == Extended) && (e->state() & Qt::ShiftButton) && !(e->state() & Qt::ControlButton) )
775 { 790 {
776 bool block = signalsBlocked(); 791 bool block = signalsBlocked();
777 blockSignals( true ); 792 blockSignals( true );
778 793
779 clearSelection(); 794 clearSelection();
780 795
781 blockSignals( block ); 796 blockSignals( block );
782 } 797 }
783 else if ((selectionModeExt()==FileManager) && (d->selectedBySimpleMove)) 798 else if ((selectionModeExt()==FileManager) && (d->selectedBySimpleMove))
784 { 799 {
785 d->selectedBySimpleMove=false; 800 d->selectedBySimpleMove=false;
786 d->selectedUsingMouse=true; 801 d->selectedUsingMouse=true;
787 if (currentItem()!=0) 802 if (currentItem()!=0)
788 { 803 {
789 currentItem()->setSelected(false); 804 currentItem()->setSelected(false);
790 currentItem()->repaint(); 805 currentItem()->repaint();
791// emit selectionChanged(); 806// emit selectionChanged();
792 }; 807 };
793 }; 808 };
794 809
795 QPoint p( contentsToViewport( e->pos() ) ); 810 QPoint p( contentsToViewport( e->pos() ) );
796 QListViewItem *at = itemAt (p); 811 Q3ListViewItem *at = itemAt (p);
797 812
798 // true if the root decoration of the item "at" was clicked (i.e. the +/- sign) 813 // true if the root decoration of the item "at" was clicked (i.e. the +/- sign)
799 bool rootDecoClicked = at 814 bool rootDecoClicked = at
800 && ( p.x() <= header()->cellPos( header()->mapToActual( 0 ) ) + 815 && ( p.x() <= header()->cellPos( header()->mapToActual( 0 ) ) +
801 treeStepSize() * ( at->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() ) 816 treeStepSize() * ( at->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() )
802 && ( p.x() >= header()->cellPos( header()->mapToActual( 0 ) ) ); 817 && ( p.x() >= header()->cellPos( header()->mapToActual( 0 ) ) );
803 818
804 if (e->button() == LeftButton && !rootDecoClicked) 819 if (e->button() == Qt::LeftButton && !rootDecoClicked)
805 { 820 {
806 //Start a drag 821 //Start a drag
807 d->startDragPos = e->pos(); 822 d->startDragPos = e->pos();
808 823
809 if (at) 824 if (at)
810 { 825 {
811 d->validDrag = true; 826 d->validDrag = true;
812 d->pressedOnSelected = at->isSelected(); 827 d->pressedOnSelected = at->isSelected();
813 } 828 }
814 } 829 }
815 830
816 QListView::contentsMousePressEvent( e ); 831 Q3ListView::contentsMousePressEvent( e );
817} 832}
818 833
819void KListView::contentsMouseMoveEvent( QMouseEvent *e ) 834void KListView::contentsMouseMoveEvent( QMouseEvent *e )
820{ 835{
821 if (!dragEnabled() || d->startDragPos.isNull() || !d->validDrag) { 836 if (!dragEnabled() || d->startDragPos.isNull() || !d->validDrag) {
822 QListView::contentsMouseMoveEvent (e); 837 Q3ListView::contentsMouseMoveEvent (e);
823 return; 838 return;
824 } 839 }
825 840
826 QPoint vp = contentsToViewport(e->pos()); 841 QPoint vp = contentsToViewport(e->pos());
827 QListViewItem *item = itemAt( vp ); 842 Q3ListViewItem *item = itemAt( vp );
828 843
829 //do we process cursor changes at all? 844 //do we process cursor changes at all?
830 if ( item && d->bChangeCursorOverItem && d->bUseSingle ) 845 if ( item && d->bChangeCursorOverItem && d->bUseSingle )
831 { 846 {
832 //Cursor moved on a new item or in/out the execute area 847 //Cursor moved on a new item or in/out the execute area
833 if( (item != d->pCurrentItem) || 848 if( (item != d->pCurrentItem) ||
834 (isExecuteArea(vp) != d->cursorInExecuteArea) ) 849 (isExecuteArea(vp) != d->cursorInExecuteArea) )
835 { 850 {
836 d->cursorInExecuteArea = isExecuteArea(vp); 851 d->cursorInExecuteArea = isExecuteArea(vp);
837 //qDebug("KListView::contentsMouseMoveEvent drag&drop not supported yet"); 852 //qDebug("KListView::contentsMouseMoveEvent drag&drop not supported yet");
838/*US 853/*US
839 if( d->cursorInExecuteArea ) //cursor moved in execute area 854 if( d->cursorInExecuteArea ) //cursor moved in execute area
@@ -844,95 +859,95 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e )
844 } 859 }
845 } 860 }
846 861
847 bool dragOn = dragEnabled(); 862 bool dragOn = dragEnabled();
848 QPoint newPos = e->pos(); 863 QPoint newPos = e->pos();
849 if (dragOn && d->validDrag && 864 if (dragOn && d->validDrag &&
850 (newPos.x() > d->startDragPos.x()+d->dragDelay || 865 (newPos.x() > d->startDragPos.x()+d->dragDelay ||
851 newPos.x() < d->startDragPos.x()-d->dragDelay || 866 newPos.x() < d->startDragPos.x()-d->dragDelay ||
852 newPos.y() > d->startDragPos.y()+d->dragDelay || 867 newPos.y() > d->startDragPos.y()+d->dragDelay ||
853 newPos.y() < d->startDragPos.y()-d->dragDelay)) 868 newPos.y() < d->startDragPos.y()-d->dragDelay))
854 //(d->startDragPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) 869 //(d->startDragPos - e->pos()).manhattanLength() > QApplication::startDragDistance())
855 { 870 {
856 QListView::contentsMouseReleaseEvent( 0 ); 871 Q3ListView::contentsMouseReleaseEvent( 0 );
857 startDrag(); 872 startDrag();
858 d->startDragPos = QPoint(); 873 d->startDragPos = QPoint();
859 d->validDrag = false; 874 d->validDrag = false;
860 } 875 }
861} 876}
862 877
863void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) 878void KListView::contentsMouseReleaseEvent( QMouseEvent *e )
864{ 879{
865 if (e->button() == LeftButton) 880 if (e->button() == Qt::LeftButton)
866 { 881 {
867 // If the row was already selected, maybe we want to start an in-place editing 882 // If the row was already selected, maybe we want to start an in-place editing
868 if ( d->pressedOnSelected && itemsRenameable() ) 883 if ( d->pressedOnSelected && itemsRenameable() )
869 { 884 {
870 QPoint p( contentsToViewport( e->pos() ) ); 885 QPoint p( contentsToViewport( e->pos() ) );
871 QListViewItem *at = itemAt (p); 886 Q3ListViewItem *at = itemAt (p);
872 if ( at ) 887 if ( at )
873 { 888 {
874 // true if the root decoration of the item "at" was clicked (i.e. the +/- sign) 889 // true if the root decoration of the item "at" was clicked (i.e. the +/- sign)
875 bool rootDecoClicked = 890 bool rootDecoClicked =
876 ( p.x() <= header()->cellPos( header()->mapToActual( 0 ) ) + 891 ( p.x() <= header()->cellPos( header()->mapToActual( 0 ) ) +
877 treeStepSize() * ( at->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() ) 892 treeStepSize() * ( at->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() )
878 && ( p.x() >= header()->cellPos( header()->mapToActual( 0 ) ) ); 893 && ( p.x() >= header()->cellPos( header()->mapToActual( 0 ) ) );
879 894
880 if (!rootDecoClicked) 895 if (!rootDecoClicked)
881 { 896 {
882 int col = header()->mapToLogical( header()->cellAt( p.x() ) ); 897 int col = header()->mapToLogical( header()->cellAt( p.x() ) );
883 if ( d->renameable.contains(col) ) 898 if ( d->renameable.contains(col) )
884 rename(at, col); 899 rename(at, col);
885 } 900 }
886 } 901 }
887 } 902 }
888 903
889 d->pressedOnSelected = false; 904 d->pressedOnSelected = false;
890 d->validDrag = false; 905 d->validDrag = false;
891 d->startDragPos = QPoint(); 906 d->startDragPos = QPoint();
892 } 907 }
893 QListView::contentsMouseReleaseEvent( e ); 908 Q3ListView::contentsMouseReleaseEvent( e );
894} 909}
895 910
896void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) 911void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e )
897{ 912{
898 //qDebug("KListView::contentsMouseDoubleClickEvent"); 913 //qDebug("KListView::contentsMouseDoubleClickEvent");
899 // We don't want to call the parent method because it does setOpen, 914 // We don't want to call the parent method because it does setOpen,
900 // whereas we don't do it in single click mode... (David) 915 // whereas we don't do it in single click mode... (David)
901 //QListView::contentsMouseDoubleClickEvent( e ); 916 //QListView::contentsMouseDoubleClickEvent( e );
902 917
903 QPoint vp = contentsToViewport(e->pos()); 918 QPoint vp = contentsToViewport(e->pos());
904 QListViewItem *item = itemAt( vp ); 919 Q3ListViewItem *item = itemAt( vp );
905 emit QListView::doubleClicked( item ); // we do it now 920 emit Q3ListView::doubleClicked( item ); // we do it now
906 921
907 int col = item ? header()->mapToLogical( header()->cellAt( vp.x() ) ) : -1; 922 int col = item ? header()->mapToLogical( header()->cellAt( vp.x() ) ) : -1;
908 923
909 if( item ) { 924 if( item ) {
910 //qDebug("KListView::contentsMouseDoubleClickEvent: emit doubleClicked"); 925 //qDebug("KListView::contentsMouseDoubleClickEvent: emit doubleClicked");
911 926
912 emit doubleClicked( item, e->globalPos(), col ); 927 emit doubleClicked( item, e->globalPos(), col );
913 928
914 if( (e->button() == LeftButton) && !d->bUseSingle ) { 929 if( (e->button() == Qt::LeftButton) && !d->bUseSingle ) {
915 //qDebug("KListView::contentsMouseDoubleClickEvent: emitExecute"); 930 //qDebug("KListView::contentsMouseDoubleClickEvent: emitExecute");
916 931
917 emitExecute( e->button(), item, e->globalPos(), col); 932 emitExecute( e->button(), item, e->globalPos(), col);
918 } 933 }
919 } 934 }
920} 935}
921 936
922void KListView::slotMouseButtonClicked( int btn, QListViewItem *item, const QPoint &pos, int c ) 937void KListView::slotMouseButtonClicked( int btn, Q3ListViewItem *item, const QPoint &pos, int c )
923{ 938{
924 //qDebug("KListView::slotMouseButtonClicked"); 939 //qDebug("KListView::slotMouseButtonClicked");
925 940
926 if( (btn == LeftButton) && item ) { 941 if( (btn == Qt::LeftButton) && item ) {
927 //qDebug("KListView::slotMouseButtonClicked: emitExecute"); 942 //qDebug("KListView::slotMouseButtonClicked: emitExecute");
928 943
929 emitExecute(btn, item, pos, c); 944 emitExecute(btn, item, pos, c);
930 } 945 }
931} 946}
932 947
933void KListView::contentsDropEvent(QDropEvent* e) 948void KListView::contentsDropEvent(QDropEvent* e)
934{ 949{
935qDebug("KListView::contentsDropEvent drag&drop not supported yet"); 950qDebug("KListView::contentsDropEvent drag&drop not supported yet");
936/*US 951/*US
937 cleanDropVisualizer(); 952 cleanDropVisualizer();
938 cleanItemHighlighter(); 953 cleanItemHighlighter();
@@ -952,64 +967,64 @@ qDebug("KListView::contentsDropEvent drag&drop not supported yet");
952 967
953 emit dropped(e, afterme); 968 emit dropped(e, afterme);
954 emit dropped(this, e, afterme); 969 emit dropped(this, e, afterme);
955 emit dropped(e, parent, afterme); 970 emit dropped(e, parent, afterme);
956 emit dropped(this, e, parent, afterme); 971 emit dropped(this, e, parent, afterme);
957 972
958 } 973 }
959 } 974 }
960*/ 975*/
961 976
962} 977}
963 978
964void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) 979void KListView::movableDropEvent (Q3ListViewItem* parent, Q3ListViewItem* afterme)
965{ 980{
966 QPtrList<QListViewItem> items, afterFirsts, afterNows; 981 Q3PtrList<Q3ListViewItem> items, afterFirsts, afterNows;
967 QListViewItem *current=currentItem(); 982 Q3ListViewItem *current=currentItem();
968 bool hasMoved=false; 983 bool hasMoved=false;
969 for (QListViewItem *i = firstChild(), *iNext=0; i != 0; i = iNext) 984 for (Q3ListViewItem *i = firstChild(), *iNext=0; i != 0; i = iNext)
970 { 985 {
971 iNext=i->itemBelow(); 986 iNext=i->itemBelow();
972 if (!i->isSelected()) 987 if (!i->isSelected())
973 continue; 988 continue;
974 989
975 // don't drop an item after itself, or else 990 // don't drop an item after itself, or else
976 // it moves to the top of the list 991 // it moves to the top of the list
977 if (i==afterme) 992 if (i==afterme)
978 continue; 993 continue;
979 994
980 i->setSelected(false); 995 i->setSelected(false);
981 996
982 QListViewItem *afterFirst = i->itemAbove(); 997 Q3ListViewItem *afterFirst = i->itemAbove();
983 998
984 if (!hasMoved) 999 if (!hasMoved)
985 { 1000 {
986 emit aboutToMove(); 1001 emit aboutToMove();
987 hasMoved=true; 1002 hasMoved=true;
988 } 1003 }
989 1004
990 moveItem(i, parent, afterme); 1005 moveItem(i, parent, afterme);
991 1006
992 // ###### This should include the new parent !!! -> KDE 3.0 1007 // ###### This should include the new parent !!! -> KDE 3.0
993 // If you need this right now, have a look at keditbookmarks. 1008 // If you need this right now, have a look at keditbookmarks.
994 emit moved(i, afterFirst, afterme); 1009 emit moved(i, afterFirst, afterme);
995 1010
996 items.append (i); 1011 items.append (i);
997 afterFirsts.append (afterFirst); 1012 afterFirsts.append (afterFirst);
998 afterNows.append (afterme); 1013 afterNows.append (afterme);
999 1014
1000 afterme = i; 1015 afterme = i;
1001 } 1016 }
1002 clearSelection(); 1017 clearSelection();
1003 for (QListViewItem *i=items.first(); i != 0; i=items.next() ) 1018 for (Q3ListViewItem *i=items.first(); i != 0; i=items.next() )
1004 i->setSelected(true); 1019 i->setSelected(true);
1005 if (current) 1020 if (current)
1006 setCurrentItem(current); 1021 setCurrentItem(current);
1007 1022
1008 emit moved(items,afterFirsts,afterNows); 1023 emit moved(items,afterFirsts,afterNows);
1009 1024
1010 if (firstChild()) 1025 if (firstChild())
1011 emit moved(); 1026 emit moved();
1012} 1027}
1013 1028
1014void KListView::contentsDragMoveEvent(QDragMoveEvent *event) 1029void KListView::contentsDragMoveEvent(QDragMoveEvent *event)
1015{ 1030{
@@ -1077,32 +1092,32 @@ void KListView::cleanDropVisualizer()
1077 { 1092 {
1078 QRect rect=d->mOldDropVisualizer; 1093 QRect rect=d->mOldDropVisualizer;
1079 d->mOldDropVisualizer = QRect(); 1094 d->mOldDropVisualizer = QRect();
1080 viewport()->repaint(rect, true); 1095 viewport()->repaint(rect, true);
1081 } 1096 }
1082} 1097}
1083 1098
1084int KListView::depthToPixels( int depth ) 1099int KListView::depthToPixels( int depth )
1085{ 1100{
1086 return treeStepSize() * ( depth + (rootIsDecorated() ? 1 : 0) ) + itemMargin(); 1101 return treeStepSize() * ( depth + (rootIsDecorated() ? 1 : 0) ) + itemMargin();
1087} 1102}
1088 1103
1089void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after) 1104void KListView::findDrop(const QPoint &pos, Q3ListViewItem *&parent, Q3ListViewItem *&after)
1090{ 1105{
1091 QPoint p (contentsToViewport(pos)); 1106 QPoint p (contentsToViewport(pos));
1092 1107
1093 // Get the position to put it in 1108 // Get the position to put it in
1094 QListViewItem *atpos = itemAt(p); 1109 Q3ListViewItem *atpos = itemAt(p);
1095 1110
1096 QListViewItem *above; 1111 Q3ListViewItem *above;
1097 if (!atpos) // put it at the end 1112 if (!atpos) // put it at the end
1098 above = lastItem(); 1113 above = lastItem();
1099 else 1114 else
1100 { 1115 {
1101 // Get the closest item before us ('atpos' or the one above, if any) 1116 // Get the closest item before us ('atpos' or the one above, if any)
1102 if (p.y() - itemRect(atpos).topLeft().y() < (atpos->height()/2)) 1117 if (p.y() - itemRect(atpos).topLeft().y() < (atpos->height()/2))
1103 above = atpos->itemAbove(); 1118 above = atpos->itemAbove();
1104 else 1119 else
1105 above = atpos; 1120 above = atpos;
1106 } 1121 }
1107 1122
1108 if (above) 1123 if (above)
@@ -1114,62 +1129,62 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte
1114 // The mouse is sufficiently on the right ? - doesn't matter if 'above' has visible children 1129 // The mouse is sufficiently on the right ? - doesn't matter if 'above' has visible children
1115 if (p.x() >= depthToPixels( above->depth() + 1 ) || 1130 if (p.x() >= depthToPixels( above->depth() + 1 ) ||
1116 (above->isOpen() && above->childCount() > 0) ) 1131 (above->isOpen() && above->childCount() > 0) )
1117 { 1132 {
1118 parent = above; 1133 parent = above;
1119 after = 0L; 1134 after = 0L;
1120 return; 1135 return;
1121 } 1136 }
1122 } 1137 }
1123 1138
1124 // Ok, there's one more level of complexity. We may want to become a new 1139 // Ok, there's one more level of complexity. We may want to become a new
1125 // sibling, but of an upper-level group, rather than the "above" item 1140 // sibling, but of an upper-level group, rather than the "above" item
1126 QListViewItem * betterAbove = above->parent(); 1141 Q3ListViewItem * betterAbove = above->parent();
1127 QListViewItem * last = above; 1142 Q3ListViewItem * last = above;
1128 while ( betterAbove ) 1143 while ( betterAbove )
1129 { 1144 {
1130 // We are allowed to become a sibling of "betterAbove" only if we are 1145 // We are allowed to become a sibling of "betterAbove" only if we are
1131 // after its last child 1146 // after its last child
1132 if ( last->nextSibling() == 0 ) 1147 if ( last->nextSibling() == 0 )
1133 { 1148 {
1134 if (p.x() < depthToPixels ( betterAbove->depth() + 1 )) 1149 if (p.x() < depthToPixels ( betterAbove->depth() + 1 ))
1135 above = betterAbove; // store this one, but don't stop yet, there may be a better one 1150 above = betterAbove; // store this one, but don't stop yet, there may be a better one
1136 else 1151 else
1137 break; // not enough on the left, so stop 1152 break; // not enough on the left, so stop
1138 last = betterAbove; 1153 last = betterAbove;
1139 betterAbove = betterAbove->parent(); // up one level 1154 betterAbove = betterAbove->parent(); // up one level
1140 } else 1155 } else
1141 break; // we're among the child of betterAbove, not after the last one 1156 break; // we're among the child of betterAbove, not after the last one
1142 } 1157 }
1143 } 1158 }
1144 // set as sibling 1159 // set as sibling
1145 after = above; 1160 after = above;
1146 parent = after ? after->parent() : 0L ; 1161 parent = after ? after->parent() : 0L ;
1147} 1162}
1148 1163
1149QListViewItem* KListView::lastChild () const 1164Q3ListViewItem* KListView::lastChild () const
1150{ 1165{
1151 QListViewItem* lastchild = firstChild(); 1166 Q3ListViewItem* lastchild = firstChild();
1152 1167
1153 if (lastchild) 1168 if (lastchild)
1154 for (; lastchild->nextSibling(); lastchild = lastchild->nextSibling()); 1169 for (; lastchild->nextSibling(); lastchild = lastchild->nextSibling());
1155 1170
1156 return lastchild; 1171 return lastchild;
1157} 1172}
1158 1173
1159QListViewItem *KListView::lastItem() const 1174Q3ListViewItem *KListView::lastItem() const
1160{ 1175{
1161 QListViewItem* last = lastChild(); 1176 Q3ListViewItem* last = lastChild();
1162 1177
1163 for (QListViewItemIterator it (last); it.current(); ++it) 1178 for (Q3ListViewItemIterator it (last); it.current(); ++it)
1164 last = it.current(); 1179 last = it.current();
1165 1180
1166 return last; 1181 return last;
1167} 1182}
1168 1183
1169KLineEdit *KListView::renameLineEdit() const 1184KLineEdit *KListView::renameLineEdit() const
1170{ 1185{
1171//US return d->editor; 1186//US return d->editor;
1172qDebug("KListView::renameLineEdit returns 0. Might crash"); 1187qDebug("KListView::renameLineEdit returns 0. Might crash");
1173return 0; 1188return 0;
1174} 1189}
1175 1190
@@ -1178,30 +1193,30 @@ void KListView::startDrag()
1178qDebug("KListView::startDrag drag&drop not supported yet."); 1193qDebug("KListView::startDrag drag&drop not supported yet.");
1179/*US 1194/*US
1180 QDragObject *drag = dragObject(); 1195 QDragObject *drag = dragObject();
1181 1196
1182 if (!drag) 1197 if (!drag)
1183 return; 1198 return;
1184 1199
1185 if (drag->drag() && drag->target() != viewport()) 1200 if (drag->drag() && drag->target() != viewport())
1186 emit moved(); 1201 emit moved();
1187*/ 1202*/
1188} 1203}
1189 1204
1190QDragObject *KListView::dragObject() 1205Q3DragObject *KListView::dragObject()
1191{ 1206{
1192 if (!currentItem()) 1207 if (!currentItem())
1193 return 0; 1208 return 0;
1194 1209
1195 return new QStoredDrag("application/x-qlistviewitem", viewport()); 1210 return new Q3StoredDrag("application/x-qlistviewitem", viewport());
1196} 1211}
1197 1212
1198void KListView::setItemsMovable(bool b) 1213void KListView::setItemsMovable(bool b)
1199{ 1214{
1200 d->itemsMovable=b; 1215 d->itemsMovable=b;
1201} 1216}
1202 1217
1203bool KListView::itemsMovable() const 1218bool KListView::itemsMovable() const
1204{ 1219{
1205 return d->itemsMovable; 1220 return d->itemsMovable;
1206} 1221}
1207 1222
@@ -1237,37 +1252,37 @@ bool KListView::autoOpen() const
1237} 1252}
1238 1253
1239bool KListView::dropVisualizer() const 1254bool KListView::dropVisualizer() const
1240{ 1255{
1241 return d->dropVisualizer; 1256 return d->dropVisualizer;
1242} 1257}
1243 1258
1244void KListView::setDropVisualizer(bool b) 1259void KListView::setDropVisualizer(bool b)
1245{ 1260{
1246 d->dropVisualizer=b; 1261 d->dropVisualizer=b;
1247} 1262}
1248 1263
1249QPtrList<QListViewItem> KListView::selectedItems() const 1264Q3PtrList<Q3ListViewItem> KListView::selectedItems() const
1250{ 1265{
1251 QPtrList<QListViewItem> list; 1266 Q3PtrList<Q3ListViewItem> list;
1252 for (QListViewItem *i=firstChild(); i!=0; i=i->itemBelow()) 1267 for (Q3ListViewItem *i=firstChild(); i!=0; i=i->itemBelow())
1253 if (i->isSelected()) list.append(i); 1268 if (i->isSelected()) list.append(i);
1254 return list; 1269 return list;
1255} 1270}
1256 1271
1257 1272
1258void KListView::moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after) 1273void KListView::moveItem(Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *after)
1259{ 1274{
1260 // sanity check - don't move a item into it's own child structure 1275 // sanity check - don't move a item into it's own child structure
1261 QListViewItem *i = parent; 1276 Q3ListViewItem *i = parent;
1262 while(i) 1277 while(i)
1263 { 1278 {
1264 if(i == item) 1279 if(i == item)
1265 return; 1280 return;
1266 i = i->parent(); 1281 i = i->parent();
1267 } 1282 }
1268 1283
1269 // Basically reimplementing the QListViewItem(QListViewItem*, QListViewItem*) constructor 1284 // Basically reimplementing the QListViewItem(QListViewItem*, QListViewItem*) constructor
1270 // in here, without ever deleting the item. 1285 // in here, without ever deleting the item.
1271 if (item->parent()) 1286 if (item->parent())
1272 item->parent()->takeItem(item); 1287 item->parent()->takeItem(item);
1273 else 1288 else
@@ -1287,37 +1302,37 @@ void KListView::contentsDragEnterEvent(QDragEnterEvent *event)
1287qDebug("KListView::contentsDragEnterEvent drag&drop not supported yet."); 1302qDebug("KListView::contentsDragEnterEvent drag&drop not supported yet.");
1288/*US 1303/*US
1289 if (acceptDrag (event)) 1304 if (acceptDrag (event))
1290 event->accept(); 1305 event->accept();
1291*/ 1306*/
1292} 1307}
1293 1308
1294void KListView::setDropVisualizerWidth (int w) 1309void KListView::setDropVisualizerWidth (int w)
1295{ 1310{
1296 d->mDropVisualizerWidth = w > 0 ? w : 1; 1311 d->mDropVisualizerWidth = w > 0 ? w : 1;
1297} 1312}
1298 1313
1299QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, 1314QRect KListView::drawDropVisualizer(QPainter *p, Q3ListViewItem *parent,
1300 QListViewItem *after) 1315 Q3ListViewItem *after)
1301{ 1316{
1302 QRect insertmarker; 1317 QRect insertmarker;
1303 1318
1304 if (!after && !parent) 1319 if (!after && !parent)
1305 insertmarker = QRect (0, 0, viewport()->width(), d->mDropVisualizerWidth/2); 1320 insertmarker = QRect (0, 0, viewport()->width(), d->mDropVisualizerWidth/2);
1306 else 1321 else
1307 { 1322 {
1308 int level = 0; 1323 int level = 0;
1309 if (after) 1324 if (after)
1310 { 1325 {
1311 QListViewItem* it = 0L; 1326 Q3ListViewItem* it = 0L;
1312 if (after->isOpen()) 1327 if (after->isOpen())
1313 { 1328 {
1314 // Look for the last child (recursively) 1329 // Look for the last child (recursively)
1315 it = after->firstChild(); 1330 it = after->firstChild();
1316 if (it) 1331 if (it)
1317 while (it->nextSibling() || it->firstChild()) 1332 while (it->nextSibling() || it->firstChild())
1318 if ( it->nextSibling() ) 1333 if ( it->nextSibling() )
1319 it = it->nextSibling(); 1334 it = it->nextSibling();
1320 else 1335 else
1321 it = it->firstChild(); 1336 it = it->firstChild();
1322 } 1337 }
1323 1338
@@ -1329,30 +1344,30 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent,
1329 insertmarker = itemRect (parent); 1344 insertmarker = itemRect (parent);
1330 level = parent->depth() + 1; 1345 level = parent->depth() + 1;
1331 } 1346 }
1332 insertmarker.setLeft( treeStepSize() * ( level + (rootIsDecorated() ? 1 : 0) ) + itemMargin() ); 1347 insertmarker.setLeft( treeStepSize() * ( level + (rootIsDecorated() ? 1 : 0) ) + itemMargin() );
1333 insertmarker.setRight (viewport()->width()); 1348 insertmarker.setRight (viewport()->width());
1334 insertmarker.setTop (insertmarker.bottom() - d->mDropVisualizerWidth/2 + 1); 1349 insertmarker.setTop (insertmarker.bottom() - d->mDropVisualizerWidth/2 + 1);
1335 insertmarker.setBottom (insertmarker.bottom() + d->mDropVisualizerWidth/2); 1350 insertmarker.setBottom (insertmarker.bottom() + d->mDropVisualizerWidth/2);
1336 } 1351 }
1337 1352
1338 // This is not used anymore, at least by KListView itself (see viewportPaintEvent) 1353 // This is not used anymore, at least by KListView itself (see viewportPaintEvent)
1339 // Remove for KDE 3.0. 1354 // Remove for KDE 3.0.
1340 if (p) 1355 if (p)
1341 p->fillRect(insertmarker, Dense4Pattern); 1356 p->fillRect(insertmarker, Qt::Dense4Pattern);
1342 1357
1343 return insertmarker; 1358 return insertmarker;
1344} 1359}
1345 1360
1346QRect KListView::drawItemHighlighter(QPainter *painter, QListViewItem *item) 1361QRect KListView::drawItemHighlighter(QPainter *painter, Q3ListViewItem *item)
1347{ 1362{
1348 QRect r; 1363 QRect r;
1349 1364
1350 if (item) 1365 if (item)
1351 { 1366 {
1352 r = itemRect(item); 1367 r = itemRect(item);
1353 r.setLeft(r.left()+(item->depth()+1)*treeStepSize()); 1368 r.setLeft(r.left()+(item->depth()+1)*treeStepSize());
1354 if (painter) { 1369 if (painter) {
1355//US style().drawPrimitive(QStyle::PE_FocusRect, painter, r, colorGroup(), 1370//US style().drawPrimitive(QStyle::PE_FocusRect, painter, r, colorGroup(),
1356//US QStyle::Style_FocusAtBorder, colorGroup().highlight()); 1371//US QStyle::Style_FocusAtBorder, colorGroup().highlight());
1357 const QColor* pHighl = &(colorGroup().highlight()); 1372 const QColor* pHighl = &(colorGroup().highlight());
1358 //LR style().drawFocusRect(painter, r, colorGroup(), pHighl, true); 1373 //LR style().drawFocusRect(painter, r, colorGroup(), pHighl, true);
@@ -1367,25 +1382,25 @@ qDebug("KListView::drawItemHighlighter has to be verified");
1367} 1382}
1368 1383
1369void KListView::cleanItemHighlighter () 1384void KListView::cleanItemHighlighter ()
1370{ 1385{
1371 if (d->mOldDropHighlighter.isValid()) 1386 if (d->mOldDropHighlighter.isValid())
1372 { 1387 {
1373 QRect rect=d->mOldDropHighlighter; 1388 QRect rect=d->mOldDropHighlighter;
1374 d->mOldDropHighlighter = QRect(); 1389 d->mOldDropHighlighter = QRect();
1375 viewport()->repaint(rect, true); 1390 viewport()->repaint(rect, true);
1376 } 1391 }
1377} 1392}
1378 1393
1379void KListView::rename(QListViewItem *item, int c) 1394void KListView::rename(Q3ListViewItem *item, int c)
1380{ 1395{
1381 if (d->renameable.contains(c)) 1396 if (d->renameable.contains(c))
1382 { 1397 {
1383 ensureItemVisible(item); 1398 ensureItemVisible(item);
1384//US d->editor->load(item,c); 1399//US d->editor->load(item,c);
1385qDebug("KListView::rename has to be verified"); 1400qDebug("KListView::rename has to be verified");
1386 1401
1387 } 1402 }
1388} 1403}
1389 1404
1390bool KListView::isRenameable (int col) const 1405bool KListView::isRenameable (int col) const
1391{ 1406{
@@ -1394,25 +1409,25 @@ bool KListView::isRenameable (int col) const
1394 1409
1395void KListView::setRenameable (int col, bool yesno) 1410void KListView::setRenameable (int col, bool yesno)
1396{ 1411{
1397 if (col>=header()->count()) return; 1412 if (col>=header()->count()) return;
1398 1413
1399 d->renameable.remove(col); 1414 d->renameable.remove(col);
1400 if (yesno && d->renameable.find(col)==d->renameable.end()) 1415 if (yesno && d->renameable.find(col)==d->renameable.end())
1401 d->renameable+=col; 1416 d->renameable+=col;
1402 else if (!yesno && d->renameable.find(col)!=d->renameable.end()) 1417 else if (!yesno && d->renameable.find(col)!=d->renameable.end())
1403 d->renameable.remove(col); 1418 d->renameable.remove(col);
1404} 1419}
1405 1420
1406void KListView::doneEditing(QListViewItem *item, int row) 1421void KListView::doneEditing(Q3ListViewItem *item, int row)
1407{ 1422{
1408 emit itemRenamed(item, item->text(row), row); 1423 emit itemRenamed(item, item->text(row), row);
1409 emit itemRenamed(item); 1424 emit itemRenamed(item);
1410} 1425}
1411 1426
1412bool KListView::acceptDrag(QDropEvent* e) const 1427bool KListView::acceptDrag(QDropEvent* e) const
1413{ 1428{
1414qDebug("KListView::acceptDrag drag&drop not supported yet"); 1429qDebug("KListView::acceptDrag drag&drop not supported yet");
1415//US return acceptDrops() && itemsMovable() && (e->source()==viewport()); 1430//US return acceptDrops() && itemsMovable() && (e->source()==viewport());
1416return false; 1431return false;
1417} 1432}
1418 1433
@@ -1438,30 +1453,30 @@ void KListView::setTooltipColumn(int column)
1438} 1453}
1439 1454
1440void KListView::setDropHighlighter(bool b) 1455void KListView::setDropHighlighter(bool b)
1441{ 1456{
1442 d->dropHighlighter=b; 1457 d->dropHighlighter=b;
1443} 1458}
1444 1459
1445bool KListView::dropHighlighter() const 1460bool KListView::dropHighlighter() const
1446{ 1461{
1447 return d->dropHighlighter; 1462 return d->dropHighlighter;
1448} 1463}
1449 1464
1450bool KListView::showTooltip(QListViewItem *item, const QPoint &, int column) const 1465bool KListView::showTooltip(Q3ListViewItem *item, const QPoint &, int column) const
1451{ 1466{
1452 return ((tooltip(item, column).length()>0) && (column==tooltipColumn())); 1467 return ((tooltip(item, column).length()>0) && (column==tooltipColumn()));
1453} 1468}
1454 1469
1455QString KListView::tooltip(QListViewItem *item, int column) const 1470QString KListView::tooltip(Q3ListViewItem *item, int column) const
1456{ 1471{
1457 return item->text(column); 1472 return item->text(column);
1458} 1473}
1459 1474
1460void KListView::setTabOrderedRenaming(bool b) 1475void KListView::setTabOrderedRenaming(bool b)
1461{ 1476{
1462 d->tabRename = b; 1477 d->tabRename = b;
1463} 1478}
1464 1479
1465bool KListView::tabOrderedRenaming() const 1480bool KListView::tabOrderedRenaming() const
1466{ 1481{
1467 return d->tabRename; 1482 return d->tabRename;
@@ -1473,25 +1488,25 @@ void KListView::keyPressEvent (QKeyEvent* e)
1473 if (e->key() == d->contextMenuKey) 1488 if (e->key() == d->contextMenuKey)
1474 { 1489 {
1475 emit menuShortCutPressed (this, currentItem()); 1490 emit menuShortCutPressed (this, currentItem());
1476 return; 1491 return;
1477 } 1492 }
1478 if (e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace) 1493 if (e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace)
1479 { 1494 {
1480 emit signalDelete ( ); 1495 emit signalDelete ( );
1481 return; 1496 return;
1482 } 1497 }
1483 1498
1484 if (d->selectionMode != FileManager) 1499 if (d->selectionMode != FileManager)
1485 QListView::keyPressEvent (e); 1500 Q3ListView::keyPressEvent (e);
1486 else 1501 else
1487 fileManagerKeyPressEvent (e); 1502 fileManagerKeyPressEvent (e);
1488} 1503}
1489 1504
1490void KListView::activateAutomaticSelection() 1505void KListView::activateAutomaticSelection()
1491{ 1506{
1492 d->selectedBySimpleMove=true; 1507 d->selectedBySimpleMove=true;
1493 d->selectedUsingMouse=false; 1508 d->selectedUsingMouse=false;
1494 if (currentItem()!=0) 1509 if (currentItem()!=0)
1495 { 1510 {
1496 selectAll(false); 1511 selectAll(false);
1497 currentItem()->setSelected(true); 1512 currentItem()->setSelected(true);
@@ -1504,112 +1519,112 @@ void KListView::deactivateAutomaticSelection()
1504{ 1519{
1505 d->selectedBySimpleMove=false; 1520 d->selectedBySimpleMove=false;
1506} 1521}
1507 1522
1508bool KListView::automaticSelection() const 1523bool KListView::automaticSelection() const
1509{ 1524{
1510 return d->selectedBySimpleMove; 1525 return d->selectedBySimpleMove;
1511} 1526}
1512 1527
1513void KListView::fileManagerKeyPressEvent (QKeyEvent* e) 1528void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
1514{ 1529{
1515 //don't care whether it's on the keypad or not 1530 //don't care whether it's on the keypad or not
1516 int e_state=(e->state() & ~Keypad); 1531 int e_state=(e->state() & ~Qt::Keypad);
1517 1532
1518 int oldSelectionDirection(d->selectionDirection); 1533 int oldSelectionDirection(d->selectionDirection);
1519 1534
1520 if ((e->key()!=Key_Shift) && (e->key()!=Key_Control) 1535 if ((e->key()!=Qt::Key_Shift) && (e->key()!=Qt::Key_Control)
1521 && (e->key()!=Key_Meta) && (e->key()!=Key_Alt)) 1536 && (e->key()!=Qt::Key_Meta) && (e->key()!=Qt::Key_Alt))
1522 { 1537 {
1523 if ((e_state==ShiftButton) && (!d->wasShiftEvent) && (!d->selectedBySimpleMove)) 1538 if ((e_state==Qt::ShiftButton) && (!d->wasShiftEvent) && (!d->selectedBySimpleMove))
1524 selectAll(FALSE); 1539 selectAll(FALSE);
1525 d->selectionDirection=0; 1540 d->selectionDirection=0;
1526 d->wasShiftEvent = (e_state == ShiftButton); 1541 d->wasShiftEvent = (e_state == Qt::ShiftButton);
1527 }; 1542 };
1528 1543
1529 //d->wasShiftEvent = (e_state == ShiftButton); 1544 //d->wasShiftEvent = (e_state == Qt::ShiftButton);
1530 1545
1531 1546
1532 QListViewItem* item = currentItem(); 1547 Q3ListViewItem* item = currentItem();
1533 if (item==0) return; 1548 if (item==0) return;
1534 1549
1535 QListViewItem* repaintItem1 = item; 1550 Q3ListViewItem* repaintItem1 = item;
1536 QListViewItem* repaintItem2 = 0L; 1551 Q3ListViewItem* repaintItem2 = 0L;
1537 QListViewItem* visItem = 0L; 1552 Q3ListViewItem* visItem = 0L;
1538 1553
1539 QListViewItem* nextItem = 0L; 1554 Q3ListViewItem* nextItem = 0L;
1540 int items = 0; 1555 int items = 0;
1541 1556
1542 bool shiftOrCtrl((e_state==ControlButton) || (e_state==ShiftButton)); 1557 bool shiftOrCtrl((e_state==Qt::ControlButton) || (e_state==Qt::ShiftButton));
1543 int selectedItems(0); 1558 int selectedItems(0);
1544 for (QListViewItem *tmpItem=firstChild(); tmpItem!=0; tmpItem=tmpItem->nextSibling()) 1559 for (Q3ListViewItem *tmpItem=firstChild(); tmpItem!=0; tmpItem=tmpItem->nextSibling())
1545 if (tmpItem->isSelected()) selectedItems++; 1560 if (tmpItem->isSelected()) selectedItems++;
1546 1561
1547 if (((selectedItems==0) || ((selectedItems==1) && (d->selectedUsingMouse))) 1562 if (((selectedItems==0) || ((selectedItems==1) && (d->selectedUsingMouse)))
1548 && (e_state==NoButton) 1563 && (e_state==Qt::NoButton)
1549 && ((e->key()==Key_Down) 1564 && ((e->key()==Qt::Key_Down)
1550 || (e->key()==Key_Up) 1565 || (e->key()==Qt::Key_Up)
1551 || (e->key()==Key_Next) 1566 || (e->key()==Qt::Key_Next)
1552 || (e->key()==Key_Prior) 1567 || (e->key()==Qt::Key_Prior)
1553 || (e->key()==Key_Home) 1568 || (e->key()==Qt::Key_Home)
1554 || (e->key()==Key_End))) 1569 || (e->key()==Qt::Key_End)))
1555 { 1570 {
1556 d->selectedBySimpleMove=true; 1571 d->selectedBySimpleMove=true;
1557 d->selectedUsingMouse=false; 1572 d->selectedUsingMouse=false;
1558 } 1573 }
1559 else if (selectedItems>1) 1574 else if (selectedItems>1)
1560 d->selectedBySimpleMove=false; 1575 d->selectedBySimpleMove=false;
1561 1576
1562 bool emitSelectionChanged(false); 1577 bool emitSelectionChanged(false);
1563 1578
1564 switch (e->key()) 1579 switch (e->key())
1565 { 1580 {
1566 case Key_Escape: 1581 case Qt::Key_Escape:
1567 selectAll(FALSE); 1582 selectAll(FALSE);
1568 emitSelectionChanged=TRUE; 1583 emitSelectionChanged=TRUE;
1569 break; 1584 break;
1570 1585
1571 case Key_Space: 1586 case Qt::Key_Space:
1572 //toggle selection of current item 1587 //toggle selection of current item
1573 if (d->selectedBySimpleMove) 1588 if (d->selectedBySimpleMove)
1574 d->selectedBySimpleMove=false; 1589 d->selectedBySimpleMove=false;
1575 item->setSelected(!item->isSelected()); 1590 item->setSelected(!item->isSelected());
1576 emitSelectionChanged=TRUE; 1591 emitSelectionChanged=TRUE;
1577 break; 1592 break;
1578 1593
1579 case Key_Insert: 1594 case Qt::Key_Insert:
1580 //toggle selection of current item and move to the next item 1595 //toggle selection of current item and move to the next item
1581 if (d->selectedBySimpleMove) 1596 if (d->selectedBySimpleMove)
1582 { 1597 {
1583 d->selectedBySimpleMove=false; 1598 d->selectedBySimpleMove=false;
1584 if (!item->isSelected()) item->setSelected(TRUE); 1599 if (!item->isSelected()) item->setSelected(TRUE);
1585 } 1600 }
1586 else 1601 else
1587 { 1602 {
1588 item->setSelected(!item->isSelected()); 1603 item->setSelected(!item->isSelected());
1589 }; 1604 };
1590 1605
1591 nextItem=item->itemBelow(); 1606 nextItem=item->itemBelow();
1592 1607
1593 if (nextItem!=0) 1608 if (nextItem!=0)
1594 { 1609 {
1595 repaintItem2=nextItem; 1610 repaintItem2=nextItem;
1596 visItem=nextItem; 1611 visItem=nextItem;
1597 setCurrentItem(nextItem); 1612 setCurrentItem(nextItem);
1598 }; 1613 };
1599 d->selectionDirection=1; 1614 d->selectionDirection=1;
1600 emitSelectionChanged=TRUE; 1615 emitSelectionChanged=TRUE;
1601 break; 1616 break;
1602 1617
1603 case Key_Down: 1618 case Qt::Key_Down:
1604 nextItem=item->itemBelow(); 1619 nextItem=item->itemBelow();
1605 //toggle selection of current item and move to the next item 1620 //toggle selection of current item and move to the next item
1606 if (shiftOrCtrl) 1621 if (shiftOrCtrl)
1607 { 1622 {
1608 d->selectionDirection=1; 1623 d->selectionDirection=1;
1609 if (d->selectedBySimpleMove) 1624 if (d->selectedBySimpleMove)
1610 d->selectedBySimpleMove=false; 1625 d->selectedBySimpleMove=false;
1611 else 1626 else
1612 { 1627 {
1613 if (oldSelectionDirection!=-1) 1628 if (oldSelectionDirection!=-1)
1614 { 1629 {
1615 item->setSelected(!item->isSelected()); 1630 item->setSelected(!item->isSelected());
@@ -1624,25 +1639,25 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
1624 }; 1639 };
1625 1640
1626 if (nextItem!=0) 1641 if (nextItem!=0)
1627 { 1642 {
1628 if (d->selectedBySimpleMove) 1643 if (d->selectedBySimpleMove)
1629 nextItem->setSelected(true); 1644 nextItem->setSelected(true);
1630 repaintItem2=nextItem; 1645 repaintItem2=nextItem;
1631 visItem=nextItem; 1646 visItem=nextItem;
1632 setCurrentItem(nextItem); 1647 setCurrentItem(nextItem);
1633 }; 1648 };
1634 break; 1649 break;
1635 1650
1636 case Key_Up: 1651 case Qt::Key_Up:
1637 nextItem=item->itemAbove(); 1652 nextItem=item->itemAbove();
1638 d->selectionDirection=-1; 1653 d->selectionDirection=-1;
1639 //move to the prev. item and toggle selection of this one 1654 //move to the prev. item and toggle selection of this one
1640 // => No, can't select the last item, with this. For symmetry, let's 1655 // => No, can't select the last item, with this. For symmetry, let's
1641 // toggle selection and THEN move up, just like we do in down (David) 1656 // toggle selection and THEN move up, just like we do in down (David)
1642 if (shiftOrCtrl) 1657 if (shiftOrCtrl)
1643 { 1658 {
1644 if (d->selectedBySimpleMove) 1659 if (d->selectedBySimpleMove)
1645 d->selectedBySimpleMove=false; 1660 d->selectedBySimpleMove=false;
1646 else 1661 else
1647 { 1662 {
1648 if (oldSelectionDirection!=1) 1663 if (oldSelectionDirection!=1)
@@ -1659,72 +1674,72 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
1659 }; 1674 };
1660 1675
1661 if (nextItem!=0) 1676 if (nextItem!=0)
1662 { 1677 {
1663 if (d->selectedBySimpleMove) 1678 if (d->selectedBySimpleMove)
1664 nextItem->setSelected(true); 1679 nextItem->setSelected(true);
1665 repaintItem2=nextItem; 1680 repaintItem2=nextItem;
1666 visItem=nextItem; 1681 visItem=nextItem;
1667 setCurrentItem(nextItem); 1682 setCurrentItem(nextItem);
1668 }; 1683 };
1669 break; 1684 break;
1670 1685
1671 case Key_End: 1686 case Qt::Key_End:
1672 //move to the last item and toggle selection of all items inbetween 1687 //move to the last item and toggle selection of all items inbetween
1673 nextItem=item; 1688 nextItem=item;
1674 if (d->selectedBySimpleMove) 1689 if (d->selectedBySimpleMove)
1675 item->setSelected(false); 1690 item->setSelected(false);
1676 if (shiftOrCtrl) 1691 if (shiftOrCtrl)
1677 d->selectedBySimpleMove=false; 1692 d->selectedBySimpleMove=false;
1678 1693
1679 while(nextItem!=0) 1694 while(nextItem!=0)
1680 { 1695 {
1681 if (shiftOrCtrl) 1696 if (shiftOrCtrl)
1682 nextItem->setSelected(!nextItem->isSelected()); 1697 nextItem->setSelected(!nextItem->isSelected());
1683 if (nextItem->itemBelow()==0) 1698 if (nextItem->itemBelow()==0)
1684 { 1699 {
1685 if (d->selectedBySimpleMove) 1700 if (d->selectedBySimpleMove)
1686 nextItem->setSelected(true); 1701 nextItem->setSelected(true);
1687 repaintItem2=nextItem; 1702 repaintItem2=nextItem;
1688 visItem=nextItem; 1703 visItem=nextItem;
1689 setCurrentItem(nextItem); 1704 setCurrentItem(nextItem);
1690 } 1705 }
1691 nextItem=nextItem->itemBelow(); 1706 nextItem=nextItem->itemBelow();
1692 } 1707 }
1693 emitSelectionChanged=TRUE; 1708 emitSelectionChanged=TRUE;
1694 break; 1709 break;
1695 1710
1696 case Key_Home: 1711 case Qt::Key_Home:
1697 // move to the first item and toggle selection of all items inbetween 1712 // move to the first item and toggle selection of all items inbetween
1698 nextItem = firstChild(); 1713 nextItem = firstChild();
1699 visItem = nextItem; 1714 visItem = nextItem;
1700 repaintItem2 = visItem; 1715 repaintItem2 = visItem;
1701 if (d->selectedBySimpleMove) 1716 if (d->selectedBySimpleMove)
1702 item->setSelected(false); 1717 item->setSelected(false);
1703 if (shiftOrCtrl) 1718 if (shiftOrCtrl)
1704 { 1719 {
1705 d->selectedBySimpleMove=false; 1720 d->selectedBySimpleMove=false;
1706 1721
1707 while ( nextItem != item ) 1722 while ( nextItem != item )
1708 { 1723 {
1709 nextItem->setSelected( !nextItem->isSelected() ); 1724 nextItem->setSelected( !nextItem->isSelected() );
1710 nextItem = nextItem->itemBelow(); 1725 nextItem = nextItem->itemBelow();
1711 } 1726 }
1712 item->setSelected( !item->isSelected() ); 1727 item->setSelected( !item->isSelected() );
1713 } 1728 }
1714 setCurrentItem( firstChild() ); 1729 setCurrentItem( firstChild() );
1715 emitSelectionChanged=TRUE; 1730 emitSelectionChanged=TRUE;
1716 break; 1731 break;
1717 1732
1718 case Key_Next: 1733 case Qt::Key_Next:
1719 items=visibleHeight()/item->height(); 1734 items=visibleHeight()/item->height();
1720 nextItem=item; 1735 nextItem=item;
1721 if (d->selectedBySimpleMove) 1736 if (d->selectedBySimpleMove)
1722 item->setSelected(false); 1737 item->setSelected(false);
1723 if (shiftOrCtrl) 1738 if (shiftOrCtrl)
1724 { 1739 {
1725 d->selectedBySimpleMove=false; 1740 d->selectedBySimpleMove=false;
1726 d->selectionDirection=1; 1741 d->selectionDirection=1;
1727 }; 1742 };
1728 1743
1729 for (int i=0; i<items; i++) 1744 for (int i=0; i<items; i++)
1730 { 1745 {
@@ -1742,25 +1757,25 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
1742 setCurrentItem(nextItem); 1757 setCurrentItem(nextItem);
1743 update(); 1758 update();
1744 if ((shiftOrCtrl) || (d->selectedBySimpleMove)) 1759 if ((shiftOrCtrl) || (d->selectedBySimpleMove))
1745 { 1760 {
1746 emit selectionChanged(); 1761 emit selectionChanged();
1747 } 1762 }
1748 return; 1763 return;
1749 } 1764 }
1750 nextItem=nextItem->itemBelow(); 1765 nextItem=nextItem->itemBelow();
1751 } 1766 }
1752 break; 1767 break;
1753 1768
1754 case Key_Prior: 1769 case Qt::Key_Prior:
1755 items=visibleHeight()/item->height(); 1770 items=visibleHeight()/item->height();
1756 nextItem=item; 1771 nextItem=item;
1757 if (d->selectedBySimpleMove) 1772 if (d->selectedBySimpleMove)
1758 item->setSelected(false); 1773 item->setSelected(false);
1759 if (shiftOrCtrl) 1774 if (shiftOrCtrl)
1760 { 1775 {
1761 d->selectionDirection=-1; 1776 d->selectionDirection=-1;
1762 d->selectedBySimpleMove=false; 1777 d->selectedBySimpleMove=false;
1763 }; 1778 };
1764 1779
1765 for (int i=0; i<items; i++) 1780 for (int i=0; i<items; i++)
1766 { 1781 {
@@ -1776,43 +1791,43 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
1776 setCurrentItem(nextItem); 1791 setCurrentItem(nextItem);
1777 update(); 1792 update();
1778 if ((shiftOrCtrl) || (d->selectedBySimpleMove)) 1793 if ((shiftOrCtrl) || (d->selectedBySimpleMove))
1779 { 1794 {
1780 emit selectionChanged(); 1795 emit selectionChanged();
1781 } 1796 }
1782 return; 1797 return;
1783 } 1798 }
1784 nextItem=nextItem->itemAbove(); 1799 nextItem=nextItem->itemAbove();
1785 } 1800 }
1786 break; 1801 break;
1787 1802
1788 case Key_Minus: 1803 case Qt::Key_Minus:
1789 if ( item->isOpen() ) 1804 if ( item->isOpen() )
1790 setOpen( item, FALSE ); 1805 setOpen( item, FALSE );
1791 break; 1806 break;
1792 case Key_Plus: 1807 case Qt::Key_Plus:
1793 if ( !item->isOpen() && (item->isExpandable() || item->childCount()) ) 1808 if ( !item->isOpen() && (item->isExpandable() || item->childCount()) )
1794 setOpen( item, TRUE ); 1809 setOpen( item, TRUE );
1795 break; 1810 break;
1796 default: 1811 default:
1797 bool realKey = ((e->key()!=Key_Shift) && (e->key()!=Key_Control) 1812 bool realKey = ((e->key()!=Qt::Key_Shift) && (e->key()!=Qt::Key_Control)
1798 && (e->key()!=Key_Meta) && (e->key()!=Key_Alt)); 1813 && (e->key()!=Qt::Key_Meta) && (e->key()!=Qt::Key_Alt));
1799 1814
1800 bool selectCurrentItem = (d->selectedBySimpleMove) && (item->isSelected()); 1815 bool selectCurrentItem = (d->selectedBySimpleMove) && (item->isSelected());
1801 if (realKey && selectCurrentItem) 1816 if (realKey && selectCurrentItem)
1802 item->setSelected(false); 1817 item->setSelected(false);
1803 //this is mainly for the "goto filename beginning with pressed char" feature (aleXXX) 1818 //this is mainly for the "goto filename beginning with pressed char" feature (aleXXX)
1804 QListView::SelectionMode oldSelectionMode = selectionMode(); 1819 Q3ListView::SelectionMode oldSelectionMode = selectionMode();
1805 setSelectionMode (QListView::Multi); 1820 setSelectionMode (Q3ListView::Multi);
1806 QListView::keyPressEvent (e); 1821 Q3ListView::keyPressEvent (e);
1807 setSelectionMode (oldSelectionMode); 1822 setSelectionMode (oldSelectionMode);
1808 if (realKey && selectCurrentItem) 1823 if (realKey && selectCurrentItem)
1809 { 1824 {
1810 currentItem()->setSelected(true); 1825 currentItem()->setSelected(true);
1811 emitSelectionChanged=TRUE; 1826 emitSelectionChanged=TRUE;
1812 } 1827 }
1813 repaintItem2=currentItem(); 1828 repaintItem2=currentItem();
1814 if (realKey) 1829 if (realKey)
1815 visItem=currentItem(); 1830 visItem=currentItem();
1816 break; 1831 break;
1817 } 1832 }
1818 1833
@@ -1841,127 +1856,127 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
1841} 1856}
1842 1857
1843void KListView::setSelectionModeExt (SelectionModeExt mode) 1858void KListView::setSelectionModeExt (SelectionModeExt mode)
1844{ 1859{
1845 d->selectionMode = mode; 1860 d->selectionMode = mode;
1846 1861
1847 switch (mode) 1862 switch (mode)
1848 { 1863 {
1849 case Single: 1864 case Single:
1850 case Multi: 1865 case Multi:
1851 case Extended: 1866 case Extended:
1852 case NoSelection: 1867 case NoSelection:
1853 setSelectionMode (static_cast<QListView::SelectionMode>(static_cast<int>(mode))); 1868 setSelectionMode (static_cast<Q3ListView::SelectionMode>(static_cast<int>(mode)));
1854 break; 1869 break;
1855 1870
1856 case FileManager: 1871 case FileManager:
1857 setSelectionMode (QListView::Extended); 1872 setSelectionMode (Q3ListView::Extended);
1858 break; 1873 break;
1859 1874
1860 default: 1875 default:
1861 kdWarning () << "Warning: illegal selection mode " << int(mode) << " set!" << endl; 1876 kdWarning () << "Warning: illegal selection mode " << int(mode) << " set!" << endl;
1862 break; 1877 break;
1863 } 1878 }
1864} 1879}
1865 1880
1866KListView::SelectionModeExt KListView::selectionModeExt () const 1881KListView::SelectionModeExt KListView::selectionModeExt () const
1867{ 1882{
1868 return d->selectionMode; 1883 return d->selectionMode;
1869} 1884}
1870 1885
1871int KListView::itemIndex( const QListViewItem *item ) const 1886int KListView::itemIndex( const Q3ListViewItem *item ) const
1872{ 1887{
1873 if ( !item ) 1888 if ( !item )
1874 return -1; 1889 return -1;
1875 1890
1876 if ( item == firstChild() ) 1891 if ( item == firstChild() )
1877 return 0; 1892 return 0;
1878 else { 1893 else {
1879 QListViewItemIterator it(firstChild()); 1894 Q3ListViewItemIterator it(firstChild());
1880 uint j = 0; 1895 uint j = 0;
1881 for (; it.current() && it.current() != item; ++it, ++j ); 1896 for (; it.current() && it.current() != item; ++it, ++j );
1882 1897
1883 if( !it.current() ) 1898 if( !it.current() )
1884 return -1; 1899 return -1;
1885 1900
1886 return j; 1901 return j;
1887 } 1902 }
1888} 1903}
1889 1904
1890QListViewItem* KListView::itemAtIndex(int index) 1905Q3ListViewItem* KListView::itemAtIndex(int index)
1891{ 1906{
1892 if (index<0) 1907 if (index<0)
1893 return 0; 1908 return 0;
1894 1909
1895 int j(0); 1910 int j(0);
1896 for (QListViewItemIterator it=firstChild(); it.current(); it++) 1911 for (Q3ListViewItemIterator it=firstChild(); it.current(); it++)
1897 { 1912 {
1898 if (j==index) 1913 if (j==index)
1899 return it.current(); 1914 return it.current();
1900 j++; 1915 j++;
1901 }; 1916 };
1902 return 0; 1917 return 0;
1903} 1918}
1904 1919
1905 1920
1906void KListView::emitContextMenu (KListView*, QListViewItem* i) 1921void KListView::emitContextMenu (KListView*, Q3ListViewItem* i)
1907{ 1922{
1908 QPoint p; 1923 QPoint p;
1909 // qDebug("KListView::emitContextMenu "); 1924 // qDebug("KListView::emitContextMenu ");
1910 1925
1911 if (i) 1926 if (i)
1912 p = viewport()->mapToGlobal(itemRect(i).center()); 1927 p = viewport()->mapToGlobal(itemRect(i).center());
1913 else 1928 else
1914 p = mapToGlobal(rect().center()); 1929 p = mapToGlobal(rect().center());
1915 1930
1916 emit contextMenu (this, i, p); 1931 emit contextMenu (this, i, p);
1917} 1932}
1918 1933
1919void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) 1934void KListView::emitContextMenu (Q3ListViewItem* i, const QPoint& p, int col)
1920{ 1935{
1921 QListViewItem* item = i; 1936 Q3ListViewItem* item = i;
1922 int c = col; 1937 int c = col;
1923 // do not trust the values for QListViewItem* i and int col; 1938 // do not trust the values for QListViewItem* i and int col;
1924 // qDebug("KListView::emitContextMenu col"); 1939 // qDebug("KListView::emitContextMenu col");
1925 if ( col == -1 ) { 1940 if ( col == -1 ) {
1926 QPoint pp = viewport()->mapFromGlobal(p); 1941 QPoint pp = viewport()->mapFromGlobal(p);
1927 item = itemAt( pp); 1942 item = itemAt( pp);
1928 c = header()->sectionAt(pp.x() ); 1943 c = header()->sectionAt(pp.x() );
1929 } 1944 }
1930 emit contextRequest( item, p, c ); 1945 emit contextRequest( item, p, c );
1931 emit contextMenu (this, item, p); 1946 emit contextMenu (this, item, p);
1932} 1947}
1933 1948
1934void KListView::setAcceptDrops (bool val) 1949void KListView::setAcceptDrops (bool val)
1935{ 1950{
1936 QListView::setAcceptDrops (val); 1951 Q3ListView::setAcceptDrops (val);
1937 viewport()->setAcceptDrops (val); 1952 viewport()->setAcceptDrops (val);
1938} 1953}
1939 1954
1940int KListView::dropVisualizerWidth () const 1955int KListView::dropVisualizerWidth () const
1941{ 1956{
1942 return d->mDropVisualizerWidth; 1957 return d->mDropVisualizerWidth;
1943} 1958}
1944 1959
1945 1960
1946void KListView::viewportPaintEvent(QPaintEvent *e) 1961void KListView::viewportPaintEvent(QPaintEvent *e)
1947{ 1962{
1948 QListView::viewportPaintEvent(e); 1963 Q3ListView::viewportPaintEvent(e);
1949 1964
1950 if (d->mOldDropVisualizer.isValid() && e->rect().intersects(d->mOldDropVisualizer)) 1965 if (d->mOldDropVisualizer.isValid() && e->rect().intersects(d->mOldDropVisualizer))
1951 { 1966 {
1952 QPainter painter(viewport()); 1967 QPainter painter(viewport());
1953 1968
1954 // This is where we actually draw the drop-visualizer 1969 // This is where we actually draw the drop-visualizer
1955 painter.fillRect(d->mOldDropVisualizer, Dense4Pattern); 1970 painter.fillRect(d->mOldDropVisualizer, Qt::Dense4Pattern);
1956 } 1971 }
1957 if (d->mOldDropHighlighter.isValid() && e->rect().intersects(d->mOldDropHighlighter)) 1972 if (d->mOldDropHighlighter.isValid() && e->rect().intersects(d->mOldDropHighlighter))
1958 { 1973 {
1959 QPainter painter(viewport()); 1974 QPainter painter(viewport());
1960 1975
1961qDebug("KListView::viewportPaintEvent has to be verified"); 1976qDebug("KListView::viewportPaintEvent has to be verified");
1962 1977
1963 // This is where we actually draw the drop-highlighter 1978 // This is where we actually draw the drop-highlighter
1964//US style().drawPrimitive(QStyle::PE_FocusRect, &painter, d->mOldDropHighlighter, colorGroup(), 1979//US style().drawPrimitive(QStyle::PE_FocusRect, &painter, d->mOldDropHighlighter, colorGroup(),
1965//US QStyle::Style_FocusAtBorder); 1980//US QStyle::Style_FocusAtBorder);
1966 1981
1967//LR style().drawFocusRect(&painter, d->mOldDropHighlighter, colorGroup(), (const QColor*)0, true); 1982//LR style().drawFocusRect(&painter, d->mOldDropHighlighter, colorGroup(), (const QColor*)0, true);
@@ -1979,51 +1994,51 @@ void KListView::setFullWidth(bool fullWidth)
1979{ 1994{
1980 d->fullWidth = fullWidth; 1995 d->fullWidth = fullWidth;
1981//US header()->setStretchEnabled(fullWidth, columns()-1); 1996//US header()->setStretchEnabled(fullWidth, columns()-1);
1982} 1997}
1983 1998
1984bool KListView::fullWidth() const 1999bool KListView::fullWidth() const
1985{ 2000{
1986 return d->fullWidth; 2001 return d->fullWidth;
1987} 2002}
1988 2003
1989int KListView::addColumn(const QString& label, int width) 2004int KListView::addColumn(const QString& label, int width)
1990{ 2005{
1991 int result = QListView::addColumn(label, width); 2006 int result = Q3ListView::addColumn(label, width);
1992 if (d->fullWidth) { 2007 if (d->fullWidth) {
1993//US header()->setStretchEnabled(false, columns()-2); 2008//US header()->setStretchEnabled(false, columns()-2);
1994//US header()->setStretchEnabled(true, columns()-1); 2009//US header()->setStretchEnabled(true, columns()-1);
1995 } 2010 }
1996 return result; 2011 return result;
1997} 2012}
1998 2013
1999int KListView::addColumn(const QIconSet& iconset, const QString& label, int width) 2014int KListView::addColumn(const QIcon& iconset, const QString& label, int width)
2000{ 2015{
2001 int result = QListView::addColumn(iconset, label, width); 2016 int result = Q3ListView::addColumn(iconset, label, width);
2002 if (d->fullWidth) { 2017 if (d->fullWidth) {
2003//US header()->setStretchEnabled(false, columns()-2); 2018//US header()->setStretchEnabled(false, columns()-2);
2004//US header()->setStretchEnabled(true, columns()-1); 2019//US header()->setStretchEnabled(true, columns()-1);
2005 } 2020 }
2006 return result; 2021 return result;
2007} 2022}
2008 2023
2009void KListView::removeColumn(int index) 2024void KListView::removeColumn(int index)
2010{ 2025{
2011 QListView::removeColumn(index); 2026 Q3ListView::removeColumn(index);
2012//US if (d->fullWidth && index == columns()) header()->setStretchEnabled(true, columns()-1); 2027//US if (d->fullWidth && index == columns()) header()->setStretchEnabled(true, columns()-1);
2013} 2028}
2014 2029
2015void KListView::viewportResizeEvent(QResizeEvent* e) 2030void KListView::viewportResizeEvent(QResizeEvent* e)
2016{ 2031{
2017 QListView::viewportResizeEvent(e); 2032 Q3ListView::viewportResizeEvent(e);
2018} 2033}
2019 2034
2020const QColor &KListView::alternateBackground() const 2035const QColor &KListView::alternateBackground() const
2021{ 2036{
2022 return d->alternateBackground; 2037 return d->alternateBackground;
2023} 2038}
2024 2039
2025void KListView::setAlternateBackground(const QColor &c) 2040void KListView::setAlternateBackground(const QColor &c)
2026{ 2041{
2027 d->alternateBackground = c; 2042 d->alternateBackground = c;
2028 repaint(); 2043 repaint();
2029} 2044}
@@ -2061,89 +2076,89 @@ void KListView::restoreLayout(KConfig *config, const QString &group)
2061 if (config->hasKey("SortColumn")) 2076 if (config->hasKey("SortColumn"))
2062 setSorting(config->readNumEntry("SortColumn"), config->readBoolEntry("SortAscending", true)); 2077 setSorting(config->readNumEntry("SortColumn"), config->readBoolEntry("SortAscending", true));
2063*/ 2078*/
2064 QStringList langLst = config->readListEntry( "SortColumn" ); 2079 QStringList langLst = config->readListEntry( "SortColumn" );
2065 if (!langLst.isEmpty()) 2080 if (!langLst.isEmpty())
2066 setSorting(config->readNumEntry("SortColumn"), config->readBoolEntry("SortAscending", true)); 2081 setSorting(config->readNumEntry("SortColumn"), config->readBoolEntry("SortAscending", true));
2067} 2082}
2068 2083
2069void KListView::setSorting(int column, bool ascending) 2084void KListView::setSorting(int column, bool ascending)
2070{ 2085{
2071 d->sortColumn = column; 2086 d->sortColumn = column;
2072 d->sortAscending = ascending; 2087 d->sortAscending = ascending;
2073 QListView::setSorting(column, ascending); 2088 Q3ListView::setSorting(column, ascending);
2074} 2089}
2075 2090
2076int KListView::columnSorted(void) const 2091int KListView::columnSorted(void) const
2077{ 2092{
2078 return d->sortColumn; 2093 return d->sortColumn;
2079} 2094}
2080 2095
2081bool KListView::ascendingSort(void) const 2096bool KListView::ascendingSort(void) const
2082{ 2097{
2083 return d->sortAscending; 2098 return d->sortAscending;
2084} 2099}
2085 2100
2086KListViewItem::KListViewItem(QListView *parent) 2101KListViewItem::KListViewItem(Q3ListView *parent)
2087 : QListViewItem(parent) 2102 : Q3ListViewItem(parent)
2088{ 2103{
2089 init(); 2104 init();
2090} 2105}
2091 2106
2092KListViewItem::KListViewItem(QListViewItem *parent) 2107KListViewItem::KListViewItem(Q3ListViewItem *parent)
2093 : QListViewItem(parent) 2108 : Q3ListViewItem(parent)
2094{ 2109{
2095 init(); 2110 init();
2096} 2111}
2097 2112
2098KListViewItem::KListViewItem(QListView *parent, QListViewItem *after) 2113KListViewItem::KListViewItem(Q3ListView *parent, Q3ListViewItem *after)
2099 : QListViewItem(parent, after) 2114 : Q3ListViewItem(parent, after)
2100{ 2115{
2101 init(); 2116 init();
2102} 2117}
2103 2118
2104KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after) 2119KListViewItem::KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after)
2105 : QListViewItem(parent, after) 2120 : Q3ListViewItem(parent, after)
2106{ 2121{
2107 init(); 2122 init();
2108} 2123}
2109 2124
2110KListViewItem::KListViewItem(QListView *parent, 2125KListViewItem::KListViewItem(Q3ListView *parent,
2111 QString label1, QString label2, QString label3, QString label4, 2126 QString label1, QString label2, QString label3, QString label4,
2112 QString label5, QString label6, QString label7, QString label8) 2127 QString label5, QString label6, QString label7, QString label8)
2113 : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) 2128 : Q3ListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8)
2114{ 2129{
2115 init(); 2130 init();
2116} 2131}
2117 2132
2118KListViewItem::KListViewItem(QListViewItem *parent, 2133KListViewItem::KListViewItem(Q3ListViewItem *parent,
2119 QString label1, QString label2, QString label3, QString label4, 2134 QString label1, QString label2, QString label3, QString label4,
2120 QString label5, QString label6, QString label7, QString label8) 2135 QString label5, QString label6, QString label7, QString label8)
2121 : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) 2136 : Q3ListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8)
2122{ 2137{
2123 init(); 2138 init();
2124} 2139}
2125 2140
2126KListViewItem::KListViewItem(QListView *parent, QListViewItem *after, 2141KListViewItem::KListViewItem(Q3ListView *parent, Q3ListViewItem *after,
2127 QString label1, QString label2, QString label3, QString label4, 2142 QString label1, QString label2, QString label3, QString label4,
2128 QString label5, QString label6, QString label7, QString label8) 2143 QString label5, QString label6, QString label7, QString label8)
2129 : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) 2144 : Q3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8)
2130{ 2145{
2131 init(); 2146 init();
2132} 2147}
2133 2148
2134KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after, 2149KListViewItem::KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after,
2135 QString label1, QString label2, QString label3, QString label4, 2150 QString label1, QString label2, QString label3, QString label4,
2136 QString label5, QString label6, QString label7, QString label8) 2151 QString label5, QString label6, QString label7, QString label8)
2137 : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) 2152 : Q3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8)
2138{ 2153{
2139 init(); 2154 init();
2140} 2155}
2141 2156
2142KListViewItem::~KListViewItem() 2157KListViewItem::~KListViewItem()
2143{ 2158{
2144} 2159}
2145 2160
2146void KListViewItem::init() 2161void KListViewItem::init()
2147{ 2162{
2148 m_known = false; 2163 m_known = false;
2149} 2164}
@@ -2203,30 +2218,30 @@ bool KListViewItem::isAlternate()
2203void KListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) 2218void KListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
2204{ 2219{
2205 QColorGroup _cg = cg; 2220 QColorGroup _cg = cg;
2206 const QPixmap *pm = listView()->viewport()->backgroundPixmap(); 2221 const QPixmap *pm = listView()->viewport()->backgroundPixmap();
2207 if (pm && !pm->isNull()) 2222 if (pm && !pm->isNull())
2208 { 2223 {
2209 _cg.setBrush(QColorGroup::Base, QBrush(backgroundColor(), *pm)); 2224 _cg.setBrush(QColorGroup::Base, QBrush(backgroundColor(), *pm));
2210 QPoint o = p->brushOrigin(); 2225 QPoint o = p->brushOrigin();
2211 p->setBrushOrigin( o.x()-listView()->contentsX(), o.y()-listView()->contentsY() ); 2226 p->setBrushOrigin( o.x()-listView()->contentsX(), o.y()-listView()->contentsY() );
2212 } 2227 }
2213 else if (isAlternate()) { 2228 else if (isAlternate()) {
2214//US if (listView()->viewport()->backgroundMode()==Qt::FixedColor) 2229//US if (listView()->viewport()->backgroundMode()==Qt::FixedColor)
2215 if (listView()->viewport()->backgroundMode()==QWidget::PaletteBackground) 2230 if (listView()->viewport()->backgroundMode()==Qt::PaletteBackground)
2216 _cg.setColor(QColorGroup::Background, static_cast< KListView* >(listView())->alternateBackground()); 2231 _cg.setColor(QColorGroup::Background, static_cast< KListView* >(listView())->alternateBackground());
2217 else 2232 else
2218 _cg.setColor(QColorGroup::Base, static_cast< KListView* >(listView())->alternateBackground()); 2233 _cg.setColor(QColorGroup::Base, static_cast< KListView* >(listView())->alternateBackground());
2219 } 2234 }
2220 QListViewItem::paintCell(p, _cg, column, width, alignment); 2235 Q3ListViewItem::paintCell(p, _cg, column, width, alignment);
2221} 2236}
2222 2237
2223//US we do not have a "global KDE" variable to setup singleClick functionality 2238//US we do not have a "global KDE" variable to setup singleClick functionality
2224void KListView::setSingleClick(bool s) 2239void KListView::setSingleClick(bool s)
2225{ 2240{
2226 d->bUseSingle = s; 2241 d->bUseSingle = s;
2227 slotSettingsChanged(1); 2242 slotSettingsChanged(1);
2228 // qDebug("KListView::setSingleClick: single %i", d->bUseSingle); 2243 // qDebug("KListView::setSingleClick: single %i", d->bUseSingle);
2229} 2244}
2230 2245
2231 2246
2232void KListView::virtual_hook( int, void* ) 2247void KListView::virtual_hook( int, void* )
diff --git a/microkde/kdeui/klistview.h b/microkde/kdeui/klistview.h
index 9f0d9fd..2176525 100644
--- a/microkde/kdeui/klistview.h
+++ b/microkde/kdeui/klistview.h
@@ -11,35 +11,46 @@
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef KLISTVIEW_H 20#ifndef KLISTVIEW_H
21#define KLISTVIEW_H 21#define KLISTVIEW_H
22 22
23#include <qlistview.h> 23#include <q3listview.h>
24 24
25#include <qptrlist.h> 25#include <q3ptrlist.h>
26//Added by qt3to4:
27#include <QDragMoveEvent>
28#include <QDropEvent>
29#include <QDragLeaveEvent>
30#include <QPaintEvent>
31#include <QResizeEvent>
32#include <QFocusEvent>
33#include <QMouseEvent>
34#include <QKeyEvent>
35#include <QEvent>
36#include <QDragEnterEvent>
26 37
27//US 38//US
28class QDropEvent; 39class QDropEvent;
29class QDragLeaveEvent; 40class QDragLeaveEvent;
30class QDragMoveEvent; 41class QDragMoveEvent;
31class QDragEnterEvent; 42class QDragEnterEvent;
32 43
33class QDragObject; 44class Q3DragObject;
34class KConfig; 45class KConfig;
35class KLineEdit; 46class KLineEdit;
36/** 47/**
37 * This Widget extends the functionality of QListView to honor the system 48 * This Widget extends the functionality of QListView to honor the system
38 * wide settings for Single Click/Double Click mode, AutoSelection and 49 * wide settings for Single Click/Double Click mode, AutoSelection and
39 * ChangeCursorOverLink (TM). 50 * ChangeCursorOverLink (TM).
40 * 51 *
41 * There is a new signal executed(). It gets connected to either 52 * There is a new signal executed(). It gets connected to either
42 * @ref QListView::clicked() or @ref QListView::doubleClicked() depending on the KDE 53 * @ref QListView::clicked() or @ref QListView::doubleClicked() depending on the KDE
43 * wide Single Click/Double Click settings. It is strongly recommended that 54 * wide Single Click/Double Click settings. It is strongly recommended that
44 * you use this signal instead of the above mentioned. This way you dont 55 * you use this signal instead of the above mentioned. This way you dont
45 * need to care about the current settings. 56 * need to care about the current settings.
@@ -48,25 +59,25 @@ class KLineEdit;
48 * 59 *
49 * Drag-and-Drop is supported with the signal @ref #dropped(), just @ref #setAcceptDrops(true) 60 * Drag-and-Drop is supported with the signal @ref #dropped(), just @ref #setAcceptDrops(true)
50 * and connect it to a suitable slot. 61 * and connect it to a suitable slot.
51 * To see where you are dropping, @ref setDropVisualizer(true). 62 * To see where you are dropping, @ref setDropVisualizer(true).
52 * And also you'll need @ref acceptDrag(QDropEvent*) 63 * And also you'll need @ref acceptDrag(QDropEvent*)
53 * 64 *
54 * KListView is drag-enabled, too: to benefit from that you've got derive from it. 65 * KListView is drag-enabled, too: to benefit from that you've got derive from it.
55 * Reimplement @ref dragObject() and (possibly) @ref startDrag(), 66 * Reimplement @ref dragObject() and (possibly) @ref startDrag(),
56 * and @ref setDragEnabled(true). 67 * and @ref setDragEnabled(true).
57 * 68 *
58 * @version $Id$ 69 * @version $Id$
59 */ 70 */
60class KListView : public QListView 71class KListView : public Q3ListView
61{ 72{
62 Q_OBJECT 73 Q_OBJECT
63 Q_ENUMS( SelectionModeExt ) 74 Q_ENUMS( SelectionModeExt )
64 Q_PROPERTY( bool fullWidth READ fullWidth WRITE setFullWidth ) 75 Q_PROPERTY( bool fullWidth READ fullWidth WRITE setFullWidth )
65 Q_PROPERTY( bool itemsMovable READ itemsMovable WRITE setItemsMovable ) 76 Q_PROPERTY( bool itemsMovable READ itemsMovable WRITE setItemsMovable )
66 Q_PROPERTY( bool itemsRenameable READ itemsRenameable WRITE setItemsRenameable ) 77 Q_PROPERTY( bool itemsRenameable READ itemsRenameable WRITE setItemsRenameable )
67 Q_PROPERTY( bool dragEnabled READ dragEnabled WRITE setDragEnabled ) 78 Q_PROPERTY( bool dragEnabled READ dragEnabled WRITE setDragEnabled )
68 Q_PROPERTY( bool autoOpen READ autoOpen WRITE setAutoOpen ) 79 Q_PROPERTY( bool autoOpen READ autoOpen WRITE setAutoOpen )
69 Q_PROPERTY( bool dropVisualizer READ dropVisualizer WRITE setDropVisualizer ) 80 Q_PROPERTY( bool dropVisualizer READ dropVisualizer WRITE setDropVisualizer )
70//US Q_PROPERTY( int tooltipColumn READ tooltipColumn WRITE setTooltipColumn ) 81//US Q_PROPERTY( int tooltipColumn READ tooltipColumn WRITE setTooltipColumn )
71 Q_PROPERTY( int dropVisualizerWidth READ dropVisualizerWidth WRITE setDropVisualizerWidth ) 82 Q_PROPERTY( int dropVisualizerWidth READ dropVisualizerWidth WRITE setDropVisualizerWidth )
72 Q_PROPERTY( QColor alternateBackground READ alternateBackground WRITE setAlternateBackground ) 83 Q_PROPERTY( QColor alternateBackground READ alternateBackground WRITE setAlternateBackground )
@@ -97,33 +108,33 @@ public:
97 * item to (including) the item one page up 108 * item to (including) the item one page up
98 * 109 *
99 * The combinations work the same with SHIFT instead of CTRL, except 110 * The combinations work the same with SHIFT instead of CTRL, except
100 * that if you start selecting something using SHIFT everything selected 111 * that if you start selecting something using SHIFT everything selected
101 * before will be deselected first. 112 * before will be deselected first.
102 * 113 *
103 * Additionally the current item is always selected automatically when 114 * Additionally the current item is always selected automatically when
104 * navigating using the keyboard, except other items were selected explicitely. 115 * navigating using the keyboard, except other items were selected explicitely.
105 * 116 *
106 * This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected 117 * This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected
107 */ 118 */
108 enum SelectionModeExt { 119 enum SelectionModeExt {
109 Single = QListView::Single, 120 Single = Q3ListView::Single,
110 Multi = QListView::Multi, 121 Multi = Q3ListView::Multi,
111 Extended = QListView::Extended, 122 Extended = Q3ListView::Extended,
112 NoSelection = QListView::NoSelection, 123 NoSelection = Q3ListView::NoSelection,
113 FileManager 124 FileManager
114 }; 125 };
115 void repaintContents( bool erase = true ) 126 void repaintContents( bool erase = true )
116 { 127 {
117 QScrollView::repaintContents( contentsX(), contentsY(), 128 Q3ScrollView::repaintContents( contentsX(), contentsY(),
118 visibleWidth(), visibleHeight(), erase ); 129 visibleWidth(), visibleHeight(), erase );
119 }; 130 };
120 /** 131 /**
121 * Constructor. 132 * Constructor.
122 * 133 *
123 * The parameters @p parent and @p name are handled by 134 * The parameters @p parent and @p name are handled by
124 * @ref QListView, as usual. 135 * @ref QListView, as usual.
125 */ 136 */
126 KListView (QWidget *parent = 0, const char *name = 0, bool emulateRightMouse = true ); 137 KListView (QWidget *parent = 0, const char *name = 0, bool emulateRightMouse = true );
127 138
128 /** 139 /**
129 * Destructor. 140 * Destructor.
@@ -152,44 +163,44 @@ public:
152 virtual bool isExecuteArea( const QPoint& point ); 163 virtual bool isExecuteArea( const QPoint& point );
153 164
154 /** 165 /**
155 * Same thing, but from an x coordinate only. This only checks if x is in 166 * Same thing, but from an x coordinate only. This only checks if x is in
156 * the first column (if all columns don't show focus), without testing if 167 * the first column (if all columns don't show focus), without testing if
157 * the y coordinate is over an item or not. 168 * the y coordinate is over an item or not.
158 */ 169 */
159 bool isExecuteArea( int x ); 170 bool isExecuteArea( int x );
160 171
161 /** 172 /**
162 * @return a list containing the currently selected items. 173 * @return a list containing the currently selected items.
163 */ 174 */
164 QPtrList<QListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?) 175 Q3PtrList<Q3ListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?)
165 176
166 /** 177 /**
167 * Arbitrarily move @p item to @p parent, positioned immediately after item @p after. 178 * Arbitrarily move @p item to @p parent, positioned immediately after item @p after.
168 */ 179 */
169 void moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after); 180 void moveItem(Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *after);
170 181
171 /** 182 /**
172 * @return the last item (not child!) of this listview. 183 * @return the last item (not child!) of this listview.
173 * 184 *
174 * @see lastChild() 185 * @see lastChild()
175 */ 186 */
176 QListViewItem *lastItem() const; 187 Q3ListViewItem *lastItem() const;
177 188
178 /** 189 /**
179 * @return the last child of this listview. 190 * @return the last child of this listview.
180 * 191 *
181 * @see lastItem() 192 * @see lastItem()
182 */ 193 */
183 QListViewItem* lastChild () const; 194 Q3ListViewItem* lastChild () const;
184 195
185 /** 196 /**
186 * @return the lineedit used for inline renaming. 197 * @return the lineedit used for inline renaming.
187 * Use that to setup a @ref KCompletion or @ref QValidator for the lineedit 198 * Use that to setup a @ref KCompletion or @ref QValidator for the lineedit
188 * 199 *
189 * @since 3.2 200 * @since 3.2
190 */ 201 */
191 KLineEdit* renameLineEdit() const; 202 KLineEdit* renameLineEdit() const;
192 203
193 /** 204 /**
194 * @returns if it is legal to move items in the list view. True by default. 205 * @returns if it is legal to move items in the list view. True by default.
195 * 206 *
@@ -267,32 +278,32 @@ public:
267 * @return the "extended" selection mode of this listview. 278 * @return the "extended" selection mode of this listview.
268 * 279 *
269 * @see SelectionModeExt 280 * @see SelectionModeExt
270 * @see setSelectionModeExt 281 * @see setSelectionModeExt
271 */ 282 */
272 SelectionModeExt selectionModeExt () const; 283 SelectionModeExt selectionModeExt () const;
273 284
274 /** 285 /**
275 * Returns the index of @p item within the item tree or -1 if 286 * Returns the index of @p item within the item tree or -1 if
276 * @p item doesn't exist in this list view. This function takes 287 * @p item doesn't exist in this list view. This function takes
277 * all items into account not only the visible ones. 288 * all items into account not only the visible ones.
278 */ 289 */
279 int itemIndex( const QListViewItem *item ) const; 290 int itemIndex( const Q3ListViewItem *item ) const;
280 291
281 /** 292 /**
282 * Returns the item of @p index within the item tree or 0 if 293 * Returns the item of @p index within the item tree or 0 if
283 * @p index doesn't exist in this list view. This function takes 294 * @p index doesn't exist in this list view. This function takes
284 * all items into account not only the visible ones. 295 * all items into account not only the visible ones.
285 */ 296 */
286 QListViewItem* itemAtIndex(int index); 297 Q3ListViewItem* itemAtIndex(int index);
287 298
288 /** 299 /**
289 * @deprecated 300 * @deprecated
290 * @see #setFullWidth() 301 * @see #setFullWidth()
291 */ 302 */
292 void setFullWidth(); 303 void setFullWidth();
293 304
294 /** 305 /**
295 * Let the last column fit exactly all the available width. 306 * Let the last column fit exactly all the available width.
296 * 307 *
297 * @see #fullWidth() 308 * @see #fullWidth()
298 */ 309 */
@@ -305,25 +316,25 @@ public:
305 */ 316 */
306 bool fullWidth() const; 317 bool fullWidth() const;
307 318
308 /** 319 /**
309 * Reimplemented for full width support 320 * Reimplemented for full width support
310 * 321 *
311 * @see #removeColumn() 322 * @see #removeColumn()
312 */ 323 */
313 virtual int addColumn(const QString& label, int width = -1); 324 virtual int addColumn(const QString& label, int width = -1);
314 /** 325 /**
315 * Reimplemented for full width support 326 * Reimplemented for full width support
316 */ 327 */
317 virtual int addColumn(const QIconSet& iconset, const QString& label, int width = -1); 328 virtual int addColumn(const QIcon& iconset, const QString& label, int width = -1);
318 /** 329 /**
319 * Reimplemented for full width support 330 * Reimplemented for full width support
320 * 331 *
321 * @see #addColumn() 332 * @see #addColumn()
322 */ 333 */
323 virtual void removeColumn(int index); 334 virtual void removeColumn(int index);
324 335
325 /** 336 /**
326 * sets the alternate background background color. 337 * sets the alternate background background color.
327 * This only has an effect if the items are KListViewItems 338 * This only has an effect if the items are KListViewItems
328 * 339 *
329 * @param c the color to use for every other item. Set to an invalid 340 * @param c the color to use for every other item. Set to an invalid
@@ -379,108 +390,108 @@ public:
379 390
380signals: 391signals:
381 392
382 /** 393 /**
383 * This signal is emitted whenever the user executes an listview item. 394 * This signal is emitted whenever the user executes an listview item.
384 * That means depending on the KDE wide Single Click/Double Click 395 * That means depending on the KDE wide Single Click/Double Click
385 * setting the user clicked or double clicked on that item. 396 * setting the user clicked or double clicked on that item.
386 * @param item is the pointer to the executed listview item. 397 * @param item is the pointer to the executed listview item.
387 * 398 *
388 * Note that you may not delete any @ref QListViewItem objects in slots 399 * Note that you may not delete any @ref QListViewItem objects in slots
389 * connected to this signal. 400 * connected to this signal.
390 */ 401 */
391 void executed( QListViewItem *item ); 402 void executed( Q3ListViewItem *item );
392 403
393 /** 404 /**
394 * This signal is emitted whenever the user executes an listview item. 405 * This signal is emitted whenever the user executes an listview item.
395 * That means depending on the KDE wide Single Click/Double Click 406 * That means depending on the KDE wide Single Click/Double Click
396 * setting the user clicked or double clicked on that item. 407 * setting the user clicked or double clicked on that item.
397 * @param item is the pointer to the executed listview item. 408 * @param item is the pointer to the executed listview item.
398 * @param pos is the position where the user has clicked 409 * @param pos is the position where the user has clicked
399 * @param c is the column into which the user clicked. 410 * @param c is the column into which the user clicked.
400 * 411 *
401 * Note that you may not delete any @ref QListViewItem objects in slots 412 * Note that you may not delete any @ref QListViewItem objects in slots
402 * connected to this signal. 413 * connected to this signal.
403 */ 414 */
404 void executed( QListViewItem *item, const QPoint &pos, int c ); 415 void executed( Q3ListViewItem *item, const QPoint &pos, int c );
405 416
406 /** 417 /**
407 * This signal gets emitted whenever the user double clicks into the 418 * This signal gets emitted whenever the user double clicks into the
408 * listview. 419 * listview.
409 * @param item is the pointer to the clicked listview item. 420 * @param item is the pointer to the clicked listview item.
410 * @param pos is the position where the user has clicked, and 421 * @param pos is the position where the user has clicked, and
411 * @param c is the column into which the user clicked. 422 * @param c is the column into which the user clicked.
412 * 423 *
413 * Note that you may not delete any @ref QListViewItem objects in slots 424 * Note that you may not delete any @ref QListViewItem objects in slots
414 * connected to this signal. 425 * connected to this signal.
415 * 426 *
416 * This signal is more or less here for the sake of completeness. 427 * This signal is more or less here for the sake of completeness.
417 * You should normally not need to use this. In most cases its better 428 * You should normally not need to use this. In most cases its better
418 * to use @ref #executed() instead. 429 * to use @ref #executed() instead.
419 */ 430 */
420 void doubleClicked( QListViewItem *item, const QPoint &pos, int c ); 431 void doubleClicked( Q3ListViewItem *item, const QPoint &pos, int c );
421 void contextRequest( QListViewItem *item, const QPoint &pos, int c ); 432 void contextRequest( Q3ListViewItem *item, const QPoint &pos, int c );
422 433
423 /** 434 /**
424 * This signal gets emitted whenever something acceptable is 435 * This signal gets emitted whenever something acceptable is
425 * dropped onto the listview. 436 * dropped onto the listview.
426 * 437 *
427 * @param e is the drop event itself (it has already been accepted) 438 * @param e is the drop event itself (it has already been accepted)
428 * @param after is the item after which the drop occured (or 0L, if 439 * @param after is the item after which the drop occured (or 0L, if
429 * the drop was above all items) 440 * the drop was above all items)
430 * 441 *
431 * @see #acceptDrop() 442 * @see #acceptDrop()
432 */ 443 */
433 void dropped (QDropEvent * e, QListViewItem *after); 444 void dropped (QDropEvent * e, Q3ListViewItem *after);
434 445
435 /** 446 /**
436 * This signal gets emitted whenever something acceptable is 447 * This signal gets emitted whenever something acceptable is
437 * dropped onto the listview. 448 * dropped onto the listview.
438 * 449 *
439 * This is an overloaded version of the above (provided to simplify 450 * This is an overloaded version of the above (provided to simplify
440 * processing drops outside of the class). 451 * processing drops outside of the class).
441 * 452 *
442 * @param list is the listview 453 * @param list is the listview
443 * @param e is the drop event itself (it has already been accepted) 454 * @param e is the drop event itself (it has already been accepted)
444 * @param after is the item after which the drop occured (or 0L, if 455 * @param after is the item after which the drop occured (or 0L, if
445 * the drop was above all items 456 * the drop was above all items
446 */ 457 */
447 void dropped (KListView* list, QDropEvent* e, QListViewItem* after); 458 void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* after);
448 459
449 /** 460 /**
450 * This signal gets emitted whenever something acceptable is 461 * This signal gets emitted whenever something acceptable is
451 * dropped onto the listview. 462 * dropped onto the listview.
452 * 463 *
453 * This function also provides a parent, in the event that your listview 464 * This function also provides a parent, in the event that your listview
454 * is a tree 465 * is a tree
455 * @param list is the listview 466 * @param list is the listview
456 * @param e is the drop event itself (it has already been accepted) 467 * @param e is the drop event itself (it has already been accepted)
457 * @param parent the item that is to be the parent of the new item 468 * @param parent the item that is to be the parent of the new item
458 * @param after is the item after which the drop occured (or 0L, if 469 * @param after is the item after which the drop occured (or 0L, if
459 * the drop was above all items 470 * the drop was above all items
460 */ 471 */
461 void dropped (KListView* list, QDropEvent* e, QListViewItem* parent, QListViewItem* after); 472 void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after);
462 473
463 /** 474 /**
464 * This signal gets emitted whenever something acceptable is 475 * This signal gets emitted whenever something acceptable is
465 * dropped onto the listview. 476 * dropped onto the listview.
466 * 477 *
467 * This function also provides a parent, in the event that your listview 478 * This function also provides a parent, in the event that your listview
468 * is a tree 479 * is a tree
469 * @param e is the drop event itself (it has already been accepted) 480 * @param e is the drop event itself (it has already been accepted)
470 * @param parent the item that is to be the parent of the new item 481 * @param parent the item that is to be the parent of the new item
471 * @param after is the item after which the drop occured (or 0L, if 482 * @param after is the item after which the drop occured (or 0L, if
472 * the drop was above all items 483 * the drop was above all items
473 */ 484 */
474 void dropped (QDropEvent* e, QListViewItem* parent, QListViewItem* after); 485 void dropped (QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after);
475 486
476 /** 487 /**
477 * This signal is emitted when ever the user moves an item in the list via 488 * This signal is emitted when ever the user moves an item in the list via
478 * DnD. 489 * DnD.
479 * If more than one item is moved at the same time, this signal is only emitted 490 * If more than one item is moved at the same time, this signal is only emitted
480 * once. 491 * once.
481 */ 492 */
482 void moved(); 493 void moved();
483 494
484 /** 495 /**
485 * Connect to this signal if you want to do some preprocessing before 496 * Connect to this signal if you want to do some preprocessing before
486 * a move is made, for example, to disable sorting 497 * a move is made, for example, to disable sorting
@@ -493,76 +504,76 @@ signals:
493 504
494 /** 505 /**
495 * This signal is emitted when ever the user moves an item in the list via 506 * This signal is emitted when ever the user moves an item in the list via
496 * DnD. 507 * DnD.
497 * If more than one item is moved at the same time, @p afterFirst and 508 * If more than one item is moved at the same time, @p afterFirst and
498 * @p afterNow will reflect what was true before the move. 509 * @p afterNow will reflect what was true before the move.
499 * This differs from @ref moved(), so be careful. All the items will have been 510 * This differs from @ref moved(), so be careful. All the items will have been
500 * moved before @ref moved() is emitted, which is not true in this method. // FIXME 511 * moved before @ref moved() is emitted, which is not true in this method. // FIXME
501 * @param item the item that was moved 512 * @param item the item that was moved
502 * @param afterFirst the item that parameter item was in before the move, in the list 513 * @param afterFirst the item that parameter item was in before the move, in the list
503 * @param afterNow the item it's currently after. 514 * @param afterNow the item it's currently after.
504 */ 515 */
505 void moved (QListViewItem *item, QListViewItem *afterFirst, QListViewItem *afterNow); 516 void moved (Q3ListViewItem *item, Q3ListViewItem *afterFirst, Q3ListViewItem *afterNow);
506 517
507 518
508 /** 519 /**
509 * This signal is emitted after all the items have been moved. It reports info for 520 * This signal is emitted after all the items have been moved. It reports info for
510 * each and every item moved, in order. The first element in @p items associates 521 * each and every item moved, in order. The first element in @p items associates
511 * with the first of afterFirst and afterNow. 522 * with the first of afterFirst and afterNow.
512 */ 523 */
513 void moved(QPtrList<QListViewItem> &items, QPtrList<QListViewItem> &afterFirst, QPtrList<QListViewItem> &afterNow); 524 void moved(Q3PtrList<Q3ListViewItem> &items, Q3PtrList<Q3ListViewItem> &afterFirst, Q3PtrList<Q3ListViewItem> &afterNow);
514 525
515 /** 526 /**
516 * This signal gets emitted when an item is renamed via in-place renaming. 527 * This signal gets emitted when an item is renamed via in-place renaming.
517 * 528 *
518 * @param item is the renamed item. 529 * @param item is the renamed item.
519 * @param str is the new value of column @p col. 530 * @param str is the new value of column @p col.
520 * @param col is the renamed column. 531 * @param col is the renamed column.
521 */ 532 */
522 void itemRenamed(QListViewItem* item, const QString &str, int col); 533 void itemRenamed(Q3ListViewItem* item, const QString &str, int col);
523 534
524 /** 535 /**
525 * Same as above, but without the extra information. 536 * Same as above, but without the extra information.
526 */ 537 */
527 void itemRenamed(QListViewItem* item); 538 void itemRenamed(Q3ListViewItem* item);
528 void signalDelete(); 539 void signalDelete();
529 540
530 /** 541 /**
531 * This signal is emitted when the shortcut key for popup-menus is pressed. 542 * This signal is emitted when the shortcut key for popup-menus is pressed.
532 * 543 *
533 * Normally you should not use this, just connect a slot to signal 544 * Normally you should not use this, just connect a slot to signal
534 * @ref contextMenu (KListView*, QListViewItem*, const QPoint&) to correctly 545 * @ref contextMenu (KListView*, QListViewItem*, const QPoint&) to correctly
535 * handle showing context menus regardless of settings. 546 * handle showing context menus regardless of settings.
536 * 547 *
537 * @param list is this listview. 548 * @param list is this listview.
538 * @param item is the @ref currentItem() at the time the key was pressed. May be 0L. 549 * @param item is the @ref currentItem() at the time the key was pressed. May be 0L.
539 */ 550 */
540 void menuShortCutPressed (KListView* list, QListViewItem* item); 551 void menuShortCutPressed (KListView* list, Q3ListViewItem* item);
541 552
542 /** 553 /**
543 * This signal is emitted whenever a context-menu should be shown for item @p i. 554 * This signal is emitted whenever a context-menu should be shown for item @p i.
544 * It automatically adjusts for all settings involved (Menu key, showMenuOnPress/Click). 555 * It automatically adjusts for all settings involved (Menu key, showMenuOnPress/Click).
545 * 556 *
546 * @param l is this listview. 557 * @param l is this listview.
547 * @param i is the item for which the menu should be shown. May be 0L. 558 * @param i is the item for which the menu should be shown. May be 0L.
548 * @param p is the point at which the menu should be shown. 559 * @param p is the point at which the menu should be shown.
549 */ 560 */
550 void contextMenu (KListView* l, QListViewItem* i, const QPoint& p); 561 void contextMenu (KListView* l, Q3ListViewItem* i, const QPoint& p);
551 562
552public slots: 563public slots:
553 /** 564 /**
554 * Rename column @p c of @p item. 565 * Rename column @p c of @p item.
555 */ 566 */
556 virtual void rename(QListViewItem *item, int c); 567 virtual void rename(Q3ListViewItem *item, int c);
557 568
558 /** 569 /**
559 * By default, if you called setItemsRenameable(true), 570 * By default, if you called setItemsRenameable(true),
560 * only the first column is renameable. 571 * only the first column is renameable.
561 * Use this function to enable the feature on other columns. 572 * Use this function to enable the feature on other columns.
562 * 573 *
563 * If you want more intelligent (dynamic) selection, 574 * If you want more intelligent (dynamic) selection,
564 * you'll have to derive from KListView, 575 * you'll have to derive from KListView,
565 * and override @ref rename() and call only call it 576 * and override @ref rename() and call only call it
566 * if you want the item to be renamed. 577 * if you want the item to be renamed.
567 */ 578 */
568 void setRenameable (int column, bool yesno=true); 579 void setRenameable (int column, bool yesno=true);
@@ -664,41 +675,41 @@ protected:
664 return (p.y() > (rect.top() + (rect.bottom() - rect.top())/2)); 675 return (p.y() > (rect.top() + (rect.bottom() - rect.top())/2));
665 } 676 }
666 677
667 /** 678 /**
668 * An overloaded version of below(const QRect&, const QPoint&). 679 * An overloaded version of below(const QRect&, const QPoint&).
669 * 680 *
670 * It differs from the above only in what arguments it takes. 681 * It differs from the above only in what arguments it takes.
671 * 682 *
672 * @param i the item whose rect() is passed to the above function. 683 * @param i the item whose rect() is passed to the above function.
673 * @param p is translated from contents coordinates to viewport coordinates 684 * @param p is translated from contents coordinates to viewport coordinates
674 * before being passed to the above function. 685 * before being passed to the above function.
675 */ 686 */
676 inline bool below (QListViewItem* i, const QPoint& p) 687 inline bool below (Q3ListViewItem* i, const QPoint& p)
677 { 688 {
678 return below (itemRect(i), contentsToViewport(p)); 689 return below (itemRect(i), contentsToViewport(p));
679 } 690 }
680 691
681 /** 692 /**
682 * Reimplemented to reload the alternate background in palette changes. 693 * Reimplemented to reload the alternate background in palette changes.
683 * @internal 694 * @internal
684 */ 695 */
685 virtual bool event( QEvent * ); 696 virtual bool event( QEvent * );
686 697
687 /** 698 /**
688 * Emit signal @ref #executed. 699 * Emit signal @ref #executed.
689 * @internal 700 * @internal
690 */ 701 */
691 //US I added buttonstate to pass the current keyboard status 702 //US I added buttonstate to pass the current keyboard status
692 void emitExecute( int buttonstate, QListViewItem *item, const QPoint &pos, int c); 703 void emitExecute( int buttonstate, Q3ListViewItem *item, const QPoint &pos, int c);
693 704
694 /** 705 /**
695 * Reimplemented for internal reasons. 706 * Reimplemented for internal reasons.
696 * Further reimplementations should call this function or else 707 * Further reimplementations should call this function or else
697 * some features may not work correctly. 708 * some features may not work correctly.
698 * 709 *
699 * The API is unaffected. 710 * The API is unaffected.
700 */ 711 */
701 virtual void focusInEvent(QFocusEvent* fe); 712 virtual void focusInEvent(QFocusEvent* fe);
702 713
703 /** 714 /**
704 * Reimplemented for internal reasons. 715 * Reimplemented for internal reasons.
@@ -712,30 +723,30 @@ protected:
712 /** 723 /**
713 * Reimplemented for internal reasons. 724 * Reimplemented for internal reasons.
714 * Further reimplementations should call this function or else 725 * Further reimplementations should call this function or else
715 * some features may not work correctly. 726 * some features may not work correctly.
716 * 727 *
717 * The API is unaffected. 728 * The API is unaffected.
718 */ 729 */
719 virtual void leaveEvent( QEvent *e ); 730 virtual void leaveEvent( QEvent *e );
720 731
721 /** 732 /**
722 * @return the tooltip for @p column of @p item. 733 * @return the tooltip for @p column of @p item.
723 */ 734 */
724 virtual QString tooltip(QListViewItem* item, int column) const; 735 virtual QString tooltip(Q3ListViewItem* item, int column) const;
725 736
726 /** 737 /**
727 * @return whether the tooltip for @p column of @p item shall be shown at point @p pos. 738 * @return whether the tooltip for @p column of @p item shall be shown at point @p pos.
728 */ 739 */
729 virtual bool showTooltip(QListViewItem *item, const QPoint &pos, int column) const; 740 virtual bool showTooltip(Q3ListViewItem *item, const QPoint &pos, int column) const;
730 741
731 /** 742 /**
732 * Reimplemented for internal reasons. 743 * Reimplemented for internal reasons.
733 * Further reimplementations should call this function or else 744 * Further reimplementations should call this function or else
734 * some features may not work correctly. 745 * some features may not work correctly.
735 * 746 *
736 * The API is unaffected. 747 * The API is unaffected.
737 */ 748 */
738 virtual void contentsDragMoveEvent (QDragMoveEvent *event); 749 virtual void contentsDragMoveEvent (QDragMoveEvent *event);
739 750
740 /** 751 /**
741 * Reimplemented for internal reasons. 752 * Reimplemented for internal reasons.
@@ -796,49 +807,49 @@ protected:
796 * Further reimplementations should call this function or else 807 * Further reimplementations should call this function or else
797 * some features may not work correctly. 808 * some features may not work correctly.
798 * 809 *
799 * The API is unaffected. 810 * The API is unaffected.
800 */ 811 */
801 virtual void contentsDragEnterEvent (QDragEnterEvent *); 812 virtual void contentsDragEnterEvent (QDragEnterEvent *);
802 813
803 /** 814 /**
804 * @return a dragobject encoding the current selection. 815 * @return a dragobject encoding the current selection.
805 * 816 *
806 * @see setDragEnabled() 817 * @see setDragEnabled()
807 */ 818 */
808 virtual QDragObject *dragObject(); 819 virtual Q3DragObject *dragObject();
809 820
810 /** 821 /**
811 * @return true if the @p event provides some acceptable 822 * @return true if the @p event provides some acceptable
812 * format. 823 * format.
813 * A common mistake is to forget the "const" in your reimplementation 824 * A common mistake is to forget the "const" in your reimplementation
814 */ 825 */
815 virtual bool acceptDrag (QDropEvent* event) const; 826 virtual bool acceptDrag (QDropEvent* event) const;
816 827
817 /** 828 /**
818 * Paint the drag line. If painter is null, don't try to :) 829 * Paint the drag line. If painter is null, don't try to :)
819 * 830 *
820 * If after == 0 then the marker should be drawn at the top. 831 * If after == 0 then the marker should be drawn at the top.
821 * 832 *
822 * @return the rectangle that you painted to. 833 * @return the rectangle that you painted to.
823 */ 834 */
824 virtual QRect drawDropVisualizer (QPainter *p, QListViewItem *parent, QListViewItem *after); 835 virtual QRect drawDropVisualizer (QPainter *p, Q3ListViewItem *parent, Q3ListViewItem *after);
825 836
826 /** 837 /**
827 * Paint the drag rectangle. If painter is null, don't try to :) 838 * Paint the drag rectangle. If painter is null, don't try to :)
828 * 839 *
829 * 840 *
830 * @return the rectangle that you painted to. 841 * @return the rectangle that you painted to.
831 */ 842 */
832 virtual QRect drawItemHighlighter(QPainter *painter, QListViewItem *item); 843 virtual QRect drawItemHighlighter(QPainter *painter, Q3ListViewItem *item);
833 844
834 /** 845 /**
835 * This method calls @ref dragObject() and starts the drag. 846 * This method calls @ref dragObject() and starts the drag.
836 * 847 *
837 * Reimplement it to do fancy stuff like setting a pixmap or 848 * Reimplement it to do fancy stuff like setting a pixmap or
838 * using a non-default DragMode 849 * using a non-default DragMode
839 */ 850 */
840 virtual void startDrag(); 851 virtual void startDrag();
841 852
842 /** 853 /**
843 * Reimplemented for internal reasons. 854 * Reimplemented for internal reasons.
844 * Further reimplementations should call this function or else 855 * Further reimplementations should call this function or else
@@ -877,52 +888,52 @@ protected:
877 /** 888 /**
878 * Reimplemented for setFullWidth() 889 * Reimplemented for setFullWidth()
879 */ 890 */
880 virtual void viewportResizeEvent(QResizeEvent* e); 891 virtual void viewportResizeEvent(QResizeEvent* e);
881 892
882protected slots: 893protected slots:
883 /** 894 /**
884 * Update internal settings whenever the global ones change. 895 * Update internal settings whenever the global ones change.
885 * @internal 896 * @internal
886 */ 897 */
887 void slotSettingsChanged(int); 898 void slotSettingsChanged(int);
888 899
889 void slotMouseButtonClicked( int btn, QListViewItem *item, const QPoint &pos, int c ); 900 void slotMouseButtonClicked( int btn, Q3ListViewItem *item, const QPoint &pos, int c );
890 void doneEditing(QListViewItem *item, int row); 901 void doneEditing(Q3ListViewItem *item, int row);
891 902
892 /** 903 /**
893 * Repaint the rect where I was drawing the drop line. 904 * Repaint the rect where I was drawing the drop line.
894 */ 905 */
895 void cleanDropVisualizer(); 906 void cleanDropVisualizer();
896 907
897 /** 908 /**
898 * Repaint the rect where I was drawing the drop rectangle. 909 * Repaint the rect where I was drawing the drop rectangle.
899 */ 910 */
900 void cleanItemHighlighter(); 911 void cleanItemHighlighter();
901 912
902 /** 913 /**
903 * Emit the @ref contextMenu signal. This slot is for mouse actions. 914 * Emit the @ref contextMenu signal. This slot is for mouse actions.
904 */ 915 */
905 void emitContextMenu (QListViewItem*, const QPoint&, int); 916 void emitContextMenu (Q3ListViewItem*, const QPoint&, int);
906 917
907 /** 918 /**
908 * Emit the @ref #contextMenu signal. This slot is for key presses. 919 * Emit the @ref #contextMenu signal. This slot is for key presses.
909 */ 920 */
910 void emitContextMenu (KListView*, QListViewItem*); 921 void emitContextMenu (KListView*, Q3ListViewItem*);
911 922
912 /** 923 /**
913 * Accessory slot for AutoSelect 924 * Accessory slot for AutoSelect
914 * @internal 925 * @internal
915 */ 926 */
916 void slotOnItem( QListViewItem *item ); 927 void slotOnItem( Q3ListViewItem *item );
917 928
918 /** 929 /**
919 * Accessory slot for AutoSelect/ChangeCursorOverItem 930 * Accessory slot for AutoSelect/ChangeCursorOverItem
920 * @internal 931 * @internal
921 */ 932 */
922 void slotOnViewport(); 933 void slotOnViewport();
923 934
924 /** 935 /**
925 * Process AutoSelection. 936 * Process AutoSelection.
926 * @internal 937 * @internal
927 */ 938 */
928 void slotAutoSelect(); 939 void slotAutoSelect();
@@ -930,33 +941,33 @@ protected slots:
930 void slotDragExpand(); 941 void slotDragExpand();
931 942
932 /** 943 /**
933 * Reacts to header changes in full width mode 944 * Reacts to header changes in full width mode
934 * @internal 945 * @internal
935 */ 946 */
936 void slotHeaderChanged(); 947 void slotHeaderChanged();
937 948
938protected: 949protected:
939 /** 950 /**
940 * Handle dropEvent when itemsMovable() is set to true. 951 * Handle dropEvent when itemsMovable() is set to true.
941 */ 952 */
942 virtual void movableDropEvent (QListViewItem* parent, QListViewItem* afterme); 953 virtual void movableDropEvent (Q3ListViewItem* parent, Q3ListViewItem* afterme);
943 954
944 /** 955 /**
945 * Where is the nearest QListViewItem that I'm going to drop? 956 * Where is the nearest QListViewItem that I'm going to drop?
946 * 957 *
947 * FIXME KDE 4.0: Make this method const so it can be called from an 958 * FIXME KDE 4.0: Make this method const so it can be called from an
948 * acceptDrag method without ugly casts 959 * acceptDrag method without ugly casts
949 */ 960 */
950 virtual void findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after); 961 virtual void findDrop(const QPoint &pos, Q3ListViewItem *&parent, Q3ListViewItem *&after);
951 962
952 /** 963 /**
953 * A special keyPressEvent (for FileManager selection mode). 964 * A special keyPressEvent (for FileManager selection mode).
954 */ 965 */
955 void fileManagerKeyPressEvent (QKeyEvent*); 966 void fileManagerKeyPressEvent (QKeyEvent*);
956 967
957 /** 968 /**
958 * Convert the depth of an item into its indentation in pixels 969 * Convert the depth of an item into its indentation in pixels
959 */ 970 */
960 int depthToPixels( int depth ); 971 int depthToPixels( int depth );
961 972
962private: 973private:
@@ -965,57 +976,57 @@ protected:
965 virtual void virtual_hook( int id, void* data ); 976 virtual void virtual_hook( int id, void* data );
966private: 977private:
967 class KListViewPrivate; 978 class KListViewPrivate;
968 KListViewPrivate *d; 979 KListViewPrivate *d;
969}; 980};
970 981
971/** 982/**
972 * A listview item with support for alternate background colours. It is 983 * A listview item with support for alternate background colours. It is
973 * a drop-in replacement for @ref QListViewItem 984 * a drop-in replacement for @ref QListViewItem
974 * 985 *
975 * @short listview item with alternate background colour support 986 * @short listview item with alternate background colour support
976 */ 987 */
977class KListViewItem : public QListViewItem 988class KListViewItem : public Q3ListViewItem
978{ 989{
979public: 990public:
980 /** 991 /**
981 * constructors. The semantics remain as in @ref QListViewItem. 992 * constructors. The semantics remain as in @ref QListViewItem.
982 * Although they accept a @ref QListViewItem as parent, please 993 * Although they accept a @ref QListViewItem as parent, please
983 * don't mix KListViewItem (or subclasses) with QListViewItem 994 * don't mix KListViewItem (or subclasses) with QListViewItem
984 * (or subclasses). 995 * (or subclasses).
985 */ 996 */
986 KListViewItem(QListView *parent); 997 KListViewItem(Q3ListView *parent);
987 KListViewItem(QListViewItem *parent); 998 KListViewItem(Q3ListViewItem *parent);
988 KListViewItem(QListView *parent, QListViewItem *after); 999 KListViewItem(Q3ListView *parent, Q3ListViewItem *after);
989 KListViewItem(QListViewItem *parent, QListViewItem *after); 1000 KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after);
990 1001
991 KListViewItem(QListView *parent, 1002 KListViewItem(Q3ListView *parent,
992 QString, QString = QString::null, 1003 QString, QString = QString::null,
993 QString = QString::null, QString = QString::null, 1004 QString = QString::null, QString = QString::null,
994 QString = QString::null, QString = QString::null, 1005 QString = QString::null, QString = QString::null,
995 QString = QString::null, QString = QString::null); 1006 QString = QString::null, QString = QString::null);
996 1007
997 KListViewItem(QListViewItem *parent, 1008 KListViewItem(Q3ListViewItem *parent,
998 QString, QString = QString::null, 1009 QString, QString = QString::null,
999 QString = QString::null, QString = QString::null, 1010 QString = QString::null, QString = QString::null,
1000 QString = QString::null, QString = QString::null, 1011 QString = QString::null, QString = QString::null,
1001 QString = QString::null, QString = QString::null); 1012 QString = QString::null, QString = QString::null);
1002 1013
1003 KListViewItem(QListView *parent, QListViewItem *after, 1014 KListViewItem(Q3ListView *parent, Q3ListViewItem *after,
1004 QString, QString = QString::null, 1015 QString, QString = QString::null,
1005 QString = QString::null, QString = QString::null, 1016 QString = QString::null, QString = QString::null,
1006 QString = QString::null, QString = QString::null, 1017 QString = QString::null, QString = QString::null,
1007 QString = QString::null, QString = QString::null); 1018 QString = QString::null, QString = QString::null);
1008 1019
1009 KListViewItem(QListViewItem *parent, QListViewItem *after, 1020 KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after,
1010 QString, QString = QString::null, 1021 QString, QString = QString::null,
1011 QString = QString::null, QString = QString::null, 1022 QString = QString::null, QString = QString::null,
1012 QString = QString::null, QString = QString::null, 1023 QString = QString::null, QString = QString::null,
1013 QString = QString::null, QString = QString::null); 1024 QString = QString::null, QString = QString::null);
1014 1025
1015 virtual ~KListViewItem(); 1026 virtual ~KListViewItem();
1016 1027
1017 /** 1028 /**
1018 * retuns true if this item is to be drawn with the alternate background 1029 * retuns true if this item is to be drawn with the alternate background
1019 */ 1030 */
1020 bool isAlternate(); 1031 bool isAlternate();
1021 /** 1032 /**
diff --git a/microkde/kdeui/kmainwindow.cpp b/microkde/kdeui/kmainwindow.cpp
index fa678f2..bac0db8 100644
--- a/microkde/kdeui/kmainwindow.cpp
+++ b/microkde/kdeui/kmainwindow.cpp
@@ -12,30 +12,36 @@
12 License version 2 as published by the Free Software Foundation. 12 License version 2 as published by the Free Software Foundation.
13 13
14 This library is distributed in the hope that it will be useful, 14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Library General Public License for more details. 17 Library General Public License for more details.
18 18
19 You should have received a copy of the GNU Library General Public License 19 You should have received a copy of the GNU Library General Public License
20 along with this library; see the file COPYING.LIB. If not, write to 20 along with this library; see the file COPYING.LIB. If not, write to
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. 22 Boston, MA 02111-1307, USA.
23 */ 23 */
24#include <qobjectlist.h> 24#include <qobject.h>
25#include <qstringlist.h> 25#include <qstringlist.h>
26#include <qtimer.h> 26#include <qtimer.h>
27#include <qmenubar.h> 27#include <qmenubar.h>
28#include <qstatusbar.h> 28#include <qstatusbar.h>
29#include <qapplication.h> 29#include <qapplication.h>
30//Added by qt3to4:
31#include <QCloseEvent>
32#include <QPaintEvent>
33#include <QResizeEvent>
34#include <QChildEvent>
35#include <Q3PtrList>
30 36
31 37
32#include "kdebug.h" 38#include "kdebug.h"
33#include "kmainwindow.h" 39#include "kmainwindow.h"
34#include "kglobalsettings.h" 40#include "kglobalsettings.h"
35#include "kactioncollection.h" 41#include "kactioncollection.h"
36 42
37class KMainWindowPrivate { 43class KMainWindowPrivate {
38public: 44public:
39//US bool showHelpMenu:1; 45//US bool showHelpMenu:1;
40 46
41 bool autoSaveSettings:1; 47 bool autoSaveSettings:1;
@@ -45,25 +51,25 @@ public:
45 QString autoSaveGroup; 51 QString autoSaveGroup;
46//US KAccel * kaccel; 52//US KAccel * kaccel;
47//US KMainWindowInterface *m_interface; 53//US KMainWindowInterface *m_interface;
48 KDEPrivate::ToolBarHandler *toolBarHandler; 54 KDEPrivate::ToolBarHandler *toolBarHandler;
49 QTimer* settingsTimer; 55 QTimer* settingsTimer;
50 KToggleAction *showStatusBarAction; 56 KToggleAction *showStatusBarAction;
51 QRect defaultWindowSize; 57 QRect defaultWindowSize;
52}; 58};
53 59
54static bool no_query_exit = false; 60static bool no_query_exit = false;
55 61
56KMainWindow::KMainWindow( QWidget* parent, const char *name ) 62KMainWindow::KMainWindow( QWidget* parent, const char *name )
57 : QMainWindow( parent, name ) /*LR, f ) with the default widget flag we cannot have fastload */ /*US, KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )*/ 63 : Q3MainWindow( parent, name ) /*LR, f ) with the default widget flag we cannot have fastload */ /*US, KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )*/
58{ 64{
59 mQToolBar = 0; 65 mQToolBar = 0;
60 initKMainWindow(name); 66 initKMainWindow(name);
61} 67}
62 68
63void KMainWindow::parseGeometry(bool parsewidth) 69void KMainWindow::parseGeometry(bool parsewidth)
64{ 70{
65//US the following code is not getting used in the embedded version !! So disable it for now 71//US the following code is not getting used in the embedded version !! So disable it for now
66/*US 72/*US
67 73
68 assert ( !kapp->geometryArgument().isNull() ); 74 assert ( !kapp->geometryArgument().isNull() );
69 assert ( d->care_about_geometry ); 75 assert ( d->care_about_geometry );
@@ -267,25 +273,25 @@ void KMainWindow::setCaption( const QString &caption )
267//US setPlainCaption( kapp->makeStdCaption(caption) ); 273//US setPlainCaption( kapp->makeStdCaption(caption) );
268 setPlainCaption( caption ); 274 setPlainCaption( caption );
269} 275}
270 276
271void KMainWindow::setCaption( const QString &caption, bool modified ) 277void KMainWindow::setCaption( const QString &caption, bool modified )
272{ 278{
273//US setPlainCaption( kapp->makeStdCaption(caption, true, modified) ); 279//US setPlainCaption( kapp->makeStdCaption(caption, true, modified) );
274 setPlainCaption( caption + "modified:" ); 280 setPlainCaption( caption + "modified:" );
275} 281}
276 282
277void KMainWindow::setPlainCaption( const QString &caption ) 283void KMainWindow::setPlainCaption( const QString &caption )
278{ 284{
279 QMainWindow::setCaption( caption ); 285 Q3MainWindow::setCaption( caption );
280#ifndef Q_WS_QWS 286#ifndef Q_WS_QWS
281//US the following is disabled for the embedded version 287//US the following is disabled for the embedded version
282//US NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 ); 288//US NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 );
283//US info.setName( caption.utf8().data() ); 289//US info.setName( caption.utf8().data() );
284#endif 290#endif
285} 291}
286 292
287void KMainWindow::slotStateChanged(const QString &newstate) 293void KMainWindow::slotStateChanged(const QString &newstate)
288{ 294{
289 stateChanged(newstate, KXMLGUIClient::StateNoReverse); 295 stateChanged(newstate, KXMLGUIClient::StateNoReverse);
290} 296}
291 297
@@ -412,73 +418,74 @@ bool KMainWindow::isStandardToolBarMenuEnabled() const
412 return ( d->toolBarHandler != 0 ); 418 return ( d->toolBarHandler != 0 );
413} 419}
414 420
415void KMainWindow::createStandardStatusBarAction(){ 421void KMainWindow::createStandardStatusBarAction(){
416 if(!d->showStatusBarAction){ 422 if(!d->showStatusBarAction){
417 d->showStatusBarAction = KStdAction::showStatusbar(this, SLOT(setSettingsDirty()), actionCollection()); 423 d->showStatusBarAction = KStdAction::showStatusbar(this, SLOT(setSettingsDirty()), actionCollection());
418 connect(d->showStatusBarAction, SIGNAL(toggled(bool)), statusBar(), SLOT(setShown(bool))); 424 connect(d->showStatusBarAction, SIGNAL(toggled(bool)), statusBar(), SLOT(setShown(bool)));
419 if(internalStatusBar()) 425 if(internalStatusBar())
420 d->showStatusBarAction->setChecked(!internalStatusBar()->isHidden()); 426 d->showStatusBarAction->setChecked(!internalStatusBar()->isHidden());
421 } 427 }
422} 428}
423 429
424QToolBar *KMainWindow::tBar( ) 430Q3ToolBar *KMainWindow::tBar( )
425{ 431{
426 if ( ! mQToolBar ) 432 if ( ! mQToolBar )
427 mQToolBar = new QToolBar( this ); 433 mQToolBar = new Q3ToolBar( this );
428 return mQToolBar; 434 return mQToolBar;
429} 435}
430 436
431KToolBar *KMainWindow::toolBar( const char * name ) 437KToolBar *KMainWindow::toolBar( const char * name )
432{ 438{
433 439
434 if (!name) 440 if (!name)
435 name = "mainToolBar"; 441 name = "mainToolBar";
436 KToolBar *tb = (KToolBar*)child( name, "KToolBar" ); 442 KToolBar *tb = (KToolBar*)child( name, "KToolBar" );
437 if ( tb ) 443 if ( tb )
438 return tb; 444 return tb;
439 bool honor_mode = (name == "mainToolBar"); 445 bool honor_mode = (name == "mainToolBar");
440 446
441/*US 447/*US
442 if ( builderClient() ) 448 if ( builderClient() )
443 return new KToolBar(this, name, honor_mode); // XMLGUI constructor 449 return new KToolBar(this, name, honor_mode); // XMLGUI constructor
444 else 450 else
445*/ 451*/
446 return new KToolBar(this, Top, false, name, honor_mode ); // non-XMLGUI 452 return new KToolBar(this, Qt::Top, false, name, honor_mode ); // non-XMLGUI
447} 453}
448 454
449QPtrListIterator<KToolBar> KMainWindow::toolBarIterator() 455Q3PtrListIterator<KToolBar> KMainWindow::toolBarIterator()
450{ 456{
451 toolbarList.clear(); 457 toolbarList.clear();
452 QPtrList<QToolBar> lst; 458 QList<Q3ToolBar*> lst;
453 for ( int i = (int)QMainWindow::Unmanaged; i <= (int)Minimized; ++i ) { 459 for ( int i = (int)Qt::Unmanaged; i <= (int)Qt::Minimized; ++i ) {
454 lst = toolBars( (ToolBarDock)i ); 460 lst = toolBars( (Qt::ToolBarDock)i );
455 for ( QToolBar *tb = lst.first(); tb; tb = lst.next() ) { 461 for(QList<Q3ToolBar*>::iterator i=lst.begin();i!=lst.end();++i) {
462 Q3ToolBar *tb = *i;
456 if ( !tb->inherits( "KToolBar" ) ) 463 if ( !tb->inherits( "KToolBar" ) )
457 continue; 464 continue;
458 toolbarList.append( (KToolBar*)tb ); 465 toolbarList.append( (KToolBar*)tb );
459 } 466 }
460 } 467 }
461 return QPtrListIterator<KToolBar>( toolbarList ); 468 return Q3PtrListIterator<KToolBar>( toolbarList );
462} 469}
463 470
464void KMainWindow::setAutoSaveSettings( const QString & groupName, bool saveWindowSize ) 471void KMainWindow::setAutoSaveSettings( const QString & groupName, bool saveWindowSize )
465{ 472{
466 d->autoSaveSettings = true; 473 d->autoSaveSettings = true;
467 d->autoSaveGroup = groupName; 474 d->autoSaveGroup = groupName;
468 d->autoSaveWindowSize = saveWindowSize; 475 d->autoSaveWindowSize = saveWindowSize;
469 // Get notified when the user moves a toolbar around 476 // Get notified when the user moves a toolbar around
470//US connect( this, SIGNAL( dockWindowPositionChanged( QDockWindow * ) ), 477//US connect( this, SIGNAL( dockWindowPositionChanged( QDockWindow * ) ),
471//US this, SLOT( setSettingsDirty() ) ); 478//US this, SLOT( setSettingsDirty() ) );
472 connect( this, SIGNAL( toolBarPositionChanged(QToolBar *) ), 479 connect( this, SIGNAL( toolBarPositionChanged(Q3ToolBar *) ),
473 this, SLOT( setSettingsDirty() ) ); 480 this, SLOT( setSettingsDirty() ) );
474 481
475 482
476 // Get default values 483 // Get default values
477//US int scnum = QApplication::desktop()->screenNumber(parentWidget()); 484//US int scnum = QApplication::desktop()->screenNumber(parentWidget());
478//US QRect desk = QApplication::desktop()->screenGeometry(scnum); 485//US QRect desk = QApplication::desktop()->screenGeometry(scnum);
479 QRect desk = KGlobalSettings::desktopGeometry(0); 486 QRect desk = KGlobalSettings::desktopGeometry(0);
480 487
481 d->defaultWindowSize = QRect(desk.width(), width(), desk.height(), height()); 488 d->defaultWindowSize = QRect(desk.width(), width(), desk.height(), height());
482 // Now read the previously saved settings 489 // Now read the previously saved settings
483 applyMainWindowSettings( KGlobal::config(), groupName ); 490 applyMainWindowSettings( KGlobal::config(), groupName );
484} 491}
@@ -494,25 +501,25 @@ void KMainWindow::resetAutoSaveSettings()
494bool KMainWindow::autoSaveSettings() const 501bool KMainWindow::autoSaveSettings() const
495{ 502{
496 return d->autoSaveSettings; 503 return d->autoSaveSettings;
497} 504}
498 505
499QString KMainWindow::autoSaveGroup() const 506QString KMainWindow::autoSaveGroup() const
500{ 507{
501 return d->autoSaveGroup; 508 return d->autoSaveGroup;
502} 509}
503 510
504void KMainWindow::saveAutoSaveSettings() 511void KMainWindow::saveAutoSaveSettings()
505{ 512{
506 ASSERT( d->autoSaveSettings ); 513 Q_ASSERT( d->autoSaveSettings );
507 //kdDebug(200) << "KMainWindow::saveAutoSaveSettings -> saving settings" << endl; 514 //kdDebug(200) << "KMainWindow::saveAutoSaveSettings -> saving settings" << endl;
508 saveMainWindowSettings( KGlobal::config(), d->autoSaveGroup ); 515 saveMainWindowSettings( KGlobal::config(), d->autoSaveGroup );
509 KGlobal::config()->sync(); 516 KGlobal::config()->sync();
510 d->settingsDirty = false; 517 d->settingsDirty = false;
511 if ( d->settingsTimer ) 518 if ( d->settingsTimer )
512 d->settingsTimer->stop(); 519 d->settingsTimer->stop();
513} 520}
514 521
515void KMainWindow::createGUI( const QString &xmlfile, bool _conserveMemory ) 522void KMainWindow::createGUI( const QString &xmlfile, bool _conserveMemory )
516{ 523{
517 // disabling the updates prevents unnecessary redraws 524 // disabling the updates prevents unnecessary redraws
518 setUpdatesEnabled( false ); 525 setUpdatesEnabled( false );
@@ -630,25 +637,25 @@ void KMainWindow::saveMainWindowSettings(KConfig *config, const QString &configG
630 entryList.append("Enabled"); 637 entryList.append("Enabled");
631 638
632 // By default we don't hide. 639 // By default we don't hide.
633 if(mb->isHidden()) 640 if(mb->isHidden())
634 //US config->writeEntry(QString::fromLatin1("MenuBar"), entryList, ';'); 641 //US config->writeEntry(QString::fromLatin1("MenuBar"), entryList, ';');
635 config->writeEntry(QString::fromLatin1("MenuBar"), entryList); 642 config->writeEntry(QString::fromLatin1("MenuBar"), entryList);
636 else 643 else
637 config->deleteEntry(QString::fromLatin1("MenuBar")); 644 config->deleteEntry(QString::fromLatin1("MenuBar"));
638 } 645 }
639 646
640 int n = 1; // Toolbar counter. toolbars are counted from 1, 647 int n = 1; // Toolbar counter. toolbars are counted from 1,
641 KToolBar *toolbar = 0; 648 KToolBar *toolbar = 0;
642 QPtrListIterator<KToolBar> it( toolBarIterator() ); 649 Q3PtrListIterator<KToolBar> it( toolBarIterator() );
643 while ( ( toolbar = it.current() ) ) { 650 while ( ( toolbar = it.current() ) ) {
644 ++it; 651 ++it;
645 QString group; 652 QString group;
646 if (!configGroup.isEmpty()) 653 if (!configGroup.isEmpty())
647 { 654 {
648 // Give a number to the toolbar, but prefer a name if there is one, 655 // Give a number to the toolbar, but prefer a name if there is one,
649 // because there's no real guarantee on the ordering of toolbars 656 // because there's no real guarantee on the ordering of toolbars
650 group = (!::qstrcmp(toolbar->name(), "unnamed") ? QString::number(n) : QString(" ")+toolbar->name()); 657 group = (!::qstrcmp(toolbar->name(), "unnamed") ? QString::number(n) : QString(" ")+toolbar->name());
651 group.prepend(" Toolbar"); 658 group.prepend(" Toolbar");
652 group.prepend(configGroup); 659 group.prepend(configGroup);
653 } 660 }
654 toolbar->saveSettings(config, group); 661 toolbar->saveSettings(config, group);
@@ -705,37 +712,39 @@ void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &config
705 sb->hide(); 712 sb->hide();
706 else 713 else
707 sb->show(); 714 sb->show();
708 if(d->showStatusBarAction) 715 if(d->showStatusBarAction)
709 d->showStatusBarAction->setChecked(!sb->isHidden()); 716 d->showStatusBarAction->setChecked(!sb->isHidden());
710 } 717 }
711 718
712 QMenuBar* mb = internalMenuBar(); 719 QMenuBar* mb = internalMenuBar();
713 if (mb) { 720 if (mb) {
714 entryList.clear(); 721 entryList.clear();
715//US i = config->readListEntry (QString::fromLatin1("MenuBar"), entryList, ';'); 722//US i = config->readListEntry (QString::fromLatin1("MenuBar"), entryList, ';');
716 entryList = config->readListEntry (QString::fromLatin1("MenuBar")); 723 entryList = config->readListEntry (QString::fromLatin1("MenuBar"));
717 entry = entryList.first(); 724 if(!entryList.empty()) {
718 if (entry==QString::fromLatin1("Disabled")) 725 entry = entryList.first();
719 { 726 if (entry==QString::fromLatin1("Disabled"))
720 mb->hide(); 727 {
721 } else 728 mb->hide();
722 { 729 } else
723 mb->show(); 730 {
724 } 731 mb->show();
732 }
733 }
725 } 734 }
726 735
727 int n = 1; // Toolbar counter. toolbars are counted from 1, 736 int n = 1; // Toolbar counter. toolbars are counted from 1,
728 KToolBar *toolbar; 737 KToolBar *toolbar;
729 QPtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator 738 Q3PtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator
730 739
731 for ( ; it.current(); ++it) { 740 for ( ; it.current(); ++it) {
732 toolbar= it.current(); 741 toolbar= it.current();
733 QString group; 742 QString group;
734 if (!configGroup.isEmpty()) 743 if (!configGroup.isEmpty())
735 { 744 {
736 // Give a number to the toolbar, but prefer a name if there is one, 745 // Give a number to the toolbar, but prefer a name if there is one,
737 // because there's no real guarantee on the ordering of toolbars 746 // because there's no real guarantee on the ordering of toolbars
738 group = (!::qstrcmp(toolbar->name(), "unnamed") ? QString::number(n) : QString(" ")+toolbar->name()); 747 group = (!::qstrcmp(toolbar->name(), "unnamed") ? QString::number(n) : QString(" ")+toolbar->name());
739 group.prepend(" Toolbar"); 748 group.prepend(" Toolbar");
740 group.prepend(configGroup); 749 group.prepend(configGroup);
741 } 750 }
@@ -747,25 +756,25 @@ void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &config
747 } 756 }
748 757
749void KMainWindow::finalizeGUI( bool force ) 758void KMainWindow::finalizeGUI( bool force )
750{ 759{
751 //kdDebug(200) << "KMainWindow::finalizeGUI force=" << force << endl; 760 //kdDebug(200) << "KMainWindow::finalizeGUI force=" << force << endl;
752 // The whole reason for this is that moveToolBar relies on the indexes 761 // The whole reason for this is that moveToolBar relies on the indexes
753 // of the other toolbars, so in theory it should be called only once per 762 // of the other toolbars, so in theory it should be called only once per
754 // toolbar, but in increasing order of indexes. 763 // toolbar, but in increasing order of indexes.
755 // Since we can't do that immediately, we move them, and _then_ 764 // Since we can't do that immediately, we move them, and _then_
756 // we call positionYourself again for each of them, but this time 765 // we call positionYourself again for each of them, but this time
757 // the toolbariterator should give them in the proper order. 766 // the toolbariterator should give them in the proper order.
758 // Both the XMLGUI and applySettings call this, hence "force" for the latter. 767 // Both the XMLGUI and applySettings call this, hence "force" for the latter.
759 QPtrListIterator<KToolBar> it( toolBarIterator() ); 768 Q3PtrListIterator<KToolBar> it( toolBarIterator() );
760 for ( ; it.current() ; ++ it ) 769 for ( ; it.current() ; ++ it )
761 it.current()->positionYourself( force ); 770 it.current()->positionYourself( force );
762 771
763 d->settingsDirty = false; 772 d->settingsDirty = false;
764} 773}
765 774
766void KMainWindow::saveWindowSize( KConfig * config ) const 775void KMainWindow::saveWindowSize( KConfig * config ) const
767{ 776{
768/*US 777/*US
769 int scnum = QApplication::desktop()->screenNumber(parentWidget()); 778 int scnum = QApplication::desktop()->screenNumber(parentWidget());
770 QRect desk = QApplication::desktop()->screenGeometry(scnum); 779 QRect desk = QApplication::desktop()->screenGeometry(scnum);
771*/ 780*/
@@ -842,117 +851,105 @@ bool KMainWindow::settingsDirty() const
842 return d->settingsDirty; 851 return d->settingsDirty;
843} 852}
844 853
845QString KMainWindow::settingsGroup() const 854QString KMainWindow::settingsGroup() const
846{ 855{
847 return d->autoSaveGroup; 856 return d->autoSaveGroup;
848} 857}
849 858
850void KMainWindow::resizeEvent( QResizeEvent * e) 859void KMainWindow::resizeEvent( QResizeEvent * e)
851{ 860{
852 if ( d->autoSaveWindowSize ) 861 if ( d->autoSaveWindowSize )
853 setSettingsDirty(); 862 setSettingsDirty();
854 QMainWindow::resizeEvent( e ); 863 Q3MainWindow::resizeEvent( e );
855} 864}
856 865
857bool KMainWindow::hasMenuBar() 866bool KMainWindow::hasMenuBar()
858{ 867{
859 return (internalMenuBar()); 868 return (internalMenuBar());
860} 869}
861 870
862//US KMenuBar *KMainWindow::menuBar() 871//US KMenuBar *KMainWindow::menuBar()
863QMenuBar *KMainWindow::menuBar() 872QMenuBar *KMainWindow::menuBar()
864{ 873{
865//US KMenuBar * mb = internalMenuBar(); 874//US KMenuBar * mb = internalMenuBar();
866 QMenuBar * mb = internalMenuBar(); 875 QMenuBar * mb = internalMenuBar();
867 if ( !mb ) { 876 if ( !mb ) {
868//US mb = new KMenuBar( this ); 877//US mb = new KMenuBar( this );
869 mb = new QMenuBar( this ); 878 mb = new QMenuBar( this );
870 // trigger a re-layout and trigger a call to the private 879 // trigger a re-layout and trigger a call to the private
871 // setMenuBar method. 880 // setMenuBar method.
872 QMainWindow::menuBar(); 881 Q3MainWindow::menuBar();
873 } 882 }
874 return mb; 883 return mb;
875} 884}
876 885
877//US KStatusBar *KMainWindow::statusBar() 886//US KStatusBar *KMainWindow::statusBar()
878QStatusBar *KMainWindow::statusBar() 887QStatusBar *KMainWindow::statusBar()
879{ 888{
880//US KStatusBar * sb = internalStatusBar(); 889//US KStatusBar * sb = internalStatusBar();
881 QStatusBar * sb = internalStatusBar(); 890 QStatusBar * sb = internalStatusBar();
882 if ( !sb ) { 891 if ( !sb ) {
883//US sb = new KStatusBar( this ); 892//US sb = new KStatusBar( this );
884 sb = new QStatusBar( this ); 893 sb = new QStatusBar( this );
885 // trigger a re-layout and trigger a call to the private 894 // trigger a re-layout and trigger a call to the private
886 // setStatusBar method. 895 // setStatusBar method.
887 QMainWindow::statusBar(); 896 Q3MainWindow::statusBar();
888 } 897 }
889 return sb; 898 return sb;
890} 899}
891 900
892void KMainWindow::shuttingDown() 901void KMainWindow::shuttingDown()
893{ 902{
894 // Needed for Qt <= 3.0.3 at least to prevent reentrancy 903 // Needed for Qt <= 3.0.3 at least to prevent reentrancy
895 // when queryExit() shows a dialog. Check before removing! 904 // when queryExit() shows a dialog. Check before removing!
896 static bool reentrancy_protection = false; 905 static bool reentrancy_protection = false;
897 if (!reentrancy_protection) 906 if (!reentrancy_protection)
898 { 907 {
899 reentrancy_protection = true; 908 reentrancy_protection = true;
900 // call the virtual queryExit 909 // call the virtual queryExit
901 queryExit(); 910 queryExit();
902 reentrancy_protection = false; 911 reentrancy_protection = false;
903 } 912 }
904 913
905} 914}
906 915
907//US KMenuBar *KMainWindow::internalMenuBar() 916//US KMenuBar *KMainWindow::internalMenuBar()
908QMenuBar *KMainWindow::internalMenuBar() 917QMenuBar *KMainWindow::internalMenuBar()
909{ 918{
910//US QObjectList *l = queryList( "KMenuBar", 0, false, false ); 919//US QObjectList *l = queryList( "KMenuBar", 0, false, false );
911 QObjectList *l = queryList( "QMenuBar", 0, false, false ); 920 QObjectList l = queryList( "QMenuBar", 0, false, false );
912 if ( !l || !l->first() ) { 921 if(l.empty())
913 delete l; 922 return 0;
914 return 0; 923 return (QMenuBar*)l.front();
915 }
916
917//US KMenuBar *m = (KMenuBar*)l->first();
918 QMenuBar *m = (QMenuBar*)l->first();
919 delete l;
920 return m;
921} 924}
922 925
923//US KStatusBar *KMainWindow::internalStatusBar() 926//US KStatusBar *KMainWindow::internalStatusBar()
924QStatusBar *KMainWindow::internalStatusBar() 927QStatusBar *KMainWindow::internalStatusBar()
925{ 928{
926//US QObjectList *l = queryList( "KStatusBar", 0, false, false ); 929//US QObjectList *l = queryList( "KStatusBar", 0, false, false );
927 QObjectList *l = queryList( "QStatusBar", 0, false, false ); 930 QObjectList l = queryList( "QStatusBar", 0, false, false );
928 if ( !l || !l->first() ) { 931 if(l.empty())
929 delete l; 932 return 0;
930 return 0; 933 return (QStatusBar*)l.front();
931 }
932
933//US KStatusBar *s = (KStatusBar*)l->first();
934 QStatusBar *s = (QStatusBar*)l->first();
935 delete l;
936 return s;
937} 934}
938 935
939void KMainWindow::childEvent( QChildEvent* e) 936void KMainWindow::childEvent( QChildEvent* e)
940{ 937{
941 QMainWindow::childEvent( e ); 938 Q3MainWindow::childEvent( e );
942} 939}
943 940
944void KMainWindow::paintEvent( QPaintEvent * e) 941void KMainWindow::paintEvent( QPaintEvent * e)
945{ 942{
946 QMainWindow::paintEvent( e ); 943 Q3MainWindow::paintEvent( e );
947} 944}
948 945
949QSize KMainWindow::sizeForCentralWidgetSize(QSize size) 946QSize KMainWindow::sizeForCentralWidgetSize(QSize size)
950{ 947{
951 KToolBar *tb = (KToolBar*)child( "mainToolBar", "KToolBar" ); 948 KToolBar *tb = (KToolBar*)child( "mainToolBar", "KToolBar" );
952 if (tb && !tb->isHidden()) { 949 if (tb && !tb->isHidden()) {
953 switch( tb->barPos() ) 950 switch( tb->barPos() )
954 { 951 {
955 case KToolBar::Top: 952 case KToolBar::Top:
956 case KToolBar::Bottom: 953 case KToolBar::Bottom:
957 size += QSize(0, tb->sizeHint().height()); 954 size += QSize(0, tb->sizeHint().height());
958 break; 955 break;
diff --git a/microkde/kdeui/kmainwindow.h b/microkde/kdeui/kmainwindow.h
index 2dc8033..a3ac82f 100644
--- a/microkde/kdeui/kmainwindow.h
+++ b/microkde/kdeui/kmainwindow.h
@@ -1,12 +1,17 @@
1//Added by qt3to4:
2#include <QResizeEvent>
3#include <QChildEvent>
4#include <QCloseEvent>
5#include <QPaintEvent>
1/* 6/*
2 This file is part of the KDE libraries 7 This file is part of the KDE libraries
3 8
4 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation. 11 License version 2 as published by the Free Software Foundation.
7 12
8 This library is distributed in the hope that it will be useful, 13 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details. 16 Library General Public License for more details.
12 17
@@ -41,30 +46,30 @@ class KMWSessionManaged;
41class KAccel; 46class KAccel;
42class KToolBarMenuAction; 47class KToolBarMenuAction;
43*/ 48*/
44 49
45class QMenuBar; 50class QMenuBar;
46class QStatusBar; 51class QStatusBar;
47class KMainWindowPrivate; 52class KMainWindowPrivate;
48class KAction; 53class KAction;
49 54
50#include <ktoolbar.h> 55#include <ktoolbar.h>
51#include <ktoolbarhandler.h> 56#include <ktoolbarhandler.h>
52#include <kxmlguiclient.h> 57#include <kxmlguiclient.h>
53#include <qmainwindow.h> 58#include <q3mainwindow.h>
54#include <qptrlist.h> 59#include <q3ptrlist.h>
55 60
56class KActionCollection; 61class KActionCollection;
57 62
58class KMainWindow : public QMainWindow, virtual public KXMLGUIClient 63class KMainWindow : public Q3MainWindow, virtual public KXMLGUIClient
59{ 64{
60 Q_OBJECT 65 Q_OBJECT
61 66
62private: 67private:
63//US create private defaultconstructor 68//US create private defaultconstructor
64 KMainWindow() {;}; 69 KMainWindow() {;};
65 70
66 71
67public: 72public:
68 /** 73 /**
69 * Construct a main window. 74 * Construct a main window.
70 * 75 *
@@ -311,30 +316,30 @@ public:
311 /** 316 /**
312 * Returns a pointer to the toolbar with the specified name. 317 * Returns a pointer to the toolbar with the specified name.
313 * This refers to toolbars created dynamically from the XML UI 318 * This refers to toolbars created dynamically from the XML UI
314 * framework. If the toolbar does not exist one will be created. 319 * framework. If the toolbar does not exist one will be created.
315 * 320 *
316 * @param name The internal name of the toolbar. If no name is 321 * @param name The internal name of the toolbar. If no name is
317 * specified "mainToolBar" is assumed. 322 * specified "mainToolBar" is assumed.
318 * 323 *
319 * @return A pointer to the toolbar 324 * @return A pointer to the toolbar
320 **/ 325 **/
321 KToolBar *toolBar( const char *name=0 ); 326 KToolBar *toolBar( const char *name=0 );
322 // method for getting rid of KDE-Crap 327 // method for getting rid of KDE-Crap
323 QToolBar *tBar( ); 328 Q3ToolBar *tBar( );
324 329
325 /** 330 /**
326 * @return An iterator over the list of all toolbars for this window. 331 * @return An iterator over the list of all toolbars for this window.
327 */ 332 */
328 QPtrListIterator<KToolBar> toolBarIterator(); 333 Q3PtrListIterator<KToolBar> toolBarIterator();
329 334
330 /** 335 /**
331 * @return A KAccel instance bound to this mainwindow. Used automatically 336 * @return A KAccel instance bound to this mainwindow. Used automatically
332 * by KAction to make keybindings work in all cases. 337 * by KAction to make keybindings work in all cases.
333 */ 338 */
334 KAccel *accel(); 339 KAccel *accel();
335 340
336 void setFrameBorderWidth( int ) {} 341 void setFrameBorderWidth( int ) {}
337 342
338 /** 343 /**
339 * Call this to enable "auto-save" of toolbar/menubar/statusbar settings 344 * Call this to enable "auto-save" of toolbar/menubar/statusbar settings
340 * (and optionally window size). 345 * (and optionally window size).
@@ -749,29 +754,29 @@ protected slots:
749 */ 754 */
750//US virtual void showAboutApplication(); 755//US virtual void showAboutApplication();
751 756
752private slots: 757private slots:
753 /** 758 /**
754 * Called when the app is shutting down. 759 * Called when the app is shutting down.
755 */ 760 */
756 void shuttingDown(); 761 void shuttingDown();
757 762
758 void saveAutoSaveSettings(); 763 void saveAutoSaveSettings();
759 764
760private: 765private:
761 QToolBar * mQToolBar; 766 Q3ToolBar * mQToolBar;
762//US KMenuBar *internalMenuBar(); 767//US KMenuBar *internalMenuBar();
763 QMenuBar *internalMenuBar(); 768 QMenuBar *internalMenuBar();
764//US KStatusBar *internalStatusBar(); 769//US KStatusBar *internalStatusBar();
765 QStatusBar *internalStatusBar(); 770 QStatusBar *internalStatusBar();
766 771
767 KMainWindowPrivate *d; 772 KMainWindowPrivate *d;
768 void initKMainWindow(const char *name); 773 void initKMainWindow(const char *name);
769 774
770 QPtrList<KToolBar> toolbarList; 775 Q3PtrList<KToolBar> toolbarList;
771 776
772protected: 777protected:
773 virtual void virtual_hook( int id, void* data ); 778 virtual void virtual_hook( int id, void* data );
774 779
775}; 780};
776 781
777#endif 782#endif
diff --git a/microkde/kdeui/knuminput.cpp b/microkde/kdeui/knuminput.cpp
index 335d6f4..da01a20 100644
--- a/microkde/kdeui/knuminput.cpp
+++ b/microkde/kdeui/knuminput.cpp
@@ -33,24 +33,27 @@
33#include <limits.h> 33#include <limits.h>
34#endif 34#endif
35#include <assert.h> 35#include <assert.h>
36#include <math.h> 36#include <math.h>
37#include <algorithm> 37#include <algorithm>
38 38
39#include <qlabel.h> 39#include <qlabel.h>
40#include <qlineedit.h> 40#include <qlineedit.h>
41#include <qsize.h> 41#include <qsize.h>
42#include <qslider.h> 42#include <qslider.h>
43#include <qspinbox.h> 43#include <qspinbox.h>
44#include <qstyle.h> 44#include <qstyle.h>
45//Added by qt3to4:
46#include <QResizeEvent>
47#include <QEvent>
45 48
46#include <kglobal.h> 49#include <kglobal.h>
47#include <klocale.h> 50#include <klocale.h>
48#include <kdebug.h> 51#include <kdebug.h>
49 52
50#include "knumvalidator.h" 53#include "knumvalidator.h"
51#include "knuminput.h" 54#include "knuminput.h"
52 55
53static inline int calcDiffByTen( int x, int y ) { 56static inline int calcDiffByTen( int x, int y ) {
54 // calculate ( x - y ) / 10 without overflowing ints: 57 // calculate ( x - y ) / 10 without overflowing ints:
55 return ( x / 10 ) - ( y / 10 ) + ( x % 10 - y % 10 ) / 10; 58 return ( x / 10 ) - ( y / 10 ) + ( x % 10 - y % 10 ) / 10;
56} 59}
@@ -97,50 +100,50 @@ KNumInput::~KNumInput()
97} 100}
98 101
99void KNumInput::setLabel(const QString & label, int a) 102void KNumInput::setLabel(const QString & label, int a)
100{ 103{
101 if(label.isEmpty()) { 104 if(label.isEmpty()) {
102 delete m_label; 105 delete m_label;
103 m_label = 0; 106 m_label = 0;
104 m_alignment = 0; 107 m_alignment = 0;
105 } 108 }
106 else { 109 else {
107 if (m_label) m_label->setText(label); 110 if (m_label) m_label->setText(label);
108 else m_label = new QLabel(label, this, "KNumInput::QLabel"); 111 else m_label = new QLabel(label, this, "KNumInput::QLabel");
109 m_label->setAlignment((a & (~(AlignTop|AlignBottom|AlignVCenter))) 112 m_label->setAlignment((a & (~(Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter)))
110 | AlignVCenter); 113 | Qt::AlignVCenter);
111 // if no vertical alignment set, use Top alignment 114 // if no vertical alignment set, use Top alignment
112 if(!(a & (AlignTop|AlignBottom|AlignVCenter))) 115 if(!(a & (Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter)))
113 a |= AlignTop; 116 a |= Qt::AlignTop;
114 m_alignment = a; 117 m_alignment = a;
115 } 118 }
116 119
117 layout(true); 120 layout(true);
118} 121}
119 122
120QString KNumInput::label() const 123QString KNumInput::label() const
121{ 124{
122 if (m_label) return m_label->text(); 125 if (m_label) return m_label->text();
123 return QString::null; 126 return QString::null;
124} 127}
125 128
126void KNumInput::layout(bool deep) 129void KNumInput::layout(bool deep)
127{ 130{
128 int w1 = m_colw1; 131 int w1 = m_colw1;
129 int w2 = m_colw2; 132 int w2 = m_colw2;
130 133
131 // label sizeHint 134 // label sizeHint
132 m_sizeLabel = (m_label ? m_label->sizeHint() : QSize(0,0)); 135 m_sizeLabel = (m_label ? m_label->sizeHint() : QSize(0,0));
133 136
134 if(m_label && (m_alignment & AlignVCenter)) 137 if(m_label && (m_alignment & Qt::AlignVCenter))
135 m_colw1 = m_sizeLabel.width() + 4; 138 m_colw1 = m_sizeLabel.width() + 4;
136 else 139 else
137 m_colw1 = 0; 140 m_colw1 = 0;
138 141
139 // slider sizeHint 142 // slider sizeHint
140 m_sizeSlider = (m_slider ? m_slider->sizeHint() : QSize(0, 0)); 143 m_sizeSlider = (m_slider ? m_slider->sizeHint() : QSize(0, 0));
141 144
142 doLayout(); 145 doLayout();
143 146
144 if(!deep) { 147 if(!deep) {
145 m_colw1 = w1; 148 m_colw1 = w1;
146 m_colw2 = w2; 149 m_colw2 = w2;
@@ -193,38 +196,38 @@ QSize KNumInput::sizeHint() const
193void KNumInput::setSteps(int minor, int major) 196void KNumInput::setSteps(int minor, int major)
194{ 197{
195 if(m_slider) 198 if(m_slider)
196 m_slider->setSteps( minor, major ); 199 m_slider->setSteps( minor, major );
197} 200}
198 201
199 202
200// ---------------------------------------------------------------------------- 203// ----------------------------------------------------------------------------
201 204
202KIntSpinBox::KIntSpinBox(QWidget *parent, const char *name) 205KIntSpinBox::KIntSpinBox(QWidget *parent, const char *name)
203 : QSpinBox(0, 99, 1, parent, name) 206 : QSpinBox(0, 99, 1, parent, name)
204{ 207{
205 editor()->setAlignment(AlignRight); 208 setAlignment(Qt::AlignRight);
206 val_base = 10; 209 val_base = 10;
207 setValue(0); 210 setValue(0);
208} 211}
209 212
210KIntSpinBox::~KIntSpinBox() 213KIntSpinBox::~KIntSpinBox()
211{ 214{
212} 215}
213 216
214KIntSpinBox::KIntSpinBox(int lower, int upper, int step, int value, int base, 217KIntSpinBox::KIntSpinBox(int lower, int upper, int step, int value, int base,
215 QWidget* parent, const char* name) 218 QWidget* parent, const char* name)
216 : QSpinBox(lower, upper, step, parent, name) 219 : QSpinBox(lower, upper, step, parent, name)
217{ 220{
218 editor()->setAlignment(AlignRight); 221 setAlignment(Qt::AlignRight);
219 val_base = base; 222 val_base = base;
220 setValue(value); 223 setValue(value);
221} 224}
222 225
223void KIntSpinBox::setBase(int base) 226void KIntSpinBox::setBase(int base)
224{ 227{
225 val_base = base; 228 val_base = base;
226} 229}
227 230
228 231
229int KIntSpinBox::base() const 232int KIntSpinBox::base() const
230{ 233{
@@ -234,27 +237,27 @@ int KIntSpinBox::base() const
234QString KIntSpinBox::mapValueToText(int v) 237QString KIntSpinBox::mapValueToText(int v)
235{ 238{
236 return QString::number(v, val_base); 239 return QString::number(v, val_base);
237} 240}
238 241
239int KIntSpinBox::mapTextToValue(bool* ok) 242int KIntSpinBox::mapTextToValue(bool* ok)
240{ 243{
241 return cleanText().toInt(ok, val_base); 244 return cleanText().toInt(ok, val_base);
242} 245}
243 246
244void KIntSpinBox::setEditFocus(bool mark) 247void KIntSpinBox::setEditFocus(bool mark)
245{ 248{
246 editor()->setFocus(); 249 setFocus();
247 if(mark) 250 if(mark)
248 editor()->selectAll(); 251 selectAll();
249} 252}
250 253
251 254
252// ---------------------------------------------------------------------------- 255// ----------------------------------------------------------------------------
253 256
254class KIntNumInput::KIntNumInputPrivate { 257class KIntNumInput::KIntNumInputPrivate {
255public: 258public:
256 int referencePoint; 259 int referencePoint;
257 short blockRelative; 260 short blockRelative;
258 KIntNumInputPrivate( int r ) 261 KIntNumInputPrivate( int r )
259 : referencePoint( r ), 262 : referencePoint( r ),
260 blockRelative( 0 ) {} 263 blockRelative( 0 ) {}
@@ -316,32 +319,32 @@ void KIntNumInput::slotEmitRelativeValueChanged( int value ) {
316 if ( d->blockRelative || !d->referencePoint ) return; 319 if ( d->blockRelative || !d->referencePoint ) return;
317 emit relativeValueChanged( double( value ) / double( d->referencePoint ) ); 320 emit relativeValueChanged( double( value ) / double( d->referencePoint ) );
318} 321}
319 322
320void KIntNumInput::setRange(int lower, int upper, int step, bool slider) 323void KIntNumInput::setRange(int lower, int upper, int step, bool slider)
321{ 324{
322 upper = kMax(upper, lower); 325 upper = kMax(upper, lower);
323 lower = kMin(upper, lower); 326 lower = kMin(upper, lower);
324 m_spin->setMinValue(lower); 327 m_spin->setMinValue(lower);
325 m_spin->setMaxValue(upper); 328 m_spin->setMaxValue(upper);
326 m_spin->setLineStep(step); 329 m_spin->setLineStep(step);
327 330
328 step = m_spin->lineStep(); // maybe QRangeControl didn't like out lineStep? 331 step = m_spin->singleStep(); // maybe QRangeControl didn't like out lineStep?
329 332
330 if(slider) { 333 if(slider) {
331 if (m_slider) 334 if (m_slider)
332 m_slider->setRange(lower, upper); 335 m_slider->setRange(lower, upper);
333 else { 336 else {
334 m_slider = new QSlider(lower, upper, step, m_spin->value(), 337 m_slider = new QSlider(lower, upper, step, m_spin->value(),
335 QSlider::Horizontal, this); 338 Qt::Horizontal, this);
336 m_slider->setTickmarks(QSlider::Below); 339 m_slider->setTickmarks(QSlider::Below);
337 connect(m_slider, SIGNAL(valueChanged(int)), 340 connect(m_slider, SIGNAL(valueChanged(int)),
338 m_spin, SLOT(setValue(int))); 341 m_spin, SLOT(setValue(int)));
339 } 342 }
340 343
341 // calculate (upper-lower)/10 without overflowing int's: 344 // calculate (upper-lower)/10 without overflowing int's:
342 int major = calcDiffByTen( upper, lower ); 345 int major = calcDiffByTen( upper, lower );
343 if ( major==0 ) major = step; // #### workaround Qt bug in 2.1-beta4 346 if ( major==0 ) major = step; // #### workaround Qt bug in 2.1-beta4
344 347
345 m_slider->setSteps(step, major); 348 m_slider->setSteps(step, major);
346 m_slider->setTickInterval(major); 349 m_slider->setTickInterval(major);
347 } 350 }
@@ -349,35 +352,35 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider)
349 delete m_slider; 352 delete m_slider;
350 m_slider = 0; 353 m_slider = 0;
351 } 354 }
352 355
353 // check that reference point is still inside valid range: 356 // check that reference point is still inside valid range:
354 setReferencePoint( referencePoint() ); 357 setReferencePoint( referencePoint() );
355 358
356 layout(true); 359 layout(true);
357} 360}
358 361
359void KIntNumInput::setMinValue(int min) 362void KIntNumInput::setMinValue(int min)
360{ 363{
361 setRange(min, m_spin->maxValue(), m_spin->lineStep(), m_slider); 364 setRange(min, m_spin->maxValue(), m_spin->singleStep(), m_slider);
362} 365}
363 366
364int KIntNumInput::minValue() const 367int KIntNumInput::minValue() const
365{ 368{
366 return m_spin->minValue(); 369 return m_spin->minValue();
367} 370}
368 371
369void KIntNumInput::setMaxValue(int max) 372void KIntNumInput::setMaxValue(int max)
370{ 373{
371 setRange(m_spin->minValue(), max, m_spin->lineStep(), m_slider); 374 setRange(m_spin->minValue(), max, m_spin->singleStep(), m_slider);
372} 375}
373 376
374int KIntNumInput::maxValue() const 377int KIntNumInput::maxValue() const
375{ 378{
376 return m_spin->maxValue(); 379 return m_spin->maxValue();
377} 380}
378 381
379void KIntNumInput::setSuffix(const QString &suffix) 382void KIntNumInput::setSuffix(const QString &suffix)
380{ 383{
381 m_spin->setSuffix(suffix); 384 m_spin->setSuffix(suffix);
382 385
383 layout(true); 386 layout(true);
@@ -406,70 +409,70 @@ void KIntNumInput::setEditFocus(bool mark)
406} 409}
407 410
408QSize KIntNumInput::minimumSizeHint() const 411QSize KIntNumInput::minimumSizeHint() const
409{ 412{
410 constPolish(); 413 constPolish();
411 414
412 int w; 415 int w;
413 int h; 416 int h;
414 417
415 h = 2 + QMAX(m_sizeSpin.height(), m_sizeSlider.height()); 418 h = 2 + QMAX(m_sizeSpin.height(), m_sizeSlider.height());
416 419
417 // if in extra row, then count it here 420 // if in extra row, then count it here
418 if(m_label && (m_alignment & (AlignBottom|AlignTop))) 421 if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop)))
419 h += 4 + m_sizeLabel.height(); 422 h += 4 + m_sizeLabel.height();
420 else 423 else
421 // label is in the same row as the other widgets 424 // label is in the same row as the other widgets
422 h = QMAX(h, m_sizeLabel.height() + 2); 425 h = QMAX(h, m_sizeLabel.height() + 2);
423 426
424 w = m_slider ? m_slider->sizeHint().width() + 8 : 0; 427 w = m_slider ? m_slider->sizeHint().width() + 8 : 0;
425 w += m_colw1 + m_colw2; 428 w += m_colw1 + m_colw2;
426 429
427 if(m_alignment & (AlignTop|AlignBottom)) 430 if(m_alignment & (Qt::AlignTop|Qt::AlignBottom))
428 w = QMAX(w, m_sizeLabel.width() + 4); 431 w = QMAX(w, m_sizeLabel.width() + 4);
429 432
430 return QSize(w, h); 433 return QSize(w, h);
431} 434}
432 435
433void KIntNumInput::doLayout() 436void KIntNumInput::doLayout()
434{ 437{
435 m_sizeSpin = m_spin->sizeHint(); 438 m_sizeSpin = m_spin->sizeHint();
436 m_colw2 = m_sizeSpin.width(); 439 m_colw2 = m_sizeSpin.width();
437 440
438 if (m_label) 441 if (m_label)
439 m_label->setBuddy(m_spin); 442 m_label->setBuddy(m_spin);
440} 443}
441 444
442void KIntNumInput::resizeEvent(QResizeEvent* e) 445void KIntNumInput::resizeEvent(QResizeEvent* e)
443{ 446{
444 int w = m_colw1; 447 int w = m_colw1;
445 int h = 0; 448 int h = 0;
446 449
447 if(m_label && (m_alignment & AlignTop)) { 450 if(m_label && (m_alignment & Qt::AlignTop)) {
448 m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); 451 m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height());
449 h += m_sizeLabel.height() + 4; 452 h += m_sizeLabel.height() + 4;
450 } 453 }
451 454
452 if(m_label && (m_alignment & AlignVCenter)) 455 if(m_label && (m_alignment & Qt::AlignVCenter))
453 m_label->setGeometry(0, 0, w, m_sizeSpin.height()); 456 m_label->setGeometry(0, 0, w, m_sizeSpin.height());
454 457
455 m_spin->setGeometry(w, h, m_slider ? m_colw2 : QMAX(m_colw2, e->size().width() - w), m_sizeSpin.height()); 458 m_spin->setGeometry(w, h, m_slider ? m_colw2 : QMAX(m_colw2, e->size().width() - w), m_sizeSpin.height());
456 w += m_colw2 + 8; 459 w += m_colw2 + 8;
457 460
458 if(m_slider) 461 if(m_slider)
459 m_slider->setGeometry(w, h, e->size().width() - w, m_sizeSpin.height()); 462 m_slider->setGeometry(w, h, e->size().width() - w, m_sizeSpin.height());
460 463
461 h += m_sizeSpin.height() + 2; 464 h += m_sizeSpin.height() + 2;
462 465
463 if(m_label && (m_alignment & AlignBottom)) 466 if(m_label && (m_alignment & Qt::AlignBottom))
464 m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); 467 m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height());
465} 468}
466 469
467KIntNumInput::~KIntNumInput() 470KIntNumInput::~KIntNumInput()
468{ 471{
469 delete d; 472 delete d;
470} 473}
471 474
472void KIntNumInput::setValue(int val) 475void KIntNumInput::setValue(int val)
473{ 476{
474 m_spin->setValue(val); 477 m_spin->setValue(val);
475 // slider value is changed by spinValueChanged 478 // slider value is changed by spinValueChanged
@@ -637,62 +640,62 @@ void KDoubleNumInput::slotEmitRelativeValueChanged( double value )
637} 640}
638 641
639QSize KDoubleNumInput::minimumSizeHint() const 642QSize KDoubleNumInput::minimumSizeHint() const
640{ 643{
641 constPolish(); 644 constPolish();
642 645
643 int w; 646 int w;
644 int h; 647 int h;
645 648
646 h = 2 + QMAX(m_sizeEdit.height(), m_sizeSlider.height()); 649 h = 2 + QMAX(m_sizeEdit.height(), m_sizeSlider.height());
647 650
648 // if in extra row, then count it here 651 // if in extra row, then count it here
649 if(m_label && (m_alignment & (AlignBottom|AlignTop))) 652 if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop)))
650 h += 4 + m_sizeLabel.height(); 653 h += 4 + m_sizeLabel.height();
651 else 654 else
652 // label is in the same row as the other widgets 655 // label is in the same row as the other widgets
653 h = QMAX(h, m_sizeLabel.height() + 2); 656 h = QMAX(h, m_sizeLabel.height() + 2);
654 657
655 w = m_slider ? m_slider->sizeHint().width() + 8 : 0; 658 w = m_slider ? m_slider->sizeHint().width() + 8 : 0;
656 w += m_colw1 + m_colw2; 659 w += m_colw1 + m_colw2;
657 660
658 if(m_alignment & (AlignTop|AlignBottom)) 661 if(m_alignment & (Qt::AlignTop|Qt::AlignBottom))
659 w = QMAX(w, m_sizeLabel.width() + 4); 662 w = QMAX(w, m_sizeLabel.width() + 4);
660 663
661 return QSize(w, h); 664 return QSize(w, h);
662} 665}
663 666
664void KDoubleNumInput::resizeEvent(QResizeEvent* e) 667void KDoubleNumInput::resizeEvent(QResizeEvent* e)
665{ 668{
666 int w = m_colw1; 669 int w = m_colw1;
667 int h = 0; 670 int h = 0;
668 671
669 if(m_label && (m_alignment & AlignTop)) { 672 if(m_label && (m_alignment & Qt::AlignTop)) {
670 m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); 673 m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height());
671 h += m_sizeLabel.height() + 4; 674 h += m_sizeLabel.height() + 4;
672 } 675 }
673 676
674 if(m_label && (m_alignment & AlignVCenter)) 677 if(m_label && (m_alignment & Qt::AlignVCenter))
675 m_label->setGeometry(0, 0, w, m_sizeEdit.height()); 678 m_label->setGeometry(0, 0, w, m_sizeEdit.height());
676 679
677 d->spin->setGeometry(w, h, m_slider ? m_colw2 680 d->spin->setGeometry(w, h, m_slider ? m_colw2
678 : e->size().width() - w, m_sizeEdit.height()); 681 : e->size().width() - w, m_sizeEdit.height());
679 w += m_colw2 + 8; 682 w += m_colw2 + 8;
680 683
681 if(m_slider) 684 if(m_slider)
682 m_slider->setGeometry(w, h, e->size().width() - w, m_sizeEdit.height()); 685 m_slider->setGeometry(w, h, e->size().width() - w, m_sizeEdit.height());
683 686
684 h += m_sizeEdit.height() + 2; 687 h += m_sizeEdit.height() + 2;
685 688
686 if(m_label && (m_alignment & AlignBottom)) 689 if(m_label && (m_alignment & Qt::AlignBottom))
687 m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); 690 m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height());
688} 691}
689 692
690void KDoubleNumInput::doLayout() 693void KDoubleNumInput::doLayout()
691{ 694{
692 m_sizeEdit = d->spin->sizeHint(); 695 m_sizeEdit = d->spin->sizeHint();
693 m_colw2 = m_sizeEdit.width(); 696 m_colw2 = m_sizeEdit.width();
694} 697}
695 698
696void KDoubleNumInput::setValue(double val) 699void KDoubleNumInput::setValue(double val)
697{ 700{
698 d->spin->setValue( val ); 701 d->spin->setValue( val );
@@ -721,32 +724,32 @@ void KDoubleNumInput::setRange(double lower, double upper, double step,
721 QSpinBox * spin = d->spin; 724 QSpinBox * spin = d->spin;
722 disconnect(spin, SIGNAL(valueChanged(int)), 725 disconnect(spin, SIGNAL(valueChanged(int)),
723 m_slider, SLOT(setValue(int)) ); 726 m_slider, SLOT(setValue(int)) );
724 } 727 }
725 d->spin->setRange( lower, upper, step, d->spin->precision() ); 728 d->spin->setRange( lower, upper, step, d->spin->precision() );
726 729
727 if(slider) { 730 if(slider) {
728 // upcast to base type to get the min/maxValue in int form: 731 // upcast to base type to get the min/maxValue in int form:
729 QSpinBox * spin = d->spin; 732 QSpinBox * spin = d->spin;
730 int slmax = spin->maxValue(); 733 int slmax = spin->maxValue();
731 int slmin = spin->minValue(); 734 int slmin = spin->minValue();
732 int slvalue = spin->value(); 735 int slvalue = spin->value();
733 int slstep = spin->lineStep(); 736 int slstep = spin->singleStep();
734 if (m_slider) { 737 if (m_slider) {
735 m_slider->setRange(slmin, slmax); 738 m_slider->setRange(slmin, slmax);
736 m_slider->setLineStep(slstep); 739 m_slider->setLineStep(slstep);
737 m_slider->setValue(slvalue); 740 m_slider->setValue(slvalue);
738 } else { 741 } else {
739 m_slider = new QSlider(slmin, slmax, slstep, slvalue, 742 m_slider = new QSlider(slmin, slmax, slstep, slvalue,
740 QSlider::Horizontal, this); 743 Qt::Horizontal, this);
741 m_slider->setTickmarks(QSlider::Below); 744 m_slider->setTickmarks(QSlider::Below);
742 // feedback line: when one moves, the other moves, too: 745 // feedback line: when one moves, the other moves, too:
743 connect(m_slider, SIGNAL(valueChanged(int)), 746 connect(m_slider, SIGNAL(valueChanged(int)),
744 SLOT(sliderMoved(int)) ); 747 SLOT(sliderMoved(int)) );
745 } 748 }
746 connect(spin, SIGNAL(valueChanged(int)), 749 connect(spin, SIGNAL(valueChanged(int)),
747 m_slider, SLOT(setValue(int)) ); 750 m_slider, SLOT(setValue(int)) );
748 // calculate ( slmax - slmin ) / 10 without overflowing ints: 751 // calculate ( slmax - slmin ) / 10 without overflowing ints:
749 int major = calcDiffByTen( slmax, slmin ); 752 int major = calcDiffByTen( slmax, slmin );
750 if ( !major ) major = slstep; // ### needed? 753 if ( !major ) major = slstep; // ### needed?
751 m_slider->setTickInterval(major); 754 m_slider->setTickInterval(major);
752 } else { 755 } else {
@@ -903,35 +906,35 @@ public:
903 906
904 double mapToDouble( int value ) const { 907 double mapToDouble( int value ) const {
905 return double(value) * basicStep(); 908 return double(value) * basicStep();
906 } 909 }
907 910
908 int mPrecision; 911 int mPrecision;
909 KDoubleValidator * mValidator; 912 KDoubleValidator * mValidator;
910}; 913};
911 914
912KDoubleSpinBox::KDoubleSpinBox( QWidget * parent, const char * name ) 915KDoubleSpinBox::KDoubleSpinBox( QWidget * parent, const char * name )
913 : QSpinBox( parent, name ) 916 : QSpinBox( parent, name )
914{ 917{
915 editor()->setAlignment( Qt::AlignRight ); 918 setAlignment( Qt::AlignRight );
916 d = new Private(); 919 d = new Private();
917 updateValidator(); 920 updateValidator();
918} 921}
919 922
920KDoubleSpinBox::KDoubleSpinBox( double lower, double upper, double step, 923KDoubleSpinBox::KDoubleSpinBox( double lower, double upper, double step,
921 double value, int precision, 924 double value, int precision,
922 QWidget * parent, const char * name ) 925 QWidget * parent, const char * name )
923 : QSpinBox( parent, name ) 926 : QSpinBox( parent, name )
924{ 927{
925 editor()->setAlignment( Qt::AlignRight ); 928 setAlignment( Qt::AlignRight );
926 d = new Private(); 929 d = new Private();
927 setRange( lower, upper, step, precision ); 930 setRange( lower, upper, step, precision );
928 setValue( value ); 931 setValue( value );
929 connect( this, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)) ); 932 connect( this, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)) );
930} 933}
931 934
932KDoubleSpinBox::~KDoubleSpinBox() { 935KDoubleSpinBox::~KDoubleSpinBox() {
933 delete d; d = 0; 936 delete d; d = 0;
934} 937}
935 938
936bool KDoubleSpinBox::acceptLocalizedNumbers() const { 939bool KDoubleSpinBox::acceptLocalizedNumbers() const {
937 if ( !d->mValidator ) return true; // we'll set one that does; 940 if ( !d->mValidator ) return true; // we'll set one that does;
@@ -1018,25 +1021,25 @@ double KDoubleSpinBox::maxValue() const {
1018 return d->mapToDouble( base::maxValue() ); 1021 return d->mapToDouble( base::maxValue() );
1019} 1022}
1020 1023
1021void KDoubleSpinBox::setMaxValue( double value ) { 1024void KDoubleSpinBox::setMaxValue( double value ) {
1022 bool ok = false; 1025 bool ok = false;
1023 int max = d->mapToInt( value, &ok ); 1026 int max = d->mapToInt( value, &ok );
1024 if ( !ok ) return; 1027 if ( !ok ) return;
1025 base::setMaxValue( max ); 1028 base::setMaxValue( max );
1026 updateValidator(); 1029 updateValidator();
1027} 1030}
1028 1031
1029double KDoubleSpinBox::lineStep() const { 1032double KDoubleSpinBox::lineStep() const {
1030 return d->mapToDouble( base::lineStep() ); 1033 return d->mapToDouble( base::singleStep() );
1031} 1034}
1032 1035
1033void KDoubleSpinBox::setLineStep( double step ) { 1036void KDoubleSpinBox::setLineStep( double step ) {
1034 bool ok = false; 1037 bool ok = false;
1035 if ( step > maxValue() - minValue() ) 1038 if ( step > maxValue() - minValue() )
1036 base::setLineStep( 1 ); 1039 base::setLineStep( 1 );
1037 else 1040 else
1038 base::setLineStep( kMax( d->mapToInt( step, &ok ), 1 ) ); 1041 base::setLineStep( kMax( d->mapToInt( step, &ok ), 1 ) );
1039} 1042}
1040 1043
1041QString KDoubleSpinBox::mapValueToText( int value ) { 1044QString KDoubleSpinBox::mapValueToText( int value ) {
1042 if ( acceptLocalizedNumbers() ) 1045 if ( acceptLocalizedNumbers() )
@@ -1063,25 +1066,25 @@ int KDoubleSpinBox::mapTextToValue( bool * ok ) {
1063void KDoubleSpinBox::setValidator( const QValidator * ) { 1066void KDoubleSpinBox::setValidator( const QValidator * ) {
1064 // silently discard the new validator. We don't want another one ;-) 1067 // silently discard the new validator. We don't want another one ;-)
1065} 1068}
1066 1069
1067void KDoubleSpinBox::slotValueChanged( int value ) { 1070void KDoubleSpinBox::slotValueChanged( int value ) {
1068 emit valueChanged( d->mapToDouble( value ) ); 1071 emit valueChanged( d->mapToDouble( value ) );
1069} 1072}
1070 1073
1071void KDoubleSpinBox::updateValidator() { 1074void KDoubleSpinBox::updateValidator() {
1072 if ( !d->mValidator ) { 1075 if ( !d->mValidator ) {
1073 d->mValidator = new KDoubleValidator( minValue(), maxValue(), precision(), 1076 d->mValidator = new KDoubleValidator( minValue(), maxValue(), precision(),
1074 this, "d->mValidator" ); 1077 this, "d->mValidator" );
1075 base::setValidator( d->mValidator ); 1078 lineEdit()->setValidator( d->mValidator );
1076 } else 1079 } else
1077 d->mValidator->setRange( minValue(), maxValue(), precision() ); 1080 d->mValidator->setRange( minValue(), maxValue(), precision() );
1078} 1081}
1079 1082
1080void KNumInput::virtual_hook( int, void* ) 1083void KNumInput::virtual_hook( int, void* )
1081{ /*BASE::virtual_hook( id, data );*/ } 1084{ /*BASE::virtual_hook( id, data );*/ }
1082 1085
1083void KIntNumInput::virtual_hook( int id, void* data ) 1086void KIntNumInput::virtual_hook( int id, void* data )
1084{ KNumInput::virtual_hook( id, data ); } 1087{ KNumInput::virtual_hook( id, data ); }
1085 1088
1086void KDoubleNumInput::virtual_hook( int id, void* data ) 1089void KDoubleNumInput::virtual_hook( int id, void* data )
1087{ KNumInput::virtual_hook( id, data ); } 1090{ KNumInput::virtual_hook( id, data ); }
diff --git a/microkde/kdeui/knuminput.h b/microkde/kdeui/knuminput.h
index 123fefa..9f9e200 100644
--- a/microkde/kdeui/knuminput.h
+++ b/microkde/kdeui/knuminput.h
@@ -20,24 +20,29 @@
20 * 20 *
21 * You should have received a copy of the GNU Library General Public License 21 * You should have received a copy of the GNU Library General Public License
22 * along with this library; see the file COPYING.LIB. If not, write to 22 * along with this library; see the file COPYING.LIB. If not, write to
23 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 * Boston, MA 02111-1307, USA. 24 * Boston, MA 02111-1307, USA.
25 */ 25 */
26 26
27#ifndef K_NUMINPUT_H 27#ifndef K_NUMINPUT_H
28#define K_NUMINPUT_H 28#define K_NUMINPUT_H
29 29
30#include <qwidget.h> 30#include <qwidget.h>
31#include <qspinbox.h> 31#include <qspinbox.h>
32#include <QLineEdit>
33//Added by qt3to4:
34#include <QResizeEvent>
35#include <QLabel>
36#include <QEvent>
32 37
33class QLabel; 38class QLabel;
34class QSlider; 39class QSlider;
35class QLineEdit; 40class QLineEdit;
36class QLayout; 41class QLayout;
37class QValidator; 42class QValidator;
38 43
39class KIntSpinBox; 44class KIntSpinBox;
40 45
41/* ------------------------------------------------------------------------ */ 46/* ------------------------------------------------------------------------ */
42 47
43/** 48/**
@@ -72,25 +77,25 @@ public:
72 * @param a one of @p AlignLeft, @p AlignHCenter, YAlignRight and 77 * @param a one of @p AlignLeft, @p AlignHCenter, YAlignRight and
73 * @p AlignTop, @p AlignVCenter, @p AlignBottom. 78 * @p AlignTop, @p AlignVCenter, @p AlignBottom.
74 * default is @p AlignLeft | @p AlignTop. 79 * default is @p AlignLeft | @p AlignTop.
75 * 80 *
76 * The vertical alignment flags have special meaning with this 81 * The vertical alignment flags have special meaning with this
77 * widget: 82 * widget:
78 * 83 *
79 * @li @p AlignTop The label is placed above the edit/slider 84 * @li @p AlignTop The label is placed above the edit/slider
80 * @li @p AlignVCenter The label is placed left beside the edit 85 * @li @p AlignVCenter The label is placed left beside the edit
81 * @li @p AlignBottom The label is placed below the edit/slider 86 * @li @p AlignBottom The label is placed below the edit/slider
82 * 87 *
83 */ 88 */
84 virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); 89 virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop);
85 90
86 /** 91 /**
87 * @return the text of the label. 92 * @return the text of the label.
88 */ 93 */
89 QString label() const; 94 QString label() const;
90 95
91 /** 96 /**
92 * @return if the num input has a slider. 97 * @return if the num input has a slider.
93 * @since 3.1 98 * @since 3.1
94 */ 99 */
95 bool showSlider() const { return m_slider; } 100 bool showSlider() const { return m_slider; }
96 101
@@ -293,25 +298,25 @@ public:
293 298
294 /** 299 /**
295 * Sets the special value text. If set, the SpinBox will display 300 * Sets the special value text. If set, the SpinBox will display
296 * this text instead of the numeric value whenever the current 301 * this text instead of the numeric value whenever the current
297 * value is equal to minVal(). Typically this is used for indicating 302 * value is equal to minVal(). Typically this is used for indicating
298 * that the choice has a special (default) meaning. 303 * that the choice has a special (default) meaning.
299 */ 304 */
300 void setSpecialValueText(const QString& text); 305 void setSpecialValueText(const QString& text);
301 306
302 /** 307 /**
303 * @reimplemented 308 * @reimplemented
304 */ 309 */
305 virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); 310 virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop);
306 311
307 /** 312 /**
308 * This method returns the minimum size necessary to display the 313 * This method returns the minimum size necessary to display the
309 * control. The minimum size is enough to show all the labels 314 * control. The minimum size is enough to show all the labels
310 * in the current font (font change may invalidate the return value). 315 * in the current font (font change may invalidate the return value).
311 * 316 *
312 * @return the minimum size necessary to show the control 317 * @return the minimum size necessary to show the control
313 */ 318 */
314 virtual QSize minimumSizeHint() const; 319 virtual QSize minimumSizeHint() const;
315 320
316public slots: 321public slots:
317 /** 322 /**
@@ -579,25 +584,25 @@ public:
579 584
580 /** 585 /**
581 * Sets the special value text. If set, the spin box will display 586 * Sets the special value text. If set, the spin box will display
582 * this text instead of the numeric value whenever the current 587 * this text instead of the numeric value whenever the current
583 * value is equal to @ref #minVal(). Typically this is used for indicating 588 * value is equal to @ref #minVal(). Typically this is used for indicating
584 * that the choice has a special (default) meaning. 589 * that the choice has a special (default) meaning.
585 */ 590 */
586 void setSpecialValueText(const QString& text); 591 void setSpecialValueText(const QString& text);
587 592
588 /** 593 /**
589 * @reimplemented 594 * @reimplemented
590 */ 595 */
591 virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); 596 virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop);
592 /** 597 /**
593 * @reimplemented 598 * @reimplemented
594 */ 599 */
595 virtual QSize minimumSizeHint() const; 600 virtual QSize minimumSizeHint() const;
596 /** 601 /**
597 * @reimplemented 602 * @reimplemented
598 */ 603 */
599 virtual bool eventFilter(QObject*, QEvent*); 604 virtual bool eventFilter(QObject*, QEvent*);
600 605
601public slots: 606public slots:
602 /** 607 /**
603 * Sets the value of the control. 608 * Sets the value of the control.
@@ -749,24 +754,28 @@ public:
749 */ 754 */
750 void setBase(int base); 755 void setBase(int base);
751 /** 756 /**
752 * @return the base in which numbers in the spin box are represented. 757 * @return the base in which numbers in the spin box are represented.
753 */ 758 */
754 int base() const; 759 int base() const;
755 /** 760 /**
756 * sets focus and optionally marks all text 761 * sets focus and optionally marks all text
757 * 762 *
758 */ 763 */
759 void setEditFocus(bool mark); 764 void setEditFocus(bool mark);
760 765
766 void setValidator(const QValidator *v) {
767 lineEdit()->setValidator(v);
768 }
769
761protected: 770protected:
762 771
763 /** 772 /**
764 * Overloaded the method in QSpinBox 773 * Overloaded the method in QSpinBox
765 * to make use of the base given in the constructor. 774 * to make use of the base given in the constructor.
766 */ 775 */
767 virtual QString mapValueToText(int); 776 virtual QString mapValueToText(int);
768 777
769 /** 778 /**
770 * Overloaded the method in QSpinBox 779 * Overloaded the method in QSpinBox
771 * to make use of the base given in the constructor. 780 * to make use of the base given in the constructor.
772 */ 781 */
diff --git a/microkde/kdeui/kpopupmenu.cpp b/microkde/kdeui/kpopupmenu.cpp
index 96d2a87..7e1503c 100644
--- a/microkde/kdeui/kpopupmenu.cpp
+++ b/microkde/kdeui/kpopupmenu.cpp
@@ -1,19 +1,22 @@
1 1
2#include <kpopupmenu.h> 2#include <kpopupmenu.h>
3#include <qtimer.h> 3#include <qtimer.h>
4//Added by qt3to4:
5#include <QFocusEvent>
6#include <Q3PopupMenu>
4 7
5 8
6KPopupMenu::KPopupMenu ( QWidget * parent, const char * name ) 9KPopupMenu::KPopupMenu ( QWidget * parent, const char * name )
7 : QPopupMenu ( parent, name ) {;} 10 : Q3PopupMenu ( parent, name ) {;}
8 11
9 12
10 13
11KMenuBar::KMenuBar ( QWidget * parent, const char * name ) 14KMenuBar::KMenuBar ( QWidget * parent, const char * name )
12 : QPEMenuBar ( parent, name ) {} 15 : QPEMenuBar ( parent, name ) {}
13 16
14void KMenuBar::focusOutEvent ( QFocusEvent * e) 17void KMenuBar::focusOutEvent ( QFocusEvent * e)
15{ 18{
16 QPEMenuBar::focusOutEvent( e ); 19 QPEMenuBar::focusOutEvent( e );
17 QTimer::singleShot( 100, this, SIGNAL ( lostFocus() ) ); 20 QTimer::singleShot( 100, this, SIGNAL ( lostFocus() ) );
18 21
19} 22}
diff --git a/microkde/kdeui/kpopupmenu.h b/microkde/kdeui/kpopupmenu.h
index fd00f36..1c903ad 100644
--- a/microkde/kdeui/kpopupmenu.h
+++ b/microkde/kdeui/kpopupmenu.h
@@ -1,24 +1,26 @@
1#ifndef KPOPUPMENU_H 1#ifndef KPOPUPMENU_H
2#define KPOPUPMENU_H 2#define KPOPUPMENU_H
3 3
4#include <qpopupmenu.h> 4#include <q3popupmenu.h>
5//Added by qt3to4:
6#include <QFocusEvent>
5#ifdef DESKTOP_VERSION 7#ifdef DESKTOP_VERSION
6#include <qmenubar.h> 8#include <qmenubar.h>
7#define QPEMenuBar QMenuBar 9#define QPEMenuBar QMenuBar
8#else 10#else
9#include <qpe/qpemenubar.h> 11#include <qpe/qpemenubar.h>
10#endif 12#endif
11 13
12class KPopupMenu : public QPopupMenu 14class KPopupMenu : public Q3PopupMenu
13{ 15{
14Q_OBJECT 16Q_OBJECT
15 public: 17 public:
16 KPopupMenu ( QWidget * parent=0, const char * name=0 ); 18 KPopupMenu ( QWidget * parent=0, const char * name=0 );
17 19
18}; 20};
19 21
20 22
21class KMenuBar : public QPEMenuBar 23class KMenuBar : public QPEMenuBar
22{ 24{
23Q_OBJECT 25Q_OBJECT
24 public: 26 public:
diff --git a/microkde/kdeui/kseparator.cpp b/microkde/kdeui/kseparator.cpp
index d028420..66000f0 100644
--- a/microkde/kdeui/kseparator.cpp
+++ b/microkde/kdeui/kseparator.cpp
@@ -9,68 +9,70 @@
9 * This program is distributed in the hope that it will be useful, 9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Library General Public License for more details. 12 * GNU Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 * 17 *
18 */ 18 */
19 19
20#include <qstyle.h> 20#include <qstyle.h>
21//Added by qt3to4:
22#include <Q3Frame>
21 23
22#include <kdebug.h> 24#include <kdebug.h>
23//US #include <kapplication.h> 25//US #include <kapplication.h>
24 26
25//US #include "kseparator.moc" 27//US #include "kseparator.moc"
26 28
27#include "kseparator.h" 29#include "kseparator.h"
28 30
29KSeparator::KSeparator(QWidget* parent, const char* name, WFlags f) 31KSeparator::KSeparator(QWidget* parent, const char* name, Qt::WFlags f)
30 : QFrame(parent, name, f) 32 : Q3Frame(parent, name, f)
31{ 33{
32 setLineWidth(1); 34 setLineWidth(1);
33 setMidLineWidth(0); 35 setMidLineWidth(0);
34 setOrientation( HLine ); 36 setOrientation( HLine );
35} 37}
36 38
37 39
38 40
39KSeparator::KSeparator(int orientation, QWidget* parent, const char* name, WFlags f) 41KSeparator::KSeparator(int orientation, QWidget* parent, const char* name, Qt::WFlags f)
40 : QFrame(parent, name, f) 42 : Q3Frame(parent, name, f)
41{ 43{
42 setLineWidth(1); 44 setLineWidth(1);
43 setMidLineWidth(0); 45 setMidLineWidth(0);
44 setOrientation( orientation ); 46 setOrientation( orientation );
45} 47}
46 48
47 49
48 50
49void KSeparator::setOrientation(int orientation) 51void KSeparator::setOrientation(int orientation)
50{ 52{
51 switch(orientation) 53 switch(orientation)
52 { 54 {
53 case Vertical: 55 case Qt::Vertical:
54 case VLine: 56 case VLine:
55 setFrameStyle( QFrame::VLine | QFrame::Sunken ); 57 setFrameStyle( Q3Frame::VLine | Q3Frame::Sunken );
56 setMinimumSize(2, 0); 58 setMinimumSize(2, 0);
57 break; 59 break;
58 60
59 default: 61 default:
60 kdWarning() << "KSeparator::setOrientation(): invalid orientation, using default orientation HLine" << endl; 62 kdWarning() << "KSeparator::setOrientation(): invalid orientation, using default orientation HLine" << endl;
61 63
62 case Horizontal: 64 case Qt::Horizontal:
63 case HLine: 65 case HLine:
64 setFrameStyle( QFrame::HLine | QFrame::Sunken ); 66 setFrameStyle( Q3Frame::HLine | Q3Frame::Sunken );
65 setMinimumSize(0, 2); 67 setMinimumSize(0, 2);
66 break; 68 break;
67 } 69 }
68} 70}
69 71
70 72
71 73
72int KSeparator::orientation() const 74int KSeparator::orientation() const
73{ 75{
74 if ( frameStyle() & VLine ) 76 if ( frameStyle() & VLine )
75 return VLine; 77 return VLine;
76 78
diff --git a/microkde/kdeui/kseparator.h b/microkde/kdeui/kseparator.h
index 6d2712a..c673475 100644
--- a/microkde/kdeui/kseparator.h
+++ b/microkde/kdeui/kseparator.h
@@ -11,49 +11,49 @@
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Library General Public License for more details. 12 * GNU Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 * 17 *
18 */ 18 */
19 19
20#ifndef __KSEPARATOR_H__ 20#ifndef __KSEPARATOR_H__
21#define __KSEPARATOR_H__ 21#define __KSEPARATOR_H__
22 22
23#include <qframe.h> 23#include <q3frame.h>
24 24
25/** 25/**
26 * Standard horizontal or vertical separator. 26 * Standard horizontal or vertical separator.
27 * 27 *
28 * @author Michael Roth <mroth@wirlweb.de> 28 * @author Michael Roth <mroth@wirlweb.de>
29 * @version $Id$ 29 * @version $Id$
30*/ 30*/
31class KSeparator : public QFrame 31class KSeparator : public Q3Frame
32{ 32{
33 Q_OBJECT 33 Q_OBJECT
34 Q_PROPERTY( int orientation READ orientation WRITE setOrientation ) 34 Q_PROPERTY( int orientation READ orientation WRITE setOrientation )
35 public: 35 public:
36 /** 36 /**
37 * Constructor. 37 * Constructor.
38 **/ 38 **/
39 KSeparator(QWidget* parent=0, const char* name=0, WFlags f=0); 39 KSeparator(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
40 /** 40 /**
41 * Constructor. 41 * Constructor.
42 * 42 *
43 * @param orientation Set the orientation of the separator. 43 * @param orientation Set the orientation of the separator.
44 * Possible values are HLine or Horizontal and VLine or Vertical. 44 * Possible values are HLine or Horizontal and VLine or Vertical.
45 **/ 45 **/
46 KSeparator(int orientation, QWidget* parent=0, const char* name=0, 46 KSeparator(int orientation, QWidget* parent=0, const char* name=0,
47 WFlags f=0); 47 Qt::WFlags f=0);
48 48
49 /** 49 /**
50 * Returns the orientation of the separator. 50 * Returns the orientation of the separator.
51 * 51 *
52 * Possible values are VLine and HLine. 52 * Possible values are VLine and HLine.
53 **/ 53 **/
54 int orientation() const; 54 int orientation() const;
55 55
56 /** 56 /**
57 * Set the orientation of the separator to @p orient 57 * Set the orientation of the separator to @p orient
58 * 58 *
59 * Possible values are VLine and HLine. 59 * Possible values are VLine and HLine.
diff --git a/microkde/kdeui/ksqueezedtextlabel.cpp b/microkde/kdeui/ksqueezedtextlabel.cpp
index 37fa29a..e2c61fd 100644
--- a/microkde/kdeui/ksqueezedtextlabel.cpp
+++ b/microkde/kdeui/ksqueezedtextlabel.cpp
@@ -9,24 +9,27 @@
9 but WITHOUT ANY WARRANTY; without even the implied warranty of 9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18 18
19#include "ksqueezedtextlabel.h" 19#include "ksqueezedtextlabel.h"
20#include <qtooltip.h> 20#include <qtooltip.h>
21//Added by qt3to4:
22#include <QResizeEvent>
23#include <QLabel>
21 24
22KSqueezedTextLabel::KSqueezedTextLabel( const QString &text , QWidget *parent, const char *name ) 25KSqueezedTextLabel::KSqueezedTextLabel( const QString &text , QWidget *parent, const char *name )
23 : QLabel ( parent, name ) { 26 : QLabel ( parent, name ) {
24 setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed )); 27 setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ));
25 fullText = text; 28 fullText = text;
26 squeezeTextToLabel(); 29 squeezeTextToLabel();
27} 30}
28 31
29KSqueezedTextLabel::KSqueezedTextLabel( QWidget *parent, const char *name ) 32KSqueezedTextLabel::KSqueezedTextLabel( QWidget *parent, const char *name )
30 : QLabel ( parent, name ) { 33 : QLabel ( parent, name ) {
31 setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed )); 34 setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ));
32} 35}
diff --git a/microkde/kdeui/ksqueezedtextlabel.h b/microkde/kdeui/ksqueezedtextlabel.h
index 1634adc..487d0b0 100644
--- a/microkde/kdeui/ksqueezedtextlabel.h
+++ b/microkde/kdeui/ksqueezedtextlabel.h
@@ -11,24 +11,26 @@
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18 18
19#ifndef KSQUEEZEDTEXTLABEL_H 19#ifndef KSQUEEZEDTEXTLABEL_H
20#define KSQUEEZEDTEXTLABEL_H 20#define KSQUEEZEDTEXTLABEL_H
21 21
22#include <qlabel.h> 22#include <qlabel.h>
23//Added by qt3to4:
24#include <QResizeEvent>
23 25
24/** 26/**
25 * A label class that squeezes its text into the label 27 * A label class that squeezes its text into the label
26 * 28 *
27 * If the text is too long to fit into the label it is divided into 29 * If the text is too long to fit into the label it is divided into
28 * remaining left and right parts which are separated by three dots. 30 * remaining left and right parts which are separated by three dots.
29 * 31 *
30 * Example: 32 * Example:
31 * http://www.kde.org/documentation/index.html could be squeezed to 33 * http://www.kde.org/documentation/index.html could be squeezed to
32 * http://www.kde...ion/index.html 34 * http://www.kde...ion/index.html
33 35
34 * @short A replacement for QLabel that squeezes its text 36 * @short A replacement for QLabel that squeezes its text
diff --git a/microkde/kdeui/kstdaction.cpp b/microkde/kdeui/kstdaction.cpp
index cfd7b54..f0d162d 100644
--- a/microkde/kdeui/kstdaction.cpp
+++ b/microkde/kdeui/kstdaction.cpp
@@ -10,25 +10,25 @@
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18 18
19#include "kstdaction.h" 19#include "kstdaction.h"
20 20
21#include <qtoolbutton.h> 21#include <qtoolbutton.h>
22#include <qwhatsthis.h> 22#include <q3whatsthis.h>
23 23
24//US #include <kaboutdata.h> 24//US #include <kaboutdata.h>
25#include <kaction.h> 25#include <kaction.h>
26#include <kapplication.h> 26#include <kapplication.h>
27#include <kdebug.h> 27#include <kdebug.h>
28#include <kglobal.h> 28#include <kglobal.h>
29#include <kiconloader.h> 29#include <kiconloader.h>
30#include <klocale.h> 30#include <klocale.h>
31//US #include <kstdaccel.h> 31//US #include <kstdaccel.h>
32//US #include <kmainwindow.h> 32//US #include <kmainwindow.h>
33 33
34namespace KStdAction 34namespace KStdAction
diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp
index 027e5e9..02db316 100644
--- a/microkde/kdeui/ktoolbar.cpp
+++ b/microkde/kdeui/ktoolbar.cpp
@@ -16,40 +16,51 @@
16 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details. 18 Library General Public License for more details.
19 19
20 You should have received a copy of the GNU Library General Public License 20 You should have received a copy of the GNU Library General Public License
21 along with this library; see the file COPYING.LIB. If not, write to 21 along with this library; see the file COPYING.LIB. If not, write to
22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. 23 Boston, MA 02111-1307, USA.
24*/ 24*/
25 25
26#ifdef KDE_USE_FINAL 26#ifdef KDE_USE_FINAL
27#undef Always 27#undef Always
28#include <qdockwindow.h> 28#include <q3dockwindow.h>
29#endif 29#endif
30 30//Added by qt3to4:
31#include <Q3ValueList>
32#include <Q3PtrList>
33#include <QPixmap>
34#include <Q3Frame>
35#include <QResizeEvent>
36#include <QMouseEvent>
37#include <QChildEvent>
38#include <QEvent>
39#include <QShowEvent>
40#include <QDesktopWidget>
41#include <QBoxLayout>
31 42
32 43
33#include "ktoolbar.h" 44#include "ktoolbar.h"
34#include "kmainwindow.h" 45#include "kmainwindow.h"
35 46
36#include <string.h> 47#include <string.h>
37 48
38#include <qpainter.h> 49#include <qpainter.h>
39#include <qtooltip.h> 50#include <qtooltip.h>
40#include <qdrawutil.h> 51#include <qdrawutil.h>
41#include <qstring.h> 52#include <qstring.h>
42#include <qrect.h> 53#include <qrect.h>
43#include <qobjectlist.h> 54#include <qobject.h>
44#include <qtimer.h> 55#include <qtimer.h>
45#include <qstyle.h> 56#include <qstyle.h>
46#include <qapplication.h> 57#include <qapplication.h>
47 58
48//US #include <config.h> 59//US #include <config.h>
49 60
50#include "klineedit.h" 61#include "klineedit.h"
51#include "kseparator.h" 62#include "kseparator.h"
52#include <klocale.h> 63#include <klocale.h>
53#include <kapplication.h> 64#include <kapplication.h>
54#include <kaction.h> 65#include <kaction.h>
55#include <kstdaction.h> 66#include <kstdaction.h>
@@ -60,26 +71,26 @@
60//US #include <kpopupmenu.h> 71//US #include <kpopupmenu.h>
61//US #include <kanimwidget.h> 72//US #include <kanimwidget.h>
62//US #include <kipc.h> 73//US #include <kipc.h>
63//US #include <kwin.h> 74//US #include <kwin.h>
64#include <kdebug.h> 75#include <kdebug.h>
65#include <qlayout.h> 76#include <qlayout.h>
66 77
67#include "ktoolbarbutton.h" 78#include "ktoolbarbutton.h"
68 79
69//US 80//US
70#include "kconfigbase.h" 81#include "kconfigbase.h"
71 82
72#include <qpopupmenu.h> 83#include <q3popupmenu.h>
73#include <qmainwindow.h> 84#include <q3mainwindow.h>
74 85
75enum { 86enum {
76 CONTEXT_TOP = 0, 87 CONTEXT_TOP = 0,
77 CONTEXT_LEFT = 1, 88 CONTEXT_LEFT = 1,
78 CONTEXT_RIGHT = 2, 89 CONTEXT_RIGHT = 2,
79 CONTEXT_BOTTOM = 3, 90 CONTEXT_BOTTOM = 3,
80 CONTEXT_FLOAT = 4, 91 CONTEXT_FLOAT = 4,
81 CONTEXT_FLAT = 5, 92 CONTEXT_FLAT = 5,
82 CONTEXT_ICONS = 6, 93 CONTEXT_ICONS = 6,
83 CONTEXT_TEXT = 7, 94 CONTEXT_TEXT = 7,
84 CONTEXT_TEXTRIGHT = 8, 95 CONTEXT_TEXTRIGHT = 8,
85 CONTEXT_TEXTUNDER = 9, 96 CONTEXT_TEXTUNDER = 9,
@@ -93,25 +104,25 @@ public:
93 m_iconSize = 0; 104 m_iconSize = 0;
94 m_iconText = KToolBar::IconOnly; 105 m_iconText = KToolBar::IconOnly;
95 m_highlight = true; 106 m_highlight = true;
96 m_transparent = true; 107 m_transparent = true;
97 m_honorStyle = false; 108 m_honorStyle = false;
98 109
99 m_enableContext = true; 110 m_enableContext = true;
100 111
101 m_xmlguiClient = 0; 112 m_xmlguiClient = 0;
102 m_configurePlugged = false; 113 m_configurePlugged = false;
103 114
104//US oldPos = Qt::DockUnmanaged; 115//US oldPos = Qt::DockUnmanaged;
105 oldPos = QMainWindow::Unmanaged; 116 oldPos = Qt::Unmanaged;
106 117
107 modified = m_isHorizontal = positioned = FALSE; 118 modified = m_isHorizontal = positioned = FALSE;
108 119
109 HiddenDefault = false; 120 HiddenDefault = false;
110 IconSizeDefault = 0; 121 IconSizeDefault = 0;
111 IconTextDefault = "IconOnly"; 122 IconTextDefault = "IconOnly";
112 IndexDefault = -1; 123 IndexDefault = -1;
113 NewLineDefault = false; 124 NewLineDefault = false;
114 OffsetDefault = -1; 125 OffsetDefault = -1;
115 PositionDefault = "Top"; 126 PositionDefault = "Top";
116 idleButtons.setAutoDelete(true); 127 idleButtons.setAutoDelete(true);
117 } 128 }
@@ -120,129 +131,129 @@ public:
120 KToolBar::IconText m_iconText; 131 KToolBar::IconText m_iconText;
121 bool m_highlight : 1; 132 bool m_highlight : 1;
122 bool m_transparent : 1; 133 bool m_transparent : 1;
123 bool m_honorStyle : 1; 134 bool m_honorStyle : 1;
124 bool m_isHorizontal : 1; 135 bool m_isHorizontal : 1;
125 bool m_enableContext : 1; 136 bool m_enableContext : 1;
126 bool m_configurePlugged : 1; 137 bool m_configurePlugged : 1;
127 bool modified : 1; 138 bool modified : 1;
128 bool positioned : 1; 139 bool positioned : 1;
129 140
130 QWidget *m_parent; 141 QWidget *m_parent;
131 142
132 QMainWindow::ToolBarDock oldPos; 143 Qt::ToolBarDock oldPos;
133 144
134 KXMLGUIClient *m_xmlguiClient; 145 KXMLGUIClient *m_xmlguiClient;
135 146
136 struct ToolBarInfo 147 struct ToolBarInfo
137 { 148 {
138//US ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( Qt::DockTop ) {} 149//US ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( Qt::DockTop ) {}
139 ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( QMainWindow::Top ) {} 150 ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( Qt::DockTop ) {}
140//US ToolBarInfo( Qt::Dock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} 151//US ToolBarInfo( Qt::Dock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {}
141 ToolBarInfo( QMainWindow::ToolBarDock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} 152 ToolBarInfo( Qt::ToolBarDock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {}
142 int index, offset; 153 int index, offset;
143 bool newline; 154 bool newline;
144//US Qt::Dock dock; 155//US Qt::Dock dock;
145 QMainWindow::ToolBarDock dock; 156 Qt::ToolBarDock dock;
146 }; 157 };
147 158
148 ToolBarInfo toolBarInfo; 159 ToolBarInfo toolBarInfo;
149 QValueList<int> iconSizes; 160 Q3ValueList<int> iconSizes;
150 QTimer repaintTimer; 161 QTimer repaintTimer;
151 162
152 // Default Values. 163 // Default Values.
153 bool HiddenDefault; 164 bool HiddenDefault;
154 int IconSizeDefault; 165 int IconSizeDefault;
155 QString IconTextDefault; 166 QString IconTextDefault;
156 int IndexDefault; 167 int IndexDefault;
157 bool NewLineDefault; 168 bool NewLineDefault;
158 int OffsetDefault; 169 int OffsetDefault;
159 QString PositionDefault; 170 QString PositionDefault;
160 171
161 QPtrList<QWidget> idleButtons; 172 Q3PtrList<QWidget> idleButtons;
162}; 173};
163 174
164KToolBarSeparator::KToolBarSeparator(Orientation o , bool l, QToolBar *parent, 175KToolBarSeparator::KToolBarSeparator(Qt::Orientation o , bool l, Q3ToolBar *parent,
165 const char* name ) 176 const char* name )
166 :QFrame( parent, name ), line( l ) 177 :Q3Frame( parent, name ), line( l )
167{ 178{
168 connect( parent, SIGNAL(orientationChanged(Orientation)), 179 connect( parent, SIGNAL(orientationChanged(Qt::Orientation)),
169 this, SLOT(setOrientation(Orientation)) ); 180 this, SLOT(setOrientation(Qt::Orientation)) );
170 setOrientation( o ); 181 setOrientation( o );
171 setBackgroundMode( parent->backgroundMode() ); 182 setBackgroundMode( parent->backgroundMode() );
172 setBackgroundOrigin( ParentOrigin ); 183 setBackgroundOrigin( ParentOrigin );
173} 184}
174 185
175void KToolBarSeparator::setOrientation( Orientation o ) 186void KToolBarSeparator::setOrientation( Qt::Orientation o )
176{ 187{
177 orient = o; 188 orient = o;
178 if ( line ) { 189 if ( line ) {
179 if ( orientation() == Vertical ) 190 if ( orientation() == Qt::Vertical )
180 setFrameStyle( HLine + Sunken ); 191 setFrameStyle( HLine + Sunken );
181 else 192 else
182 setFrameStyle( VLine + Sunken ); 193 setFrameStyle( VLine + Sunken );
183 } else { 194 } else {
184 setFrameStyle( NoFrame ); 195 setFrameStyle( NoFrame );
185 } 196 }
186} 197}
187 198
188void KToolBarSeparator::styleChange( QStyle& ) 199void KToolBarSeparator::styleChange( QStyle& )
189{ 200{
190 setOrientation( orient ); 201 setOrientation( orient );
191} 202}
192 203
193QSize KToolBarSeparator::sizeHint() const 204QSize KToolBarSeparator::sizeHint() const
194{ 205{
195 return orientation() == Vertical ? QSize( 0, 6 ) : QSize( 6, 0 ); 206 return orientation() == Qt::Vertical ? QSize( 0, 6 ) : QSize( 6, 0 );
196} 207}
197 208
198QSizePolicy KToolBarSeparator::sizePolicy() const 209QSizePolicy KToolBarSeparator::sizePolicy() const
199{ 210{
200 return QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); 211 return QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
201} 212}
202 213
203KToolBar::KToolBar( QWidget *parent, const char *name, bool honorStyle, bool readConfig ) 214KToolBar::KToolBar( QWidget *parent, const char *name, bool honorStyle, bool readConfig )
204#ifdef DESKTOP_VERSION 215#ifdef DESKTOP_VERSION
205 : QToolBar( QString::fromLatin1( name ), 216 : Q3ToolBar( QString::fromLatin1( name ),
206 parent && parent->inherits( "QMainWindow" ) ? static_cast<QMainWindow*>(parent) : 0, 217 parent && parent->inherits( "Q3MainWindow" ) ? static_cast<Q3MainWindow*>(parent) : 0,
207 parent, FALSE, 218 parent, FALSE,
208 name ? name : "mainToolBar") 219 name ? name : "mainToolBar")
209#else 220#else
210 : QPEToolBar( parent && parent->inherits( "QMainWindow" ) ? static_cast<QMainWindow*>(parent) : 0, 221 : QPEToolBar( parent && parent->inherits( "Q3MainWindow" ) ? static_cast<Q3MainWindow*>(parent) : 0,
211 QString::fromLatin1( name )) 222 QString::fromLatin1( name ))
212 223
213 224
214#endif 225#endif
215{ 226{
216 init( readConfig, honorStyle ); 227 init( readConfig, honorStyle );
217} 228}
218 229
219KToolBar::KToolBar( QMainWindow *parentWindow, QMainWindow::ToolBarDock dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) 230KToolBar::KToolBar( Q3MainWindow *parentWindow, Qt::ToolBarDock dock, bool newLine, const char *name, bool honorStyle, bool readConfig )
220#ifdef DESKTOP_VERSION 231#ifdef DESKTOP_VERSION
221 : QToolBar( QString::fromLatin1( name ), 232 : Q3ToolBar( QString::fromLatin1( name ),
222 parentWindow, dock, newLine, 233 parentWindow, dock, newLine,
223 name ? name : "mainToolBar") 234 name ? name : "mainToolBar")
224#else 235#else
225 : QPEToolBar( parentWindow,QString::fromLatin1( name )) 236 : QPEToolBar( parentWindow,QString::fromLatin1( name ))
226 237
227 238
228#endif 239#endif
229 240
230{ 241{
231 init( readConfig, honorStyle ); 242 init( readConfig, honorStyle );
232} 243}
233 244
234KToolBar::KToolBar( QMainWindow *parentWindow, QWidget *dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) 245KToolBar::KToolBar( Q3MainWindow *parentWindow, QWidget *dock, bool newLine, const char *name, bool honorStyle, bool readConfig )
235#ifdef DESKTOP_VERSION 246#ifdef DESKTOP_VERSION
236 : QToolBar( QString::fromLatin1( name ), 247 : Q3ToolBar( QString::fromLatin1( name ),
237 parentWindow, dock, newLine, 248 parentWindow, dock, newLine,
238 name ? name : "mainToolBar") 249 name ? name : "mainToolBar")
239#else 250#else
240 : QPEToolBar( parentWindow,QString::fromLatin1( name )) 251 : QPEToolBar( parentWindow,QString::fromLatin1( name ))
241 252
242 253
243#endif 254#endif
244 255
245{ 256{
246 init( readConfig, honorStyle ); 257 init( readConfig, honorStyle );
247} 258}
248 259
@@ -271,26 +282,26 @@ void KToolBar::init( bool readConfig, bool honorStyle )
271 if ( kapp ) { // may be null when started inside designer 282 if ( kapp ) { // may be null when started inside designer
272 connect(kapp, SIGNAL(toolbarAppearanceChanged(int)), this, SLOT(slotAppearanceChanged())); 283 connect(kapp, SIGNAL(toolbarAppearanceChanged(int)), this, SLOT(slotAppearanceChanged()));
273 // request notification of changes in icon style 284 // request notification of changes in icon style
274 kapp->addKipcEventMask(KIPC::IconChanged); 285 kapp->addKipcEventMask(KIPC::IconChanged);
275 connect(kapp, SIGNAL(iconChanged(int)), this, SLOT(slotIconChanged(int))); 286 connect(kapp, SIGNAL(iconChanged(int)), this, SLOT(slotIconChanged(int)));
276 } 287 }
277*/ 288*/
278 // finally, read in our configurable settings 289 // finally, read in our configurable settings
279 if ( readConfig ) 290 if ( readConfig )
280 slotReadConfig(); 291 slotReadConfig();
281 292
282 if ( mainWindow() ) 293 if ( mainWindow() )
283 connect( mainWindow(), SIGNAL( toolBarPositionChanged( QToolBar * ) ), 294 connect( mainWindow(), SIGNAL( toolBarPositionChanged( Q3ToolBar * ) ),
284 this, SLOT( toolBarPosChanged( QToolBar * ) ) ); 295 this, SLOT( toolBarPosChanged( Q3ToolBar * ) ) );
285 296
286 // Hack to make sure we recalculate our size when we dock. 297 // Hack to make sure we recalculate our size when we dock.
287//US connect( this, SIGNAL(placeChanged(QDockWindow::Place)), SLOT(rebuildLayout()) ); 298//US connect( this, SIGNAL(placeChanged(QDockWindow::Place)), SLOT(rebuildLayout()) );
288} 299}
289 300
290int KToolBar::insertButton(const QString& icon, int id, bool enabled, 301int KToolBar::insertButton(const QString& icon, int id, bool enabled,
291 const QString& text, int index/*US, KInstance *_instance*/ ) 302 const QString& text, int index/*US, KInstance *_instance*/ )
292{ 303{
293 KToolBarButton *button = new KToolBarButton( icon, id, this, 0, text/*US, _instance*/ ); 304 KToolBarButton *button = new KToolBarButton( icon, id, this, 0, text/*US, _instance*/ );
294 305
295 insertWidgetInternal( button, index, id ); 306 insertWidgetInternal( button, index, id );
296 button->setEnabled( enabled ); 307 button->setEnabled( enabled );
@@ -332,37 +343,37 @@ int KToolBar::insertButton(const QPixmap& pixmap, int id, const char *signal,
332 bool enabled, const QString& text, 343 bool enabled, const QString& text,
333 int index ) 344 int index )
334{ 345{
335 KToolBarButton *button = new KToolBarButton( pixmap, id, this, 0, text); 346 KToolBarButton *button = new KToolBarButton( pixmap, id, this, 0, text);
336 insertWidgetInternal( button, index, id ); 347 insertWidgetInternal( button, index, id );
337 button->setEnabled( enabled ); 348 button->setEnabled( enabled );
338 connect( button, signal, receiver, slot ); 349 connect( button, signal, receiver, slot );
339 doConnections( button ); 350 doConnections( button );
340 return index; 351 return index;
341} 352}
342 353
343 354
344int KToolBar::insertButton(const QString& icon, int id, QPopupMenu *popup, 355int KToolBar::insertButton(const QString& icon, int id, Q3PopupMenu *popup,
345 bool enabled, const QString &text, int index ) 356 bool enabled, const QString &text, int index )
346{ 357{
347 KToolBarButton *button = new KToolBarButton( icon, id, this, 0, text ); 358 KToolBarButton *button = new KToolBarButton( icon, id, this, 0, text );
348 insertWidgetInternal( button, index, id ); 359 insertWidgetInternal( button, index, id );
349 button->setEnabled( enabled ); 360 button->setEnabled( enabled );
350 button->setPopup( popup ); 361 button->setPopup( popup );
351 doConnections( button ); 362 doConnections( button );
352 return index; 363 return index;
353} 364}
354 365
355 366
356int KToolBar::insertButton(const QPixmap& pixmap, int id, QPopupMenu *popup, 367int KToolBar::insertButton(const QPixmap& pixmap, int id, Q3PopupMenu *popup,
357 bool enabled, const QString &text, int index ) 368 bool enabled, const QString &text, int index )
358{ 369{
359 KToolBarButton *button = new KToolBarButton( pixmap, id, this, 0, text ); 370 KToolBarButton *button = new KToolBarButton( pixmap, id, this, 0, text );
360 insertWidgetInternal( button, index, id ); 371 insertWidgetInternal( button, index, id );
361 button->setEnabled( enabled ); 372 button->setEnabled( enabled );
362 button->setPopup( popup ); 373 button->setPopup( popup );
363 doConnections( button ); 374 doConnections( button );
364 return index; 375 return index;
365} 376}
366 377
367 378
368int KToolBar::insertLined (const QString& text, int id, 379int KToolBar::insertLined (const QString& text, int id,
@@ -531,37 +542,37 @@ void KToolBar::setButtonPixmap( int id, const QPixmap& _pixmap )
531 542
532void KToolBar::setButtonIcon( int id, const QString& _icon ) 543void KToolBar::setButtonIcon( int id, const QString& _icon )
533{ 544{
534 Id2WidgetMap::Iterator it = id2widget.find( id ); 545 Id2WidgetMap::Iterator it = id2widget.find( id );
535 if ( it == id2widget.end() ) 546 if ( it == id2widget.end() )
536 return; 547 return;
537//US KToolBarButton * button = dynamic_cast<KToolBarButton *>( *it ); 548//US KToolBarButton * button = dynamic_cast<KToolBarButton *>( *it );
538 KToolBarButton * button = (KToolBarButton *)( *it ); 549 KToolBarButton * button = (KToolBarButton *)( *it );
539 if ( button ) 550 if ( button )
540 button->setIcon( _icon ); 551 button->setIcon( _icon );
541} 552}
542 553
543void KToolBar::setButtonIconSet( int id, const QIconSet& iconset ) 554void KToolBar::setButtonIconSet( int id, const QIcon& iconset )
544{ 555{
545 Id2WidgetMap::Iterator it = id2widget.find( id ); 556 Id2WidgetMap::Iterator it = id2widget.find( id );
546 if ( it == id2widget.end() ) 557 if ( it == id2widget.end() )
547 return; 558 return;
548//US KToolBarButton * button = dynamic_cast<KToolBarButton *>( *it ); 559//US KToolBarButton * button = dynamic_cast<KToolBarButton *>( *it );
549 KToolBarButton * button = (KToolBarButton *)( *it ); 560 KToolBarButton * button = (KToolBarButton *)( *it );
550 if ( button ) 561 if ( button )
551 button->setIconSet( iconset ); 562 button->setIconSet( iconset );
552} 563}
553 564
554 565
555void KToolBar::setDelayedPopup (int id , QPopupMenu *_popup, bool toggle ) 566void KToolBar::setDelayedPopup (int id , Q3PopupMenu *_popup, bool toggle )
556{ 567{
557 Id2WidgetMap::Iterator it = id2widget.find( id ); 568 Id2WidgetMap::Iterator it = id2widget.find( id );
558 if ( it == id2widget.end() ) 569 if ( it == id2widget.end() )
559 return; 570 return;
560//US KToolBarButton * button = dynamic_cast<KToolBarButton *>( *it ); 571//US KToolBarButton * button = dynamic_cast<KToolBarButton *>( *it );
561 KToolBarButton * button = (KToolBarButton *)( *it ); 572 KToolBarButton * button = (KToolBarButton *)( *it );
562 if ( button ) 573 if ( button )
563 button->setDelayedPopup( _popup, toggle ); 574 button->setDelayedPopup( _popup, toggle );
564} 575}
565 576
566 577
567void KToolBar::setAutoRepeat (int id, bool flag) 578void KToolBar::setAutoRepeat (int id, bool flag)
@@ -778,25 +789,25 @@ QWidget *KToolBar::getWidget (int id)
778 789
779 790
780void KToolBar::setItemAutoSized (int id, bool yes ) 791void KToolBar::setItemAutoSized (int id, bool yes )
781{ 792{
782 QWidget *w = getWidget(id); 793 QWidget *w = getWidget(id);
783 if ( w && yes ) 794 if ( w && yes )
784 setStretchableWidget( w ); 795 setStretchableWidget( w );
785} 796}
786 797
787 798
788void KToolBar::clear () 799void KToolBar::clear ()
789{ 800{
790 QToolBar::clear(); 801 Q3ToolBar::clear();
791 widget2id.clear(); 802 widget2id.clear();
792 id2widget.clear(); 803 id2widget.clear();
793} 804}
794 805
795 806
796void KToolBar::removeItem(int id) 807void KToolBar::removeItem(int id)
797{ 808{
798 Id2WidgetMap::Iterator it = id2widget.find( id ); 809 Id2WidgetMap::Iterator it = id2widget.find( id );
799 if ( it == id2widget.end() ) 810 if ( it == id2widget.end() )
800 { 811 {
801 kdDebug(220) << "KToolBar::removeItem item " << id << " not found" << endl; 812 kdDebug(220) << "KToolBar::removeItem item " << id << " not found" << endl;
802 return; 813 return;
@@ -867,39 +878,39 @@ bool KToolBar::fullSize() const
867void KToolBar::enableMoving(bool flag ) 878void KToolBar::enableMoving(bool flag )
868{ 879{
869//US setMovingEnabled(flag); 880//US setMovingEnabled(flag);
870 this->mainWindow()->setToolBarsMovable(flag); 881 this->mainWindow()->setToolBarsMovable(flag);
871} 882}
872 883
873 884
874void KToolBar::setBarPos (BarPosition bpos) 885void KToolBar::setBarPos (BarPosition bpos)
875{ 886{
876 if ( !mainWindow() ) 887 if ( !mainWindow() )
877 return; 888 return;
878//US mainWindow()->moveDockWindow( this, (Dock)bpos ); 889//US mainWindow()->moveDockWindow( this, (Dock)bpos );
879 mainWindow()->moveToolBar( this, (QMainWindow::ToolBarDock)bpos ); 890 mainWindow()->moveToolBar( this, (Qt::ToolBarDock)bpos );
880} 891}
881 892
882 893
883const KToolBar::BarPosition KToolBar::barPos() 894const KToolBar::BarPosition KToolBar::barPos()
884{ 895{
885 if ( !(QMainWindow*)mainWindow() ) 896 if ( !(Q3MainWindow*)mainWindow() )
886 return KToolBar::Top; 897 return KToolBar::Top;
887//US Dock dock; 898//US Dock dock;
888 QMainWindow::ToolBarDock dock; 899 Qt::ToolBarDock dock;
889 int dm1, dm2; 900 int dm1, dm2;
890 bool dm3; 901 bool dm3;
891 ((QMainWindow*)mainWindow())->getLocation( (QToolBar*)this, dock, dm1, dm3, dm2 ); 902 ((Q3MainWindow*)mainWindow())->getLocation( (Q3ToolBar*)this, dock, dm1, dm3, dm2 );
892//US if ( dock == DockUnmanaged ) { 903//US if ( dock == DockUnmanaged ) {
893 if ( dock == QMainWindow::Unmanaged ) { 904 if ( dock == Qt::Unmanaged ) {
894 return (KToolBar::BarPosition)Top; 905 return (KToolBar::BarPosition)Top;
895 } 906 }
896 return (BarPosition)dock; 907 return (BarPosition)dock;
897} 908}
898 909
899 910
900bool KToolBar::enable(BarStatus stat) 911bool KToolBar::enable(BarStatus stat)
901{ 912{
902 bool mystat = isVisible(); 913 bool mystat = isVisible();
903 914
904 if ( (stat == Toggle && mystat) || stat == Hide ) 915 if ( (stat == Toggle && mystat) || stat == Hide )
905 hide(); 916 hide();
@@ -958,25 +969,25 @@ void KToolBar::setIconText(IconText icontext, bool update)
958 d->m_iconText = icontext; 969 d->m_iconText = icontext;
959 doUpdate=true; 970 doUpdate=true;
960 } 971 }
961 972
962 if (update == false) 973 if (update == false)
963 return; 974 return;
964 975
965 if (doUpdate) 976 if (doUpdate)
966 emit modechange(); // tell buttons what happened 977 emit modechange(); // tell buttons what happened
967 978
968 // ugly hack to force a QMainWindow::triggerLayout( TRUE ) 979 // ugly hack to force a QMainWindow::triggerLayout( TRUE )
969 if ( mainWindow() ) { 980 if ( mainWindow() ) {
970 QMainWindow *mw = mainWindow(); 981 Q3MainWindow *mw = mainWindow();
971 mw->setUpdatesEnabled( FALSE ); 982 mw->setUpdatesEnabled( FALSE );
972 mw->setToolBarsMovable( !mw->toolBarsMovable() ); 983 mw->setToolBarsMovable( !mw->toolBarsMovable() );
973 mw->setToolBarsMovable( !mw->toolBarsMovable() ); 984 mw->setToolBarsMovable( !mw->toolBarsMovable() );
974 mw->setUpdatesEnabled( TRUE ); 985 mw->setUpdatesEnabled( TRUE );
975 } 986 }
976} 987}
977 988
978 989
979KToolBar::IconText KToolBar::iconText() const 990KToolBar::IconText KToolBar::iconText() const
980{ 991{
981 return d->m_iconText; 992 return d->m_iconText;
982} 993}
@@ -995,25 +1006,25 @@ void KToolBar::setIconSize(int size, bool update)
995 d->m_iconSize = size; 1006 d->m_iconSize = size;
996 doUpdate=true; 1007 doUpdate=true;
997 } 1008 }
998 1009
999 if (update == false) 1010 if (update == false)
1000 return; 1011 return;
1001 1012
1002 if (doUpdate) 1013 if (doUpdate)
1003 emit modechange(); // tell buttons what happened 1014 emit modechange(); // tell buttons what happened
1004 1015
1005 // ugly hack to force a QMainWindow::triggerLayout( TRUE ) 1016 // ugly hack to force a QMainWindow::triggerLayout( TRUE )
1006 if ( mainWindow() ) { 1017 if ( mainWindow() ) {
1007 QMainWindow *mw = mainWindow(); 1018 Q3MainWindow *mw = mainWindow();
1008 mw->setUpdatesEnabled( FALSE ); 1019 mw->setUpdatesEnabled( FALSE );
1009 mw->setToolBarsMovable( !mw->toolBarsMovable() ); 1020 mw->setToolBarsMovable( !mw->toolBarsMovable() );
1010 mw->setToolBarsMovable( !mw->toolBarsMovable() ); 1021 mw->setToolBarsMovable( !mw->toolBarsMovable() );
1011 mw->setUpdatesEnabled( TRUE ); 1022 mw->setUpdatesEnabled( TRUE );
1012 } 1023 }
1013} 1024}
1014 1025
1015 1026
1016int KToolBar::iconSize() const 1027int KToolBar::iconSize() const
1017{ 1028{
1018/*US 1029/*US
1019 if ( !d->m_iconSize ) // default value? 1030 if ( !d->m_iconSize ) // default value?
@@ -1053,28 +1064,28 @@ void KToolBar::setItemNoStyle(int id, bool no_style )
1053 KToolBarButton * button = (KToolBarButton *)( *it ); 1064 KToolBarButton * button = (KToolBarButton *)( *it );
1054 if (button) 1065 if (button)
1055 button->setNoStyle( no_style ); 1066 button->setNoStyle( no_style );
1056} 1067}
1057 1068
1058 1069
1059void KToolBar::setFlat (bool flag) 1070void KToolBar::setFlat (bool flag)
1060{ 1071{
1061 if ( !mainWindow() ) 1072 if ( !mainWindow() )
1062 return; 1073 return;
1063 if ( flag ) 1074 if ( flag )
1064//US mainWindow()->moveDockWindow( this, DockMinimized ); 1075//US mainWindow()->moveDockWindow( this, DockMinimized );
1065 mainWindow()->moveToolBar( this, QMainWindow::Minimized ); 1076 mainWindow()->moveToolBar( this, Qt::Minimized );
1066 else 1077 else
1067//US mainWindow()->moveDockWindow( this, DockTop ); 1078//US mainWindow()->moveDockWindow( this, DockTop );
1068 mainWindow()->moveToolBar( this, QMainWindow::Top ); 1079 mainWindow()->moveToolBar( this, Qt::Top );
1069 // And remember to save the new look later 1080 // And remember to save the new look later
1070/*US 1081/*US
1071 if ( mainWindow()->inherits( "KMainWindow" ) ) 1082 if ( mainWindow()->inherits( "KMainWindow" ) )
1072 static_cast<KMainWindow *>(mainWindow())->setSettingsDirty(); 1083 static_cast<KMainWindow *>(mainWindow())->setSettingsDirty();
1073*/ 1084*/
1074} 1085}
1075 1086
1076 1087
1077int KToolBar::count() const 1088int KToolBar::count() const
1078{ 1089{
1079 return id2widget.count(); 1090 return id2widget.count();
1080} 1091}
@@ -1240,52 +1251,52 @@ void KToolBar::doConnections( KToolBarButton *button )
1240 connect(button, SIGNAL(clicked(int)), this, SIGNAL( clicked( int ) ) ); 1251 connect(button, SIGNAL(clicked(int)), this, SIGNAL( clicked( int ) ) );
1241 connect(button, SIGNAL(doubleClicked(int)), this, SIGNAL( doubleClicked( int ) ) ); 1252 connect(button, SIGNAL(doubleClicked(int)), this, SIGNAL( doubleClicked( int ) ) );
1242 connect(button, SIGNAL(released(int)), this, SIGNAL( released( int ) ) ); 1253 connect(button, SIGNAL(released(int)), this, SIGNAL( released( int ) ) );
1243 connect(button, SIGNAL(pressed(int)), this, SIGNAL( pressed( int ) ) ); 1254 connect(button, SIGNAL(pressed(int)), this, SIGNAL( pressed( int ) ) );
1244 connect(button, SIGNAL(toggled(int)), this, SIGNAL( toggled( int ) ) ); 1255 connect(button, SIGNAL(toggled(int)), this, SIGNAL( toggled( int ) ) );
1245 connect(button, SIGNAL(highlighted(int, bool)), this, SIGNAL( highlighted( int, bool ) ) ); 1256 connect(button, SIGNAL(highlighted(int, bool)), this, SIGNAL( highlighted( int, bool ) ) );
1246} 1257}
1247 1258
1248void KToolBar::mousePressEvent ( QMouseEvent *m ) 1259void KToolBar::mousePressEvent ( QMouseEvent *m )
1249{ 1260{
1250 if ( !mainWindow() ) 1261 if ( !mainWindow() )
1251 return; 1262 return;
1252 QMainWindow *mw = mainWindow(); 1263 Q3MainWindow *mw = mainWindow();
1253 if ( mw->toolBarsMovable() && d->m_enableContext ) { 1264 if ( mw->toolBarsMovable() && d->m_enableContext ) {
1254 if ( m->button() == RightButton ) { 1265 if ( m->button() == Qt::RightButton ) {
1255 int i = contextMenu()->exec( m->globalPos(), 0 ); 1266 int i = contextMenu()->exec( m->globalPos(), 0 );
1256 switch ( i ) { 1267 switch ( i ) {
1257 case -1: 1268 case -1:
1258 return; // popup cancelled 1269 return; // popup cancelled
1259 case CONTEXT_LEFT: 1270 case CONTEXT_LEFT:
1260//US mw->moveDockWindow( this, DockLeft ); 1271//US mw->moveDockWindow( this, DockLeft );
1261 mw->moveToolBar( this, QMainWindow::Left ); 1272 mw->moveToolBar( this, Qt::Left );
1262 break; 1273 break;
1263 case CONTEXT_RIGHT: 1274 case CONTEXT_RIGHT:
1264//US mw->moveDockWindow( this, DockRight ); 1275//US mw->moveDockWindow( this, DockRight );
1265 mw->moveToolBar( this, QMainWindow::Right ); 1276 mw->moveToolBar( this, Qt::Right );
1266 break; 1277 break;
1267 case CONTEXT_TOP: 1278 case CONTEXT_TOP:
1268//US mw->moveDockWindow( this, DockTop ); 1279//US mw->moveDockWindow( this, DockTop );
1269 mw->moveToolBar( this, QMainWindow::Top ); 1280 mw->moveToolBar( this, Qt::Top );
1270 break; 1281 break;
1271 case CONTEXT_BOTTOM: 1282 case CONTEXT_BOTTOM:
1272//US mw->moveDockWindow( this, DockBottom ); 1283//US mw->moveDockWindow( this, DockBottom );
1273 mw->moveToolBar( this, QMainWindow::Bottom ); 1284 mw->moveToolBar( this, Qt::Bottom );
1274 break; 1285 break;
1275 case CONTEXT_FLOAT: 1286 case CONTEXT_FLOAT:
1276 break; 1287 break;
1277 case CONTEXT_FLAT: 1288 case CONTEXT_FLAT:
1278//US mw->moveDockWindow( this, DockMinimized ); 1289//US mw->moveDockWindow( this, DockMinimized );
1279 mw->moveToolBar( this, QMainWindow::Minimized ); 1290 mw->moveToolBar( this, Qt::Minimized );
1280 break; 1291 break;
1281 case CONTEXT_ICONS: 1292 case CONTEXT_ICONS:
1282 setIconText( IconOnly ); 1293 setIconText( IconOnly );
1283 break; 1294 break;
1284 case CONTEXT_TEXTRIGHT: 1295 case CONTEXT_TEXTRIGHT:
1285 setIconText( IconTextRight ); 1296 setIconText( IconTextRight );
1286 break; 1297 break;
1287 case CONTEXT_TEXT: 1298 case CONTEXT_TEXT:
1288 setIconText( TextOnly ); 1299 setIconText( TextOnly );
1289 break; 1300 break;
1290 case CONTEXT_TEXTUNDER: 1301 case CONTEXT_TEXTUNDER:
1291 setIconText( IconTextBottom ); 1302 setIconText( IconTextBottom );
@@ -1323,25 +1334,25 @@ void KToolBar::rebuildLayout()
1323 it.deleteCurrent(); 1334 it.deleteCurrent();
1324 } 1335 }
1325 for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { 1336 for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
1326 if ( w == rightAligned ) { 1337 if ( w == rightAligned ) {
1327 continue; 1338 continue;
1328 } 1339 }
1329 if ( w->inherits( "KToolBarSeparator" ) && 1340 if ( w->inherits( "KToolBarSeparator" ) &&
1330 !( (KToolBarSeparator*)w )->showLine() ) { 1341 !( (KToolBarSeparator*)w )->showLine() ) {
1331 l->addSpacing( 6 ); 1342 l->addSpacing( 6 );
1332 w->hide(); 1343 w->hide();
1333 continue; 1344 continue;
1334 } 1345 }
1335 if ( w->inherits( "QPopupMenu" ) ) 1346 if ( w->inherits( "Q3PopupMenu" ) )
1336 continue; 1347 continue;
1337 l->addWidget( w ); 1348 l->addWidget( w );
1338 w->show(); 1349 w->show();
1339 } 1350 }
1340 if ( rightAligned ) { 1351 if ( rightAligned ) {
1341 l->addStretch(); 1352 l->addStretch();
1342 l->addWidget( rightAligned ); 1353 l->addWidget( rightAligned );
1343 rightAligned->show(); 1354 rightAligned->show();
1344 } 1355 }
1345 1356
1346 if ( fullSize() ) { 1357 if ( fullSize() ) {
1347 // This code sucks. It makes the last combo in a toolbar VERY big (e.g. zoom combo in kword). 1358 // This code sucks. It makes the last combo in a toolbar VERY big (e.g. zoom combo in kword).
@@ -1355,103 +1366,103 @@ void KToolBar::rebuildLayout()
1355 } 1366 }
1356 l->invalidate(); 1367 l->invalidate();
1357 QApplication::postEvent( this, new QEvent( QEvent::LayoutHint ) ); 1368 QApplication::postEvent( this, new QEvent( QEvent::LayoutHint ) );
1358 //#endif //DESKTOP_VERSION 1369 //#endif //DESKTOP_VERSION
1359} 1370}
1360 1371
1361void KToolBar::childEvent( QChildEvent *e ) 1372void KToolBar::childEvent( QChildEvent *e )
1362{ 1373{
1363 1374
1364 if ( e->child()->isWidgetType() ) { 1375 if ( e->child()->isWidgetType() ) {
1365 QWidget * w = (QWidget*)e->child(); 1376 QWidget * w = (QWidget*)e->child();
1366 if ( e->type() == QEvent::ChildInserted ) { 1377 if ( e->type() == QEvent::ChildInserted ) {
1367 if ( !e->child()->inherits( "QPopupMenu" ) && 1378 if ( !e->child()->inherits( "Q3PopupMenu" ) &&
1368 ::qstrcmp( "qt_dockwidget_internal", e->child()->name() ) != 0 ) { 1379 ::qstrcmp( "qt_dockwidget_internal", e->child()->name() ) != 0 ) {
1369 1380
1370 // prevent items that have been explicitly inserted by insert*() from 1381 // prevent items that have been explicitly inserted by insert*() from
1371 // being inserted again 1382 // being inserted again
1372 if ( !widget2id.contains( w ) ) 1383 if ( !widget2id.contains( w ) )
1373 { 1384 {
1374 int dummy = -1; 1385 int dummy = -1;
1375 insertWidgetInternal( w, dummy, -1 ); 1386 insertWidgetInternal( w, dummy, -1 );
1376 } 1387 }
1377 } 1388 }
1378 } else { 1389 } else if( e->type() == QEvent::ChildRemoved ) {
1379 removeWidgetInternal( w ); 1390 removeWidgetInternal( w );
1380 } 1391 }
1381 if ( isVisibleTo( 0 ) ) 1392 /* TODO:hacker: if ( isVisibleTo( 0 ) )
1382 { 1393 {
1383 QBoxLayout *l = boxLayout(); 1394 QBoxLayout *l = boxLayout();
1384 // QLayout *l = layout(); 1395 // QLayout *l = layout();
1385 1396
1386 // clear the old layout so that we don't get unnecassery layout 1397 // clear the old layout so that we don't get unnecassery layout
1387 // changes till we have rebuild the thing 1398 // changes till we have rebuild the thing
1388 QLayoutIterator it = l->iterator(); 1399 QLayoutIterator it = l->iterator();
1389 while ( it.current() ) { 1400 while ( it.current() ) {
1390 it.deleteCurrent(); 1401 it.deleteCurrent();
1391 } 1402 }
1392 layoutTimer->start( 50, TRUE ); 1403 layoutTimer->start( 50, TRUE );
1393 } 1404 } */
1394 } 1405 }
1395 QToolBar::childEvent( e ); 1406 Q3ToolBar::childEvent( e );
1396} 1407}
1397 1408
1398void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id ) 1409void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id )
1399{ 1410{
1400 // we can't have it in widgets, or something is really wrong 1411 // we can't have it in widgets, or something is really wrong
1401 //widgets.removeRef( w ); 1412 //widgets.removeRef( w );
1402 1413
1403 connect( w, SIGNAL( destroyed() ), 1414 connect( w, SIGNAL( destroyed() ),
1404 this, SLOT( widgetDestroyed() ) ); 1415 this, SLOT( widgetDestroyed() ) );
1405 if ( index == -1 || index > (int)widgets.count() ) { 1416 if ( index == -1 || index > (int)widgets.count() ) {
1406 widgets.append( w ); 1417 widgets.append( w );
1407 index = (int)widgets.count(); 1418 index = (int)widgets.count();
1408 } 1419 }
1409 else 1420 else
1410 widgets.insert( index, w ); 1421 widgets.insert( index, w );
1411 if ( id == -1 ) 1422 if ( id == -1 )
1412 id = id2widget.count(); 1423 id = id2widget.count();
1413 id2widget.insert( id, w ); 1424 id2widget.insert( id, w );
1414 widget2id.insert( w, id ); 1425 widget2id.insert( w, id );
1415} 1426}
1416void KToolBar::repaintMe() 1427void KToolBar::repaintMe()
1417{ 1428{
1418 setUpdatesEnabled( true ); 1429 setUpdatesEnabled( true );
1419 QToolBar::repaint( true ); 1430 Q3ToolBar::repaint( true );
1420 qDebug(" KToolBar::repaintMe() "); 1431 qDebug(" KToolBar::repaintMe() ");
1421} 1432}
1422 1433
1423void KToolBar::showEvent( QShowEvent *e ) 1434void KToolBar::showEvent( QShowEvent *e )
1424{ 1435{
1425 rebuildLayout(); 1436 rebuildLayout();
1426 QToolBar::showEvent( e ); 1437 Q3ToolBar::showEvent( e );
1427} 1438}
1428 1439
1429void KToolBar::setStretchableWidget( QWidget *w ) 1440void KToolBar::setStretchableWidget( QWidget *w )
1430{ 1441{
1431 QToolBar::setStretchableWidget( w ); 1442 Q3ToolBar::setStretchableWidget( w );
1432 stretchableWidget = w; 1443 stretchableWidget = w;
1433} 1444}
1434 1445
1435QSizePolicy KToolBar::sizePolicy() const 1446QSizePolicy KToolBar::sizePolicy() const
1436{ 1447{
1437 if ( orientation() == Horizontal ) 1448 if ( orientation() == Qt::Horizontal )
1438 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); 1449 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
1439 else 1450 else
1440 return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ); 1451 return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding );
1441} 1452}
1442 1453
1443QSize KToolBar::sizeHint() const 1454QSize KToolBar::sizeHint() const
1444{ 1455{
1445 QSize sh = QToolBar::sizeHint(); 1456 QSize sh = Q3ToolBar::sizeHint();
1446 //qDebug("%x KToolBar::sizeHint() %d %d ",this, QToolBar::sizeHint().width(),QToolBar::sizeHint().height() ); 1457 //qDebug("%x KToolBar::sizeHint() %d %d ",this, QToolBar::sizeHint().width(),QToolBar::sizeHint().height() );
1447 if ( sh.height() <= 20 || sh.width() < 60 ) 1458 if ( sh.height() <= 20 || sh.width() < 60 )
1448 return QSize( sizeHintW, sizeHintH ); 1459 return QSize( sizeHintW, sizeHintH );
1449 KToolBar* ttt = (KToolBar*) this; 1460 KToolBar* ttt = (KToolBar*) this;
1450 ttt->sizeHintW = sh.width(); 1461 ttt->sizeHintW = sh.width();
1451 ttt->sizeHintH = sh.height(); 1462 ttt->sizeHintH = sh.height();
1452 return sh; 1463 return sh;
1453 //return QToolBar::sizeHint(); 1464 //return QToolBar::sizeHint();
1454#if 0 1465#if 0
1455 QWidget::polish(); 1466 QWidget::polish();
1456 static int iii = 0; 1467 static int iii = 0;
1457 ++iii; 1468 ++iii;
@@ -1499,61 +1510,61 @@ QSize KToolBar::sizeHint() const
1499 sh = w->minimumSize(); 1510 sh = w->minimumSize();
1500 minSize = minSize.expandedTo(QSize(sh.width(), 0)); 1511 minSize = minSize.expandedTo(QSize(sh.width(), 0));
1501 minSize += QSize(0, sh.height()+1); 1512 minSize += QSize(0, sh.height()+1);
1502 } 1513 }
1503 } 1514 }
1504/*US 1515/*US
1505 minSize += QSize(0, QApplication::style().pixelMetric( QStyle::PM_DockWindowHandleExtent )); 1516 minSize += QSize(0, QApplication::style().pixelMetric( QStyle::PM_DockWindowHandleExtent ));
1506*/ 1517*/
1507 minSize += QSize(margin*2, margin*2); 1518 minSize += QSize(margin*2, margin*2);
1508 break; 1519 break;
1509 1520
1510 default: 1521 default:
1511 minSize = QToolBar::sizeHint(); 1522 minSize = Q3ToolBar::sizeHint();
1512 break; 1523 break;
1513 } 1524 }
1514 return minSize; 1525 return minSize;
1515#endif 1526#endif
1516} 1527}
1517 1528
1518QSize KToolBar::minimumSize() const 1529QSize KToolBar::minimumSize() const
1519{ 1530{
1520 return minimumSizeHint(); 1531 return minimumSizeHint();
1521} 1532}
1522 1533
1523QSize KToolBar::minimumSizeHint() const 1534QSize KToolBar::minimumSizeHint() const
1524{ 1535{
1525 return sizeHint(); 1536 return sizeHint();
1526} 1537}
1527 1538
1528bool KToolBar::highlight() const 1539bool KToolBar::highlight() const
1529{ 1540{
1530 return d->m_highlight; 1541 return d->m_highlight;
1531} 1542}
1532 1543
1533void KToolBar::hide() 1544void KToolBar::hide()
1534{ 1545{
1535 QToolBar::hide(); 1546 Q3ToolBar::hide();
1536} 1547}
1537 1548
1538void KToolBar::show() 1549void KToolBar::show()
1539{ 1550{
1540 QToolBar::show(); 1551 Q3ToolBar::show();
1541} 1552}
1542 1553
1543void KToolBar::resizeEvent( QResizeEvent *e ) 1554void KToolBar::resizeEvent( QResizeEvent *e )
1544{ 1555{
1545 bool b = isUpdatesEnabled(); 1556 bool b = isUpdatesEnabled();
1546 setUpdatesEnabled( FALSE ); 1557 setUpdatesEnabled( FALSE );
1547 QToolBar::resizeEvent( e ); 1558 Q3ToolBar::resizeEvent( e );
1548 if (b) 1559 if (b)
1549 d->repaintTimer.start( 100, true ); 1560 d->repaintTimer.start( 100, true );
1550} 1561}
1551 1562
1552void KToolBar::slotIconChanged(int group) 1563void KToolBar::slotIconChanged(int group)
1553{ 1564{
1554 if ((group != KIcon::Toolbar) && (group != KIcon::MainToolbar)) 1565 if ((group != KIcon::Toolbar) && (group != KIcon::MainToolbar))
1555 return; 1566 return;
1556 if ((group == KIcon::MainToolbar) != !::qstrcmp(name(), "mainToolBar")) 1567 if ((group == KIcon::MainToolbar) != !::qstrcmp(name(), "mainToolBar"))
1557 return; 1568 return;
1558 1569
1559 emit modechange(); 1570 emit modechange();
@@ -1717,25 +1728,25 @@ void KToolBar::applyAppearanceSettings(KConfig *config, const QString &_configGr
1717 if (icon_text != d->m_iconText) { 1728 if (icon_text != d->m_iconText) {
1718 //kdDebug(220) << "KToolBar::applyAppearanceSettings setIconText " << icon_text << endl; 1729 //kdDebug(220) << "KToolBar::applyAppearanceSettings setIconText " << icon_text << endl;
1719 setIconText(icon_text, false); 1730 setIconText(icon_text, false);
1720 doUpdate = true; 1731 doUpdate = true;
1721 } 1732 }
1722 1733
1723 // ...and check if the icon size has changed 1734 // ...and check if the icon size has changed
1724 if (iconsize != d->m_iconSize) { 1735 if (iconsize != d->m_iconSize) {
1725 setIconSize(iconsize, false); 1736 setIconSize(iconsize, false);
1726 doUpdate = true; 1737 doUpdate = true;
1727 } 1738 }
1728 1739
1729 QMainWindow *mw = mainWindow(); 1740 Q3MainWindow *mw = mainWindow();
1730 1741
1731 // ...and if we should highlight 1742 // ...and if we should highlight
1732 if ( highlight != d->m_highlight ) { 1743 if ( highlight != d->m_highlight ) {
1733 d->m_highlight = highlight; 1744 d->m_highlight = highlight;
1734 doUpdate = true; 1745 doUpdate = true;
1735 } 1746 }
1736 1747
1737 // ...and if we should move transparently 1748 // ...and if we should move transparently
1738 if ( mw && transparent != (!mw->opaqueMoving()) ) { 1749 if ( mw && transparent != (!mw->opaqueMoving()) ) {
1739 mw->setOpaqueMoving( !transparent ); 1750 mw->setOpaqueMoving( !transparent );
1740 } 1751 }
1741 1752
@@ -1796,47 +1807,47 @@ void KToolBar::applySettings(KConfig *config, const QString &_configGroup)
1796 pos = DockTop; 1807 pos = DockTop;
1797 else if ( position == "Bottom" ) 1808 else if ( position == "Bottom" )
1798 pos = DockBottom; 1809 pos = DockBottom;
1799 else if ( position == "Left" ) 1810 else if ( position == "Left" )
1800 pos = DockLeft; 1811 pos = DockLeft;
1801 else if ( position == "Right" ) 1812 else if ( position == "Right" )
1802 pos = DockRight; 1813 pos = DockRight;
1803 else if ( position == "Floating" ) 1814 else if ( position == "Floating" )
1804 pos = DockTornOff; 1815 pos = DockTornOff;
1805 else if ( position == "Flat" ) 1816 else if ( position == "Flat" )
1806 pos = DockMinimized; 1817 pos = DockMinimized;
1807*/ 1818*/
1808 QMainWindow::ToolBarDock pos(QMainWindow::Top); 1819 Qt::ToolBarDock pos(Qt::DockTop);
1809 if ( position == "Top" ) 1820 if ( position == "Top" )
1810 pos = QMainWindow::Top; 1821 pos = Qt::Top;
1811 else if ( position == "Bottom" ) 1822 else if ( position == "Bottom" )
1812 pos = QMainWindow::Bottom; 1823 pos = Qt::Bottom;
1813 else if ( position == "Left" ) 1824 else if ( position == "Left" )
1814 pos = QMainWindow::Left; 1825 pos = Qt::Left;
1815 else if ( position == "Right" ) 1826 else if ( position == "Right" )
1816 pos = QMainWindow::Right; 1827 pos = Qt::Right;
1817 else if ( position == "Floating" ) 1828 else if ( position == "Floating" )
1818 pos = QMainWindow::TornOff; 1829 pos = Qt::TornOff;
1819 else if ( position == "Flat" ) 1830 else if ( position == "Flat" )
1820 pos = QMainWindow::Minimized; 1831 pos = Qt::Minimized;
1821 1832
1822 //kdDebug(220) << "KToolBar::applySettings hidden=" << hidden << endl; 1833 //kdDebug(220) << "KToolBar::applySettings hidden=" << hidden << endl;
1823 if (hidden) 1834 if (hidden)
1824 hide(); 1835 hide();
1825 else 1836 else
1826 show(); 1837 show();
1827 1838
1828 if ( mainWindow() ) 1839 if ( mainWindow() )
1829 { 1840 {
1830 QMainWindow *mw = mainWindow(); 1841 Q3MainWindow *mw = mainWindow();
1831 1842
1832 //kdDebug(220) << "KToolBar::applySettings updating ToolbarInfo" << endl; 1843 //kdDebug(220) << "KToolBar::applySettings updating ToolbarInfo" << endl;
1833 d->toolBarInfo = KToolBarPrivate::ToolBarInfo( pos, index, newLine, offset ); 1844 d->toolBarInfo = KToolBarPrivate::ToolBarInfo( pos, index, newLine, offset );
1834 1845
1835 // moveDockWindow calls QDockArea which does a reparent() on us with 1846 // moveDockWindow calls QDockArea which does a reparent() on us with
1836 // showIt = true, so we loose our visibility status 1847 // showIt = true, so we loose our visibility status
1837 bool doHide = isHidden(); 1848 bool doHide = isHidden();
1838 1849
1839//US mw->moveDockWindow( this, pos, newLine, index, offset ); 1850//US mw->moveDockWindow( this, pos, newLine, index, offset );
1840 mw->moveToolBar( this, pos, newLine, index, offset ); 1851 mw->moveToolBar( this, pos, newLine, index, offset );
1841 1852
1842 //kdDebug(220) << "KToolBar::applySettings " << name() << " moveDockWindow with pos=" << pos << " newLine=" << newLine << " idx=" << index << " offs=" << offset << endl; 1853 //kdDebug(220) << "KToolBar::applySettings " << name() << " moveDockWindow with pos=" << pos << " newLine=" << newLine << " idx=" << index << " offs=" << offset << endl;
@@ -1853,50 +1864,50 @@ bool KToolBar::event( QEvent *e )
1853 if ( (e->type() == QEvent::LayoutHint) && isUpdatesEnabled() ) 1864 if ( (e->type() == QEvent::LayoutHint) && isUpdatesEnabled() )
1854 d->repaintTimer.start( 100, true ); 1865 d->repaintTimer.start( 100, true );
1855 1866
1856 if (e->type() == QEvent::ChildInserted ) 1867 if (e->type() == QEvent::ChildInserted )
1857 { 1868 {
1858 // By pass QToolBar::event, 1869 // By pass QToolBar::event,
1859 // it will show() the inserted child and we don't want to 1870 // it will show() the inserted child and we don't want to
1860 // do that until we have rebuild the layout. 1871 // do that until we have rebuild the layout.
1861 childEvent((QChildEvent *)e); 1872 childEvent((QChildEvent *)e);
1862 return true; 1873 return true;
1863 } 1874 }
1864 1875
1865 return QToolBar::event( e ); 1876 return Q3ToolBar::event( e );
1866} 1877}
1867 1878
1868void KToolBar::slotRepaint() 1879void KToolBar::slotRepaint()
1869{ 1880{
1870 setUpdatesEnabled( FALSE ); 1881 setUpdatesEnabled( FALSE );
1871 // Send a resizeEvent to update the "toolbar extension arrow" 1882 // Send a resizeEvent to update the "toolbar extension arrow"
1872 // (The button you get when your toolbar-items don't fit in 1883 // (The button you get when your toolbar-items don't fit in
1873 // the available space) 1884 // the available space)
1874 QResizeEvent ev(size(), size()); 1885 QResizeEvent ev(size(), size());
1875 resizeEvent(&ev); 1886 resizeEvent(&ev);
1876 //#ifdef DESKTOP_VERSION 1887 //#ifdef DESKTOP_VERSION
1877 QApplication::sendPostedEvents( this, QEvent::LayoutHint ); 1888 QApplication::sendPostedEvents( this, QEvent::LayoutHint );
1878 //#endif //DESKTOP_VERSION 1889 //#endif //DESKTOP_VERSION
1879 setUpdatesEnabled( TRUE ); 1890 setUpdatesEnabled( TRUE );
1880 repaint( TRUE ); 1891 repaint( TRUE );
1881} 1892}
1882 1893
1883void KToolBar::toolBarPosChanged( QToolBar *tb ) 1894void KToolBar::toolBarPosChanged( Q3ToolBar *tb )
1884{ 1895{
1885 if ( tb != this ) 1896 if ( tb != this )
1886 return; 1897 return;
1887//US if ( d->oldPos == DockMinimized ) 1898//US if ( d->oldPos == DockMinimized )
1888 if ( d->oldPos == QMainWindow::Minimized ) 1899 if ( d->oldPos == Qt::Minimized )
1889 rebuildLayout(); 1900 rebuildLayout();
1890 d->oldPos = (QMainWindow::ToolBarDock)barPos(); 1901 d->oldPos = (Qt::ToolBarDock)barPos();
1891/*US 1902/*US
1892 if ( mainWindow() && mainWindow()->inherits( "KMainWindow" ) ) 1903 if ( mainWindow() && mainWindow()->inherits( "KMainWindow" ) )
1893 static_cast<KMainWindow *>(mainWindow())->setSettingsDirty(); 1904 static_cast<KMainWindow *>(mainWindow())->setSettingsDirty();
1894*/ 1905*/
1895} 1906}
1896 1907
1897/*US 1908/*US
1898void KToolBar::loadState( const QDomElement &element ) 1909void KToolBar::loadState( const QDomElement &element )
1899{ 1910{
1900 //kdDebug(220) << "KToolBar::loadState " << this << endl; 1911 //kdDebug(220) << "KToolBar::loadState " << this << endl;
1901 if ( !mainWindow() ) 1912 if ( !mainWindow() )
1902 return; 1913 return;
@@ -2022,25 +2033,25 @@ void KToolBar::getAttributes( QString &position, QString &icontext, int &index )
2022 position = "Right"; 2033 position = "Right";
2023 break; 2034 break;
2024 case KToolBar::Floating: 2035 case KToolBar::Floating:
2025 position = "Floating"; 2036 position = "Floating";
2026 break; 2037 break;
2027 case KToolBar::Top: 2038 case KToolBar::Top:
2028 default: 2039 default:
2029 position = "Top"; 2040 position = "Top";
2030 break; 2041 break;
2031 } 2042 }
2032 2043
2033 if ( mainWindow() ) { 2044 if ( mainWindow() ) {
2034 QMainWindow::ToolBarDock dock; 2045 Qt::ToolBarDock dock;
2035 bool newLine; 2046 bool newLine;
2036 int offset; 2047 int offset;
2037 mainWindow()->getLocation( this, dock, index, newLine, offset ); 2048 mainWindow()->getLocation( this, dock, index, newLine, offset );
2038 } 2049 }
2039 2050
2040 switch (d->m_iconText) { 2051 switch (d->m_iconText) {
2041 case KToolBar::IconTextRight: 2052 case KToolBar::IconTextRight:
2042 icontext = "IconTextRight"; 2053 icontext = "IconTextRight";
2043 break; 2054 break;
2044 case KToolBar::IconTextBottom: 2055 case KToolBar::IconTextBottom:
2045 icontext = "IconTextBottom"; 2056 icontext = "IconTextBottom";
2046 break; 2057 break;
@@ -2091,70 +2102,70 @@ void KToolBar::positionYourself( bool force )
2091 d->toolBarInfo.index, 2102 d->toolBarInfo.index,
2092 d->toolBarInfo.offset ); 2103 d->toolBarInfo.offset );
2093*/ 2104*/
2094 mainWindow()->moveToolBar( this, d->toolBarInfo.dock, d->NewLineDefault, d->IndexDefault, d->OffsetDefault ); 2105 mainWindow()->moveToolBar( this, d->toolBarInfo.dock, d->NewLineDefault, d->IndexDefault, d->OffsetDefault );
2095 2106
2096 if ( doHide ) 2107 if ( doHide )
2097 hide(); 2108 hide();
2098 // This method can only have an effect once - unless force is set 2109 // This method can only have an effect once - unless force is set
2099 d->positioned = TRUE; 2110 d->positioned = TRUE;
2100} 2111}
2101 2112
2102//US KPopupMenu *KToolBar::contextMenu() 2113//US KPopupMenu *KToolBar::contextMenu()
2103QPopupMenu *KToolBar::contextMenu() 2114Q3PopupMenu *KToolBar::contextMenu()
2104{ 2115{
2105 if ( context ) 2116 if ( context )
2106 return context; 2117 return context;
2107 2118
2108 // Construct our context popup menu. Name it qt_dockwidget_internal so it 2119 // Construct our context popup menu. Name it qt_dockwidget_internal so it
2109 // won't be deleted by QToolBar::clear(). 2120 // won't be deleted by QToolBar::clear().
2110//US context = new KPopupMenu( this, "qt_dockwidget_internal" ); 2121//US context = new KPopupMenu( this, "qt_dockwidget_internal" );
2111 context = new QPopupMenu( this, "qt_dockwidget_internal" ); 2122 context = new Q3PopupMenu( this, "qt_dockwidget_internal" );
2112//US context->insertTitle(i18n("Toolbar Menu")); 2123//US context->insertTitle(i18n("Toolbar Menu"));
2113 2124
2114//US KPopupMenu *orient = new KPopupMenu( context, "orient" ); 2125//US KPopupMenu *orient = new KPopupMenu( context, "orient" );
2115 QPopupMenu *orient = new QPopupMenu( context, "orient" ); 2126 Q3PopupMenu *orient = new Q3PopupMenu( context, "orient" );
2116 orient->insertItem( i18n("toolbar position string","Top"), CONTEXT_TOP ); 2127 orient->insertItem( i18n("toolbar position string","Top"), CONTEXT_TOP );
2117 orient->insertItem( i18n("toolbar position string","Left"), CONTEXT_LEFT ); 2128 orient->insertItem( i18n("toolbar position string","Left"), CONTEXT_LEFT );
2118 orient->insertItem( i18n("toolbar position string","Right"), CONTEXT_RIGHT ); 2129 orient->insertItem( i18n("toolbar position string","Right"), CONTEXT_RIGHT );
2119 orient->insertItem( i18n("toolbar position string","Bottom"), CONTEXT_BOTTOM ); 2130 orient->insertItem( i18n("toolbar position string","Bottom"), CONTEXT_BOTTOM );
2120 orient->insertSeparator(-1); 2131 orient->insertSeparator(-1);
2121 //orient->insertItem( i18n("toolbar position string","Floating"), CONTEXT_FLOAT ); 2132 //orient->insertItem( i18n("toolbar position string","Floating"), CONTEXT_FLOAT );
2122 orient->insertItem( i18n("min toolbar", "Flat"), CONTEXT_FLAT ); 2133 orient->insertItem( i18n("min toolbar", "Flat"), CONTEXT_FLAT );
2123 2134
2124//US KPopupMenu *mode = new KPopupMenu( context, "mode" ); 2135//US KPopupMenu *mode = new KPopupMenu( context, "mode" );
2125 QPopupMenu *mode = new QPopupMenu( context, "mode" ); 2136 Q3PopupMenu *mode = new Q3PopupMenu( context, "mode" );
2126 mode->insertItem( i18n("Icons Only"), CONTEXT_ICONS ); 2137 mode->insertItem( i18n("Icons Only"), CONTEXT_ICONS );
2127 mode->insertItem( i18n("Text Only"), CONTEXT_TEXT ); 2138 mode->insertItem( i18n("Text Only"), CONTEXT_TEXT );
2128 mode->insertItem( i18n("Text Alongside Icons"), CONTEXT_TEXTRIGHT ); 2139 mode->insertItem( i18n("Text Alongside Icons"), CONTEXT_TEXTRIGHT );
2129 mode->insertItem( i18n("Text Under Icons"), CONTEXT_TEXTUNDER ); 2140 mode->insertItem( i18n("Text Under Icons"), CONTEXT_TEXTUNDER );
2130 2141
2131//US KPopupMenu *size = new KPopupMenu( context, "size" ); 2142//US KPopupMenu *size = new KPopupMenu( context, "size" );
2132 QPopupMenu *size = new QPopupMenu( context, "size" ); 2143 Q3PopupMenu *size = new Q3PopupMenu( context, "size" );
2133 size->insertItem( i18n("Default"), CONTEXT_ICONSIZES ); 2144 size->insertItem( i18n("Default"), CONTEXT_ICONSIZES );
2134 // Query the current theme for available sizes 2145 // Query the current theme for available sizes
2135 QValueList<int> avSizes; 2146 Q3ValueList<int> avSizes;
2136/*US 2147/*US
2137 KIconTheme *theme = KGlobal::instance()->iconLoader()->theme(); 2148 KIconTheme *theme = KGlobal::instance()->iconLoader()->theme();
2138 if (!::qstrcmp(QObject::name(), "mainToolBar")) 2149 if (!::qstrcmp(QObject::name(), "mainToolBar"))
2139 avSizes = theme->querySizes( KIcon::MainToolbar); 2150 avSizes = theme->querySizes( KIcon::MainToolbar);
2140 else 2151 else
2141 avSizes = theme->querySizes( KIcon::Toolbar); 2152 avSizes = theme->querySizes( KIcon::Toolbar);
2142*/ 2153*/
2143 avSizes << 16; 2154 avSizes << 16;
2144 avSizes << 32; 2155 avSizes << 32;
2145 2156
2146 d->iconSizes = avSizes; 2157 d->iconSizes = avSizes;
2147 2158
2148 QValueList<int>::Iterator it; 2159 Q3ValueList<int>::Iterator it;
2149 for (it=avSizes.begin(); it!=avSizes.end(); it++) { 2160 for (it=avSizes.begin(); it!=avSizes.end(); it++) {
2150 QString text; 2161 QString text;
2151 if ( *it < 19 ) 2162 if ( *it < 19 )
2152 text = i18n("Small (%1x%2)").arg(*it).arg(*it); 2163 text = i18n("Small (%1x%2)").arg(*it).arg(*it);
2153 else if (*it < 25) 2164 else if (*it < 25)
2154 text = i18n("Medium (%1x%2)").arg(*it).arg(*it); 2165 text = i18n("Medium (%1x%2)").arg(*it).arg(*it);
2155 else 2166 else
2156 text = i18n("Large (%1x%2)").arg(*it).arg(*it); 2167 text = i18n("Large (%1x%2)").arg(*it).arg(*it);
2157 //we use the size as an id, with an offset 2168 //we use the size as an id, with an offset
2158 size->insertItem( text, CONTEXT_ICONSIZES + *it ); 2169 size->insertItem( text, CONTEXT_ICONSIZES + *it );
2159 } 2170 }
2160 2171
@@ -2209,26 +2220,26 @@ void KToolBar::slotContextAboutToShow()
2209 break; 2220 break;
2210 case IconTextRight: 2221 case IconTextRight:
2211 context->setItemChecked(CONTEXT_TEXTRIGHT, true); 2222 context->setItemChecked(CONTEXT_TEXTRIGHT, true);
2212 break; 2223 break;
2213 case TextOnly: 2224 case TextOnly:
2214 context->setItemChecked(CONTEXT_TEXT, true); 2225 context->setItemChecked(CONTEXT_TEXT, true);
2215 break; 2226 break;
2216 case IconTextBottom: 2227 case IconTextBottom:
2217 context->setItemChecked(CONTEXT_TEXTUNDER, true); 2228 context->setItemChecked(CONTEXT_TEXTUNDER, true);
2218 break; 2229 break;
2219 } 2230 }
2220 2231
2221 QValueList<int>::ConstIterator iIt = d->iconSizes.begin(); 2232 Q3ValueList<int>::ConstIterator iIt = d->iconSizes.begin();
2222 QValueList<int>::ConstIterator iEnd = d->iconSizes.end(); 2233 Q3ValueList<int>::ConstIterator iEnd = d->iconSizes.end();
2223 for (; iIt != iEnd; ++iIt ) 2234 for (; iIt != iEnd; ++iIt )
2224 context->setItemChecked( CONTEXT_ICONSIZES + *iIt, false ); 2235 context->setItemChecked( CONTEXT_ICONSIZES + *iIt, false );
2225 2236
2226 context->setItemChecked( CONTEXT_ICONSIZES, false ); 2237 context->setItemChecked( CONTEXT_ICONSIZES, false );
2227 2238
2228 context->setItemChecked( CONTEXT_ICONSIZES + d->m_iconSize, true ); 2239 context->setItemChecked( CONTEXT_ICONSIZES + d->m_iconSize, true );
2229 2240
2230 for ( int i = CONTEXT_TOP; i <= CONTEXT_FLAT; ++i ) 2241 for ( int i = CONTEXT_TOP; i <= CONTEXT_FLAT; ++i )
2231 context->setItemChecked( i, false ); 2242 context->setItemChecked( i, false );
2232 2243
2233 switch ( barPos() ) 2244 switch ( barPos() )
2234 { 2245 {
diff --git a/microkde/kdeui/ktoolbar.h b/microkde/kdeui/ktoolbar.h
index 3319fa8..4e00abd 100644
--- a/microkde/kdeui/ktoolbar.h
+++ b/microkde/kdeui/ktoolbar.h
@@ -17,77 +17,85 @@
17 17
18 You should have received a copy of the GNU Library General Public License 18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to 19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. 21 Boston, MA 02111-1307, USA.
22 */ 22 */
23 23
24#ifndef KTOOLBAR_H 24#ifndef KTOOLBAR_H
25#define KTOOLBAR_H 25#define KTOOLBAR_H
26 26
27#ifndef DESKTOP_VERSION 27#ifndef DESKTOP_VERSION
28#define private public 28#define private public
29#include <qtoolbar.h> 29#include <q3toolbar.h>
30#undef private 30#undef private
31#include <qpe/qpetoolbar.h> 31#include <qpe/qpetoolbar.h>
32#else 32#else
33#include <qtoolbar.h> 33#include <q3toolbar.h>
34#endif 34#endif
35 35
36 36
37#include <qmainwindow.h> 37#include <q3mainwindow.h>
38#include <qcombobox.h> 38#include <qcombobox.h>
39#include <qmap.h> 39#include <qmap.h>
40#include <qptrlist.h> 40#include <q3ptrlist.h>
41//Added by qt3to4:
42#include <QPixmap>
43#include <QResizeEvent>
44#include <Q3PopupMenu>
45#include <QMouseEvent>
46#include <QChildEvent>
47#include <QEvent>
48#include <QShowEvent>
41#include <kglobal.h> 49#include <kglobal.h>
42#include <qguardedptr.h> 50#include <qpointer.h>
43#include <qframe.h> 51#include <q3frame.h>
44#include <qiconset.h> 52#include <qicon.h>
45 53
46class QDomElement; 54class QDomElement;
47class QSize; 55class QSize;
48class QPixmap; 56class QPixmap;
49class QPopupMenu; 57class Q3PopupMenu;
50class QStringList; 58class QStringList;
51class QDomDocument; 59class QDomDocument;
52class QTimer; 60class QTimer;
53 61
54class KLineEdit; 62class KLineEdit;
55class KToolBar; 63class KToolBar;
56class KToolBarButton; 64class KToolBarButton;
57class KToolBoxManager; 65class KToolBoxManager;
58//US class KAnimWidget; 66//US class KAnimWidget;
59//US class KPopupMenu; 67//US class KPopupMenu;
60//US class KInstance; 68//US class KInstance;
61class KComboBox; 69class KComboBox;
62class KXMLGUIClient; 70class KXMLGUIClient;
63 71
64class KToolBarPrivate; 72class KToolBarPrivate;
65 73
66class KToolBarSeparator : public QFrame 74class KToolBarSeparator : public Q3Frame
67{ 75{
68 Q_OBJECT 76 Q_OBJECT
69public: 77public:
70 KToolBarSeparator( Orientation, bool l, QToolBar *parent, const char* name=0 ); 78 KToolBarSeparator( Qt::Orientation, bool l, Q3ToolBar *parent, const char* name=0 );
71 79
72 QSize sizeHint() const; 80 QSize sizeHint() const;
73 Orientation orientation() const { return orient; } 81 Qt::Orientation orientation() const { return orient; }
74 QSizePolicy sizePolicy() const; 82 QSizePolicy sizePolicy() const;
75 bool showLine() const { return line; } 83 bool showLine() const { return line; }
76public slots: 84public slots:
77 void setOrientation( Orientation ); 85 void setOrientation( Qt::Orientation );
78protected: 86protected:
79 void styleChange( QStyle& ); 87 void styleChange( QStyle& );
80private: 88private:
81 Orientation orient; 89 Qt::Orientation orient;
82 bool line; 90 bool line;
83}; 91};
84 92
85 93
86 /** 94 /**
87 * A KDE-style toolbar. 95 * A KDE-style toolbar.
88 * 96 *
89 * KToolBar can be dragged around in and between different docks. 97 * KToolBar can be dragged around in and between different docks.
90 * 98 *
91 * A KToolBar can contain all sorts of widgets. 99 * A KToolBar can contain all sorts of widgets.
92 * 100 *
93 * KToolBar can be used as a standalone widget, but @ref KMainWindow 101 * KToolBar can be used as a standalone widget, but @ref KMainWindow
@@ -102,41 +110,41 @@ private:
102 * construction. It will reread this config group on a 110 * construction. It will reread this config group on a
103 * @ref KApplication::appearanceChanged() signal. 111 * @ref KApplication::appearanceChanged() signal.
104 * 112 *
105 * @short Floatable toolbar with auto resize. 113 * @short Floatable toolbar with auto resize.
106 * @version $Id$ 114 * @version $Id$
107 * @author Reginald Stadlbauer <reggie@kde.org>, Stephan Kulow <coolo@kde.org>, Sven Radej <radej@kde.org>. 115 * @author Reginald Stadlbauer <reggie@kde.org>, Stephan Kulow <coolo@kde.org>, Sven Radej <radej@kde.org>.
108 */ 116 */
109 117
110// strange things are happening ... so I have to use strange define methods ... 118// strange things are happening ... so I have to use strange define methods ...
111// porting KToolBar back to Qt2 really needs some strange hacks 119// porting KToolBar back to Qt2 really needs some strange hacks
112 120
113#ifndef DESKTOP_VERSION 121#ifndef DESKTOP_VERSION
114#define QToolBar QPEToolBar 122#define Q3ToolBar QPEToolBar
115#endif 123#endif
116 124
117 class KToolBar : public QToolBar 125 class KToolBar : public Q3ToolBar
118{ 126{
119 Q_OBJECT 127 Q_OBJECT
120 128
121 129
122 Q_ENUMS( IconText BarPosition ) 130 Q_ENUMS( IconText BarPosition )
123 131
124 Q_PROPERTY( IconText iconText READ iconText WRITE setIconText ) 132 Q_PROPERTY( IconText iconText READ iconText WRITE setIconText )
125 Q_PROPERTY( BarPosition barPos READ barPos WRITE setBarPos ) 133 Q_PROPERTY( BarPosition barPos READ barPos WRITE setBarPos )
126 Q_PROPERTY( bool fullSize READ fullSize WRITE setFullSize ) 134 Q_PROPERTY( bool fullSize READ fullSize WRITE setFullSize )
127 Q_PROPERTY( int iconSize READ iconSize WRITE setIconSize ) 135 Q_PROPERTY( int iconSize READ iconSize WRITE setIconSize )
128 Q_PROPERTY( QString text READ text WRITE setText ) 136 Q_PROPERTY( QString text READ text WRITE setText )
129#ifndef DESKTOP_VERSION 137#ifndef DESKTOP_VERSION
130#undef QToolBar 138#undef Q3ToolBar
131#endif 139#endif
132public: 140public:
133 enum IconText{IconOnly = 0, IconTextRight, TextOnly, IconTextBottom}; 141 enum IconText{IconOnly = 0, IconTextRight, TextOnly, IconTextBottom};
134 /** 142 /**
135 * The state of the status bar. 143 * The state of the status bar.
136 * @deprecated 144 * @deprecated
137 **/ 145 **/
138 enum BarStatus{Toggle, Show, Hide}; 146 enum BarStatus{Toggle, Show, Hide};
139 /** 147 /**
140 * Possible bar positions. 148 * Possible bar positions.
141 **/ 149 **/
142 enum BarPosition{ Unmanaged, Floating, Top, Bottom, Right, Left, Flat}; 150 enum BarPosition{ Unmanaged, Floating, Top, Bottom, Right, Left, Flat};
@@ -166,43 +174,43 @@ public:
166 * The toolbar will read in various global config settings for 174 * The toolbar will read in various global config settings for
167 * things like icon size and text position, etc. However, some of 175 * things like icon size and text position, etc. However, some of
168 * the settings will be honored only if @ref #_honor_mode is set to 176 * the settings will be honored only if @ref #_honor_mode is set to
169 * true. All other toolbars will be IconOnly and use Medium icons. 177 * true. All other toolbars will be IconOnly and use Medium icons.
170 * 178 *
171 * @param parentWindow The window that should be the parent of this toolbar 179 * @param parentWindow The window that should be the parent of this toolbar
172 * @param dock The position of the toolbar. Usually QMainWindow::Top. 180 * @param dock The position of the toolbar. Usually QMainWindow::Top.
173 * @param newLine If true, start a new line in the dock for this toolbar. 181 * @param newLine If true, start a new line in the dock for this toolbar.
174 * @param name The standard internal name 182 * @param name The standard internal name
175 * @param honor_style If true, then global settings for IconSize and IconText will be honored 183 * @param honor_style If true, then global settings for IconSize and IconText will be honored
176 * @param readConfig whether to apply the configuration (global and application-specific) 184 * @param readConfig whether to apply the configuration (global and application-specific)
177 */ 185 */
178 KToolBar( QMainWindow *parentWindow, QMainWindow::ToolBarDock dock /*= QMainWindow::Top*/, bool newLine = false, 186 KToolBar( Q3MainWindow *parentWindow, Qt::ToolBarDock dock /*= QMainWindow::Top*/, bool newLine = false,
179 const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE ); 187 const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE );
180 188
181 /** 189 /**
182 * Constructor for non-XML-GUI applications. 190 * Constructor for non-XML-GUI applications.
183 * 191 *
184 * The toolbar will read in various global config settings for 192 * The toolbar will read in various global config settings for
185 * things like icon size and text position, etc. However, some of 193 * things like icon size and text position, etc. However, some of
186 * the settings will be honored only if @ref #_honor_mode is set to 194 * the settings will be honored only if @ref #_honor_mode is set to
187 * true. All other toolbars will be IconOnly and use Medium icons. 195 * true. All other toolbars will be IconOnly and use Medium icons.
188 * 196 *
189 * @param parentWindow The window that should be the parent of this toolbar 197 * @param parentWindow The window that should be the parent of this toolbar
190 * @param dock Another widget than the mainwindow to dock toolbar to. 198 * @param dock Another widget than the mainwindow to dock toolbar to.
191 * @param newLine If true, start a new line in the dock for this toolbar. 199 * @param newLine If true, start a new line in the dock for this toolbar.
192 * @param name The standard internal name 200 * @param name The standard internal name
193 * @param honor_style If true, then global settings for IconSize and IconText will be honored 201 * @param honor_style If true, then global settings for IconSize and IconText will be honored
194 * @param readConfig whether to apply the configuration (global and application-specific) 202 * @param readConfig whether to apply the configuration (global and application-specific)
195 */ 203 */
196 KToolBar( QMainWindow *parentWindow, QWidget *dock, bool newLine = false, 204 KToolBar( Q3MainWindow *parentWindow, QWidget *dock, bool newLine = false,
197 const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE ); 205 const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE );
198 206
199 virtual ~KToolBar(); 207 virtual ~KToolBar();
200 208
201 /** 209 /**
202 * Insert a button (a @ref KToolBarButton) with a pixmap. The 210 * Insert a button (a @ref KToolBarButton) with a pixmap. The
203 * pixmap is loaded by the button itself based on the global icon 211 * pixmap is loaded by the button itself based on the global icon
204 * settings. 212 * settings.
205 * 213 *
206 * You should connect to one or more signals in KToolBar: 214 * You should connect to one or more signals in KToolBar:
207 * @ref clicked() , @ref pressed() , @ref released() , or 215 * @ref clicked() , @ref pressed() , @ref released() , or
208 * @ref highlighted() and if the button is a toggle button 216 * @ref highlighted() and if the button is a toggle button
@@ -294,40 +302,40 @@ public:
294 /** 302 /**
295 * Inserts a button with popupmenu. 303 * Inserts a button with popupmenu.
296 * 304 *
297 * Button will have small 305 * Button will have small
298 * triangle. You have to connect to popup's signals. The 306 * triangle. You have to connect to popup's signals. The
299 * signals @ref KButton::pressed(), @ref KButton::released(), 307 * signals @ref KButton::pressed(), @ref KButton::released(),
300 * @ref KButton::clicked() or @ref KButton::doubleClicked() are @p not 308 * @ref KButton::clicked() or @ref KButton::doubleClicked() are @p not
301 * emmited by 309 * emmited by
302 * this button (see @ref setDelayedPopup() for that). 310 * this button (see @ref setDelayedPopup() for that).
303 * You can add custom popups which inherit @ref QPopupMenu to get popups 311 * You can add custom popups which inherit @ref QPopupMenu to get popups
304 * with tables, drawings etc. Just don't fiddle with events there. 312 * with tables, drawings etc. Just don't fiddle with events there.
305 */ 313 */
306 int insertButton(const QString& icon, int id, QPopupMenu *popup, 314 int insertButton(const QString& icon, int id, Q3PopupMenu *popup,
307 bool enabled, const QString&_text, int index=-1); 315 bool enabled, const QString&_text, int index=-1);
308 316
309 /** 317 /**
310 * Inserts a button with popupmenu. 318 * Inserts a button with popupmenu.
311 * 319 *
312 * Button will have small 320 * Button will have small
313 * triangle. You have to connect to popup's signals. The 321 * triangle. You have to connect to popup's signals. The
314 * signals @ref KButton::pressed(), @ref KButton::released(), 322 * signals @ref KButton::pressed(), @ref KButton::released(),
315 * @ref KButton::clicked() or @ref KButton::doubleClicked() are @p not 323 * @ref KButton::clicked() or @ref KButton::doubleClicked() are @p not
316 * emmited by 324 * emmited by
317 * this button (see @ref setDelayedPopup() for that). 325 * this button (see @ref setDelayedPopup() for that).
318 * You can add custom popups which inherit @ref QPopupMenu to get popups 326 * You can add custom popups which inherit @ref QPopupMenu to get popups
319 * with tables, drawings etc. Just don't fiddle with events there. 327 * with tables, drawings etc. Just don't fiddle with events there.
320 */ 328 */
321 int insertButton(const QPixmap& pixmap, int id, QPopupMenu *popup, 329 int insertButton(const QPixmap& pixmap, int id, Q3PopupMenu *popup,
322 bool enabled, const QString&_text, int index=-1); 330 bool enabled, const QString&_text, int index=-1);
323 331
324 /** 332 /**
325 * Inserts a @ref KLineEdit. You have to specify signals and slots to 333 * Inserts a @ref KLineEdit. You have to specify signals and slots to
326 * which KLineEdit will be connected. KLineEdit has all slots QLineEdit 334 * which KLineEdit will be connected. KLineEdit has all slots QLineEdit
327 * has, plus signals @ref KLineEdit::completion and @ref KLineEdit::textRotation 335 * has, plus signals @ref KLineEdit::completion and @ref KLineEdit::textRotation
328 * KLineEdit can be set to autoresize itself to full free width 336 * KLineEdit can be set to autoresize itself to full free width
329 * in toolbar, that is to last right aligned item. For that, 337 * in toolbar, that is to last right aligned item. For that,
330 * toolbar must be set to full width (which it is by default). 338 * toolbar must be set to full width (which it is by default).
331 * @see setFullWidth() 339 * @see setFullWidth()
332 * @see setItemAutoSized() 340 * @see setItemAutoSized()
333 * @see KLineEdit 341 * @see KLineEdit
@@ -350,41 +358,41 @@ public:
350 * computed. 358 * computed.
351 * 359 *
352 * @see setFullWidth() 360 * @see setFullWidth()
353 * @see setItemAutoSized() 361 * @see setItemAutoSized()
354 * @see KComboBox 362 * @see KComboBox
355 * @return Item index. 363 * @return Item index.
356 */ 364 */
357 int insertCombo (const QStringList &list, int id, bool writable, 365 int insertCombo (const QStringList &list, int id, bool writable,
358 const char *signal, const QObject *receiver, 366 const char *signal, const QObject *receiver,
359 const char *slot, bool enabled=true, 367 const char *slot, bool enabled=true,
360 const QString& tooltiptext=QString::null, 368 const QString& tooltiptext=QString::null,
361 int size=70, int index=-1, 369 int size=70, int index=-1,
362 QComboBox::Policy policy = QComboBox::AtBottom); 370 QComboBox::Policy policy = QComboBox::InsertAtBottom);
363 371
364 /** 372 /**
365 * Insert a @ref KComboBox with text. 373 * Insert a @ref KComboBox with text.
366 * 374 *
367 * The rest is the same as above. 375 * The rest is the same as above.
368 * @see setItemAutoSized() 376 * @see setItemAutoSized()
369 * 377 *
370 * @see KComboBox 378 * @see KComboBox
371 * @return Item index. 379 * @return Item index.
372 */ 380 */
373 int insertCombo (const QString& text, int id, bool writable, 381 int insertCombo (const QString& text, int id, bool writable,
374 const char *signal, QObject *recevier, 382 const char *signal, QObject *recevier,
375 const char *slot, bool enabled=true, 383 const char *slot, bool enabled=true,
376 const QString& tooltiptext=QString::null, 384 const QString& tooltiptext=QString::null,
377 int size=70, int index=-1, 385 int size=70, int index=-1,
378 QComboBox::Policy policy = QComboBox::AtBottom); 386 QComboBox::Policy policy = QComboBox::InsertAtBottom);
379 387
380 /** 388 /**
381 * Inserts a separator into the toolbar with the given id. 389 * Inserts a separator into the toolbar with the given id.
382 * Returns the separator's index 390 * Returns the separator's index
383 */ 391 */
384 int insertSeparator( int index = -1, int id = -1 ); 392 int insertSeparator( int index = -1, int id = -1 );
385 393
386 /** 394 /**
387 * Inserts a line separator into the toolbar with the given id. 395 * Inserts a line separator into the toolbar with the given id.
388 * Returns the separator's index 396 * Returns the separator's index
389 */ 397 */
390 int insertLineSeparator( int index = -1, int id = -1 ); 398 int insertLineSeparator( int index = -1, int id = -1 );
@@ -456,25 +464,25 @@ public:
456 /** 464 /**
457 * Sets button pixmap. 465 * Sets button pixmap.
458 * 466 *
459 * Can be used while button is visible. 467 * Can be used while button is visible.
460 */ 468 */
461 void setButtonPixmap( int id, const QPixmap& _pixmap ); 469 void setButtonPixmap( int id, const QPixmap& _pixmap );
462 470
463 /** 471 /**
464 * Sets a button icon from a QIconSet. 472 * Sets a button icon from a QIconSet.
465 * 473 *
466 * Can be used while button is visible. 474 * Can be used while button is visible.
467 */ 475 */
468 void setButtonIconSet( int id, const QIconSet& iconset ); 476 void setButtonIconSet( int id, const QIcon& iconset );
469 477
470 /** 478 /**
471 * Sets a delayed popup for a button. 479 * Sets a delayed popup for a button.
472 * 480 *
473 * Delayed popup is what you see in 481 * Delayed popup is what you see in
474 * Netscape Navigator's Previous and Next buttons: If you click them you 482 * Netscape Navigator's Previous and Next buttons: If you click them you
475 * go back 483 * go back
476 * or forth. If you press them long enough, you get a history-menu. 484 * or forth. If you press them long enough, you get a history-menu.
477 * This is exactly what we do here. 485 * This is exactly what we do here.
478 * 486 *
479 * You will insert normal a button with connection (or use signals from 487 * You will insert normal a button with connection (or use signals from
480 * toolbar): 488 * toolbar):
@@ -482,25 +490,25 @@ public:
482 * bar->insertButton(icon, id, SIGNAL(clicked ()), this, 490 * bar->insertButton(icon, id, SIGNAL(clicked ()), this,
483 * SLOT (slotClick()), true, "click or wait for popup"); 491 * SLOT (slotClick()), true, "click or wait for popup");
484 * </pre> And then add a delayed popup: 492 * </pre> And then add a delayed popup:
485 * <pre> 493 * <pre>
486 * bar->setDelayedPopup (id, historyPopup); </pre> 494 * bar->setDelayedPopup (id, historyPopup); </pre>
487 * 495 *
488 * Don't add delayed popups to buttons which have normal popups. 496 * Don't add delayed popups to buttons which have normal popups.
489 * 497 *
490 * You may add popups which are derived from @ref QPopupMenu. You may 498 * You may add popups which are derived from @ref QPopupMenu. You may
491 * add popups that are already in the menu bar or are submenus of 499 * add popups that are already in the menu bar or are submenus of
492 * other popups. 500 * other popups.
493 */ 501 */
494 void setDelayedPopup (int id , QPopupMenu *_popup, bool toggle = false); 502 void setDelayedPopup (int id , Q3PopupMenu *_popup, bool toggle = false);
495 503
496 /** 504 /**
497 * Turns a button into an autorepeat button. 505 * Turns a button into an autorepeat button.
498 * 506 *
499 * Toggle buttons, buttons with menus, or 507 * Toggle buttons, buttons with menus, or
500 * buttons with delayed menus cannot be made into autorepeat buttons. 508 * buttons with delayed menus cannot be made into autorepeat buttons.
501 * Moreover, you can and will receive 509 * Moreover, you can and will receive
502 * only the signal clicked(), but not pressed() or released(). 510 * only the signal clicked(), but not pressed() or released().
503 * When the user presses this button, you will receive the signal clicked(), 511 * When the user presses this button, you will receive the signal clicked(),
504 * and if the button is still pressed after some time, 512 * and if the button is still pressed after some time,
505 * you will receive more clicked() signals separated by regular 513 * you will receive more clicked() signals separated by regular
506 * intervals. Since this uses @ref QButton::setAutoRepeat() , 514 * intervals. Since this uses @ref QButton::setAutoRepeat() ,
@@ -1051,60 +1059,60 @@ public:
1051 /** 1059 /**
1052 * @return global setting for "Toolbars transparent when moving" 1060 * @return global setting for "Toolbars transparent when moving"
1053 */ 1061 */
1054 static bool transparentSetting(); 1062 static bool transparentSetting();
1055 1063
1056 /** 1064 /**
1057 * @return global setting for "Icon Text" 1065 * @return global setting for "Icon Text"
1058 */ 1066 */
1059 static IconText iconTextSetting(); 1067 static IconText iconTextSetting();
1060 1068
1061public slots: 1069public slots:
1062 virtual void setIconText( const QString &txt ) 1070 virtual void setIconText( const QString &txt )
1063 { QToolBar::setIconText( txt ); } 1071 { Q3ToolBar::setIconText( txt ); }
1064 void slotRepaint(); 1072 void slotRepaint();
1065 1073
1066protected: 1074protected:
1067 void mousePressEvent( QMouseEvent * ); 1075 void mousePressEvent( QMouseEvent * );
1068 void childEvent( QChildEvent *e ); 1076 void childEvent( QChildEvent *e );
1069 void showEvent( QShowEvent *e ); 1077 void showEvent( QShowEvent *e );
1070 void resizeEvent( QResizeEvent *e ); 1078 void resizeEvent( QResizeEvent *e );
1071 bool event( QEvent *e ); 1079 bool event( QEvent *e );
1072 void applyAppearanceSettings(KConfig *config, const QString &_configGroup, bool forceGlobal = false); 1080 void applyAppearanceSettings(KConfig *config, const QString &_configGroup, bool forceGlobal = false);
1073 QString settingsGroup(); 1081 QString settingsGroup();
1074 1082
1075private slots: 1083private slots:
1076 void rebuildLayout(); 1084 void rebuildLayout();
1077 void slotReadConfig (); 1085 void slotReadConfig ();
1078 void slotAppearanceChanged(); 1086 void slotAppearanceChanged();
1079 void slotIconChanged(int); 1087 void slotIconChanged(int);
1080 void toolBarPosChanged( QToolBar *tb ); 1088 void toolBarPosChanged( Q3ToolBar *tb );
1081 void slotContextAboutToShow(); 1089 void slotContextAboutToShow();
1082 void widgetDestroyed(); 1090 void widgetDestroyed();
1083 1091
1084private: 1092private:
1085 int sizeHintW; 1093 int sizeHintW;
1086 int sizeHintH; 1094 int sizeHintH;
1087 void init( bool readConfig = true, bool honorStyle = false ); 1095 void init( bool readConfig = true, bool honorStyle = false );
1088 void doConnections( KToolBarButton *button ); 1096 void doConnections( KToolBarButton *button );
1089 void insertWidgetInternal( QWidget *w, int &index, int id ); 1097 void insertWidgetInternal( QWidget *w, int &index, int id );
1090 void removeWidgetInternal( QWidget *w ); 1098 void removeWidgetInternal( QWidget *w );
1091 void getAttributes( QString &position, QString &icontext, int &index ); 1099 void getAttributes( QString &position, QString &icontext, int &index );
1092//US KPopupMenu *contextMenu(); 1100//US KPopupMenu *contextMenu();
1093 QPopupMenu *contextMenu(); 1101 Q3PopupMenu *contextMenu();
1094 1102
1095 QMap<QWidget*, int > widget2id; 1103 QMap<QWidget*, int > widget2id;
1096 typedef QMap<int, QWidget* > Id2WidgetMap; 1104 typedef QMap<int, QWidget* > Id2WidgetMap;
1097 Id2WidgetMap id2widget; 1105 Id2WidgetMap id2widget;
1098//US KPopupMenu *context; 1106//US KPopupMenu *context;
1099 QPopupMenu *context; 1107 Q3PopupMenu *context;
1100 QPtrList<QWidget> widgets; 1108 Q3PtrList<QWidget> widgets;
1101 QTimer *layoutTimer; 1109 QTimer *layoutTimer;
1102 QGuardedPtr<QWidget> stretchableWidget, rightAligned; 1110 QPointer<QWidget> stretchableWidget, rightAligned;
1103protected: 1111protected:
1104 virtual void virtual_hook( int id, void* data ); 1112 virtual void virtual_hook( int id, void* data );
1105private: 1113private:
1106 KToolBarPrivate *d; 1114 KToolBarPrivate *d;
1107 bool inshutdownprocess; 1115 bool inshutdownprocess;
1108}; 1116};
1109 1117
1110#endif 1118#endif
diff --git a/microkde/kdeui/ktoolbarbutton.cpp b/microkde/kdeui/ktoolbarbutton.cpp
index 1d5d0e5..7b98b32 100644
--- a/microkde/kdeui/ktoolbarbutton.cpp
+++ b/microkde/kdeui/ktoolbarbutton.cpp
@@ -24,40 +24,44 @@
24//US #include <config.h> 24//US #include <config.h>
25#include <string.h> 25#include <string.h>
26 26
27#include "ktoolbarbutton.h" 27#include "ktoolbarbutton.h"
28#include "ktoolbar.h" 28#include "ktoolbar.h"
29 29
30#include <qstyle.h> 30#include <qstyle.h>
31#include <qimage.h> 31#include <qimage.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qdrawutil.h> 33#include <qdrawutil.h>
34#include <qtooltip.h> 34#include <qtooltip.h>
35#include <qbitmap.h> 35#include <qbitmap.h>
36#include <qpopupmenu.h> 36#include <q3popupmenu.h>
37#include <qcursor.h> 37#include <qcursor.h>
38#include <qpainter.h> 38#include <qpainter.h>
39#include <qlayout.h> 39#include <qlayout.h>
40//Added by qt3to4:
41#include <QPixmap>
42#include <QMouseEvent>
43#include <QEvent>
40 44
41#include <kapplication.h> 45#include <kapplication.h>
42#include <kdebug.h> 46#include <kdebug.h>
43#include <kglobal.h> 47#include <kglobal.h>
44#include <kglobalsettings.h> 48#include <kglobalsettings.h>
45//US #include <kiconeffect.h> 49//US #include <kiconeffect.h>
46#include <kiconloader.h> 50#include <kiconloader.h>
47 51
48// needed to get our instance 52// needed to get our instance
49#include <kmainwindow.h> 53#include <kmainwindow.h>
50 54
51template class QIntDict<KToolBarButton>; 55template class Q3IntDict<KToolBarButton>;
52 56
53class KToolBarButtonPrivate 57class KToolBarButtonPrivate
54{ 58{
55public: 59public:
56 KToolBarButtonPrivate() 60 KToolBarButtonPrivate()
57 { 61 {
58 m_noStyle = false; 62 m_noStyle = false;
59 m_isSeparator = false; 63 m_isSeparator = false;
60 m_isRadio = false; 64 m_isRadio = false;
61 m_highlight = false; 65 m_highlight = false;
62 m_isRaised = false; 66 m_isRaised = false;
63 m_isActive = false; 67 m_isActive = false;
@@ -106,25 +110,25 @@ KToolBarButton::KToolBarButton( QWidget *_parent, const char *_name )
106KToolBarButton::KToolBarButton( const QString& _icon, int _id, 110KToolBarButton::KToolBarButton( const QString& _icon, int _id,
107 QWidget *_parent, const char *_name, 111 QWidget *_parent, const char *_name,
108 const QString &_txt/*US, KInstance *_instance*/ ) 112 const QString &_txt/*US, KInstance *_instance*/ )
109 : QToolButton( _parent, _name ), d( 0 ) 113 : QToolButton( _parent, _name ), d( 0 )
110{ 114{
111 d = new KToolBarButtonPrivate; 115 d = new KToolBarButtonPrivate;
112 116
113 d->m_id = _id; 117 d->m_id = _id;
114 d->m_parent = (KToolBar*)_parent; 118 d->m_parent = (KToolBar*)_parent;
115 QToolButton::setTextLabel(_txt); 119 QToolButton::setTextLabel(_txt);
116//US d->m_instance = _instance; 120//US d->m_instance = _instance;
117 121
118 setFocusPolicy( NoFocus ); 122 setFocusPolicy( Qt::NoFocus );
119 123
120 // connect all of our slots and start trapping events 124 // connect all of our slots and start trapping events
121 connect(d->m_parent, SIGNAL( modechange() ), 125 connect(d->m_parent, SIGNAL( modechange() ),
122 this, SLOT( modeChange() )); 126 this, SLOT( modeChange() ));
123 127
124 connect(this, SIGNAL( clicked() ), 128 connect(this, SIGNAL( clicked() ),
125 this, SLOT( slotClicked() ) ); 129 this, SLOT( slotClicked() ) );
126 connect(this, SIGNAL( pressed() ), 130 connect(this, SIGNAL( pressed() ),
127 this, SLOT( slotPressed() ) ); 131 this, SLOT( slotPressed() ) );
128 connect(this, SIGNAL( released() ), 132 connect(this, SIGNAL( released() ),
129 this, SLOT( slotReleased() ) ); 133 this, SLOT( slotReleased() ) );
130 installEventFilter(this); 134 installEventFilter(this);
@@ -137,40 +141,40 @@ KToolBarButton::KToolBarButton( const QString& _icon, int _id,
137 141
138KToolBarButton::KToolBarButton( const QPixmap& pixmap, int _id, 142KToolBarButton::KToolBarButton( const QPixmap& pixmap, int _id,
139 QWidget *_parent, const char *name, 143 QWidget *_parent, const char *name,
140 const QString& txt) 144 const QString& txt)
141 : QToolButton( _parent, name ), d( 0 ) 145 : QToolButton( _parent, name ), d( 0 )
142{ 146{
143 d = new KToolBarButtonPrivate; 147 d = new KToolBarButtonPrivate;
144 148
145 d->m_id = _id; 149 d->m_id = _id;
146 d->m_parent = (KToolBar *) _parent; 150 d->m_parent = (KToolBar *) _parent;
147 QToolButton::setTextLabel(txt); 151 QToolButton::setTextLabel(txt);
148 152
149 setFocusPolicy( NoFocus ); 153 setFocusPolicy( Qt::NoFocus );
150 154
151 // connect all of our slots and start trapping events 155 // connect all of our slots and start trapping events
152 connect(d->m_parent, SIGNAL( modechange()), 156 connect(d->m_parent, SIGNAL( modechange()),
153 this, SLOT(modeChange())); 157 this, SLOT(modeChange()));
154 158
155 connect(this, SIGNAL( clicked() ), 159 connect(this, SIGNAL( clicked() ),
156 this, SLOT( slotClicked() )); 160 this, SLOT( slotClicked() ));
157 connect(this, SIGNAL( pressed() ), 161 connect(this, SIGNAL( pressed() ),
158 this, SLOT( slotPressed() )); 162 this, SLOT( slotPressed() ));
159 connect(this, SIGNAL( released() ), 163 connect(this, SIGNAL( released() ),
160 this, SLOT( slotReleased() )); 164 this, SLOT( slotReleased() ));
161 installEventFilter(this); 165 installEventFilter(this);
162 166
163 // set our pixmap and do our initial setup 167 // set our pixmap and do our initial setup
164 setIconSet( QIconSet( pixmap )); 168 setIconSet( QIcon( pixmap ));
165 modeChange(); 169 modeChange();
166} 170}
167 171
168KToolBarButton::~KToolBarButton() 172KToolBarButton::~KToolBarButton()
169{ 173{
170 delete d; d = 0; 174 delete d; d = 0;
171} 175}
172 176
173void KToolBarButton::modeChange() 177void KToolBarButton::modeChange()
174{ 178{
175 QSize mysize; 179 QSize mysize;
176 180
@@ -283,99 +287,99 @@ void KToolBarButton::setIcon( const QString &icon )
283 if (!strcmp(d->m_parent->name(), "mainToolBar")) 287 if (!strcmp(d->m_parent->name(), "mainToolBar"))
284/*US QToolButton::setIconSet( d->m_instance->iconLoader()->loadIconSet( 288/*US QToolButton::setIconSet( d->m_instance->iconLoader()->loadIconSet(
285 d->m_iconName, KIcon::MainToolbar, d->m_iconSize )); 289 d->m_iconName, KIcon::MainToolbar, d->m_iconSize ));
286*/ 290*/
287 QToolButton::setIconSet( KGlobal::iconLoader()->loadIconSet(d->m_iconName )); 291 QToolButton::setIconSet( KGlobal::iconLoader()->loadIconSet(d->m_iconName ));
288 else 292 else
289/*US QToolButton::setIconSet(d->m_instance->iconLoader()->loadIconSet( 293/*US QToolButton::setIconSet(d->m_instance->iconLoader()->loadIconSet(
290 d->m_iconName, KIcon::Toolbar, d->m_iconSize )); 294 d->m_iconName, KIcon::Toolbar, d->m_iconSize ));
291*/ 295*/
292 QToolButton::setIconSet(KGlobal::iconLoader()->loadIconSet(d->m_iconName)); 296 QToolButton::setIconSet(KGlobal::iconLoader()->loadIconSet(d->m_iconName));
293} 297}
294 298
295void KToolBarButton::setIconSet( const QIconSet &iconset ) 299void KToolBarButton::setIconSet( const QIcon &iconset )
296{ 300{
297 QToolButton::setIconSet( iconset ); 301 QToolButton::setIconSet( iconset );
298} 302}
299 303
300// remove? 304// remove?
301void KToolBarButton::setPixmap( const QPixmap &pixmap ) 305void KToolBarButton::setPixmap( const QPixmap &pixmap )
302{ 306{
303 if( pixmap.isNull()) // called by QToolButton 307 if( pixmap.isNull()) // called by QToolButton
304 { 308 {
305 QToolButton::setPixmap( pixmap ); 309 QToolButton::setPixmap( pixmap );
306 return; 310 return;
307 } 311 }
308 QIconSet set = iconSet(); 312 QIcon set = iconSet();
309 set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Active ); 313 set.setPixmap( pixmap, QIcon::Automatic, QIcon::Active );
310 QToolButton::setIconSet( set ); 314 QToolButton::setIconSet( set );
311} 315}
312 316
313void KToolBarButton::setDefaultPixmap( const QPixmap &pixmap ) 317void KToolBarButton::setDefaultPixmap( const QPixmap &pixmap )
314{ 318{
315 QIconSet set = iconSet(); 319 QIcon set = iconSet();
316 set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Normal ); 320 set.setPixmap( pixmap, QIcon::Automatic, QIcon::Normal );
317 QToolButton::setIconSet( set ); 321 QToolButton::setIconSet( set );
318} 322}
319 323
320void KToolBarButton::setDisabledPixmap( const QPixmap &pixmap ) 324void KToolBarButton::setDisabledPixmap( const QPixmap &pixmap )
321{ 325{
322 QIconSet set = iconSet(); 326 QIcon set = iconSet();
323 set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Disabled ); 327 set.setPixmap( pixmap, QIcon::Automatic, QIcon::Disabled );
324 QToolButton::setIconSet( set ); 328 QToolButton::setIconSet( set );
325} 329}
326 330
327void KToolBarButton::setDefaultIcon( const QString& icon ) 331void KToolBarButton::setDefaultIcon( const QString& icon )
328{ 332{
329 QIconSet set = iconSet(); 333 QIcon set = iconSet();
330 QPixmap pm; 334 QPixmap pm;
331 if (!strcmp(d->m_parent->name(), "mainToolBar")) 335 if (!strcmp(d->m_parent->name(), "mainToolBar"))
332 pm = /*US d->m_instance->iconLoader()*/KGlobal::iconLoader()->loadIcon( icon, KIcon::MainToolbar, 336 pm = /*US d->m_instance->iconLoader()*/KGlobal::iconLoader()->loadIcon( icon, KIcon::MainToolbar,
333 d->m_iconSize ); 337 d->m_iconSize );
334 else 338 else
335 pm = /*US d->m_instance->iconLoader()*/KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar, 339 pm = /*US d->m_instance->iconLoader()*/KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar,
336 d->m_iconSize ); 340 d->m_iconSize );
337 set.setPixmap( pm, QIconSet::Automatic, QIconSet::Normal ); 341 set.setPixmap( pm, QIcon::Automatic, QIcon::Normal );
338 QToolButton::setIconSet( set ); 342 QToolButton::setIconSet( set );
339} 343}
340 344
341void KToolBarButton::setDisabledIcon( const QString& icon ) 345void KToolBarButton::setDisabledIcon( const QString& icon )
342{ 346{
343 QIconSet set = iconSet(); 347 QIcon set = iconSet();
344 QPixmap pm; 348 QPixmap pm;
345 if (!strcmp(d->m_parent->name(), "mainToolBar")) 349 if (!strcmp(d->m_parent->name(), "mainToolBar"))
346 pm = /*US d->m_instance->iconLoader()*/ KGlobal::iconLoader()->loadIcon( icon, KIcon::MainToolbar, 350 pm = /*US d->m_instance->iconLoader()*/ KGlobal::iconLoader()->loadIcon( icon, KIcon::MainToolbar,
347 d->m_iconSize ); 351 d->m_iconSize );
348 else 352 else
349 pm = /*US d->m_instance->iconLoader()*/ KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar, 353 pm = /*US d->m_instance->iconLoader()*/ KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar,
350 d->m_iconSize ); 354 d->m_iconSize );
351 set.setPixmap( pm, QIconSet::Automatic, QIconSet::Disabled ); 355 set.setPixmap( pm, QIcon::Automatic, QIcon::Disabled );
352 QToolButton::setIconSet( set ); 356 QToolButton::setIconSet( set );
353} 357}
354 358
355QPopupMenu *KToolBarButton::popup() 359QMenu *KToolBarButton::popup()
356{ 360{
357 // obsolete 361 // obsolete
358 // KDE4: remove me 362 // KDE4: remove me
359 return QToolButton::popup(); 363 return QToolButton::popup();
360} 364}
361 365
362void KToolBarButton::setPopup(QPopupMenu *p, bool) 366void KToolBarButton::setPopup(Q3PopupMenu *p, bool)
363{ 367{
364 QToolButton::setPopup(p); 368 QToolButton::setPopup(p);
365 QToolButton::setPopupDelay(1); 369 QToolButton::setPopupDelay(1);
366} 370}
367 371
368 372
369void KToolBarButton::setDelayedPopup (QPopupMenu *p, bool) 373void KToolBarButton::setDelayedPopup (Q3PopupMenu *p, bool)
370{ 374{
371 QToolButton::setPopup(p); 375 QToolButton::setPopup(p);
372//US QToolButton::setPopupDelay(QApplication::startDragTime()); 376//US QToolButton::setPopupDelay(QApplication::startDragTime());
373} 377}
374 378
375void KToolBarButton::leaveEvent(QEvent *) 379void KToolBarButton::leaveEvent(QEvent *)
376{ 380{
377 if( d->m_isRaised || d->m_isActive ) 381 if( d->m_isRaised || d->m_isActive )
378 { 382 {
379 d->m_isRaised = false; 383 d->m_isRaised = false;
380 d->m_isActive = false; 384 d->m_isActive = false;
381 repaint(false); 385 repaint(false);
@@ -442,155 +446,161 @@ bool KToolBarButton::eventFilter(QObject *o, QEvent *ev)
442 { 446 {
443 emit doubleClicked(d->m_id); 447 emit doubleClicked(d->m_id);
444 return true; 448 return true;
445 } 449 }
446 } 450 }
447 451
448 return QToolButton::eventFilter(o, ev); 452 return QToolButton::eventFilter(o, ev);
449} 453}
450 454
451void KToolBarButton::drawButton( QPainter *_painter ) 455void KToolBarButton::drawButton( QPainter *_painter )
452{ 456{
453#ifdef DESKTOP_VERSION 457#ifdef DESKTOP_VERSION
454 QStyle::SFlags flags = QStyle::Style_Default; 458 QStyle::State flags = QStyle::State_None;
455 QStyle::SCFlags active = QStyle::SC_None; 459 QStyle::SubControls active = QStyle::SC_None;
456 460
457 if (isDown()) { 461 if (isDown()) {
458 flags |= QStyle::Style_Down; 462 flags |= QStyle::State_DownArrow;
459 active |= QStyle::SC_ToolButton; 463 active |= QStyle::SC_ToolButton;
460 } 464 }
461 if (isEnabled()) flags |= QStyle::Style_Enabled; 465 if (isEnabled()) flags |= QStyle::State_Enabled;
462 if (isOn()) flags |= QStyle::Style_On; 466 if (isOn()) flags |= QStyle::State_On;
463 if (isEnabled() && d->m_isRaised)flags |= QStyle::Style_Raised; 467 if (isEnabled() && d->m_isRaised)flags |= QStyle::State_Raised;
464 if (hasFocus())flags |= QStyle::Style_HasFocus; 468 if (hasFocus())flags |= QStyle::State_HasFocus;
469
470 QStyleOptionToolButton qsotb;
471 qsotb.initFrom(this);
472 qsotb.state = flags;
473 qsotb.activeSubControls = active;
474 qsotb.rect = rect();
475 qsotb.palette = palette();
465 476
466 // Draw a styled toolbutton 477 // Draw a styled toolbutton
467 style().drawComplexControl(QStyle::CC_ToolButton, _painter, this, rect(), 478 style()->drawComplexControl(QStyle::CC_ToolButton, &qsotb, _painter, this);
468 colorGroup(), flags, QStyle::SC_ToolButton, active, QStyleOption());
469 479
470#else 480#else
471 style().drawToolButton(_painter, rect().x(), rect().y(), rect().width(), rect().height(), colorGroup()); 481 style().drawToolButton(_painter, rect().x(), rect().y(), rect().width(), rect().height(), colorGroup());
472#endif 482#endif
473 int dx, dy; 483 int dx, dy;
474 QFont tmp_font(KGlobalSettings::toolBarFont()); 484 QFont tmp_font(KGlobalSettings::toolBarFont());
475 QFontMetrics fm(tmp_font); 485 QFontMetrics fm(tmp_font);
476 QRect textRect; 486 QRect textRect;
477 int textFlags = 0; 487 int textFlags = 0;
478 488
479 if (d->m_iconText == KToolBar::IconOnly) // icon only 489 if (d->m_iconText == KToolBar::IconOnly) // icon only
480 { 490 {
481/*US 491/*US
482 QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, 492 QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic,
483 isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : 493 isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) :
484 QIconSet::Disabled, 494 QIconSet::Disabled,
485 isOn() ? QIconSet::On : QIconSet::Off ); 495 isOn() ? QIconSet::On : QIconSet::Off );
486*/ 496*/
487 QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, 497 QPixmap pixmap = iconSet().pixmap( QIcon::Automatic,
488 isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : 498 isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) :
489 QIconSet::Disabled); 499 QIcon::Disabled);
490 500
491 if( !pixmap.isNull()) 501 if( !pixmap.isNull())
492 { 502 {
493 dx = ( width() - pixmap.width() ) / 2; 503 dx = ( width() - pixmap.width() ) / 2;
494 dy = ( height() - pixmap.height() ) / 2; 504 dy = ( height() - pixmap.height() ) / 2;
495 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ ) 505 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ )
496 { 506 {
497 ++dx; 507 ++dx;
498 ++dy; 508 ++dy;
499 } 509 }
500 _painter->drawPixmap( dx, dy, pixmap ); 510 _painter->drawPixmap( dx, dy, pixmap );
501 } 511 }
502 } 512 }
503 else if (d->m_iconText == KToolBar::IconTextRight) // icon and text (if any) 513 else if (d->m_iconText == KToolBar::IconTextRight) // icon and text (if any)
504 { 514 {
505/*US 515/*US
506 QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, 516 QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic,
507 isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : 517 isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) :
508 QIconSet::Disabled, 518 QIconSet::Disabled,
509 isOn() ? QIconSet::On : QIconSet::Off ); 519 isOn() ? QIconSet::On : QIconSet::Off );
510*/ 520*/
511 QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, 521 QPixmap pixmap = iconSet().pixmap( QIcon::Automatic,
512 isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : 522 isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) :
513 QIconSet::Disabled); 523 QIcon::Disabled);
514 524
515 if( !pixmap.isNull()) 525 if( !pixmap.isNull())
516 { 526 {
517 dx = 4; 527 dx = 4;
518 dy = ( height() - pixmap.height() ) / 2; 528 dy = ( height() - pixmap.height() ) / 2;
519 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ ) 529 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ )
520 { 530 {
521 ++dx; 531 ++dx;
522 ++dy; 532 ++dy;
523 } 533 }
524 _painter->drawPixmap( dx, dy, pixmap ); 534 _painter->drawPixmap( dx, dy, pixmap );
525 } 535 }
526 536
527 if (!textLabel().isNull()) 537 if (!textLabel().isNull())
528 { 538 {
529 textFlags = AlignVCenter|AlignLeft; 539 textFlags = Qt::AlignVCenter|Qt::AlignLeft;
530 if (!pixmap.isNull()) 540 if (!pixmap.isNull())
531 dx = 4 + pixmap.width() + 2; 541 dx = 4 + pixmap.width() + 2;
532 else 542 else
533 dx = 4; 543 dx = 4;
534 dy = 0; 544 dy = 0;
535 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ ) 545 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ )
536 { 546 {
537 ++dx; 547 ++dx;
538 ++dy; 548 ++dy;
539 } 549 }
540 textRect = QRect(dx, dy, width()-dx, height()); 550 textRect = QRect(dx, dy, width()-dx, height());
541 } 551 }
542 } 552 }
543 else if (d->m_iconText == KToolBar::TextOnly) 553 else if (d->m_iconText == KToolBar::TextOnly)
544 { 554 {
545 if (!textLabel().isNull()) 555 if (!textLabel().isNull())
546 { 556 {
547 textFlags = AlignVCenter|AlignLeft; 557 textFlags = Qt::AlignVCenter|Qt::AlignLeft;
548 dx = (width() - fm.width(textLabel())) / 2; 558 dx = (width() - fm.width(textLabel())) / 2;
549 dy = (height() - fm.lineSpacing()) / 2; 559 dy = (height() - fm.lineSpacing()) / 2;
550 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ ) 560 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ )
551 { 561 {
552 ++dx; 562 ++dx;
553 ++dy; 563 ++dy;
554 } 564 }
555 textRect = QRect( dx, dy, fm.width(textLabel()), fm.lineSpacing() ); 565 textRect = QRect( dx, dy, fm.width(textLabel()), fm.lineSpacing() );
556 } 566 }
557 } 567 }
558 else if (d->m_iconText == KToolBar::IconTextBottom) 568 else if (d->m_iconText == KToolBar::IconTextBottom)
559 { 569 {
560/*US 570/*US
561 QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, 571 QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic,
562 isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : 572 isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) :
563 QIconSet::Disabled, 573 QIconSet::Disabled,
564 isOn() ? QIconSet::On : QIconSet::Off ); 574 isOn() ? QIconSet::On : QIconSet::Off );
565*/ 575*/
566 QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, 576 QPixmap pixmap = iconSet().pixmap( QIcon::Automatic,
567 isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : 577 isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) :
568 QIconSet::Disabled); 578 QIcon::Disabled);
569 579
570 if( !pixmap.isNull()) 580 if( !pixmap.isNull())
571 { 581 {
572 dx = (width() - pixmap.width()) / 2; 582 dx = (width() - pixmap.width()) / 2;
573 dy = (height() - fm.lineSpacing() - pixmap.height()) / 2; 583 dy = (height() - fm.lineSpacing() - pixmap.height()) / 2;
574 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ ) 584 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ )
575 { 585 {
576 ++dx; 586 ++dx;
577 ++dy; 587 ++dy;
578 } 588 }
579 _painter->drawPixmap( dx, dy, pixmap ); 589 _painter->drawPixmap( dx, dy, pixmap );
580 } 590 }
581 591
582 if (!textLabel().isNull()) 592 if (!textLabel().isNull())
583 { 593 {
584 textFlags = AlignBottom|AlignHCenter; 594 textFlags = Qt::AlignBottom|Qt::AlignHCenter;
585 dx = (width() - fm.width(textLabel())) / 2; 595 dx = (width() - fm.width(textLabel())) / 2;
586 dy = height() - fm.lineSpacing() - 4; 596 dy = height() - fm.lineSpacing() - 4;
587 597
588 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ ) 598 if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ )
589 { 599 {
590 ++dx; 600 ++dx;
591 ++dy; 601 ++dy;
592 } 602 }
593 textRect = QRect( dx, dy, fm.width(textLabel()), fm.lineSpacing() ); 603 textRect = QRect( dx, dy, fm.width(textLabel()), fm.lineSpacing() );
594 } 604 }
595 } 605 }
596 606
@@ -601,32 +611,36 @@ void KToolBarButton::drawButton( QPainter *_painter )
601 if (!isEnabled()) 611 if (!isEnabled())
602 _painter->setPen(palette().disabled().dark()); 612 _painter->setPen(palette().disabled().dark());
603 else if(d->m_isRaised) 613 else if(d->m_isRaised)
604 _painter->setPen(KGlobalSettings::toolBarHighlightColor()); 614 _painter->setPen(KGlobalSettings::toolBarHighlightColor());
605 else 615 else
606 _painter->setPen( colorGroup().buttonText() ); 616 _painter->setPen( colorGroup().buttonText() );
607 _painter->drawText(textRect, textFlags, textLabel()); 617 _painter->drawText(textRect, textFlags, textLabel());
608 } 618 }
609 619
610 if (QToolButton::popup()) 620 if (QToolButton::popup())
611 { 621 {
612#ifdef DESKTOP_VERSION 622#ifdef DESKTOP_VERSION
613 QStyle::SFlags arrowFlags = QStyle::Style_Default; 623 QStyle::State arrowFlags = QStyle::State_None;
624
625 if (isDown())arrowFlags |= QStyle::State_DownArrow;
626 if (isEnabled()) arrowFlags |= QStyle::State_Enabled;
614 627
615 if (isDown())arrowFlags |= QStyle::Style_Down; 628 QStyleOption qso;
616 if (isEnabled()) arrowFlags |= QStyle::Style_Enabled; 629 qso.initFrom(this);
630 qso.state = arrowFlags;
631 qso.rect = QRect(width()-7, height()-7, 7, 7);
632 qso.palette = palette();
617 633
618 style().drawPrimitive(QStyle::PE_ArrowDown, _painter, 634 style()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &qso, _painter);
619 QRect(width()-7, height()-7, 7, 7), colorGroup(),
620 arrowFlags, QStyleOption() );
621#else 635#else
622 style().drawArrow(_painter, Qt::DownArrow, isDown(), 636 style().drawArrow(_painter, Qt::DownArrow, isDown(),
623 width()-7, height()-7, 7, 7, colorGroup(), isEnabled() ); 637 width()-7, height()-7, 7, 7, colorGroup(), isEnabled() );
624#endif 638#endif
625 639
626 } 640 }
627} 641}
628 642
629void KToolBarButton::paletteChange(const QPalette &) 643void KToolBarButton::paletteChange(const QPalette &)
630{ 644{
631 if(!d->m_isSeparator) 645 if(!d->m_isSeparator)
632 { 646 {
diff --git a/microkde/kdeui/ktoolbarbutton.h b/microkde/kdeui/ktoolbarbutton.h
index 9aaa13c..ad02e4e 100644
--- a/microkde/kdeui/ktoolbarbutton.h
+++ b/microkde/kdeui/ktoolbarbutton.h
@@ -17,33 +17,36 @@
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22 22
23// $Id$ 23// $Id$
24#ifndef _KTOOLBARBUTTON_H 24#ifndef _KTOOLBARBUTTON_H
25#define _KTOOLBARBUTTON_H 25#define _KTOOLBARBUTTON_H
26 26
27#include <qpixmap.h> 27#include <qpixmap.h>
28#include <qtoolbutton.h> 28#include <qtoolbutton.h>
29#include <qintdict.h> 29#include <q3intdict.h>
30#include <qstring.h> 30#include <qstring.h>
31//Added by qt3to4:
32#include <QEvent>
33#include <Q3PopupMenu>
31#include <kglobal.h> 34#include <kglobal.h>
32 35
33class KToolBar; 36class KToolBar;
34class KToolBarButtonPrivate; 37class KToolBarButtonPrivate;
35//USclass KInstance; 38//USclass KInstance;
36class QEvent; 39class QEvent;
37class QPopupMenu; 40class Q3PopupMenu;
38class QPainter; 41class QPainter;
39 42
40/** 43/**
41 * A toolbar button. This is used internally by @ref KToolBar, use the 44 * A toolbar button. This is used internally by @ref KToolBar, use the
42 * KToolBar methods instead. 45 * KToolBar methods instead.
43 * @internal 46 * @internal
44 */ 47 */
45class KToolBarButton : public QToolButton 48class KToolBarButton : public QToolButton
46{ 49{
47 Q_OBJECT 50 Q_OBJECT
48 51
49public: 52public:
@@ -141,25 +144,25 @@ public:
141 virtual void setIcon(const QString &icon); 144 virtual void setIcon(const QString &icon);
142 145
143 /// @since 3.1 146 /// @since 3.1
144 virtual void setIcon( const QPixmap &pixmap ) 147 virtual void setIcon( const QPixmap &pixmap )
145 { QToolButton::setIcon( pixmap ); } 148 { QToolButton::setIcon( pixmap ); }
146 149
147 /** 150 /**
148 * Set the pixmaps for this toolbar button from a QIconSet. 151 * Set the pixmaps for this toolbar button from a QIconSet.
149 * If you call this you don't need to call any of the other methods 152 * If you call this you don't need to call any of the other methods
150 * that set icons or pixmaps. 153 * that set icons or pixmaps.
151 * @param iconset The iconset to use 154 * @param iconset The iconset to use
152 */ 155 */
153 virtual void setIconSet( const QIconSet &iconset ); 156 virtual void setIconSet( const QIcon &iconset );
154 157
155#ifndef KDE_NO_COMPAT 158#ifndef KDE_NO_COMPAT
156 /** 159 /**
157 * @deprecated 160 * @deprecated
158 * Set the active icon for this button. The pixmap itself is loaded 161 * Set the active icon for this button. The pixmap itself is loaded
159 * internally based on the icon size... .. the disabled and default 162 * internally based on the icon size... .. the disabled and default
160 * pixmaps, however will only be constructed if @ref #generate is 163 * pixmaps, however will only be constructed if @ref #generate is
161 * true. This function is preferred over @ref setPixmap 164 * true. This function is preferred over @ref setPixmap
162 * 165 *
163 * @param icon The name of the active icon 166 * @param icon The name of the active icon
164 * @param generate If true, then the other icons are automagically 167 * @param generate If true, then the other icons are automagically
165 * generated from this one 168 * generated from this one
@@ -200,51 +203,51 @@ public:
200 /** 203 /**
201 * Turn this button into a toggle button or disable the toggle 204 * Turn this button into a toggle button or disable the toggle
202 * aspects of it. This does not toggle the button itself. 205 * aspects of it. This does not toggle the button itself.
203 * Use @ref toggle() for that. 206 * Use @ref toggle() for that.
204 * 207 *
205 * @param toggle true or false 208 * @param toggle true or false
206 */ 209 */
207 void setToggle(bool toggle = true); 210 void setToggle(bool toggle = true);
208 211
209 /** 212 /**
210 * Return a pointer to this button's popup menu (if it exists) 213 * Return a pointer to this button's popup menu (if it exists)
211 */ 214 */
212 QPopupMenu *popup(); 215 QMenu *popup();
213 216
214 /** 217 /**
215 * Returns the button's id. 218 * Returns the button's id.
216 * @since 3.2 219 * @since 3.2
217 */ 220 */
218 int id() const; 221 int id() const;
219 222
220 /** 223 /**
221 * Give this button a popup menu. There will not be a delay when 224 * Give this button a popup menu. There will not be a delay when
222 * you press the button. Use @ref setDelayedPopup if you want that 225 * you press the button. Use @ref setDelayedPopup if you want that
223 * behavior. 226 * behavior.
224 * 227 *
225 * @param p The new popup menu 228 * @param p The new popup menu
226 */ 229 */
227 void setPopup (QPopupMenu *p, bool unused = false); 230 void setPopup (Q3PopupMenu *p, bool unused = false);
228 231
229 /** 232 /**
230 * Gives this button a delayed popup menu. 233 * Gives this button a delayed popup menu.
231 * 234 *
232 * This function allows you to add a delayed popup menu to the button. 235 * This function allows you to add a delayed popup menu to the button.
233 * The popup menu is then only displayed when the button is pressed and 236 * The popup menu is then only displayed when the button is pressed and
234 * held down for about half a second. 237 * held down for about half a second.
235 * 238 *
236 * @param p the new popup menu 239 * @param p the new popup menu
237 */ 240 */
238 void setDelayedPopup(QPopupMenu *p, bool unused = false); 241 void setDelayedPopup(Q3PopupMenu *p, bool unused = false);
239 242
240 /** 243 /**
241 * Turn this button into a radio button 244 * Turn this button into a radio button
242 * 245 *
243 * @param f true or false 246 * @param f true or false
244 */ 247 */
245 void setRadio(bool f = true); 248 void setRadio(bool f = true);
246 249
247 /** 250 /**
248 * Toolbar buttons naturally will assume the global styles 251 * Toolbar buttons naturally will assume the global styles
249 * concerning icons, icons sizes, etc. You can use this function to 252 * concerning icons, icons sizes, etc. You can use this function to
250 * explicitely turn this off, if you like. 253 * explicitely turn this off, if you like.
@@ -294,20 +297,20 @@ protected slots:
294 297
295protected: 298protected:
296 virtual void virtual_hook( int id, void* data ); 299 virtual void virtual_hook( int id, void* data );
297private: 300private:
298 KToolBarButtonPrivate *d; 301 KToolBarButtonPrivate *d;
299}; 302};
300 303
301/** 304/**
302* List of @ref KToolBarButton objects. 305* List of @ref KToolBarButton objects.
303* @internal 306* @internal
304* @version $Id$ 307* @version $Id$
305*/ 308*/
306class KToolBarButtonList : public QIntDict<KToolBarButton> 309class KToolBarButtonList : public Q3IntDict<KToolBarButton>
307{ 310{
308public: 311public:
309 KToolBarButtonList(); 312 KToolBarButtonList();
310 ~KToolBarButtonList() {} 313 ~KToolBarButtonList() {}
311}; 314};
312 315
313#endif 316#endif
diff --git a/microkde/kdeui/ktoolbarhandler.cpp b/microkde/kdeui/ktoolbarhandler.cpp
index 7b97233..4d3ace7 100644
--- a/microkde/kdeui/ktoolbarhandler.cpp
+++ b/microkde/kdeui/ktoolbarhandler.cpp
@@ -9,25 +9,27 @@
9 but WITHOUT ANY WARRANTY; without even the implied warranty of 9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18 18
19#include "ktoolbarhandler.h" 19#include "ktoolbarhandler.h"
20 20
21#include <qpopupmenu.h> 21#include <q3popupmenu.h>
22//Added by qt3to4:
23#include <Q3PtrList>
22#include <kapplication.h> 24#include <kapplication.h>
23#include <ktoolbar.h> 25#include <ktoolbar.h>
24#include <kmainwindow.h> 26#include <kmainwindow.h>
25#include <klocale.h> 27#include <klocale.h>
26#include <kaction.h> 28#include <kaction.h>
27#include <assert.h> 29#include <assert.h>
28 30
29namespace 31namespace
30{ 32{
31 const char *actionListName = "show_menu_and_toolbar_actionlist"; 33 const char *actionListName = "show_menu_and_toolbar_actionlist";
32 34
33 const char *guiDescription = "" 35 const char *guiDescription = ""
@@ -35,25 +37,25 @@ namespace
35 "<MenuBar>" 37 "<MenuBar>"
36 " <Menu name=\"settings\">" 38 " <Menu name=\"settings\">"
37 " <ActionList name=\"%1\" />" 39 " <ActionList name=\"%1\" />"
38 " </Menu>" 40 " </Menu>"
39 "</MenuBar>" 41 "</MenuBar>"
40 "</kpartgui>"; 42 "</kpartgui>";
41 43
42 const char *resourceFileName = "barhandler.rc"; 44 const char *resourceFileName = "barhandler.rc";
43 45
44 class BarActionBuilder 46 class BarActionBuilder
45 { 47 {
46 public: 48 public:
47 BarActionBuilder( KActionCollection *actionCollection, KMainWindow *mainWindow, QPtrList<KToolBar> &oldToolBarList ) 49 BarActionBuilder( KActionCollection *actionCollection, KMainWindow *mainWindow, Q3PtrList<KToolBar> &oldToolBarList )
48 : m_actionCollection( actionCollection ), m_mainWindow( mainWindow ), m_needsRebuild( false ) 50 : m_actionCollection( actionCollection ), m_mainWindow( mainWindow ), m_needsRebuild( false )
49 { 51 {
50/*US 52/*US
51 QPtrList<QDockWindow> dockWindows = m_mainWindow->dockWindows(); 53 QPtrList<QDockWindow> dockWindows = m_mainWindow->dockWindows();
52 QPtrListIterator<QDockWindow> dockWindowIt( dockWindows ); 54 QPtrListIterator<QDockWindow> dockWindowIt( dockWindows );
53 for ( ; dockWindowIt.current(); ++dockWindowIt ) { 55 for ( ; dockWindowIt.current(); ++dockWindowIt ) {
54 56
55//US KToolBar *toolBar = dynamic_cast<KToolBar *>( dockWindowIt.current() ); 57//US KToolBar *toolBar = dynamic_cast<KToolBar *>( dockWindowIt.current() );
56 KToolBar *toolBar = (KToolBar *)( dockWindowIt.current() ); 58 KToolBar *toolBar = (KToolBar *)( dockWindowIt.current() );
57 if ( !toolBar ) 59 if ( !toolBar )
58 continue; 60 continue;
59 61
@@ -61,71 +63,71 @@ namespace
61 m_needsRebuild = true; 63 m_needsRebuild = true;
62 64
63 m_toolBars.append( toolBar ); 65 m_toolBars.append( toolBar );
64 } 66 }
65*/ 67*/
66 if ( !m_needsRebuild ) 68 if ( !m_needsRebuild )
67 m_needsRebuild = ( oldToolBarList.count() != m_toolBars.count() ); 69 m_needsRebuild = ( oldToolBarList.count() != m_toolBars.count() );
68 70
69 } 71 }
70 72
71 bool needsRebuild() const { return m_needsRebuild; } 73 bool needsRebuild() const { return m_needsRebuild; }
72 74
73 QPtrList<KAction> create() 75 Q3PtrList<KAction> create()
74 { 76 {
75 if ( !m_needsRebuild ) 77 if ( !m_needsRebuild )
76 return QPtrList<KAction>(); 78 return Q3PtrList<KAction>();
77 79
78 QPtrListIterator<KToolBar> toolBarIt( m_toolBars ); 80 Q3PtrListIterator<KToolBar> toolBarIt( m_toolBars );
79 for ( ; toolBarIt.current(); ++toolBarIt ) 81 for ( ; toolBarIt.current(); ++toolBarIt )
80 handleToolBar( toolBarIt.current() ); 82 handleToolBar( toolBarIt.current() );
81 83
82 QPtrList<KAction> actions; 84 Q3PtrList<KAction> actions;
83 85
84 if ( m_toolBarActions.count() == 0 ) 86 if ( m_toolBarActions.count() == 0 )
85 return actions; 87 return actions;
86 88
87 if ( m_toolBarActions.count() == 1 ) { 89 if ( m_toolBarActions.count() == 1 ) {
88 m_toolBarActions.getFirst()->setText( i18n( "Show Toolbar" ) ); 90 m_toolBarActions.getFirst()->setText( i18n( "Show Toolbar" ) );
89 return m_toolBarActions; 91 return m_toolBarActions;
90 } 92 }
91 93
92 KActionMenu *menuAction = new KActionMenu( i18n( "Toolbars" ), m_actionCollection, "toolbars_submenu_action" ); 94 KActionMenu *menuAction = new KActionMenu( i18n( "Toolbars" ), m_actionCollection, "toolbars_submenu_action" );
93 95
94 QPtrListIterator<KAction> actionIt( m_toolBarActions ); 96 Q3PtrListIterator<KAction> actionIt( m_toolBarActions );
95 for ( ; actionIt.current(); ++actionIt ) 97 for ( ; actionIt.current(); ++actionIt )
96 menuAction->insert( actionIt.current() ); 98 menuAction->insert( actionIt.current() );
97 99
98 actions.append( menuAction ); 100 actions.append( menuAction );
99 return actions; 101 return actions;
100 } 102 }
101 103
102 const QPtrList<KToolBar> &toolBars() const { return m_toolBars; } 104 const Q3PtrList<KToolBar> &toolBars() const { return m_toolBars; }
103 105
104 private: 106 private:
105 void handleToolBar( KToolBar *toolBar ) 107 void handleToolBar( KToolBar *toolBar )
106 { 108 {
107 KAction *action = new KToggleToolBarAction( toolBar, 109 KAction *action = new KToggleToolBarAction( toolBar,
108 i18n( "Show %1" ).arg( toolBar->label() ), 110 i18n( "Show %1" ).arg( toolBar->label() ),
109 m_actionCollection, 111 m_actionCollection,
110 toolBar->name() ); 112 toolBar->name() );
111 113
112 m_toolBarActions.append( action ); 114 m_toolBarActions.append( action );
113 } 115 }
114 116
115 KActionCollection *m_actionCollection; 117 KActionCollection *m_actionCollection;
116 KMainWindow *m_mainWindow; 118 KMainWindow *m_mainWindow;
117 119
118 QPtrList<KToolBar> m_toolBars; 120 Q3PtrList<KToolBar> m_toolBars;
119 QPtrList<KAction> m_toolBarActions; 121 Q3PtrList<KAction> m_toolBarActions;
120 122
121 bool m_needsRebuild : 1; 123 bool m_needsRebuild : 1;
122 }; 124 };
123} 125}
124 126
125using namespace KDEPrivate; 127using namespace KDEPrivate;
126 128
127ToolBarHandler::ToolBarHandler( KMainWindow *mainWindow, const char *name ) 129ToolBarHandler::ToolBarHandler( KMainWindow *mainWindow, const char *name )
128 : QObject( mainWindow, name ), KXMLGUIClient( mainWindow ) 130 : QObject( mainWindow, name ), KXMLGUIClient( mainWindow )
129{ 131{
130 init( mainWindow ); 132 init( mainWindow );
131} 133}
@@ -215,39 +217,39 @@ void ToolBarHandler::init( KMainWindow *mainWindow )
215 if ( domDocument().documentElement().isNull() ) { 217 if ( domDocument().documentElement().isNull() ) {
216 218
217 QString completeDescription = QString::fromLatin1( guiDescription ) 219 QString completeDescription = QString::fromLatin1( guiDescription )
218 .arg( actionListName ); 220 .arg( actionListName );
219 221
220 setXML( completeDescription, false*/ /*merge*/ /*); 222 setXML( completeDescription, false*/ /*merge*/ /*);
221 } 223 }
222*/ 224*/
223} 225}
224 226
225void ToolBarHandler::connectToActionContainers() 227void ToolBarHandler::connectToActionContainers()
226{ 228{
227 QPtrListIterator<KAction> actionIt( m_actions ); 229 Q3PtrListIterator<KAction> actionIt( m_actions );
228 for ( ; actionIt.current(); ++actionIt ) 230 for ( ; actionIt.current(); ++actionIt )
229 connectToActionContainer( actionIt.current() ); 231 connectToActionContainer( actionIt.current() );
230} 232}
231 233
232void ToolBarHandler::connectToActionContainer( KAction *action ) 234void ToolBarHandler::connectToActionContainer( KAction *action )
233{ 235{
234 uint containerCount = action->containerCount(); 236 uint containerCount = action->containerCount();
235 for ( uint i = 0; i < containerCount; ++i ) 237 for ( uint i = 0; i < containerCount; ++i )
236 connectToActionContainer( action->container( i ) ); 238 connectToActionContainer( action->container( i ) );
237} 239}
238 240
239void ToolBarHandler::connectToActionContainer( QWidget *container ) 241void ToolBarHandler::connectToActionContainer( QWidget *container )
240{ 242{
241//US QPopupMenu *popupMenu = dynamic_cast<QPopupMenu *>( container ); 243//US QPopupMenu *popupMenu = dynamic_cast<QPopupMenu *>( container );
242 QPopupMenu *popupMenu = (QPopupMenu *)( container ); 244 Q3PopupMenu *popupMenu = (Q3PopupMenu *)( container );
243 if ( !popupMenu ) 245 if ( !popupMenu )
244 return; 246 return;
245 247
246 connect( popupMenu, SIGNAL( aboutToShow() ), 248 connect( popupMenu, SIGNAL( aboutToShow() ),
247 this, SLOT( setupActions() ) ); 249 this, SLOT( setupActions() ) );
248} 250}
249 251
250//US #include "ktoolbarhandler.moc" 252//US #include "ktoolbarhandler.moc"
251 253
252/* vim: et sw=4 ts=4 254/* vim: et sw=4 ts=4
253 */ 255 */
diff --git a/microkde/kdeui/ktoolbarhandler.h b/microkde/kdeui/ktoolbarhandler.h
index a1340ae..35f0d18 100644
--- a/microkde/kdeui/ktoolbarhandler.h
+++ b/microkde/kdeui/ktoolbarhandler.h
@@ -11,26 +11,26 @@
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18 18
19#ifndef KBARHANDLER_H 19#ifndef KBARHANDLER_H
20#define KBARHANDLER_H 20#define KBARHANDLER_H
21 21
22#include <qobject.h> 22#include <qobject.h>
23#include <qguardedptr.h> 23#include <qpointer.h>
24#include <qptrlist.h> 24#include <q3ptrlist.h>
25#include <kxmlguiclient.h> 25#include <kxmlguiclient.h>
26#include <kaction.h> 26#include <kaction.h>
27 27
28class KMainWindow; 28class KMainWindow;
29class KToolBar; 29class KToolBar;
30 30
31namespace KDEPrivate 31namespace KDEPrivate
32{ 32{
33 33
34/// @since 3.1 34/// @since 3.1
35class ToolBarHandler : public QObject, public KXMLGUIClient 35class ToolBarHandler : public QObject, public KXMLGUIClient
36{ 36{
@@ -48,23 +48,23 @@ public slots:
48private slots: 48private slots:
49//US void clientAdded( KXMLGUIClient *client ); 49//US void clientAdded( KXMLGUIClient *client );
50 50
51private: 51private:
52 void init( KMainWindow *mainWindow ); 52 void init( KMainWindow *mainWindow );
53 void connectToActionContainers(); 53 void connectToActionContainers();
54 void connectToActionContainer( KAction *action ); 54 void connectToActionContainer( KAction *action );
55 void connectToActionContainer( QWidget *container ); 55 void connectToActionContainer( QWidget *container );
56 56
57 struct Data; 57 struct Data;
58 Data *d; 58 Data *d;
59 59
60 QGuardedPtr<KMainWindow> m_mainWindow; 60 QPointer<KMainWindow> m_mainWindow;
61 QPtrList<KAction> m_actions; 61 Q3PtrList<KAction> m_actions;
62 QPtrList<KToolBar> m_toolBars; 62 Q3PtrList<KToolBar> m_toolBars;
63}; 63};
64 64
65} // namespace KDEPrivate 65} // namespace KDEPrivate
66 66
67#endif // KBARHANDLER_H 67#endif // KBARHANDLER_H
68 68
69/* vim: et sw=4 ts=4 69/* vim: et sw=4 ts=4
70 */ 70 */
diff --git a/microkde/kdeui/kxmlguiclient.cpp b/microkde/kdeui/kxmlguiclient.cpp
index 073e30b..8740bde 100644
--- a/microkde/kdeui/kxmlguiclient.cpp
+++ b/microkde/kdeui/kxmlguiclient.cpp
@@ -30,85 +30,87 @@
30#include <qdom.h> 30#include <qdom.h>
31#include <qtextstream.h> 31#include <qtextstream.h>
32#include <qregexp.h> 32#include <qregexp.h>
33*/ 33*/
34 34
35//US #include <kinstance.h> 35//US #include <kinstance.h>
36#include <kstandarddirs.h> 36#include <kstandarddirs.h>
37#include <kdebug.h> 37#include <kdebug.h>
38#include <kaction.h> 38#include <kaction.h>
39#include <kapplication.h> 39#include <kapplication.h>
40 40
41#include <assert.h> 41#include <assert.h>
42//Added by qt3to4:
43#include <Q3PtrList>
42 44
43class KXMLGUIClientPrivate 45class KXMLGUIClientPrivate
44{ 46{
45public: 47public:
46 KXMLGUIClientPrivate() 48 KXMLGUIClientPrivate()
47 { 49 {
48//US m_instance = KGlobal::instance(); 50//US m_instance = KGlobal::instance();
49//US m_factory = 0L; 51//US m_factory = 0L;
50 m_parent = 0L; 52 m_parent = 0L;
51//US m_builder = 0L; 53//US m_builder = 0L;
52 m_actionCollection = 0; 54 m_actionCollection = 0;
53 } 55 }
54 ~KXMLGUIClientPrivate() 56 ~KXMLGUIClientPrivate()
55 { 57 {
56 } 58 }
57 59
58//US KInstance *m_instance; 60//US KInstance *m_instance;
59 61
60//US QDomDocument m_doc; 62//US QDomDocument m_doc;
61 KActionCollection *m_actionCollection; 63 KActionCollection *m_actionCollection;
62//US QDomDocument m_buildDocument; 64//US QDomDocument m_buildDocument;
63//US KXMLGUIFactory *m_factory; 65//US KXMLGUIFactory *m_factory;
64 KXMLGUIClient *m_parent; 66 KXMLGUIClient *m_parent;
65 //QPtrList<KXMLGUIClient> m_supers; 67 //QPtrList<KXMLGUIClient> m_supers;
66 QPtrList<KXMLGUIClient> m_children; 68 Q3PtrList<KXMLGUIClient> m_children;
67//US KXMLGUIBuilder *m_builder; 69//US KXMLGUIBuilder *m_builder;
68//US QString m_xmlFile; 70//US QString m_xmlFile;
69//US QString m_localXMLFile; 71//US QString m_localXMLFile;
70}; 72};
71 73
72KXMLGUIClient::KXMLGUIClient() 74KXMLGUIClient::KXMLGUIClient()
73{ 75{
74 d = new KXMLGUIClientPrivate; 76 d = new KXMLGUIClientPrivate;
75} 77}
76 78
77KXMLGUIClient::KXMLGUIClient( KXMLGUIClient *parent ) 79KXMLGUIClient::KXMLGUIClient( KXMLGUIClient *parent )
78{ 80{
79 d = new KXMLGUIClientPrivate; 81 d = new KXMLGUIClientPrivate;
80 parent->insertChildClient( this ); 82 parent->insertChildClient( this );
81} 83}
82 84
83KXMLGUIClient::~KXMLGUIClient() 85KXMLGUIClient::~KXMLGUIClient()
84{ 86{
85 if ( d->m_parent ) 87 if ( d->m_parent )
86 d->m_parent->removeChildClient( this ); 88 d->m_parent->removeChildClient( this );
87 89
88 QPtrListIterator<KXMLGUIClient> it( d->m_children ); 90 Q3PtrListIterator<KXMLGUIClient> it( d->m_children );
89 for ( ; it.current(); ++it ) { 91 for ( ; it.current(); ++it ) {
90 assert( it.current()->d->m_parent == this ); 92 assert( it.current()->d->m_parent == this );
91 it.current()->d->m_parent = 0; 93 it.current()->d->m_parent = 0;
92 } 94 }
93 95
94 delete d->m_actionCollection; 96 delete d->m_actionCollection;
95 delete d; 97 delete d;
96} 98}
97 99
98KAction *KXMLGUIClient::action( const char *name ) const 100KAction *KXMLGUIClient::action( const char *name ) const
99{ 101{
100 KAction* act = actionCollection()->action( name ); 102 KAction* act = actionCollection()->action( name );
101 if ( !act ) { 103 if ( !act ) {
102 QPtrListIterator<KXMLGUIClient> childIt( d->m_children ); 104 Q3PtrListIterator<KXMLGUIClient> childIt( d->m_children );
103 for (; childIt.current(); ++childIt ) { 105 for (; childIt.current(); ++childIt ) {
104 act = childIt.current()->actionCollection()->action( name ); 106 act = childIt.current()->actionCollection()->action( name );
105 if ( act ) 107 if ( act )
106 break; 108 break;
107 } 109 }
108 } 110 }
109 return act; 111 return act;
110} 112}
111 113
112KActionCollection *KXMLGUIClient::actionCollection() const 114KActionCollection *KXMLGUIClient::actionCollection() const
113{ 115{
114 if ( !d->m_actionCollection ) 116 if ( !d->m_actionCollection )
@@ -579,43 +581,43 @@ void KXMLGUIClient::removeChildClient( KXMLGUIClient *child )
579 d->m_children.removeRef( child ); 581 d->m_children.removeRef( child );
580 child->d->m_parent = 0; 582 child->d->m_parent = 0;
581} 583}
582 584
583/*bool KXMLGUIClient::addSuperClient( KXMLGUIClient *super ) 585/*bool KXMLGUIClient::addSuperClient( KXMLGUIClient *super )
584{ 586{
585 if ( d->m_supers.contains( super ) ) 587 if ( d->m_supers.contains( super ) )
586 return false; 588 return false;
587 d->m_supers.append( super ); 589 d->m_supers.append( super );
588 return true; 590 return true;
589}*/ 591}*/
590 592
591const QPtrList<KXMLGUIClient> *KXMLGUIClient::childClients() 593const Q3PtrList<KXMLGUIClient> *KXMLGUIClient::childClients()
592{ 594{
593 return &d->m_children; 595 return &d->m_children;
594} 596}
595/*US 597/*US
596void KXMLGUIClient::setClientBuilder( KXMLGUIBuilder *builder ) 598void KXMLGUIClient::setClientBuilder( KXMLGUIBuilder *builder )
597{ 599{
598 d->m_builder = builder; 600 d->m_builder = builder;
599 if ( builder ) 601 if ( builder )
600 builder->setBuilderInstance( instance() ); 602 builder->setBuilderInstance( instance() );
601} 603}
602 604
603KXMLGUIBuilder *KXMLGUIClient::clientBuilder() const 605KXMLGUIBuilder *KXMLGUIClient::clientBuilder() const
604{ 606{
605 return d->m_builder; 607 return d->m_builder;
606} 608}
607*/ 609*/
608 610
609void KXMLGUIClient::plugActionList( const QString &name, const QPtrList<KAction> &actionList ) 611void KXMLGUIClient::plugActionList( const QString &name, const Q3PtrList<KAction> &actionList )
610{ 612{
611/*US 613/*US
612 if ( !d->m_factory ) 614 if ( !d->m_factory )
613 return; 615 return;
614 616
615 d->m_factory->plugActionList( this, name, actionList ); 617 d->m_factory->plugActionList( this, name, actionList );
616*/ 618*/
617} 619}
618 620
619void KXMLGUIClient::unplugActionList( const QString &name ) 621void KXMLGUIClient::unplugActionList( const QString &name )
620{ 622{
621/*US 623/*US
diff --git a/microkde/kdeui/kxmlguiclient.h b/microkde/kdeui/kxmlguiclient.h
index cd74c8e..b9d7b09 100644
--- a/microkde/kdeui/kxmlguiclient.h
+++ b/microkde/kdeui/kxmlguiclient.h
@@ -12,25 +12,25 @@
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19#ifndef _KXMLGUICLIENT_H 19#ifndef _KXMLGUICLIENT_H
20#define _KXMLGUICLIENT_H 20#define _KXMLGUICLIENT_H
21 21
22 22
23//US #include <qdom.h> 23//US #include <qdom.h>
24#include <qptrlist.h> 24#include <q3ptrlist.h>
25#include <qmap.h> 25#include <qmap.h>
26#include <qstringlist.h> 26#include <qstringlist.h>
27 27
28class QWidget; 28class QWidget;
29class KAction; 29class KAction;
30class KActionCollection; 30class KActionCollection;
31class KInstance; 31class KInstance;
32 32
33class KXMLGUIClientPrivate; 33class KXMLGUIClientPrivate;
34class KXMLGUIFactory; 34class KXMLGUIFactory;
35class KXMLGUIBuilder; 35class KXMLGUIBuilder;
36 36
@@ -152,25 +152,25 @@ public:
152 * arent argument. 152 * arent argument.
153 */ 153 */
154 void insertChildClient( KXMLGUIClient *child ); 154 void insertChildClient( KXMLGUIClient *child );
155 155
156 /** 156 /**
157 * Removes the given @p child from the client's children list. 157 * Removes the given @p child from the client's children list.
158 */ 158 */
159 void removeChildClient( KXMLGUIClient *child ); 159 void removeChildClient( KXMLGUIClient *child );
160 160
161 /** 161 /**
162 * Retrieves a list of all child clients. 162 * Retrieves a list of all child clients.
163 */ 163 */
164 const QPtrList<KXMLGUIClient> *childClients(); 164 const Q3PtrList<KXMLGUIClient> *childClients();
165 165
166 /** 166 /**
167 * A client can have an own @ref KXMLGUIBuilder. 167 * A client can have an own @ref KXMLGUIBuilder.
168 * Use this method to assign your builder instance to the client (so that the 168 * Use this method to assign your builder instance to the client (so that the
169 * @ref KXMLGUIFactory can use it when building the client's GUI) 169 * @ref KXMLGUIFactory can use it when building the client's GUI)
170 * 170 *
171 * Client specific guibuilders are useful if you want to create 171 * Client specific guibuilders are useful if you want to create
172 * custom container widgets for your GUI. 172 * custom container widgets for your GUI.
173 */ 173 */
174//US void setClientBuilder( KXMLGUIBuilder *builder ); 174//US void setClientBuilder( KXMLGUIBuilder *builder );
175 175
176 /** 176 /**
@@ -219,25 +219,25 @@ public:
219 * unplugActionList( "xxx_file_actionlist" ); 219 * unplugActionList( "xxx_file_actionlist" );
220 * plugActionList( "xxx_file_actionlist", file_actions ); 220 * plugActionList( "xxx_file_actionlist", file_actions );
221 * \endcode 221 * \endcode
222 * every time a file is selected, unselected or ... 222 * every time a file is selected, unselected or ...
223 * 223 *
224 * \note You should not call createGUI() after calling this 224 * \note You should not call createGUI() after calling this
225 * function. In fact, that would remove the newly added 225 * function. In fact, that would remove the newly added
226 * actionlists again... 226 * actionlists again...
227 * \note Forgetting to call unplugActionList() before 227 * \note Forgetting to call unplugActionList() before
228 * plugActionList() would leave the previous actions in the 228 * plugActionList() would leave the previous actions in the
229 * menu too.. 229 * menu too..
230 */ 230 */
231 void plugActionList( const QString &name, const QPtrList<KAction> &actionList ); 231 void plugActionList( const QString &name, const Q3PtrList<KAction> &actionList );
232 232
233 /** 233 /**
234 * The complement of \ref plugActionList() ... 234 * The complement of \ref plugActionList() ...
235 */ 235 */
236 void unplugActionList( const QString &name ); 236 void unplugActionList( const QString &name );
237 237
238//US static QString findMostRecentXMLFile( const QStringList &files, QString &doc ); 238//US static QString findMostRecentXMLFile( const QStringList &files, QString &doc );
239 239
240 void addStateActionEnabled(const QString& state, const QString& action); 240 void addStateActionEnabled(const QString& state, const QString& action);
241 241
242 void addStateActionDisabled(const QString& state, const QString& action); 242 void addStateActionDisabled(const QString& state, const QString& action);
243 243
diff --git a/microkde/kdialog.cpp b/microkde/kdialog.cpp
index 8398956..57e7ea6 100644
--- a/microkde/kdialog.cpp
+++ b/microkde/kdialog.cpp
@@ -1,19 +1,21 @@
1 1
2#include <kdialog.h> 2#include <kdialog.h>
3#include <qapp.h> 3#include <qapplication.h>
4#include <qlabel.h> 4#include <qlabel.h>
5#include <qpushbutton.h> 5#include <qpushbutton.h>
6#include <qlayout.h> 6#include <qlayout.h>
7#include <qprogressbar.h> 7#include <q3progressbar.h>
8//Added by qt3to4:
9#include <Q3VBoxLayout>
8#include <klocale.h> 10#include <klocale.h>
9 11
10KDialog::KDialog( QWidget *parent, const char *name, bool modal ) : 12KDialog::KDialog( QWidget *parent, const char *name, bool modal ) :
11 QDialog( parent, name, modal ) 13 QDialog( parent, name, modal )
12{ 14{
13 ; 15 ;
14 16
15} 17}
16#ifdef DESKTOP_VERSION 18#ifdef DESKTOP_VERSION
17int KDialog::spacingHint() { return 7; } 19int KDialog::spacingHint() { return 7; }
18int KDialog::marginHint() { return 7; } 20int KDialog::marginHint() { return 7; }
19 21
@@ -21,27 +23,27 @@ int KDialog::spacingHintSmall() { return 4; }
21int KDialog::marginHintSmall() { return 4; } 23int KDialog::marginHintSmall() { return 4; }
22 24
23#else 25#else
24int KDialog::spacingHint() { return 3; } 26int KDialog::spacingHint() { return 3; }
25int KDialog::marginHint() { return 3; } 27int KDialog::marginHint() { return 3; }
26 28
27int KDialog::spacingHintSmall() { return 1; } 29int KDialog::spacingHintSmall() { return 1; }
28int KDialog::marginHintSmall() { return 1; } 30int KDialog::marginHintSmall() { return 1; }
29#endif 31#endif
30KProgressDialog::KProgressDialog( QWidget *parent, const char *name, bool modal ) : 32KProgressDialog::KProgressDialog( QWidget *parent, const char *name, bool modal ) :
31 QDialog( parent, name, modal ) 33 QDialog( parent, name, modal )
32{ 34{
33 QVBoxLayout* lay= new QVBoxLayout ( this ); 35 Q3VBoxLayout* lay= new Q3VBoxLayout ( this );
34 mLabel = new QLabel ( "abc",this ); 36 mLabel = new QLabel ( "abc",this );
35 mBar = new QProgressBar ( this ); 37 mBar = new Q3ProgressBar ( this );
36 mButton = new QPushButton ( i18n("Cancel"),this ); 38 mButton = new QPushButton ( i18n("Cancel"),this );
37 lay->addWidget ( mLabel ); 39 lay->addWidget ( mLabel );
38 lay->addWidget ( mBar ); 40 lay->addWidget ( mBar );
39 lay->addWidget ( mButton ); 41 lay->addWidget ( mButton );
40 connect ( mButton , SIGNAL ( clicked () ), this, SIGNAL ( cancelled () )); 42 connect ( mButton , SIGNAL ( clicked () ), this, SIGNAL ( cancelled () ));
41 resize ( 220, sizeHint().height() +mLabel->sizeHint().height()); 43 resize ( 220, sizeHint().height() +mLabel->sizeHint().height());
42 44
43} 45}
44 46
45void KProgressDialog::setLabelText ( const QString & t) 47void KProgressDialog::setLabelText ( const QString & t)
46{ 48{
47 mLabel->setText( t ); 49 mLabel->setText( t );
diff --git a/microkde/kdialog.h b/microkde/kdialog.h
index bc80689..5f9bf0e 100644
--- a/microkde/kdialog.h
+++ b/microkde/kdialog.h
@@ -1,18 +1,20 @@
1#ifndef MINIKDE_KDIALOG_H 1#ifndef MINIKDE_KDIALOG_H
2#define MINIKDE_KDIALOG_H 2#define MINIKDE_KDIALOG_H
3 3
4#include <qdialog.h> 4#include <qdialog.h>
5//Added by qt3to4:
6#include <QLabel>
5class QLabel; 7class QLabel;
6class QProgressBar; 8class Q3ProgressBar;
7class QPushButton ; 9class QPushButton ;
8 10
9class KDialog : public QDialog 11class KDialog : public QDialog
10{ 12{
11 Q_OBJECT 13 Q_OBJECT
12 public: 14 public:
13 KDialog( QWidget *parent=0, const char *name=0, bool modal=true ); 15 KDialog( QWidget *parent=0, const char *name=0, bool modal=true );
14 16
15 static int spacingHint(); 17 static int spacingHint();
16 static int marginHint(); 18 static int marginHint();
17 static int spacingHintSmall(); 19 static int spacingHintSmall();
18 static int marginHintSmall(); 20 static int marginHintSmall();
@@ -20,19 +22,19 @@ class KDialog : public QDialog
20class KProgressDialog : public QDialog 22class KProgressDialog : public QDialog
21{ 23{
22 Q_OBJECT 24 Q_OBJECT
23 public: 25 public:
24 KProgressDialog( QWidget *parent=0, const char *name=0, bool modal=false ); 26 KProgressDialog( QWidget *parent=0, const char *name=0, bool modal=false );
25 void setLabelText ( const QString & ); 27 void setLabelText ( const QString & );
26 void setTotalSteps ( int totalSteps ); 28 void setTotalSteps ( int totalSteps );
27 void setProgress ( int progress ); 29 void setProgress ( int progress );
28 void accept(); 30 void accept();
29 void reject(); 31 void reject();
30 private: 32 private:
31 QLabel * mLabel; 33 QLabel * mLabel;
32 QProgressBar *mBar; 34 Q3ProgressBar *mBar;
33 QPushButton *mButton; 35 QPushButton *mButton;
34 signals: 36 signals:
35 void cancelled (); 37 void cancelled ();
36}; 38};
37 39
38#endif 40#endif
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp
index d5c7e61..a40bad6 100644
--- a/microkde/kdialogbase.cpp
+++ b/microkde/kdialogbase.cpp
@@ -1,16 +1,20 @@
1#include <qtabwidget.h> 1#include <qtabwidget.h>
2#include <qpushbutton.h> 2#include <qpushbutton.h>
3#include <qlayout.h> 3#include <qlayout.h>
4#include <qframe.h> 4#include <q3frame.h>
5//Added by qt3to4:
6#include <QPixmap>
7#include <Q3HBoxLayout>
8#include <Q3VBoxLayout>
5 9
6 10
7#include "klocale.h" 11#include "klocale.h"
8#include "kdebug.h" 12#include "kdebug.h"
9 13
10#include "kdialogbase.h" 14#include "kdialogbase.h"
11 15
12KDialogBase::KDialogBase() 16KDialogBase::KDialogBase()
13{ 17{
14} 18}
15 19
16KDialogBase::KDialogBase( QWidget *parent, const char *name, bool modal, 20KDialogBase::KDialogBase( QWidget *parent, const char *name, bool modal,
@@ -126,53 +130,53 @@ void KDialogBase::hideButtons()
126 if ( mUser2Button ) mUser2Button->hide() ; 130 if ( mUser2Button ) mUser2Button->hide() ;
127 if ( mOkButton ) mOkButton->hide() ; 131 if ( mOkButton ) mOkButton->hide() ;
128 if ( mApplyButton ) mApplyButton->hide() ; 132 if ( mApplyButton ) mApplyButton->hide() ;
129 if ( mDefaultButton ) mDefaultButton->hide(); 133 if ( mDefaultButton ) mDefaultButton->hide();
130 if ( mCancelButton ) mCancelButton->hide() ; 134 if ( mCancelButton ) mCancelButton->hide() ;
131 if ( mCloseButton ) mCloseButton->hide() ; 135 if ( mCloseButton ) mCloseButton->hide() ;
132 136
133} 137}
134void KDialogBase::initLayout() 138void KDialogBase::initLayout()
135{ 139{
136 140
137 delete mTopLayout; 141 delete mTopLayout;
138 mTopLayout = new QVBoxLayout( this ); 142 mTopLayout = new Q3VBoxLayout( this );
139 mTopLayout->setMargin( marginHintSmall() ); 143 mTopLayout->setMargin( marginHintSmall() );
140 mTopLayout->setSpacing( spacingHintSmall() ); 144 mTopLayout->setSpacing( spacingHintSmall() );
141 145
142 mTopLayout->addWidget( mMainWidget ); 146 mTopLayout->addWidget( mMainWidget );
143 147
144 QBoxLayout *buttonLayout = new QHBoxLayout; 148 Q3BoxLayout *buttonLayout = new Q3HBoxLayout;
145 mTopLayout->addLayout( buttonLayout ); 149 mTopLayout->addLayout( buttonLayout );
146 150
147 if ( mUser1Button ) buttonLayout->addWidget( mUser1Button ); 151 if ( mUser1Button ) buttonLayout->addWidget( mUser1Button );
148 if ( mUser2Button ) buttonLayout->addWidget( mUser2Button ); 152 if ( mUser2Button ) buttonLayout->addWidget( mUser2Button );
149 if ( mOkButton ) buttonLayout->addWidget( mOkButton ); 153 if ( mOkButton ) buttonLayout->addWidget( mOkButton );
150 if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); 154 if ( mApplyButton ) buttonLayout->addWidget( mApplyButton );
151 if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton ); 155 if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton );
152 if ( mCancelButton ) buttonLayout->addWidget( mCancelButton ); 156 if ( mCancelButton ) buttonLayout->addWidget( mCancelButton );
153 if ( mCloseButton ) buttonLayout->addWidget( mCloseButton ); 157 if ( mCloseButton ) buttonLayout->addWidget( mCloseButton );
154 buttonLayout->setMargin( marginHintSmall() ); 158 buttonLayout->setMargin( marginHintSmall() );
155 buttonLayout->setSpacing( spacingHintSmall() ); 159 buttonLayout->setSpacing( spacingHintSmall() );
156} 160}
157 161
158QFrame *KDialogBase::addPage( const QString &name ) 162Q3Frame *KDialogBase::addPage( const QString &name )
159{ 163{
160// kdDebug() << "KDialogBase::addPage(): " << name << endl; 164// kdDebug() << "KDialogBase::addPage(): " << name << endl;
161 QFrame *frame = new QFrame( tabWidget() ); 165 Q3Frame *frame = new Q3Frame( tabWidget() );
162 tabWidget()->addTab( frame, name ); 166 tabWidget()->addTab( frame, name );
163 return frame; 167 return frame;
164} 168}
165 169
166QFrame *KDialogBase::addPage( const QString &name, int, const QPixmap & ) 170Q3Frame *KDialogBase::addPage( const QString &name, int, const QPixmap & )
167{ 171{
168 return addPage( name ); 172 return addPage( name );
169} 173}
170 174
171 175
172void KDialogBase::setMainWidget( QWidget *widget ) 176void KDialogBase::setMainWidget( QWidget *widget )
173{ 177{
174 kdDebug() << "KDialogBase::setMainWidget()" << endl; 178 kdDebug() << "KDialogBase::setMainWidget()" << endl;
175 179
176 mMainWidget = widget; 180 mMainWidget = widget;
177 initLayout(); 181 initLayout();
178} 182}
@@ -245,28 +249,28 @@ void KDialogBase::showButton( ButtonCode id, bool show )
245 249
246int KDialogBase::pageIndex( QWidget *widget ) const 250int KDialogBase::pageIndex( QWidget *widget ) const
247{ 251{
248 return 0; 252 return 0;
249} 253}
250 254
251 255
252bool KDialogBase::showPage( int index ) 256bool KDialogBase::showPage( int index )
253{ 257{
254 tabWidget()->setCurrentPage( index );return false; 258 tabWidget()->setCurrentPage( index );return false;
255} 259}
256 260
257QFrame *KDialogBase::plainPage() 261Q3Frame *KDialogBase::plainPage()
258{ 262{
259 if ( !mPlainPage ) { 263 if ( !mPlainPage ) {
260 mPlainPage = new QFrame( this ); 264 mPlainPage = new Q3Frame( this );
261 setMainWidget( mPlainPage ); 265 setMainWidget( mPlainPage );
262 } 266 }
263 return mPlainPage; 267 return mPlainPage;
264} 268}
265 269
266void KDialogBase::slotOk() 270void KDialogBase::slotOk()
267{ 271{
268 emit okClicked(); 272 emit okClicked();
269 accept(); 273 accept();
270} 274}
271 275
272void KDialogBase::slotApply() 276void KDialogBase::slotApply()
diff --git a/microkde/kdialogbase.h b/microkde/kdialogbase.h
index 17c186b..64cbd17 100644
--- a/microkde/kdialogbase.h
+++ b/microkde/kdialogbase.h
@@ -1,23 +1,25 @@
1#ifndef MINIKDE_KDIALOGBASE_H 1#ifndef MINIKDE_KDIALOGBASE_H
2#define MINIKDE_KDIALOGBASE_H 2#define MINIKDE_KDIALOGBASE_H
3 3
4#include <qframe.h> 4#include <q3frame.h>
5//Added by qt3to4:
6#include <QPixmap>
5 7
6#include "kdialog.h" 8#include "kdialog.h"
7 9
8class QPushButton; 10class QPushButton;
9class QLayout; 11class QLayout;
10class QTabWidget; 12class QTabWidget;
11class QBoxLayout; 13class Q3BoxLayout;
12 14
13class KDialogBase : public KDialog 15class KDialogBase : public KDialog
14{ 16{
15 Q_OBJECT 17 Q_OBJECT
16 public: 18 public:
17 enum ButtonCode 19 enum ButtonCode
18 { 20 {
19 Help = 0x00000001, 21 Help = 0x00000001,
20 Default = 0x00000002, 22 Default = 0x00000002,
21 Ok = 0x00000004, 23 Ok = 0x00000004,
22 Apply = 0x00000008, 24 Apply = 0x00000008,
23 Try = 0x00000010, 25 Try = 0x00000010,
@@ -50,43 +52,43 @@ class KDialogBase : public KDialog
50 const QString &user1=QString::null, 52 const QString &user1=QString::null,
51 const QString &user2=QString::null, 53 const QString &user2=QString::null,
52 const QString &user3=QString::null); 54 const QString &user3=QString::null);
53 KDialogBase( int dialogFace, const QString &caption, 55 KDialogBase( int dialogFace, const QString &caption,
54 int buttonMask, ButtonCode defaultButton, 56 int buttonMask, ButtonCode defaultButton,
55 QWidget *parent=0, const char *name=0, bool modal=true, 57 QWidget *parent=0, const char *name=0, bool modal=true,
56 bool separator=false, 58 bool separator=false,
57 const QString &user1=QString::null, 59 const QString &user1=QString::null,
58 const QString &user2=QString::null, 60 const QString &user2=QString::null,
59 const QString &user3=QString::null); 61 const QString &user3=QString::null);
60 virtual ~KDialogBase(); 62 virtual ~KDialogBase();
61 63
62 QFrame *addPage( const QString & ); 64 Q3Frame *addPage( const QString & );
63 QFrame *addPage( const QString &, int, const QPixmap & ); 65 Q3Frame *addPage( const QString &, int, const QPixmap & );
64 66
65 void setMainWidget( QWidget *widget ); 67 void setMainWidget( QWidget *widget );
66 68
67 void setButtonText( ButtonCode id, const QString &text ); 69 void setButtonText( ButtonCode id, const QString &text );
68 70
69 void enableButton( ButtonCode id, bool state ); 71 void enableButton( ButtonCode id, bool state );
70 void enableButtonOK( bool state ); 72 void enableButtonOK( bool state );
71 void enableButtonApply( bool state ); 73 void enableButtonApply( bool state );
72 74
73 void showButton( ButtonCode, bool show ); 75 void showButton( ButtonCode, bool show );
74 76
75 int pageIndex( QWidget *widget ) const; 77 int pageIndex( QWidget *widget ) const;
76 78
77 bool showPage( int index ); 79 bool showPage( int index );
78 void hideButtons(); 80 void hideButtons();
79 81
80 QFrame *plainPage(); 82 Q3Frame *plainPage();
81 83
82 signals: 84 signals:
83 void user1Clicked(); 85 void user1Clicked();
84 void user2Clicked(); 86 void user2Clicked();
85 /** 87 /**
86 * The Apply button was pressed. This signal is only emitted if 88 * The Apply button was pressed. This signal is only emitted if
87 * @ref slotApply() is not replaced. 89 * @ref slotApply() is not replaced.
88 */ 90 */
89 void applyClicked(); 91 void applyClicked();
90 92
91 /** 93 /**
92 * The OK button was pressed. This signal is only emitted if 94 * The OK button was pressed. This signal is only emitted if
@@ -119,25 +121,25 @@ class KDialogBase : public KDialog
119 virtual void accept (); 121 virtual void accept ();
120 protected: 122 protected:
121 QPushButton *findButton( ButtonCode ); 123 QPushButton *findButton( ButtonCode );
122 QTabWidget *tabWidget(); 124 QTabWidget *tabWidget();
123 125
124 private: 126 private:
125 void init( const QString &caption, int buttonMask, 127 void init( const QString &caption, int buttonMask,
126 const QString &user1=QString::null, const QString &user2=QString::null ); 128 const QString &user1=QString::null, const QString &user2=QString::null );
127 void initLayout(); 129 void initLayout();
128 130
129 QWidget *mMainWidget; 131 QWidget *mMainWidget;
130 QTabWidget *mTabWidget; 132 QTabWidget *mTabWidget;
131 QFrame *mPlainPage; 133 Q3Frame *mPlainPage;
132 QBoxLayout *mTopLayout; 134 Q3BoxLayout *mTopLayout;
133 135
134 QPushButton *mUser1Button; 136 QPushButton *mUser1Button;
135 QPushButton *mUser2Button; 137 QPushButton *mUser2Button;
136 QPushButton *mCloseButton; 138 QPushButton *mCloseButton;
137 QPushButton *mOkButton; 139 QPushButton *mOkButton;
138 QPushButton *mApplyButton; 140 QPushButton *mApplyButton;
139 QPushButton *mCancelButton; 141 QPushButton *mCancelButton;
140 QPushButton *mDefaultButton; 142 QPushButton *mDefaultButton;
141}; 143};
142 144
143#endif 145#endif
diff --git a/microkde/keditlistbox.cpp b/microkde/keditlistbox.cpp
index 55b7784..257a44a 100644
--- a/microkde/keditlistbox.cpp
+++ b/microkde/keditlistbox.cpp
@@ -12,66 +12,69 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qstringlist.h> 21#include <qstringlist.h>
22#include <qpushbutton.h> 22#include <qpushbutton.h>
23#include <qlayout.h> 23#include <qlayout.h>
24#include <qgroupbox.h> 24#include <q3groupbox.h>
25#include <qlistbox.h> 25#include <q3listbox.h>
26#include <qwhatsthis.h> 26#include <q3whatsthis.h>
27#include <qlabel.h> 27#include <qlabel.h>
28//Added by qt3to4:
29#include <Q3GridLayout>
30#include <Q3StrList>
28 31
29#include <kcombobox.h> 32#include <kcombobox.h>
30#include <kdebug.h> 33#include <kdebug.h>
31#include <kdialog.h> 34#include <kdialog.h>
32#include <klineedit.h> 35#include <klineedit.h>
33#include <klocale.h> 36#include <klocale.h>
34#include <kapplication.h> 37#include <kapplication.h>
35#include <knotifyclient.h> 38#include <knotifyclient.h>
36 39
37#include "keditlistbox.h" 40#include "keditlistbox.h"
38 41
39#include <assert.h> 42#include <assert.h>
40 43
41class KEditListBoxPrivate 44class KEditListBoxPrivate
42{ 45{
43public: 46public:
44 bool m_checkAtEntering; 47 bool m_checkAtEntering;
45 int buttons; 48 int buttons;
46}; 49};
47 50
48KEditListBox::KEditListBox(QWidget *parent, const char *name, 51KEditListBox::KEditListBox(QWidget *parent, const char *name,
49 bool checkAtEntering, int buttons ) 52 bool checkAtEntering, int buttons )
50 :QGroupBox(parent, name ) 53 :Q3GroupBox(parent, name )
51{ 54{
52 init( checkAtEntering, buttons ); 55 init( checkAtEntering, buttons );
53} 56}
54 57
55KEditListBox::KEditListBox(const QString& title, QWidget *parent, 58KEditListBox::KEditListBox(const QString& title, QWidget *parent,
56 const char *name, bool checkAtEntering, int buttons) 59 const char *name, bool checkAtEntering, int buttons)
57 :QGroupBox(title, parent, name ) 60 :Q3GroupBox(title, parent, name )
58{ 61{
59 init( checkAtEntering, buttons ); 62 init( checkAtEntering, buttons );
60} 63}
61 64
62KEditListBox::KEditListBox(const QString& title, const CustomEditor& custom, 65KEditListBox::KEditListBox(const QString& title, const CustomEditor& custom,
63 QWidget *parent, const char *name, 66 QWidget *parent, const char *name,
64 bool checkAtEntering, int buttons) 67 bool checkAtEntering, int buttons)
65 :QGroupBox(title, parent, name ) 68 :Q3GroupBox(title, parent, name )
66{ 69{
67 m_lineEdit = custom.lineEdit(); 70 m_lineEdit = custom.lineEdit();
68 init( checkAtEntering, buttons, custom.representationWidget() ); 71 init( checkAtEntering, buttons, custom.representationWidget() );
69} 72}
70 73
71KEditListBox::~KEditListBox() 74KEditListBox::~KEditListBox()
72{ 75{
73 delete d; 76 delete d;
74 d=0; 77 d=0;
75} 78}
76 79
77void KEditListBox::init( bool checkAtEntering, int buttons, 80void KEditListBox::init( bool checkAtEntering, int buttons,
@@ -86,39 +89,39 @@ void KEditListBox::init( bool checkAtEntering, int buttons,
86 lostButtons++; 89 lostButtons++;
87 if ( (buttons & Remove) == 0 ) 90 if ( (buttons & Remove) == 0 )
88 lostButtons++; 91 lostButtons++;
89 if ( (buttons & UpDown) == 0 ) 92 if ( (buttons & UpDown) == 0 )
90 lostButtons += 2; 93 lostButtons += 2;
91 94
92 95
93 servNewButton = servRemoveButton = servUpButton = servDownButton = 0L; 96 servNewButton = servRemoveButton = servUpButton = servDownButton = 0L;
94 setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, 97 setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,
95 QSizePolicy::MinimumExpanding)); 98 QSizePolicy::MinimumExpanding));
96 99
97 QWidget * gb = this; 100 QWidget * gb = this;
98 QGridLayout * grid = new QGridLayout(gb, 7 - lostButtons, 2, 101 Q3GridLayout * grid = new Q3GridLayout(gb, 7 - lostButtons, 2,
99 KDialog::marginHint(), 102 KDialog::marginHint(),
100 KDialog::spacingHint()); 103 KDialog::spacingHint());
101 grid->addRowSpacing(0, fontMetrics().lineSpacing()); 104 grid->addRowSpacing(0, fontMetrics().lineSpacing());
102 for ( int i = 1; i < 7 - lostButtons; i++ ) 105 for ( int i = 1; i < 7 - lostButtons; i++ )
103 grid->setRowStretch(i, 1); 106 grid->setRowStretch(i, 1);
104 107
105 grid->setMargin(15); 108 grid->setMargin(15);
106 109
107 if ( representationWidget ) 110 if ( representationWidget )
108 representationWidget->reparent( gb, QPoint(0,0) ); 111 representationWidget->reparent( gb, QPoint(0,0) );
109 else 112 else
110 m_lineEdit=new KLineEdit(gb); 113 m_lineEdit=new KLineEdit(gb);
111 114
112 m_listBox = new QListBox(gb); 115 m_listBox = new Q3ListBox(gb);
113 116
114 QWidget *editingWidget = representationWidget ? 117 QWidget *editingWidget = representationWidget ?
115 representationWidget : m_lineEdit; 118 representationWidget : m_lineEdit;
116 grid->addMultiCellWidget(editingWidget,1,1,0,1); 119 grid->addMultiCellWidget(editingWidget,1,1,0,1);
117 grid->addMultiCellWidget(m_listBox, 2, 6 - lostButtons, 0, 0); 120 grid->addMultiCellWidget(m_listBox, 2, 6 - lostButtons, 0, 0);
118 int row = 2; 121 int row = 2;
119 if ( buttons & Add ) { 122 if ( buttons & Add ) {
120 servNewButton = new QPushButton(i18n("&Add"), gb); 123 servNewButton = new QPushButton(i18n("&Add"), gb);
121 servNewButton->setEnabled(false); 124 servNewButton->setEnabled(false);
122 connect(servNewButton, SIGNAL(clicked()), SLOT(addItem())); 125 connect(servNewButton, SIGNAL(clicked()), SLOT(addItem()));
123 126
124 grid->addWidget(servNewButton, row++, 1); 127 grid->addWidget(servNewButton, row++, 1);
@@ -195,48 +198,48 @@ void KEditListBox::moveItemUp()
195 { 198 {
196 KNotifyClient::beep(); 199 KNotifyClient::beep();
197 return; 200 return;
198 } 201 }
199 202
200 unsigned int selIndex = m_listBox->currentItem(); 203 unsigned int selIndex = m_listBox->currentItem();
201 if (selIndex == 0) 204 if (selIndex == 0)
202 { 205 {
203 KNotifyClient::beep(); 206 KNotifyClient::beep();
204 return; 207 return;
205 } 208 }
206 209
207 QListBoxItem *selItem = m_listBox->item(selIndex); 210 Q3ListBoxItem *selItem = m_listBox->item(selIndex);
208 m_listBox->takeItem(selItem); 211 m_listBox->takeItem(selItem);
209 m_listBox->insertItem(selItem, selIndex-1); 212 m_listBox->insertItem(selItem, selIndex-1);
210 m_listBox->setCurrentItem(selIndex - 1); 213 m_listBox->setCurrentItem(selIndex - 1);
211 214
212 emit changed(); 215 emit changed();
213} 216}
214 217
215void KEditListBox::moveItemDown() 218void KEditListBox::moveItemDown()
216{ 219{
217 if (!m_listBox->isEnabled()) 220 if (!m_listBox->isEnabled())
218 { 221 {
219 KNotifyClient::beep(); 222 KNotifyClient::beep();
220 return; 223 return;
221 } 224 }
222 225
223 unsigned int selIndex = m_listBox->currentItem(); 226 unsigned int selIndex = m_listBox->currentItem();
224 if (selIndex == m_listBox->count() - 1) 227 if (selIndex == m_listBox->count() - 1)
225 { 228 {
226 KNotifyClient::beep(); 229 KNotifyClient::beep();
227 return; 230 return;
228 } 231 }
229 232
230 QListBoxItem *selItem = m_listBox->item(selIndex); 233 Q3ListBoxItem *selItem = m_listBox->item(selIndex);
231 m_listBox->takeItem(selItem); 234 m_listBox->takeItem(selItem);
232 m_listBox->insertItem(selItem, selIndex+1); 235 m_listBox->insertItem(selItem, selIndex+1);
233 m_listBox->setCurrentItem(selIndex + 1); 236 m_listBox->setCurrentItem(selIndex + 1);
234 237
235 emit changed(); 238 emit changed();
236} 239}
237 240
238void KEditListBox::addItem() 241void KEditListBox::addItem()
239{ 242{
240 // when m_checkAtEntering is true, the add-button is disabled, but this 243 // when m_checkAtEntering is true, the add-button is disabled, but this
241 // slot can still be called through Key_Return/Key_Enter. So we guard 244 // slot can still be called through Key_Return/Key_Enter. So we guard
242 // against this. 245 // against this.
@@ -340,32 +343,34 @@ void KEditListBox::enableMoveButtons(int index)
340void KEditListBox::clear() 343void KEditListBox::clear()
341{ 344{
342 m_lineEdit->clear(); 345 m_lineEdit->clear();
343 m_listBox->clear(); 346 m_listBox->clear();
344 emit changed(); 347 emit changed();
345} 348}
346 349
347void KEditListBox::insertStringList(const QStringList& list, int index) 350void KEditListBox::insertStringList(const QStringList& list, int index)
348{ 351{
349 m_listBox->insertStringList(list,index); 352 m_listBox->insertStringList(list,index);
350} 353}
351 354
352void KEditListBox::insertStrList(const QStrList* list, int index) 355void KEditListBox::insertStrList(const Q3StrList* list, int index)
353{ 356{
354 m_listBox->insertStrList(list,index); 357 for(Q3StrList::const_iterator i=list->begin();i!=list->end();++i)
358 m_listBox->insertItem(*i,index++);
355} 359}
356 360
357void KEditListBox::insertStrList(const QStrList& list, int index) 361void KEditListBox::insertStrList(const Q3StrList& list, int index)
358{ 362{
359 m_listBox->insertStrList(list,index); 363 for(Q3StrList::const_iterator i=list.begin();i!=list.end();++i)
364 m_listBox->insertItem(*i,index++);
360} 365}
361 366
362void KEditListBox::insertStrList(const char ** list, int numStrings, int index) 367void KEditListBox::insertStrList(const char ** list, int numStrings, int index)
363{ 368{
364 m_listBox->insertStrList(list,numStrings,index); 369 m_listBox->insertStrList(list,numStrings,index);
365} 370}
366 371
367QStringList KEditListBox::items() const 372QStringList KEditListBox::items() const
368{ 373{
369 QStringList list; 374 QStringList list;
370 for ( uint i = 0; i < m_listBox->count(); i++ ) 375 for ( uint i = 0; i < m_listBox->count(); i++ )
371 list.append( m_listBox->text( i )); 376 list.append( m_listBox->text( i ));
diff --git a/microkde/keditlistbox.h b/microkde/keditlistbox.h
index 130d933..e43d958 100644
--- a/microkde/keditlistbox.h
+++ b/microkde/keditlistbox.h
@@ -11,41 +11,43 @@
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#ifndef KEDITLISTBOX_H 20#ifndef KEDITLISTBOX_H
21#define KEDITLISTBOX_H 21#define KEDITLISTBOX_H
22 22
23#include <qgroupbox.h> 23#include <q3groupbox.h>
24#include <qlistbox.h> 24#include <q3listbox.h>
25//Added by qt3to4:
26#include <Q3StrList>
25 27
26class KLineEdit; 28class KLineEdit;
27class KComboBox; 29class KComboBox;
28class QPushButton; 30class QPushButton;
29 31
30class KEditListBoxPrivate; 32class KEditListBoxPrivate;
31/** 33/**
32 * An editable listbox 34 * An editable listbox
33 * 35 *
34 * This class provides a editable listbox ;-), this means 36 * This class provides a editable listbox ;-), this means
35 * a listbox which is accompanied by a line edit to enter new 37 * a listbox which is accompanied by a line edit to enter new
36 * items into the listbox and pushbuttons to add and remove 38 * items into the listbox and pushbuttons to add and remove
37 * items from the listbox and two buttons to move items up and down. 39 * items from the listbox and two buttons to move items up and down.
38 */ 40 */
39class KEditListBox : public QGroupBox 41class KEditListBox : public Q3GroupBox
40{ 42{
41 Q_OBJECT 43 Q_OBJECT
42 44
43public: 45public:
44 /// @since 3.1 46 /// @since 3.1
45 class CustomEditor 47 class CustomEditor
46 { 48 {
47 public: 49 public:
48 CustomEditor() 50 CustomEditor()
49 : m_representationWidget( 0L ), 51 : m_representationWidget( 0L ),
50 m_lineEdit( 0L ) {} 52 m_lineEdit( 0L ) {}
51 CustomEditor( QWidget *repWidget, KLineEdit *edit ) 53 CustomEditor( QWidget *repWidget, KLineEdit *edit )
@@ -117,25 +119,25 @@ public:
117 * @since 3.1 119 * @since 3.1
118 */ 120 */
119 KEditListBox( const QString& title, 121 KEditListBox( const QString& title,
120 const CustomEditor &customEditor, 122 const CustomEditor &customEditor,
121 QWidget *parent = 0, const char *name = 0, 123 QWidget *parent = 0, const char *name = 0,
122 bool checkAtEntering = false, int buttons = All ); 124 bool checkAtEntering = false, int buttons = All );
123 125
124 virtual ~KEditListBox(); 126 virtual ~KEditListBox();
125 127
126 /** 128 /**
127 * Return a pointer to the embedded QListBox. 129 * Return a pointer to the embedded QListBox.
128 */ 130 */
129 QListBox* listBox() const { return m_listBox; } 131 Q3ListBox* listBox() const { return m_listBox; }
130 /** 132 /**
131 * Return a pointer to the embedded QLineEdit. 133 * Return a pointer to the embedded QLineEdit.
132 */ 134 */
133 KLineEdit* lineEdit() const { return m_lineEdit; } 135 KLineEdit* lineEdit() const { return m_lineEdit; }
134 /** 136 /**
135 * Return a pointer to the Add button 137 * Return a pointer to the Add button
136 */ 138 */
137 QPushButton* addButton() const { return servNewButton; } 139 QPushButton* addButton() const { return servNewButton; }
138 /** 140 /**
139 * Return a pointer to the Remove button 141 * Return a pointer to the Remove button
140 */ 142 */
141 QPushButton* removeButton() const { return servRemoveButton; } 143 QPushButton* removeButton() const { return servRemoveButton; }
@@ -150,29 +152,29 @@ public:
150 152
151 /** 153 /**
152 * See @ref QListBox::count() 154 * See @ref QListBox::count()
153 */ 155 */
154 int count() const { return int(m_listBox->count()); } 156 int count() const { return int(m_listBox->count()); }
155 /** 157 /**
156 * See @ref QListBox::insertStringList() 158 * See @ref QListBox::insertStringList()
157 */ 159 */
158 void insertStringList(const QStringList& list, int index=-1); 160 void insertStringList(const QStringList& list, int index=-1);
159 /** 161 /**
160 * See @ref QListBox::insertStringList() 162 * See @ref QListBox::insertStringList()
161 */ 163 */
162 void insertStrList(const QStrList* list, int index=-1); 164 void insertStrList(const Q3StrList* list, int index=-1);
163 /** 165 /**
164 * See @ref QListBox::insertStrList() 166 * See @ref QListBox::insertStrList()
165 */ 167 */
166 void insertStrList(const QStrList& list, int index=-1); 168 void insertStrList(const Q3StrList& list, int index=-1);
167 /** 169 /**
168 * See @ref QListBox::insertStrList() 170 * See @ref QListBox::insertStrList()
169 */ 171 */
170 void insertStrList(const char ** list, int numStrings=-1, int index=-1); 172 void insertStrList(const char ** list, int numStrings=-1, int index=-1);
171 /** 173 /**
172 * See @ref QListBox::insertItem() 174 * See @ref QListBox::insertItem()
173 */ 175 */
174 void insertItem(const QString& text, int index=-1) {m_listBox->insertItem(text,index);} 176 void insertItem(const QString& text, int index=-1) {m_listBox->insertItem(text,index);}
175 /** 177 /**
176 * Clears both the listbox and the line edit. 178 * Clears both the listbox and the line edit.
177 */ 179 */
178 void clear(); 180 void clear();
@@ -198,25 +200,25 @@ public:
198 void changed(); 200 void changed();
199 201
200 protected slots: 202 protected slots:
201 //the names should be self-explaining 203 //the names should be self-explaining
202 void moveItemUp(); 204 void moveItemUp();
203 void moveItemDown(); 205 void moveItemDown();
204 void addItem(); 206 void addItem();
205 void removeItem(); 207 void removeItem();
206 void enableMoveButtons(int index); 208 void enableMoveButtons(int index);
207 void typedSomething(const QString& text); 209 void typedSomething(const QString& text);
208 210
209 private: 211 private:
210 QListBox *m_listBox; 212 Q3ListBox *m_listBox;
211 QPushButton *servUpButton, *servDownButton; 213 QPushButton *servUpButton, *servDownButton;
212 QPushButton *servNewButton, *servRemoveButton; 214 QPushButton *servNewButton, *servRemoveButton;
213 KLineEdit *m_lineEdit; 215 KLineEdit *m_lineEdit;
214 216
215 //this is called in both ctors, to avoid code duplication 217 //this is called in both ctors, to avoid code duplication
216 void init( bool checkAtEntering, int buttons, 218 void init( bool checkAtEntering, int buttons,
217 QWidget *representationWidget = 0L ); 219 QWidget *representationWidget = 0L );
218 220
219 protected: 221 protected:
220 virtual void virtual_hook( int id, void* data ); 222 virtual void virtual_hook( int id, void* data );
221 private: 223 private:
222 //our lovely private d-pointer 224 //our lovely private d-pointer
diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp
index 383e711..c1bfdef 100644
--- a/microkde/kfiledialog.cpp
+++ b/microkde/kfiledialog.cpp
@@ -1,28 +1,30 @@
1#include <kfiledialog.h> 1#include <kfiledialog.h>
2#include <qdialog.h> 2#include <qdialog.h>
3#include <qlayout.h> 3#include <qlayout.h>
4#include <qdir.h> 4#include <qdir.h>
5#include <qfileinfo.h> 5#include <qfileinfo.h>
6#include <qapplication.h> 6#include <qapplication.h>
7//Added by qt3to4:
8#include <Q3VBoxLayout>
7 9
8#ifndef DESKTOP_VERSION 10#ifndef DESKTOP_VERSION
9//US orig#include <ofileselector.h> 11//US orig#include <ofileselector.h>
10#include <ofileselector_p.h> 12#include <ofileselector_p.h>
11QString KFileDialog::getSaveFileName( const QString & fn, 13QString KFileDialog::getSaveFileName( const QString & fn,
12 const QString & cap , QWidget * par ) 14 const QString & cap , QWidget * par )
13{ 15{
14 QString retfile = ""; 16 QString retfile = "";
15 QDialog dia ( par, "input-dialog", true ); 17 QDialog dia ( par, "input-dialog", true );
16 QVBoxLayout lay( &dia ); 18 Q3VBoxLayout lay( &dia );
17 lay.setMargin(7); 19 lay.setMargin(7);
18 lay.setSpacing(7); 20 lay.setSpacing(7);
19 QString file = fn; 21 QString file = fn;
20 if ( file.isEmpty() ) 22 if ( file.isEmpty() )
21 file = QDir::homeDirPath()+"/*"; 23 file = QDir::homeDirPath()+"/*";
22 QFileInfo fi ( file ); 24 QFileInfo fi ( file );
23 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); 25 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() );
24 QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); 26 QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) );
25 lay.addWidget( &o); 27 lay.addWidget( &o);
26 // o.setNewVisible( true ); 28 // o.setNewVisible( true );
27 // o.setNameVisible( true ); 29 // o.setNameVisible( true );
28 dia.showMaximized(); 30 dia.showMaximized();
@@ -33,56 +35,56 @@ QString KFileDialog::getSaveFileName( const QString & fn,
33 int res = dia.exec(); 35 int res = dia.exec();
34 if ( res ) 36 if ( res )
35 retfile = o.selectedName(); 37 retfile = o.selectedName();
36 return retfile; 38 return retfile;
37} 39}
38 40
39QString KFileDialog::getOpenFileName( const QString & fn, 41QString KFileDialog::getOpenFileName( const QString & fn,
40 const QString & cap, QWidget * par ) 42 const QString & cap, QWidget * par )
41{ 43{
42 QString retfile = ""; 44 QString retfile = "";
43 QDialog dia ( par, "input-dialog", true ); 45 QDialog dia ( par, "input-dialog", true );
44 // QLineEdit lab ( &dia ); 46 // QLineEdit lab ( &dia );
45 QVBoxLayout lay( &dia ); 47 Q3VBoxLayout lay( &dia );
46 lay.setMargin(7); 48 lay.setMargin(7);
47 lay.setSpacing(7); 49 lay.setSpacing(7);
48 QString file = fn; 50 QString file = fn;
49 if ( file.isEmpty() ) 51 if ( file.isEmpty() )
50 file = QDir::homeDirPath()+"/*";; 52 file = QDir::homeDirPath()+"/*";;
51 QFileInfo fi ( file ); 53 QFileInfo fi ( file );
52 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); 54 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() );
53 QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); 55 QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) );
54 lay.addWidget( &o); 56 lay.addWidget( &o);
55 dia.showMaximized(); 57 dia.showMaximized();
56 dia.setCaption( cap ); 58 dia.setCaption( cap );
57 int res = dia.exec(); 59 int res = dia.exec();
58 if ( res ) 60 if ( res )
59 retfile = o.selectedName(); 61 retfile = o.selectedName();
60 return retfile; 62 return retfile;
61} 63}
62QString KFileDialog::getExistingDirectory( const QString & fn, 64QString KFileDialog::getExistingDirectory( const QString & fn,
63 const QString & cap, QWidget * par ) 65 const QString & cap, QWidget * par )
64{ 66{
65 return KFileDialog::getSaveFileName( fn, cap, par ); 67 return KFileDialog::getSaveFileName( fn, cap, par );
66} 68}
67#else 69#else
68 70
69#include <qfiledialog.h> 71#include <q3filedialog.h>
70 72
71QString KFileDialog::getSaveFileName( const QString & fn, 73QString KFileDialog::getSaveFileName( const QString & fn,
72 const QString & cap , QWidget * par ) 74 const QString & cap , QWidget * par )
73{ 75{
74 return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); 76 return Q3FileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap );
75} 77}
76QString KFileDialog::getOpenFileName( const QString & fn, 78QString KFileDialog::getOpenFileName( const QString & fn,
77 const QString & cap, QWidget * par ) 79 const QString & cap, QWidget * par )
78{ 80{
79 81
80 return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); 82 return Q3FileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap );
81} 83}
82QString KFileDialog::getExistingDirectory( const QString & fn, 84QString KFileDialog::getExistingDirectory( const QString & fn,
83 const QString & cap, QWidget * par ) 85 const QString & cap, QWidget * par )
84{ 86{
85 return QFileDialog::getExistingDirectory( fn, par, "exidtingdir", cap ); 87 return Q3FileDialog::getExistingDirectory( fn, par, "exidtingdir", cap );
86} 88}
87#endif 89#endif
88 90
diff --git a/microkde/kfontdialog.cpp b/microkde/kfontdialog.cpp
index 174123c..f83c2a8 100644
--- a/microkde/kfontdialog.cpp
+++ b/microkde/kfontdialog.cpp
@@ -1,27 +1,29 @@
1#include "kfontdialog.h" 1#include "kfontdialog.h"
2#ifndef DESKTOP_VERSION 2#ifndef DESKTOP_VERSION
3#include "ofontselector.h" 3#include "ofontselector.h"
4#else 4#else
5#include <qfontdialog.h> 5#include <qfontdialog.h>
6#endif 6#endif
7#include <qdialog.h> 7#include <qdialog.h>
8#include <qlayout.h> 8#include <qlayout.h>
9#include <qpushbutton.h> 9#include <qpushbutton.h>
10//Added by qt3to4:
11#include <Q3VBoxLayout>
10QFont KFontDialog::getFont( const QFont & f, bool & ok ) 12QFont KFontDialog::getFont( const QFont & f, bool & ok )
11{ 13{
12#ifndef DESKTOP_VERSION 14#ifndef DESKTOP_VERSION
13 QDialog d( 0, "fd", true );; 15 QDialog d( 0, "fd", true );;
14 OFontSelector s ( true, &d, "fontsel"); 16 OFontSelector s ( true, &d, "fontsel");
15 QVBoxLayout l ( &d ); 17 Q3VBoxLayout l ( &d );
16 l.addWidget( &s ); 18 l.addWidget( &s );
17 s.setSelectedFont ( f ); 19 s.setSelectedFont ( f );
18 QPushButton b ( "OK", &d ); 20 QPushButton b ( "OK", &d );
19 l.addWidget( &b ); 21 l.addWidget( &b );
20 qDebug("size %d ", f.bold()); 22 qDebug("size %d ", f.bold());
21 QObject::connect( &b, SIGNAL( clicked () ), &d, SLOT ( accept () ) ); 23 QObject::connect( &b, SIGNAL( clicked () ), &d, SLOT ( accept () ) );
22 d.show(); 24 d.show();
23 ok = false; 25 ok = false;
24 if ( d.exec () ) { 26 if ( d.exec () ) {
25 ok = true; 27 ok = true;
26 return s.selectedFont ( ); 28 return s.selectedFont ( );
27 } 29 }
diff --git a/microkde/kglobal.cpp b/microkde/kglobal.cpp
index 53edd08..9cc5835 100644
--- a/microkde/kglobal.cpp
+++ b/microkde/kglobal.cpp
@@ -1,28 +1,29 @@
1#include "kglobal.h" 1#include "kglobal.h"
2#include "kstandarddirs.h" 2#include "kstandarddirs.h"
3#include <qkeycode.h> 3#include <qnamespace.h>
4#include <qapplication.h> 4#include <qapplication.h>
5#include <QDesktopWidget>
5 6
6KLocale *KGlobal::mLocale = 0; 7KLocale *KGlobal::mLocale = 0;
7KConfig *KGlobal::mConfig = 0; 8KConfig *KGlobal::mConfig = 0;
8KIconLoader *KGlobal::mIconLoader = 0; 9KIconLoader *KGlobal::mIconLoader = 0;
9KStandardDirs *KGlobal::mDirs = 0; 10KStandardDirs *KGlobal::mDirs = 0;
10 11
11QString KGlobal::mAppName = "godot"; 12QString KGlobal::mAppName = "godot";
12 13
13KLocale *KGlobal::locale() 14KLocale *KGlobal::locale()
14{ 15{
15 if ( !mLocale ) { 16 if ( !mLocale ) {
16 ASSERT(mAppName); 17 Q_ASSERT(!mAppName.isEmpty());
17 18
18 mLocale = new KLocale();//mAppName); 19 mLocale = new KLocale();//mAppName);
19 } 20 }
20 21
21 return mLocale; 22 return mLocale;
22} 23}
23 24
24//US 25//US
25void KGlobal::setLocale(KLocale *kg) 26void KGlobal::setLocale(KLocale *kg)
26{ 27{
27 mLocale = kg; 28 mLocale = kg;
28} 29}
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp
index 2e483e9..1f08255 100644
--- a/microkde/kglobalsettings.cpp
+++ b/microkde/kglobalsettings.cpp
@@ -1,18 +1,19 @@
1#include "kglobalsettings.h" 1#include "kglobalsettings.h"
2#include "kconfig.h" 2#include "kconfig.h"
3#include "kglobal.h" 3#include "kglobal.h"
4#include "kconfigbase.h" 4#include "kconfigbase.h"
5 5
6#include <qapplication.h> 6#include <qapplication.h>
7#include <QDesktopWidget>
7 8
8#ifdef DESKTOP_VERSION 9#ifdef DESKTOP_VERSION
9 QColor KGlobalSettings::mAlternate = QColor( 235, 235, 235 ); 10 QColor KGlobalSettings::mAlternate = QColor( 235, 235, 235 );
10#else 11#else
11 QColor KGlobalSettings::mAlternate = QColor( 210, 210, 210 ); 12 QColor KGlobalSettings::mAlternate = QColor( 210, 210, 210 );
12#endif 13#endif
13 14
14 15
15QFont KGlobalSettings::generalFont() 16QFont KGlobalSettings::generalFont()
16{ 17{
17 int size = 12; 18 int size = 12;
18 if (QApplication::desktop()->width() < 480 ) { 19 if (QApplication::desktop()->width() < 480 ) {
diff --git a/microkde/kiconloader.cpp b/microkde/kiconloader.cpp
index 4842d71..e7f657d 100644
--- a/microkde/kiconloader.cpp
+++ b/microkde/kiconloader.cpp
@@ -1,36 +1,38 @@
1 1
2#include "kiconloader.h" 2#include "kiconloader.h"
3#include "kglobal.h" 3#include "kglobal.h"
4 4
5#ifndef DESKTOP_VERSION_OEGEL 5#ifndef DESKTOP_VERSION_OEGEL
6#include <qdir.h> 6#include <qdir.h>
7//Added by qt3to4:
8#include <QPixmap>
7QPixmap KIconLoader::loadIcon( const QString& name, KIcon::Group, int, 9QPixmap KIconLoader::loadIcon( const QString& name, KIcon::Group, int,
8 int, QString *, bool ) const 10 int, QString *, bool ) const
9{ 11{
10 QPixmap pix; 12 QPixmap pix;
11 QString file; 13 QString file;
12 file = iconPath() + name+".png"; 14 file = iconPath() + name+".png";
13 pix.load ( file ); 15 pix.load ( file );
14 // qDebug("KIconLoader::loadIcon %s -----------", file.latin1()); 16 // qDebug("KIconLoader::loadIcon %s -----------", file.latin1());
15 return pix; 17 return pix;
16} 18}
17QIconSet KIconLoader::loadIconSet( const QString& name) const 19QIcon KIconLoader::loadIconSet( const QString& name) const
18{ 20{
19 QPixmap pixmapLoader; 21 QPixmap pixmapLoader;
20 QString file; 22 QString file;
21 file = iconPath() + name+".png"; 23 file = iconPath() + name+".png";
22 pixmapLoader.load( file ); 24 pixmapLoader.load( file );
23 //qDebug("KIconLoader::loadIconSet: %s ************", file.latin1() ); 25 //qDebug("KIconLoader::loadIconSet: %s ************", file.latin1() );
24 QIconSet is ( pixmapLoader ); 26 QIcon is ( pixmapLoader );
25 return is; 27 return is;
26} 28}
27 29
28QPixmap BarIcon( const QString &name ) 30QPixmap BarIcon( const QString &name )
29{ 31{
30 QPixmap pix; 32 QPixmap pix;
31 pix.load ( KGlobal::iconLoader()->iconPath() + name +".png" ); 33 pix.load ( KGlobal::iconLoader()->iconPath() + name +".png" );
32 return pix; 34 return pix;
33} 35}
34 36
35QPixmap DesktopIcon( const QString &name, int ) 37QPixmap DesktopIcon( const QString &name, int )
36{ 38{
@@ -68,30 +70,30 @@ QPixmap KIconLoader::loadIcon( const QString& name, KIcon::Group, int,
68 int, QString *, bool ) const 70 int, QString *, bool ) const
69{ 71{
70 QString px = this->iconPath() + "/" + name; 72 QString px = this->iconPath() + "/" + name;
71 73
72 QPixmap p = Resource::loadPixmap( px ); 74 QPixmap p = Resource::loadPixmap( px );
73 QPixmap* pPtr = &p; 75 QPixmap* pPtr = &p;
74 if (pPtr == 0) 76 if (pPtr == 0)
75 qDebug("KIconLoader::loadIcon: %s not found", px.latin1()); 77 qDebug("KIconLoader::loadIcon: %s not found", px.latin1());
76 78
77 return p; 79 return p;
78} 80}
79 81
80QIconSet KIconLoader::loadIconSet( const QString& name) const 82QIcon KIconLoader::loadIconSet( const QString& name) const
81{ 83{
82 QString px = this->iconPath() + "/" + name; 84 QString px = this->iconPath() + "/" + name;
83 85
84 QIconSet is ;//= Resource::loadIconSet( px ); 86 QIcon is ;//= Resource::loadIconSet( px );
85 QIconSet* isPtr = 0;//LR&is; 87 QIcon* isPtr = 0;//LR&is;
86 if (isPtr == 0) 88 if (isPtr == 0)
87 qDebug("KIconLoader::loadIconSet: %s not foun", px.latin1()); 89 qDebug("KIconLoader::loadIconSet: %s not foun", px.latin1());
88 90
89 return is; 91 return is;
90} 92}
91 93
92QPixmap BarIcon( const QString &name ) 94QPixmap BarIcon( const QString &name )
93{ 95{
94 QPixmap p = KGlobal::iconLoader()->loadIcon(name, KIcon::Desktop); 96 QPixmap p = KGlobal::iconLoader()->loadIcon(name, KIcon::Desktop);
95 return p; 97 return p;
96} 98}
97 99
diff --git a/microkde/kiconloader.h b/microkde/kiconloader.h
index 68fec4e..2abb667 100644
--- a/microkde/kiconloader.h
+++ b/microkde/kiconloader.h
@@ -1,19 +1,19 @@
1#ifndef MINIKDE_KICONLOADER_H 1#ifndef MINIKDE_KICONLOADER_H
2#define MINIKDE_KICONLOADER_H 2#define MINIKDE_KICONLOADER_H
3 3
4#include <qpixmap.h> 4#include <qpixmap.h>
5#include <qstring.h> 5#include <qstring.h>
6//US 6//US
7#include <qiconset.h> 7#include <qicon.h>
8 8
9class KIcon 9class KIcon
10{ 10{
11 public: 11 public:
12 enum Group { NoGroup=-1, Desktop=0, Toolbar, MainToolbar, Small, 12 enum Group { NoGroup=-1, Desktop=0, Toolbar, MainToolbar, Small,
13 Panel, LastGroup, User }; 13 Panel, LastGroup, User };
14 enum StdSizes { SizeSmall=16, SizeMedium=32, SizeLarge=48 }; 14 enum StdSizes { SizeSmall=16, SizeMedium=32, SizeLarge=48 };
15 enum States { DefaultState, ActiveState, DisabledState, LastState }; 15 enum States { DefaultState, ActiveState, DisabledState, LastState };
16}; 16};
17 17
18class KIconLoader 18class KIconLoader
19{ 19{
@@ -25,25 +25,25 @@ class KIconLoader
25 : mIconpath(iconpath) {} 25 : mIconpath(iconpath) {}
26 26
27//US QPixmap loadIcon( const QString &name, int ); 27//US QPixmap loadIcon( const QString &name, int );
28 28
29 QPixmap loadIcon(const QString& name, KIcon::Group group, int size=0, 29 QPixmap loadIcon(const QString& name, KIcon::Group group, int size=0,
30 int state=KIcon::DefaultState, QString *path_store=0, 30 int state=KIcon::DefaultState, QString *path_store=0,
31 bool canReturnNull=false) const; 31 bool canReturnNull=false) const;
32 32
33//US 33//US
34 QString setIconPath( const QString &); 34 QString setIconPath( const QString &);
35 QString iconPath( /*US const QString &, int */) const; 35 QString iconPath( /*US const QString &, int */) const;
36 QString iconPath( const QString &, int ) const; 36 QString iconPath( const QString &, int ) const;
37 QIconSet loadIconSet( const QString &name) const; 37 QIcon loadIconSet( const QString &name) const;
38 38
39//US to make this class usable for different applications, we have to add a iconpathvariable 39//US to make this class usable for different applications, we have to add a iconpathvariable
40 private: 40 private:
41 QString mIconpath; 41 QString mIconpath;
42}; 42};
43 43
44QPixmap BarIcon(const QString& name); 44QPixmap BarIcon(const QString& name);
45 45
46QPixmap DesktopIcon(const QString& name, int); 46QPixmap DesktopIcon(const QString& name, int);
47 47
48QPixmap SmallIcon(const QString& name); 48QPixmap SmallIcon(const QString& name);
49 49
diff --git a/microkde/kio/kfile/kurlrequester.cpp b/microkde/kio/kfile/kurlrequester.cpp
index ca94570..ce62da7 100644
--- a/microkde/kio/kfile/kurlrequester.cpp
+++ b/microkde/kio/kfile/kurlrequester.cpp
@@ -18,24 +18,26 @@
18 18
19 19
20#include <sys/stat.h> 20#include <sys/stat.h>
21#ifdef _WIN32_ 21#ifdef _WIN32_
22 22
23#else 23#else
24#include <unistd.h> 24#include <unistd.h>
25#endif 25#endif
26#include <qstring.h> 26#include <qstring.h>
27//US #include <qtooltip.h> 27//US #include <qtooltip.h>
28 28
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30//Added by qt3to4:
31#include <QPixmap>
30 32
31//US #include <kaccel.h> 33//US #include <kaccel.h>
32//US #include <kcombobox.h> 34//US #include <kcombobox.h>
33#include <kdebug.h> 35#include <kdebug.h>
34#include <kdialog.h> 36#include <kdialog.h>
35#include <kfiledialog.h> 37#include <kfiledialog.h>
36#include <kglobal.h> 38#include <kglobal.h>
37#include <kiconloader.h> 39#include <kiconloader.h>
38#include <klineedit.h> 40#include <klineedit.h>
39#include <klocale.h> 41#include <klocale.h>
40//US #include <kurlcompletion.h> 42//US #include <kurlcompletion.h>
41//US #include <kurldrag.h> 43//US #include <kurldrag.h>
@@ -173,60 +175,60 @@ KURLRequester::KURLRequester( QWidget *editWidget, QWidget *parent,
173 175
174 // must have this as parent 176 // must have this as parent
175 editWidget->reparent( this, 0, QPoint(0,0) ); 177 editWidget->reparent( this, 0, QPoint(0,0) );
176//US d->edit = dynamic_cast<KLineEdit*>( editWidget ); 178//US d->edit = dynamic_cast<KLineEdit*>( editWidget );
177 d->edit = (KLineEdit*)( editWidget ); 179 d->edit = (KLineEdit*)( editWidget );
178//US d->combo = dynamic_cast<KComboBox*>( editWidget ); 180//US d->combo = dynamic_cast<KComboBox*>( editWidget );
179 181
180 init(); 182 init();
181} 183}
182*/ 184*/
183 185
184KURLRequester::KURLRequester( QWidget *parent, const char *name ) 186KURLRequester::KURLRequester( QWidget *parent, const char *name )
185 : QHBox( parent, name ) 187 : Q3HBox( parent, name )
186{ 188{
187 d = new KURLRequesterPrivate; 189 d = new KURLRequesterPrivate;
188 init(); 190 init();
189} 191}
190 192
191 193
192KURLRequester::KURLRequester( const QString& url, QWidget *parent, 194KURLRequester::KURLRequester( const QString& url, QWidget *parent,
193 const char *name ) 195 const char *name )
194 : QHBox( parent, name ) 196 : Q3HBox( parent, name )
195{ 197{
196 d = new KURLRequesterPrivate; 198 d = new KURLRequesterPrivate;
197 init(); 199 init();
198 setURL( url ); 200 setURL( url );
199} 201}
200 202
201 203
202KURLRequester::~KURLRequester() 204KURLRequester::~KURLRequester()
203{ 205{
204//US delete myCompletion; 206//US delete myCompletion;
205 delete myFileDialog; 207 delete myFileDialog;
206 delete d; 208 delete d;
207} 209}
208 210
209 211
210void KURLRequester::init() 212void KURLRequester::init()
211{ 213{
212 myFileDialog = 0L; 214 myFileDialog = 0L;
213 myShowLocalProt = false; 215 myShowLocalProt = false;
214 mPathIsDir = false; 216 mPathIsDir = false;
215 if (/*US !d->combo && */ !d->edit ) 217 if (/*US !d->combo && */ !d->edit )
216 d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" ); 218 d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" );
217 219
218 myButton = new KURLDragPushButton( this, "kfile button"); 220 myButton = new KURLDragPushButton( this, "kfile button");
219 QIconSet iconSet = SmallIconSet("fileopen"); 221 QIcon iconSet = SmallIconSet("fileopen");
220 QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal ); 222 QPixmap pixMap = iconSet.pixmap( QIcon::Small, QIcon::Normal );
221 myButton->setIconSet( iconSet ); 223 myButton->setIconSet( iconSet );
222 myButton->setFixedSize( pixMap.width()+8, pixMap.height()+8 ); 224 myButton->setFixedSize( pixMap.width()+8, pixMap.height()+8 );
223//US QToolTip::add(myButton, i18n("Open file dialog")); 225//US QToolTip::add(myButton, i18n("Open file dialog"));
224 226
225 connect( myButton, SIGNAL( pressed() ), SLOT( slotUpdateURL() )); 227 connect( myButton, SIGNAL( pressed() ), SLOT( slotUpdateURL() ));
226 228
227 setSpacing( KDialog::spacingHint() ); 229 setSpacing( KDialog::spacingHint() );
228 230
229 QWidget *widget = /*US d->combo ? (QWidget*) d->combo : */ (QWidget*) d->edit; 231 QWidget *widget = /*US d->combo ? (QWidget*) d->combo : */ (QWidget*) d->edit;
230 setFocusProxy( widget ); 232 setFocusProxy( widget );
231 233
232 d->connectSignals( this ); 234 d->connectSignals( this );
diff --git a/microkde/kio/kfile/kurlrequester.h b/microkde/kio/kfile/kurlrequester.h
index faa3326..5d4fa11 100644
--- a/microkde/kio/kfile/kurlrequester.h
+++ b/microkde/kio/kfile/kurlrequester.h
@@ -11,25 +11,25 @@
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18 18
19 19
20#ifndef KURLREQUESTER_H 20#ifndef KURLREQUESTER_H
21#define KURLREQUESTER_H 21#define KURLREQUESTER_H
22 22
23#include <qhbox.h> 23#include <q3hbox.h>
24 24
25#include <keditlistbox.h> 25#include <keditlistbox.h>
26//US #include <kfile.h> 26//US #include <kfile.h>
27//US #include <kpushbutton.h> 27//US #include <kpushbutton.h>
28#include <kurl.h> 28#include <kurl.h>
29 29
30//US class KComboBox; 30//US class KComboBox;
31 31
32class KFileDialog; 32class KFileDialog;
33class KLineEdit; 33class KLineEdit;
34//US class KURLCompletion; 34//US class KURLCompletion;
35class KURLDragPushButton; 35class KURLDragPushButton;
@@ -44,25 +44,25 @@ class QTimer;
44 * 44 *
45 * The defaults for the filedialog are to ask for one existing local file, i.e. 45 * The defaults for the filedialog are to ask for one existing local file, i.e.
46 * KFileDialog::setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly ) 46 * KFileDialog::setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly )
47 * The default filter is "*", i.e. show all files, and the start directory is 47 * The default filter is "*", i.e. show all files, and the start directory is
48 * the current working directory, or the last directory where a file has been 48 * the current working directory, or the last directory where a file has been
49 * selected. 49 * selected.
50 * 50 *
51 * You can change this behavior by using @ref setMode() or @ref setFilter(). 51 * You can change this behavior by using @ref setMode() or @ref setFilter().
52 * 52 *
53 * @short A widget to request a filename/url from the user 53 * @short A widget to request a filename/url from the user
54 * @author Carsten Pfeiffer <pfeiffer@kde.org> 54 * @author Carsten Pfeiffer <pfeiffer@kde.org>
55 */ 55 */
56class KURLRequester : public QHBox 56class KURLRequester : public Q3HBox
57{ 57{
58 Q_OBJECT 58 Q_OBJECT
59 Q_PROPERTY( QString url READ url WRITE setURL ) 59 Q_PROPERTY( QString url READ url WRITE setURL )
60 60
61public: 61public:
62 /** 62 /**
63 * Constructs a KURLRequester widget. 63 * Constructs a KURLRequester widget.
64 */ 64 */
65 KURLRequester( QWidget *parent=0, const char *name=0 ); 65 KURLRequester( QWidget *parent=0, const char *name=0 );
66 66
67 /** 67 /**
68 * Constructs a KURLRequester widget with the initial URL @p url. 68 * Constructs a KURLRequester widget with the initial URL @p url.
diff --git a/microkde/kio/kio/kdirwatch.cpp b/microkde/kio/kio/kdirwatch.cpp
index 1596d1f..5f07c54 100644
--- a/microkde/kio/kio/kdirwatch.cpp
+++ b/microkde/kio/kio/kdirwatch.cpp
@@ -43,29 +43,31 @@ $Id$
43#ifdef HAVE_DNOTIFY 43#ifdef HAVE_DNOTIFY
44#include <unistd.h> 44#include <unistd.h>
45#include <time.h> 45#include <time.h>
46#include <fcntl.h> 46#include <fcntl.h>
47#include <signal.h> 47#include <signal.h>
48#include <errno.h> 48#include <errno.h>
49#endif 49#endif
50 50
51#include <sys/stat.h> 51#include <sys/stat.h>
52#include <assert.h> 52#include <assert.h>
53#include <qdir.h> 53#include <qdir.h>
54#include <qfile.h> 54#include <qfile.h>
55#include <qintdict.h> 55#include <q3intdict.h>
56#include <qptrlist.h> 56#include <q3ptrlist.h>
57#include <qsocketnotifier.h> 57#include <qsocketnotifier.h>
58#include <qstringlist.h> 58#include <qstringlist.h>
59#include <qtimer.h> 59#include <qtimer.h>
60//Added by qt3to4:
61#include <Q3CString>
60 62
61#include <kapplication.h> 63#include <kapplication.h>
62#include <kdebug.h> 64#include <kdebug.h>
63#include <kconfig.h> 65#include <kconfig.h>
64#include <kconfigbase.h> 66#include <kconfigbase.h>
65#include <kglobal.h> 67#include <kglobal.h>
66#include <kstaticdeleter.h> 68#include <kstaticdeleter.h>
67 69
68#include "kdirwatch.h" 70#include "kdirwatch.h"
69#include "kdirwatch_p.h" 71#include "kdirwatch_p.h"
70//US #include "global.h" // KIO::probably_slow_mounted 72//US #include "global.h" // KIO::probably_slow_mounted
71 73
@@ -175,25 +177,25 @@ KDirWatchPrivate::KDirWatchPrivate()
175{ 177{
176 timer = new QTimer(this); 178 timer = new QTimer(this);
177 connect (timer, SIGNAL(timeout()), this, SLOT(slotRescan())); 179 connect (timer, SIGNAL(timeout()), this, SLOT(slotRescan()));
178 freq = 3600000; // 1 hour as upper bound 180 freq = 3600000; // 1 hour as upper bound
179 statEntries = 0; 181 statEntries = 0;
180 delayRemove = false; 182 delayRemove = false;
181 m_ref = 0; 183 m_ref = 0;
182 184
183//US KConfigGroup config(KGlobal::config(), QCString("DirWatch")); 185//US KConfigGroup config(KGlobal::config(), QCString("DirWatch"));
184//US m_nfsPollInterval = config.readNumEntry("NFSPollInterval", 5000); 186//US m_nfsPollInterval = config.readNumEntry("NFSPollInterval", 5000);
185//US m_PollInterval = config.readNumEntry("PollInterval", 500); 187//US m_PollInterval = config.readNumEntry("PollInterval", 500);
186 KConfig *config = KGlobal::config(); 188 KConfig *config = KGlobal::config();
187 KConfigGroupSaver saver( config, QCString("DirWatch") ); 189 KConfigGroupSaver saver( config, Q3CString("DirWatch") );
188 190
189 m_nfsPollInterval = config->readNumEntry("NFSPollInterval", 5000); 191 m_nfsPollInterval = config->readNumEntry("NFSPollInterval", 5000);
190 m_PollInterval = config->readNumEntry("PollInterval", 500); 192 m_PollInterval = config->readNumEntry("PollInterval", 500);
191 193
192 194
193 QString available("Stat"); 195 QString available("Stat");
194 196
195#ifdef HAVE_FAM 197#ifdef HAVE_FAM
196 // It's possible that FAM server can't be started 198 // It's possible that FAM server can't be started
197 if (FAMOpen(&fc) ==0) { 199 if (FAMOpen(&fc) ==0) {
198 available += ", FAM"; 200 available += ", FAM";
199 use_fam=true; 201 use_fam=true;
@@ -722,25 +724,25 @@ void KDirWatchPrivate::removeEntry( KDirWatch* instance,
722 << (sub_entry ? QString(" for %1").arg(sub_entry->path) : QString("")) 724 << (sub_entry ? QString(" for %1").arg(sub_entry->path) : QString(""))
723 << (instance ? QString(" [%1]").arg(instance->name()) : QString("")) 725 << (instance ? QString(" [%1]").arg(instance->name()) : QString(""))
724 << endl; 726 << endl;
725 m_mapEntries.remove( e->path ); // <e> not valid any more 727 m_mapEntries.remove( e->path ); // <e> not valid any more
726} 728}
727 729
728 730
729/* Called from KDirWatch destructor: 731/* Called from KDirWatch destructor:
730 * remove <instance> as client from all entries 732 * remove <instance> as client from all entries
731 */ 733 */
732void KDirWatchPrivate::removeEntries( KDirWatch* instance ) 734void KDirWatchPrivate::removeEntries( KDirWatch* instance )
733{ 735{
734 QPtrList<Entry> list; 736 Q3PtrList<Entry> list;
735 int minfreq = 3600000; 737 int minfreq = 3600000;
736 738
737 // put all entries where instance is a client in list 739 // put all entries where instance is a client in list
738 EntryMap::Iterator it = m_mapEntries.begin(); 740 EntryMap::Iterator it = m_mapEntries.begin();
739 for( ; it != m_mapEntries.end(); ++it ) { 741 for( ; it != m_mapEntries.end(); ++it ) {
740 Client* c = (*it).m_clients.first(); 742 Client* c = (*it).m_clients.first();
741 for(;c;c=(*it).m_clients.next()) 743 for(;c;c=(*it).m_clients.next())
742 if (c->instance == instance) break; 744 if (c->instance == instance) break;
743 if (c) { 745 if (c) {
744 c->count = 1; // forces deletion of instance as client 746 c->count = 1; // forces deletion of instance as client
745 list.append(&(*it)); 747 list.append(&(*it));
746 } 748 }
@@ -998,25 +1000,25 @@ void KDirWatchPrivate::slotRescan()
998 // People can do very long things in the slot connected to dirty(), 1000 // People can do very long things in the slot connected to dirty(),
999 // like showing a message box. We don't want to keep polling during 1001 // like showing a message box. We don't want to keep polling during
1000 // that time, otherwise the value of 'delayRemove' will be reset. 1002 // that time, otherwise the value of 'delayRemove' will be reset.
1001 bool timerRunning = timer->isActive(); 1003 bool timerRunning = timer->isActive();
1002 if ( timerRunning ) 1004 if ( timerRunning )
1003 timer->stop(); 1005 timer->stop();
1004 1006
1005 // We delay deletions of entries this way. 1007 // We delay deletions of entries this way.
1006 // removeDir(), when called in slotDirty(), can cause a crash otherwise 1008 // removeDir(), when called in slotDirty(), can cause a crash otherwise
1007 delayRemove = true; 1009 delayRemove = true;
1008 1010
1009#ifdef HAVE_DNOTIFY 1011#ifdef HAVE_DNOTIFY
1010 QPtrList<Entry> dList, cList; 1012 Q3PtrList<Entry> dList, cList;
1011 1013
1012 // for DNotify method, 1014 // for DNotify method,
1013 if (rescan_all) 1015 if (rescan_all)
1014 { 1016 {
1015 // mark all as dirty 1017 // mark all as dirty
1016 it = m_mapEntries.begin(); 1018 it = m_mapEntries.begin();
1017 for( ; it != m_mapEntries.end(); ++it ) 1019 for( ; it != m_mapEntries.end(); ++it )
1018 (*it).dn_dirty = true; 1020 (*it).dn_dirty = true;
1019 rescan_all = false; 1021 rescan_all = false;
1020 } 1022 }
1021 else 1023 else
1022 { 1024 {
diff --git a/microkde/kio/kio/kdirwatch_p.h b/microkde/kio/kio/kdirwatch_p.h
index 0ab482f..be74f2a 100644
--- a/microkde/kio/kio/kdirwatch_p.h
+++ b/microkde/kio/kio/kdirwatch_p.h
@@ -9,25 +9,25 @@ Enhanced Version of the file for platform independent KDE tools.
9Copyright (c) 2004 Ulf Schenk 9Copyright (c) 2004 Ulf Schenk
10 10
11$Id$ 11$Id$
12*/ 12*/
13 13
14#ifndef _KDIRWATCH_P_H 14#ifndef _KDIRWATCH_P_H
15#define _KDIRWATCH_P_H 15#define _KDIRWATCH_P_H
16 16
17#ifdef HAVE_FAM 17#ifdef HAVE_FAM
18#include <fam.h> 18#include <fam.h>
19#endif 19#endif
20 20
21#include <qptrlist.h> 21#include <q3ptrlist.h>
22 22
23#include <kdirwatch.h> 23#include <kdirwatch.h>
24 24
25#include <ctime> 25#include <ctime>
26 26
27#define invalid_ctime ((time_t)-1) 27#define invalid_ctime ((time_t)-1)
28 28
29/* KDirWatchPrivate is a singleton and does the watching 29/* KDirWatchPrivate is a singleton and does the watching
30 * for every KDirWatch instance in the application. 30 * for every KDirWatch instance in the application.
31 */ 31 */
32class KDirWatchPrivate : public QObject 32class KDirWatchPrivate : public QObject
33{ 33{
@@ -49,27 +49,27 @@ public:
49 49
50 class Entry 50 class Entry
51 { 51 {
52 public: 52 public:
53 // the last observed modification time 53 // the last observed modification time
54 time_t m_ctime; 54 time_t m_ctime;
55 // the last observed link count 55 // the last observed link count
56 int m_nlink; 56 int m_nlink;
57 entryStatus m_status; 57 entryStatus m_status;
58 entryMode m_mode; 58 entryMode m_mode;
59 bool isDir; 59 bool isDir;
60 // instances interested in events 60 // instances interested in events
61 QPtrList<Client> m_clients; 61 Q3PtrList<Client> m_clients;
62 // nonexistent entries of this directory 62 // nonexistent entries of this directory
63 QPtrList<Entry> m_entries; 63 Q3PtrList<Entry> m_entries;
64 QString path; 64 QString path;
65 65
66 int msecLeft, freq; 66 int msecLeft, freq;
67 67
68 void addClient(KDirWatch*); 68 void addClient(KDirWatch*);
69 void removeClient(KDirWatch*); 69 void removeClient(KDirWatch*);
70 int clients(); 70 int clients();
71 bool isValid() { return m_clients.count() || m_entries.count(); } 71 bool isValid() { return m_clients.count() || m_entries.count(); }
72 72
73#ifdef HAVE_FAM 73#ifdef HAVE_FAM
74 FAMRequest fr; 74 FAMRequest fr;
75#endif 75#endif
@@ -115,39 +115,39 @@ public slots:
115public: 115public:
116 QTimer *timer; 116 QTimer *timer;
117 EntryMap m_mapEntries; 117 EntryMap m_mapEntries;
118 118
119private: 119private:
120 int freq; 120 int freq;
121 int statEntries; 121 int statEntries;
122 int m_nfsPollInterval, m_PollInterval; 122 int m_nfsPollInterval, m_PollInterval;
123 int m_ref; 123 int m_ref;
124 bool useStat(Entry*); 124 bool useStat(Entry*);
125 125
126 bool delayRemove; 126 bool delayRemove;
127 QPtrList<Entry> removeList; 127 Q3PtrList<Entry> removeList;
128 128
129#ifdef HAVE_FAM 129#ifdef HAVE_FAM
130 QSocketNotifier *sn; 130 QSocketNotifier *sn;
131 FAMConnection fc; 131 FAMConnection fc;
132 bool use_fam; 132 bool use_fam;
133 133
134 void checkFAMEvent(FAMEvent*); 134 void checkFAMEvent(FAMEvent*);
135 bool useFAM(Entry*); 135 bool useFAM(Entry*);
136#endif 136#endif
137 137
138#ifdef HAVE_DNOTIFY 138#ifdef HAVE_DNOTIFY
139 bool supports_dnotify; 139 bool supports_dnotify;
140 bool rescan_all; 140 bool rescan_all;
141 int mPipe[2]; 141 int mPipe[2];
142 QTimer mTimer; 142 QTimer mTimer;
143 QSocketNotifier *mSn; 143 QSocketNotifier *mSn;
144 QIntDict<Entry> fd_Entry; 144 Q3IntDict<Entry> fd_Entry;
145 145
146 static void dnotify_handler(int, siginfo_t *si, void *); 146 static void dnotify_handler(int, siginfo_t *si, void *);
147 static void dnotify_sigio_handler(int, siginfo_t *si, void *); 147 static void dnotify_sigio_handler(int, siginfo_t *si, void *);
148 bool useDNotify(Entry*); 148 bool useDNotify(Entry*);
149#endif 149#endif
150}; 150};
151 151
152#endif // KDIRWATCH_P_H 152#endif // KDIRWATCH_P_H
153 153
diff --git a/microkde/klineedit.h b/microkde/klineedit.h
index 70c72d1..9eb749d 100644
--- a/microkde/klineedit.h
+++ b/microkde/klineedit.h
@@ -1,16 +1,18 @@
1#ifndef MINIKDE_KLINEEDIT_H 1#ifndef MINIKDE_KLINEEDIT_H
2#define MINIKDE_KLINEEDIT_H 2#define MINIKDE_KLINEEDIT_H
3 3
4#include <qlineedit.h> 4#include <qlineedit.h>
5//Added by qt3to4:
6#include <QKeyEvent>
5 7
6#ifndef DESKTOP_VERSION 8#ifndef DESKTOP_VERSION
7#include <qpe/qpeapplication.h> 9#include <qpe/qpeapplication.h>
8#endif 10#endif
9 11
10 12
11class KLineEdit : public QLineEdit 13class KLineEdit : public QLineEdit
12{ 14{
13 15
14 Q_OBJECT 16 Q_OBJECT
15 17
16 public: 18 public:
diff --git a/microkde/klineeditdlg.h b/microkde/klineeditdlg.h
index 68e9252..d0004cd 100644
--- a/microkde/klineeditdlg.h
+++ b/microkde/klineeditdlg.h
@@ -1,30 +1,32 @@
1#ifndef MICROKDE_KLINEEDITDLG_H 1#ifndef MICROKDE_KLINEEDITDLG_H
2#define MICROKDE_KLINEEDITDLG_H 2#define MICROKDE_KLINEEDITDLG_H
3 3
4#include "kdialogbase.h" 4#include "kdialogbase.h"
5#include <klineedit.h> 5#include <klineedit.h>
6#include <qlayout.h> 6#include <qlayout.h>
7#include <qlabel.h> 7#include <qlabel.h>
8#include <qdialog.h> 8#include <qdialog.h>
9#include <qpushbutton.h> 9#include <qpushbutton.h>
10//Added by qt3to4:
11#include <Q3VBoxLayout>
10 12
11class KLineEditDlg : public QDialog 13class KLineEditDlg : public QDialog
12{ 14{
13 public: 15 public:
14 KLineEditDlg( const QString & text, const QString & editText, QWidget *parent ) : 16 KLineEditDlg( const QString & text, const QString & editText, QWidget *parent ) :
15 QDialog( parent,"lineedit", true ) { 17 QDialog( parent,"lineedit", true ) {
16 QLabel* lab = new QLabel( text, this ); 18 QLabel* lab = new QLabel( text, this );
17 mEdit = new KLineEdit( this ); 19 mEdit = new KLineEdit( this );
18 QVBoxLayout* vl = new QVBoxLayout( this ); 20 Q3VBoxLayout* vl = new Q3VBoxLayout( this );
19 vl->setSpacing(5); 21 vl->setSpacing(5);
20 vl->setMargin(7); 22 vl->setMargin(7);
21 vl->addWidget( lab ); 23 vl->addWidget( lab );
22 vl->addWidget( mEdit ); 24 vl->addWidget( mEdit );
23 mEdit->setText( editText ); 25 mEdit->setText( editText );
24 QPushButton * p = new QPushButton (" OK ", this ); 26 QPushButton * p = new QPushButton (" OK ", this );
25 vl->addWidget( p ); 27 vl->addWidget( p );
26 connect( p, SIGNAL ( clicked () ), this , SLOT (accept() ) ); 28 connect( p, SIGNAL ( clicked () ), this , SLOT (accept() ) );
27 } 29 }
28 30
29 QString text() { return mEdit->text(); } 31 QString text() { return mEdit->text(); }
30 private: 32 private:
diff --git a/microkde/kresources/configdialog.cpp b/microkde/kresources/configdialog.cpp
index 55253c0..4820faf 100644
--- a/microkde/kresources/configdialog.cpp
+++ b/microkde/kresources/configdialog.cpp
@@ -16,82 +16,85 @@
16 Library General Public License for more details. 16 Library General Public License for more details.
17 17
18 You should have received a copy of the GNU Library General Public License 18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to 19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. 21 Boston, MA 02111-1307, USA.
22*/ 22*/
23 23
24#include <klocale.h> 24#include <klocale.h>
25#include <kglobal.h> 25#include <kglobal.h>
26#include <kmessagebox.h> 26#include <kmessagebox.h>
27 27
28#include <qgroupbox.h> 28#include <q3groupbox.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qpushbutton.h> 31#include <qpushbutton.h>
32#include <qvbox.h> 32#include <q3vbox.h>
33 33
34#include <qcheckbox.h> 34#include <qcheckbox.h>
35#include <qscrollview.h> 35#include <q3scrollview.h>
36//Added by qt3to4:
37#include <Q3VBoxLayout>
38#include <Q3Frame>
36 39
37#include <kbuttonbox.h> 40#include <kbuttonbox.h>
38#include <kdialog.h> 41#include <kdialog.h>
39#include <klineedit.h> 42#include <klineedit.h>
40 43
41#include "factory.h" 44#include "factory.h"
42#include "configwidget.h" 45#include "configwidget.h"
43#include "configdialog.h" 46#include "configdialog.h"
44 47
45using namespace KRES; 48using namespace KRES;
46 49
47ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, 50ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
48 Resource* resource, const char *name ) 51 Resource* resource, const char *name )
49 : KDialogBase( parent, name, true, i18n( "Resource Configuration" ), 52 : KDialogBase( parent, name, true, i18n( "Resource Configuration" ),
50 Ok|Cancel, Ok, true )/*, mConfig( config )*/, mResource( resource ), mPersistentReadOnly(false) 53 Ok|Cancel, Ok, true )/*, mConfig( config )*/, mResource( resource ), mPersistentReadOnly(false)
51{ 54{
52 55
53 Factory *factory = Factory::self( resourceFamily ); 56 Factory *factory = Factory::self( resourceFamily );
54 57
55//US resize( 250, 240 ); 58//US resize( 250, 240 );
56 resize( KMIN(KGlobal::getDesktopWidth(), 250), KMIN(KGlobal::getDesktopHeight(), 240)); 59 resize( KMIN(KGlobal::getDesktopWidth(), 250), KMIN(KGlobal::getDesktopHeight(), 240));
57 60
58 QFrame *main; 61 Q3Frame *main;
59 62
60 main = plainPage(); 63 main = plainPage();
61 64
62 QVBoxLayout *mainLayout = new QVBoxLayout( main, 0, spacingHint() ); 65 Q3VBoxLayout *mainLayout = new Q3VBoxLayout( main, 0, spacingHint() );
63 66
64 67
65 QGroupBox *generalGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); 68 Q3GroupBox *generalGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main );
66 generalGroupBox->layout()->setSpacing( spacingHint() ); 69 generalGroupBox->layout()->setSpacing( spacingHint() );
67 generalGroupBox->setTitle( i18n( "General Settings" ) ); 70 generalGroupBox->setTitle( i18n( "General Settings" ) );
68 71
69 new QLabel( i18n( "Name:" ), generalGroupBox ); 72 new QLabel( i18n( "Name:" ), generalGroupBox );
70 73
71 mName = new KLineEdit( generalGroupBox ); 74 mName = new KLineEdit( generalGroupBox );
72 75
73 new QLabel("", generalGroupBox ); 76 new QLabel("", generalGroupBox );
74 mReadOnly = new QCheckBox( i18n( "Read-only" ), generalGroupBox ); 77 mReadOnly = new QCheckBox( i18n( "Read-only" ), generalGroupBox );
75 mReadOnly->setChecked( mResource->readOnly() ); 78 mReadOnly->setChecked( mResource->readOnly() );
76 79
77 new QLabel("", generalGroupBox ); 80 new QLabel("", generalGroupBox );
78 mIncludeInSync = new QCheckBox( i18n( "Include in sync" ), generalGroupBox ); 81 mIncludeInSync = new QCheckBox( i18n( "Include in sync" ), generalGroupBox );
79 mIncludeInSync->setChecked( mResource->includeInSync() ); 82 mIncludeInSync->setChecked( mResource->includeInSync() );
80 83
81 mName->setText( mResource->resourceName() ); 84 mName->setText( mResource->resourceName() );
82 85
83 mainLayout->addWidget( generalGroupBox ); 86 mainLayout->addWidget( generalGroupBox );
84 87
85 QGroupBox *resourceGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); 88 Q3GroupBox *resourceGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main );
86 resourceGroupBox->layout()->setSpacing( spacingHint()); 89 resourceGroupBox->layout()->setSpacing( spacingHint());
87 resourceGroupBox->setTitle( i18n( "%1 Resource Settings" ) 90 resourceGroupBox->setTitle( i18n( "%1 Resource Settings" )
88 .arg( factory->typeName( resource->type() ) ) ); 91 .arg( factory->typeName( resource->type() ) ) );
89 mainLayout->addWidget( resourceGroupBox ); 92 mainLayout->addWidget( resourceGroupBox );
90 93
91 mainLayout->addStretch(); 94 mainLayout->addStretch();
92 95
93 mConfigWidget = factory->configWidget( resource->type(), resourceGroupBox ); 96 mConfigWidget = factory->configWidget( resource->type(), resourceGroupBox );
94 if ( mConfigWidget ) { 97 if ( mConfigWidget ) {
95 connect( mConfigWidget, SIGNAL( setReadOnly( bool ) ), 98 connect( mConfigWidget, SIGNAL( setReadOnly( bool ) ),
96 SLOT( setReadOnly( bool ) ) ); 99 SLOT( setReadOnly( bool ) ) );
97 connect( mConfigWidget, SIGNAL( setIncludeInSync( bool ) ), 100 connect( mConfigWidget, SIGNAL( setIncludeInSync( bool ) ),
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp
index fc7a42e..1a9d063 100644
--- a/microkde/kresources/configpage.cpp
+++ b/microkde/kresources/configpage.cpp
@@ -19,62 +19,66 @@
19 along with this library; see the file COPYING.LIB. If not, write to 19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. 21 Boston, MA 02111-1307, USA.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qgroupbox.h> 31#include <q3groupbox.h>
32 32
33#ifdef DESKTOP_VERSION 33#ifdef DESKTOP_VERSION
34#include <qinputdialog.h> 34#include <qinputdialog.h>
35#else 35#else
36#include <qtcompat/qinputdialog.h> 36#include <qtcompat/qinputdialog.h>
37#endif 37#endif
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qlayout.h> 39#include <qlayout.h>
40//Added by qt3to4:
41#include <Q3GridLayout>
42#include <Q3ValueList>
43#include <Q3VBoxLayout>
40#include <kapplication.h> 44#include <kapplication.h>
41#include <kcombobox.h> 45#include <kcombobox.h>
42#include <kdebug.h> 46#include <kdebug.h>
43#include <klocale.h> 47#include <klocale.h>
44#include <kmessagebox.h> 48#include <kmessagebox.h>
45#include <ksimpleconfig.h> 49#include <ksimpleconfig.h>
46#include <kstandarddirs.h> 50#include <kstandarddirs.h>
47#include <kurlrequester.h> 51#include <kurlrequester.h>
48#include <klistview.h> 52#include <klistview.h>
49#include <kbuttonbox.h> 53#include <kbuttonbox.h>
50//US #include <ktrader.h> 54//US #include <ktrader.h>
51 55
52#include "resource.h" 56#include "resource.h"
53#include "configdialog.h" 57#include "configdialog.h"
54 58
55#include "configpage.h" 59#include "configpage.h"
56 60
57//US 61//US
58#include <qpushbutton.h> 62#include <qpushbutton.h>
59#include <qfile.h> 63#include <qfile.h>
60#include <kglobal.h> 64#include <kglobal.h>
61 65
62using namespace KRES; 66using namespace KRES;
63 67
64class ConfigViewItem : public QCheckListItem 68class ConfigViewItem : public Q3CheckListItem
65{ 69{
66 public: 70 public:
67 ConfigViewItem( QListView *parent, Resource* resource ) : 71 ConfigViewItem( Q3ListView *parent, Resource* resource ) :
68 QCheckListItem( parent, resource->resourceName(), CheckBox ), 72 Q3CheckListItem( parent, resource->resourceName(), CheckBox ),
69 mResource( resource ), 73 mResource( resource ),
70 mIsStandard( false ) 74 mIsStandard( false )
71 { 75 {
72 setText( 1, mResource->type() ); 76 setText( 1, mResource->type() );
73 setOn( mResource->isActive() ); 77 setOn( mResource->isActive() );
74 } 78 }
75 79
76 void setStandard( bool value ) 80 void setStandard( bool value )
77 { 81 {
78 setText( 2, ( value ? i18n( "Yes" ) : QString::null ) ); 82 setText( 2, ( value ? i18n( "Yes" ) : QString::null ) );
79 mIsStandard = value; 83 mIsStandard = value;
80 } 84 }
@@ -88,31 +92,31 @@ class ConfigViewItem : public QCheckListItem
88 Resource* mResource; 92 Resource* mResource;
89 93
90 bool mIsStandard; 94 bool mIsStandard;
91}; 95};
92 96
93ConfigPage::ConfigPage( QWidget *parent, const char *name ) 97ConfigPage::ConfigPage( QWidget *parent, const char *name )
94 : QWidget( parent, name ), 98 : QWidget( parent, name ),
95 mCurrentManager( 0 ), 99 mCurrentManager( 0 ),
96 mCurrentConfig( 0 ) 100 mCurrentConfig( 0 )
97{ 101{
98 setCaption( i18n( "Resource Configuration" ) ); 102 setCaption( i18n( "Resource Configuration" ) );
99 103
100 QVBoxLayout *mainLayout = new QVBoxLayout( this ); 104 Q3VBoxLayout *mainLayout = new Q3VBoxLayout( this );
101 105
102 QGroupBox *groupBox = new QGroupBox( i18n( "Resources" ), this ); 106 Q3GroupBox *groupBox = new Q3GroupBox( i18n( "Resources" ), this );
103 groupBox->setColumnLayout(0, Qt::Vertical ); 107 groupBox->setColumnLayout(0, Qt::Vertical );
104 groupBox->layout()->setSpacing( 3 ); 108 groupBox->layout()->setSpacing( 3 );
105 groupBox->layout()->setMargin( 5 ); 109 groupBox->layout()->setMargin( 5 );
106 QGridLayout *groupBoxLayout = new QGridLayout( groupBox->layout(), 4, 2 ); 110 Q3GridLayout *groupBoxLayout = new Q3GridLayout( groupBox->layout(), 4, 2 );
107 111
108//US mFamilyCombo = new KComboBox( false, groupBox ); 112//US mFamilyCombo = new KComboBox( false, groupBox );
109 mFamilyCombo = new KComboBox( groupBox ); 113 mFamilyCombo = new KComboBox( groupBox );
110 groupBoxLayout->addMultiCellWidget( mFamilyCombo, 0, 0, 0, 1 ); 114 groupBoxLayout->addMultiCellWidget( mFamilyCombo, 0, 0, 0, 1 );
111 115
112 mListView = new KListView( groupBox ); 116 mListView = new KListView( groupBox );
113 mListView->setAllColumnsShowFocus( true ); 117 mListView->setAllColumnsShowFocus( true );
114 mListView->addColumn( i18n( "Name" ) ); 118 mListView->addColumn( i18n( "Name" ) );
115 mListView->addColumn( i18n( "Type" ) ); 119 mListView->addColumn( i18n( "Type" ) );
116 mListView->addColumn( i18n( "Standard" ) ); 120 mListView->addColumn( i18n( "Standard" ) );
117 121
118//US groupBoxLayout->addWidget( mListView, 1, 0 ); 122//US groupBoxLayout->addWidget( mListView, 1, 0 );
@@ -136,39 +140,39 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name )
136 connect( mAddButton, SIGNAL( clicked() ), SLOT(slotAdd()) ); 140 connect( mAddButton, SIGNAL( clicked() ), SLOT(slotAdd()) );
137 connect( mRemoveButton, SIGNAL( clicked() ), SLOT(slotRemove()) ); 141 connect( mRemoveButton, SIGNAL( clicked() ), SLOT(slotRemove()) );
138 connect( mEditButton, SIGNAL( clicked() ), SLOT(slotEdit()) ); 142 connect( mEditButton, SIGNAL( clicked() ), SLOT(slotEdit()) );
139 connect( mStandardButton, SIGNAL( clicked() ), SLOT(slotStandard()) ); 143 connect( mStandardButton, SIGNAL( clicked() ), SLOT(slotStandard()) );
140 144
141 145
142 mainLayout->addWidget( groupBox ); 146 mainLayout->addWidget( groupBox );
143 147
144 connect( mFamilyCombo, SIGNAL( activated( int ) ), 148 connect( mFamilyCombo, SIGNAL( activated( int ) ),
145 SLOT( slotFamilyChanged( int ) ) ); 149 SLOT( slotFamilyChanged( int ) ) );
146 connect( mListView, SIGNAL( selectionChanged() ), 150 connect( mListView, SIGNAL( selectionChanged() ),
147 SLOT( slotSelectionChanged() ) ); 151 SLOT( slotSelectionChanged() ) );
148 connect( mListView, SIGNAL( clicked( QListViewItem * ) ), 152 connect( mListView, SIGNAL( clicked( Q3ListViewItem * ) ),
149 SLOT( slotItemClicked( QListViewItem * ) ) ); 153 SLOT( slotItemClicked( Q3ListViewItem * ) ) );
150 154
151 mLastItem = 0; 155 mLastItem = 0;
152 156
153//US mConfig = new KConfig( "kcmkresourcesrc" ); 157//US mConfig = new KConfig( "kcmkresourcesrc" );
154 mConfig = new KConfig( locateLocal( "config", "kcmkresourcesrc") ); 158 mConfig = new KConfig( locateLocal( "config", "kcmkresourcesrc") );
155 mConfig->setGroup( "General" ); 159 mConfig->setGroup( "General" );
156 160
157 load(); 161 load();
158} 162}
159 163
160ConfigPage::~ConfigPage() 164ConfigPage::~ConfigPage()
161{ 165{
162 QValueList<ResourcePageInfo>::Iterator it; 166 Q3ValueList<ResourcePageInfo>::Iterator it;
163 for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) { 167 for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) {
164 (*it).mManager->removeListener( this ); 168 (*it).mManager->removeListener( this );
165 delete (*it).mManager; 169 delete (*it).mManager;
166 delete (*it).mConfig; 170 delete (*it).mConfig;
167 } 171 }
168 172
169 mConfig->writeEntry( "CurrentFamily", mFamilyCombo->currentItem() ); 173 mConfig->writeEntry( "CurrentFamily", mFamilyCombo->currentItem() );
170 delete mConfig; 174 delete mConfig;
171 mConfig = 0; 175 mConfig = 0;
172} 176}
173 177
174void ConfigPage::load() 178void ConfigPage::load()
@@ -221,25 +225,25 @@ void ConfigPage::load()
221 225
222 mFamilyCombo->insertStringList( mFamilyMap ); 226 mFamilyCombo->insertStringList( mFamilyMap );
223 227
224 int currentFamily = mConfig->readNumEntry( "CurrentFamily", 0 ); 228 int currentFamily = mConfig->readNumEntry( "CurrentFamily", 0 );
225 mFamilyCombo->setCurrentItem( currentFamily ); 229 mFamilyCombo->setCurrentItem( currentFamily );
226 slotFamilyChanged( currentFamily ); 230 slotFamilyChanged( currentFamily );
227} 231}
228 232
229void ConfigPage::save() 233void ConfigPage::save()
230{ 234{
231 saveResourceSettings(); 235 saveResourceSettings();
232 236
233 QValueList<ResourcePageInfo>::Iterator it; 237 Q3ValueList<ResourcePageInfo>::Iterator it;
234 for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) 238 for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it )
235 (*it).mManager->writeConfig( (*it).mConfig ); 239 (*it).mManager->writeConfig( (*it).mConfig );
236 240
237 emit changed( false ); 241 emit changed( false );
238} 242}
239 243
240void ConfigPage::defaults() 244void ConfigPage::defaults()
241{ 245{
242} 246}
243 247
244void ConfigPage::slotFamilyChanged( int pos ) 248void ConfigPage::slotFamilyChanged( int pos )
245{ 249{
@@ -332,50 +336,50 @@ void ConfigPage::slotAdd()
332 336
333 if ( dlg.exec() ) { 337 if ( dlg.exec() ) {
334 mCurrentManager->add( resource ); 338 mCurrentManager->add( resource );
335 339
336 ConfigViewItem *item = new ConfigViewItem( mListView, resource ); 340 ConfigViewItem *item = new ConfigViewItem( mListView, resource );
337 341
338 mLastItem = item; 342 mLastItem = item;
339 343
340 // if there are only read-only resources we'll set this resource 344 // if there are only read-only resources we'll set this resource
341 // as standard resource 345 // as standard resource
342 if ( !resource->readOnly() ) { 346 if ( !resource->readOnly() ) {
343 bool onlyReadOnly = true; 347 bool onlyReadOnly = true;
344 QListViewItem *it = mListView->firstChild(); 348 Q3ListViewItem *it = mListView->firstChild();
345 while ( it != 0 ) { 349 while ( it != 0 ) {
346 ConfigViewItem *confIt = static_cast<ConfigViewItem*>( it ); 350 ConfigViewItem *confIt = static_cast<ConfigViewItem*>( it );
347 if ( !confIt->readOnly() && confIt != item ) 351 if ( !confIt->readOnly() && confIt != item )
348 onlyReadOnly = false; 352 onlyReadOnly = false;
349 353
350 it = it->itemBelow(); 354 it = it->itemBelow();
351 } 355 }
352 356
353 if ( onlyReadOnly ) 357 if ( onlyReadOnly )
354 item->setStandard( true ); 358 item->setStandard( true );
355 } 359 }
356 360
357 emit changed( true ); 361 emit changed( true );
358 } else { 362 } else {
359 delete resource; 363 delete resource;
360 resource = 0; 364 resource = 0;
361 } 365 }
362} 366}
363 367
364void ConfigPage::slotRemove() 368void ConfigPage::slotRemove()
365{ 369{
366 if ( !mCurrentManager ) 370 if ( !mCurrentManager )
367 return; 371 return;
368 372
369 QListViewItem *item = mListView->currentItem(); 373 Q3ListViewItem *item = mListView->currentItem();
370 ConfigViewItem *confItem = static_cast<ConfigViewItem*>( item ); 374 ConfigViewItem *confItem = static_cast<ConfigViewItem*>( item );
371 375
372 if ( !confItem ) 376 if ( !confItem )
373 return; 377 return;
374 378
375 if ( confItem->standard() ) { 379 if ( confItem->standard() ) {
376 KMessageBox::sorry( this, i18n( "You cannot remove your standard resource!\n Please select a new standard resource first." ) ); 380 KMessageBox::sorry( this, i18n( "You cannot remove your standard resource!\n Please select a new standard resource first." ) );
377 return; 381 return;
378 } 382 }
379 383
380 mCurrentManager->remove( confItem->resource() ); 384 mCurrentManager->remove( confItem->resource() );
381 385
@@ -384,25 +388,25 @@ void ConfigPage::slotRemove()
384 388
385 mListView->takeItem( item ); 389 mListView->takeItem( item );
386 delete item; 390 delete item;
387 391
388 emit changed( true ); 392 emit changed( true );
389} 393}
390 394
391void ConfigPage::slotEdit() 395void ConfigPage::slotEdit()
392{ 396{
393 if ( !mCurrentManager ) 397 if ( !mCurrentManager )
394 return; 398 return;
395 399
396 QListViewItem *item = mListView->currentItem(); 400 Q3ListViewItem *item = mListView->currentItem();
397 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item ); 401 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item );
398 if ( !configItem ) 402 if ( !configItem )
399 return; 403 return;
400 404
401 Resource *resource = configItem->resource(); 405 Resource *resource = configItem->resource();
402 406
403 ConfigDialog dlg( this, mFamily, resource, "KRES::ConfigDialog" ); 407 ConfigDialog dlg( this, mFamily, resource, "KRES::ConfigDialog" );
404 408
405 if ( dlg.exec() ) { 409 if ( dlg.exec() ) {
406 configItem->setText( 0, resource->resourceName() ); 410 configItem->setText( 0, resource->resourceName() );
407 configItem->setText( 1, resource->type() ); 411 configItem->setText( 1, resource->type() );
408 412
@@ -426,25 +430,25 @@ void ConfigPage::slotStandard()
426 return; 430 return;
427 431
428 if ( item->readOnly() ) { 432 if ( item->readOnly() ) {
429 KMessageBox::sorry( this, i18n( "You cannot use a read-only<br>resource as standard!" ) ); 433 KMessageBox::sorry( this, i18n( "You cannot use a read-only<br>resource as standard!" ) );
430 return; 434 return;
431 } 435 }
432 436
433 if ( !item->isOn() ) { 437 if ( !item->isOn() ) {
434 KMessageBox::sorry( this, i18n( "You cannot use an inactive<br>resource as standard!" ) ); 438 KMessageBox::sorry( this, i18n( "You cannot use an inactive<br>resource as standard!" ) );
435 return; 439 return;
436 } 440 }
437 441
438 QListViewItem *it = mListView->firstChild(); 442 Q3ListViewItem *it = mListView->firstChild();
439 while ( it != 0 ) { 443 while ( it != 0 ) {
440 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( it ); 444 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( it );
441 if ( configItem->standard() ) 445 if ( configItem->standard() )
442 configItem->setStandard( false ); 446 configItem->setStandard( false );
443 it = it->itemBelow(); 447 it = it->itemBelow();
444 } 448 }
445 449
446 item->setStandard( true ); 450 item->setStandard( true );
447 mCurrentManager->setStandardResource( item->resource() ); 451 mCurrentManager->setStandardResource( item->resource() );
448 emit changed( true ); 452 emit changed( true );
449 453
450} 454}
@@ -473,47 +477,47 @@ void ConfigPage::resourceAdded( Resource* resource )
473} 477}
474 478
475void ConfigPage::resourceModified( Resource* resource ) 479void ConfigPage::resourceModified( Resource* resource )
476{ 480{
477 qDebug("ConfigPage::resourceModified : %s", resource->resourceName().latin1()); 481 qDebug("ConfigPage::resourceModified : %s", resource->resourceName().latin1());
478} 482}
479 483
480void ConfigPage::resourceDeleted( Resource* resource ) 484void ConfigPage::resourceDeleted( Resource* resource )
481{ 485{
482 qDebug("ConfigPage::resourceDeleted : %s", resource->resourceName().latin1()); 486 qDebug("ConfigPage::resourceDeleted : %s", resource->resourceName().latin1());
483} 487}
484 488
485void ConfigPage::slotItemClicked( QListViewItem *item ) 489void ConfigPage::slotItemClicked( Q3ListViewItem *item )
486{ 490{
487 ConfigViewItem *configItem = static_cast<ConfigViewItem *>( item ); 491 ConfigViewItem *configItem = static_cast<ConfigViewItem *>( item );
488 if ( !configItem ) return; 492 if ( !configItem ) return;
489 493
490 if ( configItem->standard() && !configItem->isOn() ) { 494 if ( configItem->standard() && !configItem->isOn() ) {
491 KMessageBox::sorry( this, i18n( "You cannot deactivate the<br>standard resource. Choose<br>another standard resource first." ) ); 495 KMessageBox::sorry( this, i18n( "You cannot deactivate the<br>standard resource. Choose<br>another standard resource first." ) );
492 configItem->setOn( true ); 496 configItem->setOn( true );
493 return; 497 return;
494 } 498 }
495 499
496 if ( configItem->isOn() != configItem->resource()->isActive() ) { 500 if ( configItem->isOn() != configItem->resource()->isActive() ) {
497 emit changed( true ); 501 emit changed( true );
498 } 502 }
499} 503}
500 504
501void ConfigPage::saveResourceSettings() 505void ConfigPage::saveResourceSettings()
502{ 506{
503 //qDebug("ConfigPage::saveResourceSettings() begin"); 507 //qDebug("ConfigPage::saveResourceSettings() begin");
504 508
505 if ( mCurrentManager ) { 509 if ( mCurrentManager ) {
506 510
507 QListViewItem *item = mListView->firstChild(); 511 Q3ListViewItem *item = mListView->firstChild();
508 while ( item ) { 512 while ( item ) {
509 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item ); 513 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item );
510 514
511 // check if standard resource 515 // check if standard resource
512 if ( configItem->standard() && !configItem->readOnly() && 516 if ( configItem->standard() && !configItem->readOnly() &&
513 configItem->isOn() ) { 517 configItem->isOn() ) {
514 518
515 mCurrentManager->setStandardResource( configItem->resource() ); 519 mCurrentManager->setStandardResource( configItem->resource() );
516 } 520 }
517 521
518 // check if active or passive resource 522 // check if active or passive resource
519 configItem->resource()->setActive( configItem->isOn() ); 523 configItem->resource()->setActive( configItem->isOn() );
diff --git a/microkde/kresources/configpage.h b/microkde/kresources/configpage.h
index be9239e..dc1aa50 100644
--- a/microkde/kresources/configpage.h
+++ b/microkde/kresources/configpage.h
@@ -16,31 +16,33 @@
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22 22
23#ifndef KRESOURCES_CONFIGPAGE_H 23#ifndef KRESOURCES_CONFIGPAGE_H
24#define KRESOURCES_CONFIGPAGE_H 24#define KRESOURCES_CONFIGPAGE_H
25 25
26#include <qstringlist.h> 26#include <qstringlist.h>
27#include <qwidget.h> 27#include <qwidget.h>
28//Added by qt3to4:
29#include <Q3ValueList>
28 30
29#include "manager.h" 31#include "manager.h"
30 32
31class KComboBox; 33class KComboBox;
32class KListView; 34class KListView;
33 35
34class QListViewItem; 36class Q3ListViewItem;
35class QPushButton; 37class QPushButton;
36 38
37 39
38namespace KRES { 40namespace KRES {
39 41
40class ResourcePageInfo 42class ResourcePageInfo
41{ 43{
42 public: 44 public:
43 Manager<Resource> *mManager; 45 Manager<Resource> *mManager;
44 KConfig *mConfig; 46 KConfig *mConfig;
45}; 47};
46 48
@@ -64,41 +66,41 @@ class ConfigPage : public QWidget, public ManagerListener<Resource>
64 void slotRemove(); 66 void slotRemove();
65 void slotEdit(); 67 void slotEdit();
66 void slotStandard(); 68 void slotStandard();
67 void slotSelectionChanged(); 69 void slotSelectionChanged();
68 70
69 // From ManagerListener<Resource> 71 // From ManagerListener<Resource>
70 public: 72 public:
71 virtual void resourceAdded( Resource* resource ); 73 virtual void resourceAdded( Resource* resource );
72 virtual void resourceModified( Resource* resource ); 74 virtual void resourceModified( Resource* resource );
73 virtual void resourceDeleted( Resource* resource ); 75 virtual void resourceDeleted( Resource* resource );
74 76
75 protected slots: 77 protected slots:
76 void slotItemClicked( QListViewItem * ); 78 void slotItemClicked( Q3ListViewItem * );
77 79
78 signals: 80 signals:
79 void changed( bool ); 81 void changed( bool );
80 82
81 private: 83 private:
82 void saveResourceSettings(); 84 void saveResourceSettings();
83 85
84 Manager<Resource>* mCurrentManager; 86 Manager<Resource>* mCurrentManager;
85 KConfig* mCurrentConfig; 87 KConfig* mCurrentConfig;
86 KConfig* mConfig; 88 KConfig* mConfig;
87 QString mFamily; 89 QString mFamily;
88 QStringList mFamilyMap; 90 QStringList mFamilyMap;
89 QValueList<ResourcePageInfo> mInfoMap; 91 Q3ValueList<ResourcePageInfo> mInfoMap;
90 92
91 KComboBox* mFamilyCombo; 93 KComboBox* mFamilyCombo;
92 KListView* mListView; 94 KListView* mListView;
93 QPushButton* mAddButton; 95 QPushButton* mAddButton;
94 QPushButton* mRemoveButton; 96 QPushButton* mRemoveButton;
95 QPushButton* mEditButton; 97 QPushButton* mEditButton;
96 QPushButton* mStandardButton; 98 QPushButton* mStandardButton;
97 99
98 QListViewItem* mLastItem; 100 Q3ListViewItem* mLastItem;
99 static const QString syncfamily; 101 static const QString syncfamily;
100}; 102};
101 103
102} 104}
103 105
104#endif 106#endif
diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp
index 86b22b2..4f286d1 100644
--- a/microkde/kresources/factory.cpp
+++ b/microkde/kresources/factory.cpp
@@ -32,35 +32,35 @@
32#include <qfile.h> 32#include <qfile.h>
33 33
34#include "resource.h" 34#include "resource.h"
35#include "factory.h" 35#include "factory.h"
36 36
37#ifdef STATIC_RESOURCES 37#ifdef STATIC_RESOURCES
38#include <file/resourcefile.h> 38#include <file/resourcefile.h>
39#include <dir/resourcedir.h> 39#include <dir/resourcedir.h>
40#include <qtopia/resourceqtopia.h> 40#include <qtopia/resourceqtopia.h>
41#endif 41#endif
42using namespace KRES; 42using namespace KRES;
43 43
44QDict<Factory> *Factory::mSelves = 0; 44Q3Dict<Factory> *Factory::mSelves = 0;
45static KStaticDeleter< QDict<Factory> > staticDeleter; 45static KStaticDeleter< Q3Dict<Factory> > staticDeleter;
46 46
47Factory *Factory::self( const QString& resourceFamily) 47Factory *Factory::self( const QString& resourceFamily)
48{ 48{
49 49
50 50
51 Factory *factory = 0; 51 Factory *factory = 0;
52 if ( !mSelves ) 52 if ( !mSelves )
53 { 53 {
54 mSelves = staticDeleter.setObject( new QDict<Factory> ); 54 mSelves = staticDeleter.setObject( new Q3Dict<Factory> );
55 } 55 }
56 56
57 factory = mSelves->find( resourceFamily ); 57 factory = mSelves->find( resourceFamily );
58 58
59 if ( !factory ) { 59 if ( !factory ) {
60 factory = new Factory( resourceFamily); 60 factory = new Factory( resourceFamily);
61 mSelves->insert( resourceFamily, factory ); 61 mSelves->insert( resourceFamily, factory );
62 } 62 }
63 63
64 return factory; 64 return factory;
65} 65}
66 66
diff --git a/microkde/kresources/factory.h b/microkde/kresources/factory.h
index ea01b23..709fde0 100644
--- a/microkde/kresources/factory.h
+++ b/microkde/kresources/factory.h
@@ -15,25 +15,25 @@
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details. 16 Library General Public License for more details.
17 17
18 You should have received a copy of the GNU Library General Public License 18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to 19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. 21 Boston, MA 02111-1307, USA.
22*/ 22*/
23 23
24#ifndef KRESOURCES_FACTORY_H 24#ifndef KRESOURCES_FACTORY_H
25#define KRESOURCES_FACTORY_H 25#define KRESOURCES_FACTORY_H
26 26
27#include <qdict.h> 27#include <q3dict.h>
28#include <qstring.h> 28#include <qstring.h>
29 29
30#include <kconfig.h> 30#include <kconfig.h>
31 31
32 32
33#include "resource.h" 33#include "resource.h"
34 34
35namespace KRES { 35namespace KRES {
36 36
37class ConfigWidget; 37class ConfigWidget;
38 38
39//US 39//US
@@ -105,22 +105,22 @@ class Factory
105 */ 105 */
106 QString typeName( const QString &type ) const; 106 QString typeName( const QString &type ) const;
107 107
108 /** 108 /**
109 * Returns the description for a special type. 109 * Returns the description for a special type.
110 */ 110 */
111 QString typeDescription( const QString &type ) const; 111 QString typeDescription( const QString &type ) const;
112 112
113 protected: 113 protected:
114 Factory( const QString& resourceFamily); 114 Factory( const QString& resourceFamily);
115 115
116 private: 116 private:
117 static QDict<Factory> *mSelves; 117 static Q3Dict<Factory> *mSelves;
118 118
119 QString mResourceFamily; 119 QString mResourceFamily;
120//US QMap<QString, KService::Ptr> mTypeMap; 120//US QMap<QString, KService::Ptr> mTypeMap;
121//US lets store the pluginfo struct as value instead of a KService 121//US lets store the pluginfo struct as value instead of a KService
122 QMap<QString, PluginInfo*> mTypeMap; 122 QMap<QString, PluginInfo*> mTypeMap;
123}; 123};
124 124
125} 125}
126#endif 126#endif
diff --git a/microkde/kresources/kcmkresources.cpp b/microkde/kresources/kcmkresources.cpp
index d600a31..f5eb826 100644
--- a/microkde/kresources/kcmkresources.cpp
+++ b/microkde/kresources/kcmkresources.cpp
@@ -11,47 +11,50 @@
11 This library is distributed in the hope that it will be useful, 11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <qlayout.h> 22#include <qlayout.h>
23//Added by qt3to4:
24#include <Q3VBoxLayout>
25#include <Q3Frame>
23 26
24//US #include <kaboutdata.h> 27//US #include <kaboutdata.h>
25//US #include <kgenericfactory.h> 28//US #include <kgenericfactory.h>
26#include <klocale.h> 29#include <klocale.h>
27 30
28#include "configpage.h" 31#include "configpage.h"
29 32
30#include "kcmkresources.h" 33#include "kcmkresources.h"
31 34
32using namespace KRES; 35using namespace KRES;
33 36
34//US typedef KGenericFactory<KCMKResources, QWidget> ResourcesFactory; 37//US typedef KGenericFactory<KCMKResources, QWidget> ResourcesFactory;
35//US K_EXPORT_COMPONENT_FACTORY( kcm_kresources, ResourcesFactory( "kcmkresources" ) ); 38//US K_EXPORT_COMPONENT_FACTORY( kcm_kresources, ResourcesFactory( "kcmkresources" ) );
36 39
37//US KCMKResources::KCMKResources( QWidget *parent, const char *name, const QStringList& ) 40//US KCMKResources::KCMKResources( QWidget *parent, const char *name, const QStringList& )
38//US : KCModule( ResourcesFactory::instance(), parent, name ) 41//US : KCModule( ResourcesFactory::instance(), parent, name )
39KCMKResources::KCMKResources( QWidget *parent, const char *name, const QStringList& ) 42KCMKResources::KCMKResources( QWidget *parent, const char *name, const QStringList& )
40 : KDialogBase( parent, name, true, i18n( "Configure Resources" ), 43 : KDialogBase( parent, name, true, i18n( "Configure Resources" ),
41 Ok|Cancel, Ok, true ) 44 Ok|Cancel, Ok, true )
42{ 45{
43 QFrame *main = plainPage(); 46 Q3Frame *main = plainPage();
44 47
45 QVBoxLayout *layout = new QVBoxLayout( main ); 48 Q3VBoxLayout *layout = new Q3VBoxLayout( main );
46 mConfigPage = new KRES::ConfigPage( main ); 49 mConfigPage = new KRES::ConfigPage( main );
47 layout->addWidget( mConfigPage ); 50 layout->addWidget( mConfigPage );
48 51
49 52
50 connect( mConfigPage, SIGNAL( changed( bool ) ), SLOT( changed( bool ) ) ); 53 connect( mConfigPage, SIGNAL( changed( bool ) ), SLOT( changed( bool ) ) );
51#ifndef DESKTOP_VERSION 54#ifndef DESKTOP_VERSION
52 showMaximized(); 55 showMaximized();
53#endif 56#endif
54} 57}
55 58
56void KCMKResources::changed( bool changed) 59void KCMKResources::changed( bool changed)
57{ 60{
diff --git a/microkde/kresources/manager.h b/microkde/kresources/manager.h
index 69062da..88705d4 100644
--- a/microkde/kresources/manager.h
+++ b/microkde/kresources/manager.h
@@ -23,26 +23,28 @@
23*/ 23*/
24 24
25/* 25/*
26Enhanced Version of the file for platform independent KDE tools. 26Enhanced Version of the file for platform independent KDE tools.
27Copyright (c) 2004 Ulf Schenk 27Copyright (c) 2004 Ulf Schenk
28 28
29$Id$ 29$Id$
30*/ 30*/
31 31
32#ifndef KRESOURCES_MANAGER_H 32#ifndef KRESOURCES_MANAGER_H
33#define KRESOURCES_MANAGER_H 33#define KRESOURCES_MANAGER_H
34 34
35#include <qdict.h> 35#include <q3dict.h>
36#include <qstringlist.h> 36#include <qstringlist.h>
37//Added by qt3to4:
38#include <Q3PtrList>
37 39
38#include "factory.h" 40#include "factory.h"
39#include "managerimpl.h" 41#include "managerimpl.h"
40 42
41namespace KRES { 43namespace KRES {
42 44
43class Resource; 45class Resource;
44 46
45template<class T> 47template<class T>
46class ManagerListener 48class ManagerListener
47{ 49{
48 public: 50 public:
@@ -166,25 +168,25 @@ class Manager : private ManagerImplListener
166 } 168 }
167 169
168 bool isEmpty() const { return mImpl->resourceList()->isEmpty(); } 170 bool isEmpty() const { return mImpl->resourceList()->isEmpty(); }
169 171
170 Manager( const QString &family ) 172 Manager( const QString &family )
171 { 173 {
172 mFactory = Factory::self( family ); 174 mFactory = Factory::self( family );
173 // The managerimpl will use the same Factory object as the manager 175 // The managerimpl will use the same Factory object as the manager
174 // because of the Factory::self() pattern 176 // because of the Factory::self() pattern
175 mImpl = new ManagerImpl( family ); 177 mImpl = new ManagerImpl( family );
176 mImpl->setListener( this ); 178 mImpl->setListener( this );
177 179
178 mListeners = new QPtrList<ManagerListener<T> >; 180 mListeners = new Q3PtrList<ManagerListener<T> >;
179 } 181 }
180 182
181 virtual ~Manager() 183 virtual ~Manager()
182 { 184 {
183 mImpl->setListener( 0 ); 185 mImpl->setListener( 0 );
184 delete mListeners; 186 delete mListeners;
185 delete mImpl; 187 delete mImpl;
186 } 188 }
187 189
188 /** 190 /**
189 Recreate Resource objects from configuration file. If cfg is 0, read standard 191 Recreate Resource objects from configuration file. If cfg is 0, read standard
190 configuration file. 192 configuration file.
@@ -321,18 +323,18 @@ class Manager : private ManagerImplListener
321 { 323 {
322 324
323 T* resource = (T *)( res ); 325 T* resource = (T *)( res );
324 ManagerListener<T> *listener; 326 ManagerListener<T> *listener;
325 for ( listener = mListeners->first(); listener; listener = mListeners->next() ) { 327 for ( listener = mListeners->first(); listener; listener = mListeners->next() ) {
326 listener->resourceDeleted( resource ); 328 listener->resourceDeleted( resource );
327 } 329 }
328 } 330 }
329 331
330 private: 332 private:
331 ManagerImpl *mImpl; 333 ManagerImpl *mImpl;
332 Factory *mFactory; 334 Factory *mFactory;
333 QPtrList<ManagerListener<T> > *mListeners; 335 Q3PtrList<ManagerListener<T> > *mListeners;
334}; 336};
335 337
336} 338}
337 339
338#endif 340#endif
diff --git a/microkde/kresources/managerimpl.cpp b/microkde/kresources/managerimpl.cpp
index a6d2007..4c0751c 100644
--- a/microkde/kresources/managerimpl.cpp
+++ b/microkde/kresources/managerimpl.cpp
@@ -26,24 +26,26 @@ Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <kglobal.h> 31#include <kglobal.h>
32 32
33#include <kapplication.h> 33#include <kapplication.h>
34#include <kdebug.h> 34#include <kdebug.h>
35#include <kconfig.h> 35#include <kconfig.h>
36#include <kstandarddirs.h> 36#include <kstandarddirs.h>
37#include <qfile.h> 37#include <qfile.h>
38//Added by qt3to4:
39#include <Q3PtrList>
38 40
39#include "resource.h" 41#include "resource.h"
40#include "factory.h" 42#include "factory.h"
41#include "managerimpl.h" 43#include "managerimpl.h"
42 44
43 45
44 46
45using namespace KRES; 47using namespace KRES;
46 48
47ManagerImpl::ManagerImpl( const QString &family ) 49ManagerImpl::ManagerImpl( const QString &family )
48 : mFamily( family ), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ), 50 : mFamily( family ), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ),
49 mFactory( 0 ) 51 mFactory( 0 )
@@ -223,38 +225,38 @@ QStringList ManagerImpl::resourceNames()
223 Resource::List::ConstIterator it; 225 Resource::List::ConstIterator it;
224 for ( it = mResources.begin(); it != mResources.end(); ++it ) { 226 for ( it = mResources.begin(); it != mResources.end(); ++it ) {
225 result.append( (*it)->resourceName() ); 227 result.append( (*it)->resourceName() );
226 } 228 }
227 return result; 229 return result;
228} 230}
229 231
230Resource::List *ManagerImpl::resourceList() 232Resource::List *ManagerImpl::resourceList()
231{ 233{
232 return &mResources; 234 return &mResources;
233} 235}
234 236
235QPtrList<Resource> ManagerImpl::resources() 237Q3PtrList<Resource> ManagerImpl::resources()
236{ 238{
237 QPtrList<Resource> result; 239 Q3PtrList<Resource> result;
238 240
239 Resource::List::ConstIterator it; 241 Resource::List::ConstIterator it;
240 for ( it = mResources.begin(); it != mResources.end(); ++it ) { 242 for ( it = mResources.begin(); it != mResources.end(); ++it ) {
241 result.append( *it ); 243 result.append( *it );
242 } 244 }
243 return result; 245 return result;
244} 246}
245 247
246QPtrList<Resource> ManagerImpl::resources( bool active ) 248Q3PtrList<Resource> ManagerImpl::resources( bool active )
247{ 249{
248 QPtrList<Resource> result; 250 Q3PtrList<Resource> result;
249 251
250 Resource::List::ConstIterator it; 252 Resource::List::ConstIterator it;
251 for ( it = mResources.begin(); it != mResources.end(); ++it ) { 253 for ( it = mResources.begin(); it != mResources.end(); ++it ) {
252 if ( (*it)->isActive() == active ) { 254 if ( (*it)->isActive() == active ) {
253 result.append( *it ); 255 result.append( *it );
254 } 256 }
255 } 257 }
256 return result; 258 return result;
257} 259}
258 260
259void ManagerImpl::setListener( ManagerImplListener *listener ) 261void ManagerImpl::setListener( ManagerImplListener *listener )
260{ 262{
diff --git a/microkde/kresources/managerimpl.h b/microkde/kresources/managerimpl.h
index 56a2db6..1f728e5 100644
--- a/microkde/kresources/managerimpl.h
+++ b/microkde/kresources/managerimpl.h
@@ -23,26 +23,26 @@
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#ifndef KRESOURCES_MANAGERIMPL_H 31#ifndef KRESOURCES_MANAGERIMPL_H
32#define KRESOURCES_MANAGERIMPL_H 32#define KRESOURCES_MANAGERIMPL_H
33 33
34#include <qstring.h> 34#include <qstring.h>
35#include <qptrlist.h> 35#include <q3ptrlist.h>
36#include <qdict.h> 36#include <q3dict.h>
37//US 37//US
38#include <qobject.h> 38#include <qobject.h>
39 39
40#include "resource.h" 40#include "resource.h"
41 41
42 42
43class KConfig; 43class KConfig;
44 44
45namespace KRES { 45namespace KRES {
46 46
47class Resource; 47class Resource;
48class Factory; 48class Factory;
@@ -72,28 +72,28 @@ class ManagerImpl : public QObject
72 void writeConfig( KConfig * ); 72 void writeConfig( KConfig * );
73 73
74 void add( Resource *resource, bool useDCOP = true ); 74 void add( Resource *resource, bool useDCOP = true );
75 void remove( Resource *resource, bool useDCOP = true ); 75 void remove( Resource *resource, bool useDCOP = true );
76 76
77 Resource *standardResource(); 77 Resource *standardResource();
78 void setStandardResource( Resource *resource ); 78 void setStandardResource( Resource *resource );
79 79
80 void setActive( Resource *resource, bool active ); 80 void setActive( Resource *resource, bool active );
81 81
82 Resource::List *resourceList(); 82 Resource::List *resourceList();
83 83
84 QPtrList<Resource> resources(); 84 Q3PtrList<Resource> resources();
85 85
86 // Get only active or passive resources 86 // Get only active or passive resources
87 QPtrList<Resource> resources( bool active ); 87 Q3PtrList<Resource> resources( bool active );
88 88
89 QStringList resourceNames(); 89 QStringList resourceNames();
90 90
91 void setListener( ManagerImplListener *listener ); 91 void setListener( ManagerImplListener *listener );
92 92
93 public slots: 93 public slots:
94 void resourceChanged( Resource *resource ); 94 void resourceChanged( Resource *resource );
95 95
96 private: 96 private:
97 // dcop calls 97 // dcop calls
98 98
99 private: 99 private:
diff --git a/microkde/kresources/resource.h b/microkde/kresources/resource.h
index ed5af96..1f9527c 100644
--- a/microkde/kresources/resource.h
+++ b/microkde/kresources/resource.h
@@ -19,25 +19,25 @@
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22 22
23#ifndef KRESOURCES_RESOURCE_H 23#ifndef KRESOURCES_RESOURCE_H
24#define KRESOURCES_RESOURCE_H 24#define KRESOURCES_RESOURCE_H
25 25
26//US 26//US
27#ifdef QT_THREAD_SUPPORT 27#ifdef QT_THREAD_SUPPORT
28#include <qmutex.h> 28#include <qmutex.h>
29#endif //QT_THREAD_SUPPORT 29#endif //QT_THREAD_SUPPORT
30 30
31#include <qvaluelist.h> 31#include <q3valuelist.h>
32#include <qwidget.h> 32#include <qwidget.h>
33 33
34#include <qobject.h> 34#include <qobject.h>
35 35
36#include <klibloader.h> 36#include <klibloader.h>
37 37
38class KConfig; 38class KConfig;
39 39
40namespace KRES { 40namespace KRES {
41 41
42class ConfigWidget; 42class ConfigWidget;
43 43
@@ -230,25 +230,25 @@ link_DATA= resourceexample.desktop
230/** 230/**
231 * A @ref Resource is a ... 231 * A @ref Resource is a ...
232 * 232 *
233 * A subclass should reimplement at least the constructor and the 233 * A subclass should reimplement at least the constructor and the
234k * @ref writeConfig method. 234k * @ref writeConfig method.
235 * 235 *
236 */ 236 */
237class Resource : public QObject 237class Resource : public QObject
238{ 238{
239 Q_OBJECT 239 Q_OBJECT
240 240
241 public: 241 public:
242 typedef QValueList<Resource *> List; 242 typedef Q3ValueList<Resource *> List;
243 243
244 /** 244 /**
245 * Constructor. Construct resource from config. 245 * Constructor. Construct resource from config.
246 * @param config Configuration to read persistence information from. 246 * @param config Configuration to read persistence information from.
247 * If config==0, create object using default settings. 247 * If config==0, create object using default settings.
248 */ 248 */
249 Resource( const KConfig* config ); 249 Resource( const KConfig* config );
250 250
251 /** 251 /**
252 * Destructor. 252 * Destructor.
253 */ 253 */
254 virtual ~Resource(); 254 virtual ~Resource();
diff --git a/microkde/kresources/selectdialog.cpp b/microkde/kresources/selectdialog.cpp
index fba8648..d5b83e9 100644
--- a/microkde/kresources/selectdialog.cpp
+++ b/microkde/kresources/selectdialog.cpp
@@ -25,64 +25,68 @@
25#include <kbuttonbox.h> 25#include <kbuttonbox.h>
26#include <klistbox.h> 26#include <klistbox.h>
27#include <klocale.h> 27#include <klocale.h>
28#include <kmessagebox.h> 28#include <kmessagebox.h>
29 29
30*/ 30*/
31#include <klocale.h> 31#include <klocale.h>
32#include <kmessagebox.h> 32#include <kmessagebox.h>
33 33
34//US 34//US
35#include <kglobal.h> 35#include <kglobal.h>
36 36
37#include <qlistbox.h> 37#include <q3listbox.h>
38#include <qlayout.h> 38#include <qlayout.h>
39#include <qgroupbox.h> 39#include <q3groupbox.h>
40//Added by qt3to4:
41#include <Q3VBoxLayout>
42#include <Q3Frame>
43#include <Q3PtrList>
40 44
41#include "resource.h" 45#include "resource.h"
42 46
43#include "selectdialog.h" 47#include "selectdialog.h"
44 48
45using namespace KRES; 49using namespace KRES;
46 50
47//US I am using KBaseDialog instead of KDialog 51//US I am using KBaseDialog instead of KDialog
48//US : KDialog( parent, name, true ) 52//US : KDialog( parent, name, true )
49SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, 53SelectDialog::SelectDialog( Q3PtrList<Resource> list, QWidget *parent,
50 const char *name ) 54 const char *name )
51 : KDialogBase( parent, name, true, i18n( "Resource Selection" ), Help | Ok | Cancel, 55 : KDialogBase( parent, name, true, i18n( "Resource Selection" ), Help | Ok | Cancel,
52 Ok, true) 56 Ok, true)
53 57
54{ 58{
55//US setCaption( i18n( "Resource Selection" ) ); 59//US setCaption( i18n( "Resource Selection" ) );
56//US resize( 300, 200 ); 60//US resize( 300, 200 );
57 resize( KMIN(KGlobal::getDesktopWidth(), 300), KMIN(KGlobal::getDesktopHeight(), 200) ); 61 resize( KMIN(KGlobal::getDesktopWidth(), 300), KMIN(KGlobal::getDesktopHeight(), 200) );
58 62
59//US 63//US
60 QFrame *main = plainPage(); 64 Q3Frame *main = plainPage();
61/*US 65/*US
62 QVBoxLayout *layout = new QVBoxLayout( main ); 66 QVBoxLayout *layout = new QVBoxLayout( main );
63 mConfigPage = new KRES::ConfigPage( main ); 67 mConfigPage = new KRES::ConfigPage( main );
64 layout->addWidget( mConfigPage ); 68 layout->addWidget( mConfigPage );
65*/ 69*/
66 70
67//US QVBoxLayout *mainLayout = new QVBoxLayout( this ); 71//US QVBoxLayout *mainLayout = new QVBoxLayout( this );
68 QVBoxLayout *mainLayout = new QVBoxLayout( main ); 72 Q3VBoxLayout *mainLayout = new Q3VBoxLayout( main );
69 mainLayout->setMargin( marginHint() ); 73 mainLayout->setMargin( marginHint() );
70 74
71//US QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, this ); 75//US QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, this );
72 QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, main ); 76 Q3GroupBox *groupBox = new Q3GroupBox( 2, Qt::Horizontal, main );
73 groupBox->setTitle( i18n( "Resources" ) ); 77 groupBox->setTitle( i18n( "Resources" ) );
74 78
75//US mResourceId = new KListBox( groupBox ); 79//US mResourceId = new KListBox( groupBox );
76 mResourceId = new QListBox( groupBox ); 80 mResourceId = new Q3ListBox( groupBox );
77 81
78 mainLayout->addWidget( groupBox ); 82 mainLayout->addWidget( groupBox );
79 83
80 mainLayout->addSpacing( 40 ); 84 mainLayout->addSpacing( 40 );
81 85
82/*US 86/*US
83 KButtonBox *buttonBox = new KButtonBox( this ); 87 KButtonBox *buttonBox = new KButtonBox( this );
84 88
85 buttonBox->addStretch(); 89 buttonBox->addStretch();
86 buttonBox->addButton( i18n( "&OK" ), this, SLOT( accept() ) ); 90 buttonBox->addButton( i18n( "&OK" ), this, SLOT( accept() ) );
87 buttonBox->addButton( i18n( "&Cancel" ), this, SLOT( reject() ) ); 91 buttonBox->addButton( i18n( "&Cancel" ), this, SLOT( reject() ) );
88 buttonBox->layout(); 92 buttonBox->layout();
@@ -92,37 +96,37 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent,
92 // setup listbox 96 // setup listbox
93 uint counter = 0; 97 uint counter = 0;
94 for ( uint i = 0; i < list.count(); ++i ) { 98 for ( uint i = 0; i < list.count(); ++i ) {
95 Resource *resource = list.at( i ); 99 Resource *resource = list.at( i );
96 if ( resource && !resource->readOnly() ) { 100 if ( resource && !resource->readOnly() ) {
97 mResourceMap.insert( counter, resource ); 101 mResourceMap.insert( counter, resource );
98 mResourceId->insertItem( resource->resourceName() ); 102 mResourceId->insertItem( resource->resourceName() );
99 counter++; 103 counter++;
100 } 104 }
101 } 105 }
102 106
103 mResourceId->setCurrentItem( 0 ); 107 mResourceId->setCurrentItem( 0 );
104 connect( mResourceId, SIGNAL(returnPressed(QListBoxItem*)), 108 connect( mResourceId, SIGNAL(returnPressed(Q3ListBoxItem*)),
105 SLOT(accept()) ); 109 SLOT(accept()) );
106} 110}
107 111
108Resource *SelectDialog::resource() 112Resource *SelectDialog::resource()
109{ 113{
110 if ( mResourceId->currentItem() != -1 ) 114 if ( mResourceId->currentItem() != -1 )
111 return mResourceMap[ mResourceId->currentItem() ]; 115 return mResourceMap[ mResourceId->currentItem() ];
112 else 116 else
113 return 0; 117 return 0;
114} 118}
115 119
116Resource *SelectDialog::getResource( QPtrList<Resource> list, QWidget *parent ) 120Resource *SelectDialog::getResource( Q3PtrList<Resource> list, QWidget *parent )
117{ 121{
118 if ( list.count() == 0 ) { 122 if ( list.count() == 0 ) {
119 KMessageBox::error( parent, i18n( "There is no resource available!" ) ); 123 KMessageBox::error( parent, i18n( "There is no resource available!" ) );
120 return 0; 124 return 0;
121 } 125 }
122 126
123 if ( list.count() == 1 ) return list.first(); 127 if ( list.count() == 1 ) return list.first();
124 128
125 // the following lines will return a writeable resource if only _one_ writeable 129 // the following lines will return a writeable resource if only _one_ writeable
126 // resource exists 130 // resource exists
127 Resource *found = 0; 131 Resource *found = 0;
128 Resource *it = list.first(); 132 Resource *it = list.first();
diff --git a/microkde/kresources/selectdialog.h b/microkde/kresources/selectdialog.h
index 7026212..be5152b 100644
--- a/microkde/kresources/selectdialog.h
+++ b/microkde/kresources/selectdialog.h
@@ -16,31 +16,31 @@
16 Library General Public License for more details. 16 Library General Public License for more details.
17 17
18 You should have received a copy of the GNU Library General Public License 18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to 19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. 21 Boston, MA 02111-1307, USA.
22*/ 22*/
23 23
24#ifndef KRESOURCES_SELECTDIALOG_H 24#ifndef KRESOURCES_SELECTDIALOG_H
25#define KRESOURCES_SELECTDIALOG_H 25#define KRESOURCES_SELECTDIALOG_H
26 26
27#include <qobject.h> 27#include <qobject.h>
28#include <qptrlist.h> 28#include <q3ptrlist.h>
29#include <qmap.h> 29#include <qmap.h>
30 30
31#include <kdialogbase.h> 31#include <kdialogbase.h>
32 32
33//US class KListBox; 33//US class KListBox;
34class QListBox; 34class Q3ListBox;
35 35
36namespace KRES { 36namespace KRES {
37 37
38class Resource; 38class Resource;
39 39
40/** 40/**
41 * Dialog for selecting a resource. 41 * Dialog for selecting a resource.
42 * 42 *
43 * Example: 43 * Example:
44 * 44 *
45 * <pre> 45 * <pre>
46 * KABC::Resource *res = KABC::SelectDialog::getResource(); 46 * KABC::Resource *res = KABC::SelectDialog::getResource();
@@ -53,40 +53,40 @@ class Resource;
53 */ 53 */
54//US class SelectDialog : KDialog 54//US class SelectDialog : KDialog
55class SelectDialog : KDialogBase 55class SelectDialog : KDialogBase
56{ 56{
57 // Q_OBJECT 57 // Q_OBJECT
58 public: 58 public:
59 /** 59 /**
60 * Constructor. 60 * Constructor.
61 * @param ab The address book you want to select the resource from 61 * @param ab The address book you want to select the resource from
62 * @param parent The parent widget 62 * @param parent The parent widget
63 * @param name The name of the dialog 63 * @param name The name of the dialog
64 */ 64 */
65 SelectDialog( QPtrList<Resource> list, QWidget *parent = 0, 65 SelectDialog( Q3PtrList<Resource> list, QWidget *parent = 0,
66 const char *name = 0); 66 const char *name = 0);
67 67
68 // ~SelectDialog(); 68 // ~SelectDialog();
69 69
70 /** 70 /**
71 * Return selected resource. 71 * Return selected resource.
72 */ 72 */
73 Resource *resource(); 73 Resource *resource();
74 74
75 /** 75 /**
76 * Open a dialog showing the available resources and return the resource the 76 * Open a dialog showing the available resources and return the resource the
77 * user has selected. Returns 0, if the dialog was canceled. 77 * user has selected. Returns 0, if the dialog was canceled.
78 */ 78 */
79 static Resource *getResource( QPtrList<Resource> list, QWidget *parent = 0 ); 79 static Resource *getResource( Q3PtrList<Resource> list, QWidget *parent = 0 );
80 80
81 private: 81 private:
82//US KListBox *mResourceId; 82//US KListBox *mResourceId;
83 QListBox *mResourceId; 83 Q3ListBox *mResourceId;
84 84
85 QMap<int, Resource*> mResourceMap; 85 QMap<int, Resource*> mResourceMap;
86}; 86};
87 87
88 88
89 89
90} 90}
91 91
92#endif 92#endif
diff --git a/microkde/ksystemtray.cpp b/microkde/ksystemtray.cpp
index 4f81d02..0d0045f 100644
--- a/microkde/ksystemtray.cpp
+++ b/microkde/ksystemtray.cpp
@@ -1,11 +1,14 @@
1#include "ksystemtray.h" 1#include "ksystemtray.h"
2//Added by qt3to4:
3#include <QMouseEvent>
4#include <QLabel>
2 5
3void KSystemTray::mousePressEvent( QMouseEvent *) 6void KSystemTray::mousePressEvent( QMouseEvent *)
4{ 7{
5 ; //qDebug("hallo"); 8 ; //qDebug("hallo");
6} 9}
7 10
8KSystemTray::KSystemTray( QWidget *parent ) : QLabel( parent ) 11KSystemTray::KSystemTray( QWidget *parent ) : QLabel( parent )
9{ 12{
10 13
11} 14}
diff --git a/microkde/ksystemtray.h b/microkde/ksystemtray.h
index f3e4f6a..6708c86 100644
--- a/microkde/ksystemtray.h
+++ b/microkde/ksystemtray.h
@@ -1,14 +1,16 @@
1#ifndef MICROKDE_KSYSTEMTRAY_H 1#ifndef MICROKDE_KSYSTEMTRAY_H
2#define MICROKDE_KSYSTEMTRAY_H 2#define MICROKDE_KSYSTEMTRAY_H
3 3
4#include <qlabel.h> 4#include <qlabel.h>
5//Added by qt3to4:
6#include <QMouseEvent>
5 7
6class KSystemTray : public QLabel 8class KSystemTray : public QLabel
7{ 9{
8 Q_OBJECT 10 Q_OBJECT
9 public: 11 public:
10 KSystemTray( QWidget *parent = 0 ); 12 KSystemTray( QWidget *parent = 0 );
11 void mousePressEvent( QMouseEvent *); 13 void mousePressEvent( QMouseEvent *);
12}; 14};
13 15
14#endif 16#endif
diff --git a/microkde/ktempfile.cpp b/microkde/ktempfile.cpp
index b9166bd..d61d22e 100644
--- a/microkde/ktempfile.cpp
+++ b/microkde/ktempfile.cpp
@@ -1,25 +1,25 @@
1#include <qtextstream.h> 1#include <q3textstream.h>
2 2
3#include "ktempfile.h" 3#include "ktempfile.h"
4 4
5KTempFile::KTempFile() 5KTempFile::KTempFile()
6{ 6{
7} 7}
8 8
9KTempFile::KTempFile( const QString &filename, const QString &extension ) 9KTempFile::KTempFile( const QString &filename, const QString &extension )
10{ 10{
11} 11}
12 12
13void KTempFile::setAutoDelete( bool ) 13void KTempFile::setAutoDelete( bool )
14{ 14{
15} 15}
16 16
17QString KTempFile::name() 17QString KTempFile::name()
18{ 18{
19 return QString::null; 19 return QString::null;
20} 20}
21 21
22QTextStream *KTempFile::textStream() 22Q3TextStream *KTempFile::textStream()
23{ 23{
24 return 0; 24 return 0;
25} 25}
diff --git a/microkde/ktempfile.h b/microkde/ktempfile.h
index 20dfa82..1ac7258 100644
--- a/microkde/ktempfile.h
+++ b/microkde/ktempfile.h
@@ -1,20 +1,20 @@
1#ifndef MINIKDE_KTEMPFILE_H 1#ifndef MINIKDE_KTEMPFILE_H
2#define MINIKDE_KTEMPFILE_H 2#define MINIKDE_KTEMPFILE_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5 5
6class QTextStream; 6class Q3TextStream;
7 7
8class KTempFile 8class KTempFile
9{ 9{
10 public: 10 public:
11 KTempFile(); 11 KTempFile();
12 KTempFile( const QString &filename, const QString &extension ); 12 KTempFile( const QString &filename, const QString &extension );
13 13
14 void setAutoDelete( bool ); 14 void setAutoDelete( bool );
15 QString name(); 15 QString name();
16 16
17 QTextStream *textStream(); 17 Q3TextStream *textStream();
18}; 18};
19 19
20#endif 20#endif
diff --git a/microkde/ktextedit.cpp b/microkde/ktextedit.cpp
index 4dd6875..d74706b 100644
--- a/microkde/ktextedit.cpp
+++ b/microkde/ktextedit.cpp
@@ -1,53 +1,55 @@
1 1
2#include <ktextedit.h> 2#include <ktextedit.h>
3#ifndef DESKTOP_VERSION 3#ifndef DESKTOP_VERSION
4#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
5//Added by qt3to4:
6#include <QMouseEvent>
5#endif 7#endif
6 8
7 9
8KTextEdit::KTextEdit ( QWidget *parent ) : QMultiLineEdit( parent ) 10KTextEdit::KTextEdit ( QWidget *parent ) : Q3MultiLineEdit( parent )
9{ 11{
10 mAllowPopupMenu = false; 12 mAllowPopupMenu = false;
11 mMouseDown = false; 13 mMouseDown = false;
12 mIgnoreMark = false; 14 mIgnoreMark = false;
13#ifndef DESKTOP_VERSION 15#ifndef DESKTOP_VERSION
14 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); 16 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
15#endif 17#endif
16} 18}
17 19
18void KTextEdit::mousePressEvent(QMouseEvent *e) 20void KTextEdit::mousePressEvent(QMouseEvent *e)
19{ 21{
20 if ( e->button() == LeftButton ) { 22 if ( e->button() == Qt::LeftButton ) {
21 mAllowPopupMenu = true; 23 mAllowPopupMenu = true;
22 mYMousePos = mapToGlobal( (e->pos())).y(); 24 mYMousePos = mapToGlobal( (e->pos())).y();
23 mXMousePos = mapToGlobal( (e->pos())).x(); 25 mXMousePos = mapToGlobal( (e->pos())).x();
24 } 26 }
25 if ( e->button() == RightButton && !mAllowPopupMenu ) 27 if ( e->button() == Qt::RightButton && !mAllowPopupMenu )
26 return; 28 return;
27 if ( e->button() == LeftButton ) { 29 if ( e->button() == Qt::LeftButton ) {
28 if ( hasMarkedText () ) 30 if ( hasMarkedText () )
29 mIgnoreMark = !mIgnoreMark; 31 mIgnoreMark = !mIgnoreMark;
30 if ( mIgnoreMark && hasMarkedText () ) { 32 if ( mIgnoreMark && hasMarkedText () ) {
31 mMouseDown = false; 33 mMouseDown = false;
32 return ; 34 return ;
33 } 35 }
34 } 36 }
35 QMultiLineEdit::mousePressEvent( e ); 37 Q3MultiLineEdit::mousePressEvent( e );
36} 38}
37 39
38void KTextEdit::mouseReleaseEvent(QMouseEvent *e) 40void KTextEdit::mouseReleaseEvent(QMouseEvent *e)
39{ 41{
40 QMultiLineEdit::mouseReleaseEvent(e); 42 Q3MultiLineEdit::mouseReleaseEvent(e);
41} 43}
42 44
43void KTextEdit::mouseMoveEvent(QMouseEvent *e) 45void KTextEdit::mouseMoveEvent(QMouseEvent *e)
44{ 46{
45 int diff = mYMousePos - mapToGlobal( (e->pos())).y(); 47 int diff = mYMousePos - mapToGlobal( (e->pos())).y();
46 if ( diff < 0 ) diff = -diff; 48 if ( diff < 0 ) diff = -diff;
47 int diff2 = mXMousePos - mapToGlobal( (e->pos())).x(); 49 int diff2 = mXMousePos - mapToGlobal( (e->pos())).x();
48 if ( diff2 < 0 ) diff2 = -diff2; 50 if ( diff2 < 0 ) diff2 = -diff2;
49 if ( diff+ diff2 > 20 ) 51 if ( diff+ diff2 > 20 )
50 mAllowPopupMenu = false; 52 mAllowPopupMenu = false;
51 QMultiLineEdit::mouseMoveEvent(e); 53 Q3MultiLineEdit::mouseMoveEvent(e);
52} 54}
53 55
diff --git a/microkde/ktextedit.h b/microkde/ktextedit.h
index 87c0602..b7c8924 100644
--- a/microkde/ktextedit.h
+++ b/microkde/ktextedit.h
@@ -1,18 +1,20 @@
1#ifndef MICROKDE_KTEXTEDIT_H 1#ifndef MICROKDE_KTEXTEDIT_H
2#define MICROKDE_KTEXTEDIT_H 2#define MICROKDE_KTEXTEDIT_H
3 3
4#include <qmultilineedit.h> 4#include <q3multilineedit.h>
5//Added by qt3to4:
6#include <QMouseEvent>
5 7
6class KTextEdit : public QMultiLineEdit 8class KTextEdit : public Q3MultiLineEdit
7{ 9{
8 public: 10 public:
9 KTextEdit( QWidget *parent ) ; 11 KTextEdit( QWidget *parent ) ;
10 void setIgnoreMark( bool b ) { mIgnoreMark = b; } 12 void setIgnoreMark( bool b ) { mIgnoreMark = b; }
11 13
12 private: 14 private:
13 bool mAllowPopupMenu; 15 bool mAllowPopupMenu;
14 bool mMouseDown; 16 bool mMouseDown;
15 bool mIgnoreMark; 17 bool mIgnoreMark;
16 int mYMousePos; 18 int mYMousePos;
17 int mXMousePos; 19 int mXMousePos;
18 void mousePressEvent(QMouseEvent *e); 20 void mousePressEvent(QMouseEvent *e);
diff --git a/microkde/kurl.cpp b/microkde/kurl.cpp
index 2574e25..122ad71 100644
--- a/microkde/kurl.cpp
+++ b/microkde/kurl.cpp
@@ -25,48 +25,50 @@
25//US#include <kidna.h> 25//US#include <kidna.h>
26#endif 26#endif
27 27
28#include <stdio.h> 28#include <stdio.h>
29#include <assert.h> 29#include <assert.h>
30#include <ctype.h> 30#include <ctype.h>
31#include <stdlib.h> 31#include <stdlib.h>
32#ifdef _WIN32_ 32#ifdef _WIN32_
33 33
34#else 34#else
35#include <unistd.h> 35#include <unistd.h>
36#endif 36#endif
37#include <qurl.h> 37#include <q3url.h>
38#include <qdir.h> 38#include <qdir.h>
39#include <qstringlist.h> 39#include <qstringlist.h>
40#include <qregexp.h> 40#include <qregexp.h>
41//US#include <qstylesheet.h> 41//US#include <qstylesheet.h>
42#include <qmap.h> 42#include <qmap.h>
43#include <qtextcodec.h> 43#include <qtextcodec.h>
44//Added by qt3to4:
45#include <Q3CString>
44 46
45static const QString fileProt = "file"; 47static const QString fileProt = "file";
46 48
47static QTextCodec * codecForHint( int encoding_hint /* not 0 ! */ ) 49static QTextCodec * codecForHint( int encoding_hint /* not 0 ! */ )
48{ 50{
49 return QTextCodec::codecForMib( encoding_hint ); 51 return QTextCodec::codecForMib( encoding_hint );
50} 52}
51 53
52static QString encode( const QString& segment, bool encode_slash, int encoding_hint ) 54static QString encode( const QString& segment, bool encode_slash, int encoding_hint )
53{ 55{
54 const char *encode_string; 56 const char *encode_string;
55 if (encode_slash) 57 if (encode_slash)
56 encode_string = "<>#@\"&%?={}|^~[]\'`\\:+/"; 58 encode_string = "<>#@\"&%?={}|^~[]\'`\\:+/";
57 else 59 else
58 encode_string = "<>#@\"&%?={}|^~[]\'`\\:+"; 60 encode_string = "<>#@\"&%?={}|^~[]\'`\\:+";
59 61
60 QCString local; 62 Q3CString local;
61 if (encoding_hint==0) 63 if (encoding_hint==0)
62 local = segment.local8Bit(); 64 local = segment.local8Bit();
63 else 65 else
64 { 66 {
65 QTextCodec * textCodec = codecForHint( encoding_hint ); 67 QTextCodec * textCodec = codecForHint( encoding_hint );
66 if (!textCodec) 68 if (!textCodec)
67 local = segment.local8Bit(); 69 local = segment.local8Bit();
68 else 70 else
69 local = textCodec->fromUnicode( segment ); 71 local = textCodec->fromUnicode( segment );
70 } 72 }
71 73
72 int old_length = local.length(); 74 int old_length = local.length();
@@ -91,25 +93,25 @@ static QString encode( const QString& segment, bool encode_slash, int encoding_h
91 new_segment[ new_length++ ] = '%'; 93 new_segment[ new_length++ ] = '%';
92 94
93 unsigned int c = character / 16; 95 unsigned int c = character / 16;
94 c += (c > 9) ? ('A' - 10) : '0'; 96 c += (c > 9) ? ('A' - 10) : '0';
95 new_segment[ new_length++ ] = c; 97 new_segment[ new_length++ ] = c;
96 98
97 c = character % 16; 99 c = character % 16;
98 c += (c > 9) ? ('A' - 10) : '0'; 100 c += (c > 9) ? ('A' - 10) : '0';
99 new_segment[ new_length++ ] = c; 101 new_segment[ new_length++ ] = c;
100 102
101 } 103 }
102 else 104 else
103 new_segment[ new_length++ ] = local[i]; 105 new_segment[ new_length++ ] = character;
104 } 106 }
105 107
106 QString result = QString(new_segment, new_length); 108 QString result = QString(new_segment, new_length);
107 delete [] new_segment; 109 delete [] new_segment;
108 return result; 110 return result;
109} 111}
110 112
111static QString encodeHost( const QString& segment, bool encode_slash, int encoding_hint ) 113static QString encodeHost( const QString& segment, bool encode_slash, int encoding_hint )
112{ 114{
113 // Hostnames are encoded differently 115 // Hostnames are encoded differently
114 // we use the IDNA transformation instead 116 // we use the IDNA transformation instead
115 117
@@ -196,25 +198,25 @@ static void decode( const QString& segment, QString &decoded, QString &encoded,
196 198
197 int old_length = segment.length(); 199 int old_length = segment.length();
198 if ( !old_length ) 200 if ( !old_length )
199 return; 201 return;
200 202
201 QTextCodec *textCodec = 0; 203 QTextCodec *textCodec = 0;
202 if (encoding_hint) 204 if (encoding_hint)
203 textCodec = codecForHint( encoding_hint ); 205 textCodec = codecForHint( encoding_hint );
204 206
205 if (!textCodec) 207 if (!textCodec)
206 textCodec = QTextCodec::codecForLocale(); 208 textCodec = QTextCodec::codecForLocale();
207 209
208 QCString csegment = textCodec->fromUnicode(segment); 210 Q3CString csegment = textCodec->fromUnicode(segment);
209 // Check if everything went ok 211 // Check if everything went ok
210 if (textCodec->toUnicode(csegment) != segment) 212 if (textCodec->toUnicode(csegment) != segment)
211 { 213 {
212 // Uh oh 214 // Uh oh
213 textCodec = codecForHint( 106 ); // Fall back to utf-8 215 textCodec = codecForHint( 106 ); // Fall back to utf-8
214 csegment = textCodec->fromUnicode(segment); 216 csegment = textCodec->fromUnicode(segment);
215 } 217 }
216 old_length = csegment.length(); 218 old_length = csegment.length();
217 219
218 int new_length = 0; 220 int new_length = 0;
219 int new_length2 = 0; 221 int new_length2 = 0;
220 222
@@ -269,25 +271,25 @@ static void decode( const QString& segment, QString &decoded, QString &encoded,
269 } 271 }
270 new_segment [ new_length ] = 0; 272 new_segment [ new_length ] = 0;
271 273
272 encoded = QString( new_usegment, new_length2); 274 encoded = QString( new_usegment, new_length2);
273 275
274 // Encoding specified 276 // Encoding specified
275 if (updateDecoded) 277 if (updateDecoded)
276 { 278 {
277 QByteArray array; 279 QByteArray array;
278 array.setRawData(new_segment, new_length); 280 array.setRawData(new_segment, new_length);
279 decoded = textCodec->toUnicode( array, new_length ); 281 decoded = textCodec->toUnicode( array, new_length );
280 array.resetRawData(new_segment, new_length); 282 array.resetRawData(new_segment, new_length);
281 QCString validate = textCodec->fromUnicode(decoded); 283 Q3CString validate = textCodec->fromUnicode(decoded);
282 284
283 if (strcmp(validate.data(), new_segment) != 0) 285 if (strcmp(validate.data(), new_segment) != 0)
284 { 286 {
285 decoded = QString::fromLocal8Bit(new_segment, new_length); 287 decoded = QString::fromLocal8Bit(new_segment, new_length);
286 } 288 }
287 } 289 }
288 290
289 delete [] new_segment; 291 delete [] new_segment;
290 delete [] new_usegment; 292 delete [] new_usegment;
291} 293}
292 294
293static QString decode(const QString &segment, int encoding_hint = 0) 295static QString decode(const QString &segment, int encoding_hint = 0)
@@ -410,25 +412,25 @@ KURL::~KURL()
410KURL::KURL( const QString &url, int encoding_hint ) 412KURL::KURL( const QString &url, int encoding_hint )
411{ 413{
412 reset(); 414 reset();
413 parse( url, encoding_hint ); 415 parse( url, encoding_hint );
414} 416}
415 417
416KURL::KURL( const char * url, int encoding_hint ) 418KURL::KURL( const char * url, int encoding_hint )
417{ 419{
418 reset(); 420 reset();
419 parse( QString::fromLatin1(url), encoding_hint ); 421 parse( QString::fromLatin1(url), encoding_hint );
420} 422}
421 423
422KURL::KURL( const QCString& url, int encoding_hint ) 424KURL::KURL( const Q3CString& url, int encoding_hint )
423{ 425{
424 reset(); 426 reset();
425 parse( QString::fromLatin1(url), encoding_hint ); 427 parse( QString::fromLatin1(url), encoding_hint );
426} 428}
427 429
428KURL::KURL( const KURL& _u ) 430KURL::KURL( const KURL& _u )
429{ 431{
430 *this = _u; 432 *this = _u;
431} 433}
432 434
433QDataStream & operator<< (QDataStream & s, const KURL & a) 435QDataStream & operator<< (QDataStream & s, const KURL & a)
434{ 436{
@@ -451,25 +453,25 @@ QDataStream & operator>> (QDataStream & s, KURL & a)
451 >> malf >> a.m_iPort; 453 >> malf >> a.m_iPort;
452 a.m_bIsMalformed = (malf != 0); 454 a.m_bIsMalformed = (malf != 0);
453 455
454 if ( QueryFromWire.isEmpty() ) 456 if ( QueryFromWire.isEmpty() )
455 a.m_strQuery_encoded = QString::null; 457 a.m_strQuery_encoded = QString::null;
456 else 458 else
457 a.m_strQuery_encoded = QueryFromWire.mid(1); 459 a.m_strQuery_encoded = QueryFromWire.mid(1);
458 460
459 return s; 461 return s;
460} 462}
461 463
462#ifndef QT_NO_NETWORKPROTOCOL 464#ifndef QT_NO_NETWORKPROTOCOL
463KURL::KURL( const QUrl &u ) 465KURL::KURL( const Q3Url &u )
464{ 466{
465 *this = u; 467 *this = u;
466} 468}
467#endif 469#endif
468 470
469KURL::KURL( const KURL& _u, const QString& _rel_url, int encoding_hint ) 471KURL::KURL( const KURL& _u, const QString& _rel_url, int encoding_hint )
470{ 472{
471 // WORKAROUND THE RFC 1606 LOOPHOLE THAT ALLOWS 473 // WORKAROUND THE RFC 1606 LOOPHOLE THAT ALLOWS
472 // http:/index.html AS A VALID SYNTAX FOR RELATIVE 474 // http:/index.html AS A VALID SYNTAX FOR RELATIVE
473 // URLS. ( RFC 2396 section 5.2 item # 3 ) 475 // URLS. ( RFC 2396 section 5.2 item # 3 )
474 QString rUrl = _rel_url; 476 QString rUrl = _rel_url;
475 int len = _u.m_strProtocol.length(); 477 int len = _u.m_strProtocol.length();
@@ -580,31 +582,31 @@ void KURL::parse( const QString& _url, int encoding_hint )
580 const QChar* buf = _url.unicode(); 582 const QChar* buf = _url.unicode();
581 const QChar* orig = buf; 583 const QChar* orig = buf;
582 584
583 QChar delim; 585 QChar delim;
584 QString tmp; 586 QString tmp;
585 587
586 uint pos = 0; 588 uint pos = 0;
587 589
588 // Node 1: Accept alpha or slash 590 // Node 1: Accept alpha or slash
589 QChar x = buf[pos++]; 591 QChar x = buf[pos++];
590 if ( x == '/' ) 592 if ( x == '/' )
591 goto Node9; 593 goto Node9;
592 if ( !isalpha( (int)x ) ) 594 if ( !x.isLetter() )
593 goto NodeErr; 595 goto NodeErr;
594 596
595 // Node 2: Accept any amount of (alpha|digit|'+'|'-') 597 // Node 2: Accept any amount of (alpha|digit|'+'|'-')
596 // '.' is not currently accepted, because current KURL may be confused. 598 // '.' is not currently accepted, because current KURL may be confused.
597 // Proceed with :// :/ or : 599 // Proceed with :// :/ or :
598 while( pos < len && (isalpha((int)buf[pos]) || isdigit((int)buf[pos]) || 600 while( pos < len && ( buf[pos].isLetter() || buf[pos].isDigit() ||
599 buf[pos] == '+' || buf[pos] == '-')) pos++; 601 buf[pos] == '+' || buf[pos] == '-')) pos++;
600 602
601 if ( pos+2 < len && buf[pos] == ':' && buf[pos+1] == '/' && buf[pos+2] == '/' ) 603 if ( pos+2 < len && buf[pos] == ':' && buf[pos+1] == '/' && buf[pos+2] == '/' )
602 { 604 {
603 m_strProtocol = QString( orig, pos ).lower(); 605 m_strProtocol = QString( orig, pos ).lower();
604 pos += 3; 606 pos += 3;
605 } 607 }
606 else if (pos+1 < len && buf[pos] == ':' ) // Need to always compare length()-1 otherwise KURL passes "http:" as legal!! 608 else if (pos+1 < len && buf[pos] == ':' ) // Need to always compare length()-1 otherwise KURL passes "http:" as legal!!
607 { 609 {
608 m_strProtocol = QString( orig, pos ).lower(); 610 m_strProtocol = QString( orig, pos ).lower();
609 //kdDebug(126)<<"setting protocol to "<<m_strProtocol<<endl; 611 //kdDebug(126)<<"setting protocol to "<<m_strProtocol<<endl;
610 pos++; 612 pos++;
@@ -760,29 +762,29 @@ void KURL::parse( const QString& _url, int encoding_hint )
760 { 762 {
761 start = pos++; 763 start = pos++;
762 goto Node9; 764 goto Node9;
763 } 765 }
764 else if ( x != ':' ) 766 else if ( x != ':' )
765 goto NodeErr; 767 goto NodeErr;
766 pos++; 768 pos++;
767 769
768 // Node 8a: Accept at least one digit 770 // Node 8a: Accept at least one digit
769 if ( pos == len ) 771 if ( pos == len )
770 goto NodeErr; 772 goto NodeErr;
771 start = pos; 773 start = pos;
772 if ( !isdigit( buf[pos++] ) ) 774 if ( !buf[pos++].isDigit() )
773 goto NodeErr; 775 goto NodeErr;
774 776
775 // Node 8b: Accept any amount of digits 777 // Node 8b: Accept any amount of digits
776 while( pos < len && isdigit( buf[pos] ) ) pos++; 778 while( pos < len && buf[pos].isDigit() ) pos++;
777 port = QString( buf + start, pos - start ); 779 port = QString( buf + start, pos - start );
778 m_iPort = port.toUShort(); 780 m_iPort = port.toUShort();
779 if ( pos == len ) 781 if ( pos == len )
780 goto NodeOk; 782 goto NodeOk;
781 start = pos++; 783 start = pos++;
782 784
783 Node9: // parse path until query or reference reached 785 Node9: // parse path until query or reference reached
784 786
785 while( pos < len && buf[pos] != '#' && buf[pos]!='?' ) pos++; 787 while( pos < len && buf[pos] != '#' && buf[pos]!='?' ) pos++;
786 788
787 tmp = QString( buf + start, pos - start ); 789 tmp = QString( buf + start, pos - start );
788 //kdDebug(126)<<" setting encoded path&query to:"<<tmp<<endl; 790 //kdDebug(126)<<" setting encoded path&query to:"<<tmp<<endl;
@@ -839,25 +841,25 @@ KURL& KURL::operator=( const QString& _url )
839 return *this; 841 return *this;
840} 842}
841 843
842KURL& KURL::operator=( const char * _url ) 844KURL& KURL::operator=( const char * _url )
843{ 845{
844 reset(); 846 reset();
845 parse( QString::fromLatin1(_url) ); 847 parse( QString::fromLatin1(_url) );
846 848
847 return *this; 849 return *this;
848} 850}
849 851
850#ifndef QT_NO_NETWORKPROTOCOL 852#ifndef QT_NO_NETWORKPROTOCOL
851KURL& KURL::operator=( const QUrl & u ) 853KURL& KURL::operator=( const Q3Url & u )
852{ 854{
853 m_strProtocol = u.protocol(); 855 m_strProtocol = u.protocol();
854 m_strUser = u.user(); 856 m_strUser = u.user();
855 m_strPass = u.password(); 857 m_strPass = u.password();
856 m_strHost = u.host(); 858 m_strHost = u.host();
857 m_strPath = u.path( FALSE ); 859 m_strPath = u.path( FALSE );
858 m_strPath_encoded = QString::null; 860 m_strPath_encoded = QString::null;
859 m_strQuery_encoded = u.query(); 861 m_strQuery_encoded = u.query();
860 m_strRef_encoded = u.ref(); 862 m_strRef_encoded = u.ref();
861 m_bIsMalformed = !u.isValid(); 863 m_bIsMalformed = !u.isValid();
862 m_iPort = u.port(); 864 m_iPort = u.port();
863 865
@@ -1365,25 +1367,25 @@ KURL::List KURL::split( const QString& _url )
1365 1367
1366KURL KURL::join( const KURL::List & lst ) 1368KURL KURL::join( const KURL::List & lst )
1367{ 1369{
1368 if (lst.isEmpty()) return KURL(); 1370 if (lst.isEmpty()) return KURL();
1369 KURL tmp; 1371 KURL tmp;
1370 1372
1371 KURL::List::ConstIterator first = lst.fromLast(); 1373 KURL::List::ConstIterator first = lst.fromLast();
1372 for( KURL::List::ConstIterator it = first; it != lst.end(); --it ) 1374 for( KURL::List::ConstIterator it = first; it != lst.end(); --it )
1373 { 1375 {
1374 KURL u(*it); 1376 KURL u(*it);
1375 if (it != first) 1377 if (it != first)
1376 { 1378 {
1377 if (!u.m_strRef_encoded) u.m_strRef_encoded = tmp.url(); 1379 if (u.m_strRef_encoded.isEmpty()) u.m_strRef_encoded = tmp.url();
1378 else u.m_strRef_encoded += "#" + tmp.url(); // Support more than one suburl thingy 1380 else u.m_strRef_encoded += "#" + tmp.url(); // Support more than one suburl thingy
1379 } 1381 }
1380 tmp = u; 1382 tmp = u;
1381 } 1383 }
1382 1384
1383 return tmp; 1385 return tmp;
1384} 1386}
1385 1387
1386QString KURL::fileName( bool _strip_trailing_slash ) const 1388QString KURL::fileName( bool _strip_trailing_slash ) const
1387{ 1389{
1388 QString fname; 1390 QString fname;
1389 if (hasSubURL()) { // If we have a suburl, then return the filename from there 1391 if (hasSubURL()) { // If we have a suburl, then return the filename from there
@@ -1409,25 +1411,25 @@ QString KURL::fileName( bool _strip_trailing_slash ) const
1409 if ( len == 1 && path[ 0 ] == '/' ) 1411 if ( len == 1 && path[ 0 ] == '/' )
1410 return fname; 1412 return fname;
1411 1413
1412 // Skip last n slashes 1414 // Skip last n slashes
1413 int n = 1; 1415 int n = 1;
1414 if (!m_strPath_encoded.isEmpty()) 1416 if (!m_strPath_encoded.isEmpty())
1415 { 1417 {
1416 // This is hairy, we need the last unencoded slash. 1418 // This is hairy, we need the last unencoded slash.
1417 // Count in the encoded string how many encoded slashes follow the last 1419 // Count in the encoded string how many encoded slashes follow the last
1418 // unencoded one. 1420 // unencoded one.
1419 int i = m_strPath_encoded.findRev( '/', len - 1 ); 1421 int i = m_strPath_encoded.findRev( '/', len - 1 );
1420 QString fileName_encoded = m_strPath_encoded.mid(i+1); 1422 QString fileName_encoded = m_strPath_encoded.mid(i+1);
1421 n += fileName_encoded.contains("%2f", false); 1423 n += fileName_encoded.count("%2f", Qt::CaseInsensitive);
1422 } 1424 }
1423 int i = len; 1425 int i = len;
1424 do { 1426 do {
1425 i = path.findRev( '/', i - 1 ); 1427 i = path.findRev( '/', i - 1 );
1426 } 1428 }
1427 while (--n && (i > 0)); 1429 while (--n && (i > 0));
1428 1430
1429 // If ( i == -1 ) => the first character is not a '/' 1431 // If ( i == -1 ) => the first character is not a '/'
1430 // So it's some URL like file:blah.tgz, return the whole path 1432 // So it's some URL like file:blah.tgz, return the whole path
1431 if ( i == -1 ) { 1433 if ( i == -1 ) {
1432 if ( len == (int)path.length() ) 1434 if ( len == (int)path.length() )
1433 fname = path; 1435 fname = path;
diff --git a/microkde/kurl.h b/microkde/kurl.h
index cd65a1c..016eb24 100644
--- a/microkde/kurl.h
+++ b/microkde/kurl.h
@@ -12,27 +12,29 @@
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA. 17 * Boston, MA 02111-1307, USA.
18 **/ 18 **/
19 19
20#ifndef __kurl_h__ 20#ifndef __kurl_h__
21#define __kurl_h__ "$Id$" 21#define __kurl_h__ "$Id$"
22 22
23#include <qstring.h> 23#include <qstring.h>
24#include <qvaluelist.h> 24#include <q3valuelist.h>
25//Added by qt3to4:
26#include <Q3CString>
25 27
26class QUrl; 28class Q3Url;
27class QStringList; 29class QStringList;
28template <typename K, typename V> class QMap; 30template <typename K, typename V> class QMap;
29 31
30class KURLPrivate; 32class KURLPrivate;
31/** 33/**
32 * Represents and parses a URL. 34 * Represents and parses a URL.
33 * 35 *
34 * A prototypical URL looks like: 36 * A prototypical URL looks like:
35 * <pre> 37 * <pre>
36 * protocol:/user:password\@hostname:port/path/to/file.ext#reference 38 * protocol:/user:password\@hostname:port/path/to/file.ext#reference
37 * </pre> 39 * </pre>
38 * 40 *
@@ -55,25 +57,25 @@ public:
55 enum AdjustementFlags 57 enum AdjustementFlags
56 { 58 {
57 NoAdjustements = 0, 59 NoAdjustements = 0,
58 StripFileProtocol = 1 60 StripFileProtocol = 1
59 }; 61 };
60 62
61 /** 63 /**
62 * KURL::List is a QValueList that contains KURLs with a few 64 * KURL::List is a QValueList that contains KURLs with a few
63 * convenience methods. 65 * convenience methods.
64 * @see KURL 66 * @see KURL
65 * @see QValueList 67 * @see QValueList
66 */ 68 */
67 class List : public QValueList<KURL> 69 class List : public Q3ValueList<KURL>
68 { 70 {
69 public: 71 public:
70 /** 72 /**
71 * Creates an empty List. 73 * Creates an empty List.
72 */ 74 */
73 List() { } 75 List() { }
74 /** 76 /**
75 * Creates a list that contains the given URL as only 77 * Creates a list that contains the given URL as only
76 * item. 78 * item.
77 * @param url the url to add. 79 * @param url the url to add.
78 */ 80 */
79 List(const KURL &url); 81 List(const KURL &url);
@@ -126,35 +128,35 @@ public:
126 * @see QTextCodec::mibEnum() 128 * @see QTextCodec::mibEnum()
127 */ 129 */
128 KURL( const char * url, int encoding_hint = 0 ); 130 KURL( const char * url, int encoding_hint = 0 );
129 /** 131 /**
130 * Constructor taking a QCString @p url, which is an _encoded_ representation 132 * Constructor taking a QCString @p url, which is an _encoded_ representation
131 * of the URL, exactly like the usual constructor. This is useful when 133 * of the URL, exactly like the usual constructor. This is useful when
132 * then URL, in its encoded form, is strictly ascii. 134 * then URL, in its encoded form, is strictly ascii.
133 * @param url A encoded URL. If the URL does not have a protocol part, 135 * @param url A encoded URL. If the URL does not have a protocol part,
134 * "file:" is assumed. 136 * "file:" is assumed.
135 * @param encoding_hint MIB of original encoding of URL. 137 * @param encoding_hint MIB of original encoding of URL.
136 * @see QTextCodec::mibEnum() 138 * @see QTextCodec::mibEnum()
137 */ 139 */
138 KURL( const QCString& url, int encoding_hint = 0 ); 140 KURL( const Q3CString& url, int encoding_hint = 0 );
139 /** 141 /**
140 * Copy constructor. 142 * Copy constructor.
141 * @param u the KURL to copy 143 * @param u the KURL to copy
142 */ 144 */
143 KURL( const KURL& u ); 145 KURL( const KURL& u );
144 /** 146 /**
145 * Converts from a @ref QUrl. 147 * Converts from a @ref QUrl.
146 * @param u the QUrl 148 * @param u the QUrl
147 */ 149 */
148 KURL( const QUrl &u ); 150 KURL( const Q3Url &u );
149 /** 151 /**
150 * Constructor allowing relative URLs. 152 * Constructor allowing relative URLs.
151 * 153 *
152 * @param _baseurl The base url. 154 * @param _baseurl The base url.
153 * @param _rel_url A relative or absolute URL. 155 * @param _rel_url A relative or absolute URL.
154 * If this is an absolute URL then @p _baseurl will be ignored. 156 * If this is an absolute URL then @p _baseurl will be ignored.
155 * If this is a relative URL it will be combined with @p _baseurl. 157 * If this is a relative URL it will be combined with @p _baseurl.
156 * Note that _rel_url should be encoded too, in any case. 158 * Note that _rel_url should be encoded too, in any case.
157 * So do NOT pass a path here (use setPath or addPath instead). 159 * So do NOT pass a path here (use setPath or addPath instead).
158 * @param encoding_hint MIB of original encoding of URL. 160 * @param encoding_hint MIB of original encoding of URL.
159 * @see QTextCodec::mibEnum() 161 * @see QTextCodec::mibEnum()
160 */ 162 */
@@ -649,25 +651,25 @@ public:
649 * This function is useful to implement the "Up" button in a file manager for example. 651 * This function is useful to implement the "Up" button in a file manager for example.
650 * @ref cd() never strips a sub-protocol. That means that if you are in 652 * @ref cd() never strips a sub-protocol. That means that if you are in
651 * file:/home/x.tgz#gzip:/#tar:/ and hit the up button you expect to see 653 * file:/home/x.tgz#gzip:/#tar:/ and hit the up button you expect to see
652 * file:/home. The algorithm tries to go up on the right-most URL. If that is not 654 * file:/home. The algorithm tries to go up on the right-most URL. If that is not
653 * possible it strips the right most URL. It continues stripping URLs. 655 * possible it strips the right most URL. It continues stripping URLs.
654 * @return a URL that is a level higher 656 * @return a URL that is a level higher
655 */ 657 */
656 KURL upURL( ) const; 658 KURL upURL( ) const;
657 659
658 KURL& operator=( const KURL& _u ); 660 KURL& operator=( const KURL& _u );
659 KURL& operator=( const QString& _url ); 661 KURL& operator=( const QString& _url );
660 KURL& operator=( const char * _url ); 662 KURL& operator=( const char * _url );
661 KURL& operator=( const QUrl & u ); 663 KURL& operator=( const Q3Url & u );
662 664
663 bool operator==( const KURL& _u ) const; 665 bool operator==( const KURL& _u ) const;
664 bool operator==( const QString& _u ) const; 666 bool operator==( const QString& _u ) const;
665 bool operator!=( const KURL& _u ) const { return !( *this == _u ); } 667 bool operator!=( const KURL& _u ) const { return !( *this == _u ); }
666 bool operator!=( const QString& _u ) const { return !( *this == _u ); } 668 bool operator!=( const QString& _u ) const { return !( *this == _u ); }
667 669
668 /** 670 /**
669 * The same as equals(), just with a less obvious name. 671 * The same as equals(), just with a less obvious name.
670 * Compares this url with @p u. 672 * Compares this url with @p u.
671 * @param ignore_trailing set to true to ignore trailing '/' characters. 673 * @param ignore_trailing set to true to ignore trailing '/' characters.
672 * @return true if both urls are the same 674 * @return true if both urls are the same
673 * @see operator==. This function should be used if you want to 675 * @see operator==. This function should be used if you want to
diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp
index 9c87682..88f17e5 100644
--- a/microkde/kutils/kcmultidialog.cpp
+++ b/microkde/kutils/kcmultidialog.cpp
@@ -10,28 +10,30 @@
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 19
20*/ 20*/
21 21
22#include <qhbox.h> 22#include <q3hbox.h>
23#include <qvbox.h> 23#include <q3vbox.h>
24#include <qcursor.h> 24#include <qcursor.h>
25#include <qlayout.h> 25#include <qlayout.h>
26//Added by qt3to4:
27#include <QPixmap>
26 28
27#include <klocale.h> 29#include <klocale.h>
28#include <kglobal.h> 30#include <kglobal.h>
29#include <kdebug.h> 31#include <kdebug.h>
30#include <kiconloader.h> 32#include <kiconloader.h>
31#include <kmessagebox.h> 33#include <kmessagebox.h>
32//US #include <klibloader.h> 34//US #include <klibloader.h>
33#include <krun.h> 35#include <krun.h>
34#include <kprocess.h> 36#include <kprocess.h>
35#include <kglobalsettings.h> 37#include <kglobalsettings.h>
36 38
37#include "kcmultidialog.h" 39#include "kcmultidialog.h"
@@ -64,57 +66,57 @@ KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const ch
64} 66}
65 67
66KCMultiDialog::~KCMultiDialog() 68KCMultiDialog::~KCMultiDialog()
67{ 69{
68//US moduleDict.setAutoDelete(true); 70//US moduleDict.setAutoDelete(true);
69} 71}
70 72
71void KCMultiDialog::slotDefault() 73void KCMultiDialog::slotDefault()
72{ 74{
73 75
74 int curPageIndex = activePageIndex(); 76 int curPageIndex = activePageIndex();
75 77
76 QPtrListIterator<KCModule> it(modules); 78 Q3PtrListIterator<KCModule> it(modules);
77 for (; it.current(); ++it) 79 for (; it.current(); ++it)
78 { 80 {
79 if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) 81 if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex)
80 { 82 {
81 (*it)->defaults(); 83 (*it)->defaults();
82 clientChanged(true); 84 clientChanged(true);
83 return; 85 return;
84 } 86 }
85 } 87 }
86 88
87} 89}
88void KCMultiDialog::accept() 90void KCMultiDialog::accept()
89{ 91{
90 slotOk(); 92 slotOk();
91} 93}
92void KCMultiDialog::slotApply() 94void KCMultiDialog::slotApply()
93{ 95{
94 QPtrListIterator<KCModule> it(modules); 96 Q3PtrListIterator<KCModule> it(modules);
95 for (; it.current(); ++it) 97 for (; it.current(); ++it)
96 (*it)->save(); 98 (*it)->save();
97 clientChanged(false); 99 clientChanged(false);
98 100
99 emit applyClicked(); 101 emit applyClicked();
100 102
101} 103}
102 104
103 105
104void KCMultiDialog::slotOk() 106void KCMultiDialog::slotOk()
105{ 107{
106qDebug("KCMultiDialog::slotOk clicked"); 108qDebug("KCMultiDialog::slotOk clicked");
107 109
108 QPtrListIterator<KCModule> it(modules); 110 Q3PtrListIterator<KCModule> it(modules);
109 for (; it.current(); ++it) 111 for (; it.current(); ++it)
110 (*it)->save(); 112 (*it)->save();
111 QDialog::accept(); 113 QDialog::accept();
112 114
113 emit okClicked(); 115 emit okClicked();
114} 116}
115 117
116void KCMultiDialog::slotHelp() 118void KCMultiDialog::slotHelp()
117{ 119{
118/*US 120/*US
119 KURL url( KURL("help:/"), _docPath ); 121 KURL url( KURL("help:/"), _docPath );
120 122
@@ -144,27 +146,27 @@ void KCMultiDialog::addModule(const QString& path, bool withfallback)
144 146
145 QHBox* page = addHBoxPage(info.moduleName(), info.comment(), 147 QHBox* page = addHBoxPage(info.moduleName(), info.comment(),
146 KGlobal::iconLoader()->loadIcon(info.icon(), KIcon::Desktop, KIcon::SizeMedium)); 148 KGlobal::iconLoader()->loadIcon(info.icon(), KIcon::Desktop, KIcon::SizeMedium));
147 if(!page) { 149 if(!page) {
148 KCModuleLoader::unloadModule(info); 150 KCModuleLoader::unloadModule(info);
149 return; 151 return;
150 } 152 }
151 moduleDict.insert(page, new LoadInfo(path, withfallback)); 153 moduleDict.insert(page, new LoadInfo(path, withfallback));
152 if (modules.isEmpty()) 154 if (modules.isEmpty())
153 slotAboutToShow(page); 155 slotAboutToShow(page);
154} 156}
155*/ 157*/
156QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) 158Q3VBox * KCMultiDialog::getNewVBoxPage( const QString & modulename )
157{ 159{
158 QVBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() ); 160 Q3VBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() );
159 return page; 161 return page;
160 162
161} 163}
162//US special method for microkde. We dop noty want to load everything dynamically. 164//US special method for microkde. We dop noty want to load everything dynamically.
163void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, const QString& iconname) 165void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, const QString& iconname)
164{ 166{
165 167
166 modules.append(module); 168 modules.append(module);
167 connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool))); 169 connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool)));
168//US 170//US
169 module->load(); 171 module->load();
170 172
diff --git a/microkde/kutils/kcmultidialog.h b/microkde/kutils/kcmultidialog.h
index 66412ac..78f8a00 100644
--- a/microkde/kutils/kcmultidialog.h
+++ b/microkde/kutils/kcmultidialog.h
@@ -13,26 +13,26 @@
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 19
20*/ 20*/
21 21
22#ifndef KCMULTIDIALOG_H 22#ifndef KCMULTIDIALOG_H
23#define KCMULTIDIALOG_H 23#define KCMULTIDIALOG_H
24 24
25#include <qptrlist.h> 25#include <q3ptrlist.h>
26#include <qptrdict.h> 26#include <q3ptrdict.h>
27 27
28#include <kdialogbase.h> 28#include <kdialogbase.h>
29#include <kjanuswidget.h> 29#include <kjanuswidget.h>
30#include <kcmodule.h> 30#include <kcmodule.h>
31 31
32/** 32/**
33 * A class that offers a @ref KDialogBase containing arbitrary KControl Modules 33 * A class that offers a @ref KDialogBase containing arbitrary KControl Modules
34 * 34 *
35 * @short A method that offers a @ref KDialogBase containing arbitrary 35 * @short A method that offers a @ref KDialogBase containing arbitrary
36 * KControl Modules. 36 * KControl Modules.
37 * 37 *
38 * @author Matthias Elter <elter@kde.org>, Daniel Molkentin <molkentin@kde.org> 38 * @author Matthias Elter <elter@kde.org>, Daniel Molkentin <molkentin@kde.org>
@@ -66,25 +66,25 @@ public:
66 * 66 *
67 * @param module Specify the name of the module that is to be added 67 * @param module Specify the name of the module that is to be added
68 * to the list of modules the dialog will show. 68 * to the list of modules the dialog will show.
69 * 69 *
70 * @param withfallback Try harder to load the module. Might result 70 * @param withfallback Try harder to load the module. Might result
71 * in the module appearing outside the dialog. 71 * in the module appearing outside the dialog.
72 **/ 72 **/
73//US void addModule(const QString& module, bool withfallback=true); 73//US void addModule(const QString& module, bool withfallback=true);
74 74
75 75
76//US special method for microkde. We do not want to load everything dynamically. 76//US special method for microkde. We do not want to load everything dynamically.
77 void addModule(KCModule* module );//, const QString& modulename, const QString& iconname); 77 void addModule(KCModule* module );//, const QString& modulename, const QString& iconname);
78 QVBox* getNewVBoxPage(const QString & modulename) ; 78 Q3VBox* getNewVBoxPage(const QString & modulename) ;
79 79
80 80
81 bool showPage( int index ); 81 bool showPage( int index );
82 int activePageIndex() const; 82 int activePageIndex() const;
83 int pageIndex( QWidget *widget ) const; 83 int pageIndex( QWidget *widget ) const;
84 84
85protected slots: 85protected slots:
86 /** 86 /**
87 * This slot is called when the user presses the "Default" Button 87 * This slot is called when the user presses the "Default" Button
88 * You can reimplement it if needed. 88 * You can reimplement it if needed.
89 * 89 *
90 * @note Make sure you call the original implementation! 90 * @note Make sure you call the original implementation!
@@ -124,25 +124,25 @@ private slots:
124 void clientChanged(bool state); 124 void clientChanged(bool state);
125 125
126private: 126private:
127/*US 127/*US
128 struct LoadInfo { 128 struct LoadInfo {
129 LoadInfo(const QString &_path, bool _withfallback) 129 LoadInfo(const QString &_path, bool _withfallback)
130 : path(_path), withfallback(_withfallback) 130 : path(_path), withfallback(_withfallback)
131 { } 131 { }
132 QString path; 132 QString path;
133 bool withfallback; 133 bool withfallback;
134 }; 134 };
135*/ 135*/
136 QPtrList<KCModule> modules; 136 Q3PtrList<KCModule> modules;
137/* 137/*
138 QPtrDict<LoadInfo> moduleDict; 138 QPtrDict<LoadInfo> moduleDict;
139 QString _docPath; 139 QString _docPath;
140*/ 140*/
141 QString _baseGroup; 141 QString _baseGroup;
142 142
143//US 143//US
144 KJanusWidget* mMainWidget; 144 KJanusWidget* mMainWidget;
145 145
146 // For future use 146 // For future use
147 class KCMultiDialogPrivate; 147 class KCMultiDialogPrivate;
148 KCMultiDialogPrivate *d; 148 KCMultiDialogPrivate *d;
diff --git a/microkde/microkde.pro b/microkde/microkde.pro
index 7120bdd..4ff06a3 100644
--- a/microkde/microkde.pro
+++ b/microkde/microkde.pro
@@ -1,21 +1,21 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3include( ../variables.pri ) 3include( ../variables.pri )
4#INCLUDEPATH += $(QTDIR)/include . 4#INCLUDEPATH += $(QTDIR)/include .
5#DEPENDPATH += $(QTDIR)/include 5#DEPENDPATH += $(QTDIR)/include
6INCLUDEPATH += . ../ ../kabc ./kdecore ./kdeui ./kio/kfile ./kio/kio 6INCLUDEPATH += . ../ ../kabc ./kdecore ./kdeui ./kio/kfile ./kio/kio
7#LIBS += -lqtcompat 7#LIBS += -lqtcompat
8 8
9 TARGET = microkde 9 TARGET = xmicrokde
10DESTDIR= ../bin 10DESTDIR= ../bin
11DEFINES += DESKTOP_VERSION KDE_QT_ONLY 11DEFINES += DESKTOP_VERSION KDE_QT_ONLY
12unix : { 12unix : {
13staticlib: { 13staticlib: {
14INCLUDEPATH += ../kabc/plugins 14INCLUDEPATH += ../kabc/plugins
15DEFINES += STATIC_RESOURCES 15DEFINES += STATIC_RESOURCES
16} 16}
17 17
18 18
19OBJECTS_DIR = obj/unix 19OBJECTS_DIR = obj/unix
20MOC_DIR = moc/unix 20MOC_DIR = moc/unix
21} 21}
@@ -169,12 +169,14 @@ KDGanttMinimizeSplitter.cpp \
169 kdeui/kpopupmenu.cpp \ 169 kdeui/kpopupmenu.cpp \
170 kdeui/kactionclasses.cpp \ 170 kdeui/kactionclasses.cpp \
171 kdeui/kactioncollection.cpp \ 171 kdeui/kactioncollection.cpp \
172 kdeui/kmainwindow.cpp \ 172 kdeui/kmainwindow.cpp \
173 kdeui/ktoolbar.cpp \ 173 kdeui/ktoolbar.cpp \
174 kdeui/ktoolbarbutton.cpp \ 174 kdeui/ktoolbarbutton.cpp \
175 kdeui/ktoolbarhandler.cpp \ 175 kdeui/ktoolbarhandler.cpp \
176 kdeui/kstdaction.cpp \ 176 kdeui/kstdaction.cpp \
177 kdeui/kxmlguiclient.cpp \ 177 kdeui/kxmlguiclient.cpp \
178 kdecore/kprefs.cpp \ 178 kdecore/kprefs.cpp \
179 kdecore/klibloader.cpp \ 179 kdecore/klibloader.cpp \
180 kidmanager.cpp 180 kidmanager.cpp
181#The following line was inserted by qt3to4
182QT += xml qt3support
diff --git a/microkde/microkdeE.pro b/microkde/microkdeE.pro
index 8fe2bd5..514e7b3 100644
--- a/microkde/microkdeE.pro
+++ b/microkde/microkdeE.pro
@@ -1,22 +1,22 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3INCLUDEPATH += . .. $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/kabc kdecore kdeui kio/kfile kio/kio $(QPEDIR)/include 3INCLUDEPATH += . .. $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/kabc kdecore kdeui kio/kfile kio/kio $(QPEDIR)/include
4 4
5DEPENDPATH += $(QPEDIR)/include 5DEPENDPATH += $(QPEDIR)/include
6LIBS += -lmicroqtcompat -L$(QPEDIR)/lib 6LIBS += -lmicroqtcompat -L$(QPEDIR)/lib
7 7
8DEFINES += KDE_QT_ONLY 8DEFINES += KDE_QT_ONLY
9 9
10 TARGET = microkde 10 TARGET = xmicrokde
11OBJECTS_DIR = obj/$(PLATFORM) 11OBJECTS_DIR = obj/$(PLATFORM)
12MOC_DIR = moc/$(PLATFORM) 12MOC_DIR = moc/$(PLATFORM)
13DESTDIR=$(QPEDIR)/lib 13DESTDIR=$(QPEDIR)/lib
14 14
15 15
16INTERFACES = \ 16INTERFACES = \
17 17
18HEADERS = \ 18HEADERS = \
19qlayoutengine_p.h fncolordialog.h\ 19qlayoutengine_p.h fncolordialog.h\
20KDGanttMinimizeSplitter.h \ 20KDGanttMinimizeSplitter.h \
21 kapplication.h \ 21 kapplication.h \
22 kaudioplayer.h \ 22 kaudioplayer.h \
diff --git a/microkde/ofileselector_p.cpp b/microkde/ofileselector_p.cpp
index f4f112e..0f95c84 100644
--- a/microkde/ofileselector_p.cpp
+++ b/microkde/ofileselector_p.cpp
@@ -256,25 +256,25 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st
256 this, SLOT(slotNew() ) ); 256 this, SLOT(slotNew() ) );
257 257
258 258
259 m_btnClose = new QToolButton( box ); 259 m_btnClose = new QToolButton( box );
260 m_btnClose->setIconSet( Resource::loadPixmap("close") ); 260 m_btnClose->setIconSet( Resource::loadPixmap("close") );
261 connect(m_btnClose, SIGNAL(clicked() ), 261 connect(m_btnClose, SIGNAL(clicked() ),
262 selector(), SIGNAL(closeMe() ) ); 262 selector(), SIGNAL(closeMe() ) );
263 263
264 btn = new QToolButton( box ); 264 btn = new QToolButton( box );
265 btn->setIconSet( Resource::loadPixmap("cardmon/pcmcia") ); 265 btn->setIconSet( Resource::loadPixmap("cardmon/pcmcia") );
266 266
267 /* let's fill device parts */ 267 /* let's fill device parts */
268 QPopupMenu* pop = new QPopupMenu(this); 268 Q3PopupMenu* pop = new Q3PopupMenu(this);
269 connect(pop, SIGNAL( activated(int) ), 269 connect(pop, SIGNAL( activated(int) ),
270 this, SLOT(slotFSActivated(int) ) ); 270 this, SLOT(slotFSActivated(int) ) );
271 271
272 StorageInfo storage; 272 StorageInfo storage;
273 const QList<FileSystem> &fs = storage.fileSystems(); 273 const QList<FileSystem> &fs = storage.fileSystems();
274 QListIterator<FileSystem> it(fs); 274 QListIterator<FileSystem> it(fs);
275 for ( ; it.current(); ++it ) { 275 for ( ; it.current(); ++it ) {
276 const QString disk = (*it)->name(); 276 const QString disk = (*it)->name();
277 const QString path = (*it)->path(); 277 const QString path = (*it)->path();
278 m_dev.insert( disk, path ); 278 m_dev.insert( disk, path );
279 pop->insertItem( disk ); 279 pop->insertItem( disk );
280 } 280 }
diff --git a/microkde/ofileselector_p.h b/microkde/ofileselector_p.h
index 834fd70..a7d97fe 100644
--- a/microkde/ofileselector_p.h
+++ b/microkde/ofileselector_p.h
@@ -128,25 +128,25 @@ private slots:
128 void slotClicked(int, QListViewItem*, const QPoint&, int ); 128 void slotClicked(int, QListViewItem*, const QPoint&, int );
129 void slotDoubleClicked(QListViewItem*); 129 void slotDoubleClicked(QListViewItem*);
130 void slotFSActivated(int); 130 void slotFSActivated(int);
131 131
132protected: 132protected:
133 133
134 OFileSelector* selector(); 134 OFileSelector* selector();
135 135
136private: 136private:
137 QMap<QString, QString> m_dev; 137 QMap<QString, QString> m_dev;
138 bool m_all : 1; 138 bool m_all : 1;
139 OFileSelector* m_sel; 139 OFileSelector* m_sel;
140 QPopupMenu* m_fsPop; 140 Q3PopupMenu* m_fsPop;
141 bool compliesMime( const QString& ); 141 bool compliesMime( const QString& );
142 QStringList m_mimes; // used in compy mime 142 QStringList m_mimes; // used in compy mime
143 QString m_currentDir; 143 QString m_currentDir;
144 QToolButton *m_btnNew, *m_btnClose; 144 QToolButton *m_btnNew, *m_btnClose;
145 void connectSlots(); 145 void connectSlots();
146 void addFile( QFileInfo* info, bool symlink = FALSE ); 146 void addFile( QFileInfo* info, bool symlink = FALSE );
147 void addDir ( QFileInfo* info, bool symlink = FALSE ); 147 void addDir ( QFileInfo* info, bool symlink = FALSE );
148 void addSymlink( QFileInfo* info, bool = FALSE ); 148 void addSymlink( QFileInfo* info, bool = FALSE );
149 149
150 150
151private: 151private:
152 QListView* m_view; 152 QListView* m_view;
diff --git a/microkde/qlayoutengine_p.h b/microkde/qlayoutengine_p.h
index 2d6a556..e782703 100644
--- a/microkde/qlayoutengine_p.h
+++ b/microkde/qlayoutengine_p.h
@@ -1,12 +1,14 @@
1//Added by qt3to4:
2#include <Q3MemArray>
1// THIS IS A COPY OF THE FILE FOUND IN $QTDIR/src/kernel. Needed to modify qsplitter 3// THIS IS A COPY OF THE FILE FOUND IN $QTDIR/src/kernel. Needed to modify qsplitter
2 4
3/**************************************************************************** 5/****************************************************************************
4** $Id$ 6** $Id$
5** 7**
6** Internal header file. 8** Internal header file.
7** 9**
8** Created : 981027 10** Created : 981027
9** 11**
10** Copyright (C) 1998-99 by Trolltech AS. All rights reserved. 12** Copyright (C) 1998-99 by Trolltech AS. All rights reserved.
11** 13**
12** This file is part of the kernel module of the Qt GUI Toolkit. 14** This file is part of the kernel module of the Qt GUI Toolkit.
@@ -46,51 +48,47 @@
46// ------------- 48// -------------
47// 49//
48// This file is not part of the Qt API. It exists for the convenience 50// This file is not part of the Qt API. It exists for the convenience
49// of qlayout.cpp, qlayoutengine.cpp, qmainwindow.cpp and qsplitter.cpp. 51// of qlayout.cpp, qlayoutengine.cpp, qmainwindow.cpp and qsplitter.cpp.
50// This header file may change from version to version without notice, 52// This header file may change from version to version without notice,
51// or even be removed. 53// or even be removed.
52// 54//
53// We mean it. 55// We mean it.
54// 56//
55// 57//
56 58
57 59
58#ifndef QT_H
59#include "qabstractlayout.h"
60#endif // QT_H
61
62#ifndef QT_NO_LAYOUT 60#ifndef QT_NO_LAYOUT
63struct QLayoutStruct 61struct QLayoutStruct
64{ 62{
65 void initParameters() { minimumSize = sizeHint = 0; 63 void initParameters() { minimumSize = sizeHint = 0;
66 maximumSize = QWIDGETSIZE_MAX; expansive = FALSE; empty = TRUE; } 64 maximumSize = QWIDGETSIZE_MAX; expansive = FALSE; empty = TRUE; }
67 void init() { stretch = 0; initParameters(); } 65 void init() { stretch = 0; initParameters(); }
68 //permanent storage: 66 //permanent storage:
69 int stretch; 67 int stretch;
70 //parameters: 68 //parameters:
71 QCOORD sizeHint; 69 QCOORD sizeHint;
72 QCOORD maximumSize; 70 QCOORD maximumSize;
73 QCOORD minimumSize; 71 QCOORD minimumSize;
74 bool expansive; 72 bool expansive;
75 bool empty; 73 bool empty;
76 //temporary storage: 74 //temporary storage:
77 bool done; 75 bool done;
78 //result: 76 //result:
79 int pos; 77 int pos;
80 int size; 78 int size;
81}; 79};
82 80
83 81
84void qGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, 82void qGeomCalc( Q3MemArray<QLayoutStruct> &chain, int start, int count, int pos,
85 int space, int spacer ); 83 int space, int spacer );
86 84
87 85
88 86
89/* 87/*
90 Modify total maximum (max) and total expansion (exp) 88 Modify total maximum (max) and total expansion (exp)
91 when adding boxmax/boxexp. 89 when adding boxmax/boxexp.
92 90
93 Expansive boxes win over non-expansive boxes. 91 Expansive boxes win over non-expansive boxes.
94*/ 92*/
95static inline void qMaxExpCalc( QCOORD & max, bool &exp, 93static inline void qMaxExpCalc( QCOORD & max, bool &exp,
96 QCOORD boxmax, bool boxexp ) 94 QCOORD boxmax, bool boxexp )
diff --git a/pwmanager/libcrypt/cipher/cipher.pro b/pwmanager/libcrypt/cipher/cipher.pro
index ad96201..7e1a330 100644
--- a/pwmanager/libcrypt/cipher/cipher.pro
+++ b/pwmanager/libcrypt/cipher/cipher.pro
@@ -59,12 +59,14 @@ SOURCES += ../crypt/ath.c \
59 ../crypt/misc.c \ 59 ../crypt/misc.c \
60 ../crypt/missing-string.c \ 60 ../crypt/missing-string.c \
61 ../crypt/module.c \ 61 ../crypt/module.c \
62 ../crypt/secmem.c \ 62 ../crypt/secmem.c \
63 ../crypt/sexp.c \ 63 ../crypt/sexp.c \
64 ../crypt/stdmem.c 64 ../crypt/stdmem.c
65 65
66 66
67 67
68 68
69#LIBS += -L../$(PLATFORM) 69#LIBS += -L../$(PLATFORM)
70#LIBS += -lgcrypt -lmpi -lerror 70#LIBS += -lgcrypt -lmpi -lerror
71#The following line was inserted by qt3to4
72QT += xml qt3support
diff --git a/pwmanager/libcrypt/error/error.pro b/pwmanager/libcrypt/error/error.pro
index 8c5f667..e96bcee 100644
--- a/pwmanager/libcrypt/error/error.pro
+++ b/pwmanager/libcrypt/error/error.pro
@@ -20,13 +20,15 @@ HEADERS += code-from-errno.h \
20 gettext.h 20 gettext.h
21 21
22SOURCES += code-from-errno.c \ 22SOURCES += code-from-errno.c \
23 code-to-errno.c \ 23 code-to-errno.c \
24 strerror-sym.c \ 24 strerror-sym.c \
25 strerror.c \ 25 strerror.c \
26 strsource-sym.c \ 26 strsource-sym.c \
27 strsource.c 27 strsource.c
28 28
29 # gpg-error.c \ 29 # gpg-error.c \
30 # gpg-error.h \ 30 # gpg-error.h \
31 # mkerrcodes.h 31 # mkerrcodes.h
32 # mkerrcodes.c \ \ No newline at end of file 32 # mkerrcodes.c \
33#The following line was inserted by qt3to4
34QT += xml qt3support
diff --git a/pwmanager/libcrypt/mpi/mpi.pro b/pwmanager/libcrypt/mpi/mpi.pro
index 4eb6346..d213bc3 100644
--- a/pwmanager/libcrypt/mpi/mpi.pro
+++ b/pwmanager/libcrypt/mpi/mpi.pro
@@ -31,12 +31,14 @@ SOURCES += mpi-add.c \
31 mpicoder.c \ 31 mpicoder.c \
32 mpih-div.c \ 32 mpih-div.c \
33 mpih-mul.c \ 33 mpih-mul.c \
34 mpiutil.c \ 34 mpiutil.c \
35 generic/mpih-add1.c \ 35 generic/mpih-add1.c \
36 generic/mpih-lshift.c \ 36 generic/mpih-lshift.c \
37 generic/mpih-mul1.c \ 37 generic/mpih-mul1.c \
38 generic/mpih-mul2.c \ 38 generic/mpih-mul2.c \
39 generic/mpih-mul3.c \ 39 generic/mpih-mul3.c \
40 generic/mpih-rshift.c \ 40 generic/mpih-rshift.c \
41 generic/mpih-sub1.c \ 41 generic/mpih-sub1.c \
42 generic/udiv-w-sdiv.c 42 generic/udiv-w-sdiv.c
43#The following line was inserted by qt3to4
44QT += xml qt3support
diff --git a/pwmanager/libcrypt/zlib/zlib.pro b/pwmanager/libcrypt/zlib/zlib.pro
index 2841aaf..7ba44e3 100644
--- a/pwmanager/libcrypt/zlib/zlib.pro
+++ b/pwmanager/libcrypt/zlib/zlib.pro
@@ -25,12 +25,14 @@ SOURCES += adler32.c \
25 compress.c \ 25 compress.c \
26 crc32.c \ 26 crc32.c \
27 deflate.c \ 27 deflate.c \
28 infblock.c \ 28 infblock.c \
29 infcodes.c \ 29 infcodes.c \
30 inffast.c \ 30 inffast.c \
31 inflate.c \ 31 inflate.c \
32 inftrees.c \ 32 inftrees.c \
33 infutil.c \ 33 infutil.c \
34 trees.c \ 34 trees.c \
35 uncompr.c \ 35 uncompr.c \
36 zutil.c 36 zutil.c
37#The following line was inserted by qt3to4
38QT += xml qt3support
diff --git a/pwmanager/pwmanager/addentrywnd_emb.cpp b/pwmanager/pwmanager/addentrywnd_emb.cpp
index 2fa9e8a..f76d33b 100644
--- a/pwmanager/pwmanager/addentrywnd_emb.cpp
+++ b/pwmanager/pwmanager/addentrywnd_emb.cpp
@@ -20,73 +20,76 @@
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22 22
23$Id$ 23$Id$
24*/ 24*/
25 25
26#include "addentrywnd_emb.h" 26#include "addentrywnd_emb.h"
27#include "pwmdoc.h" 27#include "pwmdoc.h"
28 28
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qlabel.h> 30#include <qlabel.h>
31#include <qtabwidget.h> 31#include <qtabwidget.h>
32#include <qgroupbox.h> 32#include <q3groupbox.h>
33//Added by qt3to4:
34#include <Q3GridLayout>
35#include <Q3VBoxLayout>
33#include <klocale.h> 36#include <klocale.h>
34#include <kcombobox.h> 37#include <kcombobox.h>
35#include <klineedit.h> 38#include <klineedit.h>
36#include <qpushbutton.h> 39#include <qpushbutton.h>
37#include <qmultilineedit.h> 40#include <q3multilineedit.h>
38 41
39/* 42/*
40 * Constructs a addEntryWnd as a child of 'parent', with the 43 * Constructs a addEntryWnd as a child of 'parent', with the
41 * name 'name' and widget flags set to 'f'. 44 * name 'name' and widget flags set to 'f'.
42 * 45 *
43 * The dialog will by default be modeless, unless you set 'modal' to 46 * The dialog will by default be modeless, unless you set 'modal' to
44 * TRUE to construct a modal dialog. 47 * TRUE to construct a modal dialog.
45 */ 48 */
46addEntryWnd::addEntryWnd( PwMDoc* d, QWidget* parent, const char* name) 49addEntryWnd::addEntryWnd( PwMDoc* d, QWidget* parent, const char* name)
47 : KDialogBase( KDialogBase::Plain, i18n( "edit/add a password entry" ), 50 : KDialogBase( KDialogBase::Plain, i18n( "edit/add a password entry" ),
48 KDialogBase::Ok | KDialogBase::Cancel, 51 KDialogBase::Ok | KDialogBase::Cancel,
49 KDialogBase::Ok, parent, name, true ), doc(d) 52 KDialogBase::Ok, parent, name, true ), doc(d)
50{ 53{
51 QWidget *page = plainPage(); 54 QWidget *page = plainPage();
52 QVBoxLayout *pageLayout = new QVBoxLayout( page ); 55 Q3VBoxLayout *pageLayout = new Q3VBoxLayout( page );
53 56
54 QTabWidget* mTabWidget = new QTabWidget( page ); 57 QTabWidget* mTabWidget = new QTabWidget( page );
55 pageLayout->addWidget( mTabWidget ); 58 pageLayout->addWidget( mTabWidget );
56 59
57 //////////////////////////////////////////////////////////////////// 60 ////////////////////////////////////////////////////////////////////
58 // This is the Password tab 61 // This is the Password tab
59 QWidget *tab1 = new QWidget( mTabWidget ); 62 QWidget *tab1 = new QWidget( mTabWidget );
60 63
61 QGridLayout *layout = new QGridLayout( tab1, 3, 1 ); 64 Q3GridLayout *layout = new Q3GridLayout( tab1, 3, 1 );
62 layout->setMargin( KDialogBase::marginHint() ); 65 layout->setMargin( KDialogBase::marginHint() );
63 layout->setSpacing( KDialogBase::spacingHint() ); 66 layout->setSpacing( KDialogBase::spacingHint() );
64 67
65 68
66 69
67 int i = 0; 70 int i = 0;
68 descLineEdit = new KLineEdit( tab1, "descLineEdit" ); 71 descLineEdit = new KLineEdit( tab1, "descLineEdit" );
69 descLineLabel = new QLabel( descLineEdit, i18n("Description:"), tab1 ); 72 descLineLabel = new QLabel( descLineEdit, i18n("Description:"), tab1 );
70 layout->addWidget( descLineLabel, i, 0 ); 73 layout->addWidget( descLineLabel, i, 0 );
71 layout->addWidget( descLineEdit, i, 1 ); 74 layout->addWidget( descLineEdit, i, 1 );
72 i++; 75 i++;
73 76
74 categoryComboBox = new KComboBox( tab1 ); 77 categoryComboBox = new KComboBox( tab1 );
75 QLabel* label = new QLabel( categoryComboBox, i18n("Category:"), tab1 ); 78 QLabel* label = new QLabel( categoryComboBox, i18n("Category:"), tab1 );
76 layout->addWidget( label, i, 0 ); 79 layout->addWidget( label, i, 0 );
77 layout->addWidget( categoryComboBox, i, 1 ); 80 layout->addWidget( categoryComboBox, i, 1 );
78 i++; 81 i++;
79 categoryComboBox->setEditable( TRUE ); 82 categoryComboBox->setEditable( TRUE );
80 categoryComboBox->setSizeLimit( 8 ); 83 categoryComboBox->setMaxVisibleItems( 8 );
81 categoryComboBox->setAutoCompletion( TRUE ); 84 categoryComboBox->setAutoCompletion( TRUE );
82 categoryComboBox->setDuplicatesEnabled( FALSE ); 85 categoryComboBox->setDuplicatesEnabled( FALSE );
83 connect(categoryComboBox,SIGNAL(activated(const QString&)), SLOT(categorySelected(const QString&))); 86 connect(categoryComboBox,SIGNAL(activated(const QString&)), SLOT(categorySelected(const QString&)));
84 87
85 88
86 usernameLineEdit = new KLineEdit( tab1, "usernameLineEdit" ); 89 usernameLineEdit = new KLineEdit( tab1, "usernameLineEdit" );
87 usernameLineLabel = new QLabel( usernameLineEdit, i18n("Username:"), tab1 ); 90 usernameLineLabel = new QLabel( usernameLineEdit, i18n("Username:"), tab1 );
88 layout->addWidget( usernameLineLabel, i, 0 ); 91 layout->addWidget( usernameLineLabel, i, 0 );
89 layout->addWidget( usernameLineEdit, i, 1 ); 92 layout->addWidget( usernameLineEdit, i, 1 );
90 i++; 93 i++;
91 94
92 pwLineEdit = new KLineEdit( tab1, "pwLineEdit" ); 95 pwLineEdit = new KLineEdit( tab1, "pwLineEdit" );
@@ -108,42 +111,42 @@ addEntryWnd::addEntryWnd( PwMDoc* d, QWidget* parent, const char* name)
108 label = new QLabel( urlLineEdit, i18n("URL:"), tab1 ); 111 label = new QLabel( urlLineEdit, i18n("URL:"), tab1 );
109 layout->addWidget( label, i, 0 ); 112 layout->addWidget( label, i, 0 );
110 layout->addWidget( urlLineEdit, i, 1 ); 113 layout->addWidget( urlLineEdit, i, 1 );
111 i++; 114 i++;
112 115
113 mTabWidget->addTab( tab1, i18n( "&Password" ) ); 116 mTabWidget->addTab( tab1, i18n( "&Password" ) );
114 117
115 118
116 //////////////////////////////////////////////////////////////////// 119 ////////////////////////////////////////////////////////////////////
117 // This is the Comment tab 120 // This is the Comment tab
118 QWidget *tab2 = new QWidget( mTabWidget ); 121 QWidget *tab2 = new QWidget( mTabWidget );
119 122
120 layout = new QGridLayout( tab2, 3, 1 ); 123 layout = new Q3GridLayout( tab2, 3, 1 );
121 layout->setMargin( KDialogBase::marginHintSmall() ); 124 layout->setMargin( KDialogBase::marginHintSmall() );
122 layout->setSpacing( KDialogBase::spacingHintSmall() ); 125 layout->setSpacing( KDialogBase::spacingHintSmall() );
123 i = 0; 126 i = 0;
124 127
125 commentTextEdit = new QMultiLineEdit(tab2); 128 commentTextEdit = new Q3MultiLineEdit(tab2);
126 layout->addMultiCellWidget( commentTextEdit, i, i, 0, 0 ); 129 layout->addMultiCellWidget( commentTextEdit, i, i, 0, 0 );
127 i++; 130 i++;
128 131
129 132
130 mTabWidget->addTab( tab2, i18n( "&Comments" ) ); 133 mTabWidget->addTab( tab2, i18n( "&Comments" ) );
131 134
132 135
133 //////////////////////////////////////////////////////////////////// 136 ////////////////////////////////////////////////////////////////////
134 // This is the Launcher tab 137 // This is the Launcher tab
135 QWidget *tab3 = new QWidget( mTabWidget ); 138 QWidget *tab3 = new QWidget( mTabWidget );
136 139
137 layout = new QGridLayout( tab3, 3, 1 ); 140 layout = new Q3GridLayout( tab3, 3, 1 );
138 layout->setMargin( KDialogBase::marginHintSmall() ); 141 layout->setMargin( KDialogBase::marginHintSmall() );
139 layout->setSpacing( KDialogBase::spacingHintSmall() ); 142 layout->setSpacing( KDialogBase::spacingHintSmall() );
140 i = 0; 143 i = 0;
141 144
142 launcherLineEdit = new KLineEdit( tab3, "launcherLineEdit" ); 145 launcherLineEdit = new KLineEdit( tab3, "launcherLineEdit" );
143 label = new QLabel( launcherLineEdit, i18n("Launcher:"), tab3 ); 146 label = new QLabel( launcherLineEdit, i18n("Launcher:"), tab3 );
144 147
145 QLabel* label1 = new QLabel( launcherLineEdit, i18n("$d = Description"), tab3 ); 148 QLabel* label1 = new QLabel( launcherLineEdit, i18n("$d = Description"), tab3 );
146 QLabel* label2 = new QLabel( launcherLineEdit, i18n("$n = Username"), tab3 ); 149 QLabel* label2 = new QLabel( launcherLineEdit, i18n("$n = Username"), tab3 );
147 QLabel* label3 = new QLabel( launcherLineEdit, i18n("$c = Comment"), tab3 ); 150 QLabel* label3 = new QLabel( launcherLineEdit, i18n("$c = Comment"), tab3 );
148 QLabel* label4 = new QLabel( launcherLineEdit, i18n("$u = URL"), tab3 ); 151 QLabel* label4 = new QLabel( launcherLineEdit, i18n("$u = URL"), tab3 );
149 QLabel* label5 = new QLabel( launcherLineEdit, i18n("$p = Password"), tab3 ); 152 QLabel* label5 = new QLabel( launcherLineEdit, i18n("$p = Password"), tab3 );
diff --git a/pwmanager/pwmanager/addentrywnd_emb.h b/pwmanager/pwmanager/addentrywnd_emb.h
index 966d9d2..ad7d30c 100644
--- a/pwmanager/pwmanager/addentrywnd_emb.h
+++ b/pwmanager/pwmanager/addentrywnd_emb.h
@@ -18,59 +18,64 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22 22
23$Id$ 23$Id$
24*/ 24*/
25 25
26#ifndef ADDENTRYWND_EMB_H 26#ifndef ADDENTRYWND_EMB_H
27#define ADDENTRYWND_EMB_H 27#define ADDENTRYWND_EMB_H
28 28
29#include <qvariant.h> 29#include <qvariant.h>
30//Added by qt3to4:
31#include <Q3VBoxLayout>
32#include <Q3GridLayout>
33#include <Q3HBoxLayout>
34#include <QLabel>
30#include <kdialogbase.h> 35#include <kdialogbase.h>
31 36
32class QVBoxLayout; 37class Q3VBoxLayout;
33class QHBoxLayout; 38class Q3HBoxLayout;
34class QGridLayout; 39class Q3GridLayout;
35class QSpacerItem; 40class QSpacerItem;
36class KLineEdit; 41class KLineEdit;
37class QPushButton; 42class QPushButton;
38class KComboBox; 43class KComboBox;
39class QLabel; 44class QLabel;
40class QGroupBox; 45class Q3GroupBox;
41class QMultiLineEdit; 46class Q3MultiLineEdit;
42class PwMDoc; 47class PwMDoc;
43 48
44class addEntryWnd : public KDialogBase 49class addEntryWnd : public KDialogBase
45{ 50{
46 Q_OBJECT 51 Q_OBJECT
47 52
48public: 53public:
49 addEntryWnd( PwMDoc* doc, QWidget* parent = 0, const char* name = 0); 54 addEntryWnd( PwMDoc* doc, QWidget* parent = 0, const char* name = 0);
50 ~addEntryWnd(); 55 ~addEntryWnd();
51 56
52 KLineEdit* launcherLineEdit; 57 KLineEdit* launcherLineEdit;
53 QPushButton* generateButton; 58 QPushButton* generateButton;
54 KLineEdit* descLineEdit; 59 KLineEdit* descLineEdit;
55 KComboBox* categoryComboBox; 60 KComboBox* categoryComboBox;
56 KLineEdit* usernameLineEdit; 61 KLineEdit* usernameLineEdit;
57 KLineEdit* pwLineEdit; 62 KLineEdit* pwLineEdit;
58 KLineEdit* urlLineEdit; 63 KLineEdit* urlLineEdit;
59 QLabel* descLineLabel; 64 QLabel* descLineLabel;
60 QLabel* usernameLineLabel; 65 QLabel* usernameLineLabel;
61 QLabel* pwLineLabel; 66 QLabel* pwLineLabel;
62 67
63 QPushButton* revealButton; 68 QPushButton* revealButton;
64 QMultiLineEdit* commentTextEdit; 69 Q3MultiLineEdit* commentTextEdit;
65 PwMDoc* doc; 70 PwMDoc* doc;
66 71
67public slots: 72public slots:
68 virtual void revealButton_slot(); 73 virtual void revealButton_slot();
69 virtual void generateButton_slot(); 74 virtual void generateButton_slot();
70 virtual void advancedCommentButton_slot(bool on); 75 virtual void advancedCommentButton_slot(bool on);
71 76
72 protected slots: 77 protected slots:
73 virtual void slotOk(); 78 virtual void slotOk();
74 virtual void categorySelected ( const QString & string ); 79 virtual void categorySelected ( const QString & string );
75 80
76}; 81};
diff --git a/pwmanager/pwmanager/addentrywndimpl.cpp b/pwmanager/pwmanager/addentrywndimpl.cpp
index 09efd1c..c952ead 100644
--- a/pwmanager/pwmanager/addentrywndimpl.cpp
+++ b/pwmanager/pwmanager/addentrywndimpl.cpp
@@ -187,35 +187,35 @@ void AddEntryWndImpl::switchComment(bool toAdvanced)
187 return; 187 return;
188 editAdvCommentButton = new QPushButton(i18n("Edit advanced comment..."), 188 editAdvCommentButton = new QPushButton(i18n("Edit advanced comment..."),
189 commentDummy); 189 commentDummy);
190 editAdvCommentButton->resize(commentDummy->size().width(), 50); 190 editAdvCommentButton->resize(commentDummy->size().width(), 50);
191 connect(editAdvCommentButton, SIGNAL(clicked()), 191 connect(editAdvCommentButton, SIGNAL(clicked()),
192 this, SLOT(editAdvCommentButton_slot())); 192 this, SLOT(editAdvCommentButton_slot()));
193 editAdvCommentButton->show(); 193 editAdvCommentButton->show();
194 } else { 194 } else {
195 delete_ifnot_null(editAdvCommentButton); 195 delete_ifnot_null(editAdvCommentButton);
196 if (commentTextEdit) 196 if (commentTextEdit)
197 return; 197 return;
198 198
199 commentTextEdit = new QTextEdit(commentDummy); 199 commentTextEdit = new Q3TextEdit(commentDummy);
200 commentTextEdit->setTextFormat(Qt::PlainText); 200 commentTextEdit->setTextFormat(Qt::PlainText);
201 commentTextEdit->resize(commentDummy->size()); 201 commentTextEdit->resize(commentDummy->size());
202 commentTextEdit->setText(savedCommentText); 202 commentTextEdit->setText(savedCommentText);
203 commentTextEdit->show(); 203 commentTextEdit->show();
204 } 204 }
205#endif 205#endif
206} 206}
207 207
208void AddEntryWndImpl::editAdvCommentButton_slot() 208void AddEntryWndImpl::editAdvCommentButton_slot()
209{ 209{
210#ifndef PWM_EMBEDDED 210#ifndef PWM_EMBEDDED
211 AdvCommEditImpl editor(this); 211 AdvCommEditImpl editor(this);
212 editor.setHtmlDta(advCommentDta); 212 editor.setHtmlDta(advCommentDta);
213 if (editor.exec()) 213 if (editor.exec())
214 return; 214 return;
215 advCommentDta = editor.getHtmlDta(); 215 advCommentDta = editor.getHtmlDta();
216#endif 216#endif
217} 217}
218 218
219#ifndef PWM_EMBEDDED 219#ifndef PWM_EMBEDDED_
220#include "addentrywndimpl.moc" 220#include "moc_addentrywndimpl.cpp"
221#endif 221#endif
diff --git a/pwmanager/pwmanager/addentrywndimpl.h b/pwmanager/pwmanager/addentrywndimpl.h
index e13eb54..c5f4bb1 100644
--- a/pwmanager/pwmanager/addentrywndimpl.h
+++ b/pwmanager/pwmanager/addentrywndimpl.h
@@ -14,31 +14,31 @@
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef __ADDENTRYWNDIMPL_H 20#ifndef __ADDENTRYWNDIMPL_H
21#define __ADDENTRYWNDIMPL_H 21#define __ADDENTRYWNDIMPL_H
22 22
23 23
24#ifndef PWM_EMBEDDED 24#ifndef PWM_EMBEDDED
25#include <qlineedit.h> 25#include <qlineedit.h>
26#include <qtextedit.h> 26#include <q3textedit.h>
27#include <qcombobox.h> 27#include <qcombobox.h>
28#include "addentrywnd.h" 28#include "addentrywnd.h"
29#else 29#else
30#include <klineedit.h> 30#include <klineedit.h>
31#include <kcombobox.h> 31#include <kcombobox.h>
32#include <qmultilineedit.h> 32#include <q3multilineedit.h>
33#include "addentrywnd_emb.h" 33#include "addentrywnd_emb.h"
34#endif 34#endif
35 35
36#include <qpushbutton.h> 36#include <qpushbutton.h>
37 37
38class PwGenWndImpl; 38class PwGenWndImpl;
39 39
40/** "add/edit" Window */ 40/** "add/edit" Window */
41class AddEntryWndImpl : public addEntryWnd 41class AddEntryWndImpl : public addEntryWnd
42{ 42{
43 Q_OBJECT 43 Q_OBJECT
44public: 44public:
@@ -77,49 +77,49 @@ public:
77 void setUrl(const QString &url) 77 void setUrl(const QString &url)
78 { urlLineEdit->setText(url); } 78 { urlLineEdit->setText(url); }
79 void setLauncher(const QString launcher) 79 void setLauncher(const QString launcher)
80 { launcherLineEdit->setText(launcher); } 80 { launcherLineEdit->setText(launcher); }
81 void setComment(const QString &comm); 81 void setComment(const QString &comm);
82 82
83 /** are we using an advanced comment */ 83 /** are we using an advanced comment */
84 bool isAdvancedComment() 84 bool isAdvancedComment()
85 { return useAdvComment; } 85 { return useAdvComment; }
86 86
87public slots: 87public slots:
88#ifndef PWM_EMBEDDED 88#ifndef PWM_EMBEDDED
89//MOC_SKIP_BEGIN 89#ifndef Q_MOC_RUN
90 /** OK button pressed */ 90 /** OK button pressed */
91 void okButton_slot(); 91 void okButton_slot();
92 /** cancel button pressed */ 92 /** cancel button pressed */
93 void cancelButton_slot(); 93 void cancelButton_slot();
94//MOC_SKIP_END 94#endif
95#else 95#else
96 virtual void slotOk(); 96 virtual void slotOk();
97#endif 97#endif
98 /** Reveal button pressed */ 98 /** Reveal button pressed */
99 void revealButton_slot(); 99 void revealButton_slot();
100 /** Generate button pressed */ 100 /** Generate button pressed */
101 void generateButton_slot(); 101 void generateButton_slot();
102 /** advanced comment button pressed */ 102 /** advanced comment button pressed */
103 void advancedCommentButton_slot(bool on); 103 void advancedCommentButton_slot(bool on);
104 /** edit advanced comment button pressed */ 104 /** edit advanced comment button pressed */
105 void editAdvCommentButton_slot(); 105 void editAdvCommentButton_slot();
106 106
107protected: 107protected:
108 void switchComment(bool toAdvanced); 108 void switchComment(bool toAdvanced);
109 109
110protected: 110protected:
111 QPushButton *editAdvCommentButton; 111 QPushButton *editAdvCommentButton;
112#ifndef PWM_EMBEDDED 112#ifndef PWM_EMBEDDED
113 QTextEdit *commentTextEdit; 113 Q3TextEdit *commentTextEdit;
114#else 114#else
115 //nothing here 115 //nothing here
116#endif 116#endif
117 /** saved data from normal comment text edit box */ 117 /** saved data from normal comment text edit box */
118 QString savedCommentText; 118 QString savedCommentText;
119 /** use an advanced comment? */ 119 /** use an advanced comment? */
120 bool useAdvComment; 120 bool useAdvComment;
121 /** data of advanced comment (if available) */ 121 /** data of advanced comment (if available) */
122 QString advCommentDta; 122 QString advCommentDta;
123 /** password generation object */ 123 /** password generation object */
124 PwGenWndImpl *pwGen; 124 PwGenWndImpl *pwGen;
125}; 125};
diff --git a/pwmanager/pwmanager/binentrygen.h b/pwmanager/pwmanager/binentrygen.h
index 49288aa..9263cdc 100644
--- a/pwmanager/pwmanager/binentrygen.h
+++ b/pwmanager/pwmanager/binentrygen.h
@@ -12,25 +12,25 @@
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef __BINENTRYGEN_H 20#ifndef __BINENTRYGEN_H
21#define __BINENTRYGEN_H 21#define __BINENTRYGEN_H
22 22
23 23
24#include <qcstring.h> 24#include <q3cstring.h>
25 25
26#include "pwmdoc.h" 26#include "pwmdoc.h"
27 27
28/** Binary entry generator. 28/** Binary entry generator.
29 * This generator generates a normal struct PwMDataItem 29 * This generator generates a normal struct PwMDataItem
30 * from binary data (using base64 encoding). 30 * from binary data (using base64 encoding).
31 * This mechanism is used to support the binary interface functions 31 * This mechanism is used to support the binary interface functions
32 * of the KWallet emulation, for example. 32 * of the KWallet emulation, for example.
33 * 33 *
34 * The format of the encoded binary data as a PwMDataItem is as follows: 34 * The format of the encoded binary data as a PwMDataItem is as follows:
35 * 35 *
36 * PwMDataItem::desc contains the normal description string for 36 * PwMDataItem::desc contains the normal description string for
diff --git a/pwmanager/pwmanager/commentbox.cpp b/pwmanager/pwmanager/commentbox.cpp
index 5416856..a60440d 100644
--- a/pwmanager/pwmanager/commentbox.cpp
+++ b/pwmanager/pwmanager/commentbox.cpp
@@ -17,27 +17,27 @@
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "commentbox.h" 20#include "commentbox.h"
21#include "pwmexception.h" 21#include "pwmexception.h"
22#include "htmlgen.h" 22#include "htmlgen.h"
23 23
24#include <klocale.h> 24#include <klocale.h>
25 25
26#ifndef PWM_EMBEDDED 26#ifndef PWM_EMBEDDED
27#include <khtml_part.h> 27#include <khtml_part.h>
28#include <khtmlview.h> 28#include <khtmlview.h>
29#include <qtextedit.h> 29#include <q3textedit.h>
30#else 30#else
31#include <qmultilineedit.h> 31#include <q3multilineedit.h>
32#endif 32#endif
33 33
34 34
35 35
36#ifndef PWM_EMBEDDED 36#ifndef PWM_EMBEDDED
37CommentBox::CommentBox(QWidget *_parentWidget) 37CommentBox::CommentBox(QWidget *_parentWidget)
38{ 38{
39 PWM_ASSERT(_parentWidget); 39 PWM_ASSERT(_parentWidget);
40 parentWidget = _parentWidget; 40 parentWidget = _parentWidget;
41 textDta = 0; 41 textDta = 0;
42 htmlDta = 0; 42 htmlDta = 0;
43 mode = mode_notSet; 43 mode = mode_notSet;
@@ -128,25 +128,25 @@ void CommentBox::switchTo(commentBoxMode newMode)
128 clearText(); 128 clearText();
129 break; 129 break;
130 case mode_html: 130 case mode_html:
131 clearHtml(); 131 clearHtml();
132 break; 132 break;
133 default: 133 default:
134 break; 134 break;
135 } 135 }
136 136
137 // setup new mode 137 // setup new mode
138 switch (newMode) { 138 switch (newMode) {
139 case mode_text: 139 case mode_text:
140 textDta = new QTextEdit(parentWidget); 140 textDta = new Q3TextEdit(parentWidget);
141 textDta->setTextFormat(Qt::PlainText); 141 textDta->setTextFormat(Qt::PlainText);
142 textDta->setReadOnly(true); 142 textDta->setReadOnly(true);
143 textDta->show(); 143 textDta->show();
144 break; 144 break;
145 case mode_html: 145 case mode_html:
146 htmlDta = new KHTMLPart(parentWidget, 0, 146 htmlDta = new KHTMLPart(parentWidget, 0,
147 parentWidget); 147 parentWidget);
148 htmlDta->show(); 148 htmlDta->show();
149 break; 149 break;
150 default: 150 default:
151 BUG(); 151 BUG();
152 break; 152 break;
@@ -220,44 +220,44 @@ QSize CommentBox::size()
220 break; 220 break;
221 } 221 }
222 222
223 return QSize(); 223 return QSize();
224} 224}
225 225
226 226
227//////////////////////////////////////////////////////////////////////// 227////////////////////////////////////////////////////////////////////////
228 228
229#else 229#else
230 230
231CommentBox::CommentBox(QWidget *_parentWidget) 231CommentBox::CommentBox(QWidget *_parentWidget)
232 : QTextBrowser(_parentWidget) 232 : Q3TextBrowser(_parentWidget)
233 233
234{ 234{
235 //this->setReadOnly(true); 235 //this->setReadOnly(true);
236 setFocusPolicy( QWidget::ClickFocus ); 236 setFocusPolicy( Qt::ClickFocus );
237} 237}
238 238
239CommentBox::~CommentBox() 239CommentBox::~CommentBox()
240{ 240{
241} 241}
242 242
243void CommentBox::clear() 243void CommentBox::clear()
244{ 244{
245 this->hide(); 245 this->hide();
246} 246}
247 247
248 248
249void CommentBox::setText(const QString &text) 249void CommentBox::setText(const QString &text)
250{ 250{
251 QTextBrowser::setText( text); 251 Q3TextBrowser::setText( text);
252 if (!isVisible()) 252 if (!isVisible())
253 show(); 253 show();
254} 254}
255 255
256bool CommentBox::getText(QString *text) 256bool CommentBox::getText(QString *text)
257{ 257{
258 *text = this->text(); 258 *text = this->text();
259 return true; 259 return true;
260} 260}
261 261
262void CommentBox::setContent(const QString &dta) 262void CommentBox::setContent(const QString &dta)
263{ 263{
diff --git a/pwmanager/pwmanager/commentbox.h b/pwmanager/pwmanager/commentbox.h
index 3103353..d14ba13 100644
--- a/pwmanager/pwmanager/commentbox.h
+++ b/pwmanager/pwmanager/commentbox.h
@@ -14,25 +14,25 @@
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef COMMENTBOX_H 20#ifndef COMMENTBOX_H
21#define COMMENTBOX_H 21#define COMMENTBOX_H
22 22
23#include <qstring.h> 23#include <qstring.h>
24#include <qsize.h> 24#include <qsize.h>
25class QWidget; 25class QWidget;
26class QTextEdit; 26class Q3TextEdit;
27class KHTMLPart; 27class KHTMLPart;
28 28
29#ifndef PWM_EMBEDDED 29#ifndef PWM_EMBEDDED
30 30
31class CommentBox 31class CommentBox
32{ 32{
33protected: 33protected:
34 enum commentBoxMode 34 enum commentBoxMode
35 { 35 {
36 mode_notSet = 0, 36 mode_notSet = 0,
37 mode_text, 37 mode_text,
38 mode_html 38 mode_html
@@ -76,36 +76,36 @@ protected:
76 void switchTo(commentBoxMode newMode); 76 void switchTo(commentBoxMode newMode);
77 /** clear all text data */ 77 /** clear all text data */
78 void clearText(); 78 void clearText();
79 /** clear all HTML data */ 79 /** clear all HTML data */
80 void clearHtml(); 80 void clearHtml();
81 81
82protected: 82protected:
83 /** parent widget for this comment box */ 83 /** parent widget for this comment box */
84 QWidget *parentWidget; 84 QWidget *parentWidget;
85 /** current comment box usage type */ 85 /** current comment box usage type */
86 commentBoxMode mode; 86 commentBoxMode mode;
87 /** if the comment box is a normal textbox, data is stored here */ 87 /** if the comment box is a normal textbox, data is stored here */
88 QTextEdit *textDta; 88 Q3TextEdit *textDta;
89 /** if the comment box is a HTML box, data is stored here */ 89 /** if the comment box is a HTML box, data is stored here */
90 KHTMLPart *htmlDta; 90 KHTMLPart *htmlDta;
91}; 91};
92 92
93#else 93#else
94#include <qtextbrowser.h> 94#include <q3textbrowser.h>
95/** Implementation of the advanced HTML comment box */ 95/** Implementation of the advanced HTML comment box */
96//US ENH: CommentBox must be derived from QWidget, to allow the splitter to set a initial size 96//US ENH: CommentBox must be derived from QWidget, to allow the splitter to set a initial size
97// without conflicting with the two display modes 97// without conflicting with the two display modes
98 98
99class CommentBox : public QTextBrowser 99class CommentBox : public Q3TextBrowser
100{ 100{
101public: 101public:
102 CommentBox(QWidget *_parentWidget); 102 CommentBox(QWidget *_parentWidget);
103 ~CommentBox(); 103 ~CommentBox();
104 104
105 /** clear all data in the comment box */ 105 /** clear all data in the comment box */
106 void clear(); 106 void clear();
107 /** if neccessary switch to text-mode and 107 /** if neccessary switch to text-mode and
108 * insert this text into the comment box 108 * insert this text into the comment box
109 */ 109 */
110 void setText(const QString &text); 110 void setText(const QString &text);
111 /** get the text of the comment box. 111 /** get the text of the comment box.
diff --git a/pwmanager/pwmanager/csv.cpp b/pwmanager/pwmanager/csv.cpp
index 194edf2..226cc08 100644
--- a/pwmanager/pwmanager/csv.cpp
+++ b/pwmanager/pwmanager/csv.cpp
@@ -14,44 +14,46 @@
14 * This file is originaly based on version 1.1 of pwmanager 14 * This file is originaly based on version 1.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * The original file version was 1.2 16 * The original file version was 1.2
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "csv.h" 20#include "csv.h"
21#include "pwmdoc.h" 21#include "pwmdoc.h"
22#include "pwmexception.h" 22#include "pwmexception.h"
23 23
24#include <kmessagebox.h> 24#include <kmessagebox.h>
25#include <klocale.h> 25#include <klocale.h>
26//Added by qt3to4:
27#include <Q3CString>
26 28
27 #define MAX_CSV_FILE_SIZE(50 * 1024 * 1024) // bytes 29 #define MAX_CSV_FILE_SIZE(50 * 1024 * 1024) // bytes
28 30
29 31
30Csv::Csv(QWidget *_parent) 32Csv::Csv(QWidget *_parent)
31 : parent (_parent) 33 : parent (_parent)
32{ 34{
33} 35}
34 36
35Csv::~Csv() 37Csv::~Csv()
36{ 38{
37} 39}
38 40
39bool Csv::importData(const QString &filepath, 41bool Csv::importData(const QString &filepath,
40 PwMDoc *doc) 42 PwMDoc *doc)
41{ 43{
42 bool ret = true; 44 bool ret = true;
43 QByteArray d; 45 QByteArray d;
44 QFile f(filepath); 46 QFile f(filepath);
45 if (!f.open(IO_ReadOnly)) { 47 if (!f.open(QIODevice::ReadOnly)) {
46 KMessageBox::error(parent, 48 KMessageBox::error(parent,
47 i18n("Could not open file.\n" 49 i18n("Could not open file.\n"
48 "Does the file exist?"), 50 "Does the file exist?"),
49 i18n("Open error.")); 51 i18n("Open error."));
50 ret = false; 52 ret = false;
51 goto out; 53 goto out;
52 } 54 }
53 if (f.size() > MAX_CSV_FILE_SIZE) { 55 if (f.size() > MAX_CSV_FILE_SIZE) {
54 KMessageBox::error(parent, 56 KMessageBox::error(parent,
55 i18n("File too big.\nMaximum file size is 1 Byte.", "File too big.\nMaximum file size is %n Bytes.", MAX_CSV_FILE_SIZE), 57 i18n("File too big.\nMaximum file size is 1 Byte.", "File too big.\nMaximum file size is %n Bytes.", MAX_CSV_FILE_SIZE),
56 i18n("File too big.")); 58 i18n("File too big."));
57 ret = false; 59 ret = false;
@@ -80,25 +82,25 @@ out:
80 return ret; 82 return ret;
81} 83}
82 84
83bool Csv::doImport(const QByteArray &d, 85bool Csv::doImport(const QByteArray &d,
84 PwMDoc *doc) 86 PwMDoc *doc)
85{ 87{
86 PwMDataItem di; 88 PwMDataItem di;
87 //US ENH: initialize all members: 89 //US ENH: initialize all members:
88 di.clear(); 90 di.clear();
89 91
90 int refIndex = 0; 92 int refIndex = 0;
91 int ret; 93 int ret;
92 QCString s, curCat; 94 Q3CString s, curCat;
93 int fieldIndex = 0; 95 int fieldIndex = 0;
94 bool inRecord = false; 96 bool inRecord = false;
95 /* fieldIndex is a reference count to see which 97 /* fieldIndex is a reference count to see which
96 * value we are attaching to di. 98 * value we are attaching to di.
97 * Valid counts are: 99 * Valid counts are:
98 * 0 -> category 100 * 0 -> category
99 * 1 -> desc 101 * 1 -> desc
100 * 2 -> name 102 * 2 -> name
101 * 3 -> pw 103 * 3 -> pw
102 * 4 -> url 104 * 4 -> url
103 * 5 -> launcher 105 * 5 -> launcher
104 * 6 -> comment 106 * 6 -> comment
@@ -112,79 +114,79 @@ bool Csv::doImport(const QByteArray &d,
112 inRecord = true; 114 inRecord = true;
113 switch (fieldIndex) { 115 switch (fieldIndex) {
114 case 0: // category 116 case 0: // category
115 if (s.isEmpty()) { 117 if (s.isEmpty()) {
116 /* This is special case. It's the category 118 /* This is special case. It's the category
117 * list terminating empty field. 119 * list terminating empty field.
118 */ 120 */
119 ++fieldIndex; 121 ++fieldIndex;
120 } else 122 } else
121 curCat = s; 123 curCat = s;
122 break; 124 break;
123 case 1:// desc 125 case 1:// desc
124 di.desc = s; 126 di.desc = std::string(s);
125 ++fieldIndex; 127 ++fieldIndex;
126 break; 128 break;
127 case 2: // name 129 case 2: // name
128 di.name = s; 130 di.name = std::string(s);
129 ++fieldIndex; 131 ++fieldIndex;
130 break; 132 break;
131 case 3: // pw 133 case 3: // pw
132 di.pw = s; 134 di.pw = std::string(s);
133 ++fieldIndex; 135 ++fieldIndex;
134 break; 136 break;
135 case 4: // url 137 case 4: // url
136 di.url = s; 138 di.url = std::string(s);
137 ++fieldIndex; 139 ++fieldIndex;
138 break; 140 break;
139 case 5: // launcher 141 case 5: // launcher
140 di.launcher = s; 142 di.launcher = std::string(s);
141 ++fieldIndex; 143 ++fieldIndex;
142 break; 144 break;
143 case 6: // comment 145 case 6: // comment
144 di.comment = s; 146 di.comment = std::string(s);
145 ++fieldIndex; 147 ++fieldIndex;
146 break; 148 break;
147 default: 149 default:
148 /* Too many fields in a record. 150 /* Too many fields in a record.
149 * We simply throw it away. 151 * We simply throw it away.
150 */ 152 */
151 break; 153 break;
152 } 154 }
153 break; 155 break;
154 case 1: 156 case 1:
155 // record complete. 157 // record complete.
156 if (fieldIndex == 6) 158 if (fieldIndex == 6)
157 di.comment = s; 159 di.comment = std::string(s);
158 inRecord = false; 160 inRecord = false;
159 fieldIndex = 0; 161 fieldIndex = 0;
160 doc->addEntry(curCat, &di, true); 162 doc->addEntry(curCat, &di, true);
161 //US ENH: clear di for the next row 163 //US ENH: clear di for the next row
162 di.clear(); 164 di.clear();
163 break; 165 break;
164 case 2: 166 case 2:
165 // data completely parsed. 167 // data completely parsed.
166 doc->flagDirty(); 168 doc->flagDirty();
167 return true; 169 return true;
168 case -1: 170 case -1:
169 // parse error 171 // parse error
170 doc->flagDirty(); 172 doc->flagDirty();
171 return false; 173 return false;
172 } 174 }
173 } 175 }
174 BUG(); 176 BUG();
175 return false; 177 return false;
176} 178}
177 179
178int Csv::nextField(QCString *ret, 180int Csv::nextField(Q3CString *ret,
179 const QByteArray &in, 181 const QByteArray &in,
180 bool inRecord, 182 bool inRecord,
181 int *_refIndex) 183 int *_refIndex)
182{ 184{
183 int rv = -2; 185 int rv = -2;
184 char c; 186 char c;
185 bool inField = false; 187 bool inField = false;
186 bool isQuoted = false; 188 bool isQuoted = false;
187 bool searchingTerminator = false; 189 bool searchingTerminator = false;
188 int refIndex; 190 int refIndex;
189 int inSize = static_cast<int>(in.size()); 191 int inSize = static_cast<int>(in.size());
190 ret->truncate(0); 192 ret->truncate(0);
@@ -344,85 +346,85 @@ bool Csv::exportData(const QString &filepath,
344 "Do you want to overwrite it?"), 346 "Do you want to overwrite it?"),
345 i18n("Overwrite file?")); 347 i18n("Overwrite file?"));
346 if (ret == KMessageBox::No) 348 if (ret == KMessageBox::No)
347 return false; 349 return false;
348 if (!QFile::remove(filepath)) { 350 if (!QFile::remove(filepath)) {
349 KMessageBox::error(parent, 351 KMessageBox::error(parent,
350 i18n("Could not delete the old file."), 352 i18n("Could not delete the old file."),
351 i18n("Delete error.")); 353 i18n("Delete error."));
352 return false; 354 return false;
353 } 355 }
354 } 356 }
355 QFile f(filepath); 357 QFile f(filepath);
356 if (!f.open(IO_ReadWrite)) { 358 if (!f.open(QIODevice::ReadWrite)) {
357 KMessageBox::error(parent, 359 KMessageBox::error(parent,
358 i18n("Could not open file for writing."), 360 i18n("Could not open file for writing."),
359 i18n("Open error.")); 361 i18n("Open error."));
360 ret = false; 362 ret = false;
361 goto out; 363 goto out;
362 } 364 }
363 doc->unlockAll_tempoary(); 365 doc->unlockAll_tempoary();
364 if (!doExport(f, doc)) 366 if (!doExport(f, doc))
365 ret = false; 367 ret = false;
366 doc->unlockAll_tempoary(true); 368 doc->unlockAll_tempoary(true);
367 f.close(); 369 f.close();
368out: 370out:
369 return ret; 371 return ret;
370} 372}
371 373
372bool Csv::doExport(QFile &f, 374bool Csv::doExport(QFile &f,
373 PwMDoc *doc) 375 PwMDoc *doc)
374{ 376{
375 unsigned int numCat = doc->numCategories(); 377 unsigned int numCat = doc->numCategories();
376 unsigned int numEntr; 378 unsigned int numEntr;
377 unsigned int i, j; 379 unsigned int i, j;
378 PwMDataItem d; 380 PwMDataItem d;
379 QCString s, catName; 381 Q3CString s, catName;
380 QByteArray b; 382 QByteArray b;
381 383
382 for (i = 0; i < numCat; ++i) { 384 for (i = 0; i < numCat; ++i) {
383 numEntr = doc->numEntries(i); 385 numEntr = doc->numEntries(i);
384 catName = newField(doc->getCategory(i)->c_str()); 386 catName = newField(doc->getCategory(i)->c_str());
385 for (j = 0; j < numEntr; ++j) { 387 for (j = 0; j < numEntr; ++j) {
386 doc->getEntry(i, j, &d); 388 doc->getEntry(i, j, &d);
387 s = catName; 389 s = catName;
388 s += ",,"; 390 s += ",,";
389 s += newField(d.desc.c_str()); 391 s += newField(d.desc.c_str());
390 s += ","; 392 s += ",";
391 s += newField(d.name.c_str()); 393 s += newField(d.name.c_str());
392 s += ","; 394 s += ",";
393 s += newField(d.pw.c_str()); 395 s += newField(d.pw.c_str());
394 s += ","; 396 s += ",";
395 s += newField(d.url.c_str()); 397 s += newField(d.url.c_str());
396 s += ","; 398 s += ",";
397 s += newField(d.launcher.c_str()); 399 s += newField(d.launcher.c_str());
398 s += ","; 400 s += ",";
399 s += newField(d.comment.c_str()); 401 s += newField(d.comment.c_str());
400 s += "\r\n"; 402 s += "\r\n";
401 b = s; 403 b = s;
402 // remove \0 termination 404 // remove \0 termination
403#ifndef PWM_EMBEDDED 405#ifndef PWM_EMBEDDED
404 b.resize(b.size() - 1, QGArray::SpeedOptim); 406 b.resize(b.size() - 1, Q3GArray::SpeedOptim);
405#else 407#else
406 b.resize(b.size() - 1); 408 b.resize(b.size() - 1);
407#endif 409#endif
408 if (!f.writeBlock(b)) 410 if (!f.writeBlock(b))
409 return false; 411 return false;
410 } 412 }
411 } 413 }
412 return true; 414 return true;
413} 415}
414 416
415QCString Csv::newField(QCString s) 417Q3CString Csv::newField(Q3CString s)
416{ 418{
417 if (s.isEmpty()) 419 if (s.isEmpty())
418 return QCString(); 420 return Q3CString();
419 QCString ret("\""); 421 Q3CString ret("\"");
420#ifndef PWM_EMBEDDED 422#ifndef PWM_EMBEDDED
421 s.replace('\"', "\"\""); 423 s.replace('\"', "\"\"");
422#else 424#else
423 s.replace(QRegExp("\""), "\"\""); 425 s.replace("\"", "\"\"");
424#endif 426#endif
425 ret += s; 427 ret += s;
426 ret += "\""; 428 ret += "\"";
427 return ret; 429 return ret;
428} 430}
diff --git a/pwmanager/pwmanager/csv.h b/pwmanager/pwmanager/csv.h
index 6f3c1e1..8049122 100644
--- a/pwmanager/pwmanager/csv.h
+++ b/pwmanager/pwmanager/csv.h
@@ -12,25 +12,25 @@
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.1 of pwmanager 14 * This file is originaly based on version 1.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * The original file version was 1.2 16 * The original file version was 1.2
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20 20
21#ifndef __PWMANAGER_CSV_H 21#ifndef __PWMANAGER_CSV_H
22#define __PWMANAGER_CSV_H 22#define __PWMANAGER_CSV_H
23 23
24#include <qcstring.h> 24#include <q3cstring.h>
25#include <qfile.h> 25#include <qfile.h>
26 26
27 27
28class PwMDoc; 28class PwMDoc;
29class QString; 29class QString;
30class QWidget; 30class QWidget;
31 31
32/** class for CSV (Comma Separated Value) export and import. 32/** class for CSV (Comma Separated Value) export and import.
33 * 33 *
34 * http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm 34 * http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm
35 * http://en.wikipedia.org/wiki/Comma-separated_values 35 * http://en.wikipedia.org/wiki/Comma-separated_values
36 * 36 *
@@ -64,28 +64,28 @@ public:
64 64
65protected: 65protected:
66 /** do the import process. */ 66 /** do the import process. */
67 bool doImport(const QByteArray &d, 67 bool doImport(const QByteArray &d,
68 PwMDoc *doc); 68 PwMDoc *doc);
69 /** parse for the next field. 69 /** parse for the next field.
70 * @return Return values are: 70 * @return Return values are:
71 * 0 -> successfully got the next field. 71 * 0 -> successfully got the next field.
72 * 1 -> record end. 72 * 1 -> record end.
73 * 2 -> data end. 73 * 2 -> data end.
74 * -1 -> parser error. 74 * -1 -> parser error.
75 */ 75 */
76 int nextField(QCString *ret, 76 int nextField(Q3CString *ret,
77 const QByteArray &in, 77 const QByteArray &in,
78 bool inRecord, 78 bool inRecord,
79 int *_refIndex); 79 int *_refIndex);
80 /** do the export process. */ 80 /** do the export process. */
81 bool doExport(QFile &f, 81 bool doExport(QFile &f,
82 PwMDoc *doc); 82 PwMDoc *doc);
83 /** generate a new data field string. */ 83 /** generate a new data field string. */
84 QCString newField(QCString s); 84 Q3CString newField(Q3CString s);
85 85
86protected: 86protected:
87 /** current parent widget. */ 87 /** current parent widget. */
88 QWidget *parent; 88 QWidget *parent;
89}; 89};
90 90
91#endif // __PWMANAGER_CSV_H 91#endif // __PWMANAGER_CSV_H
diff --git a/pwmanager/pwmanager/editcategory.cpp b/pwmanager/pwmanager/editcategory.cpp
index 4e2378c..4f19299 100644
--- a/pwmanager/pwmanager/editcategory.cpp
+++ b/pwmanager/pwmanager/editcategory.cpp
@@ -19,25 +19,27 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22 22
23$Id$ 23$Id$
24*/ 24*/
25 25
26#include "editcategory.h" 26#include "editcategory.h"
27#include "pwmdoc.h" 27#include "pwmdoc.h"
28 28
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qlabel.h> 30#include <qlabel.h>
31#include <qgroupbox.h> 31#include <q3groupbox.h>
32//Added by qt3to4:
33#include <Q3GridLayout>
32#include <klocale.h> 34#include <klocale.h>
33#include <kcombobox.h> 35#include <kcombobox.h>
34#include <klineedit.h> 36#include <klineedit.h>
35#include <qpushbutton.h> 37#include <qpushbutton.h>
36 38
37 39
38/* 40/*
39 * Constructs a addEntryWnd as a child of 'parent', with the 41 * Constructs a addEntryWnd as a child of 'parent', with the
40 * name 'name' and widget flags set to 'f'. 42 * name 'name' and widget flags set to 'f'.
41 * 43 *
42 * The dialog will by default be modeless, unless you set 'modal' to 44 * The dialog will by default be modeless, unless you set 'modal' to
43 * TRUE to construct a modal dialog. 45 * TRUE to construct a modal dialog.
@@ -46,36 +48,36 @@ editCategoryWnd::editCategoryWnd( PwMDoc* d, QWidget* parent, const char* name)
46 : KDialogBase( KDialogBase::Plain, i18n( "edit category descriptions" ), 48 : KDialogBase( KDialogBase::Plain, i18n( "edit category descriptions" ),
47 Apply | User2 | Ok, 49 Apply | User2 | Ok,
48 Ok, parent, name, true ), 50 Ok, parent, name, true ),
49 doc(d) 51 doc(d)
50{ 52{
51 findButton( Ok )->setText (i18n("Close" )) ; 53 findButton( Ok )->setText (i18n("Close" )) ;
52 findButton( User2 )->setText (i18n("Cancel" )) ; 54 findButton( User2 )->setText (i18n("Cancel" )) ;
53 connect(this,SIGNAL(user2Clicked()), SLOT(cancel_slot())); 55 connect(this,SIGNAL(user2Clicked()), SLOT(cancel_slot()));
54 enableButton( KDialogBase::Apply, false ); 56 enableButton( KDialogBase::Apply, false );
55 57
56 58
57 QWidget *page = plainPage(); 59 QWidget *page = plainPage();
58 QGridLayout *layout = new QGridLayout( page, 3, 1 ); 60 Q3GridLayout *layout = new Q3GridLayout( page, 3, 1 );
59 layout->setMargin( KDialogBase::marginHint() ); 61 layout->setMargin( KDialogBase::marginHint() );
60 layout->setSpacing( KDialogBase::spacingHint() ); 62 layout->setSpacing( KDialogBase::spacingHint() );
61 63
62 int i = 0; 64 int i = 0;
63 categoryComboBox = new KComboBox( page ); 65 categoryComboBox = new KComboBox( page );
64 QLabel* label = new QLabel( categoryComboBox, i18n("Category:"), page ); 66 QLabel* label = new QLabel( categoryComboBox, i18n("Category:"), page );
65 layout->addWidget( label, i, 0 ); 67 layout->addWidget( label, i, 0 );
66 layout->addWidget( categoryComboBox, i, 1 ); 68 layout->addWidget( categoryComboBox, i, 1 );
67 i++; 69 i++;
68 categoryComboBox->setEditable( FALSE ); 70 categoryComboBox->setEditable( FALSE );
69 categoryComboBox->setSizeLimit( 100 ); 71 categoryComboBox->setMaxVisibleItems( 100 );
70 connect(categoryComboBox,SIGNAL(activated(const QString&)), SLOT(categorySelected(const QString&))); 72 connect(categoryComboBox,SIGNAL(activated(const QString&)), SLOT(categorySelected(const QString&)));
71 73
72 74
73 descLineEdit = new KLineEdit( page, "descLineEdit" ); 75 descLineEdit = new KLineEdit( page, "descLineEdit" );
74 label = new QLabel( descLineEdit, i18n("Text1 (Description):"), page ); 76 label = new QLabel( descLineEdit, i18n("Text1 (Description):"), page );
75 layout->addWidget( label, i, 0 ); 77 layout->addWidget( label, i, 0 );
76 layout->addWidget( descLineEdit, i, 1 ); 78 layout->addWidget( descLineEdit, i, 1 );
77 connect( descLineEdit, SIGNAL( textChanged ( const QString & ) ), SLOT( widgetModified(const QString &) ) ); 79 connect( descLineEdit, SIGNAL( textChanged ( const QString & ) ), SLOT( widgetModified(const QString &) ) );
78 i++; 80 i++;
79 81
80 usernameLineEdit = new KLineEdit( page, "usernameLineEdit" ); 82 usernameLineEdit = new KLineEdit( page, "usernameLineEdit" );
81 label = new QLabel( usernameLineEdit, i18n("Text2 (Username):"), page ); 83 label = new QLabel( usernameLineEdit, i18n("Text2 (Username):"), page );
diff --git a/pwmanager/pwmanager/editcategory.h b/pwmanager/pwmanager/editcategory.h
index 90b685b..10a012b 100644
--- a/pwmanager/pwmanager/editcategory.h
+++ b/pwmanager/pwmanager/editcategory.h
@@ -18,36 +18,41 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22 22
23$Id$ 23$Id$
24*/ 24*/
25 25
26#ifndef EDITCATEGORY_H 26#ifndef EDITCATEGORY_H
27#define EDITCATEGORY_H 27#define EDITCATEGORY_H
28 28
29#include <qvariant.h> 29#include <qvariant.h>
30//Added by qt3to4:
31#include <Q3VBoxLayout>
32#include <Q3GridLayout>
33#include <Q3HBoxLayout>
34#include <QLabel>
30#include <kdialogbase.h> 35#include <kdialogbase.h>
31 36
32class QVBoxLayout; 37class Q3VBoxLayout;
33class QHBoxLayout; 38class Q3HBoxLayout;
34class QGridLayout; 39class Q3GridLayout;
35class QSpacerItem; 40class QSpacerItem;
36class KLineEdit; 41class KLineEdit;
37class QPushButton; 42class QPushButton;
38class KComboBox; 43class KComboBox;
39class QLabel; 44class QLabel;
40class QGroupBox; 45class Q3GroupBox;
41class QMultiLineEdit; 46class Q3MultiLineEdit;
42class PwMDoc; 47class PwMDoc;
43 48
44class editCategoryWnd : public KDialogBase 49class editCategoryWnd : public KDialogBase
45{ 50{
46 Q_OBJECT 51 Q_OBJECT
47 52
48public: 53public:
49 editCategoryWnd( PwMDoc* doc, QWidget* parent = 0, const char* name = 0); 54 editCategoryWnd( PwMDoc* doc, QWidget* parent = 0, const char* name = 0);
50 ~editCategoryWnd(); 55 ~editCategoryWnd();
51 56
52 void setCurrCategory(const QString &cat); 57 void setCurrCategory(const QString &cat);
53 58
diff --git a/pwmanager/pwmanager/findwnd_emb.cpp b/pwmanager/pwmanager/findwnd_emb.cpp
index 6dcabe8..03d4e38 100644
--- a/pwmanager/pwmanager/findwnd_emb.cpp
+++ b/pwmanager/pwmanager/findwnd_emb.cpp
@@ -19,27 +19,29 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22 22
23$Id$ 23$Id$
24*/ 24*/
25 25
26#include "findwnd_emb.h" 26#include "findwnd_emb.h"
27 27
28#include <klocale.h> 28#include <klocale.h>
29 29
30#include <qcheckbox.h> 30#include <qcheckbox.h>
31#include <qbuttongroup.h> 31#include <q3buttongroup.h>
32#include <qradiobutton.h> 32#include <qradiobutton.h>
33#include <qlayout.h> 33#include <qlayout.h>
34//Added by qt3to4:
35#include <Q3VBoxLayout>
34#include <klineedit.h> 36#include <klineedit.h>
35#include <qlabel.h> 37#include <qlabel.h>
36 38
37/* 39/*
38#include <qvariant.h> 40#include <qvariant.h>
39#include <qlabel.h> 41#include <qlabel.h>
40#include <qlineedit.h> 42#include <qlineedit.h>
41#include <qpushbutton.h> 43#include <qpushbutton.h>
42#include <qcheckbox.h> 44#include <qcheckbox.h>
43#include <qbuttongroup.h> 45#include <qbuttongroup.h>
44#include <qradiobutton.h> 46#include <qradiobutton.h>
45#include <qlayout.h> 47#include <qlayout.h>
@@ -48,36 +50,36 @@ $Id$
48*/ 50*/
49 51
50/* 52/*
51 * Constructs a findWnd as a child of 'parent', with the 53 * Constructs a findWnd as a child of 'parent', with the
52 * name 'name'. 54 * name 'name'.
53 */ 55 */
54findWnd::findWnd( QWidget* parent, const char* name ) 56findWnd::findWnd( QWidget* parent, const char* name )
55 : KDialogBase( KDialogBase::Plain, i18n( "Find" ), 57 : KDialogBase( KDialogBase::Plain, i18n( "Find" ),
56 KDialogBase::Ok | KDialogBase::Cancel, 58 KDialogBase::Ok | KDialogBase::Cancel,
57 KDialogBase::Ok, parent, name, true ) 59 KDialogBase::Ok, parent, name, true )
58{ 60{
59 QWidget *page = plainPage(); 61 QWidget *page = plainPage();
60 QVBoxLayout *layout = new QVBoxLayout( page ); 62 Q3VBoxLayout *layout = new Q3VBoxLayout( page );
61 layout->setMargin( KDialogBase::marginHint() ); 63 layout->setMargin( KDialogBase::marginHint() );
62 layout->setSpacing( KDialogBase::spacingHint() ); 64 layout->setSpacing( KDialogBase::spacingHint() );
63 65
64 exactCheckBox = new QCheckBox( i18n( "&Exact match" ), page ); 66 exactCheckBox = new QCheckBox( i18n( "&Exact match" ), page );
65 layout->addWidget( exactCheckBox ); 67 layout->addWidget( exactCheckBox );
66 68
67 caseSensCheckBox = new QCheckBox( i18n( "&Case sensitive" ), page ); 69 caseSensCheckBox = new QCheckBox( i18n( "&Case sensitive" ), page );
68 layout->addWidget( caseSensCheckBox ); 70 layout->addWidget( caseSensCheckBox );
69 71
70 72
71 QButtonGroup* buttonGroup1 = new QButtonGroup(1, Qt::Horizontal, i18n( "Search in Column" ), page ); 73 Q3ButtonGroup* buttonGroup1 = new Q3ButtonGroup(1, Qt::Horizontal, i18n( "Search in Column" ), page );
72 layout->addWidget( buttonGroup1 ); 74 layout->addWidget( buttonGroup1 );
73 75
74 descRadioButton = new QRadioButton( i18n( "&Description" ), buttonGroup1 ); 76 descRadioButton = new QRadioButton( i18n( "&Description" ), buttonGroup1 );
75 pwRadioButton = new QRadioButton( i18n( "&Password" ), buttonGroup1 ); 77 pwRadioButton = new QRadioButton( i18n( "&Password" ), buttonGroup1 );
76 commentRadioButton = new QRadioButton( i18n( "C&omment" ), buttonGroup1 ); 78 commentRadioButton = new QRadioButton( i18n( "C&omment" ), buttonGroup1 );
77 nameRadioButton = new QRadioButton( i18n( "&Username" ), buttonGroup1 ); 79 nameRadioButton = new QRadioButton( i18n( "&Username" ), buttonGroup1 );
78 urlRadioButton = new QRadioButton( i18n( "U&RL" ), buttonGroup1 ); 80 urlRadioButton = new QRadioButton( i18n( "U&RL" ), buttonGroup1 );
79 launcherRadioButton = new QRadioButton( i18n( "&Launcher" ), buttonGroup1 ); 81 launcherRadioButton = new QRadioButton( i18n( "&Launcher" ), buttonGroup1 );
80 descRadioButton->setChecked( TRUE ); 82 descRadioButton->setChecked( TRUE );
81 83
82 findLineEdit = new KLineEdit( page ); 84 findLineEdit = new KLineEdit( page );
83 // QLabel* label = new QLabel( findLineEdit, i18n( "Find:" ), page ); 85 // QLabel* label = new QLabel( findLineEdit, i18n( "Find:" ), page );
diff --git a/pwmanager/pwmanager/findwndimpl.cpp b/pwmanager/pwmanager/findwndimpl.cpp
index 059219f..d323133 100644
--- a/pwmanager/pwmanager/findwndimpl.cpp
+++ b/pwmanager/pwmanager/findwndimpl.cpp
@@ -124,15 +124,15 @@ void FindWndImpl::closeButton_slot()
124#ifndef PWM_EMBEDDED 124#ifndef PWM_EMBEDDED
125 done(0); 125 done(0);
126#endif 126#endif
127} 127}
128 128
129void FindWndImpl::selectionChanged_slot() 129void FindWndImpl::selectionChanged_slot()
130{ 130{
131 fAt = 0; 131 fAt = 0;
132 refVal = 0; 132 refVal = 0;
133 currFoundPos = -1; 133 currFoundPos = -1;
134} 134}
135 135
136#ifndef PWM_EMBEDDED 136#ifndef PWM_EMBEDDED_
137#include "findwndimpl.moc" 137#include "moc_findwndimpl.cpp"
138#endif 138#endif
diff --git a/pwmanager/pwmanager/genpasswd.cpp b/pwmanager/pwmanager/genpasswd.cpp
index 41078b3..82f0c06 100644
--- a/pwmanager/pwmanager/genpasswd.cpp
+++ b/pwmanager/pwmanager/genpasswd.cpp
@@ -12,24 +12,26 @@
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "genpasswd.h" 20#include "genpasswd.h"
21#include "pwmexception.h" 21#include "pwmexception.h"
22#include "randomizer.h" 22#include "randomizer.h"
23#include "globalstuff.h" 23#include "globalstuff.h"
24//Added by qt3to4:
25#include <Q3PtrList>
24 26
25 27
26/* how often can a char of the same charset be reused in order */ 28/* how often can a char of the same charset be reused in order */
27 #define FILTER_MAX_CHARSET_REUSE3 29 #define FILTER_MAX_CHARSET_REUSE3
28/* re-randomize all charsets on every iteration (0/1) */ 30/* re-randomize all charsets on every iteration (0/1) */
29 #define RERAND_CHARSET 0 31 #define RERAND_CHARSET 0
30 32
31 33
32struct staticCharsetStruct 34struct staticCharsetStruct
33{ 35{
34 const char *lower; 36 const char *lower;
35 const char *upper; 37 const char *upper;
@@ -149,25 +151,25 @@ QString GenPasswd::gen()
149} 151}
150 152
151GenPasswd::dynCharset_element * GenPasswd::selectNextCharset() 153GenPasswd::dynCharset_element * GenPasswd::selectNextCharset()
152{ 154{
153 dynCharset_element *ret; 155 dynCharset_element *ret;
154 int numCharsets = dynCharset.count(); 156 int numCharsets = dynCharset.count();
155 BUG_ON(numCharsets <= 0); 157 BUG_ON(numCharsets <= 0);
156 if (numCharsets == 1) 158 if (numCharsets == 1)
157 return dynCharset.at(0); 159 return dynCharset.at(0);
158 Randomizer *rnd = Randomizer::obj(); 160 Randomizer *rnd = Randomizer::obj();
159 if (useFilter) { 161 if (useFilter) {
160 // find out which charsets are allowed (filtering) 162 // find out which charsets are allowed (filtering)
161 QPtrList<dynCharset_element> allowedCharsets; 163 Q3PtrList<dynCharset_element> allowedCharsets;
162 // QPtrList<dynCharset_element>::iterator is not available in QT-3.1 164 // QPtrList<dynCharset_element>::iterator is not available in QT-3.1
163 unsigned int i, cnt = dynCharset.count(); 165 unsigned int i, cnt = dynCharset.count();
164 dynCharset_element *p; 166 dynCharset_element *p;
165 for (i = 0; i < cnt; ++i) { 167 for (i = 0; i < cnt; ++i) {
166 p = dynCharset.at(i); 168 p = dynCharset.at(i);
167 PWM_ASSERT(p); 169 PWM_ASSERT(p);
168 if (p->refCnt < FILTER_MAX_CHARSET_REUSE) { 170 if (p->refCnt < FILTER_MAX_CHARSET_REUSE) {
169 allowedCharsets.append(p); 171 allowedCharsets.append(p);
170 } else { 172 } else {
171 p->refCnt = 0; 173 p->refCnt = 0;
172 } 174 }
173 } 175 }
diff --git a/pwmanager/pwmanager/genpasswd.h b/pwmanager/pwmanager/genpasswd.h
index 3fa1607..5493891 100644
--- a/pwmanager/pwmanager/genpasswd.h
+++ b/pwmanager/pwmanager/genpasswd.h
@@ -12,25 +12,25 @@
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef __GENPASSWD_H 20#ifndef __GENPASSWD_H
21#define __GENPASSWD_H 21#define __GENPASSWD_H
22 22
23#include <qstring.h> 23#include <qstring.h>
24#include <qptrlist.h> 24#include <q3ptrlist.h>
25 25
26/** internal password generator of PwManager */ 26/** internal password generator of PwManager */
27class GenPasswd 27class GenPasswd
28{ 28{
29protected: 29protected:
30 struct dynCharset_element 30 struct dynCharset_element
31 { 31 {
32 /** charset data */ 32 /** charset data */
33 QString data; 33 QString data;
34 /** reference counter for the filter */ 34 /** reference counter for the filter */
35 unsigned int refCnt; 35 unsigned int refCnt;
36 }; 36 };
@@ -61,16 +61,16 @@ protected:
61 void rndDynCharset(); 61 void rndDynCharset();
62 /** select the next charset (based on useFilter) */ 62 /** select the next charset (based on useFilter) */
63 dynCharset_element * selectNextCharset(); 63 dynCharset_element * selectNextCharset();
64 /** generate a new random char from the given charset */ 64 /** generate a new random char from the given charset */
65 QChar genNewRandom(const dynCharset_element *charset); 65 QChar genNewRandom(const dynCharset_element *charset);
66 66
67protected: 67protected:
68 /** password length to generate */ 68 /** password length to generate */
69 int length; 69 int length;
70 /** use the filter? */ 70 /** use the filter? */
71 bool useFilter; 71 bool useFilter;
72 /** dynamic charset used for generating the password */ 72 /** dynamic charset used for generating the password */
73 QPtrList<dynCharset_element> dynCharset; 73 Q3PtrList<dynCharset_element> dynCharset;
74}; 74};
75 75
76#endif // __GENPASSWD_H 76#endif // __GENPASSWD_H
diff --git a/pwmanager/pwmanager/getkeycardwnd.cpp b/pwmanager/pwmanager/getkeycardwnd.cpp
index 89dada2..b8e6174 100644
--- a/pwmanager/pwmanager/getkeycardwnd.cpp
+++ b/pwmanager/pwmanager/getkeycardwnd.cpp
@@ -11,35 +11,38 @@
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "getkeycardwnd.h" 20#include "getkeycardwnd.h"
21 21
22#include <qmessagebox.h> 22#include <qmessagebox.h>
23//Added by qt3to4:
24#include <QResizeEvent>
25#include <QLabel>
23 26
24#include <klocale.h> 27#include <klocale.h>
25 28
26 29
27GetKeyCardWnd::GetKeyCardWnd(QWidget *parent, 30GetKeyCardWnd::GetKeyCardWnd(QWidget *parent,
28 const char *name, bool modal, WFlags f) 31 const char *name, bool modal, Qt::WFlags f)
29 : QDialog(parent, name, modal, f) 32 : QDialog(parent, name, modal, f)
30{ 33{
31 vbox1 = new QVBox(this); 34 vbox1 = new Q3VBox(this);
32 text_label = new QLabel(vbox1); 35 text_label = new QLabel(vbox1);
33 hbox1 = new QHBox(vbox1); 36 hbox1 = new Q3HBox(vbox1);
34 okButton = new QPushButton(i18n("&Ok"), hbox1); 37 okButton = new QPushButton(i18n("&Ok"), hbox1);
35 cancelButton = new QPushButton(i18n("&Cancel"), hbox1); 38 cancelButton = new QPushButton(i18n("&Cancel"), hbox1);
36 39
37 vbox1->setSpacing(10); 40 vbox1->setSpacing(10);
38 vbox1->setMargin(10); 41 vbox1->setMargin(10);
39 hbox1->setSpacing(10); 42 hbox1->setSpacing(10);
40 43
41 resize(500, 100); 44 resize(500, 100);
42 45
43 setCaption(i18n("Insert key-card")); 46 setCaption(i18n("Insert key-card"));
44 text_label->setText(i18n("Please insert the key-card " 47 text_label->setText(i18n("Please insert the key-card "
45 "and press the OK button.")); 48 "and press the OK button."));
@@ -53,15 +56,15 @@ GetKeyCardWnd::~GetKeyCardWnd()
53} 56}
54 57
55void GetKeyCardWnd::resizeEvent(QResizeEvent *) 58void GetKeyCardWnd::resizeEvent(QResizeEvent *)
56{ 59{
57 vbox1->resize(size()); 60 vbox1->resize(size());
58} 61}
59 62
60void GetKeyCardWnd::okButton_slot() 63void GetKeyCardWnd::okButton_slot()
61{ 64{
62 done(1); 65 done(1);
63} 66}
64 67
65#ifndef PWM_EMBEDDED 68#ifndef PWM_EMBEDDED_
66#include "getkeycardwnd.moc" 69#include "moc_getkeycardwnd.cpp"
67#endif 70#endif
diff --git a/pwmanager/pwmanager/getkeycardwnd.h b/pwmanager/pwmanager/getkeycardwnd.h
index fbe46ee..202e920 100644
--- a/pwmanager/pwmanager/getkeycardwnd.h
+++ b/pwmanager/pwmanager/getkeycardwnd.h
@@ -11,43 +11,45 @@
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef GETKEYCARDWND_H 20#ifndef GETKEYCARDWND_H
21#define GETKEYCARDWND_H 21#define GETKEYCARDWND_H
22 22
23#include <qvbox.h> 23#include <q3vbox.h>
24#include <qhbox.h> 24#include <q3hbox.h>
25#include <qdialog.h> 25#include <qdialog.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qevent.h> 28#include <qevent.h>
29//Added by qt3to4:
30#include <QResizeEvent>
29 31
30/** The equivalent to GetMasterPwWndImpl for chipcards */ 32/** The equivalent to GetMasterPwWndImpl for chipcards */
31class GetKeyCardWnd : public QDialog 33class GetKeyCardWnd : public QDialog
32{ 34{
33 Q_OBJECT 35 Q_OBJECT
34public: 36public:
35 GetKeyCardWnd(QWidget *parent = 0, const char *name = 0, 37 GetKeyCardWnd(QWidget *parent = 0, const char *name = 0,
36 bool modal = FALSE, WFlags f = 0); 38 bool modal = FALSE, Qt::WFlags f = 0);
37 ~GetKeyCardWnd(); 39 ~GetKeyCardWnd();
38 40
39protected slots: 41protected slots:
40 void okButton_slot(); 42 void okButton_slot();
41 43
42protected: 44protected:
43 QVBox *vbox1; 45 Q3VBox *vbox1;
44 QHBox *hbox1; 46 Q3HBox *hbox1;
45 QLabel *text_label; 47 QLabel *text_label;
46 QPushButton *okButton; 48 QPushButton *okButton;
47 QPushButton *cancelButton; 49 QPushButton *cancelButton;
48 50
49protected: 51protected:
50 void resizeEvent(QResizeEvent *); 52 void resizeEvent(QResizeEvent *);
51}; 53};
52 54
53#endif 55#endif
diff --git a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
index 678f05f..7e4bbb7 100644
--- a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
+++ b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
@@ -34,58 +34,61 @@ $Id$
34#include <qlineedit.h> 34#include <qlineedit.h>
35#include <qlayout.h> 35#include <qlayout.h>
36#include <qtooltip.h> 36#include <qtooltip.h>
37#include <qwhatsthis.h> 37#include <qwhatsthis.h>
38*/ 38*/
39 39
40#include <qwidget.h> 40#include <qwidget.h>
41#include <qlayout.h> 41#include <qlayout.h>
42#include <qlabel.h> 42#include <qlabel.h>
43#include <qlineedit.h> 43#include <qlineedit.h>
44#include <qpushbutton.h> 44#include <qpushbutton.h>
45#include <qapplication.h> 45#include <qapplication.h>
46//Added by qt3to4:
47#include <Q3GridLayout>
48#include <Q3VBoxLayout>
46 49
47/* 50/*
48 * Constructs a getMasterPwWnd as a child of 'parent', with the 51 * Constructs a getMasterPwWnd as a child of 'parent', with the
49 * name 'name' 52 * name 'name'
50 */ 53 */
51getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name) 54getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name)
52 : KDialogBase( KDialogBase::Plain, i18n( "Master-password" ), 55 : KDialogBase( KDialogBase::Plain, i18n( "Master-password" ),
53 KDialogBase::Ok | KDialogBase::Cancel, 56 KDialogBase::Ok | KDialogBase::Cancel,
54 KDialogBase::Ok, parent, name, true ) 57 KDialogBase::Ok, parent, name, true )
55{ 58{
56 QWidget *page = plainPage(); 59 QWidget *page = plainPage();
57 QVBoxLayout *pageLayout = new QVBoxLayout( page ); 60 Q3VBoxLayout *pageLayout = new Q3VBoxLayout( page );
58 61
59 pwLineEdit = new QLineEdit( page, "pwLineEdit" ); 62 pwLineEdit = new QLineEdit( page, "pwLineEdit" );
60 pwLineEdit->setEchoMode( QLineEdit::Password ); 63 pwLineEdit->setEchoMode( QLineEdit::Password );
61 64
62 QLabel* textLabel1 = new QLabel( pwLineEdit, i18n("Please enter the master-password:"), page, "textLabel1" ); 65 QLabel* textLabel1 = new QLabel( pwLineEdit, i18n("Please enter the master-password:"), page, "textLabel1" );
63 textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); 66 textLabel1->setAlignment( int( Qt::WordBreak | Qt::AlignCenter ) );
64 pageLayout->addWidget(textLabel1); 67 pageLayout->addWidget(textLabel1);
65 pageLayout->addWidget(pwLineEdit); 68 pageLayout->addWidget(pwLineEdit);
66 69
67 QWidget* numberBox = new QWidget( page ); 70 QWidget* numberBox = new QWidget( page );
68#ifndef DESKTOP_VERSION 71#ifndef DESKTOP_VERSION
69 if ( QApplication::desktop()->width() > 320 ) { 72 if ( QApplication::desktop()->width() > 320 ) {
70 numberBox->setFixedHeight(250); 73 numberBox->setFixedHeight(250);
71 numberBox->setFixedWidth(200); 74 numberBox->setFixedWidth(200);
72 } 75 }
73 else{ 76 else{
74 numberBox->setFixedHeight(150); 77 numberBox->setFixedHeight(150);
75 numberBox->setFixedWidth(150); 78 numberBox->setFixedWidth(150);
76 } 79 }
77#endif 80#endif
78 81
79 QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 ); 82 Q3GridLayout* numberLayout = new Q3GridLayout( numberBox, 4, 3 );
80 numberLayout->setMargin( 0 ); 83 numberLayout->setMargin( 0 );
81 numberLayout->setSpacing( 0 ); 84 numberLayout->setSpacing( 0 );
82 85
83 QPushButton* p1 = new QPushButton( i18n("1"), numberBox ); 86 QPushButton* p1 = new QPushButton( i18n("1"), numberBox );
84 numberLayout->addWidget( p1, 0, 0 ); 87 numberLayout->addWidget( p1, 0, 0 );
85 QPushButton* p2 = new QPushButton( i18n("2"), numberBox ); 88 QPushButton* p2 = new QPushButton( i18n("2"), numberBox );
86 numberLayout->addWidget( p2, 0, 1 ); 89 numberLayout->addWidget( p2, 0, 1 );
87 QPushButton* p3 = new QPushButton( i18n("3"), numberBox ); 90 QPushButton* p3 = new QPushButton( i18n("3"), numberBox );
88 numberLayout->addWidget( p3, 0, 2 ); 91 numberLayout->addWidget( p3, 0, 2 );
89 QPushButton* p4 = new QPushButton( i18n("4"), numberBox ); 92 QPushButton* p4 = new QPushButton( i18n("4"), numberBox );
90 numberLayout->addWidget( p4, 1, 0 ); 93 numberLayout->addWidget( p4, 1, 0 );
91 QPushButton* p5 = new QPushButton( i18n("5"), numberBox ); 94 QPushButton* p5 = new QPushButton( i18n("5"), numberBox );
diff --git a/pwmanager/pwmanager/getmasterpwwndimpl.cpp b/pwmanager/pwmanager/getmasterpwwndimpl.cpp
index 6be9618..f741f72 100644
--- a/pwmanager/pwmanager/getmasterpwwndimpl.cpp
+++ b/pwmanager/pwmanager/getmasterpwwndimpl.cpp
@@ -46,15 +46,15 @@ void GetMasterPwWndImpl::cancelButton_slot()
46} 46}
47 47
48#ifdef PWM_EMBEDDED 48#ifdef PWM_EMBEDDED
49void GetMasterPwWndImpl::slotOk() 49void GetMasterPwWndImpl::slotOk()
50{ 50{
51 if (pwLineEdit->text() != "") 51 if (pwLineEdit->text() != "")
52 getMasterPwWnd::slotOk(); 52 getMasterPwWnd::slotOk();
53 else 53 else
54 return; 54 return;
55} 55}
56#endif 56#endif
57 57
58#ifndef PWM_EMBEDDED 58#ifndef PWM_EMBEDDED_
59#include "getmasterpwwndimpl.moc" 59#include "moc_getmasterpwwndimpl.cpp"
60#endif 60#endif
diff --git a/pwmanager/pwmanager/globalstuff.h b/pwmanager/pwmanager/globalstuff.h
index 090fcda..2e8f287 100644
--- a/pwmanager/pwmanager/globalstuff.h
+++ b/pwmanager/pwmanager/globalstuff.h
@@ -25,25 +25,25 @@
25#endif 25#endif
26 26
27#include "compiler.h" 27#include "compiler.h"
28 28
29 //US BUG: the following code caused compile errors with certain gcccompilers (2.95). 29 //US BUG: the following code caused compile errors with certain gcccompilers (2.95).
30 // Because of that I replaced it with a Qt version, which should do the same. 30 // Because of that I replaced it with a Qt version, which should do the same.
31#include <string> 31#include <string>
32 32
33#ifndef PWM_EMBEDDED 33#ifndef PWM_EMBEDDED
34#include <sstream> 34#include <sstream>
35#else 35#else
36#include <qstring.h> 36#include <qstring.h>
37#include <qtextstream.h> 37#include <QTextOStream>
38#endif 38#endif
39 39
40#ifndef CONFIG_KEYCARD 40#ifndef CONFIG_KEYCARD
41class QWidget; 41class QWidget;
42void no_keycard_support_msg_box(QWidget *parentWidget); 42void no_keycard_support_msg_box(QWidget *parentWidget);
43#endif // CONFIG_KEYCARD 43#endif // CONFIG_KEYCARD
44 44
45#ifdef PROG_NAME 45#ifdef PROG_NAME
46# undef PROG_NAME 46# undef PROG_NAME
47#endif 47#endif
48 #define PROG_NAME"PwM/Pi" 48 #define PROG_NAME"PwM/Pi"
49 49
@@ -88,25 +88,25 @@ template <class T> inline
88std::string tostr(const T &t) 88std::string tostr(const T &t)
89{ 89{
90 std::ostringstream s; 90 std::ostringstream s;
91 s << t; 91 s << t;
92 return s.str(); 92 return s.str();
93} 93}
94#else 94#else
95/** convert something to string using ostringstream */ 95/** convert something to string using ostringstream */
96template <class T> inline 96template <class T> inline
97std::string tostr(const T &t) 97std::string tostr(const T &t)
98{ 98{
99 QString result; 99 QString result;
100 QTextOStream(&result) << t; 100 QTextOStream tmp(&result); tmp << t;
101 return result.latin1(); 101 return result.latin1();
102} 102}
103#endif 103#endif
104 104
105/** delete the memory and NULL the pointer */ 105/** delete the memory and NULL the pointer */
106template<class T> inline 106template<class T> inline
107void delete_and_null(T *&p) 107void delete_and_null(T *&p)
108{ 108{
109 delete p; 109 delete p;
110 p = 0; 110 p = 0;
111} 111}
112/** delete the memory if the pointer isn't a NULL pointer */ 112/** delete the memory if the pointer isn't a NULL pointer */
diff --git a/pwmanager/pwmanager/htmlgen.cpp b/pwmanager/pwmanager/htmlgen.cpp
index bee8198..be3406a 100644
--- a/pwmanager/pwmanager/htmlgen.cpp
+++ b/pwmanager/pwmanager/htmlgen.cpp
@@ -51,25 +51,25 @@ HtmlGen::HtmlGen()
51} 51}
52 52
53HtmlGen::~HtmlGen() 53HtmlGen::~HtmlGen()
54{ 54{
55} 55}
56 56
57QString HtmlGen::escapeHtmlText(const QString &str) 57QString HtmlGen::escapeHtmlText(const QString &str)
58{ 58{
59 QString ret; 59 QString ret;
60 unsigned int len = str.length(), i; 60 unsigned int len = str.length(), i;
61 char c; 61 char c;
62 for (i = 0; i < len; ++i) { 62 for (i = 0; i < len; ++i) {
63 c = str.at(i); 63 c = str.at(i).toLatin1();
64 switch (c) { 64 switch (c) {
65 case '<': 65 case '<':
66 ret.append("&lt;"); 66 ret.append("&lt;");
67 break; 67 break;
68 case '>': 68 case '>':
69 ret.append("&gt;"); 69 ret.append("&gt;");
70 break; 70 break;
71 case '&': 71 case '&':
72 ret.append("&amp;"); 72 ret.append("&amp;");
73 break; 73 break;
74 case '\"': 74 case '\"':
75 ret.append("&quot;"); 75 ret.append("&quot;");
diff --git a/pwmanager/pwmanager/ipc.cpp b/pwmanager/pwmanager/ipc.cpp
index 643b022..4c65f1d 100644
--- a/pwmanager/pwmanager/ipc.cpp
+++ b/pwmanager/pwmanager/ipc.cpp
@@ -19,25 +19,25 @@
19 19
20#include "ipc.h" 20#include "ipc.h"
21#include "pwmexception.h" 21#include "pwmexception.h"
22 22
23#include <qsocketnotifier.h> 23#include <qsocketnotifier.h>
24#ifndef _WIN32_ 24#ifndef _WIN32_
25#include <sys/socket.h> 25#include <sys/socket.h>
26#endif 26#endif
27#ifndef PWM_EMBEDDED 27#ifndef PWM_EMBEDDED
28#include <sys/types.h> 28#include <sys/types.h>
29#include <stdio.h> 29#include <stdio.h>
30#else 30#else
31#include <qsocket.h> 31#include <q3socket.h>
32#endif 32#endif
33 33
34 #define END_OF_LINE '\n' 34 #define END_OF_LINE '\n'
35 #define INIT_LINEBUF_LEN64 /* byte */ 35 #define INIT_LINEBUF_LEN64 /* byte */
36 36
37#ifndef PWM_EMBEDDED 37#ifndef PWM_EMBEDDED
38 38
39Ipc::Ipc() 39Ipc::Ipc()
40 : stream (0) 40 : stream (0)
41 , notifier (0) 41 , notifier (0)
42 , rdBuf (0) 42 , rdBuf (0)
43{ 43{
@@ -68,36 +68,36 @@ Ipc::Ipc()
68 host = true; 68 host = true;
69} 69}
70#else 70#else
71Ipc::Ipc() 71Ipc::Ipc()
72 : notifier (0) 72 : notifier (0)
73 , rdBuf (0) 73 , rdBuf (0)
74{ 74{
75#ifndef _WIN32_ 75#ifndef _WIN32_
76 if (socketpair(AF_LOCAL, SOCK_STREAM, 0, sock)) { 76 if (socketpair(AF_LOCAL, SOCK_STREAM, 0, sock)) {
77 qDebug("Ipc: socketpair() failed"); 77 qDebug("Ipc: socketpair() failed");
78 } 78 }
79#endif 79#endif
80 QSocket* qsock = new QSocket(); 80 Q3Socket* qsock = new Q3Socket();
81 qsock->setSocket(sock[0]); 81 qsock->setSocket(sock[0]);
82 82
83 rdBufSize = INIT_LINEBUF_LEN; 83 rdBufSize = INIT_LINEBUF_LEN;
84 rdBuf = (char *)(malloc(rdBufSize)); 84 rdBuf = (char *)(malloc(rdBufSize));
85 if (!rdBuf) { 85 if (!rdBuf) {
86 close(sock[0]); 86 close(sock[0]);
87 close(sock[1]); 87 close(sock[1]);
88 qDebug("Ipc: OOM"); 88 qDebug("Ipc: OOM");
89 } 89 }
90 90
91 qsock = new QSocket(); 91 qsock = new Q3Socket();
92 qsock->setSocket(sock[0]); 92 qsock->setSocket(sock[0]);
93 93
94 /*US 94 /*US
95 stream = fdopen(sock[0], "r"); 95 stream = fdopen(sock[0], "r");
96 if (!stream) { 96 if (!stream) {
97 close(sock[0]); 97 close(sock[0]);
98 close(sock[1]); 98 close(sock[1]);
99 free(rdBuf); 99 free(rdBuf);
100 qDebug("Ipc: fdopen() failed"); 100 qDebug("Ipc: fdopen() failed");
101 } 101 }
102 */ 102 */
103 103
@@ -143,25 +143,25 @@ Ipc::Ipc(const Ipc *ipc)
143Ipc::Ipc(const Ipc *ipc) 143Ipc::Ipc(const Ipc *ipc)
144 : notifier (0) 144 : notifier (0)
145 , rdBuf (0) 145 , rdBuf (0)
146{ 146{
147 rdBufSize = INIT_LINEBUF_LEN; 147 rdBufSize = INIT_LINEBUF_LEN;
148 rdBuf = (char *)(malloc(rdBufSize)); 148 rdBuf = (char *)(malloc(rdBufSize));
149 if (!rdBuf) { 149 if (!rdBuf) {
150 qDebug("Ipc: OOM"); 150 qDebug("Ipc: OOM");
151 } 151 }
152 sock[0] = ipc->sock[1]; 152 sock[0] = ipc->sock[1];
153 sock[1] = ipc->sock[0]; 153 sock[1] = ipc->sock[0];
154 154
155 qSock = new QSocket(); 155 qSock = new Q3Socket();
156 qSock->setSocket(sock[0]); 156 qSock->setSocket(sock[0]);
157 157
158 /*US 158 /*US
159 stream = fdopen(sock[0], "r"); 159 stream = fdopen(sock[0], "r");
160 if (!stream) { 160 if (!stream) {
161 free(rdBuf); 161 free(rdBuf);
162 qDebug("Ipc: fdopen() failed"); 162 qDebug("Ipc: fdopen() failed");
163 } 163 }
164 */ 164 */
165 165
166 notifier = new QSocketNotifier(sock[0], QSocketNotifier::Read); 166 notifier = new QSocketNotifier(sock[0], QSocketNotifier::Read);
167 connect(notifier, SIGNAL(activated(int)), 167 connect(notifier, SIGNAL(activated(int)),
@@ -203,15 +203,15 @@ void Ipc::receiveData(int s)
203 } 203 }
204#else 204#else
205 int rd; 205 int rd;
206 rd = qSock->readLine(rdBuf, rdBufSize); 206 rd = qSock->readLine(rdBuf, rdBufSize);
207 if (rd > 0) { 207 if (rd > 0) {
208 emit lineAvailable(rdBuf, rd); 208 emit lineAvailable(rdBuf, rd);
209 } 209 }
210#endif 210#endif
211 qDebug("void Ipc::receiveData(int s) has to be implemented."); 211 qDebug("void Ipc::receiveData(int s) has to be implemented.");
212 212
213} 213}
214 214
215#ifndef PWM_EMBEDDED 215#ifndef PWM_EMBEDDED_
216#include "ipc.moc" 216#include "moc_ipc.cpp"
217#endif 217#endif
diff --git a/pwmanager/pwmanager/ipc.h b/pwmanager/pwmanager/ipc.h
index 7bfca02..3248283 100644
--- a/pwmanager/pwmanager/ipc.h
+++ b/pwmanager/pwmanager/ipc.h
@@ -20,25 +20,25 @@
20#ifndef __PWM_IPC_H 20#ifndef __PWM_IPC_H
21#define __PWM_IPC_H 21#define __PWM_IPC_H
22 22
23#include <qobject.h> 23#include <qobject.h>
24#ifndef _WIN32_ 24#ifndef _WIN32_
25#include <unistd.h> 25#include <unistd.h>
26#else 26#else
27#include <io.h> 27#include <io.h>
28#endif 28#endif
29#ifndef PWM_EMBEDDED 29#ifndef PWM_EMBEDDED
30#include <stdio.h> 30#include <stdio.h>
31#else 31#else
32#include <qsocket.h> 32#include <q3socket.h>
33#endif 33#endif
34 34
35class QSocketNotifier; 35class QSocketNotifier;
36 36
37/** very simple interprocess communication class */ 37/** very simple interprocess communication class */
38class Ipc : public QObject 38class Ipc : public QObject
39{ 39{
40 Q_OBJECT 40 Q_OBJECT
41public: 41public:
42 /** create a new Ipc communication object */ 42 /** create a new Ipc communication object */
43 Ipc(); 43 Ipc();
44 /** create a new Ipc communication object and 44 /** create a new Ipc communication object and
@@ -65,25 +65,25 @@ signals:
65 65
66protected slots: 66protected slots:
67 /** received data on socket */ 67 /** received data on socket */
68 void receiveData(int s); 68 void receiveData(int s);
69 69
70protected: 70protected:
71#ifndef PWM_EMBEDDED 71#ifndef PWM_EMBEDDED
72 /** stream on "this" end of the socket (sock[0]) */ 72 /** stream on "this" end of the socket (sock[0]) */
73 FILE *stream; 73 FILE *stream;
74 /** current receive buffer size */ 74 /** current receive buffer size */
75 size_t rdBufSize; 75 size_t rdBufSize;
76#else 76#else
77 QSocket* qSock; 77 Q3Socket* qSock;
78 /** current receive buffer size */ 78 /** current receive buffer size */
79 unsigned int rdBufSize; 79 unsigned int rdBufSize;
80#endif 80#endif
81 81
82 /** full-duplex socket file desciptors */ 82 /** full-duplex socket file desciptors */
83 int sock[2]; 83 int sock[2];
84 /** socket notifier */ 84 /** socket notifier */
85 QSocketNotifier *notifier; 85 QSocketNotifier *notifier;
86 /** are we the host or the client object? */ 86 /** are we the host or the client object? */
87 bool host; 87 bool host;
88 /** receive buffer */ 88 /** receive buffer */
89 char *rdBuf; 89 char *rdBuf;
diff --git a/pwmanager/pwmanager/kcmconfigs/kcmpwmconfig.cpp b/pwmanager/pwmanager/kcmconfigs/kcmpwmconfig.cpp
index b7944c3..1804e88 100644
--- a/pwmanager/pwmanager/kcmconfigs/kcmpwmconfig.cpp
+++ b/pwmanager/pwmanager/kcmconfigs/kcmpwmconfig.cpp
@@ -13,45 +13,47 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25//Added by qt3to4:
26#include <Q3VBoxLayout>
25 27
26#include <kdebug.h> 28#include <kdebug.h>
27 29
28#include "pwmconfigwidget.h" 30#include "pwmconfigwidget.h"
29 31
30#include "kcmpwmconfig.h" 32#include "kcmpwmconfig.h"
31 33
32#include "pwmprefs.h" 34#include "pwmprefs.h"
33#include "kprefs.h" 35#include "kprefs.h"
34 36
35extern "C" 37extern "C"
36{ 38{
37 KCModule *create_pwmconfig(QWidget *parent, const char * ) { 39 KCModule *create_pwmconfig(QWidget *parent, const char * ) {
38 return new KCMPwmConfig(parent, "kcmpwmconfig" ); 40 return new KCMPwmConfig(parent, "kcmpwmconfig" );
39 } 41 }
40} 42}
41 43
42KCMPwmConfig::KCMPwmConfig(QWidget *parent, const char *name ) 44KCMPwmConfig::KCMPwmConfig(QWidget *parent, const char *name )
43 : KCModule( PWMPrefs::instance(), parent, name ) 45 : KCModule( PWMPrefs::instance(), parent, name )
44{ 46{
45 QVBoxLayout *layout = new QVBoxLayout( this ); 47 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
46 mConfigWidget = new PWMConfigWidget( (PWMPrefs*)getPreferences(), this, "mConfigWidget" ); 48 mConfigWidget = new PWMConfigWidget( (PWMPrefs*)getPreferences(), this, "mConfigWidget" );
47 layout->addWidget( mConfigWidget ); 49 layout->addWidget( mConfigWidget );
48 layout->setSpacing( 0 ); 50 layout->setSpacing( 0 );
49 layout->setMargin( 0 ); 51 layout->setMargin( 0 );
50 52
51 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); 53 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) );
52} 54}
53 55
54void KCMPwmConfig::load() 56void KCMPwmConfig::load()
55{ 57{
56 mConfigWidget->readConfig(); 58 mConfigWidget->readConfig();
57} 59}
diff --git a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
index 2c5189c..04771b3 100644
--- a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
+++ b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
@@ -13,64 +13,67 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qframe.h> 25#include <q3frame.h>
26#include <qgroupbox.h> 26#include <q3groupbox.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qtabwidget.h> 29#include <qtabwidget.h>
30#include <qcombobox.h> 30#include <qcombobox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qspinbox.h> 32#include <qspinbox.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qfile.h> 34#include <qfile.h>
35#include <qvbox.h> 35#include <q3vbox.h>
36//Added by qt3to4:
37#include <Q3GridLayout>
38#include <Q3VBoxLayout>
36 39
37#include <kconfig.h> 40#include <kconfig.h>
38#include <kdebug.h> 41#include <kdebug.h>
39#include <kdialog.h> 42#include <kdialog.h>
40#include <klistview.h> 43#include <klistview.h>
41#include <klocale.h> 44#include <klocale.h>
42#include <kglobal.h> 45#include <kglobal.h>
43#include <kmessagebox.h> 46#include <kmessagebox.h>
44#include <kstandarddirs.h> 47#include <kstandarddirs.h>
45#include <kio/kfile/kurlrequester.h> 48#include <kio/kfile/kurlrequester.h>
46 49
47#include "pwmprefs.h" 50#include "pwmprefs.h"
48 51
49#include "pwmconfigwidget.h" 52#include "pwmconfigwidget.h"
50#include "pwmexception.h" 53#include "pwmexception.h"
51 54
52PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *name ) 55PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *name )
53 : KPrefsWidget(prefs, parent, name ) 56 : KPrefsWidget(prefs, parent, name )
54{ 57{
55 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 58 Q3VBoxLayout *topLayout = new Q3VBoxLayout( this, 0,
56 KDialog::spacingHint() ); 59 KDialog::spacingHint() );
57 60
58 QTabWidget *tabWidget = new QTabWidget( this ); 61 QTabWidget *tabWidget = new QTabWidget( this );
59 topLayout->addWidget( tabWidget ); 62 topLayout->addWidget( tabWidget );
60 63
61 // windowsStyle page 64 // windowsStyle page
62 ////////////////////////////////////////////////////// 65 //////////////////////////////////////////////////////
63 QWidget *windowStylePage = new QWidget( this ); 66 QWidget *windowStylePage = new QWidget( this );
64 QGridLayout *windowStyleLayout = new QGridLayout( windowStylePage, 3, 3); 67 Q3GridLayout *windowStyleLayout = new Q3GridLayout( windowStylePage, 3, 3);
65 68
66 int i = 0; 69 int i = 0;
67 KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage); 70 KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage);
68 windowStyle->addRadio(i18n("Category on top")); 71 windowStyle->addRadio(i18n("Category on top"));
69 windowStyle->addRadio(i18n("Category-list left/top")); 72 windowStyle->addRadio(i18n("Category-list left/top"));
70 windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2); 73 windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2);
71 ++i; 74 ++i;
72 75
73 QLabel* lab = new QLabel(i18n("Font for Password entries:"), windowStylePage); 76 QLabel* lab = new QLabel(i18n("Font for Password entries:"), windowStylePage);
74 windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); 77 windowStyleLayout->addMultiCellWidget( lab,i,i,0,2);
75 ++i; 78 ++i;
76 KPrefsWidFont *selEntrFont = 79 KPrefsWidFont *selEntrFont =
@@ -89,25 +92,25 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n
89 &(prefs->mViewFont),windowStylePage); 92 &(prefs->mViewFont),windowStylePage);
90 windowStyleLayout->addWidget(selEntrFont->label(),i,0); 93 windowStyleLayout->addWidget(selEntrFont->label(),i,0);
91 windowStyleLayout->addWidget(selEntrFont->preview(),i,1); 94 windowStyleLayout->addWidget(selEntrFont->preview(),i,1);
92 windowStyleLayout->addWidget(selEntrFont->button(),i,2); 95 windowStyleLayout->addWidget(selEntrFont->button(),i,2);
93 ++i; 96 ++i;
94 97
95 lab = new QLabel(i18n(""), windowStylePage); 98 lab = new QLabel(i18n(""), windowStylePage);
96 windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); 99 windowStyleLayout->addMultiCellWidget( lab,i,i,0,2);
97 100
98 // File page 101 // File page
99 ////////////////////////////////////////////////////// 102 //////////////////////////////////////////////////////
100 QWidget *filePage = new QWidget( this ); 103 QWidget *filePage = new QWidget( this );
101 QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2); 104 Q3GridLayout *fileLayout = new Q3GridLayout( filePage, 3, 2);
102 105
103 i = 0; 106 i = 0;
104 QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage); 107 QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage);
105 fileLayout->addWidget(kcfg_compression_label,i,0); 108 fileLayout->addWidget(kcfg_compression_label,i,0);
106 kcfg_compression = new QComboBox(filePage, "kcfg_compression"); 109 kcfg_compression = new QComboBox(filePage, "kcfg_compression");
107 kcfg_compression->insertItem(i18n("None")); 110 kcfg_compression->insertItem(i18n("None"));
108 kcfg_compression->insertItem(i18n("gzip")); 111 kcfg_compression->insertItem(i18n("gzip"));
109 //US not yet supported: kcfg_compression->insertItem(i18n("bzip2")); 112 //US not yet supported: kcfg_compression->insertItem(i18n("bzip2"));
110 fileLayout->addWidget( kcfg_compression,i,1); 113 fileLayout->addWidget( kcfg_compression,i,1);
111 ++i; 114 ++i;
112 115
113 QLabel* kcfg_crypt_label = new QLabel(i18n("Encryption:"), filePage); 116 QLabel* kcfg_crypt_label = new QLabel(i18n("Encryption:"), filePage);
@@ -145,25 +148,25 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n
145 fileLayout->addWidget(permissionLineLabel,i,0); 148 fileLayout->addWidget(permissionLineLabel,i,0);
146 fileLayout->addWidget(permissionLineEdit,i,1); 149 fileLayout->addWidget(permissionLineEdit,i,1);
147 ++i; 150 ++i;
148 151
149 KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"), 152 KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"),
150 &(prefs->mMakeFileBackup),filePage); 153 &(prefs->mMakeFileBackup),filePage);
151 fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 154 fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
152 ++i; 155 ++i;
153 156
154 // Timeout page 157 // Timeout page
155 ////////////////////////////////////////////////////// 158 //////////////////////////////////////////////////////
156 QWidget *timeoutPage = new QWidget( this ); 159 QWidget *timeoutPage = new QWidget( this );
157 QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2); 160 Q3GridLayout *timeoutLayout = new Q3GridLayout( timeoutPage, 3, 2);
158 161
159 i = 0; 162 i = 0;
160 pwTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "pwTimeoutSpinBox" ); 163 pwTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "pwTimeoutSpinBox" );
161 QLabel* timeoutLabel = new QLabel(pwTimeoutSpinBox, i18n("<b>Password timeout</b> (timeout to hold password in memory,so you don't have to re-enter it,if you already have entered it) [set to 0 to disable]:"), timeoutPage); 164 QLabel* timeoutLabel = new QLabel(pwTimeoutSpinBox, i18n("<b>Password timeout</b> (timeout to hold password in memory,so you don't have to re-enter it,if you already have entered it) [set to 0 to disable]:"), timeoutPage);
162 timeoutLayout->addMultiCellWidget(timeoutLabel, i, i, 0 ,1); 165 timeoutLayout->addMultiCellWidget(timeoutLabel, i, i, 0 ,1);
163 ++i; 166 ++i;
164 timeoutLayout->addMultiCellWidget(pwTimeoutSpinBox,i,i,0,1); 167 timeoutLayout->addMultiCellWidget(pwTimeoutSpinBox,i,i,0,1);
165 ++i; 168 ++i;
166 pwTimeoutSpinBox->setSuffix ( i18n(" sec") ); 169 pwTimeoutSpinBox->setSuffix ( i18n(" sec") );
167 lockTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "lockTimeoutSpinBox" ); 170 lockTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "lockTimeoutSpinBox" );
168 QLabel* lockTimeoutLabel = new QLabel(lockTimeoutSpinBox, i18n("<b>Auto-lock timeout</b> (auto lock document after this\namount of seconds) [set to 0 to disable]:"), timeoutPage); 171 QLabel* lockTimeoutLabel = new QLabel(lockTimeoutSpinBox, i18n("<b>Auto-lock timeout</b> (auto lock document after this\namount of seconds) [set to 0 to disable]:"), timeoutPage);
169 timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,1); 172 timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,1);
@@ -174,65 +177,65 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n
174 177
175 sb = addWidBool(i18n("deep-lock on autolock"), 178 sb = addWidBool(i18n("deep-lock on autolock"),
176 &(prefs->mAutoDeeplock),timeoutPage); 179 &(prefs->mAutoDeeplock),timeoutPage);
177 timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 180 timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
178 ++i; 181 ++i;
179 sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),timeoutPage); 182 sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),timeoutPage);
180 timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 183 timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
181 ++i; 184 ++i;
182 185
183 // Autostart page 186 // Autostart page
184 ////////////////////////////////////////////////////// 187 //////////////////////////////////////////////////////
185 QWidget *autostartPage = new QWidget( this ); 188 QWidget *autostartPage = new QWidget( this );
186 QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2); 189 Q3GridLayout *autostartLayout = new Q3GridLayout( autostartPage, 3, 2);
187 190
188 i = 0; 191 i = 0;
189 192
190 autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit"); 193 autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit");
191 QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage); 194 QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage);
192 autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1); 195 autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1);
193 ++i; 196 ++i;
194 autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1); 197 autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1);
195 ++i; 198 ++i;
196 199
197 sb = addWidBool(i18n("open deeplocked"), 200 sb = addWidBool(i18n("open deeplocked"),
198 &(prefs->mAutostartDeeplocked),autostartPage); 201 &(prefs->mAutostartDeeplocked),autostartPage);
199 autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 202 autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
200 ++i; 203 ++i;
201 204
202 205
203 // external app page 206 // external app page
204 ////////////////////////////////////////////////////// 207 //////////////////////////////////////////////////////
205 QWidget *externalappPage = new QWidget( this ); 208 QWidget *externalappPage = new QWidget( this );
206 QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2); 209 Q3GridLayout *externalappLayout = new Q3GridLayout( externalappPage, 3, 2);
207 210
208 i = 0; 211 i = 0;
209 212
210 browserLineEdit = new QLineEdit(externalappPage); 213 browserLineEdit = new QLineEdit(externalappPage);
211 QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage); 214 QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage);
212 externalappLayout->addWidget(browserLineLabel,i,0); 215 externalappLayout->addWidget(browserLineLabel,i,0);
213 externalappLayout->addWidget(browserLineEdit,i,1); 216 externalappLayout->addWidget(browserLineEdit,i,1);
214 ++i; 217 ++i;
215 218
216 xtermLineEdit = new QLineEdit(externalappPage); 219 xtermLineEdit = new QLineEdit(externalappPage);
217 QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage); 220 QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage);
218 externalappLayout->addWidget(xtermLineLabel,i,0); 221 externalappLayout->addWidget(xtermLineLabel,i,0);
219 externalappLayout->addWidget(xtermLineEdit,i,1); 222 externalappLayout->addWidget(xtermLineEdit,i,1);
220 ++i; 223 ++i;
221 224
222#if 0 225#if 0
223 // miscelaneous page 226 // miscelaneous page
224 ////////////////////////////////////////////////////// 227 //////////////////////////////////////////////////////
225 QWidget *miscPage = new QWidget( this ); 228 QWidget *miscPage = new QWidget( this );
226 QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2); 229 Q3GridLayout *miscLayout = new Q3GridLayout( miscPage, 3, 2);
227 230
228 i = 0; 231 i = 0;
229 232
230 /*US ENH: PWM/Pi has no tray and con be minimized 233 /*US ENH: PWM/Pi has no tray and con be minimized
231 sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage); 234 sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage);
232 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 235 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
233 ++i; 236 ++i;
234 */ 237 */
235 238
236 sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage); 239 sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage);
237 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 240 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
238 ++i; 241 ++i;
@@ -350,16 +353,16 @@ int PWMConfigWidget::getFilePermissions()
350 return ret; 353 return ret;
351} 354}
352 355
353void PWMConfigWidget::setFilePermissions(int perm) 356void PWMConfigWidget::setFilePermissions(int perm)
354{ 357{
355 char tmpBuf[30]; 358 char tmpBuf[30];
356 sprintf(tmpBuf, "%o", perm); 359 sprintf(tmpBuf, "%o", perm);
357 permissionLineEdit->setText(tmpBuf); 360 permissionLineEdit->setText(tmpBuf);
358} 361}
359 362
360 363
361 364
362#ifndef PWM_EMBEDDED 365#ifndef PWM_EMBEDDED_
363#include "pwmconfigwidget.moc" 366#include "moc_pwmconfigwidget.cpp"
364#endif //PWM_EMBEDDED 367#endif //PWM_EMBEDDED
365 368
diff --git a/pwmanager/pwmanager/listobjselectwnd.cpp b/pwmanager/pwmanager/listobjselectwnd.cpp
index 59729f1..7da7e95 100644
--- a/pwmanager/pwmanager/listobjselectwnd.cpp
+++ b/pwmanager/pwmanager/listobjselectwnd.cpp
@@ -11,50 +11,53 @@
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "listobjselectwnd.h" 20#include "listobjselectwnd.h"
21 21
22#include <klocale.h> 22#include <klocale.h>
23//Added by qt3to4:
24#include <QResizeEvent>
25#include <QLabel>
23 26
24 27
25ListObjSelectWnd::ListObjSelectWnd(const QString &caption, const QString &titleText, 28ListObjSelectWnd::ListObjSelectWnd(const QString &caption, const QString &titleText,
26 QWidget *parent, bool multiSel, const char *name, 29 QWidget *parent, bool multiSel, const char *name,
27 bool modal, WFlags f) 30 bool modal, Qt::WFlags f)
28 : QDialog(parent, name, modal, f) 31 : QDialog(parent, name, modal, f)
29{ 32{
30 vbox1 = new QVBox(this); 33 vbox1 = new Q3VBox(this);
31 title = new QLabel(vbox1); 34 title = new QLabel(vbox1);
32 list = new QListBox(vbox1); 35 list = new Q3ListBox(vbox1);
33 if (multiSel) { 36 if (multiSel) {
34 hbox2 = new QHBox(vbox1); 37 hbox2 = new Q3HBox(vbox1);
35 selAllButton = new QPushButton(i18n("&Select all"), hbox2); 38 selAllButton = new QPushButton(i18n("&Select all"), hbox2);
36 unselAllButton = new QPushButton(i18n("&Unselect all"), hbox2); 39 unselAllButton = new QPushButton(i18n("&Unselect all"), hbox2);
37 } 40 }
38 hbox1 = new QHBox(vbox1); 41 hbox1 = new Q3HBox(vbox1);
39 okButton = new QPushButton(i18n("&Ok"), hbox1); 42 okButton = new QPushButton(i18n("&Ok"), hbox1);
40 cancelButton = new QPushButton(i18n("&Cancel"), hbox1); 43 cancelButton = new QPushButton(i18n("&Cancel"), hbox1);
41 44
42 vbox1->setSpacing(10); 45 vbox1->setSpacing(10);
43 vbox1->setMargin(10); 46 vbox1->setMargin(10);
44 hbox1->setSpacing(10); 47 hbox1->setSpacing(10);
45 resize(250, 300); 48 resize(250, 300);
46 setCaption(caption); 49 setCaption(caption);
47 if (multiSel) { 50 if (multiSel) {
48 list->setSelectionMode(QListBox::Multi); 51 list->setSelectionMode(Q3ListBox::Multi);
49 } 52 }
50 53
51 title->setAlignment(Qt::AlignHCenter | Qt::WordBreak); 54 title->setAlignment(Qt::AlignHCenter | Qt::WordBreak);
52 title->setText(titleText); 55 title->setText(titleText);
53 56
54 connect(okButton, SIGNAL(clicked()), 57 connect(okButton, SIGNAL(clicked()),
55 this, SLOT(okButton_slot())); 58 this, SLOT(okButton_slot()));
56 connect(cancelButton, SIGNAL(clicked()), 59 connect(cancelButton, SIGNAL(clicked()),
57 this, SLOT(cancelButton_slot())); 60 this, SLOT(cancelButton_slot()));
58 if (multiSel) { 61 if (multiSel) {
59 connect(selAllButton, SIGNAL(clicked()), 62 connect(selAllButton, SIGNAL(clicked()),
60 this, SLOT(selAllButton_slot())); 63 this, SLOT(selAllButton_slot()));
@@ -117,15 +120,15 @@ QStringList ListObjSelectWnd::getSelectedList()
117#endif 120#endif
118 } 121 }
119 } 122 }
120 return ret; 123 return ret;
121} 124}
122 125
123void ListObjSelectWnd::setList(const QStringList &_list) 126void ListObjSelectWnd::setList(const QStringList &_list)
124{ 127{
125 list->clear(); 128 list->clear();
126 list->insertStringList(_list); 129 list->insertStringList(_list);
127} 130}
128 131
129#ifndef PWM_EMBEDDED 132#ifndef PWM_EMBEDDED_
130#include "listobjselectwnd.moc" 133#include "moc_listobjselectwnd.cpp"
131#endif 134#endif
diff --git a/pwmanager/pwmanager/listobjselectwnd.h b/pwmanager/pwmanager/listobjselectwnd.h
index 3b5f1eb..df3da93 100644
--- a/pwmanager/pwmanager/listobjselectwnd.h
+++ b/pwmanager/pwmanager/listobjselectwnd.h
@@ -12,70 +12,72 @@
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef LISTOBJSELECTWND_H 20#ifndef LISTOBJSELECTWND_H
21#define LISTOBJSELECTWND_H 21#define LISTOBJSELECTWND_H
22 22
23#include <qdialog.h> 23#include <qdialog.h>
24#include <qvbox.h> 24#include <q3vbox.h>
25#include <qhbox.h> 25#include <q3hbox.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlistbox.h> 27#include <q3listbox.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qstringlist.h> 29#include <qstringlist.h>
30//Added by qt3to4:
31#include <QResizeEvent>
30 32
31 33
32/** Display a list-window for selection of some objects */ 34/** Display a list-window for selection of some objects */
33class ListObjSelectWnd : public QDialog 35class ListObjSelectWnd : public QDialog
34{ 36{
35 Q_OBJECT 37 Q_OBJECT
36public: 38public:
37 ListObjSelectWnd(const QString &caption, const QString &titleText, 39 ListObjSelectWnd(const QString &caption, const QString &titleText,
38 QWidget *parent = 0, bool multiSel = false, 40 QWidget *parent = 0, bool multiSel = false,
39 const char *name = 0, 41 const char *name = 0,
40 bool modal = FALSE, WFlags f = 0); 42 bool modal = FALSE, Qt::WFlags f = 0);
41 ~ListObjSelectWnd(); 43 ~ListObjSelectWnd();
42 44
43 void setList(const QStringList &_list); 45 void setList(const QStringList &_list);
44 void addObj(const QString &name) 46 void addObj(const QString &name)
45 { list->insertItem(name); } 47 { list->insertItem(name); }
46 void selectObj(const QString &name) 48 void selectObj(const QString &name)
47#ifndef PWM_EMBEDDED 49#ifndef PWM_EMBEDDED
48 { list->setCurrentItem(list->findItem(name, Qt::ExactMatch)); } 50 { list->setCurrentItem(list->findItem(name, Qt::ExactMatch)); }
49#else 51#else
50 { list->setCurrentItem(list->findItem(name)); } 52 { list->setCurrentItem(list->findItem(name)); }
51#endif 53#endif
52 QString getSelected() 54 QString getSelected()
53 { return list->currentText(); } 55 { return list->currentText(); }
54 int getSelectedIndex() 56 int getSelectedIndex()
55#ifndef PWM_EMBEDDED 57#ifndef PWM_EMBEDDED
56 { return list->index(list->selectedItem()); } 58 { return list->index(list->selectedItem()); }
57#else 59#else
58 { return list->currentItem(); } 60 { return list->currentItem(); }
59#endif 61#endif
60 QStringList getSelectedList(); 62 QStringList getSelectedList();
61 void clearObjs() 63 void clearObjs()
62 { list->clear(); } 64 { list->clear(); }
63 65
64protected: 66protected:
65 QVBox *vbox1; 67 Q3VBox *vbox1;
66 QHBox *hbox1; 68 Q3HBox *hbox1;
67 QHBox *hbox2; 69 Q3HBox *hbox2;
68 QLabel *title; 70 QLabel *title;
69 QListBox *list; 71 Q3ListBox *list;
70 QPushButton *okButton; 72 QPushButton *okButton;
71 QPushButton *cancelButton; 73 QPushButton *cancelButton;
72 QPushButton *selAllButton; 74 QPushButton *selAllButton;
73 QPushButton *unselAllButton; 75 QPushButton *unselAllButton;
74 76
75protected: 77protected:
76 void resizeEvent(QResizeEvent *); 78 void resizeEvent(QResizeEvent *);
77 79
78protected slots: 80protected slots:
79 void okButton_slot(); 81 void okButton_slot();
80 void cancelButton_slot(); 82 void cancelButton_slot();
81 void selAllButton_slot(); 83 void selAllButton_slot();
diff --git a/pwmanager/pwmanager/listviewpwm.cpp b/pwmanager/pwmanager/listviewpwm.cpp
index 0df9431..4253ab1 100644
--- a/pwmanager/pwmanager/listviewpwm.cpp
+++ b/pwmanager/pwmanager/listviewpwm.cpp
@@ -14,67 +14,70 @@
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "listviewpwm.h" 20#include "listviewpwm.h"
21#include "pwmexception.h" 21#include "pwmexception.h"
22#include "pwmview.h" 22#include "pwmview.h"
23 23
24#include <qpainter.h> 24#include <qpainter.h>
25#include <qpixmap.h> 25#include <qpixmap.h>
26//Added by qt3to4:
27#include <QEvent>
28#include <QKeyEvent>
26 29
27#include <kiconloader.h> 30#include <kiconloader.h>
28 31
29#ifdef PWM_EMBEDDED 32#ifdef PWM_EMBEDDED
30#include <kglobal.h> 33#include <kglobal.h>
31#endif 34#endif
32 35
33ListViewPwM::ListViewPwM(QWidget *parent, const char *name) 36ListViewPwM::ListViewPwM(QWidget *parent, const char *name)
34 : KListView(parent, name) 37 : KListView(parent, name)
35{ 38{
36 //setResizeMode(QListView::AllColumns); 39 //setResizeMode(QListView::AllColumns);
37 setAllColumnsShowFocus (true ); 40 setAllColumnsShowFocus (true );
38} 41}
39 42
40bool ListViewPwM::event(QEvent *e) 43bool ListViewPwM::event(QEvent *e)
41{ 44{
42 if (e->type() == QEvent::LayoutHint) 45 if (e->type() == QEvent::LayoutRequest)
43 emit layoutChanged(); 46 emit layoutChanged();
44 if (e->type() == QEvent::KeyPress) { 47 if (e->type() == QEvent::KeyPress) {
45 QKeyEvent* ke = (QKeyEvent*) e; 48 QKeyEvent* ke = (QKeyEvent*) e;
46 if ( ke->key() == Qt::Key_Space) { 49 if ( ke->key() == Qt::Key_Space) {
47 emit toggleOverview(); 50 emit toggleOverview();
48 return true; 51 return true;
49 } 52 }
50 if ( ke->key() == Qt::Key_I || ke->key() == Qt::Key_N || ke->key() == Qt::Key_Insert) { 53 if ( ke->key() == Qt::Key_I || ke->key() == Qt::Key_N || ke->key() == Qt::Key_Insert) {
51 emit insertPW(); 54 emit insertPW();
52 return true; 55 return true;
53 } 56 }
54 if ( ke->key() == Qt::Key_Delete || ke->key() == Qt::Key_Backspace) { 57 if ( ke->key() == Qt::Key_Delete || ke->key() == Qt::Key_Backspace) {
55 emit deletePW(); 58 emit deletePW();
56 return true; 59 return true;
57 } 60 }
58 61
59 } 62 }
60 return KListView::event(e); 63 return KListView::event(e);
61} 64}
62 65
63 66
64QPixmap * ListViewItemPwM::onPix = 0; 67QPixmap * ListViewItemPwM::onPix = 0;
65QPixmap * ListViewItemPwM::offPix = 0; 68QPixmap * ListViewItemPwM::offPix = 0;
66 69
67ListViewItemPwM::ListViewItemPwM(QListView *parent) 70ListViewItemPwM::ListViewItemPwM(Q3ListView *parent)
68 : QCheckListItem(parent, "", QCheckListItem::CheckBox) 71 : Q3CheckListItem(parent, "", Q3CheckListItem::CheckBox)
69{ 72{
70 if (!onPix) { 73 if (!onPix) {
71 PWM_ASSERT(!offPix); 74 PWM_ASSERT(!offPix);
72 KIconLoader* picons; 75 KIconLoader* picons;
73#ifndef PWM_EMBEDDED 76#ifndef PWM_EMBEDDED
74 KIconLoader il; 77 KIconLoader il;
75 picons = &il; 78 picons = &il;
76#else 79#else
77 picons = KGlobal::iconLoader(); 80 picons = KGlobal::iconLoader();
78#endif 81#endif
79 82
80 KIconLoader il; 83 KIconLoader il;
@@ -88,42 +91,42 @@ ListViewItemPwM::ListViewItemPwM(QListView *parent)
88 offPix = &offP; 91 offPix = &offP;
89 } 92 }
90} 93}
91 94
92void ListViewItemPwM::paintCell(QPainter *p, const QColorGroup &cg, 95void ListViewItemPwM::paintCell(QPainter *p, const QColorGroup &cg,
93 int column, int width, int align) 96 int column, int width, int align)
94{ 97{
95 // qDebug("ListViewItemPwM::paintCell column=%i", column); 98 // qDebug("ListViewItemPwM::paintCell column=%i", column);
96 if (!p) 99 if (!p)
97 return; 100 return;
98 //US BUG: 101 //US BUG:
99 if (column != COLUMN_DESC) { 102 if (column != COLUMN_DESC) {
100 QCheckListItem::paintCell(p, cg, column, width, align); 103 Q3CheckListItem::paintCell(p, cg, column, width, align);
101 return; 104 return;
102 } 105 }
103 QPixmap *curPix = isOn() ? onPix : offPix; 106 QPixmap *curPix = isOn() ? onPix : offPix;
104 int pixSpace = curPix->width(); 107 int pixSpace = curPix->width();
105 pixSpace += 4; 108 pixSpace += 4;
106#ifndef PWM_EMBEDDED 109#ifndef PWM_EMBEDDED
107 QRect window(p->viewport()); 110 QRect window(p->viewport());
108 // clear the rectangle (we have to clear it first. see QT doc) 111 // clear the rectangle (we have to clear it first. see QT doc)
109 p->eraseRect(0, 0, pixSpace, window.height()); 112 p->eraseRect(0, 0, pixSpace, window.height());
110 // now draw the pixmap 113 // now draw the pixmap
111 int y = (height() - curPix->height()) / 2; 114 int y = (height() - curPix->height()) / 2;
112 p->drawPixmap(1, y, *curPix); 115 p->drawPixmap(1, y, *curPix);
113 window.moveLeft(pixSpace); 116 window.moveLeft(pixSpace);
114 p->setViewport(window); 117 p->setViewport(window);
115#else 118#else
116 p->eraseRect(0, 0, pixSpace, height()); 119 p->eraseRect(0, 0, pixSpace, height());
117 // now draw the pixmap 120 // now draw the pixmap
118 int y = (height() - curPix->height()) / 2; 121 int y = (height() - curPix->height()) / 2;
119 p->drawPixmap(1, y, *curPix); 122 p->drawPixmap(1, y, *curPix);
120 p->translate( pixSpace, 0 ); 123 p->translate( pixSpace, 0 );
121 124
122#endif 125#endif
123 QListViewItem::paintCell(p, cg, column, width - pixSpace, align); 126 Q3ListViewItem::paintCell(p, cg, column, width - pixSpace, align);
124 127
125} 128}
126 129
127#ifndef PWM_EMBEDDED 130#ifndef PWM_EMBEDDED_
128#include "listviewpwm.moc" 131#include "moc_listviewpwm.cpp"
129#endif 132#endif
diff --git a/pwmanager/pwmanager/listviewpwm.h b/pwmanager/pwmanager/listviewpwm.h
index 51008b8..2652939 100644
--- a/pwmanager/pwmanager/listviewpwm.h
+++ b/pwmanager/pwmanager/listviewpwm.h
@@ -12,48 +12,51 @@
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef __LISTVIEW_H 20#ifndef __LISTVIEW_H
21#define __LISTVIEW_H 21#define __LISTVIEW_H
22 22
23#include <klistview.h> 23#include <klistview.h>
24//Added by qt3to4:
25#include <QEvent>
26#include <QPixmap>
24 27
25/** PwManager implementation of the list view. 28/** PwManager implementation of the list view.
26 * Derived from KListView. 29 * Derived from KListView.
27 */ 30 */
28class ListViewPwM : public KListView 31class ListViewPwM : public KListView
29{ 32{
30 Q_OBJECT 33 Q_OBJECT
31public: 34public:
32 ListViewPwM(QWidget *parent = 0, const char *name = 0); 35 ListViewPwM(QWidget *parent = 0, const char *name = 0);
33 36
34signals: 37signals:
35 void layoutChanged(); 38 void layoutChanged();
36 void toggleOverview(); 39 void toggleOverview();
37 void insertPW(); 40 void insertPW();
38 void deletePW( ); 41 void deletePW( );
39 42
40protected: 43protected:
41 virtual bool event(QEvent *e); 44 virtual bool event(QEvent *e);
42}; 45};
43 46
44class ListViewItemPwM : public QCheckListItem 47class ListViewItemPwM : public Q3CheckListItem
45{ 48{
46public: 49public:
47 ListViewItemPwM(QListView *parent); 50 ListViewItemPwM(Q3ListView *parent);
48 51
49protected: 52protected:
50 void paintCell(QPainter *p, const QColorGroup &cg, 53 void paintCell(QPainter *p, const QColorGroup &cg,
51 int column, int width, int align); 54 int column, int width, int align);
52 55
53protected: 56protected:
54 /** pixmap to display for an item with state "on" */ 57 /** pixmap to display for an item with state "on" */
55 static QPixmap *onPix; 58 static QPixmap *onPix;
56 /** pixmap to display for an item with state "off" */ 59 /** pixmap to display for an item with state "off" */
57 static QPixmap *offPix; 60 static QPixmap *offPix;
58}; 61};
59 62
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp
index ee26082..acb0011 100644
--- a/pwmanager/pwmanager/main.cpp
+++ b/pwmanager/pwmanager/main.cpp
@@ -133,24 +133,25 @@ static void addAuthors(KAboutData *aboutData)
133 "tengel@sonic.net"); 133 "tengel@sonic.net");
134 aboutData->addCredit("Wickey", 134 aboutData->addCredit("Wickey",
135 I18N_NOOP("graphics-design in older versions."), 135 I18N_NOOP("graphics-design in older versions."),
136 "wickey@gmx.at"); 136 "wickey@gmx.at");
137 aboutData->addCredit("Ian MacGregor", 137 aboutData->addCredit("Ian MacGregor",
138 I18N_NOOP( 138 I18N_NOOP(
139 "original documentation author.")); 139 "original documentation author."));
140} 140}
141#endif 141#endif
142 142
143int main(int argc, char *argv[]) 143int main(int argc, char *argv[])
144{ 144{
145 if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi");
145 printDebugConfigureInfo(); 146 printDebugConfigureInfo();
146#ifndef PWM_EMBEDDED 147#ifndef PWM_EMBEDDED
147 KAboutData aboutData(PACKAGE_NAME, PROG_NAME, 148 KAboutData aboutData(PACKAGE_NAME, PROG_NAME,
148 PACKAGE_VER, description, KAboutData::License_File, 149 PACKAGE_VER, description, KAboutData::License_File,
149 "(c) 2003, 2004 Michael Buesch and the PwManager Team", 0, 150 "(c) 2003, 2004 Michael Buesch and the PwManager Team", 0,
150 "http://passwordmanager.sourceforge.net/", 151 "http://passwordmanager.sourceforge.net/",
151 "mbuesch@freenet.de"); 152 "mbuesch@freenet.de");
152 addAuthors(&aboutData); 153 addAuthors(&aboutData);
153 154
154 KCmdLineArgs::init(argc, argv, &aboutData); 155 KCmdLineArgs::init(argc, argv, &aboutData);
155 KCmdLineArgs::addCmdLineOptions(options); 156 KCmdLineArgs::addCmdLineOptions(options);
156 157
diff --git a/pwmanager/pwmanager/printtext.h b/pwmanager/pwmanager/printtext.h
index 82e31b0..71bc2e0 100644
--- a/pwmanager/pwmanager/printtext.h
+++ b/pwmanager/pwmanager/printtext.h
@@ -6,25 +6,25 @@
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License version 2 * 7 * it under the terms of the GNU General Public License version 2 *
8 * as published by the Free Software Foundation. * 8 * as published by the Free Software Foundation. *
9 * * 9 * *
10 ***************************************************************************/ 10 ***************************************************************************/
11 11
12#ifndef PRINTTEXT_H 12#ifndef PRINTTEXT_H
13#define PRINTTEXT_H 13#define PRINTTEXT_H
14 14
15#include <kprinter.h> 15#include <kprinter.h>
16 16
17#include <qpainter.h> 17#include <qpainter.h>
18#include <qpaintdevicemetrics.h> 18#include <q3paintdevicemetrics.h>
19#include <qrect.h> 19#include <qrect.h>
20#include <qpoint.h> 20#include <qpoint.h>
21 21
22/** prints text "raw" to a printer */ 22/** prints text "raw" to a printer */
23class PrintText : public KPrinter 23class PrintText : public KPrinter
24{ 24{
25public: 25public:
26 PrintText(); 26 PrintText();
27 ~PrintText(); 27 ~PrintText();
28 28
29 /** begin printing. Call this before drawing to the device! */ 29 /** begin printing. Call this before drawing to the device! */
30 void beginPrint(); 30 void beginPrint();
@@ -33,25 +33,25 @@ public:
33 /** returns a pointer to the paint object */ 33 /** returns a pointer to the paint object */
34 QPainter* getPaint() 34 QPainter* getPaint()
35 { return paint; } 35 { return paint; }
36 /** sets the header-text */ 36 /** sets the header-text */
37 void setHeader(const QString &left, const QString &middle); 37 void setHeader(const QString &left, const QString &middle);
38 /** returns the header-text */ 38 /** returns the header-text */
39 void getHeader(QString *left, QString *middle); 39 void getHeader(QString *left, QString *middle);
40 40
41protected: 41protected:
42 /** painter object */ 42 /** painter object */
43 QPainter *paint; 43 QPainter *paint;
44 /** metrics */ 44 /** metrics */
45 QPaintDeviceMetrics *metrics; 45 Q3PaintDeviceMetrics *metrics;
46 /** left field of header */ 46 /** left field of header */
47 QString headerLeft; 47 QString headerLeft;
48 /** middle field of header */ 48 /** middle field of header */
49 QString headerMiddle; 49 QString headerMiddle;
50 /** right field of header */ 50 /** right field of header */
51 QString headerRight; 51 QString headerRight;
52 /** current Y-Position */ 52 /** current Y-Position */
53 int curYPos; 53 int curYPos;
54 /** text-body rectangle */ 54 /** text-body rectangle */
55 QRect body; 55 QRect body;
56 /** line-spacing */ 56 /** line-spacing */
57 int ls; 57 int ls;
diff --git a/pwmanager/pwmanager/pwgenwnd_emb.cpp b/pwmanager/pwmanager/pwgenwnd_emb.cpp
index 429904c..21e0af4 100644
--- a/pwmanager/pwmanager/pwgenwnd_emb.cpp
+++ b/pwmanager/pwmanager/pwgenwnd_emb.cpp
@@ -17,52 +17,55 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22 22
23$Id$ 23$Id$
24*/ 24*/
25 25
26#include "pwgenwnd_emb.h" 26#include "pwgenwnd_emb.h"
27 27
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qgroupbox.h> 29#include <q3groupbox.h>
30#include <qcheckbox.h> 30#include <qcheckbox.h>
31#include <qlabel.h> 31#include <qlabel.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qspinbox.h> 33#include <qspinbox.h>
34#include <qlayout.h> 34#include <qlayout.h>
35//Added by qt3to4:
36#include <Q3HBoxLayout>
37#include <Q3VBoxLayout>
35 38
36#include "klocale.h" 39#include "klocale.h"
37 40
38/* 41/*
39 * Constructs a pwGenWnd as a child of 'parent', with the 42 * Constructs a pwGenWnd as a child of 'parent', with the
40 * name 'name'. 43 * name 'name'.
41 * 44 *
42 */ 45 */
43pwGenWnd::pwGenWnd( QWidget* parent, const char* name) 46pwGenWnd::pwGenWnd( QWidget* parent, const char* name)
44 : KDialogBase( KDialogBase::Plain, i18n( "Password generator" ), 47 : KDialogBase( KDialogBase::Plain, i18n( "Password generator" ),
45 KDialogBase::Ok | KDialogBase::Cancel, 48 KDialogBase::Ok | KDialogBase::Cancel,
46 KDialogBase::Ok, parent, name, true ) 49 KDialogBase::Ok, parent, name, true )
47{ 50{
48 QWidget *page = plainPage(); 51 QWidget *page = plainPage();
49 QVBoxLayout* pwGenWndLayout = new QVBoxLayout( page, 11, 6, "pwGenWndLayout"); 52 Q3VBoxLayout* pwGenWndLayout = new Q3VBoxLayout( page, 11, 6, "pwGenWndLayout");
50 53
51 QGroupBox* groupBox1 = new QGroupBox( page, "groupBox1" ); 54 Q3GroupBox* groupBox1 = new Q3GroupBox( page, "groupBox1" );
52 groupBox1->setTitle( i18n( "Character set:" ) ); 55 groupBox1->setTitle( i18n( "Character set:" ) );
53 groupBox1->setColumnLayout(0, Qt::Vertical ); 56 groupBox1->setColumnLayout(0, Qt::Vertical );
54 groupBox1->layout()->setSpacing( 6 ); 57 groupBox1->layout()->setSpacing( 6 );
55 groupBox1->layout()->setMargin( 11 ); 58 groupBox1->layout()->setMargin( 11 );
56 QVBoxLayout* groupBox1Layout = new QVBoxLayout( groupBox1->layout() ); 59 Q3VBoxLayout* groupBox1Layout = new Q3VBoxLayout( groupBox1->layout() );
57 groupBox1Layout->setAlignment( Qt::AlignTop ); 60 groupBox1Layout->setAlignment( Qt::AlignTop );
58 61
59 int_charLowerCheckBox = new QCheckBox( i18n("Lowercase (abc)"), groupBox1, "int_charLowerCheckBox" ); 62 int_charLowerCheckBox = new QCheckBox( i18n("Lowercase (abc)"), groupBox1, "int_charLowerCheckBox" );
60 int_charLowerCheckBox->setChecked( TRUE ); 63 int_charLowerCheckBox->setChecked( TRUE );
61 groupBox1Layout->addWidget( int_charLowerCheckBox ); 64 groupBox1Layout->addWidget( int_charLowerCheckBox );
62 65
63 int_charUpperCheckBox = new QCheckBox( i18n("Uppercase (ABC)"), groupBox1, "int_charUpperCheckBox" ); 66 int_charUpperCheckBox = new QCheckBox( i18n("Uppercase (ABC)"), groupBox1, "int_charUpperCheckBox" );
64 int_charUpperCheckBox->setChecked( TRUE ); 67 int_charUpperCheckBox->setChecked( TRUE );
65 groupBox1Layout->addWidget( int_charUpperCheckBox ); 68 groupBox1Layout->addWidget( int_charUpperCheckBox );
66 69
67 70
68 int_charNumCheckBox = new QCheckBox( i18n("Numbers (123)"), groupBox1, "int_charNumCheckBox" ); 71 int_charNumCheckBox = new QCheckBox( i18n("Numbers (123)"), groupBox1, "int_charNumCheckBox" );
@@ -71,37 +74,37 @@ pwGenWnd::pwGenWnd( QWidget* parent, const char* name)
71 74
72 int_charSpecCheckBox = new QCheckBox( i18n("Special characters:"), groupBox1, "int_charSpecCheckBox" ); 75 int_charSpecCheckBox = new QCheckBox( i18n("Special characters:"), groupBox1, "int_charSpecCheckBox" );
73 groupBox1Layout->addWidget( int_charSpecCheckBox ); 76 groupBox1Layout->addWidget( int_charSpecCheckBox );
74 77
75 QLabel* textLabel7 = new QLabel( groupBox1, "textLabel7" ); 78 QLabel* textLabel7 = new QLabel( groupBox1, "textLabel7" );
76 QString st("\x21\x22\xc2\xa7\x24\x25\x26\x2f\x28\x29\x3d\x3f\x2c\x2e\x2d\x3b\x3a\x5f\x2b"); 79 QString st("\x21\x22\xc2\xa7\x24\x25\x26\x2f\x28\x29\x3d\x3f\x2c\x2e\x2d\x3b\x3a\x5f\x2b");
77 textLabel7->setText( st.utf8() ); 80 textLabel7->setText( st.utf8() );
78 groupBox1Layout->addWidget( textLabel7 ); 81 groupBox1Layout->addWidget( textLabel7 );
79 82
80 int_charBlankCheckBox = new QCheckBox( i18n( "Spaces (blank characters)"), groupBox1, "int_charBlankCheckBox" ); 83 int_charBlankCheckBox = new QCheckBox( i18n( "Spaces (blank characters)"), groupBox1, "int_charBlankCheckBox" );
81 groupBox1Layout->addWidget( int_charBlankCheckBox ); 84 groupBox1Layout->addWidget( int_charBlankCheckBox );
82 85
83 QHBoxLayout* layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); 86 Q3HBoxLayout* layout7 = new Q3HBoxLayout( 0, 0, 6, "layout7");
84 87
85 int_charUserCheckBox = new QCheckBox( i18n("User defined:"), groupBox1, "int_charUserCheckBox" ); 88 int_charUserCheckBox = new QCheckBox( i18n("User defined:"), groupBox1, "int_charUserCheckBox" );
86 layout7->addWidget( int_charUserCheckBox ); 89 layout7->addWidget( int_charUserCheckBox );
87 90
88 int_userDefLineEdit = new QLineEdit( groupBox1, "int_userDefLineEdit" ); 91 int_userDefLineEdit = new QLineEdit( groupBox1, "int_userDefLineEdit" );
89 int_userDefLineEdit->setEnabled( FALSE ); 92 int_userDefLineEdit->setEnabled( FALSE );
90 layout7->addWidget( int_userDefLineEdit ); 93 layout7->addWidget( int_userDefLineEdit );
91 groupBox1Layout->addLayout( layout7 ); 94 groupBox1Layout->addLayout( layout7 );
92 pwGenWndLayout->addWidget( groupBox1 ); 95 pwGenWndLayout->addWidget( groupBox1 );
93 96
94 97
95 QHBoxLayout* layout8 = new QHBoxLayout( 0, 0, 6, "layout8"); 98 Q3HBoxLayout* layout8 = new Q3HBoxLayout( 0, 0, 6, "layout8");
96 99
97 int_lenSpinBox = new QSpinBox( page, "int_lenSpinBox" ); 100 int_lenSpinBox = new QSpinBox( page, "int_lenSpinBox" );
98 QLabel* textLabel2 = new QLabel( int_lenSpinBox, i18n("Password Length:"), page, "textLabel2" ); 101 QLabel* textLabel2 = new QLabel( int_lenSpinBox, i18n("Password Length:"), page, "textLabel2" );
99 layout8->addWidget( textLabel2 ); 102 layout8->addWidget( textLabel2 );
100 103
101 int_lenSpinBox->setMaxValue( 9999 ); 104 int_lenSpinBox->setMaxValue( 9999 );
102 int_lenSpinBox->setMinValue( 1 ); 105 int_lenSpinBox->setMinValue( 1 );
103 int_lenSpinBox->setValue( 8 ); 106 int_lenSpinBox->setValue( 8 );
104 layout8->addWidget( int_lenSpinBox ); 107 layout8->addWidget( int_lenSpinBox );
105 pwGenWndLayout->addLayout( layout8 ); 108 pwGenWndLayout->addLayout( layout8 );
106 109
107 int_filterCheckBox = new QCheckBox( i18n( "Enable Filtering to get better passwords" ), page, "int_filterCheckBox" ); 110 int_filterCheckBox = new QCheckBox( i18n( "Enable Filtering to get better passwords" ), page, "int_filterCheckBox" );
diff --git a/pwmanager/pwmanager/pwgenwndimpl.cpp b/pwmanager/pwmanager/pwgenwndimpl.cpp
index 5313060..0eb7043 100644
--- a/pwmanager/pwmanager/pwgenwndimpl.cpp
+++ b/pwmanager/pwmanager/pwgenwndimpl.cpp
@@ -25,25 +25,25 @@
25#include <qspinbox.h> 25#include <qspinbox.h>
26#include <qcheckbox.h> 26#include <qcheckbox.h>
27#include <qlineedit.h> 27#include <qlineedit.h>
28 28
29#include <klocale.h> 29#include <klocale.h>
30#include <kmessagebox.h> 30#include <kmessagebox.h>
31 31
32 32
33#ifndef PWM_EMBEDDED 33#ifndef PWM_EMBEDDED
34PwGenWndImpl::PwGenWndImpl(QWidget *parent, 34PwGenWndImpl::PwGenWndImpl(QWidget *parent,
35 const char *name, 35 const char *name,
36 bool modal, 36 bool modal,
37 WFlags fl) 37 Qt::WFlags fl)
38 : pwGenWnd(parent, name, modal, fl) 38 : pwGenWnd(parent, name, modal, fl)
39{ 39{
40} 40}
41 41
42#else 42#else
43PwGenWndImpl::PwGenWndImpl( QWidget* parent, const char* name) 43PwGenWndImpl::PwGenWndImpl( QWidget* parent, const char* name)
44 : pwGenWnd( parent, name) 44 : pwGenWnd( parent, name)
45{ 45{
46} 46}
47#endif 47#endif
48 48
49PwGenWndImpl::~PwGenWndImpl() 49PwGenWndImpl::~PwGenWndImpl()
diff --git a/pwmanager/pwmanager/pwgenwndimpl.h b/pwmanager/pwmanager/pwgenwndimpl.h
index 994ff2f..1e706a1 100644
--- a/pwmanager/pwmanager/pwgenwndimpl.h
+++ b/pwmanager/pwmanager/pwgenwndimpl.h
@@ -24,25 +24,25 @@
24#include "pwgenwnd.h" 24#include "pwgenwnd.h"
25#else 25#else
26#include "pwgenwnd_emb.h" 26#include "pwgenwnd_emb.h"
27#endif 27#endif
28 28
29class PwGenWndImpl : public pwGenWnd 29class PwGenWndImpl : public pwGenWnd
30{ 30{
31public: 31public:
32#ifndef PWM_EMBEDDED 32#ifndef PWM_EMBEDDED
33 PwGenWndImpl(QWidget *parent = 0, 33 PwGenWndImpl(QWidget *parent = 0,
34 const char *name = 0, 34 const char *name = 0,
35 bool modal = FALSE, 35 bool modal = FALSE,
36 WFlags fl = 0); 36 Qt::WFlags fl = 0);
37#else 37#else
38 PwGenWndImpl( QWidget* parent = 0, const char* name = 0); 38 PwGenWndImpl( QWidget* parent = 0, const char* name = 0);
39#endif 39#endif
40 40
41 ~PwGenWndImpl(); 41 ~PwGenWndImpl();
42 42
43 /** returns the generated password */ 43 /** returns the generated password */
44 QString getPassword(); 44 QString getPassword();
45 45
46protected slots: 46protected slots:
47 /** generate button pressed */ 47 /** generate button pressed */
48 void genButton_slot(); 48 void genButton_slot();
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp
index 8373850..694fb13 100644
--- a/pwmanager/pwmanager/pwm.cpp
+++ b/pwmanager/pwmanager/pwm.cpp
@@ -16,24 +16,30 @@
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include <klocale.h> 20#include <klocale.h>
21#include <klistview.h> 21#include <klistview.h>
22#include <ktoolbar.h> 22#include <ktoolbar.h>
23#include <kfiledialog.h> 23#include <kfiledialog.h>
24#include <kiconloader.h> 24#include <kiconloader.h>
25#include <kmessagebox.h> 25#include <kmessagebox.h>
26 26
27#include <qstatusbar.h> 27#include <qstatusbar.h>
28#include <QDesktopWidget>
29//Added by qt3to4:
30#include <Q3ValueList>
31#include <QHideEvent>
32#include <QFocusEvent>
33#include <QCloseEvent>
28 34
29#ifndef PWM_EMBEDDED 35#ifndef PWM_EMBEDDED
30#include <kmenubar.h> 36#include <kmenubar.h>
31#include <kstatusbar.h> 37#include <kstatusbar.h>
32#include <dcopclient.h> 38#include <dcopclient.h>
33#include "configwndimpl.h" 39#include "configwndimpl.h"
34#include "configuration.h" 40#include "configuration.h"
35#else 41#else
36#include <qmenubar.h> 42#include <qmenubar.h>
37#include <qmessagebox.h> 43#include <qmessagebox.h>
38#include <pwmprefs.h> 44#include <pwmprefs.h>
39#include <kpimglobalprefs.h> 45#include <kpimglobalprefs.h>
@@ -177,25 +183,25 @@ PwM::PwM(PwMInit *_init, PwMDoc *doc,
177 , forceQuit (false) 183 , forceQuit (false)
178 , forceMinimizeToTray (false) 184 , forceMinimizeToTray (false)
179{ 185{
180 syncManager = 0; 186 syncManager = 0;
181 virgin = !virginity; 187 virgin = !virginity;
182 init = _init; 188 init = _init;
183 connect(doc, SIGNAL(docClosed(PwMDoc *)), 189 connect(doc, SIGNAL(docClosed(PwMDoc *)),
184 this, SLOT(docClosed(PwMDoc *))); 190 this, SLOT(docClosed(PwMDoc *)));
185 initMenubar(); 191 initMenubar();
186 initToolbar(); 192 initToolbar();
187 initMetrics(); 193 initMetrics();
188 setVirgin(virginity); 194 setVirgin(virginity);
189 setFocusPolicy(QWidget::WheelFocus); 195 setFocusPolicy(Qt::WheelFocus);
190#ifndef PWM_EMBEDDED 196#ifndef PWM_EMBEDDED
191 statusBar()->show(); 197 statusBar()->show();
192#endif 198#endif
193 view = makeNewListView(doc); 199 view = makeNewListView(doc);
194 setCentralWidget(view); 200 setCentralWidget(view);
195 updateCaption(); 201 updateCaption();
196 showStatMsg(i18n("Ready.")); 202 showStatMsg(i18n("Ready."));
197} 203}
198 204
199PwM::~PwM() 205PwM::~PwM()
200{ 206{
201 //qDebug("PwM::~PwM() %x", this); 207 //qDebug("PwM::~PwM() %x", this);
@@ -231,161 +237,161 @@ void PwM::initMenubar()
231#endif 237#endif
232 filePopup = new KPopupMenu(this); 238 filePopup = new KPopupMenu(this);
233 importPopup = new KPopupMenu(filePopup); 239 importPopup = new KPopupMenu(filePopup);
234 exportPopup = new KPopupMenu(filePopup); 240 exportPopup = new KPopupMenu(filePopup);
235 managePopup = new KPopupMenu(this); 241 managePopup = new KPopupMenu(this);
236#ifdef CONFIG_KEYCARD 242#ifdef CONFIG_KEYCARD
237 chipcardPopup = new KPopupMenu(this); 243 chipcardPopup = new KPopupMenu(this);
238#endif // CONFIG_KEYCARD 244#endif // CONFIG_KEYCARD
239 viewPopup = new KPopupMenu(this); 245 viewPopup = new KPopupMenu(this);
240 optionsPopup = new KPopupMenu(this); 246 optionsPopup = new KPopupMenu(this);
241 247
242// "file" popup menu 248// "file" popup menu
243 filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), 249 filePopup->insertItem(QIcon(picons->loadIcon("filenew", KIcon::Small)),
244 i18n("&New"), this, 250 i18n("&New"), this,
245 SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW); 251 SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW);
246 filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)), 252 filePopup->insertItem(QIcon(picons->loadIcon("fileopen", KIcon::Small)),
247 i18n("&Open"), this, 253 i18n("&Open"), this,
248 SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN); 254 SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN);
249 filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)), 255 filePopup->insertItem(QIcon(picons->loadIcon("fileclose", KIcon::Small)),
250 i18n("&Close"), this, 256 i18n("&Close"), this,
251 SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE); 257 SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE);
252 filePopup->insertSeparator(); 258 filePopup->insertSeparator();
253 filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)), 259 filePopup->insertItem(QIcon(picons->loadIcon("filesave", KIcon::Small)),
254 i18n("&Save"), this, 260 i18n("&Save"), this,
255 SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE); 261 SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE);
256 filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)), 262 filePopup->insertItem(QIcon(picons->loadIcon("filesaveas", KIcon::Small)),
257 i18n("Save &as..."), 263 i18n("Save &as..."),
258 this, SLOT(saveAs_slot()), 0, 264 this, SLOT(saveAs_slot()), 0,
259 BUTTON_POPUP_FILE_SAVEAS); 265 BUTTON_POPUP_FILE_SAVEAS);
260 filePopup->insertSeparator(); 266 filePopup->insertSeparator();
261 // "file/export" popup menu 267 // "file/export" popup menu
262 exportPopup->insertItem(i18n("&Text-file..."), this, 268 exportPopup->insertItem(i18n("&Text-file..."), this,
263 SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT); 269 SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT);
264 exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, 270 exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this,
265 SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN); 271 SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN);
266 exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, 272 exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this,
267 SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV); 273 SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV);
268#ifdef CONFIG_KWALLETIF 274#ifdef CONFIG_KWALLETIF
269 exportPopup->insertItem(i18n("&KWallet..."), this, 275 exportPopup->insertItem(i18n("&KWallet..."), this,
270 SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET); 276 SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET);
271#endif 277#endif
272 filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)), 278 filePopup->insertItem(QIcon(picons->loadIcon("fileexport", KIcon::Small)),
273 i18n("E&xport"), exportPopup, 279 i18n("E&xport"), exportPopup,
274 BUTTON_POPUP_FILE_EXPORT); 280 BUTTON_POPUP_FILE_EXPORT);
275 // "file/import" popup menu 281 // "file/import" popup menu
276 importPopup->insertItem(i18n("&Text-file..."), this, 282 importPopup->insertItem(i18n("&Text-file..."), this,
277 SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT); 283 SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT);
278 importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, 284 importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this,
279 SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN); 285 SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN);
280 importPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, 286 importPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this,
281 SLOT(importCsv()), 0, BUTTON_POPUP_IMPORT_CSV); 287 SLOT(importCsv()), 0, BUTTON_POPUP_IMPORT_CSV);
282#ifdef CONFIG_KWALLETIF 288#ifdef CONFIG_KWALLETIF
283 importPopup->insertItem(i18n("&KWallet..."), this, 289 importPopup->insertItem(i18n("&KWallet..."), this,
284 SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET); 290 SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET);
285#endif 291#endif
286 filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)), 292 filePopup->insertItem(QIcon(picons->loadIcon("fileimport", KIcon::Small)),
287 i18n("I&mport"), importPopup, 293 i18n("I&mport"), importPopup,
288 BUTTON_POPUP_FILE_IMPORT); 294 BUTTON_POPUP_FILE_IMPORT);
289 filePopup->insertSeparator(); 295 filePopup->insertSeparator();
290#if 0 296#if 0
291 filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)), 297 filePopup->insertItem(QIcon(picons->loadIcon("fileprint", KIcon::Small)),
292 i18n("&Print..."), this, 298 i18n("&Print..."), this,
293 SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT); 299 SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT);
294 filePopup->insertSeparator(); 300 filePopup->insertSeparator();
295#endif 301#endif
296 filePopup->insertItem(QIconSet(picons->loadIcon("exit", KIcon::Small)), 302 filePopup->insertItem(QIcon(picons->loadIcon("exit", KIcon::Small)),
297 i18n("&Quit"), this, 303 i18n("&Quit"), this,
298 SLOT(quitButton_slot()), 0, BUTTON_POPUP_FILE_QUIT); 304 SLOT(quitButton_slot()), 0, BUTTON_POPUP_FILE_QUIT);
299 menuBar()->insertItem(i18n("&File"), filePopup); 305 menuBar()->insertItem(i18n("&File"), filePopup);
300// "manage" popup menu 306// "manage" popup menu
301 managePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)), 307 managePopup->insertItem(QIcon(picons->loadIcon("pencil", KIcon::Small)),
302 i18n("&Add password"), this, 308 i18n("&Add password"), this,
303 SLOT(addPwd_slot()), 0, 309 SLOT(addPwd_slot()), 0,
304 BUTTON_POPUP_MANAGE_ADD); 310 BUTTON_POPUP_MANAGE_ADD);
305 managePopup->insertSeparator(); 311 managePopup->insertSeparator();
306 managePopup->insertItem(QIconSet(picons->loadIcon("edit", KIcon::Small)), 312 managePopup->insertItem(QIcon(picons->loadIcon("edit", KIcon::Small)),
307 i18n("&Edit"), this, SLOT(editPwd_slot()), 0, 313 i18n("&Edit"), this, SLOT(editPwd_slot()), 0,
308 BUTTON_POPUP_MANAGE_EDIT); 314 BUTTON_POPUP_MANAGE_EDIT);
309 managePopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), 315 managePopup->insertItem(QIcon(picons->loadIcon("editdelete", KIcon::Small)),
310 i18n("&Delete"), this, SLOT(deletePwd_slot()), 316 i18n("&Delete"), this, SLOT(deletePwd_slot()),
311 0, BUTTON_POPUP_MANAGE_DEL); 317 0, BUTTON_POPUP_MANAGE_DEL);
312 managePopup->insertSeparator(); 318 managePopup->insertSeparator();
313 managePopup->insertItem(QIconSet(picons->loadIcon("rotate", KIcon::Small)), 319 managePopup->insertItem(QIcon(picons->loadIcon("rotate", KIcon::Small)),
314 i18n("Change &Master Password"), this, 320 i18n("Change &Master Password"), this,
315 SLOT(changeMasterPwd_slot()), 0, 321 SLOT(changeMasterPwd_slot()), 0,
316 BUTTON_POPUP_MANAGE_CHANGEMP); 322 BUTTON_POPUP_MANAGE_CHANGEMP);
317 menuBar()->insertItem(i18n("&Manage"), managePopup); 323 menuBar()->insertItem(i18n("&Manage"), managePopup);
318// "chipcard" popup menu 324// "chipcard" popup menu
319#ifdef CONFIG_KEYCARD 325#ifdef CONFIG_KEYCARD
320 chipcardPopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), 326 chipcardPopup->insertItem(QIcon(picons->loadIcon("filenew", KIcon::Small)),
321 i18n("&Generate new key-card"), this, 327 i18n("&Generate new key-card"), this,
322 SLOT(genNewCard_slot()), 0, 328 SLOT(genNewCard_slot()), 0,
323 BUTTON_POPUP_CHIPCARD_GENNEW); 329 BUTTON_POPUP_CHIPCARD_GENNEW);
324 chipcardPopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), 330 chipcardPopup->insertItem(QIcon(picons->loadIcon("editdelete", KIcon::Small)),
325 i18n("&Erase key-card"), this, 331 i18n("&Erase key-card"), this,
326 SLOT(eraseCard_slot()), 0, 332 SLOT(eraseCard_slot()), 0,
327 BUTTON_POPUP_CHIPCARD_DEL); 333 BUTTON_POPUP_CHIPCARD_DEL);
328 chipcardPopup->insertItem(QIconSet(picons->loadIcon("", KIcon::Small)), 334 chipcardPopup->insertItem(QIcon(picons->loadIcon("", KIcon::Small)),
329 i18n("Read card-&ID"), this, 335 i18n("Read card-&ID"), this,
330 SLOT(readCardId_slot()), 0, 336 SLOT(readCardId_slot()), 0,
331 BUTTON_POPUP_CHIPCARD_READID); 337 BUTTON_POPUP_CHIPCARD_READID);
332 chipcardPopup->insertSeparator(); 338 chipcardPopup->insertSeparator();
333 chipcardPopup->insertItem(QIconSet(picons->loadIcon("2rightarrow", KIcon::Small)), 339 chipcardPopup->insertItem(QIcon(picons->loadIcon("2rightarrow", KIcon::Small)),
334 i18n("&Make card backup-image"), this, 340 i18n("&Make card backup-image"), this,
335 SLOT(makeCardBackup_slot()), 0, 341 SLOT(makeCardBackup_slot()), 0,
336 BUTTON_POPUP_CHIPCARD_SAVEBACKUP); 342 BUTTON_POPUP_CHIPCARD_SAVEBACKUP);
337 chipcardPopup->insertItem(QIconSet(picons->loadIcon("2leftarrow", KIcon::Small)), 343 chipcardPopup->insertItem(QIcon(picons->loadIcon("2leftarrow", KIcon::Small)),
338 i18n("&Replay card backup-image"), this, 344 i18n("&Replay card backup-image"), this,
339 SLOT(replayCardBackup_slot()), 0, 345 SLOT(replayCardBackup_slot()), 0,
340 BUTTON_POPUP_CHIPCARD_REPLAYBACKUP); 346 BUTTON_POPUP_CHIPCARD_REPLAYBACKUP);
341 menuBar()->insertItem(i18n("&Chipcard manager"), chipcardPopup); 347 menuBar()->insertItem(i18n("&Chipcard manager"), chipcardPopup);
342#endif // CONFIG_KEYCARD 348#endif // CONFIG_KEYCARD
343// "view" popup menu 349// "view" popup menu
344 viewPopup->insertItem(QIconSet(picons->loadIcon("find", KIcon::Small)), 350 viewPopup->insertItem(QIcon(picons->loadIcon("find", KIcon::Small)),
345 i18n("&Find"), this, 351 i18n("&Find"), this,
346 SLOT(find_slot()), 0, BUTTON_POPUP_VIEW_FIND); 352 SLOT(find_slot()), 0, BUTTON_POPUP_VIEW_FIND);
347 viewPopup->insertSeparator(); 353 viewPopup->insertSeparator();
348 viewPopup->insertItem(QIconSet(picons->loadIcon("halfencrypted", KIcon::Small)), 354 viewPopup->insertItem(QIcon(picons->loadIcon("halfencrypted", KIcon::Small)),
349 i18n("&Lock all entries"), this, 355 i18n("&Lock all entries"), this,
350 SLOT(lockWnd_slot()), 0, 356 SLOT(lockWnd_slot()), 0,
351 BUTTON_POPUP_VIEW_LOCK); 357 BUTTON_POPUP_VIEW_LOCK);
352 viewPopup->insertItem(QIconSet(picons->loadIcon("encrypted", KIcon::Small)), 358 viewPopup->insertItem(QIcon(picons->loadIcon("encrypted", KIcon::Small)),
353 i18n("&Deep-lock all entries"), this, 359 i18n("&Deep-lock all entries"), this,
354 SLOT(deepLockWnd_slot()), 0, 360 SLOT(deepLockWnd_slot()), 0,
355 BUTTON_POPUP_VIEW_DEEPLOCK); 361 BUTTON_POPUP_VIEW_DEEPLOCK);
356 viewPopup->insertItem(QIconSet(picons->loadIcon("decrypted", KIcon::Small)), 362 viewPopup->insertItem(QIcon(picons->loadIcon("decrypted", KIcon::Small)),
357 i18n("&Unlock all entries"), this, 363 i18n("&Unlock all entries"), this,
358 SLOT(unlockWnd_slot()), 0, 364 SLOT(unlockWnd_slot()), 0,
359 BUTTON_POPUP_VIEW_UNLOCK); 365 BUTTON_POPUP_VIEW_UNLOCK);
360 menuBar()->insertItem(i18n("&View"), viewPopup); 366 menuBar()->insertItem(i18n("&View"), viewPopup);
361// "options" popup menu 367// "options" popup menu
362 optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), 368 optionsPopup->insertItem(QIcon(picons->loadIcon("configure", KIcon::Small)),
363 i18n("&Configure PwM/Pi..."), this, 369 i18n("&Configure PwM/Pi..."), this,
364 SLOT(config_slot()),0, 370 SLOT(config_slot()),0,
365 BUTTON_POPUP_OPTIONS_CONFIG); 371 BUTTON_POPUP_OPTIONS_CONFIG);
366 optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), 372 optionsPopup->insertItem(QIcon(picons->loadIcon("configure", KIcon::Small)),
367 i18n("Global Settings..."), this, 373 i18n("Global Settings..."), this,
368 SLOT(config_global_slot()),0, 374 SLOT(config_global_slot()),0,
369 BUTTON_POPUP_OPTIONS_GLOBAL_CONFIG); 375 BUTTON_POPUP_OPTIONS_GLOBAL_CONFIG);
370 if ( QApplication::desktop()->width() <= 240 ) { 376 if ( QApplication::desktop()->width() <= 240 ) {
371 managePopup->insertSeparator(); 377 managePopup->insertSeparator();
372 managePopup->insertItem(i18n("&Options"), optionsPopup); 378 managePopup->insertItem(i18n("&Options"), optionsPopup);
373 } else 379 } else
374 menuBar()->insertItem(i18n("&Options"), optionsPopup); 380 menuBar()->insertItem(i18n("&Options"), optionsPopup);
375// "help" popup menu 381// "help" popup menu
376#ifndef PWM_EMBEDDED 382#ifndef PWM_EMBEDDED
377 helpPopup = helpMenu(QString::null, false); 383 helpPopup = helpMenu(QString::null, false);
378#else 384#else
379 optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), 385 optionsPopup->insertItem(QIcon(picons->loadIcon("configure", KIcon::Small)),
380 i18n("C&ategories..."), this, 386 i18n("C&ategories..."), this,
381 SLOT(category_slot()),0, 387 SLOT(category_slot()),0,
382 BUTTON_POPUP_OPTIONS_CATEGORY); 388 BUTTON_POPUP_OPTIONS_CATEGORY);
383 389
384 390
385 menuBar()->insertItem(i18n("&Sync"), syncPopup); 391 menuBar()->insertItem(i18n("&Sync"), syncPopup);
386 392
387 393
388 394
389 395
390 396
391 helpPopup = new KPopupMenu(this); 397 helpPopup = new KPopupMenu(this);
@@ -913,30 +919,30 @@ void PwM::config_slot()
913 vector<PwMDocList::listItem>::const_iterator i = dl->begin(), 919 vector<PwMDocList::listItem>::const_iterator i = dl->begin(),
914 end = dl->end(); 920 end = dl->end();
915 PwMDoc *doc; 921 PwMDoc *doc;
916 while (i != end) { 922 while (i != end) {
917 doc = (*i).doc; 923 doc = (*i).doc;
918 // unlock-without-mpw timeout 924 // unlock-without-mpw timeout
919 doc->timer()->start(DocTimer::id_mpwTimer); 925 doc->timer()->start(DocTimer::id_mpwTimer);
920 // auto-lock timeout 926 // auto-lock timeout
921 doc->timer()->start(DocTimer::id_autoLockTimer); 927 doc->timer()->start(DocTimer::id_autoLockTimer);
922 ++i; 928 ++i;
923 } 929 }
924 930
925 const QValueList<PwM *> *ml = init->mainWndList(); 931 const Q3ValueList<PwM *> *ml = init->mainWndList();
926#ifndef PWM_EMBEDDED 932#ifndef PWM_EMBEDDED
927 QValueList<PwM *>::const_iterator i2 = ml->begin(), 933 Q3ValueList<PwM *>::const_iterator i2 = ml->begin(),
928 end2 = ml->end(); 934 end2 = ml->end();
929#else 935#else
930 QValueList<PwM *>::ConstIterator i2 = ml->begin(), 936 Q3ValueList<PwM *>::ConstIterator i2 = ml->begin(),
931 end2 = ml->end(); 937 end2 = ml->end();
932#endif 938#endif
933 PwM *pwm; 939 PwM *pwm;
934 while (i2 != end2) { 940 while (i2 != end2) {
935 pwm = *i2; 941 pwm = *i2;
936 // reinitialize the window style. 942 // reinitialize the window style.
937 if (oldStyle != newStyle) 943 if (oldStyle != newStyle)
938 pwm->curView()->initStyle(newStyle); 944 pwm->curView()->initStyle(newStyle);
939 // set the new font 945 // set the new font
940 pwm->curView()->setFont(conf()->confGlobEntryFont()); 946 pwm->curView()->setFont(conf()->confGlobEntryFont());
941 ++i2; 947 ++i2;
942 } 948 }
@@ -1585,15 +1591,15 @@ bool PwM::sync(KSyncManager* manager, QString filename, int mode,QString resourc
1585} 1591}
1586 1592
1587void PwM::removeSyncInfo( QString syncProfile) 1593void PwM::removeSyncInfo( QString syncProfile)
1588{ 1594{
1589 qDebug("PWM:removeSyncInfo for profile %s ", syncProfile.latin1()); 1595 qDebug("PWM:removeSyncInfo for profile %s ", syncProfile.latin1());
1590 curDoc()->removeSyncInfo( syncProfile ); 1596 curDoc()->removeSyncInfo( syncProfile );
1591 //US curDoc()->removeSyncInfo sets the dirtyFlag. 1597 //US curDoc()->removeSyncInfo sets the dirtyFlag.
1592} 1598}
1593 1599
1594#endif 1600#endif
1595 1601
1596 1602
1597#ifndef PWM_EMBEDDED 1603#ifndef PWM_EMBEDDED_
1598#include "pwm.moc" 1604#include "moc_pwm.cpp"
1599#endif 1605#endif
diff --git a/pwmanager/pwmanager/pwm.h b/pwmanager/pwmanager/pwm.h
index c4bbb4e..450d13f 100644
--- a/pwmanager/pwmanager/pwm.h
+++ b/pwmanager/pwmanager/pwm.h
@@ -27,41 +27,46 @@
27 27
28#ifndef PWM_EMBEDDED 28#ifndef PWM_EMBEDDED
29#include <kwin.h> 29#include <kwin.h>
30#include <kapp.h> 30#include <kapp.h>
31#include <kdeversion.h> 31#include <kdeversion.h>
32#else 32#else
33#include <ksyncmanager.h> 33#include <ksyncmanager.h>
34#endif 34#endif
35 35
36#include <kaction.h> 36#include <kaction.h>
37 37
38#include <qglobal.h> 38#include <qglobal.h>
39//Added by qt3to4:
40#include <QCloseEvent>
41#include <QFocusEvent>
42#include <Q3PopupMenu>
43#include <QHideEvent>
39 44
40#include "pwmview.h" 45#include "pwmview.h"
41#include "pwmexception.h" 46#include "pwmexception.h"
42 47
43 48
44/** timeout for displaying a message on the status-bar (in seconds) */ 49/** timeout for displaying a message on the status-bar (in seconds) */
45 #define STATUSBAR_MSG_TIMEOUT5 50 #define STATUSBAR_MSG_TIMEOUT5
46 51
47 52
48class PwMInit; 53class PwMInit;
49class KSyncManager; 54class KSyncManager;
50 55
51/** PwM is the base class of the project */ 56/** PwM is the base class of the project */
52#ifndef PWM_EMBEDDED 57#ifndef PWM_EMBEDDED
53//MOC_SKIP_BEGIN 58#ifndef Q_MOC_RUN
54class PwM : public KMainWindow 59class PwM : public KMainWindow
55//MOC_SKIP_END 60#endif
56#else 61#else
57class PwM : public KMainWindow, public KSyncInterface 62class PwM : public KMainWindow, public KSyncInterface
58#endif 63#endif
59{ 64{
60 Q_OBJECT 65 Q_OBJECT
61public: 66public:
62 friend class PwMView; 67 friend class PwMView;
63 /** construtor */ 68 /** construtor */
64 PwM(PwMInit *_init, PwMDoc *doc, 69 PwM(PwMInit *_init, PwMDoc *doc,
65 bool virginity = true, 70 bool virginity = true,
66 QWidget* parent = 0, const char *name = 0); 71 QWidget* parent = 0, const char *name = 0);
67 /** destructor */ 72 /** destructor */
@@ -275,25 +280,25 @@ protected:
275 280
276 281
277 282
278 283
279 private: 284 private:
280#ifdef PWM_EMBEDDED 285#ifdef PWM_EMBEDDED
281 //this are the overwritten callbackmethods from the syncinterface 286 //this are the overwritten callbackmethods from the syncinterface
282 virtual bool sync(KSyncManager* manager, QString filename, int mode,QString resource); 287 virtual bool sync(KSyncManager* manager, QString filename, int mode,QString resource);
283 virtual void removeSyncInfo( QString syncProfile); 288 virtual void removeSyncInfo( QString syncProfile);
284 289
285 // LR ******************************* 290 // LR *******************************
286 // sync stuff! 291 // sync stuff!
287 QPopupMenu *syncPopup; 292 Q3PopupMenu *syncPopup;
288 KSyncManager* syncManager; 293 KSyncManager* syncManager;
289#endif 294#endif
290 295
291 296
292 297
293 298
294 299
295 300
296 301
297 302
298}; 303};
299 304
diff --git a/pwmanager/pwmanager/pwmanager.pro b/pwmanager/pwmanager/pwmanager.pro
index 7efe45c..d6d8dbe 100644
--- a/pwmanager/pwmanager/pwmanager.pro
+++ b/pwmanager/pwmanager/pwmanager.pro
@@ -2,26 +2,26 @@ TEMPLATE = app
2 CONFIG += qt warn_off 2 CONFIG += qt warn_off
3DESTDIR= ../../bin 3DESTDIR= ../../bin
4 TARGET = pwmpi 4 TARGET = pwmpi
5include( ../../variables.pri ) 5include( ../../variables.pri )
6 6
7INCLUDEPATH += . ../../ ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils ../libcrypt/crypt ../libcrypt/error ../libcrypt/zlib 7INCLUDEPATH += . ../../ ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils ../libcrypt/crypt ../libcrypt/error ../libcrypt/zlib
8DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION 8DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION
9 9
10#enable this setting if you want debugoutput for pwmanager 10#enable this setting if you want debugoutput for pwmanager
11#DEFINES += CONFIG_DEBUG 11#DEFINES += CONFIG_DEBUG
12LIBS += -L../libcrypt/ 12LIBS += -L../libcrypt/
13LIBS += -L../../bin/ 13LIBS += -L../../bin/
14LIBS += -lmicrokde 14LIBS += -lxmicrokde
15LIBS += -lmicrokdepim 15LIBS += -lxmicrokdepim
16LIBS += -lzlib 16LIBS += -lzlib
17LIBS += -lkpmicrocipher 17LIBS += -lkpmicrocipher
18LIBS += -lkpmicroerror 18LIBS += -lkpmicroerror
19LIBS += -lkpmicrompi 19LIBS += -lkpmicrompi
20LIBS += -lstdc++ 20LIBS += -lstdc++
21 21
22unix:{ 22unix:{
23OBJECTS_DIR = obj/unix 23OBJECTS_DIR = obj/unix
24MOC_DIR = moc/unix 24MOC_DIR = moc/unix
25 25
26} 26}
27win32:{ 27win32:{
@@ -166,12 +166,14 @@ randomizer.cpp \
166rc2.cpp \ 166rc2.cpp \
167rencatwnd.cpp \ 167rencatwnd.cpp \
168serializer.cpp \ 168serializer.cpp \
169setmasterpwwnd_emb.cpp \ 169setmasterpwwnd_emb.cpp \
170setmasterpwwndimpl.cpp \ 170setmasterpwwndimpl.cpp \
171sha1.cpp \ 171sha1.cpp \
172waitwnd.cpp \ 172waitwnd.cpp \
173kcmconfigs/kcmpwmconfig.cpp \ 173kcmconfigs/kcmpwmconfig.cpp \
174kcmconfigs/pwmconfigwidget.cpp 174kcmconfigs/pwmconfigwidget.cpp
175 175
176 176
177 177
178#The following line was inserted by qt3to4
179QT += xml qt3support
diff --git a/pwmanager/pwmanager/pwmanagerE.pro b/pwmanager/pwmanager/pwmanagerE.pro
index 6b68514..e80d1ae 100644
--- a/pwmanager/pwmanager/pwmanagerE.pro
+++ b/pwmanager/pwmanager/pwmanagerE.pro
@@ -5,27 +5,27 @@ CONFIG += qt warn_on
5 TARGET = pwmpi 5 TARGET = pwmpi
6OBJECTS_DIR = obj/$(PLATFORM) 6OBJECTS_DIR = obj/$(PLATFORM)
7MOC_DIR = moc/$(PLATFORM) 7MOC_DIR = moc/$(PLATFORM)
8DESTDIR=$(QPEDIR)/bin 8DESTDIR=$(QPEDIR)/bin
9 9
10INCLUDEPATH += . ../../ ../../qtcompat ../../qtcompat/xml ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils ../libcrypt/crypt ../libcrypt/error $(QPEDIR)/include 10INCLUDEPATH += . ../../ ../../qtcompat ../../qtcompat/xml ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils ../libcrypt/crypt ../libcrypt/error $(QPEDIR)/include
11DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY 11DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY
12 12
13#enable this setting if you want debugoutput for pwmanager 13#enable this setting if you want debugoutput for pwmanager
14#DEFINES += CONFIG_DEBUG 14#DEFINES += CONFIG_DEBUG
15 15
16LIBS += -L../libcrypt/$(PLATFORM) 16LIBS += -L../libcrypt/$(PLATFORM)
17LIBS += -lmicrokde 17LIBS += -lxmicrokde
18LIBS += -lmicroqtcompat 18LIBS += -lmicroqtcompat
19LIBS += -lmicrokdepim 19LIBS += -lxmicrokdepim
20LIBS += -L$(QPEDIR)/lib 20LIBS += -L$(QPEDIR)/lib
21LIBS += -lqpe 21LIBS += -lqpe
22LIBS += -lzlib 22LIBS += -lzlib
23#LIBS += -lbz2 23#LIBS += -lbz2
24#LIBS += -lkpmicrogcrypt 24#LIBS += -lkpmicrogcrypt
25LIBS += -ljpeg 25LIBS += -ljpeg
26LIBS += $(QTOPIALIB) 26LIBS += $(QTOPIALIB)
27LIBS += -lkpmicrocipher 27LIBS += -lkpmicrocipher
28LIBS += -lkpmicroerror 28LIBS += -lkpmicroerror
29LIBS += -lkpmicrompi 29LIBS += -lkpmicrompi
30LIBS += -lstdc++ 30LIBS += -lstdc++
31LIBS += $(GCC3EXTRALIB1) 31LIBS += $(GCC3EXTRALIB1)
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp
index b58d7e2..9213360 100644
--- a/pwmanager/pwmanager/pwmdoc.cpp
+++ b/pwmanager/pwmanager/pwmdoc.cpp
@@ -39,24 +39,25 @@
39#include <kglobalsettings.h> 39#include <kglobalsettings.h>
40#include <libkcal/syncdefines.h> 40#include <libkcal/syncdefines.h>
41 41
42 42
43#ifdef CONFIG_KWALLETIF 43#ifdef CONFIG_KWALLETIF
44# include "kwalletemu.h" 44# include "kwalletemu.h"
45#endif // CONFIG_KWALLETIF 45#endif // CONFIG_KWALLETIF
46 46
47#include <qdatetime.h> 47#include <qdatetime.h>
48#include <qsize.h> 48#include <qsize.h>
49#include <qfileinfo.h> 49#include <qfileinfo.h>
50#include <qfile.h> 50#include <qfile.h>
51#include <QDesktopWidget>
51 52
52#include <stdio.h> 53#include <stdio.h>
53#include <stdlib.h> 54#include <stdlib.h>
54#include <errno.h> 55#include <errno.h>
55#include <string.h> 56#include <string.h>
56//US#include <iostream> 57//US#include <iostream>
57#include <algorithm> 58#include <algorithm>
58#include <sys/types.h> 59#include <sys/types.h>
59#include <sys/stat.h> 60#include <sys/stat.h>
60#ifndef _WIN32_ 61#ifndef _WIN32_
61#include <unistd.h> 62#include <unistd.h>
62#include <stdint.h> 63#include <stdint.h>
@@ -472,35 +473,36 @@ PwMerror PwMDoc::saveDoc(char compress, const QString *file)
472 } 473 }
473 } 474 }
474 } 475 }
475 if (QFile::exists(filename)) { 476 if (QFile::exists(filename)) {
476 /* Move the existing file to some tmp file. 477 /* Move the existing file to some tmp file.
477 * When saving file succeeds, delete tmp file. Otherwise 478 * When saving file succeeds, delete tmp file. Otherwise
478 * move tmp file back. See below. 479 * move tmp file back. See below.
479 */ 480 */
480 Randomizer *rnd = Randomizer::obj(); 481 Randomizer *rnd = Randomizer::obj();
481 char rnd_buf[5]; 482 char rnd_buf[5];
482 sprintf(rnd_buf, "%X%X%X%X", rnd->genRndChar() & 0xFF, rnd->genRndChar() & 0xFF, 483 sprintf(rnd_buf, "%X%X%X%X", rnd->genRndChar() & 0xFF, rnd->genRndChar() & 0xFF,
483 rnd->genRndChar() & 0xFF, rnd->genRndChar() & 0xFF); 484 rnd->genRndChar() & 0xFF, rnd->genRndChar() & 0xFF);
484 tmpFileMoved = filename + "." + rnd_buf + ".mv"; 485 tmpFileMoved = filename; tmpFileMoved += '.';
486 tmpFileMoved += rnd_buf; tmpFileMoved += ".mv";
485 if (!copyFile(filename, tmpFileMoved)) 487 if (!copyFile(filename, tmpFileMoved))
486 return e_openFile; 488 return e_openFile;
487 if (!QFile::remove(filename)) { 489 if (!QFile::remove(filename)) {
488 printWarn(string("removing orig file ") 490 printWarn(string("removing orig file ")
489 + filename.latin1() 491 + filename.latin1()
490 + " failed!"); 492 + " failed!");
491 } 493 }
492 } 494 }
493 f.setName(filename); 495 f.setName(filename);
494 if (!f.open(IO_ReadWrite)) { 496 if (!f.open(QIODevice::ReadWrite)) {
495 ret = e_openFile; 497 ret = e_openFile;
496 goto out_moveback; 498 goto out_moveback;
497 } 499 }
498 e = writeFileHeader(hashAlgo, hashAlgo, 500 e = writeFileHeader(hashAlgo, hashAlgo,
499 cryptAlgo, compress, 501 cryptAlgo, compress,
500 &currentPw, &f); 502 &currentPw, &f);
501 if (e == e_hashNotImpl) { 503 if (e == e_hashNotImpl) {
502 printDebug("PwMDoc::saveDoc(): writeFileHeader() failed: e_hashNotImpl"); 504 printDebug("PwMDoc::saveDoc(): writeFileHeader() failed: e_hashNotImpl");
503 f.close(); 505 f.close();
504 ret = e_hashNotImpl; 506 ret = e_hashNotImpl;
505 goto out_moveback; 507 goto out_moveback;
506 } else if (e != e_success) { 508 } else if (e != e_success) {
@@ -625,25 +627,25 @@ PwMerror PwMDoc::openDoc(const QString *file, int openLocked)
625 } 627 }
626 QFile f(filename); 628 QFile f(filename);
627 629
628 if (openLocked == 2) { 630 if (openLocked == 2) {
629 // open deep-locked 631 // open deep-locked
630 if (!QFile::exists(filename)) 632 if (!QFile::exists(filename))
631 return e_openFile; 633 return e_openFile;
632 if (deepLock(true, false) != e_success) 634 if (deepLock(true, false) != e_success)
633 return e_openFile; 635 return e_openFile;
634 goto out_success; 636 goto out_success;
635 } 637 }
636 638
637 if (!f.open(IO_ReadOnly)) 639 if (!f.open(QIODevice::ReadOnly))
638 return e_openFile; 640 return e_openFile;
639 641
640 ret = checkHeader(&cryptAlgo, &currentPw, &compress, &headerLen, 642 ret = checkHeader(&cryptAlgo, &currentPw, &compress, &headerLen,
641 &dataHashType, &dataHash, &f); 643 &dataHashType, &dataHash, &f);
642 if (ret != e_success) { 644 if (ret != e_success) {
643 printDebug("PwMDoc::openDoc(): checkHeader() failed"); 645 printDebug("PwMDoc::openDoc(): checkHeader() failed");
644 f.close(); 646 f.close();
645 if (ret == e_wrongPw) { 647 if (ret == e_wrongPw) {
646 wrongMpwMsgBox(getDocStatFlag(DOC_STAT_USE_CHIPCARD)); 648 wrongMpwMsgBox(getDocStatFlag(DOC_STAT_USE_CHIPCARD));
647 return ret; 649 return ret;
648 } else if (ret == e_noPw || 650 } else if (ret == e_noPw ||
649 ret == e_fileVer || 651 ret == e_fileVer ||
@@ -994,28 +996,28 @@ bool PwMDoc::backupFile(const QString &filePath)
994} 996}
995 997
996bool PwMDoc::copyFile(const QString &src, const QString &dst) 998bool PwMDoc::copyFile(const QString &src, const QString &dst)
997{ 999{
998 QFileInfo fi(src); 1000 QFileInfo fi(src);
999 if (!fi.exists()) 1001 if (!fi.exists())
1000 return false; 1002 return false;
1001 if (QFile::exists(dst)) { 1003 if (QFile::exists(dst)) {
1002 if (!QFile::remove(dst)) 1004 if (!QFile::remove(dst))
1003 return false; 1005 return false;
1004 } 1006 }
1005 QFile srcFd(src); 1007 QFile srcFd(src);
1006 if (!srcFd.open(IO_ReadOnly)) 1008 if (!srcFd.open(QIODevice::ReadOnly))
1007 return false; 1009 return false;
1008 QFile dstFd(dst); 1010 QFile dstFd(dst);
1009 if (!dstFd.open(IO_ReadWrite)) { 1011 if (!dstFd.open(QIODevice::ReadWrite)) {
1010 srcFd.close(); 1012 srcFd.close();
1011 return false; 1013 return false;
1012 } 1014 }
1013 const int tmpBuf_size = 512; 1015 const int tmpBuf_size = 512;
1014 char tmpBuf[tmpBuf_size]; 1016 char tmpBuf[tmpBuf_size];
1015 Q_LONG bytesRead, bytesWritten; 1017 Q_LONG bytesRead, bytesWritten;
1016 1018
1017 while (!srcFd.atEnd()) { 1019 while (!srcFd.atEnd()) {
1018 bytesRead = srcFd.readBlock(tmpBuf, 1020 bytesRead = srcFd.readBlock(tmpBuf,
1019 static_cast<Q_ULONG>(tmpBuf_size)); 1021 static_cast<Q_ULONG>(tmpBuf_size));
1020 if (bytesRead == -1) { 1022 if (bytesRead == -1) {
1021 srcFd.close(); 1023 srcFd.close();
@@ -1476,25 +1478,25 @@ PwMerror PwMDoc::encrypt(string *d, const QString *pw, QFile *f, char algo,
1476 return e_success; 1478 return e_success;
1477} 1479}
1478 1480
1479PwMerror PwMDoc::decrypt(string *d, unsigned int pos, const QString *pw, 1481PwMerror PwMDoc::decrypt(string *d, unsigned int pos, const QString *pw,
1480 char algo, 1482 char algo,
1481 char hashalgo, //US BUG: pass _hashalgo because we need it in hashPassphrase 1483 char hashalgo, //US BUG: pass _hashalgo because we need it in hashPassphrase
1482 QFile *f) 1484 QFile *f)
1483{ 1485{
1484 PWM_ASSERT(d); 1486 PWM_ASSERT(d);
1485 PWM_ASSERT(pw); 1487 PWM_ASSERT(pw);
1486 PWM_ASSERT(f); 1488 PWM_ASSERT(f);
1487 1489
1488 unsigned int cryptLen = f->size() - pos; 1490 size_t cryptLen = f->size() - pos;
1489 byte *encrypted = new byte[cryptLen]; 1491 byte *encrypted = new byte[cryptLen];
1490 byte *decrypted = new byte[cryptLen]; 1492 byte *decrypted = new byte[cryptLen];
1491 1493
1492 f->at(pos); 1494 f->at(pos);
1493#ifndef PWM_EMBEDDED 1495#ifndef PWM_EMBEDDED
1494 if (f->readBlock(reinterpret_cast<char *>(encrypted), 1496 if (f->readBlock(reinterpret_cast<char *>(encrypted),
1495 static_cast<Q_ULONG>(cryptLen)) 1497 static_cast<Q_ULONG>(cryptLen))
1496 != static_cast<Q_LONG>(cryptLen)) { 1498 != static_cast<Q_LONG>(cryptLen)) {
1497 delete [] encrypted; 1499 delete [] encrypted;
1498 delete [] decrypted; 1500 delete [] decrypted;
1499 return e_readFile; 1501 return e_readFile;
1500 } 1502 }
@@ -1516,27 +1518,27 @@ PwMerror PwMDoc::decrypt(string *d, unsigned int pos, const QString *pw,
1516 } 1518 }
1517 case PWM_CRYPT_AES128: 1519 case PWM_CRYPT_AES128:
1518 /*... fall through */ 1520 /*... fall through */
1519 case PWM_CRYPT_AES192: 1521 case PWM_CRYPT_AES192:
1520 case PWM_CRYPT_AES256: 1522 case PWM_CRYPT_AES256:
1521 case PWM_CRYPT_3DES: 1523 case PWM_CRYPT_3DES:
1522 case PWM_CRYPT_TWOFISH: 1524 case PWM_CRYPT_TWOFISH:
1523 case PWM_CRYPT_TWOFISH128: { 1525 case PWM_CRYPT_TWOFISH128: {
1524 if (!LibGCryptIf::available()) 1526 if (!LibGCryptIf::available())
1525 return e_cryptNotImpl; 1527 return e_cryptNotImpl;
1526 LibGCryptIf gc; 1528 LibGCryptIf gc;
1527 PwMerror err; 1529 PwMerror err;
1528 err = gc.decrypt(&decrypted, 1530 err = gc.decrypt((unsigned char **)&decrypted,
1529 &cryptLen, 1531 &cryptLen,
1530 encrypted, 1532 (unsigned char*)encrypted,
1531 cryptLen, 1533 cryptLen,
1532 reinterpret_cast<const unsigned char *>(pw->latin1()), 1534 reinterpret_cast<const unsigned char *>(pw->latin1()),
1533 pw->length(), 1535 pw->length(),
1534 algo, 1536 algo,
1535 hashalgo //US BUG: pass _hashalgo because we need it in hashPassphrase 1537 hashalgo //US BUG: pass _hashalgo because we need it in hashPassphrase
1536); 1538);
1537 if (err != e_success) { 1539 if (err != e_success) {
1538 delete [] encrypted; 1540 delete [] encrypted;
1539 delete [] decrypted; 1541 delete [] decrypted;
1540 return e_cryptNotImpl; 1542 return e_cryptNotImpl;
1541 } 1543 }
1542 break; 1544 break;
@@ -2424,25 +2426,25 @@ bool PwMDoc::goToURL(unsigned int category, unsigned int entryIndex)
2424 return true; 2426 return true;
2425 return false; 2427 return false;
2426} 2428}
2427 2429
2428PwMerror PwMDoc::exportToText(const QString *file) 2430PwMerror PwMDoc::exportToText(const QString *file)
2429{ 2431{
2430 PWM_ASSERT(file); 2432 PWM_ASSERT(file);
2431 if (QFile::exists(*file)) { 2433 if (QFile::exists(*file)) {
2432 if (!QFile::remove(*file)) 2434 if (!QFile::remove(*file))
2433 return e_accessFile; 2435 return e_accessFile;
2434 } 2436 }
2435 QFile f(*file); 2437 QFile f(*file);
2436 if (!f.open(IO_ReadWrite)) 2438 if (!f.open(QIODevice::ReadWrite))
2437 return e_openFile; 2439 return e_openFile;
2438 2440
2439 if (!unlockAll_tempoary()) { 2441 if (!unlockAll_tempoary()) {
2440 f.close(); 2442 f.close();
2441 return e_lock; 2443 return e_lock;
2442 } 2444 }
2443 2445
2444 // write header 2446 // write header
2445 string header = i18n("Password table generated by\nPwM v").latin1(); 2447 string header = i18n("Password table generated by\nPwM v").latin1();
2446 header += PACKAGE_VER; 2448 header += PACKAGE_VER;
2447 header += i18n("\non ").latin1(); 2449 header += i18n("\non ").latin1();
2448 QDate currDate = QDate::currentDate(); 2450 QDate currDate = QDate::currentDate();
@@ -2698,25 +2700,25 @@ PwMerror PwMDoc::importText_PwM(const QString *file)
2698 formatError: 2700 formatError:
2699 free(ch_tmp); 2701 free(ch_tmp);
2700 fclose(f); 2702 fclose(f);
2701 return e_fileFormat; 2703 return e_fileFormat;
2702#else 2704#else
2703 PWM_ASSERT(file); 2705 PWM_ASSERT(file);
2704 QFile f(file->latin1()); 2706 QFile f(file->latin1());
2705 int tmp; 2707 int tmp;
2706 ssize_t ret; 2708 ssize_t ret;
2707 string curCat; 2709 string curCat;
2708 unsigned int entriesRead = 0; 2710 unsigned int entriesRead = 0;
2709 PwMDataItem currItem; 2711 PwMDataItem currItem;
2710 bool res = f.open(IO_ReadOnly); 2712 bool res = f.open(QIODevice::ReadOnly);
2711 if (res == false) 2713 if (res == false)
2712 return e_openFile; 2714 return e_openFile;
2713 2715
2714 unsigned int ch_tmp_size = 1024; 2716 unsigned int ch_tmp_size = 1024;
2715 char *ch_tmp = (char*)malloc(ch_tmp_size); 2717 char *ch_tmp = (char*)malloc(ch_tmp_size);
2716 if (!ch_tmp) { 2718 if (!ch_tmp) {
2717 f.close(); 2719 f.close();
2718 return e_outOfMem; 2720 return e_outOfMem;
2719 } 2721 }
2720 2722
2721 // - check header 2723 // - check header
2722 if (f.readLine(ch_tmp, ch_tmp_size) == -1) // skip first line. 2724 if (f.readLine(ch_tmp, ch_tmp_size) == -1) // skip first line.
@@ -3620,15 +3622,15 @@ QStringList PwMDoc::getIDEntryList()
3620 ++entrI; 3622 ++entrI;
3621 } 3623 }
3622 ++catcounter; 3624 ++catcounter;
3623 } 3625 }
3624 3626
3625 return results; 3627 return results;
3626} 3628}
3627 3629
3628 3630
3629 3631
3630 3632
3631 3633
3632#ifndef PWM_EMBEDDED 3634#ifndef PWM_EMBEDDED_
3633#include "pwmdoc.moc" 3635#include "moc_pwmdoc.cpp"
3634#endif 3636#endif
diff --git a/pwmanager/pwmanager/pwmdoc.h b/pwmanager/pwmanager/pwmdoc.h
index 144831f..07c97a9 100644
--- a/pwmanager/pwmanager/pwmdoc.h
+++ b/pwmanager/pwmanager/pwmdoc.h
@@ -203,40 +203,40 @@ struct PwMDataItem
203 comment = ""; 203 comment = "";
204 url = ""; 204 url = "";
205 launcher = ""; 205 launcher = "";
206 lockStat = true; 206 lockStat = true;
207 listViewPos = -1; 207 listViewPos = -1;
208 binary = false; 208 binary = false;
209 if (clearMeta) 209 if (clearMeta)
210 meta.clear(); 210 meta.clear();
211 } 211 }
212 //US ENH: we need this operator to compare two items if we have no unique ids 212 //US ENH: we need this operator to compare two items if we have no unique ids
213 //available. Generaly this happens before the first sync 213 //available. Generaly this happens before the first sync
214 214
215 bool PwMDataItem::operator==( const PwMDataItem &a ) const 215 bool operator==( const PwMDataItem &a ) const
216 { 216 {
217 //qDebug("oper==%s", a.desc.c_str()); 217 //qDebug("oper==%s", a.desc.c_str());
218 if ( desc != a.desc ) return false; 218 if ( desc != a.desc ) return false;
219 if ( name != a.name ) return false; 219 if ( name != a.name ) return false;
220 if ( pw != a.pw ) return false; 220 if ( pw != a.pw ) return false;
221 if ( comment != a.comment ) return false; 221 if ( comment != a.comment ) return false;
222 if ( url != a.url ) return false; 222 if ( url != a.url ) return false;
223 if ( launcher != a.launcher ) return false; 223 if ( launcher != a.launcher ) return false;
224 //all other field will not be checked. 224 //all other field will not be checked.
225 return true; 225 return true;
226 } 226 }
227 227
228 //US ENH: this sync method actually copies all values from the parameter like the =operator 228 //US ENH: this sync method actually copies all values from the parameter like the =operator
229 //does with two exceptions: listViewPos will not be changed, and the launcher only if required. 229 //does with two exceptions: listViewPos will not be changed, and the launcher only if required.
230 bool PwMDataItem::syncItem(const PwMDataItem &a, bool syncLauncher=true ) 230 bool syncItem(const PwMDataItem &a, bool syncLauncher=true )
231 { 231 {
232 desc = a.desc; 232 desc = a.desc;
233 name = a.name; 233 name = a.name;
234 pw = a.pw; 234 pw = a.pw;
235 comment = a.comment; 235 comment = a.comment;
236 url = a.url; 236 url = a.url;
237 if (syncLauncher == true) 237 if (syncLauncher == true)
238 launcher = a.launcher; 238 launcher = a.launcher;
239 meta = a.meta; 239 meta = a.meta;
240 binary = a.binary; 240 binary = a.binary;
241 lockStat = a.lockStat; 241 lockStat = a.lockStat;
242 rev = a.rev; 242 rev = a.rev;
diff --git a/pwmanager/pwmanager/pwmdocui.cpp b/pwmanager/pwmanager/pwmdocui.cpp
index a9916c2..ea96509 100644
--- a/pwmanager/pwmanager/pwmdocui.cpp
+++ b/pwmanager/pwmanager/pwmdocui.cpp
@@ -456,15 +456,15 @@ QString PwMDocUi::string_deepLockedLong()
456 "That means all data has been encrypted\n" 456 "That means all data has been encrypted\n"
457 "and written out to the file. If you want\n" 457 "and written out to the file. If you want\n"
458 "to see the entries, please UNLOCK the file.\n" 458 "to see the entries, please UNLOCK the file.\n"
459 "While unlocking, you will be prompted for the\n" 459 "While unlocking, you will be prompted for the\n"
460 "master-password or the key-card."); 460 "master-password or the key-card.");
461} 461}
462 462
463QString PwMDocUi::string_defaultTitle() 463QString PwMDocUi::string_defaultTitle()
464{ 464{
465 return i18n("Untitled"); 465 return i18n("Untitled");
466} 466}
467 467
468#ifndef PWM_EMBEDDED 468#ifndef PWM_EMBEDDED_
469#include "pwmdocui.moc" 469#include "moc_pwmdocui.cpp"
470#endif 470#endif
diff --git a/pwmanager/pwmanager/pwminit.cpp b/pwmanager/pwmanager/pwminit.cpp
index d59d4d8..15e21ee 100644
--- a/pwmanager/pwmanager/pwminit.cpp
+++ b/pwmanager/pwmanager/pwminit.cpp
@@ -11,24 +11,26 @@
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "pwminit.h" 20#include "pwminit.h"
21#include "randomizer.h" 21#include "randomizer.h"
22#include <qdir.h> 22#include <qdir.h>
23//Added by qt3to4:
24#include <Q3ValueList>
23 25
24#ifndef PWM_EMBEDDED 26#ifndef PWM_EMBEDDED
25#include "selftest.h" 27#include "selftest.h"
26#include "configuration.h" 28#include "configuration.h"
27#else 29#else
28#include "pwmprefs.h" 30#include "pwmprefs.h"
29#endif 31#endif
30 32
31#include "pwm.h" 33#include "pwm.h"
32#include "pwmexception.h" 34#include "pwmexception.h"
33#include "pwmtray.h" 35#include "pwmtray.h"
34#include "pwmdoc.h" 36#include "pwmdoc.h"
@@ -83,30 +85,30 @@ PwMInit::PwMInit(PwMApplication *_app)
83 , _tray (0) 85 , _tray (0)
84{ 86{
85 sig_init_pointer = this; 87 sig_init_pointer = this;
86 app = _app; 88 app = _app;
87} 89}
88 90
89PwMInit::~PwMInit() 91PwMInit::~PwMInit()
90{ 92{
91 //qDebug("PwMInit::~PwMInit() "); 93 //qDebug("PwMInit::~PwMInit() ");
92#ifndef PWM_EMBEDDED 94#ifndef PWM_EMBEDDED
93 SelfTest::cancel(); 95 SelfTest::cancel();
94 // close all open mainwnds 96 // close all open mainwnds
95 QValueList<PwM *>::iterator i = _mainWndList.begin(), 97 Q3ValueList<PwM *>::iterator i = _mainWndList.begin(),
96 end = _mainWndList.end(); 98 end = _mainWndList.end();
97 99
98#else 100#else
99 // close all open mainwnds 101 // close all open mainwnds
100 QValueList<PwM *>::Iterator i = _mainWndList.begin(), 102 Q3ValueList<PwM *>::Iterator i = _mainWndList.begin(),
101 end = _mainWndList.end(); 103 end = _mainWndList.end();
102#endif 104#endif
103 while (i != end) { 105 while (i != end) {
104 disconnect(*i, SIGNAL(closed(PwM *)), 106 disconnect(*i, SIGNAL(closed(PwM *)),
105 this, SLOT(mainWndClosed(PwM *))); 107 this, SLOT(mainWndClosed(PwM *)));
106 delete *i; 108 delete *i;
107 ++i; 109 ++i;
108 } 110 }
109 _mainWndList.clear(); 111 _mainWndList.clear();
110 // close all remaining open documents 112 // close all remaining open documents
111 PwMDocList *_dl = PwMDoc::getOpenDocList(); 113 PwMDocList *_dl = PwMDoc::getOpenDocList();
112 vector<PwMDocList::listItem> dl = *(_dl->getList()); 114 vector<PwMDocList::listItem> dl = *(_dl->getList());
@@ -417,29 +419,29 @@ again:
417 } else if (doDeleteDoc) { 419 } else if (doDeleteDoc) {
418 //qDebug("doDeleteDoc "); 420 //qDebug("doDeleteDoc ");
419 if (!wnd->curDoc()->tryDelete()) { 421 if (!wnd->curDoc()->tryDelete()) {
420 /* We failed deleting the doc, 422 /* We failed deleting the doc,
421 * so open a new window with it, again. 423 * so open a new window with it, again.
422 */ 424 */
423 createMainWnd(QString::null, false, 425 createMainWnd(QString::null, false,
424 false, wnd->curDoc()); 426 false, wnd->curDoc());
425 } 427 }
426 } 428 }
427#ifndef PWM_EMBEDDED 429#ifndef PWM_EMBEDDED
428 // find the closed window in the "mainWndList" and delete it. 430 // find the closed window in the "mainWndList" and delete it.
429 QValueList<PwM *>::iterator i = _mainWndList.begin(), 431 Q3ValueList<PwM *>::iterator i = _mainWndList.begin(),
430 end = _mainWndList.end(); 432 end = _mainWndList.end();
431#else 433#else
432 // find the closed window in the "mainWndList" and delete it. 434 // find the closed window in the "mainWndList" and delete it.
433 QValueList<PwM *>::Iterator i = _mainWndList.begin(), 435 Q3ValueList<PwM *>::Iterator i = _mainWndList.begin(),
434 end = _mainWndList.end(); 436 end = _mainWndList.end();
435#endif 437#endif
436 while (i != end) { 438 while (i != end) {
437 //qDebug("iii %x end %x wnd %x", (*i), (*end), wnd); 439 //qDebug("iii %x end %x wnd %x", (*i), (*end), wnd);
438 if (*i == wnd) { 440 if (*i == wnd) {
439#ifndef PWM_EMBEDDED 441#ifndef PWM_EMBEDDED
440 _mainWndList.erase(i); 442 _mainWndList.erase(i);
441#else 443#else
442 _mainWndList.remove(i); 444 _mainWndList.remove(i);
443#endif 445#endif
444 446
445 if ( app->mainWidget() == wnd ) { 447 if ( app->mainWidget() == wnd ) {
@@ -564,30 +566,30 @@ void PwMInit::handleCmdLineArgs(bool initial)
564#endif 566#endif
565} 567}
566 568
567void PwMInit::minimizeAllMainWnd(bool toTray) 569void PwMInit::minimizeAllMainWnd(bool toTray)
568{ 570{
569#ifndef PWM_EMBEDDED 571#ifndef PWM_EMBEDDED
570 if (!_mainWndList.size()) 572 if (!_mainWndList.size())
571 return; 573 return;
572#else 574#else
573 if (!_mainWndList.count()) 575 if (!_mainWndList.count())
574 return; 576 return;
575#endif 577#endif
576 const QValueList<PwM *> *ml = mainWndList(); 578 const Q3ValueList<PwM *> *ml = mainWndList();
577#ifndef PWM_EMBEDDED 579#ifndef PWM_EMBEDDED
578 QValueList<PwM *>::const_iterator it = ml->begin(), 580 Q3ValueList<PwM *>::const_iterator it = ml->begin(),
579 end = ml->end(); 581 end = ml->end();
580#else 582#else
581 QValueList<PwM *>::ConstIterator it = ml->begin(), 583 Q3ValueList<PwM *>::ConstIterator it = ml->begin(),
582 end = ml->end(); 584 end = ml->end();
583#endif 585#endif
584 PwM *wnd; 586 PwM *wnd;
585 if (toTray && _tray) { 587 if (toTray && _tray) {
586 /* minimize to tray. 588 /* minimize to tray.
587 * close all mainWnd. 589 * close all mainWnd.
588 */ 590 */
589 while (it != end) { 591 while (it != end) {
590 wnd = *it; 592 wnd = *it;
591 wnd->setForceMinimizeToTray(true); 593 wnd->setForceMinimizeToTray(true);
592 wnd->close_slot(); 594 wnd->close_slot();
593 ++it; 595 ++it;
@@ -615,25 +617,24 @@ PwMApplication::PwMApplication(int & argc, char ** argv)
615} 617}
616 618
617PwMApplication::~PwMApplication() 619PwMApplication::~PwMApplication()
618{ 620{
619 delete_ifnot_null(init); 621 delete_ifnot_null(init);
620} 622}
621#else //DESKTOP_VERSION 623#else //DESKTOP_VERSION
622 624
623PwMApplication::PwMApplication(int & argc, char ** argv) 625PwMApplication::PwMApplication(int & argc, char ** argv)
624 : QApplication( argc, argv ) 626 : QApplication( argc, argv )
625 , init (0) 627 , init (0)
626{ 628{
627 setStyle( new QPlatinumStyle ());
628 QString hdir = QDir::homeDirPath(); 629 QString hdir = QDir::homeDirPath();
629 // there is a bug when creating dirs for WIN 98 630 // there is a bug when creating dirs for WIN 98
630 // it is difficult to fix, because we have no WIN 98 runnung 631 // it is difficult to fix, because we have no WIN 98 runnung
631 // such that we try it to create the dirs at startup here 632 // such that we try it to create the dirs at startup here
632 if ( hdir == "C:\\" ) 633 if ( hdir == "C:\\" )
633 { 634 {
634 // win 98 or ME 635 // win 98 or ME
635 QDir app_dir; 636 QDir app_dir;
636 if ( !app_dir.exists("C:\\kdepim") ) 637 if ( !app_dir.exists("C:\\kdepim") )
637 app_dir.mkdir ("C:\\kdepim"); 638 app_dir.mkdir ("C:\\kdepim");
638 if ( !app_dir.exists("C:\\kdepim\\apps") ) 639 if ( !app_dir.exists("C:\\kdepim\\apps") )
639 app_dir.mkdir ("C:\\kdepim\\apps"); 640 app_dir.mkdir ("C:\\kdepim\\apps");
@@ -647,15 +648,15 @@ PwMApplication::PwMApplication(int & argc, char ** argv)
647PwMApplication::~PwMApplication() 648PwMApplication::~PwMApplication()
648{ 649{
649 delete_ifnot_null(init); 650 delete_ifnot_null(init);
650} 651}
651 652
652#endif //DESKTOP_VERSION 653#endif //DESKTOP_VERSION
653 654
654#endif //PWM_EMBEDDED 655#endif //PWM_EMBEDDED
655 656
656 657
657 658
658 659
659#ifndef PWM_EMBEDDED 660#ifndef PWM_EMBEDDED_
660#include "pwminit.moc" 661#include "moc_pwminit.cpp"
661#endif 662#endif
diff --git a/pwmanager/pwmanager/pwminit.h b/pwmanager/pwmanager/pwminit.h
index bf72093..32d1b4f 100644
--- a/pwmanager/pwmanager/pwminit.h
+++ b/pwmanager/pwmanager/pwminit.h
@@ -11,73 +11,72 @@
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef __PWMINIT_H 20#ifndef __PWMINIT_H
21#define __PWMINIT_H 21#define __PWMINIT_H
22 22
23#include <qvaluelist.h> 23#include <q3valuelist.h>
24#include <qobject.h> 24#include <qobject.h>
25#ifndef PWM_EMBEDDED 25#ifndef PWM_EMBEDDED
26#include <kuniqueapplication.h> 26#include <kuniqueapplication.h>
27#else //PWM_EMBEDDED 27#else //PWM_EMBEDDED
28 28
29#ifndef DESKTOP_VERSION 29#ifndef DESKTOP_VERSION
30#include <qpe/qpeapplication.h> 30#include <qpe/qpeapplication.h>
31#else //DESKTOP_VERSION 31#else //DESKTOP_VERSION
32#include <qapplication.h> 32#include <qapplication.h>
33#include <qplatinumstyle.h>
34#endif //DESKTOP_VERSION 33#endif //DESKTOP_VERSION
35 34
36#include <kapplication.h> 35#include <kapplication.h>
37#endif //PWM_EMBEDDED 36#endif //PWM_EMBEDDED
38 37
39#include "globalstuff.h" 38#include "globalstuff.h"
40 39
41class DCOPClient; 40class DCOPClient;
42class KWalletEmu; 41class KWalletEmu;
43class PwMKeyCard; 42class PwMKeyCard;
44class KApplication; 43class KApplication;
45class QWidget; 44class QWidget;
46class PwM; 45class PwM;
47class PwMTray; 46class PwMTray;
48class PwMDoc; 47class PwMDoc;
49class PwMInit; 48class PwMInit;
50 49
51/** main application class */ 50/** main application class */
52#ifndef PWM_EMBEDDED 51#ifndef PWM_EMBEDDED
53//MOC_SKIP_BEGIN 52#ifndef Q_MOC_RUN
54class PwMApplication : public KUniqueApplication 53class PwMApplication : public KUniqueApplication
55{ 54{
56public: 55public:
57 PwMApplication(bool allowStyles=true, 56 PwMApplication(bool allowStyles=true,
58 bool GUIenabled=true, 57 bool GUIenabled=true,
59 bool configUnique=false) 58 bool configUnique=false)
60 : KUniqueApplication(allowStyles, GUIenabled, configUnique) 59 : KUniqueApplication(allowStyles, GUIenabled, configUnique)
61 , init (0) 60 , init (0)
62 { } 61 { }
63 ~PwMApplication() 62 ~PwMApplication()
64 { delete_ifnot_null(init); } 63 { delete_ifnot_null(init); }
65 64
66 int newInstance(); 65 int newInstance();
67 66
68protected: 67protected:
69 PwMInit *init; 68 PwMInit *init;
70}; 69};
71//MOC_SKIP_END 70#endif
72#else //PWM_EMBEDDED 71#else //PWM_EMBEDDED
73 72
74#ifndef DESKTOP_VERSION 73#ifndef DESKTOP_VERSION
75class PwMApplication : public QPEApplication 74class PwMApplication : public QPEApplication
76{ 75{
77public: 76public:
78 PwMApplication(int & argc, char ** argv); 77 PwMApplication(int & argc, char ** argv);
79 ~PwMApplication(); 78 ~PwMApplication();
80 79
81 int newInstance(); 80 int newInstance();
82 81
83protected: 82protected:
@@ -145,25 +144,25 @@ public:
145 DCOPClient * dcopClient() 144 DCOPClient * dcopClient()
146 { return _dcopClient; } 145 { return _dcopClient; }
147 /** returns a pointer to the KWallet emulation */ 146 /** returns a pointer to the KWallet emulation */
148 KWalletEmu * kwalletEmu() 147 KWalletEmu * kwalletEmu()
149 { return _kwalletEmu; } 148 { return _kwalletEmu; }
150 /** returns a pointer to the keycard interface */ 149 /** returns a pointer to the keycard interface */
151 PwMKeyCard * keycard() 150 PwMKeyCard * keycard()
152 { return _keycard; } 151 { return _keycard; }
153 /** returns a pointer to the tray icon */ 152 /** returns a pointer to the tray icon */
154 PwMTray * tray() 153 PwMTray * tray()
155 { return _tray; } 154 { return _tray; }
156 /** returns a list of all open main windows */ 155 /** returns a list of all open main windows */
157 const QValueList<PwM *> * mainWndList() 156 const Q3ValueList<PwM *> * mainWndList()
158 { return &_mainWndList; } 157 { return &_mainWndList; }
159 /** create a new document */ 158 /** create a new document */
160 PwMDoc * createDoc(); 159 PwMDoc * createDoc();
161 /** create a new PwM main window */ 160 /** create a new PwM main window */
162 PwM * createMainWnd(const QString &loadFile = QString::null, 161 PwM * createMainWnd(const QString &loadFile = QString::null,
163 bool loadFileDeepLocked = false, 162 bool loadFileDeepLocked = false,
164 bool virginity = true, 163 bool virginity = true,
165 PwMDoc *doc = 0, 164 PwMDoc *doc = 0,
166 bool minimized = false); 165 bool minimized = false);
167 166
168 /** (re)initialize the KWallet emulation */ 167 /** (re)initialize the KWallet emulation */
169 void initKWalletEmu(bool forceDisable = false, bool forceReload = false); 168 void initKWalletEmu(bool forceDisable = false, bool forceReload = false);
@@ -205,18 +204,18 @@ protected:
205 PwMApplication *app; 204 PwMApplication *app;
206 /** pointer to the current widget the user is dealing with */ 205 /** pointer to the current widget the user is dealing with */
207 QWidget *_curWidget; 206 QWidget *_curWidget;
208 /** pointer to the dcop client */ 207 /** pointer to the dcop client */
209 DCOPClient *_dcopClient; 208 DCOPClient *_dcopClient;
210 /** pointer to the KWallet emulation */ 209 /** pointer to the KWallet emulation */
211 KWalletEmu *_kwalletEmu; 210 KWalletEmu *_kwalletEmu;
212 /** pointer to the keycard interface */ 211 /** pointer to the keycard interface */
213 PwMKeyCard *_keycard; 212 PwMKeyCard *_keycard;
214 /** pointer to the tray icon */ 213 /** pointer to the tray icon */
215 PwMTray *_tray; 214 PwMTray *_tray;
216 /** list of all open main windows */ 215 /** list of all open main windows */
217 QValueList<PwM *> _mainWndList; 216 Q3ValueList<PwM *> _mainWndList;
218 /** saved command line options. */ 217 /** saved command line options. */
219 savedCmd_t savedCmd; 218 savedCmd_t savedCmd;
220}; 219};
221 220
222#endif // __PWMINIT_H 221#endif // __PWMINIT_H
diff --git a/pwmanager/pwmanager/pwmprefs.h b/pwmanager/pwmanager/pwmprefs.h
index 1f6a35c..42f7c2e 100644
--- a/pwmanager/pwmanager/pwmprefs.h
+++ b/pwmanager/pwmanager/pwmprefs.h
@@ -19,24 +19,26 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22 22
23 $Id$ 23 $Id$
24*/ 24*/
25 25
26#ifndef PWMPREFS_H 26#ifndef PWMPREFS_H
27#define PWMPREFS_H 27#define PWMPREFS_H
28 28
29#include <qstringlist.h> 29#include <qstringlist.h>
30#include <qsize.h> 30#include <qsize.h>
31//Added by qt3to4:
32#include <Q3ValueList>
31 33
32#include <kpimprefs.h> 34#include <kpimprefs.h>
33 35
34class KConfig; 36class KConfig;
35 37
36#define conf() PWMPrefs::instance() 38#define conf() PWMPrefs::instance()
37 39
38 40
39 41
40 42
41#define CONF_DEFAULT_PWTIMEOUT 10/* 10 sec */ 43#define CONF_DEFAULT_PWTIMEOUT 10/* 10 sec */
42#define CONF_DEFAULT_LOCKTIMEOUT 0/* 0 == disable */ 44#define CONF_DEFAULT_LOCKTIMEOUT 0/* 0 == disable */
@@ -141,26 +143,26 @@ public:
141 bool mTray; 143 bool mTray;
142 bool mMakeFileBackup; 144 bool mMakeFileBackup;
143 bool mAutostartDeeplocked; 145 bool mAutostartDeeplocked;
144 bool mAutoDeeplock; 146 bool mAutoDeeplock;
145 bool mKWalletEmu; 147 bool mKWalletEmu;
146 bool mNewEntrLockStat; 148 bool mNewEntrLockStat;
147 QSize mMainWndSize; 149 QSize mMainWndSize;
148 int mMainViewStyle; 150 int mMainViewStyle;
149 bool mAutoMinimizeOnStart; 151 bool mAutoMinimizeOnStart;
150 bool mClose; 152 bool mClose;
151 153
152 //US ENH 154 //US ENH
153 QValueList<int> mCommentSplitter; 155 Q3ValueList<int> mCommentSplitter;
154 QValueList<int> mCategorySplitter; 156 Q3ValueList<int> mCategorySplitter;
155 157
156 158
157 // US introduce a nonconst way to return the config object. 159 // US introduce a nonconst way to return the config object.
158 KConfig* getConfig(); 160 KConfig* getConfig();
159 161
160 private: 162 private:
161 PWMPrefs(); 163 PWMPrefs();
162 164
163 static PWMPrefs *sInstance; 165 static PWMPrefs *sInstance;
164}; 166};
165 167
166#endif 168#endif
diff --git a/pwmanager/pwmanager/pwmtray.cpp b/pwmanager/pwmanager/pwmtray.cpp
index fe074ca..478116f 100644
--- a/pwmanager/pwmanager/pwmtray.cpp
+++ b/pwmanager/pwmanager/pwmtray.cpp
@@ -23,24 +23,27 @@
23#include "pwmtray.h" 23#include "pwmtray.h"
24#include "pwmexception.h" 24#include "pwmexception.h"
25#include "pwm.h" 25#include "pwm.h"
26#include "pwmdoc.h" 26#include "pwmdoc.h"
27#include "pwminit.h" 27#include "pwminit.h"
28#ifndef PWM_EMBEDDED 28#ifndef PWM_EMBEDDED
29#include "configuration.h" 29#include "configuration.h"
30#else 30#else
31#include "pwmprefs.h" 31#include "pwmprefs.h"
32#endif 32#endif
33 33
34#include <klocale.h> 34#include <klocale.h>
35//Added by qt3to4:
36#include <Q3ValueList>
37#include <QMouseEvent>
35 38
36 39
37void ActiveTreeItem::execIt() 40void ActiveTreeItem::execIt()
38{ 41{
39#ifndef PWM_EMBEDDED 42#ifndef PWM_EMBEDDED
40 unsigned int entr = static_cast<unsigned int>(entry); 43 unsigned int entr = static_cast<unsigned int>(entry);
41 unsigned int cat = static_cast<unsigned int>(category); 44 unsigned int cat = static_cast<unsigned int>(category);
42#else 45#else
43 unsigned int entr = (unsigned int)(entry); 46 unsigned int entr = (unsigned int)(entry);
44 unsigned int cat = (unsigned int)(category); 47 unsigned int cat = (unsigned int)(category);
45#endif 48#endif
46 switch (task) { 49 switch (task) {
@@ -78,30 +81,30 @@ void ActiveTreeItem::execIt()
78 PwMDataItem d; 81 PwMDataItem d;
79 doc->getEntry(cat, entr, &d); 82 doc->getEntry(cat, entr, &d);
80 PwM::copyToClipboard(d.comment.c_str()); 83 PwM::copyToClipboard(d.comment.c_str());
81 break; 84 break;
82 } case execLauncher: { 85 } case execLauncher: {
83 doc->execLauncher(cat, entr); 86 doc->execLauncher(cat, entr);
84 break; 87 break;
85 } case goToURL: { 88 } case goToURL: {
86 doc->goToURL(cat, entr); 89 doc->goToURL(cat, entr);
87 break; 90 break;
88 } case openMainWnd: { 91 } case openMainWnd: {
89 // search if there is already an open window. 92 // search if there is already an open window.
90 const QValueList<PwM *> *wl = tray->init->mainWndList(); 93 const Q3ValueList<PwM *> *wl = tray->init->mainWndList();
91#ifndef PWM_EMBEDDED 94#ifndef PWM_EMBEDDED
92 QValueList<PwM *>::const_iterator i = wl->begin(), 95 Q3ValueList<PwM *>::const_iterator i = wl->begin(),
93 end = wl->end(); 96 end = wl->end();
94#else 97#else
95 QValueList<PwM *>::ConstIterator i = wl->begin(), 98 Q3ValueList<PwM *>::ConstIterator i = wl->begin(),
96 end = wl->end(); 99 end = wl->end();
97#endif 100#endif
98 PwM *wnd; 101 PwM *wnd;
99 while (i != end) { 102 while (i != end) {
100 wnd = *i; 103 wnd = *i;
101 if (wnd->curDoc() == doc) { 104 if (wnd->curDoc() == doc) {
102 // now bring this window to the foreground. 105 // now bring this window to the foreground.
103 if (!wnd->hasFocus()) { 106 if (!wnd->hasFocus()) {
104 wnd->hide(); 107 wnd->hide();
105 wnd->showNormal(); 108 wnd->showNormal();
106 wnd->setFocus(); 109 wnd->setFocus();
107 } 110 }
@@ -169,43 +172,43 @@ void PwMTray::buildMain()
169 ctxMenu->insertItem(i18n("&New main window..."), this, 172 ctxMenu->insertItem(i18n("&New main window..."), this,
170 SLOT(newMainWnd())); 173 SLOT(newMainWnd()));
171 ctxMenu->insertItem(i18n("&Open file..."), this, 174 ctxMenu->insertItem(i18n("&Open file..."), this,
172 SLOT(openDoc())); 175 SLOT(openDoc()));
173 ctxMenu->insertSeparator(); 176 ctxMenu->insertSeparator();
174 ctxMenu->insertItem(i18n("&Remove from tray"), this, 177 ctxMenu->insertItem(i18n("&Remove from tray"), this,
175 SLOT(undock())); 178 SLOT(undock()));
176} 179}
177 180
178void PwMTray::insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, 181void PwMTray::insertActiveTreeItem(KPopupMenu *insertIn, const QString &text,
179 ActiveTreeItem::Task task, PwMDoc *doc, 182 ActiveTreeItem::Task task, PwMDoc *doc,
180 int docCategory, int docEntry, 183 int docCategory, int docEntry,
181 QValueList<int> *activeItemsList) 184 Q3ValueList<int> *activeItemsList)
182{ 185{
183 ActiveTreeItem *activeItem; 186 ActiveTreeItem *activeItem;
184 int id; 187 int id;
185 188
186 activeItem = new ActiveTreeItem(text, insertIn->font(), task, 189 activeItem = new ActiveTreeItem(text, insertIn->font(), task,
187 doc, docCategory, docEntry, 190 doc, docCategory, docEntry,
188 this); 191 this);
189 id = insertIn->insertItem(activeItem); 192 id = insertIn->insertItem(activeItem);
190 insertIn->connectItem(id, activeItem, SLOT(execIt())); 193 insertIn->connectItem(id, activeItem, SLOT(execIt()));
191#ifndef PWM_EMBEDDED 194#ifndef PWM_EMBEDDED
192 activeItemsList->push_back(id); 195 activeItemsList->push_back(id);
193#else 196#else
194 activeItemsList->append(id); 197 activeItemsList->append(id);
195#endif 198#endif
196} 199}
197 200
198void PwMTray::rebuildTree(KPopupMenu *popup, PwMDoc *doc, 201void PwMTray::rebuildTree(KPopupMenu *popup, PwMDoc *doc,
199 QValueList<int> *activeItems) 202 Q3ValueList<int> *activeItems)
200{ 203{
201 PWM_ASSERT(doc); 204 PWM_ASSERT(doc);
202 PWM_ASSERT(popup); 205 PWM_ASSERT(popup);
203 activeItems->clear(); 206 activeItems->clear();
204 popup->clear(); 207 popup->clear();
205#ifndef PWM_EMBEDDED 208#ifndef PWM_EMBEDDED
206 popup->insertTitle(i18n("Categories:")); 209 popup->insertTitle(i18n("Categories:"));
207#endif 210#endif
208 vector<string> catList; 211 vector<string> catList;
209 vector<string> entrList; 212 vector<string> entrList;
210 doc->getCategoryList(&catList); 213 doc->getCategoryList(&catList);
211 KPopupMenu *newCatMenu; 214 KPopupMenu *newCatMenu;
@@ -325,29 +328,29 @@ void PwMTray::updateTree(PwMDoc *document)
325{ 328{
326 PWM_ASSERT(document); 329 PWM_ASSERT(document);
327 KPopupMenu *treeEntry; 330 KPopupMenu *treeEntry;
328 int treeItemNum = -1; 331 int treeItemNum = -1;
329 int id = findTreeEntry(document, &treeEntry, &treeItemNum); 332 int id = findTreeEntry(document, &treeEntry, &treeItemNum);
330 if (id == -1) { 333 if (id == -1) {
331 // tree-entry doesn't exist, yet. 334 // tree-entry doesn't exist, yet.
332 id = insertTreeEntry(document, &treeEntry); 335 id = insertTreeEntry(document, &treeEntry);
333 } 336 }
334 if (treeItemNum != -1) { 337 if (treeItemNum != -1) {
335 // delete all *old* active items 338 // delete all *old* active items
336 KPopupMenu *ctxMenu = contextMenu(); 339 KPopupMenu *ctxMenu = contextMenu();
337 QValueList<int> *oldItems = &tree[treeItemNum].activeItems; 340 Q3ValueList<int> *oldItems = &tree[treeItemNum].activeItems;
338#ifndef PWM_EMBEDDED 341#ifndef PWM_EMBEDDED
339 QValueList<int>::iterator i = oldItems->begin(); 342 Q3ValueList<int>::iterator i = oldItems->begin();
340#else 343#else
341 QValueList<int>::Iterator i = oldItems->begin(); 344 Q3ValueList<int>::Iterator i = oldItems->begin();
342#endif 345#endif
343 while (i != oldItems->end()) { 346 while (i != oldItems->end()) {
344 ctxMenu->removeItem(*i); 347 ctxMenu->removeItem(*i);
345 ++i; 348 ++i;
346 } 349 }
347 oldItems->clear(); 350 oldItems->clear();
348 ctxMenu->changeItem(id, document->getTitle()); 351 ctxMenu->changeItem(id, document->getTitle());
349 } 352 }
350 353
351 treeItem newTreeItem; 354 treeItem newTreeItem;
352 if (document->isDeepLocked()) { 355 if (document->isDeepLocked()) {
353 treeEntry->clear(); 356 treeEntry->clear();
@@ -472,15 +475,15 @@ void PwMTray::openDoc()
472void PwMTray::newMainWnd() 475void PwMTray::newMainWnd()
473{ 476{
474 init->createMainWnd(); 477 init->createMainWnd();
475} 478}
476 479
477void PwMTray::undock() 480void PwMTray::undock()
478{ 481{
479 conf()->confGlobTray(false); 482 conf()->confGlobTray(false);
480 init->initTray(); 483 init->initTray();
481 // Attention! "this" is already deleted here! 484 // Attention! "this" is already deleted here!
482} 485}
483 486
484#ifndef PWM_EMBEDDED 487#ifndef PWM_EMBEDDED_
485#include "pwmtray.moc" 488#include "moc_pwmtray.cpp"
486#endif 489#endif
diff --git a/pwmanager/pwmanager/pwmtray.h b/pwmanager/pwmanager/pwmtray.h
index ffb625e..b1145e0 100644
--- a/pwmanager/pwmanager/pwmtray.h
+++ b/pwmanager/pwmanager/pwmtray.h
@@ -18,35 +18,37 @@
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef __PWMTRAY_H 20#ifndef __PWMTRAY_H
21#define __PWMTRAY_H 21#define __PWMTRAY_H
22 22
23#ifndef PWM_EMBEDDED 23#ifndef PWM_EMBEDDED
24#include <ksystemtray.h> 24#include <ksystemtray.h>
25#endif 25#endif
26 26
27#include <kpopupmenu.h> 27#include <kpopupmenu.h>
28 28
29#include <qpainter.h> 29#include <qpainter.h>
30#include <qvaluelist.h> 30#include <q3valuelist.h>
31//Added by qt3to4:
32#include <QMouseEvent>
33#include <QMenuItem>
31 34
32//#include "pwmexception.h" 35//#include "pwmexception.h"
33 36
34class PwMInit; 37class PwMInit;
35class PwMDoc; 38class PwMDoc;
36class PwMTray; 39class PwMTray;
37 40
38/* wrapper to workaround MOC problems */ 41/* wrapper to workaround MOC problems */
39class __ActiveTreeItem : public QCustomMenuItem 42class __ActiveTreeItem : public QMenuItem
40 , public QObject
41{ 43{
42public: 44public:
43 __ActiveTreeItem() {} 45 __ActiveTreeItem() {}
44}; 46};
45 47
46/** implements the "active" part of the tree */ 48/** implements the "active" part of the tree */
47class ActiveTreeItem : public __ActiveTreeItem 49class ActiveTreeItem : public __ActiveTreeItem
48{ 50{
49 Q_OBJECT 51 Q_OBJECT
50 52
51public: 53public:
52 enum Task 54 enum Task
@@ -78,32 +80,32 @@ public:
78 , category (_category) 80 , category (_category)
79 , entry (_entry) 81 , entry (_entry)
80 , tray (_tray) 82 , tray (_tray)
81 { } 83 { }
82 84
83 /*~ActiveTreeItem() 85 /*~ActiveTreeItem()
84 { cout << "deleted \"" << text << "\"" << endl; } */ 86 { cout << "deleted \"" << text << "\"" << endl; } */
85 87
86 void paint(QPainter *p, const QColorGroup & /*cg*/, bool /*act*/, 88 void paint(QPainter *p, const QColorGroup & /*cg*/, bool /*act*/,
87 bool /*enabled*/, int x, int y, int w, int h) 89 bool /*enabled*/, int x, int y, int w, int h)
88 { 90 {
89 p->setFont(font); 91 p->setFont(font);
90 p->drawText(x, y, w, h, AlignLeft | AlignVCenter | 92 p->drawText(x, y, w, h, Qt::AlignLeft | Qt::AlignVCenter |
91 DontClip | ShowPrefix, text); 93 Qt::DontClip | Qt::ShowPrefix, text);
92 } 94 }
93 95
94 QSize sizeHint() 96 QSize sizeHint()
95 { 97 {
96 return QFontMetrics(font).size(AlignLeft | AlignVCenter | 98 return QFontMetrics(font).size(Qt::AlignLeft | Qt::AlignVCenter |
97 ShowPrefix | DontClip, text); 99 Qt::ShowPrefix | Qt::DontClip, text);
98 } 100 }
99 101
100 bool fullSpan() const 102 bool fullSpan() const
101 { return false; } 103 { return false; }
102 104
103 bool isSeparator() const 105 bool isSeparator() const
104 { return false; } 106 { return false; }
105 107
106 void setFont(const QFont &f) 108 void setFont(const QFont &f)
107 { font = f; } 109 { font = f; }
108 110
109public slots: 111public slots:
@@ -113,37 +115,37 @@ public slots:
113protected: 115protected:
114 QString text; 116 QString text;
115 QFont font; 117 QFont font;
116 Task task; 118 Task task;
117 PwMDoc *doc; 119 PwMDoc *doc;
118 int category; 120 int category;
119 int entry; 121 int entry;
120 PwMTray *tray; 122 PwMTray *tray;
121}; 123};
122 124
123/** tray icon implementation */ 125/** tray icon implementation */
124#ifndef PWM_EMBEDDED 126#ifndef PWM_EMBEDDED
125//MOC_SKIP_BEGIN 127#ifndef Q_MOC_RUN
126class PwMTray : public KSystemTray 128class PwMTray : public KSystemTray
127{ 129{
128 Q_OBJECT 130 Q_OBJECT
129 131
130 friend class ActiveTreeItem; 132 friend class ActiveTreeItem;
131 133
132 struct treeItem 134 struct treeItem
133 { 135 {
134 int menuId; 136 int menuId;
135 PwMDoc *doc; 137 PwMDoc *doc;
136 KPopupMenu *menu; 138 KPopupMenu *menu;
137 QValueList<int> activeItems; // ids of all active items 139 Q3ValueList<int> activeItems; // ids of all active items
138 }; 140 };
139 141
140public: 142public:
141 PwMTray(PwMInit *_init, QWidget* parent = 0, const char* name = 0); 143 PwMTray(PwMInit *_init, QWidget* parent = 0, const char* name = 0);
142 ~PwMTray(); 144 ~PwMTray();
143 145
144 /** connect all signals for this document to the tray */ 146 /** connect all signals for this document to the tray */
145 void connectDocToTray(PwMDoc *doc); 147 void connectDocToTray(PwMDoc *doc);
146 148
147public slots: 149public slots:
148 /** for update-notification from all open documents */ 150 /** for update-notification from all open documents */
149 void updateTree(PwMDoc *document); 151 void updateTree(PwMDoc *document);
@@ -161,70 +163,70 @@ protected slots:
161 void undock(); 163 void undock();
162 164
163signals: 165signals:
164 /** this icon got deleted */ 166 /** this icon got deleted */
165 void closed(PwMTray *); 167 void closed(PwMTray *);
166 /** the user clicked on the tray icon */ 168 /** the user clicked on the tray icon */
167 void clickedIcon(PwMTray *); 169 void clickedIcon(PwMTray *);
168 170
169protected: 171protected:
170 /** holds a list of all open files, its documents and 172 /** holds a list of all open files, its documents and
171 * its menuIDs 173 * its menuIDs
172 */ 174 */
173 QValueList<struct treeItem> tree; 175 Q3ValueList<struct treeItem> tree;
174 /** pointer to init */ 176 /** pointer to init */
175 PwMInit *init; 177 PwMInit *init;
176 178
177protected: 179protected:
178 /** search if an entry with for the given document 180 /** search if an entry with for the given document
179 * exists and resturn its ID and a pointer to the main 181 * exists and resturn its ID and a pointer to the main
180 * KPopupMenu. If no item is found, 182 * KPopupMenu. If no item is found,
181 * it returns -1 as ID and a NULL-pointer. 183 * it returns -1 as ID and a NULL-pointer.
182 */ 184 */
183 int findTreeEntry(PwMDoc *doc, KPopupMenu **menu, int *treeItem); 185 int findTreeEntry(PwMDoc *doc, KPopupMenu **menu, int *treeItem);
184 /** build the main menu-items */ 186 /** build the main menu-items */
185 void buildMain(); 187 void buildMain();
186 /** rebuilds the tree for the given KPopupMenu entry */ 188 /** rebuilds the tree for the given KPopupMenu entry */
187 void rebuildTree(KPopupMenu *popup, PwMDoc *doc, 189 void rebuildTree(KPopupMenu *popup, PwMDoc *doc,
188 QValueList<int> *activeItems); 190 Q3ValueList<int> *activeItems);
189 /** insert a new tree-entry for the given doc and returns the ID.*/ 191 /** insert a new tree-entry for the given doc and returns the ID.*/
190 int insertTreeEntry(PwMDoc *doc, KPopupMenu **popup); 192 int insertTreeEntry(PwMDoc *doc, KPopupMenu **popup);
191 /** removes a tree entry */ 193 /** removes a tree entry */
192 void removeTreeEntry(int menuId, int treeItem, KPopupMenu **menu); 194 void removeTreeEntry(int menuId, int treeItem, KPopupMenu **menu);
193 /** inserts a new active-tree-item into the given tree entry */ 195 /** inserts a new active-tree-item into the given tree entry */
194 void insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, 196 void insertActiveTreeItem(KPopupMenu *insertIn, const QString &text,
195 ActiveTreeItem::Task task, PwMDoc *doc, 197 ActiveTreeItem::Task task, PwMDoc *doc,
196 int docCategory, int docEntry, 198 int docCategory, int docEntry,
197 QValueList<int> *activeItemsList); 199 Q3ValueList<int> *activeItemsList);
198 /** mouse event on icon */ 200 /** mouse event on icon */
199 void mouseReleaseEvent(QMouseEvent *e); 201 void mouseReleaseEvent(QMouseEvent *e);
200 /** inserts the items for the main window control 202 /** inserts the items for the main window control
201 * into the popup menu. 203 * into the popup menu.
202 */ 204 */
203 void insertMainWndCtrl(KPopupMenu *menu, PwMDoc *doc); 205 void insertMainWndCtrl(KPopupMenu *menu, PwMDoc *doc);
204}; 206};
205//MOC_SKIP_END 207#endif
206#else 208#else
207class PwMTray : public QWidget 209class PwMTray : public QWidget
208{ 210{
209 Q_OBJECT 211 Q_OBJECT
210 212
211 friend class ActiveTreeItem; 213 friend class ActiveTreeItem;
212 214
213 struct treeItem 215 struct treeItem
214 { 216 {
215 int menuId; 217 int menuId;
216 PwMDoc *doc; 218 PwMDoc *doc;
217 KPopupMenu *menu; 219 KPopupMenu *menu;
218 QValueList<int> activeItems; // ids of all active items 220 Q3ValueList<int> activeItems; // ids of all active items
219 }; 221 };
220 222
221public: 223public:
222 PwMTray(PwMInit *_init, QWidget* parent = 0, const char* name = 0); 224 PwMTray(PwMInit *_init, QWidget* parent = 0, const char* name = 0);
223 ~PwMTray(); 225 ~PwMTray();
224 226
225 //US ENH needed for embedde version. 227 //US ENH needed for embedde version.
226 KPopupMenu* contextMenu(); 228 KPopupMenu* contextMenu();
227 KPopupMenu* m_ctxMenu; 229 KPopupMenu* m_ctxMenu;
228 230
229 /** connect all signals for this document to the tray */ 231 /** connect all signals for this document to the tray */
230 void connectDocToTray(PwMDoc *doc); 232 void connectDocToTray(PwMDoc *doc);
@@ -246,47 +248,47 @@ protected slots:
246 void undock(); 248 void undock();
247 249
248signals: 250signals:
249 /** this icon got deleted */ 251 /** this icon got deleted */
250 void closed(PwMTray *); 252 void closed(PwMTray *);
251 /** the user clicked on the tray icon */ 253 /** the user clicked on the tray icon */
252 void clickedIcon(PwMTray *); 254 void clickedIcon(PwMTray *);
253 255
254protected: 256protected:
255 /** holds a list of all open files, its documents and 257 /** holds a list of all open files, its documents and
256 * its menuIDs 258 * its menuIDs
257 */ 259 */
258 QValueList<struct treeItem> tree; 260 Q3ValueList<struct treeItem> tree;
259 /** pointer to init */ 261 /** pointer to init */
260 PwMInit *init; 262 PwMInit *init;
261 263
262protected: 264protected:
263 /** search if an entry with for the given document 265 /** search if an entry with for the given document
264 * exists and resturn its ID and a pointer to the main 266 * exists and resturn its ID and a pointer to the main
265 * KPopupMenu. If no item is found, 267 * KPopupMenu. If no item is found,
266 * it returns -1 as ID and a NULL-pointer. 268 * it returns -1 as ID and a NULL-pointer.
267 */ 269 */
268 int findTreeEntry(PwMDoc *doc, KPopupMenu **menu, int *treeItem); 270 int findTreeEntry(PwMDoc *doc, KPopupMenu **menu, int *treeItem);
269 /** build the main menu-items */ 271 /** build the main menu-items */
270 void buildMain(); 272 void buildMain();
271 /** rebuilds the tree for the given KPopupMenu entry */ 273 /** rebuilds the tree for the given KPopupMenu entry */
272 void rebuildTree(KPopupMenu *popup, PwMDoc *doc, 274 void rebuildTree(KPopupMenu *popup, PwMDoc *doc,
273 QValueList<int> *activeItems); 275 Q3ValueList<int> *activeItems);
274 /** insert a new tree-entry for the given doc and returns the ID.*/ 276 /** insert a new tree-entry for the given doc and returns the ID.*/
275 int insertTreeEntry(PwMDoc *doc, KPopupMenu **popup); 277 int insertTreeEntry(PwMDoc *doc, KPopupMenu **popup);
276 /** removes a tree entry */ 278 /** removes a tree entry */
277 void removeTreeEntry(int menuId, int treeItem, KPopupMenu **menu); 279 void removeTreeEntry(int menuId, int treeItem, KPopupMenu **menu);
278 /** inserts a new active-tree-item into the given tree entry */ 280 /** inserts a new active-tree-item into the given tree entry */
279 void insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, 281 void insertActiveTreeItem(KPopupMenu *insertIn, const QString &text,
280 ActiveTreeItem::Task task, PwMDoc *doc, 282 ActiveTreeItem::Task task, PwMDoc *doc,
281 int docCategory, int docEntry, 283 int docCategory, int docEntry,
282 QValueList<int> *activeItemsList); 284 Q3ValueList<int> *activeItemsList);
283 /** mouse event on icon */ 285 /** mouse event on icon */
284 void mouseReleaseEvent(QMouseEvent *e); 286 void mouseReleaseEvent(QMouseEvent *e);
285 /** inserts the items for the main window control 287 /** inserts the items for the main window control
286 * into the popup menu. 288 * into the popup menu.
287 */ 289 */
288 void insertMainWndCtrl(KPopupMenu *menu, PwMDoc *doc); 290 void insertMainWndCtrl(KPopupMenu *menu, PwMDoc *doc);
289}; 291};
290#endif 292#endif
291 293
292#endif 294#endif
diff --git a/pwmanager/pwmanager/pwmview.cpp b/pwmanager/pwmanager/pwmview.cpp
index 2533487..68500d0 100644
--- a/pwmanager/pwmanager/pwmview.cpp
+++ b/pwmanager/pwmanager/pwmview.cpp
@@ -26,25 +26,33 @@
26#include "configuration.h" 26#include "configuration.h"
27#else 27#else
28#include "pwmprefs.h" 28#include "pwmprefs.h"
29#endif 29#endif
30#include "commentbox.h" 30#include "commentbox.h"
31 31
32#include <kmessagebox.h> 32#include <kmessagebox.h>
33#include <klocale.h> 33#include <klocale.h>
34 34
35#include <qlineedit.h> 35#include <qlineedit.h>
36#include <qpoint.h> 36#include <qpoint.h>
37#include <qapplication.h> 37#include <qapplication.h>
38#include <QDesktopWidget>
38#include <qlayout.h> 39#include <qlayout.h>
40//Added by qt3to4:
41#include <Q3HBoxLayout>
42#include <QKeyEvent>
43#include <QLabel>
44#include <QResizeEvent>
45#include <Q3PopupMenu>
46#include <Q3VBoxLayout>
39 47
40//US ENH: wouldn't it be a good idea if we could use this consts everywhere else. 48//US ENH: wouldn't it be a good idea if we could use this consts everywhere else.
41//US ENH: for examle in listviewpwm.cpp 49//US ENH: for examle in listviewpwm.cpp
42//US ENH: Because of that I transfer them into the headerfile. 50//US ENH: Because of that I transfer them into the headerfile.
43/* 51/*
44 #define COLUMN_DESC 0 52 #define COLUMN_DESC 0
45 #define COLUMN_NAME 1 53 #define COLUMN_NAME 1
46 #define COLUMN_PW 2 54 #define COLUMN_PW 2
47 #define COLUMN_URL 3 55 #define COLUMN_URL 3
48 #define COLUMN_LAUNCHER 4 56 #define COLUMN_LAUNCHER 4
49*/ 57*/
50 58
@@ -67,25 +75,25 @@ PwMView::PwMView(PwM *_mainClass,
67 connect(doc, SIGNAL(dataChanged(PwMDoc *)), this, SLOT(updateView())); 75 connect(doc, SIGNAL(dataChanged(PwMDoc *)), this, SLOT(updateView()));
68 connect(this, SIGNAL(editPW()), mainClass, SLOT(editPwd_slot())); 76 connect(this, SIGNAL(editPW()), mainClass, SLOT(editPwd_slot()));
69 connect(this, SIGNAL(insertPW()), mainClass, SLOT(addPwd_slot())); 77 connect(this, SIGNAL(insertPW()), mainClass, SLOT(addPwd_slot()));
70 connect(this, SIGNAL(deletePW()), mainClass, SLOT(deletePwd_slot())); 78 connect(this, SIGNAL(deletePW()), mainClass, SLOT(deletePwd_slot()));
71} 79}
72 80
73PwMView::~PwMView() 81PwMView::~PwMView()
74{ 82{
75} 83}
76 84
77void PwMView::initCtxMenu() 85void PwMView::initCtxMenu()
78{ 86{
79 ctxMenu = new QPopupMenu(this); 87 ctxMenu = new Q3PopupMenu(this);
80 ctxMenu->insertItem(i18n("&Add password"), mainClass, SLOT(addPwd_slot())); 88 ctxMenu->insertItem(i18n("&Add password"), mainClass, SLOT(addPwd_slot()));
81 ctxMenu->insertSeparator(); 89 ctxMenu->insertSeparator();
82 ctxMenu->insertItem(i18n("&Edit"), mainClass, SLOT(editPwd_slot())); 90 ctxMenu->insertItem(i18n("&Edit"), mainClass, SLOT(editPwd_slot()));
83 ctxMenu->insertItem(i18n("&Delete"), mainClass, SLOT(deletePwd_slot())); 91 ctxMenu->insertItem(i18n("&Delete"), mainClass, SLOT(deletePwd_slot()));
84 ctxMenu->insertSeparator(); 92 ctxMenu->insertSeparator();
85 ctxMenu->insertItem(i18n("copy password to clipboard"), 93 ctxMenu->insertItem(i18n("copy password to clipboard"),
86 this, SLOT(copyPwToClip())); 94 this, SLOT(copyPwToClip()));
87 ctxMenu->insertItem(i18n("copy username to clipboard"), 95 ctxMenu->insertItem(i18n("copy username to clipboard"),
88 this, SLOT(copyNameToClip())); 96 this, SLOT(copyNameToClip()));
89 ctxMenu->insertItem(i18n("copy description to clipboard"), 97 ctxMenu->insertItem(i18n("copy description to clipboard"),
90 this, SLOT(copyDescToClip())); 98 this, SLOT(copyDescToClip()));
91 ctxMenu->insertItem(i18n("copy url to clipboard"), 99 ctxMenu->insertItem(i18n("copy url to clipboard"),
@@ -97,25 +105,25 @@ void PwMView::initCtxMenu()
97 ctxMenu->insertSeparator(); 105 ctxMenu->insertSeparator();
98 ctxMenu->insertItem(i18n("Execute \"Launcher\""), mainClass, 106 ctxMenu->insertItem(i18n("Execute \"Launcher\""), mainClass,
99 SLOT(execLauncher_slot())); 107 SLOT(execLauncher_slot()));
100 ctxMenu->insertItem(i18n("Go to \"URL\""), mainClass, 108 ctxMenu->insertItem(i18n("Go to \"URL\""), mainClass,
101 SLOT(goToURL_slot())); 109 SLOT(goToURL_slot()));
102} 110}
103 111
104void PwMView::resizeEvent(QResizeEvent *) 112void PwMView::resizeEvent(QResizeEvent *)
105{ 113{
106 resizeView(size()); 114 resizeView(size());
107} 115}
108 116
109void PwMView::refreshCommentTextEdit(QListViewItem *curItem) 117void PwMView::refreshCommentTextEdit(Q3ListViewItem *curItem)
110{ 118{
111 PWM_ASSERT(commentBox); 119 PWM_ASSERT(commentBox);
112 if (!curItem) 120 if (!curItem)
113 return; 121 return;
114 string comment; 122 string comment;
115 PwMerror ret; 123 PwMerror ret;
116 ret = document()->getCommentByLvp_long(getCurrentCategory(), 124 ret = document()->getCommentByLvp_long(getCurrentCategory(),
117 lv->childCount() - lv->itemIndex(curItem) - 1, 125 lv->childCount() - lv->itemIndex(curItem) - 1,
118 &comment); 126 &comment);
119 if (ret == e_binEntry) { 127 if (ret == e_binEntry) {
120 commentBox->setContent(i18n("This is a binary entry.\n" 128 commentBox->setContent(i18n("This is a binary entry.\n"
121 "It is not a normal password-entry, as it contains " 129 "It is not a normal password-entry, as it contains "
@@ -127,84 +135,84 @@ void PwMView::refreshCommentTextEdit(QListViewItem *curItem)
127 return; 135 return;
128 } 136 }
129 lv->ensureItemVisible(curItem); 137 lv->ensureItemVisible(curItem);
130} 138}
131 139
132void PwMView::keyReleaseEvent(QKeyEvent * /*e*/) 140void PwMView::keyReleaseEvent(QKeyEvent * /*e*/)
133{ 141{
134 refreshCommentTextEdit(lv->currentItem()); 142 refreshCommentTextEdit(lv->currentItem());
135} 143}
136 144
137bool PwMView::getCurEntryIndex(unsigned int *index) 145bool PwMView::getCurEntryIndex(unsigned int *index)
138{ 146{
139 QListViewItem *current = lv->currentItem(); 147 Q3ListViewItem *current = lv->currentItem();
140 if (!current) 148 if (!current)
141 return false; 149 return false;
142 return getDocEntryIndex(index, current); 150 return getDocEntryIndex(index, current);
143} 151}
144 152
145bool PwMView::getDocEntryIndex(unsigned int *index, 153bool PwMView::getDocEntryIndex(unsigned int *index,
146 const QListViewItem *item) 154 const Q3ListViewItem *item)
147{ 155{
148 vector<unsigned int> foundPositions; 156 vector<unsigned int> foundPositions;
149 PwMDataItem curItem; 157 PwMDataItem curItem;
150 curItem.desc = item->text(COLUMN_DESC).latin1(); 158 curItem.desc = item->text(COLUMN_DESC).latin1();
151 curItem.name = item->text(COLUMN_NAME).latin1(); 159 curItem.name = item->text(COLUMN_NAME).latin1();
152 document()->getCommentByLvp(getCurrentCategory(), 160 document()->getCommentByLvp(getCurrentCategory(),
153 lv->childCount() - lv->itemIndex(item) - 1, 161 lv->childCount() - lv->itemIndex(item) - 1,
154 &curItem.comment); 162 &curItem.comment);
155 curItem.url = item->text(COLUMN_URL).latin1(); 163 curItem.url = item->text(COLUMN_URL).latin1();
156 curItem.launcher = item->text(COLUMN_LAUNCHER).latin1(); 164 curItem.launcher = item->text(COLUMN_LAUNCHER).latin1();
157 document()->findEntry(getCurrentCategory(), curItem, SEARCH_IN_DESC | 165 document()->findEntry(getCurrentCategory(), curItem, SEARCH_IN_DESC |
158 SEARCH_IN_NAME | SEARCH_IN_COMMENT | SEARCH_IN_URL | 166 SEARCH_IN_NAME | SEARCH_IN_COMMENT | SEARCH_IN_URL |
159 SEARCH_IN_LAUNCHER, 167 SEARCH_IN_LAUNCHER,
160 &foundPositions, true); 168 &foundPositions, true);
161 if (foundPositions.size()) { 169 if (foundPositions.size()) {
162 *index = foundPositions[0]; 170 *index = foundPositions[0];
163 return true; 171 return true;
164 } 172 }
165 173
166 return false; 174 return false;
167} 175}
168 176
169void PwMView::handleToggle(QListViewItem *item) 177void PwMView::handleToggle(Q3ListViewItem *item)
170{ 178{
171 PWM_ASSERT(doc); 179 PWM_ASSERT(doc);
172 if (!item) 180 if (!item)
173 return; 181 return;
174 QCheckListItem *clItem = (QCheckListItem *)item; 182 Q3CheckListItem *clItem = (Q3CheckListItem *)item;
175 QString curCat(getCurrentCategory()); 183 QString curCat(getCurrentCategory());
176 184
177 // find document position of this entry. 185 // find document position of this entry.
178 unsigned int curEntryDocIndex; 186 unsigned int curEntryDocIndex;
179 if (!getDocEntryIndex(&curEntryDocIndex, item)) 187 if (!getDocEntryIndex(&curEntryDocIndex, item))
180 return; 188 return;
181 189
182 // hack to refresh the comment, if only one item is present 190 // hack to refresh the comment, if only one item is present
183 if (lv->childCount() == 1) 191 if (lv->childCount() == 1)
184 refreshCommentTextEdit(lv->currentItem()); 192 refreshCommentTextEdit(lv->currentItem());
185 193
186 if (doc->isLocked(curCat, curEntryDocIndex) != clItem->isOn()) 194 if (doc->isLocked(curCat, curEntryDocIndex) != clItem->isOn())
187 return; // this is just a click somewhere on the entry 195 return; // this is just a click somewhere on the entry
188 if (doc->isDeepLocked()) { 196 if (doc->isDeepLocked()) {
189 PwMerror ret; 197 PwMerror ret;
190 ret = doc->deepLock(false); 198 ret = doc->deepLock(false);
191 if (ret != e_success) 199 if (ret != e_success)
192 clItem->setOn(false); 200 clItem->setOn(false);
193 return; 201 return;
194 } 202 }
195 doc->lockAt(curCat, curEntryDocIndex, !clItem->isOn()); 203 doc->lockAt(curCat, curEntryDocIndex, !clItem->isOn());
196} 204}
197 205
198void PwMView::handleRightClick(QListViewItem *item, const QPoint &point, int) 206void PwMView::handleRightClick(Q3ListViewItem *item, const QPoint &point, int)
199{ 207{
200 if (!item) 208 if (!item)
201 return; 209 return;
202 ctxMenu->move(point); 210 ctxMenu->move(point);
203 /* don't use ctxMenu->exec() here, as it generates race conditions 211 /* don't use ctxMenu->exec() here, as it generates race conditions
204 * with the card interface code. Believe it or not. :) 212 * with the card interface code. Believe it or not. :)
205 */ 213 */
206 ctxMenu->show(); 214 ctxMenu->show();
207} 215}
208 216
209void PwMView::updateCategories() 217void PwMView::updateCategories()
210{ 218{
@@ -265,25 +273,25 @@ void PwMView::shiftToView()
265 tmpDisableSort(); 273 tmpDisableSort();
266 lv->clear(); 274 lv->clear();
267 275
268 //US ENH: adjust the headers of the table according the category texts 276 //US ENH: adjust the headers of the table according the category texts
269 { 277 {
270 PwMCategoryItem* catItem = doc->getCategoryEntry(catDocIndex); 278 PwMCategoryItem* catItem = doc->getCategoryEntry(catDocIndex);
271 // qDebug("PwMView::ShiftToView CAT: %i, %s", catDocIndex, catItem->name.c_str()); 279 // qDebug("PwMView::ShiftToView CAT: %i, %s", catDocIndex, catItem->name.c_str());
272 lv->setColumnText(COLUMN_DESC, catItem->desc_text.c_str()); 280 lv->setColumnText(COLUMN_DESC, catItem->desc_text.c_str());
273 lv->setColumnText(COLUMN_NAME, catItem->name_text.c_str()); 281 lv->setColumnText(COLUMN_NAME, catItem->name_text.c_str());
274 lv->setColumnText(COLUMN_PW, catItem->pw_text.c_str()); 282 lv->setColumnText(COLUMN_PW, catItem->pw_text.c_str());
275 } 283 }
276 284
277 QCheckListItem *newItem; 285 Q3CheckListItem *newItem;
278 vector<PwMDataItem>::iterator it = tmpSorted.begin(), 286 vector<PwMDataItem>::iterator it = tmpSorted.begin(),
279 end = tmpSorted.end(); 287 end = tmpSorted.end();
280 while (it != end) { 288 while (it != end) {
281 newItem = new ListViewItemPwM(lv); 289 newItem = new ListViewItemPwM(lv);
282 newItem->setText(COLUMN_DESC, (*it).desc.c_str()); 290 newItem->setText(COLUMN_DESC, (*it).desc.c_str());
283 if ((*it).binary) { 291 if ((*it).binary) {
284 newItem->setText(COLUMN_NAME, ""); 292 newItem->setText(COLUMN_NAME, "");
285 newItem->setText(COLUMN_PW, i18n("<BINARY ENTRY>")); 293 newItem->setText(COLUMN_PW, i18n("<BINARY ENTRY>"));
286 newItem->setText(COLUMN_URL, ""); 294 newItem->setText(COLUMN_URL, "");
287 newItem->setText(COLUMN_LAUNCHER, (*it).launcher.c_str()); 295 newItem->setText(COLUMN_LAUNCHER, (*it).launcher.c_str());
288 } else { 296 } else {
289 newItem->setText(COLUMN_NAME, (*it).name.c_str()); 297 newItem->setText(COLUMN_NAME, (*it).name.c_str());
@@ -304,25 +312,25 @@ void PwMView::shiftToView()
304 tmpReEnableSort(); 312 tmpReEnableSort();
305 313
306 if (cY || cX) 314 if (cY || cX)
307 lv->setContentsPos(cX, cY); 315 lv->setContentsPos(cX, cY);
308} 316}
309 317
310void PwMView::reorgLp() 318void PwMView::reorgLp()
311{ 319{
312 if (!lv->childCount()) 320 if (!lv->childCount())
313 return; 321 return;
314 PWM_ASSERT(doc); 322 PWM_ASSERT(doc);
315 PWM_ASSERT(!doc->isDocEmpty()); 323 PWM_ASSERT(!doc->isDocEmpty());
316 QListViewItem *currItem; 324 Q3ListViewItem *currItem;
317 vector<unsigned int> foundPos; 325 vector<unsigned int> foundPos;
318 /* This searchIn _should_ be: 326 /* This searchIn _should_ be:
319 *const unsigned int searchIn = SEARCH_IN_DESC; 327 *const unsigned int searchIn = SEARCH_IN_DESC;
320 * But we want backward compatibility (see comment in PwMDoc::addEntry()). 328 * But we want backward compatibility (see comment in PwMDoc::addEntry()).
321 * So we need to search again, if we don't find the entry. (see below) 329 * So we need to search again, if we don't find the entry. (see below)
322 */ 330 */
323 const unsigned int searchIn = SEARCH_IN_DESC | SEARCH_IN_NAME | 331 const unsigned int searchIn = SEARCH_IN_DESC | SEARCH_IN_NAME |
324 SEARCH_IN_URL | SEARCH_IN_LAUNCHER; 332 SEARCH_IN_URL | SEARCH_IN_LAUNCHER;
325 QString curCat(getCurrentCategory()); 333 QString curCat(getCurrentCategory());
326 PwMDataItem findThis; 334 PwMDataItem findThis;
327 unsigned int i, cnt = lv->childCount(); 335 unsigned int i, cnt = lv->childCount();
328 for (i = 0; i < cnt; ++i) { 336 for (i = 0; i < cnt; ++i) {
@@ -346,25 +354,25 @@ void PwMView::reorgLp()
346 continue; 354 continue;
347 } 355 }
348 /* We assert that it's a binary entry, now. 356 /* We assert that it's a binary entry, now.
349 * No chance to efficiently verify it here. 357 * No chance to efficiently verify it here.
350 */ 358 */
351 } 359 }
352 doc->setListViewPos(curCat, foundPos[0], cnt - i - 1); 360 doc->setListViewPos(curCat, foundPos[0], cnt - i - 1);
353 } 361 }
354} 362}
355 363
356void PwMView::selAt(int index) 364void PwMView::selAt(int index)
357{ 365{
358 QListViewItem *item = lv->itemAtIndex(index); 366 Q3ListViewItem *item = lv->itemAtIndex(index);
359 if (!item) 367 if (!item)
360 return; 368 return;
361 lv->setCurrentItem(item); 369 lv->setCurrentItem(item);
362 lv->ensureItemVisible(item); 370 lv->ensureItemVisible(item);
363} 371}
364 372
365void PwMView::renCatButton_slot() 373void PwMView::renCatButton_slot()
366{ 374{
367 if (doc->isDeepLocked()) 375 if (doc->isDeepLocked())
368 return; 376 return;
369 RenCatWnd wnd(this); 377 RenCatWnd wnd(this);
370 if (wnd.exec() == 1) { 378 if (wnd.exec() == 1) {
@@ -470,25 +478,25 @@ void PwMView::copyCommentToClip()
470 document()->getEntry(getCurrentCategory(), curIndex, &d); 478 document()->getEntry(getCurrentCategory(), curIndex, &d);
471 PwM::copyToClipboard(d.comment.c_str()); 479 PwM::copyToClipboard(d.comment.c_str());
472} 480}
473 481
474/************************************************************************ 482/************************************************************************
475 * 483 *
476 * 484 *
477 * 485 *
478 ************************************************************************/ 486 ************************************************************************/
479 487
480 488
481PwMDataItemView::PwMDataItemView( QWidget *parent, const char *name ) 489PwMDataItemView::PwMDataItemView( QWidget *parent, const char *name )
482 : QTextBrowser( parent, name ) 490 : Q3TextBrowser( parent, name )
483 491
484 492
485{ 493{
486//US setWrapPolicy( QTextEdit::AtWordBoundary ); 494//US setWrapPolicy( QTextEdit::AtWordBoundary );
487 setLinkUnderline( false ); 495 setLinkUnderline( false );
488 // setVScrollBarMode( QScrollView::AlwaysOff ); 496 // setVScrollBarMode( QScrollView::AlwaysOff );
489 //setHScrollBarMode( QScrollView::AlwaysOff ); 497 //setHScrollBarMode( QScrollView::AlwaysOff );
490 498
491//US QStyleSheet *sheet = styleSheet(); 499//US QStyleSheet *sheet = styleSheet();
492//US QStyleSheetItem *link = sheet->item( "a" ); 500//US QStyleSheetItem *link = sheet->item( "a" );
493//US link->setColor( KGlobalSettings::linkColor() ); 501//US link->setColor( KGlobalSettings::linkColor() );
494 502
@@ -557,42 +565,42 @@ PwMDataItem PwMDataItemView::pwmdataitem() const
557 ************************************************************************/ 565 ************************************************************************/
558 566
559 567
560PwMDataItemChooser::PwMDataItemChooser( PwMDataItem loc, PwMDataItem rem, bool takeloc, QWidget *parent, const char *name ) 568PwMDataItemChooser::PwMDataItemChooser( PwMDataItem loc, PwMDataItem rem, bool takeloc, QWidget *parent, const char *name )
561 : KDialogBase(parent, name, true , 569 : KDialogBase(parent, name, true ,
562 i18n("Conflict! Please choose Entry!"),Ok|User1|Close,Close, false) 570 i18n("Conflict! Please choose Entry!"),Ok|User1|Close,Close, false)
563{ 571{
564 findButton( Close )->setText( i18n("Cancel Sync")); 572 findButton( Close )->setText( i18n("Cancel Sync"));
565 findButton( Ok )->setText( i18n("Remote")); 573 findButton( Ok )->setText( i18n("Remote"));
566 findButton( User1 )->setText( i18n("Local")); 574 findButton( User1 )->setText( i18n("Local"));
567 QWidget* topframe = new QWidget( this ); 575 QWidget* topframe = new QWidget( this );
568 setMainWidget( topframe ); 576 setMainWidget( topframe );
569 QBoxLayout* bl; 577 Q3BoxLayout* bl;
570 if ( QApplication::desktop()->width() < 640 ) { 578 if ( QApplication::desktop()->width() < 640 ) {
571 bl = new QVBoxLayout( topframe ); 579 bl = new Q3VBoxLayout( topframe );
572 } else { 580 } else {
573 bl = new QHBoxLayout( topframe ); 581 bl = new Q3HBoxLayout( topframe );
574 } 582 }
575 QVBox* subframe = new QVBox( topframe ); 583 Q3VBox* subframe = new Q3VBox( topframe );
576 bl->addWidget(subframe ); 584 bl->addWidget(subframe );
577 QLabel* lab = new QLabel( i18n("Local Entry"), subframe ); 585 QLabel* lab = new QLabel( i18n("Local Entry"), subframe );
578 if ( takeloc ) 586 if ( takeloc )
579 lab->setBackgroundColor(Qt::green.light() ); 587 lab->setBackgroundColor(QColor(Qt::green).light() );
580 PwMDataItemView * av = new PwMDataItemView( subframe ); 588 PwMDataItemView * av = new PwMDataItemView( subframe );
581 av->setPwMDataItem( loc ); 589 av->setPwMDataItem( loc );
582 subframe = new QVBox( topframe ); 590 subframe = new Q3VBox( topframe );
583 bl->addWidget(subframe ); 591 bl->addWidget(subframe );
584 lab = new QLabel( i18n("Remote Entry"), subframe ); 592 lab = new QLabel( i18n("Remote Entry"), subframe );
585 if ( !takeloc ) 593 if ( !takeloc )
586 lab->setBackgroundColor(Qt::green.light() ); 594 lab->setBackgroundColor(QColor(Qt::green).light() );
587 av = new PwMDataItemView( subframe ); 595 av = new PwMDataItemView( subframe );
588 av->setPwMDataItem( rem ); 596 av->setPwMDataItem( rem );
589 QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); 597 QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote()));
590 QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local())); 598 QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local()));
591#ifndef DESKTOP_VERSION 599#ifndef DESKTOP_VERSION
592 showMaximized(); 600 showMaximized();
593#else 601#else
594 resize ( 640, 400 ); 602 resize ( 640, 400 );
595#endif 603#endif
596} 604}
597 605
598int PwMDataItemChooser::executeD( bool local ) 606int PwMDataItemChooser::executeD( bool local )
@@ -609,15 +617,15 @@ void PwMDataItemChooser::slot_remote()
609{ 617{
610 mSyncResult = 2; 618 mSyncResult = 2;
611 accept(); 619 accept();
612} 620}
613void PwMDataItemChooser::slot_local() 621void PwMDataItemChooser::slot_local()
614{ 622{
615 mSyncResult = 1; 623 mSyncResult = 1;
616 accept(); 624 accept();
617} 625}
618 626
619 627
620 628
621#ifndef PWM_EMBEDDED 629#ifndef PWM_EMBEDDED_
622#include "pwmview.moc" 630#include "moc_pwmview.cpp"
623#endif 631#endif
diff --git a/pwmanager/pwmanager/pwmview.h b/pwmanager/pwmanager/pwmview.h
index e42b17a..8f60063 100644
--- a/pwmanager/pwmanager/pwmview.h
+++ b/pwmanager/pwmanager/pwmview.h
@@ -32,25 +32,29 @@
32 32
33#include "listviewpwm.h" 33#include "listviewpwm.h"
34#include "pwmdoc.h" 34#include "pwmdoc.h"
35#include "pwmviewstyle.h" 35#include "pwmviewstyle.h"
36 36
37#include <kconfig.h> 37#include <kconfig.h>
38#include <klocale.h> 38#include <klocale.h>
39#include <kdialogbase.h> 39#include <kdialogbase.h>
40 40
41#include <qevent.h> 41#include <qevent.h>
42#include <qfont.h> 42#include <qfont.h>
43#include <qobject.h> 43#include <qobject.h>
44#include <qtextbrowser.h> 44#include <q3textbrowser.h>
45//Added by qt3to4:
46#include <QResizeEvent>
47#include <QKeyEvent>
48#include <Q3PopupMenu>
45 49
46#include <vector> 50#include <vector>
47#include <string> 51#include <string>
48 52
49using std::string; 53using std::string;
50using std::vector; 54using std::vector;
51 55
52class PwM; 56class PwM;
53class ConfFile; 57class ConfFile;
54class PwMStatusBar; 58class PwMStatusBar;
55 59
56 60
@@ -68,72 +72,72 @@ public:
68 72
69 /** returns pointer to the document */ 73 /** returns pointer to the document */
70 PwMDoc* document() 74 PwMDoc* document()
71 { return doc; } 75 { return doc; }
72 /** returns the index of the currently selected entry. 76 /** returns the index of the currently selected entry.
73 * (index as represented in PwMDoc !) 77 * (index as represented in PwMDoc !)
74 */ 78 */
75 bool getCurEntryIndex(unsigned int *index); 79 bool getCurEntryIndex(unsigned int *index);
76 /** returns the position of the given item in the document 80 /** returns the position of the given item in the document
77 * Note: This func only serches in the current category. 81 * Note: This func only serches in the current category.
78 */ 82 */
79 bool getDocEntryIndex(unsigned int *index, 83 bool getDocEntryIndex(unsigned int *index,
80 const QListViewItem *item); 84 const Q3ListViewItem *item);
81 85
82public slots: 86public slots:
83 /** update the view (call if dirty) */ 87 /** update the view (call if dirty) */
84 void updateView() 88 void updateView()
85 { 89 {
86 updateCategories(); 90 updateCategories();
87 shiftToView(); 91 shiftToView();
88 } 92 }
89 /** (re)sort all items and (re)shift them to listView. */ 93 /** (re)sort all items and (re)shift them to listView. */
90 void shiftToView(); 94 void shiftToView();
91 /** handle clicking on an item */ 95 /** handle clicking on an item */
92 void handleToggle(QListViewItem *item); 96 void handleToggle(Q3ListViewItem *item);
93 /** handle right-clicking on an item */ 97 /** handle right-clicking on an item */
94 void handleRightClick(QListViewItem *item, const QPoint &point, int); 98 void handleRightClick(Q3ListViewItem *item, const QPoint &point, int);
95 /** selects the item at "index" */ 99 /** selects the item at "index" */
96 void selAt(int index); 100 void selAt(int index);
97 /** rename category button pressed */ 101 /** rename category button pressed */
98 void renCatButton_slot(); 102 void renCatButton_slot();
99 /** delete category button pressed */ 103 /** delete category button pressed */
100 void delCatButton_slot(); 104 void delCatButton_slot();
101 105
102protected: 106protected:
103 /** right-click context-menu */ 107 /** right-click context-menu */
104 QPopupMenu *ctxMenu; 108 Q3PopupMenu *ctxMenu;
105 109
106protected: 110protected:
107 /** update the categories from document */ 111 /** update the categories from document */
108 void updateCategories(); 112 void updateCategories();
109 /** widget resize event */ 113 /** widget resize event */
110 void resizeEvent(QResizeEvent *); 114 void resizeEvent(QResizeEvent *);
111 /** initialize context-menu */ 115 /** initialize context-menu */
112 void initCtxMenu(); 116 void initCtxMenu();
113 /** tempoarly disable auto-sorting and user-sorting */ 117 /** tempoarly disable auto-sorting and user-sorting */
114 void tmpDisableSort() 118 void tmpDisableSort()
115 { lv->setSorting(-1); } 119 { lv->setSorting(-1); }
116 /** re-enable tempoarly disabled sorting */ 120 /** re-enable tempoarly disabled sorting */
117 void tmpReEnableSort() 121 void tmpReEnableSort()
118 { 122 {
119 lv->setSorting(lv->columns() + 1, 123 lv->setSorting(lv->columns() + 1,
120 true/*lv->sortOrder() == Qt::Ascending*/); 124 true/*lv->sortOrder() == Qt::Ascending*/);
121 } 125 }
122 /** The user pressed and released a key. */ 126 /** The user pressed and released a key. */
123 void keyReleaseEvent(QKeyEvent *e); 127 void keyReleaseEvent(QKeyEvent *e);
124 128
125protected slots: 129protected slots:
126 /** changes the comment text-edit, because a new item has been selected */ 130 /** changes the comment text-edit, because a new item has been selected */
127 void refreshCommentTextEdit(QListViewItem *curItem); 131 void refreshCommentTextEdit(Q3ListViewItem *curItem);
128 /** copy pw to clipboard */ 132 /** copy pw to clipboard */
129 void copyPwToClip(); 133 void copyPwToClip();
130 /** copy name to clipboard */ 134 /** copy name to clipboard */
131 void copyNameToClip(); 135 void copyNameToClip();
132 /** copy desc to clipboard */ 136 /** copy desc to clipboard */
133 void copyDescToClip(); 137 void copyDescToClip();
134 /** copy url to clipboard */ 138 /** copy url to clipboard */
135 void copyUrlToClip(); 139 void copyUrlToClip();
136 /** copy launcher to clipboard */ 140 /** copy launcher to clipboard */
137 void copyLauncherToClip(); 141 void copyLauncherToClip();
138 /** copy comment to clipboard */ 142 /** copy comment to clipboard */
139 void copyCommentToClip(); 143 void copyCommentToClip();
@@ -143,25 +147,25 @@ protected slots:
143 void reorgLp(); 147 void reorgLp();
144 148
145private: 149private:
146 /** document */ 150 /** document */
147 PwMDoc *doc; 151 PwMDoc *doc;
148 /** pointer to the main class "PwM" */ 152 /** pointer to the main class "PwM" */
149 PwM *mainClass; 153 PwM *mainClass;
150}; 154};
151 155
152 156
153//US ENH basic widget to view an password entry. We need it for the sync stuff. 157//US ENH basic widget to view an password entry. We need it for the sync stuff.
154//But might be oif interest for other functionalities as well. 158//But might be oif interest for other functionalities as well.
155class PwMDataItemView : public QTextBrowser 159class PwMDataItemView : public Q3TextBrowser
156{ 160{
157 public: 161 public:
158 PwMDataItemView( QWidget *parent = 0, const char *name = 0 ); 162 PwMDataItemView( QWidget *parent = 0, const char *name = 0 );
159 163
160 /** 164 /**
161 Sets the PwMDataItem object. It is displayed immediately. 165 Sets the PwMDataItem object. It is displayed immediately.
162 166
163 @param a The PwMDataItem object. 167 @param a The PwMDataItem object.
164 */ 168 */
165 void setPwMDataItem( const PwMDataItem& a ); 169 void setPwMDataItem( const PwMDataItem& a );
166 170
167 /** 171 /**
diff --git a/pwmanager/pwmanager/pwmviewstyle.cpp b/pwmanager/pwmanager/pwmviewstyle.cpp
index ee35472..b6d930f 100644
--- a/pwmanager/pwmanager/pwmviewstyle.cpp
+++ b/pwmanager/pwmanager/pwmviewstyle.cpp
@@ -52,25 +52,25 @@ PwMViewStyle::~PwMViewStyle()
52 break; 52 break;
53 default: 53 default:
54 BUG(); 54 BUG();
55 } 55 }
56 56
57 57
58 PWMPrefs::instance()->writeConfig(); 58 PWMPrefs::instance()->writeConfig();
59 59
60 delete_ifnot_null(s0); 60 delete_ifnot_null(s0);
61 delete_ifnot_null(s1); 61 delete_ifnot_null(s1);
62} 62}
63 63
64void PwMViewStyle::editPassWord( QListViewItem * i ) 64void PwMViewStyle::editPassWord( Q3ListViewItem * i )
65{ 65{
66 if ( !i ) 66 if ( !i )
67 return; 67 return;
68 emit editPW(); 68 emit editPW();
69} 69}
70void PwMViewStyle::initStyle(style_t style) 70void PwMViewStyle::initStyle(style_t style)
71{ 71{
72 printDebug(string("initializing style ") + tostr(style)); 72 printDebug(string("initializing style ") + tostr(style));
73 bool wasMaximized = v->isMaximized(); 73 bool wasMaximized = v->isMaximized();
74 if (v->isVisible()) 74 if (v->isVisible())
75 v->hide(); 75 v->hide();
76 switch (style) { 76 switch (style) {
@@ -84,34 +84,34 @@ void PwMViewStyle::initStyle(style_t style)
84 case style_1: 84 case style_1:
85 delete_ifnot_null(s0); 85 delete_ifnot_null(s0);
86 delete_ifnot_null(s1); 86 delete_ifnot_null(s1);
87 s1 = new PwMViewStyle_1(v); 87 s1 = new PwMViewStyle_1(v);
88 lv = s1->getLv(); 88 lv = s1->getLv();
89 commentBox = s1->getCommentBox(); 89 commentBox = s1->getCommentBox();
90 break; 90 break;
91 default: 91 default:
92 BUG(); 92 BUG();
93 return; 93 return;
94 } 94 }
95 curStyle = style; 95 curStyle = style;
96 connect(lv, SIGNAL(pressed(QListViewItem *)), 96 connect(lv, SIGNAL(pressed(Q3ListViewItem *)),
97 v, SLOT(handleToggle(QListViewItem *))); 97 v, SLOT(handleToggle(Q3ListViewItem *)));
98 connect(lv, SIGNAL(rightButtonClicked(QListViewItem *, const QPoint &, int)), 98 connect(lv, SIGNAL(rightButtonClicked(Q3ListViewItem *, const QPoint &, int)),
99 v, SLOT(handleRightClick(QListViewItem *, const QPoint &, int))); 99 v, SLOT(handleRightClick(Q3ListViewItem *, const QPoint &, int)));
100 connect(lv, SIGNAL(clicked(QListViewItem *)), 100 connect(lv, SIGNAL(clicked(Q3ListViewItem *)),
101 v, SLOT(refreshCommentTextEdit(QListViewItem *))); 101 v, SLOT(refreshCommentTextEdit(Q3ListViewItem *)));
102 connect(lv, SIGNAL(returnPressed(QListViewItem *)), 102 connect(lv, SIGNAL(returnPressed(Q3ListViewItem *)),
103 this, SLOT(editPassWord(QListViewItem *))); 103 this, SLOT(editPassWord(Q3ListViewItem *)));
104 connect(lv, SIGNAL(doubleClicked(QListViewItem *)), 104 connect(lv, SIGNAL(doubleClicked(Q3ListViewItem *)),
105 this, SLOT(editPassWord(QListViewItem *))); 105 this, SLOT(editPassWord(Q3ListViewItem *)));
106 connect(lv, SIGNAL(insertPW()), 106 connect(lv, SIGNAL(insertPW()),
107 this, SIGNAL( insertPW() )); 107 this, SIGNAL( insertPW() ));
108 connect(lv, SIGNAL(deletePW()), 108 connect(lv, SIGNAL(deletePW()),
109 this, SIGNAL( deletePW() )); 109 this, SIGNAL( deletePW() ));
110 110
111 lv->addColumn(i18n("Description"), 180); 111 lv->addColumn(i18n("Description"), 180);
112 lv->addColumn(i18n("Username"), 150); 112 lv->addColumn(i18n("Username"), 150);
113 lv->addColumn(i18n("Password"), 150); 113 lv->addColumn(i18n("Password"), 150);
114 lv->addColumn(i18n("URL"), 180); 114 lv->addColumn(i18n("URL"), 180);
115 lv->addColumn(i18n("Launcher"), 120); 115 lv->addColumn(i18n("Launcher"), 120);
116 v->tmpReEnableSort(); 116 v->tmpReEnableSort();
117 117
@@ -240,15 +240,15 @@ int PwMViewStyle::numCategories()
240 case style_0: 240 case style_0:
241 PWM_ASSERT(s0); 241 PWM_ASSERT(s0);
242 return s0->numCategories(); 242 return s0->numCategories();
243 case style_1: 243 case style_1:
244 PWM_ASSERT(s1); 244 PWM_ASSERT(s1);
245 return s1->numCategories(); 245 return s1->numCategories();
246 default: 246 default:
247 BUG(); 247 BUG();
248 } 248 }
249 return 0; 249 return 0;
250} 250}
251 251
252#ifndef PWM_EMBEDDED 252#ifndef PWM_EMBEDDED_
253#include "pwmviewstyle.moc" 253#include "moc_pwmviewstyle.cpp"
254#endif 254#endif
diff --git a/pwmanager/pwmanager/pwmviewstyle.h b/pwmanager/pwmanager/pwmviewstyle.h
index 6c2d81c..a7dccbe 100644
--- a/pwmanager/pwmanager/pwmviewstyle.h
+++ b/pwmanager/pwmanager/pwmviewstyle.h
@@ -14,44 +14,44 @@
14 * copyright (C) 2004 by Ulf Schenk 14 * copyright (C) 2004 by Ulf Schenk
15 * This file is originaly based on version 1.0.1 of pwmanager 15 * This file is originaly based on version 1.0.1 of pwmanager
16 * and was modified to run on embedded devices that run microkde 16 * and was modified to run on embedded devices that run microkde
17 * 17 *
18 * $Id$ 18 * $Id$
19 **************************************************************************/ 19 **************************************************************************/
20 20
21#ifndef PWMVIEWSTYLE_H 21#ifndef PWMVIEWSTYLE_H
22#define PWMVIEWSTYLE_H 22#define PWMVIEWSTYLE_H
23 23
24#include <qwidget.h> 24#include <qwidget.h>
25#include <qsplitter.h> 25#include <qsplitter.h>
26#include <qhbox.h> 26#include <q3hbox.h>
27#include <qvbox.h> 27#include <q3vbox.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qpopupmenu.h> 29#include <q3popupmenu.h>
30#ifndef PWM_EMBEDDED 30#ifndef PWM_EMBEDDED
31#include <qtextedit.h> 31#include <q3textedit.h>
32#else 32#else
33#include <qmultilineedit.h> 33#include <q3multilineedit.h>
34#endif 34#endif
35 35
36#include <qlabel.h> 36#include <qlabel.h>
37#include <qlistbox.h> 37#include <q3listbox.h>
38#include <qcombobox.h> 38#include <qcombobox.h>
39#include <qsize.h> 39#include <qsize.h>
40 40
41class ListViewPwM; 41class ListViewPwM;
42class PwMViewStyle_0; 42class PwMViewStyle_0;
43class PwMViewStyle_1; 43class PwMViewStyle_1;
44class PwMView; 44class PwMView;
45class QListViewItem; 45class Q3ListViewItem;
46class CommentBox; 46class CommentBox;
47 47
48class PwMViewStyle : public QWidget 48class PwMViewStyle : public QWidget
49{ 49{
50 Q_OBJECT 50 Q_OBJECT
51 51
52public: 52public:
53 enum style_t 53 enum style_t
54 { 54 {
55 style_notset= -1, 55 style_notset= -1,
56 style_0 = 0, 56 style_0 = 0,
57 style_1 = 1 57 style_1 = 1
@@ -85,25 +85,25 @@ protected:
85 void selectCategory(const QString &cat); 85 void selectCategory(const QString &cat);
86 /** returns the number of categories in this view. 86 /** returns the number of categories in this view.
87 * This value dosn't say anything about the number of 87 * This value dosn't say anything about the number of
88 * categories in the document. 88 * categories in the document.
89 */ 89 */
90 int numCategories(); 90 int numCategories();
91 /** resize the view */ 91 /** resize the view */
92 void resizeView(const QSize &size); 92 void resizeView(const QSize &size);
93 ListViewPwM *lv; 93 ListViewPwM *lv;
94 CommentBox *commentBox; 94 CommentBox *commentBox;
95 95
96protected slots: 96protected slots:
97 void editPassWord( QListViewItem * ); 97 void editPassWord( Q3ListViewItem * );
98 98
99private: 99private:
100 /** which style has the view? 100 /** which style has the view?
101 * KListBox on the left, 101 * KListBox on the left,
102 * or QComboBox on the top? 102 * or QComboBox on the top?
103 */ 103 */
104 style_t curStyle; 104 style_t curStyle;
105 105
106 PwMViewStyle_0 *s0; 106 PwMViewStyle_0 *s0;
107 PwMViewStyle_1 *s1; 107 PwMViewStyle_1 *s1;
108 PwMView *v; 108 PwMView *v;
109 signals: 109 signals:
diff --git a/pwmanager/pwmanager/pwmviewstyle_0.cpp b/pwmanager/pwmanager/pwmviewstyle_0.cpp
index 1d88a34..3d1f41f 100644
--- a/pwmanager/pwmanager/pwmviewstyle_0.cpp
+++ b/pwmanager/pwmanager/pwmviewstyle_0.cpp
@@ -17,46 +17,49 @@
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "pwmviewstyle_0.h" 20#include "pwmviewstyle_0.h"
21#include "pwmview.h" 21#include "pwmview.h"
22#include "listviewpwm.h" 22#include "listviewpwm.h"
23#include "commentbox.h" 23#include "commentbox.h"
24 24
25#include <klocale.h> 25#include <klocale.h>
26#include <kglobal.h> 26#include <kglobal.h>
27#include <kiconloader.h> 27#include <kiconloader.h>
28#include "pwmprefs.h" 28#include "pwmprefs.h"
29//Added by qt3to4:
30#include <QLabel>
31#include <Q3ValueList>
29 32
30PwMViewStyle_0::PwMViewStyle_0(PwMView *view) 33PwMViewStyle_0::PwMViewStyle_0(PwMView *view)
31 : QObject() 34 : QObject()
32{ 35{
33 vbox1 = new QVBox(view); 36 vbox1 = new Q3VBox(view);
34 vbox1->setSpacing(0); 37 vbox1->setSpacing(0);
35 hbox1 = new QHBox(vbox1); 38 hbox1 = new Q3HBox(vbox1);
36 hbox1->setSpacing(0); 39 hbox1->setSpacing(0);
37 categoriesTitle = new QLabel(hbox1); 40 categoriesTitle = new QLabel(hbox1);
38 categoriesTitle->setText(i18n("Category:")); 41 categoriesTitle->setText(i18n("Category:"));
39 categoriesCombo = new QComboBox(hbox1); 42 categoriesCombo = new QComboBox(hbox1);
40 categoriesCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred )); 43 categoriesCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred ));
41 renCatButton = new QPushButton( hbox1); 44 renCatButton = new QPushButton( hbox1);
42 renCatButton->setPixmap (KGlobal::iconLoader()->loadIcon("edit", KIcon::Small) ); 45 renCatButton->setPixmap (KGlobal::iconLoader()->loadIcon("edit", KIcon::Small) );
43 int maxsi = renCatButton->sizeHint().height()+4; 46 int maxsi = renCatButton->sizeHint().height()+4;
44 renCatButton->setMinimumSize( maxsi, maxsi ); 47 renCatButton->setMinimumSize( maxsi, maxsi );
45 delCatButton = new QPushButton( hbox1); 48 delCatButton = new QPushButton( hbox1);
46 delCatButton->setPixmap (KGlobal::iconLoader()->loadIcon("editdelete", KIcon::Small) ); 49 delCatButton->setPixmap (KGlobal::iconLoader()->loadIcon("editdelete", KIcon::Small) );
47 maxsi = delCatButton->sizeHint().height()+4; 50 maxsi = delCatButton->sizeHint().height()+4;
48 delCatButton->setMinimumSize( maxsi, maxsi ); 51 delCatButton->setMinimumSize( maxsi, maxsi );
49 delCatButton->setFocusPolicy( QWidget::NoFocus ); 52 delCatButton->setFocusPolicy( Qt::NoFocus );
50 renCatButton->setFocusPolicy( QWidget::NoFocus ); 53 renCatButton->setFocusPolicy( Qt::NoFocus );
51 54
52#ifndef PWM_EMBEDDED 55#ifndef PWM_EMBEDDED
53 splitter1 = new QSplitter(vbox1); 56 splitter1 = new QSplitter(vbox1);
54 splitter1->setOrientation(Qt::Vertical); 57 splitter1->setOrientation(Qt::Vertical);
55#else 58#else
56 splitter1 = new KDGanttMinimizeSplitter( Qt::Vertical, vbox1); 59 splitter1 = new KDGanttMinimizeSplitter( Qt::Vertical, vbox1);
57 splitter1->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 60 splitter1->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
58 61
59 //US topLayout->addWidget(mMiniSplitter ); 62 //US topLayout->addWidget(mMiniSplitter );
60#endif 63#endif
61 lv = new ListViewPwM(splitter1); 64 lv = new ListViewPwM(splitter1);
62 commentBox = new CommentBox(splitter1); 65 commentBox = new CommentBox(splitter1);
@@ -72,27 +75,27 @@ PwMViewStyle_0::PwMViewStyle_0(PwMView *view)
72 view, SLOT(delCatButton_slot())); 75 view, SLOT(delCatButton_slot()));
73 connect(lv, SIGNAL(toggleOverview()), 76 connect(lv, SIGNAL(toggleOverview()),
74 this, SLOT(toggleSplitter())); 77 this, SLOT(toggleSplitter()));
75} 78}
76 79
77PwMViewStyle_0::~PwMViewStyle_0() 80PwMViewStyle_0::~PwMViewStyle_0()
78{ 81{
79 delete vbox1; 82 delete vbox1;
80} 83}
81void PwMViewStyle_0::toggleSplitter() 84void PwMViewStyle_0::toggleSplitter()
82{ 85{
83 86
84 QValueList<int> si = splitter1->sizes(); 87 Q3ValueList<int> si = splitter1->sizes();
85 splitter1->toggle(); 88 splitter1->toggle();
86 QValueList<int> si2 = splitter1->sizes(); 89 Q3ValueList<int> si2 = splitter1->sizes();
87 //qDebug("PwMViewStyle_0::toggleSplitter() %d %d %d %d", si[0],si[1],si2[0],si2[1] ); 90 //qDebug("PwMViewStyle_0::toggleSplitter() %d %d %d %d", si[0],si[1],si2[0],si2[1] );
88 if ( si[0] == si2[0] && si[1] == si2[1] && si2[1] == 1 ) { 91 if ( si[0] == si2[0] && si[1] == si2[1] && si2[1] == 1 ) {
89 int diff = si[0]/2; 92 int diff = si[0]/2;
90 if ( diff > 200 ) 93 if ( diff > 200 )
91 diff = 200; 94 diff = 200;
92 si[0] -= diff; 95 si[0] -= diff;
93 si[1] += diff; 96 si[1] += diff;
94 splitter1->toggle(); 97 splitter1->toggle();
95 splitter1->setSizes( si ); 98 splitter1->setSizes( si );
96 } 99 }
97 100
98} 101}
diff --git a/pwmanager/pwmanager/pwmviewstyle_0.h b/pwmanager/pwmanager/pwmviewstyle_0.h
index 6d3c1d1..f144eec 100644
--- a/pwmanager/pwmanager/pwmviewstyle_0.h
+++ b/pwmanager/pwmanager/pwmviewstyle_0.h
@@ -11,32 +11,32 @@
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef PWMVIEWSTYLE_0_H 20#ifndef PWMVIEWSTYLE_0_H
21#define PWMVIEWSTYLE_0_H 21#define PWMVIEWSTYLE_0_H
22 22
23#include <qhbox.h> 23#include <q3hbox.h>
24#include <qvbox.h> 24#include <q3vbox.h>
25#include <qpushbutton.h> 25#include <qpushbutton.h>
26#ifndef PWM_EMBEDDED 26#ifndef PWM_EMBEDDED
27#include <qtextedit.h> 27#include <q3textedit.h>
28#include <qsplitter.h> 28#include <qsplitter.h>
29#else 29#else
30#include <qmultilineedit.h> 30#include <q3multilineedit.h>
31#include <KDGanttMinimizeSplitter.h> 31#include <KDGanttMinimizeSplitter.h>
32#endif 32#endif
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qcombobox.h> 34#include <qcombobox.h>
35 35
36class PwMView; 36class PwMView;
37class ListViewPwM; 37class ListViewPwM;
38class CommentBox; 38class CommentBox;
39class PWMPrefs; 39class PWMPrefs;
40 40
41class PwMViewStyle_0 : public QObject 41class PwMViewStyle_0 : public QObject
42{ 42{
@@ -78,27 +78,27 @@ public:
78 void saveSettings(PWMPrefs* prefs); 78 void saveSettings(PWMPrefs* prefs);
79 79
80public slots: 80public slots:
81 void toggleSplitter(); 81 void toggleSplitter();
82protected: 82protected:
83 /** main list view */ 83 /** main list view */
84 ListViewPwM *lv; 84 ListViewPwM *lv;
85 /** categories combo-box */ 85 /** categories combo-box */
86 QComboBox *categoriesCombo; 86 QComboBox *categoriesCombo;
87 /** title string for the categories combo or list box */ 87 /** title string for the categories combo or list box */
88 QLabel *categoriesTitle; 88 QLabel *categoriesTitle;
89 /** hbox1 for widget style */ 89 /** hbox1 for widget style */
90 QHBox *hbox1; 90 Q3HBox *hbox1;
91 /** vbox1 for widget style */ 91 /** vbox1 for widget style */
92 QVBox *vbox1; 92 Q3VBox *vbox1;
93 /** splitter for commentTextEdit */ 93 /** splitter for commentTextEdit */
94 #ifndef PWM_EMBEDDED 94 #ifndef PWM_EMBEDDED
95 QSplitter *splitter1; 95 QSplitter *splitter1;
96#else 96#else
97 KDGanttMinimizeSplitter * splitter1; 97 KDGanttMinimizeSplitter * splitter1;
98#endif 98#endif
99 /** push button to change the category name */ 99 /** push button to change the category name */
100 QPushButton *renCatButton; 100 QPushButton *renCatButton;
101 /** push button to delete the category */ 101 /** push button to delete the category */
102 QPushButton *delCatButton; 102 QPushButton *delCatButton;
103 /** comment box */ 103 /** comment box */
104 CommentBox *commentBox; 104 CommentBox *commentBox;
diff --git a/pwmanager/pwmanager/pwmviewstyle_1.cpp b/pwmanager/pwmanager/pwmviewstyle_1.cpp
index e335a3f..83eed97 100644
--- a/pwmanager/pwmanager/pwmviewstyle_1.cpp
+++ b/pwmanager/pwmanager/pwmviewstyle_1.cpp
@@ -20,24 +20,30 @@
20#include "pwmviewstyle_1.h" 20#include "pwmviewstyle_1.h"
21#include "pwmview.h" 21#include "pwmview.h"
22#include "listviewpwm.h" 22#include "listviewpwm.h"
23#include "commentbox.h" 23#include "commentbox.h"
24 24
25#include <klocale.h> 25#include <klocale.h>
26#include "pwmprefs.h" 26#include "pwmprefs.h"
27 27
28#ifndef DESKTOP_VERSION 28#ifndef DESKTOP_VERSION
29#include <qpe/qpeapplication.h> 29#include <qpe/qpeapplication.h>
30#else 30#else
31#include <qapplication.h> 31#include <qapplication.h>
32#include <QDesktopWidget>
33//Added by qt3to4:
34#include <QLabel>
35#include <Q3ValueList>
36#include <Q3Frame>
37#include <Q3PopupMenu>
32#endif 38#endif
33 #define INITIAL_CATEGORIES_WIDTH100 39 #define INITIAL_CATEGORIES_WIDTH100
34 40
35PwMViewStyle_1::PwMViewStyle_1(PwMView *view) 41PwMViewStyle_1::PwMViewStyle_1(PwMView *view)
36 : QObject() 42 : QObject()
37{ 43{
38#ifndef PWM_EMBEDDED 44#ifndef PWM_EMBEDDED
39 splitter = new QSplitter(view); 45 splitter = new QSplitter(view);
40#else 46#else
41 if ( QApplication::desktop()->width() > 240 ) { 47 if ( QApplication::desktop()->width() > 240 ) {
42 splitter = new KDGanttMinimizeSplitter( Qt::Horizontal, view); 48 splitter = new KDGanttMinimizeSplitter( Qt::Horizontal, view);
43 splitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Left ); 49 splitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Left );
@@ -45,101 +51,101 @@ PwMViewStyle_1::PwMViewStyle_1(PwMView *view)
45 // mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 51 // mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
46 // mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 52 // mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
47 } else { 53 } else {
48 splitter = new KDGanttMinimizeSplitter( Qt::Vertical, view); 54 splitter = new KDGanttMinimizeSplitter( Qt::Vertical, view);
49 splitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 55 splitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
50 // topLayout = new QHBoxLayout( this ); 56 // topLayout = new QHBoxLayout( this );
51 // mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); 57 // mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
52 // mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 58 // mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
53 } 59 }
54 //US topLayout->addWidget(mMiniSplitter ); 60 //US topLayout->addWidget(mMiniSplitter );
55#endif 61#endif
56 62
57 vbox1 = new QVBox(splitter); 63 vbox1 = new Q3VBox(splitter);
58 categoriesTitle = new QLabel(vbox1); 64 categoriesTitle = new QLabel(vbox1);
59 categoriesList = new QListBox(vbox1); 65 categoriesList = new Q3ListBox(vbox1);
60#ifndef PWM_EMBEDDED 66#ifndef PWM_EMBEDDED
61 splitter2 = new QSplitter(splitter); 67 splitter2 = new QSplitter(splitter);
62 splitter2->setOrientation(Qt::Vertical); 68 splitter2->setOrientation(Qt::Vertical);
63#else 69#else
64 splitter2 = new KDGanttMinimizeSplitter( Qt::Vertical, splitter); 70 splitter2 = new KDGanttMinimizeSplitter( Qt::Vertical, splitter);
65 splitter2->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 71 splitter2->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
66 72
67 //US topLayout->addWidget(mMiniSplitter ); 73 //US topLayout->addWidget(mMiniSplitter );
68#endif 74#endif
69 lv = new ListViewPwM(splitter2); 75 lv = new ListViewPwM(splitter2);
70 commentBox = new CommentBox(splitter2); 76 commentBox = new CommentBox(splitter2);
71 // set sizes and styles 77 // set sizes and styles
72 //UScommentBox->resize(commentBox->size().width(), 60); 78 //UScommentBox->resize(commentBox->size().width(), 60);
73 QValueList<int> sizes; 79 Q3ValueList<int> sizes;
74#ifndef PWM_EMBEDDED 80#ifndef PWM_EMBEDDED
75 sizes.push_back(INITIAL_CATEGORIES_WIDTH); 81 sizes.push_back(INITIAL_CATEGORIES_WIDTH);
76 sizes.push_back(view->height() - INITIAL_CATEGORIES_WIDTH); 82 sizes.push_back(view->height() - INITIAL_CATEGORIES_WIDTH);
77#else 83#else
78 sizes.append(INITIAL_CATEGORIES_WIDTH); 84 sizes.append(INITIAL_CATEGORIES_WIDTH);
79 sizes.append(view->height() - INITIAL_CATEGORIES_WIDTH); 85 sizes.append(view->height() - INITIAL_CATEGORIES_WIDTH);
80#endif 86#endif
81 //USsplitter->setSizes(sizes); 87 //USsplitter->setSizes(sizes);
82 categoriesTitle->setAlignment(Qt::AlignHCenter); 88 categoriesTitle->setAlignment(Qt::AlignHCenter);
83#ifndef PWM_EMBEDDED 89#ifndef PWM_EMBEDDED
84 categoriesTitle->setFrameShape(QFrame::MenuBarPanel); 90 categoriesTitle->setFrameShape(Q3Frame::MenuBarPanel);
85#else 91#else
86 //categoriesTitle->setFrameShape(QFrame::StyledPanel); 92 //categoriesTitle->setFrameShape(QFrame::StyledPanel);
87#endif 93#endif
88 categoriesTitle->setText(i18n("Category:")); 94 categoriesTitle->setText(i18n("Category:"));
89 catCtxMenu = new QPopupMenu(view); 95 catCtxMenu = new Q3PopupMenu(view);
90 catCtxMenu->insertItem(i18n("&Rename"), 96 catCtxMenu->insertItem(i18n("&Rename"),
91 view, SLOT(renCatButton_slot())); 97 view, SLOT(renCatButton_slot()));
92 catCtxMenu->insertItem(i18n("&Delete"), 98 catCtxMenu->insertItem(i18n("&Delete"),
93 view, SLOT(delCatButton_slot())); 99 view, SLOT(delCatButton_slot()));
94 100
95#ifndef DESKTOP_VERSION 101#ifndef DESKTOP_VERSION
96 QPEApplication::setStylusOperation( categoriesList->viewport(), QPEApplication::RightOnHold ); 102 QPEApplication::setStylusOperation( categoriesList->viewport(), QPEApplication::RightOnHold );
97#endif 103#endif
98 104
99 // connections 105 // connections
100 connect(categoriesList, SIGNAL(highlighted(int)), 106 connect(categoriesList, SIGNAL(highlighted(int)),
101 view, SLOT(shiftToView())); 107 view, SLOT(shiftToView()));
102 connect(categoriesList, 108 connect(categoriesList,
103 SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)), 109 SIGNAL(rightButtonClicked(Q3ListBoxItem *, const QPoint &)),
104 this, 110 this,
105 SLOT(catRightClick(QListBoxItem *, const QPoint &))); 111 SLOT(catRightClick(Q3ListBoxItem *, const QPoint &)));
106 112
107 connect(lv, SIGNAL(toggleOverview()), 113 connect(lv, SIGNAL(toggleOverview()),
108 this, SLOT(toggleSplitter())); 114 this, SLOT(toggleSplitter()));
109} 115}
110 116
111PwMViewStyle_1::~PwMViewStyle_1() 117PwMViewStyle_1::~PwMViewStyle_1()
112{ 118{
113 delete catCtxMenu; 119 delete catCtxMenu;
114 delete splitter; 120 delete splitter;
115} 121}
116void PwMViewStyle_1::toggleSplitter() 122void PwMViewStyle_1::toggleSplitter()
117{ 123{
118 QValueList<int> si = splitter2->sizes(); 124 Q3ValueList<int> si = splitter2->sizes();
119 splitter2->toggle(); 125 splitter2->toggle();
120 QValueList<int> si2 = splitter2->sizes(); 126 Q3ValueList<int> si2 = splitter2->sizes();
121 //qDebug("PwMViewStyle_1::toggleSplitter() %d %d %d %d", si[0],si[1],si2[0],si2[1] ); 127 //qDebug("PwMViewStyle_1::toggleSplitter() %d %d %d %d", si[0],si[1],si2[0],si2[1] );
122 if ( si[0] == si2[0] && si[1] == si2[1] && si2[1] == 1 ) { 128 if ( si[0] == si2[0] && si[1] == si2[1] && si2[1] == 1 ) {
123 int diff = si[0]/2; 129 int diff = si[0]/2;
124 if ( diff > 200 ) 130 if ( diff > 200 )
125 diff = 200; 131 diff = 200;
126 si[0] -= diff; 132 si[0] -= diff;
127 si[1] += diff; 133 si[1] += diff;
128 splitter2->toggle(); 134 splitter2->toggle();
129 splitter2->setSizes( si ); 135 splitter2->setSizes( si );
130 } 136 }
131} 137}
132 138
133void PwMViewStyle_1::catRightClick(QListBoxItem *item, const QPoint &point) 139void PwMViewStyle_1::catRightClick(Q3ListBoxItem *item, const QPoint &point)
134{ 140{
135 if (!item) 141 if (!item)
136 return; 142 return;
137 catCtxMenu->move(point); 143 catCtxMenu->move(point);
138 catCtxMenu->show(); 144 catCtxMenu->show();
139} 145}
140 146
141void PwMViewStyle_1::delCategory(const QString &cat) 147void PwMViewStyle_1::delCategory(const QString &cat)
142{ 148{
143 PWM_ASSERT(categoriesList); 149 PWM_ASSERT(categoriesList);
144 int i, count = categoriesList->count(); 150 int i, count = categoriesList->count();
145 for (i = 0; i < count; ++i) { 151 for (i = 0; i < count; ++i) {
@@ -178,15 +184,15 @@ void PwMViewStyle_1::restoreSettings(PWMPrefs* prefs)
178 184
179//US ENH: I need a place to load the view dependend settings. Eg. splittersize 185//US ENH: I need a place to load the view dependend settings. Eg. splittersize
180void PwMViewStyle_1::saveSettings(PWMPrefs* prefs) 186void PwMViewStyle_1::saveSettings(PWMPrefs* prefs)
181{ 187{
182 //store the size of the listviewcolumns 188 //store the size of the listviewcolumns
183 lv->saveLayout(prefs->getConfig(), "listview"); 189 lv->saveLayout(prefs->getConfig(), "listview");
184 prefs->mCategorySplitter = splitter->sizes(); 190 prefs->mCategorySplitter = splitter->sizes();
185 prefs->mCommentSplitter = splitter2->sizes(); 191 prefs->mCommentSplitter = splitter2->sizes();
186 192
187} 193}
188 194
189 195
190#ifndef PWM_EMBEDDED 196#ifndef PWM_EMBEDDED_
191#include "pwmviewstyle_1.moc" 197#include "moc_pwmviewstyle_1.cpp"
192#endif 198#endif
diff --git a/pwmanager/pwmanager/pwmviewstyle_1.h b/pwmanager/pwmanager/pwmviewstyle_1.h
index 4f7a256..66cba03 100644
--- a/pwmanager/pwmanager/pwmviewstyle_1.h
+++ b/pwmanager/pwmanager/pwmviewstyle_1.h
@@ -11,37 +11,37 @@
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef PWMVIEWSTYLE_1_H 20#ifndef PWMVIEWSTYLE_1_H
21#define PWMVIEWSTYLE_1_H 21#define PWMVIEWSTYLE_1_H
22 22
23#include <qvbox.h> 23#include <q3vbox.h>
24 24
25#ifndef PWM_EMBEDDED 25#ifndef PWM_EMBEDDED
26#include <qtextedit.h> 26#include <q3textedit.h>
27#include <qsplitter.h> 27#include <qsplitter.h>
28#else 28#else
29#include <qmultilineedit.h> 29#include <q3multilineedit.h>
30#include <KDGanttMinimizeSplitter.h> 30#include <KDGanttMinimizeSplitter.h>
31#endif 31#endif
32 32
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qlistbox.h> 34#include <q3listbox.h>
35#include <qpopupmenu.h> 35#include <q3popupmenu.h>
36 36
37class PwMView; 37class PwMView;
38class ListViewPwM; 38class ListViewPwM;
39class CommentBox; 39class CommentBox;
40class PWMPrefs; 40class PWMPrefs;
41 41
42class PwMViewStyle_1 : public QObject 42class PwMViewStyle_1 : public QObject
43{ 43{
44 Q_OBJECT 44 Q_OBJECT
45public: 45public:
46 PwMViewStyle_1(PwMView *view); 46 PwMViewStyle_1(PwMView *view);
47 ~PwMViewStyle_1(); 47 ~PwMViewStyle_1();
@@ -73,42 +73,42 @@ public:
73 /** resize the view */ 73 /** resize the view */
74 void resize(const QSize &size) 74 void resize(const QSize &size)
75 { splitter->resize(size); } 75 { splitter->resize(size); }
76 76
77 //US ENH: I need a place to load the view dependend settings. Eg. splittersize 77 //US ENH: I need a place to load the view dependend settings. Eg. splittersize
78 void restoreSettings(PWMPrefs* prefs); 78 void restoreSettings(PWMPrefs* prefs);
79 void saveSettings(PWMPrefs* prefs); 79 void saveSettings(PWMPrefs* prefs);
80 80
81public slots: 81public slots:
82 void toggleSplitter(); 82 void toggleSplitter();
83protected slots: 83protected slots:
84 /** user clicked right button in category list */ 84 /** user clicked right button in category list */
85 void catRightClick(QListBoxItem *item, const QPoint &point); 85 void catRightClick(Q3ListBoxItem *item, const QPoint &point);
86 86
87protected: 87protected:
88 /** main list view */ 88 /** main list view */
89 ListViewPwM *lv; 89 ListViewPwM *lv;
90#ifndef PWM_EMBEDDED 90#ifndef PWM_EMBEDDED
91 /** main splitter widget */ 91 /** main splitter widget */
92 QSplitter *splitter; 92 QSplitter *splitter;
93 /** commentTextEdit splitter */ 93 /** commentTextEdit splitter */
94 QSplitter *splitter2; 94 QSplitter *splitter2;
95#else 95#else
96 /** main splitter widget */ 96 /** main splitter widget */
97 KDGanttMinimizeSplitter *splitter; 97 KDGanttMinimizeSplitter *splitter;
98 /** commentTextEdit splitter */ 98 /** commentTextEdit splitter */
99 KDGanttMinimizeSplitter *splitter2; 99 KDGanttMinimizeSplitter *splitter2;
100#endif 100#endif
101 101
102 /** categories list-box */ 102 /** categories list-box */
103 QListBox *categoriesList; 103 Q3ListBox *categoriesList;
104 /** title string for the categories combo or list box */ 104 /** title string for the categories combo or list box */
105 QLabel *categoriesTitle; 105 QLabel *categoriesTitle;
106 /** hbox1 for widget style */ 106 /** hbox1 for widget style */
107 QVBox *vbox1; 107 Q3VBox *vbox1;
108 /** text-edit to display the comment */ 108 /** text-edit to display the comment */
109 CommentBox *commentBox; 109 CommentBox *commentBox;
110 /** category list context menu */ 110 /** category list context menu */
111 QPopupMenu *catCtxMenu; 111 Q3PopupMenu *catCtxMenu;
112}; 112};
113 113
114#endif 114#endif
diff --git a/pwmanager/pwmanager/randomizer.cpp b/pwmanager/pwmanager/randomizer.cpp
index da4df78..24f9926 100644
--- a/pwmanager/pwmanager/randomizer.cpp
+++ b/pwmanager/pwmanager/randomizer.cpp
@@ -44,43 +44,43 @@ int rand_r( uint * seed ) {
44Randomizer * Randomizer::rndObj (0); 44Randomizer * Randomizer::rndObj (0);
45 45
46Randomizer::Randomizer() 46Randomizer::Randomizer()
47{ 47{
48 rndDev = new QFile; 48 rndDev = new QFile;
49 seed = time(0); 49 seed = time(0);
50 50
51#if 1 // set to 0 to test rand_r() fallback 51#if 1 // set to 0 to test rand_r() fallback
52 52
53 // probe for /dev/urandom 53 // probe for /dev/urandom
54 rndDev->setName("/dev/urandom"); 54 rndDev->setName("/dev/urandom");
55 if (rndDev->exists() && 55 if (rndDev->exists() &&
56 rndDev->open(IO_ReadOnly)) { 56 rndDev->open(QIODevice::ReadOnly)) {
57 printDebug("Randomizer: using /dev/urandom"); 57 printDebug("Randomizer: using /dev/urandom");
58 return; 58 return;
59 } 59 }
60 60
61 // probe for /dev/random 61 // probe for /dev/random
62 rndDev->setName("/dev/random"); 62 rndDev->setName("/dev/random");
63 if (rndDev->exists() && 63 if (rndDev->exists() &&
64 rndDev->open(IO_ReadOnly)) { 64 rndDev->open(QIODevice::ReadOnly)) {
65 printDebug("Randomizer: using /dev/random"); 65 printDebug("Randomizer: using /dev/random");
66 return; 66 return;
67 } 67 }
68 68
69 // probe for EGD 69 // probe for EGD
70 char *fn = getenv("RANDFILE"); 70 char *fn = getenv("RANDFILE");
71 if (fn) { 71 if (fn) {
72 rndDev->setName(fn); 72 rndDev->setName(fn);
73 if (rndDev->exists() && 73 if (rndDev->exists() &&
74 rndDev->open(IO_ReadOnly)) { 74 rndDev->open(QIODevice::ReadOnly)) {
75 printDebug(string("Randomizer: using $RANDFILE \"") 75 printDebug(string("Randomizer: using $RANDFILE \"")
76 + fn 76 + fn
77 + "\" (aka EGD)"); 77 + "\" (aka EGD)");
78 return; 78 return;
79 } 79 }
80 } 80 }
81#endif 81#endif
82 82
83 /* no secure randomizer found. 83 /* no secure randomizer found.
84 * Fall back to stdlib randomizer. 84 * Fall back to stdlib randomizer.
85 */ 85 */
86 delete_and_null(rndDev); 86 delete_and_null(rndDev);
diff --git a/pwmanager/pwmanager/rencatwnd.cpp b/pwmanager/pwmanager/rencatwnd.cpp
index 3c4de27..3ca758c 100644
--- a/pwmanager/pwmanager/rencatwnd.cpp
+++ b/pwmanager/pwmanager/rencatwnd.cpp
@@ -11,34 +11,37 @@
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "rencatwnd.h" 20#include "rencatwnd.h"
21 21
22#include <klocale.h> 22#include <klocale.h>
23//Added by qt3to4:
24#include <QResizeEvent>
25#include <QLabel>
23 26
24 27
25RenCatWnd::RenCatWnd(QWidget *parent, 28RenCatWnd::RenCatWnd(QWidget *parent,
26 const char *name, bool modal, WFlags f) 29 const char *name, bool modal, Qt::WFlags f)
27 : QDialog(parent, name, true, f) 30 : QDialog(parent, name, true, f)
28{ 31{
29 vbox1 = new QVBox(this); 32 vbox1 = new Q3VBox(this);
30 label = new QLabel(vbox1); 33 label = new QLabel(vbox1);
31 newName = new QLineEdit(vbox1); 34 newName = new QLineEdit(vbox1);
32 hbox1 = new QHBox(vbox1); 35 hbox1 = new Q3HBox(vbox1);
33 okButton = new QPushButton(i18n("&Ok"), hbox1); 36 okButton = new QPushButton(i18n("&Ok"), hbox1);
34 cancelButton = new QPushButton(i18n("&Cancel"), hbox1); 37 cancelButton = new QPushButton(i18n("&Cancel"), hbox1);
35 38
36 vbox1->setSpacing(10); 39 vbox1->setSpacing(10);
37 vbox1->setMargin(10); 40 vbox1->setMargin(10);
38 hbox1->setSpacing(10); 41 hbox1->setSpacing(10);
39 42
40 resize(220, 100); 43 resize(220, 100);
41 44
42 setCaption(i18n("Rename category")); 45 setCaption(i18n("Rename category"));
43 label->setText(i18n("New category name:")); 46 label->setText(i18n("New category name:"));
44 47
@@ -56,15 +59,15 @@ void RenCatWnd::resizeEvent(QResizeEvent *)
56} 59}
57 60
58void RenCatWnd::okButton_slot() 61void RenCatWnd::okButton_slot()
59{ 62{
60 done(1); 63 done(1);
61} 64}
62 65
63void RenCatWnd::cancelButton_slot() 66void RenCatWnd::cancelButton_slot()
64{ 67{
65 done(2); 68 done(2);
66} 69}
67 70
68#ifndef PWM_EMBEDDED 71#ifndef PWM_EMBEDDED_
69#include "rencatwnd.moc" 72#include "moc_rencatwnd.cpp"
70#endif 73#endif
diff --git a/pwmanager/pwmanager/rencatwnd.h b/pwmanager/pwmanager/rencatwnd.h
index 37b6725..1773136 100644
--- a/pwmanager/pwmanager/rencatwnd.h
+++ b/pwmanager/pwmanager/rencatwnd.h
@@ -11,50 +11,52 @@
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef RENCATWND_H 20#ifndef RENCATWND_H
21#define RENCATWND_H 21#define RENCATWND_H
22 22
23#include <qvbox.h> 23#include <q3vbox.h>
24#include <qhbox.h> 24#include <q3hbox.h>
25#include <qdialog.h> 25#include <qdialog.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlineedit.h> 27#include <qlineedit.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qevent.h> 29#include <qevent.h>
30//Added by qt3to4:
31#include <QResizeEvent>
30 32
31 33
32/** rename category window */ 34/** rename category window */
33class RenCatWnd : public QDialog 35class RenCatWnd : public QDialog
34{ 36{
35 Q_OBJECT 37 Q_OBJECT
36public: 38public:
37 RenCatWnd(QWidget *parent = 0, const char *name = 0, 39 RenCatWnd(QWidget *parent = 0, const char *name = 0,
38 bool modal = FALSE, WFlags f = 0); 40 bool modal = FALSE, Qt::WFlags f = 0);
39 ~RenCatWnd(); 41 ~RenCatWnd();
40 42
41 QString getNewName() 43 QString getNewName()
42 { return newName->text(); } 44 { return newName->text(); }
43 45
44protected slots: 46protected slots:
45 void okButton_slot(); 47 void okButton_slot();
46 void cancelButton_slot(); 48 void cancelButton_slot();
47 49
48protected: 50protected:
49 QVBox *vbox1; 51 Q3VBox *vbox1;
50 QHBox *hbox1; 52 Q3HBox *hbox1;
51 QLabel *label; 53 QLabel *label;
52 QLineEdit *newName; 54 QLineEdit *newName;
53 QPushButton *okButton; 55 QPushButton *okButton;
54 QPushButton *cancelButton; 56 QPushButton *cancelButton;
55 57
56protected: 58protected:
57 void resizeEvent(QResizeEvent *); 59 void resizeEvent(QResizeEvent *);
58}; 60};
59 61
60#endif 62#endif
diff --git a/pwmanager/pwmanager/serializer.cpp b/pwmanager/pwmanager/serializer.cpp
index 507fa30..6c6512e 100644
--- a/pwmanager/pwmanager/serializer.cpp
+++ b/pwmanager/pwmanager/serializer.cpp
@@ -15,24 +15,26 @@
15 * This file is originaly based on version 1.1 of pwmanager 15 * This file is originaly based on version 1.1 of pwmanager
16 * and was modified to run on embedded devices that run microkde 16 * and was modified to run on embedded devices that run microkde
17 * 17 *
18 * $Id$ 18 * $Id$
19 **************************************************************************/ 19 **************************************************************************/
20 20
21#include "serializer.h" 21#include "serializer.h"
22#include "pwmexception.h" 22#include "pwmexception.h"
23 23
24#ifdef PWM_EMBEDDED 24#ifdef PWM_EMBEDDED
25#include <kglobal.h> 25#include <kglobal.h>
26#include <klocale.h> 26#include <klocale.h>
27//Added by qt3to4:
28#include <Q3CString>
27#endif 29#endif
28 30
29/* enable/disable serializer debugging (0/1) */ 31/* enable/disable serializer debugging (0/1) */
30 #define SERIALIZER_DEBUG0 32 #define SERIALIZER_DEBUG0
31/* use the old xml tags for writing (0/1) */ 33/* use the old xml tags for writing (0/1) */
32 #define USE_OLD_TAGS 0 34 #define USE_OLD_TAGS 0
33/* write a CDATA section (0/1) */ 35/* write a CDATA section (0/1) */
34 #define WRITE_CDATA_SEC 0 36 #define WRITE_CDATA_SEC 0
35 37
36 38
37 #define META_CREATE_DATE"c" 39 #define META_CREATE_DATE"c"
38 #define META_VALID_DATE "v" 40 #define META_VALID_DATE "v"
@@ -137,25 +139,25 @@
137 139
138Serializer::Serializer() 140Serializer::Serializer()
139{ 141{
140 defaultLockStat = true; 142 defaultLockStat = true;
141//US BUG: I needed to specify a document name. Otherwise impl will not be created for serializing 143//US BUG: I needed to specify a document name. Otherwise impl will not be created for serializing
142#ifndef PWM_EMBEDDED 144#ifndef PWM_EMBEDDED
143 domDoc = new QDomDocument; 145 domDoc = new QDomDocument;
144#else 146#else
145 domDoc = new QDomDocument("mydoc"); 147 domDoc = new QDomDocument("mydoc");
146#endif 148#endif
147} 149}
148 150
149Serializer::Serializer(const QCString &buffer) 151Serializer::Serializer(const Q3CString &buffer)
150{ 152{
151 defaultLockStat = true; 153 defaultLockStat = true;
152//US BUG: I needed to specify a document name. Otherwise impl will not be created for serializing 154//US BUG: I needed to specify a document name. Otherwise impl will not be created for serializing
153#ifndef PWM_EMBEDDED 155#ifndef PWM_EMBEDDED
154 domDoc = new QDomDocument; 156 domDoc = new QDomDocument;
155#else 157#else
156 domDoc = new QDomDocument("mydoc"); 158 domDoc = new QDomDocument("mydoc");
157#endif 159#endif
158 160
159 if (!parseXml(buffer)) { 161 if (!parseXml(buffer)) {
160 delete domDoc; 162 delete domDoc;
161#ifndef PWM_EMBEDDED 163#ifndef PWM_EMBEDDED
@@ -168,72 +170,72 @@ Serializer::Serializer(const QCString &buffer)
168 170
169Serializer::~Serializer() 171Serializer::~Serializer()
170{ 172{
171 delete_ifnot_null(domDoc); 173 delete_ifnot_null(domDoc);
172} 174}
173 175
174void Serializer::clear() 176void Serializer::clear()
175{ 177{
176 delete_ifnot_null(domDoc); 178 delete_ifnot_null(domDoc);
177 domDoc = new QDomDocument; 179 domDoc = new QDomDocument;
178} 180}
179 181
180bool Serializer::parseXml(const QCString &buffer) 182bool Serializer::parseXml(const Q3CString &buffer)
181{ 183{
182 //abort(); 184 //abort();
183 //qDebug("parse %s ", buffer.data()); 185 //qDebug("parse %s ", buffer.data());
184 PWM_ASSERT(domDoc); 186 PWM_ASSERT(domDoc);
185#ifndef PWM_EMBEDDED 187#ifndef PWM_EMBEDDED
186 if (!domDoc->setContent(buffer, true)) 188 if (!domDoc->setContent(buffer, true))
187 return false; 189 return false;
188#else 190#else
189#ifdef DESKTOP_VERSION 191#ifdef DESKTOP_VERSION
190 if (!domDoc->setContent(buffer, true)) 192 if (!domDoc->setContent(buffer, true))
191#else 193#else
192 if (!domDoc->setContent(buffer)) 194 if (!domDoc->setContent(buffer))
193#endif 195#endif
194 return false; 196 return false;
195#endif 197#endif
196 if (!checkValid()) 198 if (!checkValid())
197 return false; 199 return false;
198 return true; 200 return true;
199} 201}
200 202
201QCString Serializer::getXml() 203Q3CString Serializer::getXml()
202{ 204{
203 PWM_ASSERT(domDoc); 205 PWM_ASSERT(domDoc);
204 206
205#ifndef PWM_EMBEDDED 207#ifndef PWM_EMBEDDED
206#if defined(PWM_DEBUG) && SERIALIZER_DEBUG != 0 208#if defined(PWM_DEBUG) && SERIALIZER_DEBUG != 0
207 QCString tmp(domDoc->toCString(8)); 209 Q3CString tmp(domDoc->toCString(8));
208 printDebug("<BEGIN Serializer::getXml() dump>\n"); 210 printDebug("<BEGIN Serializer::getXml() dump>\n");
209 cout << tmp << endl; 211 cout << tmp << endl;
210 printDebug("<END Serializer::getXml() dump>"); 212 printDebug("<END Serializer::getXml() dump>");
211#endif // DEBUG 213#endif // DEBUG
212 214
213 QCString ret(domDoc->toCString(0)); 215 Q3CString ret(domDoc->toCString(0));
214 ret.replace('\n', ""); 216 ret.replace('\n', "");
215 return ret; 217 return ret;
216#else 218#else
217 219
218#if defined(PWM_DEBUG) && SERIALIZER_DEBUG != 0 220#if defined(PWM_DEBUG) && SERIALIZER_DEBUG != 0
219 QCString tmp(" " + domDoc->toCString()); 221 Q3CString tmp(" " + domDoc->toCString());
220 printDebug("<BEGIN Serializer::getXml() dump>\n"); 222 printDebug("<BEGIN Serializer::getXml() dump>\n");
221 qDebug(tmp); 223 qDebug(tmp);
222 cout << tmp << endl; 224 cout << tmp << endl;
223 printDebug("<END Serializer::getXml() dump>"); 225 printDebug("<END Serializer::getXml() dump>");
224#endif // DEBUG 226#endif // DEBUG
225 227
226 QCString ret(domDoc->toCString()); 228 Q3CString ret(domDoc->toByteArray());
227 ret.replace(QRegExp("\n"), ""); 229 ret.replace("\n", "");
228 return ret; 230 return ret;
229 231
230#endif 232#endif
231} 233}
232 234
233bool Serializer::serialize(PwMItem &dta) 235bool Serializer::serialize(PwMItem &dta)
234{ 236{
235 PWM_ASSERT(domDoc); 237 PWM_ASSERT(domDoc);
236 QDomElement root(genNewRoot()); 238 QDomElement root(genNewRoot());
237 QDomElement catNode(domDoc->createElement(CAT_ROOT_WR)); 239 QDomElement catNode(domDoc->createElement(CAT_ROOT_WR));
238 QDomElement syncNode(domDoc->createElement(SYNC_ROOT)); 240 QDomElement syncNode(domDoc->createElement(SYNC_ROOT));
239 if (!addSyncData(&syncNode, dta.syncDta)) 241 if (!addSyncData(&syncNode, dta.syncDta))
diff --git a/pwmanager/pwmanager/serializer.h b/pwmanager/pwmanager/serializer.h
index df50e42..e085ade 100644
--- a/pwmanager/pwmanager/serializer.h
+++ b/pwmanager/pwmanager/serializer.h
@@ -14,51 +14,51 @@
14 * copyright (C) 2004 by Ulf Schenk 14 * copyright (C) 2004 by Ulf Schenk
15 * This file is originaly based on version 1.1 of pwmanager 15 * This file is originaly based on version 1.1 of pwmanager
16 * and was modified to run on embedded devices that run microkde 16 * and was modified to run on embedded devices that run microkde
17 * 17 *
18 * $Id$ 18 * $Id$
19 **************************************************************************/ 19 **************************************************************************/
20 20
21#ifndef __SERIALIZER_H 21#ifndef __SERIALIZER_H
22#define __SERIALIZER_H 22#define __SERIALIZER_H
23 23
24#include "pwmdoc.h" 24#include "pwmdoc.h"
25 25
26#include <qcstring.h> 26#include <q3cstring.h>
27#include <qdom.h> 27#include <qdom.h>
28 28
29#include <vector> 29#include <vector>
30 30
31using std::vector; 31using std::vector;
32 32
33/** This serializes its input data into 33/** This serializes its input data into
34 * the PwManager-XML-datastream, that becomes 34 * the PwManager-XML-datastream, that becomes
35 * encrypted and maybe compressed 35 * encrypted and maybe compressed
36 */ 36 */
37class Serializer 37class Serializer
38{ 38{
39public: 39public:
40 /** construct an empty serializer document */ 40 /** construct an empty serializer document */
41 Serializer(); 41 Serializer();
42 /** construct a serializer document and parse "buffer" */ 42 /** construct a serializer document and parse "buffer" */
43 Serializer(const QCString &buffer); 43 Serializer(const Q3CString &buffer);
44 /** destructor */ 44 /** destructor */
45 virtual ~Serializer(); 45 virtual ~Serializer();
46 46
47 /** clears all data */ 47 /** clears all data */
48 void clear(); 48 void clear();
49 /** parse the given data buffer */ 49 /** parse the given data buffer */
50 bool parseXml(const QCString &buffer); 50 bool parseXml(const Q3CString &buffer);
51 /** returns the current XML data */ 51 /** returns the current XML data */
52 QCString getXml(); 52 Q3CString getXml();
53 /** serialize "dta" and store it as XML data */ 53 /** serialize "dta" and store it as XML data */
54 //US ENH: we need to serialize and deserialize not only categories, but also synctargets 54 //US ENH: we need to serialize and deserialize not only categories, but also synctargets
55 bool serialize(PwMItem &dta); 55 bool serialize(PwMItem &dta);
56 /** deserialize the (parsed) XML data and store it in "dta" */ 56 /** deserialize the (parsed) XML data and store it in "dta" */
57 bool deSerialize(PwMItem *dta); 57 bool deSerialize(PwMItem *dta);
58 /** sets the initial default lockStat we should assign */ 58 /** sets the initial default lockStat we should assign */
59 void setDefaultLockStat(bool stat) 59 void setDefaultLockStat(bool stat)
60 { defaultLockStat = stat; } 60 { defaultLockStat = stat; }
61 61
62protected: 62protected:
63 /** main data holder */ 63 /** main data holder */
64 QDomDocument *domDoc; 64 QDomDocument *domDoc;
diff --git a/pwmanager/pwmanager/setmasterpwwnd_emb.cpp b/pwmanager/pwmanager/setmasterpwwnd_emb.cpp
index e6471e6..c5fd4e4 100644
--- a/pwmanager/pwmanager/setmasterpwwnd_emb.cpp
+++ b/pwmanager/pwmanager/setmasterpwwnd_emb.cpp
@@ -22,24 +22,27 @@
22 22
23$Id$ 23$Id$
24*/ 24*/
25 25
26#include "setmasterpwwnd_emb.h" 26#include "setmasterpwwnd_emb.h"
27 27
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qtabwidget.h> 29#include <qtabwidget.h>
30#include <qwidget.h> 30#include <qwidget.h>
31#include <qlabel.h> 31#include <qlabel.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qlayout.h> 33#include <qlayout.h>
34//Added by qt3to4:
35#include <Q3VBoxLayout>
36#include <Q3GridLayout>
34 37
35#include <klocale.h> 38#include <klocale.h>
36 39
37/*US 40/*US
38#include <qvariant.h> 41#include <qvariant.h>
39#include <qpushbutton.h> 42#include <qpushbutton.h>
40#include <qtabwidget.h> 43#include <qtabwidget.h>
41#include <qwidget.h> 44#include <qwidget.h>
42#include <qlabel.h> 45#include <qlabel.h>
43#include <qlineedit.h> 46#include <qlineedit.h>
44#include <qlayout.h> 47#include <qlayout.h>
45#include <qtooltip.h> 48#include <qtooltip.h>
@@ -48,76 +51,76 @@ $Id$
48 51
49/* 52/*
50 * Constructs a setMasterPwWnd as a child of 'parent', with the 53 * Constructs a setMasterPwWnd as a child of 'parent', with the
51 * name 'name' 54 * name 'name'
52 * 55 *
53 */ 56 */
54setMasterPwWnd::setMasterPwWnd( QWidget* parent, const char* name ) 57setMasterPwWnd::setMasterPwWnd( QWidget* parent, const char* name )
55 : KDialogBase( KDialogBase::Plain, i18n( "Set master-password" ), 58 : KDialogBase( KDialogBase::Plain, i18n( "Set master-password" ),
56 KDialogBase::Ok | KDialogBase::Cancel, 59 KDialogBase::Ok | KDialogBase::Cancel,
57 KDialogBase::Ok, parent, name, true ) 60 KDialogBase::Ok, parent, name, true )
58{ 61{
59 QWidget *page = plainPage(); 62 QWidget *page = plainPage();
60 QVBoxLayout *pageLayout = new QVBoxLayout( page ); 63 Q3VBoxLayout *pageLayout = new Q3VBoxLayout( page );
61 64
62 mainTab = new QTabWidget( page ); 65 mainTab = new QTabWidget( page );
63 pageLayout->addWidget( mainTab ); 66 pageLayout->addWidget( mainTab );
64 67
65 68
66 if ( !name ) 69 if ( !name )
67 setName( "setMasterPwWnd" ); 70 setName( "setMasterPwWnd" );
68 71
69 //////////////////////////////////////////////////////////////////// 72 ////////////////////////////////////////////////////////////////////
70 // This is the Password tab1 73 // This is the Password tab1
71 tab = new QWidget( mainTab ); 74 tab = new QWidget( mainTab );
72 75
73 QGridLayout *layout = new QGridLayout( tab, 5, 1 ); 76 Q3GridLayout *layout = new Q3GridLayout( tab, 5, 1 );
74 layout->setMargin( KDialogBase::marginHint() ); 77 layout->setMargin( KDialogBase::marginHint() );
75 layout->setSpacing( KDialogBase::spacingHint() ); 78 layout->setSpacing( KDialogBase::spacingHint() );
76 79
77 QLabel* label = new QLabel( i18n( "Using a normal password-string to encrypt the data." ), tab ); 80 QLabel* label = new QLabel( i18n( "Using a normal password-string to encrypt the data." ), tab );
78 label->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); 81 label->setAlignment( int( Qt::WordBreak | Qt::AlignCenter ) );
79 layout->addWidget(label, 0, 0); 82 layout->addWidget(label, 0, 0);
80 83
81 pwEdit_1 = new QLineEdit( tab, "pwEdit_1" ); 84 pwEdit_1 = new QLineEdit( tab, "pwEdit_1" );
82 pwEdit_1->setEchoMode( QLineEdit::Password ); 85 pwEdit_1->setEchoMode( QLineEdit::Password );
83 86
84 label = new QLabel( pwEdit_1, i18n( "Please enter the new master-password:" ), tab ); 87 label = new QLabel( pwEdit_1, i18n( "Please enter the new master-password:" ), tab );
85 layout->addWidget(label, 1, 0); 88 layout->addWidget(label, 1, 0);
86 layout->addWidget(pwEdit_1, 2, 0); 89 layout->addWidget(pwEdit_1, 2, 0);
87 90
88 pwEdit_2 = new QLineEdit( tab, "pwEdit_2" ); 91 pwEdit_2 = new QLineEdit( tab, "pwEdit_2" );
89 pwEdit_2->setEchoMode( QLineEdit::Password ); 92 pwEdit_2->setEchoMode( QLineEdit::Password );
90 93
91 label = new QLabel( pwEdit_2, i18n( "Please enter the password again:" ), tab ); 94 label = new QLabel( pwEdit_2, i18n( "Please enter the password again:" ), tab );
92 layout->addWidget(label, 3, 0); 95 layout->addWidget(label, 3, 0);
93 layout->addWidget(pwEdit_2, 4, 0); 96 layout->addWidget(pwEdit_2, 4, 0);
94 97
95 mainTab->insertTab( tab, i18n("Normal password") ); 98 mainTab->insertTab( tab, i18n("Normal password") );
96 99
97 100
98 //////////////////////////////////////////////////////////////////// 101 ////////////////////////////////////////////////////////////////////
99 // This is the Password tab2 102 // This is the Password tab2
100 tab_2 = new QWidget( mainTab ); 103 tab_2 = new QWidget( mainTab );
101 104
102 layout = new QGridLayout( tab_2, 5, 1 ); 105 layout = new Q3GridLayout( tab_2, 5, 1 );
103 layout->setMargin( KDialogBase::marginHint() ); 106 layout->setMargin( KDialogBase::marginHint() );
104 layout->setSpacing( KDialogBase::spacingHint() ); 107 layout->setSpacing( KDialogBase::spacingHint() );
105 108
106 label = new QLabel( i18n( "Using a PwM key-card to encrypt the data." ), tab_2 ); 109 label = new QLabel( i18n( "Using a PwM key-card to encrypt the data." ), tab_2 );
107 label->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); 110 label->setAlignment( int( Qt::WordBreak | Qt::AlignCenter ) );
108 layout->addWidget(label, 0, 0); 111 layout->addWidget(label, 0, 0);
109 112
110 label = new QLabel( i18n( "selected card:" ), tab_2 ); 113 label = new QLabel( i18n( "selected card:" ), tab_2 );
111 label->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); 114 label->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
112 layout->addWidget(label, 1, 0); 115 layout->addWidget(label, 1, 0);
113 116
114 selCardButton = new QPushButton( i18n( "&Select the currently inserted card as key-card" ), tab_2 ); 117 selCardButton = new QPushButton( i18n( "&Select the currently inserted card as key-card" ), tab_2 );
115 layout->addWidget(selCardButton, 2, 0); 118 layout->addWidget(selCardButton, 2, 0);
116 119
117 genCardButton = new QPushButton( i18n( "&generate new key-card") , tab_2 ); 120 genCardButton = new QPushButton( i18n( "&generate new key-card") , tab_2 );
118 layout->addWidget(genCardButton, 3, 0); 121 layout->addWidget(genCardButton, 3, 0);
119 122
120 curCardIdLabel = new QLabel( QString("") , tab_2 ); 123 curCardIdLabel = new QLabel( QString("") , tab_2 );
121 layout->addWidget(curCardIdLabel, 4, 0); 124 layout->addWidget(curCardIdLabel, 4, 0);
122 125
123 mainTab->insertTab( tab_2, i18n("Key-card (chipcard)" ) ); 126 mainTab->insertTab( tab_2, i18n("Key-card (chipcard)" ) );
diff --git a/pwmanager/pwmanager/setmasterpwwnd_emb.h b/pwmanager/pwmanager/setmasterpwwnd_emb.h
index c8ddec6..a070fea 100644
--- a/pwmanager/pwmanager/setmasterpwwnd_emb.h
+++ b/pwmanager/pwmanager/setmasterpwwnd_emb.h
@@ -18,24 +18,26 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22 22
23$Id$ 23$Id$
24*/ 24*/
25 25
26#ifndef SETMASTERPWWND_EMB_H 26#ifndef SETMASTERPWWND_EMB_H
27#define SETMASTERPWWND_EMB_H 27#define SETMASTERPWWND_EMB_H
28 28
29#include <kdialogbase.h> 29#include <kdialogbase.h>
30//Added by qt3to4:
31#include <QLabel>
30 32
31class QLineEdit; 33class QLineEdit;
32class QPushButton; 34class QPushButton;
33class QLabel; 35class QLabel;
34class QTabWidget; 36class QTabWidget;
35class QWidget; 37class QWidget;
36 38
37class setMasterPwWnd : public KDialogBase 39class setMasterPwWnd : public KDialogBase
38{ 40{
39 Q_OBJECT 41 Q_OBJECT
40 42
41public: 43public:
diff --git a/pwmanager/pwmanager/setmasterpwwndimpl.cpp b/pwmanager/pwmanager/setmasterpwwndimpl.cpp
index 3482643..7041d2e 100644
--- a/pwmanager/pwmanager/setmasterpwwndimpl.cpp
+++ b/pwmanager/pwmanager/setmasterpwwndimpl.cpp
@@ -179,15 +179,15 @@ string SetMasterPwWndImpl::getPw(bool *useCard)
179#ifdef CONFIG_KEYCARD 179#ifdef CONFIG_KEYCARD
180 // key-card 180 // key-card
181 if (useCard) 181 if (useCard)
182 *useCard = true; 182 *useCard = true;
183 PWM_ASSERT(curCardKey != ""); 183 PWM_ASSERT(curCardKey != "");
184 PWM_ASSERT(curCardIdLabel->text() != STRING_CARD_NONE); 184 PWM_ASSERT(curCardIdLabel->text() != STRING_CARD_NONE);
185 return curCardKey; 185 return curCardKey;
186#endif // CONFIG_KEYCARD 186#endif // CONFIG_KEYCARD
187 } 187 }
188 return ""; 188 return "";
189} 189}
190 190
191#ifndef PWM_EMBEDDED 191#ifndef PWM_EMBEDDED_
192#include "setmasterpwwndimpl.moc" 192#include "moc_setmasterpwwndimpl.cpp"
193#endif 193#endif
diff --git a/pwmanager/pwmanager/waitwnd.cpp b/pwmanager/pwmanager/waitwnd.cpp
index a3f25cc..d4676a9 100644
--- a/pwmanager/pwmanager/waitwnd.cpp
+++ b/pwmanager/pwmanager/waitwnd.cpp
@@ -13,36 +13,40 @@
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "waitwnd.h" 20#include "waitwnd.h"
21#include "globalstuff.h" 21#include "globalstuff.h"
22#include "pwmexception.h" 22#include "pwmexception.h"
23 23
24#include <qmessagebox.h> 24#include <qmessagebox.h>
25//Added by qt3to4:
26#include <QResizeEvent>
27#include <QCloseEvent>
28#include <QLabel>
25 29
26#include <klocale.h> 30#include <klocale.h>
27 31
28 32
29WaitWnd::WaitWnd(QString caption, QString _staticText, 33WaitWnd::WaitWnd(QString caption, QString _staticText,
30 bool showCancelButton, bool showGenericText, 34 bool showCancelButton, bool showGenericText,
31 QWidget *parent, 35 QWidget *parent,
32 const char *name, bool modal, WFlags f) 36 const char *name, bool modal, Qt::WFlags f)
33 : QDialog(parent, name, modal, f) 37 : QDialog(parent, name, modal, f)
34{ 38{
35 canClose = false; 39 canClose = false;
36 vbox1 = new QVBox(this); 40 vbox1 = new Q3VBox(this);
37 staticText = new QLabel(vbox1); 41 staticText = new QLabel(vbox1);
38 if (showGenericText) { 42 if (showGenericText) {
39 genericText = new QLabel(vbox1); 43 genericText = new QLabel(vbox1);
40 genericText->setAlignment(Qt::AlignHCenter | Qt::WordBreak); 44 genericText->setAlignment(Qt::AlignHCenter | Qt::WordBreak);
41 } else { 45 } else {
42 genericText = 0; 46 genericText = 0;
43 } 47 }
44 if (showCancelButton) { 48 if (showCancelButton) {
45 cancelButton = new QPushButton(vbox1); 49 cancelButton = new QPushButton(vbox1);
46 connect(cancelButton, SIGNAL(clicked()), 50 connect(cancelButton, SIGNAL(clicked()),
47 this, SLOT(cancel_slot())); 51 this, SLOT(cancel_slot()));
48 cancelButton->setText(i18n("&Cancel")); 52 cancelButton->setText(i18n("&Cancel"));
@@ -80,15 +84,15 @@ void WaitWnd::closeEvent(QCloseEvent *e)
80void WaitWnd::cancel_slot() 84void WaitWnd::cancel_slot()
81{ 85{
82 canClose = true; 86 canClose = true;
83 close(); 87 close();
84} 88}
85 89
86void WaitWnd::updateGenericText(const QString &text) 90void WaitWnd::updateGenericText(const QString &text)
87{ 91{
88 if (genericText) 92 if (genericText)
89 genericText->setText(text); 93 genericText->setText(text);
90} 94}
91 95
92#ifndef PWM_EMBEDDED 96#ifndef PWM_EMBEDDED_
93#include "waitwnd.moc" 97#include "moc_waitwnd.cpp"
94#endif 98#endif
diff --git a/pwmanager/pwmanager/waitwnd.h b/pwmanager/pwmanager/waitwnd.h
index ae86c8b..6a619b9 100644
--- a/pwmanager/pwmanager/waitwnd.h
+++ b/pwmanager/pwmanager/waitwnd.h
@@ -11,51 +11,54 @@
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef WAITWND_H 20#ifndef WAITWND_H
21#define WAITWND_H 21#define WAITWND_H
22 22
23#include <qvbox.h> 23#include <q3vbox.h>
24#include <qdialog.h> 24#include <qdialog.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qevent.h> 27#include <qevent.h>
28//Added by qt3to4:
29#include <QResizeEvent>
30#include <QCloseEvent>
28 31
29/** window to ask the user to wait */ 32/** window to ask the user to wait */
30class WaitWnd : public QDialog 33class WaitWnd : public QDialog
31{ 34{
32 Q_OBJECT 35 Q_OBJECT
33public: 36public:
34 WaitWnd(QString caption, QString _staticText, 37 WaitWnd(QString caption, QString _staticText,
35 bool showCancelButton, bool showGenericText, 38 bool showCancelButton, bool showGenericText,
36 QWidget *parent = 0, const char *name = 0, 39 QWidget *parent = 0, const char *name = 0,
37 bool modal = FALSE, WFlags f = 0); 40 bool modal = FALSE, Qt::WFlags f = 0);
38 ~WaitWnd(); 41 ~WaitWnd();
39 42
40 void updateGenericText(const QString &text); 43 void updateGenericText(const QString &text);
41 44
42signals: 45signals:
43 void goingToClose(); 46 void goingToClose();
44 47
45protected slots: 48protected slots:
46 void cancel_slot(); 49 void cancel_slot();
47 50
48protected: 51protected:
49 QVBox *vbox1; 52 Q3VBox *vbox1;
50 QLabel *staticText; 53 QLabel *staticText;
51 QLabel *genericText; 54 QLabel *genericText;
52 QPushButton *cancelButton; 55 QPushButton *cancelButton;
53 /** can we safely close the widget? */ 56 /** can we safely close the widget? */
54 bool canClose; 57 bool canClose;
55 58
56protected: 59protected:
57 void resizeEvent(QResizeEvent *); 60 void resizeEvent(QResizeEvent *);
58 void closeEvent(QCloseEvent *e); 61 void closeEvent(QCloseEvent *e);
59}; 62};
60 63
61#endif 64#endif
diff --git a/qtcompat/qptrlist.h b/qtcompat/qptrlist.h
index 8ce6868..c3d3ca2 100644
--- a/qtcompat/qptrlist.h
+++ b/qtcompat/qptrlist.h
@@ -1,10 +1,14 @@
1#ifndef QTCOMPAT_QPTRLIST_H 1#ifndef QTCOMPAT_QPTRLIST_H
2#define QTCOMPAT_QPTRLIST_H 2#define QTCOMPAT_QPTRLIST_H
3 3
4#if 0
5
4#include <qlist.h> 6#include <qlist.h>
5 7
6#define QPtrList QList 8#define QPtrList QList
7#define QPtrListIterator QListIterator 9#define QPtrListIterator QListIterator
8#define QPtrCollection QCollection 10#define QPtrCollection QCollection
9 11
10#endif 12#endif
13
14#endif
diff --git a/qtcompat/qptrstack.h b/qtcompat/qptrstack.h
index 92070b3..b0afdf1 100644
--- a/qtcompat/qptrstack.h
+++ b/qtcompat/qptrstack.h
@@ -1,9 +1,13 @@
1#ifndef QTCOMPAT_QPTRSTACK_H 1#ifndef QTCOMPAT_QPTRSTACK_H
2#define QTCOMPAT_QPTRSTACK_H 2#define QTCOMPAT_QPTRSTACK_H
3 3
4#if 0
5
4#include <qstack.h> 6#include <qstack.h>
5 7
6#define QPtrStack QStack 8#define QPtrStack QStack
7#define QPtrStackIterator QStackIterator 9#define QPtrStackIterator QStackIterator
8 10
9#endif 11#endif
12
13#endif