KDECore
kglobal.cpp
Go to the documentation of this file.
66 // ~KConfig needs qrand(). qrand() depends on a Q_GLOBAL_STATIC. With this Q_CONSTRUCTOR_FUNCTION we
173 if (d->locale == 0 || (d->localeIsFromFakeComponent && d->mainComponent.isValid() && d->mainComponent.config())) {
181 // And now it will stop at the first i18n call or more generally at the first construction of the KLocale object,
183 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");
193 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.");
226 // 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
const QObjectList & children() const
Definition: kglobal.h:525
const KAboutData * aboutData() const
Returns the about data of this component.
Definition: kcomponentdata.cpp:215
const_iterator insert(const T &value)
QThread * thread() const
Definition: kglobal_p.h:40
K_GLOBAL_STATIC_WITH_ARGS(KComponentData, fakeComponent,(KGlobalPrivate::initFakeComponent())) KStandardDirs *KGlobal
Definition: kglobal.cpp:129
void ref()
Tells KGlobal about one more operations that should be finished before the application exits...
Definition: kglobal.cpp:321
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:256
bool isEmpty() const
void setAllowQuit(bool allowQuit)
If refcounting reaches 0 (or less), and allowQuit is true, the instance of the application will autom...
Definition: kglobal.cpp:334
KComponentData activeComponent()
The component currently active (useful in a multi-component application, such as a KParts application...
Definition: kglobal.cpp:230
QCoreApplication * instance()
Definition: k3resolver.h:41
void quit()
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:160
static QBasicAtomicInt s_allowQuit
This counter indicates when to quit the application.
Definition: kglobal.cpp:318
void setActiveComponent(const KComponentData &d)
Set the active component for use by KAboutDialog and KBugReport.
Definition: kglobal.cpp:237
void installTranslator(QTranslator *translationFile)
QByteArray toLatin1() const
KLocale provides support for country specific stuff like the national language.
Definition: klocale.h:69
QObject * findDirectChild_helper(const QObject *parent, const QMetaObject &mo)
Definition: kglobal.cpp:346
void setCodecForLocale(QTextCodec *c)
QThread * currentThread()
const KComponentData & mainComponent()
Returns the global component data.
Definition: kglobal.cpp:145
QString fromLatin1(const char *str, int size)
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
QString applicationName()
void translateInternalProgramName() const
Definition: kaboutdata.cpp:709
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.