summaryrefslogtreecommitdiffstats
path: root/kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.cpp
blob: 9c28605274b886b4b2181e4a998f08f604216d8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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"