-rw-r--r-- | gammu/emb/common/service/gsmmisc.c | 5 | ||||
-rw-r--r-- | kabc/addressbook.cpp | 3 | ||||
-rw-r--r-- | kabc/addressbook.h | 2 | ||||
-rw-r--r-- | kabc/plugins/sharpdtm/resourcesharpdtm.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 31 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 3 |
6 files changed, 27 insertions, 21 deletions
diff --git a/gammu/emb/common/service/gsmmisc.c b/gammu/emb/common/service/gsmmisc.c index 1c6ec8b..486d136 100644 --- a/gammu/emb/common/service/gsmmisc.c +++ b/gammu/emb/common/service/gsmmisc.c @@ -220,9 +220,12 @@ bool ReadVCALText(char *Buffer, char *Start, char *Value) strcpy(buff,Start); strcat(buff,":"); if (!strncmp(Buffer,buff,strlen(buff))) { - EncodeUnicode(Value,Buffer+strlen(Start)+1,strlen(Buffer)-(strlen(Start)+1)); + + // LR original :EncodeUnicode(Value,Buffer+strlen(Start)+1,strlen(Buffer)-(strlen(Start)+1)); + // LR we have utf8 as default + DecodeUTF8(Value,Buffer+strlen(Start)+1,strlen(Buffer)-(strlen(Start)+1)); dbgprintf("ReadVCalText is \"%s\"\n",DecodeUnicodeConsole(Value)); return true; } /* SE T68i */ diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index c584c35..3641c0c 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -476,9 +476,9 @@ bool AddressBook::export2PhoneFormat( QStringList uids ,QString fileName ) } return true; } -void AddressBook::importFromFile( QString fileName, bool replaceLabel, bool removeOld ) +int AddressBook::importFromFile( QString fileName, bool replaceLabel, bool removeOld ) { if ( removeOld ) setUntagged( true ); @@ -509,8 +509,9 @@ void AddressBook::importFromFile( QString fileName, bool replaceLabel, bool rem insertAddressee( (*it), false, true ); } if ( removeOld ) removeUntagged(); + return list.count(); } void AddressBook::setUntagged(bool setNonSyncTagged) // = false) { Iterator ait; diff --git a/kabc/addressbook.h b/kabc/addressbook.h index 23bba02..5edca06 100644 --- a/kabc/addressbook.h +++ b/kabc/addressbook.h @@ -146,9 +146,9 @@ class AddressBook : public QObject void smplifyAddressees(); void preparePhoneSync( QString currentSyncDevice, bool isPreSync ); void export2File( QString fileName ); bool export2PhoneFormat( QStringList uids ,QString fileName ); - void importFromFile( QString fileName, bool replaceLabel = false, bool removeOld = false ); + int importFromFile( QString fileName, bool replaceLabel = false, bool removeOld = false ); void setUntagged( bool setNonSyncTagged = false ); void removeUntagged(); void findNewExtIds( QString fileName, QString currentSyncDevice ); /** diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp index 2cdf4bf..ba17c50 100644 --- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp +++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp @@ -71,10 +71,10 @@ ResourceSharpDTM::ResourceSharpDTM( const KConfig *config ) QString fileName = SlZDataBase::addressbookFileName(); init( fileName ); } -ResourceSharpDTM::ResourceSharpDTM( const QString &fileName, bool syncable ) - : Resource( 0, syncable ) +ResourceSharpDTM::ResourceSharpDTM( const QString &fileName ) + : Resource( 0 ) { init( fileName ); } diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 087e9e3..3ab06c4 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -203,8 +203,9 @@ public: QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; QCheckBox* mWriteToSim; }; + bool pasteWithNewUid = true; #ifdef KAB_EMBEDDED KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) @@ -221,9 +222,8 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); // syncManager->setBlockSave(false); mExtensionBarSplitter = 0; mIsPart = !parent->inherits( "KAddressBookMain" ); - mAddressBook = KABC::StdAddressBook::self(); KABC::StdAddressBook::setAutomaticSave( false ); #ifndef KAB_EMBEDDED @@ -306,8 +306,11 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const mAddressBookService = new KAddressBookService( this ); #endif //KAB_EMBEDDED + + mMessageTimer = new QTimer( this ); + connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); mEditorDialog = 0; createAddresseeEditorDialog( this ); setModified( false ); } @@ -327,10 +330,11 @@ KABCore::~KABCore() void KABCore::recieve( QString fn ) { //qDebug("KABCore::recieve "); - mAddressBook->importFromFile( fn, true ); + int count = mAddressBook->importFromFile( fn, true ); mViewManager->refreshView(); + message(i18n("%1 contact(s) received!").arg( count )); topLevelWidget()->raise(); } void KABCore::restoreSettings() { @@ -696,8 +700,9 @@ void KABCore::export2phone() QString fileName = getPhoneFile(); if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) return; + message(i18n("Exporting to phone...")); QTimer::singleShot( 1, this , SLOT ( writeToPhone())); } QString KABCore::getPhoneFile() @@ -711,11 +716,11 @@ QString KABCore::getPhoneFile() } void KABCore::writeToPhone( ) { if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) - qDebug("Export okay "); + message(i18n("Export to phone finished!")); else - qDebug("Error export contacts "); + qDebug(i18n("Error exporting to phone")); } void KABCore::beamVCard() { QStringList uids = mViewManager->selectedUids(); @@ -830,9 +835,9 @@ void KABCore::beamDone( Ir *ir ) #ifndef DESKTOP_VERSION delete ir; #endif topLevelWidget()->raise(); - message( i18n("Beaming successful!") ); + message( i18n("Beaming finished!") ); } void KABCore::browse( const QString& url ) @@ -1194,9 +1199,9 @@ void KABCore::save() syncManager->setBlockSave(true); QString text = i18n( "There was an error while attempting to save\n the " "address book. Please check that some \nother application is " "not using it. " ); - statusMessage(i18n("Saving addressbook ... ")); + message(i18n("Saving addressbook ... ")); #ifndef KAB_EMBEDDED KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); if ( !b || !b->save() ) { KMessageBox::error( this, text, i18n( "Unable to Save" ) ); @@ -1207,18 +1212,14 @@ void KABCore::save() QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok")); } #endif //KAB_EMBEDDED - statusMessage(i18n("Addressbook saved!")); + message(i18n("Addressbook saved!")); setModified( false ); syncManager->setBlockSave(false); } -void KABCore::statusMessage(QString mess , int time ) -{ - //topLevelWidget()->setCaption( mess ); - // pending setting timer to revome message -} + void KABCore::undo() { UndoStack::instance()->undo(); @@ -2154,9 +2155,9 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); bar.show(); - bar.setCaption (i18n("collecting birthdays - close to abort!") ); + bar.setCaption (i18n("Collecting birthdays - close to abort!") ); qApp->processEvents(); QDate bday; QString anni; @@ -2808,11 +2809,10 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource) } void KABCore::message( QString m ) { - topLevelWidget()->setCaption( m ); - QTimer::singleShot( 15000, this , SLOT ( setCaptionBack())); + mMessageTimer->start( 15000, true ); } bool KABCore::syncPhone() { QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); @@ -2869,6 +2869,7 @@ QString KABCore::sentSyncFile() } void KABCore::setCaptionBack() { + mMessageTimer->stop(); topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); } diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 5871d39..c7be343 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -28,8 +28,9 @@ #ifndef KAB_EMBEDDED #endif //KAB_EMBEDDED #include <qdict.h> +#include <qtimer.h> #include <qwidget.h> #include <qpopupmenu.h> #include <ksyncmanager.h> @@ -142,9 +143,8 @@ class KABCore : public QWidget, public KSyncInterface #ifdef KAB_EMBEDDED void createAboutData(); #endif //KAB_EMBEDDED - void statusMessage(QString, int time = 0 ); void showLicence(); void faq(); void whatsnew() ; void synchowto() ; @@ -369,8 +369,9 @@ class KABCore : public QWidget, public KSyncInterface void configurationChanged(); void addressBookChanged(); private: + QTimer *mMessageTimer; void initGUI(); void initActions(); QString getPhoneFile(); |