diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-07-05 09:52:11 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-07-07 14:46:18 (GMT) |
commit | 4337d695410301b97b753231c3b8fc9560a9d4c7 (patch) | |
tree | 3280574ee2de859f44b78e79a1e63a6c355b3387 /tests/auto/linguist | |
parent | 495dfda1bea31017d08a435dcb61b43b4df81d24 (diff) | |
download | Qt-4337d695410301b97b753231c3b8fc9560a9d4c7.zip Qt-4337d695410301b97b753231c3b8fc9560a9d4c7.tar.gz Qt-4337d695410301b97b753231c3b8fc9560a9d4c7.tar.bz2 |
immediately set function context when entering a namespace
otherwise, tr() calls without absolute qualification will not be
properly qualified inside the first function if it has no qualification,
either.
Task-number: QTBUG-11742 (not really)
Diffstat (limited to 'tests/auto/linguist')
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp | 27 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result | 13 |
2 files changed, 40 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp index 0765bfc..f58f932 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp @@ -275,3 +275,30 @@ void bogosity() // no spaces here. test collateral damage from ignoring equal sign Class::member=QObject::tr("just QObject"); } + + + +namespace Internal { + +class Message : public QObject +{ + Q_OBJECT +public: + Message(QObject *parent = 0); +}; + +} // The temporary closing of the namespace triggers the problem + +namespace Internal { + +static inline QString message1() +{ + return Message::tr("message1"); // Had no namespace +} + +static inline QString message2() +{ + return Message::tr("message2"); // Already had namespace +} + +} diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result index 208191d..7ac318e 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result @@ -120,6 +120,19 @@ backslashed \ stuff.</source> </message> </context> <context> + <name>Internal::Message</name> + <message> + <location filename="main.cpp" line="296"/> + <source>message1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="301"/> + <source>message2</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>Kåntekst</name> <message utf8="true"> <location filename="finddialog.cpp" line="180"/> |