pgioptionsfactory.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <kdebug.h>
00013 #include <kinstance.h>
00014 #include "pgioptionsplugin.h"
00015 #include "pgioptionsfactory.h"
00016
00017
00018 extern "C" {
00019
00020 void *init_libkdevpgioptions()
00021 {
00022 return new PgiOptionsFactory;
00023 }
00024
00025 }
00026
00027
00028 PgiOptionsFactory::PgiOptionsFactory(QObject *parent, const char *name)
00029 : KLibFactory(parent, name)
00030 {
00031 instance();
00032 }
00033
00034
00035 PgiOptionsFactory::~PgiOptionsFactory()
00036 {
00037 delete s_instance;
00038 s_instance = 0;
00039 }
00040
00041
00042 QObject *PgiOptionsFactory::createObject(QObject *parent, const char *name,
00043 const char * , const QStringList &args)
00044 {
00045 if (args.count() > 0 && qstrcmp(args[0].latin1(), "pghpf") == 0) {
00046 kdDebug(9021) << "Building PgiOptions for PGHPF" << endl;
00047 return new PgiOptionsPlugin(PgiOptionsPlugin::PGHPF, parent, name);
00048 } else if (args.count() > 0 && qstrcmp(args[0].latin1(), "pgf77") == 0) {
00049 kdDebug(9021) << "Building PgiOptions for PGF77" << endl;
00050 return new PgiOptionsPlugin(PgiOptionsPlugin::PGF77, parent, name);
00051 } else {
00052 kdDebug(9021) << "Wrong args for kdevpgioptions library" << endl;
00053 if (args.count() > 0)
00054 kdDebug(9021) << args[0] << endl;
00055 return 0;
00056 }
00057 }
00058
00059
00060 KInstance *PgiOptionsFactory::s_instance = 0;
00061 KInstance *PgiOptionsFactory::instance()
00062 {
00063 if (!s_instance)
00064 s_instance = new KInstance("kdevpgioptions");
00065
00066 return s_instance;
00067 }
00068
00069 #include "pgioptionsfactory.moc"
This file is part of the documentation for KDevelop Version 3.1.2.