path: root/qmake/generators/metamakefile.cpp
diff options
authorGiuseppe D'Angelo <>2020-11-12 16:11:50 +0100
committerVolker Hilsheimer <>2020-11-15 18:30:16 +0100
commit784a290c4b08e84d895a62dada5420a3b47dde48 (patch)
tree3a327a2d2bf0447704b68b4989398646e90cd476 /qmake/generators/metamakefile.cpp
parent1869615fc959c70a334e666ebf95ff595a3d6e67 (diff)
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 <>
Diffstat (limited to 'qmake/generators/metamakefile.cpp')
1 files changed, 2 insertions, 2 deletions
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(;
const ProKey fkey( + ".file");
if (!project->isEmpty(fkey)) {
- subdir = project->first(fkey).toQString();
+ subdir = QFileInfo(project->first(fkey).toQString());
} else {
const ProKey skey( + ".subdir");
if (!project->isEmpty(skey))
- subdir = project->first(skey).toQString();
+ subdir = QFileInfo(project->first(skey).toQString());
QString sub_name;