• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KDECore

KGlobal Class Reference

Access to the KDE global objects. More...

#include <kglobal.h>

List of all members.


Static Public Member Functions

static KInstance * activeInstance ()
static KCharsets * charsets ()
static KConfig * config ()
static void deleteStaticDeleters ()
static KStandardDirs * dirs ()
static KIconLoader * iconLoader ()
static KInstance * instance ()
static KLocale * locale ()
static void registerStaticDeleter (KStaticDeleterBase *d)
static void setActiveInstance (KInstance *d)
static KSharedConfig * sharedConfig ()
static const QString & staticQString (const QString &str)
static const QString & staticQString (const char *str)
static void unregisterStaticDeleter (KStaticDeleterBase *d)

Static Public Attributes

static KInstance * _activeInstance = 0
static KCharsets * _charsets = 0
static KInstance * _instance = 0
static KLocale * _locale = 0
static KStaticDeleterList * _staticDeleters = 0
static KStringDict * _stringDict = 0

Related Functions

(Note that these are not member functions.)

bool checkAccess (const QString &pathname, int mode)
kdbgstream & endl (kdbgstream &s)
kdbgstream & flush (kdbgstream &s)
 KABS(a)
 KCLAMP(x, low, high)
QString kdBacktrace (int levels)
QString kdBacktrace ()
void kdClearDebugConfig ()
kdbgstream kdDebug (int area=0)
kdbgstream kdError (int area=0)
kdbgstream kdFatal (int area=0)
kdbgstream kdWarning (int area=0)
 KMAX(a, b)
 KMIN(a, b)

Detailed Description

Access to the KDE global objects.

KGlobal provides you with pointers of many central objects that exist only once in the process. It is also responsible for managing instances of KStaticDeleterBase.

See also:
KStaticDeleterBase
Author:
Sirtaj Singh Kang (taj@kde.org)

Definition at line 44 of file kglobal.h.


Member Function Documentation

static KInstance* KGlobal::activeInstance (  )  [inline, static]

Definition at line 168 of file kglobal.h.

KCharsets * KGlobal::charsets (  )  [static]

The global charset manager.

Returns:
the global charset manager

Definition at line 104 of file kglobal.cpp.

KConfig * KGlobal::config (  )  [static]

Returns the general config object.

Returns:
the global configuration object.

Definition at line 61 of file kglobal.cpp.

void KGlobal::deleteStaticDeleters (  )  [static]

Calls KStaticDeleterBase::destructObject() on all registered static deleters and unregisters them all.

See also:
KStaticDeleterBase

KStaticDeleter

Definition at line 185 of file kglobal.cpp.

KStandardDirs * KGlobal::dirs (  )  [static]

Returns the application standard dirs object.

Returns:
the global standard dir object

Definition at line 54 of file kglobal.cpp.

KIconLoader * KGlobal::iconLoader (  )  [static]

Returns an iconloader object.

Returns:
the global iconloader object

Definition at line 75 of file kglobal.cpp.

KInstance * KGlobal::instance (  )  [static]

Returns the global instance.

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

Returns:
the global instance

Definition at line 82 of file kglobal.cpp.

KLocale * KGlobal::locale (  )  [static]

Returns the global locale object.

Returns:
the global locale object

Definition at line 88 of file kglobal.cpp.

void KGlobal::registerStaticDeleter ( KStaticDeleterBase *  d  )  [static]

Registers a static deleter.

Parameters:
d the static deleter to register
See also:
KStaticDeleterBase

KStaticDeleter

Definition at line 169 of file kglobal.cpp.

void KGlobal::setActiveInstance ( KInstance *  d  )  [static]

The instance currently active (useful in a multi-instance application, such as a KParts application).

Don't use this - it's mainly for KAboutDialog and KBugReport.

For internal use only.

Definition at line 114 of file kglobal.cpp.

KSharedConfig * KGlobal::sharedConfig (  )  [static]

Returns the general config object.

Returns:
the global configuration object.

Definition at line 68 of file kglobal.cpp.

const QString & KGlobal::staticQString ( const QString &  str  )  [static]

Creates a static QString.

Create a static QString.

To be used inside functions(!) like:

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

!!! Do _NOT_ use: !!!

 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.
Parameters:
str the string to create
Returns:
the static string
To be used inside functions(!) like: static const QString &myString = KGlobal::staticQString(i18n("My Text"));

Definition at line 146 of file kglobal.cpp.

const QString & KGlobal::staticQString ( const char *  str  )  [static]

Creates a static QString.

Create a static QString.

To be used inside functions(!) like:

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

!!! Do _NOT_ use: !!!

 static QString myString = KGlobal::staticQString("myText");
This creates a static object (instead of a static reference) and as you know static objects are EVIL.
Parameters:
str the string to create
Returns:
the static string
To be used inside functions(!) like: static const QString &myString = KGlobal::staticQString("myText");

Definition at line 128 of file kglobal.cpp.

void KGlobal::unregisterStaticDeleter ( KStaticDeleterBase *  d  )  [static]

Unregisters a static deleter.

Parameters:
d the static deleter to unregister
See also:
KStaticDeleterBase

KStaticDeleter

Definition at line 178 of file kglobal.cpp.


Friends And Related Function Documentation

bool checkAccess ( const QString &  pathname,
int  mode 
) [related]

Check, if a file may be accessed in a given mode. This is a wrapper around the access() system call. checkAccess() calls access() with the given parameters. If this is OK, checkAccess() returns true. If not, and W_OK is part of mode, it is checked if there is write access to the directory. If yes, checkAccess() returns true. In all other cases checkAccess() returns false.

Other than access() this function EXPLICITLY ignores non-existant files if checking for write access.

Parameters:
pathname The full path of the file you want to test
mode The access mode, as in the access() system call.
Returns:
Whether the access is allowed, true = Access allowed

Definition at line 2854 of file kapplication.cpp.

KABS ( a   )  [related]

A typesafe function to determine the absolute value of the argument.

Definition at line 187 of file kglobal.h.

KCLAMP ( x,
low,
high   )  [related]

A typesafe function that returns x if it's between low and high values. low if x is smaller than then low and high if x is bigger than high.

Definition at line 193 of file kglobal.h.

KMAX ( a,
b   )  [related]

A typesafe function to find the maximum of the two arguments.

Definition at line 182 of file kglobal.h.

KMIN ( a,
b   )  [related]

A typesafe function to find the minimum of the two arguments.

Definition at line 177 of file kglobal.h.


Member Data Documentation

KInstance * KGlobal::_activeInstance = 0 [static]

Definition at line 170 of file kglobal.h.

KCharsets * KGlobal::_charsets = 0 [static]

Definition at line 158 of file kglobal.h.

KInstance * KGlobal::_instance = 0 [static]

Definition at line 156 of file kglobal.h.

KLocale * KGlobal::_locale = 0 [static]

Definition at line 157 of file kglobal.h.

KStaticDeleterList * KGlobal::_staticDeleters = 0 [static]

Definition at line 159 of file kglobal.h.

KStringDict * KGlobal::_stringDict = 0 [static]

Definition at line 155 of file kglobal.h.


The documentation for this class was generated from the following files:
  • kglobal.h
  • kapplication.h
  • kdebug.h
  • kglobal.cpp

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal