diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bd9e6617827818fd043452c08c606f07b78014a0 (patch) | |
tree | 425bb4c3168f9c02f10150f235d2cb998dcc6108 /kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.cpp | |
download | tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.cpp')
-rw-r--r-- | kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.cpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.cpp new file mode 100644 index 00000000..9c286052 --- /dev/null +++ b/kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.cpp @@ -0,0 +1,83 @@ + +#include <klocale.h> +#include <kinstance.h> +#include <kaboutdata.h> +#include <kdebug.h> + +#include "dbse2_factory.h" +#include "KDBSearchEngine2.h" + + +extern "C" +{ + KDE_EXPORT void *init_kbabeldict_dbsearchengine2() +// void *init_libdbsearchengine2() + { + return new DbSe2Factory; + } +}; + + +KInstance *DbSe2Factory::s_instance = 0; +KAboutData *DbSe2Factory::s_about = 0; + + +DbSe2Factory::DbSe2Factory( QObject *parent, const char *name) + : KLibFactory(parent,name) +{ +} + +DbSe2Factory::~DbSe2Factory() +{ + if(s_instance) + { + delete s_instance; + s_instance=0; + } + + if(s_about) + { + delete s_about; + s_about=0; + } +} + + +QObject *DbSe2Factory::createObject( QObject *parent, const char *name, + const char *classname, const QStringList &) +{ + if(QCString(classname) != "SearchEngine") + { + kdError() << "not a SearchEngine requested" << endl; + return 0; + } + + KDBSearchEngine2 *se = new KDBSearchEngine2(parent,name); + + emit objectCreated(se); + return se; +} + + +KInstance *DbSe2Factory::instance() +{ + if(!s_instance) + { + + s_about = new KAboutData( "kdbsearchengine2", + I18N_NOOP("Translation Database") + , "1.99" , +I18N_NOOP("A fast translation search engine based on databases") + , KAboutData::License_GPL + , I18N_NOOP("Copyright 2000-2003 by Andrea Rizzi") + ,0,0, "rizzi@kde.org"); + + s_about->addAuthor("Andrea Rizzi",0,"rizzi@kde.org"); + + s_instance = new KInstance(s_about); + } + + return s_instance; +} + +#include "dbse2_factory.moc" |