made QLibraryInfo available with QT_NO_SETTINGS.
QKdeTheme is removed when QT_NO_SETTINGS is defined.
Change-Id: I63d619bb305e6c23985d9ea50c72d39a697b7a4b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
#define QT_NO_ICONV
#endif
-// QLibrary
-#if !defined(QT_NO_LIBRARY) && (defined(QT_NO_SETTINGS))
-#define QT_NO_LIBRARY
-#endif
-
// QMenu
#if !defined(QT_NO_MENU) && (defined(QT_NO_ACTION))
#define QT_NO_MENU
Feature: LIBRARY
Description: Supports a shared library wrapper.
Section: File I/O
-Requires: SETTINGS
+Requires:
Name: QLibrary
SeeAlso: ???
return 0; //no luck
}
+#endif // QT_NO_SETTINGS
+
/*!
\class QLibraryInfo
\brief The QLibraryInfo class provides information about the Qt library.
if (!QLibraryInfoPrivate::haveGroup(group)
&& (group == FinalPaths
|| !(group = FinalPaths, QLibraryInfoPrivate::haveGroup(FinalPaths))))
-#else
+#elif !defined(QT_NO_SETTINGS)
if (!QLibraryInfoPrivate::configuration())
#endif
{
if (path)
ret = QString::fromLocal8Bit(path);
+#ifndef QT_NO_SETTINGS
} else {
QString key;
QString defaultValue;
ret = QDir::fromNativeSeparators(ret);
}
+#endif // QT_NO_SETTINGS
}
if (!ret.isEmpty() && QDir::isRelativePath(ret)) {
\sa location()
*/
-#endif // QT_NO_SETTINGS
-
QT_END_NAMESPACE
#if defined(Q_CC_GNU) && defined(ELF_INTERPRETER)
QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_SETTINGS
-
class Q_CORE_EXPORT QLibraryInfo
{
public:
QLibraryInfo();
};
-#endif /* QT_NO_SETTINGS */
-
QT_END_NAMESPACE
QT_END_HEADER
void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths()
{
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
QStringList *app_libpaths = coreappdata()->app_libpaths;
Q_ASSERT(app_libpaths);
QString app_location( QCoreApplication::applicationFilePath() );
d->threadData->eventDispatcher = QCoreApplicationPrivate::eventDispatcher;
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
if (!coreappdata()->app_libpaths) {
// make sure that library paths is initialized
libraryPaths();
if (fileName.isEmpty())
return;
if (!d) {
-#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
QFileInfo info(fileName);
QString suffix = info.suffix();
if (!suffix.isEmpty()) {
QIconEngine *engine = new QIconLoaderEngine();
icon.d->engine = engine;
engine->read(s);
-#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
} else {
const int index = loader()->indexOf(key);
if (index != -1) {
QT_BEGIN_NAMESPACE
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QPlatformIntegrationFactoryInterface_iid, QLatin1String("/platforms"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
QStringList paramList = key.split(QLatin1Char(':'));
const QString platform = paramList.takeFirst().toLower();
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
// Try loading the plugin from platformPluginPath first:
if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath);
QStringList QPlatformIntegrationFactory::keys(const QString &platformPluginPath)
{
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
QStringList list;
if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath);
QT_BEGIN_NAMESPACE
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QPlatformThemeFactoryInterface_iid, QLatin1String("/platformthemes"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
QStringList paramList = key.split(QLatin1Char(':'));
const QString platform = paramList.takeFirst().toLower();
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
// Try loading the plugin from platformPluginPath first:
if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath);
*/
QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath)
{
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
QStringList list;
if (!platformPluginPath.isEmpty()) {
freetype = QFreetypeFace::getFace(face_id);
if (!freetype) {
QString newPath =
-#ifndef QT_NO_SETTINGS
QLibraryInfo::location(QLibraryInfo::LibrariesPath) +
-#endif
QLatin1String("/fonts/") +
QFileInfo(QFile::decodeName(face_id.filename)).fileName();
face_id.filename = QFile::encodeName(newPath);
{
QString fontpath = QString::fromLocal8Bit(qgetenv("QT_QPA_FONTDIR"));
if (fontpath.isEmpty()) {
-#ifndef QT_NO_SETTINGS
fontpath = QLibraryInfo::location(QLibraryInfo::LibrariesPath);
fontpath += QLatin1String("/fonts");
-#endif
}
return fontpath;
return QPlatformTheme::themeHint(hint);
}
+#ifndef QT_NO_SETTINGS
+
// Reads the color from the KDE configuration, and store it in the
// palette with the given color role if found.
static inline bool kdeColor(QPalette *pal, QPalette::ColorRole role,
return 0;
}
+#endif // QT_NO_SETTINGS
+
/*!
\class QGnomeTheme
\brief QGnomeTheme is a theme implementation for the Gnome desktop.
{
if (name == QLatin1String(QGenericUnixTheme::name))
return new QGenericUnixTheme;
+#ifndef QT_NO_SETTINGS
if (name == QLatin1String(QKdeTheme::name))
if (QPlatformTheme *kdeTheme = QKdeTheme::createKdeTheme())
return kdeTheme;
+#endif
if (name == QLatin1String(QGnomeTheme::name))
return new QGnomeTheme;
return new QGenericUnixTheme;
QStringList result;
if (QGuiApplication::desktopSettingsAware()) {
if (QGuiApplicationPrivate::platformIntegration()->services()->desktopEnvironment() == QByteArray("KDE")) {
+#ifndef QT_NO_SETTINGS
result.push_back(QLatin1String(QKdeTheme::name));
+#endif
} else if (QGuiApplicationPrivate::platformIntegration()->services()->desktopEnvironment() == QByteArray("GNOME")) {
result.push_back(QLatin1String(QGnomeTheme::name));
}
static const char *name;
};
+#ifndef QT_NO_SETTINGS
class QKdeTheme : public QPlatformTheme
{
QKdeTheme(const QString &kdeHome, int kdeVersion);
int m_toolButtonStyle;
int m_toolBarIconSize;
};
+#endif // QT_NO_SETTINGS
class QGnomeTheme : public QPlatformTheme
{
QT_BEGIN_NAMESPACE
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QPlatformPrinterSupportFactoryInterface_iid, QLatin1String("/printsupport"), Qt::CaseInsensitive))
#endif
} else
#endif
{ } // Keep these here - they make the #ifdefery above work
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
if (!ret)
ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style);
#endif
QStringList QStyleFactory::keys()
{
QStringList list;
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_LIBRARY
typedef QMultiMap<int, QString> PluginKeyMap;
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;