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

QUrl's operator==() is taking bygone data into account

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9.0 RC
    • Core: URL Handling
    • None
    • 3
    • Foundation Sprint 127, Foundation Sprint 128

    Description

      The comparesEqual() function checks sectionIsPresent only for comparing that it's the same in lhs and rhs, not for whether it should compare a given section at all. So if a section contains stale data, such as other in QTBUG-134896, and setUrl() with a valid URL is called, then the resulting object will compare not equal to a QUrl object that was constructed with the same string passed to its ctor:

      QUrl url1;
      url1.setFragment("meep"); // see QTBUG-134896
      url1.setUrl("https://www.qt-project.org"); // does not overwrite d->fragment
      QUrl url2("https://www.qt-project.org");
      QCOMPARE_EQ(url1, url2); // prints the same string, but claims they're different
      

      QUrl url1("https://www.qt-project.org);

      Attachments

        Issue Links

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

          Activity

            People

              mmutz Marc Mutz
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are 2 open Gerrit changes