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

QFileInfo::operator== misleading

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.0.0 Beta 1
    • 4.5.0
    • Core: I/O
    • None
    • I5663ec0e1ac8f70e0a156357c284696779ecd380 I9b34f189f1628f9362b3604445706abd2342fd6e

    Description

      QFileInfo::operator== states: Returns true if this QFileInfo object refers to a file in the same location as fileinfo; otherwise returns false.

      But this is only one aspect of comparison, as the size of the file is also compared, not just the location.

      If you create QFileInfo of two non-existing files (so completely
      different filePathes, in my example it was an empty path and a none
      existing file).
      The operator== will return true
      ... I think this behavior was introduced in qt4.5 (or at least I thought
      it worked correctly with qt4.4, I haven't spent time trying this again
      with the old qt)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mitch_curtis Mitch Curtis
            janichol Andy Nichols
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes