aboutsummaryrefslogtreecommitdiffstats
path: root/kde2/plugins/plppropsFactory.cc
blob: 45b47b1366e61b967589efc069f38b631e406863 (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
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#ifdef ENABLE_NLS
namespace LIBPLP {
extern "C" {
#include <intl.h>
	void init_libplp_i18n() {
#ifdef HAVE_BINDTEXTDOMAIN_CODESET
		bind_textdomain_codeset(PACKAGE, "latin1");
#endif
		textdomain(PACKAGE);
	}
};
};
#endif

#include "plppropsFactory.h"
#include "plpprops.h"

#include <stream.h>
#include <kdebug.h>
#include <klocale.h>

extern "C" {
	void *init_libplpprops() {
		return new plppropsFactory();
	}
};

plppropsFactory::plppropsFactory(QObject *parent, const char *name)
	: KLibFactory(parent, name) {
	s_global = new KInstance("plpprops");
	// Install the translations
#ifdef ENABLE_NLS
	LIBPLP::init_libplp_i18n();
#endif
	KGlobal::locale()->insertCatalogue(QString::fromLatin1("plptools"));
	KGlobal::locale()->insertCatalogue(QString::fromLatin1("libplpprops"));
}

plppropsFactory::~plppropsFactory() {
	delete s_global;
}

QObject* plppropsFactory::createObject(QObject* parent, const char *name, const char *classname, const QStringList & ) {

	QObject *obj = 0L;

	if ((strcmp(classname, "KPropsDlgPlugin") == 0) &&
	    parent &&
	    parent->inherits("KPropertiesDialog"))
		obj = new PlpPropsPlugin(static_cast<KPropertiesDialog *>(parent));
	return obj;
}

#include <plppropsFactory.moc>