From 784a290c4b08e84d895a62dada5420a3b47dde48 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Thu, 12 Nov 2020 16:11:50 +0100 Subject: QFileInfo: mark constructors as explicit These look like leftovers (API flaws). Construction of QFileInfo from QString (or similar) should be not implicit, as QFileInfo construction is expensive (might hit the file system), and this may have users overlook APIs (for instance build a QFileInfo out of QDirIterator::next(), instead of using ::fileInfo(); using QDir::entryList instead of entryInfoList; etc.). Leave an opt-out mechanism to ease porting. Fix a handful of usages around qtbase, with at least a couple of them likely to be actual "sloppy" code. [ChangeLog][Potentially Source-Incompatible Changes][QFileInfo] Most QFileInfo constructors are now explicit. The QT_IMPLICIT_QFILEINFO_CONSTRUCTION macro is provided to keep old code working. Change-Id: Ic580e6316e67edbc840aa0c60d98c7aaabaf1af6 Reviewed-by: Volker Hilsheimer --- qmake/generators/metamakefile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qmake/generators/metamakefile.cpp') diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index 8d1eb1d886..8ba941c213 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -335,11 +335,11 @@ SubdirsMetaMakefileGenerator::init() QFileInfo subdir(subdirs.at(i).toQString()); const ProKey fkey(subdirs.at(i) + ".file"); if (!project->isEmpty(fkey)) { - subdir = project->first(fkey).toQString(); + subdir = QFileInfo(project->first(fkey).toQString()); } else { const ProKey skey(subdirs.at(i) + ".subdir"); if (!project->isEmpty(skey)) - subdir = project->first(skey).toQString(); + subdir = QFileInfo(project->first(skey).toQString()); } QString sub_name; if(subdir.isDir()) -- cgit v1.2.3