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