708 files changed, 7862 insertions, 6753 deletions
diff --git a/Makefile b/Makefile deleted file mode 100644 index 594d47d..0000000 --- a/Makefile +++ b/dev/null @@ -1,385 +0,0 @@ -export KDEPIMDIR = $(shell pwd) - -export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) - -ifeq ($(PLATFORM) , zaurus) - BUILD_NO_LDAP_PLUGIN=1 -endif - -ifneq ($(PLATFORM) , zaurus) - BUILD_NO_SHARP_PLUGIN=1 -endif - -#opie plugin is deprecated. The qtopia plugin handles the task from now on. -BUILD_NO_OPIE_PLUGIN=1 - -SUBDIRS_MICROKDE = \ - libical/src/libical \ - libical/src/libicalss \ - qtcompat \ - microkde \ - libkcal \ - libkdepim \ - kabc \ - kabc/formats/binary \ - kabc/plugins/file \ - kabc/plugins/dir \ - korganizer \ - kalarmd \ - kaddressbook - -SUBDIRS_QTOPIA_PLUGIN = \ - kabc/plugins/qtopia - -SUBDIRS_OPIE_PLUGIN = \ - kabc/plugins/opie - -SUBDIRS_SHARP_PLUGIN = \ - kabc/plugins/sharpdtm - -SUBDIRS_LDAP_PLUGIN = \ - kabc/plugins/ldap - -SUBDIRS_MICROMAIL = \ - libetpan \ - kmicromail/libmailwrapper \ - kmicromail - -SUBDIRS_GAMMU = \ - gammu/emb/common \ - gammu/emb/gammu - -SUBDIRS_PWMANAGER = \ - pwmanager/libcrypt/mpi \ - pwmanager/libcrypt/error \ - pwmanager/libcrypt/cipher \ - pwmanager/libcrypt/zlib \ - pwmanager/pwmanager - -SUBDIRS = \ - $(SUBDIRS_MICROKDE) \ - $(SUBDIRS_QTOPIA_PLUGIN) \ - $(SUBDIRS_OPIE_PLUGIN) \ - $(SUBDIRS_SHARP_PLUGIN) \ - $(SUBDIRS_LDAP_PLUGIN) \ - $(SUBDIRS_MICROMAIL) \ - $(SUBDIRS_GAMMU) \ - $(SUBDIRS_PWMANAGER) - - -all: build_microkde \ - build_qtopia_plugin \ - build_opie_plugin \ - build_sharp_plugin \ - build_ldap_plugin \ - build_micromail \ - build_gammu \ - build_pwmanager - - -build_microkde: variable_test tmake - for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - -build_qtopia_plugin: build_microkde - ifdef BUILD_NO_QTOPIA_PLUGIN - @echo == qtopia plugin not build. - else - for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_opie_plugin: build_microkde - ifdef BUILD_NO_OPIE_PLUGIN - @echo == opie plugin not build. - else - for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_sharp_plugin: build_microkde - ifdef BUILD_NO_SHARP_PLUGIN - @echo == ldap plugin not build. - else - for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_ldap_plugin: build_microkde - ifdef BUILD_NO_LDAP_PLUGIN - @echo == ldap plugin not build. - else - for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - - -build_micromail: build_microkde - ifdef BUILD_NO_MICROMAIL - @echo == kmicromail not build. - else - for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_gammu: variable_test tmake - ifdef BUILD_NO_GAMMU - @echo == gammu not build. - else - for i in $(SUBDIRS_GAMMU); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_pwmanager: build_microkde - ifdef BUILD_NO_PWMANAGER - @echo == pwmanager not build. - else - for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - - -variable_info: - @echo -------------------------------------- - @echo KDEPIM buildsystem, variableinfo... - @echo KDEPIMDIR=$(KDEPIMDIR) - @echo QTDIR=$(QTDIR) - @echo QPEDIR=$(QPEDIR) - @echo OPIEDIR=$(OPIEDIR) - @echo PLATFORM=$(PLATFORM) - @echo RELEASE_DEBUG=$(RELEASE_DEBUG) - @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) - @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) - @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) - @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN) - @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) - ifndef BUILD_NO_SHARP_PLUGIN - @echo SHARPDTMSDK=$(SHARPDTMSDK) - endif - @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) - @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) - @echo -------------------------------------- - -variable_test: variable_info - @echo KDEPIM buildsystem, variablecheck... - ifndef KDEPIMDIR - @echo KDEPIMDIR is not defined. - $(error KDEPIMDIR is not defined) - endif - ifndef PLATFORM - @echo PLATFORM is not defined. - $(error PLATFORM is not defined) - endif - ifdef BUILD_NO_LDAP_PLUGIN - @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) - endif - ifdef BUILD_NO_OPIE_PLUGIN - @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) - endif - ifdef BUILD_NO_QTOPIA_PLUGIN - @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN) - endif - ifdef BUILD_NO_MICROMAIL - @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) - endif - ifdef BUILD_NO_SHARP_PLUGIN - @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) - else - ifndef SHARPDTMSDK - @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) - $(error SHARPDTMSDK is not defined) - endif - endif - ifdef BUILD_NO_GAMMU - @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) - endif - ifdef BUILD_NO_PWMANAGER - @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) - endif - @echo -------------------------------------- - - -objects: - for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done - for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done - mkdir -p libical/lib/$(PLATFORM) - mkdir -p dest - mkdir -p dest$(LIBICAL_PATH) - mkdir -p pwmanager/libcrypt/$(PLATFORM) - -clean: - rm -rf libical/lib/$(PLATFORM)/*; - rm -rf pwmanager/libcrypt/$(PLATFORM)/*; - for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ - rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ - done - -pac: - rm -f $(QPEDIR)/lib/libmicro* - rm -f $(QPEDIR)/plugins/applets/libkopi* - make - make install - make dist -install: - - cd bin/kdepim; make install - cp -r Pim $(QPEDIR)/apps - cp db2file/db2file $(QPEDIR)/bin/db2file - chmod ugo+x $(QPEDIR)/bin/db2file - cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop - cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop - cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop - cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop - -dist: - @echo Dont forget to do "make install" before "make dist" - rm -f *arm.ipk - rm -f *ipk.zip - rm -rf ../kdepimpi_$(KDEPIM_VERSION)/* - rm -f *~ - cd ..;mkdir -p kdepimpi_$(KDEPIM_VERSION) - cd ../kdepimpi_$(KDEPIM_VERSION);mkdir -p ipk - cd ..; tar czf kdepimpi-$(KDEPIM_VERSION).tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim - mkipks kmicrokdelibs.control - mkipks korganizer.control - mkipks kaddressbook.control - ifndef BUILD_NO_MICROMAIL - mkipks kopiemail.control - endif - ifndef BUILD_NO_SHARP_PLUGIN - mkipks ksharpPIM-DTMaccess.control - endif - mkipks korganizer-alarm.control - ifndef BUILD_NO_GAMMU - mkipks kmobilephoneaccess.control - endif - ifndef BUILD_NO_PWMANAGER - mkipks pwmanager.control - endif - mkipks pimTABicon.control - zip kdepim_$(KDEPIM_VERSION)_for_SharpRom.ipk.zip *.ipk ReleaseNotes.txt - mv *.ipk ../kdepimpi_$(KDEPIM_VERSION)/ipk/ - mv *for_SharpRom.ipk.zip ../kdepimpi_$(KDEPIM_VERSION)/ - mv ../kdepimpi-$(KDEPIM_VERSION).tar.gz ../kdepimpi_$(KDEPIM_VERSION)/ - -tmake: objects \ - qtcompat/Makefile$(PLATFORM) \ - microkde/Makefile$(PLATFORM) \ - libkcal/Makefile$(PLATFORM) \ - libkdepim/Makefile$(PLATFORM) \ - korganizer/Makefile$(PLATFORM) \ - kalarmd/Makefile$(PLATFORM) \ - libical/src/libical/Makefile$(PLATFORM) \ - libical/src/libicalss/Makefile$(PLATFORM) \ - kabc/Makefile$(PLATFORM) \ - kabc/formats/binary/Makefile$(PLATFORM) \ - kabc/plugins/file/Makefile$(PLATFORM) \ - kabc/plugins/dir/Makefile$(PLATFORM) \ - kabc/plugins/ldap/Makefile$(PLATFORM) \ - kabc/plugins/opie/Makefile$(PLATFORM) \ - kabc/plugins/qtopia/Makefile$(PLATFORM) \ - kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ - kaddressbook/Makefile$(PLATFORM) \ - kmicromail/Makefile$(PLATFORM) \ - libetpan/Makefile$(PLATFORM) \ - kmicromail/libmailwrapper/Makefile$(PLATFORM) \ - gammu/emb/common/Makefile$(PLATFORM) \ - gammu/emb/gammu/Makefile$(PLATFORM) \ - pwmanager/pwmanager/Makefile$(PLATFORM) \ - pwmanager/libcrypt/mpi/Makefile$(PLATFORM) \ - pwmanager/libcrypt/error/Makefile$(PLATFORM) \ - pwmanager/libcrypt/cipher/Makefile$(PLATFORM) \ - pwmanager/libcrypt/zlib/Makefile$(PLATFORM) - -qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro - cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) - -microkde/Makefile$(PLATFORM): microkde/microkdeE.pro - cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) - -libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro - cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) - - -libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro - cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) - -kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro - cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) - -korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro - cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) - -libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro - cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) - -libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro - cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) - -kabc/Makefile$(PLATFORM): kabc/kabcE.pro - cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) - -kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro - cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) - -kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro - cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) - -kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro - cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) - -kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro - cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) - -kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro - cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) - -kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro - cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) - -kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro - cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) - -kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro - cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) - -kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro - cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) - -libetpan/Makefile$(PLATFORM): libetpan/libetpanE.pro - cd libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) - -kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro - cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) - -gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro - cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) - -gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro - cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) - -pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro - cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) - - -pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro - cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM) - -pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro - cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM) - -pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro - cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM) - -pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro - cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM) - - 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 @@ -170,7 +170,7 @@ phone/obex/obexgen.c \ phone/symbian/mroutgen.c DEFINES += DESKTOP_VERSION -TARGET = microgammu +TARGET = xmicrogammu CONFIG = warn_off release console DESTDIR = ../../../bin OBJECTS_DIR = obj/unix @@ -192,3 +192,5 @@ HEADERS += device/serial/ser_w32.h \ SOURCES += device/serial/ser_w32.c \ device/bluetoth/blue_w32.c } +#The following line was inserted by qt3to4 +QT += 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 @@ -88,7 +88,7 @@ static GSM_Error bluetooth_checkdevice(GSM_StateMachine *s, char *address, WSAPR char addressAsString[1000]; DWORD bufferLength, addressSize; WSAQUERYSET *pResults = (WSAQUERYSET*)&buffer; - HANDLE handle; + Qt::HANDLE handle; GSM_Error error; memset(&querySet, 0, sizeof(querySet)); @@ -138,7 +138,7 @@ GSM_Error bluetooth_findchannel(GSM_StateMachine *s) WSADATA wsaData; int i, protocolInfoSize, result; WSAPROTOCOL_INFO protocolInfo; - HANDLE handle; + Qt::HANDLE handle; DWORD flags; WSAQUERYSET querySet; BYTE buffer[2000]; 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 @@ -119,7 +119,7 @@ WSALookupServiceBeginA( WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceNextA( - IN HANDLE hLookup, + IN Qt::HANDLE hLookup, IN DWORD dwControlFlags, IN OUT LPDWORD lpdwBufferLength, OUT LPWSAQUERYSETA lpqsResults @@ -127,7 +127,7 @@ WSALookupServiceNextA( #define WSALookupServiceNext WSALookupServiceNextA -WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceEnd(IN HANDLE hLookup); +WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceEnd(IN Qt::HANDLE hLookup); #define MAX_PROTOCOL_CHAIN 7 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 @@ -6,7 +6,7 @@ #include <windows.h> typedef struct { - HANDLE hPhone; + Qt::HANDLE hPhone; DCB old_settings; OVERLAPPED osWrite,osRead; } GSM_Device_SerialData; 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 @@ -47,7 +47,7 @@ SOURCES += gammu.c \ depend/nokia/dct3trac/wmx-util.c \ depend/nokia/dct3trac/wmx.c unix : { -LIBS += ../../../bin/libmicrogammu.so /usr/lib/libpthread.so +LIBS += ../../../bin/libxmicrogammu.so -lpthread # bluetooth disabled for now #/usr/lib/libbluetooth.so /usr/lib/libsdp.so OBJECTS_DIR = obj/unix @@ -63,3 +63,5 @@ OBJECTS_DIR = obj/win } DESTDIR = ../../../bin TARGET = kammu +#The following line was inserted by qt3to4 +QT += xml qt3support diff --git a/kabc/address.h b/kabc/address.h index 38ad20b..41794fe 100644 --- a/kabc/address.h +++ b/kabc/address.h @@ -32,7 +32,7 @@ $Id$ #include <qstring.h> #include <qregexp.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> // template tags for address formatting localization #define KABC_FMTTAG_realname QString("%n") @@ -68,8 +68,8 @@ class Address /** List of addresses. */ - typedef QValueList<Address> List; - typedef QValueList<int> TypeList; + typedef Q3ValueList<Address> List; + typedef Q3ValueList<int> TypeList; /** Address types: diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index fe59fcb..c700897 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -37,8 +37,8 @@ $Id$ #include "errorhandler.h" */ -#include <qptrlist.h> -#include <qtextstream.h> +#include <q3ptrlist.h> +#include <q3textstream.h> #include <qfile.h> #include <qregexp.h> @@ -244,7 +244,7 @@ void AddressBook::init(const QString &config, const QString &family ) blockLSEchange = false; d = new AddressBookData; QString fami = family; - if (config != 0) { + if (!config.isEmpty()) { if ( family == "syncContact" ) { qDebug("creating sync config "); fami = "contact"; @@ -381,13 +381,13 @@ void AddressBook::export2File( QString fileName, QString resourceName ) { QFile outFile( fileName ); - if ( !outFile.open( IO_WriteOnly ) ) { + if ( !outFile.open( QIODevice::WriteOnly ) ) { QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" ); KMessageBox::error( 0, text.arg( fileName ) ); return ; } - QTextStream t( &outFile ); - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( &outFile ); + t.setEncoding( Q3TextStream::UnicodeUTF8 ); Iterator it; KABC::VCardConverter::Version version; version = KABC::VCardConverter::v3_0; @@ -468,10 +468,10 @@ bool AddressBook::export2PhoneFormat( QStringList uids ,QString fileName ) } QFile outFile(fileName); - if ( outFile.open(IO_WriteOnly) ) { + if ( outFile.open(QIODevice::WriteOnly) ) { datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); - QTextStream t( &outFile ); // use a text stream - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( &outFile ); // use a text stream + t.setEncoding( Q3TextStream::UnicodeUTF8 ); t <<datastream; t << "\r\n\r\n"; outFile.close(); @@ -490,7 +490,7 @@ int AddressBook::importFromFile( QString fileName, bool replaceLabel, bool remo setUntagged( true, resource ); KABC::Addressee::List list; QFile file( fileName ); - file.open( IO_ReadOnly ); + file.open( QIODevice::ReadOnly ); QByteArray rawData = file.readAll(); file.close(); QString data; @@ -634,7 +634,7 @@ void AddressBook::findNewExtIds( QString fileName, QString currentSyncDevice ) setUntagged(); KABC::Addressee::List list; QFile file( fileName ); - file.open( IO_ReadOnly ); + file.open( QIODevice::ReadOnly ); QByteArray rawData = file.readAll(); file.close(); QString data; @@ -1218,9 +1218,9 @@ bool AddressBook::addResource( Resource *resource ) void AddressBook::removeResources() { //remove all possible resources. This should cleanup the configfile. - QPtrList<KABC::Resource> mResources = resources(); + Q3PtrList<KABC::Resource> mResources = resources(); - QPtrListIterator<KABC::Resource> it(mResources); + Q3PtrListIterator<KABC::Resource> it(mResources); for ( ; it.current(); ++it ) { KABC::Resource *res = it.current(); removeResource(res); @@ -1240,9 +1240,9 @@ bool AddressBook::removeResource( Resource *resource ) return true; } -QPtrList<Resource> AddressBook::resources() +Q3PtrList<Resource> AddressBook::resources() { - QPtrList<Resource> list; + Q3PtrList<Resource> list; // qDebug("AddressBook::resources() 1"); diff --git a/kabc/addressbook.h b/kabc/addressbook.h index a8a9fc1..56fce4d 100644 --- a/kabc/addressbook.h +++ b/kabc/addressbook.h @@ -31,7 +31,7 @@ $Id$ #include <qobject.h> #include <kresources/manager.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include "addressee.h" #include "field.h" @@ -280,7 +280,7 @@ class AddressBook : public QObject /** Return pointer list of all resources. */ - QPtrList<Resource> resources(); + Q3PtrList<Resource> resources(); /** Set the @p ErrorHandler, that is used by @ref error() to diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index e8e440c..9994e29 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -391,7 +391,7 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; - if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; + if ( mData->additionalName.isEmpty() ) mData->additionalName = ad.mData->additionalName; if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; diff --git a/kabc/addressee.h b/kabc/addressee.h index 0ea1803..30dcd5d 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h @@ -33,7 +33,7 @@ $Id$ #include <qstring.h> #include <qregexp.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include <ksharedptr.h> #include <kurl.h> @@ -84,7 +84,7 @@ class Addressee friend QDataStream &operator>>( QDataStream &, Addressee & ); public: - typedef QValueList<Addressee> List; + typedef Q3ValueList<Addressee> List; /** Construct an empty address book entry. diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp index 671787e..bda1b9e 100644 --- a/kabc/addresseedialog.cpp +++ b/kabc/addresseedialog.cpp @@ -20,11 +20,14 @@ #include <qlayout.h> #include <qpushbutton.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qapplication.h> #include <qregexp.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qlabel.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3VBoxLayout> #include <klocale.h> #include <kdebug.h> @@ -38,8 +41,8 @@ using namespace KABC; -AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : - QListViewItem( parent ), +AddresseeItem::AddresseeItem( Q3ListView *parent, const Addressee &addressee ) : + Q3ListViewItem( parent ), mAddressee( addressee ) { setText( Name,addressee.realName()); @@ -71,7 +74,7 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : QWidget *listWidget = new QWidget( mMiniSplitter ); - QVBoxLayout *listLayout = new QVBoxLayout (listWidget) ; + Q3VBoxLayout *listLayout = new Q3VBoxLayout (listWidget) ; //topLayout->addLayout( listLayout ); mAddresseeList = new KListView( listWidget ); @@ -81,10 +84,10 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : mAddresseeList->setAllColumnsShowFocus( true ); mAddresseeList->setFullWidth( true ); listLayout->addWidget( mAddresseeList ); - connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), + connect( mAddresseeList, SIGNAL( doubleClicked( Q3ListViewItem * ) ), SLOT( slotOk() ) ); //QHBox* searchBox = new QHBox ( listWidget ); - QHBox * hb = new QHBox ( listWidget ); + Q3HBox * hb = new Q3HBox ( listWidget ); listLayout->addWidget ( hb ); mAddresseeEdit = new QLineEdit( hb ); connect( mAddresseeEdit, SIGNAL( returnPressed() ), @@ -101,9 +104,9 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : mSelectedList->setFullWidth( true ); //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), // SLOT( removeSelected() ) ); - connect( mSelectedList, SIGNAL( clicked( QListViewItem * ) ), + connect( mSelectedList, SIGNAL( clicked( Q3ListViewItem * ) ), SLOT( removeSelected() ) ); - connect( mSelectedList, SIGNAL( returnPressed( QListViewItem *) ), + connect( mSelectedList, SIGNAL( returnPressed( Q3ListViewItem *) ), SLOT( removeSelected() ) ); #if 0 @@ -111,10 +114,10 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); #endif - connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), - SLOT( addSelected( QListViewItem * ) ) ); - connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), - SLOT( selectNextItem( QListViewItem * ) ) ); + connect( mAddresseeList, SIGNAL( clicked( Q3ListViewItem * ) ), + SLOT( addSelected( Q3ListViewItem * ) ) ); + connect( mAddresseeList, SIGNAL( returnPressed( Q3ListViewItem * ) ), + SLOT( selectNextItem( Q3ListViewItem * ) ) ); } @@ -126,7 +129,7 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : SLOT( addressBookChanged() ) ); #endif loadAddressBook(); - QValueList<int> splitterSize; + Q3ValueList<int> splitterSize; splitterSize.append( ( width() / 5 ) * 3 ); splitterSize.append( ( width() / 5 ) *2 ); mMiniSplitter->setSizes( splitterSize ); @@ -172,7 +175,7 @@ void AddresseeDialog::loadAddressBook() } } -void AddresseeDialog::addCompletionItem( const QString &str, QListViewItem *item ) +void AddresseeDialog::addCompletionItem( const QString &str, Q3ListViewItem *item ) { if ( str.isEmpty() ) return; @@ -184,7 +187,7 @@ void AddresseeDialog::selectItem( const QString &str ) { if ( str.isEmpty() ) return; - QListViewItem *item = mItemDict.find( str ); + Q3ListViewItem *item = mItemDict.find( str ); if ( item ) { mAddresseeList->blockSignals( true ); mAddresseeList->setSelected( item, true ); @@ -193,30 +196,30 @@ void AddresseeDialog::selectItem( const QString &str ) } } -void AddresseeDialog::updateEdit( QListViewItem *item ) +void AddresseeDialog::updateEdit( Q3ListViewItem *item ) { mAddresseeEdit->setText( item->text( 0 ) ); mAddresseeEdit->setSelection( 0, item->text( 0 ).length() ); } -void AddresseeDialog::selectNextItem( QListViewItem *item ) +void AddresseeDialog::selectNextItem( Q3ListViewItem *item ) { addSelected( item ); - QListViewItem *next = item->nextSibling(); + Q3ListViewItem *next = item->nextSibling(); if ( next ) { next->setSelected( true ); item->setSelected( false ); mAddresseeList->setCurrentItem( next ); } } -void AddresseeDialog::addSelected( QListViewItem *item ) +void AddresseeDialog::addSelected( Q3ListViewItem *item ) { AddresseeItem *addrItem = (AddresseeItem *)( item ); if ( !addrItem ) return; Addressee a = addrItem->addressee(); - QListViewItem *selectedItem = mSelectedDict.find( a.uid() ); + Q3ListViewItem *selectedItem = mSelectedDict.find( a.uid() ); if ( !selectedItem ) { selectedItem = new AddresseeItem( mSelectedList, a ); mSelectedDict.insert( a.uid(), selectedItem ); @@ -226,10 +229,10 @@ void AddresseeDialog::addSelected( QListViewItem *item ) void AddresseeDialog::removeSelected() { - QListViewItem *item = mSelectedList->selectedItem(); + Q3ListViewItem *item = mSelectedList->selectedItem(); AddresseeItem *addrItem = (AddresseeItem *)( item ); if ( !addrItem ) return; - QListViewItem *next = item->nextSibling(); + Q3ListViewItem *next = item->nextSibling(); mSelectedDict.remove( addrItem->addressee().uid() ); delete addrItem; if ( next ) @@ -255,7 +258,7 @@ Addressee::List AddresseeDialog::addressees() AddresseeItem *aItem = 0; if ( mMultiple ) { - QListViewItem *item = mSelectedList->firstChild(); + Q3ListViewItem *item = mSelectedList->firstChild(); while( item ) { aItem = (AddresseeItem *)( item ); if ( aItem ) al.append( aItem->addressee() ); diff --git a/kabc/addresseedialog.h b/kabc/addresseedialog.h index 6fab62d..be7bbb4 100644 --- a/kabc/addresseedialog.h +++ b/kabc/addresseedialog.h @@ -21,7 +21,7 @@ #ifndef KABC_ADDRESSEEDIALOG_H #define KABC_ADDRESSEEDIALOG_H -#include <qdict.h> +#include <q3dict.h> #include <kdialogbase.h> #include <klineedit.h> @@ -34,7 +34,7 @@ namespace KABC { /** @short Special ListViewItem, that is used by the AddresseeDialog. */ -class AddresseeItem : public QListViewItem +class AddresseeItem : public Q3ListViewItem { public: @@ -51,7 +51,7 @@ class AddresseeItem : public QListViewItem @param parent The parent listview. @param addressee The associated addressee. */ - AddresseeItem( QListView *parent, const Addressee &addressee ); + AddresseeItem( Q3ListView *parent, const Addressee &addressee ); /** Returns the addressee. @@ -129,9 +129,9 @@ class AddresseeDialog : public KDialogBase private slots: void selectItem( const QString & ); - void selectNextItem( QListViewItem *item ); - void updateEdit( QListViewItem *item ); - void addSelected( QListViewItem *item ); + void selectNextItem( Q3ListViewItem *item ); + void updateEdit( Q3ListViewItem *item ); + void addSelected( Q3ListViewItem *item ); void removeSelected(); void loadAddressBook(); @@ -139,7 +139,7 @@ class AddresseeDialog : public KDialogBase void addressBookChanged(); private: - void addCompletionItem( const QString &str, QListViewItem *item ); + void addCompletionItem( const QString &str, Q3ListViewItem *item ); bool mMultiple; @@ -150,8 +150,8 @@ class AddresseeDialog : public KDialogBase AddressBook *mAddressBook; - QDict<QListViewItem> mItemDict; - QDict<QListViewItem> mSelectedDict; + Q3Dict<Q3ListViewItem> mItemDict; + Q3Dict<Q3ListViewItem> mSelectedDict; class AddresseeDialogPrivate; AddresseeDialogPrivate *d; diff --git a/kabc/addresseelist.cpp b/kabc/addresseelist.cpp index 097e162..e1ba1ce 100644 --- a/kabc/addresseelist.cpp +++ b/kabc/addresseelist.cpp @@ -28,7 +28,9 @@ $Id$ #include <kdebug.h> //US -#include <qtl.h> +#include <q3tl.h> +//Added by qt3to4: +#include <Q3ValueList> #include "addresseelist.h" @@ -121,7 +123,7 @@ bool SortingTraits::GivenName::lt( const Addressee &a1, const Addressee &a2 ) // AddresseeList::AddresseeList() - : QValueList<Addressee>() + : Q3ValueList<Addressee>() { mReverseSorting = false; mActiveSortingCriterion = FormattedName; @@ -133,14 +135,14 @@ AddresseeList::~AddresseeList() } AddresseeList::AddresseeList( const AddresseeList &l ) - : QValueList<Addressee>( l ) + : Q3ValueList<Addressee>( l ) { mReverseSorting = l.reverseSorting(); mActiveSortingCriterion = l.sortingCriterion(); } -AddresseeList::AddresseeList( const QValueList<Addressee> &l ) - : QValueList<Addressee>( l ) +AddresseeList::AddresseeList( const Q3ValueList<Addressee> &l ) + : Q3ValueList<Addressee>( l ) { mReverseSorting = false; } diff --git a/kabc/addresseelist.h b/kabc/addresseelist.h index 2df252c..6106804 100644 --- a/kabc/addresseelist.h +++ b/kabc/addresseelist.h @@ -29,7 +29,7 @@ $Id$ #ifndef KABC_ADDRESSEELIST_H #define KABC_ADDRESSEELIST_H -#include <qvaluelist.h> +#include <q3valuelist.h> #include "addressee.h" @@ -114,13 +114,13 @@ typedef enum { Uid, Name, FormattedName, FamilyName, GivenName } SortingCriterio * * @author Jost Schenck jost@schenck.de */ -class AddresseeList : public QValueList<Addressee> +class AddresseeList : public Q3ValueList<Addressee> { public: AddresseeList(); ~AddresseeList(); AddresseeList( const AddresseeList & ); - AddresseeList( const QValueList<Addressee> & ); + AddresseeList( const Q3ValueList<Addressee> & ); /** * Debug output. diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp index cde19a1..425e67c 100644 --- a/kabc/addresseeview.cpp +++ b/kabc/addresseeview.cpp @@ -27,23 +27,28 @@ #include <kiconloader.h> #include <klocale.h> //US #include <kstringhandler.h> -#include <qscrollview.h> +#include <q3scrollview.h> #include <qregexp.h> #include <qfile.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qlabel.h> #include <qwidget.h> #include <qlayout.h> #include <qapplication.h> #include <qpushbutton.h> #ifdef DESKTOP_VERSION -#include <qpaintdevicemetrics.h> +#include <q3paintdevicemetrics.h> #include <qprinter.h> #include <qpainter.h> #endif +#include <QDesktopWidget> -#include <qstylesheet.h> +#include <q3stylesheet.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <QPixmap> +#include <Q3VBoxLayout> #include "externalapphandler.h" #include <kabc/addresseeview.h> @@ -59,7 +64,7 @@ using namespace KABC; bool AddresseeView::sFullDetailsMode = false; AddresseeView::AddresseeView( QWidget *parent, const char *name ) - : QTextBrowser( parent, name ) + : Q3TextBrowser( parent, name ) { @@ -82,7 +87,7 @@ void AddresseeView::printMe() return; QPainter p; p.begin ( &printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); @@ -402,7 +407,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) { picString = "<img src=\"myimage\" width=\"50\" height=\"70\">"; if ( picAvailintern ) { - QMimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() ); + Q3MimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() ); int wid = picture.data().width(); int hei = picture.data().height(); if ( wid > 128 || hei > 128 ) { @@ -418,7 +423,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) } else { if ( picAvailUrl ) { QPixmap picPix( picture.url() ); - QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", picPix ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "myimage", picPix ); int wid = picPix.width(); int hei = picPix.height(); if ( wid > 128 || hei > 128 ) { @@ -435,7 +440,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) if ( !mAddressee.custom( "KADDRESSBOOK", "X-Children" ).isEmpty() ) { static bool setDefaultImageChildren = false; if ( !setDefaultImageChildren ) { - QMimeSourceFactory::defaultFactory()->setPixmap( "familyIcon", KGlobal::iconLoader()->loadIcon( "ic_kids", KIcon::Desktop, 128 ) ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "familyIcon", KGlobal::iconLoader()->loadIcon( "ic_kids", KIcon::Desktop, 128 ) ); setDefaultImageChildren = true; } picString = "<img src=\"familyIcon\" width=\"64\" height=\"64\">"; @@ -443,7 +448,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) } else if ( !mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ).isEmpty() ) { static bool setDefaultImagepouses = false; if ( !setDefaultImagepouses ) { - QMimeSourceFactory::defaultFactory()->setPixmap( "SpousesIcon", KGlobal::iconLoader()->loadIcon( "ic_family", KIcon::Desktop, 128 ) ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "SpousesIcon", KGlobal::iconLoader()->loadIcon( "ic_family", KIcon::Desktop, 128 ) ); setDefaultImagepouses = true; } picString = "<img src=\"SpousesIcon\" width=\"64\" height=\"64\">"; @@ -452,7 +457,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) if ( gen == "male" ) { static bool setDefaultImageMale = false; if ( !setDefaultImageMale ) { - QMimeSourceFactory::defaultFactory()->setPixmap( "MaleIcon", KGlobal::iconLoader()->loadIcon( "ic_male", KIcon::Desktop, 128 ) ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "MaleIcon", KGlobal::iconLoader()->loadIcon( "ic_male", KIcon::Desktop, 128 ) ); setDefaultImageMale = true; } picString = "<img src=\"MaleIcon\" width=\"64\" height=\"64\">"; @@ -460,7 +465,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) } else if ( gen == "female" ) { static bool setDefaultImageFemale = false; if ( !setDefaultImageFemale ) { - QMimeSourceFactory::defaultFactory()->setPixmap( "FemaleIcon", KGlobal::iconLoader()->loadIcon( "ic_female", KIcon::Desktop, 128 ) ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "FemaleIcon", KGlobal::iconLoader()->loadIcon( "ic_female", KIcon::Desktop, 128 ) ); setDefaultImageFemale = true; } picString = "<img src=\"FemaleIcon\" width=\"64\" height=\"64\">"; @@ -469,7 +474,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) static bool setDefaultImage = false; if ( !setDefaultImage ) { //qDebug("Setting default pixmap "); - QMimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) ); setDefaultImage = true; } picString = "<img src=\"defaultIcon\" width=\"64\" height=\"64\">"; @@ -653,7 +658,7 @@ void AddresseeView::addTag(const QString & tag,const QString & text) { if ( text.isEmpty() ) return; - int number=text.contains("\n"); + int number=text.count("\n"); QString str = "<" + tag + ">"; QString tmpText=text; QString tmpStr=str; @@ -688,24 +693,24 @@ AddresseeChooser::AddresseeChooser( KABC::Addressee loc, KABC::Addressee rem, bo findButton( User1 )->setText( i18n("Local")); QWidget* topframe = new QWidget( this ); setMainWidget( topframe ); - QBoxLayout* bl; + Q3BoxLayout* bl; if ( QApplication::desktop()->width() < 640 ) { - bl = new QVBoxLayout( topframe ); + bl = new Q3VBoxLayout( topframe ); } else { - bl = new QHBoxLayout( topframe ); + bl = new Q3HBoxLayout( topframe ); } - QVBox* subframe = new QVBox( topframe ); + Q3VBox* subframe = new Q3VBox( topframe ); bl->addWidget(subframe ); QLabel* lab = new QLabel( i18n("Local Addressee"), subframe ); if ( takeloc ) - lab->setBackgroundColor(Qt::green.light() ); + lab->setBackgroundColor(QColor(Qt::green).light() ); AddresseeView * av = new AddresseeView( subframe ); av->setAddressee( loc ); - subframe = new QVBox( topframe ); + subframe = new Q3VBox( topframe ); bl->addWidget(subframe ); lab = new QLabel( i18n("Remote Addressee"), subframe ); if ( !takeloc ) - lab->setBackgroundColor(Qt::green.light() ); + lab->setBackgroundColor(QColor(Qt::green).light() ); av = new AddresseeView( subframe ); av->setAddressee( rem ); QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); diff --git a/kabc/addresseeview.h b/kabc/addresseeview.h index a4de085..f7ce2e0 100644 --- a/kabc/addresseeview.h +++ b/kabc/addresseeview.h @@ -26,12 +26,12 @@ #include <kdialogbase.h> //US #include <ktextbrowser.h> -#include <qtextbrowser.h> +#include <q3textbrowser.h> namespace KABC { //US class AddresseeView : public KTextBrowser -class AddresseeView : public QTextBrowser +class AddresseeView : public Q3TextBrowser { public: diff --git a/kabc/distributionlist.cpp b/kabc/distributionlist.cpp index d34ba0b..cf5afa6 100644 --- a/kabc/distributionlist.cpp +++ b/kabc/distributionlist.cpp @@ -23,6 +23,8 @@ #include <kdebug.h> #include "distributionlist.h" +//Added by qt3to4: +#include <Q3ValueList> using namespace KABC; @@ -54,7 +56,7 @@ void DistributionList::insertEntry( const Addressee &a, const QString &email ) if (em.isNull() ) em = a.preferredEmail(); Entry e( a, em ); - QValueList<Entry>::Iterator it; + Q3ValueList<Entry>::Iterator it; for( it = mEntries.begin(); it != mEntries.end(); ++it ) { if ( (*it).addressee.uid() == a.uid() ) { /** @@ -74,7 +76,7 @@ void DistributionList::insertEntry( const Addressee &a, const QString &email ) void DistributionList::removeEntry( const Addressee &a, const QString &email ) { - QValueList<Entry>::Iterator it; + Q3ValueList<Entry>::Iterator it; for( it = mEntries.begin(); it != mEntries.end(); ++it ) { if ( (*it).addressee.uid() == a.uid() && (*it).email == email ) { mEntries.remove( it ); diff --git a/kabc/distributionlist.h b/kabc/distributionlist.h index c81e543..8d21a17 100644 --- a/kabc/distributionlist.h +++ b/kabc/distributionlist.h @@ -24,6 +24,9 @@ //#include <kdirwatch.h> #include "addressbook.h" +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3PtrList> namespace KABC { @@ -48,7 +51,7 @@ class DistributionList */ struct Entry { - typedef QValueList<Entry> List; + typedef Q3ValueList<Entry> List; Entry() {} Entry( const Addressee &_addressee, const QString &_email ) : @@ -167,7 +170,7 @@ class DistributionListManager private: AddressBook *mAddressBook; - QPtrList<DistributionList> mLists; + Q3PtrList<DistributionList> mLists; }; /** diff --git a/kabc/distributionlistdialog.cpp b/kabc/distributionlistdialog.cpp index d2e1144..82883e6 100644 --- a/kabc/distributionlistdialog.cpp +++ b/kabc/distributionlistdialog.cpp @@ -18,13 +18,19 @@ Boston, MA 02111-1307, USA. */ -#include <qlistview.h> +#include <q3listview.h> #include <qlayout.h> #include <qlabel.h> #include <qpushbutton.h> #include <qcombobox.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <Q3Frame> +#include <Q3VBoxLayout> #include <klineeditdlg.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> +#include <Q3Button> #include <qradiobutton.h> #include <klocale.h> @@ -60,10 +66,10 @@ EmailSelector::EmailSelector( const QStringList &emails, const QString ¤t, KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, parent ) { - QFrame *topFrame = plainPage(); - QBoxLayout *topLayout = new QVBoxLayout( topFrame ); + Q3Frame *topFrame = plainPage(); + Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); - mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), + mButtonGroup = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"), topFrame ); topLayout->addWidget( mButtonGroup ); @@ -78,7 +84,7 @@ EmailSelector::EmailSelector( const QStringList &emails, const QString ¤t, QString EmailSelector::selected() { - QButton *button = mButtonGroup->selected(); + QAbstractButton *button = mButtonGroup->selected(); if ( button ) return button->text(); return QString::null; } @@ -96,12 +102,12 @@ QString EmailSelector::getEmail( const QStringList &emails, const QString &curre return result; } -class EntryItem : public QListViewItem +class EntryItem : public Q3ListViewItem { public: - EntryItem( QListView *parent, const Addressee &addressee, + EntryItem( Q3ListView *parent, const Addressee &addressee, const QString &email=QString::null ) : - QListViewItem( parent ), + Q3ListViewItem( parent ), mAddressee( addressee ), mEmail( email ) { @@ -136,10 +142,10 @@ DistributionListEditorWidget::DistributionListEditorWidget( AddressBook *address { kdDebug(5700) << "DistributionListEditor()" << endl; - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); - QBoxLayout *nameLayout = new QHBoxLayout( topLayout) ; + Q3BoxLayout *nameLayout = new Q3HBoxLayout( topLayout) ; mNameCombo = new QComboBox( this ); nameLayout->addWidget( mNameCombo ); @@ -157,7 +163,7 @@ DistributionListEditorWidget::DistributionListEditorWidget( AddressBook *address nameLayout->addWidget( mRemoveButton ); connect( mRemoveButton, SIGNAL( clicked() ), SLOT( removeList() ) ); - QGridLayout *gridLayout = new QGridLayout( topLayout, 3, 3 ); + Q3GridLayout *gridLayout = new Q3GridLayout( topLayout, 3, 3 ); gridLayout->setColStretch(1, 1); QLabel *listLabel = new QLabel( i18n("Available addresses:"), this ); @@ -166,14 +172,14 @@ DistributionListEditorWidget::DistributionListEditorWidget( AddressBook *address mListLabel = new QLabel( this ); gridLayout->addMultiCellWidget( mListLabel, 0, 0, 1, 2 ); - mAddresseeView = new QListView( this ); + mAddresseeView = new Q3ListView( this ); mAddresseeView->addColumn( i18n("Name") ); mAddresseeView->addColumn( i18n("Preferred Email") ); mAddresseeView->setAllColumnsShowFocus( true ); gridLayout->addWidget( mAddresseeView, 1, 0 ); connect( mAddresseeView, SIGNAL( selectionChanged() ), SLOT( slotSelectionAddresseeViewChanged() ) ); - connect( mAddresseeView, SIGNAL( doubleClicked( QListViewItem * ) ), + connect( mAddresseeView, SIGNAL( doubleClicked( Q3ListViewItem * ) ), SLOT( addEntry() ) ); mAddEntryButton = new QPushButton( i18n("Add Entry"), this ); @@ -181,7 +187,7 @@ DistributionListEditorWidget::DistributionListEditorWidget( AddressBook *address gridLayout->addWidget( mAddEntryButton, 2, 0 ); connect( mAddEntryButton, SIGNAL( clicked() ), SLOT( addEntry() ) ); - mEntryView = new QListView( this ); + mEntryView = new Q3ListView( this ); mEntryView->addColumn( i18n("Name") ); mEntryView->addColumn( i18n("Email") ); mEntryView->addColumn( i18n("Use Preferred") ); diff --git a/kabc/distributionlistdialog.h b/kabc/distributionlistdialog.h index b6d3c80..3627431 100644 --- a/kabc/distributionlistdialog.h +++ b/kabc/distributionlistdialog.h @@ -22,13 +22,15 @@ #define KABC_DISTRIBUTIONLISTDIALOG_H #include <qwidget.h> +//Added by qt3to4: +#include <QLabel> #include <kdialogbase.h> -class QListView; +class Q3ListView; class QLabel; class QComboBox; -class QButtonGroup; +class Q3ButtonGroup; namespace KABC { @@ -93,7 +95,7 @@ class EmailSelector : public KDialogBase QWidget *parent ); private: - QButtonGroup *mButtonGroup; + Q3ButtonGroup *mButtonGroup; }; /** @@ -124,8 +126,8 @@ class DistributionListEditorWidget : public QWidget private: QComboBox *mNameCombo; QLabel *mListLabel; - QListView *mEntryView; - QListView *mAddresseeView; + Q3ListView *mEntryView; + Q3ListView *mAddresseeView; AddressBook *mAddressBook; DistributionListManager *mManager; diff --git a/kabc/distributionlisteditor.cpp b/kabc/distributionlisteditor.cpp index 9f5840b..ca5ecb7 100644 --- a/kabc/distributionlisteditor.cpp +++ b/kabc/distributionlisteditor.cpp @@ -18,7 +18,7 @@ Boston, MA 02111-1307, USA. */ -#include <qlistview.h> +#include <q3listview.h> #include <qlayout.h> #include <qpushbutton.h> #include <qcombobox.h> @@ -27,8 +27,12 @@ #else #include <qtcompat/qinputdialog.h> #endif -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qradiobutton.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3Frame> +#include <Q3VBoxLayout> #include <klocale.h> #include <kdebug.h> @@ -48,10 +52,10 @@ EmailSelectDialog::EmailSelectDialog( const QStringList &emails, const QString & KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, parent ) { - QFrame *topFrame = plainPage(); - QBoxLayout *topLayout = new QVBoxLayout( topFrame ); + Q3Frame *topFrame = plainPage(); + Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); - mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), + mButtonGroup = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"), topFrame ); topLayout->addWidget( mButtonGroup ); @@ -66,7 +70,7 @@ EmailSelectDialog::EmailSelectDialog( const QStringList &emails, const QString & QString EmailSelectDialog::selected() { - QButton *button = mButtonGroup->selected(); + QAbstractButton *button = mButtonGroup->selected(); if ( button ) return button->text(); return QString::null; } @@ -85,12 +89,12 @@ QString EmailSelectDialog::getEmail( const QStringList &emails, const QString &c return result; } -class EditEntryItem : public QListViewItem +class EditEntryItem : public Q3ListViewItem { public: - EditEntryItem( QListView *parent, const Addressee &addressee, + EditEntryItem( Q3ListView *parent, const Addressee &addressee, const QString &email=QString::null ) : - QListViewItem( parent ), + Q3ListViewItem( parent ), mAddressee( addressee ), mEmail( email ) { @@ -125,11 +129,11 @@ DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidge { kdDebug(5700) << "DistributionListEditor()" << endl; - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); topLayout->setMargin( KDialog::marginHint() ); topLayout->setSpacing( KDialog::spacingHint() ); - QBoxLayout *nameLayout = new QHBoxLayout( topLayout) ; + Q3BoxLayout *nameLayout = new Q3HBoxLayout( topLayout) ; mNameCombo = new QComboBox( this ); nameLayout->addWidget( mNameCombo ); @@ -143,7 +147,7 @@ DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidge nameLayout->addWidget( removeButton ); connect( removeButton, SIGNAL( clicked() ), SLOT( removeList() ) ); - mEntryView = new QListView( this ); + mEntryView = new Q3ListView( this ); mEntryView->addColumn( i18n("Name") ); mEntryView->addColumn( i18n("Email") ); mEntryView->addColumn( i18n("Use Preferred") ); @@ -162,7 +166,7 @@ DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidge topLayout->addWidget( addEntryButton ); connect( addEntryButton, SIGNAL( clicked() ), SLOT( addEntry() ) ); - mAddresseeView = new QListView( this ); + mAddresseeView = new Q3ListView( this ); mAddresseeView->addColumn( i18n("Name") ); mAddresseeView->addColumn( i18n("Preferred Email") ); topLayout->addWidget( mAddresseeView ); diff --git a/kabc/distributionlisteditor.h b/kabc/distributionlisteditor.h index e0b4221..e672a14 100644 --- a/kabc/distributionlisteditor.h +++ b/kabc/distributionlisteditor.h @@ -24,9 +24,9 @@ #include <kdialogbase.h> -class QListView; +class Q3ListView; class QComboBox; -class QButtonGroup; +class Q3ButtonGroup; namespace KABC { @@ -45,7 +45,7 @@ class EmailSelectDialog : public KDialogBase QWidget *parent ); private: - QButtonGroup *mButtonGroup; + Q3ButtonGroup *mButtonGroup; }; /** @@ -72,8 +72,8 @@ class DistributionListEditor : public QWidget private: QComboBox *mNameCombo; - QListView *mEntryView; - QListView *mAddresseeView; + Q3ListView *mEntryView; + Q3ListView *mAddresseeView; AddressBook *mAddressBook; DistributionListManager *mManager; diff --git a/kabc/field.cpp b/kabc/field.cpp index 7c6d7a9..203f696 100644 --- a/kabc/field.cpp +++ b/kabc/field.cpp @@ -33,6 +33,8 @@ $Id$ #include "field.h" #include "resource.h" +//Added by qt3to4: +#include <Q3ValueList> using namespace KABC; @@ -377,7 +379,7 @@ bool Field::setValue( KABC::Addressee &a, const QString &value ) // But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? { QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate - a.setBirthday(dt); + a.setBirthday((QDateTime)dt); } return true; case FieldImpl::CustomField: @@ -493,7 +495,7 @@ void Field::saveFields( const QString &identifier, void Field::saveFields( KConfig *cfg, const QString &identifier, const Field::List &fields ) { - QValueList<int> fieldIds; + Q3ValueList<int> fieldIds; //US // qDebug("Field::saveFields to %s %s", cfg->getFileName().latin1(), identifier.latin1()); @@ -533,14 +535,14 @@ Field::List Field::restoreFields( const QString &identifier ) Field::List Field::restoreFields( KConfig *cfg, const QString &identifier ) { - QValueList<int> fieldIds = cfg->readIntListEntry( identifier); + Q3ValueList<int> fieldIds = cfg->readIntListEntry( identifier); //US // qDebug("Field::restoreFields from %s, identifier: %s", cfg->getFileName().latin1(), identifier.latin1()); Field::List fields; int custom = 0; - QValueList<int>::ConstIterator it; + Q3ValueList<int>::ConstIterator it; for( it = fieldIds.begin(); it != fieldIds.end(); ++it ) { FieldImpl *f = 0; if ( (*it) == FieldImpl::CustomField ) { diff --git a/kabc/field.h b/kabc/field.h index 9e06597..55cc705 100644 --- a/kabc/field.h +++ b/kabc/field.h @@ -29,7 +29,7 @@ $Id$ #define KABC_FIELD_H #include <qstring.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include "addressee.h" @@ -43,7 +43,7 @@ class Field friend class FieldImpl; public: - typedef QValueList<Field *> List; + typedef Q3ValueList<Field *> List; /** * @li @p All - diff --git a/kabc/formatfactory.cpp b/kabc/formatfactory.cpp index 3ae1c27..cbb97a2 100644 --- a/kabc/formatfactory.cpp +++ b/kabc/formatfactory.cpp @@ -102,7 +102,7 @@ QStringList FormatFactory::formats() // make sure 'vcard' is the first entry retval << "vcard"; - QDictIterator<FormatInfo> it( mFormatList ); + Q3DictIterator<FormatInfo> it( mFormatList ); for ( ; it.current(); ++it ) if ( it.currentKey() != "vcard" ) retval << it.currentKey(); diff --git a/kabc/formatfactory.h b/kabc/formatfactory.h index 9612374..de15b17 100644 --- a/kabc/formatfactory.h +++ b/kabc/formatfactory.h @@ -21,7 +21,7 @@ #ifndef KABC_FORMATFACTORY_H #define KABC_FORMATFACTORY_H -#include <qdict.h> +#include <q3dict.h> #include <qstring.h> #include <kconfig.h> @@ -97,7 +97,7 @@ class FormatFactory #endif static FormatFactory *mSelf; - QDict<FormatInfo> mFormatList; + Q3Dict<FormatInfo> mFormatList; }; } 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 @@ -8,7 +8,7 @@ INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../qtcomp OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc DESTDIR = $(QPEDIR)/lib -LIBS += -lmicrokde -lmicrokabc +LIBS += -lxmicrokde -lxmicrokabc LIBS += -L$(QPEDIR)/lib DEFINES += KAB_EMBEDDED 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 @@ -11,7 +11,7 @@ $Id$ #include "addressee.h" #include "vcardparser/vcardtool.h" -#include <qtextstream.h> +#include <q3textstream.h> #include <qfile.h> using namespace KABC; @@ -37,8 +37,8 @@ bool VCardFormatPlugin2::load( Addressee &addressee, QFile *file ) qDebug("VCardFormatPlugin2::load"); QString data; - QTextStream t( file ); - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( file ); + t.setEncoding( Q3TextStream::UnicodeUTF8 ); data = t.read(); VCardTool tool; @@ -58,8 +58,8 @@ bool VCardFormatPlugin2::loadAll( AddressBook *addressBook, Resource *resource, qDebug("VCardFormatPlugin2::loadAll"); QString data; - QTextStream t( file ); - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( file ); + t.setEncoding( Q3TextStream::UnicodeUTF8 ); data = t.read(); VCardTool tool; @@ -86,8 +86,8 @@ void VCardFormatPlugin2::save( const Addressee &addressee, QFile *file ) vcardlist.append( addressee ); - QTextStream t( file ); - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( file ); + t.setEncoding( Q3TextStream::UnicodeUTF8 ); t << tool.createVCards( vcardlist ); } @@ -105,8 +105,8 @@ void VCardFormatPlugin2::saveAll( AddressBook *ab, Resource *resource, QFile *fi } } - QTextStream t( file ); - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( file ); + t.setEncoding( Q3TextStream::UnicodeUTF8 ); t << tool.createVCards( vcardlist ); } @@ -114,7 +114,7 @@ bool VCardFormatPlugin2::checkFormat( QFile *file ) const { QString line; - file->readLine( line, 1024 ); + char tmp[1024]; file->readLine( tmp, 1024 ); line = tmp; line = line.stripWhiteSpace(); if ( line == "BEGIN:VCARD" ) return true; diff --git a/kabc/kabc.pro b/kabc/kabc.pro index 17ebff8..846ed8a 100644 --- a/kabc/kabc.pro +++ b/kabc/kabc.pro @@ -3,13 +3,13 @@ CONFIG += qt warn_on #release debug DESTDIR=../bin -TARGET = microkabc +TARGET = xmicrokabc include( ../variables.pri ) INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim ../qtcompat ../microkde/kdeui .. -#LIBS += -lmicrokde -lldap +#LIBS += -lxmicrokde -lldap LIBS += -L$(QPEDIR)/lib DEFINES += KAB_EMBEDDED DESKTOP_VERSION unix : { @@ -216,3 +216,7 @@ vcard/TextListValue.cpp # plugins/ldap/resourceldapconfig.cpp \ #formats/binary/binaryformat.cpp \ +#The following line was inserted by qt3to4 +QT += xml qt3support +#The following line was inserted by qt3to4 +QT += diff --git a/kabc/kabcE.pro b/kabc/kabcE.pro index 1d28a4d..6045b68 100644 --- a/kabc/kabcE.pro +++ b/kabc/kabcE.pro @@ -1,14 +1,14 @@ TEMPLATE = lib CONFIG += qt warn_on -TARGET = microkabc +TARGET = xmicrokabc INCLUDEPATH += . $(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 OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR = $(QPEDIR)/lib -LIBS += -lmicrokde -LIBS += -lmicrokdepim +LIBS += -lxmicrokde +LIBS += -lxmicrokdepim #LIBS += -lldap LIBS += -L$(QPEDIR)/lib DEFINES += KAB_EMBEDDED @@ -194,3 +194,5 @@ vcard/TextListValue.cpp # plugins/ldap/resourceldap.cpp \ # plugins/ldap/resourceldapconfig.cpp \ +#The following line was inserted by qt3to4 +QT += qt3support @@ -28,7 +28,7 @@ $Id$ #ifndef KABC_KEY_H #define KABC_KEY_H -#include <qvaluelist.h> +#include <q3valuelist.h> namespace KABC { @@ -41,8 +41,8 @@ class Key friend QDataStream &operator>>( QDataStream &, Key & ); public: - typedef QValueList<Key> List; - typedef QValueList<int> TypeList; + typedef Q3ValueList<Key> List; + typedef Q3ValueList<int> TypeList; /** * Key types diff --git a/kabc/phonenumber.h b/kabc/phonenumber.h index feeba6c..6bc89d3 100644 --- a/kabc/phonenumber.h +++ b/kabc/phonenumber.h @@ -28,7 +28,7 @@ $Id$ #ifndef KABC_PHONENUMBER_H #define KABC_PHONENUMBER_H -#include <qvaluelist.h> +#include <q3valuelist.h> #include <qstring.h> namespace KABC { @@ -46,8 +46,8 @@ class PhoneNumber friend QDataStream &operator>>( QDataStream &, PhoneNumber & ); public: - typedef QValueList<PhoneNumber> List; - typedef QValueList<int> TypeList; + typedef Q3ValueList<PhoneNumber> List; + typedef Q3ValueList<int> TypeList; /** @li @p Home - Home number diff --git a/kabc/picture.cpp b/kabc/picture.cpp index 57aa297..0c59937 100644 --- a/kabc/picture.cpp +++ b/kabc/picture.cpp @@ -26,6 +26,8 @@ $Id$ */ #include "picture.h" +//Added by qt3to4: +#include <QPixmap> using namespace KABC; diff --git a/kabc/picture.h b/kabc/picture.h index 714d1e2..1b63610 100644 --- a/kabc/picture.h +++ b/kabc/picture.h @@ -29,6 +29,8 @@ $Id$ #define KABC_PICTURE_H #include <qimage.h> +//Added by qt3to4: +#include <QPixmap> namespace KABC { 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 @@ -4,10 +4,10 @@ CONFIG += qt warn_on release include( ../../../variables.pri ) -TARGET = microkabc_dir +TARGET = xmicrokabc_dir INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat DESTDIR = ../../../bin -#LIBS += -lmicrokde -lmicrokabc +#LIBS += -lxmicrokde -lxmicrokabc #LIBS += -L$(QPEDIR)/lib INTERFACES = \ @@ -29,8 +29,12 @@ CONFIG += dll DEFINES += _WIN32_ OBJECTS_DIR = obj/win MOC_DIR = moc/win -LIBS += ../../../bin/microkdepim.lib -LIBS += ../../../bin/microkcal.lib -LIBS += ../../../bin/microkde.lib +LIBS += ../../../bin/xmicrokdepim.lib +LIBS += ../../../bin/xmicrokcal.lib +LIBS += ../../../bin/xmicrokde.lib LIBS += ../../../bin/microkabc.lib } +#The following line was inserted by qt3to4 +QT += qt3support +#The following line was inserted by qt3to4 +QT += 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 @@ -2,12 +2,12 @@ TEMPLATE = lib CONFIG += qt warn_on release #release debug -TARGET = microkabc_dir +TARGET = xmicrokabc_dir INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR = $(QPEDIR)/lib -LIBS += -lmicrokde -lmicrokabc +LIBS += -lxmicrokde -lxmicrokabc LIBS += -L$(QPEDIR)/lib INTERFACES = \ 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 @@ -170,7 +170,7 @@ bool ResourceDir::doOpen() return true; QFile file( mPath + "/" + testName ); - if ( file.open( IO_ReadOnly ) ) + if ( file.open( QIODevice::ReadOnly ) ) return true; if ( file.size() == 0 ) @@ -196,7 +196,7 @@ bool ResourceDir::load() for ( it = files.begin(); it != files.end(); ++it ) { QFile file( mPath + "/" + (*it) ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.open( QIODevice::ReadOnly ) ) { addressBook()->error( i18n( "Unable to open file '%1' for reading" ).arg( file.name() ) ); ok = false; continue; @@ -223,7 +223,7 @@ bool ResourceDir::save( Ticket *ticket ) continue; QFile file( mPath + "/" + (*it).uid() ); - if ( !file.open( IO_WriteOnly ) ) { + if ( !file.open( QIODevice::WriteOnly ) ) { addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) ); continue; } @@ -267,7 +267,7 @@ bool ResourceDir::lock( const QString &path ) // Create unique file QFile file( mLockUniqueName ); - file.open( IO_WriteOnly ); + file.open( QIODevice::WriteOnly ); file.close(); // Create lock file 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 @@ -27,6 +27,8 @@ $Id$ #include <qlabel.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3GridLayout> #include <kdebug.h> #include <klocale.h> @@ -44,7 +46,7 @@ using namespace KABC; ResourceDirConfig::ResourceDirConfig( QWidget* parent, const char* name ) : KRES::ConfigWidget( parent, name ) { - QGridLayout *mainLayout = new QGridLayout( this, 2, 2, 0, + Q3GridLayout *mainLayout = new Q3GridLayout( this, 2, 2, 0, KDialog::spacingHint() ); QLabel *label = new QLabel( i18n( "Format:" ), this ); 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 @@ -4,11 +4,11 @@ CONFIG += qt warn_on release include( ../../../variables.pri ) -TARGET = microkabc_file +TARGET = xmicrokabc_file INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat DESTDIR = ../../../bin -#LIBS += -lmicrokde -lmicrokabc +#LIBS += -lxmicrokde -lxmicrokabc #LIBS += -L$(QPEDIR)/lib INTERFACES = \ @@ -30,8 +30,12 @@ CONFIG += dll DEFINES += _WIN32_ OBJECTS_DIR = obj/win MOC_DIR = moc/win -LIBS += ../../../bin/microkdepim.lib -LIBS += ../../../bin/microkcal.lib -LIBS += ../../../bin/microkde.lib +LIBS += ../../../bin/xmicrokdepim.lib +LIBS += ../../../bin/xmicrokcal.lib +LIBS += ../../../bin/xmicrokde.lib LIBS += ../../../bin/microkabc.lib } +#The following line was inserted by qt3to4 +QT += qt3support +#The following line was inserted by qt3to4 +QT += 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 @@ -2,12 +2,12 @@ TEMPLATE = lib CONFIG += qt warn_on release #release debug -TARGET = microkabc_file +TARGET = xmicrokabc_file INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR = $(QPEDIR)/lib -LIBS += -lmicrokde -lmicrokabc +LIBS += -lxmicrokde -lxmicrokabc LIBS += -L$(QPEDIR)/lib INTERFACES = \ 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 @@ -201,13 +201,13 @@ bool ResourceFile::doOpen() if ( !file.exists() ) { // try to create the file - bool ok = file.open( IO_WriteOnly ); + bool ok = file.open( QIODevice::WriteOnly ); if ( ok ) file.close(); return ok; } else { - if ( !file.open( IO_ReadWrite ) ) + if ( !file.open( QIODevice::ReadWrite ) ) return false; if ( file.size() < 10 ) { @@ -230,7 +230,7 @@ bool ResourceFile::load() { QFile file( fileName() ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.open( QIODevice::ReadOnly ) ) { addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) ); return false; } @@ -311,7 +311,7 @@ bool ResourceFile::save( Ticket *ticket ) } QFile info; info.setName( fileName() ); - bool ok = info.open( IO_WriteOnly ); + bool ok = info.open( QIODevice::WriteOnly ); if ( ok ) { mFormat->saveAll( addressBook(), this, &info ); @@ -363,7 +363,7 @@ bool ResourceFile::lock( const QString &fileName ) // Create unique file QFile file( mLockUniqueName ); - file.open( IO_WriteOnly ); + file.open( QIODevice::WriteOnly ); file.close(); // Create lock file 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 @@ -28,6 +28,8 @@ $Id$ #include <qlabel.h> #include <qlayout.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <Q3GridLayout> #include <kdebug.h> #include <klocale.h> @@ -50,7 +52,7 @@ ResourceFileConfig::ResourceFileConfig( QWidget* parent, const char* name ) { //qDebug("ResourceFileConfig::ResourceFileConfig"); - QGridLayout *mainLayout = new QGridLayout( this, 2, 2, 0, + Q3GridLayout *mainLayout = new Q3GridLayout( this, 2, 2, 0, KDialog::spacingHint() ); QLabel *label = new QLabel( i18n( "Format:" ), this ); 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 @@ -2,12 +2,12 @@ TEMPLATE = lib CONFIG += qt warn_on release #release debug -TARGET = microkabc_ldap +TARGET = xmicrokabc_ldap INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR = $(QPEDIR)/lib -LIBS += -lmicrokde -lmicrokabc +LIBS += -lxmicrokde -lxmicrokabc LIBS += -L$(QPEDIR)/lib INTERFACES = \ 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,6 +1,6 @@ TEMPLATE = lib CONFIG += qt warn_on -TARGET = microkabc_olaccess +TARGET = xmicrokabc_olaccess include( ../../../variables.pri ) @@ -28,8 +28,8 @@ CONFIG += dll DEFINES += _WIN32_ OBJECTS_DIR = obj/win MOC_DIR = moc/win -LIBS += ../../../bin/microkdepim.lib -LIBS += ../../../bin/microkcal.lib -LIBS += ../../../bin/microkde.lib +LIBS += ../../../bin/xmicrokdepim.lib +LIBS += ../../../bin/xmicrokcal.lib +LIBS += ../../../bin/xmicrokde.lib LIBS += ../../../bin/microkabc.lib } 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,7 +1,7 @@ TEMPLATE = lib CONFIG += qt warn_on #release debug -TARGET = microkabc_opie +TARGET = xmicrokabc_opie INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include $(OPIEDIR)/include @@ -9,8 +9,8 @@ INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kde OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR = $(QPEDIR)/lib -LIBS += -lmicrokde -LIBS += -lmicrokabc +LIBS += -lxmicrokde +LIBS += -lxmicrokabc LIBS += -L$(QPEDIR)/lib LIBS += -L$(OPIEDIR)/lib LIBS += -lopie 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 @@ -3,13 +3,13 @@ CONFIG += qt warn_on release include( ../../../variables.pri ) -TARGET = microkabc_qtopia +TARGET = xmicrokabc_qtopia INCLUDEPATH += ../.. ../../.. ../../../kabc ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources DESTDIR = ../../../bin -#LIBS += -lmicrokde -#LIBS += -lkamicrokabc +#LIBS += -lxmicrokde +#LIBS += -lxkamicrokabc DEFINES += KAB_EMBEDDED DESKTOP_VERSION @@ -36,8 +36,12 @@ CONFIG += dll DEFINES += _WIN32_ OBJECTS_DIR = obj/win MOC_DIR = moc/win -LIBS += ../../../bin/microkdepim.lib -LIBS += ../../../bin/microkcal.lib -LIBS += ../../../bin/microkde.lib +LIBS += ../../../bin/xmicrokdepim.lib +LIBS += ../../../bin/xmicrokcal.lib +LIBS += ../../../bin/xmicrokde.lib LIBS += ../../../bin/microkabc.lib } +#The following line was inserted by qt3to4 +QT += xml qt3support +#The following line was inserted by qt3to4 +QT += 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,15 +1,15 @@ TEMPLATE = lib CONFIG += qt warn_on -TARGET = microkabc_qtopia +TARGET = xmicrokabc_qtopia INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR = $(QPEDIR)/lib -LIBS += -lmicrokde -LIBS += -lmicrokabc +LIBS += -lxmicrokde +LIBS += -lxmicrokabc LIBS += -L$(QPEDIR)/lib LIBS += -lqpe 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 @@ -34,7 +34,9 @@ $Id$ #include <qfile.h> #include <qdir.h> -#include <qtextstream.h> +#include <q3textstream.h> +//Added by qt3to4: +#include <Q3ValueList> //#include <.h> #include <libkdepim/ksyncprofile.h> @@ -71,8 +73,8 @@ QString QtopiaConverter::categoriesToNumber( const QStringList &list, const QStr { startover: QStringList dummy; - QValueList<OpieCategories>::ConstIterator catIt; - QValueList<OpieCategories> categories = m_edit->categories(); + Q3ValueList<OpieCategories>::ConstIterator catIt; + Q3ValueList<OpieCategories> categories = m_edit->categories(); bool found = false; for ( QStringList::ConstIterator listIt = list.begin(); listIt != list.end(); ++listIt ) { /* skip empty category name */ @@ -192,7 +194,7 @@ bool QtopiaConverter::qtopiaToAddressee( const QDomElement& el, Addressee &adr ) QDate date = dateFromString( el.attribute( "Birthday" ) ); if ( date.isValid() ) - adr.setBirthday( date ); + adr.setBirthday( (QDateTime)date ); adr.setRole( el.attribute( "JobTitle" ) ); if ( !el.attribute( "FileAs" ).isEmpty() ) @@ -317,7 +319,7 @@ bool QtopiaConverter::qtopiaToAddressee( const QDomElement& el, Addressee &adr ) return true; } -bool QtopiaConverter::addresseeToQtopia( const Addressee &ab, QTextStream *stream ) +bool QtopiaConverter::addresseeToQtopia( const Addressee &ab, Q3TextStream *stream ) { *stream << "<Contact "; *stream << "FirstName=\"" << escape(ab.givenName()) << "\" "; @@ -484,13 +486,13 @@ CategoryEdit::~CategoryEdit(){ void CategoryEdit::save(const QString& fileName)const{ QFile file( fileName ); QString endl = "\n"; - if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + if ( file.open( QIODevice::WriteOnly ) ) { + Q3TextStream stream( &file ); + stream.setEncoding( Q3TextStream::UnicodeUTF8 ); stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl; stream << "<!DOCTYPE CategoryList>" << endl; stream << "<Categories>" << endl; - for ( QValueList<OpieCategories>::ConstIterator it = m_categories.begin(); + for ( Q3ValueList<OpieCategories>::ConstIterator it = m_categories.begin(); it != m_categories.end(); ++it ) { stream << "<Category id=\""<< ( (*it).id() ) << "\" "; @@ -537,7 +539,7 @@ void CategoryEdit::parse( const QString &tempFile ){ QDomDocument doc( "mydocument" ); QFile f( tempFile ); - if ( !f.open( IO_ReadOnly ) ) + if ( !f.open( QIODevice::ReadOnly ) ) return; if ( !doc.setContent( &f ) ) { @@ -587,7 +589,7 @@ void CategoryEdit::clear() } QString CategoryEdit::categoryById( const QString &id, const QString &app )const { - QValueList<OpieCategories>::ConstIterator it; + Q3ValueList<OpieCategories>::ConstIterator it; QString category; QString fallback; for( it = m_categories.begin(); it != m_categories.end(); ++it ){ 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 @@ -28,6 +28,9 @@ $Id$ #define KABC_QTOPIACONVERTER_H #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3TextStream> #include "addressee.h" #ifdef DESKTOP_VERSION @@ -76,14 +79,14 @@ class OpieCategories { QStringList categoriesByIds( const QStringList& ids, const QString& app ); void clear(); - QValueList<OpieCategories> categories()const { return m_categories; }; + Q3ValueList<OpieCategories> categories()const { return m_categories; }; private: /** * this function will be used internally to update the kde categories... */ void updateKDE( const QString& app, const QStringList& categories ); QMap<int, bool> ids; // from tt Qtopia::UidGen - QValueList<OpieCategories> m_categories; + Q3ValueList<OpieCategories> m_categories; }; @@ -117,7 +120,7 @@ public: * @param addr The addressee. * @param contact The qtopia contact. */ - bool addresseeToQtopia( const Addressee &ab, QTextStream *stream ); + bool addresseeToQtopia( const Addressee &ab, Q3TextStream *stream ); private: QString categoriesToNumber( const QStringList &list, const QString &app ); 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 @@ -31,7 +31,7 @@ $Id$ #endif #include <qdir.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qfileinfo.h> #include <qregexp.h> //US #include <qtimer.h> @@ -156,7 +156,7 @@ bool ResourceQtopia::load() { QFile file( fileName() ); - if ( !file.open(IO_ReadOnly ) ) { + if ( !file.open(QIODevice::ReadOnly ) ) { return false; } @@ -203,12 +203,12 @@ bool ResourceQtopia::save( Ticket *ticket ) KABC::AddressBook::Iterator it; bool res; QFile file( fileName() ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); - QTextStream *stream = &ts; - stream->setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream ts( &file ); + Q3TextStream *stream = &ts; + stream->setEncoding( Q3TextStream::UnicodeUTF8 ); *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE Addressbook ><AddressBook>" << endl; *stream << " <Groups>" << endl; *stream << " </Groups>" << endl; @@ -260,7 +260,7 @@ bool ResourceQtopia::lock( const QString &lockfileName ) // Create unique file QFile file( mLockUniqueName ); - file.open( IO_WriteOnly ); + file.open( QIODevice::WriteOnly ); file.close(); // Create lock file 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 @@ -27,6 +27,8 @@ $Id$ #include <qlabel.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3GridLayout> #include <kdebug.h> #include <klocale.h> @@ -46,7 +48,7 @@ using namespace KABC; ResourceQtopiaConfig::ResourceQtopiaConfig( QWidget* parent, const char* name ) : ConfigWidget( parent, name ) { - QGridLayout *mainLayout = new QGridLayout( this, 1, 2, 0, + Q3GridLayout *mainLayout = new Q3GridLayout( this, 1, 2, 0, KDialog::spacingHint() ); QLabel *label = new QLabel( i18n( "Location:" ), this ); 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,6 +1,6 @@ TEMPLATE = lib CONFIG += qt warn_on -TARGET = microkabc_sharpdtm +TARGET = xmicrokabc_sharpdtm INCLUDEPATH += $(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 @@ -8,9 +8,9 @@ INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/kabc $(SHARPDTMSDK)/include $(KDEPIMDIR OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR = $(QPEDIR)/lib -LIBS += -lmicrokde -LIBS += -lmicrokabc -LIBS += -lmicrokdepim +LIBS += -lxmicrokde +LIBS += -lxmicrokabc +LIBS += -lxmicrokdepim LIBS += -lmicroqtcompat LIBS += -L$(QPEDIR)/lib LIBS += -ljpeg diff --git a/kabc/secrecy.h b/kabc/secrecy.h index b2ff565..0fe956e 100644 --- a/kabc/secrecy.h +++ b/kabc/secrecy.h @@ -28,7 +28,7 @@ $Id$ #ifndef KABC_SECRECY_H #define KABC_SECRECY_H -#include <qvaluelist.h> +#include <q3valuelist.h> namespace KABC { @@ -38,7 +38,7 @@ class Secrecy friend QDataStream &operator>>( QDataStream &, Secrecy & ); public: - typedef QValueList<int> TypeList; + typedef Q3ValueList<int> TypeList; /** * Secrecy types diff --git a/kabc/sound.h b/kabc/sound.h index 0ec5ec8..9777054 100644 --- a/kabc/sound.h +++ b/kabc/sound.h @@ -28,7 +28,7 @@ $Id$ #ifndef KABC_SOUND_H #define KABC_SOUND_H -#include <qcstring.h> +#include <q3cstring.h> #include <qstring.h> namespace KABC { diff --git a/kabc/tmpaddressbook.cpp b/kabc/tmpaddressbook.cpp index cfa57e3..5152e00 100644 --- a/kabc/tmpaddressbook.cpp +++ b/kabc/tmpaddressbook.cpp @@ -24,7 +24,7 @@ Copyright (c) 2004 Ulf Schenk $Id$ */ -#include <qptrlist.h> +#include <q3ptrlist.h> #include "tmpaddressbook.h" 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 @@ -24,6 +24,8 @@ #include <VCardRToken.h> #include <VCardAdrParam.h> #include <VCardParam.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -38,7 +40,7 @@ AdrParam::AdrParam(const AdrParam & x) { } -AdrParam::AdrParam(const QCString & s) +AdrParam::AdrParam(const Q3CString & s) : Param(s) { } @@ -56,7 +58,7 @@ AdrParam::operator = (AdrParam & x) } AdrParam & -AdrParam::operator = (const QCString & s) +AdrParam::operator = (const Q3CString & s) { Param::operator = (s); @@ -77,7 +79,7 @@ AdrParam::operator == (AdrParam & x) if (x.adrTypeList().count() != adrTypeList_.count()) return false; - QStrListIterator it(x.adrTypeList_); + Q3StrListIterator it(x.adrTypeList_); for (; it.current(); ++it) if (!adrTypeList_.find(it.current())) @@ -114,7 +116,7 @@ AdrParam::_assemble() return; } - QStrListIterator it(adrTypeList_); + Q3StrListIterator it(adrTypeList_); for (; it.current(); ++it) { 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 @@ -25,6 +25,9 @@ #include <VCardAdrValue.h> #include <VCardValue.h> #include <VCardDefines.h> +//Added by qt3to4: +#include <Q3StrList> +#include <Q3CString> using namespace VCARD; @@ -45,7 +48,7 @@ AdrValue::AdrValue(const AdrValue & x) { } -AdrValue::AdrValue(const QCString & s) +AdrValue::AdrValue(const Q3CString & s) : Value(s) { } @@ -68,7 +71,7 @@ AdrValue::operator = (AdrValue & x) } AdrValue & -AdrValue::operator = (const QCString & s) +AdrValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; @@ -105,7 +108,7 @@ AdrValue::_parse() { vDebug("AdrValue::_parse()"); - QStrList l; + Q3StrList l; RTokenise(strRep_, ";", l); for (unsigned int i = 0; i < l.count(); i++) { 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 @@ -24,6 +24,8 @@ #include <VCardAgentParam.h> #include <VCardParam.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -39,7 +41,7 @@ AgentParam::AgentParam(const AgentParam & x) { } -AgentParam::AgentParam(const QCString & s) +AgentParam::AgentParam(const Q3CString & s) : Param(s) { } @@ -57,7 +59,7 @@ AgentParam::operator = (AgentParam & x) } AgentParam & -AgentParam::operator = (const QCString & s) +AgentParam::operator = (const Q3CString & s) { Param::operator = (s); return *this; 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 @@ -24,6 +24,8 @@ #include <VCardAgentValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ AgentValue::AgentValue(const AgentValue & x) { } -AgentValue::AgentValue(const QCString & s) +AgentValue::AgentValue(const Q3CString & s) : Value(s) { } @@ -52,7 +54,7 @@ AgentValue::operator = (AgentValue & x) } AgentValue & -AgentValue::operator = (const QCString & s) +AgentValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; 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 @@ -26,6 +26,8 @@ #include <VCardValue.h> #include <kdebug.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -40,7 +42,7 @@ ClassValue::ClassValue(const ClassValue & x) { } -ClassValue::ClassValue(const QCString & s) +ClassValue::ClassValue(const Q3CString & s) : Value(s) { } @@ -58,7 +60,7 @@ ClassValue::operator = (ClassValue & x) } ClassValue & -ClassValue::operator = (const QCString & s) +ClassValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; 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 @@ -21,8 +21,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include <qcstring.h> -#include <qstrlist.h> +#include <q3cstring.h> +#include <q3strlist.h> #include <qregexp.h> #include <kdebug.h> @@ -98,7 +98,7 @@ ContentLine::ContentLine(const ContentLine & x) } -ContentLine::ContentLine(const QCString & s) +ContentLine::ContentLine(const Q3CString & s) : Entity(s), value_(0), paramType_( ParamUnknown ), @@ -129,7 +129,7 @@ ContentLine::operator = (ContentLine & x) } ContentLine & -ContentLine::operator = (const QCString & s) +ContentLine::operator = (const Q3CString & s) { Entity::operator = (s); delete value_; @@ -142,7 +142,7 @@ ContentLine::operator == (ContentLine & x) { x.parse(); - QPtrListIterator<Param> it(x.paramList()); + Q3PtrListIterator<Param> it(x.paramList()); if (!paramList_.find(it.current())) return false; @@ -163,11 +163,11 @@ ContentLine::_parse() // Unfold folded lines // NLR - strRep_ = strRep_.replace( QRegExp( "\\r" ), "" ); + strRep_ = strRep_.replace( "\\r" , "" ); // Unqote newlines - strRep_ = strRep_.replace( QRegExp( "\\\\n" ), "\n" ); + strRep_ = strRep_.replace( "\\\\n", "\n" ); //NLR - strRep_ = strRep_.replace( QRegExp( "\\\\r" ), "\r" ); + strRep_ = strRep_.replace( "\\\\r" , "\r" ); int split = strRep_.find(':'); @@ -176,8 +176,8 @@ ContentLine::_parse() return; } - QCString firstPart(strRep_.left(split)); - QCString valuePart(strRep_.mid(split + 1)); + Q3CString firstPart(strRep_.left(split)); + Q3CString valuePart(strRep_.mid(split + 1)); split = firstPart.find('.'); @@ -192,7 +192,7 @@ ContentLine::_parse() // Now we have the group, the name and param list together and the value. - QStrList l; + Q3StrList l; RTokenise(firstPart, ";", l); @@ -214,11 +214,11 @@ ContentLine::_parse() // For each parameter, create a new parameter of the correct type. - QStrListIterator it(l); + Q3StrListIterator it(l); for (; it.current(); ++it, i++) { - QCString str = *it; + Q3CString str = *it; split = str.find("="); if (split < 0 ) { @@ -226,13 +226,13 @@ ContentLine::_parse() continue; } - QCString paraName = str.left(split); - QCString paraValue = str.mid(split + 1); + Q3CString paraName = str.left(split); + Q3CString paraValue = str.mid(split + 1); - QStrList paraValues; + Q3StrList paraValues; RTokenise(paraValue, ",", paraValues); - QStrListIterator it2( paraValues ); + Q3StrListIterator it2( paraValues ); for(; it2.current(); ++it2) { @@ -309,7 +309,7 @@ ContentLine::_assemble() vDebug("Assemble (argl) - my name is \"" + name_ + "\""); strRep_.truncate(0); - QCString line; + Q3CString line; if (!group_.isEmpty()) line += group_ + '.'; 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 @@ -24,6 +24,8 @@ #include <VCardDateParam.h> #include <VCardParam.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ DateParam::DateParam(const DateParam & x) { } -DateParam::DateParam(const QCString & s) +DateParam::DateParam(const Q3CString & s) : Param(s) { } @@ -52,7 +54,7 @@ DateParam::operator = (DateParam & x) } DateParam & -DateParam::operator = (const QCString & s) +DateParam::operator = (const Q3CString & s) { Param::operator = (s); return *this; 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 @@ -22,6 +22,8 @@ */ #include <qregexp.h> +//Added by qt3to4: +#include <Q3CString> #include <kdebug.h> @@ -105,7 +107,7 @@ DateValue::DateValue(const DateValue & x) hasTime_ = x.hasTime_; } -DateValue::DateValue(const QCString & s) +DateValue::DateValue(const Q3CString & s) : Value(s) { } @@ -120,7 +122,7 @@ DateValue::operator = (DateValue & x) } DateValue & -DateValue::operator = (const QCString & s) +DateValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; @@ -154,8 +156,8 @@ DateValue::_parse() int timeSep = strRep_.find('T'); - QCString dateStr; - QCString timeStr; + Q3CString dateStr; + Q3CString timeStr; if (timeSep == -1) { @@ -173,7 +175,7 @@ DateValue::_parse() /////////////////////////////////////////////////////////////// DATE - dateStr.replace(QRegExp("-"), ""); + dateStr.replace("-", ""); kdDebug(5710) << "dateStr: " << dateStr << endl; @@ -196,7 +198,7 @@ DateValue::_parse() if (zoneSep != -1 && timeStr.length() - zoneSep > 3) { - QCString zoneStr(timeStr.mid(zoneSep + 1)); + Q3CString zoneStr(timeStr.mid(zoneSep + 1)); vDebug("zoneStr == " + zoneStr); zonePositive_ = (zoneStr[0] == '+'); @@ -211,13 +213,13 @@ DateValue::_parse() int secFracSep = timeStr.findRev(','); if (secFracSep != -1 && zoneSep != -1) { // zoneSep checked to avoid errors. - QCString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep); + Q3CString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep); secFrac_ = quirkafleeg.toDouble(); } /////////////////////////////////////////////////////////////// HMS - timeStr.replace(QRegExp(":"), ""); + timeStr.replace(":", ""); hour_ = timeStr.left(2).toInt(); minute_ = timeStr.mid(2, 2).toInt(); @@ -229,9 +231,9 @@ DateValue::_assemble() { vDebug("DateValue::_assemble"); - QCString year; - QCString month; - QCString day; + Q3CString year; + Q3CString month; + Q3CString day; year.setNum( year_ ); month.setNum( month_ ); @@ -243,9 +245,9 @@ DateValue::_assemble() strRep_ = year + '-' + month + '-' + day; if ( hasTime_ ) { - QCString hour; - QCString minute; - QCString second; + Q3CString hour; + Q3CString minute; + Q3CString second; hour.setNum( hour_ ); minute.setNum( minute_ ); 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 @@ -24,6 +24,8 @@ #include <VCardEmailParam.h> #include <VCardParam.h> #include <VCardDefines.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -40,7 +42,7 @@ EmailParam::EmailParam(const EmailParam & x) { } -EmailParam::EmailParam(const QCString & s) +EmailParam::EmailParam(const Q3CString & s) : Param(s) { } @@ -58,7 +60,7 @@ EmailParam::operator = (EmailParam & x) } EmailParam & -EmailParam::operator = (const QCString & s) +EmailParam::operator = (const Q3CString & s) { Param::operator = (s); return *this; 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 @@ -22,6 +22,8 @@ */ #include <VCardEntity.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -40,7 +42,7 @@ Entity::Entity(const Entity & e) // empty } -Entity::Entity(const QCString & s) +Entity::Entity(const Q3CString & s) : strRep_ (s), parsed_ (false), assembled_ (true) @@ -61,7 +63,7 @@ Entity::operator = (const Entity & e) } Entity & -Entity::operator = (const QCString & s) +Entity::operator = (const Q3CString & s) { strRep_ = s; parsed_ = false; @@ -83,13 +85,13 @@ Entity::operator != (Entity & e) } bool -Entity::operator == (const QCString & s) +Entity::operator == (const Q3CString & s) { return asString() == s; } bool -Entity::operator != (const QCString & s) +Entity::operator != (const Q3CString & s) { return !(*this == s); } @@ -99,7 +101,7 @@ Entity::~Entity() // empty } - QCString + Q3CString Entity::asString() { // vDebug("Entity::asString()"); 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 @@ -21,7 +21,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include <qcstring.h> +#include <q3cstring.h> #include <ctype.h> #include <VCardEnum.h> @@ -29,7 +29,7 @@ using namespace VCARD; // There are 31 possible types, not including extensions. - const QCString + const Q3CString VCARD::paramNames [] = { "NAME", @@ -222,7 +222,7 @@ VCARD::EntityTypeToValueType(EntityType e) return t; } - QCString + Q3CString VCARD::EntityTypeToParamName(EntityType e) { if ( e > EntityUnknown ) e = EntityUnknown; @@ -230,7 +230,7 @@ VCARD::EntityTypeToParamName(EntityType e) } EntityType -VCARD::EntityNameToEntityType(const QCString & s) +VCARD::EntityNameToEntityType(const Q3CString & s) { if (s.isEmpty()) return EntityUnknown; 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 @@ -24,6 +24,8 @@ #include <VCardFloatValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -45,7 +47,7 @@ FloatValue::FloatValue(const FloatValue & x) value_ = x.value_; } -FloatValue::FloatValue(const QCString & s) +FloatValue::FloatValue(const Q3CString & s) : Value(s) { } @@ -63,7 +65,7 @@ FloatValue::operator = (FloatValue & x) } FloatValue & -FloatValue::operator = (const QCString & s) +FloatValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; @@ -101,7 +103,7 @@ FloatValue::_parse() void FloatValue::_assemble() { - strRep_ = QCString().setNum(value_); + strRep_ = Q3CString().setNum(value_); } float 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 @@ -23,6 +23,8 @@ #include <VCardValue.h> #include <kdebug.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -36,7 +38,7 @@ GeoValue::GeoValue(const GeoValue & x) { } -GeoValue::GeoValue(const QCString & s) +GeoValue::GeoValue(const Q3CString & s) : Value(s) { } @@ -54,7 +56,7 @@ GeoValue::operator = (GeoValue & x) } GeoValue & -GeoValue::operator = (const QCString & s) +GeoValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; 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 @@ -24,6 +24,8 @@ #include <VCardImageParam.h> #include <VCardParam.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ ImageParam::ImageParam(const ImageParam & x) { } -ImageParam::ImageParam(const QCString & s) +ImageParam::ImageParam(const Q3CString & s) : Param(s) { } @@ -52,7 +54,7 @@ ImageParam::operator = (ImageParam & x) } ImageParam & -ImageParam::operator = (const QCString & s) +ImageParam::operator = (const Q3CString & s) { Param::operator = (s); return *this; 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 @@ -24,6 +24,8 @@ #include <VCardImageValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ ImageValue::ImageValue(const ImageValue & x) { } -ImageValue::ImageValue(const QCString & s) +ImageValue::ImageValue(const Q3CString & s) : Value(s) { } @@ -52,7 +54,7 @@ ImageValue::operator = (ImageValue & x) } ImageValue & -ImageValue::operator = (const QCString & s) +ImageValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; 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 @@ -24,6 +24,8 @@ #include <VCardImgValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ ImgValue::ImgValue(const ImgValue & x) { } -ImgValue::ImgValue(const QCString & s) +ImgValue::ImgValue(const Q3CString & s) : Value(s) { } @@ -52,7 +54,7 @@ ImgValue::operator = (ImgValue & x) } ImgValue & -ImgValue::operator = (const QCString & s) +ImgValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; 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 @@ -26,6 +26,9 @@ #include <VCardLangValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3StrList> using namespace VCARD; @@ -39,7 +42,7 @@ LangValue::LangValue(const LangValue & x) { } -LangValue::LangValue(const QCString & s) +LangValue::LangValue(const Q3CString & s) : Value(s) { } @@ -54,7 +57,7 @@ LangValue::operator = (LangValue & x) } LangValue & -LangValue::operator = (const QCString & s) +LangValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; @@ -74,7 +77,7 @@ LangValue::~LangValue() void LangValue::_parse() { - QStrList l; + Q3StrList l; RTokenise(strRep_, "-", l); if (l.count() == 0) return; @@ -91,20 +94,21 @@ LangValue::_assemble() { strRep_ = primary_; - QStrListIterator it(subtags_); + Q3StrListIterator it(subtags_); - for (; it.current(); ++it) - strRep_ += QCString('-') + it.current(); + for (; it.current(); ++it) { + strRep_ += Q3CString('-'); strRep_ += it.current(); + } } - QCString + Q3CString LangValue::primary() { parse(); return primary_; } - QStrList + Q3StrList LangValue::subtags() { parse(); @@ -112,14 +116,14 @@ LangValue::subtags() } void -LangValue::setPrimary(const QCString & s) +LangValue::setPrimary(const Q3CString & s) { parse(); primary_ = s; } void -LangValue::setSubTags(const QStrList & l) +LangValue::setSubTags(const Q3StrList & l) { parse(); subtags_ = l; 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 @@ -21,7 +21,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include <qstrlist.h> +#include <q3strlist.h> +//Added by qt3to4: +#include <Q3CString> #include <VCardRToken.h> #include <VCardNValue.h> @@ -46,7 +48,7 @@ NValue::NValue(const NValue & x) { } -NValue::NValue(const QCString & s) +NValue::NValue(const Q3CString & s) : Value(s) { vDebug("ctor"); @@ -68,7 +70,7 @@ NValue::operator = (NValue & x) } NValue & -NValue::operator = (const QCString & s) +NValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; @@ -100,7 +102,7 @@ NValue::clone() void NValue::_parse() { - QStrList l; + Q3StrList l; RTokenise(strRep_, ";", l); for (unsigned int i = 0; i < l.count(); i++) { 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 @@ -26,6 +26,8 @@ #include <VCardOrgValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -39,7 +41,7 @@ OrgValue::OrgValue(const OrgValue & x) { } -OrgValue::OrgValue(const QCString & s) +OrgValue::OrgValue(const Q3CString & s) : Value(s) { } @@ -54,7 +56,7 @@ OrgValue::operator = (OrgValue & x) } OrgValue & -OrgValue::operator = (const QCString & s) +OrgValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; @@ -82,7 +84,7 @@ OrgValue::_assemble() { bool first(true); - QStrListIterator it(valueList_); + Q3StrListIterator it(valueList_); for (; it.current(); ++it) { if (!first) strRep_ += ';'; @@ -98,7 +100,7 @@ OrgValue::numValues() return valueList_.count(); } - QCString + Q3CString OrgValue::value(unsigned int i) { parse(); 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 @@ -26,6 +26,8 @@ #include <VCardEntity.h> #include <VCardRToken.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -43,7 +45,7 @@ Param::Param(const Param & x) { } -Param::Param(const QCString & s) +Param::Param(const Q3CString & s) : Entity(s), name_(""), value_("") @@ -63,7 +65,7 @@ Param::operator = (Param & x) } Param & -Param::operator = (const QCString & s) +Param::operator = (const Q3CString & s) { Entity::operator = (s); return *this; @@ -91,7 +93,7 @@ Param::_assemble() strRep_ = name_ + "=" + value_; } -Param::Param(const QCString &name, const QCString &value) +Param::Param(const Q3CString &name, const Q3CString &value) : Entity(), name_(name), value_(value) @@ -101,7 +103,7 @@ Param::Param(const QCString &name, const QCString &value) } void -Param::setName(const QCString & name) +Param::setName(const Q3CString & name) { name_ = name; @@ -109,20 +111,20 @@ Param::setName(const QCString & name) } void -Param::setValue(const QCString & value) +Param::setValue(const Q3CString & value) { value_ = value; assembled_ = false; } - QCString + Q3CString Param::name() { return name_; } - QCString + Q3CString Param::value() { return value_; 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 @@ -24,6 +24,8 @@ #include <VCardPhoneNumberValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ PhoneNumberValue::PhoneNumberValue(const PhoneNumberValue & x) { } -PhoneNumberValue::PhoneNumberValue(const QCString & s) +PhoneNumberValue::PhoneNumberValue(const Q3CString & s) : Value(s) { } @@ -52,7 +54,7 @@ PhoneNumberValue::operator = (PhoneNumberValue & x) } PhoneNumberValue & -PhoneNumberValue::operator = (const QCString & s) +PhoneNumberValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; 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 @@ -24,14 +24,14 @@ #include <string.h> #include <stddef.h> -#include <qcstring.h> -#include <qstrlist.h> +#include <q3cstring.h> +#include <q3strlist.h> namespace VCARD { Q_UINT32 -RTokenise(const char * str, const char * delim, QStrList & l) +RTokenise(const char * str, const char * delim, Q3StrList & l) { // FIXME no stderr ! l.clear(); 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 @@ -24,6 +24,8 @@ #include <VCardSoundValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ SoundValue::SoundValue(const SoundValue & x) { } -SoundValue::SoundValue(const QCString & s) +SoundValue::SoundValue(const Q3CString & s) : Value(s) { } @@ -52,7 +54,7 @@ SoundValue::operator = (SoundValue & x) } SoundValue & -SoundValue::operator = (const QCString & s) +SoundValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; 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 @@ -24,6 +24,8 @@ #include <VCardSourceParam.h> #include <VCardParam.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -41,7 +43,7 @@ SourceParam::SourceParam(const SourceParam & x) { } -SourceParam::SourceParam(const QCString & s) +SourceParam::SourceParam(const Q3CString & s) : Param(s), type_(SourceParam::TypeUnknown) { @@ -60,7 +62,7 @@ SourceParam::operator = (SourceParam & x) } SourceParam & -SourceParam::operator = (const QCString & s) +SourceParam::operator = (const Q3CString & s) { Param::operator = (s); return *this; 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 @@ -24,6 +24,8 @@ #include <VCardTelParam.h> #include <VCardParam.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ TelParam::TelParam(const TelParam & x) { } -TelParam::TelParam(const QCString & s) +TelParam::TelParam(const Q3CString & s) : Param(s) { } @@ -52,7 +54,7 @@ TelParam::operator = (TelParam & x) } TelParam & -TelParam::operator = (const QCString & s) +TelParam::operator = (const Q3CString & s) { Param::operator = (s); return *this; 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 @@ -24,6 +24,8 @@ #include <VCardTelValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ TelValue::TelValue(const TelValue & x) { } -TelValue::TelValue(const QCString & s) +TelValue::TelValue(const Q3CString & s) : Value(s) { } @@ -52,7 +54,7 @@ TelValue::operator = (TelValue & x) } TelValue & -TelValue::operator = (const QCString & s) +TelValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; 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 @@ -24,6 +24,8 @@ #include <VCardTextBinParam.h> #include <VCardParam.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ TextBinParam::TextBinParam(const TextBinParam & x) { } -TextBinParam::TextBinParam(const QCString & s) +TextBinParam::TextBinParam(const Q3CString & s) : Param(s) { } @@ -52,7 +54,7 @@ TextBinParam::operator = (TextBinParam & x) } TextBinParam & -TextBinParam::operator = (const QCString & s) +TextBinParam::operator = (const Q3CString & s) { Param::operator = (s); return *this; 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 @@ -25,6 +25,8 @@ #include <VCardTextBinValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -41,7 +43,7 @@ TextBinValue::TextBinValue(const TextBinValue & x) mUrl_ = x.mUrl_; } -TextBinValue::TextBinValue(const QCString & s) +TextBinValue::TextBinValue(const Q3CString & s) : Value(s) { } @@ -60,7 +62,7 @@ TextBinValue::operator = (TextBinValue & x) } TextBinValue & -TextBinValue::operator = (const QCString & s) +TextBinValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; 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 @@ -26,6 +26,8 @@ #include <VCardTextListValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -39,7 +41,7 @@ TextListValue::TextListValue(const TextListValue & x) { } -TextListValue::TextListValue(const QCString & s) +TextListValue::TextListValue(const Q3CString & s) : Value(s) { } @@ -54,7 +56,7 @@ TextListValue::operator = (TextListValue & x) } TextListValue & -TextListValue::operator = (const QCString & s) +TextListValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; @@ -82,7 +84,7 @@ TextListValue::_assemble() { bool first(true); - QStrListIterator it(valueList_); + Q3StrListIterator it(valueList_); for (; it.current(); ++it) { if (!first) strRep_ += ';'; @@ -98,7 +100,7 @@ TextListValue::numValues() return valueList_.count(); } - QCString + Q3CString TextListValue::value(unsigned int i) { parse(); 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 @@ -24,6 +24,8 @@ #include <VCardTextParam.h> #include <VCardParam.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ TextParam::TextParam(const TextParam & x) { } -TextParam::TextParam(const QCString & s) +TextParam::TextParam(const Q3CString & s) : Param(s) { } @@ -52,7 +54,7 @@ TextParam::operator = (TextParam & x) } TextParam & -TextParam::operator = (const QCString & s) +TextParam::operator = (const Q3CString & s) { Param::operator = (s); return *this; 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 @@ -24,6 +24,8 @@ #include <VCardTextValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -37,7 +39,7 @@ TextValue::TextValue(const TextValue & x) { } -TextValue::TextValue(const QCString & s) +TextValue::TextValue(const Q3CString & s) : Value(s) { } @@ -52,7 +54,7 @@ TextValue::operator = (TextValue & x) } TextValue & -TextValue::operator = (const QCString & s) +TextValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; @@ -61,7 +63,7 @@ TextValue::operator = (const QCString & s) bool TextValue::operator == (TextValue & x) { - return strRep_ = x.strRep_; + return strRep_ == x.strRep_; } TextValue::~TextValue() 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 @@ -24,6 +24,8 @@ #include <VCardURIValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -32,7 +34,7 @@ URIValue::URIValue() { } -URIValue::URIValue(const QCString & scheme, const QCString & schemeSpecificPart) +URIValue::URIValue(const Q3CString & scheme, const Q3CString & schemeSpecificPart) : Value(), scheme_ (scheme), schemeSpecificPart_ (schemeSpecificPart) @@ -47,7 +49,7 @@ URIValue::URIValue(const URIValue & x) { } -URIValue::URIValue(const QCString & s) +URIValue::URIValue(const Q3CString & s) : Value(s) { } @@ -65,7 +67,7 @@ URIValue::operator = (URIValue & x) } URIValue & -URIValue::operator = (const QCString & s) +URIValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; @@ -103,14 +105,14 @@ URIValue::_assemble() strRep_ = scheme_ + ':' + schemeSpecificPart_; } - QCString + Q3CString URIValue::scheme() { parse(); return scheme_; } - QCString + Q3CString URIValue::schemeSpecificPart() { parse(); @@ -118,14 +120,14 @@ URIValue::schemeSpecificPart() } void -URIValue::setScheme(const QCString & s) +URIValue::setScheme(const Q3CString & s) { parse(); scheme_ = s; } void -URIValue::setSchemeSpecificPart(const QCString & s) +URIValue::setSchemeSpecificPart(const Q3CString & s) { parse(); schemeSpecificPart_ = s; 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 @@ -24,6 +24,8 @@ #include <VCardUTCValue.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -38,7 +40,7 @@ UTCValue::UTCValue(const UTCValue & x) { } -UTCValue::UTCValue(const QCString & s) +UTCValue::UTCValue(const Q3CString & s) : Value(s) { } @@ -57,7 +59,7 @@ UTCValue::operator = (UTCValue & x) } UTCValue & -UTCValue::operator = (const QCString & s) +UTCValue::operator = (const Q3CString & s) { Value::operator = (s); return *this; 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 @@ -23,6 +23,8 @@ #include <qregexp.h> #include <qdatetime.h> +//Added by qt3to4: +#include <Q3CString> #include <VCardDefines.h> #include <VCardVCardEntity.h> @@ -41,7 +43,7 @@ VCardEntity::VCardEntity(const VCardEntity & x) cardList_.setAutoDelete( TRUE ); } -VCardEntity::VCardEntity(const QCString & s) +VCardEntity::VCardEntity(const Q3CString & s) : Entity(s) { cardList_.setAutoDelete( TRUE ); @@ -57,7 +59,7 @@ VCardEntity::operator = (VCardEntity & x) } VCardEntity & -VCardEntity::operator = (const QCString & s) +VCardEntity::operator = (const Q3CString & s) { Entity::operator = (s); return *this; @@ -83,7 +85,7 @@ VCardEntity::_parse() int num = 0; // old code vDebug("parse"); - QCString s(strRep_); + Q3CString s(strRep_); int i = s.find(QRegExp("BEGIN:VCARD", false)); @@ -91,7 +93,7 @@ VCardEntity::_parse() i = s.find(QRegExp("BEGIN:VCARD", false), 11); - QCString cardStr(s.left(i)); + Q3CString cardStr(s.left(i)); VCard * v = new VCard(cardStr); @@ -132,7 +134,7 @@ VCardEntity::_parse() if ( i <= len ) { ++num; char* dat = strRep_.data()+start; - VCard * v = new VCard( QCString ( dat,i-start ) ); + VCard * v = new VCard( Q3CString ( dat,i-start ) ); start = i; cardList_.append(v); v->parse(); 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 @@ -21,11 +21,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include <qcstring.h> -#include <qstrlist.h> +#include <q3cstring.h> +#include <q3strlist.h> #include <qstringlist.h> #include <qstring.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include <VCardEntity.h> #include <VCardVCard.h> @@ -48,7 +48,7 @@ VCard::VCard(const VCard & x) { contentLineList_.setAutoDelete( TRUE ); - QPtrListIterator<ContentLine> it(x.contentLineList_); + Q3PtrListIterator<ContentLine> it(x.contentLineList_); for (; it.current(); ++it) { ContentLine * c = new ContentLine(*it.current()); contentLineList_.append(c); @@ -56,7 +56,7 @@ VCard::VCard(const VCard & x) } -VCard::VCard(const QCString & s) +VCard::VCard(const Q3CString & s) : Entity(s) { contentLineList_.setAutoDelete( TRUE ); @@ -68,7 +68,7 @@ VCard::operator = (VCard & x) if (*this == x) return *this; group_ = x.group(); - QPtrListIterator<ContentLine> it(x.contentLineList_); + Q3PtrListIterator<ContentLine> it(x.contentLineList_); for (; it.current(); ++it) { ContentLine * c = new ContentLine(*it.current()); contentLineList_.append(c); @@ -79,7 +79,7 @@ VCard::operator = (VCard & x) } VCard & -VCard::operator = (const QCString & s) +VCard::operator = (const Q3CString & s) { Entity::operator = (s); return *this; @@ -101,7 +101,7 @@ VCard::_parse() { QStringList l; - QStrList sl; + Q3StrList sl; RTokenise(strRep_, "\r\n", sl); @@ -109,7 +109,8 @@ VCard::_parse() //qDebug("invalid vcard "); return; } - l = QStringList::fromStrList( sl ); + for(Q3StrList::iterator i=sl.begin();i!=sl.end();++i) + l.push_back(*i); // Get the first line QString beginLine = l[0].stripWhiteSpace(); @@ -180,7 +181,7 @@ VCard::_parse() } QStringList::Iterator it2 = refolded.begin(); for (; it2 != refolded.end(); ++it2) { - ContentLine * cl = new ContentLine(QCString((*it2).latin1())); + ContentLine * cl = new ContentLine(Q3CString((*it2).latin1())); cl->parse(); if (cl->value() == 0) { @@ -228,7 +229,7 @@ VCard::_assemble() strRep_ = "BEGIN:VCARD\r\n"; strRep_ += "VERSION:3.0\r\n"; - QPtrListIterator<ContentLine> it(contentLineList_); + Q3PtrListIterator<ContentLine> it(contentLineList_); for (; it.current(); ++it) strRep_ += it.current()->asString() + "\r\n"; @@ -244,7 +245,7 @@ VCard::has(EntityType t) } bool -VCard::has(const QCString & s) +VCard::has(const Q3CString & s) { parse(); return contentLine(s) == 0 ? false : true; @@ -259,7 +260,7 @@ VCard::add(const ContentLine & cl) } void -VCard::add(const QCString & s) +VCard::add(const Q3CString & s) { parse(); ContentLine * c = new ContentLine(s); @@ -270,7 +271,7 @@ VCard::add(const QCString & s) VCard::contentLine(EntityType t) { parse(); - QPtrListIterator<ContentLine> it(contentLineList_); + Q3PtrListIterator<ContentLine> it(contentLineList_); for (; it.current(); ++it) if (it.current()->entityType() == t) @@ -280,10 +281,10 @@ VCard::contentLine(EntityType t) } ContentLine * -VCard::contentLine(const QCString & s) +VCard::contentLine(const Q3CString & s) { parse(); - QPtrListIterator<ContentLine> it(contentLineList_); + Q3PtrListIterator<ContentLine> it(contentLineList_); for (; it.current(); ++it) if (it.current()->entityType() == EntityNameToEntityType(s)) 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 @@ -23,6 +23,8 @@ #include <VCardEntity.h> #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> using namespace VCARD; @@ -36,7 +38,7 @@ Value::Value(const Value & x) { } -Value::Value(const QCString & s) +Value::Value(const Q3CString & s) : Entity(s) { } @@ -51,7 +53,7 @@ Value::operator = (Value & x) } Value & -Value::operator = (const QCString & s) +Value::operator = (const Q3CString & s) { Entity::operator = (s); return *this; 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 @@ -24,8 +24,8 @@ #ifndef ADRPARAM_H #define ADRPARAM_H -#include <qcstring.h> -#include <qstrlist.h> +#include <q3cstring.h> +#include <q3strlist.h> #include <VCardParam.h> @@ -37,16 +37,16 @@ class AdrParam : public Param #include "AdrParam-generated.h" - QStrList adrTypeList() + Q3StrList adrTypeList() { parse(); return adrTypeList_; } - QCString textParam() + Q3CString textParam() { parse(); return textParam_; } - void setAdrTypeList(const QStrList & l) + void setAdrTypeList(const Q3StrList & l) { adrTypeList_ = l; assembled_ = false; } - void setTextParam(const QCString & s) + void setTextParam(const Q3CString & s) { textParam_ = s; assembled_ = false; } enum AdrType { @@ -56,8 +56,8 @@ class AdrParam : public Param private: - QStrList adrTypeList_; - QCString textParam_; + Q3StrList adrTypeList_; + Q3CString textParam_; }; } 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 @@ -24,7 +24,9 @@ #ifndef ADRVALUE_H #define ADRVALUE_H -#include <qstrlist.h> +#include <q3strlist.h> +//Added by qt3to4: +#include <Q3CString> #include <VCardValue.h> namespace VCARD @@ -37,44 +39,44 @@ class AdrValue : public Value AdrValue *clone(); - void setPOBox(const QCString & s) + void setPOBox(const Q3CString & s) { poBox_ = s; assembled_ = false; } - void setExtAddress(const QCString & s) + void setExtAddress(const Q3CString & s) { extAddress_ = s; assembled_ = false; } - void setStreet(const QCString & s) + void setStreet(const Q3CString & s) { street_ = s; assembled_ = false; } - void setLocality(const QCString & s) + void setLocality(const Q3CString & s) { locality_ = s; assembled_ = false; } - void setRegion(const QCString & s) + void setRegion(const Q3CString & s) { region_ = s; assembled_ = false; } - void setPostCode(const QCString & s) + void setPostCode(const Q3CString & s) { postCode_ = s; assembled_ = false; } - void setCountryName(const QCString & s) + void setCountryName(const Q3CString & s) { countryName_ = s; assembled_ = false; } - QCString poBox() { parse(); return poBox_; } - QCString extAddress() { parse(); return extAddress_; } - QCString street() { parse(); return street_; } - QCString locality() { parse(); return locality_; } - QCString region() { parse(); return region_; } - QCString postCode() { parse(); return postCode_; } - QCString countryName() { parse(); return countryName_; } + Q3CString poBox() { parse(); return poBox_; } + Q3CString extAddress() { parse(); return extAddress_; } + Q3CString street() { parse(); return street_; } + Q3CString locality() { parse(); return locality_; } + Q3CString region() { parse(); return region_; } + Q3CString postCode() { parse(); return postCode_; } + Q3CString countryName() { parse(); return countryName_; } private: - QCString poBox_; - QCString extAddress_; - QCString street_; - QCString locality_; - QCString region_; - QCString postCode_; - QCString countryName_; + Q3CString poBox_; + Q3CString extAddress_; + Q3CString street_; + Q3CString locality_; + Q3CString region_; + Q3CString postCode_; + Q3CString countryName_; }; } 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 @@ -24,7 +24,7 @@ #ifndef AGENTPARAM_H #define AGENTPARAM_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardParam.h> #include <VCardURIValue.h> @@ -46,7 +46,7 @@ class AgentParam : public Param void setRefer(bool b) { refer_ = b; assembled_ = false; } - void setURI(const QCString & s) + void setURI(const Q3CString & s) { uri_ = s; assembled_ = false; } private: 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 @@ -24,7 +24,7 @@ #ifndef AGENTVALUE_H #define AGENTVALUE_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardValue.h> 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 @@ -24,7 +24,7 @@ #ifndef CLASSVALUE_H #define CLASSVALUE_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardValue.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 @@ -24,7 +24,9 @@ #ifndef CONTENTLINE_H #define CONTENTLINE_H -#include <qptrlist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <Q3CString> #include "VCardEnum.h" #include "VCardEntity.h" @@ -39,18 +41,18 @@ class ContentLine : public Entity #include "ContentLine-generated.h" - QCString group() { parse(); return group_; } - QCString name() { parse(); return name_; } + Q3CString group() { parse(); return group_; } + Q3CString name() { parse(); return name_; } Value * value() { parse(); return value_; } ParamList paramList() { parse(); return paramList_; } ParamType paramType() { parse(); return paramType_; } ValueType valueType() { parse(); return valueType_; } EntityType entityType() { parse(); return entityType_; } - void setGroup (const QCString & s) + void setGroup (const Q3CString & s) { group_ = s; assembled_ = false; } - void setName (const QCString & s) + void setName (const Q3CString & s) { name_ = s; assembled_ = false; } void setValue (Value *s) @@ -63,9 +65,9 @@ class ContentLine : public Entity private: - QCString group_; - QCString name_; - QPtrList<Param> paramList_; + Q3CString group_; + Q3CString name_; + Q3PtrList<Param> paramList_; Value * value_; ParamType paramType_; 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 @@ -24,7 +24,7 @@ #ifndef DATEPARAM_H #define DATEPARAM_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardParam.h> 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 @@ -24,7 +24,7 @@ #ifndef DATEVALUE_H #define DATEVALUE_H -#include <qcstring.h> +#include <q3cstring.h> #include <qdatetime.h> #include <VCardValue.h> 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 @@ -35,14 +35,14 @@ #if 0 #ifndef NDEBUG -# include <qcstring.h> +# include <q3cstring.h> # include <iostream> # ifdef __GNUG__ # define vDebug(a) cerr << className() << ":" << __FUNCTION__ << " (" \ - << __LINE__ << "): " << QCString((a)).data() << endl; + << __LINE__ << "): " << Q3CString((a)).data() << endl; # else # define vDebug(a) cerr << className() << ": " \ - << QCString((a)).data() << endl; + << Q3CString((a)).data() << endl; # endif #else # define vDebug(a) 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 @@ -24,7 +24,7 @@ #ifndef EMAILPARAM_H #define EMAILPARAM_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardParam.h> @@ -36,10 +36,10 @@ class EmailParam : public Param #include "EmailParam-generated.h" - QCString emailType() { parse(); return emailType_; } + Q3CString emailType() { parse(); return emailType_; } bool pref() { parse(); return pref_; } - void setEmailType(const QCString & s) + void setEmailType(const Q3CString & s) { emailType_ = s; assembled_ = false; } void setPref(bool b) @@ -47,7 +47,7 @@ class EmailParam : public Param private: - QCString emailType_; + Q3CString emailType_; bool pref_; }; 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 @@ -24,7 +24,7 @@ #ifndef ENTITY_H #define ENTITY_H -#include <qcstring.h> +#include <q3cstring.h> namespace VCARD { @@ -35,19 +35,19 @@ class Entity Entity(); Entity(const Entity & e); - Entity(const QCString & s); + Entity(const Q3CString & s); virtual Entity & operator = (const Entity & e); - virtual Entity & operator = (const QCString & s); + virtual Entity & operator = (const Q3CString & s); virtual bool operator == (Entity & e); virtual bool operator != (Entity & e); - virtual bool operator == (const QCString & s); - virtual bool operator != (const QCString & s); + virtual bool operator == (const Q3CString & s); + virtual bool operator != (const Q3CString & s); virtual ~Entity(); - QCString asString(); + Q3CString asString(); virtual void parse(); virtual void assemble(); @@ -57,7 +57,7 @@ class Entity protected: - QCString strRep_; + Q3CString strRep_; bool parsed_; bool assembled_; }; 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 @@ -24,12 +24,12 @@ #ifndef ENUM_H #define ENUM_H -#include <qcstring.h> +#include <q3cstring.h> namespace VCARD { -extern const QCString paramNames []; +extern const Q3CString paramNames []; enum EntityType { EntityName, @@ -108,8 +108,8 @@ extern const ParamType paramTypesTable[]; ParamType EntityTypeToParamType(EntityType); ValueType EntityTypeToValueType(EntityType); -QCString EntityTypeToParamName(EntityType); -EntityType EntityNameToEntityType(const QCString &); +Q3CString EntityTypeToParamName(EntityType); +EntityType EntityNameToEntityType(const Q3CString &); char * encodeBase64(const char *, unsigned long, unsigned long &); char * decodeBase64(const char *, unsigned long, unsigned long &); 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 @@ -24,7 +24,7 @@ #ifndef FLOATVALUE_H #define FLOATVALUE_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardValue.h> 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 @@ -24,7 +24,7 @@ #ifndef IMGPARAM_H #define IMGPARAM_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardParam.h> 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 @@ -24,7 +24,7 @@ #ifndef IMAGEVALUE_H #define IMAGEVALUE_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardValue.h> 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 @@ -24,8 +24,8 @@ #ifndef LANGVALUE_H #define LANGVALUE_H -#include <qcstring.h> -#include <qstrlist.h> +#include <q3cstring.h> +#include <q3strlist.h> #include <VCardValue.h> @@ -36,14 +36,14 @@ class LangValue : public Value { #include "LangValue-generated.h" - QCString primary(); - QStrList subtags(); + Q3CString primary(); + Q3StrList subtags(); - void setPrimary(const QCString &); - void setSubTags(const QStrList &); + void setPrimary(const Q3CString &); + void setSubTags(const Q3StrList &); - QCString primary_; - QStrList subtags_; + Q3CString primary_; + Q3StrList subtags_; }; } 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 @@ -25,6 +25,8 @@ #define NVALUE_H #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> namespace VCARD { @@ -34,21 +36,21 @@ class NValue : public Value #include "NValue-generated.h" NValue *clone(); - QCString family() { parse(); return family_; } - QCString given() { parse(); return given_; } - QCString middle() { parse(); return middle_; } - QCString prefix() { parse(); return prefix_; } - QCString suffix() { parse(); return suffix_; } + Q3CString family() { parse(); return family_; } + Q3CString given() { parse(); return given_; } + Q3CString middle() { parse(); return middle_; } + Q3CString prefix() { parse(); return prefix_; } + Q3CString suffix() { parse(); return suffix_; } - void setFamily (const QCString & s) { family_ = s; assembled_ = false; } - void setGiven (const QCString & s) { given_ = s; assembled_ = false; } - void setMiddle (const QCString & s) { middle_ = s; assembled_ = false; } - void setPrefix (const QCString & s) { prefix_ = s; assembled_ = false; } - void setSuffix (const QCString & s) { suffix_ = s; assembled_ = false; } + void setFamily (const Q3CString & s) { family_ = s; assembled_ = false; } + void setGiven (const Q3CString & s) { given_ = s; assembled_ = false; } + void setMiddle (const Q3CString & s) { middle_ = s; assembled_ = false; } + void setPrefix (const Q3CString & s) { prefix_ = s; assembled_ = false; } + void setSuffix (const Q3CString & s) { suffix_ = s; assembled_ = false; } private: - QCString family_, given_, middle_, prefix_, suffix_; + Q3CString family_, given_, middle_, prefix_, suffix_; }; } 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 @@ -24,8 +24,8 @@ #ifndef ORGVALUE_H #define ORGVALUE_H -#include <qcstring.h> -#include <qstrlist.h> +#include <q3cstring.h> +#include <q3strlist.h> #include <VCardValue.h> @@ -38,11 +38,11 @@ class OrgValue : public Value #include "OrgValue-generated.h" unsigned int numValues(); - QCString value(unsigned int); + Q3CString value(unsigned int); private: - QStrList valueList_; + Q3StrList valueList_; }; } 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 @@ -24,8 +24,8 @@ #ifndef PARAM_H #define PARAM_H -#include <qcstring.h> -#include <qptrlist.h> +#include <q3cstring.h> +#include <q3ptrlist.h> #include <VCardEntity.h> @@ -37,22 +37,22 @@ class Param : public Entity #include "Param-generated.h" - Param(const QCString &name, const QCString &value); + Param(const Q3CString &name, const Q3CString &value); - void setName(const QCString &); - void setValue(const QCString &); + void setName(const Q3CString &); + void setValue(const Q3CString &); - QCString name(); - QCString value(); + Q3CString name(); + Q3CString value(); private: - QCString name_; - QCString value_; + Q3CString name_; + Q3CString value_; }; -typedef QPtrList<Param> ParamList; -typedef QPtrListIterator<Param> ParamListIterator; +typedef Q3PtrList<Param> ParamList; +typedef Q3PtrListIterator<Param> ParamListIterator; } 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 @@ -25,12 +25,12 @@ #ifndef RTOKEN_H #define RTOKEN_H -#include <qstrlist.h> +#include <q3strlist.h> namespace VCARD { -Q_UINT32 RTokenise(const char * str, const char * delim, QStrList & l); +Q_UINT32 RTokenise(const char * str, const char * delim, Q3StrList & l); } 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 @@ -24,7 +24,7 @@ #ifndef SOUNDVALUE_H #define SOUNDVALUE_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardValue.h> 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 @@ -24,7 +24,7 @@ #ifndef SOURCEPARAM_H #define SOURCEPARAM_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardParam.h> @@ -39,18 +39,18 @@ class SourceParam : public Param enum SourceParamType { TypeUnknown, TypeValue, TypeContext, TypeX }; SourceParamType type() { parse(); return type_;} - QCString par() { parse(); return par_; } - QCString val() { parse(); return val_; } + Q3CString par() { parse(); return par_; } + Q3CString val() { parse(); return val_; } void setType(SourceParamType t) { type_ = t; assembled_ = false; } - void setPar(const QCString & s) { par_ = s; assembled_ = false; } - void setVal(const QCString & s) { val_ = s; assembled_ = false; } + void setPar(const Q3CString & s) { par_ = s; assembled_ = false; } + void setVal(const Q3CString & s) { val_ = s; assembled_ = false; } private: SourceParamType type_; // May be "VALUE = uri" or "CONTEXT = word" or "x-name = *SAFE-CHAR" - QCString par_, val_; // Sub-parameter, value + Q3CString par_, val_; // Sub-parameter, value }; } 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 @@ -24,7 +24,9 @@ #ifndef TELPARAM_H #define TELPARAM_H -#include <qcstring.h> +#include <q3cstring.h> +//Added by qt3to4: +#include <Q3PtrList> #include <VCardParam.h> @@ -43,7 +45,7 @@ class TelParam : public Param private: - QPtrList<TelType> types_; + Q3PtrList<TelType> types_; }; } 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 @@ -24,7 +24,7 @@ #ifndef TELVALUE_H #define TELVALUE_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardValue.h> 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 @@ -24,7 +24,7 @@ #ifndef TEXTBINPARAM_H #define TEXTBINPARAM_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardParam.h> 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 @@ -24,7 +24,7 @@ #ifndef TEXTBINVALUE_H #define TEXTBINVALUE_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardValue.h> 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 @@ -24,9 +24,9 @@ #ifndef TEXTLISTVALUE_H #define TEXTLISTVALUE_H -#include <qstrlist.h> +#include <q3strlist.h> -#include <qcstring.h> +#include <q3cstring.h> #include <VCardValue.h> @@ -39,11 +39,11 @@ class TextListValue : public Value #include "TextListValue-generated.h" unsigned int numValues(); - QCString value(unsigned int); + Q3CString value(unsigned int); private: - QStrList valueList_; + Q3StrList valueList_; }; } 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 @@ -24,7 +24,7 @@ #ifndef TEXTPARAM_H #define TEXTPARAM_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardParam.h> 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 @@ -25,6 +25,8 @@ #define URIVALUE_H #include <VCardValue.h> +//Added by qt3to4: +#include <Q3CString> namespace VCARD { @@ -33,18 +35,18 @@ class URIValue : public Value { #include "URIValue-generated.h" - URIValue(const QCString & scheme, const QCString & schemeSpecificPart); + URIValue(const Q3CString & scheme, const Q3CString & schemeSpecificPart); - QCString scheme(); - QCString schemeSpecificPart(); + Q3CString scheme(); + Q3CString schemeSpecificPart(); - void setScheme (const QCString &); - void setSchemeSpecificPart (const QCString &); + void setScheme (const Q3CString &); + void setSchemeSpecificPart (const Q3CString &); private: - QCString scheme_; - QCString schemeSpecificPart_; + Q3CString scheme_; + Q3CString schemeSpecificPart_; }; } 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 @@ -24,7 +24,7 @@ #ifndef UTCVALUE_H #define UTCVALUE_H -#include <qcstring.h> +#include <q3cstring.h> #include <VCardValue.h> 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 @@ -25,7 +25,9 @@ #define VCARD_VCARD_H #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <Q3CString> #include <VCardEnum.h> #include <VCardEntity.h> @@ -40,22 +42,22 @@ class VCard : public Entity #include "VCard-generated.h" bool has(EntityType); - bool has(const QCString &); + bool has(const Q3CString &); void add(const ContentLine &); - void add(const QCString &); + void add(const Q3CString &); ContentLine * contentLine(EntityType); - ContentLine * contentLine(const QCString &); + ContentLine * contentLine(const Q3CString &); - QCString group() { parse(); return group_; } + Q3CString group() { parse(); return group_; } - QPtrList<ContentLine> contentLineList() { parse(); return contentLineList_; } + Q3PtrList<ContentLine> contentLineList() { parse(); return contentLineList_; } private: - QCString group_; - QPtrList<ContentLine> contentLineList_; + Q3CString group_; + Q3PtrList<ContentLine> contentLineList_; }; } 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 @@ -25,7 +25,7 @@ #define VCARD_ENTITY_H #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <VCardEnum.h> #include <VCardVCard.h> @@ -34,8 +34,8 @@ namespace VCARD { -typedef QPtrList<VCard> VCardList; -typedef QPtrListIterator<VCard> VCardListIterator; +typedef Q3PtrList<VCard> VCardList; +typedef Q3PtrListIterator<VCard> VCardListIterator; class VCardEntity : public Entity { 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 @@ -24,7 +24,7 @@ #ifndef VALUE_H #define VALUE_H -#include <qptrlist.h> +#include <q3ptrlist.h> #include <VCardEntity.h> @@ -38,8 +38,8 @@ class Value : public Entity virtual Value *clone() { return new Value( *this ); } }; -typedef QPtrList<Value> ValueList; -typedef QPtrListIterator<Value> ValueListIterator; +typedef Q3PtrList<Value> ValueList; +typedef Q3PtrListIterator<Value> ValueListIterator; } 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: AdrParam(); AdrParam(const AdrParam&); -AdrParam(const QCString&); +AdrParam(const Q3CString&); AdrParam & operator = (AdrParam&); -AdrParam & operator = (const QCString&); +AdrParam & operator = (const Q3CString&); bool operator ==(AdrParam&); bool operator !=(AdrParam& x) {return !(*this==x);} -bool operator ==(const QCString& s) {AdrParam a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {AdrParam a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~AdrParam(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: AdrValue(); AdrValue(const AdrValue&); -AdrValue(const QCString&); +AdrValue(const Q3CString&); AdrValue & operator = (AdrValue&); -AdrValue & operator = (const QCString&); +AdrValue & operator = (const Q3CString&); bool operator ==(AdrValue&); bool operator !=(AdrValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {AdrValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {AdrValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~AdrValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: AgentParam(); AgentParam(const AgentParam&); -AgentParam(const QCString&); +AgentParam(const Q3CString&); AgentParam & operator = (AgentParam&); -AgentParam & operator = (const QCString&); +AgentParam & operator = (const Q3CString&); bool operator ==(AgentParam&); bool operator !=(AgentParam& x) {return !(*this==x);} -bool operator ==(const QCString& s) {AgentParam a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {AgentParam a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~AgentParam(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: AgentValue(); AgentValue(const AgentValue&); -AgentValue(const QCString&); +AgentValue(const Q3CString&); AgentValue & operator = (AgentValue&); -AgentValue & operator = (const QCString&); +AgentValue & operator = (const Q3CString&); bool operator ==(AgentValue&); bool operator !=(AgentValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {AgentValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {AgentValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~AgentValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: ClassValue(); ClassValue(const ClassValue&); -ClassValue(const QCString&); +ClassValue(const Q3CString&); ClassValue & operator = (ClassValue&); -ClassValue & operator = (const QCString&); +ClassValue & operator = (const Q3CString&); bool operator ==(ClassValue&); bool operator !=(ClassValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {ClassValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {ClassValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~ClassValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: ContentLine(); ContentLine(const ContentLine&); -ContentLine(const QCString&); +ContentLine(const Q3CString&); ContentLine & operator = (ContentLine&); -ContentLine & operator = (const QCString&); +ContentLine & operator = (const Q3CString&); bool operator ==(ContentLine&); bool operator !=(ContentLine& x) {return !(*this==x);} -bool operator ==(const QCString& s) {ContentLine a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {ContentLine a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~ContentLine(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: DateParam(); DateParam(const DateParam&); -DateParam(const QCString&); +DateParam(const Q3CString&); DateParam & operator = (DateParam&); -DateParam & operator = (const QCString&); +DateParam & operator = (const Q3CString&); bool operator ==(DateParam&); bool operator !=(DateParam& x) {return !(*this==x);} -bool operator ==(const QCString& s) {DateParam a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {DateParam a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~DateParam(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: DateValue(); DateValue(const DateValue&); -DateValue(const QCString&); +DateValue(const Q3CString&); DateValue & operator = (DateValue&); -DateValue & operator = (const QCString&); +DateValue & operator = (const Q3CString&); bool operator ==(DateValue&); bool operator !=(DateValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {DateValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {DateValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~DateValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: EmailParam(); EmailParam(const EmailParam&); -EmailParam(const QCString&); +EmailParam(const Q3CString&); EmailParam & operator = (EmailParam&); -EmailParam & operator = (const QCString&); +EmailParam & operator = (const Q3CString&); bool operator ==(EmailParam&); bool operator !=(EmailParam& x) {return !(*this==x);} -bool operator ==(const QCString& s) {EmailParam a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {EmailParam a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~EmailParam(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: FloatValue(); FloatValue(const FloatValue&); -FloatValue(const QCString&); +FloatValue(const Q3CString&); FloatValue & operator = (FloatValue&); -FloatValue & operator = (const QCString&); +FloatValue & operator = (const Q3CString&); bool operator ==(FloatValue&); bool operator !=(FloatValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {FloatValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {FloatValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~FloatValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: GeoValue(); GeoValue(const GeoValue&); -GeoValue(const QCString&); +GeoValue(const Q3CString&); GeoValue & operator = (GeoValue&); -GeoValue & operator = (const QCString&); +GeoValue & operator = (const Q3CString&); bool operator ==(GeoValue&); bool operator !=(GeoValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {GeoValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {GeoValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~GeoValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: Group(); Group(const Group&); -Group(const QCString&); +Group(const Q3CString&); Group & operator = (Group&); -Group & operator = (const QCString&); +Group & operator = (const Q3CString&); bool operator ==(Group&); bool operator !=(Group& x) {return !(*this==x);} -bool operator ==(const QCString& s) {Group a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {Group a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~Group(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: ImageParam(); ImageParam(const ImageParam&); -ImageParam(const QCString&); +ImageParam(const Q3CString&); ImageParam & operator = (ImageParam&); -ImageParam & operator = (const QCString&); +ImageParam & operator = (const Q3CString&); bool operator ==(ImageParam&); bool operator !=(ImageParam& x) {return !(*this==x);} -bool operator ==(const QCString& s) {ImageParam a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {ImageParam a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~ImageParam(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: ImageValue(); ImageValue(const ImageValue&); -ImageValue(const QCString&); +ImageValue(const Q3CString&); ImageValue & operator = (ImageValue&); -ImageValue & operator = (const QCString&); +ImageValue & operator = (const Q3CString&); bool operator ==(ImageValue&); bool operator !=(ImageValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {ImageValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {ImageValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~ImageValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: ImgParam(); ImgParam(const ImgParam&); -ImgParam(const QCString&); +ImgParam(const Q3CString&); ImgParam & operator = (ImgParam&); -ImgParam & operator = (const QCString&); +ImgParam & operator = (const Q3CString&); bool operator ==(ImgParam&); bool operator !=(ImgParam& x) {return !(*this==x);} -bool operator ==(const QCString& s) {ImgParam a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {ImgParam a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~ImgParam(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: ImgValue(); ImgValue(const ImgValue&); -ImgValue(const QCString&); +ImgValue(const Q3CString&); ImgValue & operator = (ImgValue&); -ImgValue & operator = (const QCString&); +ImgValue & operator = (const Q3CString&); bool operator ==(ImgValue&); bool operator !=(ImgValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {ImgValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {ImgValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~ImgValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: LangValue(); LangValue(const LangValue&); -LangValue(const QCString&); +LangValue(const Q3CString&); LangValue & operator = (LangValue&); -LangValue & operator = (const QCString&); +LangValue & operator = (const Q3CString&); bool operator ==(LangValue&); bool operator !=(LangValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {LangValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {LangValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~LangValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: NValue(); NValue(const NValue&); -NValue(const QCString&); +NValue(const Q3CString&); NValue & operator = (NValue&); -NValue & operator = (const QCString&); +NValue & operator = (const Q3CString&); bool operator ==(NValue&); bool operator !=(NValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {NValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {NValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~NValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: V_Name(); V_Name(const V_Name&); -V_Name(const QCString&); +V_Name(const Q3CString&); V_Name & operator = (V_Name&); -V_Name & operator = (const QCString&); +V_Name & operator = (const Q3CString&); bool operator ==(V_Name&); bool operator !=(V_Name& x) {return !(*this==x);} -bool operator ==(const QCString& s) {V_Name a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {V_Name a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~V_Name(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: OrgValue(); OrgValue(const OrgValue&); -OrgValue(const QCString&); +OrgValue(const Q3CString&); OrgValue & operator = (OrgValue&); -OrgValue & operator = (const QCString&); +OrgValue & operator = (const Q3CString&); bool operator ==(OrgValue&); bool operator !=(OrgValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {OrgValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {OrgValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~OrgValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: Param(); Param(const Param&); -Param(const QCString&); +Param(const Q3CString&); Param & operator = (Param&); -Param & operator = (const QCString&); +Param & operator = (const Q3CString&); bool operator ==(Param&); bool operator !=(Param& x) {return !(*this==x);} -bool operator ==(const QCString& s) {Param a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {Param a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~Param(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: V_ParamName(); V_ParamName(const V_ParamName&); -V_ParamName(const QCString&); +V_ParamName(const Q3CString&); V_ParamName & operator = (V_ParamName&); -V_ParamName & operator = (const QCString&); +V_ParamName & operator = (const Q3CString&); bool operator ==(V_ParamName&); bool operator !=(V_ParamName& x) {return !(*this==x);} -bool operator ==(const QCString& s) {V_ParamName a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {V_ParamName a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~V_ParamName(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: V_ParamValue(); V_ParamValue(const V_ParamValue&); -V_ParamValue(const QCString&); +V_ParamValue(const Q3CString&); V_ParamValue & operator = (V_ParamValue&); -V_ParamValue & operator = (const QCString&); +V_ParamValue & operator = (const Q3CString&); bool operator ==(V_ParamValue&); bool operator !=(V_ParamValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {V_ParamValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {V_ParamValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~V_ParamValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: PhoneNumberValue(); PhoneNumberValue(const PhoneNumberValue&); -PhoneNumberValue(const QCString&); +PhoneNumberValue(const Q3CString&); PhoneNumberValue & operator = (PhoneNumberValue&); -PhoneNumberValue & operator = (const QCString&); +PhoneNumberValue & operator = (const Q3CString&); bool operator ==(PhoneNumberValue&); bool operator !=(PhoneNumberValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {PhoneNumberValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {PhoneNumberValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~PhoneNumberValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: SoundValue(); SoundValue(const SoundValue&); -SoundValue(const QCString&); +SoundValue(const Q3CString&); SoundValue & operator = (SoundValue&); -SoundValue & operator = (const QCString&); +SoundValue & operator = (const Q3CString&); bool operator ==(SoundValue&); bool operator !=(SoundValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {SoundValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {SoundValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~SoundValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: SourceParam(); SourceParam(const SourceParam&); -SourceParam(const QCString&); +SourceParam(const Q3CString&); SourceParam & operator = (SourceParam&); -SourceParam & operator = (const QCString&); +SourceParam & operator = (const Q3CString&); bool operator ==(SourceParam&); bool operator !=(SourceParam& x) {return !(*this==x);} -bool operator ==(const QCString& s) {SourceParam a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {SourceParam a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~SourceParam(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: TelParam(); TelParam(const TelParam&); -TelParam(const QCString&); +TelParam(const Q3CString&); TelParam & operator = (TelParam&); -TelParam & operator = (const QCString&); +TelParam & operator = (const Q3CString&); bool operator ==(TelParam&); bool operator !=(TelParam& x) {return !(*this==x);} -bool operator ==(const QCString& s) {TelParam a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {TelParam a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~TelParam(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: TelValue(); TelValue(const TelValue&); -TelValue(const QCString&); +TelValue(const Q3CString&); TelValue & operator = (TelValue&); -TelValue & operator = (const QCString&); +TelValue & operator = (const Q3CString&); bool operator ==(TelValue&); bool operator !=(TelValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {TelValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {TelValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~TelValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: TextBinParam(); TextBinParam(const TextBinParam&); -TextBinParam(const QCString&); +TextBinParam(const Q3CString&); TextBinParam & operator = (TextBinParam&); -TextBinParam & operator = (const QCString&); +TextBinParam & operator = (const Q3CString&); bool operator ==(TextBinParam&); bool operator !=(TextBinParam& x) {return !(*this==x);} -bool operator ==(const QCString& s) {TextBinParam a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {TextBinParam a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~TextBinParam(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: TextBinValue(); TextBinValue(const TextBinValue&); -TextBinValue(const QCString&); +TextBinValue(const Q3CString&); TextBinValue & operator = (TextBinValue&); -TextBinValue & operator = (const QCString&); +TextBinValue & operator = (const Q3CString&); bool operator ==(TextBinValue&); bool operator !=(TextBinValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {TextBinValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {TextBinValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~TextBinValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: TextListValue(); TextListValue(const TextListValue&); -TextListValue(const QCString&); +TextListValue(const Q3CString&); TextListValue & operator = (TextListValue&); -TextListValue & operator = (const QCString&); +TextListValue & operator = (const Q3CString&); bool operator ==(TextListValue&); bool operator !=(TextListValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {TextListValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {TextListValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~TextListValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: TextNSParam(); TextNSParam(const TextNSParam&); -TextNSParam(const QCString&); +TextNSParam(const Q3CString&); TextNSParam & operator = (TextNSParam&); -TextNSParam & operator = (const QCString&); +TextNSParam & operator = (const Q3CString&); bool operator ==(TextNSParam&); bool operator !=(TextNSParam& x) {return !(*this==x);} -bool operator ==(const QCString& s) {TextNSParam a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {TextNSParam a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~TextNSParam(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: TextParam(); TextParam(const TextParam&); -TextParam(const QCString&); +TextParam(const Q3CString&); TextParam & operator = (TextParam&); -TextParam & operator = (const QCString&); +TextParam & operator = (const Q3CString&); bool operator ==(TextParam&); bool operator !=(TextParam& x) {return !(*this==x);} -bool operator ==(const QCString& s) {TextParam a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {TextParam a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~TextParam(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: TextValue(); TextValue(const TextValue&); -TextValue(const QCString&); +TextValue(const Q3CString&); TextValue & operator = (TextValue&); -TextValue & operator = (const QCString&); +TextValue & operator = (const Q3CString&); bool operator ==(TextValue&); bool operator !=(TextValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {TextValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {TextValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~TextValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: URIValue(); URIValue(const URIValue&); -URIValue(const QCString&); +URIValue(const Q3CString&); URIValue & operator = (URIValue&); -URIValue & operator = (const QCString&); +URIValue & operator = (const Q3CString&); bool operator ==(URIValue&); bool operator !=(URIValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {URIValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {URIValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~URIValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: UTCValue(); UTCValue(const UTCValue&); -UTCValue(const QCString&); +UTCValue(const Q3CString&); UTCValue & operator = (UTCValue&); -UTCValue & operator = (const QCString&); +UTCValue & operator = (const Q3CString&); bool operator ==(UTCValue&); bool operator !=(UTCValue& x) {return !(*this==x);} -bool operator ==(const QCString& s) {UTCValue a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {UTCValue a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~UTCValue(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: VCard(); VCard(const VCard&); -VCard(const QCString&); +VCard(const Q3CString&); VCard & operator = (VCard&); -VCard & operator = (const QCString&); +VCard & operator = (const Q3CString&); bool operator ==(VCard&); bool operator !=(VCard& x) {return !(*this==x);} -bool operator ==(const QCString& s) {VCard a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {VCard a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~VCard(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: VCardEntity(); VCardEntity(const VCardEntity&); -VCardEntity(const QCString&); +VCardEntity(const Q3CString&); VCardEntity & operator = (VCardEntity&); -VCardEntity & operator = (const QCString&); +VCardEntity & operator = (const Q3CString&); bool operator ==(VCardEntity&); bool operator !=(VCardEntity& x) {return !(*this==x);} -bool operator ==(const QCString& s) {VCardEntity a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {VCardEntity a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~VCardEntity(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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,15 +1,17 @@ +//Added by qt3to4: +#include <Q3CString> // XXX Automatically generated. DO NOT EDIT! XXX // public: Value(); Value(const Value&); -Value(const QCString&); +Value(const Q3CString&); Value & operator = (Value&); -Value & operator = (const QCString&); +Value & operator = (const Q3CString&); bool operator ==(Value&); bool operator !=(Value& x) {return !(*this==x);} -bool operator ==(const QCString& s) {Value a(s);return(*this==a);} -bool operator != (const QCString& s) {return !(*this == s);} +bool operator ==(const Q3CString& s) {Value a(s);return(*this==a);} +bool operator != (const Q3CString& s) {return !(*this == s);} virtual ~Value(); void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 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 @@ -3,7 +3,9 @@ #include <assert.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> +//Added by qt3to4: +#include <Q3CString> #include <VCard.h> @@ -18,14 +20,14 @@ int main(int argc, char * argv[]) QFile f(argv[1]); - QCString str; + Q3CString str; - if (!f.open(IO_ReadOnly)) { + if (!f.open(QIODevice::ReadOnly)) { cerr << "Couldn't open file \"" << argv[1] << endl; exit(1); } - QTextStream t(&f); + Q3TextStream t(&f); while (!t.eof()) str += t.readLine().utf8() + '\n'; @@ -52,7 +54,7 @@ int main(int argc, char * argv[]) if (v.has(EntityEmail)) { cerr << "Email parameter found" << endl; - QCString s = v.contentLine(EntityEmail)->value()->asString(); + Q3CString s = v.contentLine(EntityEmail)->value()->asString(); cerr << "Email value == " << s << endl; } 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 @@ -5,6 +5,8 @@ #include <kcmdlineargs.h> #include <VCard.h> +//Added by qt3to4: +#include <Q3CString> int main(int argc,char **argv) { @@ -33,7 +35,7 @@ int main(int argc,char **argv) cl2.setParamList( p ); v.add(cl2); - QCString str = v.asString(); + Q3CString str = v.asString(); kdDebug() << "--- VCard begin ---" << endl << str diff --git a/kabc/vcard21parser.cpp b/kabc/vcard21parser.cpp index 60d02b8..e24a9dc 100644 --- a/kabc/vcard21parser.cpp +++ b/kabc/vcard21parser.cpp @@ -27,6 +27,8 @@ $Id$ #include <qmap.h> #include <qregexp.h> +//Added by qt3to4: +#include <Q3ValueList> #include <kmdcodec.h> #include "vcard21parser.h" @@ -45,7 +47,7 @@ bool VCardLineX::isValid() const // This is long but it makes it a bit faster (and saves me from using // a tree which is probably the ideal situation, but a bit memory heavy) - switch( name[0] ) { + switch( name[0].unicode() ) { case 'a': if ( name == VCARD_ADR && qualified && (qualifiers.contains(VCARD_ADR_DOM) || @@ -269,7 +271,7 @@ KABC::Addressee VCard21Parser::readFromString( const QString &data) addressee.setBirthday(VCardStringToDate(tmpStr)); //set the addressee's phone numbers - for ( QValueListIterator<VCardLineX> i = mVCard->_vcdata->begin();i != mVCard->_vcdata->end(); ++i ) { + for ( Q3ValueListIterator<VCardLineX> i = mVCard->_vcdata->begin();i != mVCard->_vcdata->end(); ++i ) { if ( (*i).name == VCARD_TEL ) { int type = 0; if ( (*i).qualified ) { @@ -308,7 +310,7 @@ KABC::Addressee VCard21Parser::readFromString( const QString &data) } addressee.makePhoneNumbersOLcompatible(); //set the addressee's addresses - for ( QValueListIterator<VCardLineX> i = mVCard->_vcdata->begin();i != mVCard->_vcdata->end(); ++i ) { + for ( Q3ValueListIterator<VCardLineX> i = mVCard->_vcdata->begin();i != mVCard->_vcdata->end(); ++i ) { if ( (*i).name == VCARD_ADR ) { int type = 0; if ( (*i).qualified ) { @@ -327,7 +329,10 @@ KABC::Addressee VCard21Parser::readFromString( const QString &data) if ( (*i).qualifiers.contains( VCARD_ADR_PREF ) ) type |= Address::Pref; } - addressee.insertAddress( readAddressFromQStringList( (*i).parameters, type ) ); + QStringList tmp; + for(Q3ValueList<QString>::const_iterator ii=(*i).parameters.begin();ii!=(*i).parameters.end();++ii) + tmp.push_back(*ii); + addressee.insertAddress( readAddressFromQStringList( tmp, type ) ); } } @@ -408,10 +413,10 @@ VCard21ParserImpl *VCard21ParserImpl::parseVCard( const QString& vc, int *err ) int _err = 0; int _state = VC_STATE_BEGIN; - QValueList<VCardLineX> *_vcdata; - QValueList<QString> lines; + Q3ValueList<VCardLineX> *_vcdata; + QStringList lines; - _vcdata = new QValueList<VCardLineX>; + _vcdata = new Q3ValueList<VCardLineX>; lines = QStringList::split( QRegExp( "[\x0d\x0a]" ), vc ); @@ -501,8 +506,8 @@ VCard21ParserImpl *VCard21ParserImpl::parseVCard( const QString& vc, int *err ) } _vcl.parameters = QStringList::split( ';', value, true ); if ( qp ) { // decode the quoted printable - for ( QStringList::Iterator z = _vcl.parameters.begin(); z != _vcl.parameters.end(); ++z ) - *z = KCodecs::quotedPrintableDecode( (*z).latin1() ); + for ( QLinkedList<QString>::Iterator z = _vcl.parameters.begin(); z != _vcl.parameters.end(); ++z ) + *z = KCodecs::quotedPrintableDecode( (Q3CString)(*z).latin1() ); } } } else { @@ -543,7 +548,7 @@ VCard21ParserImpl *VCard21ParserImpl::parseVCard( const QString& vc, int *err ) return new VCard21ParserImpl( _vcdata ); } -VCard21ParserImpl::VCard21ParserImpl(QValueList<VCardLineX> *_vcd) : _vcdata(_vcd) +VCard21ParserImpl::VCard21ParserImpl(Q3ValueList<VCardLineX> *_vcd) : _vcdata(_vcd) { } @@ -554,7 +559,7 @@ QString VCard21ParserImpl::getValue(const QString& name, const QString& qualifie const QString lowname = name.lower(); const QString lowqualifier = qualifier.lower(); - for (QValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { + for (Q3ValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) { if ((*i).parameters.count() > 0) return (*i).parameters[0]; @@ -570,7 +575,7 @@ QString VCard21ParserImpl::getValue(const QString& name) QString failed; const QString lowname = name.lower(); - for (QValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { + for (Q3ValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { if ((*i).name == lowname && !(*i).qualified) { if ((*i).parameters.count() > 0) return (*i).parameters[0]; @@ -584,9 +589,10 @@ QString VCard21ParserImpl::getValue(const QString& name) QStringList VCard21ParserImpl::getValues(const QString& name) { const QString lowname = name.lower(); - for (QValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { - if ((*i).name == lowname && !(*i).qualified) - return (*i).parameters; + for (Q3ValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { + if ((*i).name == lowname && !(*i).qualified) { + return QStringList( (*i).parameters ); + } } // failed. return QStringList(); @@ -596,9 +602,9 @@ QStringList VCard21ParserImpl::getValues(const QString& name, const QString& qua { const QString lowname = name.lower(); const QString lowqualifier = qualifier.lower(); - for (QValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { + for (Q3ValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) - return (*i).parameters; + return QStringList( (*i).parameters ); } // failed. return QStringList(); diff --git a/kabc/vcard21parser.h b/kabc/vcard21parser.h index 77e69b6..80ba6ef 100644 --- a/kabc/vcard21parser.h +++ b/kabc/vcard21parser.h @@ -34,7 +34,7 @@ $Id$ #include <qregexp.h> #include <qstring.h> #include <kurl.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include "addressee.h" #include "addressbook.h" @@ -196,8 +196,8 @@ class VCardLineX public: QString name; bool qualified; - QValueList<QString> qualifiers; - QValueList<QString> parameters; + Q3ValueList<QString> qualifiers; + Q3ValueList<QString> parameters; bool isValid() const; }; @@ -217,10 +217,10 @@ public: QStringList getValues(const QString& name, const QString& qualifier); QStringList getValues(const QString& name); - QValueList<VCardLineX> *_vcdata; + Q3ValueList<VCardLineX> *_vcdata; private: - VCard21ParserImpl (QValueList<VCardLineX> *_vcd); + VCard21ParserImpl (Q3ValueList<VCardLineX> *_vcd); }; #endif diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp index 580c28b..2417874 100644 --- a/kabc/vcardformatimpl.cpp +++ b/kabc/vcardformatimpl.cpp @@ -28,6 +28,9 @@ $Id$ #include <qfile.h> #include <qregexp.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3PtrList> #include <kdebug.h> #include <kmdcodec.h> @@ -54,7 +57,7 @@ bool VCardFormatImpl::load( Addressee &addressee, QFile *file ) kdDebug(5700) << "VCardFormat::load()" << endl; QByteArray fdata = file->readAll(); - QCString data(fdata.data(), fdata.size()+1); + Q3CString data(fdata.data(), fdata.size()+1); VCardEntity e( data ); @@ -75,7 +78,7 @@ bool VCardFormatImpl::load( Addressee &addressee, QFile *file ) bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, QFile *file ) { - QCString data(file->readAll().data(), file->size()+1); + Q3CString data(file->readAll().data(), file->size()+1); VCardEntity e( data ); VCardListIterator it( e.cardList() ); @@ -108,7 +111,7 @@ void VCardFormatImpl::save( const Addressee &addressee, QFile *file ) vcardlist.append( v ); vcards.setCardList( vcardlist ); - QCString vcardData = vcards.asString(); + Q3CString vcardData = vcards.asString(); file->writeBlock( (const char*)vcardData, vcardData.length() ); } @@ -129,11 +132,11 @@ void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, QFile *file bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCard *v ) { - QPtrList<ContentLine> contentLines = v->contentLineList(); + Q3PtrList<ContentLine> contentLines = v->contentLineList(); ContentLine *cl; for( cl = contentLines.first(); cl; cl = contentLines.next() ) { - QCString n = cl->name(); + Q3CString n = cl->name(); if ( n.left( 2 ) == "X-" ) { n = n.mid( 2 ); int posDash = n.find( "-" ); @@ -219,7 +222,7 @@ bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCard *v ) break; case EntityBirthday: - addressee.setBirthday( readDateValue( cl ) ); + addressee.setBirthday( (QDateTime) readDateValue( cl ) ); break; case EntityRevision: @@ -530,7 +533,7 @@ int VCardFormatImpl::readAddressParam( ContentLine *cl ) int type = 0; ParamList params = cl->paramList(); ParamListIterator it( params ); - QCString tmpStr; + Q3CString tmpStr; for( ; it.current(); ++it ) { if ( (*it)->name().upper() == "TYPE" ) { tmpStr = (*it)->value().lower(); @@ -609,7 +612,7 @@ PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl ) int type = 0; ParamList params = cl->paramList(); ParamListIterator it( params ); - QCString tmpStr; + Q3CString tmpStr; for( ; it.current(); ++it ) { if ( (*it)->name() == "TYPE" ) { tmpStr = (*it)->value().lower(); @@ -870,7 +873,7 @@ void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType ty QImage img = pic.data(); if ( intern ) { // only for vCard export we really write the data inline QByteArray data; - QDataStream s( data, IO_WriteOnly ); + QDataStream s( &data, QIODevice::WriteOnly ); s.setVersion( 4 ); // to produce valid png files s << img; cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); @@ -959,7 +962,7 @@ void VCardFormatImpl::addSoundValue( VCARD::VCard *vcard, const Sound &sound, co cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); } else { // save sound in cache QFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) ); - if ( file.open( IO_WriteOnly ) ) { + if ( file.open( QIODevice::WriteOnly ) ) { file.writeBlock( data ); } cl.setValue( new TextValue( "<dummy>" ) ); @@ -991,7 +994,7 @@ Sound VCardFormatImpl::readSoundValue( VCARD::ContentLine *cl, const Addressee & QByteArray data; if ( v->asString() == "<dummy>" ) { // no sound inline stored => sound is in cache QFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) ); - if ( file.open( IO_ReadOnly ) ) { + if ( file.open( QIODevice::ReadOnly ) ) { data = file.readAll(); file.close(); } diff --git a/kabc/vcardformatplugin.cpp b/kabc/vcardformatplugin.cpp index 8db8c11..0b97a08 100644 --- a/kabc/vcardformatplugin.cpp +++ b/kabc/vcardformatplugin.cpp @@ -61,7 +61,7 @@ bool VCardFormatPlugin::checkFormat( QFile *file ) const { QString line; - file->readLine( line, 1024 ); + char tmp[1024]; file->readLine( tmp, 1024 ); line = tmp; line = line.stripWhiteSpace(); if ( line == "BEGIN:VCARD" ) return true; 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 @@ -24,14 +24,14 @@ #include "vcardline.h" #include <qmap.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> namespace KABC { class VCard { public: - typedef QValueList<VCard> List; + typedef Q3ValueList<VCard> List; typedef QMap< QString, VCardLine::List > LineMap; enum Version { v2_1, v3_0 }; 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 @@ -19,6 +19,8 @@ */ #include "vcardline.h" +//Added by qt3to4: +#include <Q3CString> using namespace KABC; @@ -43,7 +45,7 @@ VCardLine::VCardLine( const QString &identifier, const QString &value ) : d( 0 ) { mIdentifier = identifier; - mValue.assign( value.data(), value.length() ); + mValue = value; } VCardLine::VCardLine( const VCardLine& line ) @@ -86,7 +88,7 @@ void VCardLine::setValueString( const QString& value ) { setValueCString( value.utf8() ); } -void VCardLine::setValueCString( const QCString& value ) +void VCardLine::setValueCString( const Q3CString& value ) { mValue.duplicate( value.data(), value.length() ); } 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 @@ -22,8 +22,8 @@ #define VCARDLINE_H #include <qstringlist.h> -#include <qvaluelist.h> -#include <qcstring.h> +#include <q3valuelist.h> +#include <q3cstring.h> #include <qvariant.h> #include <qmap.h> #include <qstring.h> @@ -33,7 +33,7 @@ namespace KABC { class VCardLine { public: - typedef QValueList<VCardLine> List; + typedef Q3ValueList<VCardLine> List; typedef QMap<QString, QStringList> ParamMap; VCardLine(); @@ -59,7 +59,7 @@ class VCardLine * Sets the value of of this line. */ void setValueString( const QString& value ); - void setValueCString( const QCString& value ); + void setValueCString( const Q3CString& value ); void setValueBytes( const QByteArray& value ); /** 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 @@ -218,7 +218,7 @@ QString VCardParser::createVCards( const VCard::List& list ) if ( encodingType == "b" ) KCodecs::base64Encode( input, output ); else if ( encodingType == "quoted-printable" ) - KCodecs::quotedPrintableEncode( input, output ); + KCodecs::quotedPrintableEncode( input, output, true ); textLine.append( ":" + QString( output ) ); } else textLine.append( ":" + (*lineIt).valueString().replace( QRegExp("\n"), "\\n" ) ); 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 @@ -652,7 +652,7 @@ VCardLine VCardTool::createPicture( const QString &identifier, const Picture &pi if ( pic.isIntern() ) { if ( !pic.data().isNull() ) { QByteArray input; - QDataStream s( input, IO_WriteOnly ); + QDataStream s( &input, QIODevice::WriteOnly ); s.setVersion( 4 ); s << pic.data(); line.setValueBytes( input ); diff --git a/kaddressbook/addresseditwidget.cpp b/kaddressbook/addresseditwidget.cpp index 3dcd592..83908d0 100644 --- a/kaddressbook/addresseditwidget.cpp +++ b/kaddressbook/addresseditwidget.cpp @@ -22,24 +22,31 @@ without including the source code for Qt in the source distribution. */ -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qcheckbox.h> -#include <qhbox.h> +#include <q3hbox.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistbox.h> -#include <qlistview.h> +#include <q3listbox.h> +#include <q3listview.h> #include <qpushbutton.h> -#include <qsignal.h> +#include <q3signal.h> #include <qstring.h> #include <qapplication.h> +#include <QDesktopWidget> + +#include <Q3VBoxLayout> +#include <Q3GridLayout> #ifndef KAB_EMBEDDED -#include <qtextedit.h> +#include <q3textedit.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3VBoxLayout> #include <kaccelmanager.h> #include <kbuttonbox.h> #else //KAB_EMBEDDED -#include <qmultilineedit.h> +#include <q3multilineedit.h> #endif //KAB_EMBEDDED #include <qtoolbutton.h> @@ -67,9 +74,9 @@ AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name ) { mConfig = AddresseeConfig::instance(); - QVBoxLayout *layout = new QVBoxLayout( this ); + Q3VBoxLayout *layout = new Q3VBoxLayout( this ); layout->setSpacing( KDialog::spacingHintSmall() ); - QHBox *b1 = new QHBox( this); + Q3HBox *b1 = new Q3HBox( this); //QLabel * label = new QLabel( b1 ); //label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); @@ -84,11 +91,11 @@ AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name ) // layout->addWidget( mTypeCombo ); #ifndef KAB_EMBEDDED - mAddressTextEdit = new QTextEdit( this ); + mAddressTextEdit = new Q3TextEdit( this ); mAddressTextEdit->setReadOnly( true ); mAddressTextEdit->setMinimumHeight( 20 ); #else //KAB_EMBEDDED - mAddressTextEdit = new QMultiLineEdit( this ); + mAddressTextEdit = new Q3MultiLineEdit( this ); mAddressTextEdit->setReadOnly( true ); mAddressTextEdit->setMinimumHeight( 20 ); #endif //KAB_EMBEDDED @@ -126,13 +133,13 @@ void AddressEditWidget::setAddresses( const KABC::Addressee &addr, // Insert types for existing numbers. mTypeCombo->insertTypeList( list ); - QValueList<int> defaultTypes; + Q3ValueList<int> defaultTypes; defaultTypes << KABC::Address::Home; defaultTypes << KABC::Address::Work; mConfig->setUid( mAddressee.uid() ); - QValueList<int> configList = mConfig->noDefaultAddrTypes(); - QValueList<int>::ConstIterator it; + Q3ValueList<int> configList = mConfig->noDefaultAddrTypes(); + Q3ValueList<int>::ConstIterator it; for ( it = configList.begin(); it != configList.end(); ++it ) defaultTypes.remove( *it ); @@ -181,7 +188,7 @@ void AddressEditWidget::edit() } mConfig->setUid( mAddressee.uid() ); - QValueList<int> configList; + Q3ValueList<int> configList; if ( !hasHome ) { configList << KABC::Address::Home; } @@ -255,7 +262,7 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list, QWidget *page = plainPage(); - QGridLayout *topLayout = new QGridLayout( page, 8, 2 ); + Q3GridLayout *topLayout = new Q3GridLayout( page, 8, 2 ); topLayout->setSpacing( spacingHintSmall() ); mTypeCombo = new AddressTypeCombo( mAddressList, page ); @@ -266,9 +273,9 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list, topLayout->addWidget( label, 1, 0 ); #ifndef KAB_EMBEDDED - mStreetTextEdit = new QTextEdit( page ); + mStreetTextEdit = new Q3TextEdit( page ); #else //KAB_EMBEDDED - mStreetTextEdit = new QMultiLineEdit( page ); + mStreetTextEdit = new Q3MultiLineEdit( page ); //US qDebug("AddressEditDialog::AddressEditDialog has to be changed"); #endif //KAB_EMBEDDED @@ -311,14 +318,14 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list, fillCountryCombo(); label->setBuddy( mCountryCombo ); topLayout->addWidget( mCountryCombo, 6, 1 ); - mCountryCombo->setSizeLimit( 8); + mCountryCombo->setMaxVisibleItems( 8); mPreferredCheckBox = new QCheckBox( i18n( "This is the preferred address" ), page ); topLayout->addMultiCellWidget( mPreferredCheckBox, 7, 7, 0, 1 ); /* KSeparator *sep = new KSeparator( KSeparator::HLine, page ); topLayout->addMultiCellWidget( sep, 8, 8, 0, 1 ); */ - QHBox *buttonBox = new QHBox( page ); + Q3HBox *buttonBox = new Q3HBox( page ); buttonBox->setSpacing( spacingHint() ); topLayout->addMultiCellWidget( buttonBox, 9, 9, 0, 1 ); @@ -583,9 +590,9 @@ AddressTypeDialog::AddressTypeDialog( int type, QWidget *parent ) parent, "AddressTypeDialog" ) { QWidget *page = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( page ); + Q3VBoxLayout *layout = new Q3VBoxLayout( page ); - mGroup = new QButtonGroup( 2, Horizontal, i18n( "Address Types" ), page ); + mGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "Address Types" ), page ); layout->addWidget( mGroup ); mTypeList = KABC::Address::typeList(); @@ -617,6 +624,6 @@ int AddressTypeDialog::type() const return type; } -#ifndef KAB_EMBEDDED -#include "addresseditwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_addresseditwidget.cpp" #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 @@ -33,13 +33,13 @@ #include "addresseeconfig.h" #include "typecombo.h" -class QButtonGroup; +class Q3ButtonGroup; class QCheckBox; -class QListView; +class Q3ListView; #ifndef KAB_EMBEDDED -class QTextEdit; +class Q3TextEdit; #else //KAB_EMBEDDED -class QMultiLineEdit; +class Q3MultiLineEdit; #endif //KAB_EMBEDDED class QToolButton; @@ -81,9 +81,9 @@ class AddressEditWidget : public QWidget QPushButton *mEditButton; #ifndef KAB_EMBEDDED - QTextEdit *mAddressTextEdit; + Q3TextEdit *mAddressTextEdit; #else //KAB_EMBEDDED - QMultiLineEdit *mAddressTextEdit; + Q3MultiLineEdit *mAddressTextEdit; #endif //KAB_EMBEDDED KABC::Address::List mAddressList; @@ -120,9 +120,9 @@ class AddressEditDialog : public KDialogBase AddressTypeCombo *mTypeCombo; #ifndef KAB_EMBEDDED - QTextEdit *mStreetTextEdit; + Q3TextEdit *mStreetTextEdit; #else //KAB_EMBEDDED - QMultiLineEdit *mStreetTextEdit; + Q3MultiLineEdit *mStreetTextEdit; #endif //KAB_EMBEDDED KComboBox *mCountryCombo; KLineEdit *mRegionEdit; @@ -151,7 +151,7 @@ class AddressTypeDialog : public KDialogBase int type() const; private: - QButtonGroup *mGroup; + Q3ButtonGroup *mGroup; KABC::Address::TypeList mTypeList; }; diff --git a/kaddressbook/addresseeconfig.cpp b/kaddressbook/addresseeconfig.cpp index ea0436f..81b1bf4 100644 --- a/kaddressbook/addresseeconfig.cpp +++ b/kaddressbook/addresseeconfig.cpp @@ -26,6 +26,8 @@ //US #include <kstandarddirs.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <Q3ValueList> using namespace KABC; @@ -77,13 +79,13 @@ void AddresseeConfig::setAutomaticNameParsing( bool value ) KABPrefs::instance()->mAutomaticNameParsing ); } -void AddresseeConfig::setNoDefaultAddrTypes( const QValueList<int> &types ) +void AddresseeConfig::setNoDefaultAddrTypes( const Q3ValueList<int> &types ) { AddresseeConfig::config()->writeEntry( "NoDefaultAddrTypes", types ); AddresseeConfig::config()->sync(); } - QValueList<int> AddresseeConfig::noDefaultAddrTypes() const + Q3ValueList<int> AddresseeConfig::noDefaultAddrTypes() const { return AddresseeConfig::config()->readIntListEntry( "NoDefaultAddrTypes" ); } diff --git a/kaddressbook/addresseeconfig.h b/kaddressbook/addresseeconfig.h index 47fbdd6..f6bb3e9 100644 --- a/kaddressbook/addresseeconfig.h +++ b/kaddressbook/addresseeconfig.h @@ -26,6 +26,8 @@ #include <kabc/addressee.h> #include <kconfig.h> +//Added by qt3to4: +#include <Q3ValueList> using namespace KABC; @@ -43,8 +45,8 @@ class AddresseeConfig void setAutomaticNameParsing( bool value ); bool automaticNameParsing(); - void setNoDefaultAddrTypes( const QValueList<int> &types ); - QValueList<int> noDefaultAddrTypes() const; + void setNoDefaultAddrTypes( const Q3ValueList<int> &types ); + Q3ValueList<int> noDefaultAddrTypes() const; void remove( const QString & uid); diff --git a/kaddressbook/addresseeeditordialog.cpp b/kaddressbook/addresseeeditordialog.cpp index b5a60f2..b925a07 100644 --- a/kaddressbook/addresseeeditordialog.cpp +++ b/kaddressbook/addresseeeditordialog.cpp @@ -23,6 +23,9 @@ #include <qlayout.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kdebug.h> #include <klocale.h> @@ -43,7 +46,7 @@ AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent, QWidget *page = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( page ); + Q3VBoxLayout *layout = new Q3VBoxLayout( page ); mEditorWidget = new AddresseeEditorWidget( core, false, page ); connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ), @@ -118,6 +121,6 @@ void AddresseeEditorDialog::slotCancel() } -#ifndef KAB_EMBEDDED -#include "addresseeeditordialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_addresseeeditordialog.cpp" #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 @@ -22,23 +22,27 @@ */ #include <qcheckbox.h> -#include <qhbox.h> +#include <q3hbox.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qpushbutton.h> #include <qtabwidget.h> #include <qapplication.h> #ifndef KAB_EMBEDDED -#include <qtextedit.h> +#include <q3textedit.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3PopupMenu> +#include <Q3VBoxLayout> #include <kaccelmanager.h> #include "keywidget.h" #include "soundwidget.h" #else //KAB_EMBEDDED -#include <qmultilineedit.h> +#include <q3multilineedit.h> #endif //KAB_EMBEDDED @@ -130,7 +134,7 @@ void AddresseeEditorWidget::textChanged( const QString& ) void AddresseeEditorWidget::initGUI() { - QVBoxLayout *layout = new QVBoxLayout( this ); + Q3VBoxLayout *layout = new Q3VBoxLayout( this ); mTabWidget = new QTabWidget( this ); layout->addWidget( mTabWidget ); @@ -160,7 +164,7 @@ void AddresseeEditorWidget::setupTab1() horLayout = true; maxCol = 3; } - QGridLayout *layout = new QGridLayout( tab1, 7-maxCol, maxCol ); + Q3GridLayout *layout = new Q3GridLayout( tab1, 7-maxCol, maxCol ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); @@ -327,7 +331,7 @@ void AddresseeEditorWidget::setupTab1() layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); */ /////////////////////////////////////// - QHBox *categoryBox = new QHBox( tab1 ,"cato"); + Q3HBox *categoryBox = new Q3HBox( tab1 ,"cato"); categoryBox->setSpacing( KDialogBase::spacingHint() ); categoryBox->setMargin( KDialogBase::marginHintSmall() ); @@ -337,7 +341,7 @@ void AddresseeEditorWidget::setupTab1() mCategoryEdit = new QPushButton ( categoryBox ); mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); - mCatPopup = new QPopupMenu ( categoryBox ); + mCatPopup = new Q3PopupMenu ( categoryBox ); mCategoryEdit->setPopup( mCatPopup ); connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); @@ -411,7 +415,7 @@ void AddresseeEditorWidget::setupTab1_1() QWidget *tab1_1 = new QWidget( mTabWidget ); //US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); - QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); + Q3GridLayout *layout = new Q3GridLayout( tab1_1, 7, 2 ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); @@ -612,7 +616,7 @@ void AddresseeEditorWidget::setupTab2() // This is the Details tab QWidget *tab2 = new QWidget( mTabWidget ); - QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); + Q3GridLayout *layout = new Q3GridLayout( tab2, 8, 3 ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); @@ -691,7 +695,7 @@ void AddresseeEditorWidget::setupTab2() int iii = 6; if ( QApplication::desktop()->width() == 640 ) { - QHBox * nbox = new QHBox ( tab2 ); + Q3HBox * nbox = new Q3HBox ( tab2 ); label = new QLabel( i18n( "Nick name:" )+" ", nbox ); mNicknameEdit = new KLineEdit( nbox ); connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), @@ -735,7 +739,7 @@ void AddresseeEditorWidget::setupTab2() layout->addWidget( mChildEdit, iii, 2 ); ++iii; if ( QApplication::desktop()->width() == 640 ) { - QHBox * nbox = new QHBox ( tab2 ); + Q3HBox * nbox = new Q3HBox ( tab2 ); label = new QLabel( i18n( "Birthday:" )+" ", nbox ); mBirthdayPicker = new KDateEdit( nbox ); //mBirthdayPicker->toggleDateFormat(); @@ -804,7 +808,7 @@ void AddresseeEditorWidget::setupTab2_1() // This is the Details tab QWidget *tab2_2 = new QWidget( mTabWidget ); - QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); + Q3GridLayout *layout = new Q3GridLayout( tab2_2, 1, 2 ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); @@ -926,12 +930,12 @@ void AddresseeEditorWidget::setupTab2_1() //US layout->addWidget( label, 7, 0 ); layout->addWidget( label, 0, 0 ); #ifndef KAB_EMBEDDED - mNoteEdit = new QTextEdit( tab2_2 ); - mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); + mNoteEdit = new Q3TextEdit( tab2_2 ); + mNoteEdit->setWordWrap( Q3TextEdit::WidgetWidth ); mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); #else //KAB_EMBEDDED - mNoteEdit = new QMultiLineEdit( tab2_2 ); - mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); + mNoteEdit = new Q3MultiLineEdit( tab2_2 ); + mNoteEdit->setWordWrap( Q3MultiLineEdit::WidgetWidth ); mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); #endif //KAB_EMBEDDED @@ -953,7 +957,7 @@ void AddresseeEditorWidget::setupTab3() // This is the Misc tab QWidget *tab3 = new QWidget( mTabWidget ); - QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); + Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); //US layout->setColStretch( 2, 1 ); @@ -1005,7 +1009,7 @@ void AddresseeEditorWidget::setupTab3_1() QWidget *tab3 = new QWidget( mTabWidget ); //US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); - QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); + Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 ); layout->setMargin( KDialogBase::marginHint() ); layout->setSpacing( KDialogBase::spacingHint() ); //US layout->setColStretch( 2, 1 ); @@ -1430,6 +1434,6 @@ QString AddresseeEditorWidget::identifier() const return i18n( "contact_editor" ); } -#ifndef KAB_EMBEDDED -#include "addresseeeditorwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_addresseeeditorwidget.cpp" #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 @@ -25,7 +25,7 @@ #define ADDRESSEEEDITORWIDGET_H #include <qdatetime.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qcombobox.h> #include <kabc/addressee.h> @@ -40,9 +40,9 @@ class QSpinBox; class QTabWidget; #ifndef KAB_EMBEDDED -class QTextEdit; +class Q3TextEdit; #else //KAB_EMBEDDED -class QMultiLineEdit; +class Q3MultiLineEdit; #endif //KAB_EMBEDDED class KComboBox; @@ -155,7 +155,7 @@ class AddresseeEditorWidget : public ExtensionWidget KLineEdit *mURLEdit; KLineEdit *mIMAddressEdit; QPushButton *mCategoryEdit; - QPopupMenu *mCatPopup; + Q3PopupMenu *mCatPopup; SecrecyWidget *mSecrecyWidget; KSqueezedTextLabel *mNameLabel; @@ -172,9 +172,9 @@ class AddresseeEditorWidget : public ExtensionWidget KDateEdit *mBirthdayPicker; KDateEdit *mAnniversaryPicker; #ifndef KAB_EMBEDDED - QTextEdit *mNoteEdit; + Q3TextEdit *mNoteEdit; #else //KAB_EMBEDDED - QMultiLineEdit *mNoteEdit; + Q3MultiLineEdit *mNoteEdit; #endif //KAB_EMBEDDED QSpinBox *mTimeZoneSpin; diff --git a/kaddressbook/addresseeutil.cpp b/kaddressbook/addresseeutil.cpp index 366384a..a860f6d 100644 --- a/kaddressbook/addresseeutil.cpp +++ b/kaddressbook/addresseeutil.cpp @@ -46,7 +46,7 @@ QString AddresseeUtil::addresseesToClipboard( const KABC::Addressee::List &list KABC::Addressee::List AddresseeUtil::clipboardToAddressees( const QString &data ) { - uint numVCards = data.contains( "BEGIN:VCARD", false ); + uint numVCards = data.count( "BEGIN:VCARD", Qt::CaseInsensitive ); QStringList dataList = QStringList::split( "\r\n\r\n", data ); KABC::Addressee::List addrList; diff --git a/kaddressbook/addviewdialog.cpp b/kaddressbook/addviewdialog.cpp index 6def26b..b52a83c 100644 --- a/kaddressbook/addviewdialog.cpp +++ b/kaddressbook/addviewdialog.cpp @@ -25,17 +25,19 @@ #endif //KAB_EMBEDDED #include <qradiobutton.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qlabel.h> #include <qlineedit.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3GridLayout> #include <klocale.h> #include <kglobal.h> #include "kaddressbookview.h" #include "addviewdialog.h" -AddViewDialog::AddViewDialog( QDict<ViewFactory> *viewFactoryDict, +AddViewDialog::AddViewDialog( Q3Dict<ViewFactory> *viewFactoryDict, QWidget *parent, const char *name ) : KDialogBase( KDialogBase::Plain, i18n( "Add View" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, @@ -48,7 +50,7 @@ AddViewDialog::AddViewDialog( QDict<ViewFactory> *viewFactoryDict, QWidget *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 2, 2 ); + Q3GridLayout *layout = new Q3GridLayout( page, 2, 2 ); layout->setSpacing( spacingHint() ); layout->setRowStretch( 1, 1 ); layout->setColStretch( 1, 1 ); @@ -61,12 +63,12 @@ AddViewDialog::AddViewDialog( QDict<ViewFactory> *viewFactoryDict, SLOT( textChanged( const QString& ) ) ); layout->addWidget( mViewNameEdit, 0, 1 ); - mTypeGroup = new QButtonGroup( 2, Qt::Horizontal, i18n( "View Type" ), page ); + mTypeGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "View Type" ), page ); connect( mTypeGroup, SIGNAL( clicked( int ) ), this, SLOT( clicked( int ) ) ); layout->addMultiCellWidget( mTypeGroup, 1, 1, 0, 1 ); // Now create the radio buttons. This needs some layout work. - QDictIterator<ViewFactory> iter( *mViewFactoryDict ); + Q3DictIterator<ViewFactory> iter( *mViewFactoryDict ); for ( iter.toFirst(); iter.current(); ++iter ) { //US i am not quit sure, why I can nopt use (*iter)-> here //US new QRadioButton( (*iter)->type(), mTypeGroup ); @@ -113,6 +115,6 @@ void AddViewDialog::textChanged( const QString &text ) enableButton( KDialogBase::Ok, !text.isEmpty() ); } -#ifndef KAB_EMBEDDED -#include "addviewdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_addviewdialog.cpp" #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 @@ -25,11 +25,11 @@ #define ADDVIEWDIALOG_H #include <kdialogbase.h> -#include <qdict.h> +#include <q3dict.h> #include <qstring.h> class ViewFactory; -class QButtonGroup; +class Q3ButtonGroup; class QLineEdit; @@ -43,7 +43,7 @@ class AddViewDialog : public KDialogBase Q_OBJECT public: - AddViewDialog( QDict<ViewFactory> *viewFactoryDict, QWidget *parent, + AddViewDialog( Q3Dict<ViewFactory> *viewFactoryDict, QWidget *parent, const char *name = 0 ); ~AddViewDialog(); @@ -63,9 +63,9 @@ class AddViewDialog : public KDialogBase void textChanged( const QString &text ); private: - QDict<ViewFactory> *mViewFactoryDict; + Q3Dict<ViewFactory> *mViewFactoryDict; QLineEdit *mViewNameEdit; - QButtonGroup *mTypeGroup; + Q3ButtonGroup *mTypeGroup; int mTypeId; }; 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 @@ -22,10 +22,13 @@ */ #include <qcombobox.h> -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> #include <qlayout.h> -#include <qwidgetstack.h> +#include <q3widgetstack.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> #include <kapplication.h> #include <kdebug.h> @@ -45,13 +48,13 @@ ViewContainer::ViewContainer( QWidget *parent, const char* name ) : QWidget( parent, name ), mCurrentLook( 0 ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); //topLayout->setMargin( KDialog::marginHint() ); //topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( 0 ); topLayout->setSpacing( 0 ); - QBoxLayout *styleLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *styleLayout = new Q3HBoxLayout( topLayout ); QLabel *label = new QLabel( i18n("Style:"), this ); styleLayout->addWidget( label ); @@ -59,12 +62,12 @@ ViewContainer::ViewContainer( QWidget *parent, const char* name ) mStyleCombo = new QComboBox( this ); styleLayout->addWidget( mStyleCombo ); - QFrame *frameRuler = new QFrame( this ); + Q3Frame *frameRuler = new Q3Frame( this ); //US frameRuler->setFrameShape( QFrame::HLine ); //US frameRuler->setFrameShadow( QFrame::Sunken ); //US topLayout->addWidget( frameRuler ); - mDetailsStack = new QWidgetStack( this ); + mDetailsStack = new Q3WidgetStack( this ); topLayout->addWidget( mDetailsStack, 1 ); registerLooks(); @@ -159,6 +162,6 @@ void ViewContainer::setReadOnly( bool state ) mCurrentLook->setReadOnly( state ); } -#ifndef KAB_EMBEDDED -#include "detailsviewcontainer.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_detailsviewcontainer.cpp" #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 @@ -24,12 +24,12 @@ #ifndef DETAILSVIEWCONTAINER_H #define DETAILSVIEWCONTAINER_H -#include <qptrlist.h> +#include <q3ptrlist.h> #include "look_basic.h" class QComboBox; -class QWidgetStack; +class Q3WidgetStack; class ViewContainer : public QWidget { @@ -94,10 +94,10 @@ class ViewContainer : public QWidget private: KABC::Addressee mCurrentAddressee; KABBasicLook *mCurrentLook; - QPtrList<KABLookFactory> mLookFactories; + Q3PtrList<KABLookFactory> mLookFactories; QComboBox *mStyleCombo; - QWidgetStack *mDetailsStack; + Q3WidgetStack *mDetailsStack; }; #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 @@ -26,7 +26,7 @@ #include "look_basic.h" KABBasicLook::KABBasicLook( QWidget *parent, const char *name ) - : QVBox( parent, name ), mReadOnly( false ) + : Q3VBox( parent, name ), mReadOnly( false ) { } @@ -70,6 +70,6 @@ KABLookFactory::KABLookFactory( QWidget *parent, const char *name ) KABLookFactory::~KABLookFactory() { } -#ifndef KAB_EMBEDDED -#include "look_basic.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_look_basic.cpp" #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 @@ -25,7 +25,7 @@ #define LOOK_KABBASIC_H #include <kabc/addressbook.h> -#include <qvbox.h> +#include <q3vbox.h> class KConfig; @@ -41,7 +41,7 @@ class KConfig; The paintEvent() has to paint the whole widget, since repaint() calls will not delete the widgets background. */ -class KABBasicLook : public QVBox +class KABBasicLook : public Q3VBox { Q_OBJECT 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 @@ -189,10 +189,10 @@ void KABDetailedView::mouseMoveEvent( QMouseEvent *e ) void KABDetailedView::mousePressEvent( QMouseEvent *e ) { - QPopupMenu menu( this ); - QPopupMenu *menuBG = new QPopupMenu( &menu ); - mMenuBorderedBG = new QPopupMenu( &menu ); - mMenuTiledBG = new QPopupMenu( &menu ); + Q3PopupMenu menu( this ); + Q3PopupMenu *menuBG = new Q3PopupMenu( &menu ); + mMenuBorderedBG = new Q3PopupMenu( &menu ); + mMenuTiledBG = new Q3PopupMenu( &menu ); menu.insertItem( i18n( "Select Background" ), menuBG ); menuBG->insertItem( i18n( "Bordered Backgrounds" ), mMenuBorderedBG ); @@ -414,6 +414,6 @@ void KABDetailedView::restoreSettings( KConfig *config ) mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); } -#ifndef KAB_EMBEDDED -#include "look_details.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_look_details.cpp" #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 @@ -130,8 +130,8 @@ class KABDetailedView : public KABBasicLook QStringList mBorders; QStringList mTiles; - QPopupMenu *mMenuBorderedBG; - QPopupMenu *mMenuTiledBG; + Q3PopupMenu *mMenuBorderedBG; + Q3PopupMenu *mMenuTiledBG; static const QString mBorderedBGDir; static const QString mTiledBGDir; 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 @@ -24,7 +24,7 @@ #include <addresseeview.h> #include "look_html.h" -#include <qscrollview.h> +#include <q3scrollview.h> #include "kabprefs.h" #include <kabc/addresseeview.h> KABHtmlView::KABHtmlView( QWidget *parent, const char *name ) @@ -51,6 +51,6 @@ void KABHtmlView::setAddressee( const KABC::Addressee &addr ) mView->setAddressee( addr ); } -#ifndef KAB_EMBEDDED -#include "look_html.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_look_html.cpp" #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 @@ -28,7 +28,9 @@ #include <qstring.h> #include <qtoolbutton.h> #include <qtooltip.h> -#include <qlistbox.h> +#include <q3listbox.h> +//Added by qt3to4: +#include <Q3GridLayout> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> @@ -48,14 +50,14 @@ EmailEditWidget::EmailEditWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *topLayout = new QGridLayout( this, 2, 2 ); + Q3GridLayout *topLayout = new Q3GridLayout( this, 2, 2 ); topLayout->setSpacing( KDialog::spacingHint() ); QLabel* label = new QLabel( this ); label->setPixmap( KGlobal::iconLoader()->loadIcon( "mail_send", KIcon::Desktop, 0) ); topLayout->addWidget( label, 0, 0 ); - label->setAlignment( AlignCenter ); + label->setAlignment( Qt::AlignCenter ); QPushButton *editButton = new QPushButton( i18n( "Edit Email Addresses..." ), this); topLayout->addWidget( editButton, 0, 1 ); label = new QLabel( i18n( "Email:" ), this ); @@ -137,7 +139,7 @@ EmailEditDialog::EmailEditDialog( const QStringList &list, QWidget *parent, { QWidget *page = plainPage(); - QGridLayout *topLayout = new QGridLayout( page, 4, 3 ); + Q3GridLayout *topLayout = new Q3GridLayout( page, 4, 3 ); QLabel *label = new QLabel( i18n( "Email address:" ), page ); topLayout->addWidget( label, 0, 0 ); @@ -154,7 +156,7 @@ EmailEditDialog::EmailEditDialog( const QStringList &list, QWidget *parent, connect( mAddButton, SIGNAL( clicked() ), SLOT( add() ) ); topLayout->addWidget( mAddButton, 0, 2 ); - mEmailListBox = new QListBox( page ); + mEmailListBox = new Q3ListBox( page ); // Make sure there is room for the scrollbar mEmailListBox->setMinimumHeight( mEmailListBox->sizeHint().height() + 30 ); @@ -272,6 +274,6 @@ void EmailEditDialog::emailChanged() mAddButton->setEnabled( !mEmailEdit->text().isEmpty() ); } -#ifndef KAB_EMBEDDED -#include "emaileditwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_emaileditwidget.cpp" #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 @@ -29,11 +29,11 @@ #include "addresseeconfig.h" -class QButtonGroup; +class Q3ButtonGroup; class QCheckBox; -class QListView; -class QListBox; -class QTextEdit; +class Q3ListView; +class Q3ListBox; +class Q3TextEdit; class QToolButton; class KComboBox; @@ -89,7 +89,7 @@ class EmailEditDialog : public KDialogBase private: KLineEdit *mEmailEdit; - QListBox *mEmailListBox; + Q3ListBox *mEmailListBox; QPushButton *mAddButton; QPushButton *mRemoveButton; QPushButton *mEditButton; diff --git a/kaddressbook/extensionmanager.cpp b/kaddressbook/extensionmanager.cpp index 46defa1..5356224 100644 --- a/kaddressbook/extensionmanager.cpp +++ b/kaddressbook/extensionmanager.cpp @@ -22,6 +22,8 @@ */ #include <qlayout.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3HBoxLayout> #include <kactionclasses.h> #include <kconfig.h> #include <kdebug.h> @@ -42,7 +44,7 @@ ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent, const char *name ) - : QScrollView( parent, name ), mCore( core ), mCurrentExtensionWidget( 0 ) + : Q3ScrollView( parent, name ), mCore( core ), mCurrentExtensionWidget( 0 ) { #ifdef KAB_EMBEDDED //US QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); @@ -58,7 +60,7 @@ ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent, connect( mActionExtensions, SIGNAL( activated( int ) ), SLOT( setActiveExtension( int ) ) ); mWidgetBox = new QWidget( viewport() ); - new QHBoxLayout (mWidgetBox ); + new Q3HBoxLayout (mWidgetBox ); addChild( mWidgetBox ); setResizePolicy(AutoOneFit); createExtensionWidgets(); @@ -148,7 +150,7 @@ void ExtensionManager::createExtensionWidgets() { // clear extension widget list mExtensionWidgetList.setAutoDelete( true ); - QPtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList ); + Q3PtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList ); ExtensionWidget *wdg = 0; while ( ( wdg = wdgIt.current() ) != 0 ) mExtensionWidgetList.remove( wdg ); @@ -159,7 +161,7 @@ void ExtensionManager::createExtensionWidgets() // add addressee editor as default - QHBoxLayout *hbl = (QHBoxLayout *) mWidgetBox->layout();; + Q3HBoxLayout *hbl = (Q3HBoxLayout *) mWidgetBox->layout();; wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox ); hbl->addWidget( wdg ); @@ -244,6 +246,6 @@ void ExtensionManager::createExtensionWidgets() mCurrentExtensionWidget = 0; } -#ifndef KAB_EMBEDDED -#include "extensionmanager.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_extensionmanager.cpp" #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 @@ -24,9 +24,9 @@ #ifndef EXTENSIONMANAGER_H #define EXTENSIONMANAGER_H -#include <qhbox.h> -#include <qscrollview.h> -#include <qptrlist.h> +#include <q3hbox.h> +#include <q3scrollview.h> +#include <q3ptrlist.h> #include <extensionwidget.h> @@ -34,7 +34,7 @@ class KABCore; class KSelectAction; -class ExtensionManager : public QScrollView +class ExtensionManager : public Q3ScrollView { Q_OBJECT @@ -80,7 +80,7 @@ class ExtensionManager : public QScrollView QWidget *mWidgetBox; ExtensionWidget *mCurrentExtensionWidget; - QPtrList<ExtensionWidget> mExtensionWidgetList; + Q3PtrList<ExtensionWidget> mExtensionWidgetList; KSelectAction *mActionExtensions; diff --git a/kaddressbook/extensionwidget.cpp b/kaddressbook/extensionwidget.cpp index 69f4aa8..7c3b415 100644 --- a/kaddressbook/extensionwidget.cpp +++ b/kaddressbook/extensionwidget.cpp @@ -78,7 +78,6 @@ ConfigureWidget *ExtensionFactory::configureWidget( QWidget*, const char* ) return 0; } -#ifndef KAB_EMBEDDED -#include "extensionwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_extensionwidget.cpp" #endif //KAB_EMBEDDED - diff --git a/kaddressbook/extensionwidget.h b/kaddressbook/extensionwidget.h index fc91f21..9fcfba9 100644 --- a/kaddressbook/extensionwidget.h +++ b/kaddressbook/extensionwidget.h @@ -86,9 +86,9 @@ class ExtensionWidget : public QWidget }; #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN class ExtensionFactory : public KLibFactory -//MOC_SKIP_END +#endif #else //KAB_EMBEDDED class ExtensionFactory #endif //KAB_EMBEDDED 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 @@ -21,13 +21,20 @@ without including the source code for Qt in the source distribution. */ -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qcombobox.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistview.h> +#include <q3listview.h> #include <qpushbutton.h> #include <qradiobutton.h> +//Added by qt3to4: +#include <QDragMoveEvent> +#include <QDropEvent> +#include <Q3GridLayout> +#include <Q3Frame> +#include <Q3VBoxLayout> +#include <QDragEnterEvent> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> @@ -77,12 +84,12 @@ extern "C" { } #endif //KAB_EMBEDDED -class ContactItem : public QListViewItem +class ContactItem : public Q3ListViewItem { public: ContactItem( DistributionListView *parent, const KABC::Addressee &addressee, const QString &email = QString::null ) : - QListViewItem( parent ), + Q3ListViewItem( parent ), mAddressee( addressee ), mEmail( email ) { @@ -121,7 +128,7 @@ DistributionListWidget::DistributionListWidget( KABCore *core, QWidget *parent, const char *name ) : ExtensionWidget( core, parent, name ), mManager( 0 ) { - QGridLayout *topLayout = new QGridLayout( this, 3, 4, KDialog::marginHint(), + Q3GridLayout *topLayout = new Q3GridLayout( this, 3, 4, KDialog::marginHint(), KDialog::spacingHint() ); if (KGlobal::getOrientation() == KGlobal::Portrait) @@ -166,8 +173,8 @@ DistributionListWidget::DistributionListWidget( KABCore *core, QWidget *parent, topLayout->addMultiCellWidget( mContactView, 1, 1, 0, 3 ); connect( mContactView, SIGNAL( selectionChanged() ), SLOT( selectionContactViewChanged() ) ); - connect( mContactView, SIGNAL( dropped( QDropEvent*, QListViewItem* ) ), - SLOT( dropped( QDropEvent*, QListViewItem* ) ) ); + connect( mContactView, SIGNAL( dropped( QDropEvent*, Q3ListViewItem* ) ), + SLOT( dropped( QDropEvent*, Q3ListViewItem* ) ) ); mAddContactButton->setEnabled( false ); topLayout->addWidget( mAddContactButton, 2, 0 ); @@ -410,7 +417,7 @@ QString DistributionListWidget::identifier() const return "distribution_list_editor"; } -void DistributionListWidget::dropped( QDropEvent *e, QListViewItem* ) +void DistributionListWidget::dropped( QDropEvent *e, Q3ListViewItem* ) { dropEvent( e ); } @@ -432,7 +439,7 @@ DistributionListView::DistributionListView( QWidget *parent, const char* name ) void DistributionListView::dragEnterEvent( QDragEnterEvent* e ) { #ifndef KAB_EMBEDDED - bool canDecode = QTextDrag::canDecode( e ); + bool canDecode = Q3TextDrag::canDecode( e ); e->accept( canDecode ); #endif //KAB_EMBEDDED } @@ -440,7 +447,7 @@ void DistributionListView::dragEnterEvent( QDragEnterEvent* e ) void DistributionListView::viewportDragMoveEvent( QDragMoveEvent *e ) { #ifndef KAB_EMBEDDED - bool canDecode = QTextDrag::canDecode( e ); + bool canDecode = Q3TextDrag::canDecode( e ); e->accept( canDecode ); #endif //KAB_EMBEDDED } @@ -461,10 +468,10 @@ EmailSelector::EmailSelector( const QStringList &emails, : KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, parent ) { - QFrame *topFrame = plainPage(); - QBoxLayout *topLayout = new QVBoxLayout( topFrame ); + Q3Frame *topFrame = plainPage(); + Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); - mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), + mButtonGroup = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"), topFrame ); topLayout->addWidget( mButtonGroup ); @@ -479,7 +486,7 @@ EmailSelector::EmailSelector( const QStringList &emails, QString EmailSelector::selected() { - QButton *button = mButtonGroup->selected(); + QAbstractButton *button = mButtonGroup->selected(); if ( button ) return button->text(); @@ -496,6 +503,6 @@ QString EmailSelector::getEmail( const QStringList &emails, } -#ifndef KAB_EMBEDDED -#include "distributionlistwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_distributionlistwidget.cpp" #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 @@ -28,11 +28,16 @@ #include <klistview.h> #include "extensionwidget.h" +//Added by qt3to4: +#include <QDragEnterEvent> +#include <QDropEvent> +#include <QLabel> +#include <QDragMoveEvent> -class QButtonGroup; +class Q3ButtonGroup; class QComboBox; class QLabel; -class QListView; +class Q3ListView; class DistributionListView; class KABCore; @@ -57,7 +62,7 @@ class DistributionListWidget : public ExtensionWidget public slots: void save(); - void dropped( QDropEvent*, QListViewItem* ); + void dropped( QDropEvent*, Q3ListViewItem* ); private slots: void createList(); @@ -120,7 +125,7 @@ class EmailSelector : public KDialogBase QWidget *parent ); private: - QButtonGroup *mButtonGroup; + Q3ButtonGroup *mButtonGroup; }; 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 @@ -23,6 +23,8 @@ #include <qlayout.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3GridLayout> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> @@ -63,11 +65,11 @@ extern "C" { } #endif //KAB_EMBEDDED -class ContactItem : public QListViewItem +class ContactItem : public Q3ListViewItem { public: ContactItem( KListView *parent, const KABC::Addressee &addressee ) - : QListViewItem( parent ), mAddressee( addressee ) + : Q3ListViewItem( parent ), mAddressee( addressee ) { KABC::Field::List fieldList = KABC::Field::defaultFields(); KABC::Field::List::ConstIterator it; @@ -94,7 +96,7 @@ MergeWidget::MergeWidget( KABCore *core, QWidget *parent, const char *name ) parent->setMaximumSize( KGlobal::getDesktopWidth() , 180); #endif //KAB_EMBEDDED - QGridLayout *topLayout = new QGridLayout( this, 3, 2, KDialog::marginHint(), + Q3GridLayout *topLayout = new Q3GridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() ); mContactView = new KListView( this ); @@ -214,7 +216,7 @@ void MergeWidget::mergeAndRemove() emit modified( retval ); mBlockUpdate = true; - core()->deleteContacts( oldUID ); + core()->deleteContacts( QStringList(oldUID) ); core()->setContactSelected( mMasterAddressee.uid() ); mBlockUpdate = false; @@ -369,6 +371,6 @@ void MergeWidget::doMerge( const KABC::Addressee &addr ) mMasterAddressee.setCustoms( newCustoms ); } -#ifndef KAB_EMBEDDED -#include "mergewidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_mergewidget.cpp" #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 @@ -29,7 +29,7 @@ #include "extensionwidget.h" -class QListView; +class Q3ListView; class KABCore; diff --git a/kaddressbook/filter.cpp b/kaddressbook/filter.cpp index 12ab1e3..6462310 100644 --- a/kaddressbook/filter.cpp +++ b/kaddressbook/filter.cpp @@ -218,7 +218,7 @@ Filter::List Filter::restore( KConfig *config, QString baseGroup ) filter.noName = false; filter.mName = *it; filter.mEnabled = true; - filter.mCategoryList = *it; + filter.mCategoryList = QStringList(*it); filter.mMatchRule = Matching; filter.mInternal = true; list.append( filter ); diff --git a/kaddressbook/filter.h b/kaddressbook/filter.h index f4ae123..508436d 100644 --- a/kaddressbook/filter.h +++ b/kaddressbook/filter.h @@ -26,7 +26,7 @@ #include <qstring.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include <kabc/addressee.h> #include <kconfig.h> @@ -42,7 +42,7 @@ class Filter enum { ShowPublic = 1, ShowPrivate = 2, ShowConfidential = 4 }; void setCriteria(int c) { mCriteria = c ;} int criteria() const { return mCriteria;} - typedef QValueList<Filter> List; + typedef Q3ValueList<Filter> List; enum MatchRule { Matching = 0, NotMatching = 1 }; diff --git a/kaddressbook/filtereditdialog.cpp b/kaddressbook/filtereditdialog.cpp index ef9b979..40698a7 100644 --- a/kaddressbook/filtereditdialog.cpp +++ b/kaddressbook/filtereditdialog.cpp @@ -28,8 +28,8 @@ Copyright (c) 2004 Ulf Schenk $Id$ */ -#include <qbuttongroup.h> -#include <qhbox.h> +#include <q3buttongroup.h> +#include <q3hbox.h> #include <qlabel.h> #include <qlayout.h> #include <qpushbutton.h> @@ -40,6 +40,8 @@ $Id$ #include <qtoolbutton.h> #include <qtooltip.h> #include <qwidget.h> +//Added by qt3to4: +#include <Q3GridLayout> #include <kapplication.h> #include <kbuttonbox.h> @@ -64,7 +66,7 @@ FilterEditDialog::FilterEditDialog( QWidget *parent, const char *name ) QStringList::Iterator iter; for ( iter = cats.begin(); iter != cats.end(); ++iter ) - mCategoriesView->insertItem( new QCheckListItem( mCategoriesView, (*iter), QCheckListItem::CheckBox ) ); + mCategoriesView->insertItem( new Q3CheckListItem( mCategoriesView, (*iter), Q3CheckListItem::CheckBox ) ); filterNameTextChanged( mNameEdit->text() ); } @@ -77,10 +79,10 @@ void FilterEditDialog::setFilter( const Filter &filter ) mNameEdit->setText( filter.name() ); QStringList categories = filter.categories(); - QListViewItem *item = mCategoriesView->firstChild(); + Q3ListViewItem *item = mCategoriesView->firstChild(); while ( item != 0 ) { if ( categories.contains( item->text( 0 ) ) ) { - QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); + Q3CheckListItem *checkItem = static_cast<Q3CheckListItem*>( item ); checkItem->setOn( true ); } @@ -105,9 +107,9 @@ Filter FilterEditDialog::filter() filter.setName( mNameEdit->text() ); QStringList categories; - QListViewItem *item = mCategoriesView->firstChild(); + Q3ListViewItem *item = mCategoriesView->firstChild(); while ( item != 0 ) { - QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); + Q3CheckListItem *checkItem = static_cast<Q3CheckListItem*>( item ); if ( checkItem->isOn() ) categories.append( item->text( 0 ) ); @@ -141,7 +143,7 @@ void FilterEditDialog::initGUI() QWidget *page = plainPage(); QLabel *label; - QGridLayout *topLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); + Q3GridLayout *topLayout = new Q3GridLayout( page, 3, 2, 0, spacingHint() ); label = new QLabel( i18n( "Name" ), page ); mNameEdit = new KLineEdit( page ); @@ -155,7 +157,7 @@ void FilterEditDialog::initGUI() mCategoriesView->addColumn( i18n( "Categories" ) ); topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 ); - mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page ); + mMatchRuleGroup = new Q3HButtonGroup( i18n( "Category rule" ), page ); mMatchRuleGroup->setExclusive( true ); QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); //mMatchRuleGroup->insert( radio ); @@ -164,7 +166,7 @@ void FilterEditDialog::initGUI() //mMatchRuleGroup->insert( radio ); topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); - QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page ); + Q3HButtonGroup * mMatchPPCGroup = new Q3HButtonGroup(i18n( "Include contacts, that are:" ), page ); mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); @@ -272,7 +274,7 @@ void FilterDialog::refresh() mFilterListBox->insertItem( (*iter).name() ); } -void FilterDialog::selectionChanged( QListBoxItem *item ) +void FilterDialog::selectionChanged( Q3ListBoxItem *item ) { bool state = ( item != 0 ); @@ -290,16 +292,16 @@ void FilterDialog::initGUI() QWidget *page = plainPage(); - QGridLayout *topLayout = new QGridLayout( page, 1, 2, 0, spacingHint() ); + Q3GridLayout *topLayout = new Q3GridLayout( page, 1, 2, 0, spacingHint() ); mFilterListBox = new KListBox( page ); topLayout->addWidget( mFilterListBox, 0, 0 ); - connect( mFilterListBox, SIGNAL( selectionChanged( QListBoxItem * ) ), - SLOT( selectionChanged( QListBoxItem * ) ) ); - connect( mFilterListBox, SIGNAL( doubleClicked ( QListBoxItem * ) ), + connect( mFilterListBox, SIGNAL( selectionChanged( Q3ListBoxItem * ) ), + SLOT( selectionChanged( Q3ListBoxItem * ) ) ); + connect( mFilterListBox, SIGNAL( doubleClicked ( Q3ListBoxItem * ) ), SLOT( edit() ) ); - KButtonBox *buttonBox = new KButtonBox( page, Vertical ); + KButtonBox *buttonBox = new KButtonBox( page, Qt::Vertical ); buttonBox->addButton( i18n( "&Add..." ), this, SLOT( add() ) ); mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( edit() ) ); mEditButton->setEnabled( false ); @@ -310,6 +312,6 @@ void FilterDialog::initGUI() topLayout->addWidget( buttonBox, 0, 1 ); } -#ifndef KAB_EMBEDDED -#include "filtereditdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_filtereditdialog.cpp" #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 @@ -31,11 +31,11 @@ $Id$ #ifndef FILTEREDITDIALOG_H #define FILTEREDITDIALOG_H -class QButtonGroup; +#include <Q3HButtonGroup> class QString; class QToolButton; class QWidget; -class QListBoxItem; +class Q3ListBoxItem; class QCheckBox; class KLineEdit; @@ -43,7 +43,6 @@ class KListBox; class KListView; #include <kdialogbase.h> -#include <qhbuttongroup.h> #include "filter.h" @@ -62,7 +61,7 @@ class FilterDialog : public KDialogBase void add(); void edit(); void remove(); - void selectionChanged( QListBoxItem* ); + void selectionChanged( Q3ListBoxItem* ); private: void initGUI(); @@ -98,7 +97,7 @@ class FilterEditDialog : public KDialogBase KLineEdit *mNameEdit; KListView *mCategoriesView; - QHButtonGroup *mMatchRuleGroup; + Q3HButtonGroup *mMatchRuleGroup; QCheckBox *mPrivate; QCheckBox *mPublic; QCheckBox *mConfidential; diff --git a/kaddressbook/geowidget.cpp b/kaddressbook/geowidget.cpp index 13cd084..caff3b2 100644 --- a/kaddressbook/geowidget.cpp +++ b/kaddressbook/geowidget.cpp @@ -27,10 +27,17 @@ #include <kaccelmanager.h> #else //KAB_EMBEDDED -#include <qtextstream.h> +#include <q3textstream.h> +//Added by qt3to4: +#include <QPaintEvent> +#include <Q3GridLayout> +#include <Q3Frame> +#include <QMouseEvent> #include <kglobal.h> #endif //KAB_EMBEDDED +#include <QDesktopWidget> + #include <knuminput.h> #include <kcombobox.h> #include <kdebug.h> @@ -41,10 +48,10 @@ #include <qcheckbox.h> #include <qfile.h> #include <qapplication.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qpainter.h> #include <qpixmap.h> #include <qpushbutton.h> @@ -59,7 +66,7 @@ GeoWidget::GeoWidget( QWidget *parent, const char *name ) { QLabel *label = 0; - QGridLayout *topLayout = new QGridLayout( this, 4, 3 ); + Q3GridLayout *topLayout = new Q3GridLayout( this, 4, 3 ); topLayout->setMargin( KDialog::marginHint() ); topLayout->setSpacing( KDialog::spacingHint() ); @@ -69,7 +76,7 @@ GeoWidget::GeoWidget( QWidget *parent, const char *name ) label->setPixmap( KGlobal::iconLoader()->loadIcon( "package_network", KIcon::Desktop, 0 ) ); label->setAlignment( Qt::AlignTop ); topLayout->addMultiCellWidget( label, 0, 3, 0, 0 ); - label->setAlignment( AlignCenter ); + label->setAlignment( Qt::AlignCenter ); mGeoIsValid = new QCheckBox( i18n( "Use geo data" ), this ); topLayout->addMultiCellWidget( mGeoIsValid, 0, 0, 1, 2 ); @@ -167,16 +174,16 @@ GeoDialog::GeoDialog( QWidget *parent, const char *name ) parent, name, true, true ), mUpdateSexagesimalInput( true ) { - QFrame *page = plainPage(); + Q3Frame *page = plainPage(); - QGridLayout *topLayout = new QGridLayout( page, 1, 1, marginHintSmall(), + Q3GridLayout *topLayout = new Q3GridLayout( page, 1, 1, marginHintSmall(), spacingHint() ); //topLayout->setRowStretch( 1, 1 ); mMapWidget = new GeoMapWidget( page ); mCityCombo = new KComboBox( page ); - QGroupBox *sexagesimalGroup = new QGroupBox( 0, Vertical, i18n( "Sexagesimal" ), page ); - QGridLayout *sexagesimalLayout = new QGridLayout( sexagesimalGroup->layout(), + Q3GroupBox *sexagesimalGroup = new Q3GroupBox( 0, Qt::Vertical, i18n( "Sexagesimal" ), page ); + Q3GridLayout *sexagesimalLayout = new Q3GridLayout( sexagesimalGroup->layout(), 2, 5, spacingHint() ); QLabel *label; if ( QApplication::desktop()->width() < 320 ) { @@ -429,8 +436,8 @@ void GeoDialog::loadCityList() QFile file( fileName); - if ( file.open( IO_ReadOnly ) ) { - QTextStream s( &file ); + if ( file.open( QIODevice::ReadOnly ) ) { + Q3TextStream s( &file ); QString line, country; QRegExp coord( "[+-]\\d+[+-]\\d+" ); @@ -552,7 +559,7 @@ int GeoDialog::nearestCity( double x, double y ) GeoMapWidget::GeoMapWidget( QWidget *parent, const char *name ) : QWidget( parent, name ), mLatitude( 0 ), mLongitude( 0 ) { - setBackgroundMode( NoBackground ); + setBackgroundMode( Qt::NoBackground ); setFixedSize( 240, 120 ); @@ -624,6 +631,6 @@ void GeoMapWidget::paintEvent( QPaintEvent* ) bitBlt( this, 0, 0, &world ); } -#ifndef KAB_EMBEDDED -#include "geowidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_geowidget.cpp" #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 @@ -27,6 +27,10 @@ #include <qmap.h> #include <qwidget.h> +//Added by qt3to4: +#include <QLabel> +#include <QMouseEvent> +#include <QPaintEvent> #include <kdialogbase.h> namespace KABC { diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp index eec5e08..6ecf66d 100644 --- a/kaddressbook/imagewidget.cpp +++ b/kaddressbook/imagewidget.cpp @@ -37,23 +37,27 @@ #include <kurl.h> #include <qcheckbox.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlabel.h> #include <qlayout.h> #include <qpixmap.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> #include "imagewidget.h" ImageWidget::ImageWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *topLayout = new QGridLayout( this, 2, 1, KDialog::marginHint(), + Q3GridLayout *topLayout = new Q3GridLayout( this, 2, 1, KDialog::marginHint(), KDialog::spacingHint() ); - QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); - QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 3, 2, + Q3GroupBox *photoBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); + Q3GridLayout *boxLayout = new Q3GridLayout( photoBox->layout(), 3, 2, KDialog::spacingHint() ); boxLayout->setRowStretch( 2, 1 ); @@ -63,7 +67,7 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) fac = 6; mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac ); mPhotoLabel->setScaledContents( true ); - mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + mPhotoLabel->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken ); boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 ); mPhotoUrl = new KURLRequester( photoBox ); @@ -75,7 +79,7 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) boxLayout->addWidget( mPhotoUrl, 0, 1 ); - QHBox *hb1 = new QHBox ( photoBox ); + Q3HBox *hb1 = new Q3HBox ( photoBox ); mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), hb1 ); mUsePhotoUrl->setEnabled( false ); boxLayout->addWidget( hb1, 1, 1 ); @@ -86,14 +90,14 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) topLayout->addWidget( photoBox, 0, 0 ); - QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); - boxLayout = new QGridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() ); + Q3GroupBox *logoBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); + boxLayout = new Q3GridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() ); boxLayout->setRowStretch( 2, 1 ); mLogoLabel = new QLabel( logoBox ); mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac ); mLogoLabel->setScaledContents( true ); - mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + mLogoLabel->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken ); boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 ); mLogoUrl = new KURLRequester( logoBox ); @@ -104,7 +108,7 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) #endif //KAB_EMBEDDED boxLayout->addWidget( mLogoUrl, 0, 1 ); - QHBox *hb2 = new QHBox ( logoBox ); + Q3HBox *hb2 = new Q3HBox ( logoBox ); mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), hb2 ); mUseLogoUrl->setEnabled( false ); boxLayout->addWidget( hb2, 1, 1 ); @@ -180,7 +184,7 @@ KABC::Picture ImageWidget::photo() const if ( mUsePhotoUrl->isChecked() ) photo.setUrl( mPhotoUrl->url() ); else { - QPixmap *px = mPhotoLabel->pixmap(); + const QPixmap *px = mPhotoLabel->pixmap(); if ( px ) { #ifndef KAB_EMBEDDED if ( px->height() > px->width() ) @@ -232,7 +236,7 @@ KABC::Picture ImageWidget::logo() const if ( mUseLogoUrl->isChecked() ) logo.setUrl( mLogoUrl->url() ); else { - QPixmap *px = mLogoLabel->pixmap(); + const QPixmap *px = mLogoLabel->pixmap(); if ( px ) { #ifndef KAB_EMBEDDED if ( px->height() > px->width() ) @@ -292,6 +296,6 @@ QPixmap ImageWidget::loadPixmap( const QString &url ) return pixmap; } -#ifndef KAB_EMBEDDED -#include "imagewidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_imagewidget.cpp" #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 @@ -25,6 +25,9 @@ #define IMAGEWIDGET_H #include <qwidget.h> +//Added by qt3to4: +#include <QPixmap> +#include <QLabel> #include <kabc/picture.h> #include <kdialogbase.h> diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp index 5f8b83d..a54d1cd 100644 --- a/kaddressbook/incsearchwidget.cpp +++ b/kaddressbook/incsearchwidget.cpp @@ -25,7 +25,10 @@ #include <qlayout.h> #include <qtooltip.h> #include <qapplication.h> +#include <QDesktopWidget> #include <qcombobox.h> +//Added by qt3to4: +#include <Q3HBoxLayout> #include <kdialog.h> #include <klineedit.h> @@ -37,17 +40,18 @@ #include "incsearchwidget.h" IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) - : QWidget( parent, name ) { + setObjectName(name); + setParent(parent); #ifndef KAB_EMBEDDED //US setCaption( i18n( "Incremental Search" ) ); #endif //KAB_EMBEDDED - QHBoxLayout *layout = new QHBoxLayout( this, 2, KDialog::spacingHint() ); + Q3HBoxLayout *layout = new Q3HBoxLayout( this, 2, KDialog::spacingHint() ); #ifdef DESKTOP_VERSION QLabel *label = new QLabel( i18n( "Search:" ), this ); - label->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight ); + label->setAlignment( Qt::AlignVCenter | Qt::AlignRight ); layout->addWidget( label ); #endif //KAB_EMBEDDED @@ -176,6 +180,6 @@ int IncSearchWidget::currentItem() const return mFieldCombo->currentItem(); } -#ifndef KAB_EMBEDDED -#include "incsearchwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_incsearchwidget.cpp" #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 @@ -25,8 +25,11 @@ #include <qlayout.h> #include <qpushbutton.h> #include <qstring.h> -#include <qtl.h> +#include <q3tl.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3GridLayout> #include <kabc/addressbook.h> #include <kabc/field.h> @@ -73,9 +76,9 @@ JumpButtonBar::JumpButtonBar( KABCore *core, QWidget *parent, const char *name ) { if ( QApplication::desktop()->width() < 480 ) - mButtonLayout = new QGridLayout( this, 1, 18 ); + mButtonLayout = new Q3GridLayout( this, 1, 18 ); else - mButtonLayout = new QGridLayout( this, 1, 20 ); + mButtonLayout = new Q3GridLayout( this, 1, 20 ); mButtonLayout->setAlignment( Qt::AlignTop ); recreateButtons(); @@ -252,6 +255,6 @@ void JumpButtonBar::sortListLocaleAware( QStringList &list ) } } -#ifndef KAB_EMBEDDED -#include "jumpbuttonbar.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_jumpbuttonbar.cpp" #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 @@ -26,11 +26,14 @@ #include <qsizepolicy.h> #include <qwidget.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qstringlist.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <Q3GridLayout> class QChar; -class QGridLayout; +class Q3GridLayout; class QResizeEvent; class QPushButton; class JumpButton; @@ -76,9 +79,9 @@ class JumpButtonBar : public QWidget KABCore *mCore; - QGridLayout *mButtonLayout; + Q3GridLayout *mButtonLayout; QStringList mCharacters; - QPtrList<JumpButton> mButtons; + Q3PtrList<JumpButton> mButtons; }; #endif diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index ab2824c..03b44d1 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -39,7 +39,17 @@ $Id$ #include <qlineedit.h> #include <qcheckbox.h> #include <qpushbutton.h> -#include <qprogressbar.h> +#include <q3progressbar.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QResizeEvent> +#include <QPixmap> +#include <Q3ValueList> +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> +#include <Q3CString> +#include <Q3PopupMenu> +#include <Q3PtrList> #include <libkdepim/phoneaccess.h> #ifndef KAB_EMBEDDED @@ -47,10 +57,10 @@ $Id$ #include <qdir.h> #include <qfile.h> #include <qapplicaton.h> -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qlayout.h> #include <qregexp.h> -#include <qvbox.h> +#include <q3vbox.h> #include <kabc/addresseelist.h> #include <kabc/errorhandler.h> #include <kabc/resource.h> @@ -88,7 +98,7 @@ $Id$ //US #include <addresseeview.h> -#include <qapp.h> +#include <qapplication.h> #include <qmenubar.h> //#include <qtoolbar.h> #include <qmessagebox.h> @@ -129,12 +139,12 @@ $Id$ #include <qmap.h> #include <qdir.h> #include <qfile.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qlayout.h> #include <qclipboard.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qradiobutton.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <libkdepim/categoryselectdialog.h> #include <libkdepim/categoryeditdialog.h> @@ -175,12 +185,12 @@ class KABCatPrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Manage new Categories") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); lay->addWidget( lab ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("New categories not in list:"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; addCatBut = new QRadioButton(i18n("Add to category list"), format ); @@ -207,12 +217,12 @@ class KABFormatPrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Set formatted name") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); lay->addWidget( lab ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Set formatted name to:"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; simple = new QRadioButton(i18n("Simple: James Bond"), format ); @@ -245,29 +255,29 @@ class KAex2phonePrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Export to phone options") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel *lab; lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); - lab->setAlignment (AlignHCenter ); - QHBox* temphb; - temphb = new QHBox( this ); + lab->setAlignment (Qt::AlignHCenter ); + Q3HBox* temphb; + temphb = new Q3HBox( this ); new QLabel( i18n("I/O device: "), temphb ); mPhoneDevice = new QLineEdit( temphb); lay->addWidget( temphb ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Connection: "), temphb ); mPhoneConnection = new QLineEdit( temphb); lay->addWidget( temphb ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Model(opt.): "), temphb ); mPhoneModel = new QLineEdit( temphb); lay->addWidget( temphb ); // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); // lay->addWidget( mWriteToSim ); lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); - lab->setAlignment (AlignHCenter); + lab->setAlignment (Qt::AlignHCenter); QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); lay->addWidget( ok ); QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); @@ -407,7 +417,7 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const //QTimer::singleShot( 10, this , SLOT ( updateToolBar())); QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() )); } -void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data ) +void KABCore::receiveStart( const Q3CString& cmsg, const QByteArray& data ) { //qDebug("KO: QCOP start message received: %s ", cmsg.data() ); mCStringMess = cmsg; @@ -421,9 +431,9 @@ void KABCore::loadDataAfterStart() mViewManager->refreshView(); #ifndef DESKTOP_VERSION - disconnect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT (receiveStart ( const QCString &, const QByteArray & ))); + disconnect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT (receiveStart ( const Q3CString &, const QByteArray & ))); - QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); + QObject::connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & ))); if ( !mCStringMess.isEmpty() ) ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData ); #endif @@ -453,11 +463,11 @@ KABCore::~KABCore() delete infrared; #endif } -void KABCore::receive( const QCString& cmsg, const QByteArray& data ) +void KABCore::receive( const Q3CString& cmsg, const QByteArray& data ) { //qDebug("KA: QCOP message received: %s ", cmsg.data() ); if ( cmsg == "setDocument(QString)" ) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); QString fileName; stream >> fileName; recieve( fileName ); @@ -480,7 +490,7 @@ void KABCore::toggleBeamReceive( ) mActionBR->setChecked(true); infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; - QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); + QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(receive( const Q3CString&, const QByteArray& ))); #endif } @@ -560,7 +570,7 @@ void KABCore::restoreSettings() if ( wid < 640 ) wid = QApplication::desktop()->height(); #endif - QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; + Q3ValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; if ( true /*splitterSize.count() == 0*/ ) { splitterSize.append( wid / 2 ); splitterSize.append( wid / 2 ); @@ -650,10 +660,10 @@ QStringList KABCore::selectedUIDs() const KABC::Resource *KABCore::requestResource( QWidget *parent ) { - QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); + Q3PtrList<KABC::Resource> kabcResources = addressBook()->resources(); - QPtrList<KRES::Resource> kresResources; - QPtrListIterator<KABC::Resource> resIt( kabcResources ); + Q3PtrList<KRES::Resource> kresResources; + Q3PtrListIterator<KABC::Resource> resIt( kabcResources ); KABC::Resource *resource; while ( ( resource = resIt.current() ) != 0 ) { ++resIt; @@ -795,14 +805,14 @@ void KABCore::mailVCard( const QStringList& uids ) QFile outFile(fileName); - if ( outFile.open(IO_WriteOnly) ) { // file opened successfully + if ( outFile.open(QIODevice::WriteOnly) ) { // file opened successfully KABC::VCardConverter converter; QString vcard; converter.addresseeToVCard( a, vcard ); - QTextStream t( &outFile ); // use a text stream - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( &outFile ); // use a text stream + t.setEncoding( Q3TextStream::UnicodeUTF8 ); t << vcard; outFile.close(); @@ -1016,11 +1026,11 @@ void KABCore::beamVCard(const QStringList& uids) } #ifndef DESKTOP_VERSION QFile outFile(fileName); - if ( outFile.open(IO_WriteOnly) ) { + if ( outFile.open(QIODevice::WriteOnly) ) { datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); - QTextStream t( &outFile ); // use a text stream + Q3TextStream t( &outFile ); // use a text stream //t.setEncoding( QTextStream::UnicodeUTF8 ); - t.setEncoding( QTextStream::Latin1 ); + t.setEncoding( Q3TextStream::Latin1 ); t <<datastream.latin1(); outFile.close(); Ir *ir = new Ir( this ); @@ -1297,10 +1307,10 @@ void KABCore::newContact() { - QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); + Q3PtrList<KABC::Resource> kabcResources = mAddressBook->resources(); - QPtrList<KRES::Resource> kresResources; - QPtrListIterator<KABC::Resource> it( kabcResources ); + Q3PtrList<KRES::Resource> kresResources; + Q3PtrListIterator<KABC::Resource> it( kabcResources ); KABC::Resource *resource; while ( ( resource = it.current() ) != 0 ) { ++it; @@ -1856,7 +1866,7 @@ void KABCore::slotEditorDestroyed( const QString &uid ) void KABCore::initGUI() { #ifndef KAB_EMBEDDED - QHBoxLayout *topLayout = new QHBoxLayout( this ); + Q3HBoxLayout *topLayout = new Q3HBoxLayout( this ); topLayout->setSpacing( KDialogBase::spacingHint() ); mExtensionBarSplitter = new QSplitter( this ); @@ -1864,7 +1874,7 @@ void KABCore::initGUI() mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); - QVBox *viewSpace = new QVBox( mDetailsSplitter ); + Q3VBox *viewSpace = new Q3VBox( mDetailsSplitter ); mIncSearchWidget = new IncSearchWidget( viewSpace ); connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), SLOT( incrementalSearch( const QString& ) ) ); @@ -1888,19 +1898,19 @@ void KABCore::initGUI() #else //KAB_EMBEDDED //US initialize viewMenu before settingup viewmanager. // Viewmanager needs this menu to plugin submenues. - viewMenu = new QPopupMenu( this ); - settingsMenu = new QPopupMenu( this ); + viewMenu = new Q3PopupMenu( this ); + settingsMenu = new Q3PopupMenu( this ); //filterMenu = new QPopupMenu( this ); - ImportMenu = new QPopupMenu( this ); - ExportMenu = new QPopupMenu( this ); - syncMenu = new QPopupMenu( this ); - changeMenu= new QPopupMenu( this ); - beamMenu= new QPopupMenu( this ); + ImportMenu = new Q3PopupMenu( this ); + ExportMenu = new Q3PopupMenu( this ); + syncMenu = new Q3PopupMenu( this ); + changeMenu= new Q3PopupMenu( this ); + beamMenu= new Q3PopupMenu( this ); //US since we have no splitter for the embedded system, setup // a layout with two frames. One left and one right. - QBoxLayout *topLayout; + Q3BoxLayout *topLayout; // = new QHBoxLayout( this ); // QBoxLayout *topLayout = (QBoxLayout*)layout(); @@ -1909,7 +1919,7 @@ void KABCore::initGUI() // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); #ifdef DESKTOP_VERSION - topLayout = new QHBoxLayout( this ); + topLayout = new Q3HBoxLayout( this ); mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); @@ -1924,12 +1934,12 @@ void KABCore::initGUI() mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); #else if ( QApplication::desktop()->width() > 480 ) { - topLayout = new QHBoxLayout( this ); + topLayout = new Q3HBoxLayout( this ); mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); } else { - topLayout = new QHBoxLayout( this ); + topLayout = new Q3HBoxLayout( this ); mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); } @@ -2034,17 +2044,17 @@ void KABCore::initActions() mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); - mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, + mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", Qt::CTRL + Qt::Key_P, mViewManager, SLOT( printView() ), actionCollection(), "kaddressbook_print" ); mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails, SLOT( printView() ), actionCollection(), "kaddressbook_print2" ); - mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, + mActionSave = new KAction( i18n( "&Save" ), "filesave", Qt::CTRL+Qt::Key_S, this, SLOT( save() ), actionCollection(), "file_sync" ); - mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, + mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", Qt::CTRL+Qt::Key_N, this, SLOT( newContact() ), actionCollection(), "file_new_contact" ); mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, @@ -2083,22 +2093,22 @@ void KABCore::initActions() // edit menu if ( mIsPart ) { - mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, + mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", Qt::CTRL + Qt::Key_C, this, SLOT( copyContacts() ), actionCollection(), "kaddressbook_copy" ); - mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, + mActionCut = new KAction( i18n( "Cu&t" ), "editcut", Qt::CTRL + Qt::Key_X, this, SLOT( cutContacts() ), actionCollection(), "kaddressbook_cut" ); - mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, + mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", Qt::CTRL + Qt::Key_V, this, SLOT( pasteContacts() ), actionCollection(), "kaddressbook_paste" ); - mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, + mActionSelectAll = new KAction( i18n( "Select &All" ), Qt::CTRL + Qt::Key_A, this, SLOT( selectAllContacts() ), actionCollection(), "kaddressbook_select_all" ); - mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, + mActionUndo = new KAction( i18n( "&Undo" ), "undo", Qt::CTRL + Qt::Key_Z, this, SLOT( undo() ), actionCollection(), "kaddressbook_undo" ); - mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, + mActionRedo = new KAction( i18n( "Re&do" ), "redo", Qt::CTRL + Qt::SHIFT + Qt::Key_Z, this, SLOT( redo() ), actionCollection(), "kaddressbook_redo" ); } else { @@ -2111,7 +2121,7 @@ void KABCore::initActions() } mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", - Key_Delete, this, SLOT( deleteContacts() ), + Qt::Key_Delete, this, SLOT( deleteContacts() ), actionCollection(), "edit_delete" ); mActionUndo->setEnabled( false ); @@ -2246,9 +2256,9 @@ void KABCore::addActionsManually() //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); #ifdef KAB_EMBEDDED - QPopupMenu *fileMenu = new QPopupMenu( this ); - QPopupMenu *editMenu = new QPopupMenu( this ); - QPopupMenu *helpMenu = new QPopupMenu( this ); + Q3PopupMenu *fileMenu = new Q3PopupMenu( this ); + Q3PopupMenu *editMenu = new Q3PopupMenu( this ); + Q3PopupMenu *helpMenu = new Q3PopupMenu( this ); KToolBar* tb = mMainWindow->toolBar(); mMainWindow->setToolBarsMovable (false ); @@ -2276,7 +2286,7 @@ void KABCore::addActionsManually() } else { //US setup toolbar QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); - QPopupMenu *popupBarTB = new QPopupMenu( this ); + Q3PopupMenu *popupBarTB = new Q3PopupMenu( this ); menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); tb->insertWidget(-1, 0, menuBarTB); mIncSearchWidget = new IncSearchWidget( tb ); @@ -2631,7 +2641,7 @@ void KABCore::configureKeyBindings() #ifdef KAB_EMBEDDED void KABCore::configureResources() { - KRES::KCMKResources dlg( this, "" , 0 ); + KRES::KCMKResources dlg( this, "" , QStringList() ); if ( !dlg.exec() ) return; @@ -2727,7 +2737,7 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { ++count; } - QProgressBar bar(count,0 ); + Q3ProgressBar bar(count,0 ); int w = 300; if ( QApplication::desktop()->width() < 320 ) w = 220; @@ -2908,7 +2918,7 @@ KABC::Addressee KABCore::getLastSyncAddressee() sum = "E: "; lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); lse.setRevision( mLastAddressbookSync ); - lse.setCategories( i18n("SyncEvent") ); + lse.setCategories( QStringList(i18n("SyncEvent")) ); mAddressBook->insertAddressee( lse ); } return lse; @@ -3099,7 +3109,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); addresseeRSync.setRevision( mLastAddressbookSync ); - addresseeRSync.setCategories( i18n("SyncAddressee") ); + addresseeRSync.setCategories( QStringList(i18n("SyncAddressee")) ); } } if ( addresseeLSync.revision() == mLastAddressbookSync ) { diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index ec6a9ec..4351720 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -28,11 +28,15 @@ #ifndef KAB_EMBEDDED #endif //KAB_EMBEDDED -#include <qdict.h> +#include <q3dict.h> #include <qtimer.h> #include <qwidget.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <Q3CString> +#include <QPixmap> +#include <QResizeEvent> #include <ksyncmanager.h> #ifndef DESKTOP_VERSION #include <qcopchannel_qws.h> @@ -85,9 +89,9 @@ class KABCore : public QWidget, public KSyncInterface #ifdef KAB_EMBEDDED //US added functionality - QPopupMenu* getViewMenu() {return viewMenu;} - QPopupMenu* getFilterMenu() {return filterMenu;} - QPopupMenu* getSettingsMenu() {return settingsMenu;} + Q3PopupMenu* getViewMenu() {return viewMenu;} + Q3PopupMenu* getFilterMenu() {return filterMenu;} + Q3PopupMenu* getSettingsMenu() {return settingsMenu;} void addActionsManually(); #endif //KAB_EMBEDDED /** @@ -135,8 +139,8 @@ class KABCore : public QWidget, public KSyncInterface #endif //KAB_EMBEDDED #ifdef KAB_EMBEDDED - inline QPopupMenu* getImportMenu() { return ImportMenu;} - inline QPopupMenu* getExportMenu() { return ExportMenu;} + inline Q3PopupMenu* getImportMenu() { return ImportMenu;} + inline Q3PopupMenu* getExportMenu() { return ExportMenu;} #endif //KAB_EMBEDDED public slots: @@ -366,8 +370,8 @@ class KABCore : public QWidget, public KSyncInterface private slots: void updateToolBar(); void updateMainWindow(); - void receive( const QCString& cmsg, const QByteArray& data ); - void receiveStart( const QCString& cmsg, const QByteArray& data ); + void receive( const Q3CString& cmsg, const QByteArray& data ); + void receiveStart( const Q3CString& cmsg, const QByteArray& data ); void toggleBeamReceive( ); void disableBR(bool); void setJumpButtonBarVisible( bool visible ); @@ -394,7 +398,7 @@ class KABCore : public QWidget, public KSyncInterface void addressBookChanged(); private: - QCString mCStringMess; + Q3CString mCStringMess; QByteArray mByteData; QString mEmailSourceChannel; QString mEmailSourceUID; @@ -486,14 +490,14 @@ class KABCore : public QWidget, public KSyncInterface KAction *mActionDeleteView; - QPopupMenu *viewMenu; - QPopupMenu *filterMenu; - QPopupMenu *settingsMenu; - QPopupMenu *changeMenu; - QPopupMenu *beamMenu; + Q3PopupMenu *viewMenu; + Q3PopupMenu *filterMenu; + Q3PopupMenu *settingsMenu; + Q3PopupMenu *changeMenu; + Q3PopupMenu *beamMenu; //US QAction *mActionSave; - QPopupMenu *ImportMenu; - QPopupMenu *ExportMenu; + Q3PopupMenu *ImportMenu; + Q3PopupMenu *ExportMenu; //LR additional methods KAction *mActionRemoveVoice; KAction *mActionSetFormattedName; @@ -524,7 +528,7 @@ class KABCore : public QWidget, public KSyncInterface // LR ******************************* // sync stuff! QString sentSyncFile(); - QPopupMenu *syncMenu; + Q3PopupMenu *syncMenu; KSyncManager* syncManager; int mGlobalSyncMode; bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index 42d541b..6f9c995 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp @@ -25,7 +25,7 @@ //#include <qstring.h> //#endif //KAB_EMBEDDED -#include <qtextstream.h> +#include <q3textstream.h> #include <qfile.h> #include <qregexp.h> #include <stdlib.h> @@ -91,7 +91,7 @@ KABPrefs::KABPrefs() KPrefs::setCurrentGroup( "Views" ); QString defaultView = i18n( "Default Table View" ); addItemString( "CurrentView", &mCurrentView, defaultView ); - addItemStringList( "ViewNames", &mViewNames, defaultView ); + addItemStringList( "ViewNames", &mViewNames, QStringList(defaultView) ); KPrefs::setCurrentGroup( "Filters" ); addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h index ddbc0c0..aff725e 100644 --- a/kaddressbook/kabprefs.h +++ b/kaddressbook/kabprefs.h @@ -25,7 +25,9 @@ #define KABPREFS_H #include <qstringlist.h> -#include <qdict.h> +#include <q3dict.h> +//Added by qt3to4: +#include <Q3ValueList> #include <libkdepim/kpimprefs.h> @@ -73,8 +75,8 @@ class KABPrefs : public KPimPrefs bool mAutoSearchWithWildcard; bool mHideSearchOnSwitch; bool mAskForDelete; - QValueList<int> mExtensionsSplitter; - QValueList<int> mDetailsSplitter; + Q3ValueList<int> mExtensionsSplitter; + Q3ValueList<int> mDetailsSplitter; // Extensions stuff int mCurrentExtension; diff --git a/kaddressbook/kaddressbook.pro b/kaddressbook/kaddressbook.pro index cd38e5f..4eb1f7f 100644 --- a/kaddressbook/kaddressbook.pro +++ b/kaddressbook/kaddressbook.pro @@ -13,28 +13,28 @@ unix : { staticlib: { TARGET = kapi_linux -LIBS += ../bin/libmicrokabc_qtopia.a -LIBS += ../bin/libmicrokabc_file.a -LIBS += ../bin/libmicrokabc_dir.a -LIBS += ../bin/libmicrokdepim.a -LIBS += ../bin/libmicrokcal.a -LIBS += ../bin/libmicrokabc.a -LIBS += ../bin/libmicrokde.a -LIBS += ../bin/libmicrokabc_qtopia.a -LIBS += ../bin/libmicrokabc_file.a -LIBS += ../bin/libmicrokabc_dir.a -LIBS += ../bin/libmicrokdepim.a -LIBS += ../bin/libmicrokcal.a -LIBS += ../bin/libmicrokabc.a -LIBS += ../bin/libmicrokde.a +LIBS += ../bin/libxmicrokabc_qtopia.a +LIBS += ../bin/libxmicrokabc_file.a +LIBS += ../bin/libxmicrokabc_dir.a +LIBS += ../bin/libxmicrokdepim.a +LIBS += ../bin/libxmicrokcal.a +LIBS += ../bin/libxmicrokabc.a +LIBS += ../bin/libxmicrokde.a +LIBS += ../bin/libxmicrokabc_qtopia.a +LIBS += ../bin/libxmicrokabc_file.a +LIBS += ../bin/libxmicrokabc_dir.a +LIBS += ../bin/libxmicrokdepim.a +LIBS += ../bin/libxmicrokcal.a +LIBS += ../bin/libxmicrokabc.a +LIBS += ../bin/libxmicrokde.a LIBS += ../libical/lib/libical.a LIBS += ../libical/lib/libicalss.a } else { -LIBS += ../bin/libmicrokdepim.so -LIBS += ../bin/libmicrokde.so -LIBS += ../bin/libmicrokabc.so -LIBS += ../bin/libmicrokcal.so +LIBS += ../bin/libxmicrokdepim.so +LIBS += ../bin/libxmicrokde.so +LIBS += ../bin/libxmicrokabc.so +LIBS += ../bin/libxmicrokcal.so #LIBS += -lldap } OBJECTS_DIR = obj/unix @@ -43,10 +43,10 @@ MOC_DIR = moc/unix win32: { RC_FILE = winicons.rc DEFINES += _WIN32_ -LIBS += ../bin/microkdepim.lib -LIBS += ../bin/microkcal.lib -LIBS += ../bin/microkde.lib -LIBS += ../bin/microkabc.lib +LIBS += ../bin/xmicrokdepim.lib +LIBS += ../bin/xmicrokcal.lib +LIBS += ../bin/xmicrokde.lib +LIBS += ../bin/xmicrokabc.lib QMAKE_LINK += /NODEFAULTLIB:LIBC OBJECTS_DIR = obj/win MOC_DIR = moc/win @@ -204,3 +204,5 @@ xxport/sharpdtm_xxport.cpp \ # calendarview.cpp \ # timespanview.cpp +#The following line was inserted by qt3to4 +QT += xml qt3support diff --git a/kaddressbook/kaddressbookE.pro b/kaddressbook/kaddressbookE.pro index 64e3a4a..c4b2499 100644 --- a/kaddressbook/kaddressbookE.pro +++ b/kaddressbook/kaddressbookE.pro @@ -12,10 +12,10 @@ DEFINES += KAB_EMBEDDED KAB_NOSPLITTER #DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL #DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER #DEFINES += KORG_NOLVALTERNATION -LIBS += -lmicrokdepim -LIBS += -lmicrokde +LIBS += -lxmicrokdepim +LIBS += -lxmicrokde LIBS += -lmicroqtcompat -LIBS += -lmicrokabc +LIBS += -lxmicrokabc LIBS += -lqpe LIBS += -ljpeg LIBS += $(QTOPIALIB) diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp index c417226..b317974 100644 --- a/kaddressbook/kaddressbookmain.cpp +++ b/kaddressbook/kaddressbookmain.cpp @@ -25,8 +25,11 @@ #include "kabprefs.h" #include <kglobal.h> #include <qmessagebox.h> -#include <qtoolbar.h> +#include <q3toolbar.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3CString> +#include <QCloseEvent> #else //KAB_EMBEDDED #include <kedittoolbar.h> #include <kkeydialog.h> @@ -42,18 +45,18 @@ #ifdef KAB_EMBEDDED KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" ) #else //KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 ) -//MOC_SKIP_END +#endif #endif //KAB_EMBEDDED { setIcon(SmallIcon( "ka24" ) ); #if 0 //US for embedded systems, create the toolbar before we initiate KABCore. // KABCore will fill the toolbar with menues and icons - QMainWindow::ToolBarDock tbd; - tbd = Top; - iconToolBar = new QToolBar( this ); + Qt::ToolBarDock tbd; + tbd = Qt::DockTop; + iconToolBar = new Q3ToolBar( this ); addToolBar (iconToolBar , tbd ); iconToolBar->setHorizontalStretchable(true); //US iconToolBar->setWidth(300); @@ -85,7 +88,7 @@ KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainW setAutoSaveSettings(); mCore->restoreSettings(); #ifndef DESKTOP_VERSION - QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), mCore, SLOT (receiveStart ( const QCString &, const QByteArray & ))); + QObject::connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), mCore, SLOT (receiveStart ( const Q3CString &, const QByteArray & ))); #endif } @@ -235,7 +238,6 @@ void KAddressBookMain::closeEvent( QCloseEvent* ce ) ce->accept(); } -#ifndef KAB_EMBEDDED -#include "kaddressbookmain.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kaddressbookmain.cpp" #endif //KAB_EMBEDDED - diff --git a/kaddressbook/kaddressbookmain.h b/kaddressbook/kaddressbookmain.h index b6d9b4b..d3f5cc7 100644 --- a/kaddressbook/kaddressbookmain.h +++ b/kaddressbook/kaddressbookmain.h @@ -24,10 +24,12 @@ #ifndef KADDRESSBOOKMAIN_H #define KADDRESSBOOKMAIN_H -#include <qptrlist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <QCloseEvent> #ifdef KAB_EMBEDDED -class QToolBar; +class Q3ToolBar; #include <qaction.h> //#include <qmainwindow.h> #include <kmainwindow.h> @@ -52,9 +54,9 @@ class KConfig; #ifdef KAB_EMBEDDED class KAddressBookMain : public KMainWindow #else //KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface -//MOC_SKIP_END +#endif #endif //KAB_EMBEDDED { Q_OBJECT @@ -73,9 +75,9 @@ class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface void showMinimized () ; virtual void addEmail( QString addr ); #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN virtual ASYNC showContactEditor( QString uid ); -//MOC_SKIP_END +#endif #endif //KAB_EMBEDDED virtual void newContact(); virtual QString getNameByPhone( QString phone ); diff --git a/kaddressbook/kaddressbookview.cpp b/kaddressbook/kaddressbookview.cpp index 86898e2..4823b37 100644 --- a/kaddressbook/kaddressbookview.cpp +++ b/kaddressbook/kaddressbookview.cpp @@ -32,6 +32,8 @@ #endif //KAB_EMBEDDED #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kabc/distributionlistdialog.h> #include <kabc/addressbook.h> @@ -133,7 +135,7 @@ KABC::Addressee::List KAddressBookView::addressees() void KAddressBookView::initGUI() { // Create the layout - QVBoxLayout *layout = new QVBoxLayout( this ); + Q3VBoxLayout *layout = new Q3VBoxLayout( this ); // Add the view widget mViewWidget = new QWidget( this ); @@ -183,6 +185,6 @@ ViewConfigureWidget *ViewFactory::configureWidget( KABC::AddressBook *ab, -#ifndef KAB_EMBEDDED -#include "kaddressbookview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kaddressbookview.cpp" #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,3 +1,5 @@ +//Added by qt3to4: +#include <QDropEvent> /* This file is part of KAddressBook. Copyright (c) 2002 Mike Pilone <mpilone@slac.com> @@ -40,7 +42,7 @@ class QDropEvent; #include "filter.h" #ifdef DESKTOP_VERSION -#include <qpaintdevicemetrics.h> +#include <q3paintdevicemetrics.h> #include <qprinter.h> #include <qpainter.h> #endif @@ -175,9 +177,9 @@ class KAddressBookView : public QWidget is equal to QString::null, then all addressees should be selected. */ #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN virtual void setSelected( QString uid = QString::null, bool selected = true ) = 0; -//MOC_SKIP_END +#endif #else //KAB_EMBEDDED //US my moc can not handle the default parameters. Is this a problem ??? virtual void setSelected( QString uid, bool selected) = 0; @@ -262,9 +264,9 @@ class KAddressBookView : public QWidget }; #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN class ViewFactory : public KLibFactory -//MOC_SKIP_END +#endif #else //KAB_EMBEDDED class ViewFactory #endif //KAB_EMBEDDED 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 @@ -21,12 +21,16 @@ without including the source code for Qt in the source distribution. */ -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3HBoxLayout> #include <kbuttonbox.h> #include <kcombobox.h> @@ -45,13 +49,13 @@ NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, { if (KGlobal::getOrientation() == KGlobal::Portrait) { - QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(), + Q3GridLayout* layout = new Q3GridLayout( this, 1, 1, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); QLabel *label = new QLabel( i18n( title ), this ); layout->addWidget( label, 0, 1 ); - mBox = new QListBox( this ); + mBox = new Q3ListBox( this ); mBox->setMaximumSize(70, 70); layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); @@ -70,13 +74,13 @@ NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, } else { - QHBoxLayout *layout = new QHBoxLayout( this ); + Q3HBoxLayout *layout = new Q3HBoxLayout( this ); - QGroupBox *group = new QGroupBox( 0, Qt::Vertical, title, this ); - QGridLayout *groupLayout = new QGridLayout( group->layout(), 2, 2, + Q3GroupBox *group = new Q3GroupBox( 0, Qt::Vertical, title, this ); + Q3GridLayout *groupLayout = new Q3GridLayout( group->layout(), 2, 2, KDialog::spacingHint() ); - mBox = new QListBox( group ); + mBox = new Q3ListBox( group ); groupLayout->addWidget( mBox, 0, 0 ); @@ -97,8 +101,8 @@ NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, mRemoveButton->setEnabled( false ); - connect( mBox, SIGNAL( selectionChanged( QListBoxItem* ) ), - SLOT( selectionChanged( QListBoxItem* ) ) ); + connect( mBox, SIGNAL( selectionChanged( Q3ListBoxItem* ) ), + SLOT( selectionChanged( Q3ListBoxItem* ) ) ); connect( mEdit, SIGNAL( textChanged( const QString& ) ), SLOT( textChanged( const QString& ) ) ); connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) ); @@ -143,7 +147,7 @@ void NamePartWidget::remove() emit modified(); } -void NamePartWidget::selectionChanged( QListBoxItem *item ) +void NamePartWidget::selectionChanged( Q3ListBoxItem *item ) { mRemoveButton->setEnabled( item != 0 ); } @@ -157,7 +161,7 @@ void NamePartWidget::textChanged( const QString& text ) AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *layout; + Q3GridLayout *layout; mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); @@ -178,7 +182,7 @@ AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) if (KGlobal::getOrientation() == KGlobal::Portrait) { - layout = new QGridLayout( this, 4, 2, KDialog::marginHintSmall(), + layout = new Q3GridLayout( this, 4, 2, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); @@ -190,7 +194,7 @@ AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) } else { - layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), + layout = new Q3GridLayout( this, 2, 3, KDialog::marginHint(), KDialog::spacingHint() ); layout->addWidget( mPrefix, 0, 0 ); @@ -233,6 +237,6 @@ void AddresseeWidget::saveSettings() config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); } -#ifndef KAB_EMBEDDED -#include "addresseewidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_addresseewidget.cpp" #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 @@ -29,8 +29,8 @@ class KComboBox; class KLineEdit; -class QListBox; -class QListBoxItem; +class Q3ListBox; +class Q3ListBoxItem; class QPushButton; class NamePartWidget : public QWidget @@ -52,13 +52,13 @@ class NamePartWidget : public QWidget void add(); void remove(); - void selectionChanged( QListBoxItem* ); + void selectionChanged( Q3ListBoxItem* ); void textChanged( const QString& ); private: KLineEdit *mEdit; - QListBox *mBox; + Q3ListBox *mBox; QPushButton *mAddButton; QPushButton *mRemoveButton; }; 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 @@ -22,6 +22,9 @@ */ #include <qlayout.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> #include <klocale.h> @@ -34,8 +37,8 @@ ExtensionConfigDialog::ExtensionConfigDialog( ExtensionFactory *factory, KConfig : KDialogBase( Plain, i18n( "Extension Settings" ), Ok | Cancel, Ok, parent, name, true, true ), mWidget( 0 ), mConfig( config ) { - QFrame *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 1, 1, marginHint(), spacingHint() ); + Q3Frame *page = plainPage(); + Q3GridLayout *layout = new Q3GridLayout( page, 1, 1, marginHint(), spacingHint() ); mWidget = factory->configureWidget( page, "ExtensionConfigWidget" ); layout->addWidget( mWidget, 0, 0 ); @@ -54,6 +57,6 @@ void ExtensionConfigDialog::slotOk() KDialogBase::slotOk(); } -#ifndef KAB_EMBEDDED -#include "extensionconfigdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_extensionconfigdialog.cpp" #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 @@ -22,8 +22,8 @@ */ #include <qcheckbox.h> -#include <qframe.h> -#include <qgroupbox.h> +#include <q3frame.h> +#include <q3groupbox.h> #include <qlayout.h> #include <qpushbutton.h> #include <qtabwidget.h> @@ -31,7 +31,11 @@ #include <qlineedit.h> #include <qlabel.h> #include <qfile.h> -#include <qvbox.h> +#include <q3vbox.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3PtrList> +#include <Q3VBoxLayout> #include <kconfig.h> #include <kdebug.h> @@ -57,15 +61,15 @@ #include "kabconfigwidget.h" #include <kglobalsettings.h> -class ExtensionItem : public QCheckListItem +class ExtensionItem : public Q3CheckListItem { public: #ifndef KAB_EMBEDDED - ExtensionItem( QListView *parent, const QString &text ); + ExtensionItem( Q3ListView *parent, const QString &text ); void setService( const KService::Ptr &ptr ); #else //KAB_EMBEDDED - ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ); + ExtensionItem( Q3ListView *parent, const QString &text, const QString &name, const QString &comment ); void setFactory( ExtensionFactory* fac ); #endif //KAB_EMBEDDED @@ -90,7 +94,7 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * : KPrefsWidget( prefs, parent, name ) { - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, + Q3VBoxLayout *topLayout = new Q3VBoxLayout( this, 0, KDialog::spacingHintSmall() ); QTabWidget *tabWidget = new QTabWidget( this ); @@ -98,12 +102,12 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * // General page QWidget *generalPage = new QWidget( this ); - QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(), + Q3VBoxLayout *layout = new Q3VBoxLayout( generalPage, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); QWidget *hBox = new QWidget( generalPage, "qhbox" ); - QHBoxLayout *hboxLayout = new QHBoxLayout( hBox); + Q3HBoxLayout *hboxLayout = new Q3HBoxLayout( hBox); KPrefsWidFont *detailsFont = addWidFont(i18n("phone:123"),i18n("Details view font"), &(KABPrefs::instance()->mDetailsFont),hBox); @@ -117,7 +121,7 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * //general groupbox QWidget *vBox = new QWidget( generalPage, "qvbox" ); - QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); + Q3VBoxLayout *boxLayout = new Q3VBoxLayout( vBox ); boxLayout->setAlignment( Qt::AlignTop ); boxLayout->setMargin(KDialog::marginHintSmall() ); boxLayout->setSpacing( KDialog::spacingHintSmall() ); @@ -154,13 +158,13 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * // Extension page QWidget *extensionPage = new QWidget( this ); - QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(), + Q3VBoxLayout *extensionLayout = new Q3VBoxLayout( extensionPage, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); //extensions groupbox - QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); - boxLayout = new QVBoxLayout( groupBox->layout() ); + Q3GroupBox* groupBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); + boxLayout = new Q3VBoxLayout( groupBox->layout() ); boxLayout->setAlignment( Qt::AlignTop ); boxLayout->setMargin(KDialog::marginHintSmall()); boxLayout->setSpacing(KDialog::spacingHintSmall()); @@ -189,10 +193,10 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); connect( mAskForDelete, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); - connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), - SLOT( selectionChanged( QListViewItem* ) ) ); - connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), - SLOT( itemClicked( QListViewItem* ) ) ); + connect( mExtensionView, SIGNAL( selectionChanged( Q3ListViewItem* ) ), + SLOT( selectionChanged( Q3ListViewItem* ) ) ); + connect( mExtensionView, SIGNAL( clicked( Q3ListViewItem* ) ), + SLOT( itemClicked( Q3ListViewItem* ) ) ); connect( mConfigureButton, SIGNAL( clicked() ), SLOT( configureExtension() ) ); @@ -295,8 +299,8 @@ void KABConfigWidget::saveExtensionSettings() { QStringList activeExtensions; - QPtrList<QListViewItem> list; - QListViewItemIterator it( mExtensionView ); + Q3PtrList<Q3ListViewItem> list; + Q3ListViewItemIterator it( mExtensionView ); while ( it.current() ) { ExtensionItem *item = static_cast<ExtensionItem*>( it.current() ); if ( item ) { @@ -328,7 +332,7 @@ void KABConfigWidget::configureExtension() config.sync(); } -void KABConfigWidget::selectionChanged( QListViewItem *i ) +void KABConfigWidget::selectionChanged( Q3ListViewItem *i ) { ExtensionItem *item = static_cast<ExtensionItem*>( i ); if ( !item ) @@ -337,15 +341,15 @@ void KABConfigWidget::selectionChanged( QListViewItem *i ) mConfigureButton->setEnabled( item->configWidgetAvailable() ); } -void KABConfigWidget::itemClicked( QListViewItem *item ) +void KABConfigWidget::itemClicked( Q3ListViewItem *item ) { if ( item != 0 ) modified(); } #ifndef KAB_EMBEDDED -ExtensionItem::ExtensionItem( QListView *parent, const QString &text ) - : QCheckListItem( parent, text, CheckBox ) +ExtensionItem::ExtensionItem( Q3ListView *parent, const QString &text ) + : Q3CheckListItem( parent, text, CheckBox ) { } @@ -354,8 +358,8 @@ void ExtensionItem::setService( const KService::Ptr &ptr ) mPtr = ptr; } #else //KAB_EMBEDDED -ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ) - : QCheckListItem( parent, text, CheckBox ) +ExtensionItem::ExtensionItem( Q3ListView *parent, const QString &text, const QString &name, const QString &comment ) + : Q3CheckListItem( parent, text, CheckBox ) { mName = name; mComment = comment; @@ -418,7 +422,6 @@ QString ExtensionItem::text( int column ) const #endif //KAB_EMBEDDED } -#ifndef KAB_EMBEDDED -#include "kabconfigwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kabconfigwidget.cpp" #endif //KAB_EMBEDDED - 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 @@ -27,7 +27,7 @@ #include <kprefswidget.h> class QCheckBox; -class QListViewItem; +class Q3ListViewItem; class QPushButton; class QComboBox; class QLineEdit; @@ -53,8 +53,8 @@ class KABConfigWidget : public KPrefsWidget private slots: void configureExtension(); - void selectionChanged( QListViewItem* ); - void itemClicked( QListViewItem* ); + void selectionChanged( Q3ListViewItem* ); + void itemClicked( Q3ListViewItem* ); private: void restoreExtensionSettings(); 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 @@ -22,6 +22,8 @@ */ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #ifndef KAB_EMBEDDED #include <kaboutdata.h> @@ -48,7 +50,7 @@ KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) : KCModule( KABPrefs::instance(), parent, name ) { //abort(); - QVBoxLayout *layout = new QVBoxLayout( this ); + Q3VBoxLayout *layout = new Q3VBoxLayout( this ); mConfigWidget = new KABConfigWidget( (KABPrefs*)getPreferences(), this, "KABConfigWidget" ); layout->addWidget( mConfigWidget ); layout->setSpacing( 0 ); @@ -87,6 +89,6 @@ const KAboutData* KCMKabConfig::aboutData() const } #endif //KAB_EMBEDDED -#ifndef KAB_EMBEDDED -#include "kcmkabconfig.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kcmkabconfig.cpp" #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 @@ -28,6 +28,8 @@ #include <qlabel.h> #include <qlayout.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3GridLayout> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> @@ -36,7 +38,7 @@ #else //KAB_EMBEDDED #include <qmap.h> #include <qmessagebox.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <kurl.h> #endif //KAB_EMBEDDED @@ -52,7 +54,7 @@ KeyWidget::KeyWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *layout = new QGridLayout( this, 2, 2, KDialog::marginHint(), + Q3GridLayout *layout = new Q3GridLayout( this, 2, 2, KDialog::marginHint(), KDialog::spacingHint() ); QLabel *label = new QLabel( i18n( "Keys:" ), this ); @@ -136,7 +138,7 @@ void KeyWidget::addKey() QString tmpFile; if ( KIO::NetAccess::download( url, tmpFile ) ) { QFile file( tmpFile ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.open( QIODevice::ReadOnly ) ) { QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); KMessageBox::error( this, text.arg( url.url() ) ); return; @@ -152,7 +154,7 @@ void KeyWidget::addKey() { QFile file( keyfile ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.open( QIODevice::ReadOnly ) ) { QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); QString caption( i18n( "Error" ) ); QMessageBox::critical( this, caption, text.arg( keyfile ) ); @@ -163,10 +165,10 @@ void KeyWidget::addKey() - QTextStream s( &file ); + Q3TextStream s( &file ); QString data; - s.setEncoding( QTextStream::UnicodeUTF8 ); + s.setEncoding( Q3TextStream::UnicodeUTF8 ); s >> data; file.close(); @@ -221,8 +223,8 @@ void KeyWidget::exportKey() KURL url = KFileDialog::getSaveURL(); KTempFile tempFile; - QTextStream *s = tempFile.textStream(); - s->setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream *s = tempFile.textStream(); + s->setEncoding( Q3TextStream::UnicodeUTF8 ); (*s) << key.textData(); tempFile.close(); @@ -235,15 +237,15 @@ void KeyWidget::exportKey() return; QFile file( keyfile ); - if ( !file.open( IO_ReadWrite ) ) { + if ( !file.open( QIODevice::ReadWrite ) ) { QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); QString caption( i18n( "Error" ) ); QMessageBox::critical( this, caption, text.arg( keyfile ) ); return; } - QTextStream s( &file ); - s.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream s( &file ); + s.setEncoding( Q3TextStream::UnicodeUTF8 ); s << key.textData(); file.close(); @@ -272,6 +274,6 @@ void KeyWidget::updateKeyCombo() mExportButton->setEnabled( state ); } -#ifndef KAB_EMBEDDED -#include "keywidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_keywidget.cpp" #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 @@ -5,8 +5,7 @@ #else #include <qapplication.h> #include <qwindowsstyle.h> -#include <qplatinumstyle.h> -#include <qmainwindow.h> +#include <q3mainwindow.h> #include <qmessagebox.h> #include <stdlib.h> #endif @@ -24,12 +23,12 @@ void dumpMissing(); int main( int argc, char **argv ) { + if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi"); #ifndef DESKTOP_VERSION QPEApplication a( argc, argv ); a.setKeepRunning (); #else QApplication a( argc, argv ); - QApplication::setStyle( new QPlatinumStyle ()); #ifdef _WIN32_ QString hdir ( getenv( "HOME") ); if ( hdir.isEmpty() ) { diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp index 199f3d6..96822d8 100644 --- a/kaddressbook/nameeditdialog.cpp +++ b/kaddressbook/nameeditdialog.cpp @@ -23,12 +23,14 @@ #include <qlayout.h> #include <qlabel.h> -#include <qlistbox.h> -#include <qlistview.h> +#include <q3listbox.h> +#include <q3listview.h> #include <qtooltip.h> #include <qpushbutton.h> #include <qcheckbox.h> #include <qstring.h> +//Added by qt3to4: +#include <Q3GridLayout> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> @@ -57,7 +59,7 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type, { QWidget *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 5, 3 ); + Q3GridLayout *layout = new Q3GridLayout( page, 5, 3 ); layout->setSpacing( spacingHint() ); layout->addColSpacing( 2, 100 ); QLabel *label; @@ -295,6 +297,6 @@ qDebug("NameEditDialog::slotHelp Help is not supported yet"); #endif //KAB_EMBEDDED } -#ifndef KAB_EMBEDDED -#include "nameeditdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_nameeditdialog.cpp" #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 @@ -316,13 +316,13 @@ void MainWindow::initActions() iconToolBar->clear(); KABPrefs *p = KABPrefs::instance(); QPEMenuBar *menuBar1 = new QPEMenuBar( iconToolBar ); - QPopupMenu *menuBar = new QPopupMenu( this ); + Q3PopupMenu *menuBar = new Q3PopupMenu( this ); menuBar1->insertItem( "ME", menuBar); - QPopupMenu *fileMenu = new QPopupMenu( this ); - QPopupMenu *editMenu = new QPopupMenu( this ); - QPopupMenu *viewMenu = new QPopupMenu( this ); - QPopupMenu *settingsMenu = new QPopupMenu( this ); - QPopupMenu *importMenu = new QPopupMenu( this ); + Q3PopupMenu *fileMenu = new Q3PopupMenu( this ); + Q3PopupMenu *editMenu = new Q3PopupMenu( this ); + Q3PopupMenu *viewMenu = new Q3PopupMenu( this ); + Q3PopupMenu *settingsMenu = new Q3PopupMenu( this ); + Q3PopupMenu *importMenu = new Q3PopupMenu( this ); menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp index df3b551..3661677 100644 --- a/kaddressbook/phoneeditwidget.cpp +++ b/kaddressbook/phoneeditwidget.cpp @@ -27,13 +27,19 @@ #include <qpushbutton.h> #include <qcheckbox.h> #include <qstring.h> -#include <qlistbox.h> -#include <qlistview.h> -#include <qbuttongroup.h> -#include <qhbox.h> +#include <q3listbox.h> +#include <q3listview.h> +#include <q3buttongroup.h> +#include <q3hbox.h> #include <qcursor.h> #include <qtimer.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3GridLayout> +#include <Q3Frame> +#include <Q3PopupMenu> +#include <Q3VBoxLayout> #include <kbuttonbox.h> #include <klistview.h> @@ -57,7 +63,7 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) : QWidget(parent,name) { - QGridLayout* gridLayout = new QGridLayout ( this, 2,2 ); + Q3GridLayout* gridLayout = new Q3GridLayout ( this, 2,2 ); QLabel *temp = new QLabel( "", this ); temp->setAlignment( Qt::AlignCenter ); @@ -67,14 +73,14 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() ); connect(addBut,SIGNAL(clicked ()),SLOT(addNumber())); - sv = new QScrollView( this ); - sv->setFrameStyle ( QFrame::Plain ); + sv = new Q3ScrollView( this ); + sv->setFrameStyle ( Q3Frame::Plain ); sv->setLineWidth ( 0 ); sv->setMidLineWidth ( 0 ); mw = new QWidget ( sv->viewport() ); sv->addChild(mw); - sv->setResizePolicy( QScrollView::AutoOneFit ); - mainLayout = new QVBoxLayout ( mw ); + sv->setResizePolicy( Q3ScrollView::AutoOneFit ); + mainLayout = new Q3VBoxLayout ( mw ); mainLayout->setMargin( 0 ); mainLayout->setSpacing( 0 ); gridLayout->setMargin( 2 ); @@ -90,7 +96,7 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) } setDefaults(); mTypeNumberEditList.setAutoDelete( true ); - mPopup = new QPopupMenu( this ); + mPopup = new Q3PopupMenu( this ); QStringList list = PhoneNumber::supportedTypeListNames(); mPopupCount = list.count(); int i = 0; @@ -226,7 +232,7 @@ KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers() PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *layout = new QGridLayout( this, 4, 1 ); + Q3GridLayout *layout = new Q3GridLayout( this, 4, 1 ); //US layout->setSpacing( KDialog::spacingHint() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); @@ -236,7 +242,7 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) //US loadIcon call is ambiguous. Add one more parameter //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); - label->setAlignment( AlignCenter ); + label->setAlignment( Qt::AlignCenter ); //US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); layout->addWidget( label, 0, 0 ); @@ -327,7 +333,7 @@ void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &list ) // Insert types for existing numbers. mPrefCombo->insertTypeList( list ); - QValueList<int> defaultTypes; + Q3ValueList<int> defaultTypes; defaultTypes << KABC::PhoneNumber::Home; defaultTypes << KABC::PhoneNumber::Work; defaultTypes << KABC::PhoneNumber::Cell; @@ -337,7 +343,7 @@ void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &list ) // Insert default types. // Doing this for mPrefCombo is enough because the list is shared by all // combos. - QValueList<int>::ConstIterator it; + Q3ValueList<int>::ConstIterator it; for( it = defaultTypes.begin(); it != defaultTypes.end(); ++it ) { if ( !mPrefCombo->hasType( *it ) ) mPrefCombo->insertType( list, *it, PhoneNumber( "", *it ) ); @@ -487,10 +493,10 @@ void PhoneEditWidget::updateOtherEdit( PhoneTypeCombo *combo, PhoneTypeCombo *ot /////////////////////////////////////////// // PhoneEditDialog -class PhoneViewItem : public QListViewItem +class PhoneViewItem : public Q3ListViewItem { public: - PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ); + PhoneViewItem( Q3ListView *parent, const KABC::PhoneNumber &number ); void setPhoneNumber( const KABC::PhoneNumber &number ) { @@ -511,8 +517,8 @@ private: KABC::PhoneNumber mPhoneNumber; }; -PhoneViewItem::PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ) - : QListViewItem( parent ), mPhoneNumber( number ) +PhoneViewItem::PhoneViewItem( Q3ListView *parent, const KABC::PhoneNumber &number ) + : Q3ListViewItem( parent ), mPhoneNumber( number ) { #ifdef DESKTOP_VERSION setRenameEnabled ( 0, true ); @@ -544,7 +550,7 @@ PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget * QWidget *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 1, 2 ); + Q3GridLayout *layout = new Q3GridLayout( page, 1, 2 ); layout->setSpacing( spacingHint() ); mListView = new KListView( page ); @@ -552,7 +558,7 @@ PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget * mListView->addColumn( i18n( "Number" ) ); mListView->addColumn( i18n( "Type" ) ); - KButtonBox *buttonBox = new KButtonBox( page, Vertical ); + KButtonBox *buttonBox = new KButtonBox( page, Qt::Vertical ); buttonBox->addButton( i18n( "&Add..." ), this, SLOT( slotAddPhoneNumber() ) ); mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( slotEditPhoneNumber() ) ); @@ -565,7 +571,7 @@ PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget * layout->addWidget( buttonBox, 0, 1 ); connect( mListView, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) ); - connect( mListView, SIGNAL(doubleClicked( QListViewItem *, const QPoint &, int )), this, SLOT( slotEditPhoneNumber())); + connect( mListView, SIGNAL(doubleClicked( Q3ListViewItem *, const QPoint &, int )), this, SLOT( slotEditPhoneNumber())); KABC::PhoneNumber::List::Iterator it; for ( it = mPhoneNumberList.begin(); it != mPhoneNumberList.end(); ++it ) @@ -588,7 +594,7 @@ void PhoneEditDialog::slotAddPhoneNumber() PhoneTypeDialog dlg( tmp, this ); if ( dlg.exec() ) { - QListViewItem* i = mListView->firstChild(); + Q3ListViewItem* i = mListView->firstChild(); KABC::PhoneNumber phoneNumber = dlg.phoneNumber(); bool insert = true; while ( i ) { @@ -620,7 +626,7 @@ void PhoneEditDialog::slotRemovePhoneNumber() return; mPhoneNumberList.remove( item->phoneNumber() ); - QListViewItem *currItem = mListView->currentItem(); + Q3ListViewItem *currItem = mListView->currentItem(); mListView->takeItem( currItem ); delete currItem; @@ -673,7 +679,7 @@ PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber, { QWidget *page = plainPage(); QLabel *label = 0; - QGridLayout *layout = new QGridLayout( page, 3, 2, marginHint(), spacingHint() ); + Q3GridLayout *layout = new Q3GridLayout( page, 3, 2, marginHint(), spacingHint() ); label = new QLabel( i18n( "Number:" ), page ); layout->addWidget( label, 0, 0 ); @@ -683,7 +689,7 @@ PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber, mPreferredBox = new QCheckBox( i18n( "This is the preferred phone number" ), page ); layout->addMultiCellWidget( mPreferredBox, 1, 1, 0, 1 ); - mGroup = new QButtonGroup( 2, Horizontal, i18n( "Types" ), page ); + mGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "Types" ), page ); layout->addMultiCellWidget( mGroup, 2, 2, 0, 1 ); // fill widgets @@ -726,6 +732,6 @@ KABC::PhoneNumber PhoneTypeDialog::phoneNumber() return mPhoneNumber; } #endif -#ifndef KAB_EMBEDDED -#include "phoneeditwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_phoneeditwidget.cpp" #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 @@ -27,16 +27,20 @@ #include <kiconloader.h> #include <qpushbutton.h> #include <qlayout.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qapplication.h> +#include <QDesktopWidget> -#include <qptrlist.h> -#include <qscrollview.h> +#include <q3ptrlist.h> +#include <q3scrollview.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> #include "addresseeconfig.h" #include "typecombo.h" -class QButtonGroup; +class Q3ButtonGroup; class QCheckBox; class PhoneTypeNumberEdit; @@ -76,15 +80,15 @@ class PhoneEditWidget : public QWidget protected: private: - QScrollView* sv; - QPopupMenu *mPopup; + Q3ScrollView* sv; + Q3PopupMenu *mPopup; int mPopupCount; PhoneTypeNumberEdit* mPendingDelete; void setDefaults(); PhoneTypeNumberEdit* appendEditCombo(); QWidget* mw; - QVBoxLayout* mainLayout; - QPtrList <PhoneTypeNumberEdit> mTypeNumberEditList; + Q3VBoxLayout* mainLayout; + Q3PtrList <PhoneTypeNumberEdit> mTypeNumberEditList; }; @@ -95,14 +99,14 @@ class PhoneTypeNumberEdit : public QWidget public: PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent ) { - QHBoxLayout * lay = new QHBoxLayout( this ); + Q3HBoxLayout * lay = new Q3HBoxLayout( this ); lay->setSpacing( 2 ); lay->setMargin( 0 ); mMinusButton = new QPushButton ( this ); mMinusButton->setPixmap ( SmallIcon("minus")); mCombo = new KComboBox( this ); if ( QApplication::desktop()->width() <= 640 ) - mCombo->setSizeLimit ( 6 ); + mCombo->setMaxVisibleItems ( 6 ); mNumber = new KLineEdit( this ); mMinusButton->setMaximumHeight( mNumber->sizeHint().height() + 6); lay->addWidget( mMinusButton ); diff --git a/kaddressbook/secrecywidget.cpp b/kaddressbook/secrecywidget.cpp index 4a2acc8..1c237c0 100644 --- a/kaddressbook/secrecywidget.cpp +++ b/kaddressbook/secrecywidget.cpp @@ -22,6 +22,8 @@ */ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kabc/secrecy.h> #include <kcombobox.h> @@ -32,7 +34,7 @@ SecrecyWidget::SecrecyWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QVBoxLayout *layout = new QVBoxLayout( this, KDialog::marginHint(), + Q3VBoxLayout *layout = new Q3VBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); mSecrecyCombo = new KComboBox( this ); layout->addWidget( mSecrecyCombo ); @@ -65,6 +67,6 @@ KABC::Secrecy SecrecyWidget::secrecy() const return secrecy; } -#ifndef KAB_EMBEDDED -#include "secrecywidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_secrecywidget.cpp" #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 @@ -114,6 +114,6 @@ void RedoStack::redo() UndoStack::instance()->push( command ); } -#ifndef KAB_EMBEDDED -#include "undo.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_undo.cpp" #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 @@ -25,7 +25,7 @@ #define UNDO_H #include <qobject.h> -#include <qptrstack.h> +#include <q3ptrstack.h> #include <qstring.h> class Command @@ -67,7 +67,7 @@ class StackBase : public QObject */ Command *pop(); - QPtrStack<Command> mCommandStack; + Q3PtrStack<Command> mCommandStack; }; class UndoStack : public StackBase diff --git a/kaddressbook/undocmds.cpp b/kaddressbook/undocmds.cpp index 5807dc0..e900b00 100644 --- a/kaddressbook/undocmds.cpp +++ b/kaddressbook/undocmds.cpp @@ -21,7 +21,7 @@ without including the source code for Qt in the source distribution. */ -#include <qtextstream.h> +#include <q3textstream.h> #include <qapplication.h> #include <qclipboard.h> diff --git a/kaddressbook/viewconfigurefieldspage.cpp b/kaddressbook/viewconfigurefieldspage.cpp index 5daae1a..7366a0b 100644 --- a/kaddressbook/viewconfigurefieldspage.cpp +++ b/kaddressbook/viewconfigurefieldspage.cpp @@ -36,20 +36,24 @@ #include <qtoolbutton.h> #include <qapplication.h> +#include <QDesktopWidget> #include <qlabel.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3BoxLayout> #include "viewconfigurefieldspage.h" -class FieldItem : public QListBoxText +class FieldItem : public Q3ListBoxText { public: - FieldItem( QListBox *parent, KABC::Field *field ) - : QListBoxText( parent, field->label() ), mField( field ) {} + FieldItem( Q3ListBox *parent, KABC::Field *field ) + : Q3ListBoxText( parent, field->label() ), mField( field ) {} - FieldItem( QListBox *parent, KABC::Field *field, int index ) - : QListBoxText( parent, field->label(), parent->item( index ) ), + FieldItem( Q3ListBox *parent, KABC::Field *field, int index ) + : Q3ListBoxText( parent, field->label(), parent->item( index ) ), mField( field ) {} KABC::Field *field() { return mField; } @@ -106,7 +110,7 @@ void ViewConfigureFieldsPage::slotShowFields( int index ) KABC::Field::List::ConstIterator it; for ( it = allFields.begin(); it != allFields.end(); ++it ) { - QListBoxItem *item = mSelectedBox->firstItem(); + Q3ListBoxItem *item = mSelectedBox->firstItem(); while( item ) { FieldItem *fieldItem = static_cast<FieldItem *>( item ); if ( (*it)->equals( fieldItem->field() ) ) @@ -189,7 +193,7 @@ void ViewConfigureFieldsPage::slotMoveUp() { int i = mSelectedBox->currentItem(); if ( i > 0 ) { - QListBoxItem *item = mSelectedBox->item( i ); + Q3ListBoxItem *item = mSelectedBox->item( i ); mSelectedBox->takeItem( item ); mSelectedBox->insertItem( item, i - 1 ); mSelectedBox->setCurrentItem( item ); @@ -201,7 +205,7 @@ void ViewConfigureFieldsPage::slotMoveDown() { int i = mSelectedBox->currentItem(); if ( i > -1 && i < (int)mSelectedBox->count() - 1 ) { - QListBoxItem *item = mSelectedBox->item( i ); + Q3ListBoxItem *item = mSelectedBox->item( i ); mSelectedBox->takeItem( item ); mSelectedBox->insertItem( item, i + 1 ); mSelectedBox->setCurrentItem( item ); @@ -219,11 +223,11 @@ void ViewConfigureFieldsPage::initGUI() setCaption( i18n("Select Fields to Display") ); - QGridLayout *gl = 0; + Q3GridLayout *gl = 0; if (orientation == 0) - gl = new QGridLayout( this , 6, 4, 0, KDialog::spacingHint() ); + gl = new Q3GridLayout( this , 6, 4, 0, KDialog::spacingHint() ); else - gl = new QGridLayout( this , 4, 6, 0, KDialog::spacingHint() ); + gl = new Q3GridLayout( this , 4, 6, 0, KDialog::spacingHint() ); #ifndef KAB_EMBEDDED mCategoryCombo = new KComboBox( false, this ); @@ -249,20 +253,20 @@ void ViewConfigureFieldsPage::initGUI() gl->addWidget( label, 2, 0 ); - mUnSelectedBox = new QListBox( this ); - mUnSelectedBox->setSelectionMode( QListBox::Extended ); + mUnSelectedBox = new Q3ListBox( this ); + mUnSelectedBox->setSelectionMode( Q3ListBox::Extended ); mUnSelectedBox->setMinimumHeight( 80 ); if (orientation == 0) gl->addWidget( mUnSelectedBox, 1, 0 ); else gl->addWidget( mUnSelectedBox, 0, 1 ); - mSelectedBox = new QListBox( this ); + mSelectedBox = new Q3ListBox( this ); //if ( QApplication::desktop()->width() < 320 ) { // mUnSelectedBox->setMaximumWidth( 134 ); // mSelectedBox->setMaximumWidth( 134 ); //} - mSelectedBox->setSelectionMode( QListBox::Extended ); + mSelectedBox->setSelectionMode( Q3ListBox::Extended ); mSelectedBox->setMinimumHeight( 80 ); label->setBuddy( mSelectedBox ); if (orientation == 0) @@ -270,11 +274,11 @@ void ViewConfigureFieldsPage::initGUI() else gl->addWidget( mSelectedBox, 2, 1 ); - QBoxLayout *vb1 = 0; + Q3BoxLayout *vb1 = 0; if (orientation == 0) - vb1 = new QBoxLayout( QBoxLayout::TopToBottom, KDialog::spacingHint() ); + vb1 = new Q3BoxLayout( Q3BoxLayout::TopToBottom, KDialog::spacingHint() ); else - vb1 = new QBoxLayout( QBoxLayout::LeftToRight, KDialog::spacingHint() ); + vb1 = new Q3BoxLayout( Q3BoxLayout::LeftToRight, KDialog::spacingHint() ); vb1->addStretch(); @@ -301,11 +305,11 @@ void ViewConfigureFieldsPage::initGUI() else gl->addLayout( vb1, 1, 1 ); - QBoxLayout *vb2 = 0; + Q3BoxLayout *vb2 = 0; if (orientation == 0) - vb2 = new QBoxLayout( QBoxLayout::TopToBottom, KDialog::spacingHint() ); + vb2 = new Q3BoxLayout( Q3BoxLayout::TopToBottom, KDialog::spacingHint() ); else - vb2 = new QBoxLayout( QBoxLayout::LeftToRight, KDialog::spacingHint() ); + vb2 = new Q3BoxLayout( Q3BoxLayout::LeftToRight, KDialog::spacingHint() ); vb2->addStretch(); @@ -340,12 +344,12 @@ void ViewConfigureFieldsPage::initGUI() connect( mUnSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); connect( mSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); - connect( mSelectedBox, SIGNAL( currentChanged( QListBoxItem * ) ), SLOT( slotButtonsEnabled() ) ); + connect( mSelectedBox, SIGNAL( currentChanged( Q3ListBoxItem * ) ), SLOT( slotButtonsEnabled() ) ); slotButtonsEnabled(); } -#ifndef KAB_EMBEDDED -#include "viewconfigurefieldspage.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_viewconfigurefieldspage.cpp" #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 @@ -35,8 +35,8 @@ class KComboBox; class QComboBox; #endif //KAB_EMBEDDED -class QListBox; -class QListBoxItem; +class Q3ListBox; +class Q3ListBoxItem; class QPushButton; class QToolButton; @@ -68,8 +68,8 @@ class ViewConfigureFieldsPage : public QWidget #else //KAB_EMBEDDED QComboBox *mCategoryCombo; #endif //KAB_EMBEDDED - QListBox *mSelectedBox; - QListBox *mUnSelectedBox; + Q3ListBox *mSelectedBox; + Q3ListBox *mUnSelectedBox; QToolButton *mAddButton; QToolButton *mRemoveButton; QToolButton *mUpButton; diff --git a/kaddressbook/viewconfigurefilterpage.cpp b/kaddressbook/viewconfigurefilterpage.cpp index b085a5e..cdb778b 100644 --- a/kaddressbook/viewconfigurefilterpage.cpp +++ b/kaddressbook/viewconfigurefilterpage.cpp @@ -27,10 +27,13 @@ #include <qcombobox.h> #endif //KAB_EMBEDDED -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qlabel.h> #include <qlayout.h> #include <qradiobutton.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> #include <kconfig.h> #include <kdialog.h> @@ -44,9 +47,9 @@ ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this, 0, KDialog::spacingHint() ); - mFilterGroup = new QButtonGroup(); + mFilterGroup = new Q3ButtonGroup(); connect( mFilterGroup, SIGNAL( clicked( int ) ), SLOT( buttonClicked( int ) ) ); QLabel *label = new QLabel( i18n( "The default filter will be activated whenever" @@ -68,7 +71,7 @@ ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent, mFilterGroup->insert( button ); topLayout->addWidget( button ); - QBoxLayout *comboLayout = new QHBoxLayout(); + Q3BoxLayout *comboLayout = new Q3HBoxLayout(); topLayout->addLayout( comboLayout ); button = new QRadioButton( i18n( "Use filter:" ), this ); mFilterGroup->insert( button ); @@ -132,6 +135,6 @@ void ViewConfigureFilterPage::buttonClicked( int id ) mFilterCombo->setEnabled( id == 2 ); } -#ifndef KAB_EMBEDDED -#include "viewconfigurefilterpage.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_viewconfigurefilterpage.cpp" #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 @@ -26,7 +26,7 @@ #include <qwidget.h> -class QButtonGroup; +class Q3ButtonGroup; #ifndef KAB_EMBEDDED class KComboBox; @@ -57,7 +57,7 @@ class ViewConfigureFilterPage : public QWidget QComboBox *mFilterCombo; #endif //KAB_EMBEDDED - QButtonGroup *mFilterGroup; + Q3ButtonGroup *mFilterGroup; }; #endif diff --git a/kaddressbook/viewconfigurewidget.cpp b/kaddressbook/viewconfigurewidget.cpp index 666e188..047df8c 100644 --- a/kaddressbook/viewconfigurewidget.cpp +++ b/kaddressbook/viewconfigurewidget.cpp @@ -24,7 +24,7 @@ #ifndef KAB_EMBEDDED -#include <qvbox.h> +#include <q3vbox.h> #include <kapplication.h> #include <kconfig.h> @@ -37,6 +37,9 @@ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <QPixmap> #include <kjanuswidget.h> #include <kglobal.h> @@ -50,14 +53,14 @@ ViewConfigureWidget::ViewConfigureWidget( KABC::AddressBook *ab, QWidget *parent const char *name ) : ConfigureWidget( ab, parent, name ) { - QVBoxLayout *topLayout = new QVBoxLayout( this ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( this ); mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); topLayout->addWidget( mMainWidget ); // Add the first page, the attributes - QVBox *page = addPage( i18n( "Fields" ), QString::null, + Q3VBox *page = addPage( i18n( "Fields" ), QString::null, KGlobal::iconLoader()->loadIcon( "view_detailed", KIcon::Panel, 16 ) ); @@ -93,13 +96,13 @@ void ViewConfigureWidget::saveSettings( KConfig *config ) mFilterPage->saveSettings( config ); } -QVBox *ViewConfigureWidget::addPage( const QString &item, const QString &header, +Q3VBox *ViewConfigureWidget::addPage( const QString &item, const QString &header, const QPixmap &pixmap ) { return mMainWidget->addVBoxPage( item, header, pixmap ); } -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> #include <qlayout.h> #include <stdlib.h> @@ -152,8 +155,6 @@ void ViewConfigureDialog::slotHelp() #endif //KAB_EMBEDDED } -#ifndef KAB_EMBEDDED -#include "viewconfigurewidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_viewconfigurewidget.cpp" #endif //KAB_EMBEDDED - - diff --git a/kaddressbook/viewconfigurewidget.h b/kaddressbook/viewconfigurewidget.h index 0c2b77c..e3b9b12 100644 --- a/kaddressbook/viewconfigurewidget.h +++ b/kaddressbook/viewconfigurewidget.h @@ -28,7 +28,7 @@ #include "configurewidget.h" -class QVBox; +class Q3VBox; #include <kdialogbase.h> #include <qpixmap.h> @@ -74,7 +74,7 @@ class ViewConfigureWidget : public ConfigureWidget /** Use this method to add new pages to the widget. */ - QVBox *addPage( const QString &item, const QString &header = QString::null, + Q3VBox *addPage( const QString &item, const QString &header = QString::null, const QPixmap &pixmap = QPixmap() ); private: diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index b5d9419..5cfe3ad 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp @@ -50,7 +50,10 @@ $Id$ #include <qaction.h> #include <qmessagebox.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <QDropEvent> #include <kconfigbase.h> #endif //KAB_EMBEDDED @@ -61,7 +64,8 @@ $Id$ #include <qlayout.h> #include <qapplication.h> -#include <qwidgetstack.h> +#include <QDesktopWidget> +#include <q3widgetstack.h> #include <kabc/addressbook.h> #include "filtereditdialog.h" @@ -117,7 +121,7 @@ void ViewManager::restoreSettings() // been modified by global settings QString _oldgroup = mCore->config()->group(); - QDictIterator<KAddressBookView> it( mViewDict ); + Q3DictIterator<KAddressBookView> it( mViewDict ); for ( it.toFirst(); it.current(); ++it ) { KConfigGroupSaver saver( mCore->config(), it.currentKey() ); it.current()->readConfig( mCore->config() ); @@ -131,7 +135,7 @@ void ViewManager::saveSettings() { QString _oldgroup = mCore->config()->group(); - QDictIterator<KAddressBookView> it( mViewDict ); + Q3DictIterator<KAddressBookView> it( mViewDict ); for ( it.toFirst(); it.current(); ++it ) { KConfigGroupSaver saver( mCore->config(), it.currentKey() ); #ifdef DESKTOP_VERSION @@ -161,7 +165,7 @@ QStringList ViewManager::selectedUids() const QStringList ViewManager::selectedEmails() const { if ( mActiveView ) - return mActiveView->selectedEmails(); + return QStringList(mActiveView->selectedEmails()); else return QStringList(); } @@ -556,7 +560,7 @@ void ViewManager::startDrag() addrList.append( mCore->addressBook()->findByUid( *iter ) ); KMultipleDrag *drag = new KMultipleDrag( this ); - drag->addDragObject( new QTextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) ); + drag->addDragObject( new Q3TextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) ); KABC::Addressee::List::Iterator it; QStringList vcards; for ( it = addrList.begin(); it != addrList.end(); ++it ) { @@ -659,9 +663,9 @@ void ViewManager::initActions() //US <Separator/> #ifdef KAB_EMBEDDED - QPopupMenu *viewmenu = (QPopupMenu*)mCore->getViewMenu(); - QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); - QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu(); + Q3PopupMenu *viewmenu = (Q3PopupMenu*)mCore->getViewMenu(); + Q3PopupMenu *settingsmenu = (Q3PopupMenu*)mCore->getSettingsMenu(); + Q3PopupMenu *filtermenu = (Q3PopupMenu*)mCore->getFilterMenu(); #endif //KAB_EMBEDDED mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); @@ -738,11 +742,11 @@ void ViewManager::initActions() void ViewManager::initGUI() { - QHBoxLayout *layout = new QHBoxLayout( this, 0, 0 ); - mViewWidgetStack = new QWidgetStack( this ); + Q3HBoxLayout *layout = new Q3HBoxLayout( this, 0, 0 ); + mViewWidgetStack = new Q3WidgetStack( this ); layout->addWidget( mViewWidgetStack ); } -#ifndef KAB_EMBEDDED -#include "viewmanager.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_viewmanager.cpp" #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 @@ -26,15 +26,17 @@ #include <qwidget.h> #include <qstringlist.h> +//Added by qt3to4: +#include <QDropEvent> #include <kaddressbookview.h> -#include <qdict.h> +#include <q3dict.h> #include "filter.h" class KAction; class KSelectAction; class KABCore; -class QWidgetStack; +class Q3WidgetStack; class QDropEvent; namespace KABC { class AddressBook; } @@ -145,11 +147,11 @@ class ViewManager : public QWidget Filter mCurrentFilter; Filter::List mFilterList; - QDict<KAddressBookView> mViewDict; - QDict<ViewFactory> mViewFactoryDict; + Q3Dict<KAddressBookView> mViewDict; + Q3Dict<ViewFactory> mViewFactoryDict; QStringList mViewNameList; - QWidgetStack *mViewWidgetStack; + Q3WidgetStack *mViewWidgetStack; KAddressBookView *mActiveView; KAction *mActionDeleteView; 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 @@ -34,6 +34,14 @@ #include <qcursor.h> #include <qtooltip.h> #include <qapplication.h> +//Added by qt3to4: +#include <QKeyEvent> +#include <Q3PtrList> +#include <QResizeEvent> +#include <QFocusEvent> +#include <QMouseEvent> +#include <QEvent> +#include <QWheelEvent> #include "kabprefs.h" #include <kdebug.h> @@ -71,11 +79,11 @@ class CardViewTip : public QLabel { // Warning: make sure you use findRef() instead of find() to find an // item! Only the pointer value is unique in the list. // -class CardViewItemList : public QPtrList<CardViewItem> +class CardViewItemList : public Q3PtrList<CardViewItem> { protected: - virtual int compareItems(QPtrCollection::Item item1, - QPtrCollection::Item item2) + virtual int compareItems(Q3PtrCollection::Item item1, + Q3PtrCollection::Item item2) { CardViewItem *cItem1 = (CardViewItem*)item1; CardViewItem *cItem2 = (CardViewItem*)item2; @@ -161,7 +169,7 @@ class CardViewPrivate {}; CardViewItemList mItemList; - QPtrList<CardViewSeparator> mSeparatorList; + Q3PtrList<CardViewSeparator> mSeparatorList; QFontMetrics *mFm; QFontMetrics *mBFm; // bold font QFont mHeaderFont; // custom header font @@ -208,7 +216,7 @@ class CardViewItemPrivate QString mCaption; - QPtrList< CardViewItem::Field > mFieldList; + Q3PtrList< CardViewItem::Field > mFieldList; bool mSelected; int x; // horizontal position, set by the view int y; // vertical position, set by the view @@ -313,7 +321,7 @@ void CardViewItem::paintCard(QPainter *p, QColorGroup &cg) p->restore(); // Go through the fields and draw them - QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); + Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList); QString label, value; int yPos = mg + 4 + bFm.height()/* + 1*/ + fm.height(); // why the + 1 ??? (anders) p->setPen(cg.text()); @@ -408,12 +416,12 @@ int CardViewItem::height( bool allowCache ) const int fieldHeight = 0; int lines; int maxLines( mView->maxFieldLines() ); - QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); + Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList); for (iter.toFirst(); iter.current(); ++iter) { if ( !sef && (*iter)->second.isEmpty() ) continue; - lines = QMIN( (*iter)->second.contains('\n') + 1, maxLines ); + lines = QMIN( (*iter)->second.count('\n') + 1, maxLines ); fieldHeight += ( lines * fh ) + 2;//sp; } @@ -450,7 +458,7 @@ void CardViewItem::removeField(const QString &label) { CardViewItem::Field *f; - QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); + Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList); for (iter.toFirst(); iter.current(); ++iter) { f = *iter; @@ -523,7 +531,7 @@ void CardViewItem::setCaption(const QString &caption) QString CardViewItem::fieldValue(const QString &label) { - QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); + Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList); for (iter.toFirst(); iter.current(); ++iter) if ((*iter)->first == label) return (*iter)->second; @@ -569,7 +577,7 @@ void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip ) Field *_f; for (_f = d->mFieldList.first(); _f != f; _f = d->mFieldList.next()) if ( se || ! _f->second.isEmpty() ) - y += ( QMIN(_f->second.contains('\n')+1, maxLines) * fh ) + 2; + y += ( QMIN(_f->second.count('\n')+1, maxLines) * fh ) + 2; // } if ( isLabel && itempos.y() > y + fh ) return; @@ -586,7 +594,7 @@ void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip ) trimmed = mView->d->mFm->width( s ) > mw - colonWidth; } else { QRect r( mView->d->mFm->boundingRect( 0, 0, INT_MAX, INT_MAX, Qt::AlignTop|Qt::AlignLeft, s ) ); - trimmed = r.width() > mw || r.height()/fh > QMIN(s.contains('\n') + 1, maxLines); + trimmed = r.width() > mw || r.height()/fh > QMIN(s.count('\n') + 1, maxLines); } } if ( trimmed ) @@ -626,7 +634,7 @@ CardViewItem::Field *CardViewItem::fieldAt( const QPoint & itempos ) const for ( f = d->mFieldList.first(); f; f = d->mFieldList.next() ) { if ( showEmpty || !f->second.isEmpty() ) - ypos += ( QMIN( f->second.contains('\n')+1, maxLines ) *fh)+2; + ypos += ( QMIN( f->second.count('\n')+1, maxLines ) *fh)+2; if ( iy <= ypos ) break; } @@ -637,7 +645,7 @@ CardViewItem::Field *CardViewItem::fieldAt( const QPoint & itempos ) const //BEGIN CardView CardView::CardView(QWidget *parent, const char *name) - : QScrollView(parent, name), + : Q3ScrollView(parent, name), d(new CardViewPrivate()) { mFlagKeyPressed = false; @@ -656,13 +664,13 @@ CardView::CardView(QWidget *parent, const char *name) viewport()->setMouseTracking( true ); viewport()->setFocusProxy(this); - viewport()->setFocusPolicy(WheelFocus); - viewport()->setBackgroundMode(PaletteBase); + viewport()->setFocusPolicy(Qt::WheelFocus); + viewport()->setBackgroundMode(Qt::PaletteBase); connect( d->mTimer, SIGNAL(timeout()), this, SLOT(tryShowFullText()) ); //US setBackgroundMode(PaletteBackground, PaletteBase); - setBackgroundMode(PaletteBackground); + setBackgroundMode(Qt::PaletteBackground); // no reason for a vertical scrollbar setVScrollBarMode(AlwaysOff); @@ -739,7 +747,7 @@ void CardView::setCurrentItem( CardViewItem *item ) CardViewItem *CardView::itemAt(const QPoint &viewPos) { CardViewItem *item = 0; - QPtrListIterator<CardViewItem> iter(d->mItemList); + Q3PtrListIterator<CardViewItem> iter(d->mItemList); bool found = false; for (iter.toFirst(); iter.current() && !found; ++iter) { @@ -787,7 +795,7 @@ CardView::SelectionMode CardView::selectionMode() const void CardView::selectAll(bool state) { - QPtrListIterator<CardViewItem> iter(d->mItemList); + Q3PtrListIterator<CardViewItem> iter(d->mItemList); if (!state) { for (iter.toFirst(); iter.current(); ++iter) @@ -878,7 +886,7 @@ bool CardView::isSelected(CardViewItem *item) const CardViewItem *CardView::selectedItem() const { // find the first selected item - QPtrListIterator<CardViewItem> iter(d->mItemList); + Q3PtrListIterator<CardViewItem> iter(d->mItemList); for (iter.toFirst(); iter.current(); ++iter) { if ((*iter)->isSelected()) @@ -955,7 +963,7 @@ void CardView::drawContents(QPainter *p, int clipx, int clipy, viewport()->erase( QRect ( cX, cY , clipw, cliph ) ); // Now tell the cards to draw, if they are in the clip region - QPtrListIterator<CardViewItem> iter(d->mItemList); + Q3PtrListIterator<CardViewItem> iter(d->mItemList); for (iter.toFirst(); iter.current(); ++iter) { item = *iter; @@ -975,7 +983,7 @@ void CardView::drawContents(QPainter *p, int clipx, int clipy, } // Followed by the separators if they are in the clip region - QPtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); + Q3PtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); for (sepIter.toFirst(); sepIter.current(); ++sepIter) { sep = *sepIter; @@ -993,7 +1001,7 @@ void CardView::drawContents(QPainter *p, int clipx, int clipy, void CardView::resizeEvent(QResizeEvent *e) { - QScrollView::resizeEvent(e); + Q3ScrollView::resizeEvent(e); setLayoutDirty(true); } @@ -1013,7 +1021,7 @@ void CardView::calcLayout() // delete the old separators d->mSeparatorList.clear(); - QPtrListIterator<CardViewItem> iter(d->mItemList); + Q3PtrListIterator<CardViewItem> iter(d->mItemList); CardViewItem *item = 0; CardViewSeparator *sep = 0; xPos += cardSpacing; @@ -1056,7 +1064,7 @@ void CardView::calcLayout() // Update the height of all the separators now that we know the // max height of a column - QPtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); + Q3PtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); for (sepIter.toFirst(); sepIter.current(); ++sepIter) { (*sepIter)->mRect.setHeight(maxHeight - 2*cardSpacing - 2*d->mItemMargin); @@ -1101,7 +1109,7 @@ void CardView::setItemSpacing( uint spacing ) void CardView::contentsMousePressEvent(QMouseEvent *e) { - QScrollView::contentsMousePressEvent(e); + Q3ScrollView::contentsMousePressEvent(e); QPoint pos = e->pos(); d->mLastClickPos = pos; @@ -1171,7 +1179,7 @@ void CardView::contentsMousePressEvent(QMouseEvent *e) bool s = ! item->isSelected(); - if ( s && ! (e->state() & ControlButton) ) + if ( s && ! (e->state() & Qt::ControlButton) ) { bool b = signalsBlocked(); blockSignals(true); @@ -1219,7 +1227,7 @@ void CardView::contentsMousePressEvent(QMouseEvent *e) void CardView::contentsMouseReleaseEvent(QMouseEvent *e) { - QScrollView::contentsMouseReleaseEvent(e); + Q3ScrollView::contentsMouseReleaseEvent(e); if ( d->mResizeAnchor ) { @@ -1257,7 +1265,7 @@ void CardView::contentsMouseReleaseEvent(QMouseEvent *e) void CardView::contentsMouseDoubleClickEvent(QMouseEvent *e) { - QScrollView::contentsMouseDoubleClickEvent(e); + Q3ScrollView::contentsMouseDoubleClickEvent(e); CardViewItem *item = itemAt(e->pos()); @@ -1302,12 +1310,12 @@ void CardView::contentsMouseMoveEvent( QMouseEvent *e ) int m = e->x()%colw; if ( m >= colcontentw && m > 0 ) { - setCursor( SplitVCursor ); // Why does this fail sometimes? + setCursor( Qt::SplitVCursor ); // Why does this fail sometimes? d->mOnSeparator = true; } else { - setCursor( ArrowCursor ); + setCursor( Qt::ArrowCursor ); d->mOnSeparator = false; } } @@ -1324,7 +1332,7 @@ void CardView::leaveEvent( QEvent * ) if (d->mOnSeparator) { d->mOnSeparator = false; - setCursor( ArrowCursor ); + setCursor( Qt::ArrowCursor ); } } @@ -1368,21 +1376,21 @@ void CardView::keyPressEvent( QKeyEvent *e ) switch ( e->key() ) { - case Key_Up: + case Qt::Key_Up: if ( pos > 0 ) { aItem = d->mItemList.at( pos - 1 ); setCurrentItem( aItem ); } break; - case Key_Down: + case Qt::Key_Down: if ( pos < d->mItemList.count() - 1 ) { aItem = d->mItemList.at( pos + 1 ); setCurrentItem( aItem ); } break; - case Key_Left: + case Qt::Key_Left: { // look for an item in the previous/next column, starting from // the vertical middle of the current item. @@ -1400,7 +1408,7 @@ void CardView::keyPressEvent( QKeyEvent *e ) setCurrentItem( aItem ); } break; - case Key_Right: + case Qt::Key_Right: { // FIXME use nice calculated measures!!! QPoint aPoint( d->mCurrentItem->d->x + d->mItemWidth, d->mCurrentItem->d->y ); @@ -1415,15 +1423,15 @@ void CardView::keyPressEvent( QKeyEvent *e ) setCurrentItem( aItem ); } break; - case Key_Home: + case Qt::Key_Home: aItem = d->mItemList.first(); setCurrentItem( aItem ); break; - case Key_End: + case Qt::Key_End: aItem = d->mItemList.last(); setCurrentItem( aItem ); break; - case Key_Prior: // PageUp + case Qt::Key_Prior: // PageUp { // QListView: "Make the item above the top visible and current" // TODO if contentsY(), pick the top item of the leftmost visible column @@ -1436,7 +1444,7 @@ void CardView::keyPressEvent( QKeyEvent *e ) setCurrentItem( aItem ); } break; - case Key_Next: // PageDown + case Qt::Key_Next: // PageDown { // QListView: "Make the item below the bottom visible and current" // find the first not fully visible column. @@ -1458,19 +1466,19 @@ void CardView::keyPressEvent( QKeyEvent *e ) setCurrentItem( aItem ); } break; - case Key_Space: + case Qt::Key_Space: setSelected( d->mCurrentItem, !d->mCurrentItem->isSelected() ); emit selectionChanged(); break; - case Key_Return: - case Key_Enter: + case Qt::Key_Return: + case Qt::Key_Enter: { emit returnPressed( d->mCurrentItem ); emit executed( d->mCurrentItem ); } break; default: - if ( (e->state() & ControlButton) && e->key() == Key_A ) + if ( (e->state() & Qt::ControlButton) && e->key() == Qt::Key_A ) { // select all selectAll( true ); @@ -1488,7 +1496,7 @@ void CardView::keyPressEvent( QKeyEvent *e ) { if ( d->mSelectionMode == CardView::Extended ) { - if ( (e->state() & ShiftButton) ) + if ( (e->state() & Qt::ShiftButton) ) { // shift button: toggle range // if control button is pressed, leave all items @@ -1519,7 +1527,7 @@ void CardView::keyPressEvent( QKeyEvent *e ) } emit selectionChanged(); } - else if ( (e->state() & ControlButton) ) + else if ( (e->state() & Qt::ControlButton) ) { // control button: do nothing } @@ -1638,9 +1646,9 @@ void CardView::drawRubberBands( int pos ) int h = visibleHeight(); QPainter p( viewport() ); - p.setRasterOp( XorROP ); - p.setPen( gray ); - p.setBrush( gray ); + p.setCompositionMode( QPainter::CompositionMode_Xor ); + p.setPen( Qt::gray ); + p.setBrush( Qt::gray ); uint n = d->first; // erase if ( d->mRubberBandAnchor ) @@ -1699,7 +1707,7 @@ QFont CardView::headerFont() const void CardView::setFont( const QFont &fnt ) { - QScrollView::setFont( fnt ); + Q3ScrollView::setFont( fnt ); delete d->mFm; d->mFm = new QFontMetrics( fnt ); } @@ -1736,7 +1744,7 @@ void CardView::keyReleaseEvent ( QKeyEvent * e ) mFlagBlockKeyPressed = false; mFlagKeyPressed = false; } - QScrollView::keyReleaseEvent ( e ); + Q3ScrollView::keyReleaseEvent ( e ); } @@ -1745,6 +1753,6 @@ void CardView::keyReleaseEvent ( QKeyEvent * e ) //END Cardview -#ifndef KAB_EMBEDDED -#include "cardview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_cardview.cpp" #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,12 +1,20 @@ #ifndef CARDVIEW_H #define CARDVIEW_H -#include <qscrollview.h> -#include <qptrlist.h> +#include <q3scrollview.h> +#include <q3ptrlist.h> #include <qstring.h> #include <qrect.h> #include <qpair.h> #include <qpoint.h> +//Added by qt3to4: +#include <QWheelEvent> +#include <QResizeEvent> +#include <QFocusEvent> +#include <QLabel> +#include <QMouseEvent> +#include <QKeyEvent> +#include <QEvent> class QLabel; class QPainter; @@ -148,7 +156,7 @@ class CardViewItem * can be used elsewhere. With the exception of a few simple config checks, * the CardView is also 100% independant of KDE. */ -class CardView : public QScrollView +class CardView : public Q3ScrollView { friend class CardViewItem; 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 @@ -19,6 +19,11 @@ */ #include <qpainter.h> +//Added by qt3to4: +#include <QDragEnterEvent> +#include <QDropEvent> +#include <QDragMoveEvent> +#include <QDragLeaveEvent> #include <kcolordialog.h> @@ -31,11 +36,11 @@ #include <qcolordialog.h> #endif -ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f ) +ColorListBox::ColorListBox( QWidget *parent, const char *name, Qt::WFlags f ) :KListBox( parent, name, f ), mCurrentOnDragEnter(-1) { connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) ); - connect( this, SIGNAL(clicked(QListBoxItem *)), this, SLOT(slotNewColor(QListBoxItem *)) ); + connect( this, SIGNAL(clicked(Q3ListBoxItem *)), this, SLOT(slotNewColor(Q3ListBoxItem *)) ); setAcceptDrops( true); } @@ -47,7 +52,7 @@ void ColorListBox::setEnabled( bool state ) return; } - QListBox::setEnabled( state ); + Q3ListBox::setEnabled( state ); for( uint i=0; i<count(); i++ ) { updateItem( i ); @@ -75,10 +80,10 @@ QColor ColorListBox::color( uint index ) const } else { - return( black ); + return( Qt::black ); } } -void ColorListBox::slotNewColor(QListBoxItem * i) +void ColorListBox::slotNewColor(Q3ListBoxItem * i) { if ( i ) newColor( index( i ) ); @@ -198,7 +203,7 @@ qDebug("ColorListBox::dropEvent drag&drop currently not supported"); ColorListItem::ColorListItem( const QString &text, const QColor &color ) - : QListBoxItem(), mColor( color ), mBoxWidth( 30 ) + : Q3ListBoxItem(), mColor( color ), mBoxWidth( 30 ) { setText( text ); } @@ -229,17 +234,17 @@ void ColorListItem::paint( QPainter *p ) } -int ColorListItem::height(const QListBox *lb ) const +int ColorListItem::height(const Q3ListBox *lb ) const { return( lb->fontMetrics().lineSpacing()+1 ); } -int ColorListItem::width(const QListBox *lb ) const +int ColorListItem::width(const Q3ListBox *lb ) const { return( mBoxWidth + lb->fontMetrics().width( text() ) + 6 ); } -#ifndef KAB_EMBEDDED -#include "colorlistbox.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_colorlistbox.cpp" #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 @@ -22,6 +22,11 @@ #define _COLOR_LISTBOX_H_ #include <klistbox.h> +//Added by qt3to4: +#include <QDragMoveEvent> +#include <QDragLeaveEvent> +#include <QDropEvent> +#include <QDragEnterEvent> class QDragEnterEvent; class QDragLeaveEvent; @@ -33,7 +38,7 @@ class ColorListBox : public KListBox Q_OBJECT public: - ColorListBox( QWidget *parent=0, const char * name=0, WFlags f=0 ); + ColorListBox( QWidget *parent=0, const char * name=0, Qt::WFlags f=0 ); void setColor( uint index, const QColor &color ); QColor color( uint index ) const; @@ -48,7 +53,7 @@ class ColorListBox : public KListBox private slots: void newColor( int index ); - void slotNewColor(QListBoxItem * i); + void slotNewColor(Q3ListBoxItem * i); private: int mCurrentOnDragEnter; @@ -56,7 +61,7 @@ class ColorListBox : public KListBox }; -class ColorListItem : public QListBoxItem +class ColorListItem : public Q3ListBoxItem { public: ColorListItem( const QString &text, const QColor &color=Qt::black ); @@ -65,8 +70,8 @@ class ColorListItem : public QListBoxItem protected: virtual void paint( QPainter * ); - virtual int height( const QListBox * ) const; - virtual int width( const QListBox * ) const; + virtual int height( const Q3ListBox * ) const; + virtual int width( const Q3ListBox * ) const; private: QColor mColor; 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 @@ -25,11 +25,14 @@ #include <qlayout.h> #include <qlabel.h> #include <qcheckbox.h> -#include <qvbox.h> -#include <qgroupbox.h> +#include <q3vbox.h> +#include <q3groupbox.h> #include <qspinbox.h> #include <qtabwidget.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> #include <kdebug.h> #include <kglobal.h> @@ -89,7 +92,7 @@ void ConfigureCardViewWidget::saveSettings( KConfig *config ) //////////////////////// // CardViewLookNFeelPage CardViewLookNFeelPage::CardViewLookNFeelPage( QWidget *parent, const char *name ) - : QVBox( parent, name ) + : Q3VBox( parent, name ) { initGUI(); } @@ -234,28 +237,28 @@ void CardViewLookNFeelPage::initGUI() QTabWidget *tabs = new QTabWidget( this ); // Layout - QVBox *loTab = new QVBox( this, "layouttab" ); + Q3VBox *loTab = new Q3VBox( this, "layouttab" ); loTab->setSpacing( spacing ); loTab->setMargin( margin ); - QGroupBox *gbGeneral = new QGroupBox( 1, Qt::Horizontal, i18n("General"), loTab ); + Q3GroupBox *gbGeneral = new Q3GroupBox( 1, Qt::Horizontal, i18n("General"), loTab ); cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral ); - QHBox *hbSW = new QHBox( gbGeneral ); + Q3HBox *hbSW = new Q3HBox( gbGeneral ); QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW ); sbSepWidth = new QSpinBox( 1, 50, 1, hbSW ); lSW->setBuddy( sbSepWidth); - QHBox *hbPadding = new QHBox( gbGeneral ); + Q3HBox *hbPadding = new Q3HBox( gbGeneral ); QLabel *lSpacing = new QLabel( i18n("&Padding:"), hbPadding ); sbSpacing = new QSpinBox( 0, 100, 1, hbPadding ); lSpacing->setBuddy( sbSpacing ); - QGroupBox *gbCards = new QGroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab ); + Q3GroupBox *gbCards = new Q3GroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab ); - QHBox *hbMargin = new QHBox( gbCards ); + Q3HBox *hbMargin = new Q3HBox( gbCards ); QLabel *lMargin = new QLabel( i18n("&Margin:"), hbMargin ); sbMargin = new QSpinBox( 0, 100, 1, hbMargin ); lMargin->setBuddy( sbMargin ); @@ -264,23 +267,23 @@ void CardViewLookNFeelPage::initGUI() loTab->setStretchFactor( new QWidget( loTab ), 1 ); - QWhatsThis::add( sbMargin, i18n( + Q3WhatsThis::add( sbMargin, i18n( "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, " "incrementing the item margin will add space between the focus rectangle and the item data." ) ); - QWhatsThis::add( lMargin, QWhatsThis::textFor( sbMargin ) ); - QWhatsThis::add( sbSpacing, i18n( + /* TODO:hacker: Q3WhatsThis::add( lMargin, Q3WhatsThis::textFor( sbMargin ) ); */ + Q3WhatsThis::add( sbSpacing, i18n( "The Item Spacing decides the distance (in pixels) between the items and anything else: the view " "borders, other items or column separators." ) ); - QWhatsThis::add( lSpacing, QWhatsThis::textFor( sbSpacing ) ); - QWhatsThis::add( sbSepWidth, i18n("Sets the width of column separators") ); - QWhatsThis::add( lSW, QWhatsThis::textFor( sbSepWidth ) ); + /* TODO:hacker: Q3WhatsThis::add( lSpacing, Q3WhatsThis::textFor( sbSpacing ) ); */ + Q3WhatsThis::add( sbSepWidth, i18n("Sets the width of column separators") ); + /* TODO:hacker: Q3WhatsThis::add( lSW, Q3WhatsThis::textFor( sbSepWidth ) ); */ tabs->addTab( loTab, i18n("&Layout") ); // Colors - QVBox *colorTab = new QVBox( this, "colortab" ); + Q3VBox *colorTab = new Q3VBox( this, "colortab" ); colorTab->setSpacing( spacing ); colorTab->setMargin( spacing ); cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); @@ -288,16 +291,16 @@ void CardViewLookNFeelPage::initGUI() lbColors = new ColorListBox( colorTab ); tabs->addTab( colorTab, i18n("&Colors") ); - QWhatsThis::add( cbEnableCustomColors, i18n( + Q3WhatsThis::add( cbEnableCustomColors, i18n( "If custom colors are enabled, you may choose the colors for the view below. " "Otherwise colors from your current KDE color scheme are used." ) ); - QWhatsThis::add( lbColors, i18n( + Q3WhatsThis::add( lbColors, i18n( "Double click or press RETURN on a item to select a color for the related strings in the view." ) ); // Fonts - QVBox *fntTab = new QVBox( this, "fonttab" ); + Q3VBox *fntTab = new Q3VBox( this, "fonttab" ); fntTab->setSpacing( spacing ); fntTab->setMargin( spacing ); @@ -306,13 +309,13 @@ void CardViewLookNFeelPage::initGUI() connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); vbFonts = new QWidget( fntTab ); - QGridLayout *gFnts = new QGridLayout( vbFonts, 2, 3 ); + Q3GridLayout *gFnts = new Q3GridLayout( vbFonts, 2, 3 ); gFnts->setSpacing( spacing ); gFnts->setAutoAdd( true ); gFnts->setColStretch( 1, 1 ); QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); lTextFont = new QLabel( vbFonts ); - lTextFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); + lTextFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); #ifndef KAB_EMBEDDED btnFont = new KPushButton( i18n("Choose..."), vbFonts ); #else //KAB_EMBEDDED @@ -325,7 +328,7 @@ void CardViewLookNFeelPage::initGUI() QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); lHeaderFont = new QLabel( vbFonts ); - lHeaderFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); + lHeaderFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); #ifndef KAB_EMBEDDED btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); #else //KAB_EMBEDDED @@ -336,7 +339,7 @@ void CardViewLookNFeelPage::initGUI() fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); - QWhatsThis::add( cbEnableCustomFonts, i18n( + Q3WhatsThis::add( cbEnableCustomFonts, i18n( "If custom fonts are enabled, you may choose which fonts to use for this view below. " "Otherwise the default KDE font will be used, in bold style for the header and " "normal style for the data." @@ -345,7 +348,7 @@ void CardViewLookNFeelPage::initGUI() tabs->addTab( fntTab, i18n("&Fonts") ); // Behaviour - QVBox *behaviourTab = new QVBox( this ); + Q3VBox *behaviourTab = new Q3VBox( this ); behaviourTab->setMargin( margin ); behaviourTab->setSpacing( spacing ); @@ -364,6 +367,6 @@ void CardViewLookNFeelPage::updateFontLabel( QFont fnt, QLabel *l ) l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); } -#ifndef KAB_EMBEDDED -#include "configurecardviewdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_configurecardviewdialog.cpp" #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 @@ -26,9 +26,11 @@ #include "viewconfigurewidget.h" -#include <qvbox.h> +#include <q3vbox.h> #include <qwidget.h> #include <qfont.h> +//Added by qt3to4: +#include <QLabel> class QString; class QWidget; @@ -77,7 +79,7 @@ class ConfigureCardViewWidget : public ViewConfigureWidget * item spacing */ -class CardViewLookNFeelPage : public QVBox { +class CardViewLookNFeelPage : public Q3VBox { Q_OBJECT 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 @@ -27,11 +27,14 @@ #include <qlabel.h> #include <qradiobutton.h> #include <qcheckbox.h> -#include <qvbox.h> -#include <qbuttongroup.h> +#include <q3vbox.h> +#include <q3buttongroup.h> #include <qtabwidget.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> #include <kglobal.h> #include <klocale.h> @@ -84,7 +87,7 @@ void ConfigureTableViewWidget::saveSettings( KConfig *config ) LookAndFeelPage::LookAndFeelPage(QWidget *parent, const char *name) - : QVBox(parent, name) + : Q3VBox(parent, name) { initGUI(); @@ -229,12 +232,12 @@ void LookAndFeelPage::initGUI() QTabWidget *tabs = new QTabWidget( this ); // General - QVBox *generalTab = new QVBox( this, "generaltab" ); + Q3VBox *generalTab = new Q3VBox( this, "generaltab" ); generalTab->setSpacing( spacing ); generalTab->setMargin( margin ); - QButtonGroup *group = new QButtonGroup(1, Qt::Horizontal, + Q3ButtonGroup *group = new Q3ButtonGroup(1, Qt::Horizontal, i18n("Row Separator"), generalTab); mAlternateButton = new QRadioButton(i18n("Alternating backgrounds"), @@ -262,7 +265,7 @@ void LookAndFeelPage::initGUI() tabs->addTab( generalTab, i18n("&General") ); // Colors - QVBox *colorTab = new QVBox( this, "colortab" ); + Q3VBox *colorTab = new Q3VBox( this, "colortab" ); colorTab->setSpacing( spacing ); colorTab->setMargin( spacing ); cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); @@ -270,16 +273,16 @@ void LookAndFeelPage::initGUI() lbColors = new ColorListBox( colorTab ); tabs->addTab( colorTab, i18n("&Colors") ); - QWhatsThis::add( cbEnableCustomColors, i18n( + Q3WhatsThis::add( cbEnableCustomColors, i18n( "If custom colors are enabled, you may choose the colors for the view below. " "Otherwise colors from your current KDE color scheme are used." ) ); - QWhatsThis::add( lbColors, i18n( + Q3WhatsThis::add( lbColors, i18n( "Double click or press RETURN on a item to select a color for the related strings in the view." ) ); // Fonts - QVBox *fntTab = new QVBox( this, "fonttab" ); + Q3VBox *fntTab = new Q3VBox( this, "fonttab" ); fntTab->setSpacing( spacing ); fntTab->setMargin( spacing ); @@ -288,13 +291,13 @@ void LookAndFeelPage::initGUI() connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); vbFonts = new QWidget( fntTab ); - QGridLayout *gFnts = new QGridLayout( vbFonts, 2, 3 ); + Q3GridLayout *gFnts = new Q3GridLayout( vbFonts, 2, 3 ); gFnts->setSpacing( spacing ); gFnts->setAutoAdd( true ); gFnts->setColStretch( 1, 1 ); QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); lTextFont = new QLabel( vbFonts ); - lTextFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); + lTextFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); #ifndef KAB_EMBEDDED btnFont = new KPushButton( i18n("Choose..."), vbFonts ); #else //KAB_EMBEDDED @@ -307,7 +310,7 @@ void LookAndFeelPage::initGUI() QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); lHeaderFont = new QLabel( vbFonts ); - lHeaderFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); + lHeaderFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); #ifndef KAB_EMBEDDED btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); #else //KAB_EMBEDDED @@ -318,7 +321,7 @@ void LookAndFeelPage::initGUI() fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); - QWhatsThis::add( cbEnableCustomFonts, i18n( + Q3WhatsThis::add( cbEnableCustomFonts, i18n( "If custom fonts are enabled, you may choose which fonts to use for this view below. " "Otherwise the default KDE font will be used, in bold style for the header and " "normal style for the data." @@ -340,6 +343,6 @@ void LookAndFeelPage::updateFontLabel( QFont fnt, QLabel *l ) l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); } -#ifndef KAB_EMBEDDED -#include "configuretableviewdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_configuretableviewdialog.cpp" #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 @@ -26,7 +26,9 @@ #include "viewconfigurewidget.h" -#include <qvbox.h> +#include <q3vbox.h> +//Added by qt3to4: +#include <QLabel> class QString; class QWidget; @@ -63,7 +65,7 @@ class ConfigureTableViewWidget : public ViewConfigureWidget /** Internal class. It is only defined here for moc */ -class LookAndFeelPage : public QVBox +class LookAndFeelPage : public Q3VBox { Q_OBJECT 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 @@ -21,15 +21,20 @@ without including the source code for Qt in the source distribution. */ -#include <qheader.h> -#include <qiconset.h> +#include <q3header.h> +#include <qicon.h> #include <qimage.h> -#include <qdragobject.h> +#include <q3dragobject.h> #include <qcombobox.h> #include <qpainter.h> #include <qbrush.h> #include <qevent.h> #include <qapplication.h> +//Added by qt3to4: +#include <QDropEvent> +#include <QPixmap> +#include <QMouseEvent> +#include <QKeyEvent> #include <klocale.h> #include <kglobalsettings.h> @@ -47,12 +52,13 @@ // DynamicTip Methods DynamicTip::DynamicTip( ContactListView *parent) - : QToolTip( parent ) + /* TODO:hacker:: QToolTip( parent ) */ { } void DynamicTip::maybeTip( const QPoint &pos ) { + /* TODO:hacker: static bool ishidden = true; if (!parentWidget()->inherits( "ContactListView" )) return; @@ -63,7 +69,7 @@ void DynamicTip::maybeTip( const QPoint &pos ) QPoint posVp = plv->viewport()->pos(); - QListViewItem *lvi = plv->itemAt( pos - posVp ); + Q3ListViewItem *lvi = plv->itemAt( pos - posVp ); if (!lvi) return; @@ -151,7 +157,7 @@ void DynamicTip::maybeTip( const QPoint &pos ) else hide(); ishidden = !ishidden; - + */ } /////////////////////////// @@ -173,7 +179,7 @@ QString ContactListViewItem::key(int column, bool ascending) const int lan = KGlobal::locale()->language(); //qDebug("language %d ", lan); if ( lan == 1 ) { //GERMAN - QString ret = QListViewItem::key(column, ascending).lower().utf8(); + QString ret = Q3ListViewItem::key(column, ascending).lower().utf8(); int start = -1; while ( (start = ret.find( 'ä', start+1)) > 0 ) { ret.at(start-1) = 'a'; @@ -197,7 +203,7 @@ QString ContactListViewItem::key(int column, bool ascending) const } else #endif - return QListViewItem::key(column, ascending).lower(); + return Q3ListViewItem::key(column, ascending).lower(); } void ContactListViewItem::paintCell(QPainter * p, @@ -288,7 +294,7 @@ void ContactListView::printMe() return; QPainter p; p.begin ( &printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); @@ -343,7 +349,7 @@ void ContactListView::contentsMousePressEvent(QMouseEvent* e) // To initiate a drag operation void ContactListView::contentsMouseMoveEvent( QMouseEvent *e ) { - if ((e->state() & LeftButton) && (e->pos() - presspos).manhattanLength() > 4 ) { + if ((e->state() & Qt::LeftButton) && (e->pos() - presspos).manhattanLength() > 4 ) { emit startAddresseeDrag(); } else @@ -353,7 +359,7 @@ void ContactListView::contentsMouseMoveEvent( QMouseEvent *e ) bool ContactListView::acceptDrag(QDropEvent *e) const { #ifndef KAB_EMBEDDED - return QTextDrag::canDecode(e); + return Q3TextDrag::canDecode(e); #else //KAB_EMBEDDED qDebug("ContactListView::acceptDrag has to be fixed"); return false; @@ -424,6 +430,6 @@ void ContactListView::keyReleaseEvent ( QKeyEvent * e ) } KListView::keyReleaseEvent ( e ); } -#ifndef KAB_EMBEDDED -#include "contactlistview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_contactlistview.cpp" #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 @@ -5,6 +5,10 @@ #include <qpixmap.h> #include <qtooltip.h> #include <qstring.h> +//Added by qt3to4: +#include <QDropEvent> +#include <QMouseEvent> +#include <QKeyEvent> #include <klistview.h> @@ -20,7 +24,7 @@ class ContactListView; /** The whole tooltip design needs a lot of work. Currently it is * hacked together to function. */ -class DynamicTip : public QToolTip +class DynamicTip /* TODO:hacker: : public QToolTip */ { public: DynamicTip( ContactListView * parent ); 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 @@ -21,13 +21,18 @@ without including the source code for Qt in the source distribution. */ -#include <qdragobject.h> +#include <q3dragobject.h> #include <qevent.h> -#include <qiconview.h> +#include <q3iconview.h> #include <qlayout.h> #include <qstringlist.h> #include <qregexp.h> #include <qapplication.h> +//Added by qt3to4: +#include <QDropEvent> +#include <QKeyEvent> +#include <Q3VBoxLayout> +#include <QDragEnterEvent> #include <kabc/addressbook.h> #include <kabc/addressee.h> @@ -125,7 +130,7 @@ void AddresseeCardView::printMe() return; QPainter p; p.begin ( &printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); @@ -148,7 +153,7 @@ void AddresseeCardView::printMe() void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e) { #ifndef KAB_EMBEDDED - if (QTextDrag::canDecode(e)) + if (Q3TextDrag::canDecode(e)) e->accept(); #else //KAB_EMBEDDED qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented"); @@ -176,7 +181,7 @@ KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab, mShowEmptyFields = false; // Init the GUI - QVBoxLayout *layout = new QVBoxLayout(viewWidget()); + Q3VBoxLayout *layout = new Q3VBoxLayout(viewWidget()); mCardView = new AddresseeCardView(viewWidget(), "mCardView"); mCardView->setSelectionMode(CardView::Extended); @@ -520,6 +525,6 @@ void KAddressBookCardView::addresseeSelected() emit selected(QString::null); } -#ifndef KAB_EMBEDDED -#include "kaddressbookcardview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kaddressbookcardview.cpp" #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 @@ -25,6 +25,9 @@ */ #include <qstring.h> +//Added by qt3to4: +#include <QDragEnterEvent> +#include <QDropEvent> #ifndef KAB_EMBEDDED #include <kiconview.h> #else //KAB_EMBEDDED 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 @@ -22,7 +22,7 @@ */ #ifndef KAB_EMBEDDED -#include <qiconview.h> +#include <q3iconview.h> #include <qstringlist.h> #include <kabc/addressee.h> @@ -35,6 +35,14 @@ #else //KAB_EMBEDDED #endif //KAB_EMBEDDED +//Added by qt3to4: +#include <QDropEvent> +#include <Q3ValueList> +#include <QPixmap> +#include <QKeyEvent> +#include <QEvent> +#include <Q3VBoxLayout> + #include <kabc/addressbook.h> #include "kabprefs.h" #include "viewmanager.h" @@ -73,12 +81,12 @@ AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) : KIconView(parent, name) #else //KAB_EMBEDDED AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) - : QIconView(parent, name) + : Q3IconView(parent, name) #endif //KAB_EMBEDDED { - setSelectionMode( QIconView::Extended ); - setResizeMode( QIconView::Adjust ); + setSelectionMode( Q3IconView::Extended ); + setResizeMode( Q3IconView::Adjust ); setWordWrapIconText( true ); setGridX( 100 ); setItemsMovable(false); @@ -89,8 +97,8 @@ AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) #ifndef KAB_EMBEDDED - connect(this, SIGNAL(dropped(QDropEvent*, const QValueList<QIconDragItem>&)), - this, SLOT(itemDropped(QDropEvent*, const QValueList<QIconDragItem>&))); + connect(this, SIGNAL(dropped(QDropEvent*, const Q3ValueList<Q3IconDragItem>&)), + this, SLOT(itemDropped(QDropEvent*, const Q3ValueList<Q3IconDragItem>&))); #endif //KAB_EMBEDDED } @@ -100,12 +108,12 @@ AddresseeIconView::~AddresseeIconView() void AddresseeIconView::itemDropped(QDropEvent *e, - const QValueList<QIconDragItem> &) + const Q3ValueList<Q3IconDragItem> &) { emit addresseeDropped(e); } -QDragObject *AddresseeIconView::dragObject() +Q3DragObject *AddresseeIconView::dragObject() { emit startAddresseeDrag(); @@ -117,20 +125,20 @@ QDragObject *AddresseeIconView::dragObject() #ifndef KAB_EMBEDDED class AddresseeIconViewItem : public KIconViewItem #else //KAB_EMBEDDED -class AddresseeIconViewItem : public QIconViewItem +class AddresseeIconViewItem : public Q3IconViewItem #endif //KAB_EMBEDDED { public: #ifndef KAB_EMBEDDED AddresseeIconViewItem(const KABC::Field::List &fields, KABC::AddressBook *doc, const KABC::Addressee &a, - QIconView *parent) + Q3IconView *parent) : KIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) #else //KAB_EMBEDDED AddresseeIconViewItem(const KABC::Field::List &fields, KABC::AddressBook *doc, const KABC::Addressee &a, - QIconView *parent) - : QIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) + Q3IconView *parent) + : Q3IconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) #endif //KAB_EMBEDDED { if ( mFields.isEmpty() ) { @@ -200,7 +208,7 @@ KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, : KAddressBookView( ab, parent, name ) { // Init the GUI - QVBoxLayout *layout = new QVBoxLayout(viewWidget()); + Q3VBoxLayout *layout = new Q3VBoxLayout(viewWidget()); mIconView = new AddresseeIconView(viewWidget(), "mIconView"); layout->addWidget(mIconView); @@ -210,8 +218,8 @@ KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, //US method executed is part of KIconView //US connect(mIconView, SIGNAL(executed(QIconViewItem *)), //US this, SLOT(addresseeExecuted(QIconViewItem *))); - connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), - this, SLOT(addresseeExecuted(QIconViewItem *))); + connect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)), + this, SLOT(addresseeExecuted(Q3IconViewItem *))); connect(mIconView, SIGNAL(selectionChanged()), this, SLOT(addresseeSelected())); @@ -248,8 +256,8 @@ void KAddressBookIconView::readConfig(KConfig *config) //US method executed is part of KIconView //US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)), //US this, SLOT(addresseeExecuted(QIconViewItem *))); - disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), - this, SLOT(addresseeExecuted(QIconViewItem *))); + disconnect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)), + this, SLOT(addresseeExecuted(Q3IconViewItem *))); //US method executed is part of KIconView. Use selectionChanged instead /*US @@ -260,8 +268,8 @@ void KAddressBookIconView::readConfig(KConfig *config) connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)), this, SLOT(addresseeExecuted(QIconViewItem *))); */ - connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), - this, SLOT(addresseeExecuted(QIconViewItem *))); + connect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)), + this, SLOT(addresseeExecuted(Q3IconViewItem *))); } void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) @@ -336,7 +344,7 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) QStringList KAddressBookIconView::selectedUids() { QStringList uidList; - QIconViewItem *item; + Q3IconViewItem *item; AddresseeIconViewItem *aItem; for (item = mIconView->firstItem(); item; item = item->nextItem()) @@ -358,7 +366,7 @@ QStringList KAddressBookIconView::selectedUids() void KAddressBookIconView::refresh(QString uid) { - QIconViewItem *item; + Q3IconViewItem *item; AddresseeIconViewItem *aItem; if ( uid.isNull() ) { @@ -406,7 +414,7 @@ void KAddressBookIconView::refresh(QString uid) void KAddressBookIconView::setSelected(QString uid, bool selected) { - QIconViewItem *item; + Q3IconViewItem *item; AddresseeIconViewItem *aItem; if (uid.isNull()) @@ -435,7 +443,7 @@ void KAddressBookIconView::setSelected(QString uid, bool selected) } } -void KAddressBookIconView::addresseeExecuted(QIconViewItem *item) +void KAddressBookIconView::addresseeExecuted(Q3IconViewItem *item) { #ifndef KAB_EMBEDDED AddresseeIconViewItem *aItem = dynamic_cast<AddresseeIconViewItem*>(item); @@ -450,7 +458,7 @@ void KAddressBookIconView::addresseeExecuted(QIconViewItem *item) void KAddressBookIconView::addresseeSelected() { - QIconViewItem *item; + Q3IconViewItem *item; AddresseeIconViewItem *aItem; bool found = false; @@ -476,6 +484,6 @@ void KAddressBookIconView::addresseeSelected() emit selected(QString::null); } -#ifndef KAB_EMBEDDED -#include "kaddressbookiconview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kaddressbookiconview.cpp" #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 @@ -25,20 +25,23 @@ #define KADDRESSBOOKICONVIEW_H #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <QDropEvent> #ifndef KAB_EMBEDDED #include <kiconview.h> #else //KAB_EMBEDDED -#include <qiconview.h> -#include <qptrlist.h> +#include <q3iconview.h> +#include <q3ptrlist.h> #include <klocale.h> #endif //KAB_EMBEDDED #include "kaddressbookview.h" -class QIconViewItem; +class Q3IconViewItem; class KConfig; class AddresseeIconView; class AddresseeIconViewItem; -class QIconDragItem; +class Q3IconDragItem; class KAddressBookIconView; namespace KABC { class AddressBook; } @@ -68,30 +71,30 @@ class KAddressBookIconView : public KAddressBookView public slots: void refresh(QString uid = QString::null); #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN void setSelected(QString uid = QString::null, bool selected = true); -//MOC_SKIP_END +#endif #else //KAB_EMBEDDED //US my MOC do not like default parameters ??? void setSelected(QString uid, bool selected); #endif //KAB_EMBEDDED protected slots: - void addresseeExecuted(QIconViewItem *item); + void addresseeExecuted(Q3IconViewItem *item); void addresseeSelected(); private: AddresseeIconView *mIconView; - QPtrList<AddresseeIconViewItem> mIconList; + Q3PtrList<AddresseeIconViewItem> mIconList; }; #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN class AddresseeIconView : public KIconView -//MOC_SKIP_END +#endif #else //KAB_EMBEDDED -class AddresseeIconView : public QIconView +class AddresseeIconView : public Q3IconView #endif //KAB_EMBEDDED { Q_OBJECT @@ -105,10 +108,10 @@ class AddresseeIconView : public QIconView void startAddresseeDrag(); protected: - virtual QDragObject *dragObject(); + virtual Q3DragObject *dragObject(); protected slots: - void itemDropped(QDropEvent *, const QValueList<QIconDragItem> &); + void itemDropped(QDropEvent *, const Q3ValueList<Q3IconDragItem> &); }; class IconViewFactory : public ViewFactory 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,16 +1,20 @@ // $Id$ -#include <qvbox.h> -#include <qlistbox.h> +#include <q3vbox.h> +#include <q3listbox.h> #include <qwidget.h> #include <qfile.h> #include <qimage.h> #include <qcombobox.h> #include <qapplication.h> -#include <qdragobject.h> +#include <q3dragobject.h> #include <qevent.h> -#include <qurl.h> +#include <q3url.h> #include <qpixmap.h> +//Added by qt3to4: +#include <QDropEvent> +#include <QKeyEvent> +#include <Q3VBoxLayout> #include <kabc/addressbook.h> #include <kapplication.h> @@ -32,7 +36,7 @@ #include "viewmanager.h" #include <qlayout.h> -#include <qheader.h> +#include <q3header.h> #include <qregexp.h> #include "kaddressbooktableview.h" @@ -42,7 +46,7 @@ KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab, QWidget *parent, const char *name ) : KAddressBookView( ab, parent, name ) { - mainLayout = new QVBoxLayout( viewWidget(), 2 ); + mainLayout = new Q3VBoxLayout( viewWidget(), 2 ); // The list view will be created when the config is read. mListView = 0; @@ -77,14 +81,14 @@ void KAddressBookTableView::reconstructListView() { disconnect(mListView, SIGNAL(selectionChanged()), this, SLOT(addresseeSelected())); - disconnect(mListView, SIGNAL(executed(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); - disconnect(mListView, SIGNAL(doubleClicked(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); + disconnect(mListView, SIGNAL(executed(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); + disconnect(mListView, SIGNAL(doubleClicked(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); disconnect(mListView, SIGNAL(startAddresseeDrag()), this, SIGNAL(startDrag())); - disconnect(mListView, SIGNAL(returnPressed(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); + disconnect(mListView, SIGNAL(returnPressed(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); disconnect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, SIGNAL(dropped(QDropEvent*))); @@ -105,7 +109,7 @@ void KAddressBookTableView::reconstructListView() int c = 0; for( it = fieldList.begin(); it != fieldList.end(); ++it ) { mListView->addColumn( (*it)->label() ); - mListView->setColumnWidthMode(c++, QListView::Manual); + mListView->setColumnWidthMode(c++, Q3ListView::Manual); //US // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); } @@ -119,15 +123,15 @@ void KAddressBookTableView::reconstructListView() if (KABPrefs::instance()->mHonorSingleClick) { // qDebug("KAddressBookTableView::reconstructListView single"); - connect(mListView, SIGNAL(executed(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); + connect(mListView, SIGNAL(executed(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); } else { // qDebug("KAddressBookTableView::reconstructListView double"); - connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); + connect(mListView, SIGNAL(doubleClicked(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); } - connect(mListView, SIGNAL(returnPressed(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); + connect(mListView, SIGNAL(returnPressed(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); connect(mListView, SIGNAL(signalDelete()), this, SLOT(addresseeDeleted())); @@ -344,7 +348,7 @@ void KAddressBookTableView::refresh(QString uid) } else { // Only need to update on entry. Iterate through and try to find it ContactListViewItem *ceItem; - QListViewItemIterator it( mListView ); + Q3ListViewItemIterator it( mListView ); while ( it.current() ) { #ifndef KAB_EMBEDDED ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); @@ -366,7 +370,7 @@ void KAddressBookTableView::refresh(QString uid) QStringList KAddressBookTableView::selectedUids() { QStringList uidList; - QListViewItem *item; + Q3ListViewItem *item; ContactListViewItem *ceItem; for(item = mListView->firstChild(); item; item = item->itemBelow()) @@ -394,7 +398,7 @@ QStringList KAddressBookTableView::selectedUids() void KAddressBookTableView::setSelected(QString uid, bool selected) { - QListViewItem *item; + Q3ListViewItem *item; ContactListViewItem *ceItem; if (uid.isNull()) @@ -429,7 +433,7 @@ void KAddressBookTableView::addresseeSelected() // last selected item, but when QListView is in multiselection mode, // there is no way to figure out which one was // selected last. - QListViewItem *item; + Q3ListViewItem *item; bool found =false; for (item = mListView->firstChild(); item && !found; item = item->nextSibling()) @@ -453,7 +457,7 @@ void KAddressBookTableView::addresseeSelected() emit selected(QString::null); } -void KAddressBookTableView::addresseeExecuted(QListViewItem *item) +void KAddressBookTableView::addresseeExecuted(Q3ListViewItem *item) { if (item) { @@ -487,6 +491,6 @@ void KAddressBookTableView::addresseeDeleted() -#ifndef KAB_EMBEDDED -#include "kaddressbooktableview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kaddressbooktableview.cpp" #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 @@ -10,12 +10,12 @@ #endif #include <qwidget.h> -#include <qlistview.h> +#include <q3listview.h> #include <qstring.h> #include <qdialog.h> -#include <qtabdialog.h> +#include <q3tabdialog.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include "undo.h" @@ -25,10 +25,12 @@ #include "klocale.h" #include "kaddressbookview.h" +//Added by qt3to4: +#include <Q3VBoxLayout> -class QListViewItem; -class QListBox; -class QVBoxLayout; +class Q3ListViewItem; +class Q3ListBox; +class Q3VBoxLayout; class KConfig; class ContactListViewItem; @@ -79,10 +81,10 @@ friend class ContactListView; /** Called whenever the user executes an addressee. In terms of the * list view, this is probably a double click */ - void addresseeExecuted(QListViewItem*); + void addresseeExecuted(Q3ListViewItem*); private: - QVBoxLayout *mainLayout; + Q3VBoxLayout *mainLayout; ContactListView *mListView; }; 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 @@ -30,7 +30,7 @@ $Id$ #include <qfile.h> #include <qregexp.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <kfiledialog.h> @@ -104,7 +104,7 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString& return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() ); } else { QFile file( url.path() ); - if ( !file.open( IO_WriteOnly ) ) { + if ( !file.open( QIODevice::WriteOnly ) ) { QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); KMessageBox::error( parentWidget(), txt.arg( url.path() ) ); return false; @@ -124,7 +124,7 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString& return false; QFile file( fileName ); - if ( !file.open( IO_WriteOnly ) ) { + if ( !file.open( QIODevice::WriteOnly ) ) { QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); KMessageBox::error( parentWidget(), txt.arg( fileName ) ); return false; @@ -151,7 +151,7 @@ KABC::AddresseeList CSVXXPort::importContacts( const QString& ) const void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) { - QTextStream t( fp ); + Q3TextStream t( fp ); t.setCodec( QTextCodec::codecForName("utf8") ); KABC::AddresseeList::ConstIterator iter; @@ -187,8 +187,6 @@ void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) } } -#ifndef KAB_EMBEDDED -#include "csv_xxport.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_csv_xxport.cpp" #endif //KAB_EMBEDDED - - 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 @@ -27,7 +27,7 @@ $Id$ */ -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qcheckbox.h> #include <qcombobox.h> #ifdef DESKTOP_VERSION @@ -39,10 +39,14 @@ $Id$ #include <qlineedit.h> #include <qpushbutton.h> #include <qradiobutton.h> -#include <qtable.h> +#include <q3table.h> #include <qlayout.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qfile.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3ValueList> +#include <Q3GridLayout> #include <kapplication.h> #include <kdebug.h> @@ -56,7 +60,7 @@ $Id$ #include <kurlrequester.h> #ifdef DESKTOP_VERSION -#include "qtable.h" +#include "q3table.h" #else #include "qcombotableitem.h" #endif @@ -161,7 +165,7 @@ CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, this, SLOT( saveTemplate() ) ); // if ( QApplication::desktop()->width() < 321 ) - QIconSet icon = SmallIcon("filesave"); + QIcon icon = SmallIcon("filesave"); findButton( User2 )->setIconSet (icon ) ; icon = SmallIcon("fileopen"); @@ -186,7 +190,7 @@ KABC::AddresseeList CSVImportDialog::contacts() const KABC::Address addrWork( KABC::Address::Work ); for ( int col = 0; col < mTable->numCols(); ++col ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, col ) ); + Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, col ) ); if ( !item ) { qDebug( "ERROR: item cast failed" ); @@ -229,7 +233,7 @@ KABC::AddresseeList CSVImportDialog::contacts() const // But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? { QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate - a.setBirthday(dt); + a.setBirthday(QDateTime(dt)); } break; case Email: @@ -382,9 +386,9 @@ void CSVImportDialog::initGUI() { QWidget* page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 1, 1, marginHintSmall(), + Q3GridLayout *layout = new Q3GridLayout( page, 1, 1, marginHintSmall(), spacingHintSmall() ); - QHBoxLayout *hbox = new QHBoxLayout(); + Q3HBoxLayout *hbox = new Q3HBoxLayout(); hbox->setSpacing( spacingHint() ); QLabel *label = new QLabel( i18n( "File to import:" ), page ); @@ -397,11 +401,11 @@ void CSVImportDialog::initGUI() layout->addMultiCellLayout( hbox, 0, 0, 0, 2 ); // Delimiter: comma, semicolon, tab, space, other - mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), page ); + mDelimiterBox = new Q3ButtonGroup( i18n( "Delimiter" ), page ); mDelimiterBox->setColumnLayout( 0, Qt::Vertical ); mDelimiterBox->layout()->setSpacing( spacingHint() ); mDelimiterBox->layout()->setMargin( marginHint() ); - QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() ); + Q3GridLayout *delimiterLayout = new Q3GridLayout( mDelimiterBox->layout() ); delimiterLayout->setAlignment( Qt::AlignTop ); layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 2 ); @@ -450,8 +454,8 @@ void CSVImportDialog::initGUI() mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) ); layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 2 ); - mTable = new QTable( 0, 0, page ); - mTable->setSelectionMode( QTable::NoSelection ); + mTable = new Q3Table( 0, 0, page ); + mTable->setSelectionMode( Q3Table::NoSelection ); //mTable->horizontalHeader()->hide(); layout->addMultiCellWidget( mTable, 5, 5, 0, 2 ); /*US @@ -483,11 +487,11 @@ void CSVImportDialog::fillTable() QString field = ""; // store previous assignment - QValueList<int> mTypeOld = mTypeStore; + Q3ValueList<int> mTypeOld = mTypeStore; mTypeStore.clear(); for ( column = 0; column < mTable->numCols(); ++column ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, column ) ); + Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, column ) ); if ( !item || mClearTypeStore ) mTypeStore.append( typeToPos( Undefined ) ); @@ -506,14 +510,14 @@ void CSVImportDialog::fillTable() mData = QString::fromLocal8Bit( mFileArray.data() ); } - QTextStream inputStream( mData, IO_ReadOnly ); + Q3TextStream inputStream( mData, QIODevice::ReadOnly ); if ( mComboCodec->currentItem () == 0 ) { - inputStream.setEncoding( QTextStream::UnicodeUTF8 ); + inputStream.setEncoding( Q3TextStream::UnicodeUTF8 ); } else if ( mComboCodec->currentItem () == 1 ) { - inputStream.setEncoding( QTextStream::Latin1 ); + inputStream.setEncoding( Q3TextStream::Latin1 ); } else { - inputStream.setEncoding( QTextStream::Locale ); + inputStream.setEncoding( Q3TextStream::Locale ); } int maxColumn = 0; @@ -526,7 +530,7 @@ void CSVImportDialog::fillTable() case S_START : if ( x == mTextQuote ) { state = S_QUOTED_FIELD; - } else if ( x == mDelimiter ) { + } else if ( QString(x) == mDelimiter ) { if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) ++column; lastCharDelimiter = true; @@ -561,7 +565,7 @@ void CSVImportDialog::fillTable() if ( x == mTextQuote ) { field += x; state = S_QUOTED_FIELD; - } else if ( x == mDelimiter || x == '\n' ) { + } else if ( QString(x) == mDelimiter || x == '\n' ) { setText( row - mStartLine + 1, column, field ); field = ""; if ( x == '\n' ) { @@ -578,7 +582,7 @@ void CSVImportDialog::fillTable() } break; case S_END_OF_QUOTED_FIELD : - if ( x == mDelimiter || x == '\n' ) { + if ( QString(x) == mDelimiter || x == '\n' ) { setText( row - mStartLine + 1, column, field ); field = ""; if ( x == '\n' ) { @@ -601,7 +605,7 @@ void CSVImportDialog::fillTable() break; } case S_NORMAL_FIELD : - if ( x == mDelimiter || x == '\n' ) { + if ( QString(x) == mDelimiter || x == '\n' ) { setText( row - mStartLine + 1, column, field ); field = ""; if ( x == '\n' ) { @@ -617,7 +621,7 @@ void CSVImportDialog::fillTable() field += x; } } - if ( x != mDelimiter ) + if ( QString(x) != mDelimiter ) lastCharDelimiter = false; if ( column > maxColumn ) @@ -649,7 +653,7 @@ void CSVImportDialog::fillTable() for ( column = 0; column < mTable->numCols(); ++column ) { //US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() ); - QComboTableItem *item = new QComboTableItem( mTable, keys ); + Q3ComboTableItem *item = new Q3ComboTableItem( mTable, keys ); mTable->setItem( 0, column, item ); if ( column < mTypeStore.count() ) item->setCurrentItem( mTypeStore[ column ] ); @@ -764,7 +768,7 @@ void CSVImportDialog::slotOk() bool assigned = false; for ( int column = 0; column < mTable->numCols(); ++column ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, + Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, column ) ); if ( item && posToType( item->currentItem() ) != Undefined ) assigned = true; @@ -836,7 +840,7 @@ void CSVImportDialog::applyTemplate() // apply the column map for ( uint column = 0; column < columnMap.count(); ++column ) { int type = columnMap[ column ]; - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, + Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, column ) ); if ( item ) item->setCurrentItem( typeToPos( type ) ); @@ -878,7 +882,7 @@ void CSVImportDialog::saveTemplate() config.setGroup( "csv column map" ); for ( uint column = 0; column < mTable->numCols(); ++column ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, + Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, column ) ); if ( item ) config.writeEntry( QString::number( column ), posToType( @@ -934,7 +938,7 @@ void CSVImportDialog::setFile( const QString &fileName ) return; QFile file( fileName ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.open( QIODevice::ReadOnly ) ) { KMessageBox::sorry( this, i18n( "Cannot open input file!" ) ); file.close(); return; @@ -964,6 +968,6 @@ void CSVImportDialog::urlChanged( const QString &file ) } -#ifndef KAB_EMBEDDED -#include <csvimportdialog.moc> +#ifndef KAB_EMBEDDED_ +#include <moc_csvimportdialog.cpp> #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 @@ -33,17 +33,17 @@ $Id$ #include <kabc/addresseelist.h> #include <kdialogbase.h> -#include <qvaluelist.h> +#include <q3valuelist.h> class KURLRequester; -class QButtonGroup; +class Q3ButtonGroup; class QComboBox; class QCheckBox; class QLineEdit; class QPushButton; class QRadioButton; -class QTable; +class Q3Table; class CSVImportDialog : public KDialogBase { @@ -85,8 +85,8 @@ class CSVImportDialog : public KDialogBase Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL, Categories }; - QTable* mTable; - QButtonGroup* mDelimiterBox; + Q3Table* mTable; + Q3ButtonGroup* mDelimiterBox; QRadioButton* mRadioComma; QRadioButton* mRadioSemicolon; QRadioButton* mRadioTab; @@ -119,7 +119,7 @@ class CSVImportDialog : public KDialogBase KABC::AddressBook *mAddressBook; int mCustomCounter; bool mClearTypeStore; - QValueList<int> mTypeStore; + Q3ValueList<int> mTypeStore; }; 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 @@ -116,6 +116,6 @@ KABC::AddresseeList KDE2XXPort::importContacts( const QString& ) const return KABC::AddresseeList(); } -#ifndef KAB_EMBEDDED -#include "kde2_xxport.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kde2_xxport.cpp" #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 @@ -29,8 +29,10 @@ */ #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <Q3CString> #include <kabc/vcardconverter.h> #include <kabc/vcardparser/vcardtool.h> @@ -102,14 +104,14 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &list, const QString return false; QFile outFile( fileName ); - if ( !outFile.open( IO_WriteOnly ) ) { + if ( !outFile.open( QIODevice::WriteOnly ) ) { QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" ); KMessageBox::error( parentWidget(), text.arg( fileName ) ); return false; } - QTextStream t( &outFile ); - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( &outFile ); + t.setEncoding( Q3TextStream::UnicodeUTF8 ); KABC::Addressee::List::ConstIterator it; for ( it = list.begin(); it != list.end(); ++it ) { @@ -153,7 +155,7 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const if ( KIO::NetAccess::download( url, fileName ) ) { QFile file( fileName ); - file.open( IO_ReadOnly ); + file.open( QIODevice::ReadOnly ); QByteArray rawData = file.readAll(); file.close(); @@ -196,8 +198,8 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const } QFile file( fileName ); - if ( file.open( IO_ReadOnly ) ) { - QCString rawData ( file.readAll().data(),file.size()+1); + if ( file.open( QIODevice::ReadOnly ) ) { + Q3CString rawData ( file.readAll().data(),file.size()+1); file.close(); int start = 0; #ifndef DESKTOP_VERSION @@ -267,6 +269,6 @@ KABC::AddresseeList VCardXXPort::parseVCard( const QString &data ) const } -#ifndef KAB_EMBEDDED -#include "vcard_xxport.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_vcard_xxport.cpp" #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 @@ -30,6 +30,8 @@ $Id$ #include <qlayout.h> #include <qlist.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kabc/addressbook.h> #include <kabc/resource.h> @@ -217,7 +219,7 @@ void XXPortManager::loadPlugins() } #else //KAB_EMBEDDED - QList<XXPortFactory> factorylist; + QList<XXPortFactory*> factorylist; factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport())); factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport())); factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport())); @@ -225,10 +227,8 @@ void XXPortManager::loadPlugins() factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_qtopia_xxport())); factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_sharpdtm_xxport())); - QListIterator<XXPortFactory> it(factorylist); - for ( ; it.current(); ++it ) - { - XXPortFactory *xxportFactory = it.current(); + for(QList<XXPortFactory*>::iterator it=factorylist.begin();it!=factorylist.end();++it) { + XXPortFactory *xxportFactory = *it; #endif //KAB_EMBEDDED XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore ); @@ -250,7 +250,7 @@ PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, name, true, true ,i18n( "Import all!" ),i18n( "No" ) ) { QWidget *page = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); + Q3VBoxLayout *layout = new Q3VBoxLayout( page, marginHint(), spacingHint() ); connect( this, SIGNAL( user1Clicked() ), this, SLOT ( slotClose() ) ); connect( this, SIGNAL( user2Clicked() ), this, SLOT ( slotCancel() ) ); @@ -264,7 +264,6 @@ PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, #endif } -#ifndef KAB_EMBEDDED -#include "xxportmanager.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_xxportmanager.cpp" #endif //KAB_EMBEDDED - diff --git a/kaddressbook/xxportmanager.h b/kaddressbook/xxportmanager.h index e801d9b..0528922 100644 --- a/kaddressbook/xxportmanager.h +++ b/kaddressbook/xxportmanager.h @@ -32,7 +32,7 @@ $Id$ #ifndef XXPORTMANAGER_H #define XXPORTMANAGER_H -#include <qdict.h> +#include <q3dict.h> #include <qobject.h> #include <kurl.h> @@ -71,7 +71,7 @@ class XXPortManager : public QObject private: void loadPlugins(); - QDict<XXPortObject> mXXPortObjects; + Q3Dict<XXPortObject> mXXPortObjects; KABCore *mCore; bool mShowPreview; diff --git a/kaddressbook/xxportobject.cpp b/kaddressbook/xxportobject.cpp index bd9d986..2d8d0ff 100644 --- a/kaddressbook/xxportobject.cpp +++ b/kaddressbook/xxportobject.cpp @@ -271,6 +271,6 @@ KABC::AddresseeList XXPortResourceObject::_importContacts( const QString& identi -#ifndef KAB_EMBEDDED -#include "xxportobject.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_xxportobject.cpp" #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 @@ -36,16 +36,21 @@ $Id$ #include <kglobal.h> #include <qapplication.h> -#include <qbuttongroup.h> +#include <QDesktopWidget> +#include <q3buttongroup.h> #include <qcombobox.h> -#include <qheader.h> +#include <q3header.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistview.h> +#include <q3listview.h> #include <qpushbutton.h> #include <qradiobutton.h> #include <qstringlist.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> +#include <Q3VBoxLayout> #include "kabcore.h" #include "kabprefs.h" @@ -62,8 +67,8 @@ XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, connect( mFiltersCombo, SIGNAL( activated( int ) ), SLOT( filterChanged( int ) ) ); - connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ), - SLOT( categoryClicked( QListViewItem* ) ) ); + connect( mCategoriesView, SIGNAL( clicked( Q3ListViewItem* ) ), + SLOT( categoryClicked( Q3ListViewItem* ) ) ); // setup filters #ifndef KAB_EMBEDDED @@ -84,7 +89,7 @@ XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, QStringList categories = KABPrefs::instance()->mCustomCategories; QStringList::Iterator it; for ( it = categories.begin(); it != categories.end(); ++it ) - new QCheckListItem( mCategoriesView, *it, QCheckListItem::CheckBox ); + new Q3CheckListItem( mCategoriesView, *it, Q3CheckListItem::CheckBox ); mUseCategories->setEnabled( categories.count() > 0 ); int count = mCore->selectedUIDs().count(); @@ -210,9 +215,9 @@ QStringList XXPortSelectDialog::categories() const { QStringList list; - QListViewItemIterator it( mCategoriesView ); + Q3ListViewItemIterator it( mCategoriesView ); for ( ; it.current(); ++it ) { - QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); + Q3CheckListItem* qcli = static_cast<Q3CheckListItem*>(it.current()); if ( qcli->isOn() ) list.append( it.current()->text( 0 ) ); } @@ -225,9 +230,9 @@ void XXPortSelectDialog::filterChanged( int ) mUseFilters->setChecked( true ); } -void XXPortSelectDialog::categoryClicked( QListViewItem *i ) +void XXPortSelectDialog::categoryClicked( Q3ListViewItem *i ) { - QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); + Q3CheckListItem *qcli = static_cast<Q3CheckListItem*>( i ); if ( qcli->isOn() ) mUseCategories->setChecked( true ); } @@ -244,60 +249,60 @@ void XXPortSelectDialog::slotHelp() void XXPortSelectDialog::initGUI() { - QFrame *page = plainPage(); + Q3Frame *page = plainPage(); - QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHintSmall(), + Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page ); topLayout->addWidget( label ); - mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page ); + mButtonGroup = new Q3ButtonGroup( i18n( "Contact Selection" ), page ); mButtonGroup->setColumnLayout( 0, Qt::Vertical ); mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); mButtonGroup->layout()->setMargin( KDialog::marginHint() ); - QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() ); + Q3GridLayout *groupLayout = new Q3GridLayout( mButtonGroup->layout() ); groupLayout->setAlignment( Qt::AlignTop ); mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup ); mUseWholeBook->setChecked( true ); - QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); + Q3WhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); groupLayout->addWidget( mUseWholeBook, 0, 0 ); mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup ); - QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" + Q3WhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" "This option is disabled if no contacts are selected." ) ); groupLayout->addWidget( mUseSelection, 1, 0 ); mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup ); - QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" + Q3WhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" "This option is disabled if you haven't defined any filters" ) ); groupLayout->addWidget( mUseFilters, 2, 0 ); mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup ); - QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" + Q3WhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" "This option is disabled if you have no categories." ) ); groupLayout->addWidget( mUseCategories, 3, 0 ); mFiltersCombo = new QComboBox( false, mButtonGroup ); mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); + Q3WhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); groupLayout->addWidget( mFiltersCombo, 2, 1 ); - mCategoriesView = new QListView( mButtonGroup ); + mCategoriesView = new Q3ListView( mButtonGroup ); mCategoriesView->addColumn( "" ); mCategoriesView->header()->hide(); - QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); + Q3WhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); groupLayout->addWidget( mCategoriesView, 3, 1 ); mCategoriesView->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); //if (QApplication::desktop()->height() == 480 ) // mCategoriesView->setMaximumHeight( 240 ); topLayout->addWidget( mButtonGroup ); - QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); + Q3ButtonGroup *sortingGroup = new Q3ButtonGroup( i18n( "Sorting" ), page ); sortingGroup->setColumnLayout( 0, Qt::Vertical ); - QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2, + Q3GridLayout *sortLayout = new Q3GridLayout( sortingGroup->layout(), 2, 2, KDialog::spacingHint() ); sortLayout->setAlignment( Qt::AlignTop ); @@ -335,8 +340,6 @@ void XXPortSelectDialog::initGUI() } } -#ifndef KAB_EMBEDDED -#include "xxportselectdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_xxportselectdialog.cpp" #endif //KAB_EMBEDDED - - diff --git a/kaddressbook/xxportselectdialog.h b/kaddressbook/xxportselectdialog.h index 28b1fef..208f4f9 100644 --- a/kaddressbook/xxportselectdialog.h +++ b/kaddressbook/xxportselectdialog.h @@ -30,10 +30,10 @@ #include "filter.h" -class QButtonGroup; +class Q3ButtonGroup; class QComboBox; -class QListView; -class QListViewItem; +class Q3ListView; +class Q3ListViewItem; class QRadioButton; class KABCore; @@ -53,7 +53,7 @@ class XXPortSelectDialog : public KDialogBase private slots: void filterChanged( int ); - void categoryClicked( QListViewItem * i ); + void categoryClicked( Q3ListViewItem * i ); protected slots: void slotHelp(); @@ -62,13 +62,13 @@ class XXPortSelectDialog : public KDialogBase void initGUI(); QStringList categories() const; - QButtonGroup* mButtonGroup; + Q3ButtonGroup* mButtonGroup; QRadioButton* mUseCategories; QRadioButton* mUseFilters; QRadioButton* mUseWholeBook; QRadioButton* mUseSelection; QComboBox* mFiltersCombo; - QListView* mCategoriesView; + Q3ListView* mCategoriesView; KComboBox *mFieldCombo; KComboBox *mSortTypeCombo; diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp index 18ce9da..467fef7 100644 --- a/kalarmd/alarmdialog.cpp +++ b/kalarmd/alarmdialog.cpp @@ -23,9 +23,10 @@ // $Id$ -#include <qhbox.h> -#include <qvbox.h> -#include <qapp.h> +#include <q3hbox.h> +#include <q3vbox.h> +#include <qapplication.h> +#include <QDesktopWidget> #include <qlabel.h> #include <qlayout.h> #include <qfile.h> @@ -39,6 +40,9 @@ #undef protected #else #include <qspinbox.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> #endif #include <stdlib.h> #ifndef _WIN32_ @@ -62,10 +66,10 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name) : QDialog (parent, name ,false, Qt::WStyle_StaysOnTop ) { setCaption( "KO/Pi Alarm!" ); - QVBoxLayout* layout = new QVBoxLayout( this); + Q3VBoxLayout* layout = new Q3VBoxLayout( this); QLabel* l = new QLabel("The following event triggered alarm:",this); layout->addWidget ( l ); - l->setAlignment( AlignCenter); + l->setAlignment( Qt::AlignCenter); mMessage = new QLabel ( " ", this ); int fs = 18; int fs2 = 12; @@ -83,10 +87,10 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name) l->setFont( fo ); fo.setPointSize( fs ); mMessage->setFont(fo ); - mMessage->setAlignment( AlignCenter); + mMessage->setAlignment( Qt::AlignCenter); layout->addWidget ( mMessage ); mMissedAlarms= new QLabel ( "(No missed Alarms)", this ); - mMissedAlarms->setAlignment( AlignCenter); + mMissedAlarms->setAlignment( Qt::AlignCenter); playSoundTimer = new QTimer( this ); connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); @@ -103,7 +107,7 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name) fo.setPointSize( 12 ); labb->setFont ( fo ); #endif - labb->setAlignment(AlignCenter); + labb->setAlignment(Qt::AlignCenter); //layout->addWidget ( labb ); fo = font(); int pointSize = 36; @@ -122,17 +126,17 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name) #endif mSuspendSpin->setFixedSize( 18*baseSize, 10*baseSize+2 ); mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); - QHBoxLayout* layoutSpin = new QHBoxLayout( layout ); + Q3HBoxLayout* layoutSpin = new Q3HBoxLayout( layout ); layoutSpin->addStretch (); layoutSpin->addWidget ( labb ); layoutSpin->addWidget ( mSuspendSpin ); layoutSpin->addStretch (); - QVBox * bbox = new QVBox ( this ); + Q3VBox * bbox = new Q3VBox ( this ); layout->addWidget ( bbox ); bbox->layout()->setSpacing( 2 ); labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox); - labb->setAlignment(AlignCenter); + labb->setAlignment(Qt::AlignCenter); mSuspendButton = new QPushButton( "Suspend", bbox); QPushButton* silen = new QPushButton( " Stop sound ", bbox); okbut = new QPushButton( "Ok", bbox); diff --git a/kalarmd/alarmdialog.h b/kalarmd/alarmdialog.h index 52e681a..c3e0966 100644 --- a/kalarmd/alarmdialog.h +++ b/kalarmd/alarmdialog.h @@ -30,6 +30,8 @@ #include <qstring.h> #include <qcombobox.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <QLabel> #include "sharp_char.h" diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 15eff28..74a53cb 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp @@ -52,7 +52,7 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) : QLabel( parent ) { mAlarmDialog = new AlarmDialog( 0 ); - mPopUp = new QPopupMenu( this ); + mPopUp = new Q3PopupMenu( this ); mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); mPopUp->insertSeparator(); @@ -66,12 +66,12 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) ); mPopUp->insertSeparator(); mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) ); - mTimerPopUp = new QPopupMenu( this ); + mTimerPopUp = new Q3PopupMenu( this ); - mBeepPopUp = new QPopupMenu( this ); - mSoundPopUp = new QPopupMenu( this ); - mPausePopUp = new QPopupMenu( this ); - mFontsizePopup = new QPopupMenu( this ); + mBeepPopUp = new Q3PopupMenu( this ); + mSoundPopUp = new Q3PopupMenu( this ); + mPausePopUp = new Q3PopupMenu( this ); + mFontsizePopup = new Q3PopupMenu( this ); mFontsizePopup->insertItem( "10", 10 ); mFontsizePopup->insertItem( "12", 12 ); mFontsizePopup->insertItem( "14", 14 ); @@ -85,7 +85,7 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) mFontsizePopup->insertItem( "30", 30 ); mFontsizePopup->insertItem( "32", 32 ); mFontsizePopup->insertItem( "36", 36 ); - QPopupMenu* savePopUp = new QPopupMenu( this ); + QPopupMenu* savePopUp = new Q3PopupMenu( this ); savePopUp->insertItem( "Save", 0 ); savePopUp->insertItem( "Load", 1 ); mSoundPopUp->insertItem( "Buzzer", 0 ); @@ -99,7 +99,7 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) mPausePopUp->insertItem( "30 sec", 30 ); mPausePopUp->insertItem( " 1 min", 60 ); mPausePopUp->insertItem( " 5 min", 300 ); - mSuspendPopUp = new QPopupMenu( this ); + mSuspendPopUp = new Q3PopupMenu( this ); mSuspendPopUp->insertItem( "Off", 0 ); mSuspendPopUp->insertItem( " 1x", 1 ); mSuspendPopUp->insertItem( " 2x", 2 ); diff --git a/kalarmd/simplealarmdaemonimpl.h b/kalarmd/simplealarmdaemonimpl.h index 06ef91b..ac65797 100644 --- a/kalarmd/simplealarmdaemonimpl.h +++ b/kalarmd/simplealarmdaemonimpl.h @@ -30,7 +30,6 @@ class QLabel; class QTimer; -class QPopupMenu; class AlarmDialog; class SimpleAlarmDaemonImpl : public QLabel { @@ -76,7 +75,7 @@ class SimpleAlarmDaemonImpl : public QLabel QString mAlarmMessage; int mTimerTime; int getFileNameLen( QString ); - QPopupMenu* mPopUp, *mBeepPopUp, *mTimerPopUp, *mSoundPopUp,*mPausePopUp,*mSuspendPopUp, *mFontsizePopup; + Q3PopupMenu* mPopUp, *mBeepPopUp, *mTimerPopUp, *mSoundPopUp,*mPausePopUp,*mSuspendPopUp, *mFontsizePopup; QDateTime mRunningTimer; void fillTimerPopUp(); QString timerMesssage; diff --git a/kdepim-desktop.pro b/kdepim-desktop.pro index 4a5ceef..05d8357 100644 --- a/kdepim-desktop.pro +++ b/kdepim-desktop.pro @@ -19,7 +19,9 @@ win32:{ } unix:{ !staticlib: { -SUBDIRS += libetpan kmicromail/libmailwrapper kmicromail pwmanager/libcrypt/cipher pwmanager/libcrypt/error pwmanager/libcrypt/mpi pwmanager/libcrypt/zlib pwmanager/pwmanager +SUBDIRS += libetpan +# kmicromail/libmailwrapper kmicromail +SUBDIRS += pwmanager/libcrypt/cipher pwmanager/libcrypt/error pwmanager/libcrypt/mpi pwmanager/libcrypt/zlib pwmanager/pwmanager } } diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index 985a762..9b1ea2f 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp @@ -12,8 +12,10 @@ //#include <qpe/qpeapplication.h> /* QT */ -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <kiconloader.h> #include <klocale.h> @@ -54,7 +56,7 @@ AbstractMail *POP3viewItem::getWrapper() return wrapper; } -void POP3viewItem::refresh(QValueList<Opie::Core::OSmartPointer<RecMail> > & ) +void POP3viewItem::refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > & ) { refresh(); } @@ -62,16 +64,16 @@ void POP3viewItem::refresh(QValueList<Opie::Core::OSmartPointer<RecMail> > & ) void POP3viewItem::refresh() { if (account->getOffline()) return; - QValueList<FolderP> *folders = wrapper->listFolders(); - QListViewItem *child = firstChild(); + Q3ValueList<FolderP> *folders = wrapper->listFolders(); + Q3ListViewItem *child = firstChild(); while ( child ) { - QListViewItem *tmp = child; + Q3ListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } - QValueList<FolderP>::ConstIterator it; - QListViewItem*item = 0; + Q3ValueList<FolderP>::ConstIterator it; + Q3ListViewItem*item = 0; for ( it = folders->begin(); it!=folders->end(); ++it) { item = new POP3folderItem( (*it), this , item ); @@ -86,9 +88,9 @@ RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) return wrapper->fetchBody( mail ); } -QPopupMenu * POP3viewItem::getContextMenu() +Q3PopupMenu * POP3viewItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { if (!account->getOffline()) @@ -108,10 +110,10 @@ QPopupMenu * POP3viewItem::getContextMenu() void POP3viewItem::disconnect() { - QListViewItem *child = firstChild(); + Q3ListViewItem *child = firstChild(); while ( child ) { - QListViewItem *tmp = child; + Q3ListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } @@ -157,7 +159,7 @@ void POP3viewItem::contextMenuSelected(int which) POP3folderItem::~POP3folderItem() {} -POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) +POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , Q3ListViewItem*after ) : AccountViewItem(folderInit,parent,after ) { pop3 = parent; @@ -172,7 +174,7 @@ POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , setText( 0, folder->getDisplayName() ); } -void POP3folderItem::refresh(QValueList<RecMailP>&target) +void POP3folderItem::refresh(Q3ValueList<RecMailP>&target) { if (folder->may_select()) pop3->getWrapper()->listMessages( folder->getName(),target ); @@ -183,9 +185,9 @@ RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) return pop3->getWrapper()->fetchBody(aMail); } -QPopupMenu * POP3folderItem::getContextMenu() +Q3PopupMenu * POP3folderItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); @@ -261,7 +263,7 @@ AbstractMail *NNTPviewItem::getWrapper() return wrapper; } -void NNTPviewItem::refresh( QValueList<RecMailP> & ) +void NNTPviewItem::refresh( Q3ValueList<RecMailP> & ) { refresh(); } @@ -269,17 +271,17 @@ void NNTPviewItem::refresh( QValueList<RecMailP> & ) void NNTPviewItem::refresh() { if (account->getOffline()) return; - QValueList<FolderP> *folders = wrapper->listFolders(); + Q3ValueList<FolderP> *folders = wrapper->listFolders(); - QListViewItem *child = firstChild(); + Q3ListViewItem *child = firstChild(); while ( child ) { - QListViewItem *tmp = child; + Q3ListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } - QValueList<FolderP>::ConstIterator it; - QListViewItem*item = 0; + Q3ValueList<FolderP>::ConstIterator it; + Q3ListViewItem*item = 0; for ( it = folders->begin(); it!=folders->end(); ++it) { item = new NNTPfolderItem( (*it), this , item ); @@ -294,9 +296,9 @@ RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail ) return wrapper->fetchBody( mail ); } -QPopupMenu * NNTPviewItem::getContextMenu() +Q3PopupMenu * NNTPviewItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { if (!account->getOffline()) @@ -326,10 +328,10 @@ void NNTPviewItem::subscribeGroups() void NNTPviewItem::disconnect() { - QListViewItem *child = firstChild(); + Q3ListViewItem *child = firstChild(); while ( child ) { - QListViewItem *tmp = child; + Q3ListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } @@ -368,7 +370,7 @@ void NNTPviewItem::contextMenuSelected(int which) NNTPfolderItem::~NNTPfolderItem() {} -NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent , QListViewItem*after ) +NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent , Q3ListViewItem*after ) : AccountViewItem( folderInit, parent,after ) { nntp = parent; @@ -383,7 +385,7 @@ NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent setText( 0, folder->getDisplayName() ); } -void NNTPfolderItem::refresh(QValueList<RecMailP>&target) +void NNTPfolderItem::refresh(Q3ValueList<RecMailP>&target) { if (folder->may_select()) nntp->getWrapper()->listMessages( folder->getName(),target ); @@ -394,9 +396,9 @@ RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail) return nntp->getWrapper()->fetchBody(aMail); } -QPopupMenu * NNTPfolderItem::getContextMenu() +Q3PopupMenu * NNTPfolderItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { m->insertItem(i18n("Refresh header list"),0); @@ -453,7 +455,7 @@ AbstractMail *IMAPviewItem::getWrapper() return wrapper; } -void IMAPviewItem::refresh(QValueList<RecMailP>&) +void IMAPviewItem::refresh(Q3ValueList<RecMailP>&) { refreshFolders(false); } @@ -470,11 +472,11 @@ void IMAPviewItem::refreshFolders(bool force) removeChilds(); currentFolders.clear(); - QValueList<FolderP> * folders = wrapper->listFolders(); + Q3ValueList<FolderP> * folders = wrapper->listFolders(); - QValueList<FolderP>::Iterator it; - QListViewItem*item = 0; - QListViewItem*titem = 0; + Q3ValueList<FolderP>::Iterator it; + Q3ListViewItem*item = 0; + Q3ListViewItem*titem = 0; QString fname,del,search; int pos; @@ -513,9 +515,9 @@ void IMAPviewItem::refreshFolders(bool force) delete folders; } -QPopupMenu * IMAPviewItem::getContextMenu() +Q3PopupMenu * IMAPviewItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { if (!account->getOffline()) @@ -615,7 +617,7 @@ bool IMAPviewItem::offline() return account->getOffline(); } -IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , QListViewItem*after ) +IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , Q3ListViewItem*after ) : AccountViewItem( folderInit, parent , after ) { imap = parent; @@ -630,7 +632,7 @@ IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent setText( 0, folder->getDisplayName() ); } -IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ) +IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , Q3ListViewItem*after, IMAPviewItem *master ) : AccountViewItem(folderInit, parent,after ) { imap = master; @@ -653,7 +655,7 @@ const QString& IMAPfolderItem::Delemiter()const return folder->Separator(); } -void IMAPfolderItem::refresh(QValueList<RecMailP>&target) +void IMAPfolderItem::refresh(Q3ValueList<RecMailP>&target) { if (folder->may_select()) { @@ -670,9 +672,9 @@ RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail) return imap->getWrapper()->fetchBody(aMail); } -QPopupMenu * IMAPfolderItem::getContextMenu() +Q3PopupMenu * IMAPfolderItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { if (folder->may_select()) @@ -721,7 +723,7 @@ void IMAPfolderItem::deleteFolder() { if (imap->getWrapper()->deleteMbox(folder)) { - QListView*v=listView(); + Q3ListView*v=listView(); IMAPviewItem * box = imap; /* be carefull - after that this object is destroyd so don't use * any member of it after that call!!*/ @@ -800,7 +802,7 @@ AbstractMail *MHviewItem::getWrapper() return wrapper; } -void MHviewItem::refresh( QValueList<RecMailP> & target) +void MHviewItem::refresh( Q3ValueList<RecMailP> & target) { refresh(false); getWrapper()->listMessages( "",target ); @@ -811,8 +813,8 @@ void MHviewItem::refresh(bool force) if (childCount()>0 && force==false) return; removeChilds(); currentFolders.clear(); - QValueList<FolderP> *folders = wrapper->listFolders(); - QValueList<FolderP>::ConstIterator it; + Q3ValueList<FolderP> *folders = wrapper->listFolders(); + Q3ValueList<FolderP>::ConstIterator it; MHfolderItem*item = 0; MHfolderItem*pmaster = 0; QString fname = ""; @@ -857,9 +859,9 @@ RECBODYP MHviewItem::fetchBody( const RecMailP &mail ) return wrapper->fetchBody( mail ); } -QPopupMenu * MHviewItem::getContextMenu() +Q3PopupMenu * MHviewItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { m->insertItem(i18n("Refresh folder list"),0); @@ -920,14 +922,14 @@ void MHviewItem::contextMenuSelected(int which) MHfolderItem::~MHfolderItem() {} -MHfolderItem::MHfolderItem( const FolderP &folderInit, MHviewItem *parent , QListViewItem*after ) +MHfolderItem::MHfolderItem( const FolderP &folderInit, MHviewItem *parent , Q3ListViewItem*after ) : AccountViewItem(folderInit, parent,after ) { mbox = parent; initName(); } -MHfolderItem::MHfolderItem(const FolderP& folderInit, MHfolderItem *parent, QListViewItem*after, MHviewItem*master) +MHfolderItem::MHfolderItem(const FolderP& folderInit, MHfolderItem *parent, Q3ListViewItem*after, MHviewItem*master) : AccountViewItem(folderInit, parent,after ) { folder = folderInit; @@ -967,7 +969,7 @@ const FolderP&MHfolderItem::getFolder()const return folder; } -void MHfolderItem::refresh(QValueList<RecMailP>&target) +void MHfolderItem::refresh(Q3ValueList<RecMailP>&target) { if (folder->may_select()) mbox->getWrapper()->listMessages( folder->getName(),target ); @@ -989,7 +991,7 @@ void MHfolderItem::deleteFolder() { if (mbox->getWrapper()->deleteMbox(folder)) { - QListView*v=listView(); + Q3ListView*v=listView(); MHviewItem * box = mbox; /* be carefull - after that this object is destroyd so don't use * any member of it after that call!!*/ @@ -1002,9 +1004,9 @@ void MHfolderItem::deleteFolder() } } -QPopupMenu * MHfolderItem::getContextMenu() +Q3PopupMenu * MHfolderItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { m->insertItem(i18n("Move/Copie all mails"),2); @@ -1031,7 +1033,7 @@ void MHfolderItem::createFolder() QString ndir = ndirdlg.Newdir(); if (mbox->getWrapper()->createMbox(ndir,folder)) { - QListView*v=listView(); + Q3ListView*v=listView(); MHviewItem * box = mbox; /* be carefull - after that this object is destroyd so don't use * any member of it after that call!!*/ @@ -1078,26 +1080,26 @@ bool MHfolderItem::isDraftfolder() const QString AccountViewItem::contextName="AccountViewItem"; AccountViewItem::AccountViewItem( AccountView *parent ) - : QListViewItem( parent ) + : Q3ListViewItem( parent ) { init(); m_Backlink = parent; } -AccountViewItem::AccountViewItem( QListViewItem *parent) - : QListViewItem( parent),folder(0) +AccountViewItem::AccountViewItem( Q3ListViewItem *parent) + : Q3ListViewItem( parent),folder(0) { init(); } -AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after ) - :QListViewItem( parent,after ),folder(0) +AccountViewItem::AccountViewItem( Q3ListViewItem *parent , Q3ListViewItem*after ) + :Q3ListViewItem( parent,after ),folder(0) { init(); } -AccountViewItem::AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ) - :QListViewItem( parent,after ),folder(folderInit) +AccountViewItem::AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,Q3ListViewItem *parent , Q3ListViewItem*after ) + :Q3ListViewItem( parent,after ),folder(folderInit) { init(); } @@ -1140,10 +1142,10 @@ void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder) void AccountViewItem::removeChilds() { - QListViewItem *child = firstChild(); + Q3ListViewItem *child = firstChild(); while ( child ) { - QListViewItem *tmp = child; + Q3ListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } diff --git a/kmicromail/accountitem.h b/kmicromail/accountitem.h index 4c92bfc..bbfd05f 100644 --- a/kmicromail/accountitem.h +++ b/kmicromail/accountitem.h @@ -2,15 +2,18 @@ #define __ACCOUNT_ITEM -#include <qlistview.h> +#include <q3listview.h> #include <qlist.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3PopupMenu> #include <opie2/osmartpointer.h> #include <libmailwrapper/mailwrapper.h> class POP3wrapper; class RecMail; class RecBody; -class QPopupMenu; +class Q3PopupMenu; class Selectstore; class AccountView; class POP3account; @@ -21,19 +24,19 @@ class Folder; #define RECBODYP Opie::Core::OSmartPointer<RecBody> -class AccountViewItem : public QListViewItem +class AccountViewItem : public Q3ListViewItem { public: AccountViewItem( AccountView *parent ); - AccountViewItem( QListViewItem *parent); - AccountViewItem( QListViewItem *parent , QListViewItem*after ); - AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ); + AccountViewItem( Q3ListViewItem *parent); + AccountViewItem( Q3ListViewItem *parent , Q3ListViewItem*after ); + AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,Q3ListViewItem *parent , Q3ListViewItem*after ); virtual ~AccountViewItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&)=0; + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&)=0; virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&)=0; - virtual QPopupMenu * getContextMenu(){return 0;}; + virtual Q3PopupMenu * getContextMenu(){return 0;}; virtual void contextMenuSelected(int){} virtual AccountView*accountView(); virtual bool matchName(const QString&name)const; @@ -56,10 +59,10 @@ class POP3viewItem : public AccountViewItem public: POP3viewItem( POP3account *a, AccountView *parent ); virtual ~POP3viewItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target ); virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); AbstractMail *getWrapper(); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); protected: @@ -74,11 +77,11 @@ class POP3folderItem : public AccountViewItem { public: - POP3folderItem( const Opie::Core::OSmartPointer<Folder>&folder, POP3viewItem *parent , QListViewItem*after ); + POP3folderItem( const Opie::Core::OSmartPointer<Folder>&folder, POP3viewItem *parent , Q3ListViewItem*after ); virtual ~POP3folderItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&); virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); protected: @@ -93,10 +96,10 @@ class NNTPviewItem : public AccountViewItem public: NNTPviewItem( NNTPaccount *a, AccountView *parent ); virtual ~NNTPviewItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target ); virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); AbstractMail *getWrapper(); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); protected: @@ -112,11 +115,11 @@ class NNTPfolderItem : public AccountViewItem { public: - NNTPfolderItem(const Opie::Core::OSmartPointer<Folder>&folder, NNTPviewItem *parent , QListViewItem*after ); + NNTPfolderItem(const Opie::Core::OSmartPointer<Folder>&folder, NNTPviewItem *parent , Q3ListViewItem*after ); virtual ~NNTPfolderItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&); virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); protected: @@ -132,10 +135,10 @@ class IMAPviewItem : public AccountViewItem public: IMAPviewItem( IMAPaccount *a, AccountView *parent ); virtual ~IMAPviewItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&); virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); AbstractMail *getWrapper(); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); const QStringList&subFolders(); virtual void refreshFolders(bool force=false); @@ -152,12 +155,12 @@ class IMAPfolderItem : public AccountViewItem { public: - IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPviewItem *parent , QListViewItem*after ); - IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); + IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPviewItem *parent , Q3ListViewItem*after ); + IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPfolderItem *parent , Q3ListViewItem*after, IMAPviewItem *master ); virtual ~IMAPfolderItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&); virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); virtual const QString& Delemiter()const; protected: @@ -174,10 +177,10 @@ class MHviewItem : public AccountViewItem public: MHviewItem( const QString&aMboxPath, AccountView *parent ); virtual ~MHviewItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target ); virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); AbstractMail *getWrapper(); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); QStringList subFolders(); virtual void refresh(bool force=false); @@ -194,12 +197,12 @@ class MHfolderItem : public AccountViewItem { public: - MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHviewItem *parent , QListViewItem*after ); - MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master); + MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHviewItem *parent , Q3ListViewItem*after ); + MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHfolderItem *parent, Q3ListViewItem*after, MHviewItem*master); virtual ~MHfolderItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&); virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); virtual const Opie::Core::OSmartPointer<Folder>&getFolder()const; virtual bool isDraftfolder(); diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index d1d4f7e..eea1f65 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp @@ -13,25 +13,27 @@ /* QT */ #include <qmessagebox.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qcheckbox.h> #include <qtimer.h> #include <qspinbox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <klocale.h> #include <kmessagebox.h> using namespace Opie::Core; -AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) - : QListView( parent, name, flags ) +AccountView::AccountView( QWidget *parent, const char *name, Qt::WFlags flags ) + : Q3ListView( parent, name, flags ) { //connect( this, SIGNAL( selectionChanged(QListViewItem*) ), // SLOT( refresh(QListViewItem*) ) ); - connect( this, SIGNAL( clicked(QListViewItem*) ), - SLOT( refresh(QListViewItem*) ) ); - connect( this, SIGNAL( returnPressed(QListViewItem*) ), - SLOT( refresh(QListViewItem*) ) ); - connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, - SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) ); + connect( this, SIGNAL( clicked(Q3ListViewItem*) ), + SLOT( refresh(Q3ListViewItem*) ) ); + connect( this, SIGNAL( returnPressed(Q3ListViewItem*) ), + SLOT( refresh(Q3ListViewItem*) ) ); + connect( this, SIGNAL( mouseButtonPressed(int,Q3ListViewItem*,const QPoint&,int) ),this, + SLOT( slotHold(int,Q3ListViewItem*,const QPoint&,int) ) ); setSorting(0); } @@ -48,12 +50,12 @@ void AccountView::slotContextMenu(int id) view->contextMenuSelected(id); } -void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) +void AccountView::slotHold(int button, Q3ListViewItem * item,const QPoint&,int) { if (button==1) {return;} if (!item) return; AccountViewItem *view = static_cast<AccountViewItem *>(item); - QPopupMenu*m = view->getContextMenu(); + Q3PopupMenu*m = view->getContextMenu(); if (!m) return; connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); m->setFocus(); @@ -93,7 +95,7 @@ void AccountView::populate( QList<Account> list ) } } -void AccountView::refresh(QListViewItem *item) +void AccountView::refresh(Q3ListViewItem *item) { if ( item ) { @@ -145,7 +147,7 @@ void AccountView::refreshOutgoing() void AccountView::refreshCurrentSelected() { if ( !m_currentItem ) return; - QValueList<RecMailP> headerlist; + Q3ValueList<RecMailP> headerlist; AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); view->refresh(headerlist); emit refreshMailview(headerlist); @@ -166,7 +168,7 @@ void AccountView::refreshAll() RecBodyP AccountView::fetchBody(const RecMailP&aMail) { - QListViewItem*item = selectedItem (); + Q3ListViewItem*item = selectedItem (); if (!item) return new RecBody(); AccountViewItem *view = static_cast<AccountViewItem *>(item); return view->fetchBody(aMail); diff --git a/kmicromail/accountview.h b/kmicromail/accountview.h index 33f3479..14b0ff9 100644 --- a/kmicromail/accountview.h +++ b/kmicromail/accountview.h @@ -1,8 +1,10 @@ #ifndef ACCOUNTVIEW_H #define ACCOUNTVIEW_H -#include <qlistview.h> +#include <q3listview.h> #include <qlist.h> +//Added by qt3to4: +#include <Q3ValueList> #include <opie2/osmartpointer.h> #include <libmailwrapper/mailtypes.h> @@ -13,36 +15,36 @@ class Account; class IMAPviewItem; class MHviewItem; -class AccountView : public QListView +class AccountView : public Q3ListView { Q_OBJECT public: - AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); + AccountView( QWidget *parent = 0, const char *name = 0, Qt::WFlags flags = 0 ); virtual ~AccountView(); virtual void populate( QList<Account> list ); virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail); virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); virtual void downloadMailsInbox(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); virtual bool currentisDraft(); - QValueList<MHviewItem*> allAccounts() { return mhAccounts;} + Q3ValueList<MHviewItem*> allAccounts() { return mhAccounts;} public slots: virtual void refreshAll(); - virtual void refresh(QListViewItem *item); + virtual void refresh(Q3ListViewItem *item); virtual void refreshCurrent(); virtual void refreshCurrentSelected(); virtual void refreshOutgoing(); - virtual void slotHold(int, QListViewItem *,const QPoint&,int); + virtual void slotHold(int, Q3ListViewItem *,const QPoint&,int); virtual void slotContextMenu(int id); void setupFolderselect(Selectstore*sels); signals: - void refreshMailview(const QValueList<RecMailP>& ); + void refreshMailview(const Q3ValueList<RecMailP>& ); protected: - QListViewItem* m_currentItem; - QValueList<IMAPviewItem*> imapAccounts; - QValueList<MHviewItem*> mhAccounts; + Q3ListViewItem* m_currentItem; + Q3ValueList<IMAPviewItem*> imapAccounts; + Q3ValueList<MHviewItem*> mhAccounts; }; #endif diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 4bc4441..81d7b52 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp @@ -38,14 +38,14 @@ #include <qcombobox.h> #include <qcheckbox.h> -#include <qiconset.h> +#include <qicon.h> #include <qtimer.h> #include <qmessagebox.h> #include <qpushbutton.h> -#include <qmultilineedit.h> +#include <q3multilineedit.h> #include <qlabel.h> #include <qtabwidget.h> -#include <qlistview.h> +#include <q3listview.h> //using namespace Opie::Core; //using namespace Opie::Ui; @@ -125,7 +125,7 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); mMail = 0; warnAttach = true; - QIconSet icon; + QIcon icon; //icon = SmallIcon("fileexport"); icon = SmallIcon("filesave"); SaveButton->setIconSet (icon ) ; @@ -141,7 +141,7 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo QPEApplication::setStylusOperation( subjectLine, QPEApplication::RightOnHold ); #endif message->setFont ( KOPrefs::instance()->mComposeFont ); - message->setWordWrap (QMultiLineEdit::WidgetWidth); + message->setWordWrap (Q3MultiLineEdit::WidgetWidth); if ( smtpAccounts.count() > 0 ) { fillValues( smtpAccountBox->currentItem() ); } else { @@ -534,8 +534,8 @@ void ComposeMail::reEditMail(const RecMailP¤t) setCharset(body->getCharset()); } -AttachViewItem::AttachViewItem( QListView *parent, Attachment *att ) - : QListViewItem( parent ) +AttachViewItem::AttachViewItem( Q3ListView *parent, Attachment *att ) + : Q3ListViewItem( parent ) { attachment = att; if ( !attachment->getPixmap().isNull() ) diff --git a/kmicromail/composemail.h b/kmicromail/composemail.h index 966ac3e..9aef4e1 100644 --- a/kmicromail/composemail.h +++ b/kmicromail/composemail.h @@ -2,7 +2,7 @@ #define COMPOSEMAIL_H #include <qlineedit.h> -#include <qlistview.h> +#include <q3listview.h> #include "composemailui.h" //#include "addresspickerui.h" @@ -80,10 +80,10 @@ protected: bool warnAttach; }; -class AttachViewItem : public QListViewItem +class AttachViewItem : public Q3ListViewItem { public: - AttachViewItem( QListView *parent, Attachment *att ); + AttachViewItem( Q3ListView *parent, Attachment *att ); Attachment *getAttachment() { return attachment; } private: diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index 2c0f2d8..f274dc3 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp @@ -16,7 +16,7 @@ #include <qlineedit.h> #include <qlabel.h> #include <qtabwidget.h> -#include <qlistview.h> +#include <q3listview.h> #include <qspinbox.h> #include <klocale.h> #include <kfiledialog.h> @@ -25,8 +25,8 @@ using namespace Opie::Core; -AccountListItem::AccountListItem( QListView *parent, Account *a) - : QListViewItem( parent ) +AccountListItem::AccountListItem( Q3ListView *parent, Account *a) + : Q3ListViewItem( parent ) { account = a; setText( 0, account->getAccountName() ); @@ -51,7 +51,7 @@ AccountListItem::AccountListItem( QListView *parent, Account *a) setText( 1, ttext); } -EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) +EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : EditAccountsUI( parent, name, modal, flags ) { settings = s; @@ -308,7 +308,7 @@ void EditAccounts::accept() * SelectMailType */ -SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) +SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : SelectMailTypeUI( parent, name, modal, flags ) { selected = selection; @@ -325,7 +325,7 @@ void SelectMailType::slotSelection( const QString &sel ) * IMAPconfig */ -IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) +IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : IMAPconfigUI( parent, name, modal, flags ) { data = account; @@ -408,7 +408,7 @@ void IMAPconfig::accept() * POP3config */ -POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) +POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : POP3configUI( parent, name, modal, flags ) { data = account; @@ -489,7 +489,7 @@ void POP3config::accept() * SMTPconfig */ -SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) +SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : SMTPconfigUI( parent, name, modal, flags ) { data = account; @@ -498,7 +498,7 @@ SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); // fillValues(); - QIconSet icon; + QIcon icon; //icon = SmallIcon("fileexport"); icon = SmallIcon("fileopen"); SignaturButton->setText(""); @@ -572,7 +572,7 @@ void SMTPconfig::accept() * NNTPconfig */ -NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) +NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : NNTPconfigUI( parent, name, modal, flags ) { data = account; @@ -593,8 +593,8 @@ void NNTPconfig::slotShowSub() data->save(); ListViewGroups->clear(); for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { - QCheckListItem *item; - item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); + Q3CheckListItem *item; + item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox ); item->setOn( true ); } topLevelWidget()->setCaption( i18n("%1 groups subscribed").arg( subscribedGroups.count())); @@ -606,9 +606,9 @@ void NNTPconfig::slotShowFilter() ListViewGroups->clear(); int count = 0; for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) { - QCheckListItem *item; + Q3CheckListItem *item; if ( GroupFilter->text().isEmpty() || (*it).find( GroupFilter->text() ) >= 0 ) { - item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); + item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox ); ++count; if ( subscribedGroups.contains( (*it) ) >= 1 ) { item->setOn( true ); @@ -629,8 +629,8 @@ void NNTPconfig::slotGetNG() { ListViewGroups->clear(); for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) { - QCheckListItem *item; - item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); + Q3CheckListItem *item; + item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox ); if ( subscribedGroups.contains( (*it) ) >= 1 ) { item->setOn( true ); @@ -663,8 +663,8 @@ void NNTPconfig::fillValues() subscribedGroups = data->getGroups(); /* don't forget that - you will overwrite values if user clicks cancel! */ for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { - QCheckListItem *item; - item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); + Q3CheckListItem *item; + item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox ); item->setOn( true ); } } @@ -679,11 +679,11 @@ void NNTPconfig::save() data->setUser( userLine->text() ); data->setPassword( passLine->text() ); - QListViewItemIterator list_it( ListViewGroups ); + Q3ListViewItemIterator list_it( ListViewGroups ); for ( ; list_it.current(); ++list_it ) { - if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { + if ( ( (Q3CheckListItem*)list_it.current() )->isOn() ) { if ( subscribedGroups.contains( list_it.current()->text(0) ) < 1 ) subscribedGroups.append( list_it.current()->text(0) ); } else { diff --git a/kmicromail/editaccounts.h b/kmicromail/editaccounts.h index 465780c..3d01d23 100644 --- a/kmicromail/editaccounts.h +++ b/kmicromail/editaccounts.h @@ -2,7 +2,7 @@ #define EDITACCOUNTS_H #include <qstring.h> -#include <qlistview.h> +#include <q3listview.h> #include "editaccountsui.h" #include "selectmailtypeui.h" @@ -15,11 +15,11 @@ #include <libmailwrapper/settings.h> -class AccountListItem : public QListViewItem +class AccountListItem : public Q3ListViewItem { public: - AccountListItem( QListView *parent, Account *a); + AccountListItem( Q3ListView *parent, Account *a); Account *getAccount() { return account; } private: @@ -32,7 +32,7 @@ class EditAccounts : public EditAccountsUI Q_OBJECT public: - EditAccounts( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + EditAccounts( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); public slots: void slotNewAccount( const QString &type ); @@ -60,7 +60,7 @@ class SelectMailType : public SelectMailTypeUI Q_OBJECT public: - SelectMailType( QString *selection = 0, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + SelectMailType( QString *selection = 0, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); private slots: void slotSelection( const QString &sel ); @@ -75,7 +75,7 @@ class IMAPconfig : public IMAPconfigUI Q_OBJECT public: - IMAPconfig( IMAPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + IMAPconfig( IMAPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); public slots: void fillValues(); @@ -94,7 +94,7 @@ class POP3config : public POP3configUI Q_OBJECT public: - POP3config( POP3account *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + POP3config( POP3account *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); public slots: void fillValues(); @@ -113,7 +113,7 @@ class SMTPconfig : public SMTPconfigUI Q_OBJECT public: - SMTPconfig( SMTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + SMTPconfig( SMTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); public slots: void fillValues(); @@ -133,7 +133,7 @@ class NNTPconfig : public NNTPconfigUI Q_OBJECT public: - NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); public slots: void fillValues(); diff --git a/kmicromail/kmicromail.pro b/kmicromail/kmicromail.pro index 9f4d4bd..ce30bbf 100644 --- a/kmicromail/kmicromail.pro +++ b/kmicromail/kmicromail.pro @@ -41,7 +41,8 @@ SOURCES = main.cpp \ koprefsdialog.cpp\ nntpgroupsdlg.cpp -INTERFACES = editaccountsui.ui \ +#The following line was changed from INTERFACES to FORMS3 by qt3to4 +FORMS3 = editaccountsui.ui \ selectmailtypeui.ui \ imapconfigui.ui \ pop3configui.ui \ @@ -56,7 +57,7 @@ INTERFACES = editaccountsui.ui \ INCLUDEPATH += ./qpe . .. ../libkdepim ../microkde ../microkde/kdecore ../libetpan/include ../microkde/kdeui -LIBS += -L../bin -lmicromailwrapper -lmicrolibetpan -lmicrokde -lssl -lcrypto -lmicrokdepim -lmicrokabc -lpthread +LIBS += -L../bin -lmicromailwrapper -lxmicrolibetpan -lxmicrokde -lssl -lcrypto -lxmicrokdepim -lxmicrokabc -lpthread DESTDIR= ../bin TARGET = ompi @@ -76,3 +77,8 @@ OBJECTS_DIR = obj/win MOC_DIR = moc/win } +#The following line was inserted by qt3to4 +QT += xml qt3support +#The following line was inserted by qt3to4 +CONFIG += uic3 + diff --git a/kmicromail/kmicromailE.pro b/kmicromail/kmicromailE.pro index a5a51f7..19fa398 100644 --- a/kmicromail/kmicromailE.pro +++ b/kmicromail/kmicromailE.pro @@ -55,7 +55,7 @@ INTERFACES = editaccountsui.ui \ INCLUDEPATH += $(QPEDIR)/include . $(KDEPIMDIR) $(KDEPIMDIR)/libkdepim $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/libetpan/include $(KDEPIMDIR)/microkde/kdeui -LIBS += -L$(QPEDIR)/lib -lmicromailwrapper -lqpe -lmicrolibetpan -lmicrokde -lmicroqtcompat -lssl -lcrypto -ljpeg -lmicrokdepim -lpthread +LIBS += -L$(QPEDIR)/lib -lmicromailwrapper -lqpe -lxmicrolibetpan -lxmicrokde -lmicroqtcompat -lssl -lcrypto -ljpeg -lxmicrokdepim -lpthread LIBS += $(QTOPIALIB) #LIBS += -lqtopia #next line for Zaurus only diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp index e4b61dc..e2eed9a 100644 --- a/kmicromail/koprefs.cpp +++ b/kmicromail/koprefs.cpp @@ -26,7 +26,7 @@ #include <unistd.h> #endif #include <qdir.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <qstring.h> #include <qregexp.h> diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp index 017f1f7..e3102a4 100644 --- a/kmicromail/koprefsdialog.cpp +++ b/kmicromail/koprefsdialog.cpp @@ -23,24 +23,29 @@ #include <kdialog.h> #include <qlayout.h> #include <qlabel.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> +#include <q3groupbox.h> +#include <q3buttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qcombobox.h> -#include <qvbox.h> -#include <qhbox.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qregexp.h> #include <qspinbox.h> #include <qdatetime.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> -#include <qstrlist.h> +#include <q3strlist.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <QPixmap> +#include <Q3Frame> #include <kcolorbutton.h> #include <kdebug.h> @@ -111,9 +116,9 @@ void KOPrefsDialog::setupGlobalTab() } void KOPrefsDialog::setupMainTab() { - QFrame *topFrame = addPage(i18n("General"),0,0); + Q3Frame *topFrame = addPage(i18n("General"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); @@ -136,9 +141,9 @@ void KOPrefsDialog::setupMainTab() void KOPrefsDialog::setupMailTab() { - QFrame *topFrame = addPage(i18n("Mail"),0,0); + Q3Frame *topFrame = addPage(i18n("Mail"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); @@ -182,10 +187,10 @@ void KOPrefsDialog::setupMailTab() void KOPrefsDialog::setupFontsTab() { - QFrame *topFrame = addPage(i18n("Fonts"),0,0); + Q3Frame *topFrame = addPage(i18n("Fonts"),0,0); // DesktopIcon("fonts",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,7,3); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,7,3); topLayout->setSpacing(1); topLayout->setMargin(3); KPrefsDialogWidFont * tVFont; @@ -238,8 +243,8 @@ void KOPrefsDialog::usrWriteConfig() #if 0 void KOPrefsDialog::setupLocaleDateTab() { -QFrame *topFrame = addPage(i18n("Date Format"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,3,2); +Q3Frame *topFrame = addPage(i18n("Date Format"),0,0); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; @@ -292,8 +297,8 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0); void KOPrefsDialog::setupLocaleTab() { - QFrame *topFrame = addPage(i18n("Locale"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3Frame *topFrame = addPage(i18n("Locale"),0,0); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; @@ -331,7 +336,7 @@ void KOPrefsDialog::setupLocaleTab() } else { QWidget * hb = new QWidget( topFrame ); - QHBoxLayout *hbLayout = new QHBoxLayout(hb); + Q3HBoxLayout *hbLayout = new Q3HBoxLayout(hb); sb = addWidBool(i18n("Week starts on Sunday"), &(KOPrefs::instance()->mWeekStartsOnSunday),hb); @@ -361,9 +366,9 @@ void KOPrefsDialog::setupSyncAlgTab() { #if 0 QLabel * lab; - QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); + Q3Frame *topFrame = addPage(i18n("Sync Prefs"),0,0); mSetupSyncAlgTab = topFrame; - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; @@ -403,8 +408,8 @@ void KOPrefsDialog::setupSyncTab() { #if 0 QLabel * lab; - QFrame *topFrame = addPage(i18n("Sync Network"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3Frame *topFrame = addPage(i18n("Sync Network"),0,0); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); @@ -451,10 +456,10 @@ void KOPrefsDialog::setupSyncTab() void KOPrefsDialog::setupMainTab() { - QFrame *topFrame = addPage(i18n("General"),0,0); + Q3Frame *topFrame = addPage(i18n("General"),0,0); // DesktopIcon("identity",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); @@ -475,11 +480,11 @@ void KOPrefsDialog::setupMainTab() topLayout->addWidget(mEmailLabel,1,0); topLayout->addWidget(mEmailEdit,1,1); KPrefsDialogWidBool *wb; - QHBox *dummy; + Q3HBox *dummy; if ( QApplication::desktop()->width() > 480 ) { - dummy = new QHBox(topFrame); + dummy = new Q3HBox(topFrame); } else { - dummy = new QVBox(topFrame); + dummy = new Q3VBox(topFrame); } topLayout->addMultiCellWidget(dummy, 2,2,0,1); @@ -491,7 +496,7 @@ void KOPrefsDialog::setupMainTab() &(KOPrefs::instance()->mToolBarMiniIcons),dummy); - dummy = new QHBox(topFrame); + dummy = new Q3HBox(topFrame); new QLabel(i18n("Days in What's Next:"),dummy); mWhatsNextSpin = new QSpinBox(1,14,1,dummy); @@ -499,13 +504,13 @@ void KOPrefsDialog::setupMainTab() - dummy = new QHBox(topFrame); + dummy = new Q3HBox(topFrame); new QLabel(i18n("Days in Next-X-Days:"),dummy); mNextXDaysSpin = new QSpinBox(2,14,1,dummy); topLayout->addMultiCellWidget(dummy,4,4,0,1); - QHBox *prioBox = new QHBox(topFrame); + Q3HBox *prioBox = new Q3HBox(topFrame); // intervalBox->setSpacing(spacingHint()); topLayout->addMultiCellWidget(prioBox,5,5,0,1); QString messa = i18n("Show topmost todo prios in What's Next:"); @@ -529,7 +534,7 @@ void KOPrefsDialog::setupMainTab() // addWidBool(i18n("Enable automatic saving of calendar"), // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); - QHBox *intervalBox = new QHBox(topFrame); + Q3HBox *intervalBox = new Q3HBox(topFrame); // intervalBox->setSpacing(spacingHint()); topLayout->addMultiCellWidget(intervalBox,6,6,0,1); QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); @@ -620,14 +625,14 @@ void KOPrefsDialog::setupMainTab() void KOPrefsDialog::setupTimeTab() { - QFrame *topFrame = addPage(i18n("Time"),0,0); + Q3Frame *topFrame = addPage(i18n("Time"),0,0); // DesktopIcon("clock",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); - QHBox *dummy = new QHBox(topFrame); + Q3HBox *dummy = new Q3HBox(topFrame); KPrefsWidTime *dayBegins = addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), dummy); @@ -658,22 +663,22 @@ void KOPrefsDialog::setupTimeTab() topLayout->addWidget(mAlarmTimeCombo,3,1); - QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, + Q3GroupBox *workingHoursGroup = new Q3GroupBox(1,Qt::Horizontal, i18n("Working Hours"), topFrame); topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); workingHoursGroup->layout()->setSpacing( 0 ); workingHoursGroup->layout()->setMargin( 4 ); - QHBox *workStartBox = new QHBox(workingHoursGroup); + Q3HBox *workStartBox = new Q3HBox(workingHoursGroup); // workStartBox->setMargin( 0 ); addWidTime(i18n("Daily starting hour:"), &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); - QHBox *workEndBox = new QHBox(workingHoursGroup); + Q3HBox *workEndBox = new Q3HBox(workingHoursGroup); //workEndBox->setMargin( 0 ); addWidTime(i18n("Daily ending hour:"), &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); - QVBox *excludeBox = new QVBox(workingHoursGroup); + Q3VBox *excludeBox = new Q3VBox(workingHoursGroup); //excludeBox->setMargin( 0 ); addWidBool(i18n("Exclude holidays"), &(KOPrefs::instance()->mExcludeHolidays),excludeBox); @@ -693,10 +698,10 @@ void KOPrefsDialog::setupTimeTab() void KOPrefsDialog::setupViewsTab() { - QFrame *topFrame = addPage(i18n("Views"),0,0); + Q3Frame *topFrame = addPage(i18n("Views"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,6,1); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); @@ -785,7 +790,7 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("ViewChange"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,6,1); + topLayout = new Q3GridLayout(topFrame,6,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); ii = 0; @@ -838,12 +843,12 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("Month View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,5,1); + topLayout = new Q3GridLayout(topFrame,5,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); ii = 0; QLabel *lab; - QHBox *habo = new QHBox( topFrame ); + Q3HBox *habo = new Q3HBox( topFrame ); if ( QApplication::desktop()->width() < 320 ) { lab = new QLabel ( i18n("Show events that recur "), topFrame ); topLayout->addMultiCellWidget(lab,ii, ii,0,1); @@ -865,7 +870,7 @@ void KOPrefsDialog::setupViewsTab() ii++; - habo = new QHBox( topFrame ); + habo = new Q3HBox( topFrame ); if ( QApplication::desktop()->width() < 320 ) { lab = new QLabel (i18n("Show in every cell ") , topFrame ); topLayout->addMultiCellWidget(lab,ii, ii,0,1); @@ -933,7 +938,7 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("Todo View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); ii = 0; @@ -965,7 +970,7 @@ void KOPrefsDialog::setupViewsTab() KPrefsWidColor *todoDueTodayColor = addWidColor(i18n("Todo due today color:"), &(KOPrefs::instance()->mTodoDueTodayColor),wid); - QHBoxLayout *widLayout = new QHBoxLayout(wid); + Q3HBoxLayout *widLayout = new Q3HBoxLayout(wid); widLayout->addWidget( todoDueTodayColor->label() ); widLayout->addWidget( todoDueTodayColor->button() ); topLayout->addWidget(wid,ii++,0); @@ -973,7 +978,7 @@ void KOPrefsDialog::setupViewsTab() // Todo overdue color wid = new QWidget( topFrame ); - widLayout = new QHBoxLayout(wid); + widLayout = new Q3HBoxLayout(wid); KPrefsWidColor *todoOverdueColor = addWidColor(i18n("Todo overdue color:"), &(KOPrefs::instance()->mTodoOverdueColor),wid); @@ -997,7 +1002,7 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("Alarm"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,2,1); + topLayout = new Q3GridLayout(topFrame,2,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; @@ -1010,28 +1015,28 @@ void KOPrefsDialog::setupViewsTab() topLayout->addWidget(lab ,iii++,0); #ifndef DESKTOP_VERSION - lab->setAlignment( AlignLeft|WordBreak|AlignTop); + lab->setAlignment( Qt::AlignLeft|Qt::TextWordWrap|Qt::AlignTop); #else - lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); + lab->setAlignment( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); #endif - QHBox* dummyBox = new QHBox(topFrame); + Q3HBox* dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Play beeps count:"),dummyBox); mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Beeps interval in sec:"),dummyBox); mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Default suspend time in min:"),dummyBox); mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Auto suspend count:"),dummyBox); mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); @@ -1042,7 +1047,7 @@ void KOPrefsDialog::setupViewsTab() - QHBox* hbo = new QHBox ( topFrame ); + Q3HBox* hbo = new Q3HBox ( topFrame ); mDefaultAlarmFile = new QLineEdit(hbo); QPushButton * loadTemplate = new QPushButton(hbo); QPixmap icon; @@ -1082,10 +1087,10 @@ void KOPrefsDialog::selectSoundFile() void KOPrefsDialog::setupFontsTab() { - QFrame *topFrame = addPage(i18n("Fonts"),0,0); + Q3Frame *topFrame = addPage(i18n("Fonts"),0,0); // DesktopIcon("fonts",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,7,3); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,7,3); topLayout->setSpacing(1); topLayout->setMargin(3); KPrefsDialogWidFont * tVFont; @@ -1152,7 +1157,7 @@ void KOPrefsDialog::setupFontsTab() topFrame = addPage(i18n("View Fonts"),0, DesktopIcon("fonts",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,7,3); + topLayout = new Q3GridLayout(topFrame,7,3); topLayout->setSpacing(1); topLayout->setMargin(3); @@ -1220,10 +1225,10 @@ void KOPrefsDialog::setupFontsTab() void KOPrefsDialog::setupColorsTab() { - QFrame *topFrame = addPage(i18n("Colors"),0,0); + Q3Frame *topFrame = addPage(i18n("Colors"),0,0); // DesktopIcon("colorize",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2); // topLayout->setSpacing(spacingHint()); // topLayout->setMargin(marginHint()); @@ -1231,9 +1236,9 @@ void KOPrefsDialog::setupColorsTab() topLayout->setMargin(3); int ii = 1; - QGroupBox *categoryGroup ; + Q3GroupBox *categoryGroup ; - categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), + categoryGroup = new Q3GroupBox(1,Qt::Vertical,i18n("Categories"), topFrame); topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); @@ -1326,7 +1331,7 @@ void KOPrefsDialog::setupPrinterTab() mPrinterTab = addPage(i18n("Printing"),0, DesktopIcon("fileprint",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(mPrinterTab,5,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); @@ -1336,10 +1341,10 @@ void KOPrefsDialog::setupPrinterTab() void KOPrefsDialog::setupGroupSchedulingTab() { #if 0 - QFrame *topFrame = addPage(i18n("Group Scheduling"),0, + Q3Frame *topFrame = addPage(i18n("Group Scheduling"),0, DesktopIcon("personal",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); @@ -1362,7 +1367,7 @@ void KOPrefsDialog::setupGroupSchedulingTab() topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); - mAMails = new QListView(topFrame); + mAMails = new Q3ListView(topFrame); mAMails->addColumn(i18n("Email"),300); topLayout->addMultiCellWidget(mAMails,3,3,0,1); @@ -1380,17 +1385,17 @@ void KOPrefsDialog::setupGroupSchedulingTab() connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); - connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); + connect(mAMails,SIGNAL(selectionChanged(Q3ListViewItem *)),SLOT(updateInput())); #endif } void KOPrefsDialog::setupGroupAutomationTab() { return; - QFrame *topFrame = addPage(i18n("Group Automation"),0, + Q3Frame *topFrame = addPage(i18n("Group Automation"),0, DesktopIcon("personal",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,1); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); @@ -1543,7 +1548,7 @@ void KOPrefsDialog::usrWriteConfig() //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); - QDictIterator<QColor> it(mCategoryDict); + Q3DictIterator<QColor> it(mCategoryDict); while (it.current()) { KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); ++it; @@ -1683,14 +1688,14 @@ void KOPrefsDialog::updateTimezoneOffset( int index ) void KOPrefsDialog::setupTimeZoneTab() { - QFrame *topFrame = addPage(i18n("Time Zone"),0,0); + Q3Frame *topFrame = addPage(i18n("Time Zone"),0,0); // DesktopIcon("clock",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); - QHBox *timeZoneBox = new QHBox( topFrame ); + Q3HBox *timeZoneBox = new Q3HBox( topFrame ); topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); new QLabel( i18n("Timezone:"), timeZoneBox ); diff --git a/kmicromail/koprefsdialog.h b/kmicromail/koprefsdialog.h index 7fa9261..042af3f 100644 --- a/kmicromail/koprefsdialog.h +++ b/kmicromail/koprefsdialog.h @@ -23,10 +23,12 @@ #ifndef _KOPREFSDIALOG_H #define _KOPREFSDIALOG_H -#include <qframe.h> -#include <qdict.h> +#include <q3frame.h> +#include <q3dict.h> #include <qcolor.h> -#include <qlistview.h> +#include <q3listview.h> +//Added by qt3to4: +#include <QLabel> #include <kdialogbase.h> @@ -119,7 +121,7 @@ protected: KPrefsWidBool *mEnableGroupScheduling; KPrefsWidBool *mEnableProjectView; - QFrame *mPrinterTab; + Q3Frame *mPrinterTab; QLineEdit *nameEdit; QLineEdit *emailEdit; @@ -146,7 +148,7 @@ protected: QComboBox *mCategoryCombo; KColorButton *mCategoryButton; - QDict<QColor> mCategoryDict; + Q3Dict<QColor> mCategoryDict; QSlider *mHourSizeSlider; 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 @@ -3,7 +3,7 @@ ###################################################################### TEMPLATE = lib -TARGET = microlibetpan +TARGET = xmicrolibetpan OBJECTS_DIR = obj MOC_DIR = moc 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 @@ -3,7 +3,7 @@ ###################################################################### TEMPLATE = lib -TARGET = microlibetpan +TARGET = xmicrolibetpan OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) 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 @@ -8,13 +8,15 @@ #include <qpe/global.h> -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qapplication.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <klocale.h> #include <kdecore/kstandarddirs.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <stdlib.h> #include <libetpan/mailmime_content.h> #include <libetpan/mailmime.h> @@ -111,10 +113,10 @@ QString AbstractMail::convert_String(const char*text) QString AbstractMail::gen_attachment_id() { QFile file( "/proc/sys/kernel/random/uuid" ); - if (!file.open(IO_ReadOnly ) ) + if (!file.open(QIODevice::ReadOnly ) ) return QString::null; - QTextStream stream(&file); + Q3TextStream stream(&file); return "{" + stream.read().stripWhiteSpace() + "}"; } @@ -138,16 +140,16 @@ QString AbstractMail::draftFolder() } /* temporary - will be removed when implemented in all classes */ -void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &) +void AbstractMail::deleteMails(const QString &,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &) { } -void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) +void AbstractMail::deleteMailList(const Q3ValueList<RecMailP>&target) { //qDebug("AbstractMail::deleteMailList:: Please reimplement! "); // this is currently re-implemented in pop3wrapper and imapwrapper int iii = 0; int count = target.count(); - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Deleting ...")); wid.show(); while (iii < count ) { @@ -177,7 +179,7 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); return; } - QValueList<RecMailP> t; + Q3ValueList<RecMailP> t; listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); if ( t.count() == 0 ) { qDebug("There are no new messages %s", fromFolder->getName().latin1()); @@ -187,10 +189,10 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe Global::statusMessage(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); qDebug(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); qApp->processEvents(); - QValueList<RecMailP> e; + Q3ValueList<RecMailP> e; targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); //qDebug("target has mails %d ", e.count()); - QValueList<RecMailP> n; + Q3ValueList<RecMailP> n; int iii = 0; int count = t.count(); while (iii < count ) { @@ -221,7 +223,7 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe Global::statusMessage(i18n("Downloaded %1 messages").arg(n.count())); #if 0 - QValueList<RecMailP> t; + Q3ValueList<RecMailP> t; listMessages(fromFolder->getName(),t, maxSizeInKb); mvcpMailList( t,targetFolder,targetWrapper,moveit); #endif @@ -230,12 +232,12 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe void AbstractMail::mvcpAllMails(const FolderP&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) { - QValueList<RecMailP> t; + Q3ValueList<RecMailP> t; listMessages(fromFolder->getName(),t, maxSizeInKb); mvcpMailList( t,targetFolder,targetWrapper,moveit); } -void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, +void AbstractMail::mvcpMailList(const Q3ValueList<RecMailP>& t, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) { encodedString*st = 0; @@ -246,7 +248,7 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, // wel, processevents is qite strange, we need a widget for getting // Global::statusMessage(i18n("Copy2 message %1").arg(iii)); displaye - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Copying...")); wid.show(); while (iii < count ) { 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 @@ -7,6 +7,8 @@ #include "settings.h" #include <qobject.h> +//Added by qt3to4: +#include <Q3ValueList> #include <opie2/osmartpointer.h> #include "mailtypes.h" @@ -25,8 +27,8 @@ class AbstractMail:public QObject public: AbstractMail(){}; virtual ~AbstractMail(){} - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0; - virtual void listMessages(const QString & mailbox,QValueList<RecMailP>&target, int sizeInKb = 0 )=0; + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0; + virtual void listMessages(const QString & mailbox,Q3ValueList<RecMailP>&target, int sizeInKb = 0 )=0; virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; virtual RecBodyP fetchBody(const RecMailP&mail)=0; virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part)=0; @@ -35,16 +37,16 @@ public: virtual encodedString* fetchRawBody(const RecMailP&mail)=0; virtual void deleteMail(const RecMailP&mail)=0; - virtual void deleteMailList(const QValueList<RecMailP>&target); + virtual void deleteMailList(const Q3ValueList<RecMailP>&target); virtual void answeredMail(const RecMailP&mail)=0; virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&)=0; - virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> >&target); + virtual void deleteMails(const QString & FolderName,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target); virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&)=0; virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; void downloadNewMails(const FolderP&fromFolder,AbstractMail*targetWrapper ); virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int sizeInKb = 0); - virtual void mvcpMailList(const QValueList<RecMailP>& t, + virtual void mvcpMailList(const Q3ValueList<RecMailP>& t, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 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 @@ -7,6 +7,8 @@ #include <stdlib.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <Q3CString> using namespace Opie::Core; const char* Generatemail::USER_AGENT="KOpieMail 33 1/3"; @@ -228,7 +230,7 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) { mailmime_content *content; mailmime_parameter *param; int err; - QCString __str; + Q3CString __str; //qDebug(" Generatemail::buildTxtPart %s", str.latin1()); param = mailmime_parameter_new( strdup( "charset" ), strdup( mCharset.latin1() ) ); @@ -252,7 +254,7 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) { goto err_free_fields; { //__str = str.utf8(); - __str = QCString (str.latin1()); + __str = Q3CString (str.latin1()); err = mailmime_set_body_text( txtPart, strdup(__str.data()), __str.length() ); } if ( err != MAILIMF_NO_ERROR ) 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 @@ -6,6 +6,8 @@ #include <kconfig.h> #include <kglobal.h> #include <kstandarddirs.h> +//Added by qt3to4: +#include <Q3ValueList> using namespace Opie::Core; @@ -182,7 +184,7 @@ QString Genericwrapper::getencoding(mailmime_mechanism*aEnc) return enc; } -void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count) +void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueList<int>recList,unsigned int current_rec,int current_count) { if (current_rec >= 10) { ; // odebug << "too deep recursion!" << oendl; @@ -200,7 +202,7 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m switch (mime->mm_type) { case MAILMIME_SINGLE: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; countlist.append(current_count); r = mailmessage_fetch_section(message,mime,&data,&len); part->setSize(len); @@ -250,7 +252,7 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m { unsigned int ccount = 1; mailmime*cbody=0; - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; for (cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list) ; cur != NULL ; cur = clist_next(cur)) { cbody = (mailmime*)clist_content(cur); if (cbody->mm_type==MAILMIME_MULTIPLE) { @@ -270,7 +272,7 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m break; case MAILMIME_MESSAGE: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; countlist.append(current_count); /* the own header is always at recursion 0 - we don't need that */ if (current_rec > 0) { @@ -302,7 +304,7 @@ RecBodyP Genericwrapper::parseMail( mailmessage * msg ) RecBodyP body = new RecBody(); //memset(&fields, 0, sizeof(struct mailmime_single_fields)); err = mailmessage_get_bodystructure(msg,&mime); - QValueList<int>recList; + Q3ValueList<int>recList; traverseBody(body,msg,mime,recList); return body; } @@ -447,7 +449,7 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) return res; } -void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) +void Genericwrapper::parseList(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) { int r; mailmessage_list * env_list = 0; 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 @@ -5,6 +5,8 @@ #include "abstractmail.h" #include <qmap.h> #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> #include <libetpan/clist.h> class RecMail; @@ -51,11 +53,11 @@ protected: QString parseGroup( mailimf_group *group ); QString parseAddressList( mailimf_address_list *list ); - void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1); + void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueList<int>recList,unsigned int current_rek=0,int current_count=1); static void fillSingleBody(RecPartP&target,mailmessage*message,mailmime*mime); static void fillParameters(RecPartP&target,clist*parameters); static QString getencoding(mailmime_mechanism*aEnc); - virtual void parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0); + virtual void parseList(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0); QStringList parseInreplies(mailimf_in_reply_to * in_replies); QString msgTempName; 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 @@ -3,10 +3,12 @@ #include <libetpan/libetpan.h> #include <qpe/global.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3ValueList> #include "imapwrapper.h" #include "mailtypes.h" #include "logindialog.h" -#include <qprogressbar.h> +#include <q3progressbar.h> #include "genericwrapper.h" #include <kglobal.h> @@ -239,7 +241,7 @@ void IMAPwrapper::logout() m_Lastmbox = ""; } -void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) +void IMAPwrapper::listMessages(const QString&mailbox,Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) { int tryAgain = 1; @@ -320,7 +322,7 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma } } -QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() { const char *path, *mask; int err = MAILIMAP_NO_ERROR; @@ -329,7 +331,7 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() clistcell*cur_flag = 0; mailimap_mbx_list_flags*bflags = 0; - QValueList<FolderP>* folders = new QValueList<FolderP>(); + Q3ValueList<FolderP>* folders = new Q3ValueList<FolderP>(); login(); if (!m_imap) { return folders; @@ -613,7 +615,7 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) mailimap_msg_att * msg_att; msg_att = (mailimap_msg_att*)current->data; mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data; - QValueList<int> path; + Q3ValueList<int> path; body_desc = item->att_data.att_static->att_data.att_body; traverseBody(mail,body_desc,body,0,path); } else { @@ -664,7 +666,7 @@ QStringList IMAPwrapper::address_list_to_stringlist(clist*list) return l; } -encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call) +encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call) { encodedString*res=new encodedString; int err; @@ -738,7 +740,7 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int /* current_recursion is for recursive calls. current_count means the position inside the internal loop! */ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body, - int current_recursion,QValueList<int>recList,int current_count) + int current_recursion,Q3ValueList<int>recList,int current_count) { if (!body || current_recursion>=10) { return; @@ -746,7 +748,7 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t switch (body->bd_type) { case MAILIMAP_BODY_1PART: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; countlist.append(current_count); RecPartP currentPart = new RecPart(); mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; @@ -799,7 +801,7 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t break; case MAILIMAP_BODY_MPART: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; clistcell*current=0; mailimap_body*current_body=0; unsigned int ccount = 1; @@ -985,7 +987,7 @@ void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which target_part->setEncoding(encoding); target_part->setSize(which->bd_size); } -void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) +void IMAPwrapper::deleteMailList(const Q3ValueList<RecMailP>&target) { //#if 0 mailimap_flag_list*flist; @@ -1005,7 +1007,7 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) mMax = count; progress( i18n("Delete")); - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Deleting ...")); wid.show(); while (iii < count ) { @@ -1114,7 +1116,7 @@ void IMAPwrapper::answeredMail(const RecMailP&mail) } } -QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) +QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call,const QString&enc) { QString body(""); encodedString*res = fetchRawPart(mail,path,internal_call); @@ -1299,7 +1301,7 @@ const QString&IMAPwrapper::getName()const encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) { // dummy - QValueList<int> path; + Q3ValueList<int> path; return fetchRawPart(mail,path,false); } 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 @@ -3,6 +3,8 @@ #define __IMAPWRAPPER #include <qlist.h> +//Added by qt3to4: +#include <Q3ValueList> #include "mailwrapper.h" #include "abstractmail.h" #include <libetpan/clist.h> @@ -24,12 +26,12 @@ class IMAPwrapper : public AbstractMail public: IMAPwrapper( IMAPaccount *a ); virtual ~IMAPwrapper(); - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); - virtual void listMessages(const QString & mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual void listMessages(const QString & mailbox,Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); - void deleteMailList(const QValueList<RecMailP>&target); + void deleteMailList(const Q3ValueList<RecMailP>&target); virtual void answeredMail(const RecMailP&mail); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&folder); virtual void storeMessage(const char*msg,size_t length, const QString&folder); @@ -59,8 +61,8 @@ protected: void login(bool tryTLS = true); bool start_tls(bool force=true); - virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); - virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call); + virtual QString fetchTextPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call=false,const QString&enc=""); + virtual encodedString*fetchRawPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call); int selectMbox(const QString&mbox); void fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description); @@ -68,7 +70,7 @@ protected: void fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which); void fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which); void fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which); - void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,QValueList<int>recList,int current_count=1); + void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,Q3ValueList<int>recList,int current_count=1); /* just helpers */ static void fillBodyFields(RecPartP&target_part,mailimap_body_fields*which); 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 @@ -38,7 +38,8 @@ SOURCES = imapwrapper.cpp \ ../qpe/qdialog_hacked.cpp \ ../qpe/global.cpp -INTERFACES = logindialogui.ui \ +#The following line was changed from INTERFACES to FORMS3 by qt3to4 +FORMS3 = logindialogui.ui \ sendmailprogressui.ui INCLUDEPATH += ../qpe .. ../../microkde ../../microkde/kdecore ../../libetpan/include @@ -63,3 +64,8 @@ QMAKE_LINK += /NODEFAULTLIB:LIBC OBJECTS_DIR = obj/win MOC_DIR = moc/win } +#The following line was inserted by qt3to4 +QT += xml qt3support +#The following line was inserted by qt3to4 +CONFIG += uic3 + 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 @@ -6,7 +6,7 @@ //using namespace Opie::Core; -LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, WFlags flags ) +LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : LoginDialogUI( parent, name, modal, flags ) { userLine->setText( (user.isEmpty()?QString(""):user) ); 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 @@ -8,7 +8,7 @@ class LoginDialog : public LoginDialogUI Q_OBJECT public: - LoginDialog(const QString&user,const QString&pass, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); + LoginDialog(const QString&user,const QString&pass, QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags flags = 0 ); QString getUser() { return _user; } QString getPassword() { return _pass; } 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 @@ -3,6 +3,8 @@ //#include <opie2/odebug.h> #include <stdlib.h> +//Added by qt3to4: +#include <Q3ValueList> using namespace Opie::Core; RecMail::RecMail() @@ -283,12 +285,12 @@ const QString RecPart::searchParamter(const QString&key)const return value; } -void RecPart::setPositionlist(const QValueList<int>&poslist) +void RecPart::setPositionlist(const Q3ValueList<int>&poslist) { m_poslist = poslist; } -const QValueList<int>& RecPart::Positionlist()const +const Q3ValueList<int>& RecPart::Positionlist()const { return m_poslist; } @@ -323,13 +325,13 @@ const QString& RecBody::Bodytext()const return m_BodyText; } -void RecBody::setParts(const QValueList<RecPartP>&parts) +void RecBody::setParts(const Q3ValueList<RecPartP>&parts) { m_PartsList.clear(); m_PartsList = parts; } -const QValueList<RecPartP>& RecBody::Parts()const +const Q3ValueList<RecPartP>& RecBody::Parts()const { return m_PartsList; } 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 @@ -14,7 +14,7 @@ #include <qstring.h> #include <qstringlist.h> #include <qmap.h> -#include <qvaluelist.h> +#include <q3valuelist.h> class AbstractMail; /* a class to describe mails in a mailbox */ @@ -109,7 +109,7 @@ protected: unsigned int m_lines,m_size; part_plist_t m_Parameters; /* describes the position in the mail */ - QValueList<int> m_poslist; + Q3ValueList<int> m_poslist; public: RecPart(); @@ -136,8 +136,8 @@ public: const part_plist_t&Parameters()const; void addParameter(const QString&key,const QString&value); const QString searchParamter(const QString&key)const; - void setPositionlist(const QValueList<int>&poslist); - const QValueList<int>& Positionlist()const; + void setPositionlist(const Q3ValueList<int>&poslist); + const Q3ValueList<int>& Positionlist()const; }; typedef Opie::Core::OSmartPointer<RecPart> RecPartP; @@ -147,7 +147,7 @@ class RecBody:public Opie::Core::ORefCount protected: QString m_BodyText; QString mCharset; - QValueList<RecPartP> m_PartsList; + Q3ValueList<RecPartP> m_PartsList; RecPartP m_description; public: @@ -162,8 +162,8 @@ public: void setDescription(const RecPartP&des); const RecPartP& Description()const; - void setParts(const QValueList<RecPartP>&parts); - const QValueList<RecPartP>& Parts()const; + void setParts(const Q3ValueList<RecPartP>&parts); + const Q3ValueList<RecPartP>& Parts()const; void addPart(const RecPartP&part); }; 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 @@ -5,6 +5,8 @@ #include <fcntl.h> #include <string.h> #include <qdir.h> +//Added by qt3to4: +#include <Q3CString> #include "mailwrapper.h" //#include "logindialog.h" @@ -81,8 +83,8 @@ QString IMAPFolder::decodeFolderName( const QString &name ) unsigned long ucs4, utf16, bitbuf; unsigned char base64[256], utf8[6]; unsigned long srcPtr = 0; - QCString dst = ""; - QCString src = name.ascii(); + Q3CString dst = ""; + Q3CString src = name.ascii(); /* initialize modified base64 decoding table */ memset(base64, UNDEFINED, sizeof(base64)); @@ -92,9 +94,9 @@ QString IMAPFolder::decodeFolderName( const QString &name ) /* loop until end of string */ while (srcPtr < src.length ()) { - c = src[srcPtr++]; + c = src.at(srcPtr++); /* deal with literal characters and &- */ - if (c != '&' || src[srcPtr] == '-') { + if (c != '&' || src.at(srcPtr) == '-') { /* encode literally */ dst += c; /* skip over the '-' if this is an &- sequence */ @@ -105,7 +107,7 @@ QString IMAPFolder::decodeFolderName( const QString &name ) bitbuf = 0; bitcount = 0; ucs4 = 0; - while ((c = base64[(unsigned char) src[srcPtr]]) != UNDEFINED) { + while ((c = base64[(unsigned char) src.at(srcPtr)]) != UNDEFINED) { ++srcPtr; bitbuf = (bitbuf << 6) | c; bitcount += 6; @@ -149,7 +151,7 @@ QString IMAPFolder::decodeFolderName( const QString &name ) } } /* skip over trailing '-' in modified UTF-7 encoding */ - if (src[srcPtr] == '-') + if (src.at(srcPtr) == '-') ++srcPtr; } } 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 @@ -6,6 +6,8 @@ #include <qbitarray.h> #include <qdatetime.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <QPixmap> #include <kiconloader.h> #include "settings.h" @@ -61,7 +63,7 @@ public: */ virtual ~Mail(){} void addAttachment( Attachment *att ) { attList.append( att ); } - const QList<Attachment>& getAttachments()const { return attList; } + const QList<Attachment*>& getAttachments()const { return attList; } void removeAttachment( Attachment *att ) { attList.remove( att ); } const QString&getName()const { return name; } void setName( QString s ) { name = s; } @@ -86,7 +88,7 @@ public: const QString& getCharset() const { return charset; } private: - QList<Attachment> attList; + QList<Attachment*> attList; QString name, mail, to, cc, bcc, reply, subject, message, charset; QStringList m_in_reply_to; }; 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 @@ -3,6 +3,8 @@ #include "mailwrapper.h" #include <libetpan/libetpan.h> #include <qdir.h> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> #include <klocale.h> @@ -23,7 +25,7 @@ MBOXwrapper::~MBOXwrapper() { } -void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target ) +void MBOXwrapper::listMessages(const QString & mailbox, Q3ValueList<RecMailP> &target ) { mailstorage*storage = mailstorage_new(NULL); QString p = MBOXPath+"/"; @@ -48,9 +50,9 @@ void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &ta Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); } -QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); QDir dir(MBOXPath); if (!dir.exists()) return folders; dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); @@ -217,7 +219,7 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail) return result; } -void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) +void MBOXwrapper::deleteMails(const QString & mailbox,const Q3ValueList<RecMailP> &target) { QString p = MBOXPath+"/"; p+=mailbox; @@ -231,11 +233,11 @@ void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> mailmbox_done(f); } -void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target) +void MBOXwrapper::deleteMails(mailmbox_folder*f,const Q3ValueList<RecMailP> &target) { if (!f) return; int r; - QValueList<RecMailP>::ConstIterator it; + Q3ValueList<RecMailP>::ConstIterator it; for (it=target.begin(); it != target.end();++it) { r = mailmbox_delete_msg(f,(*it)->getNumber()); if (r!=MAILMBOX_NO_ERROR) { 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 @@ -3,6 +3,8 @@ #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> class encodedString; struct mailmbox_folder; @@ -15,8 +17,8 @@ public: MBOXwrapper(const QString & dir,const QString&name); virtual ~MBOXwrapper(); - virtual void listMessages(const QString & mailbox, QValueList<RecMailP>&target ); - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual void listMessages(const QString & mailbox, Q3ValueList<RecMailP>&target ); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); @@ -32,14 +34,14 @@ public: static void mbox_progress( size_t current, size_t maximum ); virtual encodedString* fetchRawBody(const RecMailP&mail); - virtual void deleteMails(const QString & FolderName,const QValueList<RecMailP> &target); + virtual void deleteMails(const QString & FolderName,const Q3ValueList<RecMailP> &target); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); virtual MAILLIB::ATYPE getType()const; virtual const QString&getName()const; virtual Account* getAccount() { return 0; }; protected: - static void deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target); + static void deleteMails(mailmbox_folder*f,const Q3ValueList<RecMailP> &target); QString MBOXPath; QString MBOXName; }; 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 @@ -5,6 +5,8 @@ #include <libetpan/libetpan.h> #include <qdir.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> #include <qpe/global.h> #include <klocale.h> @@ -64,7 +66,7 @@ MHwrapper::~MHwrapper() clean_storage(); } -void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) +void MHwrapper::listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) { init_storage(); if (!m_storage) { @@ -80,9 +82,9 @@ void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSm Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); } -QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); /* this is needed! */ if (m_storage) mailstorage_disconnect(m_storage); init_storage(); @@ -255,7 +257,7 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) return result; } -void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) +void MHwrapper::deleteMails(const QString & mailbox,const Q3ValueList<RecMailP> &target) { QString f = buildPath(mailbox); int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); @@ -263,7 +265,7 @@ void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> & qDebug("deleteMails: error selecting folder! "); return; } - QValueList<RecMailP>::ConstIterator it; + Q3ValueList<RecMailP>::ConstIterator it; for (it=target.begin(); it!=target.end();++it) { r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); if (r != MAIL_NO_ERROR) { 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 @@ -6,6 +6,8 @@ #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> class encodedString; struct mailmbox_folder; @@ -16,8 +18,8 @@ public: MHwrapper(const QString & dir,const QString&name); virtual ~MHwrapper(); - virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); @@ -36,7 +38,7 @@ public: static void mbox_progress( size_t current, size_t maximum ); virtual encodedString* fetchRawBody(const RecMailP&mail); - virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> > &target); + virtual void deleteMails(const QString & FolderName,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); virtual MAILLIB::ATYPE getType()const; virtual const QString&getName()const; 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 @@ -4,6 +4,8 @@ #include "mailtypes.h" #include <qfile.h> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> @@ -60,14 +62,14 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { if (msg_cache.exists()) { msg_cache.remove(); } - msg_cache.open(IO_ReadWrite|IO_Truncate); + msg_cache.open(QIODevice::ReadWrite|QIODevice::Truncate); last_msg_id = mail->getNumber(); err = mailsession_get_message(m_nntp->sto_session, mail->getNumber(), &mailmsg); err = mailmessage_fetch(mailmsg,&message,&length); msg_cache.writeBlock(message,length); } else { QString msg=""; - msg_cache.open(IO_ReadOnly); + msg_cache.open(QIODevice::ReadOnly); message = new char[4096]; memset(message,0,4096); while (msg_cache.readBlock(message,4095)>0) { @@ -99,7 +101,7 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { } -void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb) +void NNTPwrapper::listMessages(const QString & which, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb) { login(); if (!m_nntp) @@ -186,9 +188,9 @@ void NNTPwrapper::logout() m_nntp = 0; } -QValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); QStringList groups; if (account) { groups = account->getGroups(); 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 @@ -5,6 +5,8 @@ #include "mailwrapper.h" #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> #include <libetpan/clist.h> class encodedString; @@ -21,9 +23,9 @@ public: virtual ~NNTPwrapper(); /* mailbox will be ignored */ - virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); + virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); /* should only get the subscribed one */ - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); /* mailbox will be ignored */ virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); QStringList listAllNewsgroups(const QString&mask = QString::null); 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 @@ -9,8 +9,10 @@ #include <qpe/global.h> #include <qfile.h> -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3ValueList> /* we don't fetch messages larger than 5 MB */ #define HARD_MSG_SIZE_LIMIT 5242880 @@ -62,14 +64,14 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { if (msg_cache.exists()) { msg_cache.remove(); } - msg_cache.open(IO_ReadWrite|IO_Truncate); + msg_cache.open(QIODevice::ReadWrite|QIODevice::Truncate); last_msg_id = mail->getNumber(); err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); err = mailmessage_fetch(mailmsg,&message,&length); msg_cache.writeBlock(message,length); } else { QString msg=""; - msg_cache.open(IO_ReadOnly); + msg_cache.open(QIODevice::ReadOnly); message = new char[4096]; memset(message,0,4096); while (msg_cache.readBlock(message,4095)>0) { @@ -100,7 +102,7 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { return body; } -void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) +void POP3wrapper::listMessages(const QString &, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) { login(); if (!m_pop3) @@ -187,14 +189,14 @@ void POP3wrapper::logout() } -QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<FolderP>(); +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<FolderP>(); FolderP inb=new Folder("INBOX","/"); folders->append(inb); return folders; } -void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) +void POP3wrapper::deleteMailList(const Q3ValueList<RecMailP>&target) { login(); if (!m_pop3) @@ -202,7 +204,7 @@ void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) int iii = 0; int count = target.count(); - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Deleting ...")); wid.show(); while (iii < count ) { @@ -246,7 +248,7 @@ int POP3wrapper::deleteAllMail(const FolderP&) { - QProgressBar wid ( result ); + Q3ProgressBar wid ( result ); wid.setCaption( i18n("Deleting ...")); wid.show(); for (unsigned int i = 0; i < result; ++i) { 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 @@ -5,6 +5,8 @@ #include "mailwrapper.h" #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> class encodedString; struct mailstorage; @@ -18,13 +20,13 @@ public: POP3wrapper( POP3account *a ); virtual ~POP3wrapper(); /* mailbox will be ignored */ - virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); /* mailbox will be ignored */ virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); - virtual void deleteMailList(const QValueList<RecMailP>&target); + virtual void deleteMailList(const Q3ValueList<RecMailP>&target); virtual void answeredMail(const RecMailP&mail); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); 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,5 +1,5 @@ #include "sendmailprogress.h" -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qlabel.h> #include <klocale.h> 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 @@ -2,7 +2,7 @@ #include <qdir.h> #include <qtextcodec.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qfile.h> //#include <opie2/odebug.h> @@ -376,11 +376,11 @@ QString SMTPaccount::getSignature() return QString(); QFile file( signature ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return QString(); } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); QString text = ts.read(); file.close(); @@ -399,11 +399,11 @@ void SMTPaccount::setSignature( QString b ) save(); } QFile fileIn( signature ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { qDebug("OM: Cannot write signature file %s ", signature.latin1() ); return ; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << b ; fileIn.close(); 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 @@ -9,6 +9,8 @@ //#include <qt.h> #include <qapplication.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> #ifndef DESKTOP_VERSION //#include <qpe/config.h> @@ -434,8 +436,8 @@ bool SMTPwrapper::flushOutbox() { return false; } QString oldPw, oldUser; - QValueList<RecMailP> mailsToSend; - QValueList<RecMailP> mailsToRemove; + Q3ValueList<RecMailP> mailsToSend; + Q3ValueList<RecMailP> mailsToRemove; QString mbox("Outgoing"); wrap->listMessages(mbox,mailsToSend); if (mailsToSend.count()==0) { diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp index 41cee52..d8eee7d 100644 --- a/kmicromail/mailistviewitem.cpp +++ b/kmicromail/mailistviewitem.cpp @@ -1,12 +1,12 @@ // CHANGED 2004-08-06 Lutz Rogowski #include "mailistviewitem.h" #include <libmailwrapper/abstractmail.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <kiconloader.h> #include "koprefs.h" //#include <qpe/resource.h> -MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) +MailListViewItem::MailListViewItem(Q3ListView * parent, MailListViewItem * item ) :KListViewItem(parent,item),mail_data() { } diff --git a/kmicromail/mailistviewitem.h b/kmicromail/mailistviewitem.h index b409c9d..ecc01ba 100644 --- a/kmicromail/mailistviewitem.h +++ b/kmicromail/mailistviewitem.h @@ -9,7 +9,7 @@ class MailListViewItem:public KListViewItem { public: - MailListViewItem(QListView * parent, MailListViewItem * after ); + MailListViewItem(Q3ListView * parent, MailListViewItem * after ); virtual ~MailListViewItem(){} void storeData(const RecMailP&data); diff --git a/kmicromail/main.cpp b/kmicromail/main.cpp index fe4bc76..dc73455 100644 --- a/kmicromail/main.cpp +++ b/kmicromail/main.cpp @@ -3,6 +3,8 @@ #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> +//Added by qt3to4: +#include <Q3CString> #include <libkdepim/externalapphandler.h> #include <stdlib.h> #else @@ -23,6 +25,7 @@ void dumpMissing(); //using namespace Opie::Core; int main( int argc, char **argv ) { + if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi"); #ifndef DESKTOP_VERSION QPEApplication a( argc, argv ); @@ -51,7 +54,7 @@ int main( int argc, char **argv ) { OpieMail mw; #ifndef DESKTOP_VERSION //qDebug("CONNECT "); - QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& ))); + QObject::connect( &a, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )),&mw, SLOT(message( const Q3CString&, const QByteArray& ))); // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); a.showMainWidget(&mw ); #else diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index d547dda..627d92e 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp @@ -1,10 +1,16 @@ // CHANGED 2004-08-06 Lutz Rogowski #include <qlabel.h> -#include <qvbox.h> -#include <qheader.h> +#include <q3vbox.h> +#include <q3header.h> #include <qtimer.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3GridLayout> +#include <Q3ValueList> +#include <QPixmap> +#include <Q3PopupMenu> //#include <kdialog.h> #include <kiconloader.h> #include <kapplication.h> @@ -27,8 +33,8 @@ extern QStatusBar* globalSstatusBarMainWindow; #include "koprefs.h" -MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) - : QMainWindow( parent, name ) //, flags ) +MainWindow::MainWindow( QWidget *parent, const char *name, Qt::WFlags flags ) + : Q3MainWindow( parent, name ) //, flags ) { #ifdef DESKTOP_VERSION globalSstatusBarMainWindow = statusBar(); @@ -36,11 +42,11 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) setCaption( i18n( "KOpieMail/Pi" ) ); setToolBarsMovable( false ); //KABC::StdAddressBook::self(); - toolBar = new QToolBar( this ); + toolBar = new Q3ToolBar( this ); menuBar = new QPEMenuBar( toolBar ); - mailMenu = new QPopupMenu( menuBar ); + mailMenu = new Q3PopupMenu( menuBar ); menuBar->insertItem( i18n( "Mail" ), mailMenu ); - settingsMenu = new QPopupMenu( menuBar ); + settingsMenu = new Q3PopupMenu( menuBar ); menuBar->insertItem( i18n( "Settings" ), settingsMenu ); addToolBar( toolBar ); @@ -114,7 +120,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , 0, 0, this ); editAccounts->addTo( settingsMenu ); - codecMenu = new QPopupMenu( menuBar ); + codecMenu = new Q3PopupMenu( menuBar ); codecMenu->insertItem( "Western (iso-8859-1)",0,0); codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); codecMenu->insertItem( "Western (iso-8859-15)",2,2); @@ -125,7 +131,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); //setCentralWidget( view ); - QVBox* wrapperBox = new QVBox( this ); + Q3VBox* wrapperBox = new Q3VBox( this ); setCentralWidget( wrapperBox ); // QWidget *view = new QWidget( wrapperBox ); @@ -139,7 +145,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) toLE = 0; if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { QWidget* infoBox = new QWidget( splithor ); - QGridLayout *griLay = new QGridLayout( infoBox, 2,2); + Q3GridLayout *griLay = new Q3GridLayout( infoBox, 2,2); if ( KOPrefs::instance()->mShowInfoSub ) { griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; @@ -168,18 +174,18 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) mailView = new KListView( split ); mailView->addColumn( i18n( " " ) ); - mailView->addColumn( i18n( "Subject" ),QListView::Manual ); - mailView->addColumn( i18n( "Sender" ),QListView::Manual ); - mailView->addColumn( i18n( "Size" ),QListView::Manual); - mailView->addColumn( i18n( "Date" ),QListView::Manual); + mailView->addColumn( i18n( "Subject" ),Q3ListView::Manual ); + mailView->addColumn( i18n( "Sender" ),Q3ListView::Manual ); + mailView->addColumn( i18n( "Size" ),Q3ListView::Manual); + mailView->addColumn( i18n( "Date" ),Q3ListView::Manual); if ( KOPrefs::instance()->mShowToField ) - mailView->addColumn( i18n( "To" ),QListView::Manual); + mailView->addColumn( i18n( "To" ),Q3ListView::Manual); mailView->setAllColumnsShowFocus(true); //mailView->setSorting(-1); mailView->setRootIsDecorated( false ); statusWidget = new StatusWidget( wrapperBox ); statusWidget->hide(); - mailView->setSelectionMode( QListView::Multi ); + mailView->setSelectionMode( Q3ListView::Multi ); mailView->setMultiSelection( true); mailView->setAlternateBackground(KPimGlobalPrefs::instance()->mAlternateColor ); //layout->addWidget( mailView ); @@ -197,17 +203,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) if ( toLE ) QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); #endif - connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, - SLOT( mailLeftClicked(QListViewItem*) ) ); - connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, - SLOT( mailLeftClicked(QListViewItem*) ) ); - connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, - SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); - connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), - this,SLOT(refreshMailView(const QValueList<RecMailP>&))); - - connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, - SLOT( setInfoFields(QListViewItem*) ) ); + connect( mailView, SIGNAL( doubleClicked (Q3ListViewItem* )),this, + SLOT( mailLeftClicked(Q3ListViewItem*) ) ); + connect( mailView, SIGNAL( returnPressed (Q3ListViewItem* )),this, + SLOT( mailLeftClicked(Q3ListViewItem*) ) ); + connect( mailView, SIGNAL( mouseButtonPressed(int,Q3ListViewItem*,const QPoint&,int) ),this, + SLOT( mailHold(int,Q3ListViewItem*,const QPoint&,int) ) ); + connect(folderView, SIGNAL(refreshMailview(const Q3ValueList<RecMailP>&)), + this,SLOT(refreshMailView(const Q3ValueList<RecMailP>&))); + + connect( mailView, SIGNAL( currentChanged (Q3ListViewItem* )),this, + SLOT( setInfoFields(Q3ListViewItem*) ) ); connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); @@ -215,7 +221,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); //mailView->setMultiSelection ( true ); //mailView->setSelectionMode( QListView::Extended ); - QValueList<int> list; + Q3ValueList<int> list; int fw = 100; if ( QApplication::desktop()->width() > 320 ) fw = 50; @@ -235,7 +241,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) closeMail->addTo(mailMenu); - QPopupMenu* helpMenu = new QPopupMenu( menuBar ); + Q3PopupMenu* helpMenu = new Q3PopupMenu( menuBar ); menuBar->insertItem( i18n( "Help" ), helpMenu ); QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); @@ -259,7 +265,7 @@ MainWindow::~MainWindow() { } -void MainWindow::setInfoFields(QListViewItem* item ) +void MainWindow::setInfoFields(Q3ListViewItem* item ) { if ( item == 0) { if ( subLE ) subLE->setText(""); @@ -345,7 +351,7 @@ void MainWindow::showEtpanLicence() KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); } -void MainWindow::appMessage(const QCString &, const QByteArray &) +void MainWindow::appMessage(const Q3CString &, const QByteArray &) { qDebug("appMessage implemented by subclass"); } @@ -405,12 +411,12 @@ void MainWindow::slotShowFolders( bool ) qDebug("not implemented: "); } -void MainWindow::refreshMailView(const QValueList<RecMailP>&) +void MainWindow::refreshMailView(const Q3ValueList<RecMailP>&) { qDebug("not implemented: "); } -void MainWindow::mailLeftClicked(QListViewItem * ) +void MainWindow::mailLeftClicked(Q3ListViewItem * ) { qDebug("not implemented: "); } @@ -425,7 +431,7 @@ void MainWindow::slotDeleteMail() qDebug("not implemented: "); } -void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) +void MainWindow::mailHold(int, Q3ListViewItem *,const QPoint&,int ) { 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 @@ -3,12 +3,16 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include <qmainwindow.h> +#include <q3mainwindow.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3ValueList> +#include <Q3PopupMenu> #include <klistview.h> #include <qaction.h> #include <qlineedit.h> -#include <qtoolbar.h> +#include <q3toolbar.h> #ifdef DESKTOP_VERSION #include <qmenubar.h> #define QPEMenuBar QMenuBar @@ -24,46 +28,46 @@ class RecMail; -class MainWindow : public QMainWindow +class MainWindow : public Q3MainWindow { Q_OBJECT public: - MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); + MainWindow( QWidget *parent = 0, const char *name = 0, Qt::WFlags flags = 0 ); virtual ~MainWindow(); public slots: virtual void slotAdjustColumns(); virtual void slotAdjustColumnsWide(); - virtual void appMessage(const QCString &msg, const QByteArray &data); + virtual void appMessage(const Q3CString &msg, const QByteArray &data); virtual void slotComposeMail(); protected slots: - virtual void setInfoFields(QListViewItem* ); + virtual void setInfoFields(Q3ListViewItem* ); virtual void slotSendQueued(); virtual void slotEditAccounts(); virtual void slotShowFolders( bool show ); - virtual void refreshMailView(const QValueList<RecMailP>&); + virtual void refreshMailView(const Q3ValueList<RecMailP>&); virtual void displayMail(); virtual void slotGetMail() = 0; virtual void slotGetAllMail() = 0; virtual void slotDeleteMail(); virtual void slotDeleteAllMail() = 0; virtual void slotSetCodec(int); - virtual void mailHold(int, QListViewItem *,const QPoint&,int); + virtual void mailHold(int, Q3ListViewItem *,const QPoint&,int); virtual void slotAdjustLayout(); virtual void slotEditSettings(); virtual void slotEditGlobalSettings(); - virtual void mailLeftClicked( QListViewItem * ); + virtual void mailLeftClicked( Q3ListViewItem * ); void showLicence(); void showAbout(); void showEtpanLicence(); protected: - QToolBar *toolBar; + Q3ToolBar *toolBar; StatusWidget *statusWidget; QPEMenuBar *menuBar; - QPopupMenu *mailMenu, *settingsMenu, *codecMenu; + Q3PopupMenu *mailMenu, *settingsMenu, *codecMenu; QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, *editSettings, *editAccounts, *syncFolders; AccountView *folderView; diff --git a/kmicromail/nntpgroups.cpp b/kmicromail/nntpgroups.cpp index c729f79..d2213d4 100644 --- a/kmicromail/nntpgroups.cpp +++ b/kmicromail/nntpgroups.cpp @@ -1,12 +1,12 @@ #include "nntpgroups.h" #include <libmailwrapper/settings.h> -#include <qlistview.h> +#include <q3listview.h> #include <qlineedit.h> using namespace Opie::Core; -NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, WFlags fl) +NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, Qt::WFlags fl) : NNTPGroupsUI(parent,name,fl),subscribedGroups() { m_Account = account; @@ -27,8 +27,8 @@ void NNTPGroups::slotGetNG() QStringList list = tmp.listAllNewsgroups(filter); subscribedGroupsNotListed = subscribedGroups; for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { - QCheckListItem *item; - item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); + Q3CheckListItem *item; + item = new Q3CheckListItem( GroupListView, (*it), Q3CheckListItem::CheckBox ); if ( subscribedGroups.contains( (*it) ) >= 1 ) { item->setOn( true ); subscribedGroupsNotListed.remove((*it)); @@ -41,8 +41,8 @@ void NNTPGroups::fillGroups() if (!m_Account) return; subscribedGroups = m_Account->getGroups(); for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { - QCheckListItem *item; - item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); + Q3CheckListItem *item; + item = new Q3CheckListItem( GroupListView, (*it), Q3CheckListItem::CheckBox ); item->setOn( true ); } } @@ -50,10 +50,10 @@ void NNTPGroups::fillGroups() void NNTPGroups::storeValues() { if (!m_Account) return; - QListViewItemIterator list_it( GroupListView ); + Q3ListViewItemIterator list_it( GroupListView ); subscribedGroups.clear(); for ( ; list_it.current(); ++list_it ) { - if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { + if ( ( (Q3CheckListItem*)list_it.current() )->isOn() ) { subscribedGroups.append( list_it.current()->text(0) ); } } diff --git a/kmicromail/nntpgroups.h b/kmicromail/nntpgroups.h index e5b7c35..80cc329 100644 --- a/kmicromail/nntpgroups.h +++ b/kmicromail/nntpgroups.h @@ -12,7 +12,7 @@ class NNTPGroups:public NNTPGroupsUI { Q_OBJECT public: - NNTPGroups(NNTPaccount *account, QWidget* parent = 0, const char* name = 0, WFlags fl = 0); + NNTPGroups(NNTPaccount *account, QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0); virtual ~NNTPGroups(); /* must be called from external. * it will store the new subscription list into the account diff --git a/kmicromail/nntpgroupsdlg.cpp b/kmicromail/nntpgroupsdlg.cpp index f564b10..bfe1d35 100644 --- a/kmicromail/nntpgroupsdlg.cpp +++ b/kmicromail/nntpgroupsdlg.cpp @@ -5,13 +5,15 @@ #include <libmailwrapper/settings.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> NNTPGroupsDlg::NNTPGroupsDlg(NNTPaccount *account,QWidget * parent, const char * name) : QDialog(parent,name,true,0) { setCaption(i18n("Subscribed newsgroups")); m_Account = account; - QVBoxLayout*dlglayout = new QVBoxLayout(this); + Q3VBoxLayout*dlglayout = new Q3VBoxLayout(this); dlglayout->setSpacing(2); dlglayout->setMargin(1); groupsWidget = new NNTPGroups(account,this); diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 75a75b9..f453be5 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -4,6 +4,11 @@ #define protected public #include <qwidget.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3CString> +#include <QPixmap> +#include <Q3PopupMenu> #undef protected #include "koprefsdialog.h" #include <kapplication.h> @@ -27,7 +32,7 @@ #include <qmessagebox.h> #include <qtimer.h> #include <qcursor.h> -#include <qtextbrowser.h> +#include <q3textbrowser.h> #include <qregexp.h> #include <qpe/global.h> @@ -63,12 +68,12 @@ OpieMail::~OpieMail() delete tb; } -void OpieMail::appMessage(const QCString &msg, const QByteArray &data) +void OpieMail::appMessage(const Q3CString &msg, const QByteArray &data) { } #include <stdlib.h> -void OpieMail::message(const QCString &msg, const QByteArray &data) +void OpieMail::message(const Q3CString &msg, const QByteArray &data) { // copied from old mail2 static int ii = 0; @@ -83,7 +88,7 @@ void OpieMail::message(const QCString &msg, const QByteArray &data) if (msg == "writeMail(QString,QString)") { //qDebug("writeMail(QString,QString) "); - QDataStream stream(data,IO_ReadOnly); + QDataStream stream(data,QIODevice::ReadOnly); stream >> mPendingName >> mPendingEmail; // removing the whitespaces at beginning and end is needed! QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); @@ -100,7 +105,7 @@ void OpieMail::message(const QCString &msg, const QByteArray &data) else if (msg == "newMail(QString)") { //qDebug(" newMail(QString)"); - QDataStream stream(data,IO_ReadOnly); + QDataStream stream(data,QIODevice::ReadOnly); stream >> mPendingName; // the format is // NAME <EMAIL>:SUBJECT @@ -279,7 +284,7 @@ void OpieMail::slotEditAccounts() void OpieMail::replyMail() { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (!item) return; RecMailP mail = ((MailListViewItem*)item)->data(); RecBodyP body = folderView->fetchBody(mail); @@ -331,7 +336,7 @@ void OpieMail::closeViewMail(ViewMail * vm) void OpieMail::slotDownloadMail( ) { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (!item ) { Global::statusMessage("Error: No item slected!"); return; @@ -372,7 +377,7 @@ void OpieMail::slotDownloadMail( ) void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (!item ) { closeViewMail(vm); return; @@ -392,7 +397,7 @@ void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) } void OpieMail::displayNextMail(ViewMail * vm) { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (!item) return; ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); item = item->itemBelow(); @@ -408,7 +413,7 @@ void OpieMail::displayNextMail(ViewMail * vm) } void OpieMail::displayMail() { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (!item) return; RecMailP mail = ((MailListViewItem*)item)->data(); RecBodyP body = folderView->fetchBody(mail); @@ -432,14 +437,14 @@ void OpieMail::displayMail() } else { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (item) ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); } } void OpieMail::slotGetAllMail() { - QListViewItem * item = folderView->firstChild(); + Q3ListViewItem * item = folderView->firstChild(); while ( item ){ ((AccountViewItem *)item)->contextMenuSelected( 101 ); item = item->nextSibling (); @@ -447,7 +452,7 @@ void OpieMail::slotGetAllMail() } void OpieMail::slotGetMail() { - QListViewItem * item = folderView->currentItem(); + Q3ListViewItem * item = folderView->currentItem(); if ( ! item ) return; ((AccountViewItem *)item)->contextMenuSelected( 101 ); } @@ -464,7 +469,7 @@ void OpieMail::slotDeleteMail() void OpieMail::slotDeleteAllMail() { - QValueList<RecMailP> t; + Q3ValueList<RecMailP> t; if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); @@ -492,21 +497,21 @@ void OpieMail::clearSelection() } void OpieMail::selectAll() { - QListViewItem* item = mailView->firstChild (); + Q3ListViewItem* item = mailView->firstChild (); while ( item ) { mailView->setSelected ( item, true ); item = item->nextSibling(); } } -void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) +void OpieMail::mailHold(int button, Q3ListViewItem *item,const QPoint&,int ) { if (!mailView->currentItem()) return; MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); /* just the RIGHT button - or hold on pda */ if (button!=2) {return;} if (!item) return; - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { if (mailtype==MAILLIB::A_NNTP) { @@ -553,12 +558,12 @@ void OpieMail::slotShowFolders( bool show ) } } -void OpieMail::refreshMailView(const QValueList<RecMailP>&list) +void OpieMail::refreshMailView(const Q3ValueList<RecMailP>&list) { MailListViewItem*item = 0; mailView->clear(); - QValueList<RecMailP>::ConstIterator it; + Q3ValueList<RecMailP>::ConstIterator it; for (it = list.begin(); it != list.end();++it) { item = new MailListViewItem(mailView,item); @@ -568,7 +573,7 @@ void OpieMail::refreshMailView(const QValueList<RecMailP>&list) mailView->setSorting ( 4, false ); } -void OpieMail::mailLeftClicked( QListViewItem *item ) +void OpieMail::mailLeftClicked( Q3ListViewItem *item ) { mailView->clearSelection(); /* just LEFT button - or tap with stylus on pda */ @@ -614,7 +619,7 @@ void OpieMail::slotMoveCopyAllMail() { if (!mailView->currentItem()) return; - QValueList<RecMailP> t; + Q3ValueList<RecMailP> t; // 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 ) { MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h index bdd9058..ea64dc4 100644 --- a/kmicromail/opiemail.h +++ b/kmicromail/opiemail.h @@ -9,6 +9,9 @@ #include <libmailwrapper/mailtypes.h> #include <viewmail.h> #include <qstringlist.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3ValueList> class ComposeMail; @@ -26,8 +29,8 @@ public slots: virtual void slotwriteMail2(const QString&nameemail); virtual void slotComposeMail(); virtual void slotExtAppHandler(); - virtual void appMessage(const QCString &msg, const QByteArray &data); - virtual void message(const QCString &msg, const QByteArray &data); + virtual void appMessage(const Q3CString &msg, const QByteArray &data); + virtual void message(const Q3CString &msg, const QByteArray &data); void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); protected slots: virtual void deleteAndDisplayNextMail(ViewMail * vm); @@ -43,10 +46,10 @@ protected slots: virtual void slotGetMail(); virtual void slotGetAllMail(); virtual void slotDeleteAllMail(); - virtual void mailHold(int, QListViewItem *,const QPoint&,int); + virtual void mailHold(int, Q3ListViewItem *,const QPoint&,int); virtual void slotShowFolders( bool show ); - virtual void refreshMailView(const QValueList<RecMailP>&); - virtual void mailLeftClicked( QListViewItem * ); + virtual void refreshMailView(const Q3ValueList<RecMailP>&); + virtual void mailLeftClicked( Q3ListViewItem * ); virtual void slotMoveCopyMail(); virtual void slotMoveCopyAllMail(); virtual void reEditMail(); @@ -59,9 +62,9 @@ private: QString mPendingEmail; QString mPendingName; QByteArray mPendingData; - QCString mPendingMessage; + Q3CString mPendingMessage; Settings *settings; - QTextBrowser * tb; + Q3TextBrowser * tb; }; 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 @@ -14,7 +14,7 @@ class QDialog_hacked : public QDialog //Q__OBJECT public: - QDialog_hacked ( QWidget * parent=0, const char * name=0, bool modal=true, WFlags f=0 ); + QDialog_hacked ( QWidget * parent=0, const char * name=0, bool modal=true, Qt::WFlags f=0 ); }; 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,19 +1,19 @@ #include <qdialog.h> -#include <qhbox.h> +#include <q3hbox.h> #include <qpushbutton.h> #include <klocale.h> #ifdef QDialog #undef QDialog #endif - QDialog_hacked::QDialog_hacked ( QWidget * parent, const char * name, bool modal, WFlags f ) + QDialog_hacked::QDialog_hacked ( QWidget * parent, const char * name, bool modal, Qt::WFlags f ) : QDialog( parent,name,modal, f) { qDebug("New hacked QDialog for ompi desktop"); //QTimer::singleShot( 1, this,SLOT(addaddbuttons()) ); setOrientation ( Vertical ); - QHBox * hb = new QHBox ( this ); + Q3HBox * hb = new Q3HBox ( this ); QPushButton *ok = new QPushButton( i18n("OK"), hb ); QPushButton *cancel = new QPushButton( i18n("Cancel"), hb ); setExtension ( hb ); diff --git a/kmicromail/selectsmtp.cpp b/kmicromail/selectsmtp.cpp index 10b6d79..ead723c 100644 --- a/kmicromail/selectsmtp.cpp +++ b/kmicromail/selectsmtp.cpp @@ -8,9 +8,9 @@ #include <qlineedit.h> #include <qlabel.h> #include <qtabwidget.h> -#include <qlistview.h> +#include <q3listview.h> #include <klocale.h> -selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, WFlags fl) +selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : selectstoreui(parent,name,modal,fl) { //m_smtpList.setAutoDelete(false); diff --git a/kmicromail/selectsmtp.h b/kmicromail/selectsmtp.h index 9157ddf..d7accf6 100644 --- a/kmicromail/selectsmtp.h +++ b/kmicromail/selectsmtp.h @@ -11,7 +11,7 @@ class selectsmtp : public selectstoreui { Q_OBJECT public: - selectsmtp(QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 ); + selectsmtp(QWidget* parent = 0, const char* name = 0, bool modal = TRUE, Qt::WFlags fl = 0 ); virtual ~selectsmtp(); void setSelectionlist(QList<SMTPaccount>*list); SMTPaccount*selected_smtp(); diff --git a/kmicromail/selectstore.h b/kmicromail/selectstore.h index 447a6ae..d312c1d 100644 --- a/kmicromail/selectstore.h +++ b/kmicromail/selectstore.h @@ -2,7 +2,7 @@ #define _SELECTSTORE_H #include "selectstoreui.h" -#include <qvaluelist.h> +#include <q3valuelist.h> #include <qmap.h> #include <qstringlist.h> diff --git a/kmicromail/settingsdialog.cpp b/kmicromail/settingsdialog.cpp index c593b48..889c490 100644 --- a/kmicromail/settingsdialog.cpp +++ b/kmicromail/settingsdialog.cpp @@ -2,6 +2,8 @@ #include <qspinbox.h> #include <qlayout.h> #include <qtabwidget.h> +//Added by qt3to4: +#include <Q3GridLayout> #include <kconfig.h> #include <kprefs.h> @@ -12,13 +14,13 @@ #include "settingsdialog.h" -SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) +SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : SettingsDialogUI( parent, name, modal, fl ) { #if 0 QTabWidget *topFrame = TabWidget2; - QGridLayout *topLayout = new QGridLayout(topFrame,3,3); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,3); topLayout->setSpacing(2); topLayout->setMargin(3); KPrefsWidFont * tVFont; diff --git a/kmicromail/settingsdialog.h b/kmicromail/settingsdialog.h index 042b69f..b168226 100644 --- a/kmicromail/settingsdialog.h +++ b/kmicromail/settingsdialog.h @@ -11,7 +11,7 @@ class SettingsDialog : public SettingsDialogUI { Q_OBJECT public: - SettingsDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + SettingsDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~SettingsDialog(); private: diff --git a/kmicromail/statuswidget.cpp b/kmicromail/statuswidget.cpp index 19cf635..6da6f54 100644 --- a/kmicromail/statuswidget.cpp +++ b/kmicromail/statuswidget.cpp @@ -1,5 +1,5 @@ #include <qtimer.h> -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qlabel.h> #include "statuswidget.h" @@ -7,7 +7,7 @@ // the current problem I see is "locking": used exclusive by one sender -StatusWidget::StatusWidget( QWidget* parent, const char* name,WFlags fl ) +StatusWidget::StatusWidget( QWidget* parent, const char* name,Qt::WFlags fl ) : StatusWidgetUI( parent, name, fl ) { setMaximumHeight( 15 ); diff --git a/kmicromail/statuswidget.h b/kmicromail/statuswidget.h index 73f0d75..1d29daf 100644 --- a/kmicromail/statuswidget.h +++ b/kmicromail/statuswidget.h @@ -9,7 +9,7 @@ class StatusWidget : public StatusWidgetUI { Q_OBJECT public: - StatusWidget( QWidget* parent = 0, const char* name = 0,WFlags fl = 0 ); + StatusWidget( QWidget* parent = 0, const char* name = 0,Qt::WFlags fl = 0 ); ~StatusWidget(); diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp index 685b4e4..c9dedb0 100644 --- a/kmicromail/viewmail.cpp +++ b/kmicromail/viewmail.cpp @@ -24,20 +24,23 @@ #include <qpe/qpeapplication.h> /* QT */ -#include <qtextbrowser.h> +#include <q3textbrowser.h> #include <qmessagebox.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qaction.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qfile.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3VBoxLayout> //using namespace Opie::Ui; //using namespace Opie::Core; -AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, - const QString&fsize,int num,const QValueList<int>&path) - : QListViewItem(parent,after),_partNum(num) +AttachItem::AttachItem(Q3ListView * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file, + const QString&fsize,int num,const Q3ValueList<int>&path) + : Q3ListViewItem(parent,after),_partNum(num) { _path=path; setText(0, mime); @@ -46,9 +49,9 @@ AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mi setText(3, fsize); } -AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, - const QString&fsize,int num,const QValueList<int>&path) - : QListViewItem(parent,after),_partNum(num) +AttachItem::AttachItem(Q3ListViewItem * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file, + const QString&fsize,int num,const Q3ValueList<int>&path) + : Q3ListViewItem(parent,after),_partNum(num) { _path=path; setText(0, mime); @@ -57,7 +60,7 @@ AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QStrin setText(3, fsize); } -bool AttachItem::isParentof(const QValueList<int>&path) +bool AttachItem::isParentof(const Q3ValueList<int>&path) { /* if not set, then no parent */ if (path.count()==0||_path.count()==0) return false; @@ -70,9 +73,9 @@ bool AttachItem::isParentof(const QValueList<int>&path) return true; } -AttachItem* ViewMail::searchParent(const QValueList<int>&path) +AttachItem* ViewMail::searchParent(const Q3ValueList<int>&path) { - QListViewItemIterator it( attachments ); + Q3ListViewItemIterator it( attachments ); for ( ; it.current(); ++it ) { AttachItem*ati = (AttachItem*)it.current(); @@ -154,7 +157,7 @@ void ViewMail::setBody(const RecBodyP&body ) */ QTextOStream o(&fsize); if (w>0) o.precision(2); else o.precision(0); - o.setf(QTextStream::fixed); + o.setf(Q3TextStream::fixed); o << s << " " << q << "Byte"; } @@ -195,7 +198,7 @@ void ViewMail::setBody(const RecBodyP&body ) } QTextOStream o(&fsize); if (w>0) o.precision(2); else o.precision(0); - o.setf(QTextStream::fixed); + o.setf(Q3TextStream::fixed); o << s << " " << q << "Byte"; desc = body->Parts()[i]->Description(); parentItem = searchParent(body->Parts()[i]->Positionlist()); @@ -239,7 +242,7 @@ void ViewMail::slotShowHtml( bool state ) setText(); } -void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) +void ViewMail::slotItemClicked( Q3ListViewItem * item , const QPoint & point, int ) { if (!item ) return; @@ -249,7 +252,7 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int setText(); return; } - QPopupMenu *menu = new QPopupMenu(); + Q3PopupMenu *menu = new Q3PopupMenu(); int ret=0; if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) @@ -278,7 +281,7 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int if (content) { QFile output(str); - output.open(IO_WriteOnly); + output.open(QIODevice::WriteOnly); output.writeBlock(content->Content(),content->Length()); output.close(); delete content; @@ -297,7 +300,7 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); if (content) { QFile output(tmpfile); - output.open(IO_WriteOnly); + output.open(QIODevice::WriteOnly); output.writeBlock(content->Content(),content->Length()); output.close(); delete content; @@ -352,7 +355,7 @@ void ViewMail::slotNextMail() nextMail->blockSignals( false ); } -ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) +ViewMail::ViewMail( QWidget *parent, const char *name, Qt::WFlags fl) : ViewMailBase(parent, name, fl), _inLoop(false) { m_gotBody = false; @@ -369,7 +372,7 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) ); attachments->setEnabled(m_gotBody); - connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); + connect( attachments, SIGNAL( clicked(Q3ListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(Q3ListViewItem*,const QPoint&, int) ) ); attachments->setSorting(-1); } @@ -557,10 +560,10 @@ void ViewMail::slotDeleteMail( ) } } -MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f) +MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, Qt::WFlags f) : QDialog(parent,name,modal) { - QVBoxLayout*dlglayout = new QVBoxLayout(this); + Q3VBoxLayout*dlglayout = new Q3VBoxLayout(this); dlglayout->setSpacing(2); dlglayout->setMargin(1); //m_imageview = new Opie::MM::OImageScrollView(this); diff --git a/kmicromail/viewmail.h b/kmicromail/viewmail.h index bb5b685..6cf6efb 100644 --- a/kmicromail/viewmail.h +++ b/kmicromail/viewmail.h @@ -7,28 +7,28 @@ #include <qdialog.h> #include <qapplication.h> -#include <qlistview.h> +#include <q3listview.h> #include <qmap.h> #include <klocale.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> //namespace Opie { namespace MM { class OImageScrollView; } } -class AttachItem : public QListViewItem +class AttachItem : public Q3ListViewItem { public: - AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, - const QString&fsize,int num,const QValueList<int>&path); - AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, - const QString&fsize,int num,const QValueList<int>&path); + AttachItem(Q3ListView * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file, + const QString&fsize,int num,const Q3ValueList<int>&path); + AttachItem(Q3ListViewItem * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file, + const QString&fsize,int num,const Q3ValueList<int>&path); int Partnumber() { return _partNum; } - bool isParentof(const QValueList<int>&path); + bool isParentof(const Q3ValueList<int>&path); private: int _partNum; /* needed for a better display of attachments */ - QValueList<int> _path; + Q3ValueList<int> _path; }; class ViewMail : public ViewMailBase @@ -36,7 +36,7 @@ class ViewMail : public ViewMailBase Q_OBJECT public: - ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = 0); + ViewMail( QWidget *parent = 0, const char *name = 0, Qt::WFlags fl = 0); ~ViewMail(); void hide(); @@ -50,7 +50,7 @@ public: void signalDownloadMail(); protected: QString deHtml(const QString &string); - AttachItem* searchParent(const QValueList<int>&path); + AttachItem* searchParent(const Q3ValueList<int>&path); AttachItem* lastChild(AttachItem*parent); protected slots: @@ -58,7 +58,7 @@ protected slots: void slotReply(); void slotForward(); void setText(); - void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); + void slotItemClicked( Q3ListViewItem * item , const QPoint & point, int c ); void slotDeleteMail( ); void slotShowHtml( bool ); void slotViewSource(); @@ -83,7 +83,7 @@ class MailImageDlg:public QDialog { Q_OBJECT public: - MailImageDlg(const QString&,QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0); + MailImageDlg(const QString&,QWidget *parent = 0, const char *name = 0, bool modal = true, Qt::WFlags f = 0); ~MailImageDlg(); void setName(const QString&); protected: diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp index 3bb964e..371ee91 100644 --- a/kmicromail/viewmailbase.cpp +++ b/kmicromail/viewmailbase.cpp @@ -1,13 +1,16 @@ // CHANGED 2004-08-06 Lutz Rogowski -#include <qtextbrowser.h> -#include <qlistview.h> +#include <q3textbrowser.h> +#include <q3listview.h> #include <qaction.h> #include <qlabel.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qapplication.h> -#include <qtoolbar.h> +#include <q3toolbar.h> #include <qmenubar.h> +//Added by qt3to4: +#include <QKeyEvent> +#include <Q3PopupMenu> #include <kiconloader.h> //#include <qpe/resource.h> #include <klocale.h> @@ -15,15 +18,15 @@ #include "viewmailbase.h" //#include "opendiag.h" -ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) - : QMainWindow(parent, name, fl) +ViewMailBase::ViewMailBase(QWidget *parent, const char *name, Qt::WFlags fl) + : Q3MainWindow(parent, name, fl) { setToolBarsMovable(false); - toolbar = new QToolBar(this); + toolbar = new Q3ToolBar(this); menubar = new QMenuBar( toolbar ); - mailmenu = new QPopupMenu( menubar ); + mailmenu = new Q3PopupMenu( menubar ); menubar->insertItem( i18n( "Mail" ), mailmenu ); toolbar->setHorizontalStretchable(true); @@ -69,10 +72,10 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) toolbar->setStretchableWidget(spacer); closeMail->addTo(toolbar); closeMail->addTo(mailmenu); - QVBox *view = new QVBox(this); + Q3VBox *view = new Q3VBox(this); setCentralWidget(view); - attachments = new QListView(view); + attachments = new Q3ListView(view); int fixh = 100; if ( QApplication::desktop()->width() > 320 ) fixh = 200; @@ -85,7 +88,7 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) attachments->setSorting(-1); attachments->hide(); - browser = new QTextBrowser(view); + browser = new Q3TextBrowser(view); // openDiag = new OpenDiag(view); // openDiag->hide(); diff --git a/kmicromail/viewmailbase.h b/kmicromail/viewmailbase.h index 7c075eb..3f1dead 100644 --- a/kmicromail/viewmailbase.h +++ b/kmicromail/viewmailbase.h @@ -2,7 +2,10 @@ #ifndef VIEWMAILBASE_H #define VIEWMAILBASE_H -#include <qmainwindow.h> +#include <q3mainwindow.h> +//Added by qt3to4: +#include <Q3PopupMenu> +#include <QKeyEvent> #ifndef DESKTOP_VERSION #include <qpe/qpemenubar.h> @@ -11,27 +14,27 @@ class QAction; class OpenDiag; -class QListView; -class QToolBar; -class QTextBrowser; +class Q3ListView; +class Q3ToolBar; +class Q3TextBrowser; class QMenuBar; -class QPopupMenu; +class Q3PopupMenu; -class ViewMailBase : public QMainWindow +class ViewMailBase : public Q3MainWindow { Q_OBJECT public: - ViewMailBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); + ViewMailBase(QWidget *parent = 0, const char *name = 0, Qt::WFlags fl = 0); protected: QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail, *downloadMail, *viewSource; - QListView *attachments; - QToolBar *toolbar; - QTextBrowser *browser; + Q3ListView *attachments; + Q3ToolBar *toolbar; + Q3TextBrowser *browser; OpenDiag *openDiag; QMenuBar *menubar; - QPopupMenu *mailmenu; + Q3PopupMenu *mailmenu; protected slots: void slotChangeAttachview(bool state); diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8385bcc..c1a2f76 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -32,22 +32,28 @@ #include <qapplication.h> #include <qradiobutton.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qlayout.h> #include <qclipboard.h> #include <qcursor.h> #include <qmessagebox.h> -#include <qprogressbar.h> -#include <qmultilineedit.h> +#include <q3progressbar.h> +#include <q3multilineedit.h> #include <qtimer.h> -#include <qwidgetstack.h> -#include <qptrlist.h> +#include <q3widgetstack.h> +#include <q3ptrlist.h> #include <qregexp.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qfile.h> #include <qdir.h> #ifndef KORG_NOSPLITTER #include <qsplitter.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <QKeyEvent> +#include <Q3Frame> +#include <QLabel> +#include <Q3ValueList> #endif #include <kglobal.h> @@ -128,7 +134,7 @@ #include <stdio.h> #include <unistd.h> #else -#include <qprocess.h> +#include <q3process.h> #endif #ifdef DESKTOP_VERSION @@ -140,7 +146,7 @@ extern int globalFlagBlockAgenda; extern int globalFlagBlockStartup; -MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent) +MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, Q3PtrList<Incidence> alarms,QDateTime start ) : Q3TextBrowser(parent) { mAlarms = alarms; @@ -277,13 +283,13 @@ class KOBeamPrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Beam Options") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("File format"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; - QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); + Q3ButtonGroup* time = new Q3ButtonGroup(1, Qt::Horizontal, i18n("Time format"), this ); lay->addWidget( time ); time->setExclusive ( true ) ; vcal = new QRadioButton(" vCalendar ", format ); ical = new QRadioButton(" iCalendar ", format ); @@ -312,12 +318,12 @@ class KOCatPrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Manage new Categories") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:"), this ); lay->addWidget( lab ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("New categories not in list:"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; addCatBut = new QRadioButton(i18n("Add to category list"), format ); @@ -373,7 +379,7 @@ void CalendarView::init() flag_clearallviewsEventDisplay = false; flag_clearallviewsupdateView = false; mNextAlarmDateTime = QDateTime::currentDateTime(); - setFocusPolicy (NoFocus ); + setFocusPolicy (Qt::NoFocus ); mViewerCallerIsSearchDialog = false; mBlockShowDates = false; mConflictingEvent = 0; @@ -394,7 +400,7 @@ void CalendarView::init() mStorage = new FileStorage( mCalendar ); mNavigator = new DateNavigator( this, "datevav", mViewManager ); - QBoxLayout *topLayout = (QBoxLayout*)layout(); + Q3BoxLayout *topLayout = (Q3BoxLayout*)layout(); #ifndef KORG_NOSPLITTER // create the main layout frames. mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); @@ -425,9 +431,9 @@ void CalendarView::init() } #endif QWidget *rightBox = new QWidget( mPanner ); - QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); + Q3BoxLayout *rightLayout = new Q3VBoxLayout( rightBox ); - mRightFrame = new QWidgetStack( rightBox ); + mRightFrame = new Q3WidgetStack( rightBox ); rightLayout->addWidget( mRightFrame, 1 ); mLeftFrame = mLeftSplitter; @@ -454,7 +460,7 @@ void CalendarView::init() //QBoxLayout * leftFrameLayout; topLayout->addWidget( mMainFrame ); #ifdef DESKTOP_VERSION - mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this ); + mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,Qt::Horizontal, this ); topLayout->addWidget( mDateScrollBar ); connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); if ( QApplication::desktop()->width() < 800 ) @@ -501,8 +507,8 @@ void CalendarView::init() mCalEditView->hide(); QWidget *rightBox = new QWidget( mMainFrame ); //mainBoxLayout->addWidget ( rightBox, 10 ); - QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); - mRightFrame = new QWidgetStack( rightBox ); + Q3BoxLayout *rightLayout = new Q3VBoxLayout( rightBox ); + mRightFrame = new Q3WidgetStack( rightBox ); rightLayout->addWidget( mRightFrame, 10 ); //mLeftFrame = (QWidget *)leftFrame; @@ -616,9 +622,9 @@ void CalendarView::init() // kdDebug() << "CalendarView::CalendarView() done" << endl; - mDateFrame = new QVBox(0,0,WType_Popup); + mDateFrame = new Q3VBox(0,0,Qt::WType_Popup); //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); - mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); + mDateFrame->setFrameStyle( Q3Frame::WinPanel |Q3Frame::Raised ); mDateFrame->setLineWidth(3); mDateFrame->hide(); mDateFrame->setCaption( i18n( "Pick a date to display")); @@ -669,7 +675,7 @@ void CalendarView::nextConflict( bool all, bool allday ) { if ( flag_blockConflict ) return; flag_blockConflict = true; - QPtrList<Event> testlist = mCalendar->events(); + Q3PtrList<Event> testlist = mCalendar->events(); Event * test = testlist.first(); while ( test ) { test->setTagged( false ); @@ -685,7 +691,7 @@ void CalendarView::nextConflict( bool all, bool allday ) bool found = false; Event * cE = 0; Event * cE2 = 0; - QPtrList<Event> testlist2 = testlist; + Q3PtrList<Event> testlist2 = testlist; test = testlist.first(); bool skip = false; topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); @@ -835,7 +841,7 @@ void CalendarView::updateView(const QDate &start, const QDate &end) void CalendarView::checkFiles() { QString message; - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); while ( cal ) { if ( cal->mErrorOnLoad ) { @@ -857,7 +863,7 @@ void CalendarView::checkAlarms() KConfig *config = KOGlobals::config(); config->setGroup( "AppRun" ); QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); - int daysto = dt.daysTo( QDate::currentDate() ); + int daysto = dt.daysTo( (QDateTime)QDate::currentDate() ); int days = config->readNumEntry( "LatestProgramStopDays" , daysto); dt = dt.addDays( days ); int secto = dt.secsTo( QDateTime::currentDateTime() ); @@ -867,8 +873,8 @@ void CalendarView::checkAlarms() QDateTime latest = dt.addSecs ( secs ); qDebug("KO: Last termination on %s ", latest.toString().latin1()); //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); - QPtrList<Incidence> el = mCalendar->rawIncidences(); - QPtrList<Incidence> al; + Q3PtrList<Incidence> el = mCalendar->rawIncidences(); + Q3PtrList<Incidence> al; Incidence* inL = el.first(); QDateTime cur = QDateTime::currentDateTime().addSecs(-59); qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); @@ -886,9 +892,9 @@ void CalendarView::checkAlarms() inL = el.next(); } if ( al.count() ) { - QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); + QDialog* dia = new QDialog( this, "huhu", false, Qt::WDestructiveClose | Qt::WStyle_StaysOnTop ); dia->setCaption( i18n("KO/Pi: Missing alarms!") ); - QVBoxLayout* lay = new QVBoxLayout( dia ); + Q3VBoxLayout* lay = new Q3VBoxLayout( dia ); lay->setSpacing( 0 ); lay->setMargin( 0 ); MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); @@ -1216,7 +1222,7 @@ void CalendarView::computeAlarm( QString msg ) return; } #else - QProcess* p = new QProcess(); + Q3Process* p = new Q3Process(); p->addArgument( tempfilename.latin1() ); p->start(); return; @@ -1266,10 +1272,10 @@ void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) //qDebug("nextsuspendalarm = \n%s ",mess.latin1() ); QString fn = QDir::homeDirPath() + "/.kopi_suspend_alarm"; QFile file( fn ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { qDebug("KO: Error writing next suspend alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); } else { - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts << mess; file.close(); } @@ -1294,10 +1300,10 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) //qDebug("nextalarm = \n%s ",mess.latin1() ); QString fn = QDir::homeDirPath() + "/.kopi_next_alarm"; QFile file( fn ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { qDebug("KO: Error writing next alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); } else { - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts << mess; file.close(); } @@ -1570,7 +1576,7 @@ Event* CalendarView::getLastSyncEvent() // we check, if the to delete event has a id for a profile // if yes, we set this id in the profile to delete -void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) +void CalendarView::checkExternSyncEvent( Q3PtrList<Event> lastSync , Incidence* toDelete ) { if ( lastSync.count() == 0 ) { //qDebug(" lastSync.count() == 0"); @@ -1600,7 +1606,7 @@ void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* t } void CalendarView::checkExternalId( Incidence * inc ) { - QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; + Q3PtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; checkExternSyncEvent( lastSync, inc ); } @@ -1624,8 +1630,8 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int Event* eventRSync; Event* eventLSync; clearAllViews(); - QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); - QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); + Q3PtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); + Q3PtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); bool fullDateRange = false; local->resetTempSyncStat(); mLastCalendarSync = QDateTime::currentDateTime(); @@ -1684,10 +1690,10 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int } //qDebug("*************************** "); qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); - QPtrList<Incidence> er = remote->rawIncidences(); + Q3PtrList<Incidence> er = remote->rawIncidences(); Incidence* inR = er.first(); Incidence* inL; - QProgressBar bar( er.count(),0 ); + Q3ProgressBar bar( er.count(),0 ); bar.setCaption (i18n("Syncing - close to abort!") ); // ************** setting up filter ************* @@ -1831,7 +1837,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int } inR = er.next(); } - QPtrList<Incidence> el = local->rawIncidences(); + Q3PtrList<Incidence> el = local->rawIncidences(); inL = el.first(); modulo = (el.count()/10)+1; bar.setCaption (i18n("Add / remove events") ); @@ -2048,7 +2054,7 @@ void CalendarView::syncExternal( int mode ) if ( syncOK ) { if ( mSyncManager->mWriteBackFile ) { - QPtrList<Incidence> iL = mCalendar->rawIncidences(); + Q3PtrList<Incidence> iL = mCalendar->rawIncidences(); Incidence* inc = iL.first(); if ( phoneFormat ) { while ( inc ) { @@ -2115,7 +2121,7 @@ bool CalendarView::importBday() for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { ++count; } - QProgressBar bar(count,0 ); + Q3ProgressBar bar(count,0 ); int w = 300; if ( QApplication::desktop()->width() < 320 ) w = 220; @@ -2186,7 +2192,7 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd //qDebug("CalView 1 %i", count); - QProgressBar bar(count,0 ); + Q3ProgressBar bar(count,0 ); int w = 300; if ( QApplication::desktop()->width() < 320 ) w = 220; @@ -2350,7 +2356,7 @@ void CalendarView::setSyncEventsReadOnly() bool CalendarView::loadCalendars() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); openCalendar( MainWindow::defaultFileName(), false ); @@ -2364,7 +2370,7 @@ bool CalendarView::loadCalendars() } bool CalendarView::restoreCalendarSettings() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); while ( cal ) { mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); @@ -2529,7 +2535,7 @@ void CalendarView::watchSavedFile() } bool CalendarView::checkAllFileVersions() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); mCalendar->setDefaultCalendarEnabledOnly(); @@ -2591,7 +2597,7 @@ bool CalendarView::checkFileVersion(QString fn) } bool CalendarView::saveCalendars() { - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); mCalendar->setDefaultCalendarEnabledOnly(); @@ -2695,7 +2701,7 @@ void CalendarView::readSettings() #ifndef KORG_NOSPLITTER config->setGroup("KOrganizer Geometry"); - QValueList<int> sizes = config->readIntListEntry("Separator1"); + Q3ValueList<int> sizes = config->readIntListEntry("Separator1"); if (sizes.count() != 2) { sizes << mDateNavigator->minimumSizeHint().width(); sizes << 300; @@ -2763,7 +2769,7 @@ void CalendarView::readSettings() config->setGroup( "Views" ); int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); - QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); + Q3ValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); int resetval = 0; int maxVal = 0; @@ -2842,7 +2848,7 @@ void CalendarView::writeSettings() writeFilterSettings(config); config->setGroup( "AppRun" ); QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); - int days = dt.daysTo( QDate::currentDate() ); + int days = dt.daysTo( (QDateTime)QDate::currentDate() ); dt = dt.addDays( days ); int secs = dt.secsTo( QDateTime::currentDateTime() ); config->writeEntry( "LatestProgramStopDays", days ); @@ -2869,9 +2875,9 @@ void CalendarView::writeSettings() #endif - QValueList<int> listINT = mLeftFrame->sizes(); + Q3ValueList<int> listINT = mLeftFrame->sizes(); config->writeEntry("Left Splitter Frame",listINT); - QValueList<int> listINT2 = mMainFrame->sizes(); + Q3ValueList<int> listINT2 = mMainFrame->sizes(); config->writeEntry("Main Splitter Frame",listINT2); #ifdef DESKTOP_VERSION config->setGroup("WidgetLayout"); @@ -3166,7 +3172,7 @@ void CalendarView::checkConflictForEvent() return; } } - QPtrList<Event> testlist = mCalendar->events(); + Q3PtrList<Event> testlist = mCalendar->events(); Event * test = testlist.first(); QDateTime conflict; QDateTime retVal; @@ -3428,7 +3434,7 @@ void CalendarView::slotSelectPickerDate( QDate d) void CalendarView::removeCategories() { - QPtrList<Incidence> incList = mCalendar->rawIncidences(); + Q3PtrList<Incidence> incList = mCalendar->rawIncidences(); QStringList catList = KOPrefs::instance()->mCustomCategories; QStringList catIncList; QStringList newCatList; @@ -3449,7 +3455,7 @@ void CalendarView::removeCategories() int CalendarView::addCategories() { - QPtrList<Incidence> incList = mCalendar->rawIncidences(); + Q3PtrList<Incidence> incList = mCalendar->rawIncidences(); QStringList catList = KOPrefs::instance()->mCustomCategories; QStringList catIncList; Incidence* inc = incList.first(); @@ -3507,23 +3513,23 @@ void CalendarView::manageCategories() void CalendarView::beamIncidence(Incidence * Inc) { - QPtrList<Incidence> delSel ; + Q3PtrList<Incidence> delSel ; delSel.append(Inc); beamIncidenceList( delSel ); } void CalendarView::beamCalendar() { - QPtrList<Incidence> delSel = mCalendar->rawIncidences(); + Q3PtrList<Incidence> delSel = mCalendar->rawIncidences(); //qDebug("beamCalendar() "); beamIncidenceList( delSel ); } void CalendarView::beamFilteredCalendar() { - QPtrList<Incidence> delSel = mCalendar->incidences(); + Q3PtrList<Incidence> delSel = mCalendar->incidences(); //qDebug("beamFilteredCalendar() "); beamIncidenceList( delSel ); } -void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) +void CalendarView::beamIncidenceList(Q3PtrList<Incidence> delSel ) { KOBeamPrefs beamDialog; @@ -4315,7 +4321,7 @@ void CalendarView::schedule_publish(Incidence *incidence) PublishDialog *publishdlg = new PublishDialog(); if (incidence->attendeeCount()>0) { - QPtrList<Attendee> attendees = incidence->attendees(); + Q3PtrList<Attendee> attendees = incidence->attendees(); attendees.first(); while ( attendees.current()!=0 ) { publishdlg->addAttendee(attendees.current()); @@ -4724,7 +4730,7 @@ void CalendarView::showDates(const DateList &selectedDates) } -QPtrList<CalFilter> CalendarView::filters() +Q3PtrList<CalFilter> CalendarView::filters() { return mFilters; @@ -4765,7 +4771,7 @@ void CalendarView::showFilter(bool visible) if (visible) { mCalEditView->readConfig(); mCalEditView->show(); - QValueList<int> sizes; + Q3ValueList<int> sizes; sizes = mLeftFrame->sizes(); if ( sizes.count() == 4 && sizes[3] < 20 ) { sizes.clear(); @@ -4846,21 +4852,21 @@ void CalendarView::takeOverCalendar() // TODO: Create Calendar::allIncidences() function and use it here clearAllViews(); - QPtrList<Event> events = mCalendar->events(); + Q3PtrList<Event> events = mCalendar->events(); for(uint i=0; i<events.count(); ++i) { events.at(i)->setOrganizer(KOPrefs::instance()->email()); events.at(i)->recreate(); events.at(i)->setReadOnly(false); } - QPtrList<Todo> todos = mCalendar->todos(); + Q3PtrList<Todo> todos = mCalendar->todos(); for(uint i=0; i<todos.count(); ++i) { todos.at(i)->setOrganizer(KOPrefs::instance()->email()); todos.at(i)->recreate(); todos.at(i)->setReadOnly(false); } - QPtrList<Journal> journals = mCalendar->journals(); + Q3PtrList<Journal> journals = mCalendar->journals(); for(uint i=0; i<journals.count(); ++i) { journals.at(i)->setOrganizer(KOPrefs::instance()->email()); journals.at(i)->recreate(); @@ -4875,7 +4881,7 @@ void CalendarView::showIntro() kdDebug() << "To be implemented." << endl; } -QWidgetStack *CalendarView::viewStack() +Q3WidgetStack *CalendarView::viewStack() { return mRightFrame; } @@ -5060,7 +5066,7 @@ void CalendarView::lookForIncomingMessages() bool CalendarView::removeCompletedSubTodos( Todo* t ) { bool deleteTodo = true; - QPtrList<Incidence> subTodos; + Q3PtrList<Incidence> subTodos; Incidence *aTodo; subTodos = t->relations(); for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { @@ -5086,8 +5092,8 @@ void CalendarView::purgeCompleted() if (result == KMessageBox::Continue) { - QPtrList<Todo> todoCal; - QPtrList<Todo> rootTodos; + Q3PtrList<Todo> todoCal; + Q3PtrList<Todo> rootTodos; //QPtrList<Incidence> rel; Todo *aTodo; todoCal = calendar()->todos(); diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 60b1276..b4eada7 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -24,13 +24,15 @@ #ifndef CALENDARVIEW_H #define CALENDARVIEW_H -#include <qframe.h> +#include <q3frame.h> #include <qlayout.h> #include <qwidget.h> -#include <qptrlist.h> -#include <qvbox.h> +#include <q3ptrlist.h> +#include <q3vbox.h> #include <qmap.h> #include <qscrollbar.h> +//Added by qt3to4: +#include <QKeyEvent> #ifndef DESKTOP_VERSION #include <qtopia/ir.h> #else @@ -47,7 +49,7 @@ #include <ksyncmanager.h> //#include <koprefs.h> -class QWidgetStack; +class Q3WidgetStack; class QSplitter; class KopiCalendarFile; class CalPrinter; @@ -84,19 +86,19 @@ using namespace KCal; @author Cornelius Schumacher */ -#include <qtextbrowser.h> +#include <q3textbrowser.h> #include <qtextcodec.h> -class MissedAlarmTextBrowser : public QTextBrowser { +class MissedAlarmTextBrowser : public Q3TextBrowser { Q_OBJECT public: - MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start); + MissedAlarmTextBrowser(QWidget *parent, Q3PtrList<Incidence> alarms ,QDateTime start); ~MissedAlarmTextBrowser(); void setSource(const QString & n); private: Incidence * getNextInc(QDateTime start ); - QPtrList<Incidence> mAlarms; + Q3PtrList<Incidence> mAlarms; signals: void showIncidence( QString uid); }; @@ -127,7 +129,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser QDate startDate(); QDate endDate(); - QWidgetStack *viewStack(); + Q3WidgetStack *viewStack(); QWidget *leftFrame(); DateNavigator *dateNavigator(); @@ -441,7 +443,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void editFilters(); void toggleFilerEnabled(); - QPtrList<CalFilter> filters(); + Q3PtrList<CalFilter> filters(); void toggleFilter(); void showFilter(bool visible); void updateFilter(); @@ -495,7 +497,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void beamIncidence(Incidence *) ; void beamCalendar() ; void beamFilteredCalendar() ; - void beamIncidenceList(QPtrList<Incidence>) ; + void beamIncidenceList(Q3PtrList<Incidence>) ; void manageCategories(); void editCategories(); int addCategories(); @@ -575,7 +577,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void setSyncEventsReadOnly(); QDateTime loadedFileVersion; - void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); + void checkExternSyncEvent( Q3PtrList<Event> lastSync , Incidence* toDelete ); void checkExternalId( Incidence * inc ); int mGlobalSyncMode; QString mCurrentSyncDevice; @@ -593,10 +595,10 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser QSplitter *mPanner; QSplitter *mLeftSplitter; KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame; - QWidgetStack *mRightFrame; + Q3WidgetStack *mRightFrame; KDatePicker* mDatePicker; - QVBox* mDateFrame; + Q3VBox* mDateFrame; DateNavigatorContainer *mDateNavigator; // widget showing small month view. @@ -618,7 +620,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser KODialogManager *mDialogManager; // Calendar filters - QPtrList<CalFilter> mFilters; + Q3PtrList<CalFilter> mFilters; // various housekeeping variables. bool mModified; // flag indicating if calendar is modified diff --git a/korganizer/calprintbase.cpp b/korganizer/calprintbase.cpp index 7b7d54c..ecb9e03 100644 --- a/korganizer/calprintbase.cpp +++ b/korganizer/calprintbase.cpp @@ -25,11 +25,13 @@ #include <qpainter.h> #include <qlayout.h> -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> -#include <qptrlist.h> -#include <qintdict.h> +#include <q3ptrlist.h> +#include <q3intdict.h> #include <qfontmetrics.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kglobal.h> #include <klocale.h> @@ -145,8 +147,8 @@ CalPrintBase::~CalPrintBase() QWidget *CalPrintBase::configWidget( QWidget *w ) { - QFrame *wdg = new QFrame( w ); - QVBoxLayout *layout = new QVBoxLayout( wdg ); + Q3Frame *wdg = new Q3Frame( w ); + Q3VBoxLayout *layout = new Q3VBoxLayout( wdg ); QLabel *title = new QLabel( description(), wdg ); QFont titleFont( title->font() ); @@ -285,7 +287,7 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, p.setFont(QFont("helvetica", 7, QFont::Bold)); // int lineSpacing = p.fontMetrics().lineSpacing(); const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem(); - p.drawText(x, y, width, height/4, AlignCenter, calSys->monthName( qd ) ); + p.drawText(x, y, width, height/4, Qt::AlignCenter, calSys->monthName( qd ) ); int cellWidth = width/7; int cellHeight = height/8; @@ -301,7 +303,7 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, // tmpStr.sprintf("%c",(const char*)monthDate2.dayName(monthDate2.dayOfWeek())); tmpStr=calSys->weekDayName( monthDate2 )[0].upper(); p.drawText(x+col*cellWidth, y+height/4, cellWidth, cellHeight, - AlignCenter, tmpStr); + Qt::AlignCenter, tmpStr); monthDate2 = monthDate2.addDays(1); } @@ -318,7 +320,7 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, } p.drawText( x+col*cellWidth, y+height/4+cellHeight+(row*cellHeight), - cellWidth, cellHeight, AlignCenter, + cellWidth, cellHeight, Qt::AlignCenter, tmpStr.setNum(monthDate.day()) ); monthDate = monthDate.addDays(1); } @@ -358,7 +360,7 @@ void CalPrintBase::drawDaysOfWeekBox(QPainter &p, const QDate &qd, // p.fillRect( x+1, y+1, // width-2, height-2, // QBrush( Dense7Pattern ) ); - p.drawText( x+5, y, width-10, height, AlignCenter | AlignVCenter, + p.drawText( x+5, y, width-10, height, Qt::AlignCenter | Qt::AlignVCenter, calSys->weekDayName( qd ) ); } @@ -401,16 +403,16 @@ void CalPrintBase::drawTimeLine(QPainter &p, p.setFont(QFont("helvetica", 12, QFont::Bold)); } p.drawText(x+2, (int)currY+2, width/2-2, (int)cellHeight, - AlignTop|AlignRight, numStr); + Qt::AlignTop|Qt::AlignRight, numStr); p.setFont(QFont("helvetica", 10, QFont::Normal)); p.drawText(x+width/2, (int)currY+2, width/2+2, (int)(cellHeight/2)-3, - AlignTop | AlignLeft, "00"); + Qt::AlignTop | Qt::AlignLeft, "00"); } else { QTime time( curTime.hour(), 0 ); numStr = KGlobal::locale()->formatTime( time ); p.setFont(QFont("helvetica", 14, QFont::Bold)); p.drawText(x+2, (int)currY+2, width-4, (int)cellHeight/2-3, - AlignTop|AlignLeft, numStr); + Qt::AlignTop|Qt::AlignLeft, numStr); } currY+=cellHeight; } // enough space for half-hour line and time @@ -472,7 +474,7 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList, p.drawRect( x, offset, width, height ); p.drawText( x+5, offset+5, width-10, height-10, - AlignCenter | AlignVCenter | AlignJustify | WordBreak, + Qt::AlignCenter | Qt::AlignVCenter | Qt::AlignJustify | Qt::WordBreak, text ); // reset the colors p.setBrush( oldBrush ); @@ -493,7 +495,7 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList, if (!multiDayStr.isEmpty()) { // p.fillRect(x+1, offset+1, width-2, height-2, QBrush(Dense5Pattern) ); p.drawText( x+5, offset+5, width-10, height-10, - AlignLeft | AlignTop | AlignJustify , + Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify , multiDayStr); } } else { @@ -560,7 +562,7 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, // Calculate horizontal positions and widths of events taking into account // overlapping events - QPtrList<KOrg::CellItem> cells; + Q3PtrList<KOrg::CellItem> cells; cells.setAutoDelete( true ); Event::List::ConstIterator itEvents; @@ -568,7 +570,7 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, cells.append( new PrintCellItem( *itEvents, qd ) ); } - QPtrListIterator<KOrg::CellItem> it1( cells ); + Q3PtrListIterator<KOrg::CellItem> it1( cells ); for( it1.toFirst(); it1.current(); ++it1 ) { KOrg::CellItem *placeItem = it1.current(); @@ -593,7 +595,7 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, p.setBackgroundColor( oldBgColor ); } - p.setBrush( QBrush( NoBrush ) ); + p.setBrush( QBrush( Qt::NoBrush ) ); } @@ -635,7 +637,7 @@ void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p, p.setPen( pe ); p.drawRect( currentX, currentyPos+1, currentWidth+1, eventLength+1 ); p.drawText( currentX+3, currentyPos+2, currentWidth-5, eventLength-3, - AlignLeft | AlignTop | AlignJustify | WordBreak, + Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify | Qt::TextWordWrap, text); // p.restore(); } @@ -670,7 +672,7 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, if (!hstring.isEmpty()) { p.setFont( QFont( "helvetica", 8, QFont::Bold, true ) ); - p.drawText( x+5, y, width-25, mSubHeaderHeight, AlignLeft | AlignVCenter, + p.drawText( x+5, y, width-25, mSubHeaderHeight, Qt::AlignLeft | Qt::AlignVCenter, hstring ); } p.setFont(QFont("helvetica", 10, QFont::Bold)); @@ -680,7 +682,7 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, if ( fm.width( dayNumStr ) > width -10 ) dayNumStr = local->formatDate(qd, true); } - p.drawText(x+5, y, width-10, mSubHeaderHeight, AlignRight | AlignVCenter, + p.drawText(x+5, y, width-10, mSubHeaderHeight, Qt::AlignRight | Qt::AlignVCenter, dayNumStr); Event::List eventList; eventList.fill( mCalendar->events( qd, true )); @@ -724,7 +726,7 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, } // doesFloat p.drawText(x+5, y+textY, width-10, lineSpacing, - AlignLeft|AlignBottom, outStr); + Qt::AlignLeft|Qt::AlignBottom, outStr); textY+=lineSpacing; } @@ -743,7 +745,7 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, text += i18n("To-Do: %1").arg(todo->summary()); p.drawText(x+5, y+textY, width-10, lineSpacing, - AlignLeft|AlignBottom, text); + Qt::AlignLeft|Qt::AlignBottom, text); textY+=lineSpacing; } } @@ -849,7 +851,7 @@ void CalPrintBase::drawMonth(QPainter &p, const QDate &qd, bool weeknumbers, for (int row = 0; row<rows; row++) { int calWeek = weekDate.weekNumber(); QRect rc(x, y+yoffset+cellHeight*row, xoffset-1, cellHeight); - p.drawText( rc, AlignRight|AlignVCenter, QString::number(calWeek) ); + p.drawText( rc, Qt::AlignRight|Qt::AlignVCenter, QString::number(calWeek) ); weekDate = weekDate.addDays(7); } p.setFont(oldFont); @@ -897,7 +899,7 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & TodoParentStart startpt; // This list keeps all starting points of the parent todos so the connection // lines of the tree can easily be drawn (needed if a new page is started) - static QPtrList<TodoParentStart> startPoints; + static Q3PtrList<TodoParentStart> startPoints; if (level<1) { startPoints.clear(); } @@ -910,12 +912,12 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & outStr += " [" +local->formatDate(item->dtDue().date(),true)+"]"; } int left = possummary+(level*10); - rect = p.boundingRect(left, y, (posdue-left-5),-1, WordBreak, outStr); + rect = p.boundingRect(left, y, (posdue-left-5),-1, Qt::WordBreak, outStr); //qDebug("bottom1 %d ", rect.bottom() ); if ( !item->description().isEmpty() && desc ) { outStr = item->description(); rect = p.boundingRect( left+20, rect.bottom()+5, width-(left+10-x), -1, - WordBreak, outStr ); + Qt::WordBreak, outStr ); } //qDebug("bottom2 %d y+h %d y %d ph %d", rect.bottom(), y+height, y , pageHeight ); // if too big make new page @@ -933,8 +935,7 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & start = rct->mRect.bottom() + 1; else start = p.viewport().top(); - p.moveTo( center, start ); - p.lineTo( center, to ); + p.drawLine( center, start, center, to ); rct->mSamePage=false; } } @@ -951,12 +952,12 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & // Priority outStr.setNum(priority); - rect = p.boundingRect(pospriority, y + 10, 5, -1, AlignCenter, outStr); + rect = p.boundingRect(pospriority, y + 10, 5, -1, Qt::AlignCenter, outStr); // Make it a more reasonable size rect.setWidth(19); rect.setHeight(19); if ( priority > 0 && pospriority>=0 ) { - p.drawText(rect, AlignCenter, outStr); + p.drawText(rect, Qt::AlignCenter, outStr); p.drawRect(rect); // cross out the rectangle for completed items if ( item->isCompleted() ) { @@ -964,7 +965,7 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & p.drawLine( rect.topRight(), rect.bottomLeft() ); } else if (item->cancelled() ) { QPen pen = p.pen(); - p.setPen ( QPen ( black, 2) ); + p.setPen ( QPen ( Qt::black, 2) ); p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 ); p.setPen( pen ); } @@ -981,9 +982,8 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & bottom = 0; int to( rect.top() + (rect.height()/2)+1 ); int endx( rect.left() ); - p.moveTo(center, bottom); - p.lineTo(center, to); - p.lineTo(endx, to); + p.drawLine(center,bottom, center,to); + p.drawLine(center,to, endx,to); } // if completed, use strike out font @@ -999,9 +999,9 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & outStr += " [" +item->dtDueStr(true)+"]"; } rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)), - -1, WordBreak, outStr); + -1, Qt::WordBreak, outStr); QRect newrect; - p.drawText( rect, WordBreak, outStr, -1, &newrect ); + p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect ); //ft.setStrikeOut(false); // p.setFont(ft); @@ -1016,8 +1016,8 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & y=newrect.bottom() + 5; outStr = item->description(); rect = p.boundingRect( left+20, y, x+width-(left+10), -1, - WordBreak, outStr ); - p.drawText( rect, WordBreak, outStr, -1, &newrect ); + Qt::WordBreak, outStr ); + p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect ); } // Set the new line position @@ -1138,8 +1138,8 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, mSubHeaderHeight+= mSubHeaderHeight; KLocale *local = KGlobal::locale(); QFont font("helvetica", 18, QFont::Bold); - QPen penA( black,0); - QPen penB( black,3); + QPen penA( Qt::black,0); + QPen penB( Qt::black,3); p.setFont(font); int lineSpacing = p.fontMetrics().lineSpacing(); QString title; @@ -1161,7 +1161,7 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, QFontInfo info(p.font()); lineSpacing = p.fontMetrics().lineSpacing(); - p.drawText(0, lineSpacing * 0, width, lineSpacing, AlignRight |AlignTop, title ); + p.drawText(0, lineSpacing * 0, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title ); title.truncate(0); @@ -1171,7 +1171,7 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, p.setFont(QFont("Helvetica", 20, QFont::Bold, TRUE)); title += QString::number(fd.year()); - p.drawText(0, lineSpacing * 1, width, lineSpacing, AlignRight |AlignTop, title ); + p.drawText(0, lineSpacing * 1, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title ); mSubHeaderHeight = tempStore ; } @@ -1197,7 +1197,7 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width, p.setPen( Qt::black); p.setFont(QFont("helvetica", 12, QFont::Bold, true)); p.drawText(offsetLeft, mHeaderHeight + 5, - width, mSubHeaderHeight, AlignHCenter | AlignVCenter, + width, mSubHeaderHeight, Qt::AlignHCenter | Qt::AlignVCenter, dayName); p.setPen( QPen(Qt::black,2)); @@ -1254,10 +1254,10 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width, p.drawRect(offsetLeft+2, 1+offset+startMinuteOff+startTime*cellHeight, width-4, cheight); p.drawText(offsetLeft+12, offset+startMinuteOff+startTime*cellHeight+5, width-24, - cheight-10, AlignHCenter | AlignTop, text); + cheight-10, Qt::AlignHCenter | Qt::AlignTop, text); } } - p.setBrush(QBrush(NoBrush)); + p.setBrush(QBrush(Qt::NoBrush)); mSubHeaderHeight = tempStore ; } @@ -1274,12 +1274,12 @@ void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth, QString numStr; for (int i = 0; i < hours; i++) { - p.setPen(QPen(black,1)); + p.setPen(QPen(Qt::black,1)); p.drawLine(0, offset+i*cellHeight, width, offset+i*cellHeight); - p.setPen(QPen(gray,0)); + p.setPen(QPen(Qt::gray,0)); p.drawLine(37, offset+i*cellHeight+(cellHeight/2), width, offset+i*cellHeight+(cellHeight/2)); - p.setPen(QPen(black,0)); + p.setPen(QPen(Qt::black,0)); if ( !KGlobal::locale()->use12Clock() ) { numStr.setNum(i+startHour); @@ -1289,16 +1289,16 @@ void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth, p.setFont(QFont("helvetica", 14, QFont::Bold)); } p.drawText(0, offset+i*cellHeight, 33, cellHeight/2, - AlignTop|AlignRight, numStr); + Qt::AlignTop|Qt::AlignRight, numStr); p.setFont(QFont("helvetica", 12, QFont::Bold)); p.drawText(37, offset+i*cellHeight, 45, cellHeight/2, - AlignTop | AlignLeft, "00"); + Qt::AlignTop | Qt::AlignLeft, "00"); } else { QTime time( i + startHour, 0 ); numStr = KGlobal::locale()->formatTime( time ); p.setFont(QFont("helvetica", 12, QFont::Bold)); p.drawText(4, offset+i*cellHeight, 70, cellHeight/2, - AlignTop|AlignLeft, numStr); + Qt::AlignTop|Qt::AlignLeft, numStr); } } mSubHeaderHeight = tempStore ; } diff --git a/korganizer/calprinter.cpp b/korganizer/calprinter.cpp index 0cdf28e..d4bf988 100644 --- a/korganizer/calprinter.cpp +++ b/korganizer/calprinter.cpp @@ -21,15 +21,18 @@ without including the source code for Qt in the source distribution. */ -#include <qvbuttongroup.h> -#include <qwidgetstack.h> +// #include <qvbuttongroup.h> +#include <q3widgetstack.h> #include <qradiobutton.h> #include <qlayout.h> #include <qpushbutton.h> #include <qcombobox.h> #include <qlabel.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qsplitter.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3PtrList> #include <kprinter.h> #include <kglobal.h> @@ -174,14 +177,14 @@ void CalPrinter::updateConfig() /****************************************************************************/ -CalPrintDialog::CalPrintDialog( QPtrList<CalPrintBase> plugins, KPrinter *p, +CalPrintDialog::CalPrintDialog( Q3PtrList<CalPrintBase> plugins, KPrinter *p, QWidget *parent, const char *name ) : KDialogBase( parent, name, /*modal*/true, i18n("Print"), Ok | Cancel ), mPrinter( p ), mPrintPlugins( plugins ) { - QVBox *page = new QVBox(this);//makeVBoxMainWidget(); + Q3VBox *page = new Q3VBox(this);//makeVBoxMainWidget(); setMainWidget( page ); - QHBox *printerLayout = new QHBox( page ); + Q3HBox *printerLayout = new Q3HBox( page ); mPrinterLabel = new QLabel( printerLayout ); QPushButton *setupButton = new QPushButton( i18n("&Setup Printer..."), @@ -191,20 +194,20 @@ CalPrintDialog::CalPrintDialog( QPtrList<CalPrintBase> plugins, KPrinter *p, 0, 0, setupButton->sizePolicy().hasHeightForWidth() ) ); QSplitter *splitter = new QSplitter( page ); - splitter->setOrientation( QSplitter::Horizontal ); + splitter->setOrientation( Qt::Horizontal ); - mTypeGroup = new QVButtonGroup( i18n("View Type"), splitter, "buttonGroup" ); + mTypeGroup = new Q3VButtonGroup( i18n("View Type"), splitter, "buttonGroup" ); // use the minimal width possible = max width of the radio buttons, not extensible /* mTypeGroup->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, mTypeGroup->sizePolicy().hasHeightForWidth() ) );*/ QWidget *splitterRight = new QWidget( splitter, "splitterRight" ); - QGridLayout *splitterRightLayout = new QGridLayout( splitterRight ); + Q3GridLayout *splitterRightLayout = new Q3GridLayout( splitterRight ); splitterRightLayout->setMargin( marginHint() ); splitterRightLayout->setSpacing( spacingHint() ); - mConfigArea = new QWidgetStack( splitterRight, "configWidgetStack" ); + mConfigArea = new Q3WidgetStack( splitterRight, "configWidgetStack" ); splitterRightLayout->addMultiCellWidget( mConfigArea, 0,0, 0,1 ); QLabel *orientationLabel = new QLabel( i18n("Page &orientation:"), diff --git a/korganizer/calprinter.h b/korganizer/calprinter.h index 7b58f4f..e065779 100644 --- a/korganizer/calprinter.h +++ b/korganizer/calprinter.h @@ -1,3 +1,5 @@ +//Added by qt3to4: +#include <QLabel> /* This file is part of KOrganizer. @@ -28,7 +30,7 @@ #ifndef KORG_NOPRINTER -#include <qptrlist.h> +#include <q3ptrlist.h> #include <kdialogbase.h> @@ -38,8 +40,8 @@ using namespace KCal; -class QVButtonGroup; -class QWidgetStack; +class Q3VButtonGroup; +class Q3WidgetStack; class KPrinter; class CalPrintDialog; class KConfig; @@ -94,7 +96,7 @@ class CalPrinter : public QObject, public KOrg::CalPrinterBase void print( PrintType type, const QDate &fd, const QDate &td ); protected: - QPtrList<CalPrintBase> mPrintPlugins; + Q3PtrList<CalPrintBase> mPrintPlugins; private: KPrinter *mPrinter; @@ -109,7 +111,7 @@ class CalPrintDialog : public KDialogBase { Q_OBJECT public: - CalPrintDialog( QPtrList<CalPrintBase> plugins, KPrinter *p, + CalPrintDialog( Q3PtrList<CalPrintBase> plugins, KPrinter *p, QWidget *parent = 0, const char *name = 0 ); virtual ~CalPrintDialog(); CalPrintBase *selectedPlugin(); @@ -127,9 +129,9 @@ signals: void okClicked(); private: KPrinter *mPrinter; - QVButtonGroup *mTypeGroup; - QWidgetStack *mConfigArea; - QPtrList<CalPrintBase> mPrintPlugins; + Q3VButtonGroup *mTypeGroup; + Q3WidgetStack *mConfigArea; + Q3PtrList<CalPrintBase> mPrintPlugins; QLabel *mPrinterLabel; QString mPreviewText; QComboBox *mOrientationSelection; diff --git a/korganizer/calprintplugins.cpp b/korganizer/calprintplugins.cpp index bc35ca4..9b6dc6e 100644 --- a/korganizer/calprintplugins.cpp +++ b/korganizer/calprintplugins.cpp @@ -25,11 +25,11 @@ */ #include <qpainter.h> -#include <qdatetimeedit.h> +#include <q3datetimeedit.h> #include <qdatetime.h> #include <qcheckbox.h> #include <qlineedit.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <kglobal.h> #include <klocale.h> diff --git a/korganizer/cellitem.cpp b/korganizer/cellitem.cpp index 61d06ac..1fd703c 100644 --- a/korganizer/cellitem.cpp +++ b/korganizer/cellitem.cpp @@ -27,7 +27,9 @@ #include <klocale.h> #include <kdebug.h> -#include <qintdict.h> +#include <q3intdict.h> +//Added by qt3to4: +#include <Q3PtrList> using namespace KOrg; @@ -36,17 +38,17 @@ QString CellItem::label() const return i18n("<undefined>"); } -QPtrList<CellItem> CellItem::placeItem( QPtrList<CellItem> cells, +Q3PtrList<CellItem> CellItem::placeItem( Q3PtrList<CellItem> cells, CellItem *placeItem ) { kdDebug(5855) << "Placing " << placeItem->label() << endl; - QPtrList<KOrg::CellItem> conflictItems; + Q3PtrList<KOrg::CellItem> conflictItems; int maxSubCells = 0; - QIntDict<KOrg::CellItem> subCellDict; + Q3IntDict<KOrg::CellItem> subCellDict; // Find all items which are in same cell - QPtrListIterator<KOrg::CellItem> it2( cells ); + Q3PtrListIterator<KOrg::CellItem> it2( cells ); for( it2.toFirst(); it2.current(); ++it2 ) { KOrg::CellItem *item = it2.current(); if ( item == placeItem ) continue; @@ -83,7 +85,7 @@ QPtrList<CellItem> CellItem::placeItem( QPtrList<CellItem> cells, conflictItems.append( placeItem ); placeItem->setSubCells( maxSubCells ); - QPtrListIterator<KOrg::CellItem> it3( conflictItems ); + Q3PtrListIterator<KOrg::CellItem> it3( conflictItems ); for( it3.toFirst(); it3.current(); ++it3 ) { (*it3)->setSubCells( maxSubCells ); } diff --git a/korganizer/cellitem.h b/korganizer/cellitem.h index 72773d0..b917bd5 100644 --- a/korganizer/cellitem.h +++ b/korganizer/cellitem.h @@ -25,7 +25,7 @@ #define KORG_CELLITEM_H #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> namespace KOrg { @@ -53,7 +53,7 @@ class CellItem \return Placed items */ - static QPtrList<CellItem> placeItem( QPtrList<CellItem> cells, + static Q3PtrList<CellItem> placeItem( Q3PtrList<CellItem> cells, CellItem *placeItem ); private: diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index ea510f1..53507d3 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp @@ -34,6 +34,8 @@ #include "datenavigatorcontainer.h" #include "koprefs.h" +//Added by qt3to4: +#include <QResizeEvent> DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, const char *name ) diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h index 87cc59f..75d387c 100644 --- a/korganizer/datenavigatorcontainer.h +++ b/korganizer/datenavigatorcontainer.h @@ -1,3 +1,6 @@ +//Added by qt3to4: +#include <QResizeEvent> +#include <Q3PtrList> /* This file is part of KOrganizer. @@ -100,7 +103,7 @@ class DateNavigatorContainer: public QWidget KCal::Calendar *mCalendar; - QPtrList<KDateNavigator> mExtraViews; + Q3PtrList<KDateNavigator> mExtraViews; int mHorizontalCount; int mVerticalCount; diff --git a/korganizer/filteredit_base.cpp b/korganizer/filteredit_base.cpp index 505edf6..9425963 100644 --- a/korganizer/filteredit_base.cpp +++ b/korganizer/filteredit_base.cpp @@ -11,42 +11,47 @@ #include <qvariant.h> #include <qpushbutton.h> -#include <qframe.h> -#include <qbuttongroup.h> +#include <q3frame.h> +#include <q3buttongroup.h> #include <qapplication.h> +#include <QDesktopWidget> #include <qradiobutton.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qlabel.h> #include <qcheckbox.h> #include <qlayout.h> #include <qtooltip.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> #include "tr.h" /* * Constructs a FilterEdit_base as a child of 'parent', with the * name 'name' and widget flags set to 'f'. */ -FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) +FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, Qt::WFlags fl ) : QWidget( parent, name, fl ) { if ( !name ) setName( "FilterEdit_base" ); - FilterEdit_baseLayout = new QVBoxLayout( this, 0, 0, "FilterEdit_baseLayout"); + FilterEdit_baseLayout = new Q3VBoxLayout( this, 0, 0, "FilterEdit_baseLayout"); - mCriteriaFrame = new QFrame( this, "mCriteriaFrame" ); - mCriteriaFrame->setFrameShape( QFrame::StyledPanel ); - mCriteriaFrame->setFrameShadow( QFrame::Raised ); - mCriteriaFrameLayout = new QVBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout"); + mCriteriaFrame = new Q3Frame( this, "mCriteriaFrame" ); + mCriteriaFrame->setFrameShape( Q3Frame::StyledPanel ); + mCriteriaFrame->setFrameShadow( Q3Frame::Raised ); + mCriteriaFrameLayout = new Q3VBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout"); - ButtonGroup1 = new QButtonGroup( mCriteriaFrame, "ButtonGroup1" ); + ButtonGroup1 = new Q3ButtonGroup( mCriteriaFrame, "ButtonGroup1" ); ButtonGroup1->setColumnLayout(0, Qt::Vertical ); ButtonGroup1->layout()->setSpacing( 6 ); ButtonGroup1->layout()->setMargin( 6 ); - ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() ); + ButtonGroup1Layout = new Q3GridLayout( ButtonGroup1->layout() ); ButtonGroup1Layout->setAlignment( Qt::AlignTop ); - layout4 = new QHBoxLayout( 0, 0, 6, "layout4"); + layout4 = new Q3HBoxLayout( 0, 0, 6, "layout4"); mCatShowCheck = new QRadioButton( ButtonGroup1, "mCatShowCheck" ); layout4->addWidget( mCatShowCheck ); @@ -59,12 +64,12 @@ FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) ButtonGroup1Layout->addLayout( layout4, 0, 0 ); - mCatList = new QListBox( ButtonGroup1, "mCatList" ); + mCatList = new Q3ListBox( ButtonGroup1, "mCatList" ); ButtonGroup1Layout->addWidget( mCatList, 1, 0 ); mCriteriaFrameLayout->addWidget( ButtonGroup1 ); - layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); + layout7 = new Q3HBoxLayout( 0, 0, 6, "layout7"); textLabel1 = new QLabel( mCriteriaFrame, "textLabel1" ); layout7->addWidget( textLabel1 ); @@ -76,7 +81,7 @@ FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) layout7->addWidget( mCompletedCheck ); mCriteriaFrameLayout->addLayout( layout7 ); - layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); + layout9 = new Q3HBoxLayout( 0, 0, 6, "layout9"); textLabel1_2 = new QLabel( mCriteriaFrame, "textLabel1_2" ); layout9->addWidget( textLabel1_2 ); @@ -91,7 +96,7 @@ FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) layout9->addWidget( mJournalCheck ); mCriteriaFrameLayout->addLayout( layout9 ); - layout2 = new QHBoxLayout( 0, 0, 0, "layout2"); + layout2 = new Q3HBoxLayout( 0, 0, 0, "layout2"); textLabel2 = new QLabel( mCriteriaFrame, "textLabel2" ); layout2->addWidget( textLabel2 ); @@ -109,7 +114,6 @@ FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) FilterEdit_baseLayout->addWidget( mCriteriaFrame ); languageChange(); resize( QSize(300, 200).expandedTo(minimumSizeHint()) ); - clearWState( WState_Polished ); } /* diff --git a/korganizer/filteredit_base.h b/korganizer/filteredit_base.h index 13a02c3..135f6fa 100644 --- a/korganizer/filteredit_base.h +++ b/korganizer/filteredit_base.h @@ -12,17 +12,23 @@ #include <qvariant.h> #include <qwidget.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3Frame> +#include <Q3GridLayout> +#include <Q3HBoxLayout> +#include <QLabel> -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; class QSpacerItem; -class QFrame; -class QButtonGroup; +class Q3Frame; +class Q3ButtonGroup; class QRadioButton; class QPushButton; -class QListBox; -class QListBoxItem; +class Q3ListBox; +class Q3ListBoxItem; class QLabel; class QCheckBox; @@ -31,15 +37,15 @@ class FilterEdit_base : public QWidget Q_OBJECT public: - FilterEdit_base( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + FilterEdit_base( QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0 ); ~FilterEdit_base(); - QFrame* mCriteriaFrame; - QButtonGroup* ButtonGroup1; + Q3Frame* mCriteriaFrame; + Q3ButtonGroup* ButtonGroup1; QRadioButton* mCatShowCheck; QRadioButton* mCatHideCheck; QPushButton* mCatEditButton; - QListBox* mCatList; + Q3ListBox* mCatList; QLabel* textLabel1; QCheckBox* mRecurringCheck; QCheckBox* mCompletedCheck; @@ -53,13 +59,13 @@ public: QCheckBox* mConfidentialCheck; protected: - QVBoxLayout* FilterEdit_baseLayout; - QVBoxLayout* mCriteriaFrameLayout; - QGridLayout* ButtonGroup1Layout; - QHBoxLayout* layout4; - QHBoxLayout* layout7; - QHBoxLayout* layout9; - QHBoxLayout* layout2; + Q3VBoxLayout* FilterEdit_baseLayout; + Q3VBoxLayout* mCriteriaFrameLayout; + Q3GridLayout* ButtonGroup1Layout; + Q3HBoxLayout* layout4; + Q3HBoxLayout* layout7; + Q3HBoxLayout* layout9; + Q3HBoxLayout* layout2; protected slots: virtual void languageChange(); diff --git a/korganizer/filtereditdialog.cpp b/korganizer/filtereditdialog.cpp index df84911..a3cff49 100644 --- a/korganizer/filtereditdialog.cpp +++ b/korganizer/filtereditdialog.cpp @@ -26,8 +26,13 @@ #include <qcombobox.h> #include <qcheckbox.h> #include <qradiobutton.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3PtrList> + +#include <QDesktopWidget> #include <kdebug.h> #include <klocale.h> @@ -53,7 +58,7 @@ public: }; -FilterEditDialog::FilterEditDialog(QPtrList<CalFilter> *filters,QWidget *parent, +FilterEditDialog::FilterEditDialog(Q3PtrList<CalFilter> *filters,QWidget *parent, const char *name) : KDialogBase(parent,name,true,i18n("Edit Calendar Filters"), Ok|Apply|Cancel) @@ -80,7 +85,7 @@ FilterEditDialog::FilterEditDialog(QPtrList<CalFilter> *filters,QWidget *parent, mEditor = new FilterEdit_base(mainWidget); - QGridLayout *topLayout = new QGridLayout(mainWidget,2,2); + Q3GridLayout *topLayout = new Q3GridLayout(mainWidget,2,2); topLayout->setSpacing(spacingHint()); topLayout->addWidget(mSelectionCombo,0,0); topLayout->addWidget(upButton,0,1); diff --git a/korganizer/filtereditdialog.h b/korganizer/filtereditdialog.h index 42aa3da..c1a52ed 100644 --- a/korganizer/filtereditdialog.h +++ b/korganizer/filtereditdialog.h @@ -23,7 +23,7 @@ #ifndef _FILTEREDITDIALOG_H #define _FILTEREDITDIALOG_H -#include <qptrlist.h> +#include <q3ptrlist.h> #include <kdialogbase.h> @@ -46,7 +46,7 @@ class FilterEditDialog : public KDialogBase { Q_OBJECT public: - FilterEditDialog(QPtrList<CalFilter> *,QWidget *parent=0, const char *name=0); + FilterEditDialog(Q3PtrList<CalFilter> *,QWidget *parent=0, const char *name=0); virtual ~FilterEditDialog(); public slots: @@ -74,7 +74,7 @@ class FilterEditDialog : public KDialogBase void writeFilter(CalFilter *); private: - QPtrList<CalFilter> *mFilters; + Q3PtrList<CalFilter> *mFilters; ComboFilterBox *mSelectionCombo; QPushButton *mRemoveButton; diff --git a/korganizer/incomingdialog.cpp b/korganizer/incomingdialog.cpp index fe78356..c2402d4 100644 --- a/korganizer/incomingdialog.cpp +++ b/korganizer/incomingdialog.cpp @@ -17,10 +17,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <qlistview.h> +#include <q3listview.h> #include <qfile.h> #include <qdir.h> #include <qmap.h> +//Added by qt3to4: +#include <Q3PtrList> #include <kglobal.h> #include <klocale.h> @@ -56,9 +58,9 @@ #endif -ScheduleItemIn::ScheduleItemIn(QListView *parent,IncidenceBase *ev, +ScheduleItemIn::ScheduleItemIn(Q3ListView *parent,IncidenceBase *ev, Scheduler::Method method,ScheduleMessage::Status status) - : QListViewItem(parent) + : Q3ListViewItem(parent) { mIncidence = ev; mMethod = method; @@ -135,7 +137,7 @@ bool ScheduleItemVisitor::visit(Journal *) * TRUE to construct a modal dialog. */ IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, - QWidget* parent,const char* name,bool modal,WFlags fl) : + QWidget* parent,const char* name,bool modal,Qt::WFlags fl) : IncomingDialog_base(parent,name,modal,fl) { mCalendar = calendar; @@ -145,12 +147,12 @@ IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, #else mScheduler = new DummyScheduler(mCalendar); #endif - mMessageListView->setColumnAlignment(1,AlignHCenter); - mMessageListView->setColumnAlignment(2,AlignHCenter); - mMessageListView->setColumnAlignment(3,AlignHCenter); - mMessageListView->setColumnAlignment(4,AlignHCenter); - QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)), - this,SLOT(showEvent(QListViewItem *))); + mMessageListView->setColumnAlignment(1,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(2,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(3,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(4,Qt::AlignHCenter); + QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)), + this,SLOT(showEvent(Q3ListViewItem *))); retrieve(); } @@ -169,7 +171,7 @@ void IncomingDialog::setOutgoingDialog(OutgoingDialog *outgoing) void IncomingDialog::retrieve() { - QPtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions(); + Q3PtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions(); ScheduleMessage *message; for(message = messages.first();message;message = messages.next()) { @@ -252,7 +254,7 @@ void IncomingDialog::rejectMessage() } } -void IncomingDialog::showEvent(QListViewItem *item) +void IncomingDialog::showEvent(Q3ListViewItem *item) { IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); if( incidence && incidence->typeID() == eventID ) { @@ -269,7 +271,7 @@ bool IncomingDialog::incomeRefresh(ScheduleItemIn *item) if (ev) { //user interaction before?? Attendee *att; - QPtrList<Attendee> attlist = ev->attendees(); + Q3PtrList<Attendee> attlist = ev->attendees(); for (att=attlist.first(); att; att=attlist.next()) { Event *event = new Event(*ev); mOutgoing->addMessage(event,Scheduler::Request,att->email()); @@ -514,7 +516,7 @@ bool IncomingDialog::checkAttendeesInAddressbook(IncidenceBase *inc) #ifndef KORG_NOKABC KABC::AddressBook *add_book = KABC::StdAddressBook::self(); KABC::Addressee::List addressList; - QPtrList <Attendee> attendees; + Q3PtrList <Attendee> attendees; Attendee *att; attendees = inc->attendees(); for (att=attendees.first();att;att=attendees.next()) { diff --git a/korganizer/incomingdialog.h b/korganizer/incomingdialog.h index 413ce6a..e002b25 100644 --- a/korganizer/incomingdialog.h +++ b/korganizer/incomingdialog.h @@ -19,7 +19,7 @@ #ifndef INCOMINGDIALOG_H #define INCOMINGDIALOG_H -#include <qlistview.h> +#include <q3listview.h> #include <libkcal/calendar.h> #include <libkcal/scheduler.h> @@ -29,10 +29,10 @@ using namespace KCal; -class ScheduleItemIn : public QListViewItem +class ScheduleItemIn : public Q3ListViewItem { public: - ScheduleItemIn(QListView *parent,IncidenceBase *ev,Scheduler::Method method, + ScheduleItemIn(Q3ListView *parent,IncidenceBase *ev,Scheduler::Method method, ScheduleMessage::Status status); virtual ~ScheduleItemIn() {} @@ -72,7 +72,7 @@ class IncomingDialog : public IncomingDialog_base Q_OBJECT public: IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, - QWidget* parent=0,const char* name=0,bool modal=false,WFlags fl=0); + QWidget* parent=0,const char* name=0,bool modal=false,Qt::WFlags fl=0); ~IncomingDialog(); void setOutgoingDialog(OutgoingDialog *outgoing); @@ -87,7 +87,7 @@ class IncomingDialog : public IncomingDialog_base void acceptAllMessages(); void acceptMessage(); void rejectMessage(); - void showEvent(QListViewItem *); + void showEvent(Q3ListViewItem *); protected: bool acceptMessage(ScheduleItemIn *item); diff --git a/korganizer/incomingdialog_base.cpp b/korganizer/incomingdialog_base.cpp index 8589803..5c5ace4 100644 --- a/korganizer/incomingdialog_base.cpp +++ b/korganizer/incomingdialog_base.cpp @@ -11,12 +11,14 @@ #include "incomingdialog_base.h" #include <qvariant.h> -#include <qheader.h> -#include <qlistview.h> +#include <q3header.h> +#include <q3listview.h> #include <qpushbutton.h> #include <qlayout.h> #include <qtooltip.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3GridLayout> /* * Constructs a IncomingDialog_base as a child of 'parent', with the @@ -25,13 +27,13 @@ * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) +IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "IncomingDialog_base" ); - IncomingDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "IncomingDialog_baseLayout"); + IncomingDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "IncomingDialog_baseLayout"); PushButton4 = new QPushButton( this, "PushButton4" ); @@ -42,7 +44,7 @@ IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, boo IncomingDialog_baseLayout->addWidget( PushButton7, 5, 1 ); - mMessageListView = new QListView( this, "mMessageListView" ); + mMessageListView = new Q3ListView( this, "mMessageListView" ); mMessageListView->addColumn( tr2i18n( "Summary" ) ); mMessageListView->addColumn( tr2i18n( "Start Date" ) ); mMessageListView->addColumn( tr2i18n( "Start Time" ) ); diff --git a/korganizer/incomingdialog_base.h b/korganizer/incomingdialog_base.h index 7732384..537ef86 100644 --- a/korganizer/incomingdialog_base.h +++ b/korganizer/incomingdialog_base.h @@ -12,12 +12,16 @@ #include <qvariant.h> #include <qdialog.h> - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QListView; -class QListViewItem; +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3GridLayout> +#include <Q3HBoxLayout> + +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; +class Q3ListView; +class Q3ListViewItem; class QPushButton; class IncomingDialog_base : public QDialog @@ -25,18 +29,18 @@ class IncomingDialog_base : public QDialog Q_OBJECT public: - IncomingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + IncomingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~IncomingDialog_base(); QPushButton* PushButton4; QPushButton* PushButton7; - QListView* mMessageListView; + Q3ListView* mMessageListView; QPushButton* PushButton7_2; QPushButton* PushButton8; QPushButton* PushButton9; protected: - QGridLayout* IncomingDialog_baseLayout; + Q3GridLayout* IncomingDialog_baseLayout; protected slots: virtual void languageChange(); diff --git a/korganizer/interfaces/korganizer/baseview.h b/korganizer/interfaces/korganizer/baseview.h index 2ac9de1..c828573 100644 --- a/korganizer/interfaces/korganizer/baseview.h +++ b/korganizer/interfaces/korganizer/baseview.h @@ -24,8 +24,8 @@ // KOBaseView is the abstract base class of all calendar views. #include <qwidget.h> -#include <qptrlist.h> -#include <qvaluelist.h> +#include <q3ptrlist.h> +#include <q3valuelist.h> #include <klocale.h> #include <kdebug.h> @@ -88,7 +88,7 @@ class BaseView : public QWidget select a single event at a time, but some may be able to select more than one. */ - virtual QPtrList<Incidence> selectedIncidences() = 0; + virtual Q3PtrList<Incidence> selectedIncidences() = 0; /** @return a list of the dates of selected events. Most views can probably only @@ -153,7 +153,7 @@ class BaseView : public QWidget @param eventList a list of events to show. */ - virtual void showEvents(QPtrList<Event> eventList) = 0; + virtual void showEvents(Q3PtrList<Event> eventList) = 0; /** Updates the current display to reflect changes that may have happened diff --git a/korganizer/interfaces/korganizer/calendarviewbase.h b/korganizer/interfaces/korganizer/calendarviewbase.h index 3c715b1..1f49357 100644 --- a/korganizer/interfaces/korganizer/calendarviewbase.h +++ b/korganizer/interfaces/korganizer/calendarviewbase.h @@ -23,6 +23,8 @@ #include <qwidget.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <libkcal/calendar.h> @@ -40,7 +42,7 @@ class CalendarViewBase : public QWidget Q_OBJECT public: CalendarViewBase(QWidget *parent, const char *name) : - QWidget(parent,name) {new QVBoxLayout(this);} + QWidget(parent,name) {new Q3VBoxLayout(this);} virtual ~CalendarViewBase() {}; virtual KCal::Calendar *calendar() = 0; diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 5269af7..2814c61 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp @@ -26,14 +26,21 @@ #include <qlabel.h> #include <qlayout.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qfile.h> #include <qdir.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <qpixmap.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QResizeEvent> +#include <Q3Frame> +#include <QKeyEvent> +#include <QEvent> +#include <Q3VBoxLayout> #include <kdebug.h> #include <kglobal.h> @@ -57,7 +64,7 @@ #include <qpe/qpeapplication.h> #endif JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : - QFrame(parent) + Q3Frame(parent) { int fac = 5; @@ -70,7 +77,7 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : mCalendar = calendar; mJournal = 0; visibleMode = true; - QHBox * vb = new QHBox ( this ); + Q3HBox * vb = new Q3HBox ( this ); QPixmap iconp; vb->setMargin ( KDialog::marginHint()-1 ); QPushButton * toggleJournal = new QPushButton( vb ); @@ -129,13 +136,13 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : } //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); mEditor->setWordWrap( KTextEdit::WidgetWidth ); - QBoxLayout *topLayout = new QVBoxLayout(this); + Q3BoxLayout *topLayout = new Q3VBoxLayout(this); topLayout->addWidget(vb); topLayout->addWidget(mEditor); mEditor->installEventFilter(this); installEventFilter(this); mTitle->installEventFilter(this); - setFocusPolicy (QWidget::NoFocus); + setFocusPolicy (Qt::NoFocus); connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); @@ -168,7 +175,7 @@ void JournalEntry::resizeEvent(QResizeEvent* e ) //setMaximumWidth( QApplication::desktop()->width() ); //qDebug("MAXXX %d ", QApplication::desktop()->width()); #endif - QFrame::resizeEvent( e ); + Q3Frame::resizeEvent( e ); } QSize JournalEntry::sizeHint() const { @@ -186,13 +193,13 @@ void JournalEntry::slotSaveTemplate() return; QFile fileIn( fileName ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { KMessageBox::error( this, i18n("Error saving template file\n '%1'.") .arg( fileName ) ); return; } // QString text; - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << mEditor->text(); fileIn.close(); @@ -208,12 +215,12 @@ void JournalEntry::slotLoadTemplate() if ( fileName.length() == 0 ) return; QFile fileIn( fileName ); - if (!fileIn.open( IO_ReadOnly ) ) { + if (!fileIn.open( QIODevice::ReadOnly ) ) { KMessageBox::error( this, i18n("Error loading template file\n '%1'.") .arg( fileName ) ); return; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); QString text = tsIn.read(); fileIn.close(); @@ -316,11 +323,11 @@ bool JournalEntry::eventFilter( QObject *o, QEvent *e ) { // kdDebug() << "JournalEntry::event received " << e->type() << endl; if ( isVisible() ) { - mEditor->setFocusPolicy (QWidget::StrongFocus); - mTitle->setFocusPolicy (QWidget::StrongFocus); + mEditor->setFocusPolicy (Qt::StrongFocus); + mTitle->setFocusPolicy (Qt::StrongFocus); } else { - mEditor->setFocusPolicy (QWidget::NoFocus); - mTitle->setFocusPolicy (QWidget::NoFocus); + mEditor->setFocusPolicy (Qt::NoFocus); + mTitle->setFocusPolicy (Qt::NoFocus); } if ( e->type() == QEvent::FocusOut ) { writeJournal(); @@ -335,7 +342,7 @@ bool JournalEntry::eventFilter( QObject *o, QEvent *e ) } } - return QFrame::eventFilter( o, e ); // standard event processing + return Q3Frame::eventFilter( o, e ); // standard event processing } void JournalEntry::writeJournal() diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index ee17da8..0adebe9 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h @@ -25,7 +25,12 @@ // // Widget showing one Journal entry -#include <qframe.h> +#include <q3frame.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QEvent> +#include <QLabel> +#include <QKeyEvent> #include <libkcal/calendar.h> @@ -37,7 +42,7 @@ class KOLocationBox; using namespace KCal; -class JournalEntry : public QFrame { +class JournalEntry : public Q3Frame { Q_OBJECT public: JournalEntry(Calendar *,QWidget *parent); diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index 6697602..ecc7a2f 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -22,12 +22,16 @@ */ #include <qstring.h> -#include <qkeycode.h> +#include <qnamespace.h> #include <qlayout.h> #include <qtimer.h> -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> #include <qapplication.h> +//Added by qt3to4: +#include <QWheelEvent> +#include <Q3GridLayout> +#include <QEvent> #include <kdebug.h> #include <klocale.h> @@ -46,12 +50,12 @@ #include "kdatenavigator.h" KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) - : QFrame(parent, name), + : Q3Frame(parent, name), updateTimer(0L) { - setFrameStyle(QFrame::NoFrame); + setFrameStyle(Q3Frame::NoFrame); QDate startDate = QDate::currentDate(); - QGridLayout *topLayout = new QGridLayout(this,8,8); + Q3GridLayout *topLayout = new Q3GridLayout(this,8,8); if (! startDate.isValid()) { qDebug("KDateNavigator::invalid startdate "); @@ -81,7 +85,7 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) for( i = 0; i < 7; i++ ) { headings[i] = new QLabel("",this); //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); - headings[i]->setAlignment(AlignCenter); + headings[i]->setAlignment(Qt::AlignCenter); headings[i]->installEventFilter(this); topLayout->addWidget(headings[i],1,i+1); @@ -90,7 +94,7 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) // Create the weeknumber labels for( i = 0; i < 6; i++ ) { weeknos[i] = new QLabel(this); - weeknos[i]->setAlignment(AlignCenter ); + weeknos[i]->setAlignment(Qt::AlignCenter ); //weeknos[i]->setFont(QFont("Arial", 10)); if(!m_bShowWeekNums) { weeknos[i]->hide(); @@ -101,7 +105,7 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) } daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); - daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); + daymatrix->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken); daymatrix->setLineWidth(1); connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h index 780ebb8..2cbca76 100644 --- a/korganizer/kdatenavigator.h +++ b/korganizer/kdatenavigator.h @@ -23,9 +23,12 @@ #ifndef KDATENAVIGATOR_H #define KDATENAVIGATOR_H -#include <qframe.h> +#include <q3frame.h> #include <qdatetime.h> #include <qlabel.h> +//Added by qt3to4: +#include <QWheelEvent> +#include <QEvent> #include <libkcal/calendar.h> @@ -38,7 +41,7 @@ class KCalendarSystem; class NavigatorBar; -class KDateNavigator: public QFrame +class KDateNavigator: public Q3Frame { Q_OBJECT public: @@ -133,8 +136,8 @@ class KDateNavigator: public QFrame int mMonthSignalOffset; NavigatorBar *mNavigatorBar; - QFrame *headingSep; - QFrame *weeknumSep; + Q3Frame *headingSep; + Q3Frame *weeknumSep; QLabel *headings[7]; QLabel *weeknos[7]; KODayMatrix *daymatrix; diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 1d4d6de..fe59787 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -29,12 +29,23 @@ #include <qwidget.h> #undef protected #endif -#include <qintdict.h> +#include <q3intdict.h> #include <qdatetime.h> #include <qapplication.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qcursor.h> #include <qpainter.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> +#include <QPixmap> +#include <QMouseEvent> +#include <QKeyEvent> +#include <Q3MemArray> +#include <QEvent> +#include <Q3Frame> +#include <Q3PtrList> #include <kdebug.h> #include <klocale.h> @@ -63,7 +74,7 @@ extern int globalFlagBlockStartup; //////////////////////////////////////////////////////////////////////////// MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) - : QFrame(_agenda->viewport(),name), agenda(_agenda) + : Q3Frame(_agenda->viewport(),name), agenda(_agenda) { setLineWidth(0); setMargin(0); @@ -169,8 +180,8 @@ void MarcusBains::updateLocation(bool recalculate) Create an agenda widget with rows rows and columns columns. */ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, - const char *name,WFlags f) : - QScrollView(parent,name,f) + const char *name,Qt::WFlags f) : + Q3ScrollView(parent,name,f) { mAllAgendaPopup = 0; @@ -190,8 +201,8 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, Create an agenda widget with columns columns and one row. This is used for all-day events. */ -KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : - QScrollView(parent,name,f) +KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,Qt::WFlags f) : + Q3ScrollView(parent,name,f) { mAllAgendaPopup = 0; blockResize = false; @@ -231,7 +242,7 @@ void KOAgenda::init() mPopupTimer = new QTimer(this); connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); - mNewItemPopup = new QPopupMenu( this ); + mNewItemPopup = new Q3PopupMenu( this ); connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); QString pathString = ""; if ( !KOPrefs::instance()->mToolBarMiniIcons ) { @@ -240,18 +251,18 @@ void KOAgenda::init() } else pathString += "iconsmini/"; - mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); mNewItemPopup->insertSeparator ( ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("This month"),6 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"day" ), i18n("Day view"),3 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next week"),4 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"month" ), i18n("This month"),6 ); + mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); #ifndef _WIN32_ - int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase - viewport()->setWFlags ( wflags); + Qt::WindowFlags wflags = viewport()-> windowFlags() |Qt::WRepaintNoErase;//WResizeNoErase + viewport()->setWindowFlags ( wflags); #endif mGridSpacingX = 80; mResizeBorderWidth = 8; @@ -263,7 +274,7 @@ void KOAgenda::init() // Grab key strokes for keyboard navigation of agenda. Seems to have no // effect. Has to be fixed. - setFocusPolicy(WheelFocus); + setFocusPolicy(Qt::WheelFocus); connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); @@ -395,11 +406,11 @@ bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) case (QEvent::Leave): if (!mActionItem) - setCursor(arrowCursor); + setCursor(Qt::arrowCursor); return true; default: - return QScrollView::eventFilter(object,event); + return Q3ScrollView::eventFilter(object,event); } } void KOAgenda::popupMenu() @@ -505,11 +516,11 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) bool objIsNotViewport = (object != viewport()); bool leftButt = false; #ifdef DESKTOP_VERSION - leftButt = (me->button() == LeftButton); + leftButt = (me->button() == Qt::LeftButton); #endif switch (me->type()) { case QEvent::MouseButtonPress: - if (me->button() == LeftButton) { + if (me->button() == Qt::LeftButton) { mPopupTimer->start( 600 ); mLeftMouseDown = true; } @@ -578,10 +589,10 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) if ( objIsNotViewport ) { mPopupItem = (KOAgendaItem *)object; mPopupKind = 1; - if (me->button() == RightButton) { + if (me->button() == Qt::RightButton) { mPopupKind = 3; popupMenu(); - } else if (me->button() == LeftButton) { + } else if (me->button() == Qt::LeftButton) { mActionItem = (KOAgendaItem *)object; if (mActionItem) { emit signalClearSelection(); @@ -600,7 +611,7 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) mPopupKind = 2; selectItem(0); mActionItem = 0; - if (me->button() == RightButton) { + if (me->button() == Qt::RightButton) { int x,y; viewportToContents(viewportPos.x(),viewportPos.y(),x,y); int gx,gy; @@ -611,19 +622,19 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) mStartCellY = gy; mPopupKind = 4; popupMenu(); - } else if (me->button() == LeftButton) { - setCursor(arrowCursor); + } else if (me->button() == Qt::LeftButton) { + setCursor(Qt::arrowCursor); startSelectAction(viewportPos); } } break; case QEvent::MouseButtonRelease: - if (me->button() == LeftButton ) { + if (me->button() == Qt::LeftButton ) { mPopupTimer->stop(); } if (object != viewport()) { - if (me->button() == LeftButton && mLeftMouseDown) { + if (me->button() == Qt::LeftButton && mLeftMouseDown) { if (mActionItem) { QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); @@ -633,7 +644,7 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) mActionItem->resetMove(); placeSubCells( mActionItem ); // emit startDragSignal( mActionItem->incidence() ); - setCursor( arrowCursor ); + setCursor( Qt::arrowCursor ); mActionItem = 0; mActionType = NOP; mItemMoved = 0; @@ -645,11 +656,11 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) } } else { // ---------- viewport() - if (me->button() == LeftButton && mLeftMouseDown ) { //left click + if (me->button() == Qt::LeftButton && mLeftMouseDown ) { //left click endSelectAction( true ); // emit new event signal } } - if (me->button() == LeftButton) + if (me->button() == Qt::LeftButton) mLeftMouseDown = false; break; @@ -850,15 +861,15 @@ void KOAgenda::startItemAction(QPoint viewportPos) if ( allowResize && gridDistanceX < mResizeBorderWidth && mActionItem->cellX() == mCurrentCellX) { mActionType = RESIZELEFT; - setCursor(sizeHorCursor); + setCursor(Qt::sizeHorCursor); } else if ( allowResize && (mGridSpacingX - gridDistanceX) < mResizeBorderWidth && mActionItem->cellXWidth() == mCurrentCellX) { mActionType = RESIZERIGHT; - setCursor(sizeHorCursor); + setCursor(Qt::sizeHorCursor); } else { mActionType = MOVE; mActionItem->startMove(); - setCursor(sizeAllCursor); + setCursor(Qt::sizeAllCursor); } } else { int gridDistanceY = (y - gy * mGridSpacingY); @@ -866,16 +877,16 @@ void KOAgenda::startItemAction(QPoint viewportPos) mActionItem->cellYTop() == mCurrentCellY && !mActionItem->firstMultiItem()) { mActionType = RESIZETOP; - setCursor(sizeVerCursor); + setCursor(Qt::sizeVerCursor); } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && mActionItem->cellYBottom() == mCurrentCellY && !mActionItem->lastMultiItem()) { mActionType = RESIZEBOTTOM; - setCursor(sizeVerCursor); + setCursor(Qt::sizeVerCursor); } else { mActionType = MOVE; mActionItem->startMove(); - setCursor(sizeAllCursor); + setCursor(Qt::sizeAllCursor); } } } @@ -906,7 +917,7 @@ void KOAgenda::performItemAction(QPoint viewportPos) mActionItem->resetMove(); placeSubCells( mActionItem ); // emit startDragSignal( mActionItem->incidence() ); - setCursor( arrowCursor ); + setCursor( Qt::arrowCursor ); mActionItem = 0; mActionType = NOP; mItemMoved = 0; @@ -915,18 +926,18 @@ void KOAgenda::performItemAction(QPoint viewportPos) } else { switch ( mActionType ) { case MOVE: - setCursor( sizeAllCursor ); + setCursor( Qt::sizeAllCursor ); break; case RESIZETOP: case RESIZEBOTTOM: - setCursor( sizeVerCursor ); + setCursor( Qt::sizeVerCursor ); break; case RESIZELEFT: case RESIZERIGHT: - setCursor( sizeHorCursor ); + setCursor( Qt::sizeHorCursor ); break; default: - setCursor( arrowCursor ); + setCursor( Qt::arrowCursor ); } } @@ -971,7 +982,7 @@ void KOAgenda::performItemAction(QPoint viewportPos) int x,y; gridToContents(mCurrentCellX,mActionItem->cellYTop(),x,y); //moveChild(mActionItem,childX(mActionItem),y); - QScrollView::moveChild( mActionItem,childX(mActionItem),y ); + Q3ScrollView::moveChild( mActionItem,childX(mActionItem),y ); } } else if (mActionType == RESIZEBOTTOM) { if (mCurrentCellY >= mActionItem->cellYTop()) { @@ -1019,7 +1030,7 @@ void KOAgenda::endItemAction() type = -1; KOAgendaItem *modifiedItem = placeItem; //emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */); - QPtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems(); + Q3PtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems(); KOAgendaItem *item; if ( placeItem->incidence()->typeID() == todoID ) { @@ -1110,7 +1121,7 @@ void KOAgenda::endItemAction() emit incidenceSelected( mActionItem->incidence() ); mScrollUpTimer.stop(); mScrollDownTimer.stop(); - setCursor( arrowCursor ); + setCursor( Qt::arrowCursor ); mActionItem = 0; mActionType = NOP; mItemMoved = 0; @@ -1136,25 +1147,25 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos) int gridDistanceX = (x - gx * mGridSpacingX); if (gridDistanceX < mResizeBorderWidth && moveItem->cellX() == gx) { - setCursor(sizeHorCursor); + setCursor(Qt::sizeHorCursor); } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && moveItem->cellXWidth() == gx) { - setCursor(sizeHorCursor); + setCursor(Qt::sizeHorCursor); } else { - setCursor(arrowCursor); + setCursor(Qt::arrowCursor); } } else { int gridDistanceY = (y - gy * mGridSpacingY); if (gridDistanceY < mResizeBorderWidth && moveItem->cellYTop() == gy && !moveItem->firstMultiItem()) { - setCursor(sizeVerCursor); + setCursor(Qt::sizeVerCursor); } else if ((mGridSpacingY - gridDistanceY) < mResizeBorderWidth && moveItem->cellYBottom() == gy && !moveItem->lastMultiItem()) { - setCursor(sizeVerCursor); + setCursor(Qt::sizeVerCursor); } else { - setCursor(arrowCursor); + setCursor(Qt::arrowCursor); } } } @@ -1173,9 +1184,9 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos) void KOAgenda::placeSubCells(KOAgendaItem *placeItem) { - QPtrList<KOAgendaItem> conflictItems; + Q3PtrList<KOAgendaItem> conflictItems; int maxSubCells = 0; - QIntDict<KOAgendaItem> subCellDict(7); + Q3IntDict<KOAgendaItem> subCellDict(7); KOAgendaItem *item; for ( item=mItems.first(); item != 0; item=mItems.next() ) { @@ -1240,7 +1251,7 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) item=conflictItems.next() ) { if ( placeItem != item ) { KOAgendaItem *item2; - QPtrList<KOAgendaItem> conflictItems2 = item->conflictItems(); + Q3PtrList<KOAgendaItem> conflictItems2 = item->conflictItems(); for ( item2=conflictItems2.first(); item2 != 0; item2=conflictItems2.next() ) { if ( item2->subCells() != maxSubCells) { @@ -1325,9 +1336,9 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) if ( vySel < 0 ) off += vySel; //qDebug("OFF %d %d %d", off,vySel, vy ); - bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP); + bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,QPainter::CompositionMode_Source); } else { - bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); + bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source); } } if ( mSelectionHeight > 0 ) { @@ -1342,7 +1353,7 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) int p_hei = 5; if ( hei < 5 ) p_hei = hei; hei -= 5; - bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP); + bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source); offset += 5; } } @@ -1365,7 +1376,7 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) contentsToViewport ( cx, cy, vx,vy); // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) - bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); + bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source); if ( mSelectionHeight > 0 ) { //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); @@ -1379,7 +1390,7 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) int p_hei = 5; if ( hei < 5 ) p_hei = hei; hei -= 5; - bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP); + bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source); offset += 5; } } @@ -1576,14 +1587,14 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i int y = ((int)(cy/lGridSpacingY))*lGridSpacingY; if ( lGridSpacingY > 0 ) { while (y < cy + ch) { - p->setPen( SolidLine ); + p->setPen( Qt::SolidLine ); p->drawLine(cx,y,cx+cw,y); y+=lGridSpacingY; - p->setPen( DotLine ); + p->setPen( Qt::DotLine ); p->drawLine(cx,y,cx+cw,y); y+=lGridSpacingY; } - p->setPen( SolidLine ); + p->setPen( Qt::SolidLine ); } mPixPainter.end() ; } @@ -1717,7 +1728,7 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) item->select(false); mUnusedItems.append( item ); mItems.remove( item ); - QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); + Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); KOAgendaItem *itemit; //globalFlagBlockAgendaItemPaint = 1; for ( itemit=oldconflictItems.first(); itemit != 0; @@ -1747,7 +1758,7 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) return; //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); QDate currentDate = QDate::currentDate(); - bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); + bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); QDateTime dt; if ( todo->hasCompletedDate() ) dt = todo->completed(); @@ -1779,7 +1790,7 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) } qApp->processEvents(); globalFlagBlockAgendaItemPaint = 0; - QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); + Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); KOAgendaItem *itemit; for ( itemit=oldconflictItems.first(); itemit != 0; itemit=oldconflictItems.next() ) { @@ -1867,7 +1878,7 @@ void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, int width = XEnd - XBegin + 1; int count = 0; KOAgendaItem *current = 0; - QPtrList<KOAgendaItem> multiItems; + Q3PtrList<KOAgendaItem> multiItems; for (cellX = XBegin;cellX <= XEnd;++cellX) { if (cellX == XBegin) cellYTop = YTop; else cellYTop = 0; @@ -1927,7 +1938,7 @@ void KOAgenda::resizeEvent ( QResizeEvent *ev ) mSelectionHeight = 0; mResizeTimer.start( 150 , true ); computeSizes(); - QScrollView::resizeEvent( ev ); + Q3ScrollView::resizeEvent( ev ); return; } @@ -2016,7 +2027,7 @@ void KOAgenda::popupAlarm() } // TODO: deal correctly with multiple alarms Alarm* alarm; - QPtrList<Alarm> list(mClickedItem->incidence()->alarms()); + Q3PtrList<Alarm> list(mClickedItem->incidence()->alarms()); for(alarm=list.first();alarm;alarm=list.next()) { alarm->toggleAlarm(); } @@ -2107,16 +2118,16 @@ void KOAgenda::selectItem(KOAgendaItem *item) void KOAgenda::keyPressEvent( QKeyEvent *kev ) { switch(kev->key()) { - case Key_PageDown: + case Qt::Key_PageDown: verticalScrollBar()->addPage(); break; - case Key_PageUp: + case Qt::Key_PageUp: verticalScrollBar()->subtractPage(); break; - case Key_Down: + case Qt::Key_Down: verticalScrollBar()->addLine(); break; - case Key_Up: + case Qt::Key_Up: verticalScrollBar()->subtractLine(); break; default: @@ -2146,7 +2157,7 @@ void KOAgenda::setDateList(const DateList &selectedDates) mSelectedDates = selectedDates; } -void KOAgenda::setHolidayMask(QMemArray<bool> *mask) +void KOAgenda::setHolidayMask(Q3MemArray<bool> *mask) { mHolidayMask = mask; @@ -2162,7 +2173,7 @@ void KOAgenda::setHolidayMask(QMemArray<bool> *mask) void KOAgenda::contentsMousePressEvent ( QMouseEvent *event ) { - QScrollView::contentsMousePressEvent(event); + Q3ScrollView::contentsMousePressEvent(event); } void KOAgenda::storePosition() @@ -2196,13 +2207,13 @@ void KOAgenda::restorePosition() void KOAgenda::moveChild( QWidget *w, int x , int y ) { ++x; - QScrollView::moveChild( w, x , y ); + Q3ScrollView::moveChild( w, x , y ); } #include <qmessagebox.h> #ifdef DESKTOP_VERSION #include <qprinter.h> #include <qpainter.h> -#include <qpaintdevicemetrics.h> +#include <q3paintdevicemetrics.h> #endif void KOAgenda::printSelection() @@ -2231,7 +2242,7 @@ void KOAgenda::printSelection() return; } QPainter p( printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( printer ); QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() ); //date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true ); int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height(); diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h index 380ce62..0708341 100644 --- a/korganizer/koagenda.h +++ b/korganizer/koagenda.h @@ -23,27 +23,36 @@ #ifndef KOAGENDA_H #define KOAGENDA_H -#include <qscrollview.h> +#include <q3scrollview.h> #include <qtimer.h> -#include <qmemarray.h> +#include <q3memarray.h> #include <qpainter.h> #include <qpixmap.h> -#include <qguardedptr.h> +#include <qpointer.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <Q3Frame> +#include <QLabel> +#include <QMouseEvent> +#include <Q3PtrList> +#include <Q3PopupMenu> +#include <QKeyEvent> +#include <QEvent> #include "koagendaitem.h" #include "koeventview.h" -class QPopupMenu; +class Q3PopupMenu; class QTime; class KConfig; -class QFrame; +class Q3Frame; class KOAgenda; class KCal::Event; class KCal::Todo; using namespace KCal; -class MarcusBains : public QFrame { +class MarcusBains : public Q3Frame { Q_OBJECT public: MarcusBains(KOAgenda *agenda=0,const char *name=0); @@ -63,7 +72,7 @@ class MarcusBains : public QFrame { }; -class KOAgenda : public QScrollView +class KOAgenda : public Q3ScrollView { Q_OBJECT public: @@ -71,9 +80,9 @@ class KOAgenda : public QScrollView RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, - const char * name=0, WFlags f=0 ); + const char * name=0, Qt::WFlags f=0 ); KOAgenda ( int columns, QWidget * parent=0, - const char * name=0, WFlags f=0 ); + const char * name=0, Qt::WFlags f=0 ); virtual ~KOAgenda(); bool mInvalidPixmap; @@ -117,7 +126,7 @@ class KOAgenda : public QScrollView void checkScrollBoundaries(); - void setHolidayMask(QMemArray<bool> *); + void setHolidayMask(Q3MemArray<bool> *); void setDateList(const DateList &selectedDates); DateList dateList() const; void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); @@ -277,10 +286,10 @@ class KOAgenda : public QScrollView KOAgendaItem *mClickedItem; // The KOAgendaItem, which is being moved/resized - QGuardedPtr<KOAgendaItem> mActionItem; + QPointer<KOAgendaItem> mActionItem; // Currently selected item - QGuardedPtr<KOAgendaItem> mSelectedItem; + QPointer<KOAgendaItem> mSelectedItem; // The Marcus Bains Line widget. MarcusBains *mMarcusBains; @@ -291,16 +300,16 @@ class KOAgenda : public QScrollView bool mItemMoved; // List of all Items contained in agenda - QPtrList<KOAgendaItem> mItems; - QPtrList<KOAgendaItem> mUnusedItems; + Q3PtrList<KOAgendaItem> mItems; + Q3PtrList<KOAgendaItem> mUnusedItems; KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport); - QPopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems - QPopupMenu *mNewItemPopup; + Q3PopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems + Q3PopupMenu *mNewItemPopup; int mOldLowerScrollValue; int mOldUpperScrollValue; KOAgendaItem * getItemForTodo ( Todo * todo ); - QMemArray<bool> *mHolidayMask; + Q3MemArray<bool> *mHolidayMask; int mCurPixWid; int mCurPixHei; }; diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 407424d..0f9a38f 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -19,13 +19,23 @@ #include <qlabel.h> #include <qlayout.h> -#include <qhbox.h> -#include <qvbox.h> +#include <q3hbox.h> +#include <q3vbox.h> #include <qtooltip.h> -#include <qwhatsthis.h> -#include <qdragobject.h> +#include <q3whatsthis.h> +#include <q3dragobject.h> #include <qdrawutil.h> #include <qpainter.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3PtrList> +#include <QPixmap> +#include <QDragEnterEvent> +#include <QDropEvent> +#include <QResizeEvent> +#include <QMouseEvent> +#include <QEvent> +#include <QPaintEvent> #include <kiconloader.h> #include <kdebug.h> @@ -57,10 +67,10 @@ QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; //-------------------------------------------------------------------------- -class KOAgendaItemWhatsThis :public QWhatsThis +class KOAgendaItemWhatsThis :public Q3WhatsThis { public: - KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; + KOAgendaItemWhatsThis( KOAgendaItem* view ) : Q3WhatsThis( view ),_view (view) { }; protected: virtual QString text( const QPoint& ) @@ -72,15 +82,15 @@ private: }; KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, - const char *name,WFlags) : + const char *name,Qt::WFlags) : QWidget(parent, name), mIncidence(incidence), mDate(qd) { #ifndef DESKTOP_VERSION //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); #endif mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this); - int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase - setWFlags ( wflags); + Qt::WindowFlags wflags = windowFlags() |Qt::WRepaintNoErase;// WResizeNoErase + setWindowFlags ( wflags); mAllDay = allday; init ( incidence, qd ); //setMouseTracking(true); @@ -103,7 +113,7 @@ void KOAgendaItem::initColor () if ( (mIncidence->typeID() == todoID ) && ( !((static_cast<Todo*>(mIncidence))->isCompleted()) && ((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) { - if ( (static_cast<Todo*>(mIncidence))->dtDue() < QDateTime::currentDateTime().date()) + if ( (static_cast<Todo*>(mIncidence))->dtDue() < (QDateTime)QDateTime::currentDateTime().date()) mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; else mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; @@ -132,7 +142,7 @@ void KOAgendaItem::initColor () } mColorGroup = QColorGroup( BackgroundColor.light(), BackgroundColor.dark(),BackgroundColor.light(), - BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; + BackgroundColor.dark(),BackgroundColor, Qt::black, BackgroundColor) ; setBackgroundColor( mBackgroundColor ); mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); } @@ -228,28 +238,28 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) ++yOff; } if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::red ); if ( horLayout ) ++xOff; else ++yOff; } if (mIncidence->doesRecur()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::blue ); if ( horLayout ) ++xOff; else ++yOff; } if (mIncidence->description().length() > 0) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkGreen ); if ( horLayout ) ++xOff; else ++yOff; } if (mIncidence->isReadOnly()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::white ); if ( horLayout ) ++xOff; else @@ -259,7 +269,7 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) if (mIncidence->attendeeCount()>0) { if (mIncidence->organizer() == KOPrefs::instance()->email()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::black ); if ( horLayout ) ++xOff; else @@ -270,14 +280,14 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) } else { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::yellow ); if ( horLayout ) ++xOff; else ++yOff; } - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkYellow ); if ( horLayout ) ++xOff; else @@ -420,9 +430,9 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) } int align; #ifndef DESKTOP_VERSION - align = ( AlignLeft|WordBreak|AlignTop); + align = ( Qt::AlignLeft|Qt::TextWordWrap|Qt::AlignTop); #else - align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); + align = ( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); #endif if ( addIcon ) { if ( ! horLayout ) { @@ -435,7 +445,7 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) } } if ( mWhiteText ) - paint->setPen ( white); + paint->setPen ( Qt::white); if ( x < 0 ) { w = w+x-3; x = 3; @@ -444,9 +454,9 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) if ( w > parentWidget()->width() ){ w = parentWidget()->width() - 6; #ifndef DESKTOP_VERSION - align = ( AlignHCenter|WordBreak|AlignTop); + align = ( Qt::AlignHCenter|Qt::TextWordWrap|Qt::AlignTop); #else - align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); + align = ( Qt::AlignHCenter|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); #endif } @@ -561,7 +571,7 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) } } //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); - bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); + bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,QPainter::CompositionMode_Source); } void KOAgendaItem::computeText() { @@ -628,7 +638,7 @@ void KOAgendaItem::computeText() if (!mIncidence->location().isEmpty()) { tipText += "\n"+i18n("Location: ")+mIncidence->location(); } - QToolTip::add(this,tipText,toolTipGroup(),""); + QToolTip::add(this,tipText /*TODO:hacker: ,toolTipGroup(),"" */); #endif } void KOAgendaItem::updateItem() @@ -795,7 +805,7 @@ void KOAgendaItem::expandRight(int dx) QToolTipGroup *KOAgendaItem::toolTipGroup() { - if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); + /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */ return mToolTipGroup; } @@ -803,7 +813,7 @@ void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) { #ifndef KORG_NODND if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || - !QTextDrag::canDecode( e ) ) { + !Q3TextDrag::canDecode( e ) ) { e->ignore(); return; } @@ -815,7 +825,7 @@ void KOAgendaItem::dropEvent( QDropEvent *e ) { #ifndef KORG_NODND QString text; - if(QTextDrag::decode(e,text)) + if(Q3TextDrag::decode(e,text)) { kdDebug() << "Dropped : " << text << endl; QStringList emails = QStringList::split(",",text); @@ -833,12 +843,12 @@ void KOAgendaItem::dropEvent( QDropEvent *e ) } -QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() +Q3PtrList<KOAgendaItem> KOAgendaItem::conflictItems() { return mConflictItems; } -void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci) +void KOAgendaItem::setConflictItems(Q3PtrList<KOAgendaItem> ci) { mConflictItems = ci; KOAgendaItem *item; diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index 27ee720..17cf975 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h @@ -19,11 +19,18 @@ #ifndef KOAGENDAITEM_H #define KOAGENDAITEM_H -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> #include <qpixmap.h> #include <qdatetime.h> #include <qpalette.h> +//Added by qt3to4: +#include <QDropEvent> +#include <QPaintEvent> +#include <QResizeEvent> +#include <Q3PtrList> +#include <QEvent> +#include <QDragEnterEvent> #include <libkcal/incidence.h> @@ -45,7 +52,7 @@ class KOAgendaItem : public QWidget Q_OBJECT public: KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0, - WFlags f=0 ); + Qt::WFlags f=0 ); ~KOAgendaItem(); QString getWhatsThisText(); void init ( Incidence *incidence, QDate qd ); @@ -96,8 +103,8 @@ class KOAgendaItem : public QWidget static QToolTipGroup *toolTipGroup(); - QPtrList<KOAgendaItem> conflictItems(); - void setConflictItems(QPtrList<KOAgendaItem>); + Q3PtrList<KOAgendaItem> conflictItems(); + void setConflictItems(Q3PtrList<KOAgendaItem>); void addConflictItem(KOAgendaItem *ci); void paintMe( bool, QPainter* painter = 0 ); void repaintMe(); @@ -161,7 +168,7 @@ class KOAgendaItem : public QWidget QColorGroup mColorGroup; QString mDisplayedText; bool mSelected; - QPtrList<KOAgendaItem> mConflictItems; + Q3PtrList<KOAgendaItem> mConflictItems; }; #endif // KOAGENDAITEM_H diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 6e65a03..87993ae 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -21,21 +21,33 @@ without including the source code for Qt in the source distribution. */ -#include <qhbox.h> -#include <qvbox.h> +#include <q3hbox.h> +#include <q3vbox.h> #include <qlabel.h> -#include <qframe.h> +#include <q3frame.h> #include <qlayout.h> #ifndef KORG_NOSPLITTER #include <qsplitter.h> #endif #include <qfont.h> #include <qfontmetrics.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qtooltip.h> #include <qpainter.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QResizeEvent> +#include <QPixmap> +#include <QMouseEvent> +#include <Q3GridLayout> +#include <Q3ValueList> +#include <QKeyEvent> +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> +#include <QPaintEvent> +#include <Q3PtrList> #include <kapplication.h> #include <KDGanttMinimizeSplitter.h> @@ -78,8 +90,8 @@ using namespace KOrg; #define IDLETIMEOUT 45 -TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : - QScrollView(parent,name,f) +TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,Qt::WFlags f) : + Q3ScrollView(parent,name,f) { myPix.resize( 1, 1 ); mRows = rows; @@ -95,7 +107,7 @@ TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : resizeContents(50,mRows * mCellHeight); - viewport()->setBackgroundMode( PaletteBackground ); + viewport()->setBackgroundMode( Qt::PaletteBackground ); } void TimeLabels::setCellHeight(int height) @@ -283,7 +295,7 @@ void TimeLabels::paintEvent(QPaintEvent*) //////////////////////////////////////////////////////////////////////////// EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) - : QFrame(parent,name) + : Q3Frame(parent,name) { mColumns = 1; mTopBox = 0; @@ -393,7 +405,7 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : expandPix = SmallIcon("1leftrightarrow" ); } - QBoxLayout *topLayout = new QVBoxLayout(this); + Q3BoxLayout *topLayout = new Q3VBoxLayout(this); // Create day name labels for agenda columns // Create agenda splitter @@ -401,13 +413,13 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); topLayout->addWidget( mSplitterAgenda ); - mAllDayFrame = new QHBox(mSplitterAgenda); - mAllDayFrame->setFocusPolicy(NoFocus); + mAllDayFrame = new Q3HBox(mSplitterAgenda); + mAllDayFrame->setFocusPolicy(Qt::NoFocus); QWidget *agendaFrame = new QWidget(mSplitterAgenda); - agendaFrame->setFocusPolicy(NoFocus); + agendaFrame->setFocusPolicy(Qt::NoFocus); // Create all-day agenda widget - mDummyAllDayLeft = new QVBox( mAllDayFrame ); + mDummyAllDayLeft = new Q3VBox( mAllDayFrame ); mExpandButton = new QPushButton(mDummyAllDayLeft); mExpandButton->setPixmap( expandPix ); @@ -420,16 +432,16 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : // QSizePolicy::Fixed ) ); mExpandButton->setFixedSize( widebut, widebut); connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); - mExpandButton->setFocusPolicy(NoFocus); + mExpandButton->setFocusPolicy(Qt::NoFocus); mAllDayAgenda = new KOAgenda(1,mAllDayFrame); - mAllDayAgenda->setFocusPolicy(NoFocus); + mAllDayAgenda->setFocusPolicy(Qt::NoFocus); QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); // Create event context menu for all day agenda //mAllDayAgendaPopup = eventPopup(); // Create agenda frame - QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); + Q3GridLayout *agendaLayout = new Q3GridLayout(agendaFrame,4,3); // QHBox *agendaFrame = new QHBox(splitterAgenda); // create event indicator bars @@ -437,10 +449,10 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : #ifndef DESKTOP_VERSION mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); #endif - mDayLabelsFrame = new QHBox(agendaFrame); + mDayLabelsFrame = new Q3HBox(agendaFrame); //topLayout->addWidget(mDayLabelsFrame); - mDayLabels = new QFrame (mDayLabelsFrame); - mLayoutDayLabels = new QHBoxLayout(mDayLabels); + mDayLabels = new Q3Frame (mDayLabelsFrame); + mLayoutDayLabels = new Q3HBoxLayout(mDayLabels); agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); agendaLayout->addWidget(mEventIndicatorTop,1,1); @@ -460,12 +472,12 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); agendaLayout->setColStretch(1,1); - mAgenda->setFocusPolicy(NoFocus); + mAgenda->setFocusPolicy(Qt::NoFocus); // Create event context menu for agenda mAllAgendaPopup = eventPopup(); #if 0 - mAllAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), + mAllAgendaPopup->addAdditionalItem(QIcon(SmallIcon("bell")), i18n("Toggle Alarm"),mAgenda, SLOT(popupAlarm()),true); @@ -918,9 +930,9 @@ int KOAgendaView::currentDateCount() return mSelectedDates.count(); } -QPtrList<Incidence> KOAgendaView::selectedIncidences() +Q3PtrList<Incidence> KOAgendaView::selectedIncidences() { - QPtrList<Incidence> selected; + Q3PtrList<Incidence> selected; Incidence *incidence; incidence = mAgenda->selectedIncidence(); @@ -987,8 +999,8 @@ void KOAgendaView::updateConfig() mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); // ToolTips displaying summary of events - KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() - ->mEnableToolTips); + /* TODO:hacker: KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() + ->mEnableToolTips); */ //setHolidayMasks(); @@ -1117,7 +1129,7 @@ void KOAgendaView::showDates( const QDate &start, const QDate &end ) } -void KOAgendaView::showEvents(QPtrList<Event>) +void KOAgendaView::showEvents(Q3PtrList<Event>) { kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; } @@ -1165,11 +1177,11 @@ void KOAgendaView::fillAgenda() mMinY.resize(mSelectedDates.count()); mMaxY.resize(mSelectedDates.count()); - QPtrList<Event> dayEvents; + Q3PtrList<Event> dayEvents; // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. // Therefore, gtodoset all of them. - QPtrList<Todo> todos = calendar()->todos(); + Q3PtrList<Todo> todos = calendar()->todos(); mAgenda->setDateList(mSelectedDates); @@ -1300,7 +1312,7 @@ void KOAgendaView::fillAgenda() // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. // Already completed items can be displayed on their original due date //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda - bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; + bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)today) && KOPrefs::instance()->mShowTodoInAgenda; bool fillIn = false; if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) fillIn = true; @@ -1503,7 +1515,7 @@ void KOAgendaView::readSettings(KConfig *config) config->setGroup("Views"); //#ifndef KORG_NOSPLITTER - QValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); + Q3ValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); if (sizes.count() == 2) { if ( sizes[0] < 20 ) { sizes[1] = sizes[1] +20 - sizes[0]; @@ -1524,7 +1536,7 @@ void KOAgendaView::writeSettings(KConfig *config) config->setGroup("Views"); //#ifndef KORG_NOSPLITTER - QValueList<int> list = mSplitterAgenda->sizes(); + Q3ValueList<int> list = mSplitterAgenda->sizes(); config->writeEntry("Separator AgendaView",list); //qDebug("write %d %d ", list[0],list[1] ); //#endif @@ -1541,7 +1553,7 @@ void KOAgendaView::setHolidayMasks() bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); bool showHoliday = false; if ( KOPrefs::instance()->mExcludeHolidays ) { - QPtrList<Event> events = calendar()->events( date, true ); + Q3PtrList<Event> events = calendar()->events( date, true ); Event *event; for( event = events.first(); event; event = events.next() ) { if ( event->isHoliday()) { @@ -1663,7 +1675,7 @@ void KOAgendaView::updateTodo( Todo * t, int ) removeAD = true; } else { - bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; + bool overdue = (!t->isCompleted()) && (t->dtDue() < (QDateTime)QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; if ( overdue && QDate::currentDate() >= mSelectedDates.first() && QDate::currentDate() <= mSelectedDates.last()) { diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 5e68146..3b871d9 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h @@ -23,21 +23,31 @@ #ifndef KOAGENDAVIEW_H #define KOAGENDAVIEW_H -#include <qscrollview.h> +#include <q3scrollview.h> #include <qdatetime.h> #include <qpushbutton.h> #include <qlayout.h> +#include <Q3BoxLayout> #ifndef DESKTOP_VERSION #include <qksplitter.h> #else #include <qsplitter.h> #endif -#include <qmemarray.h> +#include <q3memarray.h> +//Added by qt3to4: +#include <QPaintEvent> +#include <QResizeEvent> +#include <Q3Frame> +#include <QPixmap> +#include <QLabel> +#include <QMouseEvent> +#include <Q3PtrList> +#include <QKeyEvent> #include "koeventview.h" -class QHBox; -class QFrame; +class Q3HBox; +class Q3Frame; class QLabel; class QPushButton; class CalendarView; @@ -55,7 +65,7 @@ class KOAgendaButton : public QPushButton { mNum = -3; setFlat( true ); - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); connect( this, SIGNAL( clicked() ), this, SLOT ( bClicked() ) ); }; @@ -70,10 +80,10 @@ private: int mNum; }; -class TimeLabels : public QScrollView { +class TimeLabels : public Q3ScrollView { Q_OBJECT public: - TimeLabels(int rows,QWidget *parent=0,const char *name=0,WFlags f=0); + TimeLabels(int rows,QWidget *parent=0,const char *name=0,Qt::WFlags f=0); void setCellHeight(int height); @@ -113,7 +123,7 @@ class TimeLabels : public QScrollView { KOAgenda* mAgenda; }; -class EventIndicator : public QFrame { +class EventIndicator : public Q3Frame { Q_OBJECT public: enum Location { Top, Bottom }; @@ -132,11 +142,11 @@ class EventIndicator : public QFrame { int mXOffset; KDGanttMinimizeSplitter* mPaintWidget; int mColumns; - QHBox *mTopBox; - QBoxLayout *mTopLayout; + Q3HBox *mTopBox; + Q3BoxLayout *mTopLayout; Location mLocation; QPixmap mPixmap; - QMemArray<bool> mEnabled; + Q3MemArray<bool> mEnabled; }; /** @@ -159,7 +169,7 @@ class KOAgendaView : public KOEventView { virtual int currentDateCount(); /** returns the currently selected events */ - virtual QPtrList<Incidence> selectedIncidences(); + virtual Q3PtrList<Incidence> selectedIncidences(); /** returns the currently selected events */ virtual DateList selectedDates(); @@ -185,7 +195,7 @@ class KOAgendaView : public KOEventView { virtual void updateView(); virtual void updateConfig(); virtual void showDates(const QDate &start, const QDate &end); - virtual void showEvents(QPtrList<Event> eventList); + virtual void showEvents(Q3PtrList<Event> eventList); void updateTodo( Todo *, int ); void changeEventDisplay(Event *, int); @@ -260,10 +270,10 @@ class KOAgendaView : public KOEventView { QTimer* mIdleTimer; QDateTime mIdleStart; // view widgets - QFrame *mDayLabels; - QHBox *mDayLabelsFrame; - QBoxLayout *mLayoutDayLabels; - QFrame *mAllDayFrame; + Q3Frame *mDayLabels; + Q3HBox *mDayLabelsFrame; + Q3BoxLayout *mLayoutDayLabels; + Q3Frame *mAllDayFrame; KOAgenda *mAllDayAgenda; KOAgenda *mAgenda; TimeLabels *mTimeLabels; @@ -284,12 +294,12 @@ class KOAgendaView : public KOEventView { EventIndicator *mEventIndicatorTop; EventIndicator *mEventIndicatorBottom; - QMemArray<int> mMinY; - QMemArray<int> mMaxY; + Q3MemArray<int> mMinY; + Q3MemArray<int> mMaxY; - QMemArray<bool> mHolidayMask; + Q3MemArray<bool> mHolidayMask; - QPtrList<KOAgendaButton> mDayLabelsList; + Q3PtrList<KOAgendaButton> mDayLabelsList; QDateTime mTimeSpanBegin; QDateTime mTimeSpanEnd; bool mTimeSpanInAllDay; diff --git a/korganizer/kocounterdialog.h b/korganizer/kocounterdialog.h index c8dcf45..493d9e1 100644 --- a/korganizer/kocounterdialog.h +++ b/korganizer/kocounterdialog.h @@ -22,7 +22,7 @@ // Viewer dialog for counter events. // -#include <qtextview.h> +#include <q3textview.h> #include <kdialogbase.h> diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 52fd1e8..4f681b3 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -24,9 +24,18 @@ #include <qevent.h> #include <qpainter.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qtimer.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <QDragLeaveEvent> +#include <Q3Frame> +#include <QDragEnterEvent> +#include <QDragMoveEvent> +#include <QDropEvent> +#include <QResizeEvent> +#include <QMouseEvent> +#include <QPaintEvent> #include <kglobal.h> #include <kdebug.h> @@ -54,15 +63,15 @@ // ============================================================================ DynamicTip::DynamicTip( QWidget * parent ) - : QToolTip( parent ) + /* TODO:hacker: : QToolTip( parent ) */ { matrix = (KODayMatrix*)parent; } -class KODaymatrixWhatsThis :public QWhatsThis +class KODaymatrixWhatsThis :public Q3WhatsThis { public: - KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;}; + KODaymatrixWhatsThis( KODayMatrix* view ) : Q3WhatsThis( view ),_view (view) { ;}; ~KODaymatrixWhatsThis() { ; }; protected: @@ -91,7 +100,7 @@ void DynamicTip::maybeTip( const QPoint &pos ) //show holiday names only QString str = matrix->getHolidayLabel(col+row*7); if (str.isEmpty()) return; - tip(rct, str); + /* TODO:hacker: tip(rct, str);*/ } @@ -103,7 +112,7 @@ const int KODayMatrix::NOSELECTION = -1000; const int KODayMatrix::NUMDAYS = 42; KODayMatrix::KODayMatrix( QWidget *parent, const char *name ) - : QFrame( parent, name , Qt::WRepaintNoErase ), mCalendar( 0 ) + : Q3Frame( parent, name , Qt::WNoAutoErase ), mCalendar( 0 ) { @@ -151,7 +160,7 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar ) return QString(); QDate mDate = days[tmp]; - QPtrList<Event> eventlist = mCalendar->events(mDate); + Q3PtrList<Event> eventlist = mCalendar->events(mDate); Event *event; QStringList mToolTip; for(event=eventlist.first();event != 0;event=eventlist.next()) { @@ -205,7 +214,7 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) } mToolTip.sort(); if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { - QPtrList<Todo> todolist = mCalendar->todos(mDate); + Q3PtrList<Todo> todolist = mCalendar->todos(mDate); Todo *todo; for(todo=todolist.first();todo != 0;todo=todolist.next()) { QString mToolTipText; @@ -220,7 +229,7 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) } } if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { - QPtrList<Journal> j_list = mCalendar->journals4Date( mDate ); + Q3PtrList<Journal> j_list = mCalendar->journals4Date( mDate ); Journal *j = j_list.first(); while ( j ) { QString mToolTipText; @@ -441,7 +450,7 @@ void KODayMatrix::updateViewTimed() int i; int timeSpan = NUMDAYS-1; - QPtrList<Event> events = mCalendar->events(); + Q3PtrList<Event> events = mCalendar->events(); Event *event; QDateTime dt; bool ok; @@ -526,7 +535,7 @@ void KODayMatrix::updateViewTimed() if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { bDays.fill( false); // insert due todos - QPtrList<Todo> todos = mCalendar->todos( ); + Q3PtrList<Todo> todos = mCalendar->todos( ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { //insertTodo( todo ); @@ -551,7 +560,7 @@ void KODayMatrix::updateViewTimed() if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { bDays.fill( false); // insert due todos - QPtrList<Journal> todos = mCalendar->journals( ); + Q3PtrList<Journal> todos = mCalendar->journals( ); Journal *todo; for(todo = todos.first(); todo; todo = todos.next()) { int day = mStartDate.daysTo( todo->dtStart().date() ); @@ -575,7 +584,7 @@ void KODayMatrix::updateViewTimed() //qDebug("KODayMatrix::updateViewTimed "); for(int i = 0; i < NUMDAYS; i++) { // if events are set for the day then remember to draw it bold - QPtrList<Event> eventlist = mCalendar->events(days[i]); + Q3PtrList<Event> eventlist = mCalendar->events(days[i]); Event *event; int numEvents = eventlist.count(); QString holiStr = ""; @@ -675,7 +684,7 @@ void KODayMatrix::updateEvents() for( int i = 0; i < NUMDAYS; i++ ) { // if events are set for the day then remember to draw it bold - QPtrList<Event> eventlist = mCalendar->events( days[ i ] ); + Q3PtrList<Event> eventlist = mCalendar->events( days[ i ] ); int numEvents = eventlist.count(); Event *event; for( event = eventlist.first(); event != 0;event=eventlist.next()) { @@ -739,7 +748,7 @@ int KODayMatrix::getDayIndexFrom(int x, int y) void KODayMatrix::mousePressEvent (QMouseEvent* e) { - if ( e->button() == LeftButton ) + if ( e->button() == Qt::LeftButton ) mouseDown = true; mSelStart = getDayIndexFrom(e->x(), e->y()); if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1; @@ -752,7 +761,7 @@ void KODayMatrix::mousePressEvent (QMouseEvent* e) void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) { mRedrawNeeded = true; - if ( e->button() == LeftButton ) + if ( e->button() == Qt::LeftButton ) if ( ! mouseDown ) { return; } @@ -1195,7 +1204,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) //qDebug("NO redraw "); } - bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,CopyROP); + bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,QPainter::CompositionMode_Source); mRedrawNeeded = false; } @@ -1208,7 +1217,7 @@ void KODayMatrix::resizeEvent(QResizeEvent * e) QRect sz = frameRect(); daysize.setHeight(sz.height()*7 / NUMDAYS); daysize.setWidth(sz.width() / 7); - QFrame::resizeEvent( e ); + Q3Frame::resizeEvent( e ); } QSize KODayMatrix::sizeHint() const diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index b96e08f..6edf7cd 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h @@ -26,7 +26,7 @@ #include <libkcal/calendar.h> #include <qstring.h> -#include <qframe.h> +#include <q3frame.h> #include <qcolor.h> #include <qpen.h> #include <qdatetime.h> @@ -34,6 +34,14 @@ #include <qpixmap.h> #include <qbitarray.h> #include <qmap.h> +//Added by qt3to4: +#include <QDragMoveEvent> +#include <QDropEvent> +#include <QDragLeaveEvent> +#include <QPaintEvent> +#include <QResizeEvent> +#include <QMouseEvent> +#include <QDragEnterEvent> class QDragEnterEvent; class QDragMoveEvent; @@ -51,7 +59,7 @@ using namespace KCal; * This class asks the day matrix object for a appropriate label which * is in our special case the name of the holiday or null if this day is no holiday. */ -class DynamicTip : public QToolTip +class DynamicTip /* TODO:hacker: : public QToolTip */ { public: @@ -103,7 +111,7 @@ private: * * @author Eitzenberger Thomas */ -class KODayMatrix: public QFrame { +class KODayMatrix: public Q3Frame { Q_OBJECT diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index ea30fac..deb1e46 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp @@ -41,6 +41,8 @@ #include "kconfig.h" #include "kodialogmanager.h" #include <kapplication.h> +//Added by qt3to4: +#include <Q3PtrList> KODialogManager::KODialogManager( CalendarView *mainView ) : QObject(), mMainView( mainView ) @@ -188,8 +190,8 @@ void KODialogManager::showSearchDialog() mMainView, SLOT(beamIncidence(Incidence *))); connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), mMainView, SLOT(moveIncidence(Incidence *))); - connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), - mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); + connect(lview, SIGNAL(beamIncidenceList(Q3PtrList<Incidence> )), + mMainView, SLOT(beamIncidenceList(Q3PtrList<Incidence> ))); connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); @@ -246,7 +248,7 @@ void KODialogManager::showArchiveDialog() #endif } -void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) +void KODialogManager::showFilterEditDialog(Q3PtrList<CalFilter> *filters) { if (!mFilterEditDialog) { mFilterEditDialog = new FilterEditDialog(filters,mMainView); diff --git a/korganizer/kodialogmanager.h b/korganizer/kodialogmanager.h index b68ddc2..00ad1df 100644 --- a/korganizer/kodialogmanager.h +++ b/korganizer/kodialogmanager.h @@ -25,7 +25,7 @@ #define KODIALOGMANAGER_H #include <qobject.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <libkcal/calfilter.h> @@ -78,7 +78,7 @@ class KODialogManager : public QObject // void showCategoryEditDialog(); void showSearchDialog(); void showArchiveDialog(); - void showFilterEditDialog(QPtrList<CalFilter> *filters); + void showFilterEditDialog(Q3PtrList<CalFilter> *filters); void showPluginDialog(); void hideSearchDialog(); diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp index 9a4b4ec..a01c838 100644 --- a/korganizer/koeditordetails.cpp +++ b/korganizer/koeditordetails.cpp @@ -22,14 +22,20 @@ */ #include <qtooltip.h> -#include <qfiledialog.h> +#include <q3filedialog.h> #include <qlayout.h> -#include <qvbox.h> -#include <qbuttongroup.h> -#include <qvgroupbox.h> -#include <qwidgetstack.h> +#include <q3vbox.h> +#include <q3buttongroup.h> +#include <q3vgroupbox.h> +#include <q3widgetstack.h> #include <qdatetime.h> -#include <qapp.h> +#include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3GridLayout> +#include <QLabel> +#include <Q3PtrList> +#include <Q3VBoxLayout> #include <klocale.h> #include <kglobal.h> @@ -80,7 +86,7 @@ void CustomListViewItem<Attendee *>::updateItem() KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) : QWidget( parent, name), mDisableItemUpdate( false ) { - QGridLayout *topLayout = new QGridLayout(this); + Q3GridLayout *topLayout = new Q3GridLayout(this); topLayout->setSpacing(spacing); topLayout->setMargin(KDialog::marginHint()-2); @@ -101,11 +107,11 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) } mListView->setAllColumnsShowFocus (true ); //mListView->setSingleClick( true ); - connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), + connect(mListView,SIGNAL(selectionChanged(Q3ListViewItem *)), SLOT(updateAttendeeInput())); - connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), - SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); + connect(mListView,SIGNAL(executed(Q3ListViewItem * ,const QPoint&, int )), + SLOT(itemClicked(Q3ListViewItem * ,const QPoint& , int ))); mRsvpButton = new QCheckBox(this); mRsvpButton->setText(i18n("Request response")); @@ -140,7 +146,7 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); QWidget *buttonBox = new QWidget(this); - QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); + Q3VBoxLayout *buttonLayout = new Q3VBoxLayout(buttonBox); QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); buttonLayout->addWidget(newButton); @@ -365,7 +371,7 @@ void KOEditorDetails::readEvent(Incidence *event) setDefaults(); //mListView->clear(); //mdelAttendees.clear(); - QPtrList<Attendee> tmpAList = event->attendees(); + Q3PtrList<Attendee> tmpAList = event->attendees(); Attendee *a; for (a = tmpAList.first(); a; a = tmpAList.next()) insertAttendee(new Attendee(*a)); @@ -377,7 +383,7 @@ void KOEditorDetails::readEvent(Incidence *event) void KOEditorDetails::writeEvent(Incidence *event) { event->clearAttendees(); - QListViewItem *item; + Q3ListViewItem *item; AttendeeListItem *a; for (item = mListView->firstChild(); item; item = item->nextSibling()) { @@ -404,7 +410,7 @@ bool KOEditorDetails::validateInput() void KOEditorDetails::updateAttendeeInput() { - QListViewItem *item = mListView->selectedItem(); + Q3ListViewItem *item = mListView->selectedItem(); AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); if (aItem) { fillAttendeeInput( aItem ); @@ -451,7 +457,7 @@ void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) mRemoveButton->setEnabled( enabled ); } -void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c ) +void KOEditorDetails::itemClicked(Q3ListViewItem * item ,const QPoint & pnt, int c ) { if ( item && c == 4 ) { mRsvpButton->setChecked( !mRsvpButton->isChecked() ); @@ -462,7 +468,7 @@ void KOEditorDetails::updateAttendeeItem() { if (mDisableItemUpdate) return; - QListViewItem *item = mListView->selectedItem(); + Q3ListViewItem *item = mListView->selectedItem(); AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); if ( !aItem ) return; diff --git a/korganizer/koeditordetails.h b/korganizer/koeditordetails.h index 5f8f6f2..40e896c 100644 --- a/korganizer/koeditordetails.h +++ b/korganizer/koeditordetails.h @@ -24,17 +24,17 @@ #define _KOEDITORDETAILS_H #include <qmap.h> -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> #include <qcheckbox.h> #include <qpushbutton.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlineedit.h> #include <qcombobox.h> -#include <qmultilineedit.h> +#include <q3multilineedit.h> #include <klistview.h> #include <qradiobutton.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <kapplication.h> @@ -83,7 +83,7 @@ class KOEditorDetails : public QWidget void updateAttendeeInput(); void clearAttendeeInput(); void fillAttendeeInput(AttendeeListItem *); - void itemClicked(QListViewItem *,const QPoint & pnt, int c); + void itemClicked(Q3ListViewItem *,const QPoint & pnt, int c); void updateAttendeeItem(); void setEnabledAttendeeInput(bool); @@ -103,7 +103,7 @@ class KOEditorDetails : public QWidget QPushButton* mRemoveButton; QPushButton* mAddressBookButton; - QPtrList<Attendee> mdelAttendees; + Q3PtrList<Attendee> mdelAttendees; }; #endif diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 21f220c..8105432 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp @@ -24,15 +24,22 @@ #include <qwidget.h> #include <qtooltip.h> #include <qlayout.h> -#include <qvbox.h> -#include <qbuttongroup.h> -#include <qvgroupbox.h> -#include <qwidgetstack.h> +#include <q3vbox.h> +#include <q3buttongroup.h> +#include <q3vgroupbox.h> +#include <q3widgetstack.h> #include <qdatetime.h> #include <qtimer.h> #include <qfile.h> #include <qregexp.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <QLabel> +#include <Q3GridLayout> +#include <Q3PtrList> +#include <Q3PopupMenu> +#include <QDesktopWidget> #include <kglobal.h> #include <kdialog.h> @@ -69,9 +76,9 @@ KOEditorGeneral::~KOEditorGeneral() { } -void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneral::initHeader(QWidget *parent,Q3BoxLayout *topLayout) { - QGridLayout *headerLayout = new QGridLayout(topLayout); + Q3GridLayout *headerLayout = new Q3GridLayout(topLayout); #if 0 mOwnerLabel = new QLabel(i18n("Owner:"),parent); @@ -195,10 +202,10 @@ void KOEditorGeneral::selectedCatPopup( int index ) setCategories( categories.join(",") ); } -void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) +void KOEditorGeneral::initCategories(QWidget *parent, Q3BoxLayout *topLayout) { - QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); - mCatPopup = new QPopupMenu ( parent ); + Q3BoxLayout *categoriesLayout = new Q3HBoxLayout( topLayout ); + mCatPopup = new Q3PopupMenu ( parent ); mCatPopup->setCheckable (true); connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); @@ -214,9 +221,9 @@ void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) categoriesLayout->addWidget(mCategoriesLabel,1); } -void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) +void KOEditorGeneral::initSecrecy(QWidget *parent, Q3BoxLayout *topLayout) { - QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *secrecyLayout = new Q3HBoxLayout( topLayout ); QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); @@ -228,7 +235,7 @@ void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) secrecyLayout->addWidget(mSecrecyCombo); } -void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneral::initDescription(QWidget *parent,Q3BoxLayout *topLayout) { mDescriptionEdit = new KTextEdit(parent); mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); @@ -243,9 +250,9 @@ void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) } -void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneral::initAlarm(QWidget *parent,Q3BoxLayout *topLayout) { - QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *alarmLayout = new Q3HBoxLayout(topLayout); //mAlarmBell = new QLabel(parent); //mAlarmBell->setPixmap(SmallIcon("bell")); @@ -528,7 +535,7 @@ void KOEditorGeneral::readIncidence(Incidence *event) mAlarmSoundButton->setOn(false); // set up alarm stuff - QPtrList<Alarm> alarms = event->alarms(); + Q3PtrList<Alarm> alarms = event->alarms(); Alarm* alarm; mAlarmIncrCombo->setCurrentItem(0); for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { @@ -590,7 +597,7 @@ void KOEditorGeneral::writeIncidence(Incidence *event) if (mAlarmButton->isChecked()) { if (event->alarms().count() == 0) event->newAlarm(); - QPtrList<Alarm> alarms = event->alarms(); + Q3PtrList<Alarm> alarms = event->alarms(); Alarm *alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { alarm->setEnabled(true); diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h index b10a5d4..45f26fd 100644 --- a/korganizer/koeditorgeneral.h +++ b/korganizer/koeditorgeneral.h @@ -23,19 +23,20 @@ #ifndef KOEDITORGENERAL_H #define KOEDITORGENERAL_H -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> #include <qcheckbox.h> #include <qpushbutton.h> -#include <qpopupmenu.h> -#include <qgroupbox.h> +#include <q3popupmenu.h> +#include <q3groupbox.h> #include <qlineedit.h> #include <qcombobox.h> -#include <qlistview.h> +#include <q3listview.h> #include <qradiobutton.h> #include <qlayout.h> #include <qspinbox.h> #include <qcombobox.h> +#include <Q3BoxLayout> #include <ktextedit.h> #include <krestrictedline.h> @@ -55,11 +56,11 @@ class KOEditorGeneral : public QObject KOEditorGeneral (QObject* parent=0,const char* name=0); virtual ~KOEditorGeneral(); void setFocusOn( int i ); - void initHeader(QWidget *,QBoxLayout *); - void initDescription(QWidget *,QBoxLayout *); - void initSecrecy(QWidget *,QBoxLayout *); - void initCategories(QWidget *,QBoxLayout *); - void initAlarm(QWidget *,QBoxLayout *); + void initHeader(QWidget *,Q3BoxLayout *); + void initDescription(QWidget *,Q3BoxLayout *); + void initSecrecy(QWidget *,Q3BoxLayout *); + void initCategories(QWidget *,Q3BoxLayout *); + void initAlarm(QWidget *,Q3BoxLayout *); /** Set widgets to default values */ void setDefaults(bool allDay); @@ -115,7 +116,7 @@ class KOEditorGeneral : public QObject QPushButton *mCategoriesLabel; private: - QPopupMenu * mCatPopup; + Q3PopupMenu * mCatPopup; QString getFittingPath( const QString &) ; QString mAlarmSound; QString mAlarmProgram; diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index 2c6ed9f..73a4139 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp @@ -23,11 +23,17 @@ #include <qtooltip.h> #include <qlayout.h> -#include <qvbox.h> -#include <qbuttongroup.h> -#include <qvgroupbox.h> -#include <qwidgetstack.h> +#include <q3vbox.h> +#include <q3buttongroup.h> +#include <q3vgroupbox.h> +#include <q3widgetstack.h> #include <qdatetime.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <Q3Frame> +#include <QLabel> +#include <Q3VBoxLayout> #include <kdebug.h> #include <kglobal.h> @@ -84,19 +90,19 @@ void KOEditorGeneralEvent::finishSetup() mSummaryEdit->setFocus(); } -void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneralEvent::initTime(QWidget *parent,Q3BoxLayout *topLayout) { - QBoxLayout *timeLayout = new QVBoxLayout(topLayout); + Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout); - QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, + Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal, i18n("Date && Time"),parent); timeLayout->addWidget(timeGroupBox); timeGroupBox->layout()->setSpacing( KDialog::spacingHintSmall() ); timeGroupBox->layout()->setMargin( KDialog::marginHint() ); - QFrame *timeBoxFrame = new QFrame(timeGroupBox); + Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox); - QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,2,3); + Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,2,3); layoutTimeBox->setSpacing(topLayout->spacing()); mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame); @@ -118,7 +124,7 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) mEndTimeEdit = new KOTimeEdit(timeBoxFrame); layoutTimeBox->addWidget(mEndTimeEdit,1,2); QWidget* duration = new QWidget( timeBoxFrame ); - QHBoxLayout *flagsBox = new QHBoxLayout( duration ); + Q3HBoxLayout *flagsBox = new Q3HBoxLayout( duration ); mNoTimeButton = new QCheckBox(i18n("All day event"),duration); flagsBox->addWidget(mNoTimeButton); connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool))); @@ -129,7 +135,7 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) flagsBox->addWidget( mDurationLabel ); //} flagsBox->setStretchFactor(mDurationLabel, 10 ); - mDurationLabel->setAlignment( AlignRight | AlignVCenter); + mDurationLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter); layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 ); // time widgets are checked if they contain a valid time @@ -147,9 +153,9 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime))); } -void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneralEvent::initClass(QWidget *parent,Q3BoxLayout *topLayout) { - QBoxLayout *classLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *classLayout = new Q3HBoxLayout(topLayout); QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent); classLayout->addWidget(freeTimeLabel); diff --git a/korganizer/koeditorgeneralevent.h b/korganizer/koeditorgeneralevent.h index d798905..5d97a5c 100644 --- a/korganizer/koeditorgeneralevent.h +++ b/korganizer/koeditorgeneralevent.h @@ -23,15 +23,15 @@ #ifndef _KOEDITORGENERALEVENT_H #define _KOEDITORGENERALEVENT_H -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> #include <qcheckbox.h> #include <qpushbutton.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlineedit.h> #include <qcombobox.h> -#include <qmultilineedit.h> -#include <qlistview.h> +#include <q3multilineedit.h> +#include <q3listview.h> #include <qradiobutton.h> #include <krestrictedline.h> @@ -51,8 +51,8 @@ class KOEditorGeneralEvent : public KOEditorGeneral KOEditorGeneralEvent (QObject* parent=0,const char* name=0); virtual ~KOEditorGeneralEvent(); - void initTime(QWidget *,QBoxLayout *); - void initClass(QWidget *,QBoxLayout *); + void initTime(QWidget *,Q3BoxLayout *); + void initClass(QWidget *,Q3BoxLayout *); void finishSetup(); diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index d32d5a5..baee9fc 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp @@ -22,14 +22,21 @@ */ #include <qtooltip.h> -#include <qfiledialog.h> +#include <q3filedialog.h> #include <qlayout.h> -#include <qvbox.h> -#include <qbuttongroup.h> -#include <qvgroupbox.h> -#include <qwidgetstack.h> +#include <q3vbox.h> +#include <q3buttongroup.h> +#include <q3vgroupbox.h> +#include <q3widgetstack.h> #include <qdatetime.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <Q3Frame> +#include <QLabel> +#include <Q3VBoxLayout> #include <kglobal.h> #include <klocale.h> @@ -82,18 +89,18 @@ void KOEditorGeneralTodo::finishSetup() mSummaryEdit->setFocus(); } -void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneralTodo::initTime(QWidget *parent,Q3BoxLayout *topLayout) { - QBoxLayout *timeLayout = new QVBoxLayout(topLayout); + Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout); - QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, + Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal, i18n("Date && Time"),parent); timeLayout->addWidget(timeGroupBox); timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); timeGroupBox->layout()->setMargin( KDialog::marginHint() ); - QFrame *timeBoxFrame = new QFrame(timeGroupBox); + Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox); - QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); + Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,3,3); layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); layoutTimeBox->setColStretch( 1, 1 ); @@ -133,7 +140,7 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) } -void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) +void KOEditorGeneralTodo::initCompletion(QWidget *parent, Q3BoxLayout *topLayout) { mCompletedCombo = new QComboBox(parent); // xgettext:no-c-format @@ -173,10 +180,10 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) } } -void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) +void KOEditorGeneralTodo::initPriority(QWidget *parent, Q3BoxLayout *topLayout) { - QHBox* h = new QHBox ( parent ); + Q3HBox* h = new Q3HBox ( parent ); topLayout->addWidget( h ); QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); // topLayout->addWidget(priorityLabel); @@ -189,9 +196,9 @@ void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) //topLayout->addWidget(mPriorityCombo); } -void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout) +void KOEditorGeneralTodo::initStatus(QWidget *parent,Q3BoxLayout *topLayout) { - QBoxLayout *statusLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *statusLayout = new Q3HBoxLayout(topLayout); initCompletion( parent, statusLayout ); @@ -396,7 +403,7 @@ void KOEditorGeneralTodo::enableStartEdit( bool enable ) void KOEditorGeneralTodo::startDateChanged(QDate newdate) { if ( mDueCheck->isChecked() ) - emit dateTimesChanged(newdate,mDueDateEdit->date()); + emit dateTimesChanged((QDateTime)newdate,(QDateTime)mDueDateEdit->date()); } void KOEditorGeneralTodo::enableTimeEdits(bool enable) { diff --git a/korganizer/koeditorgeneraltodo.h b/korganizer/koeditorgeneraltodo.h index 2e56a7a..2e97ff5 100644 --- a/korganizer/koeditorgeneraltodo.h +++ b/korganizer/koeditorgeneraltodo.h @@ -23,15 +23,15 @@ #ifndef _KOEDITORGENERALTODO_H #define _KOEDITORGENERALTODO_H -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> #include <qcheckbox.h> #include <qpushbutton.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlineedit.h> #include <qcombobox.h> -#include <qmultilineedit.h> -#include <qlistview.h> +#include <q3multilineedit.h> +#include <q3listview.h> #include <qradiobutton.h> #include "koeditorgeneral.h" @@ -50,10 +50,10 @@ class KOEditorGeneralTodo : public KOEditorGeneral KOEditorGeneralTodo (QObject* parent=0,const char* name=0); virtual ~KOEditorGeneralTodo(); - void initTime(QWidget *, QBoxLayout *); - void initStatus(QWidget *, QBoxLayout *); - void initCompletion(QWidget *, QBoxLayout *); - void initPriority(QWidget *, QBoxLayout *); + void initTime(QWidget *, Q3BoxLayout *); + void initStatus(QWidget *, Q3BoxLayout *); + void initCompletion(QWidget *, Q3BoxLayout *); + void initPriority(QWidget *, Q3BoxLayout *); void finishSetup(); diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp index e0380c4..e0ae3a0 100644 --- a/korganizer/koeditorrecurrence.cpp +++ b/korganizer/koeditorrecurrence.cpp @@ -22,17 +22,25 @@ */ #include <qtooltip.h> -#include <qfiledialog.h> +#include <q3filedialog.h> #include <qlayout.h> -#include <qvbox.h> -#include <qbuttongroup.h> -#include <qvgroupbox.h> -#include <qwidgetstack.h> +#include <q3vbox.h> +#include <q3buttongroup.h> +#include <q3vgroupbox.h> +#include <q3widgetstack.h> #include <qdatetime.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qspinbox.h> #include <qcheckbox.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <QLabel> +#include <Q3GridLayout> +#include <Q3PtrList> +#include <Q3Frame> +#include <Q3VBoxLayout> #include <kdialog.h> #include <kglobal.h> @@ -81,7 +89,7 @@ int RecurBase::frequency() RecurDaily::RecurDaily( QWidget *parent, const char *name ) : RecurBase( parent, name ) { - QBoxLayout *topLayout = new QHBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3HBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHintSmall() ); @@ -100,13 +108,13 @@ RecurDaily::RecurDaily( QWidget *parent, const char *name ) : RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) : RecurBase( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHintSmall() ); //topLayout->addStretch( 1 ); - QBoxLayout *weeksLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *weeksLayout = new Q3HBoxLayout( topLayout ); QLabel *preLabel = new QLabel( i18n("Recur every"), this ); weeksLayout->addWidget( preLabel ); @@ -116,8 +124,8 @@ RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) : QLabel *postLabel = new QLabel( i18n("week(s) on:"), this ); weeksLayout->addWidget( postLabel ); - QHBox *dayBox = new QHBox( this ); - topLayout->addWidget( dayBox, 1, AlignVCenter ); + Q3HBox *dayBox = new Q3HBox( this ); + topLayout->addWidget( dayBox, 1, Qt::AlignVCenter ); // TODO: Respect start of week setting for ( int i = 0; i < 7; ++i ) { QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true ); @@ -156,12 +164,12 @@ QBitArray RecurWeekly::days() RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : RecurBase( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHintSmall() ); - QBoxLayout *freqLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout ); QLabel *preLabel = new QLabel( i18n("every"), this ); freqLayout->addWidget( preLabel ); @@ -172,11 +180,11 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : freqLayout->addWidget( postLabel ); - QButtonGroup *buttonGroup = new QButtonGroup( this ); - buttonGroup->setFrameStyle( QFrame::NoFrame ); - topLayout->addWidget( buttonGroup, 1, AlignVCenter ); + Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this ); + buttonGroup->setFrameStyle( Q3Frame::NoFrame ); + topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter ); - QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 3, 2 ); + Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 3, 2 ); buttonLayout->setSpacing( KDialog::spacingHint() ); buttonLayout->setMargin( KDialog::marginHintSmall() ); @@ -189,7 +197,7 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : mByDayRadio = new QRadioButton( recurOnText, buttonGroup ); buttonLayout->addWidget( mByDayRadio, 0, 0 ); - mByDayCombo = new QComboBox( buttonGroup ); + mByDayCombo = new Q3ComboBox( buttonGroup ); mByDayCombo->setSizeLimit( 7 ); mByDayCombo->insertItem( i18n("1st") ); mByDayCombo->insertItem( i18n("2nd") ); @@ -293,12 +301,12 @@ int RecurMonthly::weekday() RecurYearly::RecurYearly( QWidget *parent, const char *name ) : RecurBase( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHintSmall() ); - QBoxLayout *freqLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout ); QLabel *preLabel = new QLabel( i18n("every"), this ); freqLayout->addWidget( preLabel ); @@ -309,18 +317,18 @@ RecurYearly::RecurYearly( QWidget *parent, const char *name ) : freqLayout->addWidget( postLabel ); - QButtonGroup *buttonGroup = new QButtonGroup( this ); - buttonGroup->setFrameStyle( QFrame::NoFrame ); - topLayout->addWidget( buttonGroup, 1, AlignVCenter ); + Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this ); + buttonGroup->setFrameStyle( Q3Frame::NoFrame ); + topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter ); - QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 2, 3 ); + Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 2, 3 ); mByMonthRadio = new QRadioButton( i18n("On day "), buttonGroup); buttonLayout->addWidget( mByMonthRadio, 0, 0 , Qt::AlignRight); mByDayLabel = new QLabel( i18n("%1 of ").arg(1), buttonGroup ); buttonLayout->addWidget( mByDayLabel, 0, 1 ); - mByMonthCombo = new QComboBox( buttonGroup ); + mByMonthCombo = new Q3ComboBox( buttonGroup ); mByMonthCombo->insertItem( i18n("January") ); mByMonthCombo->insertItem( i18n("February") ); mByMonthCombo->insertItem( i18n("March") ); @@ -383,15 +391,15 @@ int RecurYearly::day() ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); - QGroupBox *groupBox = new QGroupBox( 1, Horizontal, i18n("Exceptions"), + Q3GroupBox *groupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Exceptions"), this ); topLayout->addWidget( groupBox ); QWidget *box = new QWidget( groupBox ); - QGridLayout *boxLayout = new QGridLayout( box ); + Q3GridLayout *boxLayout = new Q3GridLayout( box ); mExceptionDateEdit = new KDateEdit( box ); boxLayout->addWidget( mExceptionDateEdit, 0, 0 ); @@ -403,7 +411,7 @@ ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) : QPushButton *deleteExceptionButton = new QPushButton( i18n("Delete"), box ); boxLayout->addWidget( deleteExceptionButton, 3, 0 ); - mExceptionList = new QListBox( box ); + mExceptionList = new Q3ListBox( box ); boxLayout->addMultiCellWidget( mExceptionList, 0, 3, 1, 1 ); boxLayout->setRowStretch( 4, 1 ); @@ -506,27 +514,27 @@ RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); - mRangeGroupBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Range"), + mRangeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Range"), this ); topLayout->addWidget( mRangeGroupBox ); QWidget *rangeBox = new QWidget( mRangeGroupBox ); - QVBoxLayout *rangeLayout = new QVBoxLayout( rangeBox ); + Q3VBoxLayout *rangeLayout = new Q3VBoxLayout( rangeBox ); rangeLayout->setSpacing( KDialog::spacingHint() ); rangeLayout->setMargin( KDialog::marginHintSmall() ); mStartDateLabel = new QLabel( i18n("Begin on:"), rangeBox ); rangeLayout->addWidget( mStartDateLabel ); - mRangeButtonGroup = new QButtonGroup; + mRangeButtonGroup = new Q3ButtonGroup; mNoEndDateButton = new QRadioButton( i18n("No ending date"), rangeBox ); mRangeButtonGroup->insert( mNoEndDateButton ); rangeLayout->addWidget( mNoEndDateButton ); - QBoxLayout *durationLayout = new QHBoxLayout( rangeLayout ); + Q3BoxLayout *durationLayout = new Q3HBoxLayout( rangeLayout ); durationLayout->setSpacing( KDialog::spacingHint() ); mEndDurationButton = new QRadioButton( i18n("End after"), rangeBox ); @@ -539,7 +547,7 @@ RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent, QLabel *endDurationLabel = new QLabel( i18n("occurrence(s)"), rangeBox ); durationLayout ->addWidget( endDurationLabel ); - QBoxLayout *endDateLayout = new QHBoxLayout( rangeLayout ); + Q3BoxLayout *endDateLayout = new Q3HBoxLayout( rangeLayout ); endDateLayout->setSpacing( KDialog::spacingHint() ); mEndDateButton = new QRadioButton( i18n("End by:"), rangeBox ); @@ -666,7 +674,7 @@ void RecurrenceRangeDialog::setDateTimes( const QDateTime &start, RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); mTypeCombo = new QComboBox( this ); mTypeCombo->insertItem( i18n("Daily") ); @@ -725,7 +733,7 @@ void RecurrenceChooser::emitChoice() KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *topLayout = new QGridLayout( this, 2,2 ); + Q3GridLayout *topLayout = new Q3GridLayout( this, 2,2 ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHintSmall() ); @@ -735,7 +743,7 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : topLayout->addMultiCellWidget( mEnabledCheck, 0, 0, 0, 1 ); - mTimeGroupBox = new QGroupBox( 1, Horizontal, i18n("Time"), + mTimeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Time"), this ); topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 ); @@ -752,14 +760,14 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : // layoutTimeFrame->addWidget( mDateTimeLabel ); //mTimeGroupBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) ); //mDateTimeLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum) ); - mRuleBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Rule"), this ); + mRuleBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Rule"), this ); topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 ); mRecurrenceChooser = new RecurrenceChooser( mRuleBox ); connect( mRecurrenceChooser, SIGNAL( chosen( int ) ), SLOT( showCurrentRule( int ) ) ); - mRuleStack = new QWidgetStack( mRuleBox ); + mRuleStack = new Q3WidgetStack( mRuleBox ); mDaily = new RecurDaily( mRuleStack ); mRuleStack->addWidget( mDaily, 0 ); @@ -896,8 +904,8 @@ void KOEditorRecurrence::readEvent(Incidence *event) setDefaults( event->dtStart(), dtEnd ); QBitArray rDays( 7 ); - QPtrList<Recurrence::rMonthPos> rmp; - QPtrList<int> rmd; + Q3PtrList<Recurrence::rMonthPos> rmp; + Q3PtrList<int> rmd; int day = 0; int count = 0; int month = 0; @@ -968,7 +976,7 @@ void KOEditorRecurrence::readEvent(Incidence *event) mYearly->setByMonth( month, day ); #if 0 //qDebug("2day = %d ",day ); - QPtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions(); + Q3PtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions(); int month; if ( !monthlist.isEmpty() ) { month = monthlist.first()->rPos ; diff --git a/korganizer/koeditorrecurrence.h b/korganizer/koeditorrecurrence.h index 75e0c73..6c012bd 100644 --- a/korganizer/koeditorrecurrence.h +++ b/korganizer/koeditorrecurrence.h @@ -23,17 +23,19 @@ #ifndef _KOEDITORRECURRENCE_H #define _KOEDITORRECURRENCE_H -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> #include <qcheckbox.h> #include <qpushbutton.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlineedit.h> #include <qcombobox.h> -#include <qmultilineedit.h> -#include <qlistview.h> +#include <q3multilineedit.h> +#include <q3listview.h> #include <qradiobutton.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> +#include <Q3ListBox> +#include <Q3ComboBox> #include <kdialogbase.h> @@ -41,7 +43,7 @@ #include "ktimeedit.h" -class QWidgetStack; +class Q3WidgetStack; class QSpinBox; class KDateEdit; @@ -98,7 +100,7 @@ class RecurMonthly : public RecurBase private: QRadioButton *mByDayRadio; - QComboBox *mByDayCombo; + Q3ComboBox *mByDayCombo; QRadioButton *mByPosRadio; QComboBox *mByPosCountCombo; @@ -122,7 +124,7 @@ class RecurYearly : public RecurBase private: int mDay; QRadioButton *mByMonthRadio; - QComboBox *mByMonthCombo; + Q3ComboBox *mByMonthCombo; QLabel* mByDayLabel; QLabel* mDayOfLabel; QRadioButton *mByDayRadio; @@ -180,7 +182,7 @@ class ExceptionsWidget : public QWidget, public ExceptionsBase private: KDateEdit *mExceptionDateEdit; - QListBox *mExceptionList; + Q3ListBox *mExceptionList; DateList mExceptionDates; }; @@ -235,8 +237,8 @@ class RecurrenceRangeWidget : public QWidget, public RecurrenceRangeBase void showCurrentRange(); private: - QButtonGroup *mRangeButtonGroup; - QGroupBox *mRangeGroupBox; + Q3ButtonGroup *mRangeButtonGroup; + Q3GroupBox *mRangeGroupBox; QLabel *mStartDateLabel; QRadioButton *mNoEndDateButton; QRadioButton *mEndDurationButton; @@ -300,11 +302,11 @@ class KOEditorRecurrence : public QWidget private: QCheckBox *mEnabledCheck; - QGroupBox *mTimeGroupBox; + Q3GroupBox *mTimeGroupBox; QLabel *mDateTimeLabel; - QGroupBox *mRuleBox; - QWidgetStack *mRuleStack; + Q3GroupBox *mRuleBox; + Q3WidgetStack *mRuleStack; RecurrenceChooser *mRecurrenceChooser; RecurDaily *mDaily; diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp index 3e87197..62ad250 100644 --- a/korganizer/koeventeditor.cpp +++ b/korganizer/koeventeditor.cpp @@ -22,14 +22,19 @@ */ #include <qtooltip.h> -#include <qframe.h> +#include <q3frame.h> #include <qpixmap.h> -#include <qhbox.h> +#include <q3hbox.h> #include <qtimer.h> #include <qdir.h> #include <qlayout.h> -#include <qwidgetstack.h> +#include <q3widgetstack.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3PtrList> +#include <Q3VBoxLayout> #include <kiconloader.h> #include <kstandarddirs.h> @@ -105,8 +110,8 @@ void KOEventEditor::setupGeneral() connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); if( KOPrefs::instance()->mCompactDialogs ) { - QFrame *topFrame = addPage(i18n("General")); - QBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3Frame *topFrame = addPage(i18n("General")); + Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); topLayout->setSpacing(spacingHint()-1); topLayout->setMargin(marginHint()-1); topLayout->addStretch ( 1 ); @@ -119,13 +124,13 @@ void KOEventEditor::setupGeneral() topLayout->addStretch ( 1 ); mGeneral->enableAlarm( false ); - QBoxLayout *buttonLayout; + Q3BoxLayout *buttonLayout; if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 ) - buttonLayout = new QVBoxLayout( topLayout ); + buttonLayout = new Q3VBoxLayout( topLayout ); else - buttonLayout = new QHBoxLayout( topLayout ); - QHBox* buttonWidget = new QHBox (topFrame); - QIconSet icon; + buttonLayout = new Q3HBoxLayout( topLayout ); + Q3HBox* buttonWidget = new Q3HBox (topFrame); + QIcon icon; if ( QApplication::desktop()->width() < 321 ) icon = SmallIcon("fileexport16"); else @@ -146,9 +151,9 @@ void KOEventEditor::setupGeneral() topLayout->addStretch( 1 ); - QFrame *topFrame2 = addPage(i18n("Details")); + Q3Frame *topFrame2 = addPage(i18n("Details")); - QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); + Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2); topLayout2->setSpacing(spacingHint()-1); topLayout2->setMargin(marginHint()-1); topLayout2->setSpacing(spacingHint()); @@ -160,18 +165,18 @@ void KOEventEditor::setupGeneral() connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); } else { - QFrame *topFrame = addPage(i18n("General")); + Q3Frame *topFrame = addPage(i18n("General")); - QBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); topLayout->setSpacing(spacingHint()); mGeneral->initHeader(topFrame,topLayout); mGeneral->initTime(topFrame,topLayout); - QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout); mGeneral->initAlarm(topFrame,alarmLineLayout); mGeneral->initClass(topFrame,alarmLineLayout); mGeneral->initDescription(topFrame,topLayout); - QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout); mGeneral->initCategories( topFrame, detailsLayout ); mGeneral->initSecrecy( topFrame, detailsLayout ); } @@ -182,8 +187,8 @@ void KOEventEditor::setupGeneral() void KOEventEditor::setupRecurrence() { - QFrame *topFrame = addPage( i18n("Recurrence") ); - QBoxLayout *topLayout = new QVBoxLayout( topFrame ); + Q3Frame *topFrame = addPage( i18n("Recurrence") ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); mRecurrence = new KOEditorRecurrence( topFrame ); topLayout->addWidget( mRecurrence ); @@ -356,7 +361,7 @@ void KOEventEditor::slotLoadTemplate() .arg( fileName ) ); return ; } - QPtrList<Event> events = cal.events(); + Q3PtrList<Event> events = cal.events(); Event* event = events.first(); if ( !event ) { KMessageBox::error( this, diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp index fc4d9a4..81047c1 100644 --- a/korganizer/koeventpopupmenu.cpp +++ b/korganizer/koeventpopupmenu.cpp @@ -22,6 +22,9 @@ */ #include <qcursor.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3PopupMenu> #include <klocale.h> #include <kdebug.h> @@ -32,7 +35,7 @@ #include "koeventpopupmenu.h" #include "koprefs.h" -KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() +KOEventPopupMenu::KOEventPopupMenu(): Q3PopupMenu() { mCurrentIncidence = 0; mHasAdditionalItems = false; @@ -53,11 +56,11 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), this,SLOT(popupCancel()))); isDisabled = false; - mCatPopup = new QPopupMenu ( this ); + mCatPopup = new Q3PopupMenu ( this ); mCatPopup->setCheckable (true); connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup())); connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int ))); - mCalPopup = new QPopupMenu ( this ); + mCalPopup = new Q3PopupMenu ( this ); mCalPopup->setCheckable (true); connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup())); connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int ))); @@ -65,7 +68,7 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup )); insertItem (i18n("Categories"),mCatPopup ); insertItem (i18n("Calendar"),mCalPopup ); - QValueList<int>::Iterator it; + Q3ValueList<int>::Iterator it; for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { mSingleOnlyItems.append(*it); } @@ -74,7 +77,7 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() void KOEventPopupMenu::enableDefault( bool enable ) { isDisabled = !enable; - QValueList<int>::Iterator it; + Q3ValueList<int>::Iterator it; for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) { setItemEnabled(*it,enable); } @@ -146,7 +149,7 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) if (mCurrentIncidence) { // Enable/Disabled menu items only valid for editable events. if ( !isDisabled ) { - QValueList<int>::Iterator it; + Q3ValueList<int>::Iterator it; for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); } @@ -155,7 +158,7 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) } } -void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text, +void KOEventPopupMenu::addAdditionalItem(const QIcon &icon,const QString &text, const QObject *receiver, const char *member, bool editOnly) { diff --git a/korganizer/koeventpopupmenu.h b/korganizer/koeventpopupmenu.h index e28745b..de5220b 100644 --- a/korganizer/koeventpopupmenu.h +++ b/korganizer/koeventpopupmenu.h @@ -26,18 +26,20 @@ // Context menu for event views with standard event actions // -#include <qpopupmenu.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <Q3ValueList> #include <libkcal/incidence.h> using namespace KCal; -class KOEventPopupMenu : public QPopupMenu { +class KOEventPopupMenu : public Q3PopupMenu { Q_OBJECT public: KOEventPopupMenu(); - void addAdditionalItem(const QIconSet &icon,const QString &text, + void addAdditionalItem(const QIcon &icon,const QString &text, const QObject *receiver, const char *member, bool editOnly=false); @@ -73,11 +75,11 @@ class KOEventPopupMenu : public QPopupMenu { Incidence *mCurrentIncidence; bool mHasAdditionalItems; - QValueList<int> mEditOnlyItems; - QValueList<int> mSingleOnlyItems; + Q3ValueList<int> mEditOnlyItems; + Q3ValueList<int> mSingleOnlyItems; bool isDisabled; - QPopupMenu *mCatPopup; - QPopupMenu *mCalPopup; + Q3PopupMenu *mCatPopup; + Q3PopupMenu *mCalPopup; }; #endif diff --git a/korganizer/koeventview.cpp b/korganizer/koeventview.cpp index 1d26930..a4ba85e 100644 --- a/korganizer/koeventview.cpp +++ b/korganizer/koeventview.cpp @@ -21,7 +21,7 @@ without including the source code for Qt in the source distribution. */ -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qcursor.h> #include <klocale.h> @@ -73,7 +73,7 @@ KOEventPopupMenu *KOEventView::eventPopup() //--------------------------------------------------------------------------- -void KOEventView::showIncidencePopup(QPopupMenu *popup,Incidence *event) +void KOEventView::showIncidencePopup(Q3PopupMenu *popup,Incidence *event) { mCurrentIncidence = event; if (event) popup->popup(QCursor::pos()); diff --git a/korganizer/koeventview.h b/korganizer/koeventview.h index 77ec111..f28e68b 100644 --- a/korganizer/koeventview.h +++ b/korganizer/koeventview.h @@ -30,6 +30,8 @@ #include <korganizer/baseview.h> #include "koeventpopupmenu.h" +//Added by qt3to4: +#include <Q3PopupMenu> using namespace KCal; @@ -87,7 +89,7 @@ class KOEventView : public KOrg::BaseView * @param event event, which is to be manipulated by the menu actions * @param popup a popop menu created with eventPopup() */ - void showIncidencePopup(QPopupMenu *popup, Incidence *event); + void showIncidencePopup(Q3PopupMenu *popup, Incidence *event); /** Perform the default action for an incidence, e.g. open the event editor, diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index c0acf34..4df26a9 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -17,12 +17,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <qcstring.h> -#include <qwhatsthis.h> +#include <q3cstring.h> +#include <q3whatsthis.h> #include <qdialog.h> #include <qapplication.h> +#include <QDesktopWidget> #include <qlabel.h> #include <qlayout.h> +//Added by qt3to4: +#include <QKeyEvent> +#include <Q3PtrList> +#include <Q3VBoxLayout> #include <klocale.h> #include <kapplication.h> @@ -55,14 +60,14 @@ #include <kabc/addresseeview.h> #include <qprinter.h> #include <qpainter.h> -#include <qpaintdevicemetrics.h> +#include <q3paintdevicemetrics.h> #else //DESKTOP_VERSION #include <qtopia/qcopenvelope_qws.h> #endif //DESKTOP_VERSION #include <externalapphandler.h> KOEventViewer::KOEventViewer(QWidget *parent,const char *name) - : QTextBrowser(parent,name) + : Q3TextBrowser(parent,name) { mSyncMode = false; mColorMode = 0; @@ -86,7 +91,7 @@ void KOEventViewer::printMe() return; QPainter p; p.begin ( &printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); @@ -134,7 +139,7 @@ void KOEventViewer::setSource(const QString& n) //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); QDialog dia( this,"dia123", true ); dia.setCaption( i18n("Details of attendee") ); - QVBoxLayout lay ( &dia ); + Q3VBoxLayout lay ( &dia ); KABC::AddresseeView av ( &dia ); av.setAddressee( (*it) ); lay.addWidget( &av ); @@ -155,7 +160,7 @@ void KOEventViewer::setSource(const QString& n) ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); return; } - QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); + Q3PtrList<Attendee> attendees = mCurrentIncidence->attendees(); if (attendees.count()) { Attendee *a; for(a=attendees.first();a;a=attendees.next()) { @@ -200,14 +205,14 @@ void KOEventViewer::setSource(const QString& n) const QByteArray noParamData; const QByteArray paramData; QByteArray replyData; - QCString replyTypeStr; + Q3CString replyTypeStr; #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) bool foundAbbrowser = PING_ABBROWSER; if (foundAbbrowser) { //KAddressbook is already running, so just DCOP to it to bring up the contact editor //client->send("kaddressbook","KAddressBookIface", - QDataStream arg(paramData, IO_WriteOnly); + QDataStream arg(paramData, QIODevice::WriteOnly); arg << n.mid(6); client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); return; @@ -231,7 +236,7 @@ void KOEventViewer::setSource(const QString& n) } void KOEventViewer::mailToAttendees( bool all ) { - QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); + Q3PtrList<Attendee> attendees = mCurrentIncidence->attendees(); if (attendees.count() == 0) return; QStringList nameList; QStringList emailList; @@ -260,7 +265,7 @@ void KOEventViewer::mailToAttendees( bool all ) } void KOEventViewer::addTag(const QString & tag,const QString & text) { - int number=text.contains("\n"); + int number=text.count("\n"); QString str = "<" + tag + ">"; QString tmpText=text; QString tmpStr=str; @@ -587,7 +592,7 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) // mText.append(deTag("[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] " +event->relatedTo()->summary()) +"<br>"); } - QPtrList<Incidence> Relations = event->relations(); + Q3PtrList<Incidence> Relations = event->relations(); Incidence *to; if ( Relations.first() ) addTag("b",i18n("Sub todos:<br>")); @@ -621,7 +626,7 @@ void KOEventViewer::formatCategories(Incidence *event) } void KOEventViewer::formatAttendees(Incidence *event) { - QPtrList<Attendee> attendees = event->attendees(); + Q3PtrList<Attendee> attendees = event->attendees(); if (attendees.count()) { @@ -654,7 +659,7 @@ void KOEventViewer::formatAttendees(Incidence *event) mText.append(event->organizer()); #endif - if (iconPath) { + if (!iconPath.isEmpty()) { mText += " <a href=\"mailto:" + event->organizer() + "\">"; mText += "<IMG src=\"" + iconPath + "\">"; mText += "</a>\n"; @@ -704,7 +709,7 @@ void KOEventViewer::formatAttendees(Incidence *event) if (!a->email().isEmpty()) { - if (iconPath) { + if (!iconPath.isEmpty()) { mText += "<a href=\"mailto:" + a->realName() +" <" + a->email() + ">:" + mMailSubject + "\">"; if ( a->RSVP() ) { ++a_count_nr; @@ -862,7 +867,7 @@ void KOEventViewer::keyPressEvent ( QKeyEvent * e ) e->ignore(); break; default: - QTextBrowser::keyPressEvent ( e ); + Q3TextBrowser::keyPressEvent ( e ); break; } } diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 64eb4ff..3df667f 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h @@ -22,7 +22,10 @@ // Viewer widget for events. // -#include <qtextbrowser.h> +#include <q3textbrowser.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <QKeyEvent> #include <libkcal/event.h> #include <libkcal/journal.h> @@ -37,7 +40,7 @@ using namespace KCal; #include <qlayout.h> #include <qdialog.h> #include <qlabel.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <kglobal.h> class KOPrintPrefs : public QDialog @@ -47,13 +50,13 @@ class KOPrintPrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("KO/Pi Printout") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 9 ); lay->setMargin( 9 ); QLabel * lab = new QLabel( i18n("This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n"), this ); lay->addWidget( lab ); - lab->setAlignment( AlignCenter ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Printout Mode"), this ); + lab->setAlignment( Qt::AlignCenter ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Printout Mode"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; pmNo = new QRadioButton(i18n("Print unscaled"), format ); @@ -83,7 +86,7 @@ private: #endif -class KOEventViewer : public QTextBrowser { +class KOEventViewer : public Q3TextBrowser { Q_OBJECT public: KOEventViewer(QWidget *parent=0,const char *name=0); @@ -117,7 +120,7 @@ class KOEventViewer : public QTextBrowser { void keyPressEvent ( QKeyEvent * e ); private: - QTextBrowser *mEventTextView; + Q3TextBrowser *mEventTextView; bool mSyncMode; QString deTag(QString text); diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index 2e936f3..3a37852 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp @@ -22,12 +22,15 @@ #include <libkcal/event.h> #include <qtimer.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <QHideEvent> +#include <QKeyEvent> #include "koeventviewer.h" #include <kmessagebox.h> #include "koprefs.h" #include <libkcal/todo.h> -#include "qapp.h" +#include "qapplication.h" #include "koeventviewerdialog.h" extern int globalFlagBlockAgenda; diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h index 71696f4..947c10b 100644 --- a/korganizer/koeventviewerdialog.h +++ b/korganizer/koeventviewerdialog.h @@ -22,7 +22,10 @@ // Viewer dialog for events. // -#include <qtextview.h> +#include <q3textview.h> +//Added by qt3to4: +#include <QKeyEvent> +#include <QHideEvent> #include <kdialogbase.h> diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index ee9c9f6..8335ba9 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -27,10 +27,14 @@ #include <qlayout.h> #include <qlabel.h> #include <qdialog.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> #include <qdir.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> +#include <Q3PtrList> #include <libkcal/calfilter.h> @@ -47,8 +51,8 @@ -KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent, - const char* name,WFlags fl ) +KOFilterView::KOFilterView(Q3PtrList<CalFilter> *filterList,QWidget* parent, + const char* name,Qt::WFlags fl ) : KOFilterView_base(parent,name,fl) { mFilters = filterList; @@ -114,14 +118,14 @@ void KOFilterView::setSelectedFilter( int fil ) KOCalEditView::KOCalEditView(QWidget* parent, const char* name ) - : QScrollView(parent,name) + : Q3ScrollView(parent,name) { mw = 0; setResizePolicy( AutoOneFit ); - setFrameStyle ( QFrame::Panel | QFrame::Plain ); + setFrameStyle ( Q3Frame::Panel | Q3Frame::Plain ); setLineWidth ( 1 ); setMidLineWidth ( 1 ); - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); } KOCalEditView::~KOCalEditView() @@ -247,55 +251,55 @@ void KOCalEditView::readConfig() mw = new QWidget ( viewport() ); addChild(mw); int ii = 0; - mainLayout = new QGridLayout ( mw , 2, 8 ); + mainLayout = new Q3GridLayout ( mw , 2, 8 ); mainLayout->setMargin( 2 ); mainLayout->setSpacing( 2 ); QPushButton * addButT = new QPushButton ( mw ); - addButT->setFocusPolicy(NoFocus); + addButT->setFocusPolicy(Qt::NoFocus); mainLayout->addWidget( addButT,0,0 ); addButT->setText( "D"); connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo())); - QWhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); + 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.") ); //addBut->setPixmap ( SmallIcon("greenhook16")); QPushButton *addBut = new QPushButton ( mw ); - addBut->setFocusPolicy(NoFocus); + addBut->setFocusPolicy(Qt::NoFocus); mainLayout->addWidget( addBut,0,++ii ); addBut->setPixmap ( SmallIcon("eye")); - QWhatsThis::add( addBut, i18n("In this column you can <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.") ); + 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.") ); connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); int max = addBut->sizeHint().height(); addBut->setMaximumWidth( max ); addButT->setFixedSize( QSize( max, max ) ); QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); mainLayout->addWidget( lab,0,++ii ); - QWhatsThis::add( lab, i18n("In this column you can see the <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.") ); + 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.") ); //lab = new QLabel ( i18n(" "), mw ); //mainLayout->addWidget( lab,0,++ii ); //lab->setFixedWidth( 1 ); addBut = new QPushButton ( mw ); - addBut->setFocusPolicy(NoFocus); + addBut->setFocusPolicy(Qt::NoFocus); mainLayout->addWidget( addBut,0,++ii ); addBut->setPixmap ( SmallIcon("bell")); - QWhatsThis::add( addBut, i18n("In this column you can <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.") ); + 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.") ); connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); addBut->setMaximumWidth( addBut->sizeHint().height() ); addBut = new QPushButton ( mw ); - addBut->setFocusPolicy(NoFocus); + addBut->setFocusPolicy(Qt::NoFocus); mainLayout->addWidget( addBut,0,++ii ); addBut->setPixmap ( SmallIcon("pencil")); - QWhatsThis::add( addBut, i18n("In this column you can <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.") ); + 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.") ); connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); addBut->setMaximumWidth( addBut->sizeHint().height() ); lab = new QLabel ( "", mw ); mainLayout->addWidget( lab,0,++ii ); addBut = new QPushButton ( mw ); - addBut->setFocusPolicy(NoFocus); + addBut->setFocusPolicy(Qt::NoFocus); mainLayout->addWidget( addBut,0,++ii ); addBut->setPixmap ( SmallIcon("plus")); connect(addBut,SIGNAL(clicked()),SLOT(addCal())); - QWhatsThis::add( addBut, i18n("Click this button to <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.") ); + 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.") ); lab = new QLabel ( " ", mw ); mainLayout->addWidget( lab,0,++ii ); @@ -431,11 +435,11 @@ int KOCalEditView::addCalendar( QString name, QString file, bool ask ) if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( KGlobal::formatMessage (absFile,0) ) )== KMessageBox::No ) return 0; QFile fileIn( absFile ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); return 0; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n"; fileIn.close(); @@ -475,7 +479,7 @@ void KOCalEditView::disableRO() { toggleList( mROB, false ); } -void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list , bool enable ) +void KOCalEditView::toggleList ( Q3PtrList<KOCalCheckButton> list , bool enable ) { bool dis = !enable; KOCalCheckButton* it = list.first(); diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index 0dd423a..f1bbab4 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h @@ -26,12 +26,18 @@ #include <qstring.h> #include <qcheckbox.h> #include <qapplication.h> +#include <QDesktopWidget> #include <qradiobutton.h> #include <qlayout.h> #include <qlabel.h> #include <qdialog.h> -#include <qscrollview.h> +#include <q3scrollview.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3PtrList> +#include <QKeyEvent> +#include <Q3VBoxLayout> #include <kconfig.h> #include "kofilterview_base.h" @@ -42,7 +48,7 @@ #include <kglobal.h> #include <kmessagebox.h> -class QGridLayout; +class Q3GridLayout; using namespace KCal; @@ -54,7 +60,7 @@ class KONewCalPrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Add new Calendar") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this ); @@ -110,7 +116,7 @@ class KOCalButton : public QPushButton connect( this, SIGNAL( clicked() ), SLOT( bottonClicked() )); mNumber = -1; - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); } void setNum ( int num ) {mNumber = num; } signals: @@ -135,7 +141,7 @@ class KOCalCheckButton : public QCheckBox connect( this, SIGNAL( toggled ( bool ) ), SLOT( bottonClicked( bool ) )); mNumber = -1; - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); //setMaximumWidth( 10 ); } @@ -163,7 +169,7 @@ class KOCalRadioButton : public QRadioButton connect( this, SIGNAL( toggled ( bool ) ), SLOT( bottonClicked( bool ) )); mNumber = -1; - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); //setMaximumWidth( 10 ); } @@ -188,7 +194,7 @@ class KOFilterView : public KOFilterView_base { Q_OBJECT public: - KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); + KOFilterView(Q3PtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, Qt::WFlags fl=0); ~KOFilterView(); void updateFilters(); @@ -204,10 +210,10 @@ class KOFilterView : public KOFilterView_base void editFilters(); private: - QPtrList<CalFilter> *mFilters; + Q3PtrList<CalFilter> *mFilters; }; -class KOCalEditView : public QScrollView +class KOCalEditView : public Q3ScrollView { Q_OBJECT public: @@ -244,12 +250,12 @@ class KOCalEditView : public QScrollView private: QWidget *mw; - void toggleList ( QPtrList<KOCalCheckButton> , bool b = true ); - QPtrList<KOCalRadioButton> mStdandardB; - QPtrList<KOCalCheckButton> mEnabledB; - QPtrList<KOCalCheckButton> mAlarmB; - QPtrList<KOCalCheckButton> mROB; - QGridLayout* mainLayout; + void toggleList ( Q3PtrList<KOCalCheckButton> , bool b = true ); + Q3PtrList<KOCalRadioButton> mStdandardB; + Q3PtrList<KOCalCheckButton> mEnabledB; + Q3PtrList<KOCalCheckButton> mAlarmB; + Q3PtrList<KOCalCheckButton> mROB; + Q3GridLayout* mainLayout; }; diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp index 79b97e8..63d044c 100644 --- a/korganizer/koimportoldialog.cpp +++ b/korganizer/koimportoldialog.cpp @@ -22,20 +22,20 @@ */ #include <qtooltip.h> -#include <qframe.h> +#include <q3frame.h> #include <qpixmap.h> #include <qlayout.h> -#include <qprogressbar.h> -#include <qprogressdialog.h> -#include <qwidgetstack.h> +#include <q3progressbar.h> +#include <q3progressdialog.h> +#include <q3widgetstack.h> #include <qdatetime.h> #include <qdir.h> #include <qapplication.h> -#include <qhbox.h> +#include <q3hbox.h> #include <qregexp.h> -#include <qheader.h> +#include <q3header.h> #include <qdatetime.h> -#include <qlistview.h> +#include <q3listview.h> #include <kdebug.h> #include <klocale.h> @@ -70,13 +70,13 @@ QDateTime mDdate2Qdtr( DATE dt) return qdt; } -class OLEListViewItem : public QCheckListItem +class OLEListViewItem : public Q3CheckListItem { public: - OLEListViewItem( QListView *parent, QString text ) : - QCheckListItem( parent, text, QCheckListItem::CheckBox ) { mData = 0; }; - OLEListViewItem( QListViewItem *after, QString text ) : - QCheckListItem( after, text, QCheckListItem::CheckBox ) { mData = 0; }; + OLEListViewItem( Q3ListView *parent, QString text ) : + Q3CheckListItem( parent, text, Q3CheckListItem::CheckBox ) { mData = 0; }; + OLEListViewItem( Q3ListViewItem *after, QString text ) : + Q3CheckListItem( after, text, Q3CheckListItem::CheckBox ) { mData = 0; }; ~OLEListViewItem() {}; void setData( DWORD data ) {mData= data; }; DWORD data() { return mData ;}; @@ -89,9 +89,9 @@ KOImportOLdialog::KOImportOLdialog( const QString &caption, KDialogBase( Plain, caption, User1 | Close, Ok, parent, caption, true, false, i18n("Import!") ) { - QHBox * mw = new QHBox( this ); + Q3HBox * mw = new Q3HBox( this ); setMainWidget( mw ); - mListView = new QListView( mw ); + mListView = new Q3ListView( mw ); mListView->addColumn(i18n("Select Folder to import")); mListView->addColumn(i18n("Content Type")); mCalendar = calendar; @@ -212,7 +212,7 @@ void KOImportOLdialog::readCalendarData( DWORD folder ) LPDISPATCH itm; int i; folderItems = mf.GetItems(); - QProgressDialog bar( i18n("Importing calendar data"),i18n("Abort"), folderItems.GetCount(),this ); + Q3ProgressDialog bar( i18n("Importing calendar data"),i18n("Abort"), folderItems.GetCount(),this ); bar.setCaption (i18n("Importing!") ); int h = bar.sizeHint().height() ; int w = 300; diff --git a/korganizer/koimportoldialog.h b/korganizer/koimportoldialog.h index c8847c5..d66f099 100644 --- a/korganizer/koimportoldialog.h +++ b/korganizer/koimportoldialog.h @@ -31,7 +31,7 @@ class QDateTime; -class QListView; +class Q3ListView; class OLEListViewItem; class _AppointmentItem; namespace KPIM { class CategorySelectDialog; } @@ -72,7 +72,7 @@ class KOImportOLdialog : public KDialogBase void ol2kopiCalendar( _AppointmentItem * , bool computeRecurrence = true ); Calendar *mCalendar; - QListView * mListView; + Q3ListView * mListView; QString getUidByEmail( QString email ); private: diff --git a/korganizer/koincidenceeditor.cpp b/korganizer/koincidenceeditor.cpp index 236f6f9..2060ea1 100644 --- a/korganizer/koincidenceeditor.cpp +++ b/korganizer/koincidenceeditor.cpp @@ -22,12 +22,14 @@ */ #include <qtooltip.h> -#include <qframe.h> +#include <q3frame.h> #include <qpixmap.h> #include <qlayout.h> -#include <qwidgetstack.h> +#include <q3widgetstack.h> #include <qdatetime.h> #include <qdir.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kdebug.h> #include <klocale.h> @@ -82,9 +84,9 @@ KOIncidenceEditor::~KOIncidenceEditor() void KOIncidenceEditor::setupAttendeesTab() { - QFrame *topFrame = addPage(i18n("Attendees")); + Q3Frame *topFrame = addPage(i18n("Attendees")); - QBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); mDetails = new KOEditorDetails(spacingHint()-2,topFrame); topLayout->addWidget(mDetails); diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index 406df5a..51594ff 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp @@ -25,13 +25,19 @@ // View of Journal entries #include <qlayout.h> -#include <qscrollview.h> -#include <qpopupmenu.h> -#include <qhbox.h> +#include <q3scrollview.h> +#include <q3popupmenu.h> +#include <q3hbox.h> #include <qpushbutton.h> #include <qlabel.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QPixmap> +#include <Q3PtrList> +#include <QKeyEvent> +#include <Q3VBoxLayout> #include <klocale.h> #include <kdebug.h> @@ -51,7 +57,7 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, : KOrg::BaseView(calendar, parent, name) { mCalendar = calendar; - QHBox * vb = new QHBox ( this ); + Q3HBox * vb = new Q3HBox ( this ); QPushButton * newJournal = new QPushButton( vb ); QPixmap icon; if ( QApplication::desktop()->width() < 321 ) @@ -63,15 +69,15 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, newJournal->setFixedSize( size, size ); mDateLabel = new QLabel ( vb ); mDateLabel->setMargin(1); - mDateLabel->setAlignment(AlignCenter); - QScrollView * sv = new QScrollView( this ); - QVBoxLayout * hbl = new QVBoxLayout( this ); + mDateLabel->setAlignment(Qt::AlignCenter); + Q3ScrollView * sv = new Q3ScrollView( this ); + Q3VBoxLayout * hbl = new Q3VBoxLayout( this ); hbl->addWidget( vb ); hbl->addWidget( sv ); parWid = new QWidget( sv->viewport() ); sv->addChild(parWid); - sv->setResizePolicy( QScrollView:: AutoOneFit ); - mTopLayout = new QVBoxLayout(parWid); + sv->setResizePolicy( Q3ScrollView:: AutoOneFit ); + mTopLayout = new Q3VBoxLayout(parWid); connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) ); getNewEntry(); } @@ -96,9 +102,9 @@ JournalEntry* KOJournalView::getNewEntry() return Entry; } -QPtrList<Incidence> KOJournalView::selectedIncidences() +Q3PtrList<Incidence> KOJournalView::selectedIncidences() { - QPtrList<Incidence> eventList; + Q3PtrList<Incidence> eventList; return eventList; } @@ -162,13 +168,13 @@ void KOJournalView::showOnly ( Journal* j ) showDates( mDate, QDate() ); return; } - QPtrList<Journal> jl; + Q3PtrList<Journal> jl; jl.append ( j ); showList( jl ); JournalEntry* mEntry = jEntries.first(); mEntry->setShowOnly(); } -void KOJournalView::showList(QPtrList<Journal> jl) +void KOJournalView::showList(Q3PtrList<Journal> jl) { static bool ff = false; if ( ff ) return; @@ -225,11 +231,11 @@ void KOJournalView::showDates(const QDate &start, const QDate &) { mDate = start; mDateLabel->setText(KGlobal::locale()->formatDate(mDate)); - QPtrList<Journal> jl = calendar()->journals4Date( start ); + Q3PtrList<Journal> jl = calendar()->journals4Date( start ); showList( jl ); } -void KOJournalView::showEvents(QPtrList<Event>) +void KOJournalView::showEvents(Q3PtrList<Event>) { // After new creation of list view no events are selected. // emit incidenceSelected( 0 ); diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h index 7fa94ae..22f26cd 100644 --- a/korganizer/kojournalview.h +++ b/korganizer/kojournalview.h @@ -25,6 +25,11 @@ #include <korganizer/baseview.h> #include <qlayout.h> +//Added by qt3to4: +#include <QKeyEvent> +#include <Q3PtrList> +#include <QLabel> +#include <Q3BoxLayout> class JournalEntry; class QLabel; @@ -46,7 +51,7 @@ class KOJournalView : public KOrg::BaseView virtual int currentDateCount(); void clearList(); - virtual QPtrList<Incidence> selectedIncidences(); + virtual Q3PtrList<Incidence> selectedIncidences(); DateList selectedDates() {DateList q; return q;}; @@ -60,17 +65,17 @@ class KOJournalView : public KOrg::BaseView void flushView(); void updateConfig(); void showDates( const QDate &start, const QDate &end ); - void showEvents(QPtrList<Event> eventList); + void showEvents(Q3PtrList<Event> eventList); void changeEventDisplay(Event *, int); private: - void showList(QPtrList<Journal> jl); + void showList(Q3PtrList<Journal> jl); Calendar *mCalendar; JournalEntry* getNewEntry(); - QPtrList<JournalEntry> jEntries; + Q3PtrList<JournalEntry> jEntries; void keyPressEvent ( QKeyEvent * ) ; - QBoxLayout *mTopLayout; + Q3BoxLayout *mTopLayout; QWidget *parWid; QLabel * mDateLabel; QDate mDate; diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 192f8c0..0ea1d50 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -22,20 +22,29 @@ without including the source code for Qt in the source distribution. */ -#include <qlistview.h> +#include <q3listview.h> #include <qlayout.h> #include <qlabel.h> -#include <qpopupmenu.h> -#include <qprogressbar.h> +#include <q3popupmenu.h> +#include <q3progressbar.h> #include <qfileinfo.h> #include <qmessagebox.h> #include <qdialog.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qdir.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> #include <qregexp.h> #include <qpainter.h> -#include <qpaintdevicemetrics.h> +#include <q3paintdevicemetrics.h> +//Added by qt3to4: +#include <QPixmap> +#include <QMouseEvent> +#include <QKeyEvent> +#include <QEvent> +#include <Q3VBoxLayout> +#include <Q3PtrList> + +#include<QDesktopWidget> #include <klocale.h> #include <kdebug.h> @@ -70,10 +79,10 @@ extern QPixmap* sgListViewCompletedPix[6]; extern QPixmap* sgListViewJournalPix; -class KOListViewWhatsThis :public QWhatsThis +class KOListViewWhatsThis :public Q3WhatsThis { public: - KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; + KOListViewWhatsThis( QWidget *wid, KOListView* view ) : Q3WhatsThis( wid ), _wid(wid),_view (view) { }; protected: virtual QString text( const QPoint& p) @@ -274,29 +283,29 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, mListView->addColumn(i18n("Calendar")); mListView->addColumn(i18n("Last Modified")); - mListView->setColumnAlignment(0,AlignLeft); - mListView->setColumnAlignment(1,AlignLeft); - mListView->setColumnAlignment(2,AlignHCenter); - mListView->setColumnAlignment(3,AlignLeft); - mListView->setColumnAlignment(4,AlignHCenter); - mListView->setColumnAlignment(5,AlignLeft); - mListView->setColumnAlignment(6,AlignLeft); - mListView->setColumnAlignment(7,AlignLeft); - mListView->setColumnAlignment(8,AlignLeft); - mListView->setColumnAlignment(9,AlignLeft); - mListView->setColumnAlignment(10,AlignLeft); - mListView->setColumnAlignment(11,AlignLeft); + mListView->setColumnAlignment(0,Qt::AlignLeft); + mListView->setColumnAlignment(1,Qt::AlignLeft); + mListView->setColumnAlignment(2,Qt::AlignHCenter); + mListView->setColumnAlignment(3,Qt::AlignLeft); + mListView->setColumnAlignment(4,Qt::AlignHCenter); + mListView->setColumnAlignment(5,Qt::AlignLeft); + mListView->setColumnAlignment(6,Qt::AlignLeft); + mListView->setColumnAlignment(7,Qt::AlignLeft); + mListView->setColumnAlignment(8,Qt::AlignLeft); + mListView->setColumnAlignment(9,Qt::AlignLeft); + mListView->setColumnAlignment(10,Qt::AlignLeft); + mListView->setColumnAlignment(11,Qt::AlignLeft); mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); int iii = 0; for ( iii = 0; iii< 12 ; ++iii ) - mListView->setColumnWidthMode( iii, QListView::Manual ); + mListView->setColumnWidthMode( iii, Q3ListView::Manual ); - QBoxLayout *layoutTop = new QVBoxLayout(this); + Q3BoxLayout *layoutTop = new Q3VBoxLayout(this); layoutTop->addWidget(mListView); mListView->setFont ( KOPrefs::instance()->mListViewFont ); mPopupMenu = eventPopup(); - QPopupMenu* selPopup = new QPopupMenu ( this ); + Q3PopupMenu* selPopup = new Q3PopupMenu ( this ); mPopupMenu->insertSeparator(); selPopup->insertItem(i18n("All"),this, @@ -306,20 +315,20 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, selPopup->insertItem(i18n("Delete selected..."),this, SLOT(deleteAll())); mPopupMenu->insertItem(i18n("Selection"), selPopup ); - mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + mPopupMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Hide all selected"),this, SLOT(hideAll()),true); selPopup->insertSeparator(); - QPopupMenu * exportPO = new QPopupMenu ( this ); + Q3PopupMenu * exportPO = new Q3PopupMenu ( this ); selPopup->insertItem( i18n("Export"), exportPO ); #ifdef DESKTOP_VERSION mPopupMenu->insertSeparator(); - mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + mPopupMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Print complete list..."),this, SLOT(printList()),true); #endif - mCalPopup = new QPopupMenu ( this ); + mCalPopup = new Q3PopupMenu ( this ); selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); selPopup->insertItem(i18n("Set categories")+"...",this, @@ -327,10 +336,10 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, selPopup->insertItem( i18n("Set alarm..."),this, SLOT(setAlarm())); #if 0 - mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + mPopupMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Set categories")+"...",this, SLOT(setCat()),true); - mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + mPopupMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Set alarm..."),this, SLOT(setAlarm()),true); #endif @@ -356,7 +365,7 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, selPopup->insertItem( i18n("Beam via IR..."),this, SLOT(beamSelected())); #if 0 - mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + mPopupMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Beam via IR"),this, SLOT(beamSelected()),true); #endif @@ -375,13 +384,13 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, */ QObject::connect(mListView,SIGNAL( newEvent()), this,SIGNAL(signalNewEvent())); - QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), - this,SLOT(defaultItemAction(QListViewItem *))); - QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, + QObject::connect(mListView,SIGNAL(doubleClicked(Q3ListViewItem *)), + this,SLOT(defaultItemAction(Q3ListViewItem *))); + QObject::connect(mListView,SIGNAL(rightButtonPressed( Q3ListViewItem *, const QPoint &, int )), - this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); - QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), - SLOT(processSelectionChange(QListViewItem *))); + this,SLOT(popupMenu(Q3ListViewItem *,const QPoint &,int))); + QObject::connect(mListView,SIGNAL(currentChanged(Q3ListViewItem *)), + SLOT(processSelectionChange(Q3ListViewItem *))); QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), SIGNAL(showIncidenceSignal(Incidence *)) ); @@ -428,7 +437,7 @@ void KOListView::setCalendar( int c ) return; } - QPtrList<Incidence> delSel = getSelectedIncidences() ; + Q3PtrList<Incidence> delSel = getSelectedIncidences() ; int icount = delSel.count(); if ( icount ) { Incidence *incidence = delSel.first(); @@ -442,7 +451,7 @@ void KOListView::setCalendar( int c ) incidence = delSel.next(); } } - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); while ( cal ) { mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); @@ -497,7 +506,7 @@ void KOListView::setAlarm() KOAlarmPrefs kap( this); if ( !kap.exec() ) return; - QPtrList<Incidence> delSel = getSelectedIncidences( true, true, false, true ); // no journals, only due todos + Q3PtrList<Incidence> delSel = getSelectedIncidences( true, true, false, true ); // no journals, only due todos Incidence* inc = delSel.first(); int count = 0; while ( inc ) { @@ -522,7 +531,7 @@ void KOListView::setAlarm() else alarm->setType(Alarm::Invalid); } else { - QPtrList<Alarm> alarms = inc->alarms(); + Q3PtrList<Alarm> alarms = inc->alarms(); Alarm *alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { alarm->setEnabled(false); @@ -552,7 +561,7 @@ void KOListView::setCategories( bool removeOld ) } QStringList catList = csd->selectedCategories(); delete csd; - QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; + Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; Incidence* inc = delSel.first(); while ( inc ) { if ( removeOld ) { @@ -572,7 +581,7 @@ void KOListView::setCategories( bool removeOld ) void KOListView::beamSelected() { - QPtrList<Incidence> delSel = getSelectedIncidences() ; + Q3PtrList<Incidence> delSel = getSelectedIncidences() ; if ( delSel.count() ) emit beamIncidenceList( delSel ); } @@ -587,7 +596,7 @@ void KOListView::saveDescriptionToFile() if ( result != 0 ) { return; } - QPtrList<Incidence> delSel = getSelectedIncidences() ; + Q3PtrList<Incidence> delSel = getSelectedIncidences() ; int icount = delSel.count(); if ( icount ) { QString fn = KOPrefs::instance()->mLastSaveFile; @@ -645,11 +654,11 @@ void KOListView::saveDescriptionToFile() incidence = delSel.next(); } QFile file( fn ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); return; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts << text; file.close(); //qDebug("%s ", text.latin1()); @@ -667,12 +676,12 @@ void KOListView::saveToFile() { writeToFile( true ); } -QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool includeTodos, bool includeJournals, bool onlyDueTodos ) +Q3PtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool includeTodos, bool includeJournals, bool onlyDueTodos ) { - QPtrList<Incidence> delSel ; + Q3PtrList<Incidence> delSel ; bool addSubTodos = false; bool askSubTodos = true; - QListViewItem *item = mListView->firstChild (); + Q3ListViewItem *item = mListView->firstChild (); while ( item ) { if ( item->isSelected() ) { Incidence* inc = ((KOListViewItem *)item)->data(); @@ -706,7 +715,7 @@ QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool askSubTodos = false; } if ( addSubTodos ) { - QPtrList<Incidence> tempSel ; + Q3PtrList<Incidence> tempSel ; inc->addRelationsToList( &tempSel ); Incidence* tempinc = tempSel.first(); while ( tempinc ) { @@ -730,7 +739,7 @@ QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool void KOListView::writeToFile( bool iCal ) { - QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; + Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; if ( !iCal ) { bool journal = false; Incidence *incidence = delSel.first(); @@ -803,8 +812,8 @@ void KOListView::writeToFile( bool iCal ) } void KOListView::hideAll() { - QPtrList<QListViewItem> delSel ; - QListViewItem *item = mListView->firstChild (); + Q3PtrList<Q3ListViewItem> delSel ; + Q3ListViewItem *item = mListView->firstChild (); while ( item ) { if ( item->isSelected() ) { delSel.append(item); @@ -813,7 +822,7 @@ void KOListView::hideAll() } item = delSel.first() ; while ( item ) { - QListViewItem * del = item; + Q3ListViewItem * del = item; item = delSel.next(); delete del; } @@ -824,7 +833,7 @@ void KOListView::printList() } void KOListView::deleteAll() { - QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;; + Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;; if ( delSel.count() ) { int icount = delSel.count(); Incidence *incidence = delSel.first(); @@ -838,11 +847,11 @@ void KOListView::deleteAll() int delCounter = 0; QDialog dia ( this, "p-dialog", true ); QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); - QVBoxLayout lay( &dia ); + Q3VBoxLayout lay( &dia ); lay.setMargin(7); lay.setSpacing(7); lay.addWidget( &lab); - QProgressBar bar( icount, &dia ); + Q3ProgressBar bar( icount, &dia ); lay.addWidget( &bar); int w = 220; int h = 50; @@ -884,10 +893,10 @@ int KOListView::currentDateCount() return 0; } -QPtrList<Incidence> KOListView::selectedIncidences() +Q3PtrList<Incidence> KOListView::selectedIncidences() { - QPtrList<Incidence> eventList; - QListViewItem *item = mListView->firstChild (); + Q3PtrList<Incidence> eventList; + Q3ListViewItem *item = mListView->firstChild (); while ( item ) { if ( item->isSelected() ) { eventList.append(((KOListViewItem *)item)->data()); @@ -987,7 +996,7 @@ void KOListView::showDates(const QDate &start, const QDate &end) } -void KOListView::addEvents(QPtrList<Event> eventList) +void KOListView::addEvents(Q3PtrList<Event> eventList) { Event *ev; @@ -999,7 +1008,7 @@ void KOListView::addEvents(QPtrList<Event> eventList) } } -void KOListView::addTodos(QPtrList<Todo> eventList) +void KOListView::addTodos(Q3PtrList<Todo> eventList) { Todo *ev; for(ev = eventList.first(); ev; ev = eventList.next()) { @@ -1009,7 +1018,7 @@ void KOListView::addTodos(QPtrList<Todo> eventList) updateView(); } } -void KOListView::addJournals(QPtrList<Journal> eventList) +void KOListView::addJournals(Q3PtrList<Journal> eventList) { Journal *ev; for(ev = eventList.first(); ev; ev = eventList.next()) { @@ -1044,7 +1053,7 @@ void KOListView::addIncidence(Incidence *incidence) else delete item; } -void KOListView::showEvents(QPtrList<Event> eventList) +void KOListView::showEvents(Q3PtrList<Event> eventList) { clear(); @@ -1095,14 +1104,14 @@ KOListViewItem *KOListView::getItemForEvent(Incidence *event) return 0; } -void KOListView::defaultItemAction(QListViewItem *i) +void KOListView::defaultItemAction(Q3ListViewItem *i) { KOListViewItem *item = static_cast<KOListViewItem *>( i ); if ( item ) defaultAction( item->data() ); } -void KOListView::popupMenu(QListViewItem *item,const QPoint &,int) +void KOListView::popupMenu(Q3ListViewItem *item,const QPoint &,int) { mActiveItem = (KOListViewItem *)item; if (mActiveItem) { @@ -1131,7 +1140,7 @@ void KOListView::writeSettings(KConfig *config, QString setting) mListView->saveLayout(config, setting); } -void KOListView::processSelectionChange(QListViewItem *) +void KOListView::processSelectionChange(Q3ListViewItem *) { KOListViewItem *item = @@ -1180,8 +1189,8 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) switch ( e->key() ) { case Qt::Key_Down: - if ( e->state() == ShiftButton ) { - QListViewItem* cn = currentItem(); + if ( e->state() == Qt::ShiftButton ) { + Q3ListViewItem* cn = currentItem(); if ( !cn ) cn = firstChild(); if ( !cn ) @@ -1194,10 +1203,10 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) e->accept(); return; } - if ( e->state() == ControlButton ) { + if ( e->state() == Qt::ControlButton ) { int count = childCount (); int jump = count / 5; - QListViewItem* cn; + Q3ListViewItem* cn; cn = currentItem(); if ( ! cn ) return; @@ -1211,13 +1220,13 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) ensureItemVisible ( cn ); } else - QListView::keyPressEvent ( e ) ; + Q3ListView::keyPressEvent ( e ) ; e->accept(); break; case Qt::Key_Up: - if ( e->state() == ShiftButton ) { - QListViewItem* cn = firstChild(); + if ( e->state() == Qt::ShiftButton ) { + Q3ListViewItem* cn = firstChild(); if ( cn ) { setCurrentItem ( cn ); ensureItemVisible ( cn ); @@ -1225,10 +1234,10 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) e->accept(); return; } - if ( e->state() == ControlButton ) { + if ( e->state() == Qt::ControlButton ) { int count = childCount (); int jump = count / 5; - QListViewItem* cn; + Q3ListViewItem* cn; cn = currentItem(); if ( ! cn ) return; @@ -1241,11 +1250,11 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) setCurrentItem ( cn ); ensureItemVisible ( cn ); } else - QListView::keyPressEvent ( e ) ; + Q3ListView::keyPressEvent ( e ) ; e->accept(); break; case Qt::Key_I: { - QListViewItem* cn; + Q3ListViewItem* cn; cn = currentItem(); if ( cn ) { KOListViewItem* ci = (KOListViewItem*)( cn ); @@ -1265,12 +1274,12 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) case Qt::Key_Return: case Qt::Key_Enter: { - QListViewItem* cn; + Q3ListViewItem* cn; cn = currentItem(); if ( cn ) { KOListViewItem* ci = (KOListViewItem*)( cn ); if ( ci ){ - if ( e->state() == ShiftButton ) + if ( e->state() == Qt::ShiftButton ) ci->setSelected( false ); else ci->setSelected( true ); @@ -1300,12 +1309,12 @@ KOListViewListView::KOListViewListView(KOListView * lv ) #ifndef DESKTOP_VERSION //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); #endif - setSelectionMode( QListView::Multi ); + setSelectionMode( Q3ListView::Multi ); setMultiSelection( true); } -bool KOListViewListView::hasMultiSelection(QListViewItem* item) +bool KOListViewListView::hasMultiSelection(Q3ListViewItem* item) { - QListViewItem *qitem = firstChild (); + Q3ListViewItem *qitem = firstChild (); while ( qitem ) { if ( qitem->isSelected() && item != qitem ) return true; @@ -1317,7 +1326,7 @@ void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) { if (!e) return; QPoint vp = contentsToViewport(e->pos()); - QListViewItem *item = itemAt(vp); + Q3ListViewItem *item = itemAt(vp); if (!item) { emit newEvent(); return; @@ -1329,8 +1338,8 @@ void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) { //qDebug("contentsMousePressEvent++++ "); KListView::contentsMousePressEvent( e ); - if ( e->button() == RightButton ) { - QListViewItem* ci = currentItem(); + if ( e->button() == Qt::RightButton ) { + Q3ListViewItem* ci = currentItem(); clearSelection () ; if ( ci ) ci->setSelected( true ); @@ -1348,7 +1357,7 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) void KOListViewListView::popupMenu() { mPopupTimer->stop(); - QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton ); + QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, Qt::RightButton , Qt::RightButton ); QApplication::postEvent( this->viewport(), e ); } @@ -1356,14 +1365,14 @@ void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) { //qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y()); mYMousePos = mapToGlobal( (e->pos())).y(); - if ( e->button() == LeftButton ) { + if ( e->button() == Qt::LeftButton ) { mPopupTimer->start( 600 ); mEventPos = contentsToViewport(e->pos()); mEventGlobalPos = e->globalPos(); } KListView::contentsMousePressEvent( e ); - if ( e->button() == RightButton ) { - QListViewItem* ci = currentItem(); + if ( e->button() == Qt::RightButton ) { + Q3ListViewItem* ci = currentItem(); //clearSelection(); if ( ci ) ci->setSelected( true ); @@ -1390,7 +1399,7 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) } #define protected public -#include <qheader.h> +#include <q3header.h> #undef protected void KOListViewListView::printList() { @@ -1407,7 +1416,7 @@ void KOListViewListView::printList() QPainter p; p.begin ( &printer ); p.setFont(font()); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); @@ -1443,7 +1452,7 @@ void KOListViewListView::printList() p.save(); for ( iii = 0; iii < cou; ++iii ) { int align = columnAlignment( iii ); - if ( align == AlignAuto ) align = AlignLeft; + if ( align == Qt::AlignLeft ) align = Qt::AlignLeft; p.restore(); p.save(); p.translate( header()->sectionPos( iii ), 0); diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h index 99d0561..9fb0b00 100644 --- a/korganizer/kolistview.h +++ b/korganizer/kolistview.h @@ -24,9 +24,15 @@ #ifndef _KOLISTVIEW_H #define _KOLISTVIEW_H -#include <qlistview.h> +#include <q3listview.h> #include <qmap.h> -#include <qdict.h> +#include <q3dict.h> +//Added by qt3to4: +#include <QMouseEvent> +#include <Q3PtrList> +#include <Q3PopupMenu> +#include <QKeyEvent> +#include <Q3VBoxLayout> #include <klistview.h> @@ -47,7 +53,7 @@ class KOListViewWhatsThis; #include <qspinbox.h> #include <qtooltip.h> #include <qcheckbox.h> -#include <qhbox.h> +#include <q3hbox.h> #include <qlabel.h> #include <kiconloader.h> #include "kfiledialog.h" @@ -60,7 +66,7 @@ class KOAlarmPrefs : public QDialog QDialog( par, name, true ) { setCaption( i18n("Alarm Options") ); - QVBoxLayout* alarmLayout = new QVBoxLayout( this ); + Q3VBoxLayout* alarmLayout = new Q3VBoxLayout( this ); alarmLayout->setSpacing( 3 ); alarmLayout->setMargin( 3 ); QWidget *parent = this; @@ -74,7 +80,7 @@ class KOAlarmPrefs : public QDialog mAlarmIncrCombo->insertItem(i18n("hour(s)")); mAlarmIncrCombo->insertItem(i18n("day(s)")); alarmLayout->addWidget(mAlarmIncrCombo); - QHBox * hb = new QHBox ( parent ); + Q3HBox * hb = new Q3HBox ( parent ); alarmLayout->addWidget(hb); mAlarmSoundButton = new QPushButton(hb); mAlarmSoundButton->setPixmap(SmallIcon("playsound")); @@ -210,7 +216,7 @@ class KOListViewListView : public KListView Q_OBJECT public: KOListViewListView(KOListView * lv ); - bool hasMultiSelection(QListViewItem*); + bool hasMultiSelection(Q3ListViewItem*); void printList(); signals: void newEvent(); @@ -240,13 +246,13 @@ class KOListView : public KOEventView virtual int maxDatesHint(); virtual int currentDateCount(); - virtual QPtrList<Incidence> selectedIncidences(); + virtual Q3PtrList<Incidence> selectedIncidences(); virtual DateList selectedDates(); void showDates(bool show); Incidence* currentItem(); - void addTodos(QPtrList<Todo> eventList); - void addJournals(QPtrList<Journal> eventList); + void addTodos(Q3PtrList<Todo> eventList); + void addJournals(Q3PtrList<Journal> eventList); virtual void printPreview(CalPrinter *calPrinter, const QDate &, const QDate &); @@ -257,11 +263,11 @@ class KOListView : public KOEventView void setStartDate(const QDate &start); int count(); QString getWhatsThisText(QPoint p); - QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false ); + Q3PtrList<Incidence> getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false ); void showCompletedTodos(); signals: void signalNewEvent(); - void beamIncidenceList(QPtrList<Incidence>); + void beamIncidenceList(Q3PtrList<Incidence>); public slots: void hideAll(); @@ -269,7 +275,7 @@ class KOListView : public KOEventView void resetFocus(); virtual void updateView(); virtual void showDates(const QDate &start, const QDate &end); - virtual void showEvents(QPtrList<Event> eventList); + virtual void showEvents(Q3PtrList<Event> eventList); void clearSelection(); void allSelection(); @@ -287,29 +293,29 @@ class KOListView : public KOEventView void setCategories( bool removeOld ); void changeEventDisplay(Event *, int); - void defaultItemAction(QListViewItem *item); - void popupMenu(QListViewItem *item,const QPoint &,int); + void defaultItemAction(Q3ListViewItem *item); + void popupMenu(Q3ListViewItem *item,const QPoint &,int); void setCalendar( int c ); void populateCalPopup(); protected slots: - void processSelectionChange(QListViewItem *); + void processSelectionChange(Q3ListViewItem *); void catChanged( Incidence* ); protected: void writeToFile( bool iCal ); - void addEvents(QPtrList<Event> eventList); + void addEvents(Q3PtrList<Event> eventList); void addIncidence(Incidence *); KOListViewItem *getItemForEvent(Incidence *event); private: bool mForceShowCompletedTodos; - QPopupMenu* mCalPopup; + Q3PopupMenu* mCalPopup; KOListViewWhatsThis *mKOListViewWhatsThis; KOListViewListView *mListView; KOEventPopupMenu *mPopupMenu; KOListViewItem *mActiveItem; - QDict<Incidence> mUidDict; + Q3Dict<Incidence> mUidDict; QDate mStartDate; void keyPressEvent ( QKeyEvent * ) ; }; diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 85e9166..ca55c43 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -17,22 +17,34 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qfont.h> #include <qfontmetrics.h> -#include <qkeycode.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qwidgetstack.h> +#include <qnamespace.h> +#include <q3hbox.h> +#include <q3vbox.h> +#include <q3widgetstack.h> #include <qpushbutton.h> #include <qtooltip.h> #include <qpainter.h> #include <qtimer.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #else #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> +#include <QPixmap> +#include <QFocusEvent> +#include <QMouseEvent> +#include <QKeyEvent> +#include <Q3VBoxLayout> +#include <Q3Frame> +#include <Q3PointArray> +#include <Q3PtrList> #endif #include <kdebug.h> @@ -59,10 +71,10 @@ #ifdef DESKTOP_VERSION QToolTipGroup *MonthViewCell::mToolTipGroup = 0; #endif -class KNOWhatsThis :public QWhatsThis +class KNOWhatsThis :public Q3WhatsThis { public: - KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; + KNOWhatsThis( KNoScrollListBox* sbox ) : Q3WhatsThis( sbox ), _wid( sbox) { }; //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; protected: @@ -77,7 +89,7 @@ private: KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) - : QListBox(parent, name, WRepaintNoErase) + : Q3ListBox(parent, name, Qt::WNoAutoErase) { #ifndef DESKTOP_VERSION QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); @@ -85,8 +97,8 @@ KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) mBlockDeselect = false; mWT = new KNOWhatsThis(this); resetOnFocusIn = true; - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } KNoScrollListBox::~KNoScrollListBox() { @@ -100,7 +112,7 @@ KNoScrollListBox::~KNoScrollListBox() void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) { - QListBox::focusInEvent ( e ); + Q3ListBox::focusInEvent ( e ); if ( count() ){ int ci = currentItem(); if ( ci < 0 ) ci = 0; @@ -112,24 +124,24 @@ void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) resetOnFocusIn = true; if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) { - QListBoxItem *fi = firstItem (); + Q3ListBoxItem *fi = firstItem (); if (fi ) { int ihei = fi->height( this ); int hei = numRows () * ihei; if ( hei < height() - horizontalScrollBar()->height () ) { - setVScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); } else - setVScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); if ( ihei *3 > height() ) { - setHScrollBarMode(QScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } else { - setHScrollBarMode(QScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } else { - setVScrollBarMode(QScrollView::Auto); - setHScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } } @@ -141,10 +153,10 @@ void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) if ( i >= 0 ) { setSelected ( i, false ); } - QListBox::focusOutEvent ( e ); + Q3ListBox::focusOutEvent ( e ); } - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); if ( ! mBlockDeselect ) emit highlightIncidence( 0, (MonthViewCell*)this, 0 ); mBlockDeselect = false; @@ -152,7 +164,7 @@ void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) QString KNoScrollListBox::getWhatsThisText(QPoint p) { - QListBoxItem* item = itemAt ( p ); + Q3ListBoxItem* item = itemAt ( p ); if ( ! item ) { return i18n("Click in the cell\nto add an event!"); } @@ -165,7 +177,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) { //qDebug("KNoScrollListBox::keyPressEvent "); switch(e->key()) { - case Key_Right: + case Qt::Key_Right: if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { e->ignore(); @@ -173,7 +185,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } scrollBy(10,0); break; - case Key_Left: + case Qt::Key_Left: if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { e->ignore(); @@ -181,7 +193,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } scrollBy(-10,0); break; - case Key_Up: + case Qt::Key_Up: if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { e->ignore(); break; @@ -201,7 +213,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } } break; - case Key_Down: + case Qt::Key_Down: if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { e->ignore(); break; @@ -221,12 +233,12 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } } break; - case Key_I: + case Qt::Key_I: QTimer::singleShot( 1, this, SLOT ( oneDown() ) ); e->ignore(); break; - case Key_Return: - case Key_Enter: + case Qt::Key_Return: + case Qt::Key_Enter: { if ( currentItem() >= 0 ) { emit doubleClicked( item( currentItem() ) ); @@ -236,7 +248,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } } break; - case Key_Shift: + case Qt::Key_Shift: emit shiftDown(); break; default: @@ -266,7 +278,7 @@ void KNoScrollListBox::oneDown() void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) { switch(e->key()) { - case Key_Shift: + case Qt::Key_Shift: emit shiftUp(); break; default: @@ -276,15 +288,15 @@ void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) void KNoScrollListBox::mousePressEvent(QMouseEvent *e) { - QListBox::mousePressEvent(e); + Q3ListBox::mousePressEvent(e); - if(e->button() == RightButton) { + if(e->button() == Qt::RightButton) { emit rightClick(); } } MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s) - : QListBoxItem() + : Q3ListBoxItem() { mblockRepaint = true; isWeekItem = KOPrefs::instance()->mMonthViewWeek; @@ -395,14 +407,14 @@ void MonthViewItem::paint(QPainter *p) p->setBrush( QBrush( textColor ) ); p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; if ( mMultiday == 2 || mMultiday == 3 ) { - QPointArray pa ( 3 ); + Q3PointArray pa ( 3 ); pa.setPoint (0, x, yyy ); pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 ); pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 ); p->drawPolygon( pa ); } if ( mMultiday == 2 || mMultiday == 1 ) { - QPointArray pa ( 3 ); + Q3PointArray pa ( 3 ); pa.setPoint (0, x+sizeM +sizeM/2, yyy ); pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); @@ -462,7 +474,7 @@ void MonthViewItem::paint(QPainter *p) } } -int MonthViewItem::height(const QListBox *lb) const +int MonthViewItem::height(const Q3ListBox *lb) const { int ret = 10; if ( lb ) @@ -470,7 +482,7 @@ int MonthViewItem::height(const QListBox *lb) const return ret; } -int MonthViewItem::width(const QListBox *lb) const +int MonthViewItem::width(const Q3ListBox *lb) const { if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) { int size = PIXMAP_SIZE; @@ -514,10 +526,10 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) //mLabel->setLineWidth( 1 ); //mLabel->setAlignment( AlignCenter ); mLabel->setFlat( true ); - mLabel->setFocusPolicy(NoFocus); + mLabel->setFocusPolicy(Qt::NoFocus); //mItemList = new KNoScrollListBox( this ); setMinimumSize( 10, 10 ); - setFrameStyle( QFrame::Panel | QFrame::Plain ); + setFrameStyle( Q3Frame::Panel | Q3Frame::Plain ); setLineWidth( 1 ); //topLayout->addWidget( mItemList ); mLabel->raise(); @@ -529,13 +541,13 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) updateConfig(); //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); - connect( this , SIGNAL( doubleClicked( QListBoxItem *) ), - SLOT( defaultAction( QListBoxItem * ) ) ); - connect( this, SIGNAL( rightButtonPressed( QListBoxItem *, + connect( this , SIGNAL( doubleClicked( Q3ListBoxItem *) ), + SLOT( defaultAction( Q3ListBoxItem * ) ) ); + connect( this, SIGNAL( rightButtonPressed( Q3ListBoxItem *, const QPoint &) ), - SLOT( contextMenu( QListBoxItem * ) ) ); - connect( this, SIGNAL( highlighted( QListBoxItem *) ), - SLOT( selection( QListBoxItem * ) ) ); + SLOT( contextMenu( Q3ListBoxItem * ) ) ); + connect( this, SIGNAL( highlighted( Q3ListBoxItem *) ), + SLOT( selection( Q3ListBoxItem * ) ) ); /* connect( this, SIGNAL( clicked( QListBoxItem * ) ), @@ -545,7 +557,7 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) #ifdef DESKTOP_VERSION QToolTipGroup *MonthViewCell::toolTipGroup() { - if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); + /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */ return mToolTipGroup; } #endif @@ -637,7 +649,7 @@ void MonthViewCell::startUpdateCell() { blockSignals( true ); mdayCount = 0; - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); if ( !mMonthView->isUpdatePossible() ) return; MonthViewItem *mitem = (MonthViewItem*) firstItem (); @@ -692,7 +704,7 @@ int MonthViewCell::insertEvent(Event *event) useToolTips = false; #endif QString mToolTipText; - setFocusPolicy(WheelFocus); + setFocusPolicy(Qt::WheelFocus); if ( !(event->doesRecur() == Recurrence::rNone) ) { if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) return mdayCount; @@ -834,7 +846,7 @@ int MonthViewCell::insertEvent(Event *event) } for ( i = pos; i < itcount;++i ) { // qDebug("i %d mday %u count %d ",i,itcount,mdayCount ); - QListBoxItem* it = this->item ( i ); + Q3ListBoxItem* it = this->item ( i ); if ( it && text < it->text() ) { pos = i; break; @@ -850,7 +862,7 @@ int MonthViewCell::insertEvent(Event *event) } void MonthViewCell::insertTodo(Todo *todo) { - setFocusPolicy(WheelFocus); + setFocusPolicy(Qt::WheelFocus); QString text; if (todo->hasDueDate()) { if (!todo->doesFloat()) { @@ -922,7 +934,7 @@ void MonthViewCell::finishUpdateCell() #ifdef DESKTOP_VERSION if (mToolTip.count() > 0 ) { mToolTip.sort(); - QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); + /* TODO: hacker: QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); */ } #endif //sort(); @@ -938,13 +950,13 @@ void MonthViewCell::updateCell() return; startUpdateCell(); //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); - QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); + Q3PtrList<Event> events = mMonthView->calendar()->events( mDate, true ); Event *event; for( event = events.first(); event; event = events.next() ) { // for event insertEvent(event); } // insert due todos - QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); + Q3PtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { insertTodo( todo ); @@ -992,28 +1004,28 @@ void MonthViewCell::enableScrollBars( bool enabled ) return; if ( enabled ) { - QListBoxItem *fi = firstItem (); + Q3ListBoxItem *fi = firstItem (); if (fi ) { int ihei = fi->height( this ); int hei = numRows () * ihei; if ( hei < height() - horizontalScrollBar()->height () ) { - setVScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); } else - setVScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); if ( ihei *3 > height() ) { - setHScrollBarMode(QScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } else { - setHScrollBarMode(QScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } else { - setVScrollBarMode(QScrollView::Auto); - setHScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } else { - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } } @@ -1083,7 +1095,7 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e ) KNoScrollListBox::resizeEvent ( e ); } -void MonthViewCell::defaultAction( QListBoxItem *item ) +void MonthViewCell::defaultAction( Q3ListBoxItem *item ) { if ( !item ) { @@ -1105,7 +1117,7 @@ void MonthViewCell::newEvent() QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); emit newEventSignal( dt ); } -void MonthViewCell::cellClicked( QListBoxItem *item ) +void MonthViewCell::cellClicked( Q3ListBoxItem *item ) { mMonthView->setSelectedCell( this ); if ( item == 0 ) { @@ -1116,7 +1128,7 @@ void MonthViewCell::cellClicked( QListBoxItem *item ) } -void MonthViewCell::contextMenu( QListBoxItem *item ) +void MonthViewCell::contextMenu( Q3ListBoxItem *item ) { mMonthView->setPopupCell( this ); if ( !item ) { @@ -1133,7 +1145,7 @@ void MonthViewCell::contextMenu( QListBoxItem *item ) } } -void MonthViewCell::selection( QListBoxItem *item ) +void MonthViewCell::selection( Q3ListBoxItem *item ) { if ( !item ) { emit highlightIncidence( 0 , this, 0 ); @@ -1185,8 +1197,8 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) clPending = true; mPopupCell = 0; mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); - mWidStack = new QWidgetStack( this ); - QVBoxLayout* hb = new QVBoxLayout( this ); + mWidStack = new Q3WidgetStack( this ); + Q3VBoxLayout* hb = new Q3VBoxLayout( this ); mMonthView = new QWidget( mWidStack ); mWeekView = new QWidget( mWidStack ); #if QT_VERSION >= 0x030000 @@ -1215,15 +1227,15 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) for( i = 0; i < mDaysPerWeek; i++ ) { QLabel *label = new QLabel( mMonthView ); label->setFont(bfont); - label->setFrameStyle(QFrame::Panel|QFrame::Raised); + label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised); label->setLineWidth(1); - label->setAlignment(AlignCenter); + label->setAlignment(Qt::AlignCenter); mDayLabels.insert( i, label ); label = new QLabel( mWeekView ); label->setFont(bfont); - label->setFrameStyle(QFrame::Panel|QFrame::Raised); + label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised); label->setLineWidth(1); - label->setAlignment(AlignCenter); + label->setAlignment(Qt::AlignCenter); mDayLabelsW.insert( i, label ); } @@ -1232,34 +1244,34 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mWeekLabelsW.resize( 2 ); for( i = 0; i < mNumWeeks+1; i++ ) { KOWeekButton *label = new KOWeekButton( mMonthView ); - label->setFocusPolicy(NoFocus); + label->setFocusPolicy(Qt::NoFocus); label->setFont(bfont); connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); label->setFlat(true); - QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); + Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); //label->setFrameStyle(QFrame::Panel|QFrame::Raised); //label->setLineWidth(1); //label->setAlignment(AlignCenter); mWeekLabels.insert( i, label ); } mWeekLabels[mNumWeeks]->setText( i18n("W")); - mWeekLabels[mNumWeeks]->setFocusPolicy(WheelFocus); - QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); + mWeekLabels[mNumWeeks]->setFocusPolicy(Qt::WheelFocus); + Q3WhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); for( i = 0; i < 1+1; i++ ) { KOWeekButton *label = new KOWeekButton( mWeekView ); - label->setFocusPolicy(NoFocus); + label->setFocusPolicy(Qt::NoFocus); label->setFont(bfont); connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); label->setFlat(true); - QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); + Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); //label->setFrameStyle(QFrame::Panel|QFrame::Raised); //label->setLineWidth(1); //label->setAlignment(AlignCenter); mWeekLabelsW.insert( i, label ); } mWeekLabelsW[1]->setText( i18n("W")); - mWeekLabelsW[1]->setFocusPolicy(WheelFocus); + mWeekLabelsW[1]->setFocusPolicy(Qt::WheelFocus); int row, col; @@ -1305,13 +1317,13 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); mContextMenu = eventPopup(); - mContextMenu->addAdditionalItem(QIconSet(QPixmap()), + mContextMenu->addAdditionalItem(QIcon(QPixmap()), i18n("New Event..."),this, SLOT(slotNewEvent()),false); - mContextMenu->addAdditionalItem(QIconSet(QPixmap()), + mContextMenu->addAdditionalItem(QIcon(QPixmap()), i18n("New Todo..."),this, SLOT(slotNewTodo()),false); - mContextMenu->addAdditionalItem(QIconSet(QPixmap()), + mContextMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Journal"),this, SLOT(slotEditJournal()),false); @@ -1325,7 +1337,7 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) pathString += "icons16/"; } else pathString += "iconsmini/"; - mNewItemMenu = new QPopupMenu( this ); + mNewItemMenu = new Q3PopupMenu( this ); mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent())); mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false); mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false); @@ -1397,7 +1409,7 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int break; } } - QPtrVector<MonthViewCell> *cells; + Q3PtrVector<MonthViewCell> *cells; if ( weekview ) cells = &mCellsW; else { @@ -1495,9 +1507,9 @@ int KOMonthView::currentDateCount() return mNumCells; } -QPtrList<Incidence> KOMonthView::selectedIncidences() +Q3PtrList<Incidence> KOMonthView::selectedIncidences() { - QPtrList<Incidence> selected; + Q3PtrList<Incidence> selected; if ( mSelectedCell ) { Incidence *incidence = mSelectedCell->selectedIncidence(); @@ -1561,7 +1573,7 @@ void KOMonthView::updateConfig() mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); } #ifdef DESKTOP_VERSION - MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); + /* TODO:hacker: MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); */ #endif updateView(); } @@ -1569,7 +1581,7 @@ void KOMonthView::updateConfig() void KOMonthView::updateDayLabels() { - QPtrVector<QLabel> *mDayLabelsT; + Q3PtrVector<QLabel> *mDayLabelsT; mDayLabelsT = &mDayLabelsW; for (int i = 0; i < 7; i++) { @@ -1610,9 +1622,9 @@ void KOMonthView::showDates(const QDate &start, const QDate &) { // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; - QPtrVector<MonthViewCell> *cells; - QPtrVector<QLabel> *dayLabels; - QPtrVector<KOWeekButton> *weekLabels; + Q3PtrVector<MonthViewCell> *cells; + Q3PtrVector<QLabel> *dayLabels; + Q3PtrVector<KOWeekButton> *weekLabels; uint weekNum = 6; mStartDate = start; if ( mShowWeekView ) { @@ -1668,7 +1680,7 @@ void KOMonthView::showDates(const QDate &start, const QDate &) updateView(); } -void KOMonthView::showEvents(QPtrList<Event>) +void KOMonthView::showEvents(Q3PtrList<Event>) { qDebug("KOMonthView::selectEvents is not implemented yet. "); } @@ -1690,7 +1702,7 @@ void KOMonthView::updateView() //QTime ti; //ti.start(); clearSelection(); - QPtrVector<MonthViewCell> *cells; + Q3PtrVector<MonthViewCell> *cells; if ( mShowWeekView ) { cells = &mCellsW; } else { @@ -1705,7 +1717,7 @@ void KOMonthView::updateView() (*cells)[i]->startUpdateCell(); } - QPtrList<Event> events = calendar()->events(); + Q3PtrList<Event> events = calendar()->events(); Event *event; QDateTime dt; QDate endDate = mStartDate.addDays( timeSpan ); @@ -1769,7 +1781,7 @@ void KOMonthView::updateView() } } // insert due todos - QPtrList<Todo> todos = calendar()->todos( ); + Q3PtrList<Todo> todos = calendar()->todos( ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { //insertTodo( todo ); @@ -2225,7 +2237,7 @@ void KOMonthView::setSelectedCell( MonthViewCell *cell ) void KOMonthView::processSelectionChange() { - QPtrList<Incidence> incidences = selectedIncidences(); + Q3PtrList<Incidence> incidences = selectedIncidences(); if (incidences.count() > 0) { emit incidenceSelected( incidences.first() ); } else { @@ -2261,7 +2273,7 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) if (! e->isAutoRepeat() ) mFlagKeyPressed = true; switch(e->key()) { - case Key_Up: + case Qt::Key_Up: { if ( mShowWeekView ) { emit selectWeekNum ( currentWeek() - 1 ); @@ -2272,7 +2284,7 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) } e->accept(); break; - case Key_Down: + case Qt::Key_Down: { if ( mShowWeekView ) { emit selectWeekNum ( currentWeek() +1); @@ -2284,14 +2296,14 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) } e->accept(); break; - case Key_Return: - case Key_Enter: + case Qt::Key_Return: + case Qt::Key_Enter: { selectInternalWeekNum ( currentWeek() ); } e->accept(); break; - case Key_D: + case Qt::Key_D: if ( mSelectedCell ) { mSelectedCell->showDay(); e->accept(); diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 1a9d16d..bca76e5 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -21,17 +21,24 @@ #define _KOMONTHVIEW_H #include <qlabel.h> -#include <qframe.h> +#include <q3frame.h> #include <qdatetime.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qpoint.h> -#include <qwidgetstack.h> +#include <q3widgetstack.h> #include <qlayout.h> #include <qtimer.h> -#include <qintdict.h> +#include <q3intdict.h> #include <qpushbutton.h> -#include <qvaluelist.h> -#include <qptrvector.h> +#include <q3valuelist.h> +#include <q3ptrvector.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QFocusEvent> +#include <QMouseEvent> +#include <Q3PtrList> +#include <Q3PopupMenu> +#include <QKeyEvent> #include <libkcal/calendar.h> #include <libkcal/event.h> @@ -72,7 +79,7 @@ private slots : void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } }; -class KNoScrollListBox: public QListBox +class KNoScrollListBox: public Q3ListBox { Q_OBJECT public: @@ -103,7 +110,7 @@ class KNoScrollListBox: public QListBox }; -class MonthViewItem: public QListBoxItem +class MonthViewItem: public Q3ListBoxItem { public: MonthViewItem( Incidence *,const QString & title ); @@ -126,8 +133,8 @@ class MonthViewItem: public QListBoxItem protected: virtual void paint(QPainter *); - virtual int height(const QListBox *) const; - virtual int width(const QListBox *) const; + virtual int height(const Q3ListBox *) const; + virtual int width(const Q3ListBox *) const; private: int mdayPos; @@ -198,15 +205,15 @@ public slots: void deHighLight(); void repaintfinishUpdateCell(); protected slots: - void defaultAction( QListBoxItem * ); - void contextMenu( QListBoxItem * ); - void selection( QListBoxItem * ); - void cellClicked( QListBoxItem * ); + void defaultAction( Q3ListBoxItem * ); + void contextMenu( Q3ListBoxItem * ); + void selection( Q3ListBoxItem * ); + void cellClicked( Q3ListBoxItem * ); void newEvent(); private: int mdayCount; - QPtrList <MonthViewItem> mAvailItemList; + Q3PtrList <MonthViewItem> mAvailItemList; KOMonthView *mMonthView; int currentPalette; @@ -247,7 +254,7 @@ class KOMonthView: public KOEventView virtual int currentDateCount(); /** returns the currently selected events */ - virtual QPtrList<Incidence> selectedIncidences(); + virtual Q3PtrList<Incidence> selectedIncidences(); /** returns dates of the currently selected events */ virtual DateList selectedDates(); @@ -269,7 +276,7 @@ class KOMonthView: public KOEventView virtual void updateView(); virtual void updateConfig(); virtual void showDates(const QDate &start, const QDate &end); - virtual void showEvents(QPtrList<Event> eventList); + virtual void showEvents(Q3PtrList<Event> eventList); void changeEventDisplay(Event *, int); @@ -311,7 +318,7 @@ class KOMonthView: public KOEventView NavigatorBar* mNavigatorBar; int currentWeek(); bool clPending; - QWidgetStack * mWidStack; + Q3WidgetStack * mWidStack; QWidget* mMonthView; QWidget* mWeekView; bool mShowWeekView; @@ -325,12 +332,12 @@ class KOMonthView: public KOEventView void computeLayoutWeek(); void doComputeLayoutWeek(); - QPtrVector<MonthViewCell> mCells; - QPtrVector<QLabel> mDayLabels; - QPtrVector<KOWeekButton> mWeekLabels; - QPtrVector<MonthViewCell> mCellsW; - QPtrVector<QLabel> mDayLabelsW; - QPtrVector<KOWeekButton> mWeekLabelsW; + Q3PtrVector<MonthViewCell> mCells; + Q3PtrVector<QLabel> mDayLabels; + Q3PtrVector<KOWeekButton> mWeekLabels; + Q3PtrVector<MonthViewCell> mCellsW; + Q3PtrVector<QLabel> mDayLabelsW; + Q3PtrVector<KOWeekButton> mWeekLabelsW; bool mShortDayLabelsM; bool mShortDayLabelsW; @@ -342,7 +349,7 @@ class KOMonthView: public KOEventView MonthViewCell *mPopupCell; bool mFlagKeyPressed; KOEventPopupMenu *mContextMenu; - QPopupMenu *mNewItemMenu; + Q3PopupMenu *mNewItemMenu; void keyPressEvent ( QKeyEvent * ) ; void keyReleaseEvent ( QKeyEvent * ) ; diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 5078c57..0bd46ea 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -26,7 +26,7 @@ #include <unistd.h> #endif #include <qdir.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <qstring.h> #include <qregexp.h> @@ -305,13 +305,13 @@ KOPrefs::KOPrefs() : KPrefs::setCurrentGroup("KOrganizer Plugins"); - addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); + addItemStringList("SelectedPlugins",&mSelectedPlugins,QStringList("holidays")); KPrefs::setCurrentGroup("Group Scheduling"); addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); - addItemStringList("AdditionalMails",&mAdditionalMails,""); + addItemStringList("AdditionalMails",&mAdditionalMails,QStringList()); addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); @@ -566,7 +566,7 @@ void KOPrefs::usrWriteConfig() config()->writeEntry("user_email",mEmail); config()->setGroup("Category Colors"); - QDictIterator<QColor> it(mCategoryColors); + Q3DictIterator<QColor> it(mCategoryColors); while (it.current()) { config()->writeEntry(it.currentKey(),*(it.current())); ++it; diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 94bdd33..35c6110 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -25,9 +25,12 @@ #include <libkdepim/kpimprefs.h> -#include <qdict.h> +#include <q3dict.h> #include <qdir.h> #include <qobject.h> +#include <QDateTime> +//Added by qt3to4: +#include <Q3PtrList> class KConfig; class QFont; @@ -347,7 +350,7 @@ class KOPrefs : public KPimPrefs bool mWTshowChanged; int mCurrentDisplayedView; - QPtrList<KopiCalendarFile> mCalendars; + Q3PtrList<KopiCalendarFile> mCalendars; int mNextAvailableCalendar; bool mGlobalUpdateDisabled; @@ -362,8 +365,8 @@ class KOPrefs : public KPimPrefs QString mFilterConflictAllItem; private: - QDict<QColor> mCategoryColors; - QArray<KopiCalendarFile*> mDefCalColors; + Q3Dict<QColor> mCategoryColors; + QVector<KopiCalendarFile*> mDefCalColors; QColor mDefaultCategoryColor; QFont mDefaultTimeBarFont; diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index f1a6c3d..43c488f 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -23,24 +23,30 @@ #include <qlayout.h> #include <qlabel.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> +#include <q3groupbox.h> +#include <q3buttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qcombobox.h> -#include <qvbox.h> -#include <qhbox.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qregexp.h> #include <qspinbox.h> #include <qdatetime.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> -#include <qstrlist.h> +#include <q3strlist.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <QPixmap> +#include <Q3Frame> #include <kcolorbutton.h> #include <kdebug.h> @@ -116,8 +122,8 @@ void KOPrefsDialog::setupGlobalTab() void KOPrefsDialog::setupLocaleDateTab() { #if 0 -QFrame *topFrame = addPage(i18n("Date Format"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,3,2); +Q3Frame *topFrame = addPage(i18n("Date Format"),0,0); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); int iii = 0; @@ -172,8 +178,8 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0); void KOPrefsDialog::setupLocaleTab() { #if 0 - QFrame *topFrame = addPage(i18n("Locale"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3Frame *topFrame = addPage(i18n("Locale"),0,0); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); int iii = 0; @@ -211,7 +217,7 @@ void KOPrefsDialog::setupLocaleTab() } else { QWidget * hb = new QWidget( topFrame ); - QHBoxLayout *hbLayout = new QHBoxLayout(hb); + Q3HBoxLayout *hbLayout = new Q3HBoxLayout(hb); sb = addWidBool(i18n("Week starts on Sunday"), &(KOPrefs::instance()->mWeekStartsOnSunday),hb); @@ -236,10 +242,10 @@ void KOPrefsDialog::setupLocaleTab() void KOPrefsDialog::setupMainTab() { - QFrame *topFrame = addPage(i18n("General"),0,0); + Q3Frame *topFrame = addPage(i18n("General"),0,0); // DesktopIcon("identity",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); @@ -287,12 +293,12 @@ void KOPrefsDialog::setupMainTab() ++iii; if ( QApplication::desktop()->height() <= 240 ) { topFrame = addPage(i18n("General") +" 2",0,0); - topLayout = new QGridLayout(topFrame,4,2); + topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(2); topLayout->setMargin(3); iii = 0; } - QHBox *dummy = new QHBox(topFrame); + Q3HBox *dummy = new Q3HBox(topFrame); new QLabel(i18n("Days in Next-X-Days:"),dummy); mNextXDaysSpin = new QSpinBox(2,14,1,dummy); @@ -313,7 +319,7 @@ void KOPrefsDialog::setupMainTab() // addWidBool(i18n("Enable automatic saving of calendar"), // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); - QHBox *intervalBox = new QHBox(topFrame); + Q3HBox *intervalBox = new Q3HBox(topFrame); // intervalBox->setSpacing(mSpacingHint); topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); ++iii; @@ -402,14 +408,14 @@ void KOPrefsDialog::setupMainTab() void KOPrefsDialog::setupTimeTab() { - QFrame *topFrame = addPage(i18n("Time"),0,0); + Q3Frame *topFrame = addPage(i18n("Time"),0,0); // DesktopIcon("clock",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); - QHBox *dummy = new QHBox(topFrame); + Q3HBox *dummy = new Q3HBox(topFrame); KPrefsDialogWidTime *dayBegins = addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), dummy); @@ -441,28 +447,28 @@ void KOPrefsDialog::setupTimeTab() int iii = 4; if ( QApplication::desktop()->height() <= 240 ) { topFrame = addPage(i18n("Time") +" 2",0,0); - topLayout = new QGridLayout(topFrame,1,2); + topLayout = new Q3GridLayout(topFrame,1,2); topLayout->setSpacing(2); topLayout->setMargin(3); iii = 0; } - QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, + Q3GroupBox *workingHoursGroup = new Q3GroupBox(1,Qt::Horizontal, i18n("Working Hours"), topFrame); topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1); workingHoursGroup->layout()->setSpacing( 0 ); workingHoursGroup->layout()->setMargin( 4 ); - QHBox *workStartBox = new QHBox(workingHoursGroup); + Q3HBox *workStartBox = new Q3HBox(workingHoursGroup); // workStartBox->setMargin( 0 ); addWidTime(i18n("Daily starting hour:"), &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); - QHBox *workEndBox = new QHBox(workingHoursGroup); + Q3HBox *workEndBox = new Q3HBox(workingHoursGroup); //workEndBox->setMargin( 0 ); addWidTime(i18n("Daily ending hour:"), &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); - QVBox *excludeBox = new QVBox(workingHoursGroup); + Q3VBox *excludeBox = new Q3VBox(workingHoursGroup); //excludeBox->setMargin( 0 ); addWidBool(i18n("Exclude holidays"), &(KOPrefs::instance()->mExcludeHolidays),excludeBox); @@ -482,10 +488,10 @@ void KOPrefsDialog::setupTimeTab() void KOPrefsDialog::setupViewsTab() { - QFrame *topFrame = addPage(i18n("Views"),0,0); + Q3Frame *topFrame = addPage(i18n("Views"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,6,1); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); @@ -530,7 +536,7 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("ViewChange"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,6,1); + topLayout = new Q3GridLayout(topFrame,6,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; @@ -594,7 +600,7 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("Agenda View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,5,1); + topLayout = new Q3GridLayout(topFrame,5,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; @@ -652,12 +658,12 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("Month View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,5,1); + topLayout = new Q3GridLayout(topFrame,5,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; QLabel *lab; - QHBox *habo = new QHBox( topFrame ); + Q3HBox *habo = new Q3HBox( topFrame ); if ( QApplication::desktop()->width() <= 480 ) { lab = new QLabel ( i18n("Show events that recur "), topFrame ); topLayout->addMultiCellWidget(lab,ii, ii,0,1); @@ -677,7 +683,7 @@ void KOPrefsDialog::setupViewsTab() ii++; - habo = new QHBox( topFrame ); + habo = new Q3HBox( topFrame ); if ( QApplication::desktop()->width() <= 480 ) { lab = new QLabel (i18n("Show in every cell ") , topFrame ); topLayout->addMultiCellWidget(lab,ii, ii,0,1); @@ -730,7 +736,7 @@ void KOPrefsDialog::setupViewsTab() if ( QApplication::desktop()->height() <= 240 ) { topFrame = addPage(i18n("Month View") +" 2",0,0); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); topLayout->setSpacing(2); topLayout->setMargin(1); ii = 0; @@ -764,19 +770,19 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("What's Next View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; - QHBox* hdummy = new QHBox(topFrame); + Q3HBox* hdummy = new Q3HBox(topFrame); new QLabel(i18n("Days in What's Next:"),hdummy); mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); topLayout->addWidget(hdummy,ii++,0); - QHBox *prioBox = new QHBox(topFrame); + Q3HBox *prioBox = new Q3HBox(topFrame); // intervalBox->setSpacing(mSpacingHint); topLayout->addWidget(prioBox,ii++,0); @@ -818,7 +824,7 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("Todo View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; @@ -855,7 +861,7 @@ dummy = KPrefsDialogWidColor *todoRunColor = addWidColor(i18n("Color for running todos:"), &(KOPrefs::instance()->mTodoRunColor),wid); - QHBoxLayout *widLayout = new QHBoxLayout(wid); + Q3HBoxLayout *widLayout = new Q3HBoxLayout(wid); widLayout->addWidget( todoRunColor->label() ); widLayout->addWidget( todoRunColor->button() ); topLayout->addWidget(wid,ii++,0); @@ -865,7 +871,7 @@ dummy = KPrefsDialogWidColor *todoDueTodayColor = addWidColor(i18n("Todo due today color:"), &(KOPrefs::instance()->mTodoDueTodayColor),wid); - widLayout = new QHBoxLayout(wid); + widLayout = new Q3HBoxLayout(wid); widLayout->addWidget( todoDueTodayColor->label() ); widLayout->addWidget( todoDueTodayColor->button() ); topLayout->addWidget(wid,ii++,0); @@ -873,7 +879,7 @@ dummy = // Todo overdue color wid = new QWidget( topFrame ); - widLayout = new QHBoxLayout(wid); + widLayout = new Q3HBoxLayout(wid); KPrefsDialogWidColor *todoOverdueColor = addWidColor(i18n("Todo overdue color:"), &(KOPrefs::instance()->mTodoOverdueColor),wid); @@ -890,7 +896,7 @@ dummy = topFrame = addPage(i18n("View Options"),0,0); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; @@ -929,16 +935,16 @@ dummy = topFrame = addPage(i18n("Conflict detection"),0,0); - topLayout = new QGridLayout(topFrame,2,1); + topLayout = new Q3GridLayout(topFrame,2,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; dummy = addWidBool(i18n("Enable conflict detection"), &(KOPrefs::instance()->mDetectConflicts),topFrame); topLayout->addWidget(dummy->checkBox(), ii++,0); - topFrame = new QFrame( topFrame ); + topFrame = new Q3Frame( topFrame ); topLayout->addWidget(topFrame ,ii++,0); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) ); dummy = addWidBool(i18n("Include events which \"show as free\""), &(KOPrefs::instance()->mIncludeFree),topFrame); @@ -970,7 +976,7 @@ dummy = topFrame = addPage(i18n("Alarm"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,2,1); + topLayout = new Q3GridLayout(topFrame,2,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); int iii = 0; @@ -989,33 +995,33 @@ dummy = #ifndef DESKTOP_VERSION lab->setAlignment( AlignLeft|WordBreak|AlignTop); #else - lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); + lab->setAlignment( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); #endif - QHBox* dummyBox = new QHBox(topFrame); + Q3HBox* dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Play beeps count:"),dummyBox); mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Beeps interval in sec:"),dummyBox); mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Default suspend time in min:"),dummyBox); mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Auto suspend count:"),dummyBox); mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - QHBox* hbo = new QHBox ( topFrame ); + Q3HBox* hbo = new Q3HBox ( topFrame ); mDefaultAlarmFile = new QLineEdit(hbo); QPushButton * loadTemplate = new QPushButton(hbo); QPixmap icon; @@ -1055,10 +1061,10 @@ void KOPrefsDialog::selectSoundFile() void KOPrefsDialog::setupFontsTab() { - QFrame *topFrame = addPage(i18n("Fonts"),0,0); + Q3Frame *topFrame = addPage(i18n("Fonts"),0,0); // DesktopIcon("fonts",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,7,3); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,7,3); topLayout->setSpacing(1); topLayout->setMargin(3); KPrefsDialogWidFont * tVFont; @@ -1125,7 +1131,7 @@ void KOPrefsDialog::setupFontsTab() topFrame = addPage(i18n("View Fonts"),0, DesktopIcon("fonts",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,7,3); + topLayout = new Q3GridLayout(topFrame,7,3); topLayout->setSpacing(1); topLayout->setMargin(3); @@ -1193,10 +1199,10 @@ void KOPrefsDialog::setupFontsTab() void KOPrefsDialog::setupColorsTab() { - QFrame *topFrame = addPage(i18n("Colors"),0,0); + Q3Frame *topFrame = addPage(i18n("Colors"),0,0); // DesktopIcon("colorize",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2); // topLayout->setSpacing(mSpacingHint); // topLayout->setMargin(mMarginHint); @@ -1204,9 +1210,9 @@ void KOPrefsDialog::setupColorsTab() topLayout->setMargin(3); int ii = 1; - QGroupBox *categoryGroup ; + Q3GroupBox *categoryGroup ; - categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), + categoryGroup = new Q3GroupBox(1,Qt::Vertical,i18n("Categories"), topFrame); topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); @@ -1250,7 +1256,7 @@ void KOPrefsDialog::setupColorsTab() topFrame = addPage(i18n("Colors") +" 2",0,0); // DesktopIcon("colorize",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,5,2); + topLayout = new Q3GridLayout(topFrame,5,2); // topLayout->setSpacing(mSpacingHint); // topLayout->setMargin(mMarginHint); @@ -1317,7 +1323,7 @@ void KOPrefsDialog::setupPrinterTab() mPrinterTab = addPage(i18n("Printing"),0, DesktopIcon("fileprint",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(mPrinterTab,5,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); @@ -1327,10 +1333,10 @@ void KOPrefsDialog::setupPrinterTab() void KOPrefsDialog::setupGroupSchedulingTab() { #if 0 - QFrame *topFrame = addPage(i18n("Group Scheduling"),0, + Q3Frame *topFrame = addPage(i18n("Group Scheduling"),0, DesktopIcon("personal",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); @@ -1353,7 +1359,7 @@ void KOPrefsDialog::setupGroupSchedulingTab() topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); - mAMails = new QListView(topFrame); + mAMails = new Q3ListView(topFrame); mAMails->addColumn(i18n("Email"),300); topLayout->addMultiCellWidget(mAMails,3,3,0,1); @@ -1371,17 +1377,17 @@ void KOPrefsDialog::setupGroupSchedulingTab() connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); - connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); + connect(mAMails,SIGNAL(selectionChanged(Q3ListViewItem *)),SLOT(updateInput())); #endif } void KOPrefsDialog::setupGroupAutomationTab() { return; - QFrame *topFrame = addPage(i18n("Group Automation"),0, + Q3Frame *topFrame = addPage(i18n("Group Automation"),0, DesktopIcon("personal",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,1); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); @@ -1515,7 +1521,7 @@ void KOPrefsDialog::usrWriteConfig() ++iii; } } - QDictIterator<QColor> it(mCategoryDict); + Q3DictIterator<QColor> it(mCategoryDict); while (it.current()) { KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); ++it; diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h index ee7a7aa..ccc1726 100644 --- a/korganizer/koprefsdialog.h +++ b/korganizer/koprefsdialog.h @@ -23,10 +23,12 @@ #ifndef _KOPREFSDIALOG_H #define _KOPREFSDIALOG_H -#include <qframe.h> -#include <qdict.h> +#include <q3frame.h> +#include <q3dict.h> #include <qcolor.h> -#include <qlistview.h> +#include <q3listview.h> +//Added by qt3to4: +#include <QLabel> #include <kdialogbase.h> @@ -94,7 +96,7 @@ class KOPrefsDialog : public KPrefsDialog KPrefsDialogWidBool *mEnableGroupScheduling; KPrefsDialogWidBool *mEnableProjectView; - QFrame *mPrinterTab; + Q3Frame *mPrinterTab; QLineEdit *nameEdit; QLineEdit *emailEdit; @@ -121,7 +123,7 @@ class KOPrefsDialog : public KPrefsDialog QComboBox *mCategoryCombo; KColorButton *mCategoryButton; - QDict<QColor> mCategoryDict; + Q3Dict<QColor> mCategoryDict; QSlider *mHourSizeSlider; diff --git a/korganizer/korganizer.pro b/korganizer/korganizer.pro index df8f8d7..0f3b328 100644 --- a/korganizer/korganizer.pro +++ b/korganizer/korganizer.pro @@ -1,5 +1,5 @@ TEMPLATE = app -CONFIG = qt warn_on +CONFIG += qt warn_on TARGET = kopi OBJECTS_DIR = _obj/ MOC_DIR = _moc @@ -17,27 +17,27 @@ DEFINES += DESKTOP_VERSION unix : { staticlib: { TARGET = kopi_linux -LIBS += ../bin/libmicrokabc_qtopia.a -LIBS += ../bin/libmicrokabc_file.a -LIBS += ../bin/libmicrokabc_dir.a -LIBS += ../bin/libmicrokdepim.a -LIBS += ../bin/libmicrokcal.a -LIBS += ../bin/libmicrokabc.a -LIBS += ../bin/libmicrokde.a -LIBS += ../bin/libmicrokabc_qtopia.a -LIBS += ../bin/libmicrokabc_file.a -LIBS += ../bin/libmicrokabc_dir.a -LIBS += ../bin/libmicrokdepim.a -LIBS += ../bin/libmicrokcal.a -LIBS += ../bin/libmicrokabc.a -LIBS += ../bin/libmicrokde.a +LIBS += ../bin/libxmicrokabc_qtopia.a +LIBS += ../bin/libxmicrokabc_file.a +LIBS += ../bin/libxmicrokabc_dir.a +LIBS += ../bin/libxmicrokdepim.a +LIBS += ../bin/libxmicrokcal.a +LIBS += ../bin/libxmicrokabc.a +LIBS += ../bin/libxmicrokde.a +LIBS += ../bin/libxmicrokabc_qtopia.a +LIBS += ../bin/libxmicrokabc_file.a +LIBS += ../bin/libxmicrokabc_dir.a +LIBS += ../bin/libxmicrokdepim.a +LIBS += ../bin/libxmicrokcal.a +LIBS += ../bin/libxmicrokabc.a +LIBS += ../bin/libxmicrokde.a LIBS += ../libical/lib/libical.a LIBS += ../libical/lib/libicalss.a } else { -LIBS += ../bin/libmicrokdepim.so -LIBS += ../bin/libmicrokcal.so -LIBS += ../bin/libmicrokde.so -LIBS += ../bin/libmicrokabc.so +LIBS += ../bin/libxmicrokdepim.so +LIBS += ../bin/libxmicrokcal.so +LIBS += ../bin/libxmicrokde.so +LIBS += ../bin/libxmicrokabc.so #LIBS += -lbluetooth #LIBS += -lsdp @@ -49,10 +49,10 @@ MOC_DIR = moc/unix win32: { RC_FILE = winicons.rc DEFINES += _WIN32_ -LIBS += ../bin/microkdepim.lib -LIBS += ../bin/microkcal.lib -LIBS += ../bin/microkde.lib -LIBS += ../bin/microkabc.lib +LIBS += ../bin/xmicrokdepim.lib +LIBS += ../bin/xmicrokcal.lib +LIBS += ../bin/xmicrokde.lib +LIBS += ../bin/xmicrokabc.lib LIBS += ../libical/lib/ical.lib LIBS += ../libical/lib/icalss.lib #LIBS += atls.lib @@ -85,7 +85,8 @@ TARGET = kopi_me } -INTERFACES = kofilterview_base.ui +#The following line was changed from INTERFACES to FORMS3 by qt3to4 +FORMS3 = kofilterview_base.ui #filteredit_base.ui # kdateedit.h \ @@ -210,9 +211,15 @@ filteredit_base.cpp \ ../kalarmd/alarmdialog.cpp HEADERS += calprintbase.h calprinter.h calprintplugins.h cellitem.h -INTERFACES += calprintdayconfig_base.ui \ +#The following line was changed from INTERFACES to FORMS3 by qt3to4 +FORMS3 += calprintdayconfig_base.ui \ calprintmonthconfig_base.ui \ calprinttodoconfig_base.ui \ calprintweekconfig_base.ui SOURCES += calprintbase.cpp calprinter.cpp calprintplugins.cpp cellitem.cpp +#The following line was inserted by qt3to4 +QT += xml qt3support +#The following line was inserted by qt3to4 +CONFIG += uic3 + diff --git a/korganizer/korganizerE.pro b/korganizer/korganizerE.pro index 553c265..2c1cd42 100644 --- a/korganizer/korganizerE.pro +++ b/korganizer/korganizerE.pro @@ -11,9 +11,9 @@ DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER DEFINES += KORG_NOLVALTERNATION #KORG_NOKABC -LIBS += -lmicrokdepim -LIBS += -lmicrokcal -LIBS += -lmicrokde +LIBS += -lxmicrokdepim +LIBS += -lxmicrokcal +LIBS += -lxmicrokde LIBS += -lmicroqtcompat LIBS += $(GCC3EXTRALIB1) diff --git a/korganizer/kotimespanview.cpp b/korganizer/kotimespanview.cpp index 3265a3a..a214720 100644 --- a/korganizer/kotimespanview.cpp +++ b/korganizer/kotimespanview.cpp @@ -1,4 +1,8 @@ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3ValueList> +#include <Q3PtrList> #include <kconfig.h> @@ -11,7 +15,7 @@ KOTimeSpanView::KOTimeSpanView(Calendar *calendar, QWidget *parent, const char *name) : KOEventView( calendar, parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); mTimeSpanView = new TimeSpanView( this ); topLayout->addWidget( mTimeSpanView ); @@ -34,7 +38,7 @@ void KOTimeSpanView::readSettings(KConfig *config) config->setGroup("Views"); - QValueList<int> sizes = config->readIntListEntry("Separator TimeSpanView"); + Q3ValueList<int> sizes = config->readIntListEntry("Separator TimeSpanView"); if (sizes.count() == 2) { mTimeSpanView->setSplitterSizes(sizes); } @@ -46,7 +50,7 @@ void KOTimeSpanView::writeSettings(KConfig *config) config->setGroup("Views"); - QValueList<int> list = mTimeSpanView->splitterSizes(); + Q3ValueList<int> list = mTimeSpanView->splitterSizes(); config->writeEntry("Separator TimeSpanView",list); } @@ -60,9 +64,9 @@ int KOTimeSpanView::currentDateCount() return 0; } -QPtrList<Incidence> KOTimeSpanView::selectedIncidences() +Q3PtrList<Incidence> KOTimeSpanView::selectedIncidences() { - QPtrList<Incidence> selected; + Q3PtrList<Incidence> selected; return selected; } @@ -84,9 +88,9 @@ void KOTimeSpanView::showDates(const QDate &start, const QDate &end) void KOTimeSpanView::insertItems(const QDate &start, const QDate &end) { mTimeSpanView->clear(); - mTimeSpanView->setDateRange( start, end ); + mTimeSpanView->setDateRange( (QDateTime)start, (QDateTime)end ); - QPtrList<Event> events = calendar()->events( start, end ); + Q3PtrList<Event> events = calendar()->events( start, end ); Event *event = events.first(); while( event ) { // kdDebug() << "KOTimeSpanView::showDates() add event: " << event->summary() @@ -100,7 +104,7 @@ void KOTimeSpanView::insertItems(const QDate &start, const QDate &end) mTimeSpanView->updateView(); } -void KOTimeSpanView::showEvents(QPtrList<Event> eventList) +void KOTimeSpanView::showEvents(Q3PtrList<Event> eventList) { } diff --git a/korganizer/kotimespanview.h b/korganizer/kotimespanview.h index c682ed8..c3e4b41 100644 --- a/korganizer/kotimespanview.h +++ b/korganizer/kotimespanview.h @@ -2,6 +2,8 @@ #define KOTIMESPANVIEW_H #include "koeventview.h" +//Added by qt3to4: +#include <Q3PtrList> class KConfig; class TimeSpanView; @@ -16,7 +18,7 @@ class KOTimeSpanView : public KOEventView virtual int maxDatesHint(); virtual int currentDateCount(); - virtual QPtrList<Incidence> selectedIncidences(); + virtual Q3PtrList<Incidence> selectedIncidences(); DateList selectedDates() {DateList q; return q;} @@ -28,7 +30,7 @@ class KOTimeSpanView : public KOEventView public slots: virtual void updateView(); virtual void showDates(const QDate &start, const QDate &end); - virtual void showEvents(QPtrList<Event> eventList); + virtual void showEvents(Q3PtrList<Event> eventList); void changeEventDisplay(Event *, int); diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index 20a35d2..aeab92a 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp @@ -23,15 +23,20 @@ */ #include <qtooltip.h> -#include <qframe.h> +#include <q3frame.h> #include <qpixmap.h> #include <qlayout.h> -#include <qhbox.h> +#include <q3hbox.h> #include <qtimer.h> #include <qdir.h> #include <qdatetime.h> #include <qapplication.h> +#include <QDesktopWidget> #include <qtabwidget.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3PtrList> +#include <Q3VBoxLayout> #include <kiconloader.h> #include <klocale.h> @@ -81,8 +86,8 @@ void KOTodoEditor::init() } void KOTodoEditor::setupRecurrence() { - QFrame *topFrame = addPage( i18n("Recurrence") ); - QBoxLayout *topLayout = new QVBoxLayout( topFrame ); + Q3Frame *topFrame = addPage( i18n("Recurrence") ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); mRecurrence = new KOEditorRecurrence( topFrame ); topLayout->addWidget( mRecurrence ); @@ -111,9 +116,9 @@ void KOTodoEditor::setupGeneral() // mGeneral,SLOT(setCategories(const QString &))); if (KOPrefs::instance()->mCompactDialogs) { - QFrame *topFrame = addPage(i18n("General")); + Q3Frame *topFrame = addPage(i18n("General")); - QBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); if ( QApplication::desktop()->width() < 480 ) { topLayout->setMargin(marginHintSmall()); topLayout->setSpacing(spacingHintSmall()); @@ -131,17 +136,17 @@ void KOTodoEditor::setupGeneral() mGeneral->enableAlarm( false ); - QBoxLayout *priorityLayout; + Q3BoxLayout *priorityLayout; if ( QApplication::desktop()->width() < 500 ) - priorityLayout = new QVBoxLayout( topLayout ); + priorityLayout = new Q3VBoxLayout( topLayout ); else - priorityLayout = new QHBoxLayout( topLayout ); + priorityLayout = new Q3HBoxLayout( topLayout ); QWidget* prioWidget = new QWidget (topFrame); priorityLayout->addWidget( prioWidget ); - QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget); + Q3HBoxLayout* priorityLayout2 = new Q3HBoxLayout( prioWidget); - QIconSet icon; + QIcon icon; if ( QApplication::desktop()->width() < 321 ) icon = SmallIcon("fileimport16"); else @@ -164,13 +169,13 @@ void KOTodoEditor::setupGeneral() mGeneral->initCategories( topFrame, priorityLayout ); topLayout->addStretch(1); - QFrame *topFrame2 = addPage(i18n("Details")); + Q3Frame *topFrame2 = addPage(i18n("Details")); - QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); + Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2); topLayout2->setMargin(marginHint()); topLayout2->setSpacing(spacingHint()); - QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 ); + Q3HBoxLayout *completionLayout = new Q3HBoxLayout( topLayout2 ); mGeneral->initCompletion(topFrame2,completionLayout); @@ -185,18 +190,18 @@ void KOTodoEditor::setupGeneral() connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); } else { - QFrame *topFrame = addPage(i18n("General")); + Q3Frame *topFrame = addPage(i18n("General")); - QBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); topLayout->setSpacing(spacingHint()); mGeneral->initHeader(topFrame,topLayout); mGeneral->initTime(topFrame,topLayout); mGeneral->initStatus(topFrame,topLayout); - QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout); mGeneral->initAlarm(topFrame,alarmLineLayout); mGeneral->initDescription(topFrame,topLayout); - QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout); mGeneral->initCategories( topFrame, detailsLayout ); mGeneral->initSecrecy( topFrame, detailsLayout ); } @@ -427,7 +432,7 @@ void KOTodoEditor::slotLoadTemplate() .arg( fileName ) ); return ; } - QPtrList<Todo> todos = cal.todos(); + Q3PtrList<Todo> todos = cal.todos(); Todo * todo = todos.first(); if ( !todo ) { KMessageBox::error( this, diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index ba94057..2b8fbd3 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -21,17 +21,33 @@ without including the source code for Qt in the source distribution. */ +#include <QDesktopWidget> + #include <qlayout.h> -#include <qheader.h> +#include <q3header.h> #include <qcursor.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> #include <qdialog.h> #include <qlabel.h> #include <qpushbutton.h> #include <qinputdialog.h> -#include <qvbox.h> +#include <q3vbox.h> +//Added by qt3to4: +#include <QWheelEvent> +#include <QFocusEvent> +#include <QDragLeaveEvent> +#include <QMouseEvent> +#include <QDragEnterEvent> +#include <QKeyEvent> +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> +#include <QDropEvent> +#include <QDragMoveEvent> +#include <QPaintEvent> +#include <Q3PopupMenu> +#include <Q3PtrList> #include <kdebug.h> #include "koprefs.h" #include <klocale.h> @@ -68,12 +84,12 @@ KOStartTodoPrefs::KOStartTodoPrefs( QString sum, QWidget *parent, const char *na { mStopAll = true; setCaption( i18n("Start todo") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( sum ), this ); lay->addWidget( lab ); - lab->setAlignment( AlignCenter ); + lab->setAlignment( Qt::AlignCenter ); QPushButton * ok = new QPushButton( i18n("Start this todo\nand stop all running"), this ); lay->addWidget( ok ); @@ -98,20 +114,20 @@ KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name { mTodo = todo; setCaption( i18n("Stop todo") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( todo->summary() ), this ); lay->addWidget( lab ); - lab->setAlignment( AlignHCenter ); + lab->setAlignment( Qt::AlignHCenter ); lab = new QLabel( i18n("Additional Comment:"), this ); lay->addWidget( lab ); mComment = new QLineEdit( this ); lay->addWidget( mComment ); - QHBox * start = new QHBox ( this ); + Q3HBox * start = new Q3HBox ( this ); lay->addWidget( start ); lab = new QLabel( i18n("Start:"), start ); - QHBox * end = new QHBox ( this ); + Q3HBox * end = new Q3HBox ( this ); lay->addWidget( end ); lab = new QLabel( i18n("End:"), end ); sde = new KDateEdit( start ); @@ -173,10 +189,10 @@ void KOStopTodoPrefs::doNotSave() } -class KOTodoViewWhatsThis :public QWhatsThis +class KOTodoViewWhatsThis :public Q3WhatsThis { public: - KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; + KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : Q3WhatsThis( wid ), _wid(wid),_view (view) { }; protected: virtual QString text( const QPoint& p) @@ -214,7 +230,7 @@ void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) #ifndef KORG_NODND // kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && - !QTextDrag::canDecode( e ) ) { + !Q3TextDrag::canDecode( e ) ) { e->ignore(); return; } @@ -230,7 +246,7 @@ void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) // kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && - !QTextDrag::canDecode( e ) ) { + !Q3TextDrag::canDecode( e ) ) { e->ignore(); return; } @@ -255,7 +271,7 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) // kdDebug() << "KOTodoListView::contentsDropEvent" << endl; if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && - !QTextDrag::canDecode( e ) ) { + !Q3TextDrag::canDecode( e ) ) { e->ignore(); return; } @@ -300,7 +316,7 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) } else { QString text; - if (QTextDrag::decode(e,text)) { + if (Q3TextDrag::decode(e,text)) { //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) )); qDebug("Dropped : " + text); @@ -323,14 +339,14 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) } void KOTodoListView::wheelEvent (QWheelEvent *e) { - QListView::wheelEvent (e); + Q3ListView::wheelEvent (e); } void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) { QPoint p(contentsToViewport(e->pos())); - QListViewItem *i = itemAt(p); + Q3ListViewItem *i = itemAt(p); bool rootClicked = true; if (i) { // if the user clicked into the root decoration of the item, don't @@ -348,7 +364,7 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) } #ifndef KORG_NODND mMousePressed = false; - if (! rootClicked && !( e->button() == RightButton) ) { + if (! rootClicked && !( e->button() == Qt::RightButton) ) { mPressPos = e->pos(); mMousePressed = true; } else { @@ -358,15 +374,15 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); #ifndef DESKTOP_VERSION if (!( e->button() == RightButton && rootClicked) ) - QListView::contentsMousePressEvent(e); + Q3ListView::contentsMousePressEvent(e); #else - QListView::contentsMousePressEvent(e); + Q3ListView::contentsMousePressEvent(e); #endif } void KOTodoListView::paintEvent(QPaintEvent* e) { emit paintNeeded(); - QListView::paintEvent( e); + Q3ListView::paintEvent( e); } void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) { @@ -376,7 +392,7 @@ void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()*3) { mMousePressed = false; - QListViewItem *item = itemAt(contentsToViewport(mPressPos)); + Q3ListViewItem *item = itemAt(contentsToViewport(mPressPos)); if (item) { DndFactory factory( mCalendar ); ICalDrag *vd = factory.createDrag( @@ -422,13 +438,13 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) } if (! e->isAutoRepeat() ) mFlagKeyPressed = true; - QListViewItem* cn; + Q3ListViewItem* cn; if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") { cn = currentItem(); if ( cn ) { KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); if ( ci ){ - if ( e->state() == ShiftButton ) + if ( e->state() == Qt::ShiftButton ) ci->setOn( false ); else ci->setOn( true ); @@ -449,12 +465,12 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) switch ( e->key() ) { case Qt::Key_Down: case Qt::Key_Up: - QListView::keyPressEvent ( e ); + Q3ListView::keyPressEvent ( e ); e->accept(); break; case Qt::Key_Left: case Qt::Key_Right: - QListView::keyPressEvent ( e ); + Q3ListView::keyPressEvent ( e ); e->accept(); return; break; @@ -468,7 +484,7 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) } void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) { - QListView::contentsMouseReleaseEvent(e); + Q3ListView::contentsMouseReleaseEvent(e); mMousePressed = false; } @@ -478,7 +494,7 @@ void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) QPoint vp = contentsToViewport(e->pos()); - QListViewItem *item = itemAt(vp); + Q3ListViewItem *item = itemAt(vp); emit double_Clicked(item); if (!item) return; @@ -492,7 +508,7 @@ KOQuickTodo::KOQuickTodo(QWidget *parent) : QLineEdit(parent) { setText(i18n("Click to add new Todo")); - setFocusPolicy ( QWidget::ClickFocus ); + setFocusPolicy ( Qt::ClickFocus ); } void KOQuickTodo::focusInEvent(QFocusEvent *ev) @@ -523,14 +539,14 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mPendingUpdateBeforeRepaint = false; isFlatDisplay = false; mNavigator = 0; - QBoxLayout *topLayout = new QVBoxLayout(this); + Q3BoxLayout *topLayout = new Q3VBoxLayout(this); mName = QString ( name ); mBlockUpdate = false; mQuickBar = new QWidget( this ); topLayout->addWidget(mQuickBar); mQuickAdd = new KOQuickTodo(mQuickBar); - QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); + Q3BoxLayout *quickLayout = new Q3HBoxLayout(mQuickBar); quickLayout->addWidget( mQuickAdd ); mNewSubBut = new QPushButton( "sub",mQuickBar ); QPushButton * s_done = new QPushButton( "D",mQuickBar ); @@ -568,19 +584,19 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : s_run->setFixedHeight(fixhei ); mNewSubBut->setFixedHeight(fixhei ); - flat->setFocusPolicy( NoFocus ); - s_done->setFocusPolicy( NoFocus ); - allopen->setFocusPolicy( NoFocus ); - allclose->setFocusPolicy( NoFocus ); - s_run->setFocusPolicy( NoFocus ); - mNewSubBut->setFocusPolicy( NoFocus ); + flat->setFocusPolicy( Qt::NoFocus ); + s_done->setFocusPolicy( Qt::NoFocus ); + allopen->setFocusPolicy( Qt::NoFocus ); + allclose->setFocusPolicy( Qt::NoFocus ); + s_run->setFocusPolicy( Qt::NoFocus ); + mNewSubBut->setFocusPolicy( Qt::NoFocus ); - QWhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) ); - QWhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) ); - QWhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) ); - QWhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) ); - QWhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) ); - QWhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) ); + Q3WhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) ); + Q3WhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) ); + Q3WhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) ); + Q3WhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) ); + Q3WhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) ); + Q3WhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) ); quickLayout->addWidget( mNewSubBut ); quickLayout->addWidget( s_done ); @@ -601,19 +617,19 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->addColumn(i18n("Todo")); mTodoListView->addColumn(i18n("Prio")); - mTodoListView->setColumnAlignment(1,AlignHCenter); + mTodoListView->setColumnAlignment(1,Qt::AlignHCenter); mTodoListView->addColumn(i18n("Complete")); - mTodoListView->setColumnAlignment(2,AlignCenter); + mTodoListView->setColumnAlignment(2,Qt::AlignCenter); mTodoListView->addColumn(i18n("Due Date")); - mTodoListView->setColumnAlignment(3,AlignLeft); + mTodoListView->setColumnAlignment(3,Qt::AlignLeft); mTodoListView->addColumn(i18n("Due Time")); - mTodoListView->setColumnAlignment(4,AlignHCenter); + mTodoListView->setColumnAlignment(4,Qt::AlignHCenter); mTodoListView->addColumn(i18n("Start Date")); - mTodoListView->setColumnAlignment(5,AlignLeft); + mTodoListView->setColumnAlignment(5,Qt::AlignLeft); mTodoListView->addColumn(i18n("Start Time")); - mTodoListView->setColumnAlignment(6,AlignHCenter); + mTodoListView->setColumnAlignment(6,Qt::AlignHCenter); //mTodoListView->addColumn(i18n("Cancelled")); mTodoListView->addColumn(i18n("Categories")); @@ -623,7 +639,7 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->addColumn(i18n("Last Modified Sub")); #if 0 mTodoListView->addColumn(i18n("Sort Id")); - mTodoListView->setColumnAlignment(4,AlignHCenter); + mTodoListView->setColumnAlignment(4,Qt::AlignHCenter); #endif mTodoListView->setMinimumHeight( 60 ); @@ -632,19 +648,19 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->setColumnWidth( 0, 120 ); int iii = 0; for ( iii = 0; iii< 12 ; ++iii ) - mTodoListView->setColumnWidthMode( iii, QListView::Manual ); + mTodoListView->setColumnWidthMode( iii, Q3ListView::Manual ); mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); - mPriorityPopupMenu = new QPopupMenu(this); + mPriorityPopupMenu = new Q3PopupMenu(this); for (int i = 1; i <= 5; i++) { QString label = QString ("%1").arg (i); mPriority[mPriorityPopupMenu->insertItem (label)] = i; } connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); - mPercentageCompletedPopupMenu = new QPopupMenu(this); + mPercentageCompletedPopupMenu = new Q3PopupMenu(this); for (int i = 0; i <= 100; i+=20) { QString label = QString ("%1 %").arg (i); mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; @@ -652,12 +668,12 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); - mCategoryPopupMenu = new QPopupMenu (this); + mCategoryPopupMenu = new Q3PopupMenu (this); mCategoryPopupMenu->setCheckable (true); connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); - mCalPopupMenu = new QPopupMenu (this); + mCalPopupMenu = new Q3PopupMenu (this); mCalPopupMenu->setCheckable (true); connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); @@ -665,7 +681,7 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : - mItemPopupMenu = new QPopupMenu(this); + mItemPopupMenu = new Q3PopupMenu(this); mItemPopupMenu->insertItem(i18n("Show"), this, SLOT (showTodo())); mItemPopupMenu->insertItem(i18n("Edit..."), this, @@ -710,7 +726,7 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : this, SLOT( toggleRunning() ),0, 35 ); #endif - mPopupMenu = new QPopupMenu(this); + mPopupMenu = new Q3PopupMenu(this); mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, SLOT (newTodo()),0,1); mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), @@ -746,38 +762,38 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : // Double clicking conflicts with opening/closing the subtree - connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), - SLOT( editItem( QListViewItem *) ) ); + connect( mTodoListView, SIGNAL( doubleClicked( Q3ListViewItem *) ), + SLOT( editItem( Q3ListViewItem *) ) ); /* connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, const QPoint &,int ) ), SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); */ - connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, + connect( mTodoListView, SIGNAL( contextRequest ( Q3ListViewItem *, const QPoint &,int ) ), - SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); - connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), - SLOT( itemClicked( QListViewItem * ) ) ); - connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), - SLOT( itemDoubleClicked( QListViewItem * ) ) ); + SLOT( popupMenu( Q3ListViewItem *, const QPoint & ,int) ) ); + connect( mTodoListView, SIGNAL( clicked( Q3ListViewItem * ) ), + SLOT( itemClicked( Q3ListViewItem * ) ) ); + connect( mTodoListView, SIGNAL( double_Clicked( Q3ListViewItem * ) ), + SLOT( itemDoubleClicked( Q3ListViewItem * ) ) ); connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), SLOT( updateView() ) ); connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), SLOT( todoModified(Todo *, int) ) ); - connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), - SLOT( itemStateChanged( QListViewItem * ) ) ); - connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), - SLOT( itemStateChanged( QListViewItem * ) ) ); + connect( mTodoListView, SIGNAL( expanded( Q3ListViewItem * ) ), + SLOT( itemStateChanged( Q3ListViewItem * ) ) ); + connect( mTodoListView, SIGNAL( collapsed( Q3ListViewItem * ) ), + SLOT( itemStateChanged( Q3ListViewItem * ) ) ); connect( mTodoListView, SIGNAL( paintNeeded() ), SLOT( paintNeeded()) ); #if 0 - connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), - SLOT(selectionChanged(QListViewItem *))); - connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), - SLOT(selectionChanged(QListViewItem *))); - connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), - SLOT(selectionChanged(QListViewItem *))); + connect(mTodoListView,SIGNAL(selectionChanged(Q3ListViewItem *)), + SLOT(selectionChanged(Q3ListViewItem *))); + connect(mTodoListView,SIGNAL(clicked(Q3ListViewItem *)), + SLOT(selectionChanged(Q3ListViewItem *))); + connect(mTodoListView,SIGNAL(pressed(Q3ListViewItem *)), + SLOT(selectionChanged(Q3ListViewItem *))); #endif connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); @@ -881,7 +897,7 @@ void KOTodoView::updateView() mTodoListView->setFont( fo ); // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); //mTodoListView->header()->setMaximumHeight(fm.height()); - QPtrList<Todo> todoList = calendar()->todos(); + Q3PtrList<Todo> todoList = calendar()->todos(); /* kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; @@ -1044,7 +1060,7 @@ bool KOTodoView::checkTodo( Todo * todo ) return true; } -void KOTodoView::restoreItemState( QListViewItem *item ) +void KOTodoView::restoreItemState( Q3ListViewItem *item ) { pendingSubtodo = 0; while( item ) { @@ -1096,9 +1112,9 @@ void KOTodoView::updateConfig() mTodoListView->repaintContents(); } -QPtrList<Incidence> KOTodoView::selectedIncidences() +Q3PtrList<Incidence> KOTodoView::selectedIncidences() { - QPtrList<Incidence> selected; + Q3PtrList<Incidence> selected; KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); // if (!item) item = mActiveItem; @@ -1107,9 +1123,9 @@ QPtrList<Incidence> KOTodoView::selectedIncidences() return selected; } -QPtrList<Todo> KOTodoView::selectedTodos() +Q3PtrList<Todo> KOTodoView::selectedTodos() { - QPtrList<Todo> selected; + Q3PtrList<Todo> selected; KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); // if (!item) item = mActiveItem; @@ -1127,7 +1143,7 @@ void KOTodoView::showDates(const QDate &, const QDate &) { } -void KOTodoView::showEvents(QPtrList<Event>) +void KOTodoView::showEvents(Q3PtrList<Event>) { kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; } @@ -1140,19 +1156,19 @@ void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, #endif } -void KOTodoView::editItem(QListViewItem *item ) +void KOTodoView::editItem(Q3ListViewItem *item ) { if ( item ) emit editTodoSignal(((KOTodoViewItem *)item)->todo()); } -void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) +void KOTodoView::showItem(Q3ListViewItem *item,const QPoint &,int) { if ( item ) emit showTodoSignal(((KOTodoViewItem *)item)->todo()); } -void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) +void KOTodoView::popupMenu(Q3ListViewItem *item,const QPoint &p,int column) { pendingSubtodo = 0; mActiveItem = (KOTodoViewItem *)item; @@ -1361,7 +1377,7 @@ void KOTodoView::toggleRunningItemQuick() topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); } } -void KOTodoView::itemDoubleClicked(QListViewItem *item) +void KOTodoView::itemDoubleClicked(Q3ListViewItem *item) { if ( pendingSubtodo != 0 ) { topLevelWidget()->setCaption(i18n("Reparenting aborted!")); @@ -1428,7 +1444,7 @@ void KOTodoView::toggleRunningItem() } } -void KOTodoView::itemClicked(QListViewItem *item) +void KOTodoView::itemClicked(Q3ListViewItem *item) { //qDebug("KOTodoView::itemClicked %d", item); if (!item) { @@ -1441,7 +1457,7 @@ void KOTodoView::itemClicked(QListViewItem *item) KOTodoViewItem *todoItem = (KOTodoViewItem *)item; if ( pendingSubtodo != 0 ) { bool allowReparent = true; - QListViewItem *par = item; + Q3ListViewItem *par = item; while ( par ) { if ( par == pendingSubtodo ) { allowReparent = false; @@ -1469,7 +1485,7 @@ void KOTodoView::setDocumentId( const QString &id ) mDocPrefs->setDoc( id ); } -void KOTodoView::itemStateChanged( QListViewItem *item ) +void KOTodoView::itemStateChanged( Q3ListViewItem *item ) { if (!item) return; @@ -1542,7 +1558,7 @@ void KOTodoView::setAllClose() setOpen(mTodoListView->firstChild(), false); resetCurrentItem(); } -void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) +void KOTodoView::setOpen( Q3ListViewItem* item, bool setOpenI) { while ( item ) { @@ -1563,7 +1579,7 @@ void KOTodoView::displayAllFlat() clearList (); mPopupMenu->setItemChecked( 8,true ); isFlatDisplay = true; - QPtrList<Todo> todoList = calendar()->todos(); + Q3PtrList<Todo> todoList = calendar()->todos(); Todo *todo; for(todo = todoList.first(); todo; todo = todoList.next()) { if ( checkTodo( todo ) ) { diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 0cbc087..a9e7f30 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -26,15 +26,25 @@ #include <qfont.h> #include <qfontmetrics.h> #include <qlineedit.h> -#include <qptrlist.h> -#include <qstrlist.h> -#include <qlistbox.h> -#include <qpopupmenu.h> +#include <q3ptrlist.h> +#include <q3strlist.h> +#include <q3listbox.h> +#include <q3popupmenu.h> #include <qlabel.h> #include <qmap.h> #include <qdialog.h> #include <qlabel.h> -#include <qlistview.h> +#include <q3listview.h> +//Added by qt3to4: +#include <QDragMoveEvent> +#include <QDropEvent> +#include <QDragLeaveEvent> +#include <QWheelEvent> +#include <QPaintEvent> +#include <QFocusEvent> +#include <QMouseEvent> +#include <QKeyEvent> +#include <QDragEnterEvent> #include <klistview.h> #include <libkcal/calendar.h> @@ -101,7 +111,7 @@ class KOTodoListView : public KListView signals: void paintNeeded(); void todoDropped(Todo *, int); - void double_Clicked(QListViewItem *item); + void double_Clicked(Q3ListViewItem *item); void reparentTodoSignal( Todo *,Todo * ); void unparentTodoSignal(Todo *); void deleteTodo( Todo * ); @@ -124,7 +134,7 @@ class KOTodoListView : public KListView Calendar *mCalendar; QPoint mPressPos; bool mMousePressed; - QListViewItem *mOldCurrent; + Q3ListViewItem *mOldCurrent; bool mFlagKeyPressed; void keyPressEvent ( QKeyEvent * ) ; void keyReleaseEvent ( QKeyEvent * ) ; @@ -157,8 +167,8 @@ class KOTodoView : public KOrg::BaseView KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); ~KOTodoView(); - QPtrList<Incidence> selectedIncidences(); - QPtrList<Todo> selectedTodos(); + Q3PtrList<Incidence> selectedIncidences(); + Q3PtrList<Todo> selectedTodos(); DateList selectedDates() {DateList q; @@ -184,14 +194,14 @@ class KOTodoView : public KOrg::BaseView void changeEventDisplay(Event *, int); void showDates(const QDate &start, const QDate &end); - void showEvents(QPtrList<Event> eventList); + void showEvents(Q3PtrList<Event> eventList); void clearSelection(); void jumpToDate (); - void editItem(QListViewItem *item); - void showItem(QListViewItem *item,const QPoint &,int); - void popupMenu(QListViewItem *item,const QPoint &,int); + void editItem(Q3ListViewItem *item); + void showItem(Q3ListViewItem *item,const QPoint &,int); + void popupMenu(Q3ListViewItem *item,const QPoint &,int); void newTodo(); void newSubTodo(); void unparentTodo(); @@ -219,10 +229,10 @@ class KOTodoView : public KOrg::BaseView void toggleQuickTodo(); void updateTodo( Todo *, int ); - void itemClicked(QListViewItem *); - void itemStateChanged(QListViewItem *); + void itemClicked(Q3ListViewItem *); + void itemStateChanged(Q3ListViewItem *); void modified(bool); - void itemDoubleClicked(QListViewItem *item); + void itemDoubleClicked(Q3ListViewItem *item); void resetFocusToList(); void fillCategories (); void fillCal (); @@ -273,18 +283,18 @@ class KOTodoView : public KOrg::BaseView bool mPendingUpdateBeforeRepaint; friend class KOTodoViewItem; QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); - void restoreItemState( QListViewItem * ); + void restoreItemState( Q3ListViewItem * ); bool checkTodo( Todo * ); bool isFlatDisplay; - void setOpen( QListViewItem*, bool setOpen); + void setOpen( Q3ListViewItem*, bool setOpen); KOTodoListView *mTodoListView; - QPopupMenu *mItemPopupMenu; - QPopupMenu *mPopupMenu; - QPopupMenu *mPriorityPopupMenu; - QPopupMenu *mPercentageCompletedPopupMenu; - QPopupMenu *mCategoryPopupMenu; - QPopupMenu *mCalPopupMenu; + Q3PopupMenu *mItemPopupMenu; + Q3PopupMenu *mPopupMenu; + Q3PopupMenu *mPriorityPopupMenu; + Q3PopupMenu *mPercentageCompletedPopupMenu; + Q3PopupMenu *mCategoryPopupMenu; + Q3PopupMenu *mCalPopupMenu; QMap<int, int> mPercentage; QMap<int, int> mPriority; diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 519bb16..c21816d 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -19,7 +19,11 @@ #include <klocale.h> #include <kdebug.h> -#include <qapp.h> +#include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3PointArray> +#include <QPixmap> #include <kglobal.h> #include <kiconloader.h> @@ -27,14 +31,14 @@ #include "kotodoview.h" #include "koprefs.h" -KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) - : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) +KOTodoViewItem::KOTodoViewItem( Q3ListView *parent, Todo *todo, KOTodoView *kotodo) + : Q3CheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) { construct(); } KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) - : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) + : Q3CheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) { construct(); } @@ -80,7 +84,7 @@ void KOTodoViewItem::setSortKey(int column,const QString &key) void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, int y,int h) { - QListViewItem::paintBranches(p,cg,w,y,h); + Q3ListViewItem::paintBranches(p,cg,w,y,h); } #else #endif @@ -316,7 +320,7 @@ void KOTodoViewItem::stateChange(bool state) else setSortKey(2,QString::number(99)); } if ( state ) { - QListViewItem * myChild = firstChild(); + Q3ListViewItem * myChild = firstChild(); KOTodoViewItem *item; while( myChild ) { //qDebug("stateCH "); @@ -325,7 +329,7 @@ void KOTodoViewItem::stateChange(bool state) myChild = myChild->nextSibling(); } } else { - QListViewItem * myChild = parent(); + Q3ListViewItem * myChild = parent(); if ( myChild ) (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); } @@ -383,12 +387,12 @@ bool KOTodoViewItem::isAlternate() { KOTodoViewItem *item; bool previous = true; - if (QListViewItem::parent()) + if (Q3ListViewItem::parent()) { - item = static_cast<KOTodoViewItem *>(QListViewItem::parent()); + item = static_cast<KOTodoViewItem *>(Q3ListViewItem::parent()); if (item) previous = item->m_odd; - item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); + item = static_cast<KOTodoViewItem *>(Q3ListViewItem::parent()->firstChild()); } else { @@ -476,13 +480,13 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling QColor fc = KOPrefs::instance()->mHighlightColor; if ( mTodo->percentComplete() == 100 ) - fc = darkGreen; + fc = Qt::darkGreen; p->drawRect( 2, 2, width-4, height()-4); p->fillRect( 3, 3, progress, height()-6, fc ); p->restore(); } else { - QCheckListItem::paintCell(p, _cg, column, width, alignment); + Q3CheckListItem::paintCell(p, _cg, column, width, alignment); } return; } @@ -494,12 +498,12 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); - QListView *lv = listView(); + Q3ListView *lv = listView(); if ( !lv ) return; int marg = 2;//lv->itemMargin(); int r = 0; - QCheckListItem::Type myType = QCheckListItem::CheckBox; + Q3CheckListItem::Type myType = Q3CheckListItem::CheckBox; int BoxSize = 20; int boxOffset = 2; int xOffset = 2; @@ -522,7 +526,7 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i if ( !pixmap( 0 ) ) r += BoxSize + 4; } else { - ASSERT( lv ); //### + Q_ASSERT( lv ); //### // QFontMetrics fm( lv->font() ); // int d = fm.height(); int x = 0; @@ -539,7 +543,7 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i x++; y++; if ( isOn() ) { - QPointArray a( 7*2 ); + Q3PointArray a( 7*2 ); int i, xx, yy; xx = x+xOffset+marg+(boxOffset/2); yy = y+5+boxOffset; @@ -555,7 +559,7 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i a.setPoint( 2*i+1, xx, yy+2 ); xx++; yy--; } - p->setPen( darkGreen ); + p->setPen( Qt::darkGreen ); p->drawLineSegments( a ); } //////////////////////// @@ -565,9 +569,9 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i p->translate( r, 0 ); p->setPen( QPen( _cg.text() ) ); - QListViewItem::paintCell( p, _cg, column, width - r, align ); + Q3ListViewItem::paintCell( p, _cg, column, width - r, align ); if ( mTodo->cancelled () ) { - p->setPen( black ); + p->setPen( Qt::black ); QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); int wid = br.width() +lineStart; if ( wid > width-3 ) diff --git a/korganizer/kotodoviewitem.h b/korganizer/kotodoviewitem.h index bd024c8..62a635c 100644 --- a/korganizer/kotodoviewitem.h +++ b/korganizer/kotodoviewitem.h @@ -22,13 +22,13 @@ #include <qfont.h> #include <qfontmetrics.h> #include <qlineedit.h> -#include <qptrlist.h> -#include <qstrlist.h> -#include <qlistbox.h> -#include <qpopupmenu.h> +#include <q3ptrlist.h> +#include <q3strlist.h> +#include <q3listbox.h> +#include <q3popupmenu.h> #include <qlabel.h> #include <qmap.h> -#include <qlistview.h> +#include <q3listview.h> #include <qpainter.h> #include <libkcal/calendar.h> @@ -45,7 +45,7 @@ class KOTodoView; @author Cornelius Schumacher <schumacher@kde.org> @see KOTodoView */ -class KOTodoViewItem : public QCheckListItem +class KOTodoViewItem : public Q3CheckListItem { public: /** @@ -54,7 +54,7 @@ class KOTodoViewItem : public QCheckListItem @param parent is the list view to which this item belongs. @param ev is the event to have the item display information for. */ - KOTodoViewItem(QListView *parent, Todo *todo, KOTodoView *kotodo); + KOTodoViewItem(Q3ListView *parent, Todo *todo, KOTodoView *kotodo); KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo); //~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );} diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 4057ae0..07c4295 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -23,7 +23,9 @@ without including the source code for Qt in the source distribution. */ -#include <qwidgetstack.h> +#include <q3widgetstack.h> +//Added by qt3to4: +#include <Q3PtrList> #include <kconfig.h> #include <kglobal.h> @@ -457,8 +459,8 @@ void KOViewManager::showListView() mMainView, SLOT ( moveIncidence( Incidence * ) ) ); connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), mMainView, SLOT ( beamIncidence( Incidence * ) ) ); - connect( mListView, SIGNAL( beamIncidenceList( QPtrList<Incidence> ) ), - mMainView, SLOT ( beamIncidenceList( QPtrList<Incidence> ) ) ); + connect( mListView, SIGNAL( beamIncidenceList( Q3PtrList<Incidence> ) ), + mMainView, SLOT ( beamIncidenceList( Q3PtrList<Incidence> ) ) ); } // bool temp = mFlagShowNextxDays; //globalFlagBlockPainting = true; diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index f88403c..bfe930f 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -18,14 +18,20 @@ */ #include <qlayout.h> -#include <qtextbrowser.h> +#include <q3textbrowser.h> #include <qtextcodec.h> #include <qfileinfo.h> #include <qlabel.h> #include <qapplication.h> +#include <QDesktopWidget> #ifdef DESKTOP_VERSION -#include <qpaintdevicemetrics.h> +#include <q3paintdevicemetrics.h> +//Added by qt3to4: +#include <Q3PtrList> +#include <QHideEvent> +#include <Q3VBoxLayout> +#include <QShowEvent> #endif #include <kglobal.h> #include <klocale.h> @@ -42,7 +48,7 @@ #include "koprefs.h" #include "koeventviewerdialog.h" #include "koeventviewer.h" -#include <qstylesheet.h> +#include <q3stylesheet.h> #include "kowhatsnextview.h" using namespace KOrg; @@ -56,7 +62,7 @@ void WhatsNextTextBrowser::setSource(const QString& n) emit showIncidence(n); return; } else { - QTextBrowser::setSource(n); + Q3TextBrowser::setSource(n); } } void WhatsNextTextBrowser::printMe() @@ -72,7 +78,7 @@ void WhatsNextTextBrowser::printMe() return; QPainter p; p.begin ( &printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); @@ -103,19 +109,19 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, setFont( KOPrefs::instance()->mWhatsNextFont ); mView = new WhatsNextTextBrowser(this); connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); - QStyleSheet* stsh = mView->styleSheet(); - QStyleSheetItem * style ; + Q3StyleSheet* stsh = mView->styleSheet(); + Q3StyleSheetItem * style ; style = stsh->item ("h2" ); if ( style ) { - style->setMargin(QStyleSheetItem::MarginAll,0); + style->setMargin(Q3StyleSheetItem::MarginAll,0); } style = stsh->item ("h3" ); if ( style ) { - style->setMargin(QStyleSheetItem::MarginAll,0); + style->setMargin(Q3StyleSheetItem::MarginAll,0); } mEventViewer = 0; - QBoxLayout *topLayout = new QVBoxLayout(this); + Q3BoxLayout *topLayout = new Q3VBoxLayout(this); // topLayout->addWidget(mDateLabel); topLayout->addWidget(mView); mTimer = new QTimer( this ); @@ -144,9 +150,9 @@ void KOWhatsNextView::clearList() mTimer->stop(); mView->setText(" "); } -QPtrList<Incidence> KOWhatsNextView::selectedIncidences() +Q3PtrList<Incidence> KOWhatsNextView::selectedIncidences() { - QPtrList<Incidence> eventList; + Q3PtrList<Incidence> eventList; return eventList; } @@ -219,8 +225,8 @@ void KOWhatsNextView::updateView() mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; int iii; mTodos.clear(); - QPtrList<Event> events; - QPtrList<Todo> todos = calendar()->todos(); + Q3PtrList<Event> events; + Q3PtrList<Todo> todos = calendar()->todos(); Todo * todo; //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; int daysToShow = KOPrefs::instance()->mWhatsNextDays ; @@ -454,7 +460,7 @@ void KOWhatsNextView::showDates(const QDate &, const QDate &) updateView(); } -void KOWhatsNextView::showEvents(QPtrList<Event>) +void KOWhatsNextView::showEvents(Q3PtrList<Event>) { } @@ -741,7 +747,7 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) ind += "-"; mText += "</li>\n"; } - QPtrList<Incidence> Relations = ev->relations(); + Q3PtrList<Incidence> Relations = ev->relations(); Incidence *to; for (to=Relations.first();to;to=Relations.next()) { if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio ) diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h index 93574ef..49fc448 100644 --- a/korganizer/kowhatsnextview.h +++ b/korganizer/kowhatsnextview.h @@ -19,22 +19,28 @@ #ifndef KOWHATSNEXTVIEW_H #define KOWHATSNEXTVIEW_H -#include <qtextbrowser.h> +#include <q3textbrowser.h> #include <qtimer.h> +//Added by qt3to4: +#include <QShowEvent> +#include <QHideEvent> +#include <QLabel> +#include <Q3ValueList> +#include <Q3PtrList> #include <korganizer/baseview.h> -class QListView; +class Q3ListView; class QLabel; class KOEventViewerDialog; #include <qpainter.h> #include <qwidget.h> -class WhatsNextTextBrowser : public QTextBrowser { +class WhatsNextTextBrowser : public Q3TextBrowser { Q_OBJECT public: - WhatsNextTextBrowser(QWidget *parent) : QTextBrowser(parent) {}; + WhatsNextTextBrowser(QWidget *parent) : Q3TextBrowser(parent) {}; void setSource(const QString &); void printMe(); @@ -58,7 +64,7 @@ class KOWhatsNextView : public KOrg::BaseView virtual int maxDatesHint(); virtual int currentDateCount(); void setEventViewer(KOEventViewerDialog* v ); - virtual QPtrList<Incidence> selectedIncidences(); + virtual Q3PtrList<Incidence> selectedIncidences(); void clearList(); DateList selectedDates() {DateList q; @@ -70,7 +76,7 @@ class KOWhatsNextView : public KOrg::BaseView virtual void updateView(); void printMe(); virtual void showDates(const QDate &start, const QDate &end); - virtual void showEvents(QPtrList<Event> eventList); + virtual void showEvents(Q3PtrList<Event> eventList); void updateConfig(); void changeEventDisplay(Event *, int); @@ -96,7 +102,7 @@ class KOWhatsNextView : public KOrg::BaseView // QLabel *mDateLabel; KOEventViewerDialog *mEventViewer; - QValueList<Incidence *> mTodos; + Q3ValueList<Incidence *> mTodos; }; #endif diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp index df9b2fc..e2ae4a6 100644 --- a/korganizer/ktimeedit.cpp +++ b/korganizer/ktimeedit.cpp @@ -21,12 +21,15 @@ without including the source code for Qt in the source distribution. */ -#include <qkeycode.h> +#include <qnamespace.h> #include <qcombobox.h> #include <qdatetime.h> #include <qlineedit.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QKeyEvent> #include <kmessagebox.h> #include <kglobal.h> @@ -45,7 +48,7 @@ // Difficult to get all in one... // But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help. KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) - : QComboBox(TRUE, parent, name) + : Q3ComboBox(TRUE, parent, name) { setInsertionPolicy(NoInsertion); mFlagKeyPressed = false; @@ -64,12 +67,12 @@ KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) do { insertItem(KGlobal::locale()->formatTime(timeEntry)); timeEntry = timeEntry.addSecs(60*15); - } while (!timeEntry.isNull()); + } while ( !( timeEntry.hour() || timeEntry.minute() ) ); // Add end of day. insertItem( KGlobal::locale()->formatTime( QTime( 23, 59, 59 ) ) ); updateText(); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(Qt::StrongFocus); connect(this, SIGNAL(activated(int)), this, SLOT(activ(int))); connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int))); @@ -208,8 +211,8 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) mFlagKeyPressed = true; } // Tap -> Focus Next Widget - if ( e->key() == Key_Tab ) { - QComboBox::keyPressEvent(e); + if ( e->key() == Qt::Key_Tab ) { + Q3ComboBox::keyPressEvent(e); return; } @@ -220,12 +223,12 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) // Switch for arrows, backspace and escape switch(e->key()) { - case Key_Escape: + case Qt::Key_Escape: lineEdit()->deselect(); - case Key_Tab: - QComboBox::keyPressEvent(e); + case Qt::Key_Tab: + Q3ComboBox::keyPressEvent(e); break; - case Key_Up: + case Qt::Key_Up: if ( e->state () == Qt::ControlButton ) { addTime(QTime(0,15,0), false ); lineEdit()->setCursorPosition(3); @@ -267,7 +270,7 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) break; } break; - case Key_Down: + case Qt::Key_Down: if ( e->state () == Qt::ControlButton ) { subTime(QTime(0,15,0), false ); lineEdit()->setCursorPosition(3); @@ -310,7 +313,7 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) } break; // set cursor to correct place - case Key_Left: + case Qt::Key_Left: if ( cpos == 3 ) --cpos; if ( cpos > 0) { @@ -321,7 +324,7 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) setSelect ( 0 , 1 ); break; // set cursor to correct place - case Key_Right: + case Qt::Key_Right: if ( cpos == 1 ) ++cpos; if ( cpos < maxpos ) { @@ -330,19 +333,19 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) } break; // rest - case Key_Prior: + case Qt::Key_Prior: subTime(QTime(1,0,0)); break; - case Key_Next: + case Qt::Key_Next: addTime(QTime(1,0,0)); break; - case Key_Backspace: + case Qt::Key_Backspace: if ( cpos > 0) { if ( cpos == 3 ) --cpos; if ( cpos > 5) cpos = 5; - text.at( cpos-1 ) = '0'; + text[ cpos-1 ] = '0'; lineEdit()->setText( text ); lineEdit()->setCursorPosition(--cpos); setSelect ( cpos , 1 ); @@ -352,7 +355,7 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) } // switch arrows // if cursor at string end, alltext market and keyEvent don't ArrowLeft -> deselect and cpos - if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Key_Left ) { + if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Qt::Key_Left ) { lineEdit()->deselect(); cpos = 0; lineEdit()->setCursorPosition(cpos); @@ -367,42 +370,42 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) if ( cpos < 5 ) { // switch another keys switch(e->key()) { - case Key_Delete: - text.at( cpos ) = '0'; + case Qt::Key_Delete: + text[ cpos ] = '0'; lineEdit()->setText( text ); lineEdit()->setCursorPosition(cpos); setSelect ( cpos , 1 ); changedText(); break; - case Key_9: - case Key_8: - case Key_7: - case Key_6: + case Qt::Key_9: + case Qt::Key_8: + case Qt::Key_7: + case Qt::Key_6: if ( !(cpos == 1 || cpos == 4) ) return; if ( cpos == 1 && text.at( 0 ) > '1') - text.at( 0 ) = '1'; - case Key_5: - case Key_4: - case Key_3: + text[ 0 ] = '1'; + case Qt::Key_5: + case Qt::Key_4: + case Qt::Key_3: if ( cpos < 1 ) return; if ( hour12Format && cpos == 1 ) return; - case Key_2: + case Qt::Key_2: if ( hour12Format && cpos == 0 ) return; if ( cpos == 0 && text.at( 1 ) > '3') - text.at( 1 ) = '3'; - case Key_1: - case Key_0: + text[ 1 ] = '3'; + case Qt::Key_1: + case Qt::Key_0: if ( hour12Format ) { - if ( e->key() == Key_0 && cpos == 1 && text.at( 0 ) == '0' ) + if ( e->key() == Qt::Key_0 && cpos == 1 && text.at( 0 ) == '0' ) return; - if ( e->key() == Key_0 && cpos == 0 && text.at( 1 ) == '0' ) - text.at( 1 ) = '1'; + if ( e->key() == Qt::Key_0 && cpos == 0 && text.at( 1 ) == '0' ) + text[ 1 ] = '1'; } - text.at( cpos ) = QChar ( e->key() ); + text[ cpos ] = QChar ( e->key() ); lineEdit()->setText( text ); if ( cpos == 1 ) ++cpos; @@ -411,11 +414,11 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) setSelect( cpos , 1 ); changedText(); break; - case Key_Home: + case Qt::Key_Home: lineEdit()->setCursorPosition(0); setSelect( cpos , 1 ); break; - case Key_End: + case Qt::Key_End: lineEdit()->setCursorPosition(5); lineEdit()->deselect(); break; @@ -425,13 +428,13 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) } // switch num keys } else if ( cpos == 5 ) {// if cpos < 5 if ( hour12Format ) { - if ( e->key() == Key_A ) { - text.at( 5 ) = 'a'; + if ( e->key() == Qt::Key_A ) { + text[ 5 ] = 'a'; lineEdit()->setText( text ); lineEdit()->setCursorPosition(5); - } else if ( e->key() == Key_P ) { - text.at( 5 ) = 'p'; + } else if ( e->key() == Qt::Key_P ) { + text[ 5 ] = 'p'; lineEdit()->setText( text ); lineEdit()->setCursorPosition(5); diff --git a/korganizer/ktimeedit.h b/korganizer/ktimeedit.h index b3d842d..1c7d18d 100644 --- a/korganizer/ktimeedit.h +++ b/korganizer/ktimeedit.h @@ -24,10 +24,13 @@ #define _KTIMEEDIT_H #include <qevent.h> -#include <qkeycode.h> +#include <qnamespace.h> #include <qstring.h> #include <qdatetime.h> #include <qcombobox.h> +#include <Q3ComboBox> +//Added by qt3to4: +#include <QKeyEvent> #include <kapplication.h> @@ -38,7 +41,7 @@ @short Provides a way to edit times in a user-friendly manner. @author Preston Brown, Ian Dawes */ -class KOTimeEdit : public QComboBox +class KOTimeEdit : public Q3ComboBox { Q_OBJECT public: diff --git a/korganizer/lineview.cpp b/korganizer/lineview.cpp index e72e41c..012455e 100644 --- a/korganizer/lineview.cpp +++ b/korganizer/lineview.cpp @@ -7,7 +7,7 @@ #include "lineview.h" LineView::LineView( QWidget *parent, const char *name ) : - QScrollView( parent, name ) + Q3ScrollView( parent, name ) { mPixelWidth = 1000; diff --git a/korganizer/lineview.h b/korganizer/lineview.h index aa34dbc..52ae9cf 100644 --- a/korganizer/lineview.h +++ b/korganizer/lineview.h @@ -1,10 +1,10 @@ #ifndef LINEVIEW_H #define LINEVIEW_H -#include <qscrollview.h> -#include <qptrlist.h> +#include <q3scrollview.h> +#include <q3ptrlist.h> -class LineView : public QScrollView +class LineView : public Q3ScrollView { Q_OBJECT public: @@ -28,7 +28,7 @@ class LineView : public QScrollView int end; }; - QPtrList<Line> mLines; + Q3PtrList<Line> mLines; int mPixelWidth; }; diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 4a0e24f..211fde6 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp @@ -4,13 +4,13 @@ #include <qpe/qpeapplication.h> #include <qcopchannel_qws.h> #include <qpe/global.h> +//Added by qt3to4: +#include <Q3CString> #include <stdlib.h> #else #include <qapplication.h> #include <qstring.h> #include <qwindowsstyle.h> -#include <qplatinumstyle.h> -#include <qsgistyle.h> #include <stdlib.h> #endif #include <qtextcodec.h> @@ -26,12 +26,12 @@ void dumpMissing(); int main( int argc, char **argv ) { + if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi"); #ifndef DESKTOP_VERSION QPEApplication a( argc, argv ); a.setKeepRunning (); #else QApplication a( argc, argv ); - QApplication::setStyle( new QPlatinumStyle ()); #ifdef _WIN32_ QString hdir ( getenv( "HOME") ); if ( hdir.isEmpty() ) { @@ -89,7 +89,7 @@ int main( int argc, char **argv ) MainWindow m; #ifndef DESKTOP_VERSION - QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(receiveStart( const QCString&, const QByteArray& ))); + QObject::connect( &a, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )),&m, SLOT(receiveStart( const Q3CString&, const QByteArray& ))); a.showMainWidget(&m ); #else a.setMainWidget(&m ); @@ -98,7 +98,7 @@ int main( int argc, char **argv ) //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); #endif if ( argc > 1 ) { - QCString command = argv[1]; + Q3CString command = argv[1]; if ( argc > 2 ) command += argv[2]; m.recieve(command, QByteArray() ); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 69ccde1..2004939 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1,24 +1,25 @@ #include <stdlib.h> #include <qaction.h> -#include <qpopupmenu.h> +#include <Q3Action> +#include <q3popupmenu.h> #include <qpainter.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> #include <qpushbutton.h> #include <qmessagebox.h> #include <qlineedit.h> #include <qtextcodec.h> #include <qfile.h> #include <qdir.h> -#include <qapp.h> +#include <qapplication.h> #include <qfileinfo.h> #include <qlabel.h> #include <qspinbox.h> #include <qcheckbox.h> #include <qmap.h> -#include <qwmatrix.h> -#include <qtextbrowser.h> -#include <qtextstream.h> +#include <qmatrix.h> +#include <q3textbrowser.h> +#include <q3textstream.h> #ifndef DESKTOP_VERSION #include <qpe/global.h> #include <qpe/qpetoolbar.h> @@ -28,8 +29,17 @@ #include <qtopia/qcopenvelope_qws.h> //#include <unistd.h> // for sleep #else -#include <qtoolbar.h> +#include <q3toolbar.h> #include <qapplication.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QPixmap> +#include <QCloseEvent> +#include <QKeyEvent> +#include <Q3VBoxLayout> +#include <QHideEvent> +#include <Q3CString> +#include <Q3PtrList> //#include <resource.h> #endif @@ -80,35 +90,35 @@ class KOex2phonePrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Export to phone options") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel *lab; lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); - lab->setAlignment (AlignHCenter ); - QHBox* temphb; - temphb = new QHBox( this ); + lab->setAlignment (Qt::AlignHCenter ); + Q3HBox* temphb; + temphb = new Q3HBox( this ); new QLabel( i18n("I/O device: "), temphb ); mPhoneDevice = new QLineEdit( temphb); lay->addWidget( temphb ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Connection: "), temphb ); mPhoneConnection = new QLineEdit( temphb); lay->addWidget( temphb ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Model(opt.): "), temphb ); mPhoneModel = new QLineEdit( temphb); lay->addWidget( temphb ); mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); mWriteBackFuture->setChecked( true ); lay->addWidget( mWriteBackFuture ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Max. weeks in future: ") , temphb ); mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); mWriteBackFutureWeeks->setValue( 8 ); lay->addWidget( temphb ); lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); - lab->setAlignment (AlignHCenter ); + lab->setAlignment (Qt::AlignHCenter ); QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); lay->addWidget( ok ); QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); @@ -134,7 +144,7 @@ QPixmap* sgListViewJournalPix; int globalFlagBlockStartup; MainWindow::MainWindow( QWidget *parent, const char *name ) : - QMainWindow( parent, name ) + Q3MainWindow( parent, name ) { sgListViewCompletedPix[5] = &listviewPix; sgListViewCompletedPix[0] = &listviewPix0; @@ -185,18 +195,18 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : p->mCurrentDisplayedView = 0; if ( p->mHourSize > 22 ) p->mHourSize = 22; - QMainWindow::ToolBarDock tbd; + Qt::ToolBarDock tbd; if ( p->mToolBarHor ) { if ( p->mToolBarUp ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUp ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } if ( KOPrefs::instance()->mUseAppColors ) QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); @@ -213,15 +223,15 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : { if ( p->mToolBarHorF ) { if ( p->mToolBarUpF ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUpF ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } filterToolBar = new QPEToolBar ( this ); filterMenubar = new KMenuBar( 0 ); @@ -230,7 +240,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : filterToolBar->setFocusPolicy( NoFocus ); filterMenubar->setFocusPolicy( NoFocus ); #endif - filterPopupMenu = new QPopupMenu( this ); + filterPopupMenu = new Q3PopupMenu( this ); filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); QString addTest = "A"; filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); @@ -259,29 +269,29 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : #endif if ( p->mToolBarHorV ) { if ( p->mToolBarUpV ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUpV ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } viewToolBar = new QPEToolBar( this ); addToolBar (viewToolBar , tbd ); if ( p->mToolBarHorN ) { if ( p->mToolBarUpN ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUpN ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } navigatorToolBar = new QPEToolBar( this ); addToolBar (navigatorToolBar , tbd ); @@ -440,9 +450,9 @@ void MainWindow::loadDataAfterStart() connect( mView, SIGNAL( modifiedChanged( bool ) ), SLOT( slotModifiedChanged( bool ) ) ); #ifndef DESKTOP_VERSION - connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); - connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& ))); - disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& ))); + connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & ))); + connect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(recieve( const Q3CString&, const QByteArray& ))); + disconnect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(receiveStart( const Q3CString&, const QByteArray& ))); if ( !mCStringMess.isEmpty() ) recieve( mCStringMess, mByteData ); #endif @@ -509,7 +519,7 @@ void MainWindow::toggleBeamReceive() qDebug("KO: Enable BeamReceive "); brAction->setOn(true); infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; - QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); + QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(recieve( const Q3CString&, const QByteArray& ))); #endif } void MainWindow::showMaximized () @@ -600,22 +610,22 @@ void MainWindow::closeEvent( QCloseEvent* ce ) } -void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) +void MainWindow::receiveStart( const Q3CString& cmsg, const QByteArray& data ) { qDebug("KO: QCOP start message received: %s ", cmsg.data() ); mCStringMess = cmsg; mByteData = data; } -void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) +void MainWindow::recieve( const Q3CString& cmsg, const QByteArray& data ) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); //QString datamess; //qDebug("message "); qDebug("KO: QCOP message received: %s ", cmsg.data() ); if ( cmsg == "setDocument(QString)" ) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); QString fileName; stream >> fileName; //qDebug("filename %s ", fileName.latin1()); @@ -744,21 +754,21 @@ void MainWindow::initActions() KOPrefs *p = KOPrefs::instance(); //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); - QPopupMenu *viewMenu = new QPopupMenu( this ); - QPopupMenu *actionMenu = new QPopupMenu( this ); - mCurrentItemMenu = new QPopupMenu ( this ); - QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); - QPopupMenu *importMenu = new QPopupMenu( this ); - QPopupMenu *importMenu_X = new QPopupMenu( this ); - QPopupMenu *exportMenu_X = new QPopupMenu( this ); - QPopupMenu *beamMenu_X = new QPopupMenu( this ); - selectFilterMenu = new QPopupMenu( this ); + Q3PopupMenu *viewMenu = new Q3PopupMenu( this ); + Q3PopupMenu *actionMenu = new Q3PopupMenu( this ); + mCurrentItemMenu = new Q3PopupMenu ( this ); + Q3PopupMenu *nextConflictMenu = new Q3PopupMenu ( this ); + Q3PopupMenu *importMenu = new Q3PopupMenu( this ); + Q3PopupMenu *importMenu_X = new Q3PopupMenu( this ); + Q3PopupMenu *exportMenu_X = new Q3PopupMenu( this ); + Q3PopupMenu *beamMenu_X = new Q3PopupMenu( this ); + selectFilterMenu = new Q3PopupMenu( this ); selectFilterMenu->setCheckable( true ); - syncMenu = new QPopupMenu( this ); - configureAgendaMenu = new QPopupMenu( this ); - configureToolBarMenu = new QPopupMenu( this ); - QPopupMenu *helpMenu = new QPopupMenu( this ); - QIconSet icon; + syncMenu = new Q3PopupMenu( this ); + configureAgendaMenu = new Q3PopupMenu( this ); + configureToolBarMenu = new Q3PopupMenu( this ); + Q3PopupMenu *helpMenu = new Q3PopupMenu( this ); + QIcon icon; int pixWid = 22, pixHei = 22; QString pathString = ""; if ( !p->mToolBarMiniIcons ) { @@ -791,7 +801,7 @@ void MainWindow::initActions() menuBar1->insertItem( i18n("Help"), helpMenu ); } else { menuBar1 = new KMenuBar( iconToolBar ); - QPopupMenu *menuBar = new QPopupMenu( this ); + Q3PopupMenu *menuBar = new Q3PopupMenu( this ); icon = loadPixmap( pathString + "z_menu" ); menuBar1->insertItem( icon.pixmap(), menuBar); //menuBar1->insertItem( i18n("ME"), menuBar); @@ -818,7 +828,7 @@ void MainWindow::initActions() mWeekPixmap.resize( pixWid , pixHei ); mWeekPixmap.fill( mWeekBgColor ); icon = mWeekPixmap; - mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); + mWeekAction = new Q3Action( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); if ( p-> mShowIconWeekNum ) mWeekAction->addTo( iconToolBar ); mWeekFont = font(); @@ -840,18 +850,18 @@ void MainWindow::initActions() connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); if ( p->mShowIconFilterview ) { icon = loadPixmap( pathString + "filter" ); - actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); + actionFilterMenuTB = new Q3Action( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); connect( actionFilterMenuTB, SIGNAL( activated() ), this, SLOT( fillFilterMenuTB() ) ); actionFilterMenuTB->addTo( iconToolBar ); - selectFilterMenuTB = new QPopupMenu( this ); + selectFilterMenuTB = new Q3PopupMenu( this ); selectFilterMenuTB->setCheckable( true ); connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); } //#endif // ****************** - QAction *action; + Q3Action *action; // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); configureToolBarMenu->setCheckable( true ); @@ -866,35 +876,35 @@ void MainWindow::initActions() connect( configureAgendaMenu, SIGNAL( aboutToShow()), this, SLOT( showConfigureAgenda( ) ) ); icon = loadPixmap( pathString + "today" ); - QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); + Q3Action* today_action = new Q3Action( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); today_action->addTo( actionMenu ); connect( today_action, SIGNAL( activated() ), mView, SLOT( goToday() ) ); icon = loadPixmap( pathString + "picker" ); - QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); + Q3Action* dPickerAction = new Q3Action( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); dPickerAction->addTo( actionMenu ); connect( dPickerAction, SIGNAL( activated() ), mView, SLOT( showDatePicker() ) ); icon = loadPixmap( pathString + "search" ); - QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); + Q3Action* search_action = new Q3Action( i18n("Search"), icon, i18n("Search..."), 0, this ); search_action->addTo( actionMenu ); connect( search_action, SIGNAL( activated() ), mView->dialogManager(), SLOT( showSearchDialog() ) ); actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); - action = new QAction( "Undo Delete", i18n("All events"), 0, this ); + action = new Q3Action( "Undo Delete", i18n("All events"), 0, this ); action->addTo( nextConflictMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( conflictAll() ) ); - action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); + action = new Q3Action( "Undo Delete", i18n("Allday events"), 0, this ); action->addTo( nextConflictMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( conflictAllday() ) ); - action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); + action = new Q3Action( "Undo Delete", i18n("Events with time"), 0, this ); action->addTo( nextConflictMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( conflictNotAll() ) ); @@ -902,16 +912,16 @@ void MainWindow::initActions() actionMenu->insertSeparator(); icon = loadPixmap( pathString + "newevent" ); - QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); + Q3Action* ne_action = new Q3Action( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); ne_action->addTo( mCurrentItemMenu ); connect( ne_action, SIGNAL( activated() ), mView, SLOT( newEvent() ) ); icon = loadPixmap( pathString + "newtodo" ); - QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); + Q3Action* nt_action = new Q3Action( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); nt_action->addTo( mCurrentItemMenu ); connect( nt_action, SIGNAL( activated() ), mView, SLOT( newTodo() ) ); - mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, + mNewSubTodoAction = new Q3Action( "new_subtodo", i18n("New Sub-Todo..."), 0, this ); mNewSubTodoAction->addTo( mCurrentItemMenu ); connect( mNewSubTodoAction, SIGNAL( activated() ), @@ -930,44 +940,44 @@ void MainWindow::initActions() configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); - mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); + mShowAction = new Q3Action( "show_incidence", i18n("Show"), 0, this ); mShowAction->addTo( mCurrentItemMenu ); connect( mShowAction, SIGNAL( activated() ), mView, SLOT( showIncidence() ) ); - mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); + mEditAction = new Q3Action( "edit_incidence", i18n("Edit..."), 0, this ); mEditAction->addTo( mCurrentItemMenu ); connect( mEditAction, SIGNAL( activated() ), mView, SLOT( editIncidence() ) ); - mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); + mDeleteAction = new Q3Action( "delete_incidence", i18n("Delete..."), 0, this ); mDeleteAction->addTo( mCurrentItemMenu ); connect( mDeleteAction, SIGNAL( activated() ), mView, SLOT( deleteIncidence() ) ); - mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); + mCloneAction = new Q3Action( "clone_incidence", i18n("Clone..."), 0, this ); mCloneAction->addTo( mCurrentItemMenu ); connect( mCloneAction, SIGNAL( activated() ), mView, SLOT( cloneIncidence() ) ); - mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); + mMoveAction = new Q3Action( "Move_incidence", i18n("Move..."), 0, this ); mMoveAction->addTo( mCurrentItemMenu ); connect( mMoveAction, SIGNAL( activated() ), mView, SLOT( moveIncidence() ) ); #ifndef DESKTOP_VERSION - mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); + mBeamAction = new Q3Action( "Beam_incidence", i18n("Beam..."), 0, this ); mBeamAction->addTo(mCurrentItemMenu ); connect( mBeamAction, SIGNAL( activated() ), mView, SLOT( beamIncidence() ) ); #endif - mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); + mCancelAction = new Q3Action( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); mCancelAction->addTo( mCurrentItemMenu ); connect( mCancelAction, SIGNAL( activated() ), mView, SLOT( toggleCancelIncidence() ) ); mCurrentItemMenu->insertSeparator(); - action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); + action = new Q3Action( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); action->addTo( mCurrentItemMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( undo_delete() ) ); @@ -979,7 +989,7 @@ void MainWindow::initActions() icon = SmallIcon("1leftrightarrow" ); } configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); - QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); + Q3Action* FSaction = new Q3Action( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); FSaction->addTo( viewMenu ); connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); @@ -987,21 +997,21 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "filter" ); configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); icon = loadPixmap( pathString + "configure" ); - action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); + action = new Q3Action( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleFilter() ) ); mToggleFilter = action; icon = loadPixmap( pathString + "navi" ); configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); - action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); + action = new Q3Action( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleDateNavigatorWidget() ) ); mToggleNav = action ; icon = loadPixmap( pathString + "allday" ); configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); - action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); + action = new Q3Action( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleAllDaySize() ) ); @@ -1031,14 +1041,14 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "whatsnext" ); configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); - QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); + Q3Action* whatsnext_action = new Q3Action( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); whatsnext_action->addTo( viewMenu ); connect( whatsnext_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWhatsNextView() ) ); icon = loadPixmap( pathString + "xdays" ); configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); - QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); + Q3Action* xdays_action = new Q3Action( i18n("Next days"), icon, i18n("Next days"), 0, this ); xdays_action->addTo( viewMenu ); connect( xdays_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showNextXView() ) ); @@ -1046,7 +1056,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "journal" ); configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); - QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); + Q3Action* viewjournal_action = new Q3Action( i18n("Journal"), icon, i18n("Journal"), 0, this ); viewjournal_action->addTo( viewMenu ); connect( viewjournal_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showJournalView() ) ); @@ -1054,7 +1064,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "day" ); configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); - QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); + Q3Action* day1_action = new Q3Action( i18n("Day View"), icon, i18n("Day View"), 0, this ); day1_action->addTo( viewMenu ); // action->addTo( toolBar ); connect( day1_action, SIGNAL( activated() ), @@ -1062,42 +1072,42 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "workweek" ); configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); - QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); + Q3Action* day5_action = new Q3Action( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); day5_action->addTo( viewMenu ); connect( day5_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWorkWeekView() ) ); icon = loadPixmap( pathString + "week" ); configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); - QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); + Q3Action* day7_action = new Q3Action( i18n("Week"), icon, i18n("Week"), 0, this ); day7_action->addTo( viewMenu ); connect( day7_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWeekView() ) ); icon = loadPixmap( pathString + "workweek2" ); configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); - QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); + Q3Action* day6_action = new Q3Action( i18n("List week"), icon, i18n("List week"), 0, this ); day6_action->addTo( viewMenu ); connect( day6_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showMonthViewWeek() ) ); icon = loadPixmap( pathString + "month" ); configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); - QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); + Q3Action* month_action = new Q3Action( i18n("Month"), icon, i18n("Month"), 0, this ); month_action->addTo( viewMenu ); connect( month_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showMonthView() ) ); icon = loadPixmap( pathString + "list" ); configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); - QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); + Q3Action* showlist_action = new Q3Action( i18n("List View"), icon, i18n("List View"), 0, this ); showlist_action->addTo( viewMenu ); connect( showlist_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showListView() ) ); icon = loadPixmap( pathString + "todo" ); configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); - QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); + Q3Action* todoview_action = new Q3Action( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); todoview_action->addTo( viewMenu ); connect( todoview_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showTodoView() ) ); @@ -1105,7 +1115,7 @@ void MainWindow::initActions() #if 0 - action = new QAction( "view_timespan", "Time Span", 0, this ); + action = new Q3Action( "view_timespan", "Time Span", 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView->viewManager(), SLOT( showTimeSpanView() ) ); @@ -1113,7 +1123,7 @@ void MainWindow::initActions() - action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, + action = new Q3Action( "purge_completed", i18n("Purge Completed..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); @@ -1125,12 +1135,12 @@ void MainWindow::initActions() actionMenu->insertSeparator(); - action = new QAction( "manage cat", i18n("Edit category list..."), 0, + action = new Q3Action( "manage cat", i18n("Edit category list..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); - action = new QAction( "manage cat", i18n("Manage new categories..."), 0, + action = new Q3Action( "manage cat", i18n("Manage new categories..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); @@ -1138,15 +1148,15 @@ void MainWindow::initActions() actionMenu->insertSeparator(); icon = loadPixmap( pathString + "configure" ); - action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); + action = new Q3Action( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( edit_options() ) ); - action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); + action = new Q3Action( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), this, SLOT( calHint() ) ); - action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); + action = new Q3Action( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( edit_global_options() ) ); @@ -1155,29 +1165,29 @@ void MainWindow::initActions() } // actionMenu->insertSeparator(); - action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, + action = new Q3Action( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); - action = new QAction( "import_quick", i18n("Import last file"), 0, + action = new Q3Action( "import_quick", i18n("Import last file"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); importMenu_X->insertSeparator(); - action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, + action = new Q3Action( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); //#ifndef DESKTOP_VERSION importMenu_X->insertSeparator(); - action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, + action = new Q3Action( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); //#else #ifdef _OL_IMPORT_ importMenu_X->insertSeparator(); - action = new QAction( "import_ol", i18n("Import from OL"), 0, + action = new Q3Action( "import_ol", i18n("Import from OL"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); @@ -1186,30 +1196,30 @@ void MainWindow::initActions() //importMenu->insertSeparator(); #if 0 - action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, + action = new Q3Action( "load_cal", i18n("Load Calendar Backup"), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); #endif - action = new QAction( "save_cal", i18n("Save Backup..."), 0, + action = new Q3Action( "save_cal", i18n("Save Backup..."), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); importMenu->insertSeparator(); importMenu->insertItem( i18n("Import"), importMenu_X ); //importMenu->insertSeparator(); - action = new QAction( "export ical", i18n("Export All Data"), 0, + action = new Q3Action( "export ical", i18n("Export All Data"), 0, this ); action->addTo( exportMenu_X ); connect( action, SIGNAL( activated() ), SLOT( exportICalendar() ) ); - action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, + action = new Q3Action( "import_qtopia", i18n("Export VCalendar"), 0, this ); action->addTo( exportMenu_X ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); //LR - QPopupMenu *ex2phone = new QPopupMenu( this ); + Q3PopupMenu *ex2phone = new Q3PopupMenu( this ); ex2phone->insertItem(i18n("Complete calendar..."), 1 ); ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); @@ -1219,18 +1229,18 @@ void MainWindow::initActions() mPrintSelAction = 0; #ifndef DESKTOP_VERSION //importMenu->insertSeparator(); - brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, + brAction = new Q3Action( "beam toggle", i18n("Beam receive enabled"), 0, this ); brAction->addTo( beamMenu_X ); brAction->setToggleAction (true ) ; connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); - action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, + action = new Q3Action( "beam all", i18n("Beam complete calendar..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); - action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, + action = new Q3Action( "beam all", i18n("Beam filtered calendar..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); @@ -1238,31 +1248,31 @@ void MainWindow::initActions() #else //importMenu->insertSeparator(); icon = loadPixmap( pathString + "print" ); - action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); + action = new Q3Action( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), this, SLOT( printCal() ) ); icon = loadPixmap( pathString + "week" ); - action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); + action = new Q3Action( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), this, SLOT( printSel() ) ); icon = loadPixmap( pathString + "whatsnext" ); - action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); + action = new Q3Action( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView->viewManager(), SLOT( slotprintWNV() ) ); icon = loadPixmap( pathString + "list" ); - action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); + action = new Q3Action( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), this, SLOT( printListView() ) ); icon = loadPixmap( pathString + "newevent" ); - action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); + action = new Q3Action( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView, SLOT( slotprintSelInc() ) ); @@ -1271,11 +1281,11 @@ void MainWindow::initActions() #endif importMenu->insertSeparator(); - action = new QAction( "beam all", i18n("Save"), 0, + action = new Q3Action( "beam all", i18n("Save"), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); - action = new QAction( "beam all", i18n("Exit (+save)"), 0, + action = new Q3Action( "beam all", i18n("Exit (+save)"), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); @@ -1284,59 +1294,59 @@ void MainWindow::initActions() //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); icon = loadPixmap( "korganizer/korganizer" ); - action = new QAction( "Whats New", i18n("What's new?"), 0,this ); + action = new Q3Action( "Whats New", i18n("What's new?"), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( whatsNew() ) ); - action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); + action = new Q3Action( "featureHowto", i18n("Features + hints..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( features() ) ); - action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); + action = new Q3Action( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( keyBindings() ) ); - action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); + action = new Q3Action( "Storage Howto", i18n("Storage HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( storagehowto() ) ); - action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); + action = new Q3Action( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( timetrackinghowto() ) ); - action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); + action = new Q3Action( "Sync Howto", i18n("Sync HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( synchowto() ) ); - action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); + action = new Q3Action( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( kdesynchowto() ) ); - action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); + action = new Q3Action( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( multisynchowto() ) ); - action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); + action = new Q3Action( "Auto saving", i18n("Auto saving..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( aboutAutoSaving() ) ); - action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); + action = new Q3Action( "Problemd", i18n("Known Problems..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( aboutKnownBugs() ) ); - action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); + action = new Q3Action( "Translate Howto", i18n("User translation..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( usertrans() ) ); - action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); + action = new Q3Action( "Frequently asked questions", i18n("FAQ..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( faq() ) ); - action = new QAction( "licence", i18n("Licence..."), 0, this ); + action = new Q3Action( "licence", i18n("Licence..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( licence() ) ); - action = new QAction( "about", i18n("About..."), 0, this ); + action = new Q3Action( "about", i18n("About..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( about() ) ); @@ -1356,7 +1366,7 @@ void MainWindow::initActions() if (p-> mShowIconSearch) search_action->addTo( iconToolBar ); if (p-> mShowIconWhatsThis) - QWhatsThis::whatsThisButton ( iconToolBar ); + Q3WhatsThis::whatsThisButton ( iconToolBar ); if (p-> mShowIconNext) whatsnext_action->addTo( viewToolBar ); if (p-> mShowIconNextDays) @@ -1381,7 +1391,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "2leftarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); if (p-> mShowIconBackFast) { - action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); + action = new Q3Action( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goPreviousMonth() ) ); action->addTo( navigatorToolBar ); @@ -1389,7 +1399,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "1leftarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); if (p-> mShowIconBack) { - action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); + action = new Q3Action( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goPrevious() ) ); action->addTo( navigatorToolBar ); @@ -1401,7 +1411,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "1rightarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); if (p-> mShowIconForward) { - action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); + action = new Q3Action( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goNext() ) ); action->addTo( navigatorToolBar ); @@ -1409,7 +1419,7 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "2rightarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); if (p-> mShowIconForwardFast) { - action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); + action = new Q3Action( i18n("Next month"), icon, i18n("Next month"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goNextMonth() ) ); action->addTo( navigatorToolBar ); @@ -1524,7 +1534,7 @@ void MainWindow::exportToPhone( int mode ) int inFuture = 0; if ( ex2phone.mWriteBackFuture->isChecked() ) inFuture = ex2phone.mWriteBackFutureWeeks->value(); - QPtrList<Incidence> delSel; + Q3PtrList<Incidence> delSel; if ( mode == 1 ) delSel = mCalendar->rawIncidences(); if ( mode == 2 ) @@ -1595,10 +1605,10 @@ void MainWindow::displayText( QString text ,QString cap ) { QDialog dia( this, "name", true ); ; dia.setCaption( cap ); - QVBoxLayout* lay = new QVBoxLayout( &dia ); + Q3VBoxLayout* lay = new Q3VBoxLayout( &dia ); lay->setSpacing( 3 ); lay->setMargin( 3 ); - QTextBrowser tb ( &dia ); + Q3TextBrowser tb ( &dia ); lay->addWidget( &tb ); tb.setText( text ); #ifdef DESKTOP_VERSION @@ -1777,9 +1787,9 @@ void MainWindow::updateWeek(QDate seda) mWeekPixmap.fill( mWeekBgColor ); QPainter p ( &mWeekPixmap ); p.setFont( mWeekFont ); - p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); + p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),Qt::AlignCenter, QString::number( weekNum) ); p.end(); - QIconSet icon3 ( mWeekPixmap ); + QIcon icon3 ( mWeekPixmap ); mWeekAction->setIconSet ( icon3 ); } @@ -1812,7 +1822,7 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); if ( incidence->isBirthday() || incidence->isAnniversary() ) { bool ok; - QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); + QDateTime noc = incidence->getNextOccurence( (QDateTime)mView->startDate().addDays(-1), &ok ); if ( ok ) { int years = noc.date().year() - incidence->dtStart().date().year(); startString += i18n(" (%1 y.)"). arg( years ); @@ -1846,13 +1856,13 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) static QPixmap jP = SmallIcon( "journal" ); static QPixmap eP = SmallIcon( "newevent" ); static QPixmap tP = SmallIcon( "newtodo" ); - QIconSet icon; + QIcon icon; if ( incidence->typeID() == todoID ) - icon = QIconSet ( tP ); + icon = QIcon ( tP ); else if ( incidence->typeID() == eventID ) - icon = QIconSet ( eP ); + icon = QIcon ( eP ); else if ( incidence->typeID() == journalID ) - icon = QIconSet ( jP ); + icon = QIcon ( jP ); mPrintSelAction->setIconSet ( icon ); #endif } @@ -2045,7 +2055,7 @@ void MainWindow::backupAllFiles() } else if ( retval == 1 ){ qDebug("KO: Backup created."); // backup ok - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); cal = calendars.next(); while ( cal ) { @@ -2341,7 +2351,7 @@ void MainWindow::fillFilterMenuTB() selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); selectFilterMenuTB->insertSeparator(); - QPtrList<CalFilter> fili = mView->filters(); + Q3PtrList<CalFilter> fili = mView->filters(); CalFilter *curfilter = mView->filterView()->selectedFilter(); CalFilter *filter = fili.first(); int iii = 2; @@ -2386,7 +2396,7 @@ void MainWindow::fillFilterMenu() selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); selectFilterMenu->insertSeparator(); - QPtrList<CalFilter> fili = mView->filters(); + Q3PtrList<CalFilter> fili = mView->filters(); CalFilter *curfilter = mView->filterView()->selectedFilter(); CalFilter *filter = fili.first(); int iii = 2; @@ -2407,7 +2417,7 @@ void MainWindow::fillFilterMenuPopup() filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); filterPopupMenu->insertSeparator(); - QPtrList<CalFilter> fili = mView->filters(); + Q3PtrList<CalFilter> fili = mView->filters(); CalFilter *curfilter = mView->filterView()->selectedFilter(); CalFilter *filter = fili.first(); int iii = 1; @@ -2819,5 +2829,5 @@ void MainWindow::resizeEvent( QResizeEvent* e) } } #endif - QMainWindow::resizeEvent( e); + Q3MainWindow::resizeEvent( e); } diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index a533d8b..6756216 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h @@ -1,13 +1,21 @@ #ifndef KORGE_MAINWINDOW_H #define KORGE_MAINWINDOW_H -#include <qmainwindow.h> +#include <q3mainwindow.h> #include <qtimer.h> -#include <qdict.h> +#include <q3dict.h> #include <qfile.h> #include <qmenubar.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qregexp.h> +//Added by qt3to4: +#include <Q3CString> +#include <QCloseEvent> +#include <QResizeEvent> +#include <QPixmap> +#include <Q3PopupMenu> +#include <QHideEvent> +#include <QKeyEvent> #include <libkcal/incidence.h> #include <ksyncmanager.h> @@ -15,12 +23,12 @@ #ifndef DESKTOP_VERSION #include <qcopchannel_qws.h> #endif -class QAction; +class Q3Action; class CalendarView; class KSyncProfile; #ifdef DESKTOP_VERSION -#define QPEToolBar QToolBar +#define QPEToolBar Q3ToolBar #endif class QPEToolBar; @@ -31,7 +39,7 @@ class CalendarLocal; using namespace KCal; -class MainWindow : public QMainWindow +class MainWindow : public Q3MainWindow { Q_OBJECT public: @@ -49,8 +57,8 @@ class MainWindow : public QMainWindow void updateFilterToolbar(); virtual void showMaximized (); void configureAgenda( int ); - void recieve( const QCString& msg, const QByteArray& data ); - void receiveStart( const QCString& msg, const QByteArray& data ); + void recieve( const Q3CString& msg, const QByteArray& data ); + void receiveStart( const Q3CString& msg, const QByteArray& data ); protected slots: void autoSaveWarning(); void loadDataAfterStart(); @@ -124,7 +132,7 @@ class MainWindow : public QMainWindow private: bool mAutoSaveDisabled; bool checkAutosave(); - QCString mCStringMess; + Q3CString mCStringMess; QByteArray mByteData; //void setMenuBar( QMenuBar * ); @@ -132,7 +140,7 @@ class MainWindow : public QMainWindow #ifndef DESKTOP_VERSION QCopChannel* infrared; #endif - QAction* brAction; + Q3Action* brAction; KSyncManager* mSyncManager; bool mClosed; void saveOnClose(); @@ -144,38 +152,38 @@ class MainWindow : public QMainWindow QPEToolBar *navigatorToolBar; QPEToolBar *filterToolBar; KMenuBar *filterMenubar; - QPopupMenu * filterPopupMenu; - QPopupMenu * mCurrentItemMenu; + Q3PopupMenu * filterPopupMenu; + Q3PopupMenu * mCurrentItemMenu; void initActions(); void setDefaultPreferences(); void resizeEvent( QResizeEvent* e); void keyPressEvent ( QKeyEvent * ) ; void keyReleaseEvent ( QKeyEvent * ) ; - QPopupMenu *configureToolBarMenu; - QPopupMenu *selectFilterMenu; - QPopupMenu *selectFilterMenuTB; - QPopupMenu *configureAgendaMenu, *syncMenu; + Q3PopupMenu *configureToolBarMenu; + Q3PopupMenu *selectFilterMenu; + Q3PopupMenu *selectFilterMenuTB; + Q3PopupMenu *configureAgendaMenu, *syncMenu; CalendarLocal *mCalendar; CalendarView *mView; - QAction *mNewSubTodoAction; - QAction *mWeekAction; + Q3Action *mNewSubTodoAction; + Q3Action *mWeekAction; QFont mWeekFont; QPixmap mWeekPixmap; QColor mWeekBgColor; - QAction *mShowAction; - QAction *mEditAction; - QAction *mDeleteAction; - QAction *mCloneAction; - QAction *mMoveAction; - QAction *mBeamAction; - QAction *mCancelAction; - QAction *mPrintSelAction; - - QAction *mToggleNav; - QAction *mToggleFilter; - QAction *mToggleAllday; - QAction *actionFilterMenuTB; + Q3Action *mShowAction; + Q3Action *mEditAction; + Q3Action *mDeleteAction; + Q3Action *mCloneAction; + Q3Action *mMoveAction; + Q3Action *mBeamAction; + Q3Action *mCancelAction; + Q3Action *mPrintSelAction; + + Q3Action *mToggleNav; + Q3Action *mToggleFilter; + Q3Action *mToggleAllday; + Q3Action *actionFilterMenuTB; void closeEvent( QCloseEvent* ce ); QTimer mSaveTimer; diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index f6a1a6a..59c3e45 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -26,10 +26,13 @@ #include <qtooltip.h> #include <qpushbutton.h> #include <qlayout.h> -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3HBoxLayout> #include <kdebug.h> #include <klocale.h> @@ -53,11 +56,11 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QHBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3HBoxLayout( this ); // Set up the control buttons and date label - mCtrlFrame = new QFrame( this ); - mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised); + mCtrlFrame = new Q3Frame( this ); + mCtrlFrame->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised); mCtrlFrame->setLineWidth(1); topLayout->addWidget( mCtrlFrame ); @@ -129,7 +132,7 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam // set up control frame layout - QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); + Q3BoxLayout *ctrlLayout = new Q3HBoxLayout( mCtrlFrame, 1 ); ctrlLayout->addWidget( mPrevYear, 3 ); ctrlLayout->addWidget( mPrevMonth, 3 ); ctrlLayout->addWidget( mPrevWeek, 3 ); @@ -150,13 +153,13 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); - mPrevYear->setFocusPolicy(NoFocus); - mPrevMonth->setFocusPolicy(NoFocus); - mNextMonth->setFocusPolicy(NoFocus); - mPrevWeek->setFocusPolicy(NoFocus); - mNextWeek->setFocusPolicy(NoFocus); - mNextYear->setFocusPolicy(NoFocus); - mSelectMonth->setFocusPolicy(NoFocus); + mPrevYear->setFocusPolicy(Qt::NoFocus); + mPrevMonth->setFocusPolicy(Qt::NoFocus); + mNextMonth->setFocusPolicy(Qt::NoFocus); + mPrevWeek->setFocusPolicy(Qt::NoFocus); + mNextWeek->setFocusPolicy(Qt::NoFocus); + mNextYear->setFocusPolicy(Qt::NoFocus); + mSelectMonth->setFocusPolicy(Qt::NoFocus); setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); } diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h index 9ccef14..a1880f5 100644 --- a/korganizer/navigatorbar.h +++ b/korganizer/navigatorbar.h @@ -27,9 +27,12 @@ #include <libkcal/incidencebase.h> #include <qwidget.h> +//Added by qt3to4: +#include <Q3Frame> +#include <QLabel> class QPushButton; -class QFrame; +class Q3Frame; class QLabel; class NavigatorBar: public QWidget @@ -60,7 +63,7 @@ class NavigatorBar: public QWidget int mCurrentHei; int mCurrentMinWid; int mCurrentButtonMinWid; - QFrame *mCtrlFrame; + Q3Frame *mCtrlFrame; QPushButton *mPrevYear; QPushButton *mPrevMonth; diff --git a/korganizer/outgoingdialog.cpp b/korganizer/outgoingdialog.cpp index 7253c8e..ab31274 100644 --- a/korganizer/outgoingdialog.cpp +++ b/korganizer/outgoingdialog.cpp @@ -21,7 +21,7 @@ #include <qfile.h> #include <qdir.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <kglobal.h> #include <klocale.h> @@ -44,10 +44,10 @@ #include "koeventviewerdialog.h" #include "docprefs.h" -ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, +ScheduleItemOut::ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev, Scheduler::Method method, const QString &recipients) - : QListViewItem(parent) + : Q3ListViewItem(parent) { mIncidence = ev; mMethod = method; @@ -123,7 +123,7 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, const char* name,bool modal, - WFlags fl) + Qt::WFlags fl) : OutgoingDialog_base(parent,name,modal,fl) { mCalendar = calendar; @@ -139,12 +139,12 @@ OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, mScheduler = new DummyScheduler(mCalendar); #endif } - mMessageListView->setColumnAlignment(1,AlignHCenter); - mMessageListView->setColumnAlignment(2,AlignHCenter); - mMessageListView->setColumnAlignment(3,AlignHCenter); - mMessageListView->setColumnAlignment(4,AlignHCenter); - QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)), - this,SLOT(showEvent(QListViewItem *))); + mMessageListView->setColumnAlignment(1,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(2,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(3,Qt::AlignHCenter); + mMessageListView->setColumnAlignment(4,Qt::AlignHCenter); + QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)), + this,SLOT(showEvent(Q3ListViewItem *))); mDocPrefs = new DocPrefs("groupschedule"); loadMessages(); } @@ -236,7 +236,7 @@ void OutgoingDialog::deleteItem() emit numMessagesChanged(mMessageListView->childCount()); } -void OutgoingDialog::showEvent(QListViewItem *qitem) +void OutgoingDialog::showEvent(Q3ListViewItem *qitem) { ScheduleItemOut *item = (ScheduleItemOut *)qitem; Event *event = 0; @@ -294,7 +294,7 @@ bool OutgoingDialog::saveMessage(IncidenceBase *incidence,Scheduler::Method meth { KTempFile ktfile(locateLocal("data","korganizer/outgoing/"),"ics"); QString messageText = mFormat->createScheduleMessage(incidence,method); - QTextStream *qts = ktfile.textStream(); + Q3TextStream *qts = ktfile.textStream(); *qts << messageText; *qts << "METHOD-BEGIN:" << endl << method << endl << ":METHOD-END" << endl; *qts << "RECIPIENTS-BEGIN:" << endl << recipients << endl << ":RECIPIENTS-END" << endl; @@ -330,11 +330,11 @@ void OutgoingDialog::loadMessages() if (iter.data() == outgoingDirName + "/" + (*it)) inserted = true; } if (!inserted) { - if (!f.open(IO_ReadOnly)) { + if (!f.open(QIODevice::ReadOnly)) { kdDebug() << "OutgoingDialog::loadMessage(): Can't open file'" << (*it) << "'" << endl; } else { - QTextStream t(&f); + Q3TextStream t(&f); QString messageString = t.read(); ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar, messageString); diff --git a/korganizer/outgoingdialog.h b/korganizer/outgoingdialog.h index a3d561a..e727087 100644 --- a/korganizer/outgoingdialog.h +++ b/korganizer/outgoingdialog.h @@ -23,7 +23,7 @@ #ifndef OUTGOINGDIALOG_H #define OUTGOINGDIALOG_H -#include <qlistview.h> +#include <q3listview.h> #include <qmap.h> #include <qstring.h> @@ -34,10 +34,10 @@ using namespace KCal; -class ScheduleItemOut : public QListViewItem +class ScheduleItemOut : public Q3ListViewItem { public: - ScheduleItemOut(QListView *parent,IncidenceBase *ev, + ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev, Scheduler::Method method, const QString &recipients=QString::null); virtual ~ScheduleItemOut() {} @@ -56,7 +56,7 @@ class OutgoingDialog : public OutgoingDialog_base Q_OBJECT public: OutgoingDialog(Calendar *,QWidget* parent=0,const char* name=0, - bool modal=false,WFlags fl=0); + bool modal=false,Qt::WFlags fl=0); ~OutgoingDialog(); bool addMessage(IncidenceBase *,Scheduler::Method); @@ -72,7 +72,7 @@ class OutgoingDialog : public OutgoingDialog_base protected slots: void send(); void deleteItem(); - void showEvent(QListViewItem *); + void showEvent(Q3ListViewItem *); private: bool saveMessage(IncidenceBase *,Scheduler::Method,const QString &recipients=0); diff --git a/korganizer/outgoingdialog_base.cpp b/korganizer/outgoingdialog_base.cpp index 1873b44..be8a870 100644 --- a/korganizer/outgoingdialog_base.cpp +++ b/korganizer/outgoingdialog_base.cpp @@ -11,12 +11,14 @@ #include "outgoingdialog_base.h" #include <qvariant.h> -#include <qheader.h> -#include <qlistview.h> +#include <q3header.h> +#include <q3listview.h> #include <qpushbutton.h> #include <qlayout.h> #include <qtooltip.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3GridLayout> /* * Constructs a OutgoingDialog_base as a child of 'parent', with the @@ -25,23 +27,23 @@ * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -OutgoingDialog_base::OutgoingDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) +OutgoingDialog_base::OutgoingDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "OutgoingDialog_base" ); - OutgoingDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "OutgoingDialog_baseLayout"); + OutgoingDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "OutgoingDialog_baseLayout"); - mMessageListView = new QListView( this, "mMessageListView" ); + mMessageListView = new Q3ListView( this, "mMessageListView" ); mMessageListView->addColumn( tr2i18n( "Summary" ) ); mMessageListView->addColumn( tr2i18n( "Start Date" ) ); mMessageListView->addColumn( tr2i18n( "Start Time" ) ); mMessageListView->addColumn( tr2i18n( "End Date" ) ); mMessageListView->addColumn( tr2i18n( "End Time" ) ); mMessageListView->addColumn( tr2i18n( "Method" ) ); - mMessageListView->setFrameShape( QListView::StyledPanel ); - mMessageListView->setFrameShadow( QListView::Sunken ); + mMessageListView->setFrameShape( Q3ListView::StyledPanel ); + mMessageListView->setFrameShadow( Q3ListView::Sunken ); mMessageListView->setAllColumnsShowFocus( TRUE ); OutgoingDialog_baseLayout->addMultiCellWidget( mMessageListView, 0, 3, 0, 0 ); diff --git a/korganizer/outgoingdialog_base.h b/korganizer/outgoingdialog_base.h index af71bb1..5e81725 100644 --- a/korganizer/outgoingdialog_base.h +++ b/korganizer/outgoingdialog_base.h @@ -12,12 +12,16 @@ #include <qvariant.h> #include <qdialog.h> - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QListView; -class QListViewItem; +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> + +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; +class Q3ListView; +class Q3ListViewItem; class QPushButton; class OutgoingDialog_base : public QDialog @@ -25,16 +29,16 @@ class OutgoingDialog_base : public QDialog Q_OBJECT public: - OutgoingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + OutgoingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~OutgoingDialog_base(); - QListView* mMessageListView; + Q3ListView* mMessageListView; QPushButton* PushButton5; QPushButton* PushButton7; QPushButton* PushButton6; protected: - QGridLayout* OutgoingDialog_baseLayout; + Q3GridLayout* OutgoingDialog_baseLayout; protected slots: virtual void languageChange(); diff --git a/korganizer/publishdialog.cpp b/korganizer/publishdialog.cpp index 2ae6720..ede9840 100644 --- a/korganizer/publishdialog.cpp +++ b/korganizer/publishdialog.cpp @@ -35,13 +35,13 @@ #include "publishdialog.h" PublishDialog::PublishDialog(QWidget* parent, const char* name, - bool modal, WFlags fl) + bool modal, Qt::WFlags fl) : PublishDialog_base(parent,name,modal,fl) { setCaption(i18n("Select Addresses")); mNameLineEdit->setEnabled(false); mEmailLineEdit->setEnabled(false); - connect(mAddressListView,SIGNAL(selectionChanged(QListViewItem *)), + connect(mAddressListView,SIGNAL(selectionChanged(Q3ListViewItem *)), SLOT(updateInput())); } @@ -53,7 +53,7 @@ void PublishDialog::addAttendee(Attendee *attendee) { mNameLineEdit->setEnabled(true); mEmailLineEdit->setEnabled(true); - QListViewItem *item = new QListViewItem(mAddressListView); + Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); item->setText(0,attendee->name()); item->setText(1,attendee->email()); mAddressListView->insertItem(item); @@ -62,7 +62,7 @@ void PublishDialog::addAttendee(Attendee *attendee) QString PublishDialog::addresses() { QString to = ""; - QListViewItem *item; + Q3ListViewItem *item; int i, count; count = mAddressListView->childCount(); for (i=0;i<count;i++) { @@ -80,7 +80,7 @@ void PublishDialog::addItem() { mNameLineEdit->setEnabled(true); mEmailLineEdit->setEnabled(true); - QListViewItem *item = new QListViewItem(mAddressListView); + Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); mAddressListView->insertItem(item); mAddressListView->setSelected(item,true); mNameLineEdit->setText(i18n("(EmptyName)")); @@ -89,7 +89,7 @@ void PublishDialog::addItem() void PublishDialog::removeItem() { - QListViewItem *item; + Q3ListViewItem *item; item = mAddressListView->selectedItem(); if (!item) return; mAddressListView->takeItem(item); @@ -119,7 +119,7 @@ void PublishDialog::openAddressbook() a = addressList[i]; mNameLineEdit->setEnabled(true); mEmailLineEdit->setEnabled(true); - QListViewItem *item = new QListViewItem(mAddressListView); + Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); mAddressListView->setSelected(item,true); mNameLineEdit->setText(a.realName()); mEmailLineEdit->setText(a.preferredEmail()); @@ -131,7 +131,7 @@ void PublishDialog::openAddressbook() void PublishDialog::updateItem() { - QListViewItem *item; + Q3ListViewItem *item; item = mAddressListView->selectedItem(); if (!item) return; item->setText(0,mNameLineEdit->text()); @@ -140,7 +140,7 @@ void PublishDialog::updateItem() void PublishDialog::updateInput() { - QListViewItem *item; + Q3ListViewItem *item; item = mAddressListView->selectedItem(); if (!item) return; mNameLineEdit->setEnabled(true); diff --git a/korganizer/publishdialog.h b/korganizer/publishdialog.h index 338603c..3ffeec4 100644 --- a/korganizer/publishdialog.h +++ b/korganizer/publishdialog.h @@ -23,7 +23,7 @@ #ifndef PUBLISHDIALOG_H #define PUBLISHDIALOG_H -#include <qlistview.h> +#include <q3listview.h> #include <libkcal/attendee.h> #include "publishdialog_base.h" @@ -35,7 +35,7 @@ class PublishDialog : public PublishDialog_base Q_OBJECT public: PublishDialog(QWidget* parent=0,const char* name=0, - bool modal=true,WFlags fl=0); + bool modal=true,Qt::WFlags fl=0); ~PublishDialog(); void addAttendee(Attendee *attendee); diff --git a/korganizer/publishdialog_base.cpp b/korganizer/publishdialog_base.cpp index 683f7e9..ce5c542 100644 --- a/korganizer/publishdialog_base.cpp +++ b/korganizer/publishdialog_base.cpp @@ -11,15 +11,18 @@ #include "publishdialog_base.h" #include <qvariant.h> -#include <qframe.h> -#include <qheader.h> +#include <q3frame.h> +#include <q3header.h> #include <qlabel.h> #include <qlineedit.h> -#include <qlistview.h> +#include <q3listview.h> #include <qpushbutton.h> #include <qlayout.h> #include <qtooltip.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3HBoxLayout> /* * Constructs a PublishDialog_base as a child of 'parent', with the @@ -28,15 +31,15 @@ * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) +PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "PublishDialog_base" ); - PublishDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "PublishDialog_baseLayout"); + PublishDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "PublishDialog_baseLayout"); - mAddressListView = new QListView( this, "mAddressListView" ); + mAddressListView = new Q3ListView( this, "mAddressListView" ); mAddressListView->addColumn( tr2i18n( "Name" ) ); mAddressListView->addColumn( tr2i18n( "Email" ) ); @@ -72,14 +75,14 @@ PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool QSpacerItem* spacer = new QSpacerItem( 20, 241, QSizePolicy::Minimum, QSizePolicy::Expanding ); PublishDialog_baseLayout->addMultiCell( spacer, 3, 5, 2, 2 ); - Line2 = new QFrame( this, "Line2" ); - Line2->setFrameShape( QFrame::HLine ); - Line2->setFrameShadow( QFrame::Sunken ); - Line2->setFrameShape( QFrame::HLine ); + Line2 = new Q3Frame( this, "Line2" ); + Line2->setFrameShape( Q3Frame::HLine ); + Line2->setFrameShadow( Q3Frame::Sunken ); + Line2->setFrameShape( Q3Frame::HLine ); PublishDialog_baseLayout->addMultiCellWidget( Line2, 6, 6, 0, 2 ); - layout95 = new QHBoxLayout( 0, 0, 6, "layout95"); + layout95 = new Q3HBoxLayout( 0, 0, 6, "layout95"); QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); layout95->addItem( spacer_2 ); diff --git a/korganizer/publishdialog_base.h b/korganizer/publishdialog_base.h index 932474e..d1b40ae 100644 --- a/korganizer/publishdialog_base.h +++ b/korganizer/publishdialog_base.h @@ -12,15 +12,21 @@ #include <qvariant.h> #include <qdialog.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3Frame> +#include <Q3GridLayout> +#include <Q3HBoxLayout> +#include <QLabel> -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QFrame; +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; +class Q3Frame; class QLabel; class QLineEdit; -class QListView; -class QListViewItem; +class Q3ListView; +class Q3ListViewItem; class QPushButton; class PublishDialog_base : public QDialog @@ -28,10 +34,10 @@ class PublishDialog_base : public QDialog Q_OBJECT public: - PublishDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + PublishDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~PublishDialog_base(); - QListView* mAddressListView; + Q3ListView* mAddressListView; QLabel* TextLabel1; QLabel* TextLabel2; QLineEdit* mEmailLineEdit; @@ -39,13 +45,13 @@ public: QPushButton* PushButton10; QPushButton* PushButton12; QPushButton* PushButton11; - QFrame* Line2; + Q3Frame* Line2; QPushButton* PushButton9; QPushButton* PushButton8; protected: - QGridLayout* PublishDialog_baseLayout; - QHBoxLayout* layout95; + Q3GridLayout* PublishDialog_baseLayout; + Q3HBoxLayout* layout95; protected slots: virtual void languageChange(); diff --git a/korganizer/savetemplatedialog.cpp b/korganizer/savetemplatedialog.cpp index 3544081..35bedba 100644 --- a/korganizer/savetemplatedialog.cpp +++ b/korganizer/savetemplatedialog.cpp @@ -22,6 +22,9 @@ */ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3Frame> #include <keditlistbox.h> #include <klocale.h> @@ -35,8 +38,8 @@ SaveTemplateDialog::SaveTemplateDialog( IncidenceType type, QWidget *parent ) true, false ), mType( type ) { - QFrame *topFrame = plainPage(); - QVBoxLayout *topLayout = new QVBoxLayout( topFrame, 0, spacingHint() ); + Q3Frame *topFrame = plainPage(); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( topFrame, 0, spacingHint() ); mEditListBox = new KEditListBox( i18n("Select Template Name"), topFrame, 0, false, KEditListBox::Add | diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 9cfdc35..105b844 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp @@ -24,14 +24,21 @@ #include <qlayout.h> #include <qcheckbox.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qapplication.h> +#include <QDesktopWidget> #include <qlabel.h> -#include <qlistview.h> -#include <qwhatsthis.h> +#include <q3listview.h> +#include <q3whatsthis.h> #include <qlineedit.h> #include <qpushbutton.h> -#include <qhbuttongroup.h> +//#include <qhbuttongroup.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3Frame> +#include <Q3PtrList> +#include <QKeyEvent> +#include <Q3VBoxLayout> #include <klocale.h> #include <kmessagebox.h> @@ -46,15 +53,15 @@ #include "searchdialog.h" SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) - : QVBox( 0 ) + : Q3VBox( 0 ) { mCalendar = calendar; - QFrame *topFrame = new QFrame( this ) ;//plainPage(); - QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); + Q3Frame *topFrame = new Q3Frame( this ) ;//plainPage(); + Q3VBoxLayout *layout = new Q3VBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); // Search expression - QHBoxLayout *subLayout = new QHBoxLayout(); + Q3HBoxLayout *subLayout = new Q3HBoxLayout(); layout->addLayout(subLayout); /* searchLabel = new QLabel(topFrame); @@ -98,7 +105,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), // topFrame); - incidenceGroup = new QHBox( topFrame ); + incidenceGroup = new Q3HBox( topFrame ); layout->addWidget(incidenceGroup); mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); @@ -106,7 +113,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); - subjectGroup = new QHBox( topFrame ); + subjectGroup = new Q3HBox( topFrame ); layout->addWidget(subjectGroup); mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); @@ -114,7 +121,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); - attendeeGroup = new QHBox( topFrame ); + attendeeGroup = new Q3HBox( topFrame ); layout->addWidget(attendeeGroup ); new QLabel( i18n("Attendee:"),attendeeGroup ); mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); @@ -127,7 +134,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) QWidget *rangeWidget = new QWidget(topFrame); int space = KDialog::spacingHint(); if ( QApplication::desktop()->width() <= 240 ) space = 1; - QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,space); + Q3HBoxLayout *rangeLayout = new Q3HBoxLayout(rangeWidget,0,space); rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); mStartDate = new KDateEdit(rangeWidget); rangeLayout->addWidget(mStartDate); @@ -135,7 +142,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) mEndDate = new KDateEdit(rangeWidget); mEndDate->setDate(QDate::currentDate().addDays(365)); rangeLayout->addWidget(mEndDate); - QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); + QToolButton *wt = Q3WhatsThis::whatsThisButton ( rangeWidget ); rangeLayout->addWidget( (QWidget*)wt ); layout->addWidget(rangeWidget); // Results list view @@ -341,7 +348,7 @@ void SearchDialog::updateView() void SearchDialog::search(const QRegExp &re) { - QPtrList<Event> events; + Q3PtrList<Event> events; if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { if ( mRefineItems->isChecked() ) events = mMatchedEvents; mMatchedEvents.clear(); @@ -419,7 +426,7 @@ void SearchDialog::search(const QRegExp &re) } } if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { - QPtrList<Attendee> tmpAList = ev->attendees(); + Q3PtrList<Attendee> tmpAList = ev->attendees(); Attendee *a; for (a = tmpAList.first(); a; a = tmpAList.next()) { if (mSearchAName->isChecked()) { @@ -458,7 +465,7 @@ void SearchDialog::search(const QRegExp &re) } } } - QPtrList<Todo> todos; + Q3PtrList<Todo> todos; if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { if ( mRefineItems->isChecked() ) todos = mMatchedTodos ; @@ -512,7 +519,7 @@ void SearchDialog::search(const QRegExp &re) } } if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { - QPtrList<Attendee> tmpAList = tod->attendees(); + Q3PtrList<Attendee> tmpAList = tod->attendees(); Attendee *a; for (a = tmpAList.first(); a; a = tmpAList.next()) { if (mSearchAName->isChecked()) { @@ -548,7 +555,7 @@ void SearchDialog::search(const QRegExp &re) } } - QPtrList<Journal> journals; + Q3PtrList<Journal> journals; if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; mMatchedJournals.clear(); diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h index 945ff65..5df6116 100644 --- a/korganizer/searchdialog.h +++ b/korganizer/searchdialog.h @@ -26,8 +26,12 @@ #include <qregexp.h> #include <qradiobutton.h> +//Added by qt3to4: +#include <QLabel> +#include <QKeyEvent> +#include <Q3PtrList> #include <kdialogbase.h> -#include <qvbox.h> +#include <q3vbox.h> #include <libkcal/calendar.h> @@ -41,7 +45,7 @@ class QLabel; class CalendarView; using namespace KCal; -class SearchDialog : public QVBox +class SearchDialog : public Q3VBox { Q_OBJECT public: @@ -72,14 +76,14 @@ class SearchDialog : public QVBox private: - QHBox *incidenceGroup ,*subjectGroup ,*attendeeGroup; + Q3HBox *incidenceGroup ,*subjectGroup ,*attendeeGroup; void search(const QRegExp &); Calendar *mCalendar; - QPtrList<Event> mMatchedEvents; - QPtrList<Todo> mMatchedTodos; - QPtrList<Journal> mMatchedJournals; + Q3PtrList<Event> mMatchedEvents; + Q3PtrList<Todo> mMatchedTodos; + Q3PtrList<Journal> mMatchedJournals; QLabel *searchLabel; KLineEdit *searchEdit; diff --git a/korganizer/statusdialog.cpp b/korganizer/statusdialog.cpp index 7137c49..8186ebb 100644 --- a/korganizer/statusdialog.cpp +++ b/korganizer/statusdialog.cpp @@ -21,6 +21,9 @@ #include <qpushbutton.h> #include <qstringlist.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3HBoxLayout> #include <kdebug.h> #include <klocale.h> @@ -32,11 +35,11 @@ StatusDialog::StatusDialog(QWidget* parent, const char* name) : { setCaption(i18n("Set Your Status")); - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); topLayout->setSpacing( spacingHint() ); topLayout->setMargin( marginHint() ); - QBoxLayout *statusLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *statusLayout = new Q3HBoxLayout( topLayout ); QLabel *text = new QLabel(i18n("Set your status"),this); statusLayout->addWidget( text ); @@ -45,7 +48,7 @@ StatusDialog::StatusDialog(QWidget* parent, const char* name) : mStatus->insertStringList(Attendee::statusList()); statusLayout->addWidget( mStatus ); - QBoxLayout *buttonLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *buttonLayout = new Q3HBoxLayout( topLayout ); QPushButton *ok = new QPushButton(i18n("&OK"), this); connect ( ok,SIGNAL(clicked()), this,SLOT(accept()) ); diff --git a/korganizer/timeline.cpp b/korganizer/timeline.cpp index 11be432..a6c3cdc 100644 --- a/korganizer/timeline.cpp +++ b/korganizer/timeline.cpp @@ -5,13 +5,13 @@ #include "timeline.h" TimeLine::TimeLine( QWidget *parent, const char *name ) : - QScrollView( parent, name ) + Q3ScrollView( parent, name ) { mPixelWidth = 1000; resizeContents( mPixelWidth, 20 ); - viewport()->setBackgroundMode( PaletteBackground ); + viewport()->setBackgroundMode( Qt::PaletteBackground ); setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); @@ -58,5 +58,5 @@ void TimeLine::setDateRange( const QDateTime &start, const QDateTime &end ) void TimeLine::setContentsPos( int pos ) { - QScrollView::setContentsPos ( pos, 0 ); + Q3ScrollView::setContentsPos ( pos, 0 ); } diff --git a/korganizer/timeline.h b/korganizer/timeline.h index ab3e5d3..bf301fa 100644 --- a/korganizer/timeline.h +++ b/korganizer/timeline.h @@ -1,10 +1,10 @@ #ifndef TIMELINE_H #define TIMELINE_H -#include <qscrollview.h> +#include <q3scrollview.h> #include <qdatetime.h> -class TimeLine : public QScrollView +class TimeLine : public Q3ScrollView { Q_OBJECT public: diff --git a/korganizer/timespanview.cpp b/korganizer/timespanview.cpp index df8ff88..0908056 100644 --- a/korganizer/timespanview.cpp +++ b/korganizer/timespanview.cpp @@ -4,10 +4,14 @@ #else #include <qsplitter.h> #endif -#include <qlistview.h> +#include <q3listview.h> #include <qlayout.h> -#include <qheader.h> +#include <q3header.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> +#include <Q3ValueList> #include <klocale.h> #include <kdebug.h> @@ -21,7 +25,7 @@ TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); #ifndef DESKTOP_VERSION mSplitter = new QKSplitter( this ); #else @@ -29,11 +33,11 @@ TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) : #endif topLayout->addWidget( mSplitter ); - mList = new QListView( mSplitter ); + mList = new Q3ListView( mSplitter ); mList->addColumn( i18n("Summary") ); QWidget *rightPane = new QWidget( mSplitter ); - QBoxLayout *rightPaneLayout = new QVBoxLayout( rightPane ); + Q3BoxLayout *rightPaneLayout = new Q3VBoxLayout( rightPane ); mTimeLine = new TimeLine( rightPane ); mTimeLine->setFixedHeight( mList->header()->height() ); @@ -42,7 +46,7 @@ TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) : mLineView = new LineView( rightPane ); rightPaneLayout->addWidget( mLineView ); - QBoxLayout *buttonLayout = new QHBoxLayout( rightPaneLayout ); + Q3BoxLayout *buttonLayout = new Q3HBoxLayout( rightPaneLayout ); QPushButton *zoomInButton = new QPushButton( i18n("Zoom In"), rightPane ); connect( zoomInButton, SIGNAL( clicked() ), SLOT( zoomIn() ) ); @@ -64,19 +68,19 @@ TimeSpanView::~TimeSpanView() { } -QValueList<int> TimeSpanView::splitterSizes() +Q3ValueList<int> TimeSpanView::splitterSizes() { return mSplitter->sizes(); } -void TimeSpanView::setSplitterSizes( QValueList<int> sizes ) +void TimeSpanView::setSplitterSizes( Q3ValueList<int> sizes ) { mSplitter->setSizes( sizes ); } void TimeSpanView::addItem( KCal::Event *event ) { - new QListViewItem( mList, event->summary() ); + new Q3ListViewItem( mList, event->summary() ); QDateTime startDt = event->dtStart(); QDateTime endDt = event->dtEnd(); diff --git a/korganizer/timespanview.h b/korganizer/timespanview.h index 34cb1f7..f652374 100644 --- a/korganizer/timespanview.h +++ b/korganizer/timespanview.h @@ -2,6 +2,8 @@ #define TIMESPANVIEW_H #include <qwidget.h> +//Added by qt3to4: +#include <Q3ValueList> #include <libkcal/event.h> @@ -12,7 +14,7 @@ class QKSplitter; class QSplitter; #define QKSplitter QSplitter #endif -class QListView; +class Q3ListView; class LineView; class TimeLine; @@ -26,8 +28,8 @@ class TimeSpanView : public QWidget void addItem( KCal::Event * ); - QValueList<int> splitterSizes(); - void setSplitterSizes( QValueList<int> ); + Q3ValueList<int> splitterSizes(); + void setSplitterSizes( Q3ValueList<int> ); void clear(); @@ -48,7 +50,7 @@ class TimeSpanView : public QWidget private: QKSplitter *mSplitter; - QListView *mList; + Q3ListView *mList; TimeLine *mTimeLine; LineView *mLineView; diff --git a/libetpan/libetpan.pro b/libetpan/libetpan.pro index 10f51da..909d064 100644 --- a/libetpan/libetpan.pro +++ b/libetpan/libetpan.pro @@ -1,9 +1,10 @@ +include( ../variables.pri ) ###################################################################### # Automatically generated by qmake (1.07a) Fri Mar 18 19:27:39 2005 ###################################################################### TEMPLATE = lib -TARGET = microlibetpan +TARGET = xmicrolibetpan OBJECTS_DIR = obj MOC_DIR = moc DESTDIR=../bin @@ -448,3 +449,5 @@ SOURCES += src/data-types/base64.c \ src/driver/implementation/pop3/pop3driver_message.c \ src/driver/implementation/pop3/pop3driver_tools.c \ src/driver/implementation/pop3/pop3storage.c +#The following line was inserted by qt3to4 +QT += xml qt3support diff --git a/libetpan/libetpanE.pro b/libetpan/libetpanE.pro index 4b82196..9ba1a6d 100644 --- a/libetpan/libetpanE.pro +++ b/libetpan/libetpanE.pro @@ -3,7 +3,7 @@ ###################################################################### TEMPLATE = lib -TARGET = microlibetpan +TARGET = xmicrolibetpan OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR=$(QPEDIR)/lib 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 @@ -69,3 +69,5 @@ SOURCES += caldate.c \ # vsnprintf.c +#The following line was inserted by qt3to4 +QT += 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 @@ -42,3 +42,5 @@ SOURCES += icalcalendar.c \ icalspanlist.c \ icalsslexer.c \ icalssyacc.c +#The following line was inserted by qt3to4 +QT += xml qt3support diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp index 3157214..3c4a81c 100644 --- a/libkcal/alarm.cpp +++ b/libkcal/alarm.cpp @@ -26,6 +26,8 @@ #include "todo.h" #include "alarm.h" +//Added by qt3to4: +#include <Q3ValueList> using namespace KCal; #include <qwidget.h> @@ -212,7 +214,7 @@ QString Alarm::programArguments() const } void Alarm::setEmailAlarm(const QString &subject, const QString &text, - const QValueList<Person> &addressees, const QStringList &attachments) + const Q3ValueList<Person> &addressees, const QStringList &attachments) { mType = Email; mMailSubject = subject; @@ -231,7 +233,7 @@ void Alarm::setMailAddress(const Person &mailAddress) } } -void Alarm::setMailAddresses(const QValueList<Person> &mailAddresses) +void Alarm::setMailAddresses(const Q3ValueList<Person> &mailAddresses) { if (mType == Email) { mMailAddresses = mailAddresses; @@ -247,9 +249,9 @@ void Alarm::addMailAddress(const Person &mailAddress) } } -QValueList<Person> Alarm::mailAddresses() const +Q3ValueList<Person> Alarm::mailAddresses() const { - return (mType == Email) ? mMailAddresses : QValueList<Person>(); + return (mType == Email) ? mMailAddresses : Q3ValueList<Person>(); } void Alarm::setMailSubject(const QString &mailAlarmSubject) diff --git a/libkcal/alarm.h b/libkcal/alarm.h index ac6ea0d..b24f0f7 100644 --- a/libkcal/alarm.h +++ b/libkcal/alarm.h @@ -22,7 +22,7 @@ #define KCAL_ALARM_H #include <qstring.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include "customproperties.h" #include "duration.h" @@ -39,7 +39,7 @@ class Alarm : public CustomProperties { public: enum Type { Invalid, Display, Procedure, Email, Audio }; - typedef QValueList<Alarm *> List; + typedef Q3ValueList<Alarm *> List; /** Construct a new alarm with variables initialized to "sane" values. */ explicit Alarm(Incidence *parent); @@ -112,7 +112,7 @@ class Alarm : public CustomProperties @param addressees email addresses of recipient(s). @param attachments optional names of files to attach to the email. */ - void setEmailAlarm(const QString &subject, const QString &text, const QValueList<Person> &addressees, + void setEmailAlarm(const QString &subject, const QString &text, const Q3ValueList<Person> &addressees, const QStringList &attachments = QStringList()); /** Send mail to this address when the alarm is triggered. @@ -122,13 +122,13 @@ class Alarm : public CustomProperties /** Send mail to these addresses when the alarm is triggered. Ignored if the alarm is not an email alarm. */ - void setMailAddresses(const QValueList<Person> &mailAlarmAddresses); + void setMailAddresses(const Q3ValueList<Person> &mailAlarmAddresses); /** Add this address to the list of addresses to send mail to when the alarm is triggered. Ignored if the alarm is not an email alarm. */ void addMailAddress(const Person &mailAlarmAddress); /** return the addresses to send mail to when an alarm goes off */ - QValueList<Person> mailAddresses() const; + Q3ValueList<Person> mailAddresses() const; /** Set the subject line of the mail. Ignored if the alarm is not an email alarm. @@ -226,7 +226,7 @@ class Alarm : public CustomProperties QString mDescription; // text to display/email body/procedure arguments QString mFile; // procedure program to run/optional audio file to play QStringList mMailAttachFiles; // filenames to attach to email - QValueList<Person> mMailAddresses; // who to mail for reminder + Q3ValueList<Person> mMailAddresses; // who to mail for reminder QString mMailSubject; // subject of email int mAlarmSnoozeTime; // number of minutes after alarm to diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 9b38d3f..bf095cf 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp @@ -30,6 +30,8 @@ #include "calendar.h" #include "syncdefines.h" +//Added by qt3to4: +#include <Q3PtrList> using namespace KCal; @@ -271,19 +273,19 @@ CalFilter *Calendar::filter() return mFilter; } -QPtrList<Incidence> Calendar::incidences() +Q3PtrList<Incidence> Calendar::incidences() { - QPtrList<Incidence> incidences; + Q3PtrList<Incidence> incidences; Incidence *i; - QPtrList<Event> e = events(); + Q3PtrList<Event> e = events(); for( i = e.first(); i; i = e.next() ) incidences.append( i ); - QPtrList<Todo> t = todos(); + Q3PtrList<Todo> t = todos(); for( i = t.first(); i; i = t.next() ) incidences.append( i ); - QPtrList<Journal> j = journals(); + Q3PtrList<Journal> j = journals(); for( i = j.first(); i; i = j.next() ) incidences.append( i ); return incidences; @@ -291,77 +293,77 @@ QPtrList<Incidence> Calendar::incidences() void Calendar::resetPilotStat(int id ) { - QPtrList<Incidence> incidences; + Q3PtrList<Incidence> incidences; Incidence *i; - QPtrList<Event> e = rawEvents(); + Q3PtrList<Event> e = rawEvents(); for( i = e.first(); i; i = e.next() ) i->setPilotId( id ); - QPtrList<Todo> t = rawTodos(); + Q3PtrList<Todo> t = rawTodos(); for( i = t.first(); i; i = t.next() ) i->setPilotId( id ); - QPtrList<Journal> j = journals(); + Q3PtrList<Journal> j = journals(); for( i = j.first(); i; i = j.next() ) i->setPilotId( id ); } void Calendar::resetTempSyncStat() { - QPtrList<Incidence> incidences; + Q3PtrList<Incidence> incidences; Incidence *i; - QPtrList<Event> e = rawEvents(); + Q3PtrList<Event> e = rawEvents(); for( i = e.first(); i; i = e.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); - QPtrList<Todo> t = rawTodos(); + Q3PtrList<Todo> t = rawTodos(); for( i = t.first(); i; i = t.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); - QPtrList<Journal> j = journals(); + Q3PtrList<Journal> j = journals(); for( i = j.first(); i; i = j.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); } -QPtrList<Incidence> Calendar::rawIncidences() +Q3PtrList<Incidence> Calendar::rawIncidences() { - QPtrList<Incidence> incidences; + Q3PtrList<Incidence> incidences; Incidence *i; - QPtrList<Event> e = rawEvents(); + Q3PtrList<Event> e = rawEvents(); for( i = e.first(); i; i = e.next() ) incidences.append( i ); - QPtrList<Todo> t = rawTodos(); + Q3PtrList<Todo> t = rawTodos(); for( i = t.first(); i; i = t.next() ) incidences.append( i ); - QPtrList<Journal> j = journals(); + Q3PtrList<Journal> j = journals(); for( i = j.first(); i; i = j.next() ) incidences.append( i ); return incidences; } -QPtrList<Event> Calendar::events( const QDate &date, bool sorted ) +Q3PtrList<Event> Calendar::events( const QDate &date, bool sorted ) { - QPtrList<Event> el = rawEventsForDate(date,sorted); + Q3PtrList<Event> el = rawEventsForDate(date,sorted); mFilter->apply(&el); return el; } -QPtrList<Event> Calendar::events( const QDateTime &qdt ) +Q3PtrList<Event> Calendar::events( const QDateTime &qdt ) { - QPtrList<Event> el = rawEventsForDate(qdt); + Q3PtrList<Event> el = rawEventsForDate(qdt); mFilter->apply(&el); return el; } -QPtrList<Event> Calendar::events( const QDate &start, const QDate &end, +Q3PtrList<Event> Calendar::events( const QDate &start, const QDate &end, bool inclusive) { - QPtrList<Event> el = rawEvents(start,end,inclusive); + Q3PtrList<Event> el = rawEvents(start,end,inclusive); mFilter->apply(&el); return el; } -QPtrList<Event> Calendar::events() +Q3PtrList<Event> Calendar::events() { - QPtrList<Event> el = rawEvents(); + Q3PtrList<Event> el = rawEvents(); mFilter->apply(&el); return el; } @@ -369,7 +371,7 @@ void Calendar::addIncidenceBranch(Incidence *i) { addIncidence( i ); Incidence * inc; - QPtrList<Incidence> Relations = i->relations(); + Q3PtrList<Incidence> Relations = i->relations(); for (inc=Relations.first();inc;inc=Relations.next()) { addIncidenceBranch( inc ); } @@ -407,9 +409,9 @@ Incidence* Calendar::incidence( const QString& uid ) return 0; } -QPtrList<Todo> Calendar::todos() +Q3PtrList<Todo> Calendar::todos() { - QPtrList<Todo> tl = rawTodos(); + Q3PtrList<Todo> tl = rawTodos(); mFilter->apply( &tl ); return tl; } @@ -455,7 +457,7 @@ void Calendar::removeRelations( Incidence *incidence ) // qDebug("Calendar::removeRelations "); QString uid = incidence->uid(); - QPtrList<Incidence> relations = incidence->relations(); + Q3PtrList<Incidence> relations = incidence->relations(); for( Incidence* i = relations.first(); i; i = relations.next() ) if( !mOrphanUids.find( i->uid() ) ) { mOrphans.insert( uid, i ); @@ -471,7 +473,7 @@ void Calendar::removeRelations( Incidence *incidence ) // Remove this one from the orphans list if( mOrphanUids.remove( uid ) ) { QString r2uid = incidence->relatedToUid(); - QPtrList<Incidence> tempList; + Q3PtrList<Incidence> tempList; while( Incidence* i = mOrphans[ r2uid ] ) { mOrphans.remove( r2uid ); if ( i != incidence ) tempList.append( i ); @@ -487,7 +489,7 @@ void Calendar::removeRelations( Incidence *incidence ) // This incidence is located in the orphans list - it should be removed if( !( incidence->relatedTo() != 0 && mOrphans.remove( incidence->relatedTo()->uid() ) ) ) { // Removing wasn't that easy - for( QDictIterator<Incidence> it( mOrphans ); it.current(); ++it ) { + for( Q3DictIterator<Incidence> it( mOrphans ); it.current(); ++it ) { if( it.current()->uid() == uid ) { mOrphans.remove( it.currentKey() ); break; diff --git a/libkcal/calendar.h b/libkcal/calendar.h index fbc40ad..5845f44 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h @@ -25,8 +25,8 @@ #include <qobject.h> #include <qstring.h> #include <qdatetime.h> -#include <qptrlist.h> -#include <qdict.h> +#include <q3ptrlist.h> +#include <q3dict.h> #include "customproperties.h" #include "event.h" @@ -88,7 +88,7 @@ public: Sync changes in memory to persistant storage. */ virtual void save() = 0; - virtual QPtrList<Event> getExternLastSyncEvents() = 0; + virtual Q3PtrList<Event> getExternLastSyncEvents() = 0; virtual void removeSyncInfo( QString syncProfile) = 0; virtual bool isSaving() { return false; } @@ -155,12 +155,12 @@ public: /** Return filtered list of all incidences of this calendar. */ - virtual QPtrList<Incidence> incidences(); + virtual Q3PtrList<Incidence> incidences(); /** Return unfiltered list of all incidences of this calendar. */ - virtual QPtrList<Incidence> rawIncidences(); + virtual Q3PtrList<Incidence> rawIncidences(); /** Adds a Event to this calendar object. @@ -185,27 +185,27 @@ public: date specified. useful for dayView, etc. etc. The calendar filter is applied. */ - QPtrList<Event> events( const QDate &date, bool sorted = false); + Q3PtrList<Event> events( const QDate &date, bool sorted = false); /** Get events, which occur on the given date. The calendar filter is applied. */ - QPtrList<Event> events( const QDateTime &qdt ); + Q3PtrList<Event> events( const QDateTime &qdt ); /** Get events in a range of dates. If inclusive is set to true, only events are returned, which are completely included in the range. The calendar filter is applied. */ - QPtrList<Event> events( const QDate &start, const QDate &end, + Q3PtrList<Event> events( const QDate &start, const QDate &end, bool inclusive = false); /** Return filtered list of all events in calendar. */ - virtual QPtrList<Event> events(); + virtual Q3PtrList<Event> events(); /** Return unfiltered list of all events in calendar. */ - virtual QPtrList<Event> rawEvents() = 0; + virtual Q3PtrList<Event> rawEvents() = 0; /** Add a todo to the todolist. @@ -222,7 +222,7 @@ public: /** Return filterd list of todos. */ - virtual QPtrList<Todo> todos(); + virtual Q3PtrList<Todo> todos(); /** Searches todolist for an event with this unique string identifier, returns a pointer or null. @@ -232,11 +232,11 @@ public: /** Returns list of todos due on the specified date. */ - virtual QPtrList<Todo> todos( const QDate &date ) = 0; + virtual Q3PtrList<Todo> todos( const QDate &date ) = 0; /** Return unfiltered list of todos. */ - virtual QPtrList<Todo> rawTodos() = 0; + virtual Q3PtrList<Todo> rawTodos() = 0; /** Add a Journal entry to calendar. @@ -248,7 +248,7 @@ public: Return Journal for given date. */ virtual Journal *journal( const QDate & ) = 0; - virtual QPtrList<Journal> journals4Date( const QDate & ) = 0; + virtual Q3PtrList<Journal> journals4Date( const QDate & ) = 0; /** Return Journal with given UID. */ @@ -256,7 +256,7 @@ public: /** Return list of all Journal entries. */ - virtual QPtrList<Journal> journals() = 0; + virtual Q3PtrList<Journal> journals() = 0; /** Searches all incidence types for an incidence with this unique @@ -335,17 +335,17 @@ public: /** Get unfiltered events, which occur on the given date. */ - virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; + virtual Q3PtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; /** Get unfiltered events, which occur on the given date. */ - virtual QPtrList<Event> rawEventsForDate( const QDate &date, + virtual Q3PtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false ) = 0; /** Get events in a range of dates. If inclusive is set to true, only events are returned, which are completely included in the range. */ - virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end, + virtual Q3PtrList<Event> rawEvents( const QDate &start, const QDate &end, bool inclusive = false ) = 0; Incidence *mNextAlarmIncidence; @@ -376,8 +376,8 @@ private: QString mLoadedProductId; // This list is used to put together related todos - QDict<Incidence> mOrphans; - QDict<Incidence> mOrphanUids; + Q3Dict<Incidence> mOrphans; + Q3Dict<Incidence> mOrphanUids; }; } diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index ce3cd09..cb52b7c 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -22,7 +22,7 @@ #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <kdebug.h> #include <kconfig.h> @@ -192,7 +192,7 @@ bool CalendarLocal::mergeCalendar( Calendar* remote ) // 2 look for raw inc in remote // if inc in local, replace it // if not in local, add it to default calendar - QPtrList<Incidence> localInc = rawIncidences(); + Q3PtrList<Incidence> localInc = rawIncidences(); Incidence* inL = localInc.first(); while ( inL ) { if ( ! inL->isReadOnly () ) @@ -200,7 +200,7 @@ bool CalendarLocal::mergeCalendar( Calendar* remote ) deleteIncidence( inL ); inL = localInc.next(); } - QPtrList<Incidence> er = remote->rawIncidences(); + Q3PtrList<Incidence> er = remote->rawIncidences(); Incidence* inR = er.first(); while ( inR ) { inL = incidenceForUid( inR->uid(),false ); @@ -259,9 +259,9 @@ void CalendarLocal::addCalendar( Calendar* cal ) { cal->setDontDeleteIncidencesOnClose(); setSyncEventsEnabled(); - QPtrList<Incidence> incList; + Q3PtrList<Incidence> incList; { - QPtrList<Event> EventList = cal->rawEvents(); + Q3PtrList<Event> EventList = cal->rawEvents(); Event * ev = EventList.first(); while ( ev ) { if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) { @@ -279,7 +279,7 @@ void CalendarLocal::addCalendar( Calendar* cal ) } { - QPtrList<Todo> TodoList = cal->rawTodos(); + Q3PtrList<Todo> TodoList = cal->rawTodos(); Todo * ev = TodoList.first(); while ( ev ) { ev->resetRelatedTo(); @@ -299,7 +299,7 @@ void CalendarLocal::addCalendar( Calendar* cal ) } } { - QPtrList<Journal> JournalList = cal->journals(); + Q3PtrList<Journal> JournalList = cal->journals(); Journal * ev = JournalList.first(); while ( ev ) { Journal * se = journal( ev->uid() ); @@ -481,9 +481,9 @@ void CalendarLocal::deleteTodo( Todo *todo ) setupRelations( dup ); } -QPtrList<Todo> CalendarLocal::rawTodos() +Q3PtrList<Todo> CalendarLocal::rawTodos() { - QPtrList<Todo> el; + Q3PtrList<Todo> el; for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) if ( it->calEnabled() ) el.append( it ); return el; @@ -499,13 +499,13 @@ Todo *CalendarLocal::todo( QString syncProf, QString id ) } void CalendarLocal::removeSyncInfo( QString syncProfile) { - QPtrList<Incidence> all = rawIncidences() ; + Q3PtrList<Incidence> all = rawIncidences() ; Incidence *inc; for ( inc = all.first(); inc; inc = all.next() ) { inc->removeID( syncProfile ); } if ( syncProfile.isEmpty() ) { - QPtrList<Event> el; + Q3PtrList<Event> el; Event *todo; for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) @@ -520,9 +520,9 @@ void CalendarLocal::removeSyncInfo( QString syncProfile) deleteIncidence ( lse ); } } -QPtrList<Event> CalendarLocal::getExternLastSyncEvents() +Q3PtrList<Event> CalendarLocal::getExternLastSyncEvents() { - QPtrList<Event> el; + Q3PtrList<Event> el; Event *todo; for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) @@ -685,9 +685,9 @@ void CalendarLocal::deRegisterAlarm() // #endif } -QPtrList<Todo> CalendarLocal::todos( const QDate &date ) +Q3PtrList<Todo> CalendarLocal::todos( const QDate &date ) { - QPtrList<Todo> todos; + Q3PtrList<Todo> todos; Todo *todo; for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { @@ -786,7 +786,7 @@ Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to ) void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence, const QDateTime &from, const QDateTime &to ) { - QPtrList<Alarm> alarmList = incidence->alarms(); + Q3PtrList<Alarm> alarmList = incidence->alarms(); Alarm *alarm; for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) { // kdDebug(5800) << "CalendarLocal::appendAlarms() '" << alarm->text() @@ -805,7 +805,7 @@ void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms, const QDateTime &to ) { - QPtrList<Alarm> alarmList = incidence->alarms(); + Q3PtrList<Alarm> alarmList = incidence->alarms(); Alarm *alarm; QDateTime qdt; for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) { @@ -844,9 +844,9 @@ void CalendarLocal::insertEvent( Event *event ) } -QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) +Q3PtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) { - QPtrList<Event> eventList; + Q3PtrList<Event> eventList; Event *event; for( event = mEventList.first(); event; event = mEventList.next() ) { @@ -878,7 +878,7 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) // kdDebug(5800) << "Sorting events for date\n" << endl; // now, we have to sort it based on dtStart.time() - QPtrList<Event> eventListSorted; + Q3PtrList<Event> eventListSorted; Event *sortEvent; for ( event = eventList.first(); event; event = eventList.next() ) { sortEvent = eventListSorted.first(); @@ -894,12 +894,12 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) } -QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, +Q3PtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, bool inclusive ) { Event *event = 0; - QPtrList<Event> eventList; + Q3PtrList<Event> eventList; // Get non-recurring events for( event = mEventList.first(); event; event = mEventList.next() ) { @@ -923,7 +923,7 @@ QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, } } else { bool founOne; - QDate next = event->getNextOccurence( start, &founOne ).date(); + QDate next = event->getNextOccurence( (QDateTime)start, &founOne ).date(); if ( founOne ) { if ( next <= end ) { found = true; @@ -972,14 +972,14 @@ QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, return eventList; } -QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) +Q3PtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) { return rawEventsForDate( qdt.date() ); } -QPtrList<Event> CalendarLocal::rawEvents() +Q3PtrList<Event> CalendarLocal::rawEvents() { - QPtrList<Event> el; + Q3PtrList<Event> el; for ( Event *it = mEventList.first(); it; it = mEventList.next() ) if ( it->calEnabled() ) el.append( it ); return el; @@ -1006,9 +1006,9 @@ void CalendarLocal::deleteJournal( Journal *journal ) } } -QPtrList<Journal> CalendarLocal::journals4Date( const QDate & date ) +Q3PtrList<Journal> CalendarLocal::journals4Date( const QDate & date ) { - QPtrList<Journal> el; + Q3PtrList<Journal> el; for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) if ( it->calEnabled() && it->dtStart().date() == date) el.append( it ); return el; @@ -1040,9 +1040,9 @@ Journal *CalendarLocal::journal( const QString &uid ) return retVal; } -QPtrList<Journal> CalendarLocal::journals() +Q3PtrList<Journal> CalendarLocal::journals() { - QPtrList<Journal> el; + Q3PtrList<Journal> el; for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) if ( it->calEnabled() ) el.append( it ); return el; @@ -1051,7 +1051,7 @@ void CalendarLocal::setCalendarRemove( int id ) { { - QPtrList<Event> EventList = mEventList; + Q3PtrList<Event> EventList = mEventList; Event * ev = EventList.first(); while ( ev ) { if ( ev->calID() == id && ev->uid().left( 15 ) != QString("last-syncEvent-") ) @@ -1061,7 +1061,7 @@ void CalendarLocal::setCalendarRemove( int id ) } { - QPtrList<Todo> TodoList = mTodoList; + Q3PtrList<Todo> TodoList = mTodoList; Todo * ev = TodoList.first(); while ( ev ) { if ( ev->calID() == id ) @@ -1070,7 +1070,7 @@ void CalendarLocal::setCalendarRemove( int id ) } } { - QPtrList<Journal> JournalList = mJournalList; + Q3PtrList<Journal> JournalList = mJournalList; Journal * ev = JournalList.first(); while ( ev ) { if ( ev->calID() == id ) diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index 1ceabce..1df65c7 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h @@ -23,6 +23,8 @@ #define KCAL_CALENDARLOCAL_H #include "calendar.h" +//Added by qt3to4: +#include <Q3PtrList> namespace KCal { @@ -93,8 +95,8 @@ class CalendarLocal : public Calendar /** Return unfiltered list of all events in calendar. */ - QPtrList<Event> rawEvents(); - QPtrList<Event> getExternLastSyncEvents(); + Q3PtrList<Event> rawEvents(); + Q3PtrList<Event> getExternLastSyncEvents(); /** Add a todo to the todolist. */ @@ -112,17 +114,17 @@ class CalendarLocal : public Calendar /** Return list of all todos. */ - QPtrList<Todo> rawTodos(); + Q3PtrList<Todo> rawTodos(); /** Returns list of todos due on the specified date. */ - QPtrList<Todo> todos( const QDate &date ); + Q3PtrList<Todo> todos( const QDate &date ); /** Return list of all todos. Workaround because compiler does not recognize function of base class. */ - QPtrList<Todo> todos() { return Calendar::todos(); } + Q3PtrList<Todo> todos() { return Calendar::todos(); } /** Add a Journal entry to calendar. @@ -136,7 +138,7 @@ class CalendarLocal : public Calendar Return Journal for given date. */ Journal *journal( const QDate & ); - QPtrList<Journal> journals4Date( const QDate & ); + Q3PtrList<Journal> journals4Date( const QDate & ); /** Return Journal with given UID. */ @@ -144,7 +146,7 @@ class CalendarLocal : public Calendar /** Return list of all Journals stored in calendar. */ - QPtrList<Journal> journals(); + Q3PtrList<Journal> journals(); /** Return all alarms, which ocur in the given time interval. @@ -174,16 +176,16 @@ class CalendarLocal : public Calendar Builds and then returns a list of all events that match for the date specified. useful for dayView, etc. etc. */ - QPtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false ); + Q3PtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false ); /** Get unfiltered events for date \a qdt. */ - QPtrList<Event> rawEventsForDate( const QDateTime &qdt ); + Q3PtrList<Event> rawEventsForDate( const QDateTime &qdt ); /** Get unfiltered events in a range of dates. If inclusive is set to true, only events are returned, which are completely included in the range. */ - QPtrList<Event> rawEvents( const QDate &start, const QDate &end, + Q3PtrList<Event> rawEvents( const QDate &start, const QDate &end, bool inclusive = false ); Todo *todo( QString, QString ); Event *event( QString, QString ); @@ -224,9 +226,9 @@ public slots: private: void init(); - QPtrList<Event> mEventList; - QPtrList<Todo> mTodoList; - QPtrList<Journal> mJournalList; + Q3PtrList<Event> mEventList; + Q3PtrList<Todo> mTodoList; + Q3PtrList<Journal> mJournalList; }; } diff --git a/libkcal/calfilter.cpp b/libkcal/calfilter.cpp index 72f70c2..fa1dbd5 100644 --- a/libkcal/calfilter.cpp +++ b/libkcal/calfilter.cpp @@ -21,6 +21,8 @@ #include <kdebug.h> #include "calfilter.h" +//Added by qt3to4: +#include <Q3PtrList> using namespace KCal; @@ -41,7 +43,7 @@ CalFilter::~CalFilter() { } -void CalFilter::apply(QPtrList<Event> *eventlist) +void CalFilter::apply(Q3PtrList<Event> *eventlist) { if (!mEnabled) return; @@ -61,7 +63,7 @@ void CalFilter::apply(QPtrList<Event> *eventlist) } // TODO: avoid duplicating apply() code -void CalFilter::apply(QPtrList<Todo> *eventlist) +void CalFilter::apply(Q3PtrList<Todo> *eventlist) { if (!mEnabled) return; Todo *event = eventlist->first(); diff --git a/libkcal/calfilter.h b/libkcal/calfilter.h index e349770..821149f 100644 --- a/libkcal/calfilter.h +++ b/libkcal/calfilter.h @@ -22,7 +22,7 @@ #define _CALFILTER_H #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include "event.h" #include "todo.h" @@ -55,15 +55,15 @@ class CalFilter { Apply filter to eventlist, all events not matching filter criterias are removed from the list. */ - void apply(QPtrList<Event> *eventlist); + void apply(Q3PtrList<Event> *eventlist); /** Apply filter to todolist, all todos not matching filter criterias are removed from the list. */ - void apply(QPtrList<Todo> *todolist); - bool CalFilter::filterCalendarItem(Incidence *in); - bool CalFilter::filterJournal(Journal *in); + void apply(Q3PtrList<Todo> *todolist); + bool filterCalendarItem(Incidence *in); + bool filterJournal(Journal *in); /** Apply filter criteria on the specified event. Return true, if event passes criteria, otherwise return false. diff --git a/libkcal/customproperties.cpp b/libkcal/customproperties.cpp index adc1710..16f4a28 100644 --- a/libkcal/customproperties.cpp +++ b/libkcal/customproperties.cpp @@ -19,6 +19,8 @@ */ #include "customproperties.h" +//Added by qt3to4: +#include <Q3CString> using namespace KCal; @@ -35,52 +37,52 @@ CustomProperties::~CustomProperties() { } -void CustomProperties::setCustomProperty(const QCString &app, const QCString &key, +void CustomProperties::setCustomProperty(const Q3CString &app, const Q3CString &key, const QString &value) { if (value.isNull() || key.isEmpty() || app.isEmpty()) return; - QCString property = "X-KDE-" + app + "-" + key; + Q3CString property = "X-KDE-" + app + "-" + key; if (!checkName(property)) return; mProperties[property] = value; } -void CustomProperties::removeCustomProperty(const QCString &app, const QCString &key) +void CustomProperties::removeCustomProperty(const Q3CString &app, const Q3CString &key) { - removeNonKDECustomProperty(QCString("X-KDE-" + app + "-" + key)); + removeNonKDECustomProperty(Q3CString("X-KDE-" + app + "-" + key)); } -QString CustomProperties::customProperty(const QCString &app, const QCString &key) const +QString CustomProperties::customProperty(const Q3CString &app, const Q3CString &key) const { - return nonKDECustomProperty(QCString("X-KDE-" + app + "-" + key)); + return nonKDECustomProperty(Q3CString("X-KDE-" + app + "-" + key)); } -void CustomProperties::setNonKDECustomProperty(const QCString &name, const QString &value) +void CustomProperties::setNonKDECustomProperty(const Q3CString &name, const QString &value) { if (value.isNull() || !checkName(name)) return; mProperties[name] = value; } -void CustomProperties::removeNonKDECustomProperty(const QCString &name) +void CustomProperties::removeNonKDECustomProperty(const Q3CString &name) { - QMap<QCString, QString>::Iterator it = mProperties.find(name); + QMap<Q3CString, QString>::Iterator it = mProperties.find(name); if (it != mProperties.end()) mProperties.remove(it); } -QString CustomProperties::nonKDECustomProperty(const QCString &name) const +QString CustomProperties::nonKDECustomProperty(const Q3CString &name) const { - QMap<QCString, QString>::ConstIterator it = mProperties.find(name); + QMap<Q3CString, QString>::ConstIterator it = mProperties.find(name); if (it == mProperties.end()) return QString::null; return it.data(); } -void CustomProperties::setCustomProperties(const QMap<QCString, QString> &properties) +void CustomProperties::setCustomProperties(const QMap<Q3CString, QString> &properties) { - for (QMap<QCString, QString>::ConstIterator it = properties.begin(); it != properties.end(); ++it) { + for (QMap<Q3CString, QString>::ConstIterator it = properties.begin(); it != properties.end(); ++it) { // Validate the property name and convert any null string to empty string if (checkName(it.key())) { mProperties[it.key()] = it.data().isNull() ? QString("") : it.data(); @@ -88,12 +90,12 @@ void CustomProperties::setCustomProperties(const QMap<QCString, QString> &proper } } -QMap<QCString, QString> CustomProperties::customProperties() const +QMap<Q3CString, QString> CustomProperties::customProperties() const { return mProperties; } -bool CustomProperties::checkName(const QCString &name) +bool CustomProperties::checkName(const Q3CString &name) { // Check that the property name starts with 'X-' and contains // only the permitted characters diff --git a/libkcal/customproperties.h b/libkcal/customproperties.h index 0cbfdcd..75eb3ad 100644 --- a/libkcal/customproperties.h +++ b/libkcal/customproperties.h @@ -23,6 +23,8 @@ #include <qstring.h> #include <qmap.h> +//Added by qt3to4: +#include <Q3CString> namespace KCal { @@ -49,47 +51,47 @@ class CustomProperties @param value The property's value. A call with a value of QString::null will be ignored. */ - void setCustomProperty(const QCString &app, const QCString &key, + void setCustomProperty(const Q3CString &app, const Q3CString &key, const QString &value); /** Delete a custom calendar property. @param app Application name as it appears in the custom property name. @param key Property identifier specific to the application. */ - void removeCustomProperty(const QCString &app, const QCString &key); + void removeCustomProperty(const Q3CString &app, const Q3CString &key); /** Return the value of a custom calendar property. @param app Application name as it appears in the custom property name. @param key Property identifier specific to the application. @return Property value, or QString::null if (and only if) the property does not exist. */ - QString customProperty(const QCString &app, const QCString &key) const; + QString customProperty(const Q3CString &app, const Q3CString &key) const; /** Create or modify a non-KDE or non-standard custom calendar property. @param name Full property name @param value The property's value. A call with a value of QString::null will be ignored. */ - void setNonKDECustomProperty(const QCString &name, const QString &value); + void setNonKDECustomProperty(const Q3CString &name, const QString &value); /** Delete a non-KDE or non-standard custom calendar property. @param name Full property name */ - void removeNonKDECustomProperty(const QCString &name); + void removeNonKDECustomProperty(const Q3CString &name); /** Return the value of a non-KDE or non-standard custom calendar property. @param name Full property name @return Property value, or QString::null if (and only if) the property does not exist. */ - QString nonKDECustomProperty(const QCString& name) const; + QString nonKDECustomProperty(const Q3CString& name) const; /** Initialise the alarm's custom calendar properties to the specified key/value pairs. */ - void setCustomProperties(const QMap<QCString, QString> &properties); + void setCustomProperties(const QMap<Q3CString, QString> &properties); /** Return all custom calendar property key/value pairs. */ - QMap<QCString, QString> customProperties() const; + QMap<Q3CString, QString> customProperties() const; private: - static bool checkName(const QCString& name); + static bool checkName(const Q3CString& name); - QMap<QCString, QString> mProperties; // custom calendar properties + QMap<Q3CString, QString> mProperties; // custom calendar properties }; } diff --git a/libkcal/dndfactory.cpp b/libkcal/dndfactory.cpp index cdcfae4..ca7e212 100644 --- a/libkcal/dndfactory.cpp +++ b/libkcal/dndfactory.cpp @@ -22,6 +22,9 @@ #include <qapplication.h> #include <qclipboard.h> +//Added by qt3to4: +#include <QDropEvent> +#include <Q3PtrList> #include <kiconloader.h> #include <kdebug.h> @@ -68,7 +71,7 @@ Event *DndFactory::createDrop(QDropEvent *de) if ( ICalDrag::decode( de, &cal ) || VCalDrag::decode( de, &cal ) ) { de->accept(); - QPtrList<Event> events = cal.events(); + Q3PtrList<Event> events = cal.events(); if ( !events.isEmpty() ) { Event *event = new Event( *events.first() ); return event; @@ -87,7 +90,7 @@ Todo *DndFactory::createDropTodo(QDropEvent *de) if ( ICalDrag::decode( de, &cal ) || VCalDrag::decode( de, &cal ) ) { de->accept(); - QPtrList<Todo> todos = cal.todos(); + Q3PtrList<Todo> todos = cal.todos(); if ( !todos.isEmpty() ) { Todo *todo = new Todo( *todos.first() ); return todo; @@ -133,7 +136,7 @@ Incidence *DndFactory::pasteIncidence(const QDate &newDate, const QTime *newTime return 0; } - QPtrList<Incidence> incList = cal.incidences(); + Q3PtrList<Incidence> incList = cal.incidences(); Incidence *inc = incList.first(); if ( !incList.isEmpty() && inc ) { diff --git a/libkcal/dndfactory.h b/libkcal/dndfactory.h index 2df5259..a873c37 100644 --- a/libkcal/dndfactory.h +++ b/libkcal/dndfactory.h @@ -1,3 +1,5 @@ +//Added by qt3to4: +#include <QDropEvent> /* This file is part of libkcal. 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 @@ -25,6 +25,8 @@ #define KCAL_DNDFACTORY_H #include "vcalformat.h" +//Added by qt3to4: +#include <QDropEvent> class QDropEvent; diff --git a/libkcal/dummyscheduler.cpp b/libkcal/dummyscheduler.cpp index ae40e6d..73eb3d0 100644 --- a/libkcal/dummyscheduler.cpp +++ b/libkcal/dummyscheduler.cpp @@ -23,7 +23,9 @@ // #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> +//Added by qt3to4: +#include <Q3PtrList> #include <kdebug.h> @@ -68,8 +70,8 @@ bool DummyScheduler::performTransaction(IncidenceBase *incidence,Method method) bool DummyScheduler::saveMessage(const QString &message) { QFile f("dummyscheduler.store"); - if (f.open(IO_WriteOnly | IO_Append)) { - QTextStream t(&f); + if (f.open(QIODevice::WriteOnly | QIODevice::Append)) { + Q3TextStream t(&f); t << message << endl; f.close(); return true; @@ -78,16 +80,16 @@ bool DummyScheduler::saveMessage(const QString &message) } } -QPtrList<ScheduleMessage> DummyScheduler::retrieveTransactions() +Q3PtrList<ScheduleMessage> DummyScheduler::retrieveTransactions() { - QPtrList<ScheduleMessage> messageList; + Q3PtrList<ScheduleMessage> messageList; QFile f("dummyscheduler.store"); - if (!f.open(IO_ReadOnly)) { + if (!f.open(QIODevice::ReadOnly)) { kdDebug(5800) << "DummyScheduler::retrieveTransactions(): Can't open file" << endl; } else { - QTextStream t(&f); + Q3TextStream t(&f); QString messageString; QString messageLine = t.readLine(); while (!messageLine.isNull()) { diff --git a/libkcal/dummyscheduler.h b/libkcal/dummyscheduler.h index df42153..f86d583 100644 --- a/libkcal/dummyscheduler.h +++ b/libkcal/dummyscheduler.h @@ -24,6 +24,8 @@ // #include "scheduler.h" +//Added by qt3to4: +#include <Q3PtrList> namespace KCal { @@ -39,7 +41,7 @@ class DummyScheduler : public Scheduler { bool publish (IncidenceBase *incidence,const QString &recipients); bool performTransaction(IncidenceBase *incidence,Method method); bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients); - QPtrList<ScheduleMessage> retrieveTransactions(); + Q3PtrList<ScheduleMessage> retrieveTransactions(); protected: bool saveMessage(const QString &); diff --git a/libkcal/event.cpp b/libkcal/event.cpp index fdf5657..060df81 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp @@ -384,7 +384,7 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_ // *ok = false; // return incidenceStart; // } - for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { + for (Q3PtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { if (alarm->enabled()) { if ( alarm->hasTime () ) { if ( alarm->time() < alarmStart ) { diff --git a/libkcal/event.h b/libkcal/event.h index 6a58618..da44f81 100644 --- a/libkcal/event.h +++ b/libkcal/event.h @@ -25,6 +25,8 @@ // #include "incidence.h" +//Added by qt3to4: +#include <Q3CString> namespace KCal { /** @@ -40,7 +42,7 @@ class Event : public Incidence ~Event(); bool matchTime(QDateTime*startDT, QDateTime* endDT); - QCString type() const { return "Event"; } + Q3CString type() const { return "Event"; } IncTypeID typeID() const { return eventID; } Incidence *clone(); diff --git a/libkcal/filestorage.cpp b/libkcal/filestorage.cpp index a139124..3d1309f 100644 --- a/libkcal/filestorage.cpp +++ b/libkcal/filestorage.cpp @@ -22,7 +22,7 @@ #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <kdebug.h> diff --git a/libkcal/freebusy.cpp b/libkcal/freebusy.cpp index ba15d6d..e4e9ec9 100644 --- a/libkcal/freebusy.cpp +++ b/libkcal/freebusy.cpp @@ -21,6 +21,9 @@ #include <kdebug.h> #include "freebusy.h" +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3PtrList> using namespace KCal; @@ -43,7 +46,7 @@ FreeBusy::FreeBusy( Calendar *calendar, const QDateTime &start, const QDateTime setDtEnd(end); //Gets all the events in the calendar - QPtrList<Event> eventList = mCalendar->events(); + Q3PtrList<Event> eventList = mCalendar->events(); Event *event; int extraDays, i, x, duration; @@ -113,7 +116,7 @@ QDateTime FreeBusy::dtEnd() const return mDtEnd; } -QValueList<Period> FreeBusy::busyPeriods() const +Q3ValueList<Period> FreeBusy::busyPeriods() const { return mBusyPeriods; } @@ -146,14 +149,14 @@ bool FreeBusy::addLocalPeriod(const QDateTime &eventStart, const QDateTime &even return true; } -FreeBusy::FreeBusy(QValueList<Period> busyPeriods) +FreeBusy::FreeBusy(Q3ValueList<Period> busyPeriods) { mBusyPeriods = busyPeriods; } void FreeBusy::sortList() { - typedef QValueList<Period> PeriodList; + typedef Q3ValueList<Period> PeriodList; PeriodList::Iterator tmpPeriod, earlyPeriod; PeriodList sortedList; diff --git a/libkcal/freebusy.h b/libkcal/freebusy.h index d741c72..bd14cb7 100644 --- a/libkcal/freebusy.h +++ b/libkcal/freebusy.h @@ -24,8 +24,10 @@ // #include <qdatetime.h> -#include <qvaluelist.h> -#include <qptrlist.h> +#include <q3valuelist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <Q3CString> #include "period.h" #include "calendar.h" @@ -43,17 +45,17 @@ class FreeBusy : public IncidenceBase FreeBusy(); FreeBusy(const QDateTime &start, const QDateTime &end); FreeBusy(Calendar *calendar, const QDateTime &start, const QDateTime &end); - FreeBusy(QValueList<Period> busyPeriods); + FreeBusy(Q3ValueList<Period> busyPeriods); ~FreeBusy(); - QCString type() const { return "FreeBusy"; } + Q3CString type() const { return "FreeBusy"; } IncTypeID typeID() const { return freebusyID; } virtual QDateTime dtEnd() const; bool setDtEnd( const QDateTime &end ); - QValueList<Period> busyPeriods() const; + Q3ValueList<Period> busyPeriods() const; void addPeriod(const QDateTime &start, const QDateTime &end); void sortList(); @@ -64,7 +66,7 @@ class FreeBusy : public IncidenceBase bool addLocalPeriod(const QDateTime &start, const QDateTime &end); QDateTime mDtEnd; - QValueList<Period> mBusyPeriods; + Q3ValueList<Period> mBusyPeriods; Calendar *mCalendar; }; diff --git a/libkcal/icaldrag.cpp b/libkcal/icaldrag.cpp index 446a115..7f5a796 100644 --- a/libkcal/icaldrag.cpp +++ b/libkcal/icaldrag.cpp @@ -28,7 +28,7 @@ using namespace KCal; ICalDrag::ICalDrag( Calendar *cal, QWidget *parent, const char *name ) - : QStoredDrag( "text/calendar", parent, name ) + : Q3StoredDrag( "text/calendar", parent, name ) { ICalFormat icf; QString scal = icf.toString( cal ); diff --git a/libkcal/icaldrag.h b/libkcal/icaldrag.h index fdf32b7..c1f73f4 100644 --- a/libkcal/icaldrag.h +++ b/libkcal/icaldrag.h @@ -22,13 +22,13 @@ #ifndef ICALDRAG_H #define ICALDRAG_H -#include <qdragobject.h> +#include <q3dragobject.h> #include "calendar.h" namespace KCal { /** iCalendar drag&drop class. */ -class ICalDrag : public QStoredDrag +class ICalDrag : public Q3StoredDrag { public: /** Create a drag&drop object for iCalendar component \a ical. */ diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp index 6f3a799..3829bc1 100644 --- a/libkcal/icalformat.cpp +++ b/libkcal/icalformat.cpp @@ -20,11 +20,11 @@ #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qregexp.h> #include <qclipboard.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <stdlib.h> @@ -70,14 +70,14 @@ bool ICalFormat::load( Calendar *calendar, const QString &fileName) clearException(); QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { setException(new ErrorFormat(ErrorFormat::LoadError)); return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); QString text; - ts.setEncoding( QTextStream::Latin1 ); + ts.setEncoding( Q3TextStream::Latin1 ); text = ts.read(); file.close(); @@ -98,14 +98,14 @@ bool ICalFormat::save( Calendar *calendar, const QString &fileName ) // TODO: write backup file //is.restart(); QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { setException(new ErrorFormat(ErrorFormat::SaveError, i18n("Could not open file '%1'").arg(fileName))); return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); - ts.setEncoding( QTextStream::Latin1 ); + ts.setEncoding( Q3TextStream::Latin1 ); ts << text; file.close(); //qDebug("saving file takes ms: %d ", is.elapsed() ); @@ -156,15 +156,15 @@ Incidence *ICalFormat::fromString( const QString &text ) fromString(&cal, text); Incidence *ical = 0; - QPtrList<Event> elist = cal.events(); + Q3PtrList<Event> elist = cal.events(); if ( elist.count() > 0 ) { ical = elist.first(); } else { - QPtrList<Todo> tlist = cal.todos(); + Q3PtrList<Todo> tlist = cal.todos(); if ( tlist.count() > 0 ) { ical = tlist.first(); } else { - QPtrList<Journal> jlist = cal.journals(); + Q3PtrList<Journal> jlist = cal.journals(); if ( jlist.count() > 0 ) { ical = jlist.first(); } @@ -172,7 +172,7 @@ Incidence *ICalFormat::fromString( const QString &text ) } return ical; } -#include <qapp.h> +#include <qapplication.h> QString ICalFormat::toString( Calendar *cal ) { @@ -184,8 +184,8 @@ QString ICalFormat::toString( Calendar *cal ) icalcomponent *component; // todos - QPtrList<Todo> todoList = cal->rawTodos(); - QPtrListIterator<Todo> qlt(todoList); + Q3PtrList<Todo> todoList = cal->rawTodos(); + Q3PtrListIterator<Todo> qlt(todoList); for (; qlt.current(); ++qlt) { component = mImpl->writeTodo(qlt.current()); icalcomponent_add_component(calendar,component); @@ -196,7 +196,7 @@ QString ICalFormat::toString( Calendar *cal ) } } // events - QPtrList<Event> events = cal->rawEvents(); + Q3PtrList<Event> events = cal->rawEvents(); Event *ev; for(ev=events.first();ev;ev=events.next()) { component = mImpl->writeEvent(ev); @@ -207,7 +207,7 @@ QString ICalFormat::toString( Calendar *cal ) } // journals - QPtrList<Journal> journals = cal->journals(); + Q3PtrList<Journal> journals = cal->journals(); Journal *j; for(j=journals.first();j;j=journals.next()) { component = mImpl->writeJournal(j); diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h index a770dbb..a454b35 100644 --- a/libkcal/icalformat.h +++ b/libkcal/icalformat.h @@ -21,6 +21,8 @@ #define ICALFORMAT_H #include <qstring.h> +//Added by qt3to4: +#include <Q3CString> #include "scheduler.h" @@ -106,7 +108,7 @@ class ICalFormat : public CalFormat { bool mProcessEvents; ICalFormatImpl *mImpl; QString mTimeZoneId; - QCString mTzString; + Q3CString mTzString; int tzOffsetMin; bool mUtc; }; diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index 65eabc8..ea144ee 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -20,8 +20,11 @@ #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qfile.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3CString> #include <kdebug.h> #include <klocale.h> @@ -221,8 +224,8 @@ icalcomponent *ICalFormatImpl::writeFreeBusy(FreeBusy *freebusy, } //Loops through all the periods in the freebusy object - QValueList<Period> list = freebusy->busyPeriods(); - QValueList<Period>::Iterator it; + Q3ValueList<Period> list = freebusy->busyPeriods(); + Q3ValueList<Period>::Iterator it; icalperiodtype period; for (it = list.begin(); it!= list.end(); ++it) { period.start = writeICalDateTime((*it).start()); @@ -384,12 +387,12 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence) } // attachments - QPtrList<Attachment> attachments = incidence->attachments(); + Q3PtrList<Attachment> attachments = incidence->attachments(); for (Attachment *at = attachments.first(); at; at = attachments.next()) icalcomponent_add_property(parent,writeAttachment(at)); // alarms - QPtrList<Alarm> alarms = incidence->alarms(); + Q3PtrList<Alarm> alarms = incidence->alarms(); Alarm* alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next()) { if (alarm->enabled()) { @@ -423,8 +426,8 @@ void ICalFormatImpl::writeIncidenceBase(icalcomponent *parent,IncidenceBase *inc // attendees if (incidenceBase->attendeeCount() != 0) { - QPtrList<Attendee> al = incidenceBase->attendees(); - QPtrListIterator<Attendee> ai(al); + Q3PtrList<Attendee> al = incidenceBase->attendees(); + Q3PtrListIterator<Attendee> ai(al); for (; ai.current(); ++ai) { icalcomponent_add_property(parent,writeAttendee(ai.current())); } @@ -436,8 +439,8 @@ void ICalFormatImpl::writeIncidenceBase(icalcomponent *parent,IncidenceBase *inc void ICalFormatImpl::writeCustomProperties(icalcomponent *parent,CustomProperties *properties) { - QMap<QCString, QString> custom = properties->customProperties(); - for (QMap<QCString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) { + QMap<Q3CString, QString> custom = properties->customProperties(); + for (QMap<Q3CString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) { icalproperty *p = icalproperty_new_x(c.data().utf8()); icalproperty_set_x_name(p,c.key()); icalcomponent_add_property(parent,p); @@ -546,8 +549,8 @@ icalproperty *ICalFormatImpl::writeRecurrenceRule(Recurrence *recur) int index = 0; int index2 = 0; - QPtrList<Recurrence::rMonthPos> tmpPositions; - QPtrList<int> tmpDays; + Q3PtrList<Recurrence::rMonthPos> tmpPositions; + Q3PtrList<int> tmpDays; int *tmpDay; Recurrence::rMonthPos *tmpPos; bool datetime = false; @@ -704,8 +707,8 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) break; case Alarm::Email: { action = ICAL_ACTION_EMAIL; - QValueList<Person> addresses = alarm->mailAddresses(); - for (QValueList<Person>::Iterator ad = addresses.begin(); ad != addresses.end(); ++ad) { + Q3ValueList<Person> addresses = alarm->mailAddresses(); + for (Q3ValueList<Person>::Iterator ad = addresses.begin(); ad != addresses.end(); ++ad) { icalproperty *p = icalproperty_new_attendee("MAILTO:" + (*ad).email().utf8()); if (!(*ad).name().isEmpty()) { icalproperty_add_parameter(p,icalparameter_new_cn((*ad).name().utf8())); @@ -763,8 +766,8 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) } // Custom properties - QMap<QCString, QString> custom = alarm->customProperties(); - for (QMap<QCString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) { + QMap<Q3CString, QString> custom = alarm->customProperties(); + for (QMap<Q3CString, QString>::Iterator c = custom.begin(); c != custom.end(); ++c) { icalproperty *p = icalproperty_new_x(c.data().utf8()); icalproperty_set_x_name(p,c.key()); icalcomponent_add_property(a,p); @@ -1339,7 +1342,7 @@ void ICalFormatImpl::readIncidenceBase(icalcomponent *parent,IncidenceBase *inci void ICalFormatImpl::readCustomProperties(icalcomponent *parent,CustomProperties *properties) { - QMap<QCString, QString> customProperties; + QMap<Q3CString, QString> customProperties; icalproperty *p = icalcomponent_get_first_property(parent,ICAL_X_PROPERTY); diff --git a/libkcal/icalformatimpl.h b/libkcal/icalformatimpl.h index 203c302..3a35b4c 100644 --- a/libkcal/icalformatimpl.h +++ b/libkcal/icalformatimpl.h @@ -21,6 +21,8 @@ #define ICALFORMATIMPL_H #include <qstring.h> +//Added by qt3to4: +#include <Q3PtrList> #include "scheduler.h" #include "freebusy.h" @@ -93,8 +95,8 @@ class ICalFormatImpl { QString mLoadedProductId; // PRODID string loaded from calendar file int mCalendarVersion; // determines backward compatibility mode on read - QPtrList<Event> mEventsRelate; // events with relations - QPtrList<Todo> mTodosRelate; // todos with relations + Q3PtrList<Event> mEventsRelate; // events with relations + Q3PtrList<Todo> mTodosRelate; // todos with relations static const int mSecondsPerWeek; static const int mSecondsPerDay; diff --git a/libkcal/imipscheduler.cpp b/libkcal/imipscheduler.cpp index e186f8e..e6d56a6 100644 --- a/libkcal/imipscheduler.cpp +++ b/libkcal/imipscheduler.cpp @@ -26,6 +26,8 @@ #include "icalformat.h" #include "imipscheduler.h" +//Added by qt3to4: +#include <Q3PtrList> using namespace KCal; @@ -50,9 +52,9 @@ bool IMIPScheduler::performTransaction(IncidenceBase *incidence,Method method) return false; } -QPtrList<ScheduleMessage> IMIPScheduler::retrieveTransactions() +Q3PtrList<ScheduleMessage> IMIPScheduler::retrieveTransactions() { - QPtrList<ScheduleMessage> messageList; + Q3PtrList<ScheduleMessage> messageList; return messageList; } diff --git a/libkcal/imipscheduler.h b/libkcal/imipscheduler.h index f142060..5a2d38e 100644 --- a/libkcal/imipscheduler.h +++ b/libkcal/imipscheduler.h @@ -23,7 +23,7 @@ // iMIP implementation of iTIP methods // -#include <qptrlist.h> +#include <q3ptrlist.h> #include "scheduler.h" @@ -40,7 +40,7 @@ class IMIPScheduler : public Scheduler { bool publish (IncidenceBase *incidence,const QString &recipients); bool performTransaction(IncidenceBase *incidence,Method method); - QPtrList<ScheduleMessage> retrieveTransactions(); + Q3PtrList<ScheduleMessage> retrieveTransactions(); }; } diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 7dd9bd2..8fcdc69 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -26,6 +26,8 @@ #include "incidence.h" #include "todo.h" +//Added by qt3to4: +#include <Q3PtrList> using namespace KCal; @@ -59,7 +61,7 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) mRelatedToUid = i.mRelatedToUid; // QPtrList<Incidence> mRelations; QPtrList<Incidence> mRelations; mExDates = i.mExDates; - QPtrListIterator<Attachment> itat( i.mAttachments ); + Q3PtrListIterator<Attachment> itat( i.mAttachments ); Attachment *at; while( (at = itat.current()) ) { Attachment *a = new Attachment( *at ); @@ -73,7 +75,7 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) mLocation = i.mLocation; mCancelled = i.mCancelled; mHasStartDate = i.mHasStartDate; - QPtrListIterator<Alarm> it( i.mAlarms ); + Q3PtrListIterator<Alarm> it( i.mAlarms ); const Alarm *a; while( (a = it.current()) ) { Alarm *b = new Alarm( *a ); @@ -98,7 +100,7 @@ Incidence::~Incidence() { Incidence *ev; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (ev=Relations.first();ev;ev=Relations.next()) { if (ev->relatedTo() == this) ev->setRelatedTo(0); } @@ -216,8 +218,8 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) } } #if 0 - QPtrListIterator<Alarm> a1( i1.alarms() ); - QPtrListIterator<Alarm> a2( i2.alarms() ); + Q3PtrListIterator<Alarm> a1( i1.alarms() ); + Q3PtrListIterator<Alarm> a2( i2.alarms() ); for( ; a1.current() && a2.current(); ++a1, ++a2 ) { if( *a1.current() == *a2.current() ) { continue; @@ -322,7 +324,7 @@ void Incidence::cloneRelations( Incidence * newInc ) // newInc is already a clone of this incidence Incidence * inc; Incidence * cloneInc; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (inc=Relations.first();inc;inc=Relations.next()) { cloneInc = inc->clone(); cloneInc->recreate(); @@ -356,7 +358,7 @@ QDateTime Incidence::lastModifiedSub() return mLastModifiedSub; mLastModifiedSub = lastModified(); Incidence * inc; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (inc=Relations.first();inc;inc=Relations.next()) { if ( inc->lastModifiedSub() > mLastModifiedSub ) mLastModifiedSub = inc->lastModifiedSub(); @@ -447,7 +449,7 @@ void Incidence::addCategories(const QStringList &categories, bool addToRelations updated(); if ( addToRelations ) { Incidence * inc; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (inc=Relations.first();inc;inc=Relations.next()) { inc->addCategories( categories, true ); } @@ -462,7 +464,7 @@ void Incidence::setCategories(const QStringList &categories, bool setForRelation updated(); if ( setForRelations ) { Incidence * inc; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (inc=Relations.first();inc;inc=Relations.next()) { inc->setCategories( categories, true ); } @@ -550,15 +552,15 @@ Incidence *Incidence::relatedTo() const return mRelatedTo; } -QPtrList<Incidence> Incidence::relations() const +Q3PtrList<Incidence> Incidence::relations() const { return mRelations; } -void Incidence::addRelationsToList(QPtrList<Incidence> *rel) +void Incidence::addRelationsToList(Q3PtrList<Incidence> *rel) { Incidence* inc; - QPtrList<Incidence> Relations = relations(); + Q3PtrList<Incidence> Relations = relations(); for (inc=Relations.first();inc;inc=Relations.next()) { inc->addRelationsToList( rel ); } @@ -647,15 +649,15 @@ void Incidence::deleteAttachments(const QString& mime) } } -QPtrList<Attachment> Incidence::attachments() const +Q3PtrList<Attachment> Incidence::attachments() const { return mAttachments; } -QPtrList<Attachment> Incidence::attachments(const QString& mime) const +Q3PtrList<Attachment> Incidence::attachments(const QString& mime) const { - QPtrList<Attachment> attachments; - QPtrListIterator<Attachment> it( mAttachments ); + Q3PtrList<Attachment> attachments; + Q3PtrListIterator<Attachment> it( mAttachments ); Attachment *at; while ( (at = it.current()) ) { if (at->mimeType() == mime) @@ -737,7 +739,7 @@ QStringList Incidence::secrecyList() } -QPtrList<Alarm> Incidence::alarms() const +Q3PtrList<Alarm> Incidence::alarms() const { return mAlarms; } @@ -771,7 +773,7 @@ void Incidence::clearAlarms() bool Incidence::isAlarmEnabled() const { Alarm* alarm; - for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { + for (Q3PtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { if (alarm->enabled()) return true; } diff --git a/libkcal/incidence.h b/libkcal/incidence.h index f89942f..2940129 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h @@ -25,7 +25,9 @@ #include <qdatetime.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> +//Added by qt3to4: +#include <Q3PtrList> #include "recurrence.h" #include "alarm.h" @@ -113,7 +115,7 @@ class Incidence : public IncidenceBase virtual Incidence *clone() = 0; virtual void cloneRelations( Incidence * ); - void addRelationsToList(QPtrList<Incidence> *rel); + void addRelationsToList(Q3PtrList<Incidence> *rel); void clearRelations(); virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; void setReadOnly( bool ); @@ -177,7 +179,7 @@ class Incidence : public IncidenceBase /** what event does this one relate to? */ Incidence *relatedTo() const; /** All events that are related to this event */ - QPtrList<Incidence> relations() const; + Q3PtrList<Incidence> relations() const; /** Add an event which is related to this event */ void addRelation(Incidence *); /** Remove event that is related to this event */ @@ -202,9 +204,9 @@ class Incidence : public IncidenceBase /** remove and delete all attachments with this mime type */ void deleteAttachments(const QString& mime); /** return list of all associated attachments */ - QPtrList<Attachment> attachments() const; + Q3PtrList<Attachment> attachments() const; /** find a list of attachments with this mime type */ - QPtrList<Attachment> attachments(const QString& mime) const; + Q3PtrList<Attachment> attachments(const QString& mime) const; /** sets the event's status the value specified. See the enumeration * above for possible values. */ @@ -235,7 +237,7 @@ class Incidence : public IncidenceBase int priority() const; /** All alarms that are associated with this incidence */ - QPtrList<Alarm> alarms() const; + Q3PtrList<Alarm> alarms() const; /** Create a new alarm which is associated with this incidence */ Alarm* newAlarm(); /** Add an alarm which is associated with this incidence */ @@ -288,8 +290,8 @@ class Incidence : public IncidenceBase QString durationText4Time( int secs ); Recurrence *mRecurrence; protected: - QPtrList<Alarm> mAlarms; - QPtrList<Incidence> mRelations; + Q3PtrList<Alarm> mAlarms; + Q3PtrList<Incidence> mRelations; QDateTime mRecurrenceID; bool mHasRecurrenceID; private: @@ -308,7 +310,7 @@ protected: Incidence *mRelatedTo; QString mRelatedToUid; DateList mExDates; - QPtrList<Attachment> mAttachments; + Q3PtrList<Attachment> mAttachments; QStringList mResources; bool mHasStartDate; // if todo has associated start date diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 56c0560..f11ec54 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp @@ -27,6 +27,8 @@ #include "syncdefines.h" #include "incidencebase.h" +//Added by qt3to4: +#include <Q3PtrList> using namespace KCal; @@ -64,7 +66,7 @@ IncidenceBase::IncidenceBase(const IncidenceBase &i) : mCalEnabled = i.mCalEnabled; mAlarmEnabled = i.mAlarmEnabled; mCalID = i.mCalID; - QPtrList<Attendee> attendees = i.attendees(); + Q3PtrList<Attendee> attendees = i.attendees(); for( Attendee *a = attendees.first(); a; a = attendees.next() ) { mAttendees.append( new Attendee( *a ) ); } @@ -300,7 +302,7 @@ bool IncidenceBase::addAttendee(Attendee *a, bool doupdate) if (a->name().left(7).upper() == "MAILTO:") a->setName(a->name().remove(0,7)); - QPtrListIterator<Attendee> qli(mAttendees); + Q3PtrListIterator<Attendee> qli(mAttendees); qli.toFirst(); while (qli) { @@ -343,7 +345,7 @@ void IncidenceBase::clearAttendees() #if 0 Attendee *IncidenceBase::getAttendee(const char *n) const { - QPtrListIterator<Attendee> qli(mAttendees); + Q3PtrListIterator<Attendee> qli(mAttendees); qli.toFirst(); while (qli) { @@ -357,7 +359,7 @@ Attendee *IncidenceBase::getAttendee(const char *n) const Attendee *IncidenceBase::attendeeByMail(const QString &email) { - QPtrListIterator<Attendee> qli(mAttendees); + Q3PtrListIterator<Attendee> qli(mAttendees); qli.toFirst(); while (qli) { @@ -370,7 +372,7 @@ Attendee *IncidenceBase::attendeeByMail(const QString &email) Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email) { - QPtrListIterator<Attendee> qli(mAttendees); + Q3PtrListIterator<Attendee> qli(mAttendees); QStringList mails = emails; if (!email.isEmpty()) { @@ -491,7 +493,7 @@ void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer ) void IncidenceBase::updated() { - QPtrListIterator<Observer> it(mObservers); + Q3PtrListIterator<Observer> it(mObservers); while( it.current() ) { Observer *o = it.current(); ++it; diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index 3edc03b..d97f524 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h @@ -25,15 +25,17 @@ #include <qdatetime.h> #include <qstringlist.h> -#include <qvaluelist.h> -#include <qptrlist.h> +#include <q3valuelist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <Q3CString> #include "customproperties.h" #include "attendee.h" namespace KCal { -typedef QValueList<QDate> DateList; +typedef Q3ValueList<QDate> DateList; enum IncTypeID { eventID,todoID,journalID,freebusyID }; /** @@ -51,7 +53,7 @@ class IncidenceBase : public CustomProperties IncidenceBase(const IncidenceBase &); virtual ~IncidenceBase(); - virtual QCString type() const = 0; + virtual Q3CString type() const = 0; virtual IncTypeID typeID() const = 0; /** Set the unique id for the event */ @@ -109,7 +111,7 @@ class IncidenceBase : public CustomProperties /** Remove all Attendees. */ void clearAttendees(); /** Return list of attendees. */ - QPtrList<Attendee> attendees() const { return mAttendees; }; + Q3PtrList<Attendee> attendees() const { return mAttendees; }; /** Return number of attendees. */ int attendeeCount() const { return mAttendees.count(); }; /** Return the Attendee with this email */ @@ -168,7 +170,7 @@ class IncidenceBase : public CustomProperties bool mCalEnabled; bool mAlarmEnabled; QDateTime mLastModified; - QPtrList<Attendee> mAttendees; + Q3PtrList<Attendee> mAttendees; bool mFloats; @@ -181,7 +183,7 @@ class IncidenceBase : public CustomProperties int mPilotId; // unique id for pilot sync int mSyncStatus; // status (for sync) - QPtrList<Observer> mObservers; + Q3PtrList<Observer> mObservers; }; bool operator==( const IncidenceBase&, const IncidenceBase& ); diff --git a/libkcal/journal.h b/libkcal/journal.h index 1cd0a22..c83356f 100644 --- a/libkcal/journal.h +++ b/libkcal/journal.h @@ -24,6 +24,8 @@ // #include "incidence.h" +//Added by qt3to4: +#include <Q3CString> namespace KCal { @@ -36,7 +38,7 @@ class Journal : public Incidence Journal(); ~Journal(); - QCString type() const { return "Journal"; } + Q3CString type() const { return "Journal"; } IncTypeID typeID() const { return journalID; } Incidence *clone(); diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index 733b897..bce68b0 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp @@ -4,6 +4,8 @@ #include <klocale.h> #ifdef DEKTOP_VERSION #include <kabc/stdaddressbook.h> +//Added by qt3to4: +#include <Q3PtrList> #define size count #endif @@ -310,7 +312,7 @@ void KIncidenceFormatter::formatCategories(Incidence *event) } void KIncidenceFormatter::addTag(const QString & tag,const QString & text) { - int number=text.contains("\n"); + int number=text.count("\n"); QString str = "<" + tag + ">"; QString tmpText=text; QString tmpStr=str; @@ -339,7 +341,7 @@ void KIncidenceFormatter::addTag(const QString & tag,const QString & text) void KIncidenceFormatter::formatAttendees(Incidence *event) { - QPtrList<Attendee> attendees = event->attendees(); + Q3PtrList<Attendee> attendees = event->attendees(); if (attendees.count()) { QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); @@ -362,7 +364,7 @@ void KIncidenceFormatter::formatAttendees(Incidence *event) #else mText.append(event->organizer()); #endif - if (iconPath) { + if (!iconPath.isEmpty()) { mText += " <a href=\"mailto:" + event->organizer() + "\">"; mText += "<IMG src=\"" + iconPath + "\">"; mText += "</a>\n"; @@ -402,7 +404,7 @@ void KIncidenceFormatter::formatAttendees(Incidence *event) #endif if (!a->email().isEmpty()) { - if (iconPath) { + if (!iconPath.isEmpty()) { mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">"; if ( a->RSVP() ) mText += "<IMG src=\"" + iconPath + "\">"; diff --git a/libkcal/libkcal.pro b/libkcal/libkcal.pro index 33c63c3..1f43b10 100644 --- a/libkcal/libkcal.pro +++ b/libkcal/libkcal.pro @@ -1,6 +1,6 @@ TEMPLATE = lib CONFIG += qt warn_on -TARGET = microkcal +TARGET = xmicrokcal include( ../variables.pri ) @@ -106,3 +106,7 @@ dndfactory.cpp \ versit/vobject.c \ phoneformat.cpp \ +#The following line was inserted by qt3to4 +QT += xml qt3support +#The following line was inserted by qt3to4 +QT += diff --git a/libkcal/libkcalE.pro b/libkcal/libkcalE.pro index 737be53..fe46656 100644 --- a/libkcal/libkcalE.pro +++ b/libkcal/libkcalE.pro @@ -1,6 +1,6 @@ TEMPLATE = lib CONFIG += qt warn_on -TARGET = microkcal +TARGET = xmicrokcal INCLUDEPATH += ../libkdepim ../microkde ../qtcompat versit ../microkde/kdecore $(QPEDIR)/include INCLUDEPATH += ../libical/src/libical diff --git a/libkcal/listbase.h b/libkcal/listbase.h index 085b13d..6c942ef 100644 --- a/libkcal/listbase.h +++ b/libkcal/listbase.h @@ -21,7 +21,9 @@ #ifndef KCAL_LISTBASE_H #define KCAL_LISTBASE_H -#include <qvaluelist.h> +#include <q3valuelist.h> +//Added by qt3to4: +#include <Q3PtrList> namespace KCal { class Event; @@ -31,24 +33,24 @@ namespace KCal { *> by auto delete funtionality known from QPtrList. */ template<class T> -class ListBase : public QValueList<T *> +class ListBase : public Q3ValueList<T *> { public: ListBase() - : QValueList<T *>(), mAutoDelete( false ) + : Q3ValueList<T *>(), mAutoDelete( false ) { } ListBase( const ListBase &l ) - : QValueList<T *>( l ), mAutoDelete( false ) + : Q3ValueList<T *>( l ), mAutoDelete( false ) { } ~ListBase() { if ( mAutoDelete ) { - QValueListIterator<T *> it; - for( it = QValueList<T*>::begin(); it != QValueList<T*>::end(); ++it ) { + Q3ValueListIterator<T *> it; + for( it = Q3ValueList<T*>::begin(); it != Q3ValueList<T*>::end(); ++it ) { delete *it; } } @@ -57,7 +59,7 @@ class ListBase : public QValueList<T *> ListBase &operator=( const ListBase &l ) { if ( this == &l ) return *this; - QValueList<T *>::operator=( l ); + Q3ValueList<T *>::operator=( l ); return *this; } @@ -68,8 +70,8 @@ class ListBase : public QValueList<T *> bool removeRef( T *t ) { - QValueListIterator<T *> it = find( t ); - if ( it == QValueList<T*>::end() ) { + Q3ValueListIterator<T *> it = find( t ); + if ( it == Q3ValueList<T*>::end() ) { return false; } else { if ( mAutoDelete ) delete t; @@ -77,8 +79,8 @@ class ListBase : public QValueList<T *> return true; } } - void fill ( QPtrList<T> list ) { - QPtrListIterator<T> it (list); + void fill ( Q3PtrList<T> list ) { + Q3PtrListIterator<T> it (list); T *item; while ( (item = it.current()) != 0 ) { append( item ); diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 900fc04..794e4b4 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp @@ -22,15 +22,16 @@ #include <qdatetime.h> #include <qstring.h> #include <qapplication.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qregexp.h> #include <qmessagebox.h> #include <qclipboard.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <qdir.h> #include <qlabel.h> +#include <QDesktopWidget> #include <kdebug.h> #include <klocale.h> @@ -201,7 +202,7 @@ ulong PhoneFormat::getCsumEvent( Event* event ) writeEndDate = true; { int count = 1; - QPtrList<Recurrence::rMonthPos> rmp; + Q3PtrList<Recurrence::rMonthPos> rmp; rmp = rec->monthPositions(); if ( rmp.first()->negative ) count = 5 - rmp.first()->rPos - 1; @@ -241,7 +242,7 @@ ulong PhoneFormat::getCsumEvent( Event* event ) if ( rec->endDate().isValid() ) { // 15 + 16 list.append( "1" ); - list.append( PhoneParser::dtToString( rec->endDate()) ); + list.append( PhoneParser::dtToString( (QDateTime)rec->endDate()) ); } else { list.append( "0" ); list.append( "20991231T000000" ); @@ -305,7 +306,7 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) if ( ! vfload.load( calendar, fileName ) ) return false; - QPtrList<Event> er = calendar->rawEvents(); + Q3PtrList<Event> er = calendar->rawEvents(); Event* ev = er.first(); qDebug("reading events... "); while ( ev ) { @@ -340,7 +341,7 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) } { qDebug("reading todos... "); - QPtrList<Todo> tr = calendar->rawTodos(); + Q3PtrList<Todo> tr = calendar->rawTodos(); Todo* ev = tr.first(); while ( ev ) { @@ -465,7 +466,7 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from ) to->setPriority(from->priority()); } -#include <qcstring.h> +#include <q3cstring.h> void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum) { @@ -497,7 +498,7 @@ bool PhoneFormat::save( Calendar *calendar) // 1 remove events which should be deleted - QPtrList<Event> er = calendar->rawEvents(); + Q3PtrList<Event> er = calendar->rawEvents(); Event* ev = er.first(); while ( ev ) { if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { @@ -508,7 +509,7 @@ bool PhoneFormat::save( Calendar *calendar) ev = er.next(); } // 2 remove todos which should be deleted - QPtrList<Todo> tl = calendar->rawTodos(); + Q3PtrList<Todo> tl = calendar->rawTodos(); Todo* to = tl.first(); while ( to ) { if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { @@ -552,7 +553,7 @@ bool PhoneFormat::save( Calendar *calendar) er = calendar->rawEvents(); ev = er.first(); message = i18n(" Comparing event # "); - QPtrList<Event> er1 = calendarTemp->rawEvents(); + Q3PtrList<Event> er1 = calendarTemp->rawEvents(); Event* ev1; int procCount = 0; while ( ev ) { @@ -580,7 +581,7 @@ bool PhoneFormat::save( Calendar *calendar) tl = calendar->rawTodos(); to = tl.first(); procCount = 0; - QPtrList<Todo> tl1 = calendarTemp->rawTodos(); + Q3PtrList<Todo> tl1 = calendarTemp->rawTodos(); Todo* to1 ; message = i18n(" Comparing todo # "); while ( to ) { diff --git a/libkcal/qtopiaformat.cpp b/libkcal/qtopiaformat.cpp index 0a4a031..2dfe1a4 100644 --- a/libkcal/qtopiaformat.cpp +++ b/libkcal/qtopiaformat.cpp @@ -21,11 +21,11 @@ #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qregexp.h> #include <qclipboard.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qxml.h> #include <kdebug.h> @@ -309,12 +309,12 @@ bool QtopiaFormat::save( Calendar *calendar, const QString &fileName ) // TODO: write backup file QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { setException(new ErrorFormat(ErrorFormat::SaveError, i18n("Could not open file '%1'").arg(fileName))); return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts << text; file.close(); diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp index 6ee5499..9a4e540 100644 --- a/libkcal/recurrence.cpp +++ b/libkcal/recurrence.cpp @@ -29,6 +29,9 @@ #include "incidence.h" #include "recurrence.h" +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3PtrList> using namespace KCal; @@ -56,7 +59,7 @@ Recurrence::Recurrence(Incidence *parent, int compatVersion) Recurrence::Recurrence(const Recurrence &r, Incidence *parent) : recurs(r.recurs), rWeekStart(r.rWeekStart), - rDays(r.rDays.copy()), + rDays(r.rDays), rFreq(r.rFreq), rDuration(r.rDuration), rEndDateTime(r.rEndDateTime), @@ -70,19 +73,19 @@ Recurrence::Recurrence(const Recurrence &r, Incidence *parent) mCompatDuration(r.mCompatDuration), mParent(parent) { - for (QPtrListIterator<rMonthPos> mp(r.rMonthPositions); mp.current(); ++mp) { + for (Q3PtrListIterator<rMonthPos> mp(r.rMonthPositions); mp.current(); ++mp) { rMonthPos *tmp = new rMonthPos; tmp->rPos = mp.current()->rPos; tmp->negative = mp.current()->negative; - tmp->rDays = mp.current()->rDays.copy(); + tmp->rDays = mp.current()->rDays; rMonthPositions.append(tmp); } - for (QPtrListIterator<int> md(r.rMonthDays); md.current(); ++md) { + for (Q3PtrListIterator<int> md(r.rMonthDays); md.current(); ++md) { int *tmp = new int; *tmp = *md.current(); rMonthDays.append(tmp); } - for (QPtrListIterator<int> yn(r.rYearNums); yn.current(); ++yn) { + for (Q3PtrListIterator<int> yn(r.rYearNums); yn.current(); ++yn) { int *tmp = new int; *tmp = *yn.current(); rYearNums.append(tmp); @@ -124,8 +127,8 @@ bool Recurrence::operator==( const Recurrence& r2 ) const return rDays == r2.rDays && rWeekStart == r2.rWeekStart; case rMonthlyPos: { - QPtrList<rMonthPos> MonthPositions = rMonthPositions; - QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; + Q3PtrList<rMonthPos> MonthPositions = rMonthPositions; + Q3PtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; if ( !MonthPositions.count() ) return false; if ( !MonthPositions2.count() ) @@ -133,8 +136,8 @@ bool Recurrence::operator==( const Recurrence& r2 ) const return MonthPositions.first()->rPos == MonthPositions2.first()->rPos; } case rMonthlyDay: { - QPtrList<int> MonthDays = rMonthDays ; - QPtrList<int> MonthDays2 = r2.rMonthDays ; + Q3PtrList<int> MonthDays = rMonthDays ; + Q3PtrList<int> MonthDays2 = r2.rMonthDays ; if ( !MonthDays.count() ) return false; if ( !MonthDays2.count() ) @@ -143,12 +146,12 @@ bool Recurrence::operator==( const Recurrence& r2 ) const } case rYearlyPos: { - QPtrList<int> YearNums = rYearNums; - QPtrList<int> YearNums2 = r2.rYearNums; + Q3PtrList<int> YearNums = rYearNums; + Q3PtrList<int> YearNums2 = r2.rYearNums; if ( *YearNums.first() != *YearNums2.first() ) return false; - QPtrList<rMonthPos> MonthPositions = rMonthPositions; - QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; + Q3PtrList<rMonthPos> MonthPositions = rMonthPositions; + Q3PtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; if ( !MonthPositions.count() ) return false; if ( !MonthPositions2.count() ) @@ -157,13 +160,13 @@ bool Recurrence::operator==( const Recurrence& r2 ) const } case rYearlyMonth: { - QPtrList<int> YearNums = rYearNums; - QPtrList<int> YearNums2 = r2.rYearNums; + Q3PtrList<int> YearNums = rYearNums; + Q3PtrList<int> YearNums2 = r2.rYearNums; return ( *YearNums.first() == *YearNums2.first() && mFeb29YearlyType == r2.mFeb29YearlyType); } case rYearlyDay: { - QPtrList<int> YearNums = rYearNums; - QPtrList<int> YearNums2 = r2.rYearNums; + Q3PtrList<int> YearNums = rYearNums; + Q3PtrList<int> YearNums2 = r2.rYearNums; return ( *YearNums.first() == *YearNums2.first() ); } case rNone: @@ -357,7 +360,7 @@ QDateTime Recurrence::endDateTime() const case rHourly: return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*3600); case rDaily: - return dStart.addDays((rDuration-1+mRecurExDatesCount)*rFreq); + return (QDateTime)dStart.addDays((rDuration-1+mRecurExDatesCount)*rFreq); case rWeekly: count = weeklyCalc(END_DATE_AND_COUNT, end); @@ -506,17 +509,17 @@ const QBitArray &Recurrence::days() const return rDays; } -const QPtrList<Recurrence::rMonthPos> &Recurrence::monthPositions() const +const Q3PtrList<Recurrence::rMonthPos> &Recurrence::monthPositions() const { return rMonthPositions; } -const QPtrList<Recurrence::rMonthPos> &Recurrence::yearMonthPositions() const +const Q3PtrList<Recurrence::rMonthPos> &Recurrence::yearMonthPositions() const { return rMonthPositions; } -const QPtrList<int> &Recurrence::monthDays() const +const Q3PtrList<int> &Recurrence::monthDays() const { return rMonthDays; } @@ -759,7 +762,7 @@ void Recurrence::addYearlyMonthPos(short _rPos, const QBitArray &_rDays) addMonthlyPos_(_rPos, _rDays); } -const QPtrList<int> &Recurrence::yearNums() const +const Q3PtrList<int> &Recurrence::yearNums() const { return rYearNums; } @@ -1047,13 +1050,13 @@ bool Recurrence::recursMonthly(const QDate &qd) const (rDuration == 0 && qd <= rEndDateTime.date()) || rDuration == -1)) { // The date queried falls within the range of the event. - QValueList<int> days; + Q3ValueList<int> days; int daysInMonth = qd.daysInMonth(); if (recurs == rMonthlyDay) getMonthlyDayDays(days, daysInMonth); else if (recurs == rMonthlyPos) getMonthlyPosDays(days, daysInMonth, QDate(year, month, 1).dayOfWeek()); - for (QValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) { + for (Q3ValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) { if (*it == day) return true; } @@ -1101,7 +1104,7 @@ bool Recurrence::recursYearlyByMonth(const QDate &qd) const rDuration == -1)) { // The date queried falls within the range of the event. int i = qmonth; - for (QPtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { + for (Q3PtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { if (i == *qlin.current()) return true; } @@ -1127,12 +1130,12 @@ bool Recurrence::recursYearlyByPos(const QDate &qd) const (rDuration == 0 && qd <= rEndDateTime.date()) || rDuration == -1)) { // The date queried falls within the range of the event. - for (QPtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { + for (Q3PtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { if (month == *qlin.current()) { // The month recurs - QValueList<int> days; + Q3ValueList<int> days; getMonthlyPosDays(days, qd.daysInMonth(), QDate(year, month, 1).dayOfWeek()); - for (QValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) { + for (Q3ValueList<int>::Iterator it = days.begin(); it != days.end(); ++it) { if (*it == day) return true; } @@ -1157,7 +1160,7 @@ bool Recurrence::recursYearlyByDay(const QDate &qd) const rDuration == -1)) { // The date queried falls within the range of the event. int i = qd.dayOfYear(); - for (QPtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { + for (Q3PtrListIterator<int> qlin(rYearNums); qlin.current(); ++qlin) { if (i == *qlin.current()) return true; } @@ -1549,7 +1552,7 @@ int Recurrence::recurCalc(PeriodFunc func, QDate &enddate) const case END_DATE_AND_COUNT: case NEXT_AFTER_DATE: if (count == 0) - endtime = QDate(); + endtime = QDateTime(); else if (timed) enddate = endtime.date(); break; @@ -1793,8 +1796,8 @@ struct Recurrence::MonthlyData { int day; // current day of month 1..31 bool varies; // true if recurring days vary between different months private: - QValueList<int> days28, days29, days30, days31; // recurring days in months of each length - QValueList<int> *recurDays[4]; + Q3ValueList<int> days28, days29, days30, days31; // recurring days in months of each length + Q3ValueList<int> *recurDays[4]; public: MonthlyData(const Recurrence* r, const QDate &date) : recurrence(r), year(date.year()), month(date.month()-1), day(date.day()) @@ -1805,12 +1808,12 @@ struct Recurrence::MonthlyData { varies = (recurrence->recurs == rMonthlyPos) ? true : recurrence->getMonthlyDayDays(days31, 31); } - const QValueList<int>* dayList() const { + const Q3ValueList<int>* dayList() const { if (!varies) return &days31; QDate startOfMonth(year, month + 1, 1); int daysInMonth = startOfMonth.daysInMonth(); - QValueList<int>* days = recurDays[daysInMonth - 28]; + Q3ValueList<int>* days = recurDays[daysInMonth - 28]; if (recurrence->recurs == rMonthlyPos) recurrence->getMonthlyPosDays(*days, daysInMonth, startOfMonth.dayOfWeek()); else if (days->isEmpty()) @@ -1844,8 +1847,8 @@ int Recurrence::monthlyCalcEndDate(QDate &enddate, MonthlyData &data) const { uint countTogo = rDuration + mRecurExDatesCount; int countGone = 0; - QValueList<int>::ConstIterator it; - const QValueList<int>* days = data.dayList(); + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* days = data.dayList(); if (data.day > 1) { // Check what remains of the start month @@ -1910,8 +1913,8 @@ int Recurrence::monthlyCalcToDate(const QDate &enddate, MonthlyData &data) const int endMonth = enddate.month() - 1; // zero-based int endDay = enddate.day(); int endYearMonth = endYear*12 + endMonth; - QValueList<int>::ConstIterator it; - const QValueList<int>* days = data.dayList(); + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* days = data.dayList(); if (data.day > 1) { // Check what remains of the start month @@ -1969,8 +1972,8 @@ int Recurrence::monthlyCalcNextAfter(QDate &enddate, MonthlyData &data) const int endYear = enddate.year(); int endDay = enddate.day(); int endYearMonth = endYear*12 + enddate.month() - 1; - QValueList<int>::ConstIterator it; - const QValueList<int>* days = data.dayList(); + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* days = data.dayList(); if (data.day > 1) { // Check what remains of the start month @@ -2052,17 +2055,17 @@ struct Recurrence::YearlyMonthData { bool leapyear; // true if February 29th recurs and current year is a leap year bool feb29; // true if February 29th recurs private: - QValueList<int> months; // recurring months in non-leap years 1..12 - QValueList<int> leapMonths; // recurring months in leap years 1..12 + Q3ValueList<int> months; // recurring months in non-leap years 1..12 + Q3ValueList<int> leapMonths; // recurring months in leap years 1..12 public: YearlyMonthData(const Recurrence* r, const QDate &date) : recurrence(r), year(date.year()), month(date.month()), day(date.day()) { feb29 = recurrence->getYearlyMonthMonths(day, months, leapMonths); leapyear = feb29 && QDate::leapYear(year); } - const QValueList<int>* monthList() const + const Q3ValueList<int>* monthList() const { return leapyear ? &leapMonths : &months; } - const QValueList<int>* leapMonthList() const { return &leapMonths; } + const Q3ValueList<int>* leapMonthList() const { return &leapMonths; } QDate date() const { return QDate(year, month, day); } }; @@ -2088,8 +2091,8 @@ int Recurrence::yearlyMonthCalcEndDate(QDate &enddate, YearlyMonthData &data) co { uint countTogo = rDuration + mRecurExDatesCount; int countGone = 0; - QValueList<int>::ConstIterator it; - const QValueList<int>* mons = data.monthList(); // get recurring months for this year + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* mons = data.monthList(); // get recurring months for this year if (data.month > 1) { // Check what remains of the start year @@ -2199,8 +2202,8 @@ int Recurrence::yearlyMonthCalcToDate(const QDate &enddate, YearlyMonthData &dat --endYear; } } - QValueList<int>::ConstIterator it; - const QValueList<int>* mons = data.monthList(); + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* mons = data.monthList(); if (data.month > 1) { // Check what remains of the start year @@ -2270,8 +2273,8 @@ int Recurrence::yearlyMonthCalcNextAfter(QDate &enddate, YearlyMonthData &data) --endYear; } } - QValueList<int>::ConstIterator it; - const QValueList<int>* mons = data.monthList(); + Q3ValueList<int>::ConstIterator it; + const Q3ValueList<int>* mons = data.monthList(); if (data.month > 1) { // Check what remains of the start year @@ -2390,7 +2393,7 @@ struct Recurrence::YearlyPosData { int count; // number of days which recur each year, or -1 if variable bool varies; // true if number of days varies from year to year private: - mutable QValueList<int> days; + mutable Q3ValueList<int> days; public: YearlyPosData(const Recurrence* r, const QDate &date) : recurrence(r), year(date.year()), month(date.month()), day(date.day()), count(-1) @@ -2398,7 +2401,7 @@ struct Recurrence::YearlyPosData { count = daysPerMonth * r->rYearNums.count(); varies = (daysPerMonth < 0); } - const QValueList<int>* dayList() const { + const Q3ValueList<int>* dayList() const { QDate startOfMonth(year, month, 1); recurrence->getMonthlyPosDays(days, startOfMonth.daysInMonth(), startOfMonth.dayOfWeek()); return &days; @@ -2428,12 +2431,12 @@ int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const { uint countTogo = rDuration + mRecurExDatesCount; int countGone = 0; - QValueList<int>::ConstIterator id; - const QValueList<int>* days; + Q3ValueList<int>::ConstIterator id; + const Q3ValueList<int>* days; if (data.month > 1 || data.day > 1) { // Check what remains of the start year - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { if (*im.current() >= data.month) { // Check what remains of the start month if (data.day > 1 || data.varies @@ -2466,7 +2469,7 @@ int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const if (data.varies) { // The number of recurrences varies from year to year. for ( ; ; ) { - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { data.month = *im.current(); days = data.dayList(); int n = days->count(); @@ -2496,7 +2499,7 @@ int Recurrence::yearlyPosCalcEndDate(QDate &enddate, YearlyPosData &data) const countTogo -= wholeYears * data.count; // Check the last year in the recurrence. - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { if (static_cast<uint>(data.daysPerMonth) >= countTogo) { // Check the last month in the recurrence data.month = *im.current(); @@ -2531,12 +2534,12 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c --endYear; } int endYearMonth = endYear*12 + endMonth; - QValueList<int>::ConstIterator id; - const QValueList<int>* days; + Q3ValueList<int>::ConstIterator id; + const Q3ValueList<int>* days; if (data.month > 1 || data.day > 1) { // Check what remains of the start year - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { if (*im.current() >= data.month) { data.month = *im.current(); if (data.yearMonth() > endYearMonth) @@ -2576,7 +2579,7 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c if (data.varies) { // The number of recurrences varies from year to year. for ( ; ; ) { - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { data.month = *im.current(); days = data.dayList(); if (data.yearMonth() >= endYearMonth) { @@ -2611,7 +2614,7 @@ int Recurrence::yearlyPosCalcToDate(const QDate &enddate, YearlyPosData &data) c data.year = endYear; // Check the last year in the recurrence. - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { data.month = *im.current(); if (data.month >= endMonth) { if (data.month > endMonth) @@ -2646,14 +2649,14 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons --endYear; } int endYearMonth = endYear*12 + endMonth; - QValueList<int>::ConstIterator id; - const QValueList<int>* days; + Q3ValueList<int>::ConstIterator id; + const Q3ValueList<int>* days; if (data.varies) { // The number of recurrences varies from year to year. for ( ; ; ) { // Check the next year - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { if (*im.current() >= data.month) { // Check the next month data.month = *im.current(); @@ -2689,7 +2692,7 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons // The number of recurrences is the same every year. if (data.month > 1 || data.day > 1) { // Check what remains of the start year - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { if (*im.current() >= data.month) { // Check what remains of the start month data.month = *im.current(); @@ -2734,7 +2737,7 @@ int Recurrence::yearlyPosCalcNextAfter(QDate &enddate, YearlyPosData &data) cons } // Check the last year in the recurrence - for (QPtrListIterator<int> im(rYearNums); im.current(); ++im) { + for (Q3PtrListIterator<int> im(rYearNums); im.current(); ++im) { data.month = *im.current(); int ended = data.yearMonth() - endYearMonth; if (ended >= 0) { @@ -2808,7 +2811,7 @@ int Recurrence::yearlyDayCalcEndDate(QDate &enddate, YearlyDayData &data) const if (data.day > 1) { // Check what remains of the start year bool leapOK = data.isMaxDayCount(); - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { int d = *it.current(); if (d >= data.day && (leapOK || d < 366)) { ++countGone; @@ -2846,7 +2849,7 @@ int Recurrence::yearlyDayCalcEndDate(QDate &enddate, YearlyDayData &data) const } if (countTogo) { // Check the last year in the recurrence - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { ++countGone; if (--countTogo == 0) { data.day = *it.current(); @@ -2869,7 +2872,7 @@ int Recurrence::yearlyDayCalcToDate(const QDate &enddate, YearlyDayData &data) c if (data.day > 1) { // Check what remains of the start year bool leapOK = data.isMaxDayCount(); - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { int d = *it.current(); if (d >= data.day && (leapOK || d < 366)) { if (data.year == endYear && d > endDay) @@ -2908,7 +2911,7 @@ int Recurrence::yearlyDayCalcToDate(const QDate &enddate, YearlyDayData &data) c if (data.year <= endYear) { // Check the last year in the recurrence - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { if (*it.current() > endDay) return countGone; if (++countGone >= countMax) @@ -2928,7 +2931,7 @@ int Recurrence::yearlyDayCalcNextAfter(QDate &enddate, YearlyDayData &data) cons if (data.day > 1) { // Check what remains of the start year bool leapOK = data.isMaxDayCount(); - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { int d = *it.current(); if (d >= data.day && (leapOK || d < 366)) { ++countGone; @@ -2977,7 +2980,7 @@ int Recurrence::yearlyDayCalcNextAfter(QDate &enddate, YearlyDayData &data) cons } // Check the last year in the recurrence - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { ++countGone; int d = *it.current(); if (data.year > endYear || d > endDay) { @@ -2995,13 +2998,13 @@ ex: // Get the days in this month which recur, in numerical order. // Parameters: daysInMonth = number of days in this month // startDayOfWeek = day of week for first day of month. -void Recurrence::getMonthlyPosDays(QValueList<int> &list, int daysInMonth, int startDayOfWeek) const +void Recurrence::getMonthlyPosDays(Q3ValueList<int> &list, int daysInMonth, int startDayOfWeek) const { list.clear(); int endDayOfWeek = (startDayOfWeek + daysInMonth - 2) % 7 + 1; // Go through the list, compiling a bit list of actual day numbers Q_UINT32 days = 0; - for (QPtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) { + for (Q3PtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) { int weeknum = pos.current()->rPos - 1; // get 0-based week number QBitArray &rdays = pos.current()->rDays; if (pos.current()->negative) { @@ -3039,7 +3042,7 @@ int Recurrence::countMonthlyPosDays() const int count = 0; Q_UINT8 positive[5] = { 0, 0, 0, 0, 0 }; Q_UINT8 negative[4] = { 0, 0, 0, 0 }; - for (QPtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) { + for (Q3PtrListIterator<rMonthPos> pos(rMonthPositions); pos.current(); ++pos) { int weeknum = pos.current()->rPos; Q_UINT8* wk; if (pos.current()->negative) { @@ -3072,12 +3075,12 @@ int Recurrence::countMonthlyPosDays() const // Get the days in this month which recur, in numerical order. // Reply = true if day numbers varies from month to month. -bool Recurrence::getMonthlyDayDays(QValueList<int> &list, int daysInMonth) const +bool Recurrence::getMonthlyDayDays(Q3ValueList<int> &list, int daysInMonth) const { list.clear(); bool variable = false; Q_UINT32 days = 0; - for (QPtrListIterator<int> it(rMonthDays); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rMonthDays); it.current(); ++it) { int day = *it.current(); if (day > 0) { // date in the month @@ -3106,12 +3109,12 @@ bool Recurrence::getMonthlyDayDays(QValueList<int> &list, int daysInMonth) const // N.B. If February 29th recurs on March 1st in non-leap years, February (not March) is // included in the non-leap year month list. // Reply = true if February 29th also recurs. -bool Recurrence::getYearlyMonthMonths(int day, QValueList<int> &list, QValueList<int> &leaplist) const +bool Recurrence::getYearlyMonthMonths(int day, Q3ValueList<int> &list, Q3ValueList<int> &leaplist) const { list.clear(); leaplist.clear(); bool feb29 = false; - for (QPtrListIterator<int> it(rYearNums); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rYearNums); it.current(); ++it) { int month = *it.current(); if (month == 2) { if (day <= 28) { @@ -3187,7 +3190,7 @@ QDate Recurrence::getFirstDateInMonth(const QDate &earliestDate) const switch (recurs) { case rMonthlyDay: { int minday = daysInMonth + 1; - for (QPtrListIterator<int> it(rMonthDays); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rMonthDays); it.current(); ++it) { int day = *it.current(); if (day < 0) day = daysInMonth + day + 1; @@ -3201,9 +3204,9 @@ QDate Recurrence::getFirstDateInMonth(const QDate &earliestDate) const case rMonthlyPos: case rYearlyPos: { QDate monthBegin(earliestDate.addDays(1 - earliestDay)); - QValueList<int> dayList; + Q3ValueList<int> dayList; getMonthlyPosDays(dayList, daysInMonth, monthBegin.dayOfWeek()); - for (QValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) { + for (Q3ValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) { if (*id >= earliestDay) return monthBegin.addDays(*id - 1); } @@ -3224,7 +3227,7 @@ QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const switch (recurs) { case rMonthlyDay: { int maxday = -1; - for (QPtrListIterator<int> it(rMonthDays); it.current(); ++it) { + for (Q3PtrListIterator<int> it(rMonthDays); it.current(); ++it) { int day = *it.current(); if (day < 0) day = daysInMonth + day + 1; @@ -3238,9 +3241,9 @@ QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const case rMonthlyPos: case rYearlyPos: { QDate monthBegin(latestDate.addDays(1 - latestDay)); - QValueList<int> dayList; + Q3ValueList<int> dayList; getMonthlyPosDays(dayList, daysInMonth, monthBegin.dayOfWeek()); - for (QValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) { + for (Q3ValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) { if (*id <= latestDay) return monthBegin.addDays(*id - 1); } @@ -3256,7 +3259,7 @@ QDate Recurrence::getLastDateInMonth(const QDate &latestDate) const */ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const { - QPtrListIterator<int> it(rYearNums); + Q3PtrListIterator<int> it(rYearNums); switch (recurs) { case rYearlyMonth: { int day = recurStart().date().day(); @@ -3292,7 +3295,7 @@ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const break; } case rYearlyPos: { - QValueList<int> dayList; + Q3ValueList<int> dayList; int earliestYear = earliestDate.year(); int earliestMonth = earliestDate.month(); int earliestDay = earliestDate.day(); @@ -3301,7 +3304,7 @@ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const if (month >= earliestMonth) { QDate monthBegin(earliestYear, month, 1); getMonthlyPosDays(dayList, monthBegin.daysInMonth(), monthBegin.dayOfWeek()); - for (QValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) { + for (Q3ValueList<int>::ConstIterator id = dayList.begin(); id != dayList.end(); ++id) { if (*id >= earliestDay) return monthBegin.addDays(*id - 1); } @@ -3329,7 +3332,7 @@ QDate Recurrence::getFirstDateInYear(const QDate &earliestDate) const */ QDate Recurrence::getLastDateInYear(const QDate &latestDate) const { - QPtrListIterator<int> it(rYearNums); + Q3PtrListIterator<int> it(rYearNums); switch (recurs) { case rYearlyMonth: { int day = recurStart().date().day(); @@ -3364,7 +3367,7 @@ QDate Recurrence::getLastDateInYear(const QDate &latestDate) const break; } case rYearlyPos: { - QValueList<int> dayList; + Q3ValueList<int> dayList; int latestYear = latestDate.year(); int latestMonth = latestDate.month(); int latestDay = latestDate.day(); @@ -3373,7 +3376,7 @@ QDate Recurrence::getLastDateInYear(const QDate &latestDate) const if (month <= latestMonth) { QDate monthBegin(latestYear, month, 1); getMonthlyPosDays(dayList, monthBegin.daysInMonth(), monthBegin.dayOfWeek()); - for (QValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) { + for (Q3ValueList<int>::ConstIterator id = dayList.fromLast(); id != dayList.end(); --id) { if (*id <= latestDay) return monthBegin.addDays(*id - 1); } diff --git a/libkcal/recurrence.h b/libkcal/recurrence.h index b13d14f..5b5aab1 100644 --- a/libkcal/recurrence.h +++ b/libkcal/recurrence.h @@ -24,7 +24,9 @@ #include <qstring.h> #include <qbitarray.h> -#include <qptrlist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <Q3ValueList> namespace KCal { @@ -248,9 +250,9 @@ class Recurrence */ void addMonthlyDay(short _rDay); /** Returns list of day positions in months. */ - const QPtrList<rMonthPos> &monthPositions() const; + const Q3PtrList<rMonthPos> &monthPositions() const; /** Returns list of day numbers of a month. */ - const QPtrList<int> &monthDays() const; + const Q3PtrList<int> &monthDays() const; /** Sets an event to recur yearly. * @var type rYearlyMonth, rYearlyPos or rYearlyDay @@ -279,9 +281,9 @@ class Recurrence */ void addYearlyMonthPos(short _rPos, const QBitArray &_rDays); /** Returns positions of days or months in year. */ - const QPtrList<int> &yearNums() const; + const Q3PtrList<int> &yearNums() const; /** Returns list of day positions in months, for a recursYearlyPos recurrence rule. */ - const QPtrList<rMonthPos> &yearMonthPositions() const; + const Q3PtrList<rMonthPos> &yearMonthPositions() const; /** Returns how yearly recurrences of February 29th are handled. */ Feb29Type feb29YearlyType() const { return mFeb29YearlyType; } /** Sets the default method for handling yearly recurrences of February 29th. */ @@ -294,8 +296,8 @@ class Recurrence */ void dump() const; QString recurrenceText() const; - bool getYearlyMonthMonths(int day, QValueList<int>&, - QValueList<int> &leaplist) const; + bool getYearlyMonthMonths(int day, Q3ValueList<int>&, + Q3ValueList<int> &leaplist) const; protected: enum PeriodFunc { END_DATE_AND_COUNT, COUNT_TO_DATE, NEXT_AFTER_DATE }; @@ -345,9 +347,9 @@ class Recurrence int yearlyDayCalcNextAfter(QDate& enddate, YearlyDayData&) const; int countMonthlyPosDays() const; - void getMonthlyPosDays(QValueList<int>&, int daysInMonth, + void getMonthlyPosDays(Q3ValueList<int>&, int daysInMonth, int startDayOfWeek) const; - bool getMonthlyDayDays(QValueList<int>&, int daysInMonth) const; + bool getMonthlyDayDays(Q3ValueList<int>&, int daysInMonth) const; int getFirstDayInWeek(int startDay, bool useWeekStart = true) const; int getLastDayInWeek(int endDay, bool useWeekStart = true) const; @@ -366,13 +368,13 @@ class Recurrence int rWeekStart; // day which starts the week, Monday=1 .. Sunday=7 QBitArray rDays; // array of days during week it recurs - QPtrList<rMonthPos> rMonthPositions; // list of positions during a month + Q3PtrList<rMonthPos> rMonthPositions; // list of positions during a month // on which an event recurs - QPtrList<int> rMonthDays; // list of days during a month on + Q3PtrList<int> rMonthDays; // list of days during a month on // which the event recurs - QPtrList<int> rYearNums; // either months/days to recur on for rYearly, + Q3PtrList<int> rYearNums; // either months/days to recur on for rYearly, // sorted in numerical order int rFreq; // frequency of period diff --git a/libkcal/scheduler.cpp b/libkcal/scheduler.cpp index 253d8b7..234cfcf 100644 --- a/libkcal/scheduler.cpp +++ b/libkcal/scheduler.cpp @@ -20,7 +20,9 @@ #include <qdir.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> +//Added by qt3to4: +#include <Q3PtrList> #include <klocale.h> #include <kdebug.h> @@ -264,8 +266,8 @@ bool Scheduler::acceptReply(IncidenceBase *incidence,ScheduleMessage::Status sta if (ev || to) { //get matching attendee in calendar kdDebug(5800) << "Scheduler::acceptTransaction match found!" << endl; - QPtrList<Attendee> attendeesIn = incidence->attendees(); - QPtrList<Attendee> attendeesEv; + Q3PtrList<Attendee> attendeesIn = incidence->attendees(); + Q3PtrList<Attendee> attendeesEv; if (ev) attendeesEv = ev->attendees(); if (to) attendeesEv = to->attendees(); Attendee *attIn; @@ -342,11 +344,11 @@ bool Scheduler::acceptFreeBusy(IncidenceBase *incidence, Method method) QString messageText = mFormat->createScheduleMessage(freebusy, Publish); - if (!f.open(IO_ReadWrite)) { + if (!f.open(QIODevice::ReadWrite)) { kdDebug() << "acceptFreeBusy: Can't open:" << filename << " for writing" << endl; return false; } - QTextStream t(&f); + Q3TextStream t(&f); t << messageText; f.close(); diff --git a/libkcal/scheduler.h b/libkcal/scheduler.h index a9f43b9..357e98e 100644 --- a/libkcal/scheduler.h +++ b/libkcal/scheduler.h @@ -23,7 +23,7 @@ // iTIP transactions base class #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> namespace KCal { @@ -95,7 +95,7 @@ class Scheduler { method. */ virtual bool performTransaction(IncidenceBase *incidence,Method method,const QString &recipients) = 0; /** Retrieve incoming iTIP transactions */ - virtual QPtrList<ScheduleMessage> retrieveTransactions() = 0; + virtual Q3PtrList<ScheduleMessage> retrieveTransactions() = 0; /** Accept transaction. The incidence argument specifies the iCal compoennt diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index 9b757f7..b8c2aa7 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp @@ -22,12 +22,12 @@ #include <qdatetime.h> #include <qstring.h> #include <qapplication.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qregexp.h> #include <qmessagebox.h> #include <qclipboard.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <qxml.h> #include <qlabel.h> @@ -366,11 +366,11 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal ) } QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); text = ts.read(); file.close(); @@ -388,7 +388,7 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal ) fileName = "/tmp/todo.txt"; } file.setName( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } @@ -475,7 +475,7 @@ bool SharpFormat::save( Calendar *calendar) QString ePrefix = "CARDID,CATEGORY,DSRP,PLCE,MEM1,TIM1,TIM2,ADAY,ARON,ARMN,ARSD,RTYP,RFRQ,RPOS,RDYS,REND,REDT,ALSD,ALED,MDAY\n"; QString tPrefix = "CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1\n"; QString command; - QPtrList<Event> er = calendar->rawEvents(); + Q3PtrList<Event> er = calendar->rawEvents(); Event* ev = er.first(); QString fileName = "/tmp/kopitempout"; int i = 0; @@ -503,10 +503,10 @@ bool SharpFormat::save( Calendar *calendar) else if ( ev->getID("Sharp_DTM").isEmpty() ) { // add new QString fileNameIn = "/tmp/kopitempin"; QFile fileIn( fileNameIn ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << ePrefix << eString ; fileIn.close(); @@ -517,11 +517,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("command -------- "); system ( command.utf8() ); QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); answer = ts.read(); file.close(); @@ -544,11 +544,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("changing... "); if ( changeEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << changeString ; file.close(); @@ -562,11 +562,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("deleting... "); if ( deleteEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << deleteString; file.close(); @@ -580,7 +580,7 @@ bool SharpFormat::save( Calendar *calendar) deleteString = tPrefix; status.setText ( i18n("Processing todos ...") ); qApp->processEvents(); - QPtrList<Todo> tl = calendar->rawTodos(); + Q3PtrList<Todo> tl = calendar->rawTodos(); Todo* to = tl.first(); i = 0; message = i18n("Processing todo # "); @@ -605,20 +605,20 @@ bool SharpFormat::save( Calendar *calendar) QString fileNameIn = "/tmp/kopitempin"; QFile fileIn( fileNameIn ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << tPrefix << eString ; fileIn.close(); command = "(cat /tmp/kopitempin | db2file todo -w -g -c " + codec+ ") > "+ fileName; system ( command.utf8() ); QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); answer = ts.read(); file.close(); @@ -642,11 +642,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("changing... "); if ( changeEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << changeString ; file.close(); @@ -660,11 +660,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("deleting... "); if ( deleteEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << deleteString; file.close(); @@ -783,7 +783,7 @@ QString SharpFormat::getEventString( Event* event ) writeEndDate = true; { int count = 1; - QPtrList<Recurrence::rMonthPos> rmp; + Q3PtrList<Recurrence::rMonthPos> rmp; rmp = rec->monthPositions(); if ( rmp.first()->negative ) count = 5 - rmp.first()->rPos - 1; diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index cc1c5ae..5a0c32e 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -623,7 +623,7 @@ QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_d // *ok = false; // return incidenceStart; // } - for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { + for (Q3PtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { if (alarm->enabled()) { if ( alarm->hasTime () ) { if ( alarm->time() < alarmStart ) { diff --git a/libkcal/todo.h b/libkcal/todo.h index 2131732..cea976c 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h @@ -26,6 +26,8 @@ #include "incidence.h" #include <qtimer.h> +//Added by qt3to4: +#include <Q3CString> namespace KCal { @@ -40,7 +42,7 @@ namespace KCal { Todo(const Todo &); ~Todo(); typedef ListBase<Todo> List; - QCString type() const { return "Todo"; } + Q3CString type() const { return "Todo"; } IncTypeID typeID() const { return todoID; } /** Return an exact copy of this todo. */ diff --git a/libkcal/vcaldrag.cpp b/libkcal/vcaldrag.cpp index f01f332..324981e 100644 --- a/libkcal/vcaldrag.cpp +++ b/libkcal/vcaldrag.cpp @@ -26,7 +26,7 @@ using namespace KCal; VCalDrag::VCalDrag( Calendar *cal, QWidget *parent, const char *name ) - : QStoredDrag( "text/x-vCalendar", parent, name ) + : Q3StoredDrag( "text/x-vCalendar", parent, name ) { VCalFormat format; setEncodedData( format.toString( cal ).utf8() ); diff --git a/libkcal/vcaldrag.h b/libkcal/vcaldrag.h index 3048124..68a320d 100644 --- a/libkcal/vcaldrag.h +++ b/libkcal/vcaldrag.h @@ -22,7 +22,7 @@ #ifndef VCALDRAG_H #define VCALDRAG_H -#include <qdragobject.h> +#include <q3dragobject.h> namespace KCal { @@ -30,7 +30,7 @@ namespace KCal { class Calendar; /** vCalendar drag&drop class. */ -class VCalDrag : public QStoredDrag { +class VCalDrag : public Q3StoredDrag { public: /** Create a drag&drop object for vCalendar component \a vcal. */ VCalDrag( Calendar *vcal, QWidget *parent = 0, const char *name = 0 ); diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp index 2e19740..9cbaf16 100644 --- a/libkcal/vcalformat.cpp +++ b/libkcal/vcalformat.cpp @@ -22,11 +22,13 @@ #include <qapplication.h> #include <qdatetime.h> #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qregexp.h> #include <qclipboard.h> #include <qdialog.h> #include <qfile.h> +//Added by qt3to4: +#include <Q3CString> #include <kdebug.h> #include <kglobal.h> @@ -108,15 +110,15 @@ bool VCalFormat::save(Calendar *calendar, const QString &fileName) addPropValue(vcal,VCVersionProp, _VCAL_VERSION); // TODO STUFF - QPtrList<Todo> todoList = mCalendar->rawTodos(); - QPtrListIterator<Todo> qlt(todoList); + Q3PtrList<Todo> todoList = mCalendar->rawTodos(); + Q3PtrListIterator<Todo> qlt(todoList); for (; qlt.current(); ++qlt) { vo = eventToVTodo(qlt.current()); addVObjectProp(vcal, vo); } // EVENT STUFF - QPtrList<Event> events = mCalendar->rawEvents(); + Q3PtrList<Event> events = mCalendar->rawEvents(); Event *ev; for(ev=events.first();ev;ev=events.next()) { vo = eventToVEvent(ev); @@ -138,7 +140,7 @@ bool VCalFormat::fromString( Calendar *calendar, const QString &text ) { // TODO: Factor out VCalFormat::fromString() - QCString data = text.utf8(); + Q3CString data = text.utf8(); if ( !data.size() ) return false; @@ -210,7 +212,7 @@ QString VCalFormat::toString( Calendar *calendar ) addPropValue( vcal, VCVersionProp, _VCAL_VERSION ); // TODO: Use all data. - QPtrList<Event> events = calendar->events(); + Q3PtrList<Event> events = calendar->events(); Event *event = events.first(); if ( !event ) return QString::null; @@ -271,8 +273,8 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) // attendees if (anEvent->attendeeCount() != 0) { - QPtrList<Attendee> al = anEvent->attendees(); - QPtrListIterator<Attendee> ai(al); + Q3PtrList<Attendee> al = anEvent->attendees(); + Q3PtrListIterator<Attendee> ai(al); Attendee *curAttendee; for (; ai.current(); ++ai) { @@ -326,7 +328,7 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) addPropValue(vtodo, VCPriorityProp, tmpStr.local8Bit()); // related event - if (anEvent->relatedToUid()) { + if (!anEvent->relatedToUid().isEmpty()) { addPropValue(vtodo, VCRelatedToProp, anEvent->relatedToUid().local8Bit()); } @@ -355,7 +357,7 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) // alarm stuff kdDebug(5800) << "vcalformat::eventToVTodo was called" << endl; - QPtrList<Alarm> alarms = anEvent->alarms(); + Q3PtrList<Alarm> alarms = anEvent->alarms(); Alarm* alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next()) { if (alarm->enabled()) { @@ -433,8 +435,8 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) addPropValue(vevent, ICOrganizerProp, tmpStr.local8Bit()); if (anEvent->attendeeCount() != 0) { - QPtrList<Attendee> al = anEvent->attendees(); - QPtrListIterator<Attendee> ai(al); + Q3PtrList<Attendee> al = anEvent->attendees(); + Q3PtrListIterator<Attendee> ai(al); Attendee *curAttendee; // TODO: Put this functionality into Attendee class @@ -461,8 +463,8 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) // recurrence rule stuff if (anEvent->doesRecur()) { // some more variables - QPtrList<Recurrence::rMonthPos> tmpPositions; - QPtrList<int> tmpDays; + Q3PtrList<Recurrence::rMonthPos> tmpPositions; + Q3PtrList<int> tmpDays; int *tmpDay; Recurrence::rMonthPos *tmpPos; QString tmpStr2; @@ -545,7 +547,7 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) } else if (anEvent->recurrence()->duration() == -1) { tmpStr += "#0"; // defined as repeat forever } else { - tmpStr += qDateTimeToISO(anEvent->recurrence()->endDate(), FALSE); + tmpStr += qDateTimeToISO((QDateTime)anEvent->recurrence()->endDate(), FALSE); } addPropValue(vevent,VCRRuleProp, tmpStr.local8Bit()); @@ -625,7 +627,7 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) // attachments // TODO: handle binary attachments! - QPtrList<Attachment> attachments = anEvent->attachments(); + Q3PtrList<Attachment> attachments = anEvent->attachments(); for ( Attachment *at = attachments.first(); at; at = attachments.next() ) addPropValue(vevent, VCAttachProp, at->uri().local8Bit()); @@ -636,7 +638,7 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) addPropValue(vevent, VCResourcesProp, tmpStr.local8Bit()); // alarm stuff - QPtrList<Alarm> alarms = anEvent->alarms(); + Q3PtrList<Alarm> alarms = anEvent->alarms(); Alarm* alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next()) { if (alarm->enabled()) { @@ -672,7 +674,7 @@ VObject* VCalFormat::eventToVEvent(Event *anEvent) addPropValue(vevent, VCTranspProp, tmpStr.local8Bit()); // related event - if (anEvent->relatedToUid()) { + if (!anEvent->relatedToUid().isEmpty()) { addPropValue(vevent, VCRelatedToProp, anEvent->relatedToUid().local8Bit()); } @@ -1408,7 +1410,7 @@ QString VCalFormat::qDateToISO(const QDate &qd) { QString tmpStr; - ASSERT(qd.isValid()); + Q_ASSERT(qd.isValid()); tmpStr.sprintf("%.2d%.2d%.2d", qd.year(), qd.month(), qd.day()); @@ -1420,8 +1422,8 @@ QString VCalFormat::qDateTimeToISO(const QDateTime &qdt, bool zulu) { QString tmpStr; - ASSERT(qdt.date().isValid()); - ASSERT(qdt.time().isValid()); + Q_ASSERT(qdt.date().isValid()); + Q_ASSERT(qdt.time().isValid()); if (zulu && !useLocalTime ) { QDateTime tmpDT = qdt.addSecs ( -KGlobal::locale()->localTimeOffset( qdt )*60); tmpStr.sprintf("%.2d%.2d%.2dT%.2d%.2d%.2dZ", @@ -1454,8 +1456,8 @@ QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr) tmpDate.setYMD(year, month, day); tmpTime.setHMS(hour, minute, second); - ASSERT(tmpDate.isValid()); - ASSERT(tmpTime.isValid()); + Q_ASSERT(tmpDate.isValid()); + Q_ASSERT(tmpTime.isValid()); QDateTime tmpDT(tmpDate, tmpTime); // correct for GMT if string is in Zulu format if (dtStr.at(dtStr.length()-1) == 'Z') @@ -1648,7 +1650,7 @@ Attendee::Role VCalFormat::readRole(const char *s) const return role; } -QCString VCalFormat::writeRole(Attendee::Role role) const +Q3CString VCalFormat::writeRole(Attendee::Role role) const { if ( role == Attendee::Chair ) return "OWNER"; @@ -1686,7 +1688,7 @@ Attendee::PartStat VCalFormat::readStatus(const char *s) const return status; } -QCString VCalFormat::writeStatus(Attendee::PartStat status) const +Q3CString VCalFormat::writeStatus(Attendee::PartStat status) const { switch(status) { default: diff --git a/libkcal/vcalformat.h b/libkcal/vcalformat.h index 6dae3d2..cac9634 100644 --- a/libkcal/vcalformat.h +++ b/libkcal/vcalformat.h @@ -23,6 +23,9 @@ #define _VCALFORMAT_H #include "calformat.h" +//Added by qt3to4: +#include <Q3CString> +#include <Q3PtrList> #define _VCAL_VERSION "1.0" @@ -95,17 +98,17 @@ class VCalFormat : public CalFormat { const char *dayFromNum(int day); /** the reverse of the above function. */ int numFromDay(const QString &day); - Attendee::Role VCalFormat::readRole(const char *s) const; - QCString writeRole(Attendee::Role role) const; + Attendee::Role readRole(const char *s) const; + Q3CString writeRole(Attendee::Role role) const; Attendee::PartStat readStatus(const char *s) const; - QCString writeStatus(Attendee::PartStat status) const; + Q3CString writeStatus(Attendee::PartStat status) const; private: Calendar *mCalendar; bool useLocalTime; - QPtrList<Event> mEventsRelate; // events with relations - QPtrList<Todo> mTodosRelate; // todos with relations + Q3PtrList<Event> mEventsRelate; // events with relations + Q3PtrList<Todo> mTodosRelate; // todos with relations }; } diff --git a/libkdepim/categoryeditdialog.cpp b/libkdepim/categoryeditdialog.cpp index e2325d2..92a1737 100644 --- a/libkdepim/categoryeditdialog.cpp +++ b/libkdepim/categoryeditdialog.cpp @@ -23,10 +23,11 @@ #include <qstringlist.h> #include <qlineedit.h> -#include <qlistview.h> -#include <qheader.h> +#include <q3listview.h> +#include <q3header.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> #include "kpimprefs.h" @@ -36,7 +37,7 @@ using namespace KPIM; CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent, const char* name, bool modal, - WFlags fl ) + Qt::WFlags fl ) : CategoryEditDialog_base( parent, name, modal, fl ), mPrefs( prefs ) { @@ -46,12 +47,12 @@ CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent, bool categoriesExist=false; for (it = mPrefs->mCustomCategories.begin(); it != mPrefs->mCustomCategories.end(); ++it ) { - new QListViewItem(mCategories,*it); + new Q3ListViewItem(mCategories,*it); categoriesExist=true; } - connect(mCategories,SIGNAL(selectionChanged(QListViewItem *)), - SLOT(editItem(QListViewItem *))); + connect(mCategories,SIGNAL(selectionChanged(Q3ListViewItem *)), + SLOT(editItem(Q3ListViewItem *))); connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &))); mButtonRemove->setEnabled(categoriesExist); mButtonModify->setEnabled(categoriesExist); @@ -82,7 +83,7 @@ void CategoryEditDialog::slotTextChanged(const QString &text) void CategoryEditDialog::add() { if (!mEdit->text().isEmpty()) { - new QListViewItem(mCategories,mEdit->text()); + new Q3ListViewItem(mCategories,mEdit->text()); mEdit->setText(""); mButtonRemove->setEnabled(mCategories->childCount()>0); mButtonModify->setEnabled(mCategories->childCount()>0); @@ -121,7 +122,7 @@ void CategoryEditDialog::slotApply() { mPrefs->mCustomCategories.clear(); - QListViewItem *item = mCategories->firstChild(); + Q3ListViewItem *item = mCategories->firstChild(); while(item) { mPrefs->mCustomCategories.append(item->text(0)); item = item->nextSibling(); @@ -131,7 +132,7 @@ void CategoryEditDialog::slotApply() emit categoryConfigChanged(); } -void CategoryEditDialog::editItem(QListViewItem *item) +void CategoryEditDialog::editItem(Q3ListViewItem *item) { mEdit->setText(item->text(0)); mButtonRemove->setEnabled(true); diff --git a/libkdepim/categoryeditdialog.h b/libkdepim/categoryeditdialog.h index 9bb3201..828894f 100644 --- a/libkdepim/categoryeditdialog.h +++ b/libkdepim/categoryeditdialog.h @@ -24,30 +24,30 @@ #define KPIM_CATEGORYEDITDIALOG_H #include <categoryeditdialog_base.h> -#include <qlistview.h> +#include <q3listview.h> class KPimPrefs; namespace KPIM { - class CategorySelectItem :public QObject, public QCheckListItem + class CategorySelectItem :public QObject, public Q3CheckListItem { Q_OBJECT public: - CategorySelectItem(QListView * parent, const QString & text, Type tt) : QObject( parent ), - QCheckListItem (parent, text, tt ) + CategorySelectItem(Q3ListView * parent, const QString & text, Type tt) : QObject( parent ), + Q3CheckListItem (parent, text, tt ) {;} signals: - void stateChanged( QListViewItem*); + void stateChanged( Q3ListViewItem*); protected: virtual void stateChange(bool b) { - QCheckListItem::stateChange(b); + Q3CheckListItem::stateChange(b); emit stateChanged( this ); } }; @@ -59,7 +59,7 @@ class CategoryEditDialog : public CategoryEditDialog_base public: CategoryEditDialog( KPimPrefs *prefs, QWidget* parent = 0, const char* name = 0, - bool modal = FALSE, WFlags fl = 0 ); + bool modal = FALSE, Qt::WFlags fl = 0 ); ~CategoryEditDialog(); public slots: @@ -75,9 +75,9 @@ class CategoryEditDialog : public CategoryEditDialog_base void categoryConfigChanged(); private slots: - void editItem(QListViewItem *item); + void editItem(Q3ListViewItem *item); void slotTextChanged(const QString &text); - + private: KPimPrefs *mPrefs; }; 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 @@ -11,13 +11,17 @@ #include "categoryeditdialog_base.h" #include <qvariant.h> -#include <qheader.h> +#include <q3header.h> #include <qlineedit.h> -#include <qlistview.h> +#include <q3listview.h> #include <qpushbutton.h> #include <qlayout.h> #include <qtooltip.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> /* * Constructs a CategoryEditDialog_base as a child of 'parent', with the @@ -26,19 +30,19 @@ * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -CategoryEditDialog_base::CategoryEditDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) +CategoryEditDialog_base::CategoryEditDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, true, fl ) { if ( !name ) setName( "CategoryEditDialog_base" ); - CategoryEditDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "CategoryEditDialog_baseLayout"); + CategoryEditDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "CategoryEditDialog_baseLayout"); mEdit = new QLineEdit( this, "mEdit" ); CategoryEditDialog_baseLayout->addMultiCellWidget( mEdit, 1, 1, 0, 0 ); - Layout13 = new QHBoxLayout( 0, 0, 6, "Layout13"); + Layout13 = new Q3HBoxLayout( 0, 0, 6, "Layout13"); // mButtonHelp = new QPushButton( this, "mButtonHelp" ); //mButtonHelp->setAutoDefault( TRUE ); @@ -60,12 +64,12 @@ CategoryEditDialog_base::CategoryEditDialog_base( QWidget* parent, const char* n CategoryEditDialog_baseLayout->addMultiCellLayout( Layout13, 2, 2, 0, 1 ); - mCategories = new QListView( this, "mCategories" ); + mCategories = new Q3ListView( this, "mCategories" ); mCategories->addColumn( tr2i18n( "Category" ) ); CategoryEditDialog_baseLayout->addWidget( mCategories, 0, 0 ); - layout103 = new QVBoxLayout( 0, 0, 6, "layout103"); + layout103 = new Q3VBoxLayout( 0, 0, 6, "layout103"); mButtonAdd = new QPushButton( this, "mButtonAdd" ); CategoryEditDialog_baseLayout->addMultiCellWidget(mButtonAdd , 1, 1, 1, 1 ); 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 @@ -12,13 +12,17 @@ #include <qvariant.h> #include <qdialog.h> - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3GridLayout> +#include <Q3HBoxLayout> + +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; class QLineEdit; -class QListView; -class QListViewItem; +class Q3ListView; +class Q3ListViewItem; class QPushButton; class CategoryEditDialog_base : public QDialog @@ -26,7 +30,7 @@ class CategoryEditDialog_base : public QDialog Q_OBJECT public: - CategoryEditDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + CategoryEditDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~CategoryEditDialog_base(); QLineEdit* mEdit; @@ -34,7 +38,7 @@ public: QPushButton* mApply; QPushButton* mButtonOk; QPushButton* mButtonCancel; - QListView* mCategories; + Q3ListView* mCategories; QPushButton* mButtonAdd; QPushButton* mButtonModify; QPushButton* mButtonRemove; @@ -47,9 +51,9 @@ public slots: virtual void slotOk(); protected: - QGridLayout* CategoryEditDialog_baseLayout; - QHBoxLayout* Layout13; - QVBoxLayout* layout103; + Q3GridLayout* CategoryEditDialog_baseLayout; + Q3HBoxLayout* Layout13; + Q3VBoxLayout* layout103; protected slots: virtual void languageChange(); diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp index 2a9b43e..4f72880 100644 --- a/libkdepim/categoryselectdialog.cpp +++ b/libkdepim/categoryselectdialog.cpp @@ -21,11 +21,14 @@ without including the source code for Qt in the source distribution. */ -#include <qlistview.h> +#include <q3listview.h> #include <qpushbutton.h> -#include <qheader.h> -#include <qapp.h> +#include <q3header.h> +#include <qapplication.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <QPixmap> +#include <QDesktopWidget> #include <kmessagebox.h> @@ -38,7 +41,7 @@ using namespace KPIM; CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent, const char* name, - bool modal, WFlags fl ) + bool modal, Qt::WFlags fl ) : CategorySelectDialog_base( parent, name, true, fl ), mPrefs( prefs ) { @@ -81,8 +84,8 @@ void CategorySelectDialog::setCategories() QStringList::Iterator it; for (it = mPrefs->mCustomCategories.begin(); it != mPrefs->mCustomCategories.end(); ++it ) { - CategorySelectItem * item = new CategorySelectItem(mCategories,*it,QCheckListItem::CheckBox); - QObject::connect( item, SIGNAL( stateChanged(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) ); + CategorySelectItem * item = new CategorySelectItem(mCategories,*it,Q3CheckListItem::CheckBox); + QObject::connect( item, SIGNAL( stateChanged(Q3ListViewItem *) ), this, SLOT( clicked(Q3ListViewItem *) ) ); } } @@ -100,7 +103,7 @@ void CategorySelectDialog::setSelected(const QStringList &selList) bool found = false; for (it=selList.begin();it!=selList.end();++it) { //qDebug(" CategorySelectDialog::setSelected("); - QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); + Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild(); while (item) { if (item->text() == *it) { item->setOn(true); @@ -109,7 +112,7 @@ void CategorySelectDialog::setSelected(const QStringList &selList) found = true; break; } - item = (QCheckListItem *)item->nextSibling(); + item = (Q3CheckListItem *)item->nextSibling(); } // if ( ! found ) { @@ -137,7 +140,7 @@ void CategorySelectDialog::setColorEnabled() } void CategorySelectDialog::setColorCat() { - QCheckListItem * newColorItem = (QCheckListItem * )mCategories->currentItem (); + Q3CheckListItem * newColorItem = (Q3CheckListItem * )mCategories->currentItem (); if ( !newColorItem ) { KMessageBox::error(this,i18n("There is no current item.")); return; @@ -147,26 +150,26 @@ void CategorySelectDialog::setColorCat() setColorItem( newColorItem ); } -void CategorySelectDialog::clicked ( QListViewItem * it ) +void CategorySelectDialog::clicked ( Q3ListViewItem * it ) { if ( ! it ) return; - QCheckListItem *i = (QCheckListItem *) it; + Q3CheckListItem *i = (Q3CheckListItem *) it; if ( !i->isOn() && i==mColorItem) { setColorItem( 0); - QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); + Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild(); while (item) { if (item->isOn()) { setColorItem( item ); break; } - item = (QCheckListItem *)item->nextSibling(); + item = (Q3CheckListItem *)item->nextSibling(); } } else if ( i->isOn() && !mColorItem) { setColorItem( i); } } -void CategorySelectDialog::setColorItem( QCheckListItem * newColorItem ) +void CategorySelectDialog::setColorItem( Q3CheckListItem * newColorItem ) { if ( !mColorEnabled ) return; @@ -186,7 +189,7 @@ void CategorySelectDialog::setColorItem( QCheckListItem * newColorItem ) void CategorySelectDialog::slotApply() { QStringList categories; - QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); + Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild(); QString colcat; while (item) { if (item->isOn()) { @@ -195,7 +198,7 @@ void CategorySelectDialog::slotApply() else categories.append(item->text()); } - item = (QCheckListItem *)item->nextSibling(); + item = (Q3CheckListItem *)item->nextSibling(); } categories.sort(); if ( ! colcat.isEmpty() ) @@ -220,22 +223,22 @@ void CategorySelectDialog::slotOk() void CategorySelectDialog::clear() { - QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); + Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild(); while (item) { item->setOn(false); - item = (QCheckListItem *)item->nextSibling(); + item = (Q3CheckListItem *)item->nextSibling(); } } void CategorySelectDialog::updateCategoryConfig() { QStringList selected; - QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); + Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild(); while (item) { if (item->isOn()) { selected.append(item->text()); } - item = (QCheckListItem *)item->nextSibling(); + item = (Q3CheckListItem *)item->nextSibling(); } setCategories(); diff --git a/libkdepim/categoryselectdialog.h b/libkdepim/categoryselectdialog.h index 680a093..ff7ac58 100644 --- a/libkdepim/categoryselectdialog.h +++ b/libkdepim/categoryselectdialog.h @@ -26,7 +26,7 @@ #include <categoryselectdialog_base.h> class KPimPrefs; -class QCheckListItem; +class Q3CheckListItem; namespace KPIM { @@ -36,7 +36,7 @@ class CategorySelectDialog : public CategorySelectDialog_base public: CategorySelectDialog( KPimPrefs *prefs, QWidget* parent = 0, const char* name = 0, - bool modal = FALSE, WFlags fl = 0 ); + bool modal = FALSE, Qt::WFlags fl = 0 ); ~CategorySelectDialog(); void setCategories(); @@ -53,7 +53,7 @@ class CategorySelectDialog : public CategorySelectDialog_base void editCategoriesDialog(); void updateCategoryConfig(); void setColorCat(); - void clicked ( QListViewItem * ); + void clicked ( Q3ListViewItem * ); signals: void categoriesSelected(const QString &); void categoriesSelected(const QStringList &); @@ -63,8 +63,8 @@ class CategorySelectDialog : public CategorySelectDialog_base bool mColorEnabled; KPimPrefs *mPrefs; QStringList mCategoryList; - QCheckListItem *mColorItem; - void setColorItem( QCheckListItem * ); + Q3CheckListItem *mColorItem; + void setColorItem( Q3CheckListItem * ); class CategorySelectDialogPrivate; CategorySelectDialogPrivate *d; 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 @@ -11,12 +11,15 @@ #include "categoryselectdialog_base.h" #include <qvariant.h> -#include <qheader.h> -#include <qlistview.h> +#include <q3header.h> +#include <q3listview.h> #include <qpushbutton.h> #include <qlayout.h> #include <qtooltip.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3HBoxLayout> /* * Constructs a CategorySelectDialog_base as a child of 'parent', with the @@ -25,20 +28,20 @@ * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -CategorySelectDialog_base::CategorySelectDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) +CategorySelectDialog_base::CategorySelectDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "CategorySelectDialog_base" ); - CategorySelectDialog_baseLayout = new QVBoxLayout( this, 11, 6, "CategorySelectDialog_baseLayout"); + CategorySelectDialog_baseLayout = new Q3VBoxLayout( this, 11, 6, "CategorySelectDialog_baseLayout"); - mCategories = new QListView( this, "mCategories" ); + mCategories = new Q3ListView( this, "mCategories" ); mCategories->addColumn( i18n( "Category" ) ); CategorySelectDialog_baseLayout->addWidget( mCategories ); mSetColorCat = new QPushButton( this, "msetColor" ); CategorySelectDialog_baseLayout->addWidget( mSetColorCat ); - Layout12 = new QHBoxLayout( 0, 0, 4, "Layout12"); + Layout12 = new Q3HBoxLayout( 0, 0, 4, "Layout12"); mClear = new QPushButton( this, "mClear" ); Layout12->addWidget( mClear ); @@ -49,7 +52,7 @@ CategorySelectDialog_base::CategorySelectDialog_base( QWidget* parent, const cha Layout12->addWidget( mButtonEdit ); CategorySelectDialog_baseLayout->addLayout( Layout12 ); - Layout11 = new QHBoxLayout( 0, 0, 4, "Layout11"); + Layout11 = new Q3HBoxLayout( 0, 0, 4, "Layout11"); //mButtonHelp = new QPushButton( this, "mButtonHelp" ); //Layout11->addWidget( mButtonHelp ); 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 @@ -12,12 +12,16 @@ #include <qvariant.h> #include <qdialog.h> - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QListView; -class QListViewItem; +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3GridLayout> +#include <Q3HBoxLayout> + +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; +class Q3ListView; +class Q3ListViewItem; class QPushButton; class CategorySelectDialog_base : public QDialog @@ -25,10 +29,10 @@ class CategorySelectDialog_base : public QDialog Q_OBJECT public: - CategorySelectDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + CategorySelectDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~CategorySelectDialog_base(); - QListView* mCategories; + Q3ListView* mCategories; QPushButton* mClear; QPushButton* mButtonEdit; QPushButton* mButtonHelp; @@ -43,9 +47,9 @@ public slots: virtual void slotOk(); protected: - QVBoxLayout* CategorySelectDialog_baseLayout; - QHBoxLayout* Layout12; - QHBoxLayout* Layout11; + Q3VBoxLayout* CategorySelectDialog_baseLayout; + Q3HBoxLayout* Layout12; + Q3HBoxLayout* Layout11; protected slots: virtual void languageChange(); diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index f376e6c..3fc548a 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp @@ -39,7 +39,9 @@ $Id$ #include <qtopia/qcopenvelope_qws.h> #else #include <qapplication.h> -#include <qprocess.h> +#include <q3process.h> +//Added by qt3to4: +#include <Q3CString> #endif #include <kstaticdeleter.h> @@ -123,7 +125,7 @@ void QCopTransferItem::setSourceChannel(const QString& sourceChannel) /*********************************************************************************/ -bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) +bool QCopTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) { // copied from old mail2 @@ -146,7 +148,7 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data()) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); QString sourceChannel; @@ -226,13 +228,13 @@ bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QSt /*********************************************************************************/ -bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) +bool QCopMapTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) { bool res = QCopTransferItem::appMessage( cmsg, data ); if (res == false) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); // qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); @@ -305,7 +307,7 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString /*********************************************************************************/ -bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) +bool QCopListTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) { bool res = QCopTransferItem::appMessage( cmsg, data ); #ifdef DEBUG_EXT_APP_HANDLER @@ -314,7 +316,7 @@ bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& d if (res == false) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); #ifdef DEBUG_EXT_APP_HANDLER qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); @@ -518,9 +520,9 @@ void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& la } -QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) +Q3PtrList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) { - QList<DefaultAppItem> list; + Q3PtrList<DefaultAppItem> list; DefaultAppItem* dai; @@ -746,7 +748,7 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS #endif qDebug("%s --- %s %s --- %s %s", channel.latin1(), message.latin1(),message2.latin1(), parameters.latin1(), parameters2.latin1() ); //KMessageBox::sorry( 0, message2 ); - QProcess * proc = new QProcess( this ); + Q3Process * proc = new Q3Process( this ); int i = 0; proc->addArgument( channel ); @@ -772,7 +774,7 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS //KMessageBox::sorry( 0,arg ); //qDebug("2add%sdd ",arg.latin1() ); proc->addArgument( arg); - proc->launch(""); + proc->launch(QString()); #endif return true; @@ -831,7 +833,7 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e #else // DESKTOP_VERSION //KMessageBox::sorry( 0,channel ); - QProcess * proc = new QProcess( this ); + Q3Process * proc = new Q3Process( this ); proc->addArgument( channel ); if ( message.find (" " ) > 0 ) { QStringList list = QStringList::split( " ", message ); @@ -850,7 +852,7 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e //KMessageBox::information(0,parameters); proc->addArgument( parameters ); - proc->launch(""); + proc->launch(QString()); #endif return true; @@ -1232,7 +1234,7 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete * **************************************************************************/ -void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) +void ExternalAppHandler::appMessage( const Q3CString& cmsg, const QByteArray& data ) { qDebug("ExternalAppHandler::appMessage %s %x", cmsg.data(), this); if ( cmsg == "nextView()" ) { diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h index b899ad7..3247fe4 100644 --- a/libkdepim/externalapphandler.h +++ b/libkdepim/externalapphandler.h @@ -34,6 +34,9 @@ $Id$ #include <qobject.h> #include <qlist.h> #include <qmap.h> +#include <Q3PtrList> +//Added by qt3to4: +#include <Q3CString> class QCopEnvelope; @@ -50,7 +53,7 @@ class QCopTransferItem : public QObject void setSourceChannel(const QString& sourceChannel); - virtual bool appMessage( const QCString& msg, const QByteArray& data ); + virtual bool appMessage( const Q3CString& msg, const QByteArray& data ); signals: @@ -83,7 +86,7 @@ class QCopMapTransferItem : public QCopTransferItem bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap); - virtual bool appMessage( const QCString& msg, const QByteArray& data ); + virtual bool appMessage( const Q3CString& msg, const QByteArray& data ); signals: @@ -104,7 +107,7 @@ class QCopListTransferItem : public QCopTransferItem bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6); - virtual bool appMessage( const QCString& msg, const QByteArray& data ); + virtual bool appMessage( const Q3CString& msg, const QByteArray& data ); signals: @@ -225,11 +228,11 @@ class ExternalAppHandler : public QObject //loadConfig clears the cache and checks again if the applications are available or not void loadConfig(); - QList<DefaultAppItem> getAvailableDefaultItems(Types); + Q3PtrList<DefaultAppItem> getAvailableDefaultItems(Types); DefaultAppItem* getDefaultItem(Types, int); public slots: - void appMessage( const QCString& msg, const QByteArray& data ); + void appMessage( const Q3CString& msg, const QByteArray& data ); signals: @@ -262,7 +265,7 @@ class ExternalAppHandler : public QObject private: ExternalAppHandler(); - QList<DefaultAppItem> mDefaultItems; + Q3PtrList<DefaultAppItem> mDefaultItems; Availability mEmailAppAvailable; Availability mPhoneAppAvailable; 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 @@ -30,6 +30,8 @@ $Id$ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kdebug.h> //#include <klocale.h> @@ -54,7 +56,7 @@ KCMKdePimConfig::KCMKdePimConfig(QWidget *parent, const char *name ) : KCModule( KPimGlobalPrefs::instance(), parent, name ) { //abort(); - QVBoxLayout *layout = new QVBoxLayout( this ); + Q3VBoxLayout *layout = new Q3VBoxLayout( this ); mConfigWidget = new KDEPIMConfigWidget( (KPimGlobalPrefs*)getPreferences(), this, "KDEPIMConfigWidget" ); layout->addWidget( mConfigWidget ); layout->setSpacing( 0 ); 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 @@ -31,16 +31,21 @@ $Id$ #include <qlayout.h> #include <qtabwidget.h> #include <qcombobox.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlabel.h> #include <qlineedit.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qcheckbox.h> #include <qfile.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qdir.h> #include <qregexp.h> #include <qspinbox.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <Q3VBoxLayout> #include <kdialog.h> #include <kprefsdialog.h> @@ -101,7 +106,7 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, + Q3VBoxLayout *topLayout = new Q3VBoxLayout( this, 0, KDialog::spacingHint() ); tabWidget = new QTabWidget( this ); @@ -121,17 +126,17 @@ void KDEPIMConfigWidget::showTimeZoneTab() } void KDEPIMConfigWidget::setupBackupTab() { - QVBox *colorPage = new QVBox( this ); + Q3VBox *colorPage = new Q3VBox( this ); tabWidget->addTab( colorPage, i18n( "Backup" ) ); QWidget* topFrame = new QWidget( colorPage ); - QVBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3VBoxLayout *topLayout = new Q3VBoxLayout(topFrame); KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); topLayout->addWidget((QWidget*)sb->checkBox()); QWidget* bupFrame = new QWidget( topFrame ); topLayout->addWidget((bupFrame)); QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); - QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); + Q3VBoxLayout *bupLayout = new Q3VBoxLayout(bupFrame); sb = addWidBool(i18n("Use standard backup dir"), &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); bupLayout->addWidget((QWidget*)sb->checkBox()); @@ -143,13 +148,13 @@ void KDEPIMConfigWidget::setupBackupTab() mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); - QHBox *dummy = new QHBox(bupFrame); + Q3HBox *dummy = new Q3HBox(bupFrame); new QLabel(i18n("Number of Backups:"),dummy); mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); new QLabel(i18n(" "),dummy); bupLayout->addWidget( dummy ); - dummy = new QHBox(bupFrame); + dummy = new Q3HBox(bupFrame); new QLabel(i18n("Make backup every "),dummy); mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); new QLabel(i18n(" days"),dummy); @@ -167,18 +172,18 @@ void KDEPIMConfigWidget::setupBackupTab() } void KDEPIMConfigWidget::setupStoreTab() { - QVBox *colorPage = new QVBox( this ); + Q3VBox *colorPage = new Q3VBox( this ); tabWidget->addTab( colorPage, i18n( "Colors" ) ); QWidget* cw = new QWidget( colorPage ); KPrefsWidColor *holidayColor = addWidColor(i18n("Alternating background of list views"), &(KPimGlobalPrefs::instance()->mAlternateColor),cw); - QHBoxLayout *topLayout = new QHBoxLayout(cw); + Q3HBoxLayout *topLayout = new Q3HBoxLayout(cw); topLayout->addWidget(holidayColor->label()); topLayout->addWidget( (QWidget* )holidayColor->button()); - QVBox *storePage = new QVBox( this ); + Q3VBox *storePage = new Q3VBox( this ); if ( QApplication::desktop()->height() > 240 ) 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 ); new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); @@ -200,7 +205,7 @@ void KDEPIMConfigWidget::setupStoreTab() #endif new QLabel( i18n("New dirs are created automatically"), storePage ); - QHBox *bb = new QHBox( storePage ); + Q3HBox *bb = new Q3HBox( storePage ); QPushButton * pb; if ( QApplication::desktop()->width() < 640 ) pb = new QPushButton ( i18n("Save"), bb ); @@ -270,7 +275,7 @@ void KDEPIMConfigWidget::saveStoreSettings() void KDEPIMConfigWidget::setupExternalAppTab() { QWidget *externalAppsPage = new QWidget( this ); - QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), + Q3VBoxLayout* layout = new Q3VBoxLayout( externalAppsPage, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); mExternalApps = new QComboBox( externalAppsPage ); @@ -285,8 +290,8 @@ void KDEPIMConfigWidget::setupExternalAppTab() this, SLOT (externalapp_changed( int ) ) ); - mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); - QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); + mExternalAppGroupBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); + Q3GridLayout *boxLayout = new Q3GridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); mExternalAppGroupBox->layout()->setMargin(4); mClient = new QComboBox( mExternalAppGroupBox ); @@ -352,7 +357,7 @@ void KDEPIMConfigWidget::setupExternalAppTab() void KDEPIMConfigWidget::setupLocaleDateTab() { QWidget *topFrame = new QWidget( this ); - QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); + Q3GridLayout *topLayout = new Q3GridLayout( topFrame, 3, 2); topLayout->setSpacing(KDialog::spacingHintSmall()); topLayout->setMargin(KDialog::marginHintSmall()); @@ -420,7 +425,7 @@ void KDEPIMConfigWidget::setupLocaleTab() { QWidget *topFrame = new QWidget( this ); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(KDialog::spacingHint()); topLayout->setMargin(KDialog::marginHint()); @@ -442,7 +447,7 @@ void KDEPIMConfigWidget::setupLocaleTab() tabWidget->addTab( topFrame, i18n( "Language" ) ); topFrame = new QWidget( this ); - topLayout = new QGridLayout(topFrame,4,2); + topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(KDialog::spacingHint()); topLayout->setMargin(KDialog::marginHint()); @@ -471,7 +476,7 @@ void KDEPIMConfigWidget::setupLocaleTab() void KDEPIMConfigWidget::setupTimeZoneTab() { QWidget *topFrame; - QGridLayout *topLayout ; + Q3GridLayout *topLayout ; @@ -479,11 +484,11 @@ void KDEPIMConfigWidget::setupTimeZoneTab() topFrame = new QWidget( this ); - topLayout = new QGridLayout( topFrame, 5, 2); + topLayout = new Q3GridLayout( topFrame, 5, 2); topLayout->setSpacing(KDialog::spacingHintSmall()); topLayout->setMargin(KDialog::marginHintSmall()); - QHBox *timeZoneBox = new QHBox( topFrame ); + Q3HBox *timeZoneBox = new Q3HBox( topFrame ); topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); new QLabel( i18n("Timezone:"), timeZoneBox ); @@ -550,7 +555,7 @@ void KDEPIMConfigWidget::setupTimeZoneTab() topFrame = new QWidget( this ); - topLayout = new QGridLayout( topFrame, 3, 2); + topLayout = new Q3GridLayout( topFrame, 3, 2); topLayout->setSpacing(KDialog::spacingHintSmall()); topLayout->setMargin(KDialog::marginHintSmall()); tabWidget->addTab( topFrame, i18n( "Fonts" ) ); @@ -711,7 +716,7 @@ void KDEPIMConfigWidget::updateClientWidgets() //update the entries in the client combobox mClient->clear(); - QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); + Q3PtrList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); DefaultAppItem* dai; for ( dai=items.first(); dai != 0; dai=items.next() ) { 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 @@ -34,6 +34,8 @@ $Id$ #include <kprefswidget.h> #include <kio/kfile/kurlrequester.h> #include <qmap.h> +//Added by qt3to4: +#include <QLabel> #include "externalapphandler.h" @@ -41,7 +43,7 @@ $Id$ class QComboBox; class QLineEdit; class KPimGlobalPrefs; -class QGroupBox; +class Q3GroupBox; class QTabWidget; class KDateEdit; @@ -106,7 +108,7 @@ class KDEPIMConfigWidget : public KPrefsWidget // QCheckBox *mViewsSingleClickBox; // QPushButton *mConfigureButton; QComboBox* mExternalApps; - QGroupBox* mExternalAppGroupBox; + Q3GroupBox* mExternalAppGroupBox; QComboBox* mClient; diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp index bf38479..28c88d4 100644 --- a/libkdepim/kdateedit.cpp +++ b/libkdepim/kdateedit.cpp @@ -27,6 +27,9 @@ #include <qlineedit.h> #include <qpixmap.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3Frame> +#include <QKeyEvent> #include <kdatepicker.h> #include <kdebug.h> @@ -36,12 +39,13 @@ #include <kmessagebox.h> #include <knotifyclient.h> #include <qpalette.h> +#include <QDesktopWidget> #include "kdateedit.h" //#include "kdateedit.moc" KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) - : QHBox(parent, name) + : Q3HBox(parent, name) { dateFormShort = true; withoutDp = withoutDP; @@ -72,9 +76,9 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) QPushButton* nowButton = new QPushButton(this); nowButton->setPixmap(pixmap2); - mDateFrame = new QVBox(0,0,WType_Popup); + mDateFrame = new Q3VBox(0,0,Qt::WType_Popup); // mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); - mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); + mDateFrame->setFrameStyle( Q3Frame::WinPanel |Q3Frame::Raised ); mDateFrame->setLineWidth(3); mDateFrame->hide(); @@ -86,7 +90,7 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide())); connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker())); connect(nowButton,SIGNAL(clicked()),SLOT(goToNow())); - mDateButton->setFocusPolicy( QWidget::NoFocus ); + mDateButton->setFocusPolicy( Qt::NoFocus ); mDateButton->setAutoDefault( false ); //mDateFrame->resize( 400, 300 ); @@ -225,10 +229,10 @@ void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateForm case 'd': case 'a': case 'A': - if(key == Key_Up) { + if(key == Qt::Key_Up) { setDate( date.addDays( 1 ) ); } - else if(key == Key_Down) { + else if(key == Qt::Key_Down) { setDate( date.addDays( -1 ) ); } maxDay = readDate().day(); @@ -236,12 +240,12 @@ void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateForm case 'm': case 'b': case 'B': - if(key == Key_Up) { + if(key == Qt::Key_Up) { int year = ((date.month()+1)>12)?date.year()+1:date.year(); int month = ((date.month()+1)>12)?1:date.month()+1; int day = (QDate(year,month,1).daysInMonth()<maxDay)?QDate(year,month,1).daysInMonth():maxDay; setDate( QDate( year, month, day ) ); - } else if(key == Key_Down) { + } else if(key == Qt::Key_Down) { int year = ((date.month()-1)<1)?date.year()-1:date.year(); int month = ((date.month()-1)<1)?12:date.month()-1; int day = (QDate(year,month,1).daysInMonth()<maxDay)?QDate(year,month,1).daysInMonth():maxDay; @@ -250,10 +254,10 @@ void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateForm break; case 'y': case 'Y': - if(key == Key_Up) { + if(key == Qt::Key_Up) { setDate( QDate( date.year() + 1, date.month() , date.day()) ); } - else if(key == Key_Down) { + else if(key == Qt::Key_Down) { setDate( QDate( date.year() - 1, date.month() , date.day()) ); } break; @@ -344,12 +348,12 @@ void KDateEdit::keyPressEvent(QKeyEvent *e) switch(e->key()) { - case Key_Escape: + case Qt::Key_Escape: mDateEdit->deselect(); - case Key_Tab: - QHBox::keyPressEvent(e); + case Qt::Key_Tab: + Q3HBox::keyPressEvent(e); break; - case Key_Up: + case Qt::Key_Up: // when date invalid then set to currend and return if(!date.isValid()) { date = QDate::currentDate(); @@ -360,9 +364,9 @@ void KDateEdit::keyPressEvent(QKeyEvent *e) KMessageBox::information( 0, text ); return; } - setDate(date, &cpos, Key_Up, dateFormShort); + setDate(date, &cpos, Qt::Key_Up, dateFormShort); break; - case Key_Down: + case Qt::Key_Down: // when date invalid then set to current and return if(!date.isValid()) { date = QDate::currentDate(); @@ -373,10 +377,10 @@ void KDateEdit::keyPressEvent(QKeyEvent *e) KMessageBox::information( 0, text ); return; } - setDate(date, &cpos, Key_Down, dateFormShort); + setDate(date, &cpos, Qt::Key_Down, dateFormShort); break; default: - QHBox::keyPressEvent(e); + Q3HBox::keyPressEvent(e); break; } // switch mDateEdit->setCursorPosition(cpos); diff --git a/libkdepim/kdateedit.h b/libkdepim/kdateedit.h index 2d8c452..38eacde 100644 --- a/libkdepim/kdateedit.h +++ b/libkdepim/kdateedit.h @@ -24,10 +24,13 @@ #ifndef KDATEEDIT_H #define KDATEEDIT_H -#include <qhbox.h> -#include <qvbox.h> +#include <q3hbox.h> +#include <q3vbox.h> #include <qdatetime.h> #include <qmap.h> +//Added by qt3to4: +#include <QKeyEvent> +#include <QEvent> class QLineEdit; class QPushButton; @@ -49,7 +52,7 @@ class KDateValidator; * @author Cornelius Schumacher <schumacher@kde.org> * @author Mike Pilone <mpilone@slac.com> */ -class KDateEdit : public QHBox +class KDateEdit : public Q3HBox { Q_OBJECT public: @@ -128,7 +131,7 @@ class KDateEdit : public QHBox QPushButton *mDateButton; QLineEdit *mDateEdit; KDatePicker *mDatePicker; - QVBox *mDateFrame; + Q3VBox *mDateFrame; int maxDay; bool withoutDp; diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index 68ef943..28b65cf 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp @@ -23,7 +23,7 @@ #include <kapplication.h> #include <klocale.h> #include <kiconloader.h> -#include <qframe.h> +#include <q3frame.h> #include <qpainter.h> #include <qdialog.h> #include <qtoolbutton.h> @@ -31,6 +31,10 @@ #include <qapplication.h> #include <qlineedit.h> #include <qvalidator.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QKeyEvent> +#include <QDesktopWidget> #include <kdebug.h> #include <knotifyclient.h> #include <kglobalsettings.h> @@ -40,7 +44,7 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) - : QFrame(parent,name), + : Q3Frame(parent,name), yearForward(new QToolButton(this)), yearBackward(new QToolButton(this)), monthForward(new QToolButton(this)), diff --git a/libkdepim/kdatepicker.h b/libkdepim/kdatepicker.h index 3db9a89..4d904da 100644 --- a/libkdepim/kdatepicker.h +++ b/libkdepim/kdatepicker.h @@ -20,8 +20,11 @@ #ifndef MICROKDE_KDATEPICKER_H #define MICROKDE_KDATEPICKER_H #include <qdatetime.h> -#include <qframe.h> +#include <q3frame.h> #include <qevent.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QKeyEvent> class QLineEdit; class QToolButton; @@ -48,7 +51,7 @@ class KDateEdit; * * @short A date selection widget. **/ -class KDatePicker: public QFrame +class KDatePicker: public Q3Frame { Q_OBJECT public: diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 9c28425..3677e87 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp @@ -38,7 +38,7 @@ $Id$ #include <qregexp.h> #include <qfile.h> #include <stdlib.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qapplication.h> #include "kpimglobalprefs.h" @@ -142,9 +142,9 @@ void KPimGlobalPrefs::setGlobalConfig() else if ( mPreferredLanguage == 3 ) fileName = fileName+"italiantranslation.txt"; QFile file( fileName ); - if (file.open( IO_ReadOnly ) ) { - QTextStream ts( &file ); - ts.setEncoding( QTextStream::Latin1 ); + if (file.open( QIODevice::ReadOnly ) ) { + Q3TextStream ts( &file ); + ts.setEncoding( Q3TextStream::Latin1 ); //ts.setCodec( QTextCodec::latin1 ); QString text = ts.read(); file.close(); @@ -158,7 +158,7 @@ void KPimGlobalPrefs::setGlobalConfig() line = text.mid( br, nbr - br ); br = nbr+1; int se, ee, st, et; - mLocaleDict = new QDict<QString>; + mLocaleDict = new Q3Dict<QString>; mLocaleDict->setAutoDelete( true ); QString end = "{ \"\",\"\" }"; while ( (line != end) && (br > 1) ) { diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h index 94ac8ae..01f5ab0 100644 --- a/libkdepim/kpimglobalprefs.h +++ b/libkdepim/kpimglobalprefs.h @@ -32,7 +32,7 @@ $Id$ #define KPIMGLOBALPREFS_H #include "kprefs.h" -#include <qdict.h> +#include <q3dict.h> class KPimGlobalPrefs : public KPrefs { @@ -85,7 +85,7 @@ class KPimGlobalPrefs : public KPrefs KPimGlobalPrefs( const QString &name = QString::null ); static KPimGlobalPrefs *sInstance; - QDict<QString> *mLocaleDict; + Q3Dict<QString> *mLocaleDict; public: diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp index 6dc741d..358acbd 100644 --- a/libkdepim/kprefsdialog.cpp +++ b/libkdepim/kprefsdialog.cpp @@ -25,23 +25,24 @@ #include <qlayout.h> #include <qlabel.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> +#include <q3groupbox.h> +#include <q3buttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> -#include <qtextstream.h> -#include <qvbox.h> -#include <qhbox.h> +#include <q3textstream.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qspinbox.h> #include <qdatetime.h> -#include <qframe.h> +#include <q3frame.h> #include <qcombobox.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> #include <kcolorbutton.h> #include <kdebug.h> @@ -128,7 +129,7 @@ KPrefsDialogWidFont::KPrefsDialogWidFont(const QString &sampleText,const QString mLabel = new QLabel(labelText, parent); mPreview = new QLabel(sampleText,parent); - mPreview->setFrameStyle(QFrame::Panel|QFrame::Sunken); + mPreview->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken); mButton = new QPushButton(i18n("Choose..."), parent); connect(mButton,SIGNAL(clicked()),SLOT(selectFont())); @@ -212,7 +213,7 @@ KPrefsDialogWidRadios::KPrefsDialogWidRadios(const QString &text,int *reference, { mReference = reference; - mBox = new QButtonGroup(1,Qt::Horizontal,text,parent); + mBox = new Q3ButtonGroup(1,Qt::Horizontal,text,parent); } KPrefsDialogWidRadios::~KPrefsDialogWidRadios() @@ -224,7 +225,7 @@ void KPrefsDialogWidRadios::addRadio(const QString &text) new QRadioButton(text,mBox); } -QButtonGroup *KPrefsDialogWidRadios::groupBox() +Q3ButtonGroup *KPrefsDialogWidRadios::groupBox() { return mBox; } diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h index 52ec809..cc95dd4 100644 --- a/libkdepim/kprefsdialog.h +++ b/libkdepim/kprefsdialog.h @@ -24,8 +24,10 @@ #define _KPREFSDIALOG_H // $Id$ -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qlineedit.h> +//Added by qt3to4: +#include <QLabel> #include <kdialogbase.h> @@ -36,7 +38,7 @@ class KColorButton; class QCheckBox; class QLabel; class QSpinBox; -class QButtonGroup; +class Q3ButtonGroup; /** @short Base class for widgets used by @ref KPrefsDialog. @@ -258,7 +260,7 @@ class KPrefsDialogWidRadios : public KPrefsDialogWid /** Return the box widget used by this widget. */ - QButtonGroup *groupBox(); + Q3ButtonGroup *groupBox(); void readConfig(); void writeConfig(); @@ -266,7 +268,7 @@ class KPrefsDialogWidRadios : public KPrefsDialogWid private: int *mReference; - QButtonGroup *mBox; + Q3ButtonGroup *mBox; }; @@ -439,7 +441,7 @@ class KPrefsDialog : public KDialogBase private: KPrefs *mPrefs; - QPtrList<KPrefsDialogWid> mPrefsWids; + Q3PtrList<KPrefsDialogWid> mPrefsWids; }; diff --git a/libkdepim/kprefswidget.cpp b/libkdepim/kprefswidget.cpp index f6a0b38..51431e2 100644 --- a/libkdepim/kprefswidget.cpp +++ b/libkdepim/kprefswidget.cpp @@ -25,23 +25,24 @@ #include <qlayout.h> #include <qlabel.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> +#include <q3groupbox.h> +#include <q3buttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> -#include <qtextstream.h> -#include <qvbox.h> -#include <qhbox.h> +#include <q3textstream.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qspinbox.h> #include <qdatetime.h> -#include <qframe.h> +#include <q3frame.h> #include <qcombobox.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> #include <kcolorbutton.h> #include <kdebug.h> @@ -131,7 +132,7 @@ KPrefsWidFont::KPrefsWidFont(const QString &sampleText,const QString &labelText, mLabel = new QLabel(labelText, parent); mPreview = new QLabel(sampleText,parent); - mPreview->setFrameStyle(QFrame::Panel|QFrame::Sunken); + mPreview->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken); mButton = new QPushButton(i18n("Choose..."), parent); connect(mButton,SIGNAL(clicked()),SLOT(selectFont())); @@ -218,7 +219,7 @@ KPrefsWidRadios::KPrefsWidRadios(const QString &text,int *reference, { mReference = reference; - mBox = new QButtonGroup(1,Qt::Horizontal,text,parent); + mBox = new Q3ButtonGroup(1,Qt::Horizontal,text,parent); connect( mBox, SIGNAL( clicked(int)), SIGNAL( modified() ) ); } @@ -231,7 +232,7 @@ void KPrefsWidRadios::addRadio(const QString &text) new QRadioButton(text,mBox); } -QButtonGroup *KPrefsWidRadios::groupBox() +Q3ButtonGroup *KPrefsWidRadios::groupBox() { return mBox; } diff --git a/libkdepim/kprefswidget.h b/libkdepim/kprefswidget.h index 8543a39..9de1be5 100644 --- a/libkdepim/kprefswidget.h +++ b/libkdepim/kprefswidget.h @@ -25,11 +25,13 @@ #ifndef _KPREFSWIDGET_H #define _KPREFSWIDGET_H -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qlineedit.h> #include <qpushbutton.h> #include <qwidget.h> +//Added by qt3to4: +#include <QLabel> class KPrefs; @@ -37,7 +39,7 @@ class KColorButton; class QCheckBox; class QLabel; class QSpinBox; -class QButtonGroup; +class Q3ButtonGroup; /** @short Base class for widgets used by @ref KPrefsDialog. @@ -265,7 +267,7 @@ class KPrefsWidRadios : public KPrefsWid /** Return the box widget used by this widget. */ - QButtonGroup *groupBox(); + Q3ButtonGroup *groupBox(); void readConfig(); void writeConfig(); @@ -273,7 +275,7 @@ class KPrefsWidRadios : public KPrefsWid private: int *mReference; - QButtonGroup *mBox; + Q3ButtonGroup *mBox; }; @@ -449,7 +451,7 @@ class KPrefsWidget : public QWidget private: KPrefs *mPrefs; - QPtrList<KPrefsWid> mPrefsWids; + Q3PtrList<KPrefsWid> mPrefsWids; }; #endif diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 5708dfc..c844627 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -35,11 +35,11 @@ #include <kmessagebox.h> #include <qdir.h> -#include <qprogressbar.h> -#include <qpopupmenu.h> +#include <q3progressbar.h> +#include <q3popupmenu.h> #include <qpushbutton.h> #include <qradiobutton.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qtimer.h> #include <qmessagebox.h> #include <qapplication.h> @@ -50,6 +50,9 @@ #include <qlabel.h> #include <qcheckbox.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <klocale.h> #include <kglobal.h> @@ -59,11 +62,11 @@ QDateTime KSyncManager::mRequestedSyncEvent; -KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) +KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, Q3PopupMenu* syncmenu) : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) { mServerSocket = 0; - bar = new QProgressBar ( 1, 0 ); + bar = new Q3ProgressBar ( 1, 0 ); bar->setCaption (""); mWriteBackInPast = 2; @@ -89,7 +92,7 @@ void KSyncManager::fillSyncMenu() mSyncMenu->insertItem( i18n("Configure..."), 0 ); mSyncMenu->insertSeparator(); - QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); + Q3PopupMenu *clearMenu = new Q3PopupMenu ( mSyncMenu ); mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); clearMenu->insertItem( i18n("For all profiles"), 1 ); clearMenu->insertSeparator(); @@ -355,7 +358,7 @@ void KSyncManager::enableQuick( bool ask ) if ( ask ) { QDialog dia ( 0, "input-dialog", true ); QLineEdit lab ( &dia ); - QVBoxLayout lay( &dia ); + Q3VBoxLayout lay( &dia ); lab.setText( mPrefs->mPassiveSyncPort ); lay.setMargin(7); lay.setSpacing(7); @@ -804,7 +807,7 @@ bool KSyncManager::edit_pisync_options() { QDialog dia( mParent, "dia", true ); dia.setCaption( i18n("Pi-Sync options for device: " ) +mCurrentSyncDevice ); - QVBoxLayout lay ( &dia ); + Q3VBoxLayout lay ( &dia ); lay.setSpacing( 5 ); lay.setMargin( 3 ); QLabel lab1 ( i18n("Password for remote access:"), &dia); @@ -838,8 +841,8 @@ bool KSyncManager::edit_sync_options() QDialog dia( mParent, "dia", true ); dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice ); - QButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia); - QVBoxLayout lay ( &dia ); + Q3ButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia); + Q3VBoxLayout lay ( &dia ); lay.setSpacing( 2 ); lay.setMargin( 3 ); lay.addWidget(&gr); @@ -891,7 +894,7 @@ QString KSyncManager::getPassword( ) QDialog dia ( mParent, "input-dialog", true ); QLineEdit lab ( &dia ); lab.setEchoMode( QLineEdit::Password ); - QVBoxLayout lay( &dia ); + Q3VBoxLayout lay( &dia ); lay.setMargin(7); lay.setSpacing(7); lay.addWidget( &lab); @@ -1334,7 +1337,7 @@ void KSyncManager::readFileFromSocket() } } -KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : QServerSocket( port, backlog, parent, name ) +KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : Q3ServerSocket( port, backlog, parent, name ) { mPendingConnect = 0; mPassWord = pw; @@ -1350,7 +1353,7 @@ void KServerSocket::waitForSocketFinish() QTimer::singleShot( 250, this , SLOT ( waitForSocketFinish())); return; } - mSocket = new QSocket( this ); + mSocket = new Q3Socket( this ); connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); mSocket->setSocket( mPendingConnect ); @@ -1372,7 +1375,7 @@ void KServerSocket::newConnection ( int socket ) mSocket = 0; } mPendingConnect = 0; - mSocket = new QSocket( this ); + mSocket = new Q3Socket( this ); connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); mSocket->setSocket( socket ); @@ -1462,11 +1465,11 @@ void KServerSocket::displayErrorMessage() } void KServerSocket::error_connect( QString errmess ) { - QTextStream os( mSocket ); - os.setEncoding( QTextStream::Latin1 ); + Q3TextStream os( mSocket ); + os.setEncoding( Q3TextStream::Latin1 ); os << errmess ; mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) { + if ( mSocket->state() == Q3Socket::Idle ) { QTimer::singleShot( 0, this , SLOT ( discardClient())); } } @@ -1484,7 +1487,7 @@ void KServerSocket::send_file() mSyncActionDialog->setCaption(i18n("Received sync request")); QLabel* label = new QLabel( i18n("Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog."), mSyncActionDialog ); label->setAlignment ( Qt::AlignHCenter ); - QVBoxLayout* lay = new QVBoxLayout( mSyncActionDialog ); + Q3VBoxLayout* lay = new Q3VBoxLayout( mSyncActionDialog ); lay->addWidget( label); lay->setMargin(7); lay->setSpacing(7); @@ -1536,18 +1539,18 @@ void KServerSocket::send_file() qApp->processEvents(); QString fileName = mFileName; QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { mErrorMessage = 0; end_connect(); error_connect("ERROR_FI\r\n\r\n"); return ; } mSyncActionDialog->setCaption( i18n("Sending file...") ); - QTextStream ts( &file ); - ts.setEncoding( QTextStream::Latin1 ); + Q3TextStream ts( &file ); + ts.setEncoding( Q3TextStream::Latin1 ); - QTextStream os( mSocket ); - os.setEncoding( QTextStream::Latin1 ); + Q3TextStream os( mSocket ); + os.setEncoding( Q3TextStream::Latin1 ); while ( ! ts.atEnd() ) { os << ts.readLine() << "\r\n"; } @@ -1556,7 +1559,7 @@ void KServerSocket::send_file() file.close(); mSyncActionDialog->setCaption( i18n("Waiting for synced file...") ); mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) QTimer::singleShot( 10, this , SLOT ( discardClient())); } void KServerSocket::get_file() @@ -1588,7 +1591,7 @@ void KServerSocket::readBackFileFromSocket() } QString fileName = mFileName; QFile file ( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { delete mSyncActionDialog; mSyncActionDialog = 0; qDebug("KSS:Error open read back file "); @@ -1601,12 +1604,12 @@ void KServerSocket::readBackFileFromSocket() } // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); - QTextStream ts ( &file ); - ts.setEncoding( QTextStream::Latin1 ); + Q3TextStream ts ( &file ); + ts.setEncoding( Q3TextStream::Latin1 ); mSyncActionDialog->setCaption( i18n("Writing file to disk...") ); ts << piFileString; mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) QTimer::singleShot( 10, this , SLOT ( discardClient())); file.close(); piFileString = ""; @@ -1648,8 +1651,8 @@ void KCommandSocket::sendFileRequest() mConnectProgress.setCaption( i18n("Pi-Sync: Connected!") ); mConnectProgress.setLabelText( i18n("Waiting for remote file...") ); mTimerSocket->start( 100, true ); - QTextStream os( mSocket ); - os.setEncoding( QTextStream::Latin1 ); + Q3TextStream os( mSocket ); + os.setEncoding( Q3TextStream::Latin1 ); QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); os << "GET " << mPassWord << curDt << " " << mRemoteResource << "\r\n\r\n"; @@ -1658,7 +1661,7 @@ void KCommandSocket::sendFileRequest() void KCommandSocket::readFile( QString fn ) { if ( !mSocket ) { - mSocket = new QSocket( this ); + mSocket = new Q3Socket( this ); //qDebug("KCS: read file - new socket"); connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) ); connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); @@ -1696,7 +1699,7 @@ void KCommandSocket::updateConnectDialog() void KCommandSocket::writeFile( QString fileName ) { if ( !mSocket ) { - mSocket = new QSocket( this ); + mSocket = new Q3Socket( this ); connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); connect( mSocket, SIGNAL(connected ()), this, SLOT(writeFileToSocket()) ); } @@ -1709,12 +1712,12 @@ void KCommandSocket::writeFileToSocket() { mTimerSocket->stop(); QFile file2( mFileName ); - if (!file2.open( IO_ReadOnly ) ) { + if (!file2.open( QIODevice::ReadOnly ) ) { mConnectProgress.hide(); mConnectCount = -1; mRetVal= errorW; mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) QTimer::singleShot( 10, this , SLOT ( deleteSocket())); return ; } @@ -1724,10 +1727,10 @@ void KCommandSocket::writeFileToSocket() mConnectProgress.setLabelText( i18n("Sending back synced file...") ); mConnectProgress.setProgress( count ); mConnectProgress.blockSignals( true ); - QTextStream ts2( &file2 ); - ts2.setEncoding( QTextStream::Latin1 ); - QTextStream os2( mSocket ); - os2.setEncoding( QTextStream::Latin1 ); + Q3TextStream ts2( &file2 ); + ts2.setEncoding( Q3TextStream::Latin1 ); + Q3TextStream os2( mSocket ); + os2.setEncoding( Q3TextStream::Latin1 ); os2 << "PUT " << mPassWord << " " << mRemoteResource << "\r\n\r\n";; int byteCount = 0; int byteMax = file2.size()/53; @@ -1748,22 +1751,22 @@ void KCommandSocket::writeFileToSocket() os2 << "\r\n"; mRetVal= successW; mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) QTimer::singleShot( 10, this , SLOT ( deleteSocket())); mConnectProgress.blockSignals( false ); } void KCommandSocket::sendStop() { if ( !mSocket ) { - mSocket = new QSocket( this ); + mSocket = new Q3Socket( this ); connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); } mSocket->connectToHost( mHost, mPort ); - QTextStream os2( mSocket ); - os2.setEncoding( QTextStream::Latin1 ); + Q3TextStream os2( mSocket ); + os2.setEncoding( Q3TextStream::Latin1 ); os2 << "STOP\r\n\r\n"; mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) QTimer::singleShot( 10, this , SLOT ( deleteSocket())); } @@ -1829,7 +1832,7 @@ void KCommandSocket::readFileFromSocket() mConnectProgress.hide(); QString fileName = mFileName; QFile file ( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { mFileString = ""; mRetVal = errorR; qDebug("KSS:Error open temp sync file for writing: %s",fileName.latin1() ); @@ -1838,8 +1841,8 @@ void KCommandSocket::readFileFromSocket() } // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); - QTextStream ts ( &file ); - ts.setEncoding( QTextStream::Latin1 ); + Q3TextStream ts ( &file ); + ts.setEncoding( Q3TextStream::Latin1 ); ts << mFileString; file.close(); mFileString = ""; @@ -1847,7 +1850,7 @@ void KCommandSocket::readFileFromSocket() mSocket->close(); // if state is not idle, deleteSocket(); is called via // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) deleteSocket(); } diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 71d17e9..32c6557 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h @@ -24,24 +24,26 @@ #include <qobject.h> #include <qstring.h> -#include <qsocket.h> +#include <q3socket.h> #include <qdatetime.h> -#include <qserversocket.h> -#include <qtextstream.h> +#include <q3serversocket.h> +#include <q3textstream.h> #include <qregexp.h> -#include <qprogressdialog.h> +#include <q3progressdialog.h> +//Added by qt3to4: +#include <Q3PopupMenu> #include <kdialog.h> -class QPopupMenu; +class Q3PopupMenu; class KSyncProfile; class KPimPrefs; class QWidget; class KSyncManager; class KSyncInterface; -class QProgressBar; +class Q3ProgressBar; -class KServerSocket : public QServerSocket +class KServerSocket : public Q3ServerSocket { Q_OBJECT @@ -74,7 +76,7 @@ class KServerSocket : public QServerSocket void end_connect(); void error_connect( QString ); QDialog* mSyncActionDialog; - QSocket* mSocket; + Q3Socket* mSocket; QString mPassWord; QString mFileName; QTime piTime; @@ -108,7 +110,7 @@ class KCommandSocket : public QObject int mConnectMax; KProgressDialog mConnectProgress; QWidget* tlw; - QSocket* mSocket; + Q3Socket* mSocket; QString mPassWord; Q_UINT16 mPort; QString mHost; @@ -132,7 +134,7 @@ class KSyncManager : public QObject KAPI = 1, PWMPI = 2 }; - KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); + KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, Q3PopupMenu* syncmenu); ~KSyncManager() ; void multiSync( bool askforPrefs ); @@ -219,8 +221,8 @@ class KSyncManager : public QObject QWidget* mParent; KSyncInterface* mImplementation; TargetApp mTargetApp; - QPopupMenu* mSyncMenu; - QProgressBar* bar; + Q3PopupMenu* mSyncMenu; + Q3ProgressBar* bar; bool mSyncWithDesktop; private slots: diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 2b87298..fd5bbca 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp @@ -23,28 +23,32 @@ #include <qlayout.h> #include <qlabel.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> +#include <q3groupbox.h> +#include <q3buttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> #include <qdir.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qcombobox.h> -#include <qvbox.h> -#include <qhbox.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qspinbox.h> #include <qdatetime.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> -#include <qstrlist.h> +#include <q3strlist.h> #include <qapplication.h> #include <qlayout.h> -#include <qscrollview.h> -#include <qvgroupbox.h> -#include <qhgroupbox.h> +#include <q3scrollview.h> +#include <q3vgroupbox.h> +#include <q3hgroupbox.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <Q3Frame> #include <kcolorbutton.h> #include <kdebug.h> @@ -89,11 +93,11 @@ void KSyncPrefsDialog::setupSyncAlgTab() { QLabel * lab; //QFrame *page = addPage(i18n("Sync Prefs"),0,0); - QVBox * mainbox = new QVBox( this ); - QScrollView* sv = new QScrollView( mainbox ); - QHBoxLayout * lay = new QHBoxLayout( this ); + Q3VBox * mainbox = new Q3VBox( this ); + Q3ScrollView* sv = new Q3ScrollView( mainbox ); + Q3HBoxLayout * lay = new Q3HBoxLayout( this ); lay->addWidget( mainbox ); - QHBox * b_box = new QHBox( mainbox ); + Q3HBox * b_box = new Q3HBox( mainbox ); QPushButton* button = new QPushButton( i18n("Ok"), b_box ); connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) ); @@ -101,11 +105,11 @@ void KSyncPrefsDialog::setupSyncAlgTab() connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) ); //QBoxLayout * sl = new QVBoxLayout(this ); //sl->addWidget ( sv ); - sv->setResizePolicy ( QScrollView::AutoOneFit ); - QFrame *topFrame = new QFrame ( sv ); + sv->setResizePolicy ( Q3ScrollView::AutoOneFit ); + Q3Frame *topFrame = new Q3Frame ( sv ); sv->addChild( topFrame ); mSetupSyncAlgTab = topFrame; - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); @@ -120,7 +124,7 @@ void KSyncPrefsDialog::setupSyncAlgTab() topLayout->addWidget(mMyMachineName,iii,1); ++iii; - QHBox* buttonbox = new QHBox( topFrame); + Q3HBox* buttonbox = new Q3HBox( topFrame); topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1); ++iii; button = new QPushButton( i18n("New profile"), buttonbox ); @@ -145,7 +149,7 @@ void KSyncPrefsDialog::setupSyncAlgTab() - QHGroupBox *iims = new QHGroupBox( i18n("Multiple Sync options"), topFrame); + Q3HGroupBox *iims = new Q3HGroupBox( i18n("Multiple Sync options"), topFrame); new QLabel( i18n("Include in multiple "), iims ); mIncludeInRing = new QCheckBox( i18n("calendar "), iims ); mIncludeInRingAB = new QCheckBox( i18n("addressbook "), iims ); @@ -153,19 +157,19 @@ void KSyncPrefsDialog::setupSyncAlgTab() new QLabel( i18n(" sync"), iims ); topLayout->addMultiCellWidget(iims, iii,iii,0,1); ++iii; - QVGroupBox* gb0 = new QVGroupBox( i18n("Sync algo options"), topFrame); + Q3VGroupBox* gb0 = new Q3VGroupBox( i18n("Sync algo options"), topFrame); topLayout->addMultiCellWidget(gb0, iii,iii,0,1); ++iii; - QButtonGroup* gr; + Q3ButtonGroup* gr; { - QVGroupBox* topFrame = gb0; + Q3VGroupBox* topFrame = gb0; mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); //topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); //++iii; - gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); + gr = new Q3ButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); //topLayout->addMultiCellWidget(gr, iii,iii,0,1); //++iii; loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); @@ -181,21 +185,21 @@ void KSyncPrefsDialog::setupSyncAlgTab() //++iii; #if 0 - QHGroupBox* gb51 = new QHGroupBox( i18n("Local resources to sync with:"), topFrame); + Q3HGroupBox* gb51 = new Q3HGroupBox( i18n("Local resources to sync with:"), topFrame); { - QVBox * fibo2 = new QVBox ( gb51 ); + Q3VBox * fibo2 = new Q3VBox ( gb51 ); new QLabel ( i18n("Calendar resources:"), fibo2 ); //mFilterInCal = new QComboBox( fibo2 ); - fibo2 = new QVBox ( gb51 ); + fibo2 = new Q3VBox ( gb51 ); new QLabel ( i18n("Addressbook resources:"), fibo2 ); //mFilterInAB = new QComboBox( fibo2 ); } #endif - QHGroupBox* gb5 = new QHGroupBox( i18n("Apply filter when adding data to local:"), topFrame); - QVBox * fibo2 = new QVBox ( gb5 ); + Q3HGroupBox* gb5 = new Q3HGroupBox( i18n("Apply filter when adding data to local:"), topFrame); + Q3VBox * fibo2 = new Q3VBox ( gb5 ); new QLabel ( i18n("Incoming calendar filter:"), fibo2 ); mFilterInCal = new QComboBox( fibo2 ); - fibo2 = new QVBox ( gb5 ); + fibo2 = new Q3VBox ( gb5 ); new QLabel ( i18n("Incoming addressbook filter:"), fibo2 ); mFilterInAB = new QComboBox( fibo2 ); @@ -203,17 +207,17 @@ void KSyncPrefsDialog::setupSyncAlgTab() // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); // ++iii; - QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame); + Q3VGroupBox* gb2 = new Q3VGroupBox( i18n("Write back options"), topFrame); //topLayout->addMultiCellWidget(gb2, iii,iii,0,1); //++iii; { - QVGroupBox*topFrame = gb2; + Q3VGroupBox*topFrame = gb2; mWriteBackExisting= new QCheckBox( i18n("Write back (on remote) existing entries only"), topFrame ); - QHGroupBox* gb4 = new QHGroupBox( i18n("Apply filter when adding data to remote:"), topFrame); - QVBox * fibo = new QVBox ( gb4 ); + Q3HGroupBox* gb4 = new Q3HGroupBox( i18n("Apply filter when adding data to remote:"), topFrame); + Q3VBox * fibo = new Q3VBox ( gb4 ); new QLabel ( i18n("Outgoing calendar filter:"), fibo ); mFilterOutCal = new QComboBox( fibo ); - fibo = new QVBox ( gb4 ); + fibo = new Q3VBox ( gb4 ); new QLabel ( i18n("Outgoing addressbook filter:"), fibo ); mFilterOutAB = new QComboBox( fibo ); //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); @@ -221,15 +225,15 @@ void KSyncPrefsDialog::setupSyncAlgTab() mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame ); //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); //++iii; - QVGroupBox* gb3 = new QVGroupBox( i18n("Time period"), topFrame); + Q3VGroupBox* gb3 = new Q3VGroupBox( i18n("Time period"), topFrame); connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) ); new QLabel( i18n("From ") , gb3 ); - QHBox * tf1 = new QHBox ( gb3 ); + Q3HBox * tf1 = new Q3HBox ( gb3 ); mWriteBackPastWeeks= new QSpinBox(1,104, 1, tf1 ); mWriteBackPastWeeks->setMaximumWidth( 100 ); new QLabel( i18n(" weeks in the past to ") ,tf1 ); - QHBox * tf2 = new QHBox ( gb3 ); + Q3HBox * tf2 = new Q3HBox ( gb3 ); mWriteBackFutureWeeks= new QSpinBox(1,104, 1, tf2); mWriteBackFutureWeeks->setMaximumWidth( 100 ); new QLabel( i18n(" weeks in the future ") , tf2 ); @@ -241,7 +245,7 @@ void KSyncPrefsDialog::setupSyncAlgTab() connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) ); } - proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); + proGr = new Q3ButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); gr = proGr; topLayout->addMultiCellWidget(gr, iii,iii,0,1); ++iii; @@ -255,7 +259,7 @@ void KSyncPrefsDialog::setupSyncAlgTab() mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); - QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame); + Q3VGroupBox* gb1 = new Q3VGroupBox( i18n("Profile kind specific settings"), topFrame); topLayout->addMultiCellWidget(gb1, iii,iii,0,1); ++iii; @@ -263,48 +267,48 @@ void KSyncPrefsDialog::setupSyncAlgTab() // Profile kind specific settings { // *** phone ******************************* - QVGroupBox* topFrame = gb1; - phoneWidget = new QVBox( topFrame); + Q3VGroupBox* topFrame = gb1; + phoneWidget = new Q3VBox( topFrame); //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); //++iii; mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); - QHBox* temphb = new QHBox( phoneWidget ); + Q3HBox* temphb = new Q3HBox( phoneWidget ); new QLabel( i18n("I/O device: "), temphb ); mPhoneDevice = new QLineEdit( temphb); button = new QPushButton( i18n("Help..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); - temphb = new QHBox( phoneWidget ); + temphb = new Q3HBox( phoneWidget ); new QLabel( i18n("Connection: "), temphb ); mPhoneConnection = new QLineEdit( temphb); button = new QPushButton( i18n("Help..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); - temphb = new QHBox( phoneWidget ); + temphb = new Q3HBox( phoneWidget ); new QLabel( i18n("Model(opt.): "), temphb ); mPhoneModel = new QLineEdit( temphb); button = new QPushButton( i18n("Help..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); // *** local******************************* - localFileWidget = new QVBox( topFrame); + localFileWidget = new Q3VBox( topFrame); //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); //++iii; - temphb = new QHBox( localFileWidget ); + temphb = new Q3HBox( localFileWidget ); lab = new QLabel( i18n("Local file Cal:"), temphb ); lab = new QLabel( i18n("Local file ABook:"), temphb ); lab = new QLabel( i18n("Local file PWMgr:"), temphb ); - temphb = new QHBox( localFileWidget ); + temphb = new Q3HBox( localFileWidget ); button = new QPushButton( i18n("Choose..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); button = new QPushButton( i18n("Choose..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); button = new QPushButton( i18n("Choose..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); - temphb = new QHBox( localFileWidget ); + temphb = new Q3HBox( localFileWidget ); mRemoteFile = new QLineEdit( temphb); mRemoteFileAB = new QLineEdit( temphb); @@ -313,34 +317,34 @@ void KSyncPrefsDialog::setupSyncAlgTab() // *** remote******************************* - remoteFileWidget = new QVBox( topFrame); + remoteFileWidget = new Q3VBox( topFrame); //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); //++iii; - temphb = new QHBox( remoteFileWidget ); + temphb = new Q3HBox( remoteFileWidget ); new QLabel( i18n("Calendar:"), temphb); new QLabel( i18n("AddressBook:"), temphb); new QLabel( i18n("PWManager:"), temphb); lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); - temphb = new QHBox( remoteFileWidget ); + temphb = new Q3HBox( remoteFileWidget ); mRemotePrecommand = new QLineEdit(temphb); mRemotePrecommandAB = new QLineEdit(temphb); mRemotePrecommandPWM = new QLineEdit(temphb); lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); - temphb = new QHBox( remoteFileWidget ); + temphb = new Q3HBox( remoteFileWidget ); mLocalTempFile = new QLineEdit(temphb); mLocalTempFileAB = new QLineEdit(temphb); mLocalTempFilePWM = new QLineEdit(temphb); lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); - temphb = new QHBox( remoteFileWidget ); + temphb = new Q3HBox( remoteFileWidget ); mRemotePostcommand = new QLineEdit(temphb ); mRemotePostcommandAB = new QLineEdit(temphb ); mRemotePostcommandPWM = new QLineEdit(temphb ); mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget ); lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); - temphb = new QHBox( remoteFileWidget ); + temphb = new Q3HBox( remoteFileWidget ); button = new QPushButton( i18n("ssh/scp"), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); button = new QPushButton( i18n("ftp"), temphb ); @@ -348,37 +352,37 @@ void KSyncPrefsDialog::setupSyncAlgTab() lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); // *** pi-sync******************************* - piWidget = new QVBox( topFrame); + piWidget = new Q3VBox( topFrame); //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); //++iii; - temphb = new QHBox( piWidget ); + temphb = new Q3HBox( piWidget ); new QLabel( i18n("Calendar:"), temphb); new QLabel( i18n("AddressBook:"), temphb); new QLabel( i18n("PWManager:"), temphb); lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget); - temphb = new QHBox( piWidget ); + temphb = new Q3HBox( piWidget ); mRemotePw = new QLineEdit(temphb); mRemotePwAB = new QLineEdit(temphb); mRemotePwPWM = new QLineEdit(temphb); lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget); - temphb = new QHBox( piWidget ); + temphb = new Q3HBox( piWidget ); mRemoteIP = new QLineEdit(temphb); mRemoteIPAB = new QLineEdit(temphb); mRemoteIPPWM = new QLineEdit(temphb); lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget); - temphb = new QHBox( piWidget ); + temphb = new Q3HBox( piWidget ); mRemotePort = new QLineEdit(temphb); mRemotePortAB = new QLineEdit(temphb); mRemotePortPWM = new QLineEdit(temphb); lab = new QLabel( i18n("Local/remote Resource sync partners (Leave empty to not sync)"), piWidget); - mTableBox = new QHBox( piWidget ); - mResTableKopi = new QTable( 1, 1, mTableBox ); - mResTableKapi = new QTable( 1, 1, mTableBox ); - mResTablePwmpi = new QTable( 1, 1, mTableBox ); + mTableBox = new Q3HBox( piWidget ); + mResTableKopi = new Q3Table( 1, 1, mTableBox ); + mResTableKapi = new Q3Table( 1, 1, mTableBox ); + mResTablePwmpi = new Q3Table( 1, 1, mTableBox ); mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") ); mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") ); mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); @@ -468,7 +472,7 @@ void KSyncPrefsDialog::slotOK() } int i; for (i = 0; i < mSyncProfileNames.count(); ++ i) { - if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { + if ( mSyncProfileNames.count( mSyncProfileNames[i]) > 1 ) { KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); return; } diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h index d8c02de..1d7503e 100644 --- a/libkdepim/ksyncprefsdialog.h +++ b/libkdepim/ksyncprefsdialog.h @@ -25,9 +25,9 @@ #include <kdialogbase.h> -#include <qptrlist.h> -#include <qtable.h> -#include <qhbox.h> +#include <q3ptrlist.h> +#include <q3table.h> +#include <q3hbox.h> //#include <libkdepim/kprefsdialog.h> @@ -38,9 +38,9 @@ class QCheckBox; class QSlider; class KURLRequester; class QComboBox; -class QButtonGroup; +class Q3ButtonGroup; class QLineEdit; -class QVBox; +class Q3VBox; class QStringList; class KSyncProfile; @@ -86,7 +86,7 @@ class KSyncPrefsDialog : public KDialog private: void updateMyCaption(); int currentSelection; - QPtrList<KSyncProfile> mSyncProfiles; + Q3PtrList<KSyncProfile> mSyncProfiles; QStringList mSyncProfileNames; QStringList mFilterKapi; QStringList mFilterKopi; @@ -105,11 +105,11 @@ class KSyncPrefsDialog : public KDialog void addProfile ( KSyncProfile* ); void insertProfiles(); void saveProfile(); - QButtonGroup* proGr; - QHBox * mTableBox; - QTable* mResTableKopi; - QTable* mResTableKapi; - QTable* mResTablePwmpi; + Q3ButtonGroup* proGr; + Q3HBox * mTableBox; + Q3Table* mResTableKopi; + Q3Table* mResTableKapi; + Q3Table* mResTablePwmpi; QComboBox * mFilterOutCal; QComboBox * mFilterInCal; @@ -152,10 +152,10 @@ class KSyncPrefsDialog : public KDialog QLineEdit * mPhoneModel; QWidget* mSetupSyncAlgTab; - QVBox* localFileWidget; - QVBox* remoteFileWidget; - QVBox* phoneWidget; - QVBox* piWidget; + Q3VBox* localFileWidget; + Q3VBox* remoteFileWidget; + Q3VBox* phoneWidget; + Q3VBox* piWidget; QCheckBox* mWriteBackFile; QCheckBox* mWriteBackFuture; QSpinBox* mWriteBackFutureWeeks; diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h index 91fcfc5..1e41662 100644 --- a/libkdepim/ksyncprofile.h +++ b/libkdepim/ksyncprofile.h @@ -20,7 +20,7 @@ #ifndef _KSYNCPROFILE_H #define _KSYNCPROFILE_H -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qcolor.h> #include <qfont.h> #include <qstringlist.h> diff --git a/libkdepim/libkdepim.pro b/libkdepim/libkdepim.pro index 7160d0e..fb27311 100644 --- a/libkdepim/libkdepim.pro +++ b/libkdepim/libkdepim.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG = qt warn_on DEFINES +=KORG_NOKABC -TARGET = microkdepim +TARGET = xmicrokdepim INCLUDEPATH += ../microkde ../microkde/kdecore ../microkde/kdeui . .. DESTDIR=../bin @@ -74,3 +74,5 @@ SOURCES += ol_access.cpp #olimport section end } } +#The following line was inserted by qt3to4 +QT += 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,9 +1,9 @@ TEMPLATE = lib CONFIG += qt warn_on -TARGET = microkdepim +TARGET = xmicrokdepim INCLUDEPATH += . $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(QPEDIR)/include -LIBS += -lmicrokde -#LIBS += -lmicrokcal +LIBS += -lxmicrokde +#LIBS += -lxmicrokcal LIBS += -L$(QPEDIR)/lib OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) 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 @@ -22,21 +22,21 @@ */ #include <qtooltip.h> -#include <qframe.h> +#include <q3frame.h> #include <qpixmap.h> #include <qlayout.h> -#include <qprogressbar.h> -#include <qprogressdialog.h> -#include <qwidgetstack.h> +#include <q3progressbar.h> +#include <q3progressdialog.h> +#include <q3widgetstack.h> #include <qdatetime.h> #include <qdir.h> #include <qpushbutton.h> #include <qregexp.h> #include <qapplication.h> -#include <qhbox.h> -#include <qheader.h> +#include <q3hbox.h> +#include <q3header.h> #include <qdatetime.h> -#include <qlistview.h> +#include <q3listview.h> #include <kdebug.h> #include <klocale.h> @@ -54,13 +54,13 @@ #include <comutil.h> -class OLEListViewItem : public QCheckListItem +class OLEListViewItem : public Q3CheckListItem { public: - OLEListViewItem( QListView *parent, QString text ) : - QCheckListItem( parent, text, QCheckListItem::CheckBox ) { ; }; - OLEListViewItem( QListViewItem *after, QString text ) : - QCheckListItem( after, text, QCheckListItem::CheckBox ) { ; }; + OLEListViewItem( Q3ListView *parent, QString text ) : + Q3CheckListItem( parent, text, Q3CheckListItem::CheckBox ) { ; }; + OLEListViewItem( Q3ListViewItem *after, QString text ) : + Q3CheckListItem( after, text, Q3CheckListItem::CheckBox ) { ; }; ~OLEListViewItem() {}; void setData( DWORD data ) {mData= data; }; void setDataID( QString data ){ mDataID = data ;} @@ -78,15 +78,15 @@ class OLEFolderSelect : public KDialogBase KDialogBase( Plain, "", Ok | Cancel, Ok, 0, "", true, false, i18n("Import!") ) { - QHBox * mw = new QHBox( this ); + Q3HBox * mw = new Q3HBox( this ); setMainWidget( mw ); - mListView = new QListView( mw ); + mListView = new Q3ListView( mw ); mListView->addColumn(i18n("Select Folder")); mListView->addColumn(i18n("Content Type")); } - QListView* listView() { return mListView;} + Q3ListView* listView() { return mListView;} private: - QListView* mListView; + Q3ListView* mListView; }; OL_access *OL_access::sInstance = 0; @@ -149,7 +149,7 @@ void OL_access::readContactData( LPDISPATCH dispItem, KABC::Addressee::List* li if ( syncMode ) { cap = i18n("Reading contact data..."); } - QProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(), 0 ); + Q3ProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(), 0 ); bar.setCaption (i18n("Accessing OL") ); int h = bar.sizeHint().height() ; int w = 300; @@ -173,7 +173,7 @@ void OL_access::readContactData( LPDISPATCH dispItem, KABC::Addressee::List* li QStringList OL_access::getFolderSelection( int type , QString caption ) { OLEFolderSelect folder_dialog; - QListView * listView = folder_dialog.listView(); + Q3ListView * listView = folder_dialog.listView(); MAPIFolder mfInbox; MAPIFolder mfRoot; CString szName; @@ -1135,13 +1135,13 @@ DATE Qdt2date( QDateTime dt ) return ddd; } -class OLEListViewItem : public QCheckListItem +class OLEListViewItem : public Q3CheckListItem { public: - OLEListViewItem( QListView *parent, QString text ) : - QCheckListItem( parent, text, QCheckListItem::CheckBox ) { ; }; - OLEListViewItem( QListViewItem *after, QString text ) : - QCheckListItem( after, text, QCheckListItem::CheckBox ) { ; }; + OLEListViewItem( Q3ListView *parent, QString text ) : + Q3CheckListItem( parent, text, Q3CheckListItem::CheckBox ) { ; }; + OLEListViewItem( Q3ListViewItem *after, QString text ) : + Q3CheckListItem( after, text, Q3CheckListItem::CheckBox ) { ; }; ~OLEListViewItem() {}; void setData( DWORD data ) {mData= data; }; void setDataID( QString data ){ mDataID = data ;} @@ -1159,9 +1159,9 @@ KAImportOLdialog::KAImportOLdialog( const QString &caption, parent, caption, true, false, i18n("Import!") ) { mSyncMode = false; - QHBox * mw = new QHBox( this ); + Q3HBox * mw = new Q3HBox( this ); setMainWidget( mw ); - mListView = new QListView( mw ); + mListView = new Q3ListView( mw ); mListView->addColumn(i18n("Select Folder")); mListView->addColumn(i18n("Content Type")); mABook = aBook; @@ -1303,7 +1303,7 @@ void KAImportOLdialog::readContactData( DWORD folder ) if ( mSyncMode ) { cap = i18n("Reading contact data..."); } - QProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(),this); + Q3ProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(),this); bar.setCaption (i18n("Accessing OL") ); int h = bar.sizeHint().height() ; int w = 300; 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 @@ -37,7 +37,7 @@ #define OL_CALENDAR_DATA 1 //pending is this the right number class QDateTime; -class QListView; +class Q3ListView; class OLEListViewItem; class _ContactItem; class OL_access : public QObject @@ -132,7 +132,7 @@ class KAImportOLdialog : public KDialogBase void readContactData( DWORD folder ); KABC::AddressBook * mABook; - QListView * mListView; + Q3ListView * mListView; KABC::Addressee::List mAList; bool addAddressee( KABC::Addressee a ); private: diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp index 89db22b..0ea73f5 100644 --- a/libkdepim/phoneaccess.cpp +++ b/libkdepim/phoneaccess.cpp @@ -22,11 +22,12 @@ #include <qstring.h> #include <qapplication.h> -#include <qptrlist.h> +#include <QDesktopWidget> +#include <q3ptrlist.h> #include <qregexp.h> #include <qfile.h> #include <qlabel.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <qdir.h> #include <kmessagebox.h> @@ -46,12 +47,14 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model bool addPort = true, addConnection = true, addModel = true; QFile file( fileName ); if ( QFile::exists( fileName) ) { - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { qDebug("Error: cannot open %s ", fileName.latin1() ); return; } QString line; - while ( file.readLine( line, 1024 ) > 0 ) { + char tmp[1024]; + while ( file.readLine( tmp, 1024 ) > 0 ) { + line = tmp; //qDebug("*%s* ", line.latin1() ); if ( line.left(7 ) == "[gammu]" ) { ; @@ -115,12 +118,12 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model content += "\n"; } if ( write ) { - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { qDebug("Error: cannot write file %s ", fileName.latin1() ); return; } qDebug("Writing file %s ", fileName.latin1() ); - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts << content ; file.close(); } diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index 72c4e60..4172cd0 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp @@ -38,21 +38,30 @@ #include "qdrawutil.h" #include "qbitmap.h" #if QT_VERSION >= 0x030000 -#include "qptrlist.h" -#include "qmemarray.h" +#include "q3ptrlist.h" +#include "q3memarray.h" #else #include <qlist.h> #include <qarray.h> -#define QPtrList QList -#define QMemArray QArray +#define Q3PtrList QList +#define Q3MemArray QArray #endif #include "qlayoutengine_p.h" -#include "qobjectlist.h" +#include "qobject.h" #include "qstyle.h" #include "qapplication.h" //sendPostedEvents -#include <qvaluelist.h> +#include <q3valuelist.h> #include <qcursor.h> -#include <qframe.h> +#include <q3frame.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3PointArray> +#include <QPixmap> +#include <QResizeEvent> +#include <QMouseEvent> +#include <QChildEvent> +#include <QEvent> +#include <QPaintEvent> #ifndef KDGANTT_MASTER_CVS //#include "KDGanttMinimizeSplitter.moc" #endif @@ -65,10 +74,10 @@ static int mouseOffset; static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky -class KDRubberBand: public QFrame +class KDRubberBand: public Q3Frame { public: - KDRubberBand( QWidget *parent, const char * name, WFlags f ) :QFrame ( parent, name, f ) {;} + KDRubberBand( QWidget *parent, const char * name, Qt::WFlags f ) :Q3Frame ( parent, name, f ) {;} protected: virtual void mousePressEvent ( QMouseEvent * ) @@ -80,9 +89,10 @@ protected: KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, KDGanttMinimizeSplitter *parent, const char * name ) - : QWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) + : _activeButton( 0 ), _collapsed( false ) { - + setObjectName(name); + setParent(parent); if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->width() < 650 ) { mSizeHint = QSize(7,7); mUseOffset = true; @@ -106,10 +116,10 @@ void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) { orient = o; #ifndef QT_NO_CURSOR - if ( o == KDGanttMinimizeSplitter::Horizontal ) - setCursor( splitHCursor ); + if ( o == Qt::Horizontal ) + setCursor( Qt::splitHCursor ); else - setCursor( splitVCursor ); + setCursor( Qt::splitVCursor ); #endif } @@ -117,7 +127,7 @@ void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) { updateCursor( e->pos() ); - if ( !(e->state()&LeftButton) ) + if ( !(e->state()&Qt::LeftButton) ) return; if ( _activeButton != 0) @@ -137,7 +147,7 @@ void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) { - if ( e->button() == LeftButton ) { + if ( e->button() == Qt::LeftButton ) { _activeButton = onButton( e->pos() ); mouseOffset = s->pick(e->pos()); mMouseDown = true; @@ -149,13 +159,13 @@ void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) void KDGanttSplitterHandle::updateCursor( const QPoint& p) { if ( onButton( p ) != 0 ) { - setCursor( arrowCursor ); + setCursor( Qt::arrowCursor ); } else { - if ( orient == KDGanttMinimizeSplitter::Horizontal ) - setCursor( splitHCursor ); + if ( orient == Qt::Horizontal ) + setCursor( Qt::splitHCursor ); else - setCursor( splitVCursor ); + setCursor( Qt::splitVCursor ); } } void KDGanttSplitterHandle::toggle() @@ -195,7 +205,7 @@ void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) updateCursor( e->pos() ); } else { - if ( !opaque() && e->button() == LeftButton ) { + if ( !opaque() && e->button() == Qt::LeftButton ) { QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) - mouseOffset; s->setRubberband( -1 ); @@ -211,10 +221,10 @@ void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) int KDGanttSplitterHandle::onButton( const QPoint& p ) { - QValueList<QPointArray> list = buttonRegions(); + Q3ValueList<Q3PointArray> list = buttonRegions(); int index = 1; int add = 12; - for( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { + for( Q3ValueList<Q3PointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { QRect rect = (*it).boundingRect(); rect.setLeft( rect.left()- add ); rect.setRight( rect.right() + add); @@ -229,16 +239,16 @@ int KDGanttSplitterHandle::onButton( const QPoint& p ) } -QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions() +Q3ValueList<Q3PointArray> KDGanttSplitterHandle::buttonRegions() { - QValueList<QPointArray> list; + Q3ValueList<Q3PointArray> list; int sw = 8; int yyy = 1; int xxx = 1; int voffset[] = { (int) -sw*3, (int) sw*3 }; for ( int i = 0; i < 2; i++ ) { - QPointArray arr; + Q3PointArray arr; if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right || _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left) { int mid = height()/2 + voffset[i]; @@ -311,11 +321,11 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) p.setBrush( col ); p.setPen( col ); - QValueList<QPointArray> list = buttonRegions(); + Q3ValueList<Q3PointArray> list = buttonRegions(); int index = 1; if ( mUseOffset ) p.translate( 0, 1 ); - for ( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( Q3ValueList<Q3PointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { if ( index == _activeButton ) { /* @@ -377,12 +387,12 @@ class QSplitterData public: QSplitterData() : opaque( FALSE ), firstShow( TRUE ) {} - QPtrList<QSplitterLayoutStruct> list; + Q3PtrList<QSplitterLayoutStruct> list; bool opaque; bool firstShow; }; -void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, +void kdganttGeomCalc( Q3MemArray<QLayoutStruct> &chain, int start, int count, int pos, int space, int spacer ); #endif // DOXYGEN_SKIP_INTERNAL @@ -461,12 +471,13 @@ static QSize minSizeHint( const QWidget* w ) name arguments being passed on to the QFrame constructor. */ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *name ) - :QFrame(parent,name,WPaintUnclipped) + :Q3Frame(parent,name) { + setAttribute(Qt::WA_PaintUnclipped); mRubberBand = 0; mFirstHandle = 0; #if QT_VERSION >= 232 - orient = Horizontal; + orient = Qt::Horizontal; init(); #endif } @@ -475,10 +486,10 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *n Constructs a splitter with orientation \a o with the \a parent and \a name arguments being passed on to the QFrame constructor. */ -KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent, const char *name ) - :QFrame(parent,name,WPaintUnclipped) +KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Qt::Orientation o, QWidget *parent, const char *name ) + :Q3Frame(parent,name) { - + setAttribute(Qt::WA_PaintUnclipped); mRubberBand = 0; mFirstHandle = 0; #if QT_VERSION >= 232 @@ -505,7 +516,7 @@ KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() void KDGanttMinimizeSplitter::init() { data = new QSplitterData; - if ( orient == Horizontal ) + if ( orient == Qt::Horizontal ) setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) ); else setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) ); @@ -534,14 +545,14 @@ void KDGanttMinimizeSplitter::toggle() By default the orientation is horizontal (the widgets are side by side). The possible orientations are Qt:Vertical and Qt::Horizontal (the default). */ -void KDGanttMinimizeSplitter::setOrientation( Orientation o ) +void KDGanttMinimizeSplitter::setOrientation( Qt::Orientation o ) { #if QT_VERSION >= 232 if ( orient == o ) return; orient = o; - if ( orient == Horizontal ) + if ( orient == Qt::Horizontal ) setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); else setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) ); @@ -600,7 +611,7 @@ QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( QWidget *w, bool firs s = new QSplitterLayoutStruct; s->mode = Stretch; s->wid = w; - if ( !testWState( WState_Resized ) && w->sizeHint().isValid() ) + if ( !testAttribute( Qt::WA_Resized ) && w->sizeHint().isValid() ) s->sizer = pick( w->sizeHint() ); else s->sizer = pick( w->size() ); @@ -621,20 +632,26 @@ QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( QWidget *w, bool firs */ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) { - if ( c->type() == QEvent::ChildInserted ) { + if ( c->type() == QEvent::ChildAdded ) { if ( !c->child()->isWidgetType() ) return; - if ( ((QWidget*)c->child())->testWFlags( WType_TopLevel ) ) + QWidget *cw = (QWidget*)c->child(); + + if ( (cw->windowFlags())&Qt::Window ) + return; + + // avoid infinite recursion + if(cw->objectName().startsWith("qt_splithandle_")) return; QSplitterLayoutStruct *s = data->list.first(); while ( s ) { - if ( s->wid == c->child() ) + if ( s->wid == cw ) return; s = data->list.next(); } - addWidget( (QWidget*)c->child() ); + addWidget( cw ); recalc( isVisible() ); } else if ( c->type() == QEvent::ChildRemoved ) { @@ -670,17 +687,17 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) { #ifdef DESKTOP_VERSION QPainter paint( this ); - paint.setPen( gray ); - paint.setBrush( gray ); - paint.setRasterOp( XorROP ); + paint.setPen( Qt::gray ); + paint.setBrush( Qt::gray ); + paint.setCompositionMode( QPainter::CompositionMode_Xor ); QRect r = contentsRect(); const int rBord = 3; //Themable???? #if QT_VERSION >= 0x030000 - int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); + int sw = style()->pixelMetric(QStyle::PM_SplitterWidth, 0, this); #else int sw = style().splitterWidth(); #endif - if ( orient == Horizontal ) { + if ( orient == Qt::Horizontal ) { if ( opaqueOldPos >= 0 ) paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(), 2*rBord, r.height() ); @@ -696,7 +713,7 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) opaqueOldPos = p; #else if ( !mRubberBand ) { - mRubberBand = new KDRubberBand( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); + mRubberBand = new KDRubberBand( 0, "rubber", Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop); mRubberBand->setFrameStyle( Box | Raised ); //mRubberBand->setPalette( QPalette ( Qt::red.light(),Qt::red.dark() ) ); mRubberBand->setPalette( QPalette ( colorGroup().background().light(), colorGroup().background().dark() )); @@ -710,7 +727,7 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) rBord = 4; } int sw = style().splitterWidth(); - if ( orient == Horizontal ) { + if ( orient == Qt::Horizontal ) { if ( p >= 0 ) { QPoint geo = mapToGlobal (QPoint ( p + sw/2 - rBord, r.y())); mRubberBand->setGeometry( geo.x(), geo.y(), 2*rBord, r.height() ); @@ -732,7 +749,7 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) /*! \reimp */ bool KDGanttMinimizeSplitter::event( QEvent *e ) { - if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) { + if ( e->type() == QEvent::LayoutRequest || ( e->type() == QEvent::Show && data->firstShow ) ) { recalc( isVisible() ); if ( e->type() == QEvent::Show ) data->firstShow = FALSE; @@ -755,7 +772,7 @@ void KDGanttMinimizeSplitter::drawSplitter( QPainter *p, // LR style().drawPrimitive(QStyle::PE_Splitter, p, QRect(x, y, w, h), colorGroup(), (orientation() == Qt::Horizontal ? - QStyle::Style_Horizontal : 0)); + QStyle::State_Horizontal : 0)); #endif } @@ -796,9 +813,9 @@ void KDGanttMinimizeSplitter::moveSplitter( QCOORD p, int id ) { p = adjustPos( p, id ); QSplitterLayoutStruct *s = data->list.at(id); - int oldP = orient == Horizontal ? s->wid->x() : s->wid->y(); + int oldP = orient == Qt::Horizontal ? s->wid->x() : s->wid->y(); bool upLeft; - if ( false && orient == Horizontal ) { + if ( false && orient == Qt::Horizontal ) { p += s->wid->width(); upLeft = p > oldP; } else @@ -813,8 +830,8 @@ void KDGanttMinimizeSplitter::moveSplitter( QCOORD p, int id ) void KDGanttMinimizeSplitter::setG( QWidget *w, int p, int s, bool isSplitter ) { - if ( orient == Horizontal ) { - if ( false && orient == Horizontal && !isSplitter ) + if ( orient == Qt::Horizontal ) { + if ( false && orient == Qt::Horizontal && !isSplitter ) p = contentsRect().width() - p - s; w->setGeometry( p, contentsRect().y(), s, contentsRect().height() ); } else @@ -840,7 +857,7 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) } else if ( s->isSplitter ) { int pos1, pos2; int dd = s->sizer; - if( false && orient == Horizontal ) { + if( false && orient == Qt::Horizontal ) { pos1 = pos; pos2 = pos + dd; } else { @@ -856,7 +873,7 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) } } else { int dd, newLeft, nextPos; - if( false && orient == Horizontal ) { + if( false && orient == Qt::Horizontal ) { dd = w->geometry().right() - pos; dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); newLeft = pos+1; @@ -893,7 +910,7 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) } else if ( s->isSplitter ) { int dd = s->sizer; int pos1, pos2; - if( false && orient == Horizontal ) { + if( false && orient == Qt::Horizontal ) { pos2 = pos - dd; pos1 = pos2 + 1; } else { @@ -910,7 +927,7 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) } else { int left = pick( w->pos() ); int right, dd,/* newRight,*/ newLeft, nextPos; - if ( false && orient == Horizontal ) { + if ( false && orient == Qt::Horizontal ) { dd = pos - left + 1; dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); newLeft = pos-dd+1; @@ -988,9 +1005,9 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) } } QRect r = contentsRect(); - if ( orient == Horizontal && false ) { + if ( orient == Qt::Horizontal && false ) { #if QT_VERSION >= 0x030000 - int splitterWidth = style().pixelMetric(QStyle::PM_SplitterWidth, this); + int splitterWidth = style()->pixelMetric(QStyle::PM_SplitterWidth, 0,this); #else int splitterWidth = style().splitterWidth(); #endif @@ -1030,7 +1047,7 @@ void KDGanttMinimizeSplitter::doResize() QRect r = contentsRect(); int i; int n = data->list.count(); - QMemArray<QLayoutStruct> a( n ); + Q3MemArray<QLayoutStruct> a( n ); for ( i = 0; i< n; i++ ) { a[i].init(); QSplitterLayoutStruct *s = data->list.at(i); @@ -1132,7 +1149,7 @@ void KDGanttMinimizeSplitter::recalc( bool update ) if ( maxt < mint ) maxt = mint; - if ( orient == Horizontal ) { + if ( orient == Qt::Horizontal ) { setMaximumSize( maxl, maxt ); setMinimumSize( minl, mint ); } else { @@ -1267,13 +1284,10 @@ QSize KDGanttMinimizeSplitter::sizeHint() const constPolish(); int l = 0; int t = 0; - if ( children() ) { - const QObjectList * c = children(); - QObjectListIt it( *c ); - QObject * o; - - while( (o=it.current()) != 0 ) { - ++it; + if ( !children().empty() ) { + const QObjectList c = children(); + for(QObjectList::const_iterator i=c.begin();i!=c.end();++i) { + QObject * o = *i; if ( o->isWidgetType() && !((QWidget*)o)->isHidden() ) { QSize s = ((QWidget*)o)->sizeHint(); @@ -1284,7 +1298,7 @@ QSize KDGanttMinimizeSplitter::sizeHint() const } } } - return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); + return orientation() == Qt::Horizontal ? QSize( l, t ) : QSize( t, l ); } @@ -1297,13 +1311,10 @@ QSize KDGanttMinimizeSplitter::minimumSizeHint() const constPolish(); int l = 0; int t = 0; - if ( children() ) { - const QObjectList * c = children(); - QObjectListIt it( *c ); - QObject * o; - - while( (o=it.current()) != 0 ) { - ++it; + if ( !children().empty() ) { + const QObjectList c = children(); + for(QObjectList::const_iterator i=c.begin();i!=c.end();++i) { + QObject * o = *i; if ( o->isWidgetType() && !((QWidget*)o)->isHidden() ) { QSize s = minSizeHint((QWidget*)o); @@ -1314,7 +1325,7 @@ QSize KDGanttMinimizeSplitter::minimumSizeHint() const } } } - return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); + return orientation() == Qt::Horizontal ? QSize( l, t ) : QSize( t, l ); } @@ -1402,13 +1413,14 @@ bool KDGanttMinimizeSplitter::isHidden( QWidget *w ) const \sa setSizes() */ -QValueList<int> KDGanttMinimizeSplitter::sizes() const +Q3ValueList<int> KDGanttMinimizeSplitter::sizes() const { + /* TODO: hacker if ( !testWState(WState_Polished) ) { QWidget* that = (QWidget*) this; that->polish(); - } - QValueList<int> list; + } */ + Q3ValueList<int> list; QSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( !s->isSplitter ) @@ -1433,10 +1445,10 @@ QValueList<int> KDGanttMinimizeSplitter::sizes() const \sa sizes() */ -void KDGanttMinimizeSplitter::setSizes( QValueList<int> list ) +void KDGanttMinimizeSplitter::setSizes( Q3ValueList<int> list ) { processChildEvents(); - QValueList<int>::Iterator it = list.begin(); + Q3ValueList<int>::Iterator it = list.begin(); QSplitterLayoutStruct *s = data->list.first(); while ( s && it != list.end() ) { if ( !s->isSplitter ) { @@ -1456,7 +1468,7 @@ void KDGanttMinimizeSplitter::setSizes( QValueList<int> list ) void KDGanttMinimizeSplitter::processChildEvents() { - QApplication::sendPostedEvents( this, QEvent::ChildInserted ); + QApplication::sendPostedEvents( this, QEvent::ChildAdded ); } @@ -1468,7 +1480,7 @@ void KDGanttMinimizeSplitter::styleChange( QStyle& old ) { #if QT_VERSION >= 0x030000 - int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); + int sw = style()->pixelMetric(QStyle::PM_SplitterWidth, 0, this); #else int sw = style().splitterWidth(); #endif @@ -1479,7 +1491,7 @@ void KDGanttMinimizeSplitter::styleChange( QStyle& old ) s = data->list.next(); } doResize(); - QFrame::styleChange( old ); + Q3Frame::styleChange( old ); } #endif @@ -1512,7 +1524,7 @@ static inline int toFixed( int i ) { return i * 256; } static inline int fRound( int i ) { return ( i % 256 < 128 ) ? i / 256 : 1 + i / 256; } -void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, +void kdganttGeomCalc( Q3MemArray<QLayoutStruct> &chain, int start, int count, int pos, int space, int spacer ) { typedef int fixed; diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h index 3042e0a..338d965 100644 --- a/microkde/KDGanttMinimizeSplitter.h +++ b/microkde/KDGanttMinimizeSplitter.h @@ -1,3 +1,10 @@ +//Added by qt3to4: +#include <Q3PointArray> +#include <QPaintEvent> +#include <QResizeEvent> +#include <QChildEvent> +#include <QMouseEvent> +#include <QEvent> /* -*- Mode: C++ -*- $Id$ */ @@ -35,8 +42,8 @@ #define KDGANTTMINIMIZESPLITTER_H #ifndef QT_H -#include "qframe.h" -#include "qvaluelist.h" +#include "q3frame.h" +#include "q3valuelist.h" #endif // QT_H #ifndef QT_NO_SPLITTER___ @@ -44,7 +51,7 @@ class QSplitterData; class QSplitterLayoutStruct; class KDGanttSplitterHandle; class KDRubberBand; -class KDGanttMinimizeSplitter : public QFrame +class KDGanttMinimizeSplitter : public Q3Frame { Q_OBJECT // Q_ENUMS( Direction ) @@ -56,11 +63,11 @@ public: enum Direction { Left, Right, Up, Down }; KDGanttMinimizeSplitter( QWidget* parent=0, const char* name=0 ); - KDGanttMinimizeSplitter( Orientation, QWidget* parent=0, const char* name=0 ); + KDGanttMinimizeSplitter( Qt::Orientation, QWidget* parent=0, const char* name=0 ); ~KDGanttMinimizeSplitter(); - virtual void setOrientation( Orientation ); - Orientation orientation() const { return orient; } + virtual void setOrientation( Qt::Orientation ); + Qt::Orientation orientation() const { return orient; } void setMinimizeDirection( Direction ); Direction minimizeDirection() const; @@ -77,8 +84,8 @@ public: QSize sizeHint() const; QSize minimumSizeHint() const; - QValueList<int> sizes() const; - void setSizes( QValueList<int> ); + Q3ValueList<int> sizes() const; + void setSizes( Q3ValueList<int> ); KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} void expandPos( int id, int* min, int* max ); KDRubberBand* rubberBand() { return mRubberBand ;} @@ -114,20 +121,20 @@ private: void setG( QWidget *w, int p, int s, bool isSplitter = FALSE ); QCOORD pick( const QPoint &p ) const - { return orient == Horizontal ? p.x() : p.y(); } + { return orient == Qt::Horizontal ? p.x() : p.y(); } QCOORD pick( const QSize &s ) const - { return orient == Horizontal ? s.width() : s.height(); } + { return orient == Qt::Horizontal ? s.width() : s.height(); } QCOORD trans( const QPoint &p ) const - { return orient == Vertical ? p.x() : p.y(); } + { return orient == Qt::Vertical ? p.x() : p.y(); } QCOORD trans( const QSize &s ) const - { return orient == Vertical ? s.width() : s.height(); } + { return orient == Qt::Vertical ? s.width() : s.height(); } KDGanttSplitterHandle* mFirstHandle; QSplitterData *data; #endif private: - Orientation orient; + Qt::Orientation orient; Direction _direction; #ifndef DOXYGEN_SKIP_INTERNAL friend class KDGanttSplitterHandle; @@ -163,7 +170,7 @@ public: void setId( int i ) { myId = i; } protected: - QValueList<QPointArray> buttonRegions(); + Q3ValueList<Q3PointArray> buttonRegions(); void paintEvent( QPaintEvent * ); void mouseMoveEvent( QMouseEvent * ); void mousePressEvent( QMouseEvent * ); diff --git a/microkde/fncolordialog.h b/microkde/fncolordialog.h index 615d2ed..52356be 100755 --- a/microkde/fncolordialog.h +++ b/microkde/fncolordialog.h @@ -35,12 +35,12 @@ //-----------------------------------------------------------------------------
// FNPaletteBase
//-----------------------------------------------------------------------------
-class Q_EXPORT FNPaletteBase : public QWidget
+class /* Q_EXPORT */ FNPaletteBase : public QWidget
{
Q_OBJECT
public:
- FNPaletteBase(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ FNPaletteBase(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0);
virtual ~FNPaletteBase();
@@ -78,11 +78,11 @@ signals: //-----------------------------------------------------------------------------
// FNColorPalette
//-----------------------------------------------------------------------------
-class Q_EXPORT FNColorPalette : public FNPaletteBase
+class /* Q_EXPORT */ FNColorPalette : public FNPaletteBase
{
Q_OBJECT
public:
- FNColorPalette(QColor c, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ FNColorPalette(QColor c, QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0);
virtual ~FNColorPalette();
};
@@ -92,11 +92,11 @@ public: //-----------------------------------------------------------------------------
// FNHSVPalette
//-----------------------------------------------------------------------------
-class Q_EXPORT FNHSVPalette : public FNPaletteBase
+class /*Q_EXPORT */ FNHSVPalette : public FNPaletteBase
{
Q_OBJECT
public:
- FNHSVPalette(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ FNHSVPalette(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0);
virtual ~FNHSVPalette();
public slots:
void hueChanged(int v);
@@ -111,11 +111,11 @@ protected: //-----------------------------------------------------------------------------
// FNColorDialog
//-----------------------------------------------------------------------------
-class Q_EXPORT FNColorDialog : public QDialog
+class /*Q_EXPORT */FNColorDialog : public QDialog
{
Q_OBJECT
public:
- FNColorDialog(QWidget* parent=0, const char* name=0, WFlags f=0);
+ FNColorDialog(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
virtual ~FNColorDialog();
void setColor(QColor c);
QColor color() const;
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index d7c12bb..b058d54 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp @@ -6,11 +6,14 @@ #include <qapplication.h> #include <qstring.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qdialog.h> #include <qlayout.h> -#include <qtextbrowser.h> +#include <q3textbrowser.h> #include <qregexp.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3VBoxLayout> int KApplication::random() { @@ -75,10 +78,10 @@ void KApplication::showFile(QString caption, QString fn) fileName = qApp->applicationDirPath () + "/" + fn; #endif QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return ; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); text = ts.read(); file.close(); KApplication::showText( caption, text ); @@ -89,19 +92,19 @@ bool KApplication::convert2latin1(QString fileName) { QString text; QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } - QTextStream ts( &file ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream ts( &file ); + ts.setEncoding( Q3TextStream::UnicodeUTF8 ); text = ts.read(); file.close(); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream tsIn( &file ); - tsIn.setEncoding( QTextStream::Latin1 ); + Q3TextStream tsIn( &file ); + tsIn.setEncoding( Q3TextStream::Latin1 ); tsIn << text.latin1(); file.close(); return true; @@ -112,11 +115,11 @@ void KApplication::showText(QString caption, QString text) { QDialog dia( 0, "name", true ); ; dia.setCaption( caption ); - QVBoxLayout* lay = new QVBoxLayout( &dia ); + Q3VBoxLayout* lay = new Q3VBoxLayout( &dia ); lay->setSpacing( 3 ); lay->setMargin( 3 ); KTextEdit tb ( &dia ); - tb.setWordWrap( QMultiLineEdit::WidgetWidth ); + tb.setWordWrap( Q3MultiLineEdit::WidgetWidth ); lay->addWidget( &tb ); tb.setText( text ); #ifdef DESKTOP_VERSION @@ -133,7 +136,7 @@ void KApplication::showText(QString caption, QString text) #include <qlayout.h> #include <qdir.h> #include <qradiobutton.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include "kglobal.h" #include "klocale.h" @@ -144,12 +147,12 @@ class KBackupPrefs : public QDialog QDialog( parent, name, true ) { setCaption( i18n("Backup Failed!") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( message, this ); lay->addWidget( lab ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Choose action"), this ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Choose action"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; vcal = new QRadioButton(i18n("Try again now"), format ); diff --git a/microkde/kcolorbutton.cpp b/microkde/kcolorbutton.cpp index 197bea2..16618fc 100644 --- a/microkde/kcolorbutton.cpp +++ b/microkde/kcolorbutton.cpp @@ -1,11 +1,14 @@ #include "kcolorbutton.h" #include "kcolordialog.h" #include "qapplication.h" +#include <QDesktopWidget> #include "qlayout.h" #ifdef DESKTOP_VERSION #include <qcolordialog.h> +//Added by qt3to4: +#include <QPixmap> #endif void KColorButton:: edit() { diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp index 940196e..12063ca 100644 --- a/microkde/kconfig.cpp +++ b/microkde/kconfig.cpp @@ -1,6 +1,8 @@ #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qwidget.h> +//Added by qt3to4: +#include <Q3ValueList> #include "kdebug.h" @@ -53,11 +55,11 @@ QString KConfig::group() const { } //US added method -QValueList<int> KConfig::readIntListEntry( const QString & key) +Q3ValueList<int> KConfig::readIntListEntry( const QString & key) { // qDebug("KConfig::readIntListEntry key=%s:", key.latin1()); - QValueList<int> result; + Q3ValueList<int> result; QMap<QString,QString>::ConstIterator mit = mStringMap.find( mGroup + key ); @@ -111,7 +113,7 @@ QString KConfig::readEntry( const QString &key, const QString &def ) QSize KConfig::readSizeEntry( const QString &key, QSize* def ) { - QValueList<int> intlist = readIntListEntry(key); + Q3ValueList<int> intlist = readIntListEntry(key); if (intlist.count() < 2) { @@ -194,11 +196,11 @@ QDateTime KConfig::readDateTimeEntry( const QString &key, const QDateTime *def ) } //US added method -void KConfig::writeEntry( const QString &key, const QValueList<int> &value) +void KConfig::writeEntry( const QString &key, const Q3ValueList<int> &value) { QStringList valuesAsStrings; - QValueList<int>::ConstIterator it; + Q3ValueList<int>::ConstIterator it; for( it = value.begin(); it != value.end(); ++it ) { @@ -246,7 +248,7 @@ void KConfig::writeEntry( const QString & e, const QColor & c ) void KConfig::writeEntry( const QString & e, const QSize & s ) { - QValueList<int> intlist; + Q3ValueList<int> intlist; intlist << s.width() << s.height(); writeEntry( e, intlist ); } @@ -271,7 +273,7 @@ void KConfig::load() QFile f( mFileName ); - if ( !f.open( IO_ReadOnly ) ) { + if ( !f.open( QIODevice::ReadOnly ) ) { //qDebug("KConfig: could not open file %s ",mFileName.latin1() ); return; } @@ -279,12 +281,12 @@ void KConfig::load() mBoolMap.clear(); mStringMap.clear(); - QTextStream t( &f ); - t.setEncoding( QTextStream::Latin1 ); + Q3TextStream t( &f ); + t.setEncoding( Q3TextStream::Latin1 ); QString line = t.readLine(); while ( !line.isNull() ) { - QStringList tokens = QStringList::split( ",", line ); + QStringList tokens = line.split(','); if ( tokens[0] == "bool" ) { bool value = false; if ( tokens[2] == "1" ) value = true; @@ -323,15 +325,15 @@ void KConfig::sync() KStandardDirs::makeDir(dir); QFile f( mFileName ); - if ( !f.open( IO_WriteOnly ) ) { + if ( !f.open( QIODevice::WriteOnly ) ) { qDebug("KConfig::sync() Can't open file %s ",mFileName.latin1() ); return; } - QTextStream t( &f ); - t.setEncoding( QTextStream::Latin1 ); + Q3TextStream t( &f ); + t.setEncoding( Q3TextStream::Latin1 ); QMap<QString,bool>::ConstIterator itBool; for( itBool = mBoolMap.begin(); itBool != mBoolMap.end(); ++itBool ) { t << "bool," << itBool.key() << "," << ( *itBool ? "1" : "0" ) << endl; diff --git a/microkde/kconfig.h b/microkde/kconfig.h index 1a1038f..7b91e44 100644 --- a/microkde/kconfig.h +++ b/microkde/kconfig.h @@ -3,7 +3,7 @@ #include <qstring.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include <qcolor.h> #include <qfont.h> #include <qmap.h> @@ -57,7 +57,7 @@ class KConfig QString getFileName(); //US added method readIntListEntry - QValueList<int> readIntListEntry( const QString &); + Q3ValueList<int> readIntListEntry( const QString &); int readNumEntry( const QString &, int def=0 ); QString readEntry( const QString &, const QString &def=QString::null ); @@ -69,7 +69,7 @@ class KConfig QSize readSizeEntry(const QString &, QSize* ); bool hasKey( const QString &); - void writeEntry( const QString &, const QValueList<int>& ); + void writeEntry( const QString &, const Q3ValueList<int>& ); void writeEntry( const QString &, int ); void writeEntry( const QString &key , unsigned int value) { writeEntry( key, int( value ) ); } void writeEntry( const char *key , unsigned int value) { writeEntry( QString( key ), value ); } diff --git a/microkde/kdatepickernew.cpp b/microkde/kdatepickernew.cpp index f60a422..8f8001e 100644 --- a/microkde/kdatepickernew.cpp +++ b/microkde/kdatepickernew.cpp @@ -313,7 +313,7 @@ KDatePicker::selectMonthClicked() QDate date = table->getDate(); int i, month, months = calendar->monthsInYear(date); - QPopupMenu popup(selectMonth); + Q3PopupMenu popup(selectMonth); for (i = 1; i <= months; i++) popup.insertItem(calendar->monthName(i, calendar->year(date)), i); diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp index 353f78d..10dc449 100644 --- a/microkde/kdatetbl.cpp +++ b/microkde/kdatetbl.cpp @@ -44,6 +44,14 @@ #include <qpen.h> #include <qpainter.h> #include <qdialog.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QResizeEvent> +#include <QFocusEvent> +#include <Q3Frame> +#include <QMouseEvent> +#include <QKeyEvent> +#include <QEvent> #include <assert.h> #include <qapplication.h> @@ -69,7 +77,7 @@ KDateValidator::date(const QString& text, QDate& d) const d = tmp; return Acceptable; } else - return Valid; + return QValidator::Intermediate; } void @@ -78,22 +86,22 @@ KDateValidator::fixup( QString& ) const } -KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f) - : QGridView(parent, name, f) +KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, Qt::WFlags f) + : Q3GridView(parent, name, f) { setFont( KGlobalSettings::generalFont() ); if(!date_.isValid()) { date_=QDate::currentDate(); } - setFocusPolicy( QWidget::StrongFocus ); + setFocusPolicy( Qt::StrongFocus ); setNumRows(7); // 6 weeks max + headline setNumCols(7); // 7 days a week setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); viewport()->setBackgroundColor(QColor(220,245,255)); #if 0 - viewport()->setEraseColor(lightGray); + viewport()->setEraseColor(Qt::lightGray); #endif mMarkCurrent = false; setDate(date_); // this initializes firstday, numdays, numDaysPrevMonth @@ -108,7 +116,7 @@ KDateTable::paintCell(QPainter *painter, int row, int col) int w=cellWidth(); int h=cellHeight(); int pos; - QBrush brushBlue(blue); + QBrush brushBlue(Qt::blue); QBrush brushLightblue(QColor(220,245,255)); QFont _font=font(); // ----- @@ -133,18 +141,17 @@ KDateTable::paintCell(QPainter *painter, int row, int col) painter->setPen(QColor(220,245,255)); painter->setBrush(brushLightblue); painter->drawRect(0, 0, w, h); - painter->setPen(blue); + painter->setPen(Qt::blue); } else { - painter->setPen(blue); + painter->setPen(Qt::blue); painter->setBrush(brushBlue); painter->drawRect(0, 0, w, h); - painter->setPen(white); + painter->setPen(Qt::white); } - painter->drawText(0, 0, w, h-1, AlignCenter, + painter->drawText(0, 0, w, h-1, Qt::AlignCenter, daystr, -1, &rect); - painter->setPen(black); - painter->moveTo(0, h-1); - painter->lineTo(w-1, h-1); + painter->setPen(Qt::black); + painter->drawLine(0, h-1, w-1, h-1); // ----- draw the weekday: } else { painter->setFont(_font); @@ -161,33 +168,33 @@ KDateTable::paintCell(QPainter *painter, int row, int col) } else { // following month text.setNum(pos-firstday-numdays+1); } - painter->setPen(gray); + painter->setPen(Qt::gray); } else { // paint a day of the current month text.setNum(pos-firstday+1); - painter->setPen(black); + painter->setPen(Qt::black); } pen=painter->pen(); if(firstday+date.day()-1==pos) { if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos) - painter->setPen(green); + painter->setPen(Qt::green); else - painter->setPen(red); + painter->setPen(Qt::red); if(hasFocus()) { - painter->setBrush(darkRed); - pen=white; + painter->setBrush(Qt::darkRed); + pen=QColor(Qt::white); } else { - painter->setBrush(darkGray); - pen=white; + painter->setBrush(Qt::darkGray); + pen=QColor(Qt::white); } } else { if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos) { - painter->setPen(green); - painter->setBrush(darkGreen); - pen=white; + painter->setPen(Qt::green); + painter->setBrush(Qt::darkGreen); + pen=QColor(Qt::white); } else { painter->setBrush(QColor(220,245,255)); painter->setPen(QColor(220,245,255)); @@ -195,7 +202,7 @@ KDateTable::paintCell(QPainter *painter, int row, int col) } painter->drawRect(0, 0, w, h); painter->setPen(pen); - painter->drawText(0, 0, w, h, AlignCenter, text, -1, &rect); + painter->drawText(0, 0, w, h, Qt::AlignCenter, text, -1, &rect); } /* if(rect.width()>maxCell.width()) maxCell.setWidth(rect.width()); @@ -274,7 +281,7 @@ KDateTable::keyPressEvent( QKeyEvent *e ) void KDateTable::viewportResizeEvent(QResizeEvent * e) { - QGridView::viewportResizeEvent(e); + Q3GridView::viewportResizeEvent(e); setCellWidth(viewport()->width()/7); setCellHeight(viewport()->height()/7); @@ -409,13 +416,13 @@ KDateTable::getDate() const void KDateTable::focusInEvent( QFocusEvent *e ) { repaintContents(false); - QGridView::focusInEvent( e ); + Q3GridView::focusInEvent( e ); } void KDateTable::focusOutEvent( QFocusEvent *e ) { repaintContents(false); - QGridView::focusOutEvent( e ); + Q3GridView::focusOutEvent( e ); } QSize @@ -432,7 +439,7 @@ KDateTable::sizeHint() const KDateInternalMonthPicker::KDateInternalMonthPicker (QWidget* parent, const char* name) - : QGridView(parent, name), + : Q3GridView(parent, name), result(0) // invalid { QRect rect; @@ -451,13 +458,13 @@ KDateInternalMonthPicker::KDateInternalMonthPicker setFont(font); setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(Q3Frame::NoFrame); setNumRows(4); setNumCols(3); // enable to find drawing failures: // setTableFlags(Tbl_clipCellPainting); #if 0 - viewport()->setEraseColor(lightGray); // for consistency with the datepicker + viewport()->setEraseColor(Qt::lightGray); // for consistency with the datepicker #endif // ----- find the preferred size // (this is slow, possibly, but unfortunatly it is needed here): @@ -487,7 +494,7 @@ KDateInternalMonthPicker::getResult() const void KDateInternalMonthPicker::setupPainter(QPainter *p) { - p->setPen(black); + p->setPen(Qt::black); } void @@ -505,7 +512,7 @@ KDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) // ----- find the number of the cell: index=3*row+col+1; text=KGlobal::locale()->monthName(index, false); - painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text); + painter->drawText(0, 0, cellWidth(), cellHeight(), Qt::AlignCenter, text); if ( activeCol == col && activeRow == row ) painter->drawRect( 0, 0, cellWidth(), cellHeight() ); } @@ -513,7 +520,7 @@ KDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) void KDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) { - if(!isEnabled() || e->button() != LeftButton) + if(!isEnabled() || e->button() != Qt::LeftButton) { KNotifyClient::beep(); return; @@ -540,7 +547,7 @@ KDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) void KDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) { - if (e->state() & LeftButton) + if (e->state() & Qt::LeftButton) { int row, col; QPoint mouseCoord; @@ -614,7 +621,7 @@ KDateInternalYearSelector::KDateInternalYearSelector font.setPointSize(fontsize); setFont(font); #if 0 - setFrameStyle(QFrame::NoFrame); + setFrameStyle(Q3Frame::NoFrame); #endif // we have to respect the limits of QDate here, I fear: val->setRange(0, 8000); @@ -661,18 +668,18 @@ KDateInternalYearSelector::setYear(int year) } KPopupFrame::KPopupFrame(QWidget* parent, const char* name) - : QFrame(parent, name, WType_Popup), + : Q3Frame(parent, name, Qt::WType_Popup), result(0), // rejected main(0) { - setFrameStyle(QFrame::Box|QFrame::Raised); + setFrameStyle(Q3Frame::Box|Q3Frame::Raised); setMidLineWidth(2); } void KPopupFrame::keyPressEvent(QKeyEvent* e) { - if(e->key()==Key_Escape) + if(e->key()==Qt::Key_Escape) { result=0; // rejected qApp->exit_loop(); @@ -756,7 +763,7 @@ void KDateTable::virtual_hook( int, void* ) KDateInternalWeekPicker::KDateInternalWeekPicker (QWidget* parent, const char* name) - : QGridView(parent, name), + : Q3GridView(parent, name), result(0) // invalid { QRect rect; @@ -773,7 +780,7 @@ KDateInternalWeekPicker::KDateInternalWeekPicker setFont(font); setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(Q3Frame::NoFrame); if ( QApplication::desktop()->height() > 240 ) { setNumRows(13); setNumCols(4); @@ -784,7 +791,7 @@ KDateInternalWeekPicker::KDateInternalWeekPicker // enable to find drawing failures: // setTableFlags(Tbl_clipCellPainting); #if 0 - viewport()->setEraseColor(lightGray); // for consistency with the datepicker + viewport()->setEraseColor(Qt::lightGray); // for consistency with the datepicker #endif // ----- find the preferred size // (this is slow, possibly, but unfortunatly it is needed here): @@ -818,7 +825,7 @@ KDateInternalWeekPicker::getResult() const void KDateInternalWeekPicker::setupPainter(QPainter *p) { - p->setPen(black); + p->setPen(Qt::black); } void @@ -836,7 +843,7 @@ KDateInternalWeekPicker::paintCell(QPainter* painter, int row, int col) // ----- find the number of the cell: index=numCols()*row+col+1; text=QString::number( index ); - painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text); + painter->drawText(0, 0, cellWidth(), cellHeight(), Qt::AlignCenter, text); if ( activeCol == col && activeRow == row ) painter->drawRect( 0, 0, cellWidth(), cellHeight() ); } @@ -844,7 +851,7 @@ KDateInternalWeekPicker::paintCell(QPainter* painter, int row, int col) void KDateInternalWeekPicker::contentsMousePressEvent(QMouseEvent *e) { - if(!isEnabled() || e->button() != LeftButton) + if(!isEnabled() || e->button() != Qt::LeftButton) { KNotifyClient::beep(); return; @@ -871,7 +878,7 @@ KDateInternalWeekPicker::contentsMousePressEvent(QMouseEvent *e) void KDateInternalWeekPicker::contentsMouseMoveEvent(QMouseEvent *e) { - if (e->state() & LeftButton) + if (e->state() & Qt::LeftButton) { int row, col; QPoint mouseCoord; diff --git a/microkde/kdatetbl.h b/microkde/kdatetbl.h index 87808df..2d3d2cf 100644 --- a/microkde/kdatetbl.h +++ b/microkde/kdatetbl.h @@ -21,9 +21,15 @@ #define KDATETBL_H #include <qvalidator.h> -#include <qgridview.h> +#include <q3gridview.h> #include <qlineedit.h> #include <qdatetime.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QMouseEvent> +#include <Q3Frame> +#include <QKeyEvent> +#include <QFocusEvent> /** * A table containing month names. It is used to pick a month directly. @@ -31,7 +37,7 @@ * @version $Id$ * @author Tim Gilman, Mirko Boehm */ -class KDateInternalMonthPicker : public QGridView +class KDateInternalMonthPicker : public Q3GridView { Q_OBJECT protected: @@ -127,7 +133,7 @@ private: * @author Tim Gilman, Mirko Boehm * @version $Id$ */ -class KPopupFrame : public QFrame +class KPopupFrame : public Q3Frame { Q_OBJECT protected: @@ -182,7 +188,7 @@ public: private: - virtual bool close(bool alsoDelete) { return QFrame::close(alsoDelete); } + virtual bool close(bool alsoDelete) { return Q3Frame::close(alsoDelete); } protected: virtual void virtual_hook( int id, void* data ); private: @@ -215,7 +221,7 @@ public: * @version $Id$ * @author Tim Gilman, Mirko Boehm */ -class KDateTable : public QGridView +class KDateTable : public Q3GridView { Q_OBJECT public: @@ -224,7 +230,7 @@ public: */ KDateTable(QWidget *parent=0, QDate date=QDate::currentDate(), - const char* name=0, WFlags f=0); + const char* name=0, Qt::WFlags f=0); /** * Returns a recommended size for the widget. * To save some time, the size of the largest used cell content is @@ -307,7 +313,7 @@ private: }; #endif // KDATETBL_H -class KDateInternalWeekPicker : public QGridView +class KDateInternalWeekPicker : public Q3GridView { Q_OBJECT protected: diff --git a/microkde/kdebug.h b/microkde/kdebug.h index bb9cfe3..534943c 100644 --- a/microkde/kdebug.h +++ b/microkde/kdebug.h @@ -4,6 +4,8 @@ #include <stdio.h> #include <qstring.h> +//Added by qt3to4: +#include <Q3CString> @@ -64,7 +66,7 @@ class kdbgstream { kdbgstream &operator<<(const char*) { return *this; } - kdbgstream &operator<<(const QCString&) { + kdbgstream &operator<<(const Q3CString&) { return *this; } kdbgstream& operator<<(KDBGFUNC f) { 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 @@ -20,6 +20,8 @@ //US #include <config.h> #include <qfile.h> +//Added by qt3to4: +#include <Q3CString> #include <kdebug.h> @@ -88,7 +90,7 @@ void KCatalogue::setFileName( const QString & fileName ) doUnload(); - QCString newFileName = QFile::encodeName( fileName ); + Q3CString newFileName = QFile::encodeName( fileName ); if ( !fileName.isEmpty() ) { 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 @@ -26,6 +26,8 @@ #define _KCONFIGBASE_H #include "kconfig.h" +//Added by qt3to4: +#include <Q3CString> /** * Helper class to facilitate working with @ref KConfig / @ref KSimpleConfig @@ -82,7 +84,7 @@ public: : _config(config), _oldgroup(config->group()) { _config->setGroup( group ); } - KConfigGroupSaver( KConfig* config, const QCString &group ) + KConfigGroupSaver( KConfig* config, const Q3CString &group ) : _config(config), _oldgroup(config->group()) { _config->setGroup( group ); } 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 @@ -20,9 +20,12 @@ #include <qclipboard.h> #include <qfile.h> #include <qtimer.h> -#include <qobjectdict.h> -#include <qwidgetlist.h> +#include <q3objectdict.h> #include <qwidget.h> +#include <qwidget.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3PtrList> #include "kapplication.h" #include "klibloader.h" @@ -45,7 +48,7 @@ #endif -template class QAsciiDict<KLibrary>; +template class Q3AsciiDict<KLibrary>; #include <stdlib.h> //getenv @@ -120,7 +123,7 @@ KLibrary::~KLibrary() // If any object is remaining, delete if ( m_objs.count() > 0 ) { - QPtrListIterator<QObject> it( m_objs ); + Q3PtrListIterator<QObject> it( m_objs ); for ( ; it.current() ; ++it ) { kdDebug(150) << "Factory still has object " << it.current() << " " << it.current()->name () << " Library = " << m_libname << endl; @@ -152,7 +155,7 @@ KLibFactory* KLibrary::factory() if ( m_factory ) return m_factory; - QCString symname; + Q3CString symname; symname.sprintf("init_%s", name().latin1() ); void* sym = symbol( symname ); @@ -305,8 +308,8 @@ KLibWrapPrivate::KLibWrapPrivate(KLibrary *l, QLibrary* h) class KLibLoaderPrivate { public: - QPtrList<KLibWrapPrivate> loaded_stack; - QPtrList<KLibWrapPrivate> pending_close; + Q3PtrList<KLibWrapPrivate> loaded_stack; + Q3PtrList<KLibWrapPrivate> pending_close; enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode; QString errorMessage; @@ -348,7 +351,7 @@ KLibLoader::~KLibLoader() { // kdDebug(150) << "Deleting KLibLoader " << this << " " << name() << endl; - QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); + Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs ); for (; it.current(); ++it ) { kdDebug(150) << "The KLibLoader contains the library " << it.current()->name @@ -364,7 +367,7 @@ KLibLoader::~KLibLoader() //static QString KLibLoader::findLibrary( const char * name/*US , const KInstance * instance*/ ) { - QCString libname( name ); + Q3CString libname( name ); // only append ".la" if there is no extension // this allows to load non-libtool libraries as well @@ -421,7 +424,7 @@ QString KLibLoader::findLibrary( const char * name/*US , const KInstance * insta { #ifndef NDEBUG kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl; - self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname); + self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(QString(libname)); qDebug("KLibLoader::library could not find library: %s", libname.data()); #endif @@ -469,7 +472,7 @@ KLibrary* KLibLoader::library( const char *name ) /* Test if this library was loaded at some time, but got unloaded meanwhile, whithout being dlclose()'ed. */ - QPtrListIterator<KLibWrapPrivate> it(d->loaded_stack); + Q3PtrListIterator<KLibWrapPrivate> it(d->loaded_stack); for (; it.current(); ++it) { if (it.current()->name == name) wrap = it.current(); @@ -550,7 +553,7 @@ void KLibLoader::slotLibraryDestroyed() { const KLibrary *lib = static_cast<const KLibrary *>( sender() ); - QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); + Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs ); for (; it.current(); ++it ) if ( it.current()->lib == lib ) { @@ -569,7 +572,7 @@ void KLibLoader::close_pending(KLibWrapPrivate *wrap) /* First delete all KLibrary objects in pending_close, but _don't_ unload the DSO behind it. */ - QPtrListIterator<KLibWrapPrivate> it(d->pending_close); + Q3PtrListIterator<KLibWrapPrivate> it(d->pending_close); for (; it.current(); ++it) { wrap = it.current(); if (wrap->lib) { 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 @@ -21,8 +21,8 @@ #include <qobject.h> #include <qstring.h> #include <qstringlist.h> -#include <qasciidict.h> -#include <qptrlist.h> +#include <q3asciidict.h> +#include <q3ptrlist.h> #include <kglobal.h> #include <stdlib.h> // For backwards compatibility @@ -52,7 +52,7 @@ class QLibrary; class KLibrary : public QObject { friend class KLibLoader; - friend class QAsciiDict<KLibrary>; + friend class Q3AsciiDict<KLibrary>; Q_OBJECT public: @@ -127,7 +127,7 @@ private: KLibFactory* m_factory; //US void * m_handle; QLibrary* m_handle; - QPtrList<QObject> m_objs; + Q3PtrList<QObject> m_objs; QTimer *m_timer; KLibraryPrivate *d; }; @@ -287,7 +287,7 @@ private slots: void slotLibraryDestroyed(); private: void close_pending( KLibWrapPrivate * ); - QAsciiDict<KLibWrapPrivate> m_libs; + Q3AsciiDict<KLibWrapPrivate> m_libs; static KLibLoader* s_self; 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,5 +1,6 @@ #include <qregexp.h> #include <qapplication.h> +#include <QDesktopWidget> #include "kdebug.h" #include "kcalendarsystemgregorian.h" @@ -11,8 +12,8 @@ //#define COLLECT_TRANSLATION -QDict<QString> *mLocaleDict = 0; -void setLocaleDict( QDict<QString> * dict ) +Q3Dict<QString> *mLocaleDict = 0; +void setLocaleDict( Q3Dict<QString> * dict ) { mLocaleDict = dict; @@ -45,7 +46,7 @@ void addExist(const char *text,QString trans ) } #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #endif void dumpMissing() @@ -53,10 +54,10 @@ void dumpMissing() #ifdef COLLECT_TRANSLATION QString fileName = "/tmp/usernewtrans.txt"; QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return ; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); int i; @@ -70,10 +71,10 @@ void dumpMissing() { QString fileName = "/tmp/usertrans.txt"; QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return ; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); int i; @@ -467,7 +468,7 @@ QString KLocale::formatDateTime(const QDateTime &pDateTime, format = "%1 %2"; else if ( intIntDateFormat == Format1 ) format = "%1 %2"; - else if ( intIntDateFormat == ISODate ) + else if ( intIntDateFormat == Qt::ISODate ) format = "%1T%2"; QString res = format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat )) @@ -527,7 +528,7 @@ QDate KLocale::readDate(const QString &intstr, const QString &fmt, bool* ok) con strpos++; c = fmt.at(fmtpos++); - switch (c) + switch (c.unicode()) { case 'a': case 'A': @@ -638,7 +639,7 @@ QTime KLocale::readTime(const QString &intstr, bool seconds, bool *ok) const strpos++; c = Format.at(Formatpos++); - switch (c) + switch (c.unicode()) { case 'p': { @@ -734,7 +735,7 @@ QDateTime KLocale::readDateTime(const QString &intstr, QString tformat = timeFormat(intIntDateFormat); QDate m_date = readDate(date, dformat, &ok1); - QTime m_time = readTime(time, tformat, &ok2); + QTime m_time = readTime(time, !tformat.isEmpty(), &ok2); QDateTime m_dt; 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 @@ -4,14 +4,14 @@ #include <qstring.h> #include <qstringlist.h> #include <qdatetime.h> -#include <qdict.h> +#include <q3dict.h> #ifndef I18N_NOOP #define I18N_NOOP(x) (x) #endif class KCalendarSystem; -void setLocaleDict( QDict<QString> * dict ); +void setLocaleDict( Q3Dict<QString> * dict ); QString i18n(const char *text); QString i18n(const char *hint, const char *text); QString i18n(const char *text1, const char *textn, int num); 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 @@ -39,6 +39,8 @@ #include <kdebug.h> #include "kmdcodec.h" +//Added by qt3to4: +#include <Q3CString> #define KMD5_S11 7 #define KMD5_S12 12 @@ -147,14 +149,14 @@ static int rikFindChar(register const char * _s, const char c) return s - _s; } -QCString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF) +Q3CString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF) { QByteArray out; quotedPrintableEncode (in, out, useCRLF); - return QCString (out.data(), out.size()+1); + return Q3CString (out.data(), out.size()+1); } -QCString KCodecs::quotedPrintableEncode(const QCString& str, bool useCRLF) +Q3CString KCodecs::quotedPrintableEncode(const Q3CString& str, bool useCRLF) { if (str.isEmpty()) return ""; @@ -280,14 +282,14 @@ void KCodecs::quotedPrintableEncode(const QByteArray& in, QByteArray& out, bool out.truncate(cursor - out.data()); } -QCString KCodecs::quotedPrintableDecode(const QByteArray & in) +Q3CString KCodecs::quotedPrintableDecode(const QByteArray & in) { QByteArray out; quotedPrintableDecode (in, out); - return QCString (out.data(), out.size()+1); + return Q3CString (out.data(), out.size()+1); } -QCString KCodecs::quotedPrintableDecode(const QCString & str) +Q3CString KCodecs::quotedPrintableDecode(const Q3CString & str) { if (str.isEmpty()) return ""; @@ -355,7 +357,7 @@ void KCodecs::quotedPrintableDecode(const QByteArray& in, QByteArray& out) out.truncate(cursor - out.data()); } -QCString KCodecs::base64Encode( const QCString& str, bool insertLFs ) +Q3CString KCodecs::base64Encode( const Q3CString& str, bool insertLFs ) { if ( str.isEmpty() ) return ""; @@ -365,11 +367,11 @@ QCString KCodecs::base64Encode( const QCString& str, bool insertLFs ) return base64Encode( in, insertLFs ); } -QCString KCodecs::base64Encode( const QByteArray& in, bool insertLFs ) +Q3CString KCodecs::base64Encode( const QByteArray& in, bool insertLFs ) { QByteArray out; base64Encode( in, out, insertLFs ); - return QCString( out.data(), out.size()+1 ); + return Q3CString( out.data(), out.size()+1 ); } void KCodecs::base64Encode( const QByteArray& in, QByteArray& out, @@ -405,15 +407,15 @@ void KCodecs::base64Encode( const QByteArray& in, QByteArray& out, if ( insertLFs ) { if ( count && (count%76) == 0 ) - out.at(didx++) = '\n'; + out[didx++] = '\n'; count += 4; } - out.at(didx++) = Base64EncMap[(data[sidx] >> 2) & 077]; - out.at(didx++) = Base64EncMap[(data[sidx+1] >> 4) & 017 | + out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077]; + out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 | (data[sidx] << 4) & 077]; - out.at(didx++) = Base64EncMap[(data[sidx+2] >> 6) & 003 | + out[didx++] = Base64EncMap[(data[sidx+2] >> 6) & 003 | (data[sidx+1] << 2) & 077]; - out.at(didx++) = Base64EncMap[data[sidx+2] & 077]; + out[didx++] = Base64EncMap[data[sidx+2] & 077]; sidx += 3; } } @@ -421,30 +423,27 @@ void KCodecs::base64Encode( const QByteArray& in, QByteArray& out, if (sidx < len) { if ( insertLFs && (count > 0) && (count%76) == 0 ) - out.at(didx++) = '\n'; + out[didx++] = '\n'; - out.at(didx++) = Base64EncMap[(data[sidx] >> 2) & 077]; + out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077]; if (sidx < len-1) { - out.at(didx++) = Base64EncMap[(data[sidx+1] >> 4) & 017 | + out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 | (data[sidx] << 4) & 077]; - out.at(didx++) = Base64EncMap[(data[sidx+1] << 2) & 077]; + out[didx++] = Base64EncMap[(data[sidx+1] << 2) & 077]; } else { - out.at(didx++) = Base64EncMap[(data[sidx] << 4) & 077]; + out[didx++] = Base64EncMap[(data[sidx] << 4) & 077]; } } // Add padding while (didx < out.size()) - { - out.at(didx) = '='; - didx++; - } + out[didx++] = '='; } -QCString KCodecs::base64Decode( const QCString& str ) +Q3CString KCodecs::base64Decode( const Q3CString& str ) { if ( str.isEmpty() ) return ""; @@ -454,11 +453,11 @@ QCString KCodecs::base64Decode( const QCString& str ) return base64Decode( in ); } -QCString KCodecs::base64Decode( const QByteArray& in ) +Q3CString KCodecs::base64Decode( const QByteArray& in ) { QByteArray out; base64Decode( in, out ); - return QCString( out.data(), out.size()+1 ); + return Q3CString( out.data(), out.size()+1 ); } void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) @@ -505,7 +504,7 @@ void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) if ((ch > 47 && ch < 58) || (ch > 64 && ch < 91) || (ch > 96 && ch < 123) || ch == '+' || ch == '/' || ch == '=') { - out.at(outIdx++) = Base64DecMap[ch]; + out[outIdx++] = Base64DecMap[ch]; } else { @@ -523,26 +522,26 @@ void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) { while (didx < len-2) { - out.at(didx) = (((out.at(sidx) << 2) & 255) | ((out.at(sidx+1) >> 4) & 003)); - out.at(didx+1) = (((out.at(sidx+1) << 4) & 255) | ((out.at(sidx+2) >> 2) & 017)); - out.at(didx+2) = (((out.at(sidx+2) << 6) & 255) | (out.at(sidx+3) & 077)); + out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003)); + out[didx+1] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017)); + out[didx+2] = (((out[sidx+2] << 6) & 255) | (out[sidx+3] & 077)); sidx += 4; didx += 3; } } if (didx < len) - out.at(didx) = (((out.at(sidx) << 2) & 255) | ((out.at(sidx+1) >> 4) & 003)); + out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003)); if (++didx < len ) - out.at(didx) = (((out.at(sidx+1) << 4) & 255) | ((out.at(sidx+2) >> 2) & 017)); + out[didx] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017)); // Resize the output buffer if ( len == 0 || len < out.size() ) out.resize(len); } -QCString KCodecs::uuencode( const QCString& str ) +Q3CString KCodecs::uuencode( const Q3CString& str ) { if ( str.isEmpty() ) return ""; @@ -553,11 +552,11 @@ QCString KCodecs::uuencode( const QCString& str ) return uuencode( in ); } -QCString KCodecs::uuencode( const QByteArray& in ) +Q3CString KCodecs::uuencode( const QByteArray& in ) { QByteArray out; uuencode( in, out ); - return QCString( out.data(), out.size()+1 ); + return Q3CString( out.data(), out.size()+1 ); } void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) @@ -580,54 +579,54 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) while (sidx+line_len < len) { // line length - out.at(didx++) = UUEncMap[line_len]; + out[didx++] = UUEncMap[line_len]; // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion for (unsigned int end = sidx+line_len; sidx < end; sidx += 3) { - out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | + out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; + out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 | (data[sidx] << 4) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+2] >> 6) & 003 | + out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 | (data[sidx+1] << 2) & 077]; - out.at(didx++) = UUEncMap[data[sidx+2] & 077]; + out[didx++] = UUEncMap[data[sidx+2] & 077]; } // line terminator //for (unsigned int idx=0; idx < nl_len; idx++) - //out.at(didx++) = nl[idx]; + //out[didx++] = nl[idx]; memcpy(out.data()+didx, nl, nl_len); didx += nl_len; } // line length - out.at(didx++) = UUEncMap[len-sidx]; + out[didx++] = UUEncMap[len-sidx]; // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion while (sidx+2 < len) { - out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | + out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; + out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 | (data[sidx] << 4) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+2] >> 6) & 003 | + out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 | (data[sidx+1] << 2) & 077]; - out.at(didx++) = UUEncMap[data[sidx+2] & 077]; + out[didx++] = UUEncMap[data[sidx+2] & 077]; sidx += 3; } if (sidx < len-1) { - out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | + out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; + out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 | (data[sidx] << 4) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+1] << 2) & 077]; - out.at(didx++) = UUEncMap[0]; + out[didx++] = UUEncMap[(data[sidx+1] << 2) & 077]; + out[didx++] = UUEncMap[0]; } else if (sidx < len) { - out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; - out.at(didx++) = UUEncMap[(data[sidx] << 4) & 077]; - out.at(didx++) = UUEncMap[0]; - out.at(didx++) = UUEncMap[0]; + out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; + out[didx++] = UUEncMap[(data[sidx] << 4) & 077]; + out[didx++] = UUEncMap[0]; + out[didx++] = UUEncMap[0]; } // line terminator @@ -639,7 +638,7 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) out.resize( 0 ); } -QCString KCodecs::uudecode( const QCString& str ) +Q3CString KCodecs::uudecode( const Q3CString& str ) { if ( str.isEmpty() ) return ""; @@ -650,11 +649,11 @@ QCString KCodecs::uudecode( const QCString& str ) return uudecode( in ); } -QCString KCodecs::uudecode( const QByteArray& in ) +Q3CString KCodecs::uudecode( const QByteArray& in ) { QByteArray out; uudecode( in, out ); - return QCString( out.data(), out.size()+1 ); + return Q3CString( out.data(), out.size()+1 ); } void KCodecs::uudecode( const QByteArray& in, QByteArray& out ) @@ -705,9 +704,9 @@ void KCodecs::uudecode( const QByteArray& in, QByteArray& out ) B = UUDecMap[(unsigned char) data[sidx+1]]; C = UUDecMap[(unsigned char) data[sidx+2]]; D = UUDecMap[(unsigned char) data[sidx+3]]; - out.at(didx++) = ( ((A << 2) & 255) | ((B >> 4) & 003) ); - out.at(didx++) = ( ((B << 4) & 255) | ((C >> 2) & 017) ); - out.at(didx++) = ( ((C << 6) & 255) | (D & 077) ); + out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) ); + out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) ); + out[didx++] = ( ((C << 6) & 255) | (D & 077) ); sidx += 4; } } @@ -716,14 +715,14 @@ void KCodecs::uudecode( const QByteArray& in, QByteArray& out ) { A = UUDecMap[(unsigned char) data[sidx]]; B = UUDecMap[(unsigned char) data[sidx+1]]; - out.at(didx++) = ( ((A << 2) & 255) | ((B >> 4) & 003) ); + out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) ); } if (didx < end) { B = UUDecMap[(unsigned char) data[sidx+1]]; C = UUDecMap[(unsigned char) data[sidx+2]]; - out.at(didx++) = ( ((B << 4) & 255) | ((C >> 2) & 017) ); + out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) ); } // skip padding @@ -761,7 +760,7 @@ KMD5::KMD5(const QByteArray& in) update( in ); } -KMD5::KMD5(const QCString& in) +KMD5::KMD5(const Q3CString& in) { init(); update( in ); @@ -772,7 +771,7 @@ void KMD5::update(const QByteArray& in) update(in.data(), int(in.size())); } -void KMD5::update(const QCString& in) +void KMD5::update(const Q3CString& in) { update(in.data(), int(in.length())); } @@ -873,7 +872,7 @@ bool KMD5::verify( const KMD5::Digest& digest) return (0 == memcmp(rawDigest(), digest, sizeof(KMD5::Digest))); } -bool KMD5::verify( const QCString& hexdigest) +bool KMD5::verify( const Q3CString& hexdigest) { finalize(); return (0 == strcmp(hexDigest().data(), hexdigest)); @@ -892,9 +891,9 @@ void KMD5::rawDigest( KMD5::Digest& bin ) } -QCString KMD5::hexDigest() +Q3CString KMD5::hexDigest() { - QCString s(33); + Q3CString s(33); finalize(); sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", @@ -905,7 +904,7 @@ QCString KMD5::hexDigest() return s; } -void KMD5::hexDigest(QCString& s) +void KMD5::hexDigest(Q3CString& s) { finalize(); s.resize(33); @@ -915,7 +914,7 @@ void KMD5::hexDigest(QCString& s) m_digest[12], m_digest[13], m_digest[14], m_digest[15]); } -QCString KMD5::base64Digest() +Q3CString KMD5::base64Digest() { QByteArray ba(16); @@ -956,7 +955,7 @@ void KMD5::transform( const unsigned char block[64] ) //memcpy( x, block, 64 ); //US Q_ASSERT(!m_finalized); // not just a user error, since the method is private - ASSERT(!m_finalized); // not just a user error, since the method is private + Q_ASSERT(!m_finalized); // not just a user error, since the method is private /* Round 1 */ FF (a, b, c, d, x[ 0], KMD5_S11, 0xd76aa478); /* 1 */ 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 @@ -39,6 +39,8 @@ #include <qglobal.h> #include <qstring.h> #include <qiodevice.h> +//Added by qt3to4: +#include <Q3CString> /** * A wrapper class for the most commonly used encoding and @@ -81,7 +83,7 @@ public: * breaks, too. * @return quoted-printable encoded data. */ - static QCString quotedPrintableEncode(const QByteArray & in, + static Q3CString quotedPrintableEncode(const QByteArray & in, bool useCRLF = true); /** @@ -96,7 +98,7 @@ public: * breaks, too. * @return quoted-printable encoded data. */ - static QCString quotedPrintableEncode(const QCString & str, + static Q3CString quotedPrintableEncode(const Q3CString & str, bool useCRLF = true); /** @@ -129,7 +131,7 @@ public: * @param in the data to be decoded. * @return decoded data. */ - static QCString quotedPrintableDecode(const QByteArray & in); + static Q3CString quotedPrintableDecode(const QByteArray & in); /** * @overload @@ -140,7 +142,7 @@ public: * @param str the data to be decoded. * @return decoded data. */ - static QCString quotedPrintableDecode(const QCString & str); + static Q3CString quotedPrintableDecode(const Q3CString & str); /** * Decodes a quoted-printable encoded data. @@ -175,7 +177,7 @@ public: * @param in the data to be uuencoded * @return a uuencoded data. */ - static QCString uuencode( const QByteArray& in ); + static Q3CString uuencode( const QByteArray& in ); /** * @overload @@ -186,7 +188,7 @@ public: * @param str the string to be uuencoded. * @return the encoded string. */ - static QCString uuencode( const QCString& str ); + static Q3CString uuencode( const Q3CString& str ); /** * Encodes the given data using the uuencode algorithm. @@ -215,7 +217,7 @@ public: * @param in the data uuencoded data to be decoded. * @return a decoded string. */ - static QCString uudecode( const QByteArray& in ); + static Q3CString uudecode( const QByteArray& in ); /** * @overload @@ -226,7 +228,7 @@ public: * @param str the string to be decoded. * @return a uudecoded string. */ - static QCString uudecode( const QCString& str ); + static Q3CString uudecode( const Q3CString& str ); /** * Decodes the given data using the uudecode algorithm. @@ -263,7 +265,7 @@ public: * * @return a base64 encoded string. */ - static QCString base64Encode( const QByteArray& in, bool insertLFs = false); + static Q3CString base64Encode( const QByteArray& in, bool insertLFs = false); /** * @overload @@ -275,7 +277,7 @@ public: * @param insertLFs limit the number of characters per line. * @return the decoded string. */ - static QCString base64Encode( const QCString& str, bool insertLFs = false ); + static Q3CString base64Encode( const Q3CString& str, bool insertLFs = false ); /** * Encodes the given data using the base64 algorithm. @@ -308,7 +310,7 @@ public: * @param in the base64-encoded data to be decoded. * @return the decoded data. */ - static QCString base64Decode( const QByteArray& in ); + static Q3CString base64Decode( const QByteArray& in ); /** * @overload @@ -319,7 +321,7 @@ public: * @param str the base64-encoded string. * @return the decoded string. */ - static QCString base64Decode( const QCString& str ); + static Q3CString base64Decode( const Q3CString& str ); /** * Decodes the given data that was encoded with the base64 @@ -431,7 +433,7 @@ public: * * Same as above except it accepts a QByteArray as its argument. */ - KMD5(const QCString& a ); + KMD5(const Q3CString& a ); /** * Updates the message to be digested. Be sure to add all data @@ -460,7 +462,7 @@ public: * * @param in message to be added to the digest (QByteArray). */ - void update(const QCString& in ); + void update(const Q3CString& in ); /** * @overload @@ -502,18 +504,18 @@ public: * Returns the value of the calculated message digest in * a hexadecimal representation. */ - QCString hexDigest (); + Q3CString hexDigest (); /** * @overload */ - void hexDigest(QCString&); + void hexDigest(Q3CString&); /** * Returns the value of the calculated message digest in * a base64-encoded representation. */ - QCString base64Digest (); + Q3CString base64Digest (); /** * returns true if the calculated digest for the given @@ -524,7 +526,7 @@ public: /** * @overload */ - bool verify(const QCString&); + bool verify(const Q3CString&); protected: /** 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 @@ -21,6 +21,8 @@ // $Id$ #include <qcolor.h> +//Added by qt3to4: +#include <Q3ValueList> #include <kconfig.h> #include <kstandarddirs.h> @@ -140,8 +142,8 @@ class KPrefsItemStringList : public KPrefsItem { class KPrefsItemIntList : public KPrefsItem { public: - KPrefsItemIntList(const QString &group,const QString &name,QValueList<int> *, - const QValueList<int> &defaultValue=QValueList<int>()); + KPrefsItemIntList(const QString &group,const QString &name,Q3ValueList<int> *, + const Q3ValueList<int> &defaultValue=Q3ValueList<int>()); virtual ~KPrefsItemIntList() {} void setDefault(); @@ -149,8 +151,8 @@ class KPrefsItemIntList : public KPrefsItem { void writeConfig(KConfig *); private: - QValueList<int> *mReference; - QValueList<int> mDefault; + Q3ValueList<int> *mReference; + Q3ValueList<int> mDefault; }; @@ -364,7 +366,7 @@ void KPrefsItemStringList::readConfig(KConfig *config) KPrefsItemIntList::KPrefsItemIntList(const QString &group,const QString &name, - QValueList<int> *reference,const QValueList<int> &defaultValue) : + Q3ValueList<int> *reference,const Q3ValueList<int> &defaultValue) : KPrefsItem(group,name) { mReference = reference; @@ -505,8 +507,8 @@ void KPrefs::addItemStringList(const QString &key,QStringList *reference, addItem(new KPrefsItemStringList(*mCurrentGroup,key,reference,defaultValue)); } -void KPrefs::addItemIntList(const QString &key,QValueList<int> *reference, - const QValueList<int> &defaultValue) +void KPrefs::addItemIntList(const QString &key,Q3ValueList<int> *reference, + const Q3ValueList<int> &defaultValue) { addItem(new KPrefsItemIntList(*mCurrentGroup,key,reference,defaultValue)); } 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 @@ -21,11 +21,13 @@ #define _KPREFS_H // $Id$ -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qcolor.h> #include <qfont.h> #include <qsize.h> #include <qstringlist.h> +//Added by qt3to4: +#include <Q3ValueList> class KConfig; @@ -283,8 +285,8 @@ class KPrefs { when the config file does not yet contain the key of this item. */ - void addItemIntList(const QString &key,QValueList<int> *reference, - const QValueList<int> &defaultValue=QValueList<int>()); + void addItemIntList(const QString &key,Q3ValueList<int> *reference, + const Q3ValueList<int> &defaultValue=Q3ValueList<int>()); protected: /** @@ -310,7 +312,7 @@ class KPrefs { KConfig *mConfig; // pointer to KConfig object - QPtrList<KPrefsItem> mItems; + Q3PtrList<KPrefsItem> mItems; }; #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 @@ -563,7 +563,7 @@ class KShortcut * @param keyQt the qt keycode * @see Qt::Key */ - KShortcut( int keyQt ) {} + KShortcut( int /*keyQt */) {} /** * Creates a new shortcut that contains only the given qt key @@ -599,7 +599,7 @@ class KShortcut * @param shortcut the description of the key * @see KKeySequence::KKeySequence(const QString&) */ - KShortcut( const char* shortcut ) {} + KShortcut( const char* /*shortcut */) {} /** * Creates a new key sequence that contains the given key sequence. @@ -608,7 +608,7 @@ class KShortcut * @param shortcut the description of the key * @see KKeySequence::KKeySequence(const QString&) */ - KShortcut( const QString& shortcut ) {} + KShortcut( const QString& /*shortcut */) {} ~KShortcut() {} /** @@ -816,7 +816,7 @@ class KShortcut /** * @internal */ - QString toStringInternal( const KShortcut* pcutDefault = 0 ) const + QString toStringInternal( const KShortcut* /*pcutDefault*/ = 0 ) const { return "EMPTY IMPL."; } 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 @@ -37,8 +37,8 @@ //US#include <pwd.h> #include <qregexp.h> -#include <qasciidict.h> -#include <qdict.h> +#include <q3asciidict.h> +#include <q3dict.h> #include <qdir.h> #include <qfileinfo.h> #include <qstring.h> @@ -46,6 +46,8 @@ #include <qapplication.h> #include <qstringlist.h> +//Added by qt3to4: +#include <Q3CString> #include "kstandarddirs.h" #include "kconfig.h" @@ -59,15 +61,15 @@ QString KStandardDirs::mAppDir = QString::null; -template class QDict<QStringList>; +template class Q3Dict<QStringList>; #if 0 -#include <qtextedit.h> +#include <q3textedit.h> void ddd( QString op ) { - static QTextEdit * dot = 0; + static Q3TextEdit * dot = 0; if ( ! dot ) - dot = new QTextEdit(); + dot = new Q3TextEdit(); dot->show(); @@ -85,7 +87,7 @@ public: bool restrictionsActive; bool dataRestrictionActive; - QAsciiDict<bool> restrictions; + Q3AsciiDict<bool> restrictions; QStringList xdgdata_prefixes; QStringList xdgconf_prefixes; }; @@ -445,7 +447,7 @@ static void lookupDirectory(const QString& path, const QString &relPart, continue; // No match */ //US this should do the same: - int pos = regexp.match(fn); + int pos = regexp.exactMatch(fn); if (!recursive && !pos == 0) continue; // No match @@ -482,7 +484,7 @@ static void lookupDirectory(const QString& path, const QString &relPart, continue; // No match */ //US this should do the same: - pos = regexp.match(fn); + pos = regexp.exactMatch(fn); if (!pos == 0) continue; // No match } @@ -1108,7 +1110,7 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode) //US struct stat st; int pos = target.find('/', i); base += target.mid(i - 1, pos - i + 1); - QCString baseEncoded = QFile::encodeName(base); + Q3CString baseEncoded = QFile::encodeName(base); // bail out if we encountered a problem //US if (stat(baseEncoded, &st) != 0) QFileInfo baseEncodedInfo(baseEncoded); @@ -1208,7 +1210,7 @@ QString readEnvPath(const char *env) //#ifdef _WIN32_ // return ""; //#else - QCString c_path; + Q3CString c_path; if ( getenv(env) != NULL ) c_path = QString ( getenv(env) ); if (c_path.isEmpty()) 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 @@ -24,7 +24,7 @@ #define SSK_KSTDDIRS_H #include <qstring.h> -#include <qdict.h> +#include <q3dict.h> #include <qstringlist.h> #include <kglobal.h> @@ -574,11 +574,11 @@ public: QStringList prefixes; // Directory dictionaries - QDict<QStringList> absolutes; - QDict<QStringList> relatives; + Q3Dict<QStringList> absolutes; + Q3Dict<QStringList> relatives; - mutable QDict<QStringList> dircache; - mutable QDict<QString> savelocations; + mutable Q3Dict<QStringList> dircache; + mutable Q3Dict<QString> savelocations; // Disallow assignment and copy-construction KStandardDirs( const KStandardDirs& ); 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 @@ -28,6 +28,9 @@ #include <assert.h> #include <qtooltip.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3ValueList> //US#include <qwhatsthis.h> //US#include <kaccel.h> //US#include <kaccelbase.h> @@ -42,9 +45,9 @@ //US added this includefiles #include <qmenubar.h> -#include <qtoolbar.h> -#include <qpopupmenu.h> -#include <qiconset.h> +#include <q3toolbar.h> +#include <q3popupmenu.h> +#include <qicon.h> /** * How it works. @@ -87,7 +90,7 @@ public: } KAccel *m_kaccel; - QValueList<KAccel*> m_kaccelList; + Q3ValueList<KAccel*> m_kaccelList; QString m_groupText; QString m_group; @@ -107,7 +110,7 @@ public: QWidget* m_representative; }; - QValueList<Container> m_containers; + Q3ValueList<Container> m_containers; }; //--------------------------------------------------------------------- @@ -130,7 +133,7 @@ KAction::KAction( const QString& text, const QString& sIconName, const KShortcut d->setIconName( sIconName ); } -KAction::KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, +KAction::KAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, KActionCollection* parent, const char* name ) : QObject( parent, name ) @@ -164,7 +167,7 @@ KAction::KAction( const QString& text, const KShortcut& cut, { initPrivate( text, cut, receiver, slot ); } -KAction::KAction( const QString& text, const QIconSet& pix, +KAction::KAction( const QString& text, const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name ) : QObject( parent, name ) @@ -182,7 +185,7 @@ KAction::KAction( const QString& text, const QString& pix, d->setIconName( pix ); } -KAction::KAction( const QString& text, const QIconSet& pix, +KAction::KAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name ) @@ -506,8 +509,8 @@ void KAction::updateShortcut( int i ) int id = itemId( i ); QWidget* w = container( i ); - if ( w->inherits( "QPopupMenu" ) ) { - QPopupMenu* menu = static_cast<QPopupMenu*>(w); + if ( w->inherits( "Q3PopupMenu" ) ) { + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>(w); updateShortcut( menu, id ); } else if ( w->inherits( "QMenuBar" ) ) @@ -518,7 +521,7 @@ void KAction::updateShortcut( int i ) } -void KAction::updateShortcut( QPopupMenu* menu, int id ) +void KAction::updateShortcut( Q3PopupMenu* menu, int id ) { /*US //kdDebug(129) << "KAction::updateShortcut(): this = " << this << " d->m_kaccelList.count() = " << d->m_kaccelList.count() << endl; @@ -621,7 +624,7 @@ void KAction::updateToolTip( int i ) if ( w->inherits( "KToolBar" ) ) QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); - else if ( w->inherits( "QToolBar" ) ) + else if ( w->inherits( "Q3ToolBar" ) ) QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); } @@ -646,9 +649,9 @@ int KAction::plug( QWidget *w, int index ) plugShortcut(); - if ( w->inherits("QPopupMenu") ) + if ( w->inherits("Q3PopupMenu") ) { - QPopupMenu* menu = static_cast<QPopupMenu*>( w ); + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( w ); int id; // Don't insert shortcut into menu if it's already in a KAccel object. //qDebug("KAction::plug warning: real shortcuts not available yet. "); @@ -721,7 +724,7 @@ int KAction::plug( QWidget *w, int index ) SLOT( slotActivated() ), d->isEnabled(), d->plainText(), index/*US, instance*/ ); } - bar->getButton( id_ )->setName( QCString("toolbutton_")+name() ); + bar->getButton( id_ )->setName( Q3CString("toolbutton_")+name() ); //US if ( !d->whatsThis().isEmpty() ) //US QWhatsThis::add( bar->getButton(id_), whatsThisWithIcon() ); @@ -749,9 +752,9 @@ void KAction::unplug( QWidget *w ) return; int id = itemId( i ); - if ( w->inherits( "QPopupMenu" ) ) + if ( w->inherits( "Q3PopupMenu" ) ) { - QPopupMenu *menu = static_cast<QPopupMenu *>( w ); + Q3PopupMenu *menu = static_cast<Q3PopupMenu *>( w ); menu->removeItem( id ); } else if ( w->inherits( "KToolBar" ) ) @@ -862,8 +865,8 @@ void KAction::updateEnabled( int i ) { QWidget *w = container( i ); - if ( w->inherits("QPopupMenu") ) - static_cast<QPopupMenu*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); + if ( w->inherits("Q3PopupMenu") ) + static_cast<Q3PopupMenu*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); else if ( w->inherits("QMenuBar") ) static_cast<QMenuBar*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); else if ( w->inherits( "KToolBar" ) ) @@ -906,10 +909,10 @@ void KAction::updateText( int i ) { QWidget *w = container( i ); - if ( w->inherits( "QPopupMenu" ) ) { + if ( w->inherits( "Q3PopupMenu" ) ) { int id = itemId( i ); - static_cast<QPopupMenu*>(w)->changeItem( id, d->text() ); - updateShortcut( static_cast<QPopupMenu*>(w), id ); + static_cast<Q3PopupMenu*>(w)->changeItem( id, d->text() ); + updateShortcut( static_cast<Q3PopupMenu*>(w), id ); } else if ( w->inherits( "QMenuBar" ) ) static_cast<QMenuBar*>(w)->changeItem( itemId( i ), d->text() ); @@ -947,16 +950,16 @@ void KAction::updateIcon( int id ) { QWidget* w = container( id ); - if ( w->inherits( "QPopupMenu" ) ) { + if ( w->inherits( "Q3PopupMenu" ) ) { int itemId_ = itemId( id ); - static_cast<QPopupMenu*>(w)->changeItem( itemId_, d->iconSet( KIcon::Small ), d->text() ); - updateShortcut( static_cast<QPopupMenu*>(w), itemId_ ); + static_cast<Q3PopupMenu*>(w)->changeItem( itemId_, d->iconSet( KIcon::Small ), d->text() ); + updateShortcut( static_cast<Q3PopupMenu*>(w), itemId_ ); } else if ( w->inherits( "QMenuBar" ) ) static_cast<QMenuBar*>(w)->changeItem( itemId( id ), d->iconSet( KIcon::Small ), d->text() ); else if ( w->inherits( "KToolBar" ) ) static_cast<KToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() ); - else if ( w->inherits( "QToolBar" ) ) + else if ( w->inherits( "Q3ToolBar" ) ) { qDebug("KAction::updateIcon has top be fixed"); //US static_cast<QToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() ); @@ -968,7 +971,7 @@ QString KAction::icon() const return d->iconName( ); } -void KAction::setIconSet( const QIconSet &iconset ) +void KAction::setIconSet( const QIcon &iconset ) { d->setIconSet( iconset ); @@ -982,11 +985,11 @@ void KAction::updateIconSet( int id ) { QWidget *w = container( id ); - if ( w->inherits( "QPopupMenu" ) ) + if ( w->inherits( "Q3PopupMenu" ) ) { int itemId_ = itemId( id ); - static_cast<QPopupMenu*>(w)->changeItem( itemId_, d->iconSet(), d->text() ); - updateShortcut( static_cast<QPopupMenu*>(w), itemId_ ); + static_cast<Q3PopupMenu*>(w)->changeItem( itemId_, d->iconSet(), d->text() ); + updateShortcut( static_cast<Q3PopupMenu*>(w), itemId_ ); } else if ( w->inherits( "QMenuBar" ) ) static_cast<QMenuBar*>(w)->changeItem( itemId( id ), d->iconSet(), d->text() ); @@ -999,7 +1002,7 @@ void KAction::updateIconSet( int id ) } } -QIconSet KAction::iconSet( KIcon::Group group, int size ) const +QIcon KAction::iconSet( KIcon::Group group, int size ) const { return d->iconSet( group, size ); } @@ -1022,7 +1025,7 @@ void KAction::setWhatsThis( const QString& text ) void KAction::updateWhatsThis( int i ) { qDebug("KAction::updateWhatsThis ...1 has top be fixed"); - QPopupMenu* pm = popupMenu( i ); + Q3PopupMenu* pm = popupMenu( i ); if ( pm ) { pm->setWhatsThis( itemId( i ), d->whatsThis() ); @@ -1064,10 +1067,10 @@ KToolBar* KAction::toolBar( int index ) const return (KToolBar *)( d->m_containers[ index ].m_container ); } -QPopupMenu* KAction::popupMenu( int index ) const +Q3PopupMenu* KAction::popupMenu( int index ) const { //US return dynamic_cast<QPopupMenu *>( d->m_containers[ index ].m_container ); - return (QPopupMenu *)( d->m_containers[ index ].m_container ); + return (Q3PopupMenu *)( d->m_containers[ index ].m_container ); } QWidget* KAction::representative( int index ) const @@ -1155,7 +1158,7 @@ void KAction::slotDestroyed() int KAction::findContainer( const QWidget* widget ) const { int pos = 0; - QValueList<KActionPrivate::Container>::ConstIterator it = d->m_containers.begin(); + Q3ValueList<KActionPrivate::Container>::ConstIterator it = d->m_containers.begin(); while( it != d->m_containers.end() ) { if ( (*it).m_representative == widget || (*it).m_container == widget ) @@ -1170,7 +1173,7 @@ int KAction::findContainer( const QWidget* widget ) const void KAction::removeContainer( int index ) { int i = 0; - QValueList<KActionPrivate::Container>::Iterator it = d->m_containers.begin(); + Q3ValueList<KActionPrivate::Container>::Iterator it = d->m_containers.begin(); while( it != d->m_containers.end() ) { if ( i == index ) 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 @@ -29,8 +29,10 @@ //US #include <qkeysequence.h> #include <qobject.h> -#include <qvaluelist.h> -#include <qguardedptr.h> +#include <q3valuelist.h> +#include <qpointer.h> +//Added by qt3to4: +#include <Q3PopupMenu> #include <kguiitem.h> #include <kshortcut.h> #include <kstdaction.h> @@ -40,10 +42,10 @@ #include <kiconloader.h> class QMenuBar; -class QPopupMenu; +class Q3PopupMenu; //USclass QComboBox; //USclass QPoint; -class QIconSet; +class QIcon; class QString; class KToolBar; @@ -259,7 +261,7 @@ public: * @param name An internal name for this action. */ - KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, KActionCollection* parent, const char* name ); @@ -308,7 +310,7 @@ public: /** * @obsolete */ - KAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); /** * @obsolete @@ -318,7 +320,7 @@ public: /** * @obsolete */ - KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); /** * @obsolete @@ -461,10 +463,10 @@ public: * Get the QIconSet from which the icons used to display this action will * be chosen. */ - virtual QIconSet iconSet( KIcon::Group group, int size=0 ) const; + virtual QIcon iconSet( KIcon::Group group, int size=0 ) const; #ifndef KDE_NO_COMPAT - QIconSet iconSet() const + QIcon iconSet() const { return iconSet( KIcon::Small ); } @@ -518,7 +520,7 @@ public slots: * Sets the QIconSet from which the icons used to display this action will * be chosen. */ - virtual void setIconSet( const QIconSet &iconSet ); + virtual void setIconSet( const QIcon &iconSet ); virtual void setIcon( const QString& icon ); @@ -546,7 +548,7 @@ protected slots: protected: KToolBar* toolBar( int index ) const; - QPopupMenu* popupMenu( int index ) const; + Q3PopupMenu* popupMenu( int index ) const; void removeContainer( int index ); int findContainer( const QWidget* widget ) const; void plugMainWindowAccel( QWidget *w ); @@ -555,7 +557,7 @@ protected: void addContainer( QWidget* parent, QWidget* representative ); virtual void updateShortcut( int i ); - virtual void updateShortcut( QPopupMenu* menu, int id ); + virtual void updateShortcut( Q3PopupMenu* menu, int id ); virtual void updateGroup( int id ); virtual void updateText(int i ); virtual void updateEnabled(int i); 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 @@ -28,9 +28,11 @@ #include <assert.h> #include <qfontdatabase.h> -#include <qobjectlist.h> +#include <qobject.h> //US#include <qwhatsthis.h> #include <qtimer.h> +//Added by qt3to4: +#include <Q3ValueList> //US#include <kaccel.h> //US#include <kapplication.h> @@ -48,13 +50,13 @@ //US added the following includefiles #include <kconfigbase.h> #include <qwidget.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qmenubar.h> -#include <qmainwindow.h> -#include <qtoolbar.h> +#include <q3mainwindow.h> +#include <q3toolbar.h> #include <qcombobox.h> -#include <qmainwindow.h> - +#include <q3mainwindow.h> +#include <qcoreapplication.h> static QFontDatabase *fontDataBase = 0; @@ -83,7 +85,7 @@ static void get_fonts( QStringList &lst ) lst.sort(); } -static QValueList<int> get_standard_font_sizes() +static Q3ValueList<int> get_standard_font_sizes() { if ( !fontDataBase ) { fontDataBase = new QFontDatabase(); @@ -120,7 +122,7 @@ KToggleAction::KToggleAction( const QString& text, const KShortcut& cut, d = new KToggleActionPrivate; } -KToggleAction::KToggleAction( const QString& text, const QIconSet& pix, +KToggleAction::KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name ) : KAction( text, pix, cut, parent, name ) @@ -136,7 +138,7 @@ KToggleAction::KToggleAction( const QString& text, const QString& pix, d = new KToggleActionPrivate; } -KToggleAction::KToggleAction( const QString& text, const QIconSet& pix, +KToggleAction::KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, @@ -169,7 +171,7 @@ KToggleAction::~KToggleAction() int KToggleAction::plug( QWidget* widget, int index ) { - if ( !widget->inherits("QPopupMenu") && !widget->inherits("KToolBar") ) + if ( !widget->inherits("Q3PopupMenu") && !widget->inherits("KToolBar") ) { kdWarning() << "Can not plug KToggleAction in " << widget->className() << endl; return -1; @@ -184,11 +186,11 @@ int KToggleAction::plug( QWidget* widget, int index ) if ( _index == -1 ) return _index; - if ( widget->inherits("QPopupMenu") ) + if ( widget->inherits("Q3PopupMenu") ) { int id = itemId( _index ); - static_cast<QPopupMenu*>(widget)->setItemChecked( id, d->m_checked ); + static_cast<Q3PopupMenu*>(widget)->setItemChecked( id, d->m_checked ); } else if ( widget->inherits( "KToolBar" ) ) { KToolBar *bar = static_cast<KToolBar *>( widget ); @@ -214,13 +216,12 @@ void KToggleAction::setChecked( bool c ) updateChecked( i ); if ( c && parent() && !exclusiveGroup().isEmpty() ) { - const QObjectList *list = parent()->children(); - if ( list ) { - QObjectListIt it( *list ); - for( ; it.current(); ++it ) { - if ( it.current()->inherits( "KToggleAction" ) && it.current() != this && - static_cast<KToggleAction*>(it.current())->exclusiveGroup() == exclusiveGroup() ) { - KToggleAction *a = static_cast<KToggleAction*>(it.current()); + const QObjectList list = parent()->children(); + if ( !list.empty() ) { + for(QObjectList::const_iterator it=list.begin();it!=list.end();++it) { + if ( (*it)->inherits( "KToggleAction" ) && (*it) != this && + static_cast<KToggleAction*>((*it))->exclusiveGroup() == exclusiveGroup() ) { + KToggleAction *a = static_cast<KToggleAction*>(*it); if( a->isChecked() ) { a->setChecked( false ); emit a->toggled( false ); @@ -235,8 +236,8 @@ void KToggleAction::updateChecked( int id ) { QWidget *w = container( id ); - if ( w->inherits( "QPopupMenu" ) ) - static_cast<QPopupMenu*>(w)->setItemChecked( itemId( id ), d->m_checked ); + if ( w->inherits( "Q3PopupMenu" ) ) + static_cast<Q3PopupMenu*>(w)->setItemChecked( itemId( id ), d->m_checked ); else if ( w->inherits( "QMenuBar" ) ) static_cast<QMenuBar*>(w)->setItemChecked( itemId( id ), d->m_checked ); else if ( w->inherits( "KToolBar" ) ) @@ -283,7 +284,7 @@ KRadioAction::KRadioAction( const QString& text, const KShortcut& cut, { } -KRadioAction::KRadioAction( const QString& text, const QIconSet& pix, +KRadioAction::KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name ) : KToggleAction( text, pix, cut, parent, name ) @@ -297,7 +298,7 @@ KRadioAction::KRadioAction( const QString& text, const QString& pix, { } -KRadioAction::KRadioAction( const QString& text, const QIconSet& pix, +KRadioAction::KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name ) @@ -349,7 +350,7 @@ public: } bool m_edit; bool m_menuAccelsEnabled; - QPopupMenu *m_menu; + Q3PopupMenu *m_menu; int m_current; int m_comboWidth; QStringList m_list; @@ -387,7 +388,7 @@ KSelectAction::KSelectAction( const QString& text, const KShortcut& cut, d = new KSelectActionPrivate; } -KSelectAction::KSelectAction( const QString& text, const QIconSet& pix, +KSelectAction::KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name ) : KAction( text, pix, cut, parent, name ) @@ -403,7 +404,7 @@ KSelectAction::KSelectAction( const QString& text, const QString& pix, d = new KSelectActionPrivate; } -KSelectAction::KSelectAction( const QString& text, const QIconSet& pix, +KSelectAction::KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, @@ -439,7 +440,7 @@ KSelectAction::~KSelectAction() void KSelectAction::setCurrentItem( int id ) { if ( id >= (int)d->m_list.count() ) { - ASSERT(id < (int)d->m_list.count()); + Q_ASSERT(id < (int)d->m_list.count()); return; } @@ -479,13 +480,13 @@ void KSelectAction::setComboWidth( int width ) updateComboWidth( i ); } -QPopupMenu* KSelectAction::popupMenu() const +Q3PopupMenu* KSelectAction::popupMenu() const { kdDebug(129) << "KSelectAction::popupMenu()" << endl; // remove -- ellis if ( !d->m_menu ) { //US d->m_menu = new KPopupMenu(0L, "KSelectAction::popupMenu()"); - d->m_menu = new QPopupMenu(0L, "QSelectAction::popupMenu()"); + d->m_menu = new Q3PopupMenu(0L, "QSelectAction::popupMenu()"); setupMenu(); if ( d->m_current >= 0 ) d->m_menu->setItemChecked( d->m_current, true ); @@ -643,12 +644,12 @@ int KSelectAction::plug( QWidget *widget, int index ) //US return -1; kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis - if ( widget->inherits("QPopupMenu") ) + if ( widget->inherits("Q3PopupMenu") ) { // Create the PopupMenu and store it in m_menu (void)popupMenu(); - QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget ); int id; if ( hasIconSet() ) @@ -682,7 +683,7 @@ int KSelectAction::plug( QWidget *widget, int index ) if ( cb ) { cb->setMaximumHeight( 34 ); - if (!isEditable()) cb->setFocusPolicy(QWidget::NoFocus); + if (!isEditable()) cb->setFocusPolicy(Qt::NoFocus); cb->setMinimumWidth( cb->sizeHint().width() ); if ( d->m_comboWidth > 0 ) { @@ -852,7 +853,7 @@ KListAction::KListAction( const QString& text, const KShortcut& cut, connect( this, SIGNAL( activated( int ) ), receiver, slot ); } -KListAction::KListAction( const QString& text, const QIconSet& pix, +KListAction::KListAction( const QString& text, const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name ) : KSelectAction( text, pix, cut, parent, name ) @@ -868,7 +869,7 @@ KListAction::KListAction( const QString& text, const QString& pix, d = new KListActionPrivate; } -KListAction::KListAction( const QString& text, const QIconSet& pix, +KListAction::KListAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name ) @@ -965,7 +966,7 @@ KRecentFilesAction::KRecentFilesAction( const QString& text, } KRecentFilesAction::KRecentFilesAction( const QString& text, - const QIconSet& pix, + const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name, uint maxItems ) @@ -991,7 +992,7 @@ KRecentFilesAction::KRecentFilesAction( const QString& text, } KRecentFilesAction::KRecentFilesAction( const QString& text, - const QIconSet& pix, + const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, @@ -1201,7 +1202,7 @@ KFontAction::KFontAction( const QString& text, const KShortcut& cut, setEditable( true ); } -KFontAction::KFontAction( const QString& text, const QIconSet& pix, +KFontAction::KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name ) : KSelectAction( text, pix, cut, parent, name ) @@ -1223,7 +1224,7 @@ KFontAction::KFontAction( const QString& text, const QString& pix, setEditable( true ); } -KFontAction::KFontAction( const QString& text, const QIconSet& pix, +KFontAction::KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name ) @@ -1361,7 +1362,7 @@ KFontSizeAction::KFontSizeAction( const QString& text, init(); } -KFontSizeAction::KFontSizeAction( const QString& text, const QIconSet& pix, +KFontSizeAction::KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name ) : KSelectAction( text, pix, cut, parent, name ) @@ -1377,7 +1378,7 @@ KFontSizeAction::KFontSizeAction( const QString& text, const QString& pix, init(); } -KFontSizeAction::KFontSizeAction( const QString& text, const QIconSet& pix, +KFontSizeAction::KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, @@ -1414,9 +1415,9 @@ void KFontSizeAction::init() d = new KFontSizeActionPrivate; setEditable( true ); - QValueList<int> sizes = get_standard_font_sizes(); + Q3ValueList<int> sizes = get_standard_font_sizes(); QStringList lst; - for ( QValueList<int>::Iterator it = sizes.begin(); it != sizes.end(); ++it ) + for ( Q3ValueList<int>::Iterator it = sizes.begin(); it != sizes.end(); ++it ) lst.append( QString::number( *it ) ); setItems( lst ); @@ -1437,7 +1438,7 @@ void KFontSizeAction::setFontSize( int size ) int index = items().findIndex( QString::number( size ) ); if ( index == -1 ) { // Insert at the correct position in the list (to keep sorting) - QValueList<int> lst; + Q3ValueList<int> lst; // Convert to list of ints QStringList itemsList = items(); for (QStringList::Iterator it = itemsList.begin() ; it != itemsList.end() ; ++it) @@ -1450,7 +1451,7 @@ qDebug("KFontSizeAction::setFontSize heapsort not found."); //US qHeapSort( lst ); // Convert back to string list QStringList strLst; - for (QValueList<int>::Iterator it = lst.begin() ; it != lst.end() ; ++it) + for (Q3ValueList<int>::Iterator it = lst.begin() ; it != lst.end() ; ++it) strLst.append( QString::number(*it) ); KSelectAction::setItems( strLst ); // Find new current item @@ -1492,7 +1493,7 @@ public: KActionMenuPrivate() { //US m_popup = new KPopupMenu(0L,"KActionMenu::KActionMenuPrivate"); - m_popup = new QPopupMenu(0L,"KActionMenu::KActionMenuPrivate"); + m_popup = new Q3PopupMenu(0L,"KActionMenu::KActionMenuPrivate"); m_delayed = true; m_stickyMenu = true; } @@ -1502,7 +1503,7 @@ public: } //US KPopupMenu *m_popup; - QPopupMenu *m_popup; + Q3PopupMenu *m_popup; bool m_delayed; bool m_stickyMenu; }; @@ -1522,7 +1523,7 @@ KActionMenu::KActionMenu( const QString& text, QObject* parent, setShortcutConfigurable( false ); } -KActionMenu::KActionMenu( const QString& text, const QIconSet& icon, +KActionMenu::KActionMenu( const QString& text, const QIcon& icon, QObject* parent, const char* name ) : KAction( text, icon, 0, parent, name ) { @@ -1552,7 +1553,7 @@ void KActionMenu::popup( const QPoint& global ) //US KPopupMenu* KActionMenu::popupMenu() const -QPopupMenu* KActionMenu::popupMenu() const +Q3PopupMenu* KActionMenu::popupMenu() const { return d->m_popup; } @@ -1592,9 +1593,9 @@ int KActionMenu::plug( QWidget* widget, int index ) return -1; */ kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis - if ( widget->inherits("QPopupMenu") ) + if ( widget->inherits("Q3PopupMenu") ) { - QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget ); int id; if ( hasIconSet() ) id = menu->insertItem( iconSet(), text(), d->m_popup, -1, index ); @@ -1781,12 +1782,12 @@ int KToolBarPopupAction::plug( QWidget *widget, int index ) } //US KPopupMenu *KToolBarPopupAction::popupMenu() const -QPopupMenu *KToolBarPopupAction::popupMenu() const +Q3PopupMenu *KToolBarPopupAction::popupMenu() const { if ( !m_popup ) { KToolBarPopupAction *that = const_cast<KToolBarPopupAction*>(this); //US that->m_popup = new KPopupMenu; - that->m_popup = new QPopupMenu; + that->m_popup = new Q3PopupMenu; } return m_popup; } @@ -1953,7 +1954,7 @@ void KWidgetAction::slotToolbarDestroyed() { //Q_ASSERT( m_widget ); // When exiting the app the widget could be destroyed before the toolbar. - ASSERT( isPlugged() ); + Q_ASSERT( isPlugged() ); if( !m_widget || !isPlugged() ) return; @@ -1974,9 +1975,9 @@ KActionSeparator::~KActionSeparator() int KActionSeparator::plug( QWidget *widget, int index ) { - if ( widget->inherits("QPopupMenu") ) + if ( widget->inherits("Q3PopupMenu") ) { - QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget ); int id = menu->insertSeparator( index ); 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 @@ -34,11 +34,14 @@ //US#include <qguardedptr.h> //US#include <kguiitem.h> #include <kshortcut.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3PopupMenu> //US#include <kstdaction.h> //US#include <kicontheme.h> class QMenuBar; -class QPopupMenu; +class Q3PopupMenu; //USclass QComboBox; //USclass QPoint; //USclass QIconSet; @@ -54,7 +57,7 @@ class KURL; //US class KToolBar needs to be replaced -class KToolBar; +#include "ktoolbar.h" class KActionCollection; //US class KPopupMenu needs to be replaced @@ -105,7 +108,7 @@ public: * @param parent This action's parent. * @param name An internal name for this action. */ - KToggleAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); /** @@ -127,7 +130,7 @@ public: * @param parent This action's parent. * @param name An internal name for this action. */ - KToggleAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); /** @@ -246,7 +249,7 @@ public: * @param parent This action's parent. * @param name An internal name for this action. */ - KRadioAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); /** @@ -268,7 +271,7 @@ public: * @param parent This action's parent. * @param name An internal name for this action. */ - KRadioAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); /** @@ -352,7 +355,7 @@ public: * @param parent This action's parent. * @param name An internal name for this action. */ - KSelectAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); /** @@ -374,7 +377,7 @@ public: * @param parent This action's parent. * @param name An internal name for this action. */ - KSelectAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); /** @@ -438,7 +441,7 @@ public: */ virtual int comboWidth() const; - QPopupMenu* popupMenu() const; + Q3PopupMenu* popupMenu() const; /** * Deprecated. See @ref setMenuAccelsEnabled . @@ -567,7 +570,7 @@ public: * @param parent This action's parent. * @param name An internal name for this action. */ - KListAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KListAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); /** @@ -589,7 +592,7 @@ public: * @param parent This action's parent. * @param name An internal name for this action. */ - KListAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KListAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); @@ -685,7 +688,7 @@ public: * @param name An internal name for this action. * @param maxItems The maximum number of files to display */ - KRecentFilesAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KRecentFilesAction( const QString& text, const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name = 0, uint maxItems = 10 ); @@ -712,7 +715,7 @@ public: * @param name An internal name for this action. * @param maxItems The maximum number of files to display */ - KRecentFilesAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KRecentFilesAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0, uint maxItems = 10 ); @@ -834,11 +837,11 @@ public: KFontAction( const QString& text, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); - KFontAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); KFontAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); - KFontAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); KFontAction( const QString& text, const QString& pix, const KShortcut& cut, @@ -873,11 +876,11 @@ public: const char* name = 0 ); KFontSizeAction( const QString& text, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); - KFontSizeAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); KFontSizeAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); - KFontSizeAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); KFontSizeAction( const QString& text, const QString& pix, const KShortcut& cut, @@ -931,7 +934,7 @@ class KActionMenu : public KAction public: KActionMenu( const QString& text, QObject* parent = 0, const char* name = 0 ); - KActionMenu( const QString& text, const QIconSet& icon, + KActionMenu( const QString& text, const QIcon& icon, QObject* parent = 0, const char* name = 0 ); KActionMenu( const QString& text, const QString& icon, QObject* parent = 0, const char* name = 0 ); @@ -942,7 +945,7 @@ public: virtual void remove( KAction* ); //US KPopupMenu* popupMenu() const; - QPopupMenu* popupMenu() const; + Q3PopupMenu* popupMenu() const; void popup( const QPoint& global ); /** @@ -1067,7 +1070,7 @@ public: * aboutToShow for a more dynamic menu. */ //US KPopupMenu *popupMenu() const; - QPopupMenu *popupMenu() const; + Q3PopupMenu *popupMenu() const; /** * Returns true if this action creates a delayed popup menu @@ -1098,7 +1101,7 @@ public: private: //US KPopupMenu *m_popup; - QPopupMenu *m_popup; + Q3PopupMenu *m_popup; bool m_delayed:1; bool m_stickyMenu:1; protected: @@ -1147,8 +1150,8 @@ public slots: virtual void setChecked( bool ); private: - QCString m_toolBarName; - QGuardedPtr<KToolBar> m_toolBar; + Q3CString m_toolBarName; + QPointer<KToolBar> m_toolBar; protected: virtual void virtual_hook( int id, void* data ); private: @@ -1195,7 +1198,7 @@ public: protected slots: void slotToolbarDestroyed(); private: - QGuardedPtr<QWidget> m_widget; + QPointer<QWidget> m_widget; bool m_autoSized; protected: virtual void virtual_hook( int id, void* data ); 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 @@ -26,7 +26,9 @@ #include "kactioncollection.h" //US#include "kactionshortcutlist.h" -#include <qptrdict.h> +#include <q3ptrdict.h> +//Added by qt3to4: +#include <Q3ValueList> //US#include <qvariant.h> //US#include <kaccel.h> @@ -36,8 +38,8 @@ //US#include <kxmlguifactory.h> //US I included the following files -#include <qasciidict.h> -#include <qptrlist.h> +#include <q3asciidict.h> +#include <q3ptrlist.h> #include "kaction.h" #include <kglobal.h> #include <qobject.h> @@ -67,13 +69,13 @@ public: //int m_iWidgetCurrent; //QValueList<QWidget*> m_widgetList; //QValueList<KAccel*> m_kaccelList; - QValueList<KActionCollection*> m_docList; + Q3ValueList<KActionCollection*> m_docList; QWidget *m_widget; KAccel *m_kaccel; KAccel *m_builderKAccel; - QAsciiDict<KAction> m_actionDict; - QPtrDict< QPtrList<KAction> > m_dctHighlightContainers; + Q3AsciiDict<KAction> m_actionDict; + Q3PtrDict< Q3PtrList<KAction> > m_dctHighlightContainers; bool m_highlight; KAction *m_currentHighlightAction; bool m_statusCleared; @@ -133,7 +135,7 @@ KActionCollection::KActionCollection( const KActionCollection © ) KActionCollection::~KActionCollection() { kdDebug(129) << "KActionCollection::~KActionCollection(): this = " << this << endl; - for ( QAsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) { + for ( Q3AsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) { KAction* pAction = it.current(); if ( pAction->m_parentCollection == this ) pAction->m_parentCollection = 0L; @@ -365,7 +367,7 @@ KAction* KActionCollection::_take( KAction* action ) void KActionCollection::_clear() { - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); while ( it.current() ) _remove( it.current() ); } @@ -386,7 +388,7 @@ KAction* KActionCollection::action( const char* name, const char* classname ) co pAction = d->m_actionDict[ name ]; else { - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); for( ; it.current(); ++it ) { if ( ( !name || strcmp( it.current()->name(), name ) == 0 ) && @@ -407,7 +409,7 @@ KAction* KActionCollection::action( const char* name, const char* classname ) co KAction* KActionCollection::action( int index ) const { - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); it += index; return it.current(); // return d->m_actions.at( index ); @@ -432,7 +434,7 @@ QStringList KActionCollection::groups() const { QStringList lst; - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); for( ; it.current(); ++it ) if ( !it.current()->group().isEmpty() && !lst.contains( it.current()->group() ) ) lst.append( it.current()->group() ); @@ -444,7 +446,7 @@ KActionPtrList KActionCollection::actions( const QString& group ) const { KActionPtrList lst; - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); for( ; it.current(); ++it ) if ( it.current()->group() == group ) lst.append( it.current() ); @@ -458,7 +460,7 @@ KActionPtrList KActionCollection::actions() const { KActionPtrList lst; - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); for( ; it.current(); ++it ) lst.append( it.current() ); @@ -508,13 +510,13 @@ void KActionCollection::connectHighlight( QWidget *container, KAction *action ) if ( !d->m_highlight ) return; - QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; + Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; if ( !actionList ) { - actionList = new QPtrList<KAction>; + actionList = new Q3PtrList<KAction>; - if ( container->inherits( "QPopupMenu" ) ) + if ( container->inherits( "Q3PopupMenu" ) ) { connect( container, SIGNAL( highlighted( int ) ), this, SLOT( slotMenuItemHighlighted( int ) ) ); @@ -522,7 +524,7 @@ void KActionCollection::connectHighlight( QWidget *container, KAction *action ) this, SLOT( slotMenuAboutToHide() ) ); } //US else if ( container->inherits( "KToolBar" ) ) - else if ( container->inherits( "QToolBar" ) ) + else if ( container->inherits( "Q3ToolBar" ) ) { connect( container, SIGNAL( highlighted( int, bool ) ), this, SLOT( slotToolBarButtonHighlighted( int, bool ) ) ); @@ -542,7 +544,7 @@ void KActionCollection::disconnectHighlight( QWidget *container, KAction *action if ( !d->m_highlight ) return; - QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; + Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; if ( !actionList ) return; @@ -625,12 +627,12 @@ void KActionCollection::slotDestroyed() KAction *KActionCollection::findAction( QWidget *container, int id ) { - QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ reinterpret_cast<void *>( container ) ]; + Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ reinterpret_cast<void *>( container ) ]; if ( !actionList ) return 0; - QPtrListIterator<KAction> it( *actionList ); + Q3PtrListIterator<KAction> it( *actionList ); for (; it.current(); ++it ) if ( it.current()->isPlugged( container, id ) ) return it.current(); @@ -644,9 +646,9 @@ KActionCollection KActionCollection::operator+(const KActionCollection &c ) cons kdWarning(129) << "KActionCollection::operator+(): function is severely deprecated." << endl; KActionCollection ret( *this ); - QValueList<KAction *> actions = c.actions(); - QValueList<KAction *>::ConstIterator it = actions.begin(); - QValueList<KAction *>::ConstIterator end = actions.end(); + Q3ValueList<KAction *> actions = c.actions(); + Q3ValueList<KAction *>::ConstIterator it = actions.begin(); + Q3ValueList<KAction *>::ConstIterator end = actions.end(); for (; it != end; ++it ) ret.insert( *it ); @@ -670,7 +672,7 @@ KActionCollection &KActionCollection::operator=( const KActionCollection © ) KActionCollection &KActionCollection::operator+=( const KActionCollection &c ) { kdWarning(129) << "KActionCollection::operator+=(): function is severely deprecated." << endl; - QAsciiDictIterator<KAction> it(c.d->m_actionDict); + Q3AsciiDictIterator<KAction> it(c.d->m_actionDict); for ( ; it.current(); ++it ) insert( it.current() ); 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 @@ -30,6 +30,8 @@ //US #include <qkeysequence.h> #include <qobject.h> +//Added by qt3to4: +#include <Q3ValueList> //US#include <qvaluelist.h> //US#include <qguardedptr.h> //US #include <kguiitem.h> @@ -60,7 +62,7 @@ class QWidget; -typedef QValueList<KAction *> KActionPtrList; +typedef Q3ValueList<KAction *> KActionPtrList; /** * A managed set of KAction objects. 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 @@ -49,7 +49,9 @@ #include <kbuttonbox.h> #include <qpushbutton.h> -#include <qptrlist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <QResizeEvent> #include <assert.h> #define minButtonWidth 50 @@ -62,7 +64,7 @@ public: unsigned short actual_size; }; -template class QPtrList<KButtonBox::Item>; +template class Q3PtrList<KButtonBox::Item>; class KButtonBoxPrivate { public: @@ -70,10 +72,10 @@ public: unsigned short autoborder; unsigned short orientation; bool activated; - QPtrList<KButtonBox::Item> buttons; + Q3PtrList<KButtonBox::Item> buttons; }; -KButtonBox::KButtonBox(QWidget *parent, Orientation _orientation, +KButtonBox::KButtonBox(QWidget *parent, Qt::Orientation _orientation, int border, int autoborder) : QWidget(parent) { @@ -149,7 +151,7 @@ void KButtonBox::layout() { void KButtonBox::placeButtons() { unsigned int i; - if(data->orientation == Horizontal) { + if(data->orientation == Qt::Horizontal) { // calculate free size and stretches int fs = width() - 2 * data->border; int stretch = 0; @@ -251,7 +253,7 @@ QSize KButtonBox::sizeHint() const { else s = bs; - if(data->orientation == Horizontal) + if(data->orientation == Qt::Horizontal) dw += s.width(); else dw += s.height(); @@ -261,7 +263,7 @@ QSize KButtonBox::sizeHint() const { } } - if(data->orientation == Horizontal) + if(data->orientation == Qt::Horizontal) return QSize(dw, bs.height() + 2 * data->border); else return QSize(bs.width() + 2 * data->border, dw); @@ -270,7 +272,7 @@ QSize KButtonBox::sizeHint() const { QSizePolicy KButtonBox::sizePolicy() const { - return data->orientation == Horizontal? + return data->orientation == Qt::Horizontal? QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) : QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); } 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 @@ -21,6 +21,8 @@ #define __KBUTTONBOX__H__ #include <qwidget.h> +//Added by qt3to4: +#include <QResizeEvent> class QPushButton; class KButtonBoxPrivate; @@ -48,7 +50,7 @@ public: * @ref addButton() are laid out from top to bottom, otherwise they * are laid out from left to right. */ - KButtonBox(QWidget *parent, Orientation _orientation = Horizontal, + KButtonBox(QWidget *parent, Qt::Orientation _orientation = Qt::Horizontal, int border = 0, int _autoborder = 6); /** 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 @@ -20,7 +20,7 @@ #include <qregexp.h> #include <qstring.h> -#include <qiconset.h> +#include <qicon.h> #include <qpixmap.h> #include <assert.h> @@ -62,7 +62,7 @@ public: QString m_whatsThis; QString m_statusText; QString m_iconName; - QIconSet m_iconSet; + QIcon m_iconSet; bool m_hasIcon : 1; bool m_enabled : 1; }; @@ -82,7 +82,7 @@ KGuiItem::KGuiItem( const QString &text, const QString &iconName, setIconName( iconName ); } -KGuiItem::KGuiItem( const QString &text, const QIconSet &iconSet, +KGuiItem::KGuiItem( const QString &text, const QIcon &iconSet, const QString &toolTip, const QString &whatsThis ) { d = new KGuiItemPrivate; @@ -124,7 +124,7 @@ QString KGuiItem::plainText() const { return stripped; } -QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const +QIcon KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const { if( d->m_hasIcon ) { @@ -148,7 +148,7 @@ QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instan } } else - return QIconSet(); + return QIcon(); } QString KGuiItem::iconName() const @@ -177,7 +177,7 @@ void KGuiItem::setText( const QString &text ) { d->m_text=text; } -void KGuiItem::setIconSet( const QIconSet &iconset ) +void KGuiItem::setIconSet( const QIcon &iconset ) { d->m_iconSet = iconset; d->m_iconName = QString::null; @@ -187,7 +187,7 @@ void KGuiItem::setIconSet( const QIconSet &iconset ) void KGuiItem::setIconName( const QString &iconName ) { d->m_iconName = iconName; - d->m_iconSet = QIconSet(); + d->m_iconSet = QIcon(); d->m_hasIcon = !iconName.isEmpty(); } 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 @@ -23,9 +23,9 @@ #define __kguiitem_h__ #include <qstring.h> -#include <qiconset.h> +#include <qicon.h> #include <qpixmap.h> -#include <qvaluelist.h> +#include <q3valuelist.h> //US#include <kicontheme.h> #include <kglobal.h> @@ -42,7 +42,7 @@ public: const QString &toolTip = QString::null, const QString &whatsThis = QString::null ); - KGuiItem( const QString &text, const QIconSet &iconSet, + KGuiItem( const QString &text, const QIcon &iconSet, const QString &toolTip = QString::null, const QString &whatsThis = QString::null ); @@ -53,10 +53,10 @@ public: QString text() const; QString plainText() const; - QIconSet iconSet( KIcon::Group, int size = 0/*US , KInstance* instance = KGlobal::instance()*/) const; + QIcon iconSet( KIcon::Group, int size = 0/*US , KInstance* instance = KGlobal::instance()*/) const; #ifndef KDE_NO_COMPAT - QIconSet iconSet() const { return iconSet( KIcon::Small); } + QIcon iconSet() const { return iconSet( KIcon::Small); } #endif QString iconName() const; @@ -69,7 +69,7 @@ public: #endif void setText( const QString &text ); - void setIconSet( const QIconSet &iconset ); + void setIconSet( const QIcon &iconset ); void setIconName( const QString &iconName ); void setToolTip( const QString &tooltip ); void setWhatsThis( const QString &whatsThis ); 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 @@ -22,15 +22,23 @@ #include <qbitmap.h> #include <qlayout.h> #include <qlabel.h> -#include <qwidgetstack.h> +#include <q3widgetstack.h> #include <qtabwidget.h> -#include <qlistview.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qgrid.h> +#include <q3listview.h> +#include <q3hbox.h> +#include <q3vbox.h> +#include <q3grid.h> #include <qpainter.h> -#include <qobjectlist.h> +#include <qobject.h> #include <qstringlist.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <Q3PtrList> +#include <Q3Frame> +#include <QEvent> +#include <Q3VBoxLayout> +#include <QShowEvent> /*US #include <qbitmap.h> #include <qgrid.h> @@ -65,13 +73,13 @@ #include "kjanuswidget.h" -class KJanusWidget::IconListItem : public QListBoxItem +class KJanusWidget::IconListItem : public Q3ListBoxItem { public: - IconListItem( QListBox *listbox, const QPixmap &pixmap, + IconListItem( Q3ListBox *listbox, const QPixmap &pixmap, const QString &text ); - virtual int height( const QListBox *lb ) const; - virtual int width( const QListBox *lb ) const; + virtual int height( const Q3ListBox *lb ) const; + virtual int width( const Q3ListBox *lb ) const; int expandMinimumWidth( int width ); protected: @@ -98,7 +106,7 @@ public: QMap<int, QString> mIntToTitle; }; -template class QPtrList<QListViewItem>; +template class Q3PtrList<Q3ListViewItem>; KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) @@ -107,12 +115,12 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) mTitleList(0), mFace(face), mTitleLabel(0), mActivePageWidget(0), mShowIconsInTreeList(false), d(0) { - QVBoxLayout *topLayout = new QVBoxLayout( this ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( this ); if( mFace == TreeList || mFace == IconList ) { d = new KJanusWidgetPrivate; - QFrame *page = 0; + Q3Frame *page = 0; if( mFace == TreeList ) { //US @@ -145,7 +153,7 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) } else { - QHBoxLayout *hbox = new QHBoxLayout( topLayout ); + Q3HBoxLayout *hbox = new Q3HBoxLayout( topLayout ); mIconList = new IconListBox( this ); QFont listFont( mIconList->font() ); @@ -156,7 +164,7 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) hbox->addWidget( mIconList ); connect( mIconList, SIGNAL(selectionChanged()), SLOT(slotShowPage())); hbox->addSpacing( KDialog::marginHint() ); - page = new QFrame( this ); + page = new Q3Frame( this ); hbox->addWidget( page, 10 ); } @@ -165,7 +173,7 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) // pagestack using all available space at bottom. // - QVBoxLayout *vbox = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + Q3VBoxLayout *vbox = new Q3VBoxLayout( page, 0, KDialog::spacingHint() ); mTitleLabel = new QLabel( QString::fromLatin1("Empty page"), page, "KJanusWidgetTitleLabel" ); vbox->addWidget( mTitleLabel ); @@ -175,10 +183,10 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) mTitleLabel->setFont( titleFont ); mTitleSep = new KSeparator( page ); - mTitleSep->setFrameStyle( QFrame::HLine|QFrame::Plain ); + mTitleSep->setFrameStyle( Q3Frame::HLine|Q3Frame::Plain ); vbox->addWidget( mTitleSep ); - mPageStack = new QWidgetStack( page ); + mPageStack = new Q3WidgetStack( page ); connect(mPageStack, SIGNAL(aboutToShow(QWidget *)), SIGNAL(aboutToShowPage(QWidget *))); vbox->addWidget( mPageStack, 10 ); @@ -199,7 +207,7 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) else { mFace = Plain; - mPlainPage = new QFrame( this ); + mPlainPage = new Q3Frame( this ); topLayout->addWidget( mPlainPage, 10 ); } /*US @@ -245,7 +253,7 @@ bool KJanusWidget::isValid() const } -QFrame *KJanusWidget::plainPage() +Q3Frame *KJanusWidget::plainPage() { return( mPlainPage ); } @@ -266,7 +274,7 @@ QWidget *KJanusWidget::FindParent() } } -QFrame *KJanusWidget::addPage( const QStringList &items, const QString &header, +Q3Frame *KJanusWidget::addPage( const QStringList &items, const QString &header, const QPixmap &pixmap ) { if( mValid == false ) @@ -275,7 +283,7 @@ QFrame *KJanusWidget::addPage( const QStringList &items, const QString &header, return( 0 ); } - QFrame *page = new QFrame( FindParent(), "page" ); + Q3Frame *page = new Q3Frame( FindParent(), "page" ); addPageWidget( page, items, header, pixmap ); return page; @@ -287,13 +295,13 @@ void KJanusWidget::pageGone( QObject *obj ) removePage( static_cast<QWidget*>( obj ) ); } -void KJanusWidget::slotReopen( QListViewItem * item ) +void KJanusWidget::slotReopen( Q3ListViewItem * item ) { if( item ) item->setOpen( true ); } -QFrame *KJanusWidget::addPage( const QString &itemName, const QString &header, +Q3Frame *KJanusWidget::addPage( const QString &itemName, const QString &header, const QPixmap &pixmap ) { @@ -304,7 +312,7 @@ QFrame *KJanusWidget::addPage( const QString &itemName, const QString &header, -QVBox *KJanusWidget::addVBoxPage( const QStringList &items, +Q3VBox *KJanusWidget::addVBoxPage( const QStringList &items, const QString &header, const QPixmap &pixmap ) { @@ -315,14 +323,14 @@ QVBox *KJanusWidget::addVBoxPage( const QStringList &items, return( 0 ); } - QVBox *page = new QVBox(FindParent() , "vbox_page" ); + Q3VBox *page = new Q3VBox(FindParent() , "vbox_page" ); page->setSpacing( KDialog::spacingHintSmall() ); addPageWidget( page, items, header, pixmap ); return page; } -QVBox *KJanusWidget::addVBoxPage( const QString &itemName, +Q3VBox *KJanusWidget::addVBoxPage( const QString &itemName, const QString &header, const QPixmap &pixmap ) { @@ -331,7 +339,7 @@ QVBox *KJanusWidget::addVBoxPage( const QString &itemName, return addVBoxPage(items, header, pixmap); } -QHBox *KJanusWidget::addHBoxPage( const QStringList &items, +Q3HBox *KJanusWidget::addHBoxPage( const QStringList &items, const QString &header, const QPixmap &pixmap ) { @@ -340,14 +348,14 @@ QHBox *KJanusWidget::addHBoxPage( const QStringList &items, return( 0 ); } - QHBox *page = new QHBox(FindParent(), "hbox_page"); + Q3HBox *page = new Q3HBox(FindParent(), "hbox_page"); page->setSpacing( KDialog::spacingHint() ); addPageWidget( page, items, header, pixmap ); return page; } -QHBox *KJanusWidget::addHBoxPage( const QString &itemName, +Q3HBox *KJanusWidget::addHBoxPage( const QString &itemName, const QString &header, const QPixmap &pixmap ) { @@ -356,7 +364,7 @@ QHBox *KJanusWidget::addHBoxPage( const QString &itemName, return addHBoxPage(items, header, pixmap); } -QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, +Q3Grid *KJanusWidget::addGridPage( int n, Qt::Orientation dir, const QStringList &items, const QString &header, const QPixmap &pixmap ) @@ -367,7 +375,7 @@ QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, return( 0 ); } - QGrid *page = new QGrid( n, dir, FindParent(), "page" ); + Q3Grid *page = new Q3Grid( n, dir, FindParent(), "page" ); page->setSpacing( KDialog::spacingHint() ); addPageWidget( page, items, header, pixmap ); @@ -375,7 +383,7 @@ QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, } -QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, +Q3Grid *KJanusWidget::addGridPage( int n, Qt::Orientation dir, const QString &itemName, const QString &header, const QPixmap &pixmap ) @@ -385,10 +393,10 @@ QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, return addGridPage(n, dir, items, header, pixmap); } -void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page) +void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, Q3Frame *page) { bool isTop = true; - QListViewItem *curTop = 0, *child, *last, *newChild; + Q3ListViewItem *curTop = 0, *child, *last, *newChild; unsigned int index = 1; QStringList curPath; @@ -412,9 +420,9 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p // This node didn't have any children at all, lets just insert the // new child. if (isTop) - newChild = new QListViewItem(mTreeList, name); + newChild = new Q3ListViewItem(mTreeList, name); else - newChild = new QListViewItem(curTop, name); + newChild = new Q3ListViewItem(curTop, name); } else if (child != 0) { @@ -431,9 +439,9 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p else { // the node had some children, but we didn't find the given name if (isTop) - newChild = new QListViewItem(mTreeList, last, name); + newChild = new Q3ListViewItem(mTreeList, last, name); else - newChild = new QListViewItem(curTop, last, name); + newChild = new Q3ListViewItem(curTop, last, name); } // Now make the element expandable if it is a path component, and make @@ -459,7 +467,7 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p } } -void KJanusWidget::addPageWidget( QFrame *page, const QStringList &items, +void KJanusWidget::addPageWidget( Q3Frame *page, const QStringList &items, const QString &header,const QPixmap &pixmap ) { /*US the following signal causes a segmentation fault while closing the dialog. @@ -550,15 +558,15 @@ bool KJanusWidget::setSwallowedWidget( QWidget *widget ) { delete mSwallowPage->layout(); } - QGridLayout *gbox = new QGridLayout( mSwallowPage, 1, 1, 0 ); + Q3GridLayout *gbox = new Q3GridLayout( mSwallowPage, 1, 1, 0 ); // // Hide old children // - QObjectList *l = (QObjectList*)mSwallowPage->children(); // silence please - for( uint i=0; i < l->count(); i++ ) + QObjectList l = mSwallowPage->children(); // silence please + for( uint i=0; i < l.count(); i++ ) { - QObject *o = l->at(i); + QObject *o = l.at(i); if( o->isWidgetType() ) { ((QWidget*)o)->hide(); @@ -597,7 +605,7 @@ bool KJanusWidget::slotShowPage() if( mFace == TreeList ) { - QListViewItem *node = mTreeList->selectedItem(); + Q3ListViewItem *node = mTreeList->selectedItem(); if( node == 0 ) { return( false ); } QWidget *stackItem = mTreeListToPageStack[node]; @@ -606,7 +614,7 @@ bool KJanusWidget::slotShowPage() } else if( mFace == IconList ) { - QListBoxItem *node = mIconList->item( mIconList->currentItem() ); + Q3ListBoxItem *node = mIconList->item( mIconList->currentItem() ); if( node == 0 ) { return( false ); } QWidget *stackItem = mIconListToPageStack[node]; // Make sure to call through the virtual function showPage(int) @@ -646,9 +654,9 @@ bool KJanusWidget::showPage( QWidget *w ) mTitleLabel->setText( d->mIntToTitle[index] ); if( mFace == TreeList ) { - QMap<QListViewItem *, QWidget *>::Iterator it; + QMap<Q3ListViewItem *, QWidget *>::Iterator it; for (it = mTreeListToPageStack.begin(); it != mTreeListToPageStack.end(); ++it){ - QListViewItem *key = it.key(); + Q3ListViewItem *key = it.key(); QWidget *val = it.data(); if (val == w) { mTreeList->setSelected(key, true ); @@ -658,9 +666,9 @@ bool KJanusWidget::showPage( QWidget *w ) } else { - QMap<QListBoxItem *, QWidget *>::Iterator it; + QMap<Q3ListBoxItem *, QWidget *>::Iterator it; for (it = mIconListToPageStack.begin(); it != mIconListToPageStack.end(); ++it){ - QListBoxItem *key = it.key(); + Q3ListBoxItem *key = it.key(); QWidget *val = it.data(); if (val == w) { mIconList->setSelected( key, true ); @@ -686,13 +694,13 @@ bool KJanusWidget::showPage( QWidget *w ) int KJanusWidget::activePageIndex() const { if( mFace == TreeList) { - QListViewItem *node = mTreeList->selectedItem(); + Q3ListViewItem *node = mTreeList->selectedItem(); if( node == 0 ) { return -1; } QWidget *stackItem = mTreeListToPageStack[node]; return d->mPageToInt[stackItem]; } else if (mFace == IconList) { - QListBoxItem *node = mIconList->item( mIconList->currentItem() ); + Q3ListBoxItem *node = mIconList->item( mIconList->currentItem() ); if( node == 0 ) { return( false ); } QWidget *stackItem = mIconListToPageStack[node]; return d->mPageToInt[stackItem]; @@ -761,7 +769,7 @@ void KJanusWidget::slotFontChanged() */ // makes the treelist behave like the list of kcontrol -void KJanusWidget::slotItemClicked(QListViewItem *it) +void KJanusWidget::slotItemClicked(Q3ListViewItem *it) { if(it && (it->childCount()>0)) it->setOpen(!it->isOpen()); @@ -895,11 +903,11 @@ void KJanusWidget::unfoldTreeList( bool persist ) if( mFace == TreeList ) { if( persist ) - connect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); + connect( mTreeList, SIGNAL( collapsed( Q3ListViewItem * ) ), this, SLOT( slotReopen( Q3ListViewItem * ) ) ); else - disconnect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); + disconnect( mTreeList, SIGNAL( collapsed( Q3ListViewItem * ) ), this, SLOT( slotReopen( Q3ListViewItem * ) ) ); - for( QListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() ) + for( Q3ListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() ) item->setOpen( true ); } } @@ -953,7 +961,7 @@ bool KJanusWidget::eventFilter( QObject *o, QEvent *e ) KJanusWidget::IconListBox::IconListBox( QWidget *parent, const char *name, - WFlags f ) + Qt::WFlags f ) :KListBox( parent, name, f ), mShowAll(false), mHeightValid(false), mWidthValid(false) { @@ -965,7 +973,7 @@ void KJanusWidget::IconListBox::updateMinimumHeight() if( mShowAll == true && mHeightValid == false ) { int h = frameWidth()*2; - for( QListBoxItem *i = item(0); i != 0; i = i->next() ) + for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() ) { h += i->height( this ); } @@ -980,13 +988,13 @@ void KJanusWidget::IconListBox::updateWidth() if( mWidthValid == false ) { int maxWidth = 10; - for( QListBoxItem *i = item(0); i != 0; i = i->next() ) + for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() ) { int w = ((IconListItem *)i)->width(this); maxWidth = QMAX( w, maxWidth ); } - for( QListBoxItem *i = item(0); i != 0; i = i->next() ) + for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() ) { ((IconListItem *)i)->expandMinimumWidth( maxWidth ); } @@ -1022,9 +1030,9 @@ void KJanusWidget::IconListBox::setShowAll( bool showAll ) -KJanusWidget::IconListItem::IconListItem( QListBox *listbox, const QPixmap &pixmap, +KJanusWidget::IconListItem::IconListItem( Q3ListBox *listbox, const QPixmap &pixmap, const QString &text ) - : QListBoxItem( listbox ) + : Q3ListBoxItem( listbox ) { mPixmap = pixmap; if( mPixmap.isNull() == true ) @@ -1083,7 +1091,7 @@ void KJanusWidget::IconListItem::paint( QPainter *painter ) } } -int KJanusWidget::IconListItem::height( const QListBox *lb ) const +int KJanusWidget::IconListItem::height( const Q3ListBox *lb ) const { if( text().isEmpty() == true ) { @@ -1096,7 +1104,7 @@ int KJanusWidget::IconListItem::height( const QListBox *lb ) const } -int KJanusWidget::IconListItem::width( const QListBox *lb ) const +int KJanusWidget::IconListItem::width( const Q3ListBox *lb ) const { int wt = lb->fontMetrics().boundingRect(text()).width()+10; int wp = mPixmap.width() + 10; @@ -1122,7 +1130,7 @@ void KJanusWidget::removePage( QWidget *page ) if ( mFace == TreeList ) { - QMap<QListViewItem*, QWidget *>::Iterator i; + QMap<Q3ListViewItem*, QWidget *>::Iterator i; for( i = mTreeListToPageStack.begin(); i != mTreeListToPageStack.end(); ++i ) if (i.data()==page) { @@ -1137,7 +1145,7 @@ void KJanusWidget::removePage( QWidget *page ) } else if ( mFace == IconList ) { - QMap<QListBoxItem*, QWidget *>::Iterator i; + QMap<Q3ListBoxItem*, QWidget *>::Iterator i; for( i = mIconListToPageStack.begin(); i != mIconListToPageStack.end(); ++i ) if (i.data()==page) { 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 @@ -20,10 +20,16 @@ #ifndef _KJANUS_WIDGET_H_ #define _KJANUS_WIDGET_H_ -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qwidget.h> #include <qmap.h> -#include <qgrid.h> +#include <q3grid.h> +//Added by qt3to4: +#include <QShowEvent> +#include <Q3Frame> +#include <QPixmap> +#include <QLabel> +#include <QEvent> #include <klistbox.h> /*US @@ -38,12 +44,12 @@ class KSeparator; class KListView; -class QWidgetStack; +class Q3WidgetStack; class QLabel; class QTabWidget; -class QListViewItem; -class QVBox; -class QHBox; +class Q3ListViewItem; +class Q3VBox; +class Q3HBox; /** * Provides a number of ready to use layouts (faces). It is used @@ -102,7 +108,7 @@ class KJanusWidget : public QWidget class IconListBox : public KListBox { public: - IconListBox( QWidget *parent=0, const char *name=0, WFlags f=0 ); + IconListBox( QWidget *parent=0, const char *name=0, Qt::WFlags f=0 ); void updateMinimumHeight(); void updateWidth(); void invalidateHeight(); @@ -193,7 +199,7 @@ class KJanusWidget : public QWidget * * @return The widget or 0 if the face in not Plain. */ - virtual QFrame *plainPage(); + virtual Q3Frame *plainPage(); /** * Add a new page when the class is used in TreeList, IconList or Tabbed @@ -214,7 +220,7 @@ class KJanusWidget : public QWidget * @return The empty page or 0 if the face is not TreeList, IconList or * Tabbed. */ - virtual QFrame *addPage(const QString &item,const QString &header=QString::null, + virtual Q3Frame *addPage(const QString &item,const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); /** @@ -231,7 +237,7 @@ class KJanusWidget : public QWidget * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. **/ - virtual QFrame *addPage(const QStringList &items, const QString &header=QString::null, + virtual Q3Frame *addPage(const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); /** @@ -253,7 +259,7 @@ class KJanusWidget : public QWidget * * @return The empty page or 0 if the face is not TreeList, IconList or * Tabbed. */ - virtual QVBox *addVBoxPage( const QString &item, + virtual Q3VBox *addVBoxPage( const QString &item, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -269,7 +275,7 @@ class KJanusWidget : public QWidget * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. **/ - virtual QVBox *addVBoxPage( const QStringList &items, + virtual Q3VBox *addVBoxPage( const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -293,7 +299,7 @@ class KJanusWidget : public QWidget * @return The empty page or 0 if the face is not TreeList, IconList or * Tabbed. */ - virtual QHBox *addHBoxPage( const QString &itemName, + virtual Q3HBox *addHBoxPage( const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -309,7 +315,7 @@ class KJanusWidget : public QWidget * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. **/ - virtual QHBox *addHBoxPage( const QStringList &items, + virtual Q3HBox *addHBoxPage( const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -337,7 +343,7 @@ class KJanusWidget : public QWidget * Tabbed. */ //US changed Orientation into Direction for compatibility - virtual QGrid *addGridPage( int n, QGrid::Direction dir, + virtual Q3Grid *addGridPage( int n, Qt::Orientation dir, const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -355,7 +361,7 @@ class KJanusWidget : public QWidget * removed (you can re-add a page with the same name later. **/ //US changed Orientation into Direction for compatibility - virtual QGrid *addGridPage( int n, QGrid::Direction dir, + virtual Q3Grid *addGridPage( int n, Qt::Orientation dir, const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -517,38 +523,38 @@ class KJanusWidget : public QWidget private slots: bool slotShowPage(); //US not yet implemented void slotFontChanged(); - void slotItemClicked(QListViewItem *it); + void slotItemClicked(Q3ListViewItem *it); void pageGone( QObject *obj); // signal from the added page's "destroyed" signal - void slotReopen(QListViewItem *item); + void slotReopen(Q3ListViewItem *item); protected: bool showPage( QWidget *w ); - void addPageWidget( QFrame *page, const QStringList &items, + void addPageWidget( Q3Frame *page, const QStringList &items, const QString &header, const QPixmap &pixmap ); - void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page); + void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, Q3Frame *page); QWidget *FindParent(); private: bool mValid; // Obsolete members. Remove in KDE 4. - QPtrList<QWidget> *mPageList; + Q3PtrList<QWidget> *mPageList; QStringList *mTitleList; int mFace; KListView *mTreeList; IconListBox *mIconList; - QWidgetStack *mPageStack; + Q3WidgetStack *mPageStack; QLabel *mTitleLabel; QTabWidget *mTabControl; - QFrame *mPlainPage; + Q3Frame *mPlainPage; QWidget *mSwallowPage; QWidget *mActivePageWidget; KSeparator *mTitleSep; //US QSplitter::ResizeMode mTreeListResizeMode; bool mShowIconsInTreeList; - QMap<QListViewItem *, QWidget *> mTreeListToPageStack; - QMap<QListBoxItem *, QWidget *> mIconListToPageStack; + QMap<Q3ListViewItem *, QWidget *> mTreeListToPageStack; + QMap<Q3ListBoxItem *, QWidget *> mIconListToPageStack; QMap<QString, QPixmap> mFolderIconMap; QMap<QString, QStringList> mChildrenNames; QMap<QString, QWidget *> mChildPages; 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 @@ -16,6 +16,11 @@ Boston, MA 02111-1307, USA. */ #include <qtimer.h> +//Added by qt3to4: +#include <QEvent> +#include <QMouseEvent> +#include <QKeyEvent> +#include <QFocusEvent> #include <kglobalsettings.h> //US#include <kcursor.h> @@ -26,22 +31,23 @@ #include "klistbox.h" #ifdef Q_WS_X11 +#include <QX11Info> #include <X11/Xlib.h> #endif #ifdef _WIN32_ #define Q_WS_QWS #endif -KListBox::KListBox( QWidget *parent, const char *name, WFlags f ) - : QListBox( parent, name, f ) +KListBox::KListBox( QWidget *parent, const char *name, Qt::WFlags f ) + : Q3ListBox( parent, name, f ) { connect( this, SIGNAL( onViewport() ), this, SLOT( slotOnViewport() ) ); - connect( this, SIGNAL( onItem( QListBoxItem * ) ), - this, SLOT( slotOnItem( QListBoxItem * ) ) ); + connect( this, SIGNAL( onItem( Q3ListBoxItem * ) ), + this, SLOT( slotOnItem( Q3ListBoxItem * ) ) ); - connect( this, SIGNAL( mouseButtonClicked( int, QListBoxItem *, + connect( this, SIGNAL( mouseButtonClicked( int, Q3ListBoxItem *, const QPoint & ) ), - this, SLOT( slotMouseButtonClicked( int, QListBoxItem *, + this, SLOT( slotMouseButtonClicked( int, Q3ListBoxItem *, const QPoint & ) ) ); /*US @@ -60,7 +66,7 @@ KListBox::KListBox( QWidget *parent, const char *name, WFlags f ) this, SLOT( slotAutoSelect() ) ); } -void KListBox::slotOnItem( QListBoxItem *item ) +void KListBox::slotOnItem( Q3ListBoxItem *item ) { /*US if ( item && m_bChangeCursorOverItem && m_bUseSingle ) @@ -139,11 +145,11 @@ void KListBox::slotAutoSelect() Window child; int root_x, root_y, win_x, win_y; uint keybstate; - XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, + XQueryPointer( x11Info().display(), x11Info().appRootWindow(), &root, &child, &root_x, &root_y, &win_x, &win_y, &keybstate ); #endif - QListBoxItem* previousItem = item( currentItem() ); + Q3ListBoxItem* previousItem = item( currentItem() ); setCurrentItem( m_pCurrentItem ); if( m_pCurrentItem ) { @@ -167,7 +173,7 @@ void KListBox::slotAutoSelect() viewport()->setUpdatesEnabled( false ); bool down = index( previousItem ) < index( m_pCurrentItem ); - QListBoxItem* it = down ? previousItem : m_pCurrentItem; + Q3ListBoxItem* it = down ? previousItem : m_pCurrentItem; for (;it ; it = it->next() ) { if ( down && it == m_pCurrentItem ) { setSelected( m_pCurrentItem, select ); @@ -186,7 +192,7 @@ void KListBox::slotAutoSelect() emit selectionChanged(); - if( selectionMode() == QListBox::Single ) + if( selectionMode() == Q3ListBox::Single ) emit selectionChanged( m_pCurrentItem ); } #ifndef Q_WS_QWS //FIXME @@ -213,14 +219,14 @@ void KListBox::slotAutoSelect() #endif } -void KListBox::emitExecute( QListBoxItem *item, const QPoint &pos ) +void KListBox::emitExecute( Q3ListBoxItem *item, const QPoint &pos ) { #ifdef Q_WS_X11 //FIXME Window root; Window child; int root_x, root_y, win_x, win_y; uint keybstate; - XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, + XQueryPointer( x11Info().display(), x11Info().appRootWindow(), &root, &child, &root_x, &root_y, &win_x, &win_y, &keybstate ); #endif @@ -246,17 +252,17 @@ void KListBox::emitExecute( QListBoxItem *item, const QPoint &pos ) // void KListBox::keyPressEvent(QKeyEvent *e) { - if( e->key() == Key_Escape ) + if( e->key() == Qt::Key_Escape ) { e->ignore(); } - else if( e->key() == Key_F1 ) + else if( e->key() == Qt::Key_F1 ) { e->ignore(); } else { - QListBox::keyPressEvent(e); + Q3ListBox::keyPressEvent(e); } } @@ -264,19 +270,19 @@ void KListBox::focusOutEvent( QFocusEvent *fe ) { m_pAutoSelect->stop(); - QListBox::focusOutEvent( fe ); + Q3ListBox::focusOutEvent( fe ); } void KListBox::leaveEvent( QEvent *e ) { m_pAutoSelect->stop(); - QListBox::leaveEvent( e ); + Q3ListBox::leaveEvent( e ); } void KListBox::contentsMousePressEvent( QMouseEvent *e ) { - if( (selectionMode() == Extended) && (e->state() & ShiftButton) && !(e->state() & ControlButton) ) { + if( (selectionMode() == Extended) && (e->state() & Qt::ShiftButton) && !(e->state() & Qt::ControlButton) ) { bool block = signalsBlocked(); blockSignals( true ); @@ -285,26 +291,26 @@ void KListBox::contentsMousePressEvent( QMouseEvent *e ) blockSignals( block ); } - QListBox::contentsMousePressEvent( e ); + Q3ListBox::contentsMousePressEvent( e ); } void KListBox::contentsMouseDoubleClickEvent ( QMouseEvent * e ) { - QListBox::contentsMouseDoubleClickEvent( e ); + Q3ListBox::contentsMouseDoubleClickEvent( e ); - QListBoxItem* item = itemAt( e->pos() ); + Q3ListBoxItem* item = itemAt( e->pos() ); if( item ) { emit doubleClicked( item, e->globalPos() ); - if( (e->button() == LeftButton) && !m_bUseSingle ) + if( (e->button() == Qt::LeftButton) && !m_bUseSingle ) emitExecute( item, e->globalPos() ); } } -void KListBox::slotMouseButtonClicked( int btn, QListBoxItem *item, const QPoint &pos ) +void KListBox::slotMouseButtonClicked( int btn, Q3ListBoxItem *item, const QPoint &pos ) { - if( (btn == LeftButton) && item ) + if( (btn == Qt::LeftButton) && item ) emitExecute( item, pos ); } 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 @@ -18,7 +18,12 @@ #ifndef KLISTBOX_H #define KLISTBOX_H -#include <qlistbox.h> +#include <q3listbox.h> +//Added by qt3to4: +#include <QMouseEvent> +#include <QFocusEvent> +#include <QKeyEvent> +#include <QEvent> /** * Extends the functionality of @ref QListBox to honor the system @@ -35,12 +40,12 @@ * * @short A variant of @ref QListBox that honors KDE's system-wide settings. **/ -class KListBox : public QListBox +class KListBox : public Q3ListBox { Q_OBJECT public: - KListBox( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); + KListBox( QWidget *parent = 0, const char *name = 0, Qt::WFlags f = 0 ); signals: @@ -54,7 +59,7 @@ signals: * Note that you may not delete any @ref QListBoxItem objects in slots * connected to this signal. */ - void executed( QListBoxItem *item ); + void executed( Q3ListBoxItem *item ); /** * Emitted whenever the user executes an listbox item. @@ -67,7 +72,7 @@ signals: * Note that you may not delete any @ref QListBoxItem objects in slots * connected to this signal. */ - void executed( QListBoxItem *item, const QPoint &pos ); + void executed( Q3ListBoxItem *item, const QPoint &pos ); /** * This signal gets emitted whenever the user double clicks into the @@ -83,10 +88,10 @@ signals: * You should normally not need to use this. In most cases it's better * to use @ref executed() instead. */ - void doubleClicked( QListBoxItem *item, const QPoint &pos ); + void doubleClicked( Q3ListBoxItem *item, const QPoint &pos ); protected slots: - void slotOnItem( QListBoxItem *item ); + void slotOnItem( Q3ListBoxItem *item ); void slotOnViewport(); //US void slotSettingsChanged(int); @@ -97,7 +102,7 @@ protected slots: void slotAutoSelect(); protected: - void emitExecute( QListBoxItem *item, const QPoint &pos ); + void emitExecute( Q3ListBoxItem *item, const QPoint &pos ); /** * @reimplemented @@ -123,13 +128,13 @@ protected: bool m_bUseSingle; //US bool m_bChangeCursorOverItem; - QListBoxItem* m_pCurrentItem; + Q3ListBoxItem* m_pCurrentItem; QTimer* m_pAutoSelect; int m_autoSelectDelay; private slots: - void slotMouseButtonClicked( int btn, QListBoxItem *item, const QPoint &pos ); + void slotMouseButtonClicked( int btn, Q3ListBoxItem *item, const QPoint &pos ); protected: virtual void virtual_hook( int id, void* data ); 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 @@ -18,13 +18,27 @@ Boston, MA 02111-1307, USA. */ -#include <qdragobject.h> +#include <q3dragobject.h> #include <qtimer.h> -#include <qheader.h> +#include <q3header.h> #include <qcursor.h> #include <qtooltip.h> #include <qstyle.h> #include <qpainter.h> +//Added by qt3to4: +#include <QDragLeaveEvent> +#include <QKeyEvent> +#include <Q3ValueList> +#include <Q3PtrList> +#include <QPixmap> +#include <QDragEnterEvent> +#include <QDragMoveEvent> +#include <QDropEvent> +#include <QResizeEvent> +#include <QFocusEvent> +#include <QMouseEvent> +#include <QEvent> +#include <QPaintEvent> #include <kglobalsettings.h> #include <kconfig.h> @@ -38,7 +52,7 @@ #endif #ifndef _WIN32_ #define private public -#include <qlistview.h> +#include <q3listview.h> #undef private #endif #include "klistview.h" @@ -46,9 +60,10 @@ #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #endif +#include <Q3Action> // /*US -class KListView::Tooltip : public QToolTip +class KListView::Tooltip /* TODO:hacker:TODO: : public QToolTip */ { public: Tooltip (KListView* parent, QToolTipGroup* group = 0L); @@ -67,7 +82,7 @@ private: }; KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group) - : QToolTip (parent, group), + : /* XXX:hacker:XXX: QToolTip (parent, group), */ mParent (parent) { } @@ -123,20 +138,20 @@ public: //US delete editor; } - QListViewItem* pCurrentItem; + Q3ListViewItem* pCurrentItem; QTimer autoSelect; int autoSelectDelay; QTimer dragExpand; - QListViewItem* dragOverItem; + Q3ListViewItem* dragOverItem; QPoint dragOverPoint; QPoint startDragPos; int dragDelay; //US KListViewLineEdit *editor; - QValueList<int> renameable; + Q3ValueList<int> renameable; bool cursorInExecuteArea:1; bool bUseSingle:1; @@ -170,8 +185,8 @@ public: QRect mOldDropVisualizer; int mDropVisualizerWidth; QRect mOldDropHighlighter; - QListViewItem *afterItemDrop; - QListViewItem *parentItemDrop; + Q3ListViewItem *afterItemDrop; + Q3ListViewItem *parentItemDrop; QColor alternateBackground; }; @@ -226,7 +241,7 @@ void KListViewLineEdit::load(QListViewItem *i, int c) * tabOrderedRename functionality. */ -static int nextCol (KListView *pl, QListViewItem *pi, int start, int dir) +static int nextCol (KListView *pl, Q3ListViewItem *pi, int start, int dir) { if (pi) { @@ -239,9 +254,9 @@ static int nextCol (KListView *pl, QListViewItem *pi, int start, int dir) return -1; } -static QListViewItem *prevItem (QListViewItem *pi) +static Q3ListViewItem *prevItem (Q3ListViewItem *pi) { - QListViewItem *pa = pi->itemAbove(); + Q3ListViewItem *pa = pi->itemAbove(); /* Does what the QListViewItem::previousSibling() * of my dreams would do. @@ -252,7 +267,7 @@ static QListViewItem *prevItem (QListViewItem *pi) return NULL; } -static QListViewItem *lastQChild (QListViewItem *pi) +static Q3ListViewItem *lastQChild (Q3ListViewItem *pi) { if (pi) { @@ -260,7 +275,7 @@ static QListViewItem *lastQChild (QListViewItem *pi) * This finds the last sibling for the given * item. */ - for (QListViewItem *pt = pi->nextSibling(); pt; pt = pt->nextSibling()) + for (Q3ListViewItem *pt = pi->nextSibling(); pt; pt = pt->nextSibling()) pi = pt; } @@ -328,10 +343,10 @@ bool KListViewLineEdit::event (QEvent *pe) if ((k->key() == Qt::Key_Backtab || k->key() == Qt::Key_Tab) && p->tabOrderedRenaming() && p->itemsRenameable() && - !(k->state() & ControlButton || k->state() & AltButton)) + !(k->state() & Qt::ControlButton || k->state() & AltButton)) { selectNextCell(item, col, - (k->key() == Key_Tab && !(k->state() & ShiftButton))); + (k->key() == Key_Tab && !(k->state() & Qt::ShiftButton))); return true; } } @@ -406,7 +421,7 @@ void KListViewLineEdit::slotSelectionChanged() */ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse ) - : QListView( parent, name ), + : Q3ListView( parent, name ), d (new KListViewPrivate (this)) { #ifndef DESKTOP_VERSION @@ -417,8 +432,8 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse connect( this, SIGNAL( onViewport() ), this, SLOT( slotOnViewport() ) ); - connect( this, SIGNAL( onItem( QListViewItem * ) ), - this, SLOT( slotOnItem( QListViewItem * ) ) ); + connect( this, SIGNAL( onItem( Q3ListViewItem * ) ), + this, SLOT( slotOnItem( Q3ListViewItem * ) ) ); connect (this, SIGNAL(contentsMoving(int,int)), this, SLOT(cleanDropVisualizer())); @@ -445,17 +460,17 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse // context menu handling if (d->showContextMenusOnPress) { - connect (this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)), - this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); + connect (this, SIGNAL (rightButtonPressed (Q3ListViewItem*, const QPoint&, int)), + this, SLOT (emitContextMenu (Q3ListViewItem*, const QPoint&, int))); } else { - connect (this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)), - this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); + connect (this, SIGNAL (rightButtonClicked (Q3ListViewItem*, const QPoint&, int)), + this, SLOT (emitContextMenu (Q3ListViewItem*, const QPoint&, int))); } - connect (this, SIGNAL (menuShortCutPressed (KListView*, QListViewItem*)), - this, SLOT (emitContextMenu (KListView*, QListViewItem*))); + connect (this, SIGNAL (menuShortCutPressed (KListView*, Q3ListViewItem*)), + this, SLOT (emitContextMenu (KListView*, Q3ListViewItem*))); //qDebug("KListView::KListView make alternate color configurable"); @@ -480,7 +495,7 @@ QSize KListView::sizeHint() const { //qDebug("KListView::QSize sizeHint() "); #ifdef DESKTOP_VERSION - return QListView::sizeHint(); + return Q3ListView::sizeHint(); #else return QSize ( 40, 40 ); #endif @@ -503,7 +518,7 @@ bool KListView::isExecuteArea( int x ) } } -void KListView::slotOnItem( QListViewItem *item ) +void KListView::slotOnItem( Q3ListViewItem *item ) { QPoint vp = viewport()->mapFromGlobal( QCursor::pos() ); if ( item && isExecuteArea( vp.x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) { @@ -534,12 +549,12 @@ void KListView::slotSettingsChanged(int category) //US set explicitly d->bUseSingle = KGlobalSettings::singleClick(); // qDebug("KListView::slotSettingsChanged: single%i", d->bUseSingle); - disconnect(this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), - this, SLOT (slotMouseButtonClicked (int, QListViewItem*, const QPoint &, int))); + disconnect(this, SIGNAL (mouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int)), + this, SLOT (slotMouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int))); if( d->bUseSingle ) - connect (this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), - this, SLOT (slotMouseButtonClicked( int, QListViewItem*, const QPoint &, int))); + connect (this, SIGNAL (mouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int)), + this, SLOT (slotMouseButtonClicked( int, Q3ListViewItem*, const QPoint &, int))); //US d->bChangeCursorOverItem = KGlobalSettings::changeCursorOverIcon(); //US d->autoSelectDelay = KGlobalSettings::autoSelectDelay(); @@ -611,7 +626,7 @@ void KListView::slotAutoSelect() if( !hasFocus() ) setFocus(); - QListViewItem* previousItem = currentItem(); + Q3ListViewItem* previousItem = currentItem(); setCurrentItem( d->pCurrentItem ); #if 0 @@ -632,7 +647,7 @@ void KListView::slotAutoSelect() viewport()->setUpdatesEnabled( false ); bool down = previousItem->itemPos() < d->pCurrentItem->itemPos(); - QListViewItemIterator lit( down ? previousItem : d->pCurrentItem ); + Q3ListViewItemIterator lit( down ? previousItem : d->pCurrentItem ); for ( ; lit.current(); ++lit ) { if ( down && lit.current() == d->pCurrentItem ) { d->pCurrentItem->setSelected( select ); @@ -651,7 +666,7 @@ void KListView::slotAutoSelect() emit selectionChanged(); - if( selectionMode() == QListView::Single ) + if( selectionMode() == Q3ListView::Single ) emit selectionChanged( d->pCurrentItem ); } else if( (keybstate & ControlMask) ) @@ -684,7 +699,7 @@ void KListView::slotHeaderChanged() } } -void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint &pos, int c) +void KListView::emitExecute( int buttonstate, Q3ListViewItem *item, const QPoint &pos, int c) { // qDebug("KListView::emitExecute buttonstate=%i", buttonstate); if( isExecuteArea( viewport()->mapFromGlobal(pos) ) ) { @@ -701,7 +716,7 @@ void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint d->autoSelect.stop(); //Dont emit executed if in SC mode and Shift or Ctrl are pressed - if( !( (buttonstate==ShiftButton) || (buttonstate==ControlButton) )) { + if( !( (buttonstate==Qt::ShiftButton) || (buttonstate==Qt::ControlButton) )) { // if( !( ((keybstate & ShiftMask) || (keybstate & ControlMask)) ) ) { emit executed( item ); @@ -714,7 +729,7 @@ void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint void KListView::focusInEvent( QFocusEvent *fe ) { // kdDebug()<<"KListView::focusInEvent()"<<endl; - QListView::focusInEvent( fe ); + Q3ListView::focusInEvent( fe ); if ((d->selectedBySimpleMove) && (d->selectionMode == FileManager) && (fe->reason()!=QFocusEvent::Popup) @@ -747,14 +762,14 @@ void KListView::focusOutEvent( QFocusEvent *fe ) emit selectionChanged(); }; - QListView::focusOutEvent( fe ); + Q3ListView::focusOutEvent( fe ); } void KListView::leaveEvent( QEvent *e ) { d->autoSelect.stop(); - QListView::leaveEvent( e ); + Q3ListView::leaveEvent( e ); } bool KListView::event( QEvent *e ) @@ -765,13 +780,13 @@ bool KListView::event( QEvent *e ) d->alternateBackground = QColor(240, 240, 240); } - return QListView::event(e); + return Q3ListView::event(e); } void KListView::contentsMousePressEvent( QMouseEvent *e ) { //qDebug("KListView::contentsMousePressEvent"); - if( (selectionModeExt() == Extended) && (e->state() & ShiftButton) && !(e->state() & ControlButton) ) + if( (selectionModeExt() == Extended) && (e->state() & Qt::ShiftButton) && !(e->state() & Qt::ControlButton) ) { bool block = signalsBlocked(); blockSignals( true ); @@ -793,7 +808,7 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) }; QPoint p( contentsToViewport( e->pos() ) ); - QListViewItem *at = itemAt (p); + Q3ListViewItem *at = itemAt (p); // true if the root decoration of the item "at" was clicked (i.e. the +/- sign) bool rootDecoClicked = at @@ -801,7 +816,7 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) treeStepSize() * ( at->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() ) && ( p.x() >= header()->cellPos( header()->mapToActual( 0 ) ) ); - if (e->button() == LeftButton && !rootDecoClicked) + if (e->button() == Qt::LeftButton && !rootDecoClicked) { //Start a drag d->startDragPos = e->pos(); @@ -813,18 +828,18 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) } } - QListView::contentsMousePressEvent( e ); + Q3ListView::contentsMousePressEvent( e ); } void KListView::contentsMouseMoveEvent( QMouseEvent *e ) { if (!dragEnabled() || d->startDragPos.isNull() || !d->validDrag) { - QListView::contentsMouseMoveEvent (e); + Q3ListView::contentsMouseMoveEvent (e); return; } QPoint vp = contentsToViewport(e->pos()); - QListViewItem *item = itemAt( vp ); + Q3ListViewItem *item = itemAt( vp ); //do we process cursor changes at all? if ( item && d->bChangeCursorOverItem && d->bUseSingle ) @@ -853,7 +868,7 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e ) newPos.y() < d->startDragPos.y()-d->dragDelay)) //(d->startDragPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) { - QListView::contentsMouseReleaseEvent( 0 ); + Q3ListView::contentsMouseReleaseEvent( 0 ); startDrag(); d->startDragPos = QPoint(); d->validDrag = false; @@ -862,13 +877,13 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e ) void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) { - if (e->button() == LeftButton) + if (e->button() == Qt::LeftButton) { // If the row was already selected, maybe we want to start an in-place editing if ( d->pressedOnSelected && itemsRenameable() ) { QPoint p( contentsToViewport( e->pos() ) ); - QListViewItem *at = itemAt (p); + Q3ListViewItem *at = itemAt (p); if ( at ) { // true if the root decoration of the item "at" was clicked (i.e. the +/- sign) @@ -890,7 +905,7 @@ void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) d->validDrag = false; d->startDragPos = QPoint(); } - QListView::contentsMouseReleaseEvent( e ); + Q3ListView::contentsMouseReleaseEvent( e ); } void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) @@ -901,8 +916,8 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) //QListView::contentsMouseDoubleClickEvent( e ); QPoint vp = contentsToViewport(e->pos()); - QListViewItem *item = itemAt( vp ); - emit QListView::doubleClicked( item ); // we do it now + Q3ListViewItem *item = itemAt( vp ); + emit Q3ListView::doubleClicked( item ); // we do it now int col = item ? header()->mapToLogical( header()->cellAt( vp.x() ) ) : -1; @@ -911,7 +926,7 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) emit doubleClicked( item, e->globalPos(), col ); - if( (e->button() == LeftButton) && !d->bUseSingle ) { + if( (e->button() == Qt::LeftButton) && !d->bUseSingle ) { //qDebug("KListView::contentsMouseDoubleClickEvent: emitExecute"); emitExecute( e->button(), item, e->globalPos(), col); @@ -919,11 +934,11 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) } } -void KListView::slotMouseButtonClicked( int btn, QListViewItem *item, const QPoint &pos, int c ) +void KListView::slotMouseButtonClicked( int btn, Q3ListViewItem *item, const QPoint &pos, int c ) { //qDebug("KListView::slotMouseButtonClicked"); - if( (btn == LeftButton) && item ) { + if( (btn == Qt::LeftButton) && item ) { //qDebug("KListView::slotMouseButtonClicked: emitExecute"); emitExecute(btn, item, pos, c); @@ -961,12 +976,12 @@ qDebug("KListView::contentsDropEvent drag&drop not supported yet"); } -void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) +void KListView::movableDropEvent (Q3ListViewItem* parent, Q3ListViewItem* afterme) { - QPtrList<QListViewItem> items, afterFirsts, afterNows; - QListViewItem *current=currentItem(); + Q3PtrList<Q3ListViewItem> items, afterFirsts, afterNows; + Q3ListViewItem *current=currentItem(); bool hasMoved=false; - for (QListViewItem *i = firstChild(), *iNext=0; i != 0; i = iNext) + for (Q3ListViewItem *i = firstChild(), *iNext=0; i != 0; i = iNext) { iNext=i->itemBelow(); if (!i->isSelected()) @@ -979,7 +994,7 @@ void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) i->setSelected(false); - QListViewItem *afterFirst = i->itemAbove(); + Q3ListViewItem *afterFirst = i->itemAbove(); if (!hasMoved) { @@ -1000,7 +1015,7 @@ void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) afterme = i; } clearSelection(); - for (QListViewItem *i=items.first(); i != 0; i=items.next() ) + for (Q3ListViewItem *i=items.first(); i != 0; i=items.next() ) i->setSelected(true); if (current) setCurrentItem(current); @@ -1086,14 +1101,14 @@ int KListView::depthToPixels( int depth ) return treeStepSize() * ( depth + (rootIsDecorated() ? 1 : 0) ) + itemMargin(); } -void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after) +void KListView::findDrop(const QPoint &pos, Q3ListViewItem *&parent, Q3ListViewItem *&after) { QPoint p (contentsToViewport(pos)); // Get the position to put it in - QListViewItem *atpos = itemAt(p); + Q3ListViewItem *atpos = itemAt(p); - QListViewItem *above; + Q3ListViewItem *above; if (!atpos) // put it at the end above = lastItem(); else @@ -1123,8 +1138,8 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte // Ok, there's one more level of complexity. We may want to become a new // sibling, but of an upper-level group, rather than the "above" item - QListViewItem * betterAbove = above->parent(); - QListViewItem * last = above; + Q3ListViewItem * betterAbove = above->parent(); + Q3ListViewItem * last = above; while ( betterAbove ) { // We are allowed to become a sibling of "betterAbove" only if we are @@ -1146,9 +1161,9 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte parent = after ? after->parent() : 0L ; } -QListViewItem* KListView::lastChild () const +Q3ListViewItem* KListView::lastChild () const { - QListViewItem* lastchild = firstChild(); + Q3ListViewItem* lastchild = firstChild(); if (lastchild) for (; lastchild->nextSibling(); lastchild = lastchild->nextSibling()); @@ -1156,11 +1171,11 @@ QListViewItem* KListView::lastChild () const return lastchild; } -QListViewItem *KListView::lastItem() const +Q3ListViewItem *KListView::lastItem() const { - QListViewItem* last = lastChild(); + Q3ListViewItem* last = lastChild(); - for (QListViewItemIterator it (last); it.current(); ++it) + for (Q3ListViewItemIterator it (last); it.current(); ++it) last = it.current(); return last; @@ -1187,12 +1202,12 @@ qDebug("KListView::startDrag drag&drop not supported yet."); */ } -QDragObject *KListView::dragObject() +Q3DragObject *KListView::dragObject() { if (!currentItem()) return 0; - return new QStoredDrag("application/x-qlistviewitem", viewport()); + return new Q3StoredDrag("application/x-qlistviewitem", viewport()); } void KListView::setItemsMovable(bool b) @@ -1246,19 +1261,19 @@ void KListView::setDropVisualizer(bool b) d->dropVisualizer=b; } -QPtrList<QListViewItem> KListView::selectedItems() const +Q3PtrList<Q3ListViewItem> KListView::selectedItems() const { - QPtrList<QListViewItem> list; - for (QListViewItem *i=firstChild(); i!=0; i=i->itemBelow()) + Q3PtrList<Q3ListViewItem> list; + for (Q3ListViewItem *i=firstChild(); i!=0; i=i->itemBelow()) if (i->isSelected()) list.append(i); return list; } -void KListView::moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after) +void KListView::moveItem(Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *after) { // sanity check - don't move a item into it's own child structure - QListViewItem *i = parent; + Q3ListViewItem *i = parent; while(i) { if(i == item) @@ -1296,8 +1311,8 @@ void KListView::setDropVisualizerWidth (int w) d->mDropVisualizerWidth = w > 0 ? w : 1; } -QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, - QListViewItem *after) +QRect KListView::drawDropVisualizer(QPainter *p, Q3ListViewItem *parent, + Q3ListViewItem *after) { QRect insertmarker; @@ -1308,7 +1323,7 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, int level = 0; if (after) { - QListViewItem* it = 0L; + Q3ListViewItem* it = 0L; if (after->isOpen()) { // Look for the last child (recursively) @@ -1338,12 +1353,12 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, // This is not used anymore, at least by KListView itself (see viewportPaintEvent) // Remove for KDE 3.0. if (p) - p->fillRect(insertmarker, Dense4Pattern); + p->fillRect(insertmarker, Qt::Dense4Pattern); return insertmarker; } -QRect KListView::drawItemHighlighter(QPainter *painter, QListViewItem *item) +QRect KListView::drawItemHighlighter(QPainter *painter, Q3ListViewItem *item) { QRect r; @@ -1376,7 +1391,7 @@ void KListView::cleanItemHighlighter () } } -void KListView::rename(QListViewItem *item, int c) +void KListView::rename(Q3ListViewItem *item, int c) { if (d->renameable.contains(c)) { @@ -1403,7 +1418,7 @@ void KListView::setRenameable (int col, bool yesno) d->renameable.remove(col); } -void KListView::doneEditing(QListViewItem *item, int row) +void KListView::doneEditing(Q3ListViewItem *item, int row) { emit itemRenamed(item, item->text(row), row); emit itemRenamed(item); @@ -1447,12 +1462,12 @@ bool KListView::dropHighlighter() const return d->dropHighlighter; } -bool KListView::showTooltip(QListViewItem *item, const QPoint &, int column) const +bool KListView::showTooltip(Q3ListViewItem *item, const QPoint &, int column) const { return ((tooltip(item, column).length()>0) && (column==tooltipColumn())); } -QString KListView::tooltip(QListViewItem *item, int column) const +QString KListView::tooltip(Q3ListViewItem *item, int column) const { return item->text(column); } @@ -1482,7 +1497,7 @@ void KListView::keyPressEvent (QKeyEvent* e) } if (d->selectionMode != FileManager) - QListView::keyPressEvent (e); + Q3ListView::keyPressEvent (e); else fileManagerKeyPressEvent (e); } @@ -1513,45 +1528,45 @@ bool KListView::automaticSelection() const void KListView::fileManagerKeyPressEvent (QKeyEvent* e) { //don't care whether it's on the keypad or not - int e_state=(e->state() & ~Keypad); + int e_state=(e->state() & ~Qt::Keypad); int oldSelectionDirection(d->selectionDirection); - if ((e->key()!=Key_Shift) && (e->key()!=Key_Control) - && (e->key()!=Key_Meta) && (e->key()!=Key_Alt)) + if ((e->key()!=Qt::Key_Shift) && (e->key()!=Qt::Key_Control) + && (e->key()!=Qt::Key_Meta) && (e->key()!=Qt::Key_Alt)) { - if ((e_state==ShiftButton) && (!d->wasShiftEvent) && (!d->selectedBySimpleMove)) + if ((e_state==Qt::ShiftButton) && (!d->wasShiftEvent) && (!d->selectedBySimpleMove)) selectAll(FALSE); d->selectionDirection=0; - d->wasShiftEvent = (e_state == ShiftButton); + d->wasShiftEvent = (e_state == Qt::ShiftButton); }; - //d->wasShiftEvent = (e_state == ShiftButton); + //d->wasShiftEvent = (e_state == Qt::ShiftButton); - QListViewItem* item = currentItem(); + Q3ListViewItem* item = currentItem(); if (item==0) return; - QListViewItem* repaintItem1 = item; - QListViewItem* repaintItem2 = 0L; - QListViewItem* visItem = 0L; + Q3ListViewItem* repaintItem1 = item; + Q3ListViewItem* repaintItem2 = 0L; + Q3ListViewItem* visItem = 0L; - QListViewItem* nextItem = 0L; + Q3ListViewItem* nextItem = 0L; int items = 0; - bool shiftOrCtrl((e_state==ControlButton) || (e_state==ShiftButton)); + bool shiftOrCtrl((e_state==Qt::ControlButton) || (e_state==Qt::ShiftButton)); int selectedItems(0); - for (QListViewItem *tmpItem=firstChild(); tmpItem!=0; tmpItem=tmpItem->nextSibling()) + for (Q3ListViewItem *tmpItem=firstChild(); tmpItem!=0; tmpItem=tmpItem->nextSibling()) if (tmpItem->isSelected()) selectedItems++; if (((selectedItems==0) || ((selectedItems==1) && (d->selectedUsingMouse))) - && (e_state==NoButton) - && ((e->key()==Key_Down) - || (e->key()==Key_Up) - || (e->key()==Key_Next) - || (e->key()==Key_Prior) - || (e->key()==Key_Home) - || (e->key()==Key_End))) + && (e_state==Qt::NoButton) + && ((e->key()==Qt::Key_Down) + || (e->key()==Qt::Key_Up) + || (e->key()==Qt::Key_Next) + || (e->key()==Qt::Key_Prior) + || (e->key()==Qt::Key_Home) + || (e->key()==Qt::Key_End))) { d->selectedBySimpleMove=true; d->selectedUsingMouse=false; @@ -1563,12 +1578,12 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) switch (e->key()) { - case Key_Escape: + case Qt::Key_Escape: selectAll(FALSE); emitSelectionChanged=TRUE; break; - case Key_Space: + case Qt::Key_Space: //toggle selection of current item if (d->selectedBySimpleMove) d->selectedBySimpleMove=false; @@ -1576,7 +1591,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) emitSelectionChanged=TRUE; break; - case Key_Insert: + case Qt::Key_Insert: //toggle selection of current item and move to the next item if (d->selectedBySimpleMove) { @@ -1600,7 +1615,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) emitSelectionChanged=TRUE; break; - case Key_Down: + case Qt::Key_Down: nextItem=item->itemBelow(); //toggle selection of current item and move to the next item if (shiftOrCtrl) @@ -1633,7 +1648,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) }; break; - case Key_Up: + case Qt::Key_Up: nextItem=item->itemAbove(); d->selectionDirection=-1; //move to the prev. item and toggle selection of this one @@ -1668,7 +1683,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) }; break; - case Key_End: + case Qt::Key_End: //move to the last item and toggle selection of all items inbetween nextItem=item; if (d->selectedBySimpleMove) @@ -1693,7 +1708,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) emitSelectionChanged=TRUE; break; - case Key_Home: + case Qt::Key_Home: // move to the first item and toggle selection of all items inbetween nextItem = firstChild(); visItem = nextItem; @@ -1715,7 +1730,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) emitSelectionChanged=TRUE; break; - case Key_Next: + case Qt::Key_Next: items=visibleHeight()/item->height(); nextItem=item; if (d->selectedBySimpleMove) @@ -1751,7 +1766,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) } break; - case Key_Prior: + case Qt::Key_Prior: items=visibleHeight()/item->height(); nextItem=item; if (d->selectedBySimpleMove) @@ -1785,25 +1800,25 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) } break; - case Key_Minus: + case Qt::Key_Minus: if ( item->isOpen() ) setOpen( item, FALSE ); break; - case Key_Plus: + case Qt::Key_Plus: if ( !item->isOpen() && (item->isExpandable() || item->childCount()) ) setOpen( item, TRUE ); break; default: - bool realKey = ((e->key()!=Key_Shift) && (e->key()!=Key_Control) - && (e->key()!=Key_Meta) && (e->key()!=Key_Alt)); + bool realKey = ((e->key()!=Qt::Key_Shift) && (e->key()!=Qt::Key_Control) + && (e->key()!=Qt::Key_Meta) && (e->key()!=Qt::Key_Alt)); bool selectCurrentItem = (d->selectedBySimpleMove) && (item->isSelected()); if (realKey && selectCurrentItem) item->setSelected(false); //this is mainly for the "goto filename beginning with pressed char" feature (aleXXX) - QListView::SelectionMode oldSelectionMode = selectionMode(); - setSelectionMode (QListView::Multi); - QListView::keyPressEvent (e); + Q3ListView::SelectionMode oldSelectionMode = selectionMode(); + setSelectionMode (Q3ListView::Multi); + Q3ListView::keyPressEvent (e); setSelectionMode (oldSelectionMode); if (realKey && selectCurrentItem) { @@ -1850,11 +1865,11 @@ void KListView::setSelectionModeExt (SelectionModeExt mode) case Multi: case Extended: case NoSelection: - setSelectionMode (static_cast<QListView::SelectionMode>(static_cast<int>(mode))); + setSelectionMode (static_cast<Q3ListView::SelectionMode>(static_cast<int>(mode))); break; case FileManager: - setSelectionMode (QListView::Extended); + setSelectionMode (Q3ListView::Extended); break; default: @@ -1868,7 +1883,7 @@ KListView::SelectionModeExt KListView::selectionModeExt () const return d->selectionMode; } -int KListView::itemIndex( const QListViewItem *item ) const +int KListView::itemIndex( const Q3ListViewItem *item ) const { if ( !item ) return -1; @@ -1876,7 +1891,7 @@ int KListView::itemIndex( const QListViewItem *item ) const if ( item == firstChild() ) return 0; else { - QListViewItemIterator it(firstChild()); + Q3ListViewItemIterator it(firstChild()); uint j = 0; for (; it.current() && it.current() != item; ++it, ++j ); @@ -1887,13 +1902,13 @@ int KListView::itemIndex( const QListViewItem *item ) const } } -QListViewItem* KListView::itemAtIndex(int index) +Q3ListViewItem* KListView::itemAtIndex(int index) { if (index<0) return 0; int j(0); - for (QListViewItemIterator it=firstChild(); it.current(); it++) + for (Q3ListViewItemIterator it=firstChild(); it.current(); it++) { if (j==index) return it.current(); @@ -1903,7 +1918,7 @@ QListViewItem* KListView::itemAtIndex(int index) } -void KListView::emitContextMenu (KListView*, QListViewItem* i) +void KListView::emitContextMenu (KListView*, Q3ListViewItem* i) { QPoint p; // qDebug("KListView::emitContextMenu "); @@ -1916,9 +1931,9 @@ void KListView::emitContextMenu (KListView*, QListViewItem* i) emit contextMenu (this, i, p); } -void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) +void KListView::emitContextMenu (Q3ListViewItem* i, const QPoint& p, int col) { - QListViewItem* item = i; + Q3ListViewItem* item = i; int c = col; // do not trust the values for QListViewItem* i and int col; // qDebug("KListView::emitContextMenu col"); @@ -1933,7 +1948,7 @@ void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) void KListView::setAcceptDrops (bool val) { - QListView::setAcceptDrops (val); + Q3ListView::setAcceptDrops (val); viewport()->setAcceptDrops (val); } @@ -1945,14 +1960,14 @@ int KListView::dropVisualizerWidth () const void KListView::viewportPaintEvent(QPaintEvent *e) { - QListView::viewportPaintEvent(e); + Q3ListView::viewportPaintEvent(e); if (d->mOldDropVisualizer.isValid() && e->rect().intersects(d->mOldDropVisualizer)) { QPainter painter(viewport()); // This is where we actually draw the drop-visualizer - painter.fillRect(d->mOldDropVisualizer, Dense4Pattern); + painter.fillRect(d->mOldDropVisualizer, Qt::Dense4Pattern); } if (d->mOldDropHighlighter.isValid() && e->rect().intersects(d->mOldDropHighlighter)) { @@ -1988,7 +2003,7 @@ bool KListView::fullWidth() const int KListView::addColumn(const QString& label, int width) { - int result = QListView::addColumn(label, width); + int result = Q3ListView::addColumn(label, width); if (d->fullWidth) { //US header()->setStretchEnabled(false, columns()-2); //US header()->setStretchEnabled(true, columns()-1); @@ -1996,9 +2011,9 @@ int KListView::addColumn(const QString& label, int width) return result; } -int KListView::addColumn(const QIconSet& iconset, const QString& label, int width) +int KListView::addColumn(const QIcon& iconset, const QString& label, int width) { - int result = QListView::addColumn(iconset, label, width); + int result = Q3ListView::addColumn(iconset, label, width); if (d->fullWidth) { //US header()->setStretchEnabled(false, columns()-2); //US header()->setStretchEnabled(true, columns()-1); @@ -2008,13 +2023,13 @@ int KListView::addColumn(const QIconSet& iconset, const QString& label, int widt void KListView::removeColumn(int index) { - QListView::removeColumn(index); + Q3ListView::removeColumn(index); //US if (d->fullWidth && index == columns()) header()->setStretchEnabled(true, columns()-1); } void KListView::viewportResizeEvent(QResizeEvent* e) { - QListView::viewportResizeEvent(e); + Q3ListView::viewportResizeEvent(e); } const QColor &KListView::alternateBackground() const @@ -2070,7 +2085,7 @@ void KListView::setSorting(int column, bool ascending) { d->sortColumn = column; d->sortAscending = ascending; - QListView::setSorting(column, ascending); + Q3ListView::setSorting(column, ascending); } int KListView::columnSorted(void) const @@ -2083,58 +2098,58 @@ bool KListView::ascendingSort(void) const return d->sortAscending; } -KListViewItem::KListViewItem(QListView *parent) - : QListViewItem(parent) +KListViewItem::KListViewItem(Q3ListView *parent) + : Q3ListViewItem(parent) { init(); } -KListViewItem::KListViewItem(QListViewItem *parent) - : QListViewItem(parent) +KListViewItem::KListViewItem(Q3ListViewItem *parent) + : Q3ListViewItem(parent) { init(); } -KListViewItem::KListViewItem(QListView *parent, QListViewItem *after) - : QListViewItem(parent, after) +KListViewItem::KListViewItem(Q3ListView *parent, Q3ListViewItem *after) + : Q3ListViewItem(parent, after) { init(); } -KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after) - : QListViewItem(parent, after) +KListViewItem::KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after) + : Q3ListViewItem(parent, after) { init(); } -KListViewItem::KListViewItem(QListView *parent, +KListViewItem::KListViewItem(Q3ListView *parent, QString label1, QString label2, QString label3, QString label4, QString label5, QString label6, QString label7, QString label8) - : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) + : Q3ListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) { init(); } -KListViewItem::KListViewItem(QListViewItem *parent, +KListViewItem::KListViewItem(Q3ListViewItem *parent, QString label1, QString label2, QString label3, QString label4, QString label5, QString label6, QString label7, QString label8) - : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) + : Q3ListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) { init(); } -KListViewItem::KListViewItem(QListView *parent, QListViewItem *after, +KListViewItem::KListViewItem(Q3ListView *parent, Q3ListViewItem *after, QString label1, QString label2, QString label3, QString label4, QString label5, QString label6, QString label7, QString label8) - : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) + : Q3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) { init(); } -KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after, +KListViewItem::KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after, QString label1, QString label2, QString label3, QString label4, QString label5, QString label6, QString label7, QString label8) - : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) + : Q3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) { init(); } @@ -2212,12 +2227,12 @@ void KListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, in } else if (isAlternate()) { //US if (listView()->viewport()->backgroundMode()==Qt::FixedColor) - if (listView()->viewport()->backgroundMode()==QWidget::PaletteBackground) + if (listView()->viewport()->backgroundMode()==Qt::PaletteBackground) _cg.setColor(QColorGroup::Background, static_cast< KListView* >(listView())->alternateBackground()); else _cg.setColor(QColorGroup::Base, static_cast< KListView* >(listView())->alternateBackground()); } - QListViewItem::paintCell(p, _cg, column, width, alignment); + Q3ListViewItem::paintCell(p, _cg, column, width, alignment); } //US we do not have a "global KDE" variable to setup singleClick functionality 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 @@ -20,9 +20,20 @@ #ifndef KLISTVIEW_H #define KLISTVIEW_H -#include <qlistview.h> - -#include <qptrlist.h> +#include <q3listview.h> + +#include <q3ptrlist.h> +//Added by qt3to4: +#include <QDragMoveEvent> +#include <QDropEvent> +#include <QDragLeaveEvent> +#include <QPaintEvent> +#include <QResizeEvent> +#include <QFocusEvent> +#include <QMouseEvent> +#include <QKeyEvent> +#include <QEvent> +#include <QDragEnterEvent> //US class QDropEvent; @@ -30,7 +41,7 @@ class QDragLeaveEvent; class QDragMoveEvent; class QDragEnterEvent; -class QDragObject; +class Q3DragObject; class KConfig; class KLineEdit; /** @@ -57,7 +68,7 @@ class KLineEdit; * * @version $Id$ */ -class KListView : public QListView +class KListView : public Q3ListView { Q_OBJECT Q_ENUMS( SelectionModeExt ) @@ -106,15 +117,15 @@ public: * This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected */ enum SelectionModeExt { - Single = QListView::Single, - Multi = QListView::Multi, - Extended = QListView::Extended, - NoSelection = QListView::NoSelection, + Single = Q3ListView::Single, + Multi = Q3ListView::Multi, + Extended = Q3ListView::Extended, + NoSelection = Q3ListView::NoSelection, FileManager }; void repaintContents( bool erase = true ) { - QScrollView::repaintContents( contentsX(), contentsY(), + Q3ScrollView::repaintContents( contentsX(), contentsY(), visibleWidth(), visibleHeight(), erase ); }; /** @@ -161,26 +172,26 @@ public: /** * @return a list containing the currently selected items. */ - QPtrList<QListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?) + Q3PtrList<Q3ListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?) /** * Arbitrarily move @p item to @p parent, positioned immediately after item @p after. */ - void moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after); + void moveItem(Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *after); /** * @return the last item (not child!) of this listview. * * @see lastChild() */ - QListViewItem *lastItem() const; + Q3ListViewItem *lastItem() const; /** * @return the last child of this listview. * * @see lastItem() */ - QListViewItem* lastChild () const; + Q3ListViewItem* lastChild () const; /** * @return the lineedit used for inline renaming. @@ -276,14 +287,14 @@ public: * @p item doesn't exist in this list view. This function takes * all items into account not only the visible ones. */ - int itemIndex( const QListViewItem *item ) const; + int itemIndex( const Q3ListViewItem *item ) const; /** * Returns the item of @p index within the item tree or 0 if * @p index doesn't exist in this list view. This function takes * all items into account not only the visible ones. */ - QListViewItem* itemAtIndex(int index); + Q3ListViewItem* itemAtIndex(int index); /** * @deprecated @@ -314,7 +325,7 @@ public: /** * Reimplemented for full width support */ - virtual int addColumn(const QIconSet& iconset, const QString& label, int width = -1); + virtual int addColumn(const QIcon& iconset, const QString& label, int width = -1); /** * Reimplemented for full width support * @@ -388,7 +399,7 @@ signals: * Note that you may not delete any @ref QListViewItem objects in slots * connected to this signal. */ - void executed( QListViewItem *item ); + void executed( Q3ListViewItem *item ); /** * This signal is emitted whenever the user executes an listview item. @@ -401,7 +412,7 @@ signals: * Note that you may not delete any @ref QListViewItem objects in slots * connected to this signal. */ - void executed( QListViewItem *item, const QPoint &pos, int c ); + void executed( Q3ListViewItem *item, const QPoint &pos, int c ); /** * This signal gets emitted whenever the user double clicks into the @@ -417,8 +428,8 @@ signals: * You should normally not need to use this. In most cases its better * to use @ref #executed() instead. */ - void doubleClicked( QListViewItem *item, const QPoint &pos, int c ); - void contextRequest( QListViewItem *item, const QPoint &pos, int c ); + void doubleClicked( Q3ListViewItem *item, const QPoint &pos, int c ); + void contextRequest( Q3ListViewItem *item, const QPoint &pos, int c ); /** * This signal gets emitted whenever something acceptable is @@ -430,7 +441,7 @@ signals: * * @see #acceptDrop() */ - void dropped (QDropEvent * e, QListViewItem *after); + void dropped (QDropEvent * e, Q3ListViewItem *after); /** * This signal gets emitted whenever something acceptable is @@ -444,7 +455,7 @@ signals: * @param after is the item after which the drop occured (or 0L, if * the drop was above all items */ - void dropped (KListView* list, QDropEvent* e, QListViewItem* after); + void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* after); /** * This signal gets emitted whenever something acceptable is @@ -458,7 +469,7 @@ signals: * @param after is the item after which the drop occured (or 0L, if * the drop was above all items */ - void dropped (KListView* list, QDropEvent* e, QListViewItem* parent, QListViewItem* after); + void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after); /** * This signal gets emitted whenever something acceptable is @@ -471,7 +482,7 @@ signals: * @param after is the item after which the drop occured (or 0L, if * the drop was above all items */ - void dropped (QDropEvent* e, QListViewItem* parent, QListViewItem* after); + void dropped (QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after); /** * This signal is emitted when ever the user moves an item in the list via @@ -502,7 +513,7 @@ signals: * @param afterFirst the item that parameter item was in before the move, in the list * @param afterNow the item it's currently after. */ - void moved (QListViewItem *item, QListViewItem *afterFirst, QListViewItem *afterNow); + void moved (Q3ListViewItem *item, Q3ListViewItem *afterFirst, Q3ListViewItem *afterNow); /** @@ -510,7 +521,7 @@ signals: * each and every item moved, in order. The first element in @p items associates * with the first of afterFirst and afterNow. */ - void moved(QPtrList<QListViewItem> &items, QPtrList<QListViewItem> &afterFirst, QPtrList<QListViewItem> &afterNow); + void moved(Q3PtrList<Q3ListViewItem> &items, Q3PtrList<Q3ListViewItem> &afterFirst, Q3PtrList<Q3ListViewItem> &afterNow); /** * This signal gets emitted when an item is renamed via in-place renaming. @@ -519,12 +530,12 @@ signals: * @param str is the new value of column @p col. * @param col is the renamed column. */ - void itemRenamed(QListViewItem* item, const QString &str, int col); + void itemRenamed(Q3ListViewItem* item, const QString &str, int col); /** * Same as above, but without the extra information. */ - void itemRenamed(QListViewItem* item); + void itemRenamed(Q3ListViewItem* item); void signalDelete(); /** @@ -537,7 +548,7 @@ signals: * @param list is this listview. * @param item is the @ref currentItem() at the time the key was pressed. May be 0L. */ - void menuShortCutPressed (KListView* list, QListViewItem* item); + void menuShortCutPressed (KListView* list, Q3ListViewItem* item); /** * This signal is emitted whenever a context-menu should be shown for item @p i. @@ -547,13 +558,13 @@ signals: * @param i is the item for which the menu should be shown. May be 0L. * @param p is the point at which the menu should be shown. */ - void contextMenu (KListView* l, QListViewItem* i, const QPoint& p); + void contextMenu (KListView* l, Q3ListViewItem* i, const QPoint& p); public slots: /** * Rename column @p c of @p item. */ - virtual void rename(QListViewItem *item, int c); + virtual void rename(Q3ListViewItem *item, int c); /** * By default, if you called setItemsRenameable(true), @@ -673,7 +684,7 @@ protected: * @param p is translated from contents coordinates to viewport coordinates * before being passed to the above function. */ - inline bool below (QListViewItem* i, const QPoint& p) + inline bool below (Q3ListViewItem* i, const QPoint& p) { return below (itemRect(i), contentsToViewport(p)); } @@ -689,7 +700,7 @@ protected: * @internal */ //US I added buttonstate to pass the current keyboard status - void emitExecute( int buttonstate, QListViewItem *item, const QPoint &pos, int c); + void emitExecute( int buttonstate, Q3ListViewItem *item, const QPoint &pos, int c); /** * Reimplemented for internal reasons. @@ -721,12 +732,12 @@ protected: /** * @return the tooltip for @p column of @p item. */ - virtual QString tooltip(QListViewItem* item, int column) const; + virtual QString tooltip(Q3ListViewItem* item, int column) const; /** * @return whether the tooltip for @p column of @p item shall be shown at point @p pos. */ - virtual bool showTooltip(QListViewItem *item, const QPoint &pos, int column) const; + virtual bool showTooltip(Q3ListViewItem *item, const QPoint &pos, int column) const; /** * Reimplemented for internal reasons. @@ -805,7 +816,7 @@ protected: * * @see setDragEnabled() */ - virtual QDragObject *dragObject(); + virtual Q3DragObject *dragObject(); /** * @return true if the @p event provides some acceptable @@ -821,7 +832,7 @@ protected: * * @return the rectangle that you painted to. */ - virtual QRect drawDropVisualizer (QPainter *p, QListViewItem *parent, QListViewItem *after); + virtual QRect drawDropVisualizer (QPainter *p, Q3ListViewItem *parent, Q3ListViewItem *after); /** * Paint the drag rectangle. If painter is null, don't try to :) @@ -829,7 +840,7 @@ protected: * * @return the rectangle that you painted to. */ - virtual QRect drawItemHighlighter(QPainter *painter, QListViewItem *item); + virtual QRect drawItemHighlighter(QPainter *painter, Q3ListViewItem *item); /** * This method calls @ref dragObject() and starts the drag. @@ -886,8 +897,8 @@ protected slots: */ void slotSettingsChanged(int); - void slotMouseButtonClicked( int btn, QListViewItem *item, const QPoint &pos, int c ); - void doneEditing(QListViewItem *item, int row); + void slotMouseButtonClicked( int btn, Q3ListViewItem *item, const QPoint &pos, int c ); + void doneEditing(Q3ListViewItem *item, int row); /** * Repaint the rect where I was drawing the drop line. @@ -902,18 +913,18 @@ protected slots: /** * Emit the @ref contextMenu signal. This slot is for mouse actions. */ - void emitContextMenu (QListViewItem*, const QPoint&, int); + void emitContextMenu (Q3ListViewItem*, const QPoint&, int); /** * Emit the @ref #contextMenu signal. This slot is for key presses. */ - void emitContextMenu (KListView*, QListViewItem*); + void emitContextMenu (KListView*, Q3ListViewItem*); /** * Accessory slot for AutoSelect * @internal */ - void slotOnItem( QListViewItem *item ); + void slotOnItem( Q3ListViewItem *item ); /** * Accessory slot for AutoSelect/ChangeCursorOverItem @@ -939,7 +950,7 @@ protected: /** * Handle dropEvent when itemsMovable() is set to true. */ - virtual void movableDropEvent (QListViewItem* parent, QListViewItem* afterme); + virtual void movableDropEvent (Q3ListViewItem* parent, Q3ListViewItem* afterme); /** * Where is the nearest QListViewItem that I'm going to drop? @@ -947,7 +958,7 @@ protected: * FIXME KDE 4.0: Make this method const so it can be called from an * acceptDrag method without ugly casts */ - virtual void findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after); + virtual void findDrop(const QPoint &pos, Q3ListViewItem *&parent, Q3ListViewItem *&after); /** * A special keyPressEvent (for FileManager selection mode). @@ -974,7 +985,7 @@ private: * * @short listview item with alternate background colour support */ -class KListViewItem : public QListViewItem +class KListViewItem : public Q3ListViewItem { public: /** @@ -983,30 +994,30 @@ public: * don't mix KListViewItem (or subclasses) with QListViewItem * (or subclasses). */ - KListViewItem(QListView *parent); - KListViewItem(QListViewItem *parent); - KListViewItem(QListView *parent, QListViewItem *after); - KListViewItem(QListViewItem *parent, QListViewItem *after); + KListViewItem(Q3ListView *parent); + KListViewItem(Q3ListViewItem *parent); + KListViewItem(Q3ListView *parent, Q3ListViewItem *after); + KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after); - KListViewItem(QListView *parent, + KListViewItem(Q3ListView *parent, QString, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null); - KListViewItem(QListViewItem *parent, + KListViewItem(Q3ListViewItem *parent, QString, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null); - KListViewItem(QListView *parent, QListViewItem *after, + KListViewItem(Q3ListView *parent, Q3ListViewItem *after, QString, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null); - KListViewItem(QListViewItem *parent, QListViewItem *after, + KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after, QString, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null, QString = QString::null, 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 @@ -21,12 +21,18 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <qobjectlist.h> +#include <qobject.h> #include <qstringlist.h> #include <qtimer.h> #include <qmenubar.h> #include <qstatusbar.h> #include <qapplication.h> +//Added by qt3to4: +#include <QCloseEvent> +#include <QPaintEvent> +#include <QResizeEvent> +#include <QChildEvent> +#include <Q3PtrList> #include "kdebug.h" @@ -54,7 +60,7 @@ public: static bool no_query_exit = false; KMainWindow::KMainWindow( QWidget* parent, const char *name ) - : QMainWindow( parent, name ) /*LR, f ) with the default widget flag we cannot have fastload */ /*US, KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )*/ + : Q3MainWindow( parent, name ) /*LR, f ) with the default widget flag we cannot have fastload */ /*US, KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )*/ { mQToolBar = 0; initKMainWindow(name); @@ -276,7 +282,7 @@ void KMainWindow::setCaption( const QString &caption, bool modified ) void KMainWindow::setPlainCaption( const QString &caption ) { - QMainWindow::setCaption( caption ); + Q3MainWindow::setCaption( caption ); #ifndef Q_WS_QWS //US the following is disabled for the embedded version //US NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 ); @@ -421,10 +427,10 @@ void KMainWindow::createStandardStatusBarAction(){ } } -QToolBar *KMainWindow::tBar( ) +Q3ToolBar *KMainWindow::tBar( ) { if ( ! mQToolBar ) - mQToolBar = new QToolBar( this ); + mQToolBar = new Q3ToolBar( this ); return mQToolBar; } @@ -443,22 +449,23 @@ KToolBar *KMainWindow::toolBar( const char * name ) return new KToolBar(this, name, honor_mode); // XMLGUI constructor else */ - return new KToolBar(this, Top, false, name, honor_mode ); // non-XMLGUI + return new KToolBar(this, Qt::Top, false, name, honor_mode ); // non-XMLGUI } -QPtrListIterator<KToolBar> KMainWindow::toolBarIterator() +Q3PtrListIterator<KToolBar> KMainWindow::toolBarIterator() { toolbarList.clear(); - QPtrList<QToolBar> lst; - for ( int i = (int)QMainWindow::Unmanaged; i <= (int)Minimized; ++i ) { - lst = toolBars( (ToolBarDock)i ); - for ( QToolBar *tb = lst.first(); tb; tb = lst.next() ) { + QList<Q3ToolBar*> lst; + for ( int i = (int)Qt::Unmanaged; i <= (int)Qt::Minimized; ++i ) { + lst = toolBars( (Qt::ToolBarDock)i ); + for(QList<Q3ToolBar*>::iterator i=lst.begin();i!=lst.end();++i) { + Q3ToolBar *tb = *i; if ( !tb->inherits( "KToolBar" ) ) continue; toolbarList.append( (KToolBar*)tb ); } } - return QPtrListIterator<KToolBar>( toolbarList ); + return Q3PtrListIterator<KToolBar>( toolbarList ); } void KMainWindow::setAutoSaveSettings( const QString & groupName, bool saveWindowSize ) @@ -469,7 +476,7 @@ void KMainWindow::setAutoSaveSettings( const QString & groupName, bool saveWindo // Get notified when the user moves a toolbar around //US connect( this, SIGNAL( dockWindowPositionChanged( QDockWindow * ) ), //US this, SLOT( setSettingsDirty() ) ); - connect( this, SIGNAL( toolBarPositionChanged(QToolBar *) ), + connect( this, SIGNAL( toolBarPositionChanged(Q3ToolBar *) ), this, SLOT( setSettingsDirty() ) ); @@ -503,7 +510,7 @@ QString KMainWindow::autoSaveGroup() const void KMainWindow::saveAutoSaveSettings() { - ASSERT( d->autoSaveSettings ); + Q_ASSERT( d->autoSaveSettings ); //kdDebug(200) << "KMainWindow::saveAutoSaveSettings -> saving settings" << endl; saveMainWindowSettings( KGlobal::config(), d->autoSaveGroup ); KGlobal::config()->sync(); @@ -639,7 +646,7 @@ void KMainWindow::saveMainWindowSettings(KConfig *config, const QString &configG int n = 1; // Toolbar counter. toolbars are counted from 1, KToolBar *toolbar = 0; - QPtrListIterator<KToolBar> it( toolBarIterator() ); + Q3PtrListIterator<KToolBar> it( toolBarIterator() ); while ( ( toolbar = it.current() ) ) { ++it; QString group; @@ -714,6 +721,7 @@ void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &config entryList.clear(); //US i = config->readListEntry (QString::fromLatin1("MenuBar"), entryList, ';'); entryList = config->readListEntry (QString::fromLatin1("MenuBar")); + if(!entryList.empty()) { entry = entryList.first(); if (entry==QString::fromLatin1("Disabled")) { @@ -723,10 +731,11 @@ void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &config mb->show(); } } + } int n = 1; // Toolbar counter. toolbars are counted from 1, KToolBar *toolbar; - QPtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator + Q3PtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator for ( ; it.current(); ++it) { toolbar= it.current(); @@ -756,7 +765,7 @@ void KMainWindow::finalizeGUI( bool force ) // we call positionYourself again for each of them, but this time // the toolbariterator should give them in the proper order. // Both the XMLGUI and applySettings call this, hence "force" for the latter. - QPtrListIterator<KToolBar> it( toolBarIterator() ); + Q3PtrListIterator<KToolBar> it( toolBarIterator() ); for ( ; it.current() ; ++ it ) it.current()->positionYourself( force ); @@ -851,7 +860,7 @@ void KMainWindow::resizeEvent( QResizeEvent * e) { if ( d->autoSaveWindowSize ) setSettingsDirty(); - QMainWindow::resizeEvent( e ); + Q3MainWindow::resizeEvent( e ); } bool KMainWindow::hasMenuBar() @@ -869,7 +878,7 @@ QMenuBar *KMainWindow::menuBar() mb = new QMenuBar( this ); // trigger a re-layout and trigger a call to the private // setMenuBar method. - QMainWindow::menuBar(); + Q3MainWindow::menuBar(); } return mb; } @@ -884,7 +893,7 @@ QStatusBar *KMainWindow::statusBar() sb = new QStatusBar( this ); // trigger a re-layout and trigger a call to the private // setStatusBar method. - QMainWindow::statusBar(); + Q3MainWindow::statusBar(); } return sb; } @@ -908,42 +917,30 @@ void KMainWindow::shuttingDown() QMenuBar *KMainWindow::internalMenuBar() { //US QObjectList *l = queryList( "KMenuBar", 0, false, false ); - QObjectList *l = queryList( "QMenuBar", 0, false, false ); - if ( !l || !l->first() ) { - delete l; + QObjectList l = queryList( "QMenuBar", 0, false, false ); + if(l.empty()) return 0; - } - -//US KMenuBar *m = (KMenuBar*)l->first(); - QMenuBar *m = (QMenuBar*)l->first(); - delete l; - return m; + return (QMenuBar*)l.front(); } //US KStatusBar *KMainWindow::internalStatusBar() QStatusBar *KMainWindow::internalStatusBar() { //US QObjectList *l = queryList( "KStatusBar", 0, false, false ); - QObjectList *l = queryList( "QStatusBar", 0, false, false ); - if ( !l || !l->first() ) { - delete l; + QObjectList l = queryList( "QStatusBar", 0, false, false ); + if(l.empty()) return 0; - } - -//US KStatusBar *s = (KStatusBar*)l->first(); - QStatusBar *s = (QStatusBar*)l->first(); - delete l; - return s; + return (QStatusBar*)l.front(); } void KMainWindow::childEvent( QChildEvent* e) { - QMainWindow::childEvent( e ); + Q3MainWindow::childEvent( e ); } void KMainWindow::paintEvent( QPaintEvent * e) { - QMainWindow::paintEvent( e ); + Q3MainWindow::paintEvent( e ); } QSize KMainWindow::sizeForCentralWidgetSize(QSize size) 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,3 +1,8 @@ +//Added by qt3to4: +#include <QResizeEvent> +#include <QChildEvent> +#include <QCloseEvent> +#include <QPaintEvent> /* This file is part of the KDE libraries @@ -50,12 +55,12 @@ class KAction; #include <ktoolbar.h> #include <ktoolbarhandler.h> #include <kxmlguiclient.h> -#include <qmainwindow.h> -#include <qptrlist.h> +#include <q3mainwindow.h> +#include <q3ptrlist.h> class KActionCollection; -class KMainWindow : public QMainWindow, virtual public KXMLGUIClient +class KMainWindow : public Q3MainWindow, virtual public KXMLGUIClient { Q_OBJECT @@ -320,12 +325,12 @@ public: **/ KToolBar *toolBar( const char *name=0 ); // method for getting rid of KDE-Crap - QToolBar *tBar( ); + Q3ToolBar *tBar( ); /** * @return An iterator over the list of all toolbars for this window. */ - QPtrListIterator<KToolBar> toolBarIterator(); + Q3PtrListIterator<KToolBar> toolBarIterator(); /** * @return A KAccel instance bound to this mainwindow. Used automatically @@ -758,7 +763,7 @@ private slots: void saveAutoSaveSettings(); private: - QToolBar * mQToolBar; + Q3ToolBar * mQToolBar; //US KMenuBar *internalMenuBar(); QMenuBar *internalMenuBar(); //US KStatusBar *internalStatusBar(); @@ -767,7 +772,7 @@ private: KMainWindowPrivate *d; void initKMainWindow(const char *name); - QPtrList<KToolBar> toolbarList; + Q3PtrList<KToolBar> toolbarList; protected: virtual void virtual_hook( int id, void* data ); 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 @@ -42,6 +42,9 @@ #include <qslider.h> #include <qspinbox.h> #include <qstyle.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QEvent> #include <kglobal.h> #include <klocale.h> @@ -106,11 +109,11 @@ void KNumInput::setLabel(const QString & label, int a) else { if (m_label) m_label->setText(label); else m_label = new QLabel(label, this, "KNumInput::QLabel"); - m_label->setAlignment((a & (~(AlignTop|AlignBottom|AlignVCenter))) - | AlignVCenter); + m_label->setAlignment((a & (~(Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter))) + | Qt::AlignVCenter); // if no vertical alignment set, use Top alignment - if(!(a & (AlignTop|AlignBottom|AlignVCenter))) - a |= AlignTop; + if(!(a & (Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter))) + a |= Qt::AlignTop; m_alignment = a; } @@ -131,7 +134,7 @@ void KNumInput::layout(bool deep) // label sizeHint m_sizeLabel = (m_label ? m_label->sizeHint() : QSize(0,0)); - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_colw1 = m_sizeLabel.width() + 4; else m_colw1 = 0; @@ -202,7 +205,7 @@ void KNumInput::setSteps(int minor, int major) KIntSpinBox::KIntSpinBox(QWidget *parent, const char *name) : QSpinBox(0, 99, 1, parent, name) { - editor()->setAlignment(AlignRight); + setAlignment(Qt::AlignRight); val_base = 10; setValue(0); } @@ -215,7 +218,7 @@ KIntSpinBox::KIntSpinBox(int lower, int upper, int step, int value, int base, QWidget* parent, const char* name) : QSpinBox(lower, upper, step, parent, name) { - editor()->setAlignment(AlignRight); + setAlignment(Qt::AlignRight); val_base = base; setValue(value); } @@ -243,9 +246,9 @@ int KIntSpinBox::mapTextToValue(bool* ok) void KIntSpinBox::setEditFocus(bool mark) { - editor()->setFocus(); + setFocus(); if(mark) - editor()->selectAll(); + selectAll(); } @@ -325,14 +328,14 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider) m_spin->setMaxValue(upper); m_spin->setLineStep(step); - step = m_spin->lineStep(); // maybe QRangeControl didn't like out lineStep? + step = m_spin->singleStep(); // maybe QRangeControl didn't like out lineStep? if(slider) { if (m_slider) m_slider->setRange(lower, upper); else { m_slider = new QSlider(lower, upper, step, m_spin->value(), - QSlider::Horizontal, this); + Qt::Horizontal, this); m_slider->setTickmarks(QSlider::Below); connect(m_slider, SIGNAL(valueChanged(int)), m_spin, SLOT(setValue(int))); @@ -358,7 +361,7 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider) void KIntNumInput::setMinValue(int min) { - setRange(min, m_spin->maxValue(), m_spin->lineStep(), m_slider); + setRange(min, m_spin->maxValue(), m_spin->singleStep(), m_slider); } int KIntNumInput::minValue() const @@ -368,7 +371,7 @@ int KIntNumInput::minValue() const void KIntNumInput::setMaxValue(int max) { - setRange(m_spin->minValue(), max, m_spin->lineStep(), m_slider); + setRange(m_spin->minValue(), max, m_spin->singleStep(), m_slider); } int KIntNumInput::maxValue() const @@ -415,7 +418,7 @@ QSize KIntNumInput::minimumSizeHint() const h = 2 + QMAX(m_sizeSpin.height(), m_sizeSlider.height()); // if in extra row, then count it here - if(m_label && (m_alignment & (AlignBottom|AlignTop))) + if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop))) h += 4 + m_sizeLabel.height(); else // label is in the same row as the other widgets @@ -424,7 +427,7 @@ QSize KIntNumInput::minimumSizeHint() const w = m_slider ? m_slider->sizeHint().width() + 8 : 0; w += m_colw1 + m_colw2; - if(m_alignment & (AlignTop|AlignBottom)) + if(m_alignment & (Qt::AlignTop|Qt::AlignBottom)) w = QMAX(w, m_sizeLabel.width() + 4); return QSize(w, h); @@ -444,12 +447,12 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) int w = m_colw1; int h = 0; - if(m_label && (m_alignment & AlignTop)) { + if(m_label && (m_alignment & Qt::AlignTop)) { m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); h += m_sizeLabel.height() + 4; } - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_label->setGeometry(0, 0, w, m_sizeSpin.height()); m_spin->setGeometry(w, h, m_slider ? m_colw2 : QMAX(m_colw2, e->size().width() - w), m_sizeSpin.height()); @@ -460,7 +463,7 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) h += m_sizeSpin.height() + 2; - if(m_label && (m_alignment & AlignBottom)) + if(m_label && (m_alignment & Qt::AlignBottom)) m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); } @@ -646,7 +649,7 @@ QSize KDoubleNumInput::minimumSizeHint() const h = 2 + QMAX(m_sizeEdit.height(), m_sizeSlider.height()); // if in extra row, then count it here - if(m_label && (m_alignment & (AlignBottom|AlignTop))) + if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop))) h += 4 + m_sizeLabel.height(); else // label is in the same row as the other widgets @@ -655,7 +658,7 @@ QSize KDoubleNumInput::minimumSizeHint() const w = m_slider ? m_slider->sizeHint().width() + 8 : 0; w += m_colw1 + m_colw2; - if(m_alignment & (AlignTop|AlignBottom)) + if(m_alignment & (Qt::AlignTop|Qt::AlignBottom)) w = QMAX(w, m_sizeLabel.width() + 4); return QSize(w, h); @@ -666,12 +669,12 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) int w = m_colw1; int h = 0; - if(m_label && (m_alignment & AlignTop)) { + if(m_label && (m_alignment & Qt::AlignTop)) { m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); h += m_sizeLabel.height() + 4; } - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_label->setGeometry(0, 0, w, m_sizeEdit.height()); d->spin->setGeometry(w, h, m_slider ? m_colw2 @@ -683,7 +686,7 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) h += m_sizeEdit.height() + 2; - if(m_label && (m_alignment & AlignBottom)) + if(m_label && (m_alignment & Qt::AlignBottom)) m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); } @@ -730,14 +733,14 @@ void KDoubleNumInput::setRange(double lower, double upper, double step, int slmax = spin->maxValue(); int slmin = spin->minValue(); int slvalue = spin->value(); - int slstep = spin->lineStep(); + int slstep = spin->singleStep(); if (m_slider) { m_slider->setRange(slmin, slmax); m_slider->setLineStep(slstep); m_slider->setValue(slvalue); } else { m_slider = new QSlider(slmin, slmax, slstep, slvalue, - QSlider::Horizontal, this); + Qt::Horizontal, this); m_slider->setTickmarks(QSlider::Below); // feedback line: when one moves, the other moves, too: connect(m_slider, SIGNAL(valueChanged(int)), @@ -912,7 +915,7 @@ public: KDoubleSpinBox::KDoubleSpinBox( QWidget * parent, const char * name ) : QSpinBox( parent, name ) { - editor()->setAlignment( Qt::AlignRight ); + setAlignment( Qt::AlignRight ); d = new Private(); updateValidator(); } @@ -922,7 +925,7 @@ KDoubleSpinBox::KDoubleSpinBox( double lower, double upper, double step, QWidget * parent, const char * name ) : QSpinBox( parent, name ) { - editor()->setAlignment( Qt::AlignRight ); + setAlignment( Qt::AlignRight ); d = new Private(); setRange( lower, upper, step, precision ); setValue( value ); @@ -1027,7 +1030,7 @@ void KDoubleSpinBox::setMaxValue( double value ) { } double KDoubleSpinBox::lineStep() const { - return d->mapToDouble( base::lineStep() ); + return d->mapToDouble( base::singleStep() ); } void KDoubleSpinBox::setLineStep( double step ) { @@ -1072,7 +1075,7 @@ void KDoubleSpinBox::updateValidator() { if ( !d->mValidator ) { d->mValidator = new KDoubleValidator( minValue(), maxValue(), precision(), this, "d->mValidator" ); - base::setValidator( d->mValidator ); + lineEdit()->setValidator( d->mValidator ); } else d->mValidator->setRange( minValue(), maxValue(), precision() ); } 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 @@ -29,6 +29,11 @@ #include <qwidget.h> #include <qspinbox.h> +#include <QLineEdit> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> +#include <QEvent> class QLabel; class QSlider; @@ -81,7 +86,7 @@ public: * @li @p AlignBottom The label is placed below the edit/slider * */ - virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); + virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); /** * @return the text of the label. @@ -302,7 +307,7 @@ public: /** * @reimplemented */ - virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); + virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); /** * This method returns the minimum size necessary to display the @@ -588,7 +593,7 @@ public: /** * @reimplemented */ - virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); + virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); /** * @reimplemented */ @@ -758,6 +763,10 @@ public: */ void setEditFocus(bool mark); + void setValidator(const QValidator *v) { + lineEdit()->setValidator(v); + } + protected: /** 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,10 +1,13 @@ #include <kpopupmenu.h> #include <qtimer.h> +//Added by qt3to4: +#include <QFocusEvent> +#include <Q3PopupMenu> KPopupMenu::KPopupMenu ( QWidget * parent, const char * name ) - : QPopupMenu ( parent, name ) {;} + : Q3PopupMenu ( parent, name ) {;} 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,7 +1,9 @@ #ifndef KPOPUPMENU_H #define KPOPUPMENU_H -#include <qpopupmenu.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <QFocusEvent> #ifdef DESKTOP_VERSION #include <qmenubar.h> #define QPEMenuBar QMenuBar @@ -9,7 +11,7 @@ #include <qpe/qpemenubar.h> #endif -class KPopupMenu : public QPopupMenu +class KPopupMenu : public Q3PopupMenu { Q_OBJECT 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 @@ -18,6 +18,8 @@ */ #include <qstyle.h> +//Added by qt3to4: +#include <Q3Frame> #include <kdebug.h> //US #include <kapplication.h> @@ -26,8 +28,8 @@ #include "kseparator.h" -KSeparator::KSeparator(QWidget* parent, const char* name, WFlags f) - : QFrame(parent, name, f) +KSeparator::KSeparator(QWidget* parent, const char* name, Qt::WFlags f) + : Q3Frame(parent, name, f) { setLineWidth(1); setMidLineWidth(0); @@ -36,8 +38,8 @@ KSeparator::KSeparator(QWidget* parent, const char* name, WFlags f) -KSeparator::KSeparator(int orientation, QWidget* parent, const char* name, WFlags f) - : QFrame(parent, name, f) +KSeparator::KSeparator(int orientation, QWidget* parent, const char* name, Qt::WFlags f) + : Q3Frame(parent, name, f) { setLineWidth(1); setMidLineWidth(0); @@ -50,18 +52,18 @@ void KSeparator::setOrientation(int orientation) { switch(orientation) { - case Vertical: + case Qt::Vertical: case VLine: - setFrameStyle( QFrame::VLine | QFrame::Sunken ); + setFrameStyle( Q3Frame::VLine | Q3Frame::Sunken ); setMinimumSize(2, 0); break; default: kdWarning() << "KSeparator::setOrientation(): invalid orientation, using default orientation HLine" << endl; - case Horizontal: + case Qt::Horizontal: case HLine: - setFrameStyle( QFrame::HLine | QFrame::Sunken ); + setFrameStyle( Q3Frame::HLine | Q3Frame::Sunken ); setMinimumSize(0, 2); break; } 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 @@ -20,7 +20,7 @@ #ifndef __KSEPARATOR_H__ #define __KSEPARATOR_H__ -#include <qframe.h> +#include <q3frame.h> /** * Standard horizontal or vertical separator. @@ -28,7 +28,7 @@ * @author Michael Roth <mroth@wirlweb.de> * @version $Id$ */ -class KSeparator : public QFrame +class KSeparator : public Q3Frame { Q_OBJECT Q_PROPERTY( int orientation READ orientation WRITE setOrientation ) @@ -36,7 +36,7 @@ class KSeparator : public QFrame /** * Constructor. **/ - KSeparator(QWidget* parent=0, const char* name=0, WFlags f=0); + KSeparator(QWidget* parent=0, const char* name=0, Qt::WFlags f=0); /** * Constructor. * @@ -44,7 +44,7 @@ class KSeparator : public QFrame * Possible values are HLine or Horizontal and VLine or Vertical. **/ KSeparator(int orientation, QWidget* parent=0, const char* name=0, - WFlags f=0); + Qt::WFlags f=0); /** * Returns the orientation of the separator. 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 @@ -18,6 +18,9 @@ #include "ksqueezedtextlabel.h" #include <qtooltip.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> KSqueezedTextLabel::KSqueezedTextLabel( const QString &text , QWidget *parent, const char *name ) : QLabel ( parent, name ) { 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 @@ -20,6 +20,8 @@ #define KSQUEEZEDTEXTLABEL_H #include <qlabel.h> +//Added by qt3to4: +#include <QResizeEvent> /** * A label class that squeezes its text into the label 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 @@ -19,7 +19,7 @@ #include "kstdaction.h" #include <qtoolbutton.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> //US #include <kaboutdata.h> #include <kaction.h> 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 @@ -25,9 +25,20 @@ #ifdef KDE_USE_FINAL #undef Always -#include <qdockwindow.h> +#include <q3dockwindow.h> #endif - +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3PtrList> +#include <QPixmap> +#include <Q3Frame> +#include <QResizeEvent> +#include <QMouseEvent> +#include <QChildEvent> +#include <QEvent> +#include <QShowEvent> +#include <QDesktopWidget> +#include <QBoxLayout> #include "ktoolbar.h" @@ -40,7 +51,7 @@ #include <qdrawutil.h> #include <qstring.h> #include <qrect.h> -#include <qobjectlist.h> +#include <qobject.h> #include <qtimer.h> #include <qstyle.h> #include <qapplication.h> @@ -69,8 +80,8 @@ //US #include "kconfigbase.h" -#include <qpopupmenu.h> -#include <qmainwindow.h> +#include <q3popupmenu.h> +#include <q3mainwindow.h> enum { CONTEXT_TOP = 0, @@ -102,7 +113,7 @@ public: m_configurePlugged = false; //US oldPos = Qt::DockUnmanaged; - oldPos = QMainWindow::Unmanaged; + oldPos = Qt::Unmanaged; modified = m_isHorizontal = positioned = FALSE; @@ -129,24 +140,24 @@ public: QWidget *m_parent; - QMainWindow::ToolBarDock oldPos; + Qt::ToolBarDock oldPos; KXMLGUIClient *m_xmlguiClient; struct ToolBarInfo { //US ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( Qt::DockTop ) {} - ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( QMainWindow::Top ) {} + ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( Qt::DockTop ) {} //US ToolBarInfo( Qt::Dock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} - ToolBarInfo( QMainWindow::ToolBarDock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} + ToolBarInfo( Qt::ToolBarDock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} int index, offset; bool newline; //US Qt::Dock dock; - QMainWindow::ToolBarDock dock; + Qt::ToolBarDock dock; }; ToolBarInfo toolBarInfo; - QValueList<int> iconSizes; + Q3ValueList<int> iconSizes; QTimer repaintTimer; // Default Values. @@ -158,25 +169,25 @@ public: int OffsetDefault; QString PositionDefault; - QPtrList<QWidget> idleButtons; + Q3PtrList<QWidget> idleButtons; }; -KToolBarSeparator::KToolBarSeparator(Orientation o , bool l, QToolBar *parent, +KToolBarSeparator::KToolBarSeparator(Qt::Orientation o , bool l, Q3ToolBar *parent, const char* name ) - :QFrame( parent, name ), line( l ) + :Q3Frame( parent, name ), line( l ) { - connect( parent, SIGNAL(orientationChanged(Orientation)), - this, SLOT(setOrientation(Orientation)) ); + connect( parent, SIGNAL(orientationChanged(Qt::Orientation)), + this, SLOT(setOrientation(Qt::Orientation)) ); setOrientation( o ); setBackgroundMode( parent->backgroundMode() ); setBackgroundOrigin( ParentOrigin ); } -void KToolBarSeparator::setOrientation( Orientation o ) +void KToolBarSeparator::setOrientation( Qt::Orientation o ) { orient = o; if ( line ) { - if ( orientation() == Vertical ) + if ( orientation() == Qt::Vertical ) setFrameStyle( HLine + Sunken ); else setFrameStyle( VLine + Sunken ); @@ -192,7 +203,7 @@ void KToolBarSeparator::styleChange( QStyle& ) QSize KToolBarSeparator::sizeHint() const { - return orientation() == Vertical ? QSize( 0, 6 ) : QSize( 6, 0 ); + return orientation() == Qt::Vertical ? QSize( 0, 6 ) : QSize( 6, 0 ); } QSizePolicy KToolBarSeparator::sizePolicy() const @@ -202,12 +213,12 @@ QSizePolicy KToolBarSeparator::sizePolicy() const KToolBar::KToolBar( QWidget *parent, const char *name, bool honorStyle, bool readConfig ) #ifdef DESKTOP_VERSION - : QToolBar( QString::fromLatin1( name ), - parent && parent->inherits( "QMainWindow" ) ? static_cast<QMainWindow*>(parent) : 0, + : Q3ToolBar( QString::fromLatin1( name ), + parent && parent->inherits( "Q3MainWindow" ) ? static_cast<Q3MainWindow*>(parent) : 0, parent, FALSE, name ? name : "mainToolBar") #else - : QPEToolBar( parent && parent->inherits( "QMainWindow" ) ? static_cast<QMainWindow*>(parent) : 0, + : QPEToolBar( parent && parent->inherits( "Q3MainWindow" ) ? static_cast<Q3MainWindow*>(parent) : 0, QString::fromLatin1( name )) @@ -216,9 +227,9 @@ KToolBar::KToolBar( QWidget *parent, const char *name, bool honorStyle, bool rea init( readConfig, honorStyle ); } -KToolBar::KToolBar( QMainWindow *parentWindow, QMainWindow::ToolBarDock dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) +KToolBar::KToolBar( Q3MainWindow *parentWindow, Qt::ToolBarDock dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) #ifdef DESKTOP_VERSION - : QToolBar( QString::fromLatin1( name ), + : Q3ToolBar( QString::fromLatin1( name ), parentWindow, dock, newLine, name ? name : "mainToolBar") #else @@ -231,9 +242,9 @@ KToolBar::KToolBar( QMainWindow *parentWindow, QMainWindow::ToolBarDock dock, bo init( readConfig, honorStyle ); } -KToolBar::KToolBar( QMainWindow *parentWindow, QWidget *dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) +KToolBar::KToolBar( Q3MainWindow *parentWindow, QWidget *dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) #ifdef DESKTOP_VERSION - : QToolBar( QString::fromLatin1( name ), + : Q3ToolBar( QString::fromLatin1( name ), parentWindow, dock, newLine, name ? name : "mainToolBar") #else @@ -280,8 +291,8 @@ void KToolBar::init( bool readConfig, bool honorStyle ) slotReadConfig(); if ( mainWindow() ) - connect( mainWindow(), SIGNAL( toolBarPositionChanged( QToolBar * ) ), - this, SLOT( toolBarPosChanged( QToolBar * ) ) ); + connect( mainWindow(), SIGNAL( toolBarPositionChanged( Q3ToolBar * ) ), + this, SLOT( toolBarPosChanged( Q3ToolBar * ) ) ); // Hack to make sure we recalculate our size when we dock. //US connect( this, SIGNAL(placeChanged(QDockWindow::Place)), SLOT(rebuildLayout()) ); @@ -341,7 +352,7 @@ int KToolBar::insertButton(const QPixmap& pixmap, int id, const char *signal, } -int KToolBar::insertButton(const QString& icon, int id, QPopupMenu *popup, +int KToolBar::insertButton(const QString& icon, int id, Q3PopupMenu *popup, bool enabled, const QString &text, int index ) { KToolBarButton *button = new KToolBarButton( icon, id, this, 0, text ); @@ -353,7 +364,7 @@ int KToolBar::insertButton(const QString& icon, int id, QPopupMenu *popup, } -int KToolBar::insertButton(const QPixmap& pixmap, int id, QPopupMenu *popup, +int KToolBar::insertButton(const QPixmap& pixmap, int id, Q3PopupMenu *popup, bool enabled, const QString &text, int index ) { KToolBarButton *button = new KToolBarButton( pixmap, id, this, 0, text ); @@ -540,7 +551,7 @@ void KToolBar::setButtonIcon( int id, const QString& _icon ) button->setIcon( _icon ); } -void KToolBar::setButtonIconSet( int id, const QIconSet& iconset ) +void KToolBar::setButtonIconSet( int id, const QIcon& iconset ) { Id2WidgetMap::Iterator it = id2widget.find( id ); if ( it == id2widget.end() ) @@ -552,7 +563,7 @@ void KToolBar::setButtonIconSet( int id, const QIconSet& iconset ) } -void KToolBar::setDelayedPopup (int id , QPopupMenu *_popup, bool toggle ) +void KToolBar::setDelayedPopup (int id , Q3PopupMenu *_popup, bool toggle ) { Id2WidgetMap::Iterator it = id2widget.find( id ); if ( it == id2widget.end() ) @@ -787,7 +798,7 @@ void KToolBar::setItemAutoSized (int id, bool yes ) void KToolBar::clear () { - QToolBar::clear(); + Q3ToolBar::clear(); widget2id.clear(); id2widget.clear(); } @@ -876,21 +887,21 @@ void KToolBar::setBarPos (BarPosition bpos) if ( !mainWindow() ) return; //US mainWindow()->moveDockWindow( this, (Dock)bpos ); - mainWindow()->moveToolBar( this, (QMainWindow::ToolBarDock)bpos ); + mainWindow()->moveToolBar( this, (Qt::ToolBarDock)bpos ); } const KToolBar::BarPosition KToolBar::barPos() { - if ( !(QMainWindow*)mainWindow() ) + if ( !(Q3MainWindow*)mainWindow() ) return KToolBar::Top; //US Dock dock; - QMainWindow::ToolBarDock dock; + Qt::ToolBarDock dock; int dm1, dm2; bool dm3; - ((QMainWindow*)mainWindow())->getLocation( (QToolBar*)this, dock, dm1, dm3, dm2 ); + ((Q3MainWindow*)mainWindow())->getLocation( (Q3ToolBar*)this, dock, dm1, dm3, dm2 ); //US if ( dock == DockUnmanaged ) { - if ( dock == QMainWindow::Unmanaged ) { + if ( dock == Qt::Unmanaged ) { return (KToolBar::BarPosition)Top; } return (BarPosition)dock; @@ -967,7 +978,7 @@ void KToolBar::setIconText(IconText icontext, bool update) // ugly hack to force a QMainWindow::triggerLayout( TRUE ) if ( mainWindow() ) { - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); mw->setUpdatesEnabled( FALSE ); mw->setToolBarsMovable( !mw->toolBarsMovable() ); mw->setToolBarsMovable( !mw->toolBarsMovable() ); @@ -1004,7 +1015,7 @@ void KToolBar::setIconSize(int size, bool update) // ugly hack to force a QMainWindow::triggerLayout( TRUE ) if ( mainWindow() ) { - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); mw->setUpdatesEnabled( FALSE ); mw->setToolBarsMovable( !mw->toolBarsMovable() ); mw->setToolBarsMovable( !mw->toolBarsMovable() ); @@ -1062,10 +1073,10 @@ void KToolBar::setFlat (bool flag) return; if ( flag ) //US mainWindow()->moveDockWindow( this, DockMinimized ); - mainWindow()->moveToolBar( this, QMainWindow::Minimized ); + mainWindow()->moveToolBar( this, Qt::Minimized ); else //US mainWindow()->moveDockWindow( this, DockTop ); - mainWindow()->moveToolBar( this, QMainWindow::Top ); + mainWindow()->moveToolBar( this, Qt::Top ); // And remember to save the new look later /*US if ( mainWindow()->inherits( "KMainWindow" ) ) @@ -1249,34 +1260,34 @@ void KToolBar::mousePressEvent ( QMouseEvent *m ) { if ( !mainWindow() ) return; - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); if ( mw->toolBarsMovable() && d->m_enableContext ) { - if ( m->button() == RightButton ) { + if ( m->button() == Qt::RightButton ) { int i = contextMenu()->exec( m->globalPos(), 0 ); switch ( i ) { case -1: return; // popup cancelled case CONTEXT_LEFT: //US mw->moveDockWindow( this, DockLeft ); - mw->moveToolBar( this, QMainWindow::Left ); + mw->moveToolBar( this, Qt::Left ); break; case CONTEXT_RIGHT: //US mw->moveDockWindow( this, DockRight ); - mw->moveToolBar( this, QMainWindow::Right ); + mw->moveToolBar( this, Qt::Right ); break; case CONTEXT_TOP: //US mw->moveDockWindow( this, DockTop ); - mw->moveToolBar( this, QMainWindow::Top ); + mw->moveToolBar( this, Qt::Top ); break; case CONTEXT_BOTTOM: //US mw->moveDockWindow( this, DockBottom ); - mw->moveToolBar( this, QMainWindow::Bottom ); + mw->moveToolBar( this, Qt::Bottom ); break; case CONTEXT_FLOAT: break; case CONTEXT_FLAT: //US mw->moveDockWindow( this, DockMinimized ); - mw->moveToolBar( this, QMainWindow::Minimized ); + mw->moveToolBar( this, Qt::Minimized ); break; case CONTEXT_ICONS: setIconText( IconOnly ); @@ -1332,7 +1343,7 @@ void KToolBar::rebuildLayout() w->hide(); continue; } - if ( w->inherits( "QPopupMenu" ) ) + if ( w->inherits( "Q3PopupMenu" ) ) continue; l->addWidget( w ); w->show(); @@ -1364,7 +1375,7 @@ void KToolBar::childEvent( QChildEvent *e ) if ( e->child()->isWidgetType() ) { QWidget * w = (QWidget*)e->child(); if ( e->type() == QEvent::ChildInserted ) { - if ( !e->child()->inherits( "QPopupMenu" ) && + if ( !e->child()->inherits( "Q3PopupMenu" ) && ::qstrcmp( "qt_dockwidget_internal", e->child()->name() ) != 0 ) { // prevent items that have been explicitly inserted by insert*() from @@ -1375,10 +1386,10 @@ void KToolBar::childEvent( QChildEvent *e ) insertWidgetInternal( w, dummy, -1 ); } } - } else { + } else if( e->type() == QEvent::ChildRemoved ) { removeWidgetInternal( w ); } - if ( isVisibleTo( 0 ) ) + /* TODO:hacker: if ( isVisibleTo( 0 ) ) { QBoxLayout *l = boxLayout(); // QLayout *l = layout(); @@ -1390,9 +1401,9 @@ void KToolBar::childEvent( QChildEvent *e ) it.deleteCurrent(); } layoutTimer->start( 50, TRUE ); + } */ } - } - QToolBar::childEvent( e ); + Q3ToolBar::childEvent( e ); } void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id ) @@ -1416,25 +1427,25 @@ void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id ) void KToolBar::repaintMe() { setUpdatesEnabled( true ); - QToolBar::repaint( true ); + Q3ToolBar::repaint( true ); qDebug(" KToolBar::repaintMe() "); } void KToolBar::showEvent( QShowEvent *e ) { rebuildLayout(); - QToolBar::showEvent( e ); + Q3ToolBar::showEvent( e ); } void KToolBar::setStretchableWidget( QWidget *w ) { - QToolBar::setStretchableWidget( w ); + Q3ToolBar::setStretchableWidget( w ); stretchableWidget = w; } QSizePolicy KToolBar::sizePolicy() const { - if ( orientation() == Horizontal ) + if ( orientation() == Qt::Horizontal ) return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); else return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ); @@ -1442,7 +1453,7 @@ QSizePolicy KToolBar::sizePolicy() const QSize KToolBar::sizeHint() const { - QSize sh = QToolBar::sizeHint(); + QSize sh = Q3ToolBar::sizeHint(); //qDebug("%x KToolBar::sizeHint() %d %d ",this, QToolBar::sizeHint().width(),QToolBar::sizeHint().height() ); if ( sh.height() <= 20 || sh.width() < 60 ) return QSize( sizeHintW, sizeHintH ); @@ -1508,7 +1519,7 @@ QSize KToolBar::sizeHint() const break; default: - minSize = QToolBar::sizeHint(); + minSize = Q3ToolBar::sizeHint(); break; } return minSize; @@ -1532,19 +1543,19 @@ bool KToolBar::highlight() const void KToolBar::hide() { - QToolBar::hide(); + Q3ToolBar::hide(); } void KToolBar::show() { - QToolBar::show(); + Q3ToolBar::show(); } void KToolBar::resizeEvent( QResizeEvent *e ) { bool b = isUpdatesEnabled(); setUpdatesEnabled( FALSE ); - QToolBar::resizeEvent( e ); + Q3ToolBar::resizeEvent( e ); if (b) d->repaintTimer.start( 100, true ); } @@ -1726,7 +1737,7 @@ void KToolBar::applyAppearanceSettings(KConfig *config, const QString &_configGr doUpdate = true; } - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); // ...and if we should highlight if ( highlight != d->m_highlight ) { @@ -1805,19 +1816,19 @@ void KToolBar::applySettings(KConfig *config, const QString &_configGroup) else if ( position == "Flat" ) pos = DockMinimized; */ - QMainWindow::ToolBarDock pos(QMainWindow::Top); + Qt::ToolBarDock pos(Qt::DockTop); if ( position == "Top" ) - pos = QMainWindow::Top; + pos = Qt::Top; else if ( position == "Bottom" ) - pos = QMainWindow::Bottom; + pos = Qt::Bottom; else if ( position == "Left" ) - pos = QMainWindow::Left; + pos = Qt::Left; else if ( position == "Right" ) - pos = QMainWindow::Right; + pos = Qt::Right; else if ( position == "Floating" ) - pos = QMainWindow::TornOff; + pos = Qt::TornOff; else if ( position == "Flat" ) - pos = QMainWindow::Minimized; + pos = Qt::Minimized; //kdDebug(220) << "KToolBar::applySettings hidden=" << hidden << endl; if (hidden) @@ -1827,7 +1838,7 @@ void KToolBar::applySettings(KConfig *config, const QString &_configGroup) if ( mainWindow() ) { - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); //kdDebug(220) << "KToolBar::applySettings updating ToolbarInfo" << endl; d->toolBarInfo = KToolBarPrivate::ToolBarInfo( pos, index, newLine, offset ); @@ -1862,7 +1873,7 @@ bool KToolBar::event( QEvent *e ) return true; } - return QToolBar::event( e ); + return Q3ToolBar::event( e ); } void KToolBar::slotRepaint() @@ -1880,14 +1891,14 @@ void KToolBar::slotRepaint() repaint( TRUE ); } -void KToolBar::toolBarPosChanged( QToolBar *tb ) +void KToolBar::toolBarPosChanged( Q3ToolBar *tb ) { if ( tb != this ) return; //US if ( d->oldPos == DockMinimized ) - if ( d->oldPos == QMainWindow::Minimized ) + if ( d->oldPos == Qt::Minimized ) rebuildLayout(); - d->oldPos = (QMainWindow::ToolBarDock)barPos(); + d->oldPos = (Qt::ToolBarDock)barPos(); /*US if ( mainWindow() && mainWindow()->inherits( "KMainWindow" ) ) static_cast<KMainWindow *>(mainWindow())->setSettingsDirty(); @@ -2031,7 +2042,7 @@ void KToolBar::getAttributes( QString &position, QString &icontext, int &index ) } if ( mainWindow() ) { - QMainWindow::ToolBarDock dock; + Qt::ToolBarDock dock; bool newLine; int offset; mainWindow()->getLocation( this, dock, index, newLine, offset ); @@ -2100,7 +2111,7 @@ void KToolBar::positionYourself( bool force ) } //US KPopupMenu *KToolBar::contextMenu() -QPopupMenu *KToolBar::contextMenu() +Q3PopupMenu *KToolBar::contextMenu() { if ( context ) return context; @@ -2108,11 +2119,11 @@ QPopupMenu *KToolBar::contextMenu() // Construct our context popup menu. Name it qt_dockwidget_internal so it // won't be deleted by QToolBar::clear(). //US context = new KPopupMenu( this, "qt_dockwidget_internal" ); - context = new QPopupMenu( this, "qt_dockwidget_internal" ); + context = new Q3PopupMenu( this, "qt_dockwidget_internal" ); //US context->insertTitle(i18n("Toolbar Menu")); //US KPopupMenu *orient = new KPopupMenu( context, "orient" ); - QPopupMenu *orient = new QPopupMenu( context, "orient" ); + Q3PopupMenu *orient = new Q3PopupMenu( context, "orient" ); orient->insertItem( i18n("toolbar position string","Top"), CONTEXT_TOP ); orient->insertItem( i18n("toolbar position string","Left"), CONTEXT_LEFT ); orient->insertItem( i18n("toolbar position string","Right"), CONTEXT_RIGHT ); @@ -2122,17 +2133,17 @@ QPopupMenu *KToolBar::contextMenu() orient->insertItem( i18n("min toolbar", "Flat"), CONTEXT_FLAT ); //US KPopupMenu *mode = new KPopupMenu( context, "mode" ); - QPopupMenu *mode = new QPopupMenu( context, "mode" ); + Q3PopupMenu *mode = new Q3PopupMenu( context, "mode" ); mode->insertItem( i18n("Icons Only"), CONTEXT_ICONS ); mode->insertItem( i18n("Text Only"), CONTEXT_TEXT ); mode->insertItem( i18n("Text Alongside Icons"), CONTEXT_TEXTRIGHT ); mode->insertItem( i18n("Text Under Icons"), CONTEXT_TEXTUNDER ); //US KPopupMenu *size = new KPopupMenu( context, "size" ); - QPopupMenu *size = new QPopupMenu( context, "size" ); + Q3PopupMenu *size = new Q3PopupMenu( context, "size" ); size->insertItem( i18n("Default"), CONTEXT_ICONSIZES ); // Query the current theme for available sizes - QValueList<int> avSizes; + Q3ValueList<int> avSizes; /*US KIconTheme *theme = KGlobal::instance()->iconLoader()->theme(); if (!::qstrcmp(QObject::name(), "mainToolBar")) @@ -2145,7 +2156,7 @@ QPopupMenu *KToolBar::contextMenu() d->iconSizes = avSizes; - QValueList<int>::Iterator it; + Q3ValueList<int>::Iterator it; for (it=avSizes.begin(); it!=avSizes.end(); it++) { QString text; if ( *it < 19 ) @@ -2218,8 +2229,8 @@ void KToolBar::slotContextAboutToShow() break; } - QValueList<int>::ConstIterator iIt = d->iconSizes.begin(); - QValueList<int>::ConstIterator iEnd = d->iconSizes.end(); + Q3ValueList<int>::ConstIterator iIt = d->iconSizes.begin(); + Q3ValueList<int>::ConstIterator iEnd = d->iconSizes.end(); for (; iIt != iEnd; ++iIt ) context->setItemChecked( CONTEXT_ICONSIZES + *iIt, false ); 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 @@ -26,27 +26,35 @@ #ifndef DESKTOP_VERSION #define private public -#include <qtoolbar.h> +#include <q3toolbar.h> #undef private #include <qpe/qpetoolbar.h> #else -#include <qtoolbar.h> +#include <q3toolbar.h> #endif -#include <qmainwindow.h> +#include <q3mainwindow.h> #include <qcombobox.h> #include <qmap.h> -#include <qptrlist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <QPixmap> +#include <QResizeEvent> +#include <Q3PopupMenu> +#include <QMouseEvent> +#include <QChildEvent> +#include <QEvent> +#include <QShowEvent> #include <kglobal.h> -#include <qguardedptr.h> -#include <qframe.h> -#include <qiconset.h> +#include <qpointer.h> +#include <q3frame.h> +#include <qicon.h> class QDomElement; class QSize; class QPixmap; -class QPopupMenu; +class Q3PopupMenu; class QStringList; class QDomDocument; class QTimer; @@ -63,22 +71,22 @@ class KXMLGUIClient; class KToolBarPrivate; -class KToolBarSeparator : public QFrame +class KToolBarSeparator : public Q3Frame { Q_OBJECT public: - KToolBarSeparator( Orientation, bool l, QToolBar *parent, const char* name=0 ); + KToolBarSeparator( Qt::Orientation, bool l, Q3ToolBar *parent, const char* name=0 ); QSize sizeHint() const; - Orientation orientation() const { return orient; } + Qt::Orientation orientation() const { return orient; } QSizePolicy sizePolicy() const; bool showLine() const { return line; } public slots: - void setOrientation( Orientation ); + void setOrientation( Qt::Orientation ); protected: void styleChange( QStyle& ); private: - Orientation orient; + Qt::Orientation orient; bool line; }; @@ -111,10 +119,10 @@ private: // porting KToolBar back to Qt2 really needs some strange hacks #ifndef DESKTOP_VERSION -#define QToolBar QPEToolBar +#define Q3ToolBar QPEToolBar #endif - class KToolBar : public QToolBar + class KToolBar : public Q3ToolBar { Q_OBJECT @@ -127,7 +135,7 @@ private: Q_PROPERTY( int iconSize READ iconSize WRITE setIconSize ) Q_PROPERTY( QString text READ text WRITE setText ) #ifndef DESKTOP_VERSION -#undef QToolBar +#undef Q3ToolBar #endif public: enum IconText{IconOnly = 0, IconTextRight, TextOnly, IconTextBottom}; @@ -175,7 +183,7 @@ public: * @param honor_style If true, then global settings for IconSize and IconText will be honored * @param readConfig whether to apply the configuration (global and application-specific) */ - KToolBar( QMainWindow *parentWindow, QMainWindow::ToolBarDock dock /*= QMainWindow::Top*/, bool newLine = false, + KToolBar( Q3MainWindow *parentWindow, Qt::ToolBarDock dock /*= QMainWindow::Top*/, bool newLine = false, const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE ); /** @@ -193,7 +201,7 @@ public: * @param honor_style If true, then global settings for IconSize and IconText will be honored * @param readConfig whether to apply the configuration (global and application-specific) */ - KToolBar( QMainWindow *parentWindow, QWidget *dock, bool newLine = false, + KToolBar( Q3MainWindow *parentWindow, QWidget *dock, bool newLine = false, const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE ); virtual ~KToolBar(); @@ -303,7 +311,7 @@ public: * You can add custom popups which inherit @ref QPopupMenu to get popups * with tables, drawings etc. Just don't fiddle with events there. */ - int insertButton(const QString& icon, int id, QPopupMenu *popup, + int insertButton(const QString& icon, int id, Q3PopupMenu *popup, bool enabled, const QString&_text, int index=-1); /** @@ -318,7 +326,7 @@ public: * You can add custom popups which inherit @ref QPopupMenu to get popups * with tables, drawings etc. Just don't fiddle with events there. */ - int insertButton(const QPixmap& pixmap, int id, QPopupMenu *popup, + int insertButton(const QPixmap& pixmap, int id, Q3PopupMenu *popup, bool enabled, const QString&_text, int index=-1); /** @@ -359,7 +367,7 @@ public: const char *slot, bool enabled=true, const QString& tooltiptext=QString::null, int size=70, int index=-1, - QComboBox::Policy policy = QComboBox::AtBottom); + QComboBox::Policy policy = QComboBox::InsertAtBottom); /** * Insert a @ref KComboBox with text. @@ -375,7 +383,7 @@ public: const char *slot, bool enabled=true, const QString& tooltiptext=QString::null, int size=70, int index=-1, - QComboBox::Policy policy = QComboBox::AtBottom); + QComboBox::Policy policy = QComboBox::InsertAtBottom); /** * Inserts a separator into the toolbar with the given id. @@ -465,7 +473,7 @@ public: * * Can be used while button is visible. */ - void setButtonIconSet( int id, const QIconSet& iconset ); + void setButtonIconSet( int id, const QIcon& iconset ); /** * Sets a delayed popup for a button. @@ -491,7 +499,7 @@ public: * add popups that are already in the menu bar or are submenus of * other popups. */ - void setDelayedPopup (int id , QPopupMenu *_popup, bool toggle = false); + void setDelayedPopup (int id , Q3PopupMenu *_popup, bool toggle = false); /** * Turns a button into an autorepeat button. @@ -1060,7 +1068,7 @@ public: public slots: virtual void setIconText( const QString &txt ) - { QToolBar::setIconText( txt ); } + { Q3ToolBar::setIconText( txt ); } void slotRepaint(); protected: @@ -1077,7 +1085,7 @@ private slots: void slotReadConfig (); void slotAppearanceChanged(); void slotIconChanged(int); - void toolBarPosChanged( QToolBar *tb ); + void toolBarPosChanged( Q3ToolBar *tb ); void slotContextAboutToShow(); void widgetDestroyed(); @@ -1090,16 +1098,16 @@ private: void removeWidgetInternal( QWidget *w ); void getAttributes( QString &position, QString &icontext, int &index ); //US KPopupMenu *contextMenu(); - QPopupMenu *contextMenu(); + Q3PopupMenu *contextMenu(); QMap<QWidget*, int > widget2id; typedef QMap<int, QWidget* > Id2WidgetMap; Id2WidgetMap id2widget; //US KPopupMenu *context; - QPopupMenu *context; - QPtrList<QWidget> widgets; + Q3PopupMenu *context; + Q3PtrList<QWidget> widgets; QTimer *layoutTimer; - QGuardedPtr<QWidget> stretchableWidget, rightAligned; + QPointer<QWidget> stretchableWidget, rightAligned; protected: virtual void virtual_hook( int id, void* data ); private: 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 @@ -33,10 +33,14 @@ #include <qdrawutil.h> #include <qtooltip.h> #include <qbitmap.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qcursor.h> #include <qpainter.h> #include <qlayout.h> +//Added by qt3to4: +#include <QPixmap> +#include <QMouseEvent> +#include <QEvent> #include <kapplication.h> #include <kdebug.h> @@ -48,7 +52,7 @@ // needed to get our instance #include <kmainwindow.h> -template class QIntDict<KToolBarButton>; +template class Q3IntDict<KToolBarButton>; class KToolBarButtonPrivate { @@ -115,7 +119,7 @@ KToolBarButton::KToolBarButton( const QString& _icon, int _id, QToolButton::setTextLabel(_txt); //US d->m_instance = _instance; - setFocusPolicy( NoFocus ); + setFocusPolicy( Qt::NoFocus ); // connect all of our slots and start trapping events connect(d->m_parent, SIGNAL( modechange() ), @@ -146,7 +150,7 @@ KToolBarButton::KToolBarButton( const QPixmap& pixmap, int _id, d->m_parent = (KToolBar *) _parent; QToolButton::setTextLabel(txt); - setFocusPolicy( NoFocus ); + setFocusPolicy( Qt::NoFocus ); // connect all of our slots and start trapping events connect(d->m_parent, SIGNAL( modechange()), @@ -161,7 +165,7 @@ KToolBarButton::KToolBarButton( const QPixmap& pixmap, int _id, installEventFilter(this); // set our pixmap and do our initial setup - setIconSet( QIconSet( pixmap )); + setIconSet( QIcon( pixmap )); modeChange(); } @@ -292,7 +296,7 @@ void KToolBarButton::setIcon( const QString &icon ) QToolButton::setIconSet(KGlobal::iconLoader()->loadIconSet(d->m_iconName)); } -void KToolBarButton::setIconSet( const QIconSet &iconset ) +void KToolBarButton::setIconSet( const QIcon &iconset ) { QToolButton::setIconSet( iconset ); } @@ -305,28 +309,28 @@ void KToolBarButton::setPixmap( const QPixmap &pixmap ) QToolButton::setPixmap( pixmap ); return; } - QIconSet set = iconSet(); - set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Active ); + QIcon set = iconSet(); + set.setPixmap( pixmap, QIcon::Automatic, QIcon::Active ); QToolButton::setIconSet( set ); } void KToolBarButton::setDefaultPixmap( const QPixmap &pixmap ) { - QIconSet set = iconSet(); - set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Normal ); + QIcon set = iconSet(); + set.setPixmap( pixmap, QIcon::Automatic, QIcon::Normal ); QToolButton::setIconSet( set ); } void KToolBarButton::setDisabledPixmap( const QPixmap &pixmap ) { - QIconSet set = iconSet(); - set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Disabled ); + QIcon set = iconSet(); + set.setPixmap( pixmap, QIcon::Automatic, QIcon::Disabled ); QToolButton::setIconSet( set ); } void KToolBarButton::setDefaultIcon( const QString& icon ) { - QIconSet set = iconSet(); + QIcon set = iconSet(); QPixmap pm; if (!strcmp(d->m_parent->name(), "mainToolBar")) pm = /*US d->m_instance->iconLoader()*/KGlobal::iconLoader()->loadIcon( icon, KIcon::MainToolbar, @@ -334,13 +338,13 @@ void KToolBarButton::setDefaultIcon( const QString& icon ) else pm = /*US d->m_instance->iconLoader()*/KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar, d->m_iconSize ); - set.setPixmap( pm, QIconSet::Automatic, QIconSet::Normal ); + set.setPixmap( pm, QIcon::Automatic, QIcon::Normal ); QToolButton::setIconSet( set ); } void KToolBarButton::setDisabledIcon( const QString& icon ) { - QIconSet set = iconSet(); + QIcon set = iconSet(); QPixmap pm; if (!strcmp(d->m_parent->name(), "mainToolBar")) pm = /*US d->m_instance->iconLoader()*/ KGlobal::iconLoader()->loadIcon( icon, KIcon::MainToolbar, @@ -348,25 +352,25 @@ void KToolBarButton::setDisabledIcon( const QString& icon ) else pm = /*US d->m_instance->iconLoader()*/ KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar, d->m_iconSize ); - set.setPixmap( pm, QIconSet::Automatic, QIconSet::Disabled ); + set.setPixmap( pm, QIcon::Automatic, QIcon::Disabled ); QToolButton::setIconSet( set ); } -QPopupMenu *KToolBarButton::popup() +QMenu *KToolBarButton::popup() { // obsolete // KDE4: remove me return QToolButton::popup(); } -void KToolBarButton::setPopup(QPopupMenu *p, bool) +void KToolBarButton::setPopup(Q3PopupMenu *p, bool) { QToolButton::setPopup(p); QToolButton::setPopupDelay(1); } -void KToolBarButton::setDelayedPopup (QPopupMenu *p, bool) +void KToolBarButton::setDelayedPopup (Q3PopupMenu *p, bool) { QToolButton::setPopup(p); //US QToolButton::setPopupDelay(QApplication::startDragTime()); @@ -451,21 +455,27 @@ bool KToolBarButton::eventFilter(QObject *o, QEvent *ev) void KToolBarButton::drawButton( QPainter *_painter ) { #ifdef DESKTOP_VERSION - QStyle::SFlags flags = QStyle::Style_Default; - QStyle::SCFlags active = QStyle::SC_None; + QStyle::State flags = QStyle::State_None; + QStyle::SubControls active = QStyle::SC_None; if (isDown()) { - flags |= QStyle::Style_Down; + flags |= QStyle::State_DownArrow; active |= QStyle::SC_ToolButton; } - if (isEnabled()) flags |= QStyle::Style_Enabled; - if (isOn()) flags |= QStyle::Style_On; - if (isEnabled() && d->m_isRaised) flags |= QStyle::Style_Raised; - if (hasFocus()) flags |= QStyle::Style_HasFocus; + if (isEnabled()) flags |= QStyle::State_Enabled; + if (isOn()) flags |= QStyle::State_On; + if (isEnabled() && d->m_isRaised) flags |= QStyle::State_Raised; + if (hasFocus()) flags |= QStyle::State_HasFocus; + + QStyleOptionToolButton qsotb; + qsotb.initFrom(this); + qsotb.state = flags; + qsotb.activeSubControls = active; + qsotb.rect = rect(); + qsotb.palette = palette(); // Draw a styled toolbutton - style().drawComplexControl(QStyle::CC_ToolButton, _painter, this, rect(), - colorGroup(), flags, QStyle::SC_ToolButton, active, QStyleOption()); + style()->drawComplexControl(QStyle::CC_ToolButton, &qsotb, _painter, this); #else style().drawToolButton(_painter, rect().x(), rect().y(), rect().width(), rect().height(), colorGroup()); @@ -484,9 +494,9 @@ void KToolBarButton::drawButton( QPainter *_painter ) QIconSet::Disabled, isOn() ? QIconSet::On : QIconSet::Off ); */ - QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, - isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : - QIconSet::Disabled); + QPixmap pixmap = iconSet().pixmap( QIcon::Automatic, + isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) : + QIcon::Disabled); if( !pixmap.isNull()) { @@ -508,9 +518,9 @@ void KToolBarButton::drawButton( QPainter *_painter ) QIconSet::Disabled, isOn() ? QIconSet::On : QIconSet::Off ); */ - QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, - isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : - QIconSet::Disabled); + QPixmap pixmap = iconSet().pixmap( QIcon::Automatic, + isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) : + QIcon::Disabled); if( !pixmap.isNull()) { @@ -526,7 +536,7 @@ void KToolBarButton::drawButton( QPainter *_painter ) if (!textLabel().isNull()) { - textFlags = AlignVCenter|AlignLeft; + textFlags = Qt::AlignVCenter|Qt::AlignLeft; if (!pixmap.isNull()) dx = 4 + pixmap.width() + 2; else @@ -544,7 +554,7 @@ void KToolBarButton::drawButton( QPainter *_painter ) { if (!textLabel().isNull()) { - textFlags = AlignVCenter|AlignLeft; + textFlags = Qt::AlignVCenter|Qt::AlignLeft; dx = (width() - fm.width(textLabel())) / 2; dy = (height() - fm.lineSpacing()) / 2; if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ ) @@ -563,9 +573,9 @@ void KToolBarButton::drawButton( QPainter *_painter ) QIconSet::Disabled, isOn() ? QIconSet::On : QIconSet::Off ); */ - QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, - isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : - QIconSet::Disabled); + QPixmap pixmap = iconSet().pixmap( QIcon::Automatic, + isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) : + QIcon::Disabled); if( !pixmap.isNull()) { @@ -581,7 +591,7 @@ void KToolBarButton::drawButton( QPainter *_painter ) if (!textLabel().isNull()) { - textFlags = AlignBottom|AlignHCenter; + textFlags = Qt::AlignBottom|Qt::AlignHCenter; dx = (width() - fm.width(textLabel())) / 2; dy = height() - fm.lineSpacing() - 4; @@ -610,14 +620,18 @@ void KToolBarButton::drawButton( QPainter *_painter ) if (QToolButton::popup()) { #ifdef DESKTOP_VERSION - QStyle::SFlags arrowFlags = QStyle::Style_Default; + QStyle::State arrowFlags = QStyle::State_None; + + if (isDown()) arrowFlags |= QStyle::State_DownArrow; + if (isEnabled()) arrowFlags |= QStyle::State_Enabled; - if (isDown()) arrowFlags |= QStyle::Style_Down; - if (isEnabled()) arrowFlags |= QStyle::Style_Enabled; + QStyleOption qso; + qso.initFrom(this); + qso.state = arrowFlags; + qso.rect = QRect(width()-7, height()-7, 7, 7); + qso.palette = palette(); - style().drawPrimitive(QStyle::PE_ArrowDown, _painter, - QRect(width()-7, height()-7, 7, 7), colorGroup(), - arrowFlags, QStyleOption() ); + style()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &qso, _painter); #else style().drawArrow(_painter, Qt::DownArrow, isDown(), width()-7, height()-7, 7, 7, colorGroup(), isEnabled() ); 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 @@ -26,15 +26,18 @@ #include <qpixmap.h> #include <qtoolbutton.h> -#include <qintdict.h> +#include <q3intdict.h> #include <qstring.h> +//Added by qt3to4: +#include <QEvent> +#include <Q3PopupMenu> #include <kglobal.h> class KToolBar; class KToolBarButtonPrivate; //USclass KInstance; class QEvent; -class QPopupMenu; +class Q3PopupMenu; class QPainter; /** @@ -150,7 +153,7 @@ public: * that set icons or pixmaps. * @param iconset The iconset to use */ - virtual void setIconSet( const QIconSet &iconset ); + virtual void setIconSet( const QIcon &iconset ); #ifndef KDE_NO_COMPAT /** @@ -209,7 +212,7 @@ public: /** * Return a pointer to this button's popup menu (if it exists) */ - QPopupMenu *popup(); + QMenu *popup(); /** * Returns the button's id. @@ -224,7 +227,7 @@ public: * * @param p The new popup menu */ - void setPopup (QPopupMenu *p, bool unused = false); + void setPopup (Q3PopupMenu *p, bool unused = false); /** * Gives this button a delayed popup menu. @@ -235,7 +238,7 @@ public: * * @param p the new popup menu */ - void setDelayedPopup(QPopupMenu *p, bool unused = false); + void setDelayedPopup(Q3PopupMenu *p, bool unused = false); /** * Turn this button into a radio button @@ -303,7 +306,7 @@ private: * @internal * @version $Id$ */ -class KToolBarButtonList : public QIntDict<KToolBarButton> +class KToolBarButtonList : public Q3IntDict<KToolBarButton> { public: KToolBarButtonList(); 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 @@ -18,7 +18,9 @@ #include "ktoolbarhandler.h" -#include <qpopupmenu.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <Q3PtrList> #include <kapplication.h> #include <ktoolbar.h> #include <kmainwindow.h> @@ -44,7 +46,7 @@ namespace class BarActionBuilder { public: - BarActionBuilder( KActionCollection *actionCollection, KMainWindow *mainWindow, QPtrList<KToolBar> &oldToolBarList ) + BarActionBuilder( KActionCollection *actionCollection, KMainWindow *mainWindow, Q3PtrList<KToolBar> &oldToolBarList ) : m_actionCollection( actionCollection ), m_mainWindow( mainWindow ), m_needsRebuild( false ) { /*US @@ -70,16 +72,16 @@ namespace bool needsRebuild() const { return m_needsRebuild; } - QPtrList<KAction> create() + Q3PtrList<KAction> create() { if ( !m_needsRebuild ) - return QPtrList<KAction>(); + return Q3PtrList<KAction>(); - QPtrListIterator<KToolBar> toolBarIt( m_toolBars ); + Q3PtrListIterator<KToolBar> toolBarIt( m_toolBars ); for ( ; toolBarIt.current(); ++toolBarIt ) handleToolBar( toolBarIt.current() ); - QPtrList<KAction> actions; + Q3PtrList<KAction> actions; if ( m_toolBarActions.count() == 0 ) return actions; @@ -91,7 +93,7 @@ namespace KActionMenu *menuAction = new KActionMenu( i18n( "Toolbars" ), m_actionCollection, "toolbars_submenu_action" ); - QPtrListIterator<KAction> actionIt( m_toolBarActions ); + Q3PtrListIterator<KAction> actionIt( m_toolBarActions ); for ( ; actionIt.current(); ++actionIt ) menuAction->insert( actionIt.current() ); @@ -99,7 +101,7 @@ namespace return actions; } - const QPtrList<KToolBar> &toolBars() const { return m_toolBars; } + const Q3PtrList<KToolBar> &toolBars() const { return m_toolBars; } private: void handleToolBar( KToolBar *toolBar ) @@ -115,8 +117,8 @@ namespace KActionCollection *m_actionCollection; KMainWindow *m_mainWindow; - QPtrList<KToolBar> m_toolBars; - QPtrList<KAction> m_toolBarActions; + Q3PtrList<KToolBar> m_toolBars; + Q3PtrList<KAction> m_toolBarActions; bool m_needsRebuild : 1; }; @@ -224,7 +226,7 @@ void ToolBarHandler::init( KMainWindow *mainWindow ) void ToolBarHandler::connectToActionContainers() { - QPtrListIterator<KAction> actionIt( m_actions ); + Q3PtrListIterator<KAction> actionIt( m_actions ); for ( ; actionIt.current(); ++actionIt ) connectToActionContainer( actionIt.current() ); } @@ -239,7 +241,7 @@ void ToolBarHandler::connectToActionContainer( KAction *action ) void ToolBarHandler::connectToActionContainer( QWidget *container ) { //US QPopupMenu *popupMenu = dynamic_cast<QPopupMenu *>( container ); - QPopupMenu *popupMenu = (QPopupMenu *)( container ); + Q3PopupMenu *popupMenu = (Q3PopupMenu *)( container ); if ( !popupMenu ) return; 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 @@ -20,8 +20,8 @@ #define KBARHANDLER_H #include <qobject.h> -#include <qguardedptr.h> -#include <qptrlist.h> +#include <qpointer.h> +#include <q3ptrlist.h> #include <kxmlguiclient.h> #include <kaction.h> @@ -57,9 +57,9 @@ private: struct Data; Data *d; - QGuardedPtr<KMainWindow> m_mainWindow; - QPtrList<KAction> m_actions; - QPtrList<KToolBar> m_toolBars; + QPointer<KMainWindow> m_mainWindow; + Q3PtrList<KAction> m_actions; + Q3PtrList<KToolBar> m_toolBars; }; } // namespace KDEPrivate 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 @@ -39,6 +39,8 @@ #include <kapplication.h> #include <assert.h> +//Added by qt3to4: +#include <Q3PtrList> class KXMLGUIClientPrivate { @@ -63,7 +65,7 @@ public: //US KXMLGUIFactory *m_factory; KXMLGUIClient *m_parent; //QPtrList<KXMLGUIClient> m_supers; - QPtrList<KXMLGUIClient> m_children; + Q3PtrList<KXMLGUIClient> m_children; //US KXMLGUIBuilder *m_builder; //US QString m_xmlFile; //US QString m_localXMLFile; @@ -85,7 +87,7 @@ KXMLGUIClient::~KXMLGUIClient() if ( d->m_parent ) d->m_parent->removeChildClient( this ); - QPtrListIterator<KXMLGUIClient> it( d->m_children ); + Q3PtrListIterator<KXMLGUIClient> it( d->m_children ); for ( ; it.current(); ++it ) { assert( it.current()->d->m_parent == this ); it.current()->d->m_parent = 0; @@ -99,7 +101,7 @@ KAction *KXMLGUIClient::action( const char *name ) const { KAction* act = actionCollection()->action( name ); if ( !act ) { - QPtrListIterator<KXMLGUIClient> childIt( d->m_children ); + Q3PtrListIterator<KXMLGUIClient> childIt( d->m_children ); for (; childIt.current(); ++childIt ) { act = childIt.current()->actionCollection()->action( name ); if ( act ) @@ -588,7 +590,7 @@ void KXMLGUIClient::removeChildClient( KXMLGUIClient *child ) return true; }*/ -const QPtrList<KXMLGUIClient> *KXMLGUIClient::childClients() +const Q3PtrList<KXMLGUIClient> *KXMLGUIClient::childClients() { return &d->m_children; } @@ -606,7 +608,7 @@ KXMLGUIBuilder *KXMLGUIClient::clientBuilder() const } */ -void KXMLGUIClient::plugActionList( const QString &name, const QPtrList<KAction> &actionList ) +void KXMLGUIClient::plugActionList( const QString &name, const Q3PtrList<KAction> &actionList ) { /*US if ( !d->m_factory ) 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 @@ -21,7 +21,7 @@ //US #include <qdom.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qmap.h> #include <qstringlist.h> @@ -161,7 +161,7 @@ public: /** * Retrieves a list of all child clients. */ - const QPtrList<KXMLGUIClient> *childClients(); + const Q3PtrList<KXMLGUIClient> *childClients(); /** * A client can have an own @ref KXMLGUIBuilder. @@ -228,7 +228,7 @@ public: * plugActionList() would leave the previous actions in the * menu too.. */ - void plugActionList( const QString &name, const QPtrList<KAction> &actionList ); + void plugActionList( const QString &name, const Q3PtrList<KAction> &actionList ); /** * The complement of \ref plugActionList() ... diff --git a/microkde/kdialog.cpp b/microkde/kdialog.cpp index 8398956..57e7ea6 100644 --- a/microkde/kdialog.cpp +++ b/microkde/kdialog.cpp @@ -1,10 +1,12 @@ #include <kdialog.h> -#include <qapp.h> +#include <qapplication.h> #include <qlabel.h> #include <qpushbutton.h> #include <qlayout.h> -#include <qprogressbar.h> +#include <q3progressbar.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <klocale.h> KDialog::KDialog( QWidget *parent, const char *name, bool modal ) : @@ -30,9 +32,9 @@ int KDialog::marginHintSmall() { return 1; } KProgressDialog::KProgressDialog( QWidget *parent, const char *name, bool modal ) : QDialog( parent, name, modal ) { - QVBoxLayout* lay= new QVBoxLayout ( this ); + Q3VBoxLayout* lay= new Q3VBoxLayout ( this ); mLabel = new QLabel ( "abc",this ); - mBar = new QProgressBar ( this ); + mBar = new Q3ProgressBar ( this ); mButton = new QPushButton ( i18n("Cancel"),this ); lay->addWidget ( mLabel ); lay->addWidget ( mBar ); diff --git a/microkde/kdialog.h b/microkde/kdialog.h index bc80689..5f9bf0e 100644 --- a/microkde/kdialog.h +++ b/microkde/kdialog.h @@ -2,8 +2,10 @@ #define MINIKDE_KDIALOG_H #include <qdialog.h> +//Added by qt3to4: +#include <QLabel> class QLabel; -class QProgressBar; +class Q3ProgressBar; class QPushButton ; class KDialog : public QDialog @@ -29,7 +31,7 @@ class KProgressDialog : public QDialog void reject(); private: QLabel * mLabel; - QProgressBar *mBar; + Q3ProgressBar *mBar; QPushButton *mButton; signals: void cancelled (); diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp index d5c7e61..a40bad6 100644 --- a/microkde/kdialogbase.cpp +++ b/microkde/kdialogbase.cpp @@ -1,7 +1,11 @@ #include <qtabwidget.h> #include <qpushbutton.h> #include <qlayout.h> -#include <qframe.h> +#include <q3frame.h> +//Added by qt3to4: +#include <QPixmap> +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> #include "klocale.h" @@ -135,13 +139,13 @@ void KDialogBase::initLayout() { delete mTopLayout; - mTopLayout = new QVBoxLayout( this ); + mTopLayout = new Q3VBoxLayout( this ); mTopLayout->setMargin( marginHintSmall() ); mTopLayout->setSpacing( spacingHintSmall() ); mTopLayout->addWidget( mMainWidget ); - QBoxLayout *buttonLayout = new QHBoxLayout; + Q3BoxLayout *buttonLayout = new Q3HBoxLayout; mTopLayout->addLayout( buttonLayout ); if ( mUser1Button ) buttonLayout->addWidget( mUser1Button ); @@ -155,15 +159,15 @@ void KDialogBase::initLayout() buttonLayout->setSpacing( spacingHintSmall() ); } -QFrame *KDialogBase::addPage( const QString &name ) +Q3Frame *KDialogBase::addPage( const QString &name ) { // kdDebug() << "KDialogBase::addPage(): " << name << endl; - QFrame *frame = new QFrame( tabWidget() ); + Q3Frame *frame = new Q3Frame( tabWidget() ); tabWidget()->addTab( frame, name ); return frame; } -QFrame *KDialogBase::addPage( const QString &name, int, const QPixmap & ) +Q3Frame *KDialogBase::addPage( const QString &name, int, const QPixmap & ) { return addPage( name ); } @@ -254,10 +258,10 @@ bool KDialogBase::showPage( int index ) tabWidget()->setCurrentPage( index );return false; } -QFrame *KDialogBase::plainPage() +Q3Frame *KDialogBase::plainPage() { if ( !mPlainPage ) { - mPlainPage = new QFrame( this ); + mPlainPage = new Q3Frame( this ); setMainWidget( mPlainPage ); } return mPlainPage; diff --git a/microkde/kdialogbase.h b/microkde/kdialogbase.h index 17c186b..64cbd17 100644 --- a/microkde/kdialogbase.h +++ b/microkde/kdialogbase.h @@ -1,14 +1,16 @@ #ifndef MINIKDE_KDIALOGBASE_H #define MINIKDE_KDIALOGBASE_H -#include <qframe.h> +#include <q3frame.h> +//Added by qt3to4: +#include <QPixmap> #include "kdialog.h" class QPushButton; class QLayout; class QTabWidget; -class QBoxLayout; +class Q3BoxLayout; class KDialogBase : public KDialog { @@ -59,8 +61,8 @@ class KDialogBase : public KDialog const QString &user3=QString::null); virtual ~KDialogBase(); - QFrame *addPage( const QString & ); - QFrame *addPage( const QString &, int, const QPixmap & ); + Q3Frame *addPage( const QString & ); + Q3Frame *addPage( const QString &, int, const QPixmap & ); void setMainWidget( QWidget *widget ); @@ -77,7 +79,7 @@ class KDialogBase : public KDialog bool showPage( int index ); void hideButtons(); - QFrame *plainPage(); + Q3Frame *plainPage(); signals: void user1Clicked(); @@ -128,8 +130,8 @@ class KDialogBase : public KDialog QWidget *mMainWidget; QTabWidget *mTabWidget; - QFrame *mPlainPage; - QBoxLayout *mTopLayout; + Q3Frame *mPlainPage; + Q3BoxLayout *mTopLayout; QPushButton *mUser1Button; QPushButton *mUser2Button; diff --git a/microkde/keditlistbox.cpp b/microkde/keditlistbox.cpp index 55b7784..257a44a 100644 --- a/microkde/keditlistbox.cpp +++ b/microkde/keditlistbox.cpp @@ -21,10 +21,13 @@ #include <qstringlist.h> #include <qpushbutton.h> #include <qlayout.h> -#include <qgroupbox.h> -#include <qlistbox.h> -#include <qwhatsthis.h> +#include <q3groupbox.h> +#include <q3listbox.h> +#include <q3whatsthis.h> #include <qlabel.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3StrList> #include <kcombobox.h> #include <kdebug.h> @@ -47,14 +50,14 @@ public: KEditListBox::KEditListBox(QWidget *parent, const char *name, bool checkAtEntering, int buttons ) - :QGroupBox(parent, name ) + :Q3GroupBox(parent, name ) { init( checkAtEntering, buttons ); } KEditListBox::KEditListBox(const QString& title, QWidget *parent, const char *name, bool checkAtEntering, int buttons) - :QGroupBox(title, parent, name ) + :Q3GroupBox(title, parent, name ) { init( checkAtEntering, buttons ); } @@ -62,7 +65,7 @@ KEditListBox::KEditListBox(const QString& title, QWidget *parent, KEditListBox::KEditListBox(const QString& title, const CustomEditor& custom, QWidget *parent, const char *name, bool checkAtEntering, int buttons) - :QGroupBox(title, parent, name ) + :Q3GroupBox(title, parent, name ) { m_lineEdit = custom.lineEdit(); init( checkAtEntering, buttons, custom.representationWidget() ); @@ -95,7 +98,7 @@ void KEditListBox::init( bool checkAtEntering, int buttons, QSizePolicy::MinimumExpanding)); QWidget * gb = this; - QGridLayout * grid = new QGridLayout(gb, 7 - lostButtons, 2, + Q3GridLayout * grid = new Q3GridLayout(gb, 7 - lostButtons, 2, KDialog::marginHint(), KDialog::spacingHint()); grid->addRowSpacing(0, fontMetrics().lineSpacing()); @@ -109,7 +112,7 @@ void KEditListBox::init( bool checkAtEntering, int buttons, else m_lineEdit=new KLineEdit(gb); - m_listBox = new QListBox(gb); + m_listBox = new Q3ListBox(gb); QWidget *editingWidget = representationWidget ? representationWidget : m_lineEdit; @@ -204,7 +207,7 @@ void KEditListBox::moveItemUp() return; } - QListBoxItem *selItem = m_listBox->item(selIndex); + Q3ListBoxItem *selItem = m_listBox->item(selIndex); m_listBox->takeItem(selItem); m_listBox->insertItem(selItem, selIndex-1); m_listBox->setCurrentItem(selIndex - 1); @@ -227,7 +230,7 @@ void KEditListBox::moveItemDown() return; } - QListBoxItem *selItem = m_listBox->item(selIndex); + Q3ListBoxItem *selItem = m_listBox->item(selIndex); m_listBox->takeItem(selItem); m_listBox->insertItem(selItem, selIndex+1); m_listBox->setCurrentItem(selIndex + 1); @@ -349,14 +352,16 @@ void KEditListBox::insertStringList(const QStringList& list, int index) m_listBox->insertStringList(list,index); } -void KEditListBox::insertStrList(const QStrList* list, int index) +void KEditListBox::insertStrList(const Q3StrList* list, int index) { - m_listBox->insertStrList(list,index); + for(Q3StrList::const_iterator i=list->begin();i!=list->end();++i) + m_listBox->insertItem(*i,index++); } -void KEditListBox::insertStrList(const QStrList& list, int index) +void KEditListBox::insertStrList(const Q3StrList& list, int index) { - m_listBox->insertStrList(list,index); + for(Q3StrList::const_iterator i=list.begin();i!=list.end();++i) + m_listBox->insertItem(*i,index++); } void KEditListBox::insertStrList(const char ** list, int numStrings, int index) diff --git a/microkde/keditlistbox.h b/microkde/keditlistbox.h index 130d933..e43d958 100644 --- a/microkde/keditlistbox.h +++ b/microkde/keditlistbox.h @@ -20,8 +20,10 @@ #ifndef KEDITLISTBOX_H #define KEDITLISTBOX_H -#include <qgroupbox.h> -#include <qlistbox.h> +#include <q3groupbox.h> +#include <q3listbox.h> +//Added by qt3to4: +#include <Q3StrList> class KLineEdit; class KComboBox; @@ -36,7 +38,7 @@ class KEditListBoxPrivate; * items into the listbox and pushbuttons to add and remove * items from the listbox and two buttons to move items up and down. */ -class KEditListBox : public QGroupBox +class KEditListBox : public Q3GroupBox { Q_OBJECT @@ -126,7 +128,7 @@ public: /** * Return a pointer to the embedded QListBox. */ - QListBox* listBox() const { return m_listBox; } + Q3ListBox* listBox() const { return m_listBox; } /** * Return a pointer to the embedded QLineEdit. */ @@ -159,11 +161,11 @@ public: /** * See @ref QListBox::insertStringList() */ - void insertStrList(const QStrList* list, int index=-1); + void insertStrList(const Q3StrList* list, int index=-1); /** * See @ref QListBox::insertStrList() */ - void insertStrList(const QStrList& list, int index=-1); + void insertStrList(const Q3StrList& list, int index=-1); /** * See @ref QListBox::insertStrList() */ @@ -207,7 +209,7 @@ public: void typedSomething(const QString& text); private: - QListBox *m_listBox; + Q3ListBox *m_listBox; QPushButton *servUpButton, *servDownButton; QPushButton *servNewButton, *servRemoveButton; KLineEdit *m_lineEdit; diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp index 383e711..c1bfdef 100644 --- a/microkde/kfiledialog.cpp +++ b/microkde/kfiledialog.cpp @@ -4,6 +4,8 @@ #include <qdir.h> #include <qfileinfo.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #ifndef DESKTOP_VERSION //US orig#include <ofileselector.h> @@ -13,7 +15,7 @@ QString KFileDialog::getSaveFileName( const QString & fn, { QString retfile = ""; QDialog dia ( par, "input-dialog", true ); - QVBoxLayout lay( &dia ); + Q3VBoxLayout lay( &dia ); lay.setMargin(7); lay.setSpacing(7); QString file = fn; @@ -42,7 +44,7 @@ QString KFileDialog::getOpenFileName( const QString & fn, QString retfile = ""; QDialog dia ( par, "input-dialog", true ); // QLineEdit lab ( &dia ); - QVBoxLayout lay( &dia ); + Q3VBoxLayout lay( &dia ); lay.setMargin(7); lay.setSpacing(7); QString file = fn; @@ -66,23 +68,23 @@ QString KFileDialog::getExistingDirectory( const QString & fn, } #else -#include <qfiledialog.h> +#include <q3filedialog.h> QString KFileDialog::getSaveFileName( const QString & fn, const QString & cap , QWidget * par ) { - return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); + return Q3FileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); } QString KFileDialog::getOpenFileName( const QString & fn, const QString & cap, QWidget * par ) { - return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); + return Q3FileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); } QString KFileDialog::getExistingDirectory( const QString & fn, const QString & cap, QWidget * par ) { - return QFileDialog::getExistingDirectory( fn, par, "exidtingdir", cap ); + return Q3FileDialog::getExistingDirectory( fn, par, "exidtingdir", cap ); } #endif diff --git a/microkde/kfontdialog.cpp b/microkde/kfontdialog.cpp index 174123c..f83c2a8 100644 --- a/microkde/kfontdialog.cpp +++ b/microkde/kfontdialog.cpp @@ -7,12 +7,14 @@ #include <qdialog.h> #include <qlayout.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3VBoxLayout> QFont KFontDialog::getFont( const QFont & f, bool & ok ) { #ifndef DESKTOP_VERSION QDialog d( 0, "fd", true );; OFontSelector s ( true, &d, "fontsel"); - QVBoxLayout l ( &d ); + Q3VBoxLayout l ( &d ); l.addWidget( &s ); s.setSelectedFont ( f ); QPushButton b ( "OK", &d ); diff --git a/microkde/kglobal.cpp b/microkde/kglobal.cpp index 53edd08..9cc5835 100644 --- a/microkde/kglobal.cpp +++ b/microkde/kglobal.cpp @@ -1,7 +1,8 @@ #include "kglobal.h" #include "kstandarddirs.h" -#include <qkeycode.h> +#include <qnamespace.h> #include <qapplication.h> +#include <QDesktopWidget> KLocale *KGlobal::mLocale = 0; KConfig *KGlobal::mConfig = 0; @@ -13,7 +14,7 @@ QString KGlobal::mAppName = "godot"; KLocale *KGlobal::locale() { if ( !mLocale ) { - ASSERT(mAppName); + Q_ASSERT(!mAppName.isEmpty()); mLocale = new KLocale();//mAppName); } diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index 2e483e9..1f08255 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp @@ -4,6 +4,7 @@ #include "kconfigbase.h" #include <qapplication.h> +#include <QDesktopWidget> #ifdef DESKTOP_VERSION QColor KGlobalSettings::mAlternate = QColor( 235, 235, 235 ); diff --git a/microkde/kiconloader.cpp b/microkde/kiconloader.cpp index 4842d71..e7f657d 100644 --- a/microkde/kiconloader.cpp +++ b/microkde/kiconloader.cpp @@ -4,6 +4,8 @@ #ifndef DESKTOP_VERSION_OEGEL #include <qdir.h> +//Added by qt3to4: +#include <QPixmap> QPixmap KIconLoader::loadIcon( const QString& name, KIcon::Group, int, int, QString *, bool ) const { @@ -14,14 +16,14 @@ QPixmap KIconLoader::loadIcon( const QString& name, KIcon::Group, int, // qDebug("KIconLoader::loadIcon %s -----------", file.latin1()); return pix; } -QIconSet KIconLoader::loadIconSet( const QString& name) const +QIcon KIconLoader::loadIconSet( const QString& name) const { QPixmap pixmapLoader; QString file; file = iconPath() + name+".png"; pixmapLoader.load( file ); //qDebug("KIconLoader::loadIconSet: %s ************", file.latin1() ); - QIconSet is ( pixmapLoader ); + QIcon is ( pixmapLoader ); return is; } @@ -77,12 +79,12 @@ QPixmap KIconLoader::loadIcon( const QString& name, KIcon::Group, int, return p; } -QIconSet KIconLoader::loadIconSet( const QString& name) const +QIcon KIconLoader::loadIconSet( const QString& name) const { QString px = this->iconPath() + "/" + name; - QIconSet is ;//= Resource::loadIconSet( px ); - QIconSet* isPtr = 0;//LR&is; + QIcon is ;//= Resource::loadIconSet( px ); + QIcon* isPtr = 0;//LR&is; if (isPtr == 0) qDebug("KIconLoader::loadIconSet: %s not foun", px.latin1()); diff --git a/microkde/kiconloader.h b/microkde/kiconloader.h index 68fec4e..2abb667 100644 --- a/microkde/kiconloader.h +++ b/microkde/kiconloader.h @@ -4,7 +4,7 @@ #include <qpixmap.h> #include <qstring.h> //US -#include <qiconset.h> +#include <qicon.h> class KIcon { @@ -34,7 +34,7 @@ class KIconLoader QString setIconPath( const QString &); QString iconPath( /*US const QString &, int */) const; QString iconPath( const QString &, int ) const; - QIconSet loadIconSet( const QString &name) const; + QIcon loadIconSet( const QString &name) const; //US to make this class usable for different applications, we have to add a iconpathvariable private: 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 @@ -27,6 +27,8 @@ //US #include <qtooltip.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <QPixmap> //US #include <kaccel.h> //US #include <kcombobox.h> @@ -182,7 +184,7 @@ KURLRequester::KURLRequester( QWidget *editWidget, QWidget *parent, */ KURLRequester::KURLRequester( QWidget *parent, const char *name ) - : QHBox( parent, name ) + : Q3HBox( parent, name ) { d = new KURLRequesterPrivate; init(); @@ -191,7 +193,7 @@ KURLRequester::KURLRequester( QWidget *parent, const char *name ) KURLRequester::KURLRequester( const QString& url, QWidget *parent, const char *name ) - : QHBox( parent, name ) + : Q3HBox( parent, name ) { d = new KURLRequesterPrivate; init(); @@ -216,8 +218,8 @@ void KURLRequester::init() d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" ); myButton = new KURLDragPushButton( this, "kfile button"); - QIconSet iconSet = SmallIconSet("fileopen"); - QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal ); + QIcon iconSet = SmallIconSet("fileopen"); + QPixmap pixMap = iconSet.pixmap( QIcon::Small, QIcon::Normal ); myButton->setIconSet( iconSet ); myButton->setFixedSize( pixMap.width()+8, pixMap.height()+8 ); //US QToolTip::add(myButton, i18n("Open file dialog")); 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 @@ -20,7 +20,7 @@ #ifndef KURLREQUESTER_H #define KURLREQUESTER_H -#include <qhbox.h> +#include <q3hbox.h> #include <keditlistbox.h> //US #include <kfile.h> @@ -53,7 +53,7 @@ class QTimer; * @short A widget to request a filename/url from the user * @author Carsten Pfeiffer <pfeiffer@kde.org> */ -class KURLRequester : public QHBox +class KURLRequester : public Q3HBox { Q_OBJECT Q_PROPERTY( QString url READ url WRITE setURL ) 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 @@ -52,11 +52,13 @@ $Id$ #include <assert.h> #include <qdir.h> #include <qfile.h> -#include <qintdict.h> -#include <qptrlist.h> +#include <q3intdict.h> +#include <q3ptrlist.h> #include <qsocketnotifier.h> #include <qstringlist.h> #include <qtimer.h> +//Added by qt3to4: +#include <Q3CString> #include <kapplication.h> #include <kdebug.h> @@ -184,7 +186,7 @@ KDirWatchPrivate::KDirWatchPrivate() //US m_nfsPollInterval = config.readNumEntry("NFSPollInterval", 5000); //US m_PollInterval = config.readNumEntry("PollInterval", 500); KConfig *config = KGlobal::config(); - KConfigGroupSaver saver( config, QCString("DirWatch") ); + KConfigGroupSaver saver( config, Q3CString("DirWatch") ); m_nfsPollInterval = config->readNumEntry("NFSPollInterval", 5000); m_PollInterval = config->readNumEntry("PollInterval", 500); @@ -731,7 +733,7 @@ void KDirWatchPrivate::removeEntry( KDirWatch* instance, */ void KDirWatchPrivate::removeEntries( KDirWatch* instance ) { - QPtrList<Entry> list; + Q3PtrList<Entry> list; int minfreq = 3600000; // put all entries where instance is a client in list @@ -1007,7 +1009,7 @@ void KDirWatchPrivate::slotRescan() delayRemove = true; #ifdef HAVE_DNOTIFY - QPtrList<Entry> dList, cList; + Q3PtrList<Entry> dList, cList; // for DNotify method, if (rescan_all) 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 @@ -18,7 +18,7 @@ $Id$ #include <fam.h> #endif -#include <qptrlist.h> +#include <q3ptrlist.h> #include <kdirwatch.h> @@ -58,9 +58,9 @@ public: entryMode m_mode; bool isDir; // instances interested in events - QPtrList<Client> m_clients; + Q3PtrList<Client> m_clients; // nonexistent entries of this directory - QPtrList<Entry> m_entries; + Q3PtrList<Entry> m_entries; QString path; int msecLeft, freq; @@ -124,7 +124,7 @@ private: bool useStat(Entry*); bool delayRemove; - QPtrList<Entry> removeList; + Q3PtrList<Entry> removeList; #ifdef HAVE_FAM QSocketNotifier *sn; @@ -141,7 +141,7 @@ private: int mPipe[2]; QTimer mTimer; QSocketNotifier *mSn; - QIntDict<Entry> fd_Entry; + Q3IntDict<Entry> fd_Entry; static void dnotify_handler(int, siginfo_t *si, void *); static void dnotify_sigio_handler(int, siginfo_t *si, void *); diff --git a/microkde/klineedit.h b/microkde/klineedit.h index 70c72d1..9eb749d 100644 --- a/microkde/klineedit.h +++ b/microkde/klineedit.h @@ -2,6 +2,8 @@ #define MINIKDE_KLINEEDIT_H #include <qlineedit.h> +//Added by qt3to4: +#include <QKeyEvent> #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> diff --git a/microkde/klineeditdlg.h b/microkde/klineeditdlg.h index 68e9252..d0004cd 100644 --- a/microkde/klineeditdlg.h +++ b/microkde/klineeditdlg.h @@ -7,6 +7,8 @@ #include <qlabel.h> #include <qdialog.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3VBoxLayout> class KLineEditDlg : public QDialog { @@ -15,7 +17,7 @@ class KLineEditDlg : public QDialog QDialog( parent,"lineedit", true ) { QLabel* lab = new QLabel( text, this ); mEdit = new KLineEdit( this ); - QVBoxLayout* vl = new QVBoxLayout( this ); + Q3VBoxLayout* vl = new Q3VBoxLayout( this ); vl->setSpacing(5); vl->setMargin(7); vl->addWidget( lab ); 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 @@ -25,14 +25,17 @@ #include <kglobal.h> #include <kmessagebox.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlabel.h> #include <qlayout.h> #include <qpushbutton.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qcheckbox.h> -#include <qscrollview.h> +#include <q3scrollview.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3Frame> #include <kbuttonbox.h> #include <kdialog.h> @@ -55,14 +58,14 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, //US resize( 250, 240 ); resize( KMIN(KGlobal::getDesktopWidth(), 250), KMIN(KGlobal::getDesktopHeight(), 240)); - QFrame *main; + Q3Frame *main; main = plainPage(); - QVBoxLayout *mainLayout = new QVBoxLayout( main, 0, spacingHint() ); + Q3VBoxLayout *mainLayout = new Q3VBoxLayout( main, 0, spacingHint() ); - QGroupBox *generalGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); + Q3GroupBox *generalGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main ); generalGroupBox->layout()->setSpacing( spacingHint() ); generalGroupBox->setTitle( i18n( "General Settings" ) ); @@ -82,7 +85,7 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, mainLayout->addWidget( generalGroupBox ); - QGroupBox *resourceGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); + Q3GroupBox *resourceGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main ); resourceGroupBox->layout()->setSpacing( spacingHint()); resourceGroupBox->setTitle( i18n( "%1 Resource Settings" ) .arg( factory->typeName( resource->type() ) ) ); 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 @@ -28,7 +28,7 @@ Copyright (c) 2004 Ulf Schenk $Id$ */ -#include <qgroupbox.h> +#include <q3groupbox.h> #ifdef DESKTOP_VERSION #include <qinputdialog.h> @@ -37,6 +37,10 @@ $Id$ #endif #include <qlabel.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3ValueList> +#include <Q3VBoxLayout> #include <kapplication.h> #include <kcombobox.h> #include <kdebug.h> @@ -61,11 +65,11 @@ $Id$ using namespace KRES; -class ConfigViewItem : public QCheckListItem +class ConfigViewItem : public Q3CheckListItem { public: - ConfigViewItem( QListView *parent, Resource* resource ) : - QCheckListItem( parent, resource->resourceName(), CheckBox ), + ConfigViewItem( Q3ListView *parent, Resource* resource ) : + Q3CheckListItem( parent, resource->resourceName(), CheckBox ), mResource( resource ), mIsStandard( false ) { @@ -97,13 +101,13 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name ) { setCaption( i18n( "Resource Configuration" ) ); - QVBoxLayout *mainLayout = new QVBoxLayout( this ); + Q3VBoxLayout *mainLayout = new Q3VBoxLayout( this ); - QGroupBox *groupBox = new QGroupBox( i18n( "Resources" ), this ); + Q3GroupBox *groupBox = new Q3GroupBox( i18n( "Resources" ), this ); groupBox->setColumnLayout(0, Qt::Vertical ); groupBox->layout()->setSpacing( 3 ); groupBox->layout()->setMargin( 5 ); - QGridLayout *groupBoxLayout = new QGridLayout( groupBox->layout(), 4, 2 ); + Q3GridLayout *groupBoxLayout = new Q3GridLayout( groupBox->layout(), 4, 2 ); //US mFamilyCombo = new KComboBox( false, groupBox ); mFamilyCombo = new KComboBox( groupBox ); @@ -145,8 +149,8 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name ) SLOT( slotFamilyChanged( int ) ) ); connect( mListView, SIGNAL( selectionChanged() ), SLOT( slotSelectionChanged() ) ); - connect( mListView, SIGNAL( clicked( QListViewItem * ) ), - SLOT( slotItemClicked( QListViewItem * ) ) ); + connect( mListView, SIGNAL( clicked( Q3ListViewItem * ) ), + SLOT( slotItemClicked( Q3ListViewItem * ) ) ); mLastItem = 0; @@ -159,7 +163,7 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name ) ConfigPage::~ConfigPage() { - QValueList<ResourcePageInfo>::Iterator it; + Q3ValueList<ResourcePageInfo>::Iterator it; for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) { (*it).mManager->removeListener( this ); delete (*it).mManager; @@ -230,7 +234,7 @@ void ConfigPage::save() { saveResourceSettings(); - QValueList<ResourcePageInfo>::Iterator it; + Q3ValueList<ResourcePageInfo>::Iterator it; for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) (*it).mManager->writeConfig( (*it).mConfig ); @@ -341,7 +345,7 @@ void ConfigPage::slotAdd() // as standard resource if ( !resource->readOnly() ) { bool onlyReadOnly = true; - QListViewItem *it = mListView->firstChild(); + Q3ListViewItem *it = mListView->firstChild(); while ( it != 0 ) { ConfigViewItem *confIt = static_cast<ConfigViewItem*>( it ); if ( !confIt->readOnly() && confIt != item ) @@ -366,7 +370,7 @@ void ConfigPage::slotRemove() if ( !mCurrentManager ) return; - QListViewItem *item = mListView->currentItem(); + Q3ListViewItem *item = mListView->currentItem(); ConfigViewItem *confItem = static_cast<ConfigViewItem*>( item ); if ( !confItem ) @@ -393,7 +397,7 @@ void ConfigPage::slotEdit() if ( !mCurrentManager ) return; - QListViewItem *item = mListView->currentItem(); + Q3ListViewItem *item = mListView->currentItem(); ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item ); if ( !configItem ) return; @@ -435,7 +439,7 @@ void ConfigPage::slotStandard() return; } - QListViewItem *it = mListView->firstChild(); + Q3ListViewItem *it = mListView->firstChild(); while ( it != 0 ) { ConfigViewItem *configItem = static_cast<ConfigViewItem*>( it ); if ( configItem->standard() ) @@ -482,7 +486,7 @@ void ConfigPage::resourceDeleted( Resource* resource ) qDebug("ConfigPage::resourceDeleted : %s", resource->resourceName().latin1()); } -void ConfigPage::slotItemClicked( QListViewItem *item ) +void ConfigPage::slotItemClicked( Q3ListViewItem *item ) { ConfigViewItem *configItem = static_cast<ConfigViewItem *>( item ); if ( !configItem ) return; @@ -504,7 +508,7 @@ void ConfigPage::saveResourceSettings() if ( mCurrentManager ) { - QListViewItem *item = mListView->firstChild(); + Q3ListViewItem *item = mListView->firstChild(); while ( item ) { ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item ); 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 @@ -25,13 +25,15 @@ #include <qstringlist.h> #include <qwidget.h> +//Added by qt3to4: +#include <Q3ValueList> #include "manager.h" class KComboBox; class KListView; -class QListViewItem; +class Q3ListViewItem; class QPushButton; @@ -73,7 +75,7 @@ class ConfigPage : public QWidget, public ManagerListener<Resource> virtual void resourceDeleted( Resource* resource ); protected slots: - void slotItemClicked( QListViewItem * ); + void slotItemClicked( Q3ListViewItem * ); signals: void changed( bool ); @@ -86,7 +88,7 @@ class ConfigPage : public QWidget, public ManagerListener<Resource> KConfig* mConfig; QString mFamily; QStringList mFamilyMap; - QValueList<ResourcePageInfo> mInfoMap; + Q3ValueList<ResourcePageInfo> mInfoMap; KComboBox* mFamilyCombo; KListView* mListView; @@ -95,7 +97,7 @@ class ConfigPage : public QWidget, public ManagerListener<Resource> QPushButton* mEditButton; QPushButton* mStandardButton; - QListViewItem* mLastItem; + Q3ListViewItem* mLastItem; static const QString syncfamily; }; 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 @@ -41,8 +41,8 @@ #endif using namespace KRES; -QDict<Factory> *Factory::mSelves = 0; -static KStaticDeleter< QDict<Factory> > staticDeleter; +Q3Dict<Factory> *Factory::mSelves = 0; +static KStaticDeleter< Q3Dict<Factory> > staticDeleter; Factory *Factory::self( const QString& resourceFamily) { @@ -51,7 +51,7 @@ Factory *Factory::self( const QString& resourceFamily) Factory *factory = 0; if ( !mSelves ) { - mSelves = staticDeleter.setObject( new QDict<Factory> ); + mSelves = staticDeleter.setObject( new Q3Dict<Factory> ); } factory = mSelves->find( resourceFamily ); 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 @@ -24,7 +24,7 @@ #ifndef KRESOURCES_FACTORY_H #define KRESOURCES_FACTORY_H -#include <qdict.h> +#include <q3dict.h> #include <qstring.h> #include <kconfig.h> @@ -114,7 +114,7 @@ class Factory Factory( const QString& resourceFamily); private: - static QDict<Factory> *mSelves; + static Q3Dict<Factory> *mSelves; QString mResourceFamily; //US QMap<QString, KService::Ptr> mTypeMap; 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 @@ -20,6 +20,9 @@ */ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3Frame> //US #include <kaboutdata.h> //US #include <kgenericfactory.h> @@ -40,9 +43,9 @@ KCMKResources::KCMKResources( QWidget *parent, const char *name, const QStringLi : KDialogBase( parent, name, true, i18n( "Configure Resources" ), Ok|Cancel, Ok, true ) { - QFrame *main = plainPage(); + Q3Frame *main = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( main ); + Q3VBoxLayout *layout = new Q3VBoxLayout( main ); mConfigPage = new KRES::ConfigPage( main ); layout->addWidget( mConfigPage ); 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 @@ -32,8 +32,10 @@ $Id$ #ifndef KRESOURCES_MANAGER_H #define KRESOURCES_MANAGER_H -#include <qdict.h> +#include <q3dict.h> #include <qstringlist.h> +//Added by qt3to4: +#include <Q3PtrList> #include "factory.h" #include "managerimpl.h" @@ -175,7 +177,7 @@ class Manager : private ManagerImplListener mImpl = new ManagerImpl( family ); mImpl->setListener( this ); - mListeners = new QPtrList<ManagerListener<T> >; + mListeners = new Q3PtrList<ManagerListener<T> >; } virtual ~Manager() @@ -330,7 +332,7 @@ class Manager : private ManagerImplListener private: ManagerImpl *mImpl; Factory *mFactory; - QPtrList<ManagerListener<T> > *mListeners; + Q3PtrList<ManagerListener<T> > *mListeners; }; } 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 @@ -35,6 +35,8 @@ $Id$ #include <kconfig.h> #include <kstandarddirs.h> #include <qfile.h> +//Added by qt3to4: +#include <Q3PtrList> #include "resource.h" #include "factory.h" @@ -232,9 +234,9 @@ Resource::List *ManagerImpl::resourceList() return &mResources; } -QPtrList<Resource> ManagerImpl::resources() +Q3PtrList<Resource> ManagerImpl::resources() { - QPtrList<Resource> result; + Q3PtrList<Resource> result; Resource::List::ConstIterator it; for ( it = mResources.begin(); it != mResources.end(); ++it ) { @@ -243,9 +245,9 @@ QPtrList<Resource> ManagerImpl::resources() return result; } -QPtrList<Resource> ManagerImpl::resources( bool active ) +Q3PtrList<Resource> ManagerImpl::resources( bool active ) { - QPtrList<Resource> result; + Q3PtrList<Resource> result; Resource::List::ConstIterator it; for ( it = mResources.begin(); it != mResources.end(); ++it ) { 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 @@ -32,8 +32,8 @@ $Id$ #define KRESOURCES_MANAGERIMPL_H #include <qstring.h> -#include <qptrlist.h> -#include <qdict.h> +#include <q3ptrlist.h> +#include <q3dict.h> //US #include <qobject.h> @@ -81,10 +81,10 @@ class ManagerImpl : public QObject Resource::List *resourceList(); - QPtrList<Resource> resources(); + Q3PtrList<Resource> resources(); // Get only active or passive resources - QPtrList<Resource> resources( bool active ); + Q3PtrList<Resource> resources( bool active ); QStringList resourceNames(); 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 @@ -28,7 +28,7 @@ #include <qmutex.h> #endif //QT_THREAD_SUPPORT -#include <qvaluelist.h> +#include <q3valuelist.h> #include <qwidget.h> #include <qobject.h> @@ -239,7 +239,7 @@ class Resource : public QObject Q_OBJECT public: - typedef QValueList<Resource *> List; + typedef Q3ValueList<Resource *> List; /** * Constructor. Construct resource from config. 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 @@ -34,9 +34,13 @@ //US #include <kglobal.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qlayout.h> -#include <qgroupbox.h> +#include <q3groupbox.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3Frame> +#include <Q3PtrList> #include "resource.h" @@ -46,7 +50,7 @@ using namespace KRES; //US I am using KBaseDialog instead of KDialog //US : KDialog( parent, name, true ) -SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, +SelectDialog::SelectDialog( Q3PtrList<Resource> list, QWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Resource Selection" ), Help | Ok | Cancel, Ok, true) @@ -57,7 +61,7 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, resize( KMIN(KGlobal::getDesktopWidth(), 300), KMIN(KGlobal::getDesktopHeight(), 200) ); //US - QFrame *main = plainPage(); + Q3Frame *main = plainPage(); /*US QVBoxLayout *layout = new QVBoxLayout( main ); mConfigPage = new KRES::ConfigPage( main ); @@ -65,15 +69,15 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, */ //US QVBoxLayout *mainLayout = new QVBoxLayout( this ); - QVBoxLayout *mainLayout = new QVBoxLayout( main ); + Q3VBoxLayout *mainLayout = new Q3VBoxLayout( main ); mainLayout->setMargin( marginHint() ); //US QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, this ); - QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, main ); + Q3GroupBox *groupBox = new Q3GroupBox( 2, Qt::Horizontal, main ); groupBox->setTitle( i18n( "Resources" ) ); //US mResourceId = new KListBox( groupBox ); - mResourceId = new QListBox( groupBox ); + mResourceId = new Q3ListBox( groupBox ); mainLayout->addWidget( groupBox ); @@ -101,7 +105,7 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, } mResourceId->setCurrentItem( 0 ); - connect( mResourceId, SIGNAL(returnPressed(QListBoxItem*)), + connect( mResourceId, SIGNAL(returnPressed(Q3ListBoxItem*)), SLOT(accept()) ); } @@ -113,7 +117,7 @@ Resource *SelectDialog::resource() return 0; } -Resource *SelectDialog::getResource( QPtrList<Resource> list, QWidget *parent ) +Resource *SelectDialog::getResource( Q3PtrList<Resource> list, QWidget *parent ) { if ( list.count() == 0 ) { KMessageBox::error( parent, i18n( "There is no resource available!" ) ); 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 @@ -25,13 +25,13 @@ #define KRESOURCES_SELECTDIALOG_H #include <qobject.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qmap.h> #include <kdialogbase.h> //US class KListBox; -class QListBox; +class Q3ListBox; namespace KRES { @@ -62,7 +62,7 @@ class SelectDialog : KDialogBase * @param parent The parent widget * @param name The name of the dialog */ - SelectDialog( QPtrList<Resource> list, QWidget *parent = 0, + SelectDialog( Q3PtrList<Resource> list, QWidget *parent = 0, const char *name = 0); // ~SelectDialog(); @@ -76,11 +76,11 @@ class SelectDialog : KDialogBase * Open a dialog showing the available resources and return the resource the * user has selected. Returns 0, if the dialog was canceled. */ - static Resource *getResource( QPtrList<Resource> list, QWidget *parent = 0 ); + static Resource *getResource( Q3PtrList<Resource> list, QWidget *parent = 0 ); private: //US KListBox *mResourceId; - QListBox *mResourceId; + Q3ListBox *mResourceId; QMap<int, Resource*> mResourceMap; }; diff --git a/microkde/ksystemtray.cpp b/microkde/ksystemtray.cpp index 4f81d02..0d0045f 100644 --- a/microkde/ksystemtray.cpp +++ b/microkde/ksystemtray.cpp @@ -1,4 +1,7 @@ #include "ksystemtray.h" +//Added by qt3to4: +#include <QMouseEvent> +#include <QLabel> void KSystemTray::mousePressEvent( QMouseEvent *) { diff --git a/microkde/ksystemtray.h b/microkde/ksystemtray.h index f3e4f6a..6708c86 100644 --- a/microkde/ksystemtray.h +++ b/microkde/ksystemtray.h @@ -2,6 +2,8 @@ #define MICROKDE_KSYSTEMTRAY_H #include <qlabel.h> +//Added by qt3to4: +#include <QMouseEvent> class KSystemTray : public QLabel { diff --git a/microkde/ktempfile.cpp b/microkde/ktempfile.cpp index b9166bd..d61d22e 100644 --- a/microkde/ktempfile.cpp +++ b/microkde/ktempfile.cpp @@ -1,4 +1,4 @@ -#include <qtextstream.h> +#include <q3textstream.h> #include "ktempfile.h" @@ -19,7 +19,7 @@ QString KTempFile::name() return QString::null; } -QTextStream *KTempFile::textStream() +Q3TextStream *KTempFile::textStream() { return 0; } diff --git a/microkde/ktempfile.h b/microkde/ktempfile.h index 20dfa82..1ac7258 100644 --- a/microkde/ktempfile.h +++ b/microkde/ktempfile.h @@ -3,7 +3,7 @@ #include <qstring.h> -class QTextStream; +class Q3TextStream; class KTempFile { @@ -14,7 +14,7 @@ class KTempFile void setAutoDelete( bool ); QString name(); - QTextStream *textStream(); + Q3TextStream *textStream(); }; #endif diff --git a/microkde/ktextedit.cpp b/microkde/ktextedit.cpp index 4dd6875..d74706b 100644 --- a/microkde/ktextedit.cpp +++ b/microkde/ktextedit.cpp @@ -2,10 +2,12 @@ #include <ktextedit.h> #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> +//Added by qt3to4: +#include <QMouseEvent> #endif -KTextEdit::KTextEdit ( QWidget *parent ) : QMultiLineEdit( parent ) +KTextEdit::KTextEdit ( QWidget *parent ) : Q3MultiLineEdit( parent ) { mAllowPopupMenu = false; mMouseDown = false; @@ -17,14 +19,14 @@ KTextEdit::KTextEdit ( QWidget *parent ) : QMultiLineEdit( parent ) void KTextEdit::mousePressEvent(QMouseEvent *e) { - if ( e->button() == LeftButton ) { + if ( e->button() == Qt::LeftButton ) { mAllowPopupMenu = true; mYMousePos = mapToGlobal( (e->pos())).y(); mXMousePos = mapToGlobal( (e->pos())).x(); } - if ( e->button() == RightButton && !mAllowPopupMenu ) + if ( e->button() == Qt::RightButton && !mAllowPopupMenu ) return; - if ( e->button() == LeftButton ) { + if ( e->button() == Qt::LeftButton ) { if ( hasMarkedText () ) mIgnoreMark = !mIgnoreMark; if ( mIgnoreMark && hasMarkedText () ) { @@ -32,12 +34,12 @@ void KTextEdit::mousePressEvent(QMouseEvent *e) return ; } } - QMultiLineEdit::mousePressEvent( e ); + Q3MultiLineEdit::mousePressEvent( e ); } void KTextEdit::mouseReleaseEvent(QMouseEvent *e) { - QMultiLineEdit::mouseReleaseEvent(e); + Q3MultiLineEdit::mouseReleaseEvent(e); } void KTextEdit::mouseMoveEvent(QMouseEvent *e) @@ -48,6 +50,6 @@ void KTextEdit::mouseMoveEvent(QMouseEvent *e) if ( diff2 < 0 ) diff2 = -diff2; if ( diff+ diff2 > 20 ) mAllowPopupMenu = false; - QMultiLineEdit::mouseMoveEvent(e); + Q3MultiLineEdit::mouseMoveEvent(e); } diff --git a/microkde/ktextedit.h b/microkde/ktextedit.h index 87c0602..b7c8924 100644 --- a/microkde/ktextedit.h +++ b/microkde/ktextedit.h @@ -1,9 +1,11 @@ #ifndef MICROKDE_KTEXTEDIT_H #define MICROKDE_KTEXTEDIT_H -#include <qmultilineedit.h> +#include <q3multilineedit.h> +//Added by qt3to4: +#include <QMouseEvent> -class KTextEdit : public QMultiLineEdit +class KTextEdit : public Q3MultiLineEdit { public: KTextEdit( QWidget *parent ) ; diff --git a/microkde/kurl.cpp b/microkde/kurl.cpp index 2574e25..122ad71 100644 --- a/microkde/kurl.cpp +++ b/microkde/kurl.cpp @@ -34,13 +34,15 @@ #else #include <unistd.h> #endif -#include <qurl.h> +#include <q3url.h> #include <qdir.h> #include <qstringlist.h> #include <qregexp.h> //US#include <qstylesheet.h> #include <qmap.h> #include <qtextcodec.h> +//Added by qt3to4: +#include <Q3CString> static const QString fileProt = "file"; @@ -57,7 +59,7 @@ static QString encode( const QString& segment, bool encode_slash, int encoding_h else encode_string = "<>#@\"&%?={}|^~[]\'`\\:+"; - QCString local; + Q3CString local; if (encoding_hint==0) local = segment.local8Bit(); else @@ -100,7 +102,7 @@ static QString encode( const QString& segment, bool encode_slash, int encoding_h } else - new_segment[ new_length++ ] = local[i]; + new_segment[ new_length++ ] = character; } QString result = QString(new_segment, new_length); @@ -205,7 +207,7 @@ static void decode( const QString& segment, QString &decoded, QString &encoded, if (!textCodec) textCodec = QTextCodec::codecForLocale(); - QCString csegment = textCodec->fromUnicode(segment); + Q3CString csegment = textCodec->fromUnicode(segment); // Check if everything went ok if (textCodec->toUnicode(csegment) != segment) { @@ -278,7 +280,7 @@ static void decode( const QString& segment, QString &decoded, QString &encoded, array.setRawData(new_segment, new_length); decoded = textCodec->toUnicode( array, new_length ); array.resetRawData(new_segment, new_length); - QCString validate = textCodec->fromUnicode(decoded); + Q3CString validate = textCodec->fromUnicode(decoded); if (strcmp(validate.data(), new_segment) != 0) { @@ -419,7 +421,7 @@ KURL::KURL( const char * url, int encoding_hint ) parse( QString::fromLatin1(url), encoding_hint ); } -KURL::KURL( const QCString& url, int encoding_hint ) +KURL::KURL( const Q3CString& url, int encoding_hint ) { reset(); parse( QString::fromLatin1(url), encoding_hint ); @@ -460,7 +462,7 @@ QDataStream & operator>> (QDataStream & s, KURL & a) } #ifndef QT_NO_NETWORKPROTOCOL -KURL::KURL( const QUrl &u ) +KURL::KURL( const Q3Url &u ) { *this = u; } @@ -589,13 +591,13 @@ void KURL::parse( const QString& _url, int encoding_hint ) QChar x = buf[pos++]; if ( x == '/' ) goto Node9; - if ( !isalpha( (int)x ) ) + if ( !x.isLetter() ) goto NodeErr; // Node 2: Accept any amount of (alpha|digit|'+'|'-') // '.' is not currently accepted, because current KURL may be confused. // Proceed with :// :/ or : - while( pos < len && (isalpha((int)buf[pos]) || isdigit((int)buf[pos]) || + while( pos < len && ( buf[pos].isLetter() || buf[pos].isDigit() || buf[pos] == '+' || buf[pos] == '-')) pos++; if ( pos+2 < len && buf[pos] == ':' && buf[pos+1] == '/' && buf[pos+2] == '/' ) @@ -769,11 +771,11 @@ void KURL::parse( const QString& _url, int encoding_hint ) if ( pos == len ) goto NodeErr; start = pos; - if ( !isdigit( buf[pos++] ) ) + if ( !buf[pos++].isDigit() ) goto NodeErr; // Node 8b: Accept any amount of digits - while( pos < len && isdigit( buf[pos] ) ) pos++; + while( pos < len && buf[pos].isDigit() ) pos++; port = QString( buf + start, pos - start ); m_iPort = port.toUShort(); if ( pos == len ) @@ -848,7 +850,7 @@ KURL& KURL::operator=( const char * _url ) } #ifndef QT_NO_NETWORKPROTOCOL -KURL& KURL::operator=( const QUrl & u ) +KURL& KURL::operator=( const Q3Url & u ) { m_strProtocol = u.protocol(); m_strUser = u.user(); @@ -1374,7 +1376,7 @@ KURL KURL::join( const KURL::List & lst ) KURL u(*it); if (it != first) { - if (!u.m_strRef_encoded) u.m_strRef_encoded = tmp.url(); + if (u.m_strRef_encoded.isEmpty()) u.m_strRef_encoded = tmp.url(); else u.m_strRef_encoded += "#" + tmp.url(); // Support more than one suburl thingy } tmp = u; @@ -1418,7 +1420,7 @@ QString KURL::fileName( bool _strip_trailing_slash ) const // unencoded one. int i = m_strPath_encoded.findRev( '/', len - 1 ); QString fileName_encoded = m_strPath_encoded.mid(i+1); - n += fileName_encoded.contains("%2f", false); + n += fileName_encoded.count("%2f", Qt::CaseInsensitive); } int i = len; do { diff --git a/microkde/kurl.h b/microkde/kurl.h index cd65a1c..016eb24 100644 --- a/microkde/kurl.h +++ b/microkde/kurl.h @@ -21,9 +21,11 @@ #define __kurl_h__ "$Id$" #include <qstring.h> -#include <qvaluelist.h> +#include <q3valuelist.h> +//Added by qt3to4: +#include <Q3CString> -class QUrl; +class Q3Url; class QStringList; template <typename K, typename V> class QMap; @@ -64,7 +66,7 @@ public: * @see KURL * @see QValueList */ - class List : public QValueList<KURL> + class List : public Q3ValueList<KURL> { public: /** @@ -135,7 +137,7 @@ public: * @param encoding_hint MIB of original encoding of URL. * @see QTextCodec::mibEnum() */ - KURL( const QCString& url, int encoding_hint = 0 ); + KURL( const Q3CString& url, int encoding_hint = 0 ); /** * Copy constructor. * @param u the KURL to copy @@ -145,7 +147,7 @@ public: * Converts from a @ref QUrl. * @param u the QUrl */ - KURL( const QUrl &u ); + KURL( const Q3Url &u ); /** * Constructor allowing relative URLs. * @@ -658,7 +660,7 @@ public: KURL& operator=( const KURL& _u ); KURL& operator=( const QString& _url ); KURL& operator=( const char * _url ); - KURL& operator=( const QUrl & u ); + KURL& operator=( const Q3Url & u ); bool operator==( const KURL& _u ) const; bool operator==( const QString& _u ) const; 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 @@ -19,10 +19,12 @@ */ -#include <qhbox.h> -#include <qvbox.h> +#include <q3hbox.h> +#include <q3vbox.h> #include <qcursor.h> #include <qlayout.h> +//Added by qt3to4: +#include <QPixmap> #include <klocale.h> #include <kglobal.h> @@ -73,7 +75,7 @@ void KCMultiDialog::slotDefault() int curPageIndex = activePageIndex(); - QPtrListIterator<KCModule> it(modules); + Q3PtrListIterator<KCModule> it(modules); for (; it.current(); ++it) { if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) @@ -91,7 +93,7 @@ void KCMultiDialog::accept() } void KCMultiDialog::slotApply() { - QPtrListIterator<KCModule> it(modules); + Q3PtrListIterator<KCModule> it(modules); for (; it.current(); ++it) (*it)->save(); clientChanged(false); @@ -105,7 +107,7 @@ void KCMultiDialog::slotOk() { qDebug("KCMultiDialog::slotOk clicked"); - QPtrListIterator<KCModule> it(modules); + Q3PtrListIterator<KCModule> it(modules); for (; it.current(); ++it) (*it)->save(); QDialog::accept(); @@ -153,9 +155,9 @@ void KCMultiDialog::addModule(const QString& path, bool withfallback) slotAboutToShow(page); } */ -QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) +Q3VBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) { - QVBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() ); + Q3VBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() ); return page; } 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 @@ -22,8 +22,8 @@ #ifndef KCMULTIDIALOG_H #define KCMULTIDIALOG_H -#include <qptrlist.h> -#include <qptrdict.h> +#include <q3ptrlist.h> +#include <q3ptrdict.h> #include <kdialogbase.h> #include <kjanuswidget.h> @@ -75,7 +75,7 @@ public: //US special method for microkde. We do not want to load everything dynamically. void addModule(KCModule* module );//, const QString& modulename, const QString& iconname); - QVBox* getNewVBoxPage(const QString & modulename) ; + Q3VBox* getNewVBoxPage(const QString & modulename) ; bool showPage( int index ); @@ -133,7 +133,7 @@ private: bool withfallback; }; */ - QPtrList<KCModule> modules; + Q3PtrList<KCModule> modules; /* QPtrDict<LoadInfo> moduleDict; QString _docPath; diff --git a/microkde/microkde.pro b/microkde/microkde.pro index 7120bdd..4ff06a3 100644 --- a/microkde/microkde.pro +++ b/microkde/microkde.pro @@ -6,7 +6,7 @@ include( ../variables.pri ) INCLUDEPATH += . ../ ../kabc ./kdecore ./kdeui ./kio/kfile ./kio/kio #LIBS += -lqtcompat -TARGET = microkde +TARGET = xmicrokde DESTDIR= ../bin DEFINES += DESKTOP_VERSION KDE_QT_ONLY unix : { @@ -178,3 +178,5 @@ KDGanttMinimizeSplitter.cpp \ kdecore/kprefs.cpp \ kdecore/klibloader.cpp \ kidmanager.cpp +#The following line was inserted by qt3to4 +QT += xml qt3support diff --git a/microkde/microkdeE.pro b/microkde/microkdeE.pro index 8fe2bd5..514e7b3 100644 --- a/microkde/microkdeE.pro +++ b/microkde/microkdeE.pro @@ -7,7 +7,7 @@ LIBS += -lmicroqtcompat -L$(QPEDIR)/lib DEFINES += KDE_QT_ONLY -TARGET = microkde +TARGET = xmicrokde OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR=$(QPEDIR)/lib 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 @@ -265,7 +265,7 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st btn->setIconSet( Resource::loadPixmap("cardmon/pcmcia") ); /* let's fill device parts */ - QPopupMenu* pop = new QPopupMenu(this); + Q3PopupMenu* pop = new Q3PopupMenu(this); connect(pop, SIGNAL( activated(int) ), this, SLOT(slotFSActivated(int) ) ); 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 @@ -137,7 +137,7 @@ private: QMap<QString, QString> m_dev; bool m_all : 1; OFileSelector* m_sel; - QPopupMenu* m_fsPop; + Q3PopupMenu* m_fsPop; bool compliesMime( const QString& ); QStringList m_mimes; // used in compy mime QString m_currentDir; 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,3 +1,5 @@ +//Added by qt3to4: +#include <Q3MemArray> // THIS IS A COPY OF THE FILE FOUND IN $QTDIR/src/kernel. Needed to modify qsplitter /**************************************************************************** @@ -55,10 +57,6 @@ // -#ifndef QT_H -#include "qabstractlayout.h" -#endif // QT_H - #ifndef QT_NO_LAYOUT struct QLayoutStruct { @@ -81,7 +79,7 @@ struct QLayoutStruct }; -void qGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, +void qGeomCalc( Q3MemArray<QLayoutStruct> &chain, int start, int count, int pos, int space, int spacer ); 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 @@ -68,3 +68,5 @@ SOURCES += ../crypt/ath.c \ #LIBS += -L../$(PLATFORM) #LIBS += -lgcrypt -lmpi -lerror +#The following line was inserted by qt3to4 +QT += 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 @@ -30,3 +30,5 @@ SOURCES += code-from-errno.c \ # gpg-error.h \ # mkerrcodes.h # mkerrcodes.c \
\ No newline at end of file +#The following line was inserted by qt3to4 +QT += 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 @@ -40,3 +40,5 @@ SOURCES += mpi-add.c \ generic/mpih-rshift.c \ generic/mpih-sub1.c \ generic/udiv-w-sdiv.c +#The following line was inserted by qt3to4 +QT += 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 @@ -34,3 +34,5 @@ SOURCES += adler32.c \ trees.c \ uncompr.c \ zutil.c +#The following line was inserted by qt3to4 +QT += 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 @@ -29,12 +29,15 @@ $Id$ #include <qlayout.h> #include <qlabel.h> #include <qtabwidget.h> -#include <qgroupbox.h> +#include <q3groupbox.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3VBoxLayout> #include <klocale.h> #include <kcombobox.h> #include <klineedit.h> #include <qpushbutton.h> -#include <qmultilineedit.h> +#include <q3multilineedit.h> /* * Constructs a addEntryWnd as a child of 'parent', with the @@ -49,7 +52,7 @@ addEntryWnd::addEntryWnd( PwMDoc* d, QWidget* parent, const char* name) KDialogBase::Ok, parent, name, true ), doc(d) { QWidget *page = plainPage(); - QVBoxLayout *pageLayout = new QVBoxLayout( page ); + Q3VBoxLayout *pageLayout = new Q3VBoxLayout( page ); QTabWidget* mTabWidget = new QTabWidget( page ); pageLayout->addWidget( mTabWidget ); @@ -58,7 +61,7 @@ addEntryWnd::addEntryWnd( PwMDoc* d, QWidget* parent, const char* name) // This is the Password tab QWidget *tab1 = new QWidget( mTabWidget ); - QGridLayout *layout = new QGridLayout( tab1, 3, 1 ); + Q3GridLayout *layout = new Q3GridLayout( tab1, 3, 1 ); layout->setMargin( KDialogBase::marginHint() ); layout->setSpacing( KDialogBase::spacingHint() ); @@ -77,7 +80,7 @@ addEntryWnd::addEntryWnd( PwMDoc* d, QWidget* parent, const char* name) layout->addWidget( categoryComboBox, i, 1 ); i++; categoryComboBox->setEditable( TRUE ); - categoryComboBox->setSizeLimit( 8 ); + categoryComboBox->setMaxVisibleItems( 8 ); categoryComboBox->setAutoCompletion( TRUE ); categoryComboBox->setDuplicatesEnabled( FALSE ); connect(categoryComboBox,SIGNAL(activated(const QString&)), SLOT(categorySelected(const QString&))); @@ -117,12 +120,12 @@ addEntryWnd::addEntryWnd( PwMDoc* d, QWidget* parent, const char* name) // This is the Comment tab QWidget *tab2 = new QWidget( mTabWidget ); - layout = new QGridLayout( tab2, 3, 1 ); + layout = new Q3GridLayout( tab2, 3, 1 ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); i = 0; - commentTextEdit = new QMultiLineEdit(tab2); + commentTextEdit = new Q3MultiLineEdit(tab2); layout->addMultiCellWidget( commentTextEdit, i, i, 0, 0 ); i++; @@ -134,7 +137,7 @@ addEntryWnd::addEntryWnd( PwMDoc* d, QWidget* parent, const char* name) // This is the Launcher tab QWidget *tab3 = new QWidget( mTabWidget ); - layout = new QGridLayout( tab3, 3, 1 ); + layout = new Q3GridLayout( tab3, 3, 1 ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); i = 0; 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 @@ -27,18 +27,23 @@ $Id$ #define ADDENTRYWND_EMB_H #include <qvariant.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3GridLayout> +#include <Q3HBoxLayout> +#include <QLabel> #include <kdialogbase.h> -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; class QSpacerItem; class KLineEdit; class QPushButton; class KComboBox; class QLabel; -class QGroupBox; -class QMultiLineEdit; +class Q3GroupBox; +class Q3MultiLineEdit; class PwMDoc; class addEntryWnd : public KDialogBase @@ -61,7 +66,7 @@ public: QLabel* pwLineLabel; QPushButton* revealButton; - QMultiLineEdit* commentTextEdit; + Q3MultiLineEdit* commentTextEdit; PwMDoc* doc; public slots: 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 @@ -196,7 +196,7 @@ void AddEntryWndImpl::switchComment(bool toAdvanced) if (commentTextEdit) return; - commentTextEdit = new QTextEdit(commentDummy); + commentTextEdit = new Q3TextEdit(commentDummy); commentTextEdit->setTextFormat(Qt::PlainText); commentTextEdit->resize(commentDummy->size()); commentTextEdit->setText(savedCommentText); @@ -216,6 +216,6 @@ void AddEntryWndImpl::editAdvCommentButton_slot() #endif } -#ifndef PWM_EMBEDDED -#include "addentrywndimpl.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_addentrywndimpl.cpp" #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 @@ -23,13 +23,13 @@ #ifndef PWM_EMBEDDED #include <qlineedit.h> -#include <qtextedit.h> +#include <q3textedit.h> #include <qcombobox.h> #include "addentrywnd.h" #else #include <klineedit.h> #include <kcombobox.h> -#include <qmultilineedit.h> +#include <q3multilineedit.h> #include "addentrywnd_emb.h" #endif @@ -86,12 +86,12 @@ public: public slots: #ifndef PWM_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN /** OK button pressed */ void okButton_slot(); /** cancel button pressed */ void cancelButton_slot(); -//MOC_SKIP_END +#endif #else virtual void slotOk(); #endif @@ -110,7 +110,7 @@ protected: protected: QPushButton *editAdvCommentButton; #ifndef PWM_EMBEDDED - QTextEdit *commentTextEdit; + Q3TextEdit *commentTextEdit; #else //nothing here #endif 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 @@ -21,7 +21,7 @@ #define __BINENTRYGEN_H -#include <qcstring.h> +#include <q3cstring.h> #include "pwmdoc.h" 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 @@ -26,9 +26,9 @@ #ifndef PWM_EMBEDDED #include <khtml_part.h> #include <khtmlview.h> -#include <qtextedit.h> +#include <q3textedit.h> #else -#include <qmultilineedit.h> +#include <q3multilineedit.h> #endif @@ -137,7 +137,7 @@ void CommentBox::switchTo(commentBoxMode newMode) // setup new mode switch (newMode) { case mode_text: - textDta = new QTextEdit(parentWidget); + textDta = new Q3TextEdit(parentWidget); textDta->setTextFormat(Qt::PlainText); textDta->setReadOnly(true); textDta->show(); @@ -229,11 +229,11 @@ QSize CommentBox::size() #else CommentBox::CommentBox(QWidget *_parentWidget) - : QTextBrowser(_parentWidget) + : Q3TextBrowser(_parentWidget) { //this->setReadOnly(true); - setFocusPolicy( QWidget::ClickFocus ); + setFocusPolicy( Qt::ClickFocus ); } CommentBox::~CommentBox() @@ -248,7 +248,7 @@ void CommentBox::clear() void CommentBox::setText(const QString &text) { - QTextBrowser::setText( text); + Q3TextBrowser::setText( text); if (!isVisible()) show(); } 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 @@ -23,7 +23,7 @@ #include <qstring.h> #include <qsize.h> class QWidget; -class QTextEdit; +class Q3TextEdit; class KHTMLPart; #ifndef PWM_EMBEDDED @@ -85,18 +85,18 @@ protected: /** current comment box usage type */ commentBoxMode mode; /** if the comment box is a normal textbox, data is stored here */ - QTextEdit *textDta; + Q3TextEdit *textDta; /** if the comment box is a HTML box, data is stored here */ KHTMLPart *htmlDta; }; #else -#include <qtextbrowser.h> +#include <q3textbrowser.h> /** Implementation of the advanced HTML comment box */ //US ENH: CommentBox must be derived from QWidget, to allow the splitter to set a initial size // without conflicting with the two display modes -class CommentBox : public QTextBrowser +class CommentBox : public Q3TextBrowser { public: CommentBox(QWidget *_parentWidget); 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 @@ -23,6 +23,8 @@ #include <kmessagebox.h> #include <klocale.h> +//Added by qt3to4: +#include <Q3CString> #define MAX_CSV_FILE_SIZE (50 * 1024 * 1024) // bytes @@ -42,7 +44,7 @@ bool Csv::importData(const QString &filepath, bool ret = true; QByteArray d; QFile f(filepath); - if (!f.open(IO_ReadOnly)) { + if (!f.open(QIODevice::ReadOnly)) { KMessageBox::error(parent, i18n("Could not open file.\n" "Does the file exist?"), @@ -89,7 +91,7 @@ bool Csv::doImport(const QByteArray &d, int refIndex = 0; int ret; - QCString s, curCat; + Q3CString s, curCat; int fieldIndex = 0; bool inRecord = false; /* fieldIndex is a reference count to see which @@ -121,27 +123,27 @@ bool Csv::doImport(const QByteArray &d, curCat = s; break; case 1: // desc - di.desc = s; + di.desc = std::string(s); ++fieldIndex; break; case 2: // name - di.name = s; + di.name = std::string(s); ++fieldIndex; break; case 3: // pw - di.pw = s; + di.pw = std::string(s); ++fieldIndex; break; case 4: // url - di.url = s; + di.url = std::string(s); ++fieldIndex; break; case 5: // launcher - di.launcher = s; + di.launcher = std::string(s); ++fieldIndex; break; case 6: // comment - di.comment = s; + di.comment = std::string(s); ++fieldIndex; break; default: @@ -154,7 +156,7 @@ bool Csv::doImport(const QByteArray &d, case 1: // record complete. if (fieldIndex == 6) - di.comment = s; + di.comment = std::string(s); inRecord = false; fieldIndex = 0; doc->addEntry(curCat, &di, true); @@ -175,7 +177,7 @@ bool Csv::doImport(const QByteArray &d, return false; } -int Csv::nextField(QCString *ret, +int Csv::nextField(Q3CString *ret, const QByteArray &in, bool inRecord, int *_refIndex) @@ -353,7 +355,7 @@ bool Csv::exportData(const QString &filepath, } } QFile f(filepath); - if (!f.open(IO_ReadWrite)) { + if (!f.open(QIODevice::ReadWrite)) { KMessageBox::error(parent, i18n("Could not open file for writing."), i18n("Open error.")); @@ -376,7 +378,7 @@ bool Csv::doExport(QFile &f, unsigned int numEntr; unsigned int i, j; PwMDataItem d; - QCString s, catName; + Q3CString s, catName; QByteArray b; for (i = 0; i < numCat; ++i) { @@ -401,7 +403,7 @@ bool Csv::doExport(QFile &f, b = s; // remove \0 termination #ifndef PWM_EMBEDDED - b.resize(b.size() - 1, QGArray::SpeedOptim); + b.resize(b.size() - 1, Q3GArray::SpeedOptim); #else b.resize(b.size() - 1); #endif @@ -412,15 +414,15 @@ bool Csv::doExport(QFile &f, return true; } -QCString Csv::newField(QCString s) +Q3CString Csv::newField(Q3CString s) { if (s.isEmpty()) - return QCString(); - QCString ret("\""); + return Q3CString(); + Q3CString ret("\""); #ifndef PWM_EMBEDDED s.replace('\"', "\"\""); #else - s.replace(QRegExp("\""), "\"\""); + s.replace("\"", "\"\""); #endif ret += s; ret += "\""; 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 @@ -21,7 +21,7 @@ #ifndef __PWMANAGER_CSV_H #define __PWMANAGER_CSV_H -#include <qcstring.h> +#include <q3cstring.h> #include <qfile.h> @@ -73,7 +73,7 @@ protected: * 2 -> data end. * -1 -> parser error. */ - int nextField(QCString *ret, + int nextField(Q3CString *ret, const QByteArray &in, bool inRecord, int *_refIndex); @@ -81,7 +81,7 @@ protected: bool doExport(QFile &f, PwMDoc *doc); /** generate a new data field string. */ - QCString newField(QCString s); + Q3CString newField(Q3CString s); protected: /** current parent widget. */ 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 @@ -28,7 +28,9 @@ $Id$ #include <qlayout.h> #include <qlabel.h> -#include <qgroupbox.h> +#include <q3groupbox.h> +//Added by qt3to4: +#include <Q3GridLayout> #include <klocale.h> #include <kcombobox.h> #include <klineedit.h> @@ -55,7 +57,7 @@ editCategoryWnd::editCategoryWnd( PwMDoc* d, QWidget* parent, const char* name) QWidget *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 3, 1 ); + Q3GridLayout *layout = new Q3GridLayout( page, 3, 1 ); layout->setMargin( KDialogBase::marginHint() ); layout->setSpacing( KDialogBase::spacingHint() ); @@ -66,7 +68,7 @@ editCategoryWnd::editCategoryWnd( PwMDoc* d, QWidget* parent, const char* name) layout->addWidget( categoryComboBox, i, 1 ); i++; categoryComboBox->setEditable( FALSE ); - categoryComboBox->setSizeLimit( 100 ); + categoryComboBox->setMaxVisibleItems( 100 ); connect(categoryComboBox,SIGNAL(activated(const QString&)), SLOT(categorySelected(const QString&))); 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 @@ -27,18 +27,23 @@ $Id$ #define EDITCATEGORY_H #include <qvariant.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3GridLayout> +#include <Q3HBoxLayout> +#include <QLabel> #include <kdialogbase.h> -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; class QSpacerItem; class KLineEdit; class QPushButton; class KComboBox; class QLabel; -class QGroupBox; -class QMultiLineEdit; +class Q3GroupBox; +class Q3MultiLineEdit; class PwMDoc; class editCategoryWnd : public KDialogBase 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 @@ -28,9 +28,11 @@ $Id$ #include <klocale.h> #include <qcheckbox.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qradiobutton.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <klineedit.h> #include <qlabel.h> @@ -57,7 +59,7 @@ findWnd::findWnd( QWidget* parent, const char* name ) KDialogBase::Ok, parent, name, true ) { QWidget *page = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( page ); + Q3VBoxLayout *layout = new Q3VBoxLayout( page ); layout->setMargin( KDialogBase::marginHint() ); layout->setSpacing( KDialogBase::spacingHint() ); @@ -68,7 +70,7 @@ findWnd::findWnd( QWidget* parent, const char* name ) layout->addWidget( caseSensCheckBox ); - QButtonGroup* buttonGroup1 = new QButtonGroup(1, Qt::Horizontal, i18n( "Search in Column" ), page ); + Q3ButtonGroup* buttonGroup1 = new Q3ButtonGroup(1, Qt::Horizontal, i18n( "Search in Column" ), page ); layout->addWidget( buttonGroup1 ); descRadioButton = new QRadioButton( i18n( "&Description" ), buttonGroup1 ); 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 @@ -133,6 +133,6 @@ void FindWndImpl::selectionChanged_slot() currFoundPos = -1; } -#ifndef PWM_EMBEDDED -#include "findwndimpl.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_findwndimpl.cpp" #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 @@ -21,6 +21,8 @@ #include "pwmexception.h" #include "randomizer.h" #include "globalstuff.h" +//Added by qt3to4: +#include <Q3PtrList> /* how often can a char of the same charset be reused in order */ @@ -158,7 +160,7 @@ GenPasswd::dynCharset_element * GenPasswd::selectNextCharset() Randomizer *rnd = Randomizer::obj(); if (useFilter) { // find out which charsets are allowed (filtering) - QPtrList<dynCharset_element> allowedCharsets; + Q3PtrList<dynCharset_element> allowedCharsets; // QPtrList<dynCharset_element>::iterator is not available in QT-3.1 unsigned int i, cnt = dynCharset.count(); dynCharset_element *p; 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 @@ -21,7 +21,7 @@ #define __GENPASSWD_H #include <qstring.h> -#include <qptrlist.h> +#include <q3ptrlist.h> /** internal password generator of PwManager */ class GenPasswd @@ -70,7 +70,7 @@ protected: /** use the filter? */ bool useFilter; /** dynamic charset used for generating the password */ - QPtrList<dynCharset_element> dynCharset; + Q3PtrList<dynCharset_element> dynCharset; }; #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 @@ -20,17 +20,20 @@ #include "getkeycardwnd.h" #include <qmessagebox.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> #include <klocale.h> GetKeyCardWnd::GetKeyCardWnd(QWidget *parent, - const char *name, bool modal, WFlags f) + const char *name, bool modal, Qt::WFlags f) : QDialog(parent, name, modal, f) { - vbox1 = new QVBox(this); + vbox1 = new Q3VBox(this); text_label = new QLabel(vbox1); - hbox1 = new QHBox(vbox1); + hbox1 = new Q3HBox(vbox1); okButton = new QPushButton(i18n("&Ok"), hbox1); cancelButton = new QPushButton(i18n("&Cancel"), hbox1); @@ -62,6 +65,6 @@ void GetKeyCardWnd::okButton_slot() done(1); } -#ifndef PWM_EMBEDDED -#include "getkeycardwnd.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_getkeycardwnd.cpp" #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 @@ -20,12 +20,14 @@ #ifndef GETKEYCARDWND_H #define GETKEYCARDWND_H -#include <qvbox.h> -#include <qhbox.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qdialog.h> #include <qlabel.h> #include <qpushbutton.h> #include <qevent.h> +//Added by qt3to4: +#include <QResizeEvent> /** The equivalent to GetMasterPwWndImpl for chipcards */ class GetKeyCardWnd : public QDialog @@ -33,15 +35,15 @@ class GetKeyCardWnd : public QDialog Q_OBJECT public: GetKeyCardWnd(QWidget *parent = 0, const char *name = 0, - bool modal = FALSE, WFlags f = 0); + bool modal = FALSE, Qt::WFlags f = 0); ~GetKeyCardWnd(); protected slots: void okButton_slot(); protected: - QVBox *vbox1; - QHBox *hbox1; + Q3VBox *vbox1; + Q3HBox *hbox1; QLabel *text_label; QPushButton *okButton; QPushButton *cancelButton; 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 @@ -43,6 +43,9 @@ $Id$ #include <qlineedit.h> #include <qpushbutton.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3VBoxLayout> /* * Constructs a getMasterPwWnd as a child of 'parent', with the @@ -54,13 +57,13 @@ getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name) KDialogBase::Ok, parent, name, true ) { QWidget *page = plainPage(); - QVBoxLayout *pageLayout = new QVBoxLayout( page ); + Q3VBoxLayout *pageLayout = new Q3VBoxLayout( page ); pwLineEdit = new QLineEdit( page, "pwLineEdit" ); pwLineEdit->setEchoMode( QLineEdit::Password ); QLabel* textLabel1 = new QLabel( pwLineEdit, i18n("Please enter the master-password:"), page, "textLabel1" ); - textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); + textLabel1->setAlignment( int( Qt::WordBreak | Qt::AlignCenter ) ); pageLayout->addWidget(textLabel1); pageLayout->addWidget(pwLineEdit); @@ -76,7 +79,7 @@ getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name) } #endif - QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 ); + Q3GridLayout* numberLayout = new Q3GridLayout( numberBox, 4, 3 ); numberLayout->setMargin( 0 ); numberLayout->setSpacing( 0 ); 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 @@ -55,6 +55,6 @@ void GetMasterPwWndImpl::slotOk() } #endif -#ifndef PWM_EMBEDDED -#include "getmasterpwwndimpl.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_getmasterpwwndimpl.cpp" #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 @@ -34,7 +34,7 @@ #include <sstream> #else #include <qstring.h> -#include <qtextstream.h> +#include <QTextOStream> #endif #ifndef CONFIG_KEYCARD @@ -97,7 +97,7 @@ template <class T> inline std::string tostr(const T &t) { QString result; - QTextOStream(&result) << t; + QTextOStream tmp(&result); tmp << t; return result.latin1(); } #endif 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 @@ -60,7 +60,7 @@ QString HtmlGen::escapeHtmlText(const QString &str) unsigned int len = str.length(), i; char c; for (i = 0; i < len; ++i) { - c = str.at(i); + c = str.at(i).toLatin1(); switch (c) { case '<': ret.append("<"); 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 @@ -28,7 +28,7 @@ #include <sys/types.h> #include <stdio.h> #else -#include <qsocket.h> +#include <q3socket.h> #endif #define END_OF_LINE '\n' @@ -77,7 +77,7 @@ Ipc::Ipc() qDebug("Ipc: socketpair() failed"); } #endif - QSocket* qsock = new QSocket(); + Q3Socket* qsock = new Q3Socket(); qsock->setSocket(sock[0]); rdBufSize = INIT_LINEBUF_LEN; @@ -88,7 +88,7 @@ Ipc::Ipc() qDebug("Ipc: OOM"); } - qsock = new QSocket(); + qsock = new Q3Socket(); qsock->setSocket(sock[0]); /*US @@ -152,7 +152,7 @@ Ipc::Ipc(const Ipc *ipc) sock[0] = ipc->sock[1]; sock[1] = ipc->sock[0]; - qSock = new QSocket(); + qSock = new Q3Socket(); qSock->setSocket(sock[0]); /*US @@ -212,6 +212,6 @@ void Ipc::receiveData(int s) } -#ifndef PWM_EMBEDDED -#include "ipc.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_ipc.cpp" #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 @@ -29,7 +29,7 @@ #ifndef PWM_EMBEDDED #include <stdio.h> #else -#include <qsocket.h> +#include <q3socket.h> #endif class QSocketNotifier; @@ -74,7 +74,7 @@ protected: /** current receive buffer size */ size_t rdBufSize; #else - QSocket* qSock; + Q3Socket* qSock; /** current receive buffer size */ unsigned int rdBufSize; #endif 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 @@ -22,6 +22,8 @@ */ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kdebug.h> @@ -42,7 +44,7 @@ extern "C" KCMPwmConfig::KCMPwmConfig(QWidget *parent, const char *name ) : KCModule( PWMPrefs::instance(), parent, name ) { - QVBoxLayout *layout = new QVBoxLayout( this ); + Q3VBoxLayout *layout = new Q3VBoxLayout( this ); mConfigWidget = new PWMConfigWidget( (PWMPrefs*)getPreferences(), this, "mConfigWidget" ); layout->addWidget( mConfigWidget ); layout->setSpacing( 0 ); 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 @@ -22,8 +22,8 @@ */ #include <qcheckbox.h> -#include <qframe.h> -#include <qgroupbox.h> +#include <q3frame.h> +#include <q3groupbox.h> #include <qlayout.h> #include <qpushbutton.h> #include <qtabwidget.h> @@ -32,7 +32,10 @@ #include <qspinbox.h> #include <qlabel.h> #include <qfile.h> -#include <qvbox.h> +#include <q3vbox.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3VBoxLayout> #include <kconfig.h> #include <kdebug.h> @@ -52,7 +55,7 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *name ) : KPrefsWidget(prefs, parent, name ) { - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, + Q3VBoxLayout *topLayout = new Q3VBoxLayout( this, 0, KDialog::spacingHint() ); QTabWidget *tabWidget = new QTabWidget( this ); @@ -61,7 +64,7 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n // windowsStyle page ////////////////////////////////////////////////////// QWidget *windowStylePage = new QWidget( this ); - QGridLayout *windowStyleLayout = new QGridLayout( windowStylePage, 3, 3); + Q3GridLayout *windowStyleLayout = new Q3GridLayout( windowStylePage, 3, 3); int i = 0; KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage); @@ -98,7 +101,7 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n // File page ////////////////////////////////////////////////////// QWidget *filePage = new QWidget( this ); - QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2); + Q3GridLayout *fileLayout = new Q3GridLayout( filePage, 3, 2); i = 0; QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage); @@ -154,7 +157,7 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n // Timeout page ////////////////////////////////////////////////////// QWidget *timeoutPage = new QWidget( this ); - QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2); + Q3GridLayout *timeoutLayout = new Q3GridLayout( timeoutPage, 3, 2); i = 0; pwTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "pwTimeoutSpinBox" ); @@ -183,7 +186,7 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n // Autostart page ////////////////////////////////////////////////////// QWidget *autostartPage = new QWidget( this ); - QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2); + Q3GridLayout *autostartLayout = new Q3GridLayout( autostartPage, 3, 2); i = 0; @@ -203,7 +206,7 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n // external app page ////////////////////////////////////////////////////// QWidget *externalappPage = new QWidget( this ); - QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2); + Q3GridLayout *externalappLayout = new Q3GridLayout( externalappPage, 3, 2); i = 0; @@ -223,7 +226,7 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n // miscelaneous page ////////////////////////////////////////////////////// QWidget *miscPage = new QWidget( this ); - QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2); + Q3GridLayout *miscLayout = new Q3GridLayout( miscPage, 3, 2); i = 0; @@ -359,7 +362,7 @@ void PWMConfigWidget::setFilePermissions(int perm) -#ifndef PWM_EMBEDDED -#include "pwmconfigwidget.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_pwmconfigwidget.cpp" #endif //PWM_EMBEDDED 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 @@ -20,22 +20,25 @@ #include "listobjselectwnd.h" #include <klocale.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> ListObjSelectWnd::ListObjSelectWnd(const QString &caption, const QString &titleText, QWidget *parent, bool multiSel, const char *name, - bool modal, WFlags f) + bool modal, Qt::WFlags f) : QDialog(parent, name, modal, f) { - vbox1 = new QVBox(this); + vbox1 = new Q3VBox(this); title = new QLabel(vbox1); - list = new QListBox(vbox1); + list = new Q3ListBox(vbox1); if (multiSel) { - hbox2 = new QHBox(vbox1); + hbox2 = new Q3HBox(vbox1); selAllButton = new QPushButton(i18n("&Select all"), hbox2); unselAllButton = new QPushButton(i18n("&Unselect all"), hbox2); } - hbox1 = new QHBox(vbox1); + hbox1 = new Q3HBox(vbox1); okButton = new QPushButton(i18n("&Ok"), hbox1); cancelButton = new QPushButton(i18n("&Cancel"), hbox1); @@ -45,7 +48,7 @@ ListObjSelectWnd::ListObjSelectWnd(const QString &caption, const QString &titleT resize(250, 300); setCaption(caption); if (multiSel) { - list->setSelectionMode(QListBox::Multi); + list->setSelectionMode(Q3ListBox::Multi); } title->setAlignment(Qt::AlignHCenter | Qt::WordBreak); @@ -126,6 +129,6 @@ void ListObjSelectWnd::setList(const QStringList &_list) list->insertStringList(_list); } -#ifndef PWM_EMBEDDED -#include "listobjselectwnd.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_listobjselectwnd.cpp" #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 @@ -21,12 +21,14 @@ #define LISTOBJSELECTWND_H #include <qdialog.h> -#include <qvbox.h> -#include <qhbox.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qlabel.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qpushbutton.h> #include <qstringlist.h> +//Added by qt3to4: +#include <QResizeEvent> /** Display a list-window for selection of some objects */ @@ -37,7 +39,7 @@ public: ListObjSelectWnd(const QString &caption, const QString &titleText, QWidget *parent = 0, bool multiSel = false, const char *name = 0, - bool modal = FALSE, WFlags f = 0); + bool modal = FALSE, Qt::WFlags f = 0); ~ListObjSelectWnd(); void setList(const QStringList &_list); @@ -62,11 +64,11 @@ public: { list->clear(); } protected: - QVBox *vbox1; - QHBox *hbox1; - QHBox *hbox2; + Q3VBox *vbox1; + Q3HBox *hbox1; + Q3HBox *hbox2; QLabel *title; - QListBox *list; + Q3ListBox *list; QPushButton *okButton; QPushButton *cancelButton; QPushButton *selAllButton; 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 @@ -23,6 +23,9 @@ #include <qpainter.h> #include <qpixmap.h> +//Added by qt3to4: +#include <QEvent> +#include <QKeyEvent> #include <kiconloader.h> @@ -39,7 +42,7 @@ ListViewPwM::ListViewPwM(QWidget *parent, const char *name) bool ListViewPwM::event(QEvent *e) { - if (e->type() == QEvent::LayoutHint) + if (e->type() == QEvent::LayoutRequest) emit layoutChanged(); if (e->type() == QEvent::KeyPress) { QKeyEvent* ke = (QKeyEvent*) e; @@ -64,8 +67,8 @@ bool ListViewPwM::event(QEvent *e) QPixmap * ListViewItemPwM::onPix = 0; QPixmap * ListViewItemPwM::offPix = 0; -ListViewItemPwM::ListViewItemPwM(QListView *parent) - : QCheckListItem(parent, "", QCheckListItem::CheckBox) +ListViewItemPwM::ListViewItemPwM(Q3ListView *parent) + : Q3CheckListItem(parent, "", Q3CheckListItem::CheckBox) { if (!onPix) { PWM_ASSERT(!offPix); @@ -97,7 +100,7 @@ void ListViewItemPwM::paintCell(QPainter *p, const QColorGroup &cg, return; //US BUG: if (column != COLUMN_DESC) { - QCheckListItem::paintCell(p, cg, column, width, align); + Q3CheckListItem::paintCell(p, cg, column, width, align); return; } QPixmap *curPix = isOn() ? onPix : offPix; @@ -120,10 +123,10 @@ void ListViewItemPwM::paintCell(QPainter *p, const QColorGroup &cg, p->translate( pixSpace, 0 ); #endif - QListViewItem::paintCell(p, cg, column, width - pixSpace, align); + Q3ListViewItem::paintCell(p, cg, column, width - pixSpace, align); } -#ifndef PWM_EMBEDDED -#include "listviewpwm.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_listviewpwm.cpp" #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 @@ -21,6 +21,9 @@ #define __LISTVIEW_H #include <klistview.h> +//Added by qt3to4: +#include <QEvent> +#include <QPixmap> /** PwManager implementation of the list view. * Derived from KListView. @@ -41,10 +44,10 @@ protected: virtual bool event(QEvent *e); }; -class ListViewItemPwM : public QCheckListItem +class ListViewItemPwM : public Q3CheckListItem { public: - ListViewItemPwM(QListView *parent); + ListViewItemPwM(Q3ListView *parent); protected: void paintCell(QPainter *p, const QColorGroup &cg, 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 @@ -142,6 +142,7 @@ static void addAuthors(KAboutData *aboutData) int main(int argc, char *argv[]) { + if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi"); printDebugConfigureInfo(); #ifndef PWM_EMBEDDED KAboutData aboutData(PACKAGE_NAME, PROG_NAME, 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 @@ -15,7 +15,7 @@ #include <kprinter.h> #include <qpainter.h> -#include <qpaintdevicemetrics.h> +#include <q3paintdevicemetrics.h> #include <qrect.h> #include <qpoint.h> @@ -42,7 +42,7 @@ protected: /** painter object */ QPainter *paint; /** metrics */ - QPaintDeviceMetrics *metrics; + Q3PaintDeviceMetrics *metrics; /** left field of header */ QString headerLeft; /** middle field of header */ 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 @@ -26,12 +26,15 @@ $Id$ #include "pwgenwnd_emb.h" #include <qpushbutton.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qcheckbox.h> #include <qlabel.h> #include <qlineedit.h> #include <qspinbox.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> #include "klocale.h" @@ -46,14 +49,14 @@ pwGenWnd::pwGenWnd( QWidget* parent, const char* name) KDialogBase::Ok, parent, name, true ) { QWidget *page = plainPage(); - QVBoxLayout* pwGenWndLayout = new QVBoxLayout( page, 11, 6, "pwGenWndLayout"); + Q3VBoxLayout* pwGenWndLayout = new Q3VBoxLayout( page, 11, 6, "pwGenWndLayout"); - QGroupBox* groupBox1 = new QGroupBox( page, "groupBox1" ); + Q3GroupBox* groupBox1 = new Q3GroupBox( page, "groupBox1" ); groupBox1->setTitle( i18n( "Character set:" ) ); groupBox1->setColumnLayout(0, Qt::Vertical ); groupBox1->layout()->setSpacing( 6 ); groupBox1->layout()->setMargin( 11 ); - QVBoxLayout* groupBox1Layout = new QVBoxLayout( groupBox1->layout() ); + Q3VBoxLayout* groupBox1Layout = new Q3VBoxLayout( groupBox1->layout() ); groupBox1Layout->setAlignment( Qt::AlignTop ); int_charLowerCheckBox = new QCheckBox( i18n("Lowercase (abc)"), groupBox1, "int_charLowerCheckBox" ); @@ -80,7 +83,7 @@ pwGenWnd::pwGenWnd( QWidget* parent, const char* name) int_charBlankCheckBox = new QCheckBox( i18n( "Spaces (blank characters)"), groupBox1, "int_charBlankCheckBox" ); groupBox1Layout->addWidget( int_charBlankCheckBox ); - QHBoxLayout* layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); + Q3HBoxLayout* layout7 = new Q3HBoxLayout( 0, 0, 6, "layout7"); int_charUserCheckBox = new QCheckBox( i18n("User defined:"), groupBox1, "int_charUserCheckBox" ); layout7->addWidget( int_charUserCheckBox ); @@ -92,7 +95,7 @@ pwGenWnd::pwGenWnd( QWidget* parent, const char* name) pwGenWndLayout->addWidget( groupBox1 ); - QHBoxLayout* layout8 = new QHBoxLayout( 0, 0, 6, "layout8"); + Q3HBoxLayout* layout8 = new Q3HBoxLayout( 0, 0, 6, "layout8"); int_lenSpinBox = new QSpinBox( page, "int_lenSpinBox" ); QLabel* textLabel2 = new QLabel( int_lenSpinBox, i18n("Password Length:"), page, "textLabel2" ); 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 @@ -34,7 +34,7 @@ PwGenWndImpl::PwGenWndImpl(QWidget *parent, const char *name, bool modal, - WFlags fl) + Qt::WFlags fl) : pwGenWnd(parent, name, modal, fl) { } 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 @@ -33,7 +33,7 @@ public: PwGenWndImpl(QWidget *parent = 0, const char *name = 0, bool modal = FALSE, - WFlags fl = 0); + Qt::WFlags fl = 0); #else PwGenWndImpl( QWidget* parent = 0, const char* name = 0); #endif 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 @@ -25,6 +25,12 @@ #include <kmessagebox.h> #include <qstatusbar.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3ValueList> +#include <QHideEvent> +#include <QFocusEvent> +#include <QCloseEvent> #ifndef PWM_EMBEDDED #include <kmenubar.h> @@ -186,7 +192,7 @@ PwM::PwM(PwMInit *_init, PwMDoc *doc, initToolbar(); initMetrics(); setVirgin(virginity); - setFocusPolicy(QWidget::WheelFocus); + setFocusPolicy(Qt::WheelFocus); #ifndef PWM_EMBEDDED statusBar()->show(); #endif @@ -240,20 +246,20 @@ void PwM::initMenubar() optionsPopup = new KPopupMenu(this); // "file" popup menu - filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), + filePopup->insertItem(QIcon(picons->loadIcon("filenew", KIcon::Small)), i18n("&New"), this, SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW); - filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)), + filePopup->insertItem(QIcon(picons->loadIcon("fileopen", KIcon::Small)), i18n("&Open"), this, SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN); - filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)), + filePopup->insertItem(QIcon(picons->loadIcon("fileclose", KIcon::Small)), i18n("&Close"), this, SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE); filePopup->insertSeparator(); - filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)), + filePopup->insertItem(QIcon(picons->loadIcon("filesave", KIcon::Small)), i18n("&Save"), this, SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE); - filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)), + filePopup->insertItem(QIcon(picons->loadIcon("filesaveas", KIcon::Small)), i18n("Save &as..."), this, SLOT(saveAs_slot()), 0, BUTTON_POPUP_FILE_SAVEAS); @@ -269,7 +275,7 @@ void PwM::initMenubar() exportPopup->insertItem(i18n("&KWallet..."), this, SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET); #endif - filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)), + filePopup->insertItem(QIcon(picons->loadIcon("fileexport", KIcon::Small)), i18n("E&xport"), exportPopup, BUTTON_POPUP_FILE_EXPORT); // "file/import" popup menu @@ -283,87 +289,87 @@ void PwM::initMenubar() importPopup->insertItem(i18n("&KWallet..."), this, SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET); #endif - filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)), + filePopup->insertItem(QIcon(picons->loadIcon("fileimport", KIcon::Small)), i18n("I&mport"), importPopup, BUTTON_POPUP_FILE_IMPORT); filePopup->insertSeparator(); #if 0 - filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)), + filePopup->insertItem(QIcon(picons->loadIcon("fileprint", KIcon::Small)), i18n("&Print..."), this, SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT); filePopup->insertSeparator(); #endif - filePopup->insertItem(QIconSet(picons->loadIcon("exit", KIcon::Small)), + filePopup->insertItem(QIcon(picons->loadIcon("exit", KIcon::Small)), i18n("&Quit"), this, SLOT(quitButton_slot()), 0, BUTTON_POPUP_FILE_QUIT); menuBar()->insertItem(i18n("&File"), filePopup); // "manage" popup menu - managePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)), + managePopup->insertItem(QIcon(picons->loadIcon("pencil", KIcon::Small)), i18n("&Add password"), this, SLOT(addPwd_slot()), 0, BUTTON_POPUP_MANAGE_ADD); managePopup->insertSeparator(); - managePopup->insertItem(QIconSet(picons->loadIcon("edit", KIcon::Small)), + managePopup->insertItem(QIcon(picons->loadIcon("edit", KIcon::Small)), i18n("&Edit"), this, SLOT(editPwd_slot()), 0, BUTTON_POPUP_MANAGE_EDIT); - managePopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), + managePopup->insertItem(QIcon(picons->loadIcon("editdelete", KIcon::Small)), i18n("&Delete"), this, SLOT(deletePwd_slot()), 0, BUTTON_POPUP_MANAGE_DEL); managePopup->insertSeparator(); - managePopup->insertItem(QIconSet(picons->loadIcon("rotate", KIcon::Small)), + managePopup->insertItem(QIcon(picons->loadIcon("rotate", KIcon::Small)), i18n("Change &Master Password"), this, SLOT(changeMasterPwd_slot()), 0, BUTTON_POPUP_MANAGE_CHANGEMP); menuBar()->insertItem(i18n("&Manage"), managePopup); // "chipcard" popup menu #ifdef CONFIG_KEYCARD - chipcardPopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), + chipcardPopup->insertItem(QIcon(picons->loadIcon("filenew", KIcon::Small)), i18n("&Generate new key-card"), this, SLOT(genNewCard_slot()), 0, BUTTON_POPUP_CHIPCARD_GENNEW); - chipcardPopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), + chipcardPopup->insertItem(QIcon(picons->loadIcon("editdelete", KIcon::Small)), i18n("&Erase key-card"), this, SLOT(eraseCard_slot()), 0, BUTTON_POPUP_CHIPCARD_DEL); - chipcardPopup->insertItem(QIconSet(picons->loadIcon("", KIcon::Small)), + chipcardPopup->insertItem(QIcon(picons->loadIcon("", KIcon::Small)), i18n("Read card-&ID"), this, SLOT(readCardId_slot()), 0, BUTTON_POPUP_CHIPCARD_READID); chipcardPopup->insertSeparator(); - chipcardPopup->insertItem(QIconSet(picons->loadIcon("2rightarrow", KIcon::Small)), + chipcardPopup->insertItem(QIcon(picons->loadIcon("2rightarrow", KIcon::Small)), i18n("&Make card backup-image"), this, SLOT(makeCardBackup_slot()), 0, BUTTON_POPUP_CHIPCARD_SAVEBACKUP); - chipcardPopup->insertItem(QIconSet(picons->loadIcon("2leftarrow", KIcon::Small)), + chipcardPopup->insertItem(QIcon(picons->loadIcon("2leftarrow", KIcon::Small)), i18n("&Replay card backup-image"), this, SLOT(replayCardBackup_slot()), 0, BUTTON_POPUP_CHIPCARD_REPLAYBACKUP); menuBar()->insertItem(i18n("&Chipcard manager"), chipcardPopup); #endif // CONFIG_KEYCARD // "view" popup menu - viewPopup->insertItem(QIconSet(picons->loadIcon("find", KIcon::Small)), + viewPopup->insertItem(QIcon(picons->loadIcon("find", KIcon::Small)), i18n("&Find"), this, SLOT(find_slot()), 0, BUTTON_POPUP_VIEW_FIND); viewPopup->insertSeparator(); - viewPopup->insertItem(QIconSet(picons->loadIcon("halfencrypted", KIcon::Small)), + viewPopup->insertItem(QIcon(picons->loadIcon("halfencrypted", KIcon::Small)), i18n("&Lock all entries"), this, SLOT(lockWnd_slot()), 0, BUTTON_POPUP_VIEW_LOCK); - viewPopup->insertItem(QIconSet(picons->loadIcon("encrypted", KIcon::Small)), + viewPopup->insertItem(QIcon(picons->loadIcon("encrypted", KIcon::Small)), i18n("&Deep-lock all entries"), this, SLOT(deepLockWnd_slot()), 0, BUTTON_POPUP_VIEW_DEEPLOCK); - viewPopup->insertItem(QIconSet(picons->loadIcon("decrypted", KIcon::Small)), + viewPopup->insertItem(QIcon(picons->loadIcon("decrypted", KIcon::Small)), i18n("&Unlock all entries"), this, SLOT(unlockWnd_slot()), 0, BUTTON_POPUP_VIEW_UNLOCK); menuBar()->insertItem(i18n("&View"), viewPopup); // "options" popup menu - optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), + optionsPopup->insertItem(QIcon(picons->loadIcon("configure", KIcon::Small)), i18n("&Configure PwM/Pi..."), this, SLOT(config_slot()),0, BUTTON_POPUP_OPTIONS_CONFIG); - optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), + optionsPopup->insertItem(QIcon(picons->loadIcon("configure", KIcon::Small)), i18n("Global Settings..."), this, SLOT(config_global_slot()),0, BUTTON_POPUP_OPTIONS_GLOBAL_CONFIG); @@ -376,7 +382,7 @@ void PwM::initMenubar() #ifndef PWM_EMBEDDED helpPopup = helpMenu(QString::null, false); #else - optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), + optionsPopup->insertItem(QIcon(picons->loadIcon("configure", KIcon::Small)), i18n("C&ategories..."), this, SLOT(category_slot()),0, BUTTON_POPUP_OPTIONS_CATEGORY); @@ -922,12 +928,12 @@ void PwM::config_slot() ++i; } - const QValueList<PwM *> *ml = init->mainWndList(); + const Q3ValueList<PwM *> *ml = init->mainWndList(); #ifndef PWM_EMBEDDED - QValueList<PwM *>::const_iterator i2 = ml->begin(), + Q3ValueList<PwM *>::const_iterator i2 = ml->begin(), end2 = ml->end(); #else - QValueList<PwM *>::ConstIterator i2 = ml->begin(), + Q3ValueList<PwM *>::ConstIterator i2 = ml->begin(), end2 = ml->end(); #endif PwM *pwm; @@ -1594,6 +1600,6 @@ void PwM::removeSyncInfo( QString syncProfile) #endif -#ifndef PWM_EMBEDDED -#include "pwm.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_pwm.cpp" #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 @@ -36,6 +36,11 @@ #include <kaction.h> #include <qglobal.h> +//Added by qt3to4: +#include <QCloseEvent> +#include <QFocusEvent> +#include <Q3PopupMenu> +#include <QHideEvent> #include "pwmview.h" #include "pwmexception.h" @@ -50,9 +55,9 @@ class KSyncManager; /** PwM is the base class of the project */ #ifndef PWM_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN class PwM : public KMainWindow -//MOC_SKIP_END +#endif #else class PwM : public KMainWindow, public KSyncInterface #endif @@ -284,7 +289,7 @@ protected: // LR ******************************* // sync stuff! - QPopupMenu *syncPopup; + Q3PopupMenu *syncPopup; KSyncManager* syncManager; #endif 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 @@ -11,8 +11,8 @@ DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION #DEFINES += CONFIG_DEBUG LIBS += -L../libcrypt/ LIBS += -L../../bin/ -LIBS += -lmicrokde -LIBS += -lmicrokdepim +LIBS += -lxmicrokde +LIBS += -lxmicrokdepim LIBS += -lzlib LIBS += -lkpmicrocipher LIBS += -lkpmicroerror @@ -175,3 +175,5 @@ kcmconfigs/pwmconfigwidget.cpp +#The following line was inserted by qt3to4 +QT += 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 @@ -14,9 +14,9 @@ DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY #DEFINES += CONFIG_DEBUG LIBS += -L../libcrypt/$(PLATFORM) -LIBS += -lmicrokde +LIBS += -lxmicrokde LIBS += -lmicroqtcompat -LIBS += -lmicrokdepim +LIBS += -lxmicrokdepim LIBS += -L$(QPEDIR)/lib LIBS += -lqpe LIBS += -lzlib 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 @@ -48,6 +48,7 @@ #include <qsize.h> #include <qfileinfo.h> #include <qfile.h> +#include <QDesktopWidget> #include <stdio.h> #include <stdlib.h> @@ -481,7 +482,8 @@ PwMerror PwMDoc::saveDoc(char compress, const QString *file) char rnd_buf[5]; sprintf(rnd_buf, "%X%X%X%X", rnd->genRndChar() & 0xFF, rnd->genRndChar() & 0xFF, rnd->genRndChar() & 0xFF, rnd->genRndChar() & 0xFF); - tmpFileMoved = filename + "." + rnd_buf + ".mv"; + tmpFileMoved = filename; tmpFileMoved += '.'; + tmpFileMoved += rnd_buf; tmpFileMoved += ".mv"; if (!copyFile(filename, tmpFileMoved)) return e_openFile; if (!QFile::remove(filename)) { @@ -491,7 +493,7 @@ PwMerror PwMDoc::saveDoc(char compress, const QString *file) } } f.setName(filename); - if (!f.open(IO_ReadWrite)) { + if (!f.open(QIODevice::ReadWrite)) { ret = e_openFile; goto out_moveback; } @@ -634,7 +636,7 @@ PwMerror PwMDoc::openDoc(const QString *file, int openLocked) goto out_success; } - if (!f.open(IO_ReadOnly)) + if (!f.open(QIODevice::ReadOnly)) return e_openFile; ret = checkHeader(&cryptAlgo, ¤tPw, &compress, &headerLen, @@ -1003,10 +1005,10 @@ bool PwMDoc::copyFile(const QString &src, const QString &dst) return false; } QFile srcFd(src); - if (!srcFd.open(IO_ReadOnly)) + if (!srcFd.open(QIODevice::ReadOnly)) return false; QFile dstFd(dst); - if (!dstFd.open(IO_ReadWrite)) { + if (!dstFd.open(QIODevice::ReadWrite)) { srcFd.close(); return false; } @@ -1485,7 +1487,7 @@ PwMerror PwMDoc::decrypt(string *d, unsigned int pos, const QString *pw, PWM_ASSERT(pw); PWM_ASSERT(f); - unsigned int cryptLen = f->size() - pos; + size_t cryptLen = f->size() - pos; byte *encrypted = new byte[cryptLen]; byte *decrypted = new byte[cryptLen]; @@ -1525,9 +1527,9 @@ PwMerror PwMDoc::decrypt(string *d, unsigned int pos, const QString *pw, return e_cryptNotImpl; LibGCryptIf gc; PwMerror err; - err = gc.decrypt(&decrypted, + err = gc.decrypt((unsigned char **)&decrypted, &cryptLen, - encrypted, + (unsigned char*)encrypted, cryptLen, reinterpret_cast<const unsigned char *>(pw->latin1()), pw->length(), @@ -2433,7 +2435,7 @@ PwMerror PwMDoc::exportToText(const QString *file) return e_accessFile; } QFile f(*file); - if (!f.open(IO_ReadWrite)) + if (!f.open(QIODevice::ReadWrite)) return e_openFile; if (!unlockAll_tempoary()) { @@ -2707,7 +2709,7 @@ PwMerror PwMDoc::importText_PwM(const QString *file) string curCat; unsigned int entriesRead = 0; PwMDataItem currItem; - bool res = f.open(IO_ReadOnly); + bool res = f.open(QIODevice::ReadOnly); if (res == false) return e_openFile; @@ -3629,6 +3631,6 @@ QStringList PwMDoc::getIDEntryList() -#ifndef PWM_EMBEDDED -#include "pwmdoc.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_pwmdoc.cpp" #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 @@ -212,7 +212,7 @@ struct PwMDataItem //US ENH: we need this operator to compare two items if we have no unique ids //available. Generaly this happens before the first sync - bool PwMDataItem::operator==( const PwMDataItem &a ) const + bool operator==( const PwMDataItem &a ) const { //qDebug("oper==%s", a.desc.c_str()); if ( desc != a.desc ) return false; @@ -227,7 +227,7 @@ struct PwMDataItem //US ENH: this sync method actually copies all values from the parameter like the =operator //does with two exceptions: listViewPos will not be changed, and the launcher only if required. - bool PwMDataItem::syncItem(const PwMDataItem &a, bool syncLauncher=true ) + bool syncItem(const PwMDataItem &a, bool syncLauncher=true ) { desc = a.desc; name = a.name; 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 @@ -465,6 +465,6 @@ QString PwMDocUi::string_defaultTitle() return i18n("Untitled"); } -#ifndef PWM_EMBEDDED -#include "pwmdocui.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_pwmdocui.cpp" #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 @@ -20,6 +20,8 @@ #include "pwminit.h" #include "randomizer.h" #include <qdir.h> +//Added by qt3to4: +#include <Q3ValueList> #ifndef PWM_EMBEDDED #include "selftest.h" @@ -92,12 +94,12 @@ PwMInit::~PwMInit() #ifndef PWM_EMBEDDED SelfTest::cancel(); // close all open mainwnds - QValueList<PwM *>::iterator i = _mainWndList.begin(), + Q3ValueList<PwM *>::iterator i = _mainWndList.begin(), end = _mainWndList.end(); #else // close all open mainwnds - QValueList<PwM *>::Iterator i = _mainWndList.begin(), + Q3ValueList<PwM *>::Iterator i = _mainWndList.begin(), end = _mainWndList.end(); #endif while (i != end) { @@ -426,11 +428,11 @@ again: } #ifndef PWM_EMBEDDED // find the closed window in the "mainWndList" and delete it. - QValueList<PwM *>::iterator i = _mainWndList.begin(), + Q3ValueList<PwM *>::iterator i = _mainWndList.begin(), end = _mainWndList.end(); #else // find the closed window in the "mainWndList" and delete it. - QValueList<PwM *>::Iterator i = _mainWndList.begin(), + Q3ValueList<PwM *>::Iterator i = _mainWndList.begin(), end = _mainWndList.end(); #endif while (i != end) { @@ -573,12 +575,12 @@ void PwMInit::minimizeAllMainWnd(bool toTray) if (!_mainWndList.count()) return; #endif - const QValueList<PwM *> *ml = mainWndList(); + const Q3ValueList<PwM *> *ml = mainWndList(); #ifndef PWM_EMBEDDED - QValueList<PwM *>::const_iterator it = ml->begin(), + Q3ValueList<PwM *>::const_iterator it = ml->begin(), end = ml->end(); #else - QValueList<PwM *>::ConstIterator it = ml->begin(), + Q3ValueList<PwM *>::ConstIterator it = ml->begin(), end = ml->end(); #endif PwM *wnd; @@ -624,7 +626,6 @@ PwMApplication::PwMApplication(int & argc, char ** argv) : QApplication( argc, argv ) , init (0) { - setStyle( new QPlatinumStyle ()); QString hdir = QDir::homeDirPath(); // there is a bug when creating dirs for WIN 98 // it is difficult to fix, because we have no WIN 98 runnung @@ -656,6 +657,6 @@ PwMApplication::~PwMApplication() -#ifndef PWM_EMBEDDED -#include "pwminit.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_pwminit.cpp" #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 @@ -20,7 +20,7 @@ #ifndef __PWMINIT_H #define __PWMINIT_H -#include <qvaluelist.h> +#include <q3valuelist.h> #include <qobject.h> #ifndef PWM_EMBEDDED #include <kuniqueapplication.h> @@ -30,7 +30,6 @@ #include <qpe/qpeapplication.h> #else //DESKTOP_VERSION #include <qapplication.h> -#include <qplatinumstyle.h> #endif //DESKTOP_VERSION #include <kapplication.h> @@ -50,7 +49,7 @@ class PwMInit; /** main application class */ #ifndef PWM_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN class PwMApplication : public KUniqueApplication { public: @@ -68,7 +67,7 @@ public: protected: PwMInit *init; }; -//MOC_SKIP_END +#endif #else //PWM_EMBEDDED #ifndef DESKTOP_VERSION @@ -154,7 +153,7 @@ public: PwMTray * tray() { return _tray; } /** returns a list of all open main windows */ - const QValueList<PwM *> * mainWndList() + const Q3ValueList<PwM *> * mainWndList() { return &_mainWndList; } /** create a new document */ PwMDoc * createDoc(); @@ -214,7 +213,7 @@ protected: /** pointer to the tray icon */ PwMTray *_tray; /** list of all open main windows */ - QValueList<PwM *> _mainWndList; + Q3ValueList<PwM *> _mainWndList; /** saved command line options. */ savedCmd_t savedCmd; }; 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 @@ -28,6 +28,8 @@ #include <qstringlist.h> #include <qsize.h> +//Added by qt3to4: +#include <Q3ValueList> #include <kpimprefs.h> @@ -150,8 +152,8 @@ public: bool mClose; //US ENH - QValueList<int> mCommentSplitter; - QValueList<int> mCategorySplitter; + Q3ValueList<int> mCommentSplitter; + Q3ValueList<int> mCategorySplitter; // US introduce a nonconst way to return the config object. 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 @@ -32,6 +32,9 @@ #endif #include <klocale.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <QMouseEvent> void ActiveTreeItem::execIt() @@ -87,12 +90,12 @@ void ActiveTreeItem::execIt() break; } case openMainWnd: { // search if there is already an open window. - const QValueList<PwM *> *wl = tray->init->mainWndList(); + const Q3ValueList<PwM *> *wl = tray->init->mainWndList(); #ifndef PWM_EMBEDDED - QValueList<PwM *>::const_iterator i = wl->begin(), + Q3ValueList<PwM *>::const_iterator i = wl->begin(), end = wl->end(); #else - QValueList<PwM *>::ConstIterator i = wl->begin(), + Q3ValueList<PwM *>::ConstIterator i = wl->begin(), end = wl->end(); #endif PwM *wnd; @@ -178,7 +181,7 @@ void PwMTray::buildMain() void PwMTray::insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, ActiveTreeItem::Task task, PwMDoc *doc, int docCategory, int docEntry, - QValueList<int> *activeItemsList) + Q3ValueList<int> *activeItemsList) { ActiveTreeItem *activeItem; int id; @@ -196,7 +199,7 @@ void PwMTray::insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, } void PwMTray::rebuildTree(KPopupMenu *popup, PwMDoc *doc, - QValueList<int> *activeItems) + Q3ValueList<int> *activeItems) { PWM_ASSERT(doc); PWM_ASSERT(popup); @@ -334,11 +337,11 @@ void PwMTray::updateTree(PwMDoc *document) if (treeItemNum != -1) { // delete all *old* active items KPopupMenu *ctxMenu = contextMenu(); - QValueList<int> *oldItems = &tree[treeItemNum].activeItems; + Q3ValueList<int> *oldItems = &tree[treeItemNum].activeItems; #ifndef PWM_EMBEDDED - QValueList<int>::iterator i = oldItems->begin(); + Q3ValueList<int>::iterator i = oldItems->begin(); #else - QValueList<int>::Iterator i = oldItems->begin(); + Q3ValueList<int>::Iterator i = oldItems->begin(); #endif while (i != oldItems->end()) { ctxMenu->removeItem(*i); @@ -481,6 +484,6 @@ void PwMTray::undock() // Attention! "this" is already deleted here! } -#ifndef PWM_EMBEDDED -#include "pwmtray.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_pwmtray.cpp" #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 @@ -27,7 +27,10 @@ #include <kpopupmenu.h> #include <qpainter.h> -#include <qvaluelist.h> +#include <q3valuelist.h> +//Added by qt3to4: +#include <QMouseEvent> +#include <QMenuItem> //#include "pwmexception.h" @@ -36,8 +39,7 @@ class PwMDoc; class PwMTray; /* wrapper to workaround MOC problems */ -class __ActiveTreeItem : public QCustomMenuItem - , public QObject +class __ActiveTreeItem : public QMenuItem { public: __ActiveTreeItem() {} @@ -87,14 +89,14 @@ public: bool /*enabled*/, int x, int y, int w, int h) { p->setFont(font); - p->drawText(x, y, w, h, AlignLeft | AlignVCenter | - DontClip | ShowPrefix, text); + p->drawText(x, y, w, h, Qt::AlignLeft | Qt::AlignVCenter | + Qt::DontClip | Qt::ShowPrefix, text); } QSize sizeHint() { - return QFontMetrics(font).size(AlignLeft | AlignVCenter | - ShowPrefix | DontClip, text); + return QFontMetrics(font).size(Qt::AlignLeft | Qt::AlignVCenter | + Qt::ShowPrefix | Qt::DontClip, text); } bool fullSpan() const @@ -122,7 +124,7 @@ protected: /** tray icon implementation */ #ifndef PWM_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN class PwMTray : public KSystemTray { Q_OBJECT @@ -134,7 +136,7 @@ class PwMTray : public KSystemTray int menuId; PwMDoc *doc; KPopupMenu *menu; - QValueList<int> activeItems; // ids of all active items + Q3ValueList<int> activeItems; // ids of all active items }; public: @@ -170,7 +172,7 @@ protected: /** holds a list of all open files, its documents and * its menuIDs */ - QValueList<struct treeItem> tree; + Q3ValueList<struct treeItem> tree; /** pointer to init */ PwMInit *init; @@ -185,7 +187,7 @@ protected: void buildMain(); /** rebuilds the tree for the given KPopupMenu entry */ void rebuildTree(KPopupMenu *popup, PwMDoc *doc, - QValueList<int> *activeItems); + Q3ValueList<int> *activeItems); /** insert a new tree-entry for the given doc and returns the ID.*/ int insertTreeEntry(PwMDoc *doc, KPopupMenu **popup); /** removes a tree entry */ @@ -194,7 +196,7 @@ protected: void insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, ActiveTreeItem::Task task, PwMDoc *doc, int docCategory, int docEntry, - QValueList<int> *activeItemsList); + Q3ValueList<int> *activeItemsList); /** mouse event on icon */ void mouseReleaseEvent(QMouseEvent *e); /** inserts the items for the main window control @@ -202,7 +204,7 @@ protected: */ void insertMainWndCtrl(KPopupMenu *menu, PwMDoc *doc); }; -//MOC_SKIP_END +#endif #else class PwMTray : public QWidget { @@ -215,7 +217,7 @@ class PwMTray : public QWidget int menuId; PwMDoc *doc; KPopupMenu *menu; - QValueList<int> activeItems; // ids of all active items + Q3ValueList<int> activeItems; // ids of all active items }; public: @@ -255,7 +257,7 @@ protected: /** holds a list of all open files, its documents and * its menuIDs */ - QValueList<struct treeItem> tree; + Q3ValueList<struct treeItem> tree; /** pointer to init */ PwMInit *init; @@ -270,7 +272,7 @@ protected: void buildMain(); /** rebuilds the tree for the given KPopupMenu entry */ void rebuildTree(KPopupMenu *popup, PwMDoc *doc, - QValueList<int> *activeItems); + Q3ValueList<int> *activeItems); /** insert a new tree-entry for the given doc and returns the ID.*/ int insertTreeEntry(PwMDoc *doc, KPopupMenu **popup); /** removes a tree entry */ @@ -279,7 +281,7 @@ protected: void insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, ActiveTreeItem::Task task, PwMDoc *doc, int docCategory, int docEntry, - QValueList<int> *activeItemsList); + Q3ValueList<int> *activeItemsList); /** mouse event on icon */ void mouseReleaseEvent(QMouseEvent *e); /** inserts the items for the main window control 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 @@ -35,7 +35,15 @@ #include <qlineedit.h> #include <qpoint.h> #include <qapplication.h> +#include <QDesktopWidget> #include <qlayout.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <QKeyEvent> +#include <QLabel> +#include <QResizeEvent> +#include <Q3PopupMenu> +#include <Q3VBoxLayout> //US ENH: wouldn't it be a good idea if we could use this consts everywhere else. //US ENH: for examle in listviewpwm.cpp @@ -76,7 +84,7 @@ PwMView::~PwMView() void PwMView::initCtxMenu() { - ctxMenu = new QPopupMenu(this); + ctxMenu = new Q3PopupMenu(this); ctxMenu->insertItem(i18n("&Add password"), mainClass, SLOT(addPwd_slot())); ctxMenu->insertSeparator(); ctxMenu->insertItem(i18n("&Edit"), mainClass, SLOT(editPwd_slot())); @@ -106,7 +114,7 @@ void PwMView::resizeEvent(QResizeEvent *) resizeView(size()); } -void PwMView::refreshCommentTextEdit(QListViewItem *curItem) +void PwMView::refreshCommentTextEdit(Q3ListViewItem *curItem) { PWM_ASSERT(commentBox); if (!curItem) @@ -136,14 +144,14 @@ void PwMView::keyReleaseEvent(QKeyEvent * /*e*/) bool PwMView::getCurEntryIndex(unsigned int *index) { - QListViewItem *current = lv->currentItem(); + Q3ListViewItem *current = lv->currentItem(); if (!current) return false; return getDocEntryIndex(index, current); } bool PwMView::getDocEntryIndex(unsigned int *index, - const QListViewItem *item) + const Q3ListViewItem *item) { vector<unsigned int> foundPositions; PwMDataItem curItem; @@ -166,12 +174,12 @@ bool PwMView::getDocEntryIndex(unsigned int *index, return false; } -void PwMView::handleToggle(QListViewItem *item) +void PwMView::handleToggle(Q3ListViewItem *item) { PWM_ASSERT(doc); if (!item) return; - QCheckListItem *clItem = (QCheckListItem *)item; + Q3CheckListItem *clItem = (Q3CheckListItem *)item; QString curCat(getCurrentCategory()); // find document position of this entry. @@ -195,7 +203,7 @@ void PwMView::handleToggle(QListViewItem *item) doc->lockAt(curCat, curEntryDocIndex, !clItem->isOn()); } -void PwMView::handleRightClick(QListViewItem *item, const QPoint &point, int) +void PwMView::handleRightClick(Q3ListViewItem *item, const QPoint &point, int) { if (!item) return; @@ -274,7 +282,7 @@ void PwMView::shiftToView() lv->setColumnText(COLUMN_PW, catItem->pw_text.c_str()); } - QCheckListItem *newItem; + Q3CheckListItem *newItem; vector<PwMDataItem>::iterator it = tmpSorted.begin(), end = tmpSorted.end(); while (it != end) { @@ -313,7 +321,7 @@ void PwMView::reorgLp() return; PWM_ASSERT(doc); PWM_ASSERT(!doc->isDocEmpty()); - QListViewItem *currItem; + Q3ListViewItem *currItem; vector<unsigned int> foundPos; /* This searchIn _should_ be: * const unsigned int searchIn = SEARCH_IN_DESC; @@ -355,7 +363,7 @@ void PwMView::reorgLp() void PwMView::selAt(int index) { - QListViewItem *item = lv->itemAtIndex(index); + Q3ListViewItem *item = lv->itemAtIndex(index); if (!item) return; lv->setCurrentItem(item); @@ -479,7 +487,7 @@ void PwMView::copyCommentToClip() PwMDataItemView::PwMDataItemView( QWidget *parent, const char *name ) - : QTextBrowser( parent, name ) + : Q3TextBrowser( parent, name ) { @@ -566,24 +574,24 @@ PwMDataItemChooser::PwMDataItemChooser( PwMDataItem loc, PwMDataItem rem, bool t findButton( User1 )->setText( i18n("Local")); QWidget* topframe = new QWidget( this ); setMainWidget( topframe ); - QBoxLayout* bl; + Q3BoxLayout* bl; if ( QApplication::desktop()->width() < 640 ) { - bl = new QVBoxLayout( topframe ); + bl = new Q3VBoxLayout( topframe ); } else { - bl = new QHBoxLayout( topframe ); + bl = new Q3HBoxLayout( topframe ); } - QVBox* subframe = new QVBox( topframe ); + Q3VBox* subframe = new Q3VBox( topframe ); bl->addWidget(subframe ); QLabel* lab = new QLabel( i18n("Local Entry"), subframe ); if ( takeloc ) - lab->setBackgroundColor(Qt::green.light() ); + lab->setBackgroundColor(QColor(Qt::green).light() ); PwMDataItemView * av = new PwMDataItemView( subframe ); av->setPwMDataItem( loc ); - subframe = new QVBox( topframe ); + subframe = new Q3VBox( topframe ); bl->addWidget(subframe ); lab = new QLabel( i18n("Remote Entry"), subframe ); if ( !takeloc ) - lab->setBackgroundColor(Qt::green.light() ); + lab->setBackgroundColor(QColor(Qt::green).light() ); av = new PwMDataItemView( subframe ); av->setPwMDataItem( rem ); QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); @@ -618,6 +626,6 @@ void PwMDataItemChooser::slot_local() -#ifndef PWM_EMBEDDED -#include "pwmview.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_pwmview.cpp" #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 @@ -41,7 +41,11 @@ #include <qevent.h> #include <qfont.h> #include <qobject.h> -#include <qtextbrowser.h> +#include <q3textbrowser.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QKeyEvent> +#include <Q3PopupMenu> #include <vector> #include <string> @@ -77,7 +81,7 @@ public: * Note: This func only serches in the current category. */ bool getDocEntryIndex(unsigned int *index, - const QListViewItem *item); + const Q3ListViewItem *item); public slots: /** update the view (call if dirty) */ @@ -89,9 +93,9 @@ public slots: /** (re)sort all items and (re)shift them to listView. */ void shiftToView(); /** handle clicking on an item */ - void handleToggle(QListViewItem *item); + void handleToggle(Q3ListViewItem *item); /** handle right-clicking on an item */ - void handleRightClick(QListViewItem *item, const QPoint &point, int); + void handleRightClick(Q3ListViewItem *item, const QPoint &point, int); /** selects the item at "index" */ void selAt(int index); /** rename category button pressed */ @@ -101,7 +105,7 @@ public slots: protected: /** right-click context-menu */ - QPopupMenu *ctxMenu; + Q3PopupMenu *ctxMenu; protected: /** update the categories from document */ @@ -124,7 +128,7 @@ protected: protected slots: /** changes the comment text-edit, because a new item has been selected */ - void refreshCommentTextEdit(QListViewItem *curItem); + void refreshCommentTextEdit(Q3ListViewItem *curItem); /** copy pw to clipboard */ void copyPwToClip(); /** copy name to clipboard */ @@ -152,7 +156,7 @@ private: //US ENH basic widget to view an password entry. We need it for the sync stuff. //But might be oif interest for other functionalities as well. -class PwMDataItemView : public QTextBrowser +class PwMDataItemView : public Q3TextBrowser { public: PwMDataItemView( QWidget *parent = 0, const char *name = 0 ); 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 @@ -61,7 +61,7 @@ PwMViewStyle::~PwMViewStyle() delete_ifnot_null(s1); } -void PwMViewStyle::editPassWord( QListViewItem * i ) +void PwMViewStyle::editPassWord( Q3ListViewItem * i ) { if ( !i ) return; @@ -93,16 +93,16 @@ void PwMViewStyle::initStyle(style_t style) return; } curStyle = style; - connect(lv, SIGNAL(pressed(QListViewItem *)), - v, SLOT(handleToggle(QListViewItem *))); - connect(lv, SIGNAL(rightButtonClicked(QListViewItem *, const QPoint &, int)), - v, SLOT(handleRightClick(QListViewItem *, const QPoint &, int))); - connect(lv, SIGNAL(clicked(QListViewItem *)), - v, SLOT(refreshCommentTextEdit(QListViewItem *))); - connect(lv, SIGNAL(returnPressed(QListViewItem *)), - this, SLOT(editPassWord(QListViewItem *))); - connect(lv, SIGNAL(doubleClicked(QListViewItem *)), - this, SLOT(editPassWord(QListViewItem *))); + connect(lv, SIGNAL(pressed(Q3ListViewItem *)), + v, SLOT(handleToggle(Q3ListViewItem *))); + connect(lv, SIGNAL(rightButtonClicked(Q3ListViewItem *, const QPoint &, int)), + v, SLOT(handleRightClick(Q3ListViewItem *, const QPoint &, int))); + connect(lv, SIGNAL(clicked(Q3ListViewItem *)), + v, SLOT(refreshCommentTextEdit(Q3ListViewItem *))); + connect(lv, SIGNAL(returnPressed(Q3ListViewItem *)), + this, SLOT(editPassWord(Q3ListViewItem *))); + connect(lv, SIGNAL(doubleClicked(Q3ListViewItem *)), + this, SLOT(editPassWord(Q3ListViewItem *))); connect(lv, SIGNAL(insertPW()), this, SIGNAL( insertPW() )); connect(lv, SIGNAL(deletePW()), @@ -249,6 +249,6 @@ int PwMViewStyle::numCategories() return 0; } -#ifndef PWM_EMBEDDED -#include "pwmviewstyle.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_pwmviewstyle.cpp" #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 @@ -23,18 +23,18 @@ #include <qwidget.h> #include <qsplitter.h> -#include <qhbox.h> -#include <qvbox.h> +#include <q3hbox.h> +#include <q3vbox.h> #include <qpushbutton.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #ifndef PWM_EMBEDDED -#include <qtextedit.h> +#include <q3textedit.h> #else -#include <qmultilineedit.h> +#include <q3multilineedit.h> #endif #include <qlabel.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qcombobox.h> #include <qsize.h> @@ -42,7 +42,7 @@ class ListViewPwM; class PwMViewStyle_0; class PwMViewStyle_1; class PwMView; -class QListViewItem; +class Q3ListViewItem; class CommentBox; class PwMViewStyle : public QWidget @@ -94,7 +94,7 @@ protected: CommentBox *commentBox; protected slots: - void editPassWord( QListViewItem * ); + void editPassWord( Q3ListViewItem * ); private: /** which style has the view? 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 @@ -26,13 +26,16 @@ #include <kglobal.h> #include <kiconloader.h> #include "pwmprefs.h" +//Added by qt3to4: +#include <QLabel> +#include <Q3ValueList> PwMViewStyle_0::PwMViewStyle_0(PwMView *view) : QObject() { - vbox1 = new QVBox(view); + vbox1 = new Q3VBox(view); vbox1->setSpacing(0); - hbox1 = new QHBox(vbox1); + hbox1 = new Q3HBox(vbox1); hbox1->setSpacing(0); categoriesTitle = new QLabel(hbox1); categoriesTitle->setText(i18n("Category:")); @@ -46,8 +49,8 @@ PwMViewStyle_0::PwMViewStyle_0(PwMView *view) delCatButton->setPixmap (KGlobal::iconLoader()->loadIcon("editdelete", KIcon::Small) ); maxsi = delCatButton->sizeHint().height()+4; delCatButton->setMinimumSize( maxsi, maxsi ); - delCatButton->setFocusPolicy( QWidget::NoFocus ); - renCatButton->setFocusPolicy( QWidget::NoFocus ); + delCatButton->setFocusPolicy( Qt::NoFocus ); + renCatButton->setFocusPolicy( Qt::NoFocus ); #ifndef PWM_EMBEDDED splitter1 = new QSplitter(vbox1); @@ -81,9 +84,9 @@ PwMViewStyle_0::~PwMViewStyle_0() void PwMViewStyle_0::toggleSplitter() { - QValueList<int> si = splitter1->sizes(); + Q3ValueList<int> si = splitter1->sizes(); splitter1->toggle(); - QValueList<int> si2 = splitter1->sizes(); + Q3ValueList<int> si2 = splitter1->sizes(); //qDebug("PwMViewStyle_0::toggleSplitter() %d %d %d %d", si[0],si[1],si2[0],si2[1] ); if ( si[0] == si2[0] && si[1] == si2[1] && si2[1] == 1 ) { int diff = si[0]/2; 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 @@ -20,14 +20,14 @@ #ifndef PWMVIEWSTYLE_0_H #define PWMVIEWSTYLE_0_H -#include <qhbox.h> -#include <qvbox.h> +#include <q3hbox.h> +#include <q3vbox.h> #include <qpushbutton.h> #ifndef PWM_EMBEDDED -#include <qtextedit.h> +#include <q3textedit.h> #include <qsplitter.h> #else -#include <qmultilineedit.h> +#include <q3multilineedit.h> #include <KDGanttMinimizeSplitter.h> #endif #include <qlabel.h> @@ -87,9 +87,9 @@ protected: /** title string for the categories combo or list box */ QLabel *categoriesTitle; /** hbox1 for widget style */ - QHBox *hbox1; + Q3HBox *hbox1; /** vbox1 for widget style */ - QVBox *vbox1; + Q3VBox *vbox1; /** splitter for commentTextEdit */ #ifndef PWM_EMBEDDED QSplitter *splitter1; 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 @@ -29,6 +29,12 @@ #include <qpe/qpeapplication.h> #else #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QLabel> +#include <Q3ValueList> +#include <Q3Frame> +#include <Q3PopupMenu> #endif #define INITIAL_CATEGORIES_WIDTH 100 @@ -54,9 +60,9 @@ PwMViewStyle_1::PwMViewStyle_1(PwMView *view) //US topLayout->addWidget(mMiniSplitter ); #endif - vbox1 = new QVBox(splitter); + vbox1 = new Q3VBox(splitter); categoriesTitle = new QLabel(vbox1); - categoriesList = new QListBox(vbox1); + categoriesList = new Q3ListBox(vbox1); #ifndef PWM_EMBEDDED splitter2 = new QSplitter(splitter); splitter2->setOrientation(Qt::Vertical); @@ -70,7 +76,7 @@ PwMViewStyle_1::PwMViewStyle_1(PwMView *view) commentBox = new CommentBox(splitter2); // set sizes and styles //US commentBox->resize(commentBox->size().width(), 60); - QValueList<int> sizes; + Q3ValueList<int> sizes; #ifndef PWM_EMBEDDED sizes.push_back(INITIAL_CATEGORIES_WIDTH); sizes.push_back(view->height() - INITIAL_CATEGORIES_WIDTH); @@ -81,12 +87,12 @@ PwMViewStyle_1::PwMViewStyle_1(PwMView *view) //US splitter->setSizes(sizes); categoriesTitle->setAlignment(Qt::AlignHCenter); #ifndef PWM_EMBEDDED - categoriesTitle->setFrameShape(QFrame::MenuBarPanel); + categoriesTitle->setFrameShape(Q3Frame::MenuBarPanel); #else //categoriesTitle->setFrameShape(QFrame::StyledPanel); #endif categoriesTitle->setText(i18n("Category:")); - catCtxMenu = new QPopupMenu(view); + catCtxMenu = new Q3PopupMenu(view); catCtxMenu->insertItem(i18n("&Rename"), view, SLOT(renCatButton_slot())); catCtxMenu->insertItem(i18n("&Delete"), @@ -100,9 +106,9 @@ PwMViewStyle_1::PwMViewStyle_1(PwMView *view) connect(categoriesList, SIGNAL(highlighted(int)), view, SLOT(shiftToView())); connect(categoriesList, - SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)), + SIGNAL(rightButtonClicked(Q3ListBoxItem *, const QPoint &)), this, - SLOT(catRightClick(QListBoxItem *, const QPoint &))); + SLOT(catRightClick(Q3ListBoxItem *, const QPoint &))); connect(lv, SIGNAL(toggleOverview()), this, SLOT(toggleSplitter())); @@ -115,9 +121,9 @@ PwMViewStyle_1::~PwMViewStyle_1() } void PwMViewStyle_1::toggleSplitter() { - QValueList<int> si = splitter2->sizes(); + Q3ValueList<int> si = splitter2->sizes(); splitter2->toggle(); - QValueList<int> si2 = splitter2->sizes(); + Q3ValueList<int> si2 = splitter2->sizes(); //qDebug("PwMViewStyle_1::toggleSplitter() %d %d %d %d", si[0],si[1],si2[0],si2[1] ); if ( si[0] == si2[0] && si[1] == si2[1] && si2[1] == 1 ) { int diff = si[0]/2; @@ -130,7 +136,7 @@ void PwMViewStyle_1::toggleSplitter() } } -void PwMViewStyle_1::catRightClick(QListBoxItem *item, const QPoint &point) +void PwMViewStyle_1::catRightClick(Q3ListBoxItem *item, const QPoint &point) { if (!item) return; @@ -187,6 +193,6 @@ void PwMViewStyle_1::saveSettings(PWMPrefs* prefs) } -#ifndef PWM_EMBEDDED -#include "pwmviewstyle_1.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_pwmviewstyle_1.cpp" #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 @@ -20,19 +20,19 @@ #ifndef PWMVIEWSTYLE_1_H #define PWMVIEWSTYLE_1_H -#include <qvbox.h> +#include <q3vbox.h> #ifndef PWM_EMBEDDED -#include <qtextedit.h> +#include <q3textedit.h> #include <qsplitter.h> #else -#include <qmultilineedit.h> +#include <q3multilineedit.h> #include <KDGanttMinimizeSplitter.h> #endif #include <qlabel.h> -#include <qlistbox.h> -#include <qpopupmenu.h> +#include <q3listbox.h> +#include <q3popupmenu.h> class PwMView; class ListViewPwM; @@ -82,7 +82,7 @@ public slots: void toggleSplitter(); protected slots: /** user clicked right button in category list */ - void catRightClick(QListBoxItem *item, const QPoint &point); + void catRightClick(Q3ListBoxItem *item, const QPoint &point); protected: /** main list view */ @@ -100,15 +100,15 @@ protected: #endif /** categories list-box */ - QListBox *categoriesList; + Q3ListBox *categoriesList; /** title string for the categories combo or list box */ QLabel *categoriesTitle; /** hbox1 for widget style */ - QVBox *vbox1; + Q3VBox *vbox1; /** text-edit to display the comment */ CommentBox *commentBox; /** category list context menu */ - QPopupMenu *catCtxMenu; + Q3PopupMenu *catCtxMenu; }; #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 @@ -53,7 +53,7 @@ Randomizer::Randomizer() // probe for /dev/urandom rndDev->setName("/dev/urandom"); if (rndDev->exists() && - rndDev->open(IO_ReadOnly)) { + rndDev->open(QIODevice::ReadOnly)) { printDebug("Randomizer: using /dev/urandom"); return; } @@ -61,7 +61,7 @@ Randomizer::Randomizer() // probe for /dev/random rndDev->setName("/dev/random"); if (rndDev->exists() && - rndDev->open(IO_ReadOnly)) { + rndDev->open(QIODevice::ReadOnly)) { printDebug("Randomizer: using /dev/random"); return; } @@ -71,7 +71,7 @@ Randomizer::Randomizer() if (fn) { rndDev->setName(fn); if (rndDev->exists() && - rndDev->open(IO_ReadOnly)) { + rndDev->open(QIODevice::ReadOnly)) { printDebug(string("Randomizer: using $RANDFILE \"") + fn + "\" (aka EGD)"); 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 @@ -20,16 +20,19 @@ #include "rencatwnd.h" #include <klocale.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> RenCatWnd::RenCatWnd(QWidget *parent, - const char *name, bool modal, WFlags f) + const char *name, bool modal, Qt::WFlags f) : QDialog(parent, name, true, f) { - vbox1 = new QVBox(this); + vbox1 = new Q3VBox(this); label = new QLabel(vbox1); newName = new QLineEdit(vbox1); - hbox1 = new QHBox(vbox1); + hbox1 = new Q3HBox(vbox1); okButton = new QPushButton(i18n("&Ok"), hbox1); cancelButton = new QPushButton(i18n("&Cancel"), hbox1); @@ -65,6 +68,6 @@ void RenCatWnd::cancelButton_slot() done(2); } -#ifndef PWM_EMBEDDED -#include "rencatwnd.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_rencatwnd.cpp" #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 @@ -20,13 +20,15 @@ #ifndef RENCATWND_H #define RENCATWND_H -#include <qvbox.h> -#include <qhbox.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qdialog.h> #include <qlabel.h> #include <qlineedit.h> #include <qpushbutton.h> #include <qevent.h> +//Added by qt3to4: +#include <QResizeEvent> /** rename category window */ @@ -35,7 +37,7 @@ class RenCatWnd : public QDialog Q_OBJECT public: RenCatWnd(QWidget *parent = 0, const char *name = 0, - bool modal = FALSE, WFlags f = 0); + bool modal = FALSE, Qt::WFlags f = 0); ~RenCatWnd(); QString getNewName() @@ -46,8 +48,8 @@ protected slots: void cancelButton_slot(); protected: - QVBox *vbox1; - QHBox *hbox1; + Q3VBox *vbox1; + Q3HBox *hbox1; QLabel *label; QLineEdit *newName; QPushButton *okButton; 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 @@ -24,6 +24,8 @@ #ifdef PWM_EMBEDDED #include <kglobal.h> #include <klocale.h> +//Added by qt3to4: +#include <Q3CString> #endif /* enable/disable serializer debugging (0/1) */ @@ -146,7 +148,7 @@ Serializer::Serializer() #endif } -Serializer::Serializer(const QCString &buffer) +Serializer::Serializer(const Q3CString &buffer) { defaultLockStat = true; //US BUG: I needed to specify a document name. Otherwise impl will not be created for serializing @@ -177,7 +179,7 @@ void Serializer::clear() domDoc = new QDomDocument; } -bool Serializer::parseXml(const QCString &buffer) +bool Serializer::parseXml(const Q3CString &buffer) { //abort(); //qDebug("parse %s ", buffer.data()); @@ -198,33 +200,33 @@ bool Serializer::parseXml(const QCString &buffer) return true; } -QCString Serializer::getXml() +Q3CString Serializer::getXml() { PWM_ASSERT(domDoc); #ifndef PWM_EMBEDDED #if defined(PWM_DEBUG) && SERIALIZER_DEBUG != 0 - QCString tmp(domDoc->toCString(8)); + Q3CString tmp(domDoc->toCString(8)); printDebug("<BEGIN Serializer::getXml() dump>\n"); cout << tmp << endl; printDebug("<END Serializer::getXml() dump>"); #endif // DEBUG - QCString ret(domDoc->toCString(0)); + Q3CString ret(domDoc->toCString(0)); ret.replace('\n', ""); return ret; #else #if defined(PWM_DEBUG) && SERIALIZER_DEBUG != 0 - QCString tmp(" " + domDoc->toCString()); + Q3CString tmp(" " + domDoc->toCString()); printDebug("<BEGIN Serializer::getXml() dump>\n"); qDebug(tmp); cout << tmp << endl; printDebug("<END Serializer::getXml() dump>"); #endif // DEBUG - QCString ret(domDoc->toCString()); - ret.replace(QRegExp("\n"), ""); + Q3CString ret(domDoc->toByteArray()); + ret.replace("\n", ""); return ret; #endif 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 @@ -23,7 +23,7 @@ #include "pwmdoc.h" -#include <qcstring.h> +#include <q3cstring.h> #include <qdom.h> #include <vector> @@ -40,16 +40,16 @@ public: /** construct an empty serializer document */ Serializer(); /** construct a serializer document and parse "buffer" */ - Serializer(const QCString &buffer); + Serializer(const Q3CString &buffer); /** destructor */ virtual ~Serializer(); /** clears all data */ void clear(); /** parse the given data buffer */ - bool parseXml(const QCString &buffer); + bool parseXml(const Q3CString &buffer); /** returns the current XML data */ - QCString getXml(); + Q3CString getXml(); /** serialize "dta" and store it as XML data */ //US ENH: we need to serialize and deserialize not only categories, but also synctargets bool serialize(PwMItem &dta); 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 @@ -31,6 +31,9 @@ $Id$ #include <qlabel.h> #include <qlineedit.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3GridLayout> #include <klocale.h> @@ -57,7 +60,7 @@ setMasterPwWnd::setMasterPwWnd( QWidget* parent, const char* name ) KDialogBase::Ok, parent, name, true ) { QWidget *page = plainPage(); - QVBoxLayout *pageLayout = new QVBoxLayout( page ); + Q3VBoxLayout *pageLayout = new Q3VBoxLayout( page ); mainTab = new QTabWidget( page ); pageLayout->addWidget( mainTab ); @@ -70,12 +73,12 @@ setMasterPwWnd::setMasterPwWnd( QWidget* parent, const char* name ) // This is the Password tab1 tab = new QWidget( mainTab ); - QGridLayout *layout = new QGridLayout( tab, 5, 1 ); + Q3GridLayout *layout = new Q3GridLayout( tab, 5, 1 ); layout->setMargin( KDialogBase::marginHint() ); layout->setSpacing( KDialogBase::spacingHint() ); QLabel* label = new QLabel( i18n( "Using a normal password-string to encrypt the data." ), tab ); - label->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); + label->setAlignment( int( Qt::WordBreak | Qt::AlignCenter ) ); layout->addWidget(label, 0, 0); pwEdit_1 = new QLineEdit( tab, "pwEdit_1" ); @@ -99,16 +102,16 @@ setMasterPwWnd::setMasterPwWnd( QWidget* parent, const char* name ) // This is the Password tab2 tab_2 = new QWidget( mainTab ); - layout = new QGridLayout( tab_2, 5, 1 ); + layout = new Q3GridLayout( tab_2, 5, 1 ); layout->setMargin( KDialogBase::marginHint() ); layout->setSpacing( KDialogBase::spacingHint() ); label = new QLabel( i18n( "Using a PwM key-card to encrypt the data." ), tab_2 ); - label->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); + label->setAlignment( int( Qt::WordBreak | Qt::AlignCenter ) ); layout->addWidget(label, 0, 0); label = new QLabel( i18n( "selected card:" ), tab_2 ); - label->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + label->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) ); layout->addWidget(label, 1, 0); selCardButton = new QPushButton( i18n( "&Select the currently inserted card as key-card" ), tab_2 ); 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 @@ -27,6 +27,8 @@ $Id$ #define SETMASTERPWWND_EMB_H #include <kdialogbase.h> +//Added by qt3to4: +#include <QLabel> class QLineEdit; class QPushButton; 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 @@ -188,6 +188,6 @@ string SetMasterPwWndImpl::getPw(bool *useCard) return ""; } -#ifndef PWM_EMBEDDED -#include "setmasterpwwndimpl.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_setmasterpwwndimpl.cpp" #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 @@ -22,6 +22,10 @@ #include "pwmexception.h" #include <qmessagebox.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QCloseEvent> +#include <QLabel> #include <klocale.h> @@ -29,11 +33,11 @@ WaitWnd::WaitWnd(QString caption, QString _staticText, bool showCancelButton, bool showGenericText, QWidget *parent, - const char *name, bool modal, WFlags f) + const char *name, bool modal, Qt::WFlags f) : QDialog(parent, name, modal, f) { canClose = false; - vbox1 = new QVBox(this); + vbox1 = new Q3VBox(this); staticText = new QLabel(vbox1); if (showGenericText) { genericText = new QLabel(vbox1); @@ -89,6 +93,6 @@ void WaitWnd::updateGenericText(const QString &text) genericText->setText(text); } -#ifndef PWM_EMBEDDED -#include "waitwnd.moc" +#ifndef PWM_EMBEDDED_ +#include "moc_waitwnd.cpp" #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 @@ -20,11 +20,14 @@ #ifndef WAITWND_H #define WAITWND_H -#include <qvbox.h> +#include <q3vbox.h> #include <qdialog.h> #include <qlabel.h> #include <qpushbutton.h> #include <qevent.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QCloseEvent> /** window to ask the user to wait */ class WaitWnd : public QDialog @@ -34,7 +37,7 @@ public: WaitWnd(QString caption, QString _staticText, bool showCancelButton, bool showGenericText, QWidget *parent = 0, const char *name = 0, - bool modal = FALSE, WFlags f = 0); + bool modal = FALSE, Qt::WFlags f = 0); ~WaitWnd(); void updateGenericText(const QString &text); @@ -46,7 +49,7 @@ protected slots: void cancel_slot(); protected: - QVBox *vbox1; + Q3VBox *vbox1; QLabel *staticText; QLabel *genericText; QPushButton *cancelButton; diff --git a/qtcompat/qptrlist.h b/qtcompat/qptrlist.h index 8ce6868..c3d3ca2 100644 --- a/qtcompat/qptrlist.h +++ b/qtcompat/qptrlist.h @@ -1,6 +1,8 @@ #ifndef QTCOMPAT_QPTRLIST_H #define QTCOMPAT_QPTRLIST_H +#if 0 + #include <qlist.h> #define QPtrList QList @@ -8,3 +10,5 @@ #define QPtrCollection QCollection #endif + +#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 @@ #ifndef QTCOMPAT_QPTRSTACK_H #define QTCOMPAT_QPTRSTACK_H +#if 0 + #include <qstack.h> #define QPtrStack QStack #define QPtrStackIterator QStackIterator #endif + +#endif |