Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 67a3f52..857ceac 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp @@ -449,172 +449,172 @@ void KSyncPrefsDialog::deleteProfile() void KSyncPrefsDialog::saveProfile() { KSyncProfile* prof; if ( currentSelection >= 0 ) { prof = mSyncProfiles.at(currentSelection) ; prof->setPreSyncCommand( mRemotePrecommand->text()); prof->setPostSyncCommand( mRemotePostcommand->text() ); prof->setLocalTempFile( mLocalTempFile->text()); prof->setRemoteFileName( mRemoteFile->text() ); prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); prof->setLocalTempFileAB( mLocalTempFileAB->text()); prof->setRemoteFileNameAB( mRemoteFileAB->text() ); prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); prof->setAskForPreferences( mAskForPreferences->isChecked()); prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); prof->setWriteBackFile( mWriteBackFile->isChecked()); prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; prof->setSyncPrefs( syncprefs); prof->setIsLocalFileSync( mIsLocal->isChecked() ); prof->setIsPhoneSync( mIsPhone->isChecked() ); prof->setWriteBackFuture(mWriteBackFuture->isChecked()); prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); prof->setPhoneDevice( mPhoneDevice->text() ); prof->setPhoneConnection( mPhoneConnection->text() ); prof->setPhoneModel( mPhoneModel->text() ); } } void KSyncPrefsDialog::insertProfiles() { int curItem = mProfileBox->currentItem(); mProfileBox->blockSignals( true ); mProfileBox->clear(); mProfileBox->insertStringList (mSyncProfileNames ); int item = mSyncProfileNames.count() -1; if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) mProfileBox->setCurrentItem( curItem ); else if ( item >= 0 ) { mProfileBox->setCurrentItem( item ); } currentSelection = -1; if ( mSyncProfileNames.count() > 0 ) { //qDebug(" profileChanged( mProfileBox->currentItem() "); profileChanged( mProfileBox->currentItem() ); currentSelection = mProfileBox->currentItem(); } mProfileBox->blockSignals( false ); } void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) { saveProfile(); mSyncProfiles.append( temp ); mSyncProfileNames << temp->getName(); insertProfiles(); int last = mProfileBox->count() -1; mProfileBox->blockSignals( true ); mProfileBox->setCurrentItem( last ); mProfileBox->blockSignals( false ); profileChanged(last); } void KSyncPrefsDialog::newProfile() { addProfile ( new KSyncProfile () ); } void KSyncPrefsDialog::cloneProfile() { if ( currentSelection >= 0 ) addProfile (mSyncProfiles.at(currentSelection)->clone()) ; else newProfile(); } void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) { mMyMachineName->setText( name ); } QString KSyncPrefsDialog::getLocalMachineName ( ) { return mMyMachineName->text(); } QStringList KSyncPrefsDialog::getSyncProfileNames() { return mSyncProfileNames; } void KSyncPrefsDialog::usrReadConfig() { //KConfig *config = KOGlobals::config(); - KConfig config ( locateLocal( "config","syncprofilesrc" ) ); + KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); config.setGroup("General"); mSyncProfileNames =config.readListEntry("SyncProfileNames"); mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); int i; KSyncProfile* temp ; mSyncProfiles.clear(); for ( i = 0; i < mSyncProfileNames.count();++i ) { temp = new KSyncProfile (); temp->setName( mSyncProfileNames[i] ); temp->readConfig( &config ); mSyncProfiles.append( temp ); } insertProfiles(); //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); } void KSyncPrefsDialog::usrWriteConfig() { saveProfile(); if ( currentSelection >= 0 ) profileChanged(currentSelection); //KConfig *config = KOGlobals::config(); - KConfig config ( locateLocal( "config","syncprofilesrc" ) ); + KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); KSyncProfile* prof = mSyncProfiles.first(); QStringList externalSyncProfileNames; externalSyncProfileNames.append("Sharp_DTM");; while ( prof ) { prof->writeConfig(&config); if ( prof->getIsPhoneSync( ) ) externalSyncProfileNames.append(prof->getName( ) ); prof = mSyncProfiles.next(); } //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); config.setGroup("General"); config.writeEntry("SyncProfileNames",mSyncProfileNames); config.writeEntry("ExternSyncProfiles",externalSyncProfileNames); config.writeEntry("LocalMachineName",mMyMachineName->text()); config.sync(); } void KSyncPrefsDialog::helpDevice() { QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); #ifdef _WIN32_ hint += "Leave empty for Irda.\n" "com1:\n(first serial port)\n" "usb not supported\n" "???\n(bluetooth device address)\n"; #else hint += "/dev/ircomm\n(Irda)\n" "/dev/ttyS0\n(first serial port)\n" "/dev/ttyUSB0\n(first device usb port)\n" "???\n(bluetooth device address)\n"; #endif KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); } void KSyncPrefsDialog::helpModel() { QString hint = i18n("Leave empty or\ninsert name of phone model:\n"); hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); } void KSyncPrefsDialog::helpConnection() { QString hint = i18n("Insert kind of connection,e.g.:\n"); hint += "irda | Nokia FBUS over infrared\n" "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n" "irdaobex | set also model as obex\n" "fbus | Nokia FBUS2 serial\n"; KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); } |