Clarified code documentation for QFileInfo::operator==.

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>
This commit is contained in:
Mitch Curtis 2012-05-22 16:27:47 +02:00 committed by Qt by Nokia
parent 318d39ccaf
commit bbafdf5812

View 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.