diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
commit | 8362bf63dea22bbf6736609b0f49c152f975eb63 (patch) | |
tree | 0eea3928e39e50fae91d4e68b21b1e6cbae25604 /kchart/kchart_factory.cc | |
download | koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip |
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kchart/kchart_factory.cc')
-rw-r--r-- | kchart/kchart_factory.cc | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/kchart/kchart_factory.cc b/kchart/kchart_factory.cc new file mode 100644 index 00000000..de8fee19 --- /dev/null +++ b/kchart/kchart_factory.cc @@ -0,0 +1,82 @@ +/** + * $Id: kchart_factory.cc 483001 2005-11-24 18:27:18Z dfaure $ + * + * Kalle Dalheimer <kalle@kde.org> + */ + + +#include "kchart_factory.h" +#include "kchart_aboutdata.h" +#include "kchart_part.h" +#include <klocale.h> +#include <kinstance.h> +#include <kdebug.h> +#include <kiconloader.h> +#include <kstandarddirs.h> + +namespace KChart +{ + +KInstance *KChartFactory::s_global = 0; +KAboutData *KChartFactory::s_aboutData = 0; + + +KChartFactory::KChartFactory( QObject* parent, const char* name ) + : KoFactory( parent, name ) +{ + global(); +} + + +KChartFactory::~KChartFactory() +{ + delete s_aboutData; + s_aboutData = 0; + delete s_global; + s_global = 0; +} + + +KParts::Part* KChartFactory::createPartObject( QWidget *parentWidget, + const char *widgetName, + QObject* parent, + const char* name, + const char *classname, + const QStringList & ) +{ + bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 ); + + KChartPart *part = new KChartPart( parentWidget, widgetName, parent, name, + !bWantKoDocument ); + + if ( !bWantKoDocument ) + part->setReadWrite( false ); + + return part; +} + + +KAboutData* KChartFactory::aboutData() +{ + if( !s_aboutData ) + s_aboutData = newKChartAboutData(); + return s_aboutData; +} + + +KInstance* KChartFactory::global() +{ + if ( !s_global ) + { + s_global = new KInstance(aboutData()); + s_global->dirs()->addResourceType( "kchart_template", + KStandardDirs::kde_default("data") + "kchart/templates/"); + // Tell the iconloader about share/apps/koffice/icons + s_global->iconLoader()->addAppDir("koffice"); + } + return s_global; +} + +} //namespace KChart + +#include <kchart_factory.moc> |