28 files changed, 91 insertions, 317 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 592d78d..c584c35 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -279,3 +279,3 @@ void AddressBook::init(const QString &config, const QString &family ) | |||
279 | //US d->mErrorHandler = 0; | 279 | //US d->mErrorHandler = 0; |
280 | d->mManager = new KRES::Manager<Resource>( fami, false ); | 280 | d->mManager = new KRES::Manager<Resource>( fami ); |
281 | d->mManager->readConfig( d->mConfig ); | 281 | d->mManager->readConfig( d->mConfig ); |
diff --git a/kabc/kabcE.pro b/kabc/kabcE.pro index 061909b..96fe39e 100644 --- a/kabc/kabcE.pro +++ b/kabc/kabcE.pro | |||
@@ -43,3 +43,2 @@ HEADERS = \ | |||
43 | stdaddressbook.h \ | 43 | stdaddressbook.h \ |
44 | syncprefwidget.h \ | ||
45 | timezone.h \ | 44 | timezone.h \ |
@@ -148,3 +147,2 @@ SOURCES = \ | |||
148 | stdaddressbook.cpp \ | 147 | stdaddressbook.cpp \ |
149 | syncprefwidget.cpp \ | ||
150 | timezone.cpp \ | 148 | timezone.cpp \ |
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp index e58e4f7..e2b7b08 100644 --- a/kabc/plugins/dir/resourcedir.cpp +++ b/kabc/plugins/dir/resourcedir.cpp | |||
@@ -60,3 +60,2 @@ $Id$ | |||
60 | #include "resourcedir.h" | 60 | #include "resourcedir.h" |
61 | #include "syncprefwidget.h" | ||
62 | 61 | ||
@@ -76,3 +75,3 @@ __declspec(dllexport) | |||
76 | { | 75 | { |
77 | return new KRES::PluginFactory<ResourceDir,ResourceDirConfig, SyncPrefWidgetContainer>(); | 76 | return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>(); |
78 | } | 77 | } |
@@ -82,4 +81,4 @@ __declspec(dllexport) | |||
82 | 81 | ||
83 | ResourceDir::ResourceDir( const KConfig *config, bool syncable ) | 82 | ResourceDir::ResourceDir( const KConfig *config ) |
84 | : Resource( config, syncable ) | 83 | : Resource( config ) |
85 | { | 84 | { |
diff --git a/kabc/plugins/dir/resourcedir.h b/kabc/plugins/dir/resourcedir.h index 77cd18c..6c1e922 100644 --- a/kabc/plugins/dir/resourcedir.h +++ b/kabc/plugins/dir/resourcedir.h | |||
@@ -51,3 +51,3 @@ class ResourceDir : public Resource | |||
51 | public: | 51 | public: |
52 | ResourceDir( const KConfig*, bool syncable ); | 52 | ResourceDir( const KConfig* ); |
53 | ~ResourceDir(); | 53 | ~ResourceDir(); |
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index 163f2b4..dc5932f 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp | |||
@@ -53,3 +53,2 @@ $Id$ | |||
53 | #include "resourcefile.h" | 53 | #include "resourcefile.h" |
54 | #include "syncprefwidget.h" | ||
55 | 54 | ||
@@ -71,3 +70,3 @@ __declspec(dllexport) | |||
71 | { | 70 | { |
72 | return new KRES::PluginFactory<ResourceFile,ResourceFileConfig, SyncPrefWidgetContainer>(); | 71 | return new KRES::PluginFactory<ResourceFile,ResourceFileConfig>(); |
73 | } | 72 | } |
@@ -77,4 +76,4 @@ __declspec(dllexport) | |||
77 | 76 | ||
78 | ResourceFile::ResourceFile( const KConfig *config, bool syncable ) | 77 | ResourceFile::ResourceFile( const KConfig *config ) |
79 | : Resource( config, syncable ) , mFormat( 0 ) | 78 | : Resource( config ) , mFormat( 0 ) |
80 | { | 79 | { |
@@ -82,6 +81,3 @@ ResourceFile::ResourceFile( const KConfig *config, bool syncable ) | |||
82 | 81 | ||
83 | if (syncable == true) | 82 | default_fileName = StdAddressBook::fileName(); |
84 | default_fileName = "/home/polo/kdepim/apps/kabc/localfile.vcf"; | ||
85 | else | ||
86 | default_fileName = StdAddressBook::fileName(); | ||
87 | 83 | ||
@@ -99,5 +95,5 @@ ResourceFile::ResourceFile( const KConfig *config, bool syncable ) | |||
99 | 95 | ||
100 | ResourceFile::ResourceFile( const QString &fileName, bool syncable , | 96 | ResourceFile::ResourceFile( const QString &fileName , |
101 | const QString &formatName ) | 97 | const QString &formatName ) |
102 | : Resource( 0, syncable ) | 98 | : Resource( 0 ) |
103 | { | 99 | { |
diff --git a/kabc/plugins/file/resourcefile.h b/kabc/plugins/file/resourcefile.h index 8339340..b4421b2 100644 --- a/kabc/plugins/file/resourcefile.h +++ b/kabc/plugins/file/resourcefile.h | |||
@@ -60,3 +60,3 @@ public: | |||
60 | */ | 60 | */ |
61 | ResourceFile( const KConfig *cfg, bool syncable ); | 61 | ResourceFile( const KConfig *cfg ); |
62 | 62 | ||
@@ -65,3 +65,3 @@ public: | |||
65 | */ | 65 | */ |
66 | ResourceFile( const QString &fileName, bool syncable , const QString &formatName = "vcard" ); | 66 | ResourceFile( const QString &fileName , const QString &formatName = "vcard" ); |
67 | 67 | ||
diff --git a/kabc/plugins/ldap/resourceldap.cpp b/kabc/plugins/ldap/resourceldap.cpp index 17f115d..55c43af 100644 --- a/kabc/plugins/ldap/resourceldap.cpp +++ b/kabc/plugins/ldap/resourceldap.cpp | |||
@@ -38,3 +38,2 @@ $Id$ | |||
38 | #include "resourceldapconfig.h" | 38 | #include "resourceldapconfig.h" |
39 | #include "syncprefwidget.h" | ||
40 | 39 | ||
@@ -47,3 +46,3 @@ extern "C" | |||
47 | { | 46 | { |
48 | return new KRES::PluginFactory<ResourceLDAP,ResourceLDAPConfig, SyncPrefWidgetContainer>(); | 47 | return new KRES::PluginFactory<ResourceLDAP,ResourceLDAPConfig>(); |
49 | } | 48 | } |
@@ -54,4 +53,4 @@ void addModOp( LDAPMod ***pmods, const QString &attr, const QString &value ); | |||
54 | 53 | ||
55 | ResourceLDAP::ResourceLDAP( const KConfig *config, bool syncable ) | 54 | ResourceLDAP::ResourceLDAP( const KConfig *config ) |
56 | : Resource( config, syncable ), mPort( 389 ), mLdap( 0 ) | 55 | : Resource( config ), mPort( 389 ), mLdap( 0 ) |
57 | { | 56 | { |
diff --git a/kabc/plugins/ldap/resourceldap.h b/kabc/plugins/ldap/resourceldap.h index 0aad3c1..0625f30 100644 --- a/kabc/plugins/ldap/resourceldap.h +++ b/kabc/plugins/ldap/resourceldap.h | |||
@@ -45,3 +45,3 @@ public: | |||
45 | 45 | ||
46 | ResourceLDAP( const KConfig*, bool syncable ); | 46 | ResourceLDAP( const KConfig* ); |
47 | 47 | ||
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp index 22237dc..f610b38 100644 --- a/kabc/plugins/opie/resourceopie.cpp +++ b/kabc/plugins/opie/resourceopie.cpp | |||
@@ -52,3 +52,2 @@ $Id$ | |||
52 | #include "stdaddressbook.h" | 52 | #include "stdaddressbook.h" |
53 | #include "syncprefwidget.h" | ||
54 | 53 | ||
@@ -63,3 +62,3 @@ extern "C" | |||
63 | { | 62 | { |
64 | return new KRES::PluginFactory<ResourceOpie,ResourceOpieConfig, SyncPrefWidgetContainer>(); | 63 | return new KRES::PluginFactory<ResourceOpie,ResourceOpieConfig>(); |
65 | } | 64 | } |
@@ -67,4 +66,4 @@ extern "C" | |||
67 | 66 | ||
68 | ResourceOpie::ResourceOpie( const KConfig *config, bool syncable ) | 67 | ResourceOpie::ResourceOpie( const KConfig *config ) |
69 | : Resource( config, syncable ), mAccess(0), mConverter (0) | 68 | : Resource( config ), mAccess(0), mConverter (0) |
70 | { | 69 | { |
@@ -81,4 +80,4 @@ ResourceOpie::ResourceOpie( const KConfig *config, bool syncable ) | |||
81 | 80 | ||
82 | ResourceOpie::ResourceOpie( const QString &fileName, bool syncable ) | 81 | ResourceOpie::ResourceOpie( const QString &fileName ) |
83 | : Resource( 0, syncable ) | 82 | : Resource( 0 ) |
84 | { | 83 | { |
diff --git a/kabc/plugins/opie/resourceopie.h b/kabc/plugins/opie/resourceopie.h index d5b4ebd..9d05c70 100644 --- a/kabc/plugins/opie/resourceopie.h +++ b/kabc/plugins/opie/resourceopie.h | |||
@@ -59,3 +59,3 @@ public: | |||
59 | */ | 59 | */ |
60 | ResourceOpie( const KConfig *cfg, bool syncable ); | 60 | ResourceOpie( const KConfig *cfg ); |
61 | 61 | ||
@@ -64,3 +64,3 @@ public: | |||
64 | */ | 64 | */ |
65 | ResourceOpie( const QString &fileName, bool syncable ); | 65 | ResourceOpie( const QString &fileName ); |
66 | 66 | ||
diff --git a/kabc/plugins/qtopia/resourceqtopia.cpp b/kabc/plugins/qtopia/resourceqtopia.cpp index f9cabcb..deb218b 100644 --- a/kabc/plugins/qtopia/resourceqtopia.cpp +++ b/kabc/plugins/qtopia/resourceqtopia.cpp | |||
@@ -51,3 +51,2 @@ $Id$ | |||
51 | #include "qtopiaconverter.h" | 51 | #include "qtopiaconverter.h" |
52 | #include "syncprefwidget.h" | ||
53 | 52 | ||
@@ -60,3 +59,3 @@ extern "C" | |||
60 | { | 59 | { |
61 | return new KRES::PluginFactory<ResourceQtopia,ResourceQtopiaConfig, SyncPrefWidgetContainer>(); | 60 | return new KRES::PluginFactory<ResourceQtopia,ResourceQtopiaConfig>(); |
62 | } | 61 | } |
@@ -64,4 +63,4 @@ extern "C" | |||
64 | 63 | ||
65 | ResourceQtopia::ResourceQtopia( const KConfig *config, bool syncable ) | 64 | ResourceQtopia::ResourceQtopia( const KConfig *config ) |
66 | : Resource( config, syncable ), mConverter (0) | 65 | : Resource( config ), mConverter (0) |
67 | { | 66 | { |
@@ -72,4 +71,4 @@ ResourceQtopia::ResourceQtopia( const KConfig *config, bool syncable ) | |||
72 | 71 | ||
73 | ResourceQtopia::ResourceQtopia( const QString &fileName, bool syncable ) | 72 | ResourceQtopia::ResourceQtopia( const QString &fileName ) |
74 | : Resource( 0, syncable ) | 73 | : Resource( 0 ) |
75 | { | 74 | { |
diff --git a/kabc/plugins/qtopia/resourceqtopia.h b/kabc/plugins/qtopia/resourceqtopia.h index eace280..ff6350d 100644 --- a/kabc/plugins/qtopia/resourceqtopia.h +++ b/kabc/plugins/qtopia/resourceqtopia.h | |||
@@ -60,3 +60,3 @@ public: | |||
60 | */ | 60 | */ |
61 | ResourceQtopia( const KConfig *cfg, bool syncable ); | 61 | ResourceQtopia( const KConfig *cfg ); |
62 | 62 | ||
@@ -65,3 +65,3 @@ public: | |||
65 | */ | 65 | */ |
66 | ResourceQtopia( const QString &fileName, bool syncable ); | 66 | ResourceQtopia( const QString &fileName ); |
67 | 67 | ||
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp index c013f52..2cdf4bf 100644 --- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp +++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp | |||
@@ -52,4 +52,2 @@ $Id$ | |||
52 | 52 | ||
53 | #include "syncprefwidget.h" | ||
54 | |||
55 | #include "stdaddressbook.h" | 53 | #include "stdaddressbook.h" |
@@ -63,3 +61,3 @@ extern "C" | |||
63 | { | 61 | { |
64 | return new KRES::PluginFactory<ResourceSharpDTM,ResourceSharpDTMConfig,SyncPrefWidgetContainer>(); | 62 | return new KRES::PluginFactory<ResourceSharpDTM,ResourceSharpDTMConfig>(); |
65 | } | 63 | } |
@@ -67,4 +65,4 @@ extern "C" | |||
67 | 65 | ||
68 | ResourceSharpDTM::ResourceSharpDTM( const KConfig *config, bool syncable ) | 66 | ResourceSharpDTM::ResourceSharpDTM( const KConfig *config ) |
69 | : Resource( config, syncable ), mConverter (0) | 67 | : Resource( config ), mConverter (0) |
70 | { | 68 | { |
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.h b/kabc/plugins/sharpdtm/resourcesharpdtm.h index f386e69..64d06f9 100644 --- a/kabc/plugins/sharpdtm/resourcesharpdtm.h +++ b/kabc/plugins/sharpdtm/resourcesharpdtm.h | |||
@@ -60,3 +60,3 @@ public: | |||
60 | */ | 60 | */ |
61 | ResourceSharpDTM( const KConfig *cfg, bool syncable ); | 61 | ResourceSharpDTM( const KConfig *cfg ); |
62 | 62 | ||
@@ -65,3 +65,3 @@ public: | |||
65 | */ | 65 | */ |
66 | ResourceSharpDTM( const QString &fileName, bool syncable ); | 66 | ResourceSharpDTM( const QString &fileName ); |
67 | 67 | ||
diff --git a/kabc/resource.cpp b/kabc/resource.cpp index 7b91239..267cdaf 100644 --- a/kabc/resource.cpp +++ b/kabc/resource.cpp | |||
@@ -29,4 +29,2 @@ $Id$ | |||
29 | 29 | ||
30 | #include <ksyncprofile.h> | ||
31 | |||
32 | #include "resource.h" | 30 | #include "resource.h" |
@@ -35,10 +33,5 @@ using namespace KABC; | |||
35 | 33 | ||
36 | Resource::Resource( const KConfig *config, bool syncable ) | 34 | Resource::Resource( const KConfig *config ) |
37 | : KRES::Resource( config ), mAddressBook( 0 ), mSyncProfile( 0 ) | 35 | : KRES::Resource( config ), mAddressBook( 0 ) |
38 | { | 36 | { |
39 | if(syncable == true) { | ||
40 | mSyncProfile = new KSyncProfile( ); | ||
41 | mSyncProfile->setName("pending" /*resourceName()*/); | ||
42 | mSyncProfile->readConfig( (KConfig *)config ); | ||
43 | } | ||
44 | } | 37 | } |
@@ -47,5 +40,2 @@ Resource::~Resource() | |||
47 | { | 40 | { |
48 | if (mSyncProfile != 0) { | ||
49 | delete mSyncProfile; | ||
50 | } | ||
51 | } | 41 | } |
@@ -55,5 +45,2 @@ void Resource::writeConfig( KConfig *config ) | |||
55 | KRES::Resource::writeConfig( config ); | 45 | KRES::Resource::writeConfig( config ); |
56 | |||
57 | if(mSyncProfile != 0) | ||
58 | mSyncProfile->writeConfig( config ); | ||
59 | } | 46 | } |
@@ -110,13 +97,2 @@ void Resource::cleanUp() | |||
110 | 97 | ||
111 | bool Resource::isSyncable() const | ||
112 | { | ||
113 | return (mSyncProfile != 0); | ||
114 | } | ||
115 | |||
116 | KSyncProfile* Resource::getSyncProfile() | ||
117 | { | ||
118 | return mSyncProfile; | ||
119 | } | ||
120 | |||
121 | |||
122 | QString Resource::fileName() const | 98 | QString Resource::fileName() const |
@@ -138,6 +114,2 @@ void Resource::setResourceName( const QString &name ) | |||
138 | KRES::Resource::setResourceName(name); | 114 | KRES::Resource::setResourceName(name); |
139 | if(mSyncProfile != 0) { | ||
140 | mSyncProfile->setName( name ); | ||
141 | } | ||
142 | |||
143 | } | 115 | } |
diff --git a/kabc/resource.h b/kabc/resource.h index 2024d2d..e5f0d5d 100644 --- a/kabc/resource.h +++ b/kabc/resource.h | |||
@@ -35,4 +35,2 @@ $Id$ | |||
35 | 35 | ||
36 | class KSyncProfile; | ||
37 | |||
38 | namespace KABC { | 36 | namespace KABC { |
@@ -62,8 +60,2 @@ class Resource : public KRES::Resource | |||
62 | { | 60 | { |
63 | private: | ||
64 | /** | ||
65 | * make this constructor private to force everybody to use the other one | ||
66 | */ | ||
67 | Resource( const KConfig *config); | ||
68 | |||
69 | public: | 61 | public: |
@@ -72,3 +64,3 @@ public: | |||
72 | */ | 64 | */ |
73 | Resource( const KConfig *config, bool syncable ); | 65 | Resource( const KConfig *config ); |
74 | 66 | ||
@@ -141,7 +133,2 @@ public: | |||
141 | 133 | ||
142 | |||
143 | virtual bool isSyncable() const; | ||
144 | |||
145 | virtual KSyncProfile* getSyncProfile(); | ||
146 | |||
147 | /** | 134 | /** |
@@ -160,3 +147,2 @@ private: | |||
160 | AddressBook *mAddressBook; | 147 | AddressBook *mAddressBook; |
161 | KSyncProfile *mSyncProfile; | ||
162 | QString mFileName; | 148 | QString mFileName; |
diff --git a/kaddressbook/xxportobject.cpp b/kaddressbook/xxportobject.cpp index 4351753..67e8406 100644 --- a/kaddressbook/xxportobject.cpp +++ b/kaddressbook/xxportobject.cpp | |||
@@ -178,3 +178,3 @@ bool XXPortResourceObject::_exportContacts( const KABC::AddresseeList &list, con | |||
178 | //create new resource | 178 | //create new resource |
179 | KABC::Resource* mResource = (KABC::Resource*)(mFactory->resource( this->identifier(), 0, false )); | 179 | KABC::Resource* mResource = (KABC::Resource*)(mFactory->resource( this->identifier(), 0 )); |
180 | 180 | ||
@@ -238,3 +238,3 @@ KABC::AddresseeList XXPortResourceObject::_importContacts( const QString& identi | |||
238 | 238 | ||
239 | KABC::Resource* mResource = (KABC::Resource*)(mFactory->resource( this->identifier(), 0, false )); | 239 | KABC::Resource* mResource = (KABC::Resource*)(mFactory->resource( this->identifier(), 0 )); |
240 | 240 | ||
diff --git a/microkde/kresources/configdialog.cpp b/microkde/kresources/configdialog.cpp index 030b547..24e82bc 100644 --- a/microkde/kresources/configdialog.cpp +++ b/microkde/kresources/configdialog.cpp | |||
@@ -43,3 +43,2 @@ | |||
43 | #include "configdialog.h" | 43 | #include "configdialog.h" |
44 | #include "syncwidget.h" | ||
45 | 44 | ||
@@ -49,4 +48,4 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, | |||
49 | Resource* resource, const char *name ) | 48 | Resource* resource, const char *name ) |
50 | : KDialogBase( parent, name, true, resource->isSyncable()?i18n( "Sync Profile Configuration" ):i18n( "Resource Configuration" ), | 49 | : KDialogBase( parent, name, true, i18n( "Resource Configuration" ), |
51 | Ok|Cancel, Ok, true )/*, mConfig( config )*/, mSyncWidget_Settings(0), mSyncWidget_Conflicts(0),mSyncWidget_Remote(0), mResource( resource ), mPersistentReadOnly(false) | 50 | Ok|Cancel, Ok, true )/*, mConfig( config )*/, mResource( resource ), mPersistentReadOnly(false) |
52 | { | 51 | { |
@@ -60,6 +59,3 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, | |||
60 | 59 | ||
61 | if (!mResource->isSyncable()) | 60 | main = plainPage(); |
62 | main = plainPage(); | ||
63 | else | ||
64 | main = addPage("Profile"); | ||
65 | 61 | ||
@@ -72,3 +68,3 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, | |||
72 | 68 | ||
73 | new QLabel( mResource->isSyncable()?i18n( "Profile Name:" ):i18n( "Name:" ), generalGroupBox ); | 69 | new QLabel( i18n( "Name:" ), generalGroupBox ); |
74 | 70 | ||
@@ -76,10 +72,9 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, | |||
76 | 72 | ||
77 | if (!mResource->isSyncable()) { | 73 | new QLabel("", generalGroupBox ); |
78 | new QLabel("", generalGroupBox ); | 74 | mReadOnly = new QCheckBox( i18n( "Read-only" ), generalGroupBox ); |
79 | mReadOnly = new QCheckBox( i18n( "Read-only" ), generalGroupBox ); | 75 | mReadOnly->setChecked( mResource->readOnly() ); |
80 | mReadOnly->setChecked( mResource->readOnly() ); | 76 | |
81 | new QLabel("", generalGroupBox ); | 77 | new QLabel("", generalGroupBox ); |
82 | mIncludeInSync = new QCheckBox( i18n( "Include in sync" ), generalGroupBox ); | 78 | mIncludeInSync = new QCheckBox( i18n( "Include in sync" ), generalGroupBox ); |
83 | mIncludeInSync->setChecked( mResource->includeInSync() ); | 79 | mIncludeInSync->setChecked( mResource->includeInSync() ); |
84 | } | ||
85 | 80 | ||
@@ -101,2 +96,4 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, | |||
101 | SLOT( setReadOnly( bool ) ) ); | 96 | SLOT( setReadOnly( bool ) ) ); |
97 | connect( mConfigWidget, SIGNAL( setIncludeInSync( bool ) ), | ||
98 | SLOT( setIncludeInSync( bool ) ) ); | ||
102 | connect( mConfigWidget, SIGNAL( setPersistentReadOnly( bool ) ), | 99 | connect( mConfigWidget, SIGNAL( setPersistentReadOnly( bool ) ), |
@@ -109,55 +106,2 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, | |||
109 | 106 | ||
110 | if (mResource->isSyncable()) | ||
111 | { | ||
112 | SyncWidgetContainer* c = factory->syncWidgetContainer( resource->type() ); | ||
113 | |||
114 | QFrame* syncPage = addPage("Settings"); | ||
115 | QVBoxLayout *syncLayout = new QVBoxLayout( syncPage, 0, spacingHint() ); | ||
116 | mSyncWidget_Settings = c->generateSettingsTab(syncPage); | ||
117 | syncLayout->addWidget( mSyncWidget_Settings ); | ||
118 | |||
119 | syncPage = addPage("Conflicts"); | ||
120 | syncLayout = new QVBoxLayout( syncPage, 0, spacingHint() ); | ||
121 | mSyncWidget_Conflicts = c->generateConflictsTab(syncPage); | ||
122 | syncLayout->addWidget( mSyncWidget_Conflicts ); | ||
123 | |||
124 | syncPage = addPage("Remote"); | ||
125 | syncLayout = new QVBoxLayout( syncPage, 0, spacingHint() ); | ||
126 | mSyncWidget_Remote = c->generateRemoteTab(syncPage); | ||
127 | syncLayout->addWidget( mSyncWidget_Remote ); | ||
128 | |||
129 | |||
130 | mSyncWidget_Settings->setInEditMode( false ); | ||
131 | mSyncWidget_Settings->loadSettings( mResource ); | ||
132 | mSyncWidget_Settings->show(); | ||
133 | |||
134 | mSyncWidget_Conflicts->setInEditMode( false ); | ||
135 | mSyncWidget_Conflicts->loadSettings( mResource ); | ||
136 | mSyncWidget_Conflicts->show(); | ||
137 | |||
138 | mSyncWidget_Remote->setInEditMode( false ); | ||
139 | mSyncWidget_Remote->loadSettings( mResource ); | ||
140 | mSyncWidget_Remote->show(); | ||
141 | |||
142 | delete c; | ||
143 | |||
144 | // QGroupBox *syncGroupBox = new QGroupBox( 2, Qt::Horizontal, syncPage ); | ||
145 | // syncGroupBox->layout()->setSpacing( spacingHint()); | ||
146 | // syncGroupBox->setTitle( i18n( "Syncronize Preferences" ) ); | ||
147 | // syncLayout->addWidget( syncGroupBox ); | ||
148 | |||
149 | // syncLayout->addStretch(); | ||
150 | /*US | ||
151 | mSyncWidget = factory->syncWidget( resource->type(), syncPage ); | ||
152 | syncLayout->addWidget( mSyncWidget ); | ||
153 | if ( mSyncWidget ) { | ||
154 | mSyncWidget->setInEditMode( false ); | ||
155 | mSyncWidget->loadSettings( mResource ); | ||
156 | mSyncWidget->show(); | ||
157 | } | ||
158 | */ | ||
159 | } | ||
160 | |||
161 | |||
162 | |||
163 | 107 | ||
@@ -177,10 +121,2 @@ void ConfigDialog::setInEditMode( bool value ) | |||
177 | mConfigWidget->setInEditMode( value ); | 121 | mConfigWidget->setInEditMode( value ); |
178 | |||
179 | if ( mSyncWidget_Settings ) | ||
180 | mSyncWidget_Settings->setInEditMode( value ); | ||
181 | if ( mSyncWidget_Conflicts ) | ||
182 | mSyncWidget_Conflicts->setInEditMode( value ); | ||
183 | if ( mSyncWidget_Remote ) | ||
184 | mSyncWidget_Remote->setInEditMode( value ); | ||
185 | |||
186 | } | 122 | } |
@@ -194,4 +130,2 @@ void ConfigDialog::setReadOnly( bool value ) | |||
194 | { | 130 | { |
195 | if (!mResource->isSyncable()) { | ||
196 | |||
197 | if (mPersistentReadOnly == false) | 131 | if (mPersistentReadOnly == false) |
@@ -200,18 +134,26 @@ void ConfigDialog::setReadOnly( bool value ) | |||
200 | mReadOnly->setChecked( true ); | 134 | mReadOnly->setChecked( true ); |
201 | } | ||
202 | } | 135 | } |
203 | 136 | ||
204 | void ConfigDialog::setPersistentReadOnly( bool value ) | 137 | void ConfigDialog::setIncludeInSync( bool value ) |
205 | { | 138 | { |
206 | if (!mResource->isSyncable()) { | 139 | if (mPersistentReadOnly == false) |
140 | mIncludeInSync->setChecked( value ); | ||
141 | else | ||
142 | mIncludeInSync->setChecked( true ); | ||
143 | } | ||
207 | 144 | ||
145 | void ConfigDialog::setPersistentReadOnly( bool value ) | ||
146 | { | ||
208 | mPersistentReadOnly = value; | 147 | mPersistentReadOnly = value; |
209 | 148 | ||
210 | if (value == true) | 149 | if (value == true) { |
211 | setReadOnly( true ); | 150 | setReadOnly( true ); |
151 | setIncludeInSync( true ); | ||
152 | } | ||
212 | 153 | ||
213 | mReadOnly->setEnabled( !value ); | 154 | mReadOnly->setEnabled( !value ); |
214 | } | 155 | mIncludeInSync->setEnabled (!value ); |
215 | } | 156 | } |
216 | 157 | ||
158 | |||
217 | void ConfigDialog::accept() | 159 | void ConfigDialog::accept() |
@@ -219,3 +161,3 @@ void ConfigDialog::accept() | |||
219 | if ( mName->text().isEmpty() ) { | 161 | if ( mName->text().isEmpty() ) { |
220 | KMessageBox::sorry( this, mResource->isSyncable()?i18n( "Please enter a profile name" ):i18n( "Please enter a resource name" ) ); | 162 | KMessageBox::sorry( this, i18n( "Please enter a resource name" ) ); |
221 | return; | 163 | return; |
@@ -224,5 +166,4 @@ void ConfigDialog::accept() | |||
224 | mResource->setResourceName( mName->text() ); | 166 | mResource->setResourceName( mName->text() ); |
225 | if (!mResource->isSyncable()) | 167 | mResource->setReadOnly( mReadOnly->isChecked() ); |
226 | mResource->setReadOnly( mReadOnly->isChecked() ); | 168 | mResource->setIncludeInSync( mIncludeInSync->isChecked() ); |
227 | mResource->setIncludeInSync( mIncludeInSync->isChecked() ); | ||
228 | 169 | ||
@@ -234,10 +175,2 @@ void ConfigDialog::accept() | |||
234 | 175 | ||
235 | if ( mSyncWidget_Settings ) | ||
236 | mSyncWidget_Settings->saveSettings( mResource ); | ||
237 | if ( mSyncWidget_Conflicts ) | ||
238 | mSyncWidget_Conflicts->saveSettings( mResource ); | ||
239 | if ( mSyncWidget_Remote ) | ||
240 | mSyncWidget_Remote->saveSettings( mResource ); | ||
241 | |||
242 | |||
243 | KDialog::accept(); | 176 | KDialog::accept(); |
diff --git a/microkde/kresources/configdialog.h b/microkde/kresources/configdialog.h index ed3ecab..b205975 100644 --- a/microkde/kresources/configdialog.h +++ b/microkde/kresources/configdialog.h | |||
@@ -33,3 +33,2 @@ namespace KRES { | |||
33 | class ConfigWidget; | 33 | class ConfigWidget; |
34 | class SyncWidget; | ||
35 | 34 | ||
@@ -48,2 +47,3 @@ class ConfigDialog : public KDialogBase | |||
48 | void setReadOnly( bool value ); | 47 | void setReadOnly( bool value ); |
48 | void setIncludeInSync( bool value ); | ||
49 | void setPersistentReadOnly( bool value ); | 49 | void setPersistentReadOnly( bool value ); |
@@ -53,5 +53,2 @@ class ConfigDialog : public KDialogBase | |||
53 | ConfigWidget *mConfigWidget; | 53 | ConfigWidget *mConfigWidget; |
54 | SyncWidget *mSyncWidget_Settings; | ||
55 | SyncWidget *mSyncWidget_Conflicts; | ||
56 | SyncWidget *mSyncWidget_Remote; | ||
57 | Resource* mResource; | 54 | Resource* mResource; |
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp index 02c5fb1..533be51 100644 --- a/microkde/kresources/configpage.cpp +++ b/microkde/kresources/configpage.cpp | |||
@@ -59,5 +59,2 @@ using namespace KRES; | |||
59 | 59 | ||
60 | const QString ConfigPage::syncfamily = "syncprofiles"; | ||
61 | |||
62 | |||
63 | class ConfigViewItem : public QCheckListItem | 60 | class ConfigViewItem : public QCheckListItem |
@@ -186,3 +183,3 @@ void ConfigPage::load() | |||
186 | QStringList families; | 183 | QStringList families; |
187 | families << "contact" << syncfamily; | 184 | families << "contact"; |
188 | 185 | ||
@@ -194,3 +191,3 @@ void ConfigPage::load() | |||
194 | if ( !mFamilyMap.contains( family ) ) { | 191 | if ( !mFamilyMap.contains( family ) ) { |
195 | mCurrentManager = new Manager<Resource>( family, (family == syncfamily) ); | 192 | mCurrentManager = new Manager<Resource>( family ); |
196 | if ( mCurrentManager ) { | 193 | if ( mCurrentManager ) { |
@@ -207,4 +204,2 @@ void ConfigPage::load() | |||
207 | info.mConfig = new KConfig( locateLocal( "config", "kcalrc" ) ); | 204 | info.mConfig = new KConfig( locateLocal( "config", "kcalrc" ) ); |
208 | } else if ( family == syncfamily && QFile::exists( configDir + "/kabcsyncrc" ) ) { | ||
209 | info.mConfig = new KConfig( locateLocal( "config", "kabcsyncrc" ) ); | ||
210 | } else { | 205 | } else { |
@@ -312,14 +307,5 @@ void ConfigPage::slotAdd() | |||
312 | 307 | ||
313 | if (mFamily == syncfamily) | 308 | desc = QInputDialog::getItem( i18n( "Resource Configuration" ), |
314 | { | ||
315 | desc = QInputDialog::getItem( i18n( "Sync Configuration" ), | ||
316 | i18n( "Select resource type for the new sync profile:" ), descs, 0, | ||
317 | false, &ok, this ); | ||
318 | } | ||
319 | else | ||
320 | { | ||
321 | desc = QInputDialog::getItem( i18n( "Resource Configuration" ), | ||
322 | i18n( "Select type of the new resource:" ), descs, 0, | 309 | i18n( "Select type of the new resource:" ), descs, 0, |
323 | false, &ok, this ); | 310 | false, &ok, this ); |
324 | } | ||
325 | 311 | ||
@@ -338,10 +324,3 @@ void ConfigPage::slotAdd() | |||
338 | 324 | ||
339 | if (mFamily == syncfamily) | 325 | resource->setResourceName( type + "-resource" ); |
340 | { | ||
341 | resource->setResourceName( type + "-syncprofile" ); | ||
342 | } | ||
343 | else | ||
344 | { | ||
345 | resource->setResourceName( type + "-resource" ); | ||
346 | } | ||
347 | 326 | ||
diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp index e44fce3..4e4456d 100644 --- a/microkde/kresources/factory.cpp +++ b/microkde/kresources/factory.cpp | |||
@@ -189,36 +189,2 @@ ConfigWidget *Factory::configWidget( const QString& type, QWidget *parent ) | |||
189 | 189 | ||
190 | SyncWidgetContainer *Factory::syncWidgetContainer( const QString& type ) | ||
191 | { | ||
192 | if ( type.isEmpty() || !mTypeMap.contains( type ) ) | ||
193 | return 0; | ||
194 | |||
195 | //US KService::Ptr ptr = mTypeMap[ type ]; | ||
196 | //US KLibFactory *factory = KLibLoader::self()->factory( ptr->library().latin1() ); | ||
197 | PluginInfo* pi = mTypeMap[ type ]; | ||
198 | KLibFactory *factory = (KLibFactory *)KLibLoader::self()->factory( pi->library.latin1() ); | ||
199 | if ( !factory ) { | ||
200 | qDebug("KRES::Factory::syncWidget(): Factory creation failed for library %s", pi->library.latin1()); | ||
201 | kdDebug() << "KRES::Factory::syncWidget(): Factory creation failed" << endl; | ||
202 | return 0; | ||
203 | } | ||
204 | |||
205 | PluginFactoryBase *pluginFactory = static_cast<PluginFactoryBase *>( factory ); | ||
206 | |||
207 | if ( !pluginFactory ) { | ||
208 | qDebug("KRES::Factory::syncWidget(): no plugin factory for library %s", pi->library.latin1()); | ||
209 | kdDebug() << "KRES::Factory::syncWidget(): no plugin factory." << endl; | ||
210 | return 0; | ||
211 | } | ||
212 | |||
213 | SyncWidgetContainer *wdg = pluginFactory->syncWidgetContainer( ); | ||
214 | if ( !wdg ) { | ||
215 | //US kdDebug() << "'" << ptr->library() << "' is not a " + mResourceFamily + " plugin." << endl; | ||
216 | qDebug("%s is not a %s plugin.", pi->library.latin1(), mResourceFamily.latin1()); | ||
217 | return 0; | ||
218 | } | ||
219 | return wdg; | ||
220 | |||
221 | } | ||
222 | |||
223 | |||
224 | QString Factory::typeName( const QString &type ) const | 190 | QString Factory::typeName( const QString &type ) const |
@@ -247,3 +213,3 @@ QString Factory::typeDescription( const QString &type ) const | |||
247 | 213 | ||
248 | Resource *Factory::resource( const QString& type, const KConfig *config, bool syncable ) | 214 | Resource *Factory::resource( const QString& type, const KConfig *config ) |
249 | { | 215 | { |
@@ -278,3 +244,3 @@ Resource *Factory::resource( const QString& type, const KConfig *config, bool sy | |||
278 | 244 | ||
279 | Resource *resource = pluginFactory->resource( config, syncable ); | 245 | Resource *resource = pluginFactory->resource( config ); |
280 | if ( !resource ) { | 246 | if ( !resource ) { |
diff --git a/microkde/kresources/factory.h b/microkde/kresources/factory.h index 0e4231b..ea01b23 100644 --- a/microkde/kresources/factory.h +++ b/microkde/kresources/factory.h | |||
@@ -36,3 +36,2 @@ namespace KRES { | |||
36 | 36 | ||
37 | class SyncWidgetContainer; | ||
38 | class ConfigWidget; | 37 | class ConfigWidget; |
@@ -89,13 +88,2 @@ class Factory | |||
89 | /** | 88 | /** |
90 | * Returns the sync widget for the given resource type, | ||
91 | * or a null pointer if resource type doesn't exist, | ||
92 | * or a null pointer if resource does not support syncing. | ||
93 | * | ||
94 | * @param type The type of the resource, returned by @ref resources() | ||
95 | * @param resource The resource to be editted. | ||
96 | * @param parent The parent widget | ||
97 | */ | ||
98 | SyncWidgetContainer *syncWidgetContainer( const QString& type ); | ||
99 | |||
100 | /** | ||
101 | * Returns a pointer to a resource object or a null pointer | 89 | * Returns a pointer to a resource object or a null pointer |
@@ -106,5 +94,4 @@ class Factory | |||
106 | * @param config The config object where the resource get it settings from, or 0 if a new resource should be created. | 94 | * @param config The config object where the resource get it settings from, or 0 if a new resource should be created. |
107 | * @param syncable If the resource should support syncing capabilities. | ||
108 | */ | 95 | */ |
109 | Resource *resource( const QString& type, const KConfig *config, bool syncable ); | 96 | Resource *resource( const QString& type, const KConfig *config); |
110 | 97 | ||
diff --git a/microkde/kresources/manager.h b/microkde/kresources/manager.h index 7e9e19a..0e6f838 100644 --- a/microkde/kresources/manager.h +++ b/microkde/kresources/manager.h | |||
@@ -169,8 +169,3 @@ class Manager : private ManagerImplListener | |||
169 | 169 | ||
170 | /** | 170 | Manager( const QString &family ) |
171 | Return true, if the manager manages syncable resources. | ||
172 | */ | ||
173 | bool manageSyncable() { return mImpl->manageSyncable(); } | ||
174 | |||
175 | Manager( const QString &family, bool syncable ) | ||
176 | { | 171 | { |
@@ -179,3 +174,3 @@ class Manager : private ManagerImplListener | |||
179 | // because of the Factory::self() pattern | 174 | // because of the Factory::self() pattern |
180 | mImpl = new ManagerImpl( family, syncable ); | 175 | mImpl = new ManagerImpl( family ); |
181 | mImpl->setListener( this ); | 176 | mImpl->setListener( this ); |
@@ -262,3 +257,2 @@ class Manager : private ManagerImplListener | |||
262 | by @ref resourceTypeNames() | 257 | by @ref resourceTypeNames() |
263 | * @param syncable If the resource should support syncing capabilities. | ||
264 | */ | 258 | */ |
@@ -266,3 +260,3 @@ class Manager : private ManagerImplListener | |||
266 | { | 260 | { |
267 | return (T *)( mFactory->resource( type, 0, mImpl->manageSyncable() ) ); | 261 | return (T *)( mFactory->resource( type, 0 ) ); |
268 | } | 262 | } |
diff --git a/microkde/kresources/managerimpl.cpp b/microkde/kresources/managerimpl.cpp index 3655f50..81bbbec 100644 --- a/microkde/kresources/managerimpl.cpp +++ b/microkde/kresources/managerimpl.cpp | |||
@@ -43,4 +43,4 @@ using namespace KRES; | |||
43 | 43 | ||
44 | ManagerImpl::ManagerImpl( const QString &family, bool syncable ) | 44 | ManagerImpl::ManagerImpl( const QString &family ) |
45 | : mFamily( family ), mSyncable(syncable), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ), | 45 | : mFamily( family ), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ), |
46 | mFactory( 0 ) | 46 | mFactory( 0 ) |
@@ -270,3 +270,3 @@ Resource* ManagerImpl::readResourceConfig( const QString& identifier, | |||
270 | QString name = mConfig->readEntry( "ResourceName" ); | 270 | QString name = mConfig->readEntry( "ResourceName" ); |
271 | Resource *resource = mFactory->resource( type, mConfig, mSyncable ); | 271 | Resource *resource = mFactory->resource( type, mConfig ); |
272 | if ( !resource ) { | 272 | if ( !resource ) { |
@@ -366,9 +366,2 @@ Resource* ManagerImpl::getResource( const QString& identifier ) | |||
366 | 366 | ||
367 | /** | ||
368 | Return true, if the manager manages syncable resources. | ||
369 | */ | ||
370 | bool ManagerImpl::manageSyncable() const | ||
371 | { | ||
372 | return mSyncable; | ||
373 | } | ||
374 | 367 | ||
diff --git a/microkde/kresources/managerimpl.h b/microkde/kresources/managerimpl.h index 0425279..56a2db6 100644 --- a/microkde/kresources/managerimpl.h +++ b/microkde/kresources/managerimpl.h | |||
@@ -67,3 +67,3 @@ class ManagerImpl : public QObject | |||
67 | public: | 67 | public: |
68 | ManagerImpl( const QString &family, bool syncable); | 68 | ManagerImpl( const QString &family); |
69 | ~ManagerImpl(); | 69 | ~ManagerImpl(); |
@@ -92,7 +92,2 @@ class ManagerImpl : public QObject | |||
92 | 92 | ||
93 | /** | ||
94 | Return true, if the manager manages syncable resources. | ||
95 | */ | ||
96 | bool manageSyncable() const; | ||
97 | |||
98 | public slots: | 93 | public slots: |
@@ -114,3 +109,2 @@ class ManagerImpl : public QObject | |||
114 | QString mFamily; | 109 | QString mFamily; |
115 | bool mSyncable; | ||
116 | KConfig *mConfig; | 110 | KConfig *mConfig; |
diff --git a/microkde/kresources/resource.cpp b/microkde/kresources/resource.cpp index f79bcd0..cccd485 100644 --- a/microkde/kresources/resource.cpp +++ b/microkde/kresources/resource.cpp | |||
@@ -200,2 +200,3 @@ void Resource::dump() const | |||
200 | kdDebug(5650) << " ReadOnly: " << ( d->mReadOnly ? "yes" : "no" ) << endl; | 200 | kdDebug(5650) << " ReadOnly: " << ( d->mReadOnly ? "yes" : "no" ) << endl; |
201 | kdDebug(5650) << " IncludeInSync: " << ( d->mIncludeInSync ? "yes" : "no" ) << endl; | ||
201 | kdDebug(5650) << " Active: " << ( d->mActive ? "yes" : "no" ) << endl; | 202 | kdDebug(5650) << " Active: " << ( d->mActive ? "yes" : "no" ) << endl; |
diff --git a/microkde/kresources/resource.h b/microkde/kresources/resource.h index 70b5613..ed5af96 100644 --- a/microkde/kresources/resource.h +++ b/microkde/kresources/resource.h | |||
@@ -42,3 +42,2 @@ namespace KRES { | |||
42 | class ConfigWidget; | 42 | class ConfigWidget; |
43 | class SyncWidgetContainer; | ||
44 | 43 | ||
@@ -234,3 +233,3 @@ link_DATA= resourceexample.desktop | |||
234 | * A subclass should reimplement at least the constructor and the | 233 | * A subclass should reimplement at least the constructor and the |
235 | * @ref writeConfig method. | 234 | k * @ref writeConfig method. |
236 | * | 235 | * |
@@ -325,7 +324,2 @@ class Resource : public QObject | |||
325 | 324 | ||
326 | |||
327 | |||
328 | virtual bool isSyncable() const = 0; | ||
329 | |||
330 | |||
331 | /** | 325 | /** |
@@ -378,3 +372,3 @@ class PluginFactoryBase : public KLibFactory | |||
378 | public: | 372 | public: |
379 | virtual Resource *resource( const KConfig *config, bool syncable ) = 0; | 373 | virtual Resource *resource( const KConfig *config) = 0; |
380 | 374 | ||
@@ -382,4 +376,2 @@ class PluginFactoryBase : public KLibFactory | |||
382 | 376 | ||
383 | virtual SyncWidgetContainer *syncWidgetContainer() = 0; | ||
384 | |||
385 | protected: | 377 | protected: |
@@ -392,3 +384,3 @@ class PluginFactoryBase : public KLibFactory | |||
392 | 384 | ||
393 | template<class TR,class TC, class TS> | 385 | template<class TR,class TC> |
394 | class PluginFactory : public PluginFactoryBase | 386 | class PluginFactory : public PluginFactoryBase |
@@ -396,5 +388,5 @@ class PluginFactory : public PluginFactoryBase | |||
396 | public: | 388 | public: |
397 | Resource *resource( const KConfig *config, bool syncable ) | 389 | Resource *resource( const KConfig *config) |
398 | { | 390 | { |
399 | return new TR( config, syncable ); | 391 | return new TR( config ); |
400 | } | 392 | } |
@@ -405,8 +397,2 @@ class PluginFactory : public PluginFactoryBase | |||
405 | } | 397 | } |
406 | |||
407 | SyncWidgetContainer *syncWidgetContainer() | ||
408 | { | ||
409 | return new TS(); | ||
410 | } | ||
411 | |||
412 | }; | 398 | }; |
diff --git a/microkde/microkdeE.pro b/microkde/microkdeE.pro index df914ce..071ceb3 100644 --- a/microkde/microkdeE.pro +++ b/microkde/microkdeE.pro | |||
@@ -91,3 +91,2 @@ osmartpointer.h \ | |||
91 | kresources/kcmkresources.h \ | 91 | kresources/kcmkresources.h \ |
92 | kresources/syncwidget.h \ | ||
93 | kdecore/kmdcodec.h \ | 92 | kdecore/kmdcodec.h \ |
@@ -175,3 +174,2 @@ oprocess.cpp \ | |||
175 | kresources/selectdialog.cpp \ | 174 | kresources/selectdialog.cpp \ |
176 | kresources/syncwidget.cpp \ | ||
177 | kutils/kcmultidialog.cpp \ | 175 | kutils/kcmultidialog.cpp \ |