author | zautrix <zautrix> | 2004-10-21 22:20:39 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-21 22:20:39 (UTC) |
commit | d6f9bd535e8cabe653bdff329500f9153e5e11fb (patch) (unidiff) | |
tree | 6f83c692713c41896a165e399f259a744f125e5c /kaddressbook | |
parent | bb235c5a639b914574e1e247d2de6e479517585f (diff) | |
download | kdepimpi-d6f9bd535e8cabe653bdff329500f9153e5e11fb.zip kdepimpi-d6f9bd535e8cabe653bdff329500f9153e5e11fb.tar.gz kdepimpi-d6f9bd535e8cabe653bdff329500f9153e5e11fb.tar.bz2 |
small fixes
-rw-r--r-- | kaddressbook/kabcore.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 124 | ||||
-rw-r--r-- | kaddressbook/views/contactlistview.cpp | 2 |
3 files changed, 9 insertions, 123 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 1074a62..c4382d6 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -359,64 +359,66 @@ void KABCore::toggleBeamReceive( ) | |||
359 | return; | 359 | return; |
360 | } | 360 | } |
361 | qDebug("AB enable BeamReceive "); | 361 | qDebug("AB enable BeamReceive "); |
362 | mActionBR->setChecked(true); | 362 | mActionBR->setChecked(true); |
363 | 363 | ||
364 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; | 364 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; |
365 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); | 365 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); |
366 | #endif | 366 | #endif |
367 | } | 367 | } |
368 | 368 | ||
369 | 369 | ||
370 | void KABCore::disableBR(bool b) | 370 | void KABCore::disableBR(bool b) |
371 | { | 371 | { |
372 | #ifndef DESKTOP_VERSION | 372 | #ifndef DESKTOP_VERSION |
373 | if ( b ) { | 373 | if ( b ) { |
374 | if ( infrared ) { | 374 | if ( infrared ) { |
375 | toggleBeamReceive( ); | 375 | toggleBeamReceive( ); |
376 | } | 376 | } |
377 | mBRdisabled = true; | 377 | mBRdisabled = true; |
378 | } else { | 378 | } else { |
379 | if ( mBRdisabled ) { | 379 | if ( mBRdisabled ) { |
380 | mBRdisabled = false; | 380 | mBRdisabled = false; |
381 | //toggleBeamReceive( ); | 381 | //toggleBeamReceive( ); |
382 | } | 382 | } |
383 | } | 383 | } |
384 | #endif | 384 | #endif |
385 | 385 | ||
386 | } | 386 | } |
387 | void KABCore::recieve( QString fn ) | 387 | void KABCore::recieve( QString fn ) |
388 | { | 388 | { |
389 | //qDebug("KABCore::recieve "); | 389 | //qDebug("KABCore::recieve "); |
390 | int count = mAddressBook->importFromFile( fn, true ); | 390 | int count = mAddressBook->importFromFile( fn, true ); |
391 | if ( count ) | ||
392 | setModified( true ); | ||
391 | mViewManager->refreshView(); | 393 | mViewManager->refreshView(); |
392 | message(i18n("%1 contact(s) received!").arg( count )); | 394 | message(i18n("%1 contact(s) received!").arg( count )); |
393 | topLevelWidget()->showMaximized(); | 395 | topLevelWidget()->showMaximized(); |
394 | topLevelWidget()->raise(); | 396 | topLevelWidget()->raise(); |
395 | } | 397 | } |
396 | void KABCore::restoreSettings() | 398 | void KABCore::restoreSettings() |
397 | { | 399 | { |
398 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; | 400 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; |
399 | 401 | ||
400 | bool state; | 402 | bool state; |
401 | 403 | ||
402 | if (mMultipleViewsAtOnce) | 404 | if (mMultipleViewsAtOnce) |
403 | state = KABPrefs::instance()->mDetailsPageVisible; | 405 | state = KABPrefs::instance()->mDetailsPageVisible; |
404 | else | 406 | else |
405 | state = false; | 407 | state = false; |
406 | 408 | ||
407 | mActionDetails->setChecked( state ); | 409 | mActionDetails->setChecked( state ); |
408 | setDetailsVisible( state ); | 410 | setDetailsVisible( state ); |
409 | 411 | ||
410 | state = KABPrefs::instance()->mJumpButtonBarVisible; | 412 | state = KABPrefs::instance()->mJumpButtonBarVisible; |
411 | 413 | ||
412 | mActionJumpBar->setChecked( state ); | 414 | mActionJumpBar->setChecked( state ); |
413 | setJumpButtonBarVisible( state ); | 415 | setJumpButtonBarVisible( state ); |
414 | /*US | 416 | /*US |
415 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; | 417 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; |
416 | if ( splitterSize.count() == 0 ) { | 418 | if ( splitterSize.count() == 0 ) { |
417 | splitterSize.append( width() / 2 ); | 419 | splitterSize.append( width() / 2 ); |
418 | splitterSize.append( width() / 2 ); | 420 | splitterSize.append( width() / 2 ); |
419 | } | 421 | } |
420 | mMiniSplitter->setSizes( splitterSize ); | 422 | mMiniSplitter->setSizes( splitterSize ); |
421 | if ( mExtensionBarSplitter ) { | 423 | if ( mExtensionBarSplitter ) { |
422 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 424 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
@@ -2850,54 +2852,56 @@ bool KABCore::syncPhone() | |||
2850 | return false; | 2852 | return false; |
2851 | } | 2853 | } |
2852 | AddressBook abLocal( fileName,"syncContact"); | 2854 | AddressBook abLocal( fileName,"syncContact"); |
2853 | bool syncOK = false; | 2855 | bool syncOK = false; |
2854 | { | 2856 | { |
2855 | abLocal.importFromFile( fileName ); | 2857 | abLocal.importFromFile( fileName ); |
2856 | qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 2858 | qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
2857 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2859 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2858 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); | 2860 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); |
2859 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 2861 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
2860 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 2862 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
2861 | if ( syncOK ) { | 2863 | if ( syncOK ) { |
2862 | if ( syncManager->mWriteBackFile ) { | 2864 | if ( syncManager->mWriteBackFile ) { |
2863 | abLocal.removeSyncAddressees( true ); | 2865 | abLocal.removeSyncAddressees( true ); |
2864 | abLocal.saveABphone( fileName ); | 2866 | abLocal.saveABphone( fileName ); |
2865 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); | 2867 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); |
2866 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); | 2868 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); |
2867 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); | 2869 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); |
2868 | } | 2870 | } |
2869 | } | 2871 | } |
2870 | setModified(); | 2872 | setModified(); |
2871 | } | 2873 | } |
2872 | if ( syncOK ) | 2874 | if ( syncOK ) |
2873 | mViewManager->refreshView(); | 2875 | mViewManager->refreshView(); |
2874 | return syncOK; | 2876 | return syncOK; |
2875 | } | 2877 | } |
2876 | void KABCore::getFile( bool success ) | 2878 | void KABCore::getFile( bool success ) |
2877 | { | 2879 | { |
2878 | if ( ! success ) { | 2880 | if ( ! success ) { |
2879 | message( i18n("Error receiving file. Nothing changed!") ); | 2881 | message( i18n("Error receiving file. Nothing changed!") ); |
2880 | return; | 2882 | return; |
2881 | } | 2883 | } |
2882 | mAddressBook->importFromFile( sentSyncFile() , false, true ); | 2884 | int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); |
2885 | if ( count ) | ||
2886 | setModified( true ); | ||
2883 | message( i18n("Pi-Sync successful!") ); | 2887 | message( i18n("Pi-Sync successful!") ); |
2884 | mViewManager->refreshView(); | 2888 | mViewManager->refreshView(); |
2885 | } | 2889 | } |
2886 | void KABCore::syncFileRequest() | 2890 | void KABCore::syncFileRequest() |
2887 | { | 2891 | { |
2888 | mAddressBook->export2File( sentSyncFile() ); | 2892 | mAddressBook->export2File( sentSyncFile() ); |
2889 | } | 2893 | } |
2890 | QString KABCore::sentSyncFile() | 2894 | QString KABCore::sentSyncFile() |
2891 | { | 2895 | { |
2892 | #ifdef DESKTOP_VERSION | 2896 | #ifdef DESKTOP_VERSION |
2893 | return locateLocal( "tmp", "copysyncab.vcf" ); | 2897 | return locateLocal( "tmp", "copysyncab.vcf" ); |
2894 | #else | 2898 | #else |
2895 | return QString( "/tmp/copysyncab.vcf" ); | 2899 | return QString( "/tmp/copysyncab.vcf" ); |
2896 | #endif | 2900 | #endif |
2897 | } | 2901 | } |
2898 | 2902 | ||
2899 | void KABCore::setCaptionBack() | 2903 | void KABCore::setCaptionBack() |
2900 | { | 2904 | { |
2901 | mMessageTimer->stop(); | 2905 | mMessageTimer->stop(); |
2902 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); | 2906 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); |
2903 | } | 2907 | } |
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index a2ff1e9..40089a1 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -1,43 +1,44 @@ | |||
1 | #ifndef DESKTOP_VERSION | 1 | #ifndef DESKTOP_VERSION |
2 | #include <qpe/qpeapplication.h> | 2 | #include <qpe/qpeapplication.h> |
3 | #include <qcopchannel_qws.h> | 3 | #include <qcopchannel_qws.h> |
4 | #include <stdlib.h> | 4 | #include <stdlib.h> |
5 | #else | 5 | #else |
6 | #include <qapplication.h> | 6 | #include <qapplication.h> |
7 | #include <qwindowsstyle.h> | 7 | #include <qwindowsstyle.h> |
8 | #include <qplatinumstyle.h> | 8 | #include <qplatinumstyle.h> |
9 | #include <qmainwindow.h> | 9 | #include <qmainwindow.h> |
10 | #endif | 10 | #endif |
11 | 11 | ||
12 | #include <qtextcodec.h> | ||
12 | #include <kstandarddirs.h> | 13 | #include <kstandarddirs.h> |
13 | #include <qregexp.h> | 14 | #include <qregexp.h> |
14 | #include <kglobal.h> | 15 | #include <kglobal.h> |
15 | #include <stdio.h> | 16 | #include <stdio.h> |
16 | #include <qdir.h> | 17 | #include <qdir.h> |
17 | #include "kaddressbookmain.h" | 18 | #include "kaddressbookmain.h" |
18 | #include "externalapphandler.h" | 19 | #include "externalapphandler.h" |
19 | #include <libkdepim/kpimglobalprefs.h> | 20 | #include <libkdepim/kpimglobalprefs.h> |
20 | 21 | ||
21 | int main( int argc, char **argv ) | 22 | int main( int argc, char **argv ) |
22 | { | 23 | { |
23 | #ifndef DESKTOP_VERSION | 24 | #ifndef DESKTOP_VERSION |
24 | QPEApplication a( argc, argv ); | 25 | QPEApplication a( argc, argv ); |
25 | a.setKeepRunning (); | 26 | a.setKeepRunning (); |
26 | #else | 27 | #else |
27 | QApplication a( argc, argv ); | 28 | QApplication a( argc, argv ); |
28 | QApplication::setStyle( new QPlatinumStyle ()); | 29 | QApplication::setStyle( new QPlatinumStyle ()); |
29 | QString hdir = QDir::homeDirPath(); | 30 | QString hdir = QDir::homeDirPath(); |
30 | // there is a bug when creating dirs for WIN 98 | 31 | // there is a bug when creating dirs for WIN 98 |
31 | // it is difficult to fix, because we have no WIN 98 runnung | 32 | // it is difficult to fix, because we have no WIN 98 runnung |
32 | // such that we try it to create the dirs at startup here | 33 | // such that we try it to create the dirs at startup here |
33 | if ( hdir == "C:\\" ) { // win 98 or ME | 34 | if ( hdir == "C:\\" ) { // win 98 or ME |
34 | QDir app_dir; | 35 | QDir app_dir; |
35 | if ( !app_dir.exists("C:\\kdepim") ) | 36 | if ( !app_dir.exists("C:\\kdepim") ) |
36 | app_dir.mkdir ("C:\\kdepim"); | 37 | app_dir.mkdir ("C:\\kdepim"); |
37 | if ( !app_dir.exists("C:\\kdepim\\apps") ) | 38 | if ( !app_dir.exists("C:\\kdepim\\apps") ) |
38 | app_dir.mkdir ("C:\\kdepim\\apps"); | 39 | app_dir.mkdir ("C:\\kdepim\\apps"); |
39 | if ( !app_dir.exists("C:\\kdepim\\config") ) | 40 | if ( !app_dir.exists("C:\\kdepim\\config") ) |
40 | app_dir.mkdir ("C:\\kdepim\\config"); | 41 | app_dir.mkdir ("C:\\kdepim\\config"); |
41 | if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") ) | 42 | if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") ) |
42 | app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook"); | 43 | app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook"); |
43 | } | 44 | } |
@@ -55,161 +56,40 @@ int main( int argc, char **argv ) | |||
55 | } | 56 | } |
56 | } | 57 | } |
57 | if ( ! exitHelp ) { | 58 | if ( ! exitHelp ) { |
58 | 59 | ||
59 | KGlobal::setAppName( "kaddressbook" ); | 60 | KGlobal::setAppName( "kaddressbook" ); |
60 | #ifndef DESKTOP_VERSION | 61 | #ifndef DESKTOP_VERSION |
61 | if ( QApplication::desktop()->width() > 320 ) | 62 | if ( QApplication::desktop()->width() > 320 ) |
62 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); | 63 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); |
63 | else | 64 | else |
64 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); | 65 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); |
65 | #else | 66 | #else |
66 | QString fileName ; | 67 | QString fileName ; |
67 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; | 68 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; |
68 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 69 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
69 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); | 70 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); |
70 | 71 | ||
71 | #endif | 72 | #endif |
72 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); | 73 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); |
73 | KAddressBookMain m ; | 74 | KAddressBookMain m ; |
74 | //US MainWindow m; | 75 | //US MainWindow m; |
75 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 76 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
76 | 77 | ||
77 | { | 78 | { |
78 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 79 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
79 | } | 80 | } |
80 | #ifndef DESKTOP_VERSION | 81 | #ifndef DESKTOP_VERSION |
81 | a.showMainWidget( &m ); | 82 | a.showMainWidget( &m ); |
82 | 83 | ||
83 | #else | 84 | #else |
84 | a.setMainWidget( &m ); | 85 | a.setMainWidget( &m ); |
85 | m.resize (640, 480 ); | 86 | m.resize (640, 480 ); |
86 | m.show(); | 87 | m.show(); |
87 | #endif | 88 | #endif |
88 | a.exec(); | 89 | a.exec(); |
89 | 90 | ||
90 | 91 | ||
91 | } | 92 | } |
92 | qDebug("KA: Bye! "); | 93 | qDebug("KA: Bye! "); |
93 | } | 94 | } |
94 | 95 | ||
95 | /* | ||
96 | #include <stdlib.h> | ||
97 | |||
98 | #include <qstring.h> | ||
99 | |||
100 | #include <kabc/stdaddressbook.h> | ||
101 | #include <kaboutdata.h> | ||
102 | #include <kcmdlineargs.h> | ||
103 | #include <kcrash.h> | ||
104 | #include <kdebug.h> | ||
105 | #include <klocale.h> | ||
106 | #include <kstartupinfo.h> | ||
107 | #include <kuniqueapplication.h> | ||
108 | #include <kwin.h> | ||
109 | |||
110 | #include "kaddressbookmain.h" | ||
111 | #include "kabcore.h" | ||
112 | |||
113 | extern "C" { | ||
114 | |||
115 | void crashHandler( int ) | ||
116 | { | ||
117 | KABC::StdAddressBook::handleCrash(); | ||
118 | ::exit( 0 ); | ||
119 | } | ||
120 | |||
121 | } | ||
122 | |||
123 | class KAddressBookApp : public KUniqueApplication { | ||
124 | public: | ||
125 | KAddressBookApp() : mMainWin( 0 ) {} | ||
126 | ~KAddressBookApp() {} | ||
127 | |||
128 | int newInstance(); | ||
129 | |||
130 | private: | ||
131 | KAddressBookMain *mMainWin; | ||
132 | }; | ||
133 | |||
134 | int KAddressBookApp::newInstance() | ||
135 | { | ||
136 | if ( isRestored() ) { | ||
137 | // There can only be one main window | ||
138 | if ( KMainWindow::canBeRestored( 1 ) ) { | ||
139 | mMainWin = new KAddressBookMain; | ||
140 | mMainWin->show(); | ||
141 | mMainWin->restore( 1 ); | ||
142 | } | ||
143 | } else { | ||
144 | KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); | ||
145 | |||
146 | QCString addrStr = args->getOption( "addr" ); | ||
147 | QCString uidStr = args->getOption( "uid" ); | ||
148 | QString addr; | ||
149 | QString uid; | ||
150 | if ( !addrStr.isEmpty() ) | ||
151 | addr = QString::fromLocal8Bit( addrStr ); | ||
152 | if ( !uidStr.isEmpty() ) | ||
153 | uid = QString::fromLocal8Bit( uidStr ); | ||
154 | |||
155 | |||
156 | if ( args->isSet( "editor-only" ) ) { | ||
157 | if ( !mMainWin ) | ||
158 | mMainWin = new KAddressBookMain; | ||
159 | KStartupInfo::appStarted(); | ||
160 | mMainWin->hide(); | ||
161 | } else { | ||
162 | if ( mMainWin ) { | ||
163 | mMainWin->show(); | ||
164 | KWin::setActiveWindow( mMainWin->winId() ); | ||
165 | } else { | ||
166 | mMainWin = new KAddressBookMain; | ||
167 | mMainWin->show(); | ||
168 | } | ||
169 | } | ||
170 | // Can not see why anyone would pass both a uid and an email address, so I'll leave it that two contact editors will show if they do | ||
171 | if ( !addr.isEmpty() ) | ||
172 | mMainWin->addEmail( addr ); | ||
173 | |||
174 | if ( !uid.isEmpty() ) | ||
175 | mMainWin->showContactEditor( uid ); | ||
176 | if ( args->isSet( "new-contact" ) ) { | ||
177 | mMainWin->newContact(); | ||
178 | } | ||
179 | } | ||
180 | |||
181 | KCrash::setEmergencySaveFunction( crashHandler ); | ||
182 | |||
183 | return 0; | ||
184 | } | ||
185 | |||
186 | // the dummy argument is required, because KMail apparently sends an empty | ||
187 | // argument. | ||
188 | static KCmdLineOptions kmoptions[] = | ||
189 | { | ||
190 | { "a", 0 , 0 }, | ||
191 | { "addr <email>", I18N_NOOP( "Shows contact editor with given email address" ), 0 }, | ||
192 | { "uid <uid>", I18N_NOOP( "Shows contact editor with given uid" ), 0 }, | ||
193 | { "editor-only", I18N_NOOP( "Launches in editor only mode" ), 0 }, | ||
194 | { "new-contact", I18N_NOOP( "Launches editor for the new contact" ), 0 }, | ||
195 | { "+[argument]", I18N_NOOP( "dummy argument" ), 0}, | ||
196 | { 0, 0, 0} | ||
197 | }; | ||
198 | |||
199 | int main( int argc, char *argv[] ) | ||
200 | { | ||
201 | KLocale::setMainCatalogue( "kaddressbook" ); | ||
202 | |||
203 | KCmdLineArgs::init( argc, argv, KABCore::createAboutData() ); | ||
204 | KCmdLineArgs::addCmdLineOptions( kmoptions ); | ||
205 | KUniqueApplication::addCmdLineOptions(); | ||
206 | |||
207 | if ( !KAddressBookApp::start() ) | ||
208 | exit( 0 ); | ||
209 | |||
210 | KAddressBookApp app; | ||
211 | KGlobal::locale()->insertCatalogue( "libkdepim" ); | ||
212 | |||
213 | return app.exec(); | ||
214 | } | ||
215 | */ | ||
diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp index c74f8cf..5fb4163 100644 --- a/kaddressbook/views/contactlistview.cpp +++ b/kaddressbook/views/contactlistview.cpp | |||
@@ -139,90 +139,92 @@ void DynamicTip::maybeTip( const QPoint &pos ) | |||
139 | 139 | ||
140 | if ( lastSpace <= a ) { | 140 | if ( lastSpace <= a ) { |
141 | lastw = linew; | 141 | lastw = linew; |
142 | } | 142 | } |
143 | 143 | ||
144 | ++i; | 144 | ++i; |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | tip( r, s ); | 148 | tip( r, s ); |
149 | } | 149 | } |
150 | else | 150 | else |
151 | hide(); | 151 | hide(); |
152 | ishidden = !ishidden; | 152 | ishidden = !ishidden; |
153 | 153 | ||
154 | } | 154 | } |
155 | 155 | ||
156 | /////////////////////////// | 156 | /////////////////////////// |
157 | // ContactListViewItem Methods | 157 | // ContactListViewItem Methods |
158 | 158 | ||
159 | ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, | 159 | ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, |
160 | ContactListView *parent, | 160 | ContactListView *parent, |
161 | KABC::AddressBook *doc, | 161 | KABC::AddressBook *doc, |
162 | const KABC::Field::List &fields ) | 162 | const KABC::Field::List &fields ) |
163 | : KListViewItem(parent), mAddressee(a), mFields( fields ), | 163 | : KListViewItem(parent), mAddressee(a), mFields( fields ), |
164 | parentListView( parent ), mDocument(doc) | 164 | parentListView( parent ), mDocument(doc) |
165 | { | 165 | { |
166 | refresh(); | 166 | refresh(); |
167 | } | 167 | } |
168 | 168 | ||
169 | QString ContactListViewItem::key(int column, bool ascending) const | 169 | QString ContactListViewItem::key(int column, bool ascending) const |
170 | { | 170 | { |
171 | #ifndef DESKTOP_VERSION | ||
171 | int lan = KGlobal::locale()->language(); | 172 | int lan = KGlobal::locale()->language(); |
172 | //qDebug("language %d ", lan); | 173 | //qDebug("language %d ", lan); |
173 | if ( lan == 1 ) { //GERMAN | 174 | if ( lan == 1 ) { //GERMAN |
174 | QString ret = QListViewItem::key(column, ascending).utf8(); | 175 | QString ret = QListViewItem::key(column, ascending).utf8(); |
175 | int start = -1; | 176 | int start = -1; |
176 | while ( (start = ret.find( 'ä', start+1)) > 0 ) { | 177 | while ( (start = ret.find( 'ä', start+1)) > 0 ) { |
177 | ret.at(start-1) = 'a'; | 178 | ret.at(start-1) = 'a'; |
178 | } | 179 | } |
179 | start = -1; | 180 | start = -1; |
180 | while ( (start = ret.find( 'ö', start+1)) > 0 ) { | 181 | while ( (start = ret.find( 'ö', start+1)) > 0 ) { |
181 | ret.at(start-1) = 'o'; | 182 | ret.at(start-1) = 'o'; |
182 | } | 183 | } |
183 | start = -1; | 184 | start = -1; |
184 | while ( (start = ret.find( 'ü', start+1)) > 0 ) { | 185 | while ( (start = ret.find( 'ü', start+1)) > 0 ) { |
185 | ret.at(start-1) = 'o'; | 186 | ret.at(start-1) = 'o'; |
186 | } | 187 | } |
187 | start = -1; | 188 | start = -1; |
188 | while ( (start = ret.find( 'ß', start+1)) > 0 ) { | 189 | while ( (start = ret.find( 'ß', start+1)) > 0 ) { |
189 | ret.at(start-1) = 's'; | 190 | ret.at(start-1) = 's'; |
190 | } | 191 | } |
191 | //qDebug("conv string %s ", ret.latin1()); | 192 | //qDebug("conv string %s ", ret.latin1()); |
192 | 193 | ||
193 | return ret; | 194 | return ret; |
194 | 195 | ||
195 | } | 196 | } |
196 | else | 197 | else |
198 | #endif | ||
197 | return QListViewItem::key(column, ascending).lower(); | 199 | return QListViewItem::key(column, ascending).lower(); |
198 | } | 200 | } |
199 | 201 | ||
200 | void ContactListViewItem::paintCell(QPainter * p, | 202 | void ContactListViewItem::paintCell(QPainter * p, |
201 | const QColorGroup & cg, | 203 | const QColorGroup & cg, |
202 | int column, | 204 | int column, |
203 | int width, | 205 | int width, |
204 | int align) | 206 | int align) |
205 | { | 207 | { |
206 | KListViewItem::paintCell(p, cg, column, width, align); | 208 | KListViewItem::paintCell(p, cg, column, width, align); |
207 | 209 | ||
208 | if ( !p ) | 210 | if ( !p ) |
209 | return; | 211 | return; |
210 | 212 | ||
211 | if (parentListView->singleLine()) { | 213 | if (parentListView->singleLine()) { |
212 | p->setPen( parentListView->alternateColor() ); | 214 | p->setPen( parentListView->alternateColor() ); |
213 | p->drawLine( 0, height() - 1, width, height() - 1 ); | 215 | p->drawLine( 0, height() - 1, width, height() - 1 ); |
214 | } | 216 | } |
215 | } | 217 | } |
216 | 218 | ||
217 | 219 | ||
218 | ContactListView *ContactListViewItem::parent() | 220 | ContactListView *ContactListViewItem::parent() |
219 | { | 221 | { |
220 | return parentListView; | 222 | return parentListView; |
221 | } | 223 | } |
222 | 224 | ||
223 | 225 | ||
224 | void ContactListViewItem::refresh() | 226 | void ContactListViewItem::refresh() |
225 | { | 227 | { |
226 | // Update our addressee, since it may have changed else were | 228 | // Update our addressee, since it may have changed else were |
227 | mAddressee = mDocument->findByUid(mAddressee.uid()); | 229 | mAddressee = mDocument->findByUid(mAddressee.uid()); |
228 | if (mAddressee.isEmpty()) | 230 | if (mAddressee.isEmpty()) |