summaryrefslogtreecommitdiffstats
path: root/tests/auto/linguist
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-09-22 18:27:26 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-09-23 13:45:04 (GMT)
commit178945342d0d46ddde460f230c22d2acb9f930a8 (patch)
treeb1d0dacb0caafc5d4e89a40b5525737c5695117b /tests/auto/linguist
parent158a48e06134845a72dcab14452390641747d211 (diff)
downloadQt-178945342d0d46ddde460f230c22d2acb9f930a8.zip
Qt-178945342d0d46ddde460f230c22d2acb9f930a8.tar.gz
Qt-178945342d0d46ddde460f230c22d2acb9f930a8.tar.bz2
actually use the argument of Q_DECLARE_TR_FUNCTIONS
which means that one can set an arbitrary context. as a side effect, this caches the stringified context of Q_OBJECT-derived classes.
Diffstat (limited to 'tests/auto/linguist')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecontexts/main.cpp9
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.ts.result9
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecontexts/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecontexts/main.cpp
index 7e81b84..25c2c0d 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecontexts/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecontexts/main.cpp
@@ -262,6 +262,15 @@ QString C2::foo()
}
+namespace Fooish {
+ Q_DECLARE_TR_FUNCTIONS(Bears::And::Spiders)
+}
+
+void Fooish::bar()
+{
+ return tr("whatever the context", "Bears::And::Spiders");
+}
+
int main(int /*argc*/, char ** /*argv*/) {
return 0;
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.ts.result
index 9b00d53..2f21de2 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.ts.result
@@ -102,6 +102,15 @@
</message>
</context>
<context>
+ <name>Bears::And::Spiders</name>
+ <message>
+ <location filename="main.cpp" line="271"/>
+ <source>whatever the context</source>
+ <comment>Bears::And::Spiders</comment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>C1</name>
<message>
<location filename="main.cpp" line="230"/>