summaryrefslogtreecommitdiffabout
path: root/microkde/kresources/factory.cpp
Unidiff
Diffstat (limited to 'microkde/kresources/factory.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/factory.cpp38
1 files changed, 2 insertions, 36 deletions
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
@@ -184,46 +184,12 @@ ConfigWidget *Factory::configWidget( const QString& type, QWidget *parent )
184 return 0; 184 return 0;
185 } 185 }
186 return wdg; 186 return wdg;
187 187
188} 188}
189 189
190SyncWidgetContainer *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
224QString Factory::typeName( const QString &type ) const 190QString Factory::typeName( const QString &type ) const
225{ 191{
226 if ( type.isEmpty() || !mTypeMap.contains( type ) ) 192 if ( type.isEmpty() || !mTypeMap.contains( type ) )
227 return QString(); 193 return QString();
228 194
229 195
@@ -242,13 +208,13 @@ QString Factory::typeDescription( const QString &type ) const
242//US KService::Ptr ptr = mTypeMap[ type ]; 208//US KService::Ptr ptr = mTypeMap[ type ];
243//US return ptr->comment(); 209//US return ptr->comment();
244 PluginInfo* pi = mTypeMap[ type ]; 210 PluginInfo* pi = mTypeMap[ type ];
245 return pi->descriptionLabel; 211 return pi->descriptionLabel;
246} 212}
247 213
248Resource *Factory::resource( const QString& type, const KConfig *config, bool syncable ) 214Resource *Factory::resource( const QString& type, const KConfig *config )
249{ 215{
250 216
251 217
252 if ( type.isEmpty() || !mTypeMap.contains( type ) ) 218 if ( type.isEmpty() || !mTypeMap.contains( type ) )
253 return 0; 219 return 0;
254 220
@@ -273,13 +239,13 @@ Resource *Factory::resource( const QString& type, const KConfig *config, bool sy
273 if ( !pluginFactory ) { 239 if ( !pluginFactory ) {
274 qDebug("KRES::Factory::resource(): no plugin factory for library %s", pi->library.latin1()); 240 qDebug("KRES::Factory::resource(): no plugin factory for library %s", pi->library.latin1());
275 kdDebug() << "KRES::Factory::resource(): no plugin factory." << endl; 241 kdDebug() << "KRES::Factory::resource(): no plugin factory." << endl;
276 return 0; 242 return 0;
277 } 243 }
278 244
279 Resource *resource = pluginFactory->resource( config, syncable ); 245 Resource *resource = pluginFactory->resource( config );
280 if ( !resource ) { 246 if ( !resource ) {
281//US kdDebug() << "'" << ptr->library() << "' is not a " + mResourceFamily + " plugin." << endl; 247//US kdDebug() << "'" << ptr->library() << "' is not a " + mResourceFamily + " plugin." << endl;
282 qDebug("%s is not a %s plugin.", pi->library.latin1(), mResourceFamily.latin1()); 248 qDebug("%s is not a %s plugin.", pi->library.latin1(), mResourceFamily.latin1());
283 return 0; 249 return 0;
284 } 250 }
285 251