summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-11-15 17:43:14 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-07 19:48:33 +0100
commite1715da844a246f7326b7b8db72c94edb21d6fae (patch)
tree29c075323fe0a260c57df45ddae022ac4cc7497d
parent9fe40675dd80bdacb31ff4de44c57bb3cf4db1f0 (diff)
downloadqttools-e1715da844a246f7326b7b8db72c94edb21d6fae.tar.gz
qttools-e1715da844a246f7326b7b8db72c94edb21d6fae.tar.bz2
qttools-e1715da844a246f7326b7b8db72c94edb21d6fae.zip
remove dead code
there is no use for a "default context" any more. amends 17af244af. Change-Id: I85122e4813668cffe9fa65baf2688c53e7b79989 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r--src/linguist/lupdate/cpp.cpp18
-rw-r--r--src/linguist/lupdate/java.cpp4
2 files changed, 9 insertions, 13 deletions
diff --git a/src/linguist/lupdate/cpp.cpp b/src/linguist/lupdate/cpp.cpp
index 0d35345c..787d1b43 100644
--- a/src/linguist/lupdate/cpp.cpp
+++ b/src/linguist/lupdate/cpp.cpp
@@ -207,7 +207,7 @@ public:
void setInput(const QString &in);
void setInput(QTextStream &ts, const QString &fileName);
void setTranslator(Translator *_tor) { tor = _tor; }
- void parse(const QString &initialContext, ConversionData &cd, const QStringList &includeStack, QSet<QString> &inclusions);
+ void parse(ConversionData &cd, const QStringList &includeStack, QSet<QString> &inclusions);
void parseInternal(ConversionData &cd, const QStringList &includeStack, QSet<QString> &inclusions);
const ParseResults *recordResults(bool isHeader);
void deleteResults() { delete results; }
@@ -1404,7 +1404,7 @@ void CppParser::processInclude(const QString &file, ConversionData &cd, const QS
parser.setInput(ts, cleanFile);
QStringList stack = includeStack;
stack << cleanFile;
- parser.parse(cd.m_defaultContext, cd, stack, inclusions);
+ parser.parse(cd, stack, inclusions);
results->includes.insert(parser.recordResults(true));
} else {
CppParser parser(results);
@@ -1588,12 +1588,12 @@ void CppParser::recordMessage(int line, const QString &context, const QString &t
tor->append(msg);
}
-void CppParser::parse(const QString &initialContext, ConversionData &cd, const QStringList &includeStack,
+void CppParser::parse(ConversionData &cd, const QStringList &includeStack,
QSet<QString> &inclusions)
{
namespaces << HashString();
functionContext = namespaces;
- functionContextUnresolved = initialContext;
+ functionContextUnresolved.clear();
parseInternal(cd, includeStack, inclusions);
}
@@ -2047,13 +2047,11 @@ void CppParser::parseInternal(ConversionData &cd, const QStringList &includeStac
truncateNamespaces(&namespaces, namespaceDepths.pop());
if (yyBraceDepth == namespaceDepths.count()) {
// function, class or namespace
- if (!yyBraceDepth && !directInclude) {
+ if (!yyBraceDepth && !directInclude)
truncateNamespaces(&functionContext, 1);
- functionContextUnresolved = cd.m_defaultContext;
- } else {
+ else
functionContext = namespaces;
- functionContextUnresolved.clear();
- }
+ functionContextUnresolved.clear();
pendingContext.clear();
}
// fallthrough
@@ -2275,7 +2273,7 @@ void loadCPP(Translator &translator, const QStringList &filenames, ConversionDat
Translator *tor = new Translator;
parser.setTranslator(tor);
QSet<QString> inclusions;
- parser.parse(cd.m_defaultContext, cd, QStringList(), inclusions);
+ parser.parse(cd, QStringList(), inclusions);
parser.recordResults(isHeader(filename));
}
diff --git a/src/linguist/lupdate/java.cpp b/src/linguist/lupdate/java.cpp
index f64de80e..aad608e8 100644
--- a/src/linguist/lupdate/java.cpp
+++ b/src/linguist/lupdate/java.cpp
@@ -112,7 +112,6 @@ static int yyInPos;
// The parser maintains the following global variables.
static QString yyPackage;
static QStack<Scope*> yyScope;
-static QString yyDefaultContext;
std::ostream &yyMsg(int line = 0)
{
@@ -446,7 +445,7 @@ static const QString context()
innerClass = true;
}
}
- return context.isEmpty() ? yyDefaultContext : context;
+ return context;
}
static void recordMessage(
@@ -606,7 +605,6 @@ bool loadJava(Translator &translator, const QString &filename, ConversionData &c
return false;
}
- yyDefaultContext = cd.m_defaultContext;
yyInPos = -1;
yyFileName = filename;
yyPackage.clear();