summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Unidiff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp146
1 files changed, 78 insertions, 68 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index ab2824c..03b44d1 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -41,3 +41,13 @@ $Id$
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qprogressbar.h> 42#include <q3progressbar.h>
43#include <QDesktopWidget>
44//Added by qt3to4:
45#include <QResizeEvent>
46#include <QPixmap>
47#include <Q3ValueList>
48#include <Q3HBoxLayout>
49#include <Q3VBoxLayout>
50#include <Q3CString>
51#include <Q3PopupMenu>
52#include <Q3PtrList>
43#include <libkdepim/phoneaccess.h> 53#include <libkdepim/phoneaccess.h>
@@ -49,6 +59,6 @@ $Id$
49#include <qapplicaton.h> 59#include <qapplicaton.h>
50#include <qprogressbar.h> 60#include <q3progressbar.h>
51#include <qlayout.h> 61#include <qlayout.h>
52#include <qregexp.h> 62#include <qregexp.h>
53#include <qvbox.h> 63#include <q3vbox.h>
54#include <kabc/addresseelist.h> 64#include <kabc/addresseelist.h>
@@ -90,3 +100,3 @@ $Id$
90 100
91#include <qapp.h> 101#include <qapplication.h>
92#include <qmenubar.h> 102#include <qmenubar.h>
@@ -131,8 +141,8 @@ $Id$
131#include <qfile.h> 141#include <qfile.h>
132#include <qvbox.h> 142#include <q3vbox.h>
133#include <qlayout.h> 143#include <qlayout.h>
134#include <qclipboard.h> 144#include <qclipboard.h>
135#include <qtextstream.h> 145#include <q3textstream.h>
136#include <qradiobutton.h> 146#include <qradiobutton.h>
137#include <qbuttongroup.h> 147#include <q3buttongroup.h>
138 148
@@ -177,3 +187,3 @@ class KABCatPrefs : public QDialog
177 setCaption( i18n("Manage new Categories") ); 187 setCaption( i18n("Manage new Categories") );
178 QVBoxLayout* lay = new QVBoxLayout( this ); 188 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
179 lay->setSpacing( 3 ); 189 lay->setSpacing( 3 );
@@ -182,3 +192,3 @@ class KABCatPrefs : public QDialog
182 lay->addWidget( lab ); 192 lay->addWidget( lab );
183 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 193 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("New categories not in list:"), this );
184 lay->addWidget( format ); 194 lay->addWidget( format );
@@ -209,3 +219,3 @@ class KABFormatPrefs : public QDialog
209 setCaption( i18n("Set formatted name") ); 219 setCaption( i18n("Set formatted name") );
210 QVBoxLayout* lay = new QVBoxLayout( this ); 220 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
211 lay->setSpacing( 3 ); 221 lay->setSpacing( 3 );
@@ -214,3 +224,3 @@ class KABFormatPrefs : public QDialog
214 lay->addWidget( lab ); 224 lay->addWidget( lab );
215 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); 225 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Set formatted name to:"), this );
216 lay->addWidget( format ); 226 lay->addWidget( format );
@@ -247,3 +257,3 @@ class KAex2phonePrefs : public QDialog
247 setCaption( i18n("Export to phone options") ); 257 setCaption( i18n("Export to phone options") );
248 QVBoxLayout* lay = new QVBoxLayout( this ); 258 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
249 lay->setSpacing( 3 ); 259 lay->setSpacing( 3 );
@@ -252,5 +262,5 @@ class KAex2phonePrefs : public QDialog
252 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 262 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
253 lab->setAlignment (AlignHCenter ); 263 lab->setAlignment (Qt::AlignHCenter );
254 QHBox* temphb; 264 Q3HBox* temphb;
255 temphb = new QHBox( this ); 265 temphb = new Q3HBox( this );
256 new QLabel( i18n("I/O device: "), temphb ); 266 new QLabel( i18n("I/O device: "), temphb );
@@ -258,3 +268,3 @@ class KAex2phonePrefs : public QDialog
258 lay->addWidget( temphb ); 268 lay->addWidget( temphb );
259 temphb = new QHBox( this ); 269 temphb = new Q3HBox( this );
260 new QLabel( i18n("Connection: "), temphb ); 270 new QLabel( i18n("Connection: "), temphb );
@@ -262,3 +272,3 @@ class KAex2phonePrefs : public QDialog
262 lay->addWidget( temphb ); 272 lay->addWidget( temphb );
263 temphb = new QHBox( this ); 273 temphb = new Q3HBox( this );
264 new QLabel( i18n("Model(opt.): "), temphb ); 274 new QLabel( i18n("Model(opt.): "), temphb );
@@ -269,3 +279,3 @@ class KAex2phonePrefs : public QDialog
269 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); 279 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) );
270 lab->setAlignment (AlignHCenter); 280 lab->setAlignment (Qt::AlignHCenter);
271 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 281 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
@@ -409,3 +419,3 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
409} 419}
410void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data ) 420void KABCore::receiveStart( const Q3CString& cmsg, const QByteArray& data )
411{ 421{
@@ -423,5 +433,5 @@ void KABCore::loadDataAfterStart()
423#ifndef DESKTOP_VERSION 433#ifndef DESKTOP_VERSION
424 disconnect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT (receiveStart ( const QCString &, const QByteArray & ))); 434 disconnect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT (receiveStart ( const Q3CString &, const QByteArray & )));
425 435
426 QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 436 QObject::connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & )));
427 if ( !mCStringMess.isEmpty() ) 437 if ( !mCStringMess.isEmpty() )
@@ -455,3 +465,3 @@ KABCore::~KABCore()
455} 465}
456void KABCore::receive( const QCString& cmsg, const QByteArray& data ) 466void KABCore::receive( const Q3CString& cmsg, const QByteArray& data )
457{ 467{
@@ -459,3 +469,3 @@ void KABCore::receive( const QCString& cmsg, const QByteArray& data )
459 if ( cmsg == "setDocument(QString)" ) { 469 if ( cmsg == "setDocument(QString)" ) {
460 QDataStream stream( data, IO_ReadOnly ); 470 QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly );
461 QString fileName; 471 QString fileName;
@@ -482,3 +492,3 @@ void KABCore::toggleBeamReceive( )
482 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; 492 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ;
483 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); 493 QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(receive( const Q3CString&, const QByteArray& )));
484#endif 494#endif
@@ -562,3 +572,3 @@ void KABCore::restoreSettings()
562#endif 572#endif
563 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; 573 Q3ValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter;
564 if ( true /*splitterSize.count() == 0*/ ) { 574 if ( true /*splitterSize.count() == 0*/ ) {
@@ -652,6 +662,6 @@ KABC::Resource *KABCore::requestResource( QWidget *parent )
652{ 662{
653 QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); 663 Q3PtrList<KABC::Resource> kabcResources = addressBook()->resources();
654 664
655 QPtrList<KRES::Resource> kresResources; 665 Q3PtrList<KRES::Resource> kresResources;
656 QPtrListIterator<KABC::Resource> resIt( kabcResources ); 666 Q3PtrListIterator<KABC::Resource> resIt( kabcResources );
657 KABC::Resource *resource; 667 KABC::Resource *resource;
@@ -797,3 +807,3 @@ void KABCore::mailVCard( const QStringList& uids )
797 807
798 if ( outFile.open(IO_WriteOnly) ) { // file opened successfully 808 if ( outFile.open(QIODevice::WriteOnly) ) { // file opened successfully
799 KABC::VCardConverter converter; 809 KABC::VCardConverter converter;
@@ -803,4 +813,4 @@ void KABCore::mailVCard( const QStringList& uids )
803 813
804 QTextStream t( &outFile ); // use a text stream 814 Q3TextStream t( &outFile ); // use a text stream
805 t.setEncoding( QTextStream::UnicodeUTF8 ); 815 t.setEncoding( Q3TextStream::UnicodeUTF8 );
806 t << vcard; 816 t << vcard;
@@ -1018,7 +1028,7 @@ void KABCore::beamVCard(const QStringList& uids)
1018 QFile outFile(fileName); 1028 QFile outFile(fileName);
1019 if ( outFile.open(IO_WriteOnly) ) { 1029 if ( outFile.open(QIODevice::WriteOnly) ) {
1020 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 1030 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
1021 QTextStream t( &outFile ); // use a text stream 1031 Q3TextStream t( &outFile ); // use a text stream
1022 //t.setEncoding( QTextStream::UnicodeUTF8 ); 1032 //t.setEncoding( QTextStream::UnicodeUTF8 );
1023 t.setEncoding( QTextStream::Latin1 ); 1033 t.setEncoding( Q3TextStream::Latin1 );
1024 t <<datastream.latin1(); 1034 t <<datastream.latin1();
@@ -1299,6 +1309,6 @@ void KABCore::newContact()
1299 1309
1300 QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); 1310 Q3PtrList<KABC::Resource> kabcResources = mAddressBook->resources();
1301 1311
1302 QPtrList<KRES::Resource> kresResources; 1312 Q3PtrList<KRES::Resource> kresResources;
1303 QPtrListIterator<KABC::Resource> it( kabcResources ); 1313 Q3PtrListIterator<KABC::Resource> it( kabcResources );
1304 KABC::Resource *resource; 1314 KABC::Resource *resource;
@@ -1858,3 +1868,3 @@ void KABCore::initGUI()
1858#ifndef KAB_EMBEDDED 1868#ifndef KAB_EMBEDDED
1859 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1869 Q3HBoxLayout *topLayout = new Q3HBoxLayout( this );
1860 topLayout->setSpacing( KDialogBase::spacingHint() ); 1870 topLayout->setSpacing( KDialogBase::spacingHint() );
@@ -1866,3 +1876,3 @@ void KABCore::initGUI()
1866 1876
1867 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1877 Q3VBox *viewSpace = new Q3VBox( mDetailsSplitter );
1868 mIncSearchWidget = new IncSearchWidget( viewSpace ); 1878 mIncSearchWidget = new IncSearchWidget( viewSpace );
@@ -1890,10 +1900,10 @@ void KABCore::initGUI()
1890 // Viewmanager needs this menu to plugin submenues. 1900 // Viewmanager needs this menu to plugin submenues.
1891 viewMenu = new QPopupMenu( this ); 1901 viewMenu = new Q3PopupMenu( this );
1892 settingsMenu = new QPopupMenu( this ); 1902 settingsMenu = new Q3PopupMenu( this );
1893 //filterMenu = new QPopupMenu( this ); 1903 //filterMenu = new QPopupMenu( this );
1894 ImportMenu = new QPopupMenu( this ); 1904 ImportMenu = new Q3PopupMenu( this );
1895 ExportMenu = new QPopupMenu( this ); 1905 ExportMenu = new Q3PopupMenu( this );
1896 syncMenu = new QPopupMenu( this ); 1906 syncMenu = new Q3PopupMenu( this );
1897 changeMenu= new QPopupMenu( this ); 1907 changeMenu= new Q3PopupMenu( this );
1898 beamMenu= new QPopupMenu( this ); 1908 beamMenu= new Q3PopupMenu( this );
1899 1909
@@ -1902,3 +1912,3 @@ void KABCore::initGUI()
1902 1912
1903 QBoxLayout *topLayout; 1913 Q3BoxLayout *topLayout;
1904 1914
@@ -1911,3 +1921,3 @@ void KABCore::initGUI()
1911#ifdef DESKTOP_VERSION 1921#ifdef DESKTOP_VERSION
1912 topLayout = new QHBoxLayout( this ); 1922 topLayout = new Q3HBoxLayout( this );
1913 1923
@@ -1926,3 +1936,3 @@ void KABCore::initGUI()
1926 if ( QApplication::desktop()->width() > 480 ) { 1936 if ( QApplication::desktop()->width() > 480 ) {
1927 topLayout = new QHBoxLayout( this ); 1937 topLayout = new Q3HBoxLayout( this );
1928 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1938 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
@@ -1931,3 +1941,3 @@ void KABCore::initGUI()
1931 1941
1932 topLayout = new QHBoxLayout( this ); 1942 topLayout = new Q3HBoxLayout( this );
1933 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); 1943 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
@@ -2036,3 +2046,3 @@ void KABCore::initActions()
2036 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); 2046 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
2037 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, 2047 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", Qt::CTRL + Qt::Key_P, mViewManager,
2038 SLOT( printView() ), actionCollection(), "kaddressbook_print" ); 2048 SLOT( printView() ), actionCollection(), "kaddressbook_print" );
@@ -2043,6 +2053,6 @@ void KABCore::initActions()
2043 2053
2044 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, 2054 mActionSave = new KAction( i18n( "&Save" ), "filesave", Qt::CTRL+Qt::Key_S, this,
2045 SLOT( save() ), actionCollection(), "file_sync" ); 2055 SLOT( save() ), actionCollection(), "file_sync" );
2046 2056
2047 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, 2057 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", Qt::CTRL+Qt::Key_N, this,
2048 SLOT( newContact() ), actionCollection(), "file_new_contact" ); 2058 SLOT( newContact() ), actionCollection(), "file_new_contact" );
@@ -2085,18 +2095,18 @@ void KABCore::initActions()
2085 if ( mIsPart ) { 2095 if ( mIsPart ) {
2086 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, 2096 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", Qt::CTRL + Qt::Key_C, this,
2087 SLOT( copyContacts() ), actionCollection(), 2097 SLOT( copyContacts() ), actionCollection(),
2088 "kaddressbook_copy" ); 2098 "kaddressbook_copy" );
2089 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, 2099 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", Qt::CTRL + Qt::Key_X, this,
2090 SLOT( cutContacts() ), actionCollection(), 2100 SLOT( cutContacts() ), actionCollection(),
2091 "kaddressbook_cut" ); 2101 "kaddressbook_cut" );
2092 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, 2102 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", Qt::CTRL + Qt::Key_V, this,
2093 SLOT( pasteContacts() ), actionCollection(), 2103 SLOT( pasteContacts() ), actionCollection(),
2094 "kaddressbook_paste" ); 2104 "kaddressbook_paste" );
2095 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, 2105 mActionSelectAll = new KAction( i18n( "Select &All" ), Qt::CTRL + Qt::Key_A, this,
2096 SLOT( selectAllContacts() ), actionCollection(), 2106 SLOT( selectAllContacts() ), actionCollection(),
2097 "kaddressbook_select_all" ); 2107 "kaddressbook_select_all" );
2098 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, 2108 mActionUndo = new KAction( i18n( "&Undo" ), "undo", Qt::CTRL + Qt::Key_Z, this,
2099 SLOT( undo() ), actionCollection(), 2109 SLOT( undo() ), actionCollection(),
2100 "kaddressbook_undo" ); 2110 "kaddressbook_undo" );
2101 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 2111 mActionRedo = new KAction( i18n( "Re&do" ), "redo", Qt::CTRL + Qt::SHIFT + Qt::Key_Z,
2102 this, SLOT( redo() ), actionCollection(), 2112 this, SLOT( redo() ), actionCollection(),
@@ -2113,3 +2123,3 @@ void KABCore::initActions()
2113 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 2123 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
2114 Key_Delete, this, SLOT( deleteContacts() ), 2124 Qt::Key_Delete, this, SLOT( deleteContacts() ),
2115 actionCollection(), "edit_delete" ); 2125 actionCollection(), "edit_delete" );
@@ -2248,5 +2258,5 @@ void KABCore::addActionsManually()
2248#ifdef KAB_EMBEDDED 2258#ifdef KAB_EMBEDDED
2249 QPopupMenu *fileMenu = new QPopupMenu( this ); 2259 Q3PopupMenu *fileMenu = new Q3PopupMenu( this );
2250 QPopupMenu *editMenu = new QPopupMenu( this ); 2260 Q3PopupMenu *editMenu = new Q3PopupMenu( this );
2251 QPopupMenu *helpMenu = new QPopupMenu( this ); 2261 Q3PopupMenu *helpMenu = new Q3PopupMenu( this );
2252 2262
@@ -2278,3 +2288,3 @@ void KABCore::addActionsManually()
2278 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 2288 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
2279 QPopupMenu *popupBarTB = new QPopupMenu( this ); 2289 Q3PopupMenu *popupBarTB = new Q3PopupMenu( this );
2280 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); 2290 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB);
@@ -2633,3 +2643,3 @@ void KABCore::configureResources()
2633{ 2643{
2634 KRES::KCMKResources dlg( this, "" , 0 ); 2644 KRES::KCMKResources dlg( this, "" , QStringList() );
2635 2645
@@ -2729,3 +2739,3 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString
2729 } 2739 }
2730 QProgressBar bar(count,0 ); 2740 Q3ProgressBar bar(count,0 );
2731 int w = 300; 2741 int w = 300;
@@ -2910,3 +2920,3 @@ KABC::Addressee KABCore::getLastSyncAddressee()
2910 lse.setRevision( mLastAddressbookSync ); 2920 lse.setRevision( mLastAddressbookSync );
2911 lse.setCategories( i18n("SyncEvent") ); 2921 lse.setCategories( QStringList(i18n("SyncEvent")) );
2912 mAddressBook->insertAddressee( lse ); 2922 mAddressBook->insertAddressee( lse );
@@ -3101,3 +3111,3 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
3101 addresseeRSync.setRevision( mLastAddressbookSync ); 3111 addresseeRSync.setRevision( mLastAddressbookSync );
3102 addresseeRSync.setCategories( i18n("SyncAddressee") ); 3112 addresseeRSync.setCategories( QStringList(i18n("SyncAddressee")) );
3103 } 3113 }