#include <QCoreApplication>
#include <QString>
#include <QList>
#include <QMap>
#include <QStringList>
#include <QDataStream>
#include <QTranslator>
#include <QDir>
#include <klfdefs.h>
Go to the source code of this file.
Classes | |
class | KLFAddOnInfo |
struct | KLFAddOnInfo::PluginSysInfo |
struct | KLFPluginInfo |
struct | KLFTranslationInfo |
Small minimalist structure to store basic information about available translations. More... | |
class | KLFI18nFile |
Small structure to store information for a translation file (.qm) More... | |
Macros | |
#define | KLF_DLL_EXT_LIST (QStringList()<<"*.so") |
#define | KLF_DATA_STREAM_APP_VERSION "3.2" |
Current datastream compatibility klatexformula version. More... | |
#define | KLF_DATA_STREAM_APP_VERSION_MAJ 3 |
'Major' version part of KLF_DATA_STREAM_APP_VERSION. More... | |
#define | KLF_DATA_STREAM_APP_VERSION_MIN 2 |
'Minor' version part of KLF_DATA_STREAM_APP_VERSION. More... | |
Functions | |
KLF_EXPORT QDebug & | operator<< (QDebug &str, const KLFAddOnInfo::PluginSysInfo &i) |
KLF_EXPORT void | klf_add_avail_translation (KLFI18nFile i18nfile) |
KLF_EXPORT void | klf_reload_translations (QCoreApplication *app, const QString ¤tlocale) |
KLF_EXPORT QString | klfFindTranslatedDataFile (const QString &baseFileName, const QString &extension) |
QString | klfDataStreamAppVersion (const QDataStream &d) |
Obtain the KLF version stream operations on d have to be compatible with. More... | |
KLF_EXPORT void | klfDataStreamWriteHeader (QDataStream &stream, const QString headermagic) |
KLF_EXPORT bool | klfDataStreamReadHeader (QDataStream &stream, const QStringList possibleHeaders, QString *readHeader=NULL, QString *readCompatKLFVersion=NULL) |
Variables | |
KLF_EXPORT QList< KLFAddOnInfo > | klf_addons |
KLF_EXPORT bool | klf_addons_canimport |
KLF_EXPORT QList< KLFPluginInfo > | klf_plugins |
KLF_EXPORT QList < KLFTranslationInfo > | klf_avail_translations |
KLF_EXPORT QList< QTranslator * > | klf_translators |
#define KLF_DATA_STREAM_APP_VERSION "3.2" |
Current datastream compatibility klatexformula version.
This value is updated to the new version of KLF whenever a change in the format of the QDataStream's occur.
This is used notably in local styles list and symbols cache.
".klf"
library files Definition at line 280 of file klfmain.h.
Referenced by klfDataStreamWriteHeader(), KLFMainWin::loadStyles(), relcachefile(), and KLFMainWin::saveStyles().
#define KLF_DATA_STREAM_APP_VERSION_MAJ 3 |
'Major' version part of KLF_DATA_STREAM_APP_VERSION.
Definition at line 284 of file klfmain.h.
Referenced by klfDataStreamWriteHeader().
#define KLF_DATA_STREAM_APP_VERSION_MIN 2 |
'Minor' version part of KLF_DATA_STREAM_APP_VERSION.
Definition at line 286 of file klfmain.h.
Referenced by klfDataStreamWriteHeader().
#define KLF_DLL_EXT_LIST (QStringList()<<"*.so") |
Definition at line 48 of file klfmain.h.
Referenced by main_load_plugins().
KLF_EXPORT void klf_add_avail_translation | ( | KLFI18nFile | i18nfile | ) |
Definition at line 324 of file klfmain.cpp.
References QFileInfo::absolutePath(), QFileInfo::canonicalFilePath(), QFileInfo::canonicalPath(), QFileInfo::completeBaseName(), QLocale::country(), QLocale::countryToString(), KLFI18nFile::fpath, KLFTranslationInfo::hasnicetranslatedname, QString::indexOf(), QString::isEmpty(), klf_avail_translations, KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfDbg, QLocale::language(), QLocale::languageToString(), QTranslator::load(), KLFI18nFile::locale, KLFTranslationInfo::localename, QLibraryInfo::location(), KLFI18nFile::name, QFileInfo::suffix(), and KLFTranslationInfo::translatedname.
Referenced by KLFSettings::importAddOn(), and klf_reload_translations().
KLF_EXPORT void klf_reload_translations | ( | QCoreApplication * | app, |
const QString & | currentlocale | ||
) |
Call this at startup or upon language change
Definition at line 396 of file klfmain.cpp.
References QDir::absoluteFilePath(), QFileInfo::absolutePath(), QSet::begin(), QFileInfo::completeBaseName(), QSet::end(), QDir::entryList(), QDir::exists(), QString::fromLatin1(), KLFConfig::globalShareDir, KLFConfig::homeConfigDirI18n, QCoreApplication::installTranslator(), QString::isEmpty(), klf_add_avail_translation(), klf_translators, klfconfig, QTranslator::load(), QLibraryInfo::location(), QCoreApplication::removeTranslator(), QList::size(), QString::split(), QFileInfo::suffix(), and KLFAddOnInfo::translations().
Referenced by main(), and KLFMainWin::setApplicationLocale().
|
inline |
Obtain the KLF version stream operations on d
have to be compatible with.
"2.1"
Definition at line 293 of file klfmain.h.
References QDataStream::device().
KLF_EXPORT bool klfDataStreamReadHeader | ( | QDataStream & | stream, |
const QStringList | possibleHeaders, | ||
QString * | readHeader = NULL , |
||
QString * | readCompatKLFVersion = NULL |
||
) |
Reads a stream in which a header was prepared with klfDataStreamWriteHeader().
Definition at line 546 of file klfmain.cpp.
References QStringList::contains(), QDataStream::device(), KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfDbg, klfVersionMaj(), klfVersionMin(), QDataStream::setVersion(), and QDataStream::status().
Referenced by KLFMainWin::try_load_style_list().
KLF_EXPORT void klfDataStreamWriteHeader | ( | QDataStream & | stream, |
const QString | headermagic | ||
) |
This function sets up the stream for writing data (for internal storage, eg. styles list)
This function will set the klfDataStreamAppVersion
property on the QIODevice associated with the given stream
, in order that objects that are sent into the stream can know their compatibility version by querying the stream with klfDataStreamAppVersion().
Definition at line 529 of file klfmain.cpp.
References QDataStream::device(), KLF_DATA_STREAM_APP_VERSION, KLF_DATA_STREAM_APP_VERSION_MAJ, KLF_DATA_STREAM_APP_VERSION_MIN, and QDataStream::setVersion().
Referenced by KLFMainWin::saveStyles().
KLF_EXPORT QString klfFindTranslatedDataFile | ( | const QString & | baseFileName, |
const QString & | extension | ||
) |
Definition at line 504 of file klfmain.cpp.
References QFile::exists(), KLF_FUNC_NAME, klfconfig, klfDbg, KLFConfig::locale, QString::section(), and KLFConfig::UI.
Referenced by KLFHelpDialogCommon::getFullHtml(), and main().
KLF_EXPORT QDebug& operator<< | ( | QDebug & | str, |
const KLFAddOnInfo::PluginSysInfo & | i | ||
) |
Definition at line 143 of file klfmain.cpp.
References KLFAddOnInfo::PluginSysInfo::arch, KLFAddOnInfo::PluginSysInfo::klfminversion, KLFAddOnInfo::PluginSysInfo::os, and KLFAddOnInfo::PluginSysInfo::qtminversion.
KLF_EXPORT QList<KLFAddOnInfo> klf_addons |
Definition at line 54 of file klfmain.cpp.
Referenced by KLFSettings::importAddOn(), main_load_extra_resources(), main_load_plugins(), KLFSettings::refreshAddOnList(), KLFSettings::refreshAddOnSelected(), and KLFSettings::removeAddOn().
KLF_EXPORT bool klf_addons_canimport |
Definition at line 55 of file klfmain.cpp.
Referenced by KLFSettings::KLFSettings(), and main_load_extra_resources().
KLF_EXPORT QList<KLFTranslationInfo> klf_avail_translations |
a list of locale names available for KLatexFormula
Definition at line 42 of file klfmain.cpp.
Referenced by KLFSettings::importAddOn(), klf_add_avail_translation(), and KLFSettings::populateLocaleCombo().
KLF_EXPORT QList<KLFPluginInfo> klf_plugins |
Definition at line 50 of file klfmain.cpp.
Referenced by KLFSettings::apply(), KLFSettings::initPluginControls(), main_load_plugins(), KLFSettings::refreshPluginSelected(), KLFSettings::removePlugin(), KLFSettings::resetPluginControls(), and KLFConfig::writeToConfig().
KLF_EXPORT QList<QTranslator*> klf_translators |
A list of instances of currently installed translators.
Definition at line 44 of file klfmain.cpp.
Referenced by klf_reload_translations().