summaryrefslogtreecommitdiffabout
path: root/microkde/kresources/factory.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kresources/factory.cpp') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kresources/factory.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp
index a3b7fff..5fbfa68 100644
--- a/microkde/kresources/factory.cpp
+++ b/microkde/kresources/factory.cpp
@@ -34,6 +34,11 @@
#include "resource.h"
#include "factory.h"
+#ifdef STATIC_RESOURCES
+#include <file/resourcefile.h>
+#include <dir/resourcedir.h>
+#include <qtopia/resourceqtopia.h>
+#endif
using namespace KRES;
QDict<Factory> *Factory::mSelves = 0;
@@ -219,6 +224,25 @@ Resource *Factory::resource( const QString& type, const KConfig *config )
if ( type.isEmpty() || !mTypeMap.contains( type ) )
return 0;
+#ifdef STATIC_RESOURCES
+ qDebug("NEW STATIC RESOURCE %s", type.latin1());
+ Resource *resource = 0;
+ if ( type == "file" ) {
+ resource = (Resource *) new KABC::ResourceFile( config );
+ } else if ( type == "dir" ) {
+ resource = new KABC::ResourceDir( config );
+ } else if ( type == "qtopia" ) {
+ resource = new KABC::ResourceQtopia( config );
+ }
+ if ( !resource)
+ qDebug("Factory::resource:: resources are statically linked. resource type %s is not supported ",type.latin1() );
+ else
+ resource->setType( type );
+ return resource;
+#else
+
+
+
/*US load the lib not dynamicly. !!
KService::Ptr ptr = mTypeMap[ type ];
KLibFactory *factory = KLibLoader::self()->factory( ptr->library().latin1() );
@@ -253,4 +277,6 @@ Resource *Factory::resource( const QString& type, const KConfig *config )
resource->setType( type );
return resource;
+
+#endif
}