You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
1.4 KiB
83 lines
1.4 KiB
|
|
#include <klocale.h>
|
|
#include <kinstance.h>
|
|
#include <kaboutdata.h>
|
|
#include <kdebug.h>
|
|
|
|
#include "dbse_factory.h"
|
|
#include "KDBSearchEngine.h"
|
|
|
|
|
|
extern "C"
|
|
{
|
|
KDE_EXPORT void *init_kbabeldict_dbsearchengine()
|
|
{
|
|
return new DbSeFactory;
|
|
}
|
|
}
|
|
|
|
|
|
KInstance *DbSeFactory::s_instance = 0;
|
|
KAboutData *DbSeFactory::s_about = 0;
|
|
|
|
|
|
DbSeFactory::DbSeFactory( TQObject *tqparent, const char *name)
|
|
: KLibFactory(tqparent,name)
|
|
{
|
|
}
|
|
|
|
DbSeFactory::~DbSeFactory()
|
|
{
|
|
if(s_instance)
|
|
{
|
|
delete s_instance;
|
|
s_instance=0;
|
|
}
|
|
|
|
if(s_about)
|
|
{
|
|
delete s_about;
|
|
s_about=0;
|
|
}
|
|
}
|
|
|
|
|
|
TQObject *DbSeFactory::createObject( TQObject *tqparent, const char *name,
|
|
const char *classname, const TQStringList &)
|
|
{
|
|
if(TQCString(classname) != "SearchEngine")
|
|
{
|
|
kdError() << "not a SearchEngine requested" << endl;
|
|
return 0;
|
|
}
|
|
|
|
KDBSearchEngine *se = new KDBSearchEngine(tqparent,name);
|
|
|
|
emit objectCreated(se);
|
|
return se;
|
|
}
|
|
|
|
|
|
KInstance *DbSeFactory::instance()
|
|
{
|
|
if(!s_instance)
|
|
{
|
|
|
|
s_about = new KAboutData( "kdbsearchengine",
|
|
I18N_NOOP("Translation Database")
|
|
, "0.3" ,
|
|
I18N_NOOP("A fast translation search engine based on databases")
|
|
, KAboutData::License_GPL
|
|
, I18N_NOOP("Copyright 2000-2001 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 "dbse_factory.moc"
|