~ubuntu-branches/ubuntu/breezy/koffice/breezy

« back to all changes in this revision

Viewing changes to kontour/KIllustrator_factory.cc

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040509113300-vfrdadqsvjfuhn3b
Tags: 1:1.3.1-1
* New upstream bugfix release.
* Built against newer imagemagick (closes: #246623).
* Made koffice-libs/kformula recommend/depend on latex-xft-fonts, which
  provides mathematical fonts that the formula editor can use.  Also
  patched the kformula part to make these fonts the default.
* Changed kword menu hint from "WordProcessors" to "Word processors"
  (closes: #246209).
* Spellchecker configuration is now fixed (closes: #221256, #227568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <KIllustrator_factory.h>
2
 
#include <KIllustrator_doc.h>
3
 
#include <KIllustrator_aboutdata.h>
4
 
 
5
 
#include <kinstance.h>
6
 
#include <kiconloader.h>
7
 
#include <kstddirs.h>
8
 
#include <kaboutdata.h>
9
 
#include <klocale.h>
10
 
 
11
 
extern "C"
12
 
{
13
 
    void* init_libkontourpart()
14
 
    {
15
 
        return new KIllustratorFactory;
16
 
    }
17
 
};
18
 
 
19
 
KInstance* KIllustratorFactory::s_global = 0;
20
 
KAboutData* KIllustratorFactory::s_aboutData = 0;
21
 
 
22
 
KIllustratorFactory::KIllustratorFactory( QObject* parent, const char* name )
23
 
    : KoFactory( parent, name )
24
 
{
25
 
    global();
26
 
}
27
 
 
28
 
KIllustratorFactory::~KIllustratorFactory()
29
 
{
30
 
    delete s_aboutData;
31
 
    s_aboutData=0;
32
 
    delete s_global;
33
 
    s_global = 0L;
34
 
}
35
 
 
36
 
KAboutData* KIllustratorFactory::aboutData()
37
 
{
38
 
  if( !s_aboutData )
39
 
      s_aboutData=newKIllustratorAboutData();
40
 
  return s_aboutData;
41
 
}
42
 
 
43
 
KParts::Part* KIllustratorFactory::createPart( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, const char* classname, const QStringList & )
44
 
{
45
 
    bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 );
46
 
 
47
 
    KIllustratorDocument *doc = new KIllustratorDocument( parentWidget, widgetName, parent, name, !bWantKoDocument );
48
 
 
49
 
    if ( !bWantKoDocument )
50
 
      doc->setReadWrite( false );
51
 
 
52
 
    emit objectCreated( doc );
53
 
    return doc;
54
 
}
55
 
 
56
 
KInstance* KIllustratorFactory::global()
57
 
{
58
 
    if ( !s_global )
59
 
      s_global = new KInstance(aboutData ());
60
 
    s_global->dirs ()->addResourceType ("kontour_template",
61
 
                                        KStandardDirs::kde_default("data") +
62
 
                                        "kontour/templates/");
63
 
    s_global->dirs ()->addResourceType ("kontour_palettes",
64
 
                                        KStandardDirs::kde_default("data") +
65
 
                                        "kontour/palettes/");
66
 
    // Tell the iconloader about share/apps/koffice/icons
67
 
    s_global->iconLoader()->addAppDir("koffice");
68
 
    return s_global;
69
 
}
70
 
 
71
 
#include <KIllustrator_factory.moc>