KDECore
kglobal.cpp
Go to the documentation of this file.
65 // ~KConfig needs qrand(). qrand() depends on a Q_GLOBAL_STATIC. With this Q_CONSTRUCTOR_FUNCTION we
172 if (d->locale == 0 || (d->localeIsFromFakeComponent && d->mainComponent.isValid() && d->mainComponent.config())) {
180 // And now it will stop at the first i18n call or more generally at the first construction of the KLocale object,
182 if (d->locale != 0) qWarning("KGlobal::locale(): Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work");
192 qFatal("KGlobal::locale() must be called from the main thread before using i18n() in threads. KApplication takes care of this. If not using KApplication, call KGlobal::locale() during initialization.");
225 // Don't use PRIVATE_DATA here. This is called by ~KGlobalPrivate -> ~KConfig -> sync -> KSaveFile, so there's no KGlobalPrivate anymore.
#define PRIVATE_DATA
static KCmdLineArgs * parsedArgs(const QByteArray &id=QByteArray())
Access parsed arguments.
Definition: kcmdlineargs.cpp:611
#define K_GLOBAL_STATIC(TYPE, NAME)
This macro makes it easy to use non-POD types as global statics.
Definition: kglobal.h:221
Definition: kglobal.h:525
const KAboutData * aboutData() const
Returns the about data of this component.
Definition: kcomponentdata.cpp:215
Definition: kglobal_p.h:40
K_GLOBAL_STATIC_WITH_ARGS(KComponentData, fakeComponent,(KGlobalPrivate::initFakeComponent())) KStandardDirs *KGlobal
Definition: kglobal.cpp:128
void ref()
Tells KGlobal about one more operations that should be finished before the application exits...
Definition: kglobal.cpp:320
bool isSet(const QByteArray &option) const
Read out a boolean option or check for the presence of string option.
Definition: kcmdlineargs.cpp:1496
void setActiveCatalog(const QString &catalog)
Sets the active catalog for translation lookup.
Definition: klocale.cpp:146
QString catalogName() const
Returns the name of the translation catalog.
Definition: kcomponentdata.cpp:232
void deref()
Tells KGlobal that one operation such as those described in ref() just finished.
Definition: kglobal.cpp:326
void setLocale(KLocale *, CopyCatalogs copy=DoCopyCatalogs)
Definition: kglobal.cpp:255
void setAllowQuit(bool allowQuit)
If refcounting reaches 0 (or less), and allowQuit is true, the instance of the application will autom...
Definition: kglobal.cpp:335
KComponentData activeComponent()
The component currently active (useful in a multi-component application, such as a KParts application...
Definition: kglobal.cpp:229
void insertCatalog(const QString &catalog)
Adds another catalog to search for translation lookup.
Definition: klocale.cpp:136
void insertCatalog(const QString &catalog)
Inserts the catalog in the main locale object if it exists.
Definition: kglobal.cpp:159
Definition: k3resolver.h:41
void setActiveComponent(const KComponentData &d)
Set the active component for use by KAboutDialog and KBugReport.
Definition: kglobal.cpp:236
KLocale provides support for country specific stuff like the national language.
Definition: klocale.h:69
static int s_refCount
This counter indicates when to quit the application.
Definition: kglobal.cpp:317
QObject * findDirectChild_helper(const QObject *parent, const QMetaObject &mo)
Definition: kglobal.cpp:342
const KComponentData & mainComponent()
Returns the global component data.
Definition: kglobal.cpp:144
QString getOption(const QByteArray &option) const
Read out a string option.
Definition: kcmdlineargs.cpp:1438
void copyCatalogsTo(KLocale *locale)
Copies the catalogs of this object to an other KLocale object.
Definition: klocale.cpp:739
void translateInternalProgramName() const
Definition: kaboutdata.cpp:709
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.