summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-02-29 00:57:12 +0100
committerJoão Abecasis <joao.abecasis@nokia.com>2012-02-29 00:58:13 +0100
commitc4ad58ed2252d5ed9f448a5c068ab33dce4cadd9 (patch)
tree7e9802171d7b4c641c2de1ef781023cab5d7d14c /src/tools
parent7da3a61b5fd5cc726f8fd62691aa5f84c7929800 (diff)
parentfa1b9070af66edb81b2a3735c1951f78b22bd666 (diff)
Merge remote-tracking branch 'gerrit/master' into containers
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/moc/generator.cpp78
-rw-r--r--src/tools/moc/util/generate_keywords.pro8
-rw-r--r--src/tools/rcc/rcc.cpp2
-rw-r--r--src/tools/tools.pro4
-rw-r--r--src/tools/uic/driver.cpp3
-rw-r--r--src/tools/uic/qclass_lib_map.h4
-rw-r--r--src/tools/uic/uic.cpp1
7 files changed, 52 insertions, 48 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 3362a1abc1..ac602fd6e8 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -951,13 +951,17 @@ void Generator::generateStaticMetacall()
}
fprintf(out, " default: ;\n");
fprintf(out, " }\n");
-
- fprintf(out, " } else if (_c == QMetaObject::IndexOfMethod) {\n");
+ fprintf(out, " }");
+ needElse = true;
+ }
+ if (!cdef->signalList.isEmpty()) {
+ Q_ASSERT(needElse); // if there is signal, there was method.
+ fprintf(out, " else if (_c == QMetaObject::IndexOfMethod) {\n");
fprintf(out, " int *result = reinterpret_cast<int *>(_a[0]);\n");
fprintf(out, " void **func = reinterpret_cast<void **>(_a[1]);\n");
bool anythingUsed = false;
- for (int methodindex = 0; methodindex < methodList.size(); ++methodindex) {
- const FunctionDef &f = methodList.at(methodindex);
+ for (int methodindex = 0; methodindex < cdef->signalList.size(); ++methodindex) {
+ const FunctionDef &f = cdef->signalList.at(methodindex);
if (f.wasCloned || !f.inPrivateClass.isEmpty() || f.isStatic)
continue;
anythingUsed = true;
@@ -1057,41 +1061,55 @@ void Generator::generateSignal(FunctionDef *def,int index)
fprintf(out, "}\n");
}
-void Generator::generatePluginMetaData()
+static void writePluginMetaData(FILE *out, const QJsonObject &data)
{
- if (cdef->pluginData.iid.isEmpty())
- return;
+ const QJsonDocument doc(data);
- QJsonObject data;
- data.insert(QLatin1String("IID"), QLatin1String(cdef->pluginData.iid.constData()));
- data.insert(QLatin1String("className"), QLatin1String(cdef->classname.constData()));
- data.insert(QLatin1String("version"), (int)QT_VERSION);
- data.insert(QLatin1String("debug"),
-#ifdef QT_NO_DEBUG
- false
-#else
- true
-#endif
- );
- data.insert(QLatin1String("MetaData"), cdef->pluginData.metaData.object());
- QJsonDocument doc(data);
-
- fprintf(out, "\nQT_PLUGIN_METADATA_SECTION const uint qt_section_alignment_dummy = 42;\n");
- fprintf(out,
- "\nQT_PLUGIN_METADATA_SECTION\n"
- "static const unsigned char qt_pluginMetaData[] = {\n"
- " 'Q', 'T', 'M', 'E', 'T', 'A', 'D', 'A', 'T', 'A', ' ', ' ',\n ");
+ fputs("\nQT_PLUGIN_METADATA_SECTION\n"
+ "static const unsigned char qt_pluginMetaData[] = {\n"
+ " 'Q', 'T', 'M', 'E', 'T', 'A', 'D', 'A', 'T', 'A', ' ', ' ',\n ", out);
#if 0
fprintf(out, "\"%s\";\n", doc.toJson().constData());
#else
- QByteArray binary = doc.toBinaryData();
- for (int i = 0; i < binary.size() - 1; ++i) {
+ const QByteArray binary = doc.toBinaryData();
+ const int last = binary.size() - 1;
+ for (int i = 0; i < last; ++i) {
fprintf(out, " 0x%02x,", (uchar)binary.at(i));
if (!((i + 1) % 8))
- fprintf(out, "\n ");
+ fputs("\n ", out);
}
- fprintf(out, " 0x%02x\n};\n", (uchar)binary.at(binary.size() - 1));
+ fprintf(out, " 0x%02x\n};\n", (uchar)binary.at(last));
#endif
+}
+
+void Generator::generatePluginMetaData()
+{
+ if (cdef->pluginData.iid.isEmpty())
+ return;
+
+ // Write plugin meta data #ifdefed QT_NO_DEBUG with debug=false,
+ // true, respectively.
+
+ QJsonObject data;
+ const QString debugKey = QStringLiteral("debug");
+ data.insert(QStringLiteral("IID"), QLatin1String(cdef->pluginData.iid.constData()));
+ data.insert(QStringLiteral("className"), QLatin1String(cdef->classname.constData()));
+ data.insert(QStringLiteral("version"), (int)QT_VERSION);
+ data.insert(debugKey, QJsonValue(false));
+ data.insert(QStringLiteral("MetaData"), cdef->pluginData.metaData.object());
+
+ fputs("\nQT_PLUGIN_METADATA_SECTION const uint qt_section_alignment_dummy = 42;\n\n"
+ "#ifdef QT_NO_DEBUG\n", out);
+ writePluginMetaData(out, data);
+
+ fputs("\n#else // QT_NO_DEBUG\n", out);
+
+ data.remove(debugKey);
+ data.insert(debugKey, QJsonValue(true));
+ writePluginMetaData(out, data);
+
+ fputs("#endif // QT_NO_DEBUG\n\n", out);
+
// 'Use' all namespaces.
int pos = cdef->qualified.indexOf("::");
for ( ; pos != -1 ; pos = cdef->qualified.indexOf("::", pos + 2) )
diff --git a/src/tools/moc/util/generate_keywords.pro b/src/tools/moc/util/generate_keywords.pro
index eb04409922..88e5553f54 100644
--- a/src/tools/moc/util/generate_keywords.pro
+++ b/src/tools/moc/util/generate_keywords.pro
@@ -1,12 +1,4 @@
-######################################################################
-# Automatically generated by qmake (1.08a) Mon Feb 23 13:08:28 2004
-######################################################################
-
-TEMPLATE = app
CONFIG -= moc
mac:CONFIG -= app_bundle
-INCLUDEPATH += .
-# Input
SOURCES += generate_keywords.cpp
-CONFIG += qt create_prl link_prl
diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
index 5fbda35fc6..b31c47e7ad 100644
--- a/src/tools/rcc/rcc.cpp
+++ b/src/tools/rcc/rcc.cpp
@@ -687,7 +687,7 @@ bool RCCResourceLibrary::output(QIODevice &outDevice, QIODevice &errorDevice)
void RCCResourceLibrary::writeHex(quint8 tmp)
{
- const char * const digits = "0123456789abcdef";
+ const char digits[] = "0123456789abcdef";
writeChar('0');
writeChar('x');
if (tmp < 16) {
diff --git a/src/tools/tools.pro b/src/tools/tools.pro
index e6b9eefc69..cf10163539 100644
--- a/src/tools/tools.pro
+++ b/src/tools/tools.pro
@@ -32,8 +32,8 @@ for(subname, TOOLS_SUBDIRS) {
subdir = $$replace(subdir, $$reg_src, $$QT_BUILD_TREE)
subdir = $$replace(subdir, /, $$QMAKE_DIR_SEP)
subdir = $$replace(subdir, \\\\, $$QMAKE_DIR_SEP)
- SUB_TEMPLATE = $$list($$fromfile($$subpro, TEMPLATE))
- !isEqual(subname, src_tools_bootstrap):if(isEqual($$SUB_TEMPLATE, lib) | isEqual($$SUB_TEMPLATE, subdirs)):!separate_debug_info {
+ SUB_TEMPLATE = $$fromfile($$subpro, TEMPLATE)
+ !isEqual(subname, src_tools_bootstrap):if(isEqual(SUB_TEMPLATE, lib) | isEqual(SUB_TEMPLATE, subdirs)):!separate_debug_info {
#debug
debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS
debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug)
diff --git a/src/tools/uic/driver.cpp b/src/tools/uic/driver.cpp
index 5a9a862f14..ea1d4f21f3 100644
--- a/src/tools/uic/driver.cpp
+++ b/src/tools/uic/driver.cpp
@@ -43,7 +43,6 @@
#include "uic.h"
#include "ui4.h"
-#include <QtCore/QRegExp>
#include <QtCore/QFileInfo>
#include <QtCore/QDebug>
@@ -208,7 +207,7 @@ QString Driver::qtify(const QString &name)
return qname;
}
-static bool isAnsiCCharacter(const QChar& c)
+static bool isAnsiCCharacter(QChar c)
{
return (c.toUpper() >= QLatin1Char('A') && c.toUpper() <= QLatin1Char('Z'))
|| c.isDigit() || c == QLatin1Char('_');
diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h
index 11be47ce64..fb181e27f7 100644
--- a/src/tools/uic/qclass_lib_map.h
+++ b/src/tools/uic/qclass_lib_map.h
@@ -53,9 +53,6 @@ QT_CLASS_LIB(Qt, QtCore, qnamespace.h)
QT_CLASS_LIB(QInternal, QtCore, qnamespace.h)
QT_CLASS_LIB(QCOORD, QtCore, qnamespace.h)
QT_CLASS_LIB(QtConfig, QtCore, qconfig.h)
-QT_CLASS_LIB(QAbstractFileEngine, QtCore, qabstractfileengine.h)
-QT_CLASS_LIB(QAbstractFileEngineHandler, QtCore, qabstractfileengine.h)
-QT_CLASS_LIB(QAbstractFileEngineIterator, QtCore, qabstractfileengine.h)
QT_CLASS_LIB(QBuffer, QtCore, qbuffer.h)
QT_CLASS_LIB(QDataStream, QtCore, qdatastream.h)
QT_CLASS_LIB(QtDebug, QtCore, qdebug.h)
@@ -68,7 +65,6 @@ QT_CLASS_LIB(QFileInfo, QtCore, qfileinfo.h)
QT_CLASS_LIB(QFileInfoList, QtCore, qfileinfo.h)
QT_CLASS_LIB(QFileInfoListIterator, QtCore, qfileinfo.h)
QT_CLASS_LIB(QFileSystemWatcher, QtCore, qfilesystemwatcher.h)
-QT_CLASS_LIB(QFSFileEngine, QtCore, qfsfileengine.h)
QT_CLASS_LIB(QIODevice, QtCore, qiodevice.h)
QT_CLASS_LIB(Q_PID, QtCore, qprocess.h)
QT_CLASS_LIB(QProcessEnvironment, QtCore, qprocess.h)
diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp
index 2de3352cfc..4ae04149e8 100644
--- a/src/tools/uic/uic.cpp
+++ b/src/tools/uic/uic.cpp
@@ -58,7 +58,6 @@
#include <QtCore/QXmlStreamReader>
#include <QtCore/QFileInfo>
-#include <QtCore/QRegExp>
#include <QtCore/QTextStream>
#include <QtCore/QDateTime>