Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-21876

lupdate confused by comment following namespace name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.0
    • 4.7.4
    • Tools: Linguist
    • None
    • Windows, Visual Studio 2010, Qt 4.7.4
    • 9577e0134f6999f7e4f569344982f071e9cc37ff

    Description

      lupdate seems to parse namespace names a bit too greedily.
      Example 1:

      namespace foo // bla bla
      {
        class bar : public QObject
        {
        Q_OBJECT
          void baz();
        };
      }
      
      void foo::bar::baz() { tr("bla bla"); }
      

      lupdate says "Qualifying with unknown namespace/class: ::foo", but the ts file seems to be fine.
      Removing the comment gets rid of the warning.

      Example 2:

      namespace foo // bla bla
      {
        class bar : public QObject
        {
        Q_OBJECT
          void baz() { tr("bla bla"); }
        };
      }
      

      lupdate says "tr() can not be called without context", and the string is not present in the ts file.
      Removing the comment gets rid of the warning, and the string appears in the ts file, but the context looks wrong (I suppose this is another bug, QTBUG-11742):

      <context>
        <name>bar</name>
        ...
      </context>
      

      Attachments

        For Gerrit Dashboard: QTBUG-21876
        # Subject Branch Project Status CR V

        Activity

          People

            buddenha Oswald Buddenhagen
            ampleyfly Simon Johansson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes