-rw-r--r-- | korganizer/calendarview.cpp | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 4 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 5 |
3 files changed, 7 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 387b751..cfc6b10 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -676,33 +676,32 @@ QDate CalendarView::endDate() void CalendarView::createPrinter() { #ifndef KORG_NOPRINTER if (!mCalPrinter) { mCalPrinter = new CalPrinter(this, mCalendar); connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); } #endif } void CalendarView::confSync() { static KSyncPrefsDialog* sp = 0; if ( ! sp ) { sp = new KSyncPrefsDialog( this, "syncprefs", true ); } - sp->setLocalMachineName ( KOPrefs::instance()->mLocalMachineName ); sp->usrReadConfig(); #ifndef DESKTOP_VERSION sp->showMaximized(); #else sp->show(); #endif sp->exec(); KOPrefs::instance()->mSyncProfileNames = sp->getSyncProfileNames(); KOPrefs::instance()->mLocalMachineName = sp->getLocalMachineName (); } //KOPrefs::instance()->mWriteBackFile //KOPrefs::instance()->mWriteBackExistingOnly // 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 589ab2d..d0d1f3b 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -808,45 +808,47 @@ void MainWindow::initActions() if (p-> mShowIconWhatsThis) QWhatsThis::whatsThisButton ( iconToolBar ); connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); configureAgenda( p->mHourSize ); connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); } void MainWindow::fillSyncMenu() { syncMenu->clear(); syncMenu->insertItem( i18n("Configure..."), 0 ); syncMenu->insertSeparator(); syncMenu->insertItem( i18n("Multiple sync"), 1 ); syncMenu->insertSeparator(); KConfig config ( locateLocal( "config","syncprofilesrc" ) ); config.setGroup("SyncProfiles"); QStringList prof = config.readListEntry("SyncProfileNames"); - + KOPrefs::instance()->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); if ( prof.count() < 3 ) { prof.clear(); prof << i18n("Sharp-DTM"); prof << i18n("Local file"); prof << i18n("Last file"); KSyncProfile* temp = new KSyncProfile (); temp->setName( prof[0] ); temp->writeConfig(&config); temp->setName( prof[1] ); temp->writeConfig(&config); temp->setName( prof[2] ); temp->writeConfig(&config); + config.setGroup("SyncProfiles"); + config.writeEntry("SyncProfileNames",prof); config.sync(); delete temp; } KOPrefs::instance()->mSyncProfileNames = prof; int i; for ( i = 0; i < prof.count(); ++i ) { syncMenu->insertItem( prof[i], 1000+i ); if ( i == 2 ) syncMenu->insertSeparator(); } QDir app_dir; if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { syncMenu->setItemEnabled( false , 1000 ); } } diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 8d610d8..3df2a3b 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp @@ -421,48 +421,51 @@ void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) } QString KSyncPrefsDialog::getLocalMachineName ( ) { return mMyMachineName->text(); } QStringList KSyncPrefsDialog::getSyncProfileNames() { return mSyncProfileNames; } void KSyncPrefsDialog::usrReadConfig() { //KConfig *config = KOGlobals::config(); KConfig config ( locateLocal( "config","syncprofilesrc" ) ); config.setGroup("SyncProfiles"); 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" ) ); config.setGroup("SyncProfiles"); KSyncProfile* prof = mSyncProfiles.first(); while ( prof ) { prof->writeConfig(&config); prof = mSyncProfiles.next(); } //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); - config.writeEntry("SyncProfileNames",&mSyncProfileNames); + config.writeEntry("SyncProfileNames",mSyncProfileNames); + QString name = mMyMachineName->text(); + config.writeEntry("LocalMachineName",name); } |