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.7 KiB
83 lines
1.7 KiB
15 years ago
|
/**
|
||
4 years ago
|
* $Id: kchart_factory.cpp 483001 2005-11-24 18:27:18Z dfaure $
|
||
15 years ago
|
*
|
||
|
* Kalle Dalheimer <kalle@kde.org>
|
||
|
*/
|
||
|
|
||
|
|
||
|
#include "kchart_factory.h"
|
||
|
#include "kchart_aboutdata.h"
|
||
|
#include "kchart_part.h"
|
||
12 years ago
|
#include <tdelocale.h>
|
||
15 years ago
|
#include <kinstance.h>
|
||
|
#include <kdebug.h>
|
||
|
#include <kiconloader.h>
|
||
|
#include <kstandarddirs.h>
|
||
|
|
||
|
namespace KChart
|
||
|
{
|
||
|
|
||
12 years ago
|
TDEInstance *KChartFactory::s_global = 0;
|
||
|
TDEAboutData *KChartFactory::s_aboutData = 0;
|
||
15 years ago
|
|
||
|
|
||
13 years ago
|
KChartFactory::KChartFactory( TQObject* parent, const char* name )
|
||
|
: KoFactory( parent, name )
|
||
15 years ago
|
{
|
||
|
global();
|
||
|
}
|
||
|
|
||
|
|
||
|
KChartFactory::~KChartFactory()
|
||
|
{
|
||
|
delete s_aboutData;
|
||
|
s_aboutData = 0;
|
||
|
delete s_global;
|
||
|
s_global = 0;
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
KParts::Part* KChartFactory::createPartObject( TQWidget *parentWidget,
|
||
15 years ago
|
const char *widgetName,
|
||
13 years ago
|
TQObject* parent,
|
||
15 years ago
|
const char* name,
|
||
|
const char *classname,
|
||
14 years ago
|
const TQStringList & )
|
||
15 years ago
|
{
|
||
|
bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 );
|
||
|
|
||
13 years ago
|
KChartPart *part = new KChartPart( parentWidget, widgetName, parent, name,
|
||
15 years ago
|
!bWantKoDocument );
|
||
|
|
||
|
if ( !bWantKoDocument )
|
||
|
part->setReadWrite( false );
|
||
|
|
||
|
return part;
|
||
|
}
|
||
|
|
||
|
|
||
12 years ago
|
TDEAboutData* KChartFactory::aboutData()
|
||
15 years ago
|
{
|
||
|
if( !s_aboutData )
|
||
|
s_aboutData = newKChartAboutData();
|
||
|
return s_aboutData;
|
||
|
}
|
||
|
|
||
|
|
||
12 years ago
|
TDEInstance* KChartFactory::global()
|
||
15 years ago
|
{
|
||
|
if ( !s_global )
|
||
|
{
|
||
12 years ago
|
s_global = new TDEInstance(aboutData());
|
||
15 years ago
|
s_global->dirs()->addResourceType( "kchart_template",
|
||
12 years ago
|
TDEStandardDirs::kde_default("data") + "kchart/templates/");
|
||
15 years ago
|
// Tell the iconloader about share/apps/koffice/icons
|
||
|
s_global->iconLoader()->addAppDir("koffice");
|
||
|
}
|
||
|
return s_global;
|
||
|
}
|
||
|
|
||
|
} //namespace KChart
|
||
|
|
||
|
#include <kchart_factory.moc>
|