Do not use QList<QMakeLocalFileName>
QMakeLocalFileName is not suitable for QList. Use QVector instead. Change-Id: I5a3c4c8da14c0a920b5a57cba148ad68ac0f85a2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
c58ca4256d
commit
50e496bd3a
@ -764,7 +764,7 @@ MakefileGenerator::init()
|
||||
ProStringList incDirs = v["DEPENDPATH"] + v["QMAKE_ABSOLUTE_SOURCE_PATH"];
|
||||
if(project->isActiveConfig("depend_includepath"))
|
||||
incDirs += v["INCLUDEPATH"];
|
||||
QList<QMakeLocalFileName> deplist;
|
||||
QVector<QMakeLocalFileName> deplist;
|
||||
deplist.reserve(incDirs.size());
|
||||
for (ProStringList::Iterator it = incDirs.begin(); it != incDirs.end(); ++it)
|
||||
deplist.append(QMakeLocalFileName((*it).toQString()));
|
||||
@ -1839,7 +1839,7 @@ static QStringList splitDeps(const QString &indeps, bool lineMode)
|
||||
|
||||
QString MakefileGenerator::resolveDependency(const QDir &outDir, const QString &file)
|
||||
{
|
||||
const QList<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths();
|
||||
const QVector<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths();
|
||||
for (const auto &depdir : depdirs) {
|
||||
const QString &local = depdir.local();
|
||||
QString lf = outDir.absoluteFilePath(local + '/' + file);
|
||||
@ -3105,7 +3105,7 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
|
||||
|
||||
if(Option::output_dir != qmake_getpwd()
|
||||
&& QDir::isRelativePath(dep.real())) { //is it from the shadow tree
|
||||
QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
|
||||
QVector<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
|
||||
depdirs.prepend(fileInfo(file.real()).absoluteDir().path());
|
||||
QString pwd = qmake_getpwd();
|
||||
if(pwd.at(pwd.length()-1) != '/')
|
||||
|
@ -199,10 +199,10 @@ void QMakeSourceFileInfo::dependTreeWalker(SourceFile *node, SourceDependChildre
|
||||
}
|
||||
}
|
||||
|
||||
void QMakeSourceFileInfo::setDependencyPaths(const QList<QMakeLocalFileName> &l)
|
||||
void QMakeSourceFileInfo::setDependencyPaths(const QVector<QMakeLocalFileName> &l)
|
||||
{
|
||||
// Ensure that depdirs does not contain the same paths several times, to minimize the stats
|
||||
QList<QMakeLocalFileName> ll;
|
||||
QVector<QMakeLocalFileName> ll;
|
||||
for (int i = 0; i < l.count(); ++i) {
|
||||
if (!ll.contains(l.at(i)))
|
||||
ll.append(l.at(i));
|
||||
@ -853,8 +853,8 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
|
||||
}
|
||||
}
|
||||
if(!exists) { //path lookup
|
||||
for(QList<QMakeLocalFileName>::Iterator it = depdirs.begin(); it != depdirs.end(); ++it) {
|
||||
QMakeLocalFileName f((*it).real() + Option::dir_sep + lfn.real());
|
||||
for (const QMakeLocalFileName &depdir : qAsConst(depdirs)) {
|
||||
QMakeLocalFileName f(depdir.real() + Option::dir_sep + lfn.real());
|
||||
QFileInfo fi(findFileInfo(f));
|
||||
if(fi.exists() && !fi.isDir()) {
|
||||
lfn = fixPathForFile(f);
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include <qstringlist.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qvector.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -65,7 +66,7 @@ private:
|
||||
//quick project lookups
|
||||
SourceFiles *files, *includes;
|
||||
bool files_changed;
|
||||
QList<QMakeLocalFileName> depdirs;
|
||||
QVector<QMakeLocalFileName> depdirs;
|
||||
QStringList systemIncludes;
|
||||
|
||||
//sleezy buffer code
|
||||
@ -91,8 +92,8 @@ public:
|
||||
QMakeSourceFileInfo(const QString &cachefile="");
|
||||
virtual ~QMakeSourceFileInfo();
|
||||
|
||||
QList<QMakeLocalFileName> dependencyPaths() const { return depdirs; }
|
||||
void setDependencyPaths(const QList<QMakeLocalFileName> &);
|
||||
QVector<QMakeLocalFileName> dependencyPaths() const { return depdirs; }
|
||||
void setDependencyPaths(const QVector<QMakeLocalFileName> &);
|
||||
|
||||
enum DependencyMode { Recursive, NonRecursive };
|
||||
inline void setDependencyMode(DependencyMode mode) { dep_mode = mode; }
|
||||
|
@ -215,7 +215,7 @@ ProjectGenerator::init()
|
||||
}
|
||||
|
||||
//setup deplist
|
||||
QList<QMakeLocalFileName> deplist;
|
||||
QVector<QMakeLocalFileName> deplist;
|
||||
{
|
||||
const ProStringList &d = v["DEPENDPATH"];
|
||||
for(int i = 0; i < d.size(); ++i)
|
||||
|
@ -392,7 +392,7 @@ UnixMakefileGenerator::fixLibFlag(const ProString &lib)
|
||||
bool
|
||||
UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
||||
{
|
||||
QList<QMakeLocalFileName> libdirs, frameworkdirs;
|
||||
QVector<QMakeLocalFileName> libdirs, frameworkdirs;
|
||||
int libidx = 0, fwidx = 0;
|
||||
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
|
||||
libdirs.append(QMakeLocalFileName(dlib.toQString()));
|
||||
@ -418,9 +418,8 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
||||
libdirs.insert(libidx++, f);
|
||||
} else if(opt.startsWith("-l")) {
|
||||
QString lib = opt.mid(2);
|
||||
for (QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin();
|
||||
dep_it != libdirs.end(); ++dep_it) {
|
||||
QString libBase = (*dep_it).local() + '/'
|
||||
for (const QMakeLocalFileName &libdir : qAsConst(libdirs)) {
|
||||
QString libBase = libdir.local() + '/'
|
||||
+ project->first("QMAKE_PREFIX_SHLIB") + lib;
|
||||
if (linkPrl && processPrlFile(libBase, true))
|
||||
goto found;
|
||||
|
@ -79,7 +79,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
||||
ProStringList impexts = project->values("QMAKE_LIB_EXTENSIONS");
|
||||
if (impexts.isEmpty())
|
||||
impexts = project->values("QMAKE_EXTENSION_STATICLIB");
|
||||
QList<QMakeLocalFileName> dirs;
|
||||
QVector<QMakeLocalFileName> dirs;
|
||||
int libidx = 0;
|
||||
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
|
||||
dirs.append(QMakeLocalFileName(dlib.toQString()));
|
||||
@ -104,8 +104,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
||||
QString lib = arg.toQString();
|
||||
ProString verovr =
|
||||
project->first(ProKey("QMAKE_" + lib.toUpper() + "_VERSION_OVERRIDE"));
|
||||
for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin();
|
||||
dir_it != dirs.end(); ++dir_it) {
|
||||
for (auto dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) {
|
||||
QString cand = (*dir_it).real() + Option::dir_sep + lib;
|
||||
if (linkPrl && processPrlFile(cand, true)) {
|
||||
(*it) = cand;
|
||||
@ -128,8 +127,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
||||
if (processPrlFile(lib, false))
|
||||
(*it) = lib;
|
||||
} else {
|
||||
for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin();
|
||||
dir_it != dirs.end(); ++dir_it) {
|
||||
for (auto dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) {
|
||||
QString cand = (*dir_it).real() + Option::dir_sep + lib;
|
||||
if (processPrlFile(cand, false)) {
|
||||
(*it) = cand;
|
||||
|
Loading…
Reference in New Issue
Block a user