From ac3f25c3b75cbca0ac512e0993bc3b7e1ac34e5e Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 18 Jun 2016 21:19:06 +0000 Subject: [PATCH] cleanup UI compiler includes writer Signed-off-by: Ivailo Monev --- src/tools/uic/cpp/cppwriteincludes.cpp | 18 +++--------------- src/tools/uic/cpp/cppwriteincludes.h | 1 - 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/tools/uic/cpp/cppwriteincludes.cpp b/src/tools/uic/cpp/cppwriteincludes.cpp index f174917b1..94c68328d 100644 --- a/src/tools/uic/cpp/cppwriteincludes.cpp +++ b/src/tools/uic/cpp/cppwriteincludes.cpp @@ -70,15 +70,6 @@ static const ClassInfoEntry qclass_lib_map[] = { #undef QT_CLASS_LIB }; -// Format a module header as 'QtCore/QObject' -static inline QString moduleHeader(const QString &module, const QString &header) -{ - QString rc = module; - rc += QLatin1Char('/'); - rc += header; - return rc; -} - namespace CPP { WriteIncludes::WriteIncludes(Uic *uic) @@ -89,11 +80,10 @@ WriteIncludes::WriteIncludes(Uic *uic) const ClassInfoEntry *classLibEnd = qclass_lib_map + sizeof(qclass_lib_map)/sizeof(ClassInfoEntry); for(const ClassInfoEntry *it = qclass_lib_map; it < classLibEnd; ++it) { const QString klass = QLatin1String(it->klass); - const QString module = QLatin1String(it->module); const QLatin1String header = QLatin1String(it->header); - const QString newHeader = moduleHeader(module, klass); + // Format a module header as 'QtCore/QObject' + const QString newHeader = QLatin1String(it->module) + QLatin1Char('/') + header; m_classToHeader.insert(klass, newHeader); - m_oldHeaderToNewHeader.insert(header, newHeader); } } @@ -298,9 +288,7 @@ void WriteIncludes::writeHeaders(const OrderedSet &headers, bool global) // Check for the old headers 'qslider.h' and replace by 'QtGui/QSlider' const OrderedSet::const_iterator cend = headers.constEnd(); for (OrderedSet::const_iterator sit = headers.constBegin(); sit != cend; ++sit) { - const StringMap::const_iterator hit = m_oldHeaderToNewHeader.constFind(sit.key()); - const bool mapped = hit != m_oldHeaderToNewHeader.constEnd(); - const QString header = mapped ? hit.value() : sit.key(); + const QString header = sit.key(); if (!header.trimmed().isEmpty()) { m_output << "#include " << openingQuote << header << closingQuote << QLatin1Char('\n'); } diff --git a/src/tools/uic/cpp/cppwriteincludes.h b/src/tools/uic/cpp/cppwriteincludes.h index 9ae508ffb..41ff4a530 100644 --- a/src/tools/uic/cpp/cppwriteincludes.h +++ b/src/tools/uic/cpp/cppwriteincludes.h @@ -104,7 +104,6 @@ private: typedef QMap StringMap; StringMap m_classToHeader; - StringMap m_oldHeaderToNewHeader; bool m_scriptsActivated; bool m_laidOut;