author | zautrix <zautrix> | 2004-08-01 12:56:11 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-01 12:56:11 (UTC) |
commit | cc2643f4be54269db8c24f66fdcbbf6954d5f537 (patch) (unidiff) | |
tree | 3562598dac624305dfb9fd1911a4b314ae40945d | |
parent | c31e99f265dbe8762efca20667f8ccd973840f8f (diff) | |
download | kdepimpi-cc2643f4be54269db8c24f66fdcbbf6954d5f537.zip kdepimpi-cc2643f4be54269db8c24f66fdcbbf6954d5f537.tar.gz kdepimpi-cc2643f4be54269db8c24f66fdcbbf6954d5f537.tar.bz2 |
Made sync profile dialog korganizer independent
-rw-r--r-- | korganizer/calendarview.cpp | 28 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/kosyncprefsdialog.cpp | 44 | ||||
-rw-r--r-- | korganizer/kosyncprefsdialog.h | 4 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 21 |
5 files changed, 47 insertions, 52 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index b543eca..c75d10e 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -238,3 +238,2 @@ void CalendarView::init() | |||
238 | mSelectedIncidence = 0; | 238 | mSelectedIncidence = 0; |
239 | mSyncProfiles.setAutoDelete(true); | ||
240 | mCalPrinter = 0; | 239 | mCalPrinter = 0; |
@@ -692,2 +691,3 @@ void CalendarView::confSync() | |||
692 | } | 691 | } |
692 | sp->setLocalMachineName ( KOPrefs::instance()->mLocalMachineName ); | ||
693 | sp->usrReadConfig(); | 693 | sp->usrReadConfig(); |
@@ -699,3 +699,4 @@ void CalendarView::confSync() | |||
699 | sp->exec(); | 699 | sp->exec(); |
700 | 700 | KOPrefs::instance()->mSyncProfileNames = sp->getSyncProfileNames(); | |
701 | KOPrefs::instance()->mLocalMachineName = sp->getLocalMachineName (); | ||
701 | } | 702 | } |
@@ -1565,25 +1566,2 @@ void CalendarView::readSettings() | |||
1565 | 1566 | ||
1566 | |||
1567 | // pending read sync settings; | ||
1568 | mSyncProfileNames.clear(); | ||
1569 | mSyncProfileNames << "Profile_1"; | ||
1570 | mSyncProfileNames << "Profile_2"; | ||
1571 | mSyncProfileNames << "Profile_3"; | ||
1572 | mSyncProfileNames << "Profile_4"; | ||
1573 | mSyncProfileNames << "Profile_5"; | ||
1574 | KSyncProfile* temp = new KSyncProfile (); | ||
1575 | temp->setName("Profile_1" ); | ||
1576 | mSyncProfiles.append( temp ); | ||
1577 | temp = new KSyncProfile (); | ||
1578 | temp->setName("Profile_2" ); | ||
1579 | mSyncProfiles.append( temp ); | ||
1580 | temp = new KSyncProfile (); | ||
1581 | temp->setName("Profile_3" ); | ||
1582 | mSyncProfiles.append( temp ); | ||
1583 | temp = new KSyncProfile (); | ||
1584 | temp->setName("Profile_4" ); | ||
1585 | mSyncProfiles.append( temp ); | ||
1586 | temp = new KSyncProfile (); | ||
1587 | temp->setName("Profile_5" ); | ||
1588 | mSyncProfiles.append( temp ); | ||
1589 | } | 1567 | } |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index fda02f7..8aa5e1c 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -484,4 +484,2 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
484 | void checkSharpEvent( Event* lastSync, Incidence* toDelete ); | 484 | void checkSharpEvent( Event* lastSync, Incidence* toDelete ); |
485 | QPtrList<KSyncProfile> mSyncProfiles; | ||
486 | QStringList mSyncProfileNames; | ||
487 | void checkZaurusId( int id, bool todo = false ); | 485 | void checkZaurusId( int id, bool todo = false ); |
diff --git a/korganizer/kosyncprefsdialog.cpp b/korganizer/kosyncprefsdialog.cpp index b7e4265..7c838f5 100644 --- a/korganizer/kosyncprefsdialog.cpp +++ b/korganizer/kosyncprefsdialog.cpp | |||
@@ -31,2 +31,3 @@ | |||
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qdir.h> | ||
32 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
@@ -61,6 +62,6 @@ | |||
61 | 62 | ||
62 | #include "koprefs.h" | 63 | //#include "koprefs.h" |
63 | 64 | ||
64 | #include "kosyncprefsdialog.h" | 65 | #include "kosyncprefsdialog.h" |
65 | #include "koglobals.h" | 66 | //#include "koglobals.h" |
66 | 67 | ||
@@ -235,3 +236,3 @@ void KOSyncPrefsDialog::chooseFile() | |||
235 | { | 236 | { |
236 | QString fn =KOPrefs::instance()->mLastSyncedLocalFile; | 237 | QString fn = QDir::homeDirPath(); |
237 | 238 | ||
@@ -415,8 +416,22 @@ void KOSyncPrefsDialog::cloneProfile() | |||
415 | 416 | ||
417 | void KOSyncPrefsDialog::setLocalMachineName ( const QString& name ) | ||
418 | { | ||
419 | mMyMachineName->setText( name ); | ||
416 | 420 | ||
421 | } | ||
422 | QString KOSyncPrefsDialog::getLocalMachineName ( ) | ||
423 | { | ||
424 | return mMyMachineName->text(); | ||
425 | } | ||
426 | |||
427 | QStringList KOSyncPrefsDialog::getSyncProfileNames() | ||
428 | { | ||
429 | return mSyncProfileNames; | ||
430 | } | ||
417 | void KOSyncPrefsDialog::usrReadConfig() | 431 | void KOSyncPrefsDialog::usrReadConfig() |
418 | { | 432 | { |
419 | KConfig *config = KOGlobals::config(); | 433 | //KConfig *config = KOGlobals::config(); |
420 | config->setGroup("SyncProfiles"); | 434 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
421 | mSyncProfileNames = KOPrefs::instance()->mSyncProfileNames; | 435 | config.setGroup("SyncProfiles"); |
436 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); | ||
422 | int i; | 437 | int i; |
@@ -427,3 +442,3 @@ void KOSyncPrefsDialog::usrReadConfig() | |||
427 | temp->setName( mSyncProfileNames[i] ); | 442 | temp->setName( mSyncProfileNames[i] ); |
428 | temp->readConfig( config ); | 443 | temp->readConfig( &config ); |
429 | mSyncProfiles.append( temp ); | 444 | mSyncProfiles.append( temp ); |
@@ -431,3 +446,3 @@ void KOSyncPrefsDialog::usrReadConfig() | |||
431 | insertProfiles(); | 446 | insertProfiles(); |
432 | mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); | 447 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); |
433 | } | 448 | } |
@@ -440,12 +455,13 @@ void KOSyncPrefsDialog::usrWriteConfig() | |||
440 | profileChanged(currentSelection); | 455 | profileChanged(currentSelection); |
441 | KConfig *config = KOGlobals::config(); | 456 | //KConfig *config = KOGlobals::config(); |
442 | config->setGroup("SyncProfiles"); | 457 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
458 | config.setGroup("SyncProfiles"); | ||
443 | KSyncProfile* prof = mSyncProfiles.first(); | 459 | KSyncProfile* prof = mSyncProfiles.first(); |
444 | while ( prof ) { | 460 | while ( prof ) { |
445 | prof->writeConfig(config); | 461 | prof->writeConfig(&config); |
446 | prof = mSyncProfiles.next(); | 462 | prof = mSyncProfiles.next(); |
447 | } | 463 | } |
448 | KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; | 464 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; |
449 | KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); | 465 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); |
450 | config->writeEntry("SyncProfileNames",&mSyncProfileNames); | 466 | config.writeEntry("SyncProfileNames",&mSyncProfileNames); |
451 | } | 467 | } |
diff --git a/korganizer/kosyncprefsdialog.h b/korganizer/kosyncprefsdialog.h index d2d8c6f..541d18b 100644 --- a/korganizer/kosyncprefsdialog.h +++ b/korganizer/kosyncprefsdialog.h | |||
@@ -57,2 +57,6 @@ class KOSyncPrefsDialog : public KDialog | |||
57 | void usrReadConfig(); | 57 | void usrReadConfig(); |
58 | void setLocalMachineName ( const QString& name ); | ||
59 | QString getLocalMachineName ( ); | ||
60 | |||
61 | QStringList getSyncProfileNames(); | ||
58 | 62 | ||
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index a487f14..589ab2d 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -820,7 +820,7 @@ void MainWindow::fillSyncMenu() | |||
820 | syncMenu->insertSeparator(); | 820 | syncMenu->insertSeparator(); |
821 | 821 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | |
822 | QStringList prof = KOPrefs::instance()->mSyncProfileNames; | 822 | config.setGroup("SyncProfiles"); |
823 | 823 | QStringList prof = config.readListEntry("SyncProfileNames"); | |
824 | |||
824 | if ( prof.count() < 3 ) { | 825 | if ( prof.count() < 3 ) { |
825 | KConfig *config = KOGlobals::config(); | ||
826 | prof.clear(); | 826 | prof.clear(); |
@@ -831,12 +831,11 @@ void MainWindow::fillSyncMenu() | |||
831 | temp->setName( prof[0] ); | 831 | temp->setName( prof[0] ); |
832 | temp->writeConfig(config); | 832 | temp->writeConfig(&config); |
833 | temp->setName( prof[1] ); | 833 | temp->setName( prof[1] ); |
834 | temp->writeConfig(config); | 834 | temp->writeConfig(&config); |
835 | temp->setName( prof[2] ); | 835 | temp->setName( prof[2] ); |
836 | temp->writeConfig(config); | 836 | temp->writeConfig(&config); |
837 | config->sync(); | 837 | config.sync(); |
838 | delete temp; | 838 | delete temp; |
839 | KOPrefs::instance()->mSyncProfileNames = prof; | ||
840 | } | 839 | } |
841 | 840 | KOPrefs::instance()->mSyncProfileNames = prof; | |
842 | int i; | 841 | int i; |
@@ -1802,3 +1801,3 @@ void MainWindow::confSync() | |||
1802 | fillSyncMenu(); | 1801 | fillSyncMenu(); |
1803 | mView->writeSettings(); | 1802 | //mView->writeSettings(); |
1804 | 1803 | ||