Clarified code documentation for QFileInfo::operator==.
authorMitch Curtis <mitch.curtis@nokia.com>
Tue, 22 May 2012 14:27:47 +0000 (16:27 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 23 May 2012 12:18:34 +0000 (14:18 +0200)
QTBUG-4031 mentions that canonicalFilePath() will cause the operator
to return true for the following comparison because it returns an
empty string if the path is empty or non-existant:

QFileInfo("") == QFileInfo("non_existant_file")

I'm assuming that the reason for not checking whether one of the files
exist is based on performance, and so I've updated the comments for the
operator to explicitly state that the result of the above comparison is
undefined.

Task-number: QTBUG-4031
Change-Id: I9b34f189f1628f9362b3604445706abd2342fd6e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/io/qfileinfo.cpp

index e533511..4973ecb 100644 (file)
@@ -379,7 +379,8 @@ QFileInfo::~QFileInfo()
     location as \a fileinfo; otherwise returns false.
 
     Note that the result of comparing two empty QFileInfo objects,
-    containing no file references, is undefined.
+    containing no file references (file paths that do not exist or
+    are empty), is undefined.
 
     \warning This will not compare two different symbolic links
     pointing to the same file.