# Namespace KGlobal

Module | kdecore
Namespace | KGlobal

### enums

- CopyCatalogs { DoCopyCatalogs, DontCopyCatalogs }

enum details

### methods

- activeComponent ( )

  returns KComponentData

  The component currently active (useful in a multi-component application, such as a KParts application). Don't use this - it's mainly for KAboutDialog and KBugReport. Internal

- caption ( )

  returns QString

  Returns a text for the window caption.

  This may be set by "-caption", otherwise it will be equivalent to the name of the executable. Returns the text for the window caption

- charsets ( )

  returns KCharsets
  Not implemented

  The global charset manager. Returns the global charset manager

- charsets ( )

  returns KCharsets

- config ( )

  returns KSharedConfigPtr

  Returns the general config object. Returns the global configuration object.

- deref ( )

  returns Nothing

  Tells KGlobal that one operation such as those described in ref() just finished. This call makes the QApplication quit if the counter is back to 0.

- dirs ( )

  returns KStandardDirs

  Returns the application standard dirs object. Returns the global standard dir object

- hasLocale ( )

  returns bool

  Internal Returns whether KGlobal has a valid KLocale object

- hasMainComponent ( )

  returns bool

  Internal Returns whether a main KComponentData is available.

- locale ( )

  returns KLocale

  Returns the global locale object. Returns the global locale object

- mainComponent ( )

  returns KComponentData

  Returns the global component data. There is always at least one instance of a component in one application (in most cases the application itself). Returns the global component data

- ref ( )

  returns Nothing

  Tells KGlobal about one more operations that should be finished before the application exits. The standard behavior is to exit on the "last window closed" event, but some events should outlive the last window closed (e.g. a file copy for a file manager, or 'compacting folders on exit' for a mail client).

  Note that for this to happen you must call qApp->setQuitOnLastWindowClosed(false), in main() for instance.

- setActiveComponent (d)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  d | KComponentData |

  Set the active component for use by KAboutDialog and KBugReport. To be used only by a multi-component (KParts) application.

  See also activeComponent()

- setLocale (a0, copy)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | KLocale |
  copy | KGlobal.CopyCatalogs | KGlobal.DoCopyCatalogs

  Internal

- staticQString (str)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  str | char |

  Creates a static QString.

  To be used inside functions(!) like:

      static const QString &myString = KGlobal.staticQString("myText");

  Do NOT use code such as:

      static QString myString = KGlobal.staticQString("myText");

  This creates a static object (instead of a static reference) and as you know static objects are EVIL.

  str - the string to create Returns the static string

- staticQString (str)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  str | QString |

  Creates a static QString.

  To be used inside functions(!) like:

      static const QString &myString = KGlobal.staticQString(i18n("My Text"));

  Do NOT use code such as:

      static QString myString = KGlobal.staticQString(i18n("myText"));

  This creates a static object (instead of a static reference) and as you know static objects are EVIL.

  str - the string to create Returns the static string

- umask ( )

  returns mode_t
  KDE 4.1.0 and later only

  Returns the umask of the process. Returns the umask of the process

### enums - detail

- CopyCatalogs { DoCopyCatalogs, DontCopyCatalogs }

  For setLocale

  | DoCopyCatalogs | - | - |
  | DontCopyCatalogs | - | - |