Use QList instead of QVector in qmake
Task-number: QTBUG-84469 Change-Id: I4a3da94702f1dad1ee10b1ba3c6712b6f40338c9 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
973a795bec
commit
8ef41d1713
@ -601,7 +601,7 @@ MakefileGenerator::init()
|
|||||||
int x;
|
int x;
|
||||||
|
|
||||||
//build up a list of compilers
|
//build up a list of compilers
|
||||||
QVector<Compiler> compilers;
|
QList<Compiler> compilers;
|
||||||
{
|
{
|
||||||
const char *builtins[] = { "OBJECTS", "SOURCES", "PRECOMPILED_HEADER", nullptr };
|
const char *builtins[] = { "OBJECTS", "SOURCES", "PRECOMPILED_HEADER", nullptr };
|
||||||
for(x = 0; builtins[x]; ++x) {
|
for(x = 0; builtins[x]; ++x) {
|
||||||
@ -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"];
|
||||||
QVector<QMakeLocalFileName> deplist;
|
QList<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()));
|
||||||
@ -1826,7 +1826,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 QVector<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths();
|
const QList<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);
|
||||||
@ -3095,7 +3095,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
|
||||||
QVector<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
|
QList<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) != '/')
|
||||||
|
@ -192,10 +192,10 @@ void QMakeSourceFileInfo::dependTreeWalker(SourceFile *node, SourceDependChildre
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMakeSourceFileInfo::setDependencyPaths(const QVector<QMakeLocalFileName> &l)
|
void QMakeSourceFileInfo::setDependencyPaths(const QList<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
|
||||||
QVector<QMakeLocalFileName> ll;
|
QList<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));
|
||||||
|
@ -31,9 +31,9 @@
|
|||||||
|
|
||||||
#include <proitems.h>
|
#include <proitems.h>
|
||||||
|
|
||||||
#include <qstringlist.h>
|
|
||||||
#include <qfileinfo.h>
|
#include <qfileinfo.h>
|
||||||
#include <qvector.h>
|
#include <qlist.h>
|
||||||
|
#include <qstringlist.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ private:
|
|||||||
//quick project lookups
|
//quick project lookups
|
||||||
SourceFiles *files, *includes;
|
SourceFiles *files, *includes;
|
||||||
bool files_changed;
|
bool files_changed;
|
||||||
QVector<QMakeLocalFileName> depdirs;
|
QList<QMakeLocalFileName> depdirs;
|
||||||
QStringList systemIncludes;
|
QStringList systemIncludes;
|
||||||
|
|
||||||
//sleezy buffer code
|
//sleezy buffer code
|
||||||
@ -89,8 +89,8 @@ public:
|
|||||||
QMakeSourceFileInfo();
|
QMakeSourceFileInfo();
|
||||||
virtual ~QMakeSourceFileInfo();
|
virtual ~QMakeSourceFileInfo();
|
||||||
|
|
||||||
QVector<QMakeLocalFileName> dependencyPaths() const { return depdirs; }
|
QList<QMakeLocalFileName> dependencyPaths() const { return depdirs; }
|
||||||
void setDependencyPaths(const QVector<QMakeLocalFileName> &);
|
void setDependencyPaths(const QList<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; }
|
||||||
|
@ -258,7 +258,7 @@ void BuildsMetaMakefileGenerator::checkForConflictingTargets() const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
using TargetInfo = std::pair<Build *, ProString>;
|
using TargetInfo = std::pair<Build *, ProString>;
|
||||||
QVector<TargetInfo> targets;
|
QList<TargetInfo> targets;
|
||||||
const int last = makefiles.count() - 1;
|
const int last = makefiles.count() - 1;
|
||||||
targets.resize(last);
|
targets.resize(last);
|
||||||
for (int i = 0; i < last; ++i) {
|
for (int i = 0; i < last; ++i) {
|
||||||
|
@ -215,7 +215,7 @@ ProjectGenerator::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//setup deplist
|
//setup deplist
|
||||||
QVector<QMakeLocalFileName> deplist;
|
QList<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)
|
||||||
|
@ -391,7 +391,7 @@ UnixMakefileGenerator::fixLibFlag(const ProString &lib)
|
|||||||
bool
|
bool
|
||||||
UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
||||||
{
|
{
|
||||||
QVector<QMakeLocalFileName> libdirs, frameworkdirs;
|
QList<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()));
|
||||||
|
@ -958,7 +958,7 @@ public:
|
|||||||
VCCLCompilerTool CompilerTool;
|
VCCLCompilerTool CompilerTool;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QVector<VCFilter> VCFilterList;
|
typedef QList<VCFilter> VCFilterList;
|
||||||
class VCProjectSingleConfig
|
class VCProjectSingleConfig
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -355,7 +355,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
|
|||||||
QHash<QString, ProStringList> &subdirProjectLookup,
|
QHash<QString, ProStringList> &subdirProjectLookup,
|
||||||
const ProStringList &allDependencies)
|
const ProStringList &allDependencies)
|
||||||
{
|
{
|
||||||
QVector<QPair<QString, ProStringList> > collectedSubdirs;
|
QList<QPair<QString, ProStringList>> collectedSubdirs;
|
||||||
ProStringList tmp_proj_subdirs = proj->values("SUBDIRS");
|
ProStringList tmp_proj_subdirs = proj->values("SUBDIRS");
|
||||||
ProStringList projectsInProject;
|
ProStringList projectsInProject;
|
||||||
const int numSubdirs = tmp_proj_subdirs.size();
|
const int numSubdirs = tmp_proj_subdirs.size();
|
||||||
|
@ -102,7 +102,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");
|
||||||
QVector<LibrarySearchPath> dirs;
|
QList<LibrarySearchPath> 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(LibrarySearchPath(dlib.toQString(), true));
|
dirs.append(LibrarySearchPath(dlib.toQString(), true));
|
||||||
|
@ -32,10 +32,10 @@
|
|||||||
#include "qmake_global.h"
|
#include "qmake_global.h"
|
||||||
|
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
#include <qstring.h>
|
|
||||||
#include <qvector.h>
|
|
||||||
#include <qhash.h>
|
#include <qhash.h>
|
||||||
|
#include <qlist.h>
|
||||||
#include <qmap.h>
|
#include <qmap.h>
|
||||||
|
#include <qstring.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ private:
|
|||||||
const ProString *m_ps;
|
const ProString *m_ps;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ProStringList : public QVector<ProString> {
|
class ProStringList : public QList<ProString> {
|
||||||
public:
|
public:
|
||||||
ProStringList() {}
|
ProStringList() {}
|
||||||
ProStringList(const ProString &str) { *this << str; }
|
ProStringList(const ProString &str) { *this << str; }
|
||||||
@ -319,7 +319,7 @@ public:
|
|||||||
QStringList toQStringList() const;
|
QStringList toQStringList() const;
|
||||||
|
|
||||||
ProStringList &operator<<(const ProString &str)
|
ProStringList &operator<<(const ProString &str)
|
||||||
{ QVector<ProString>::operator<<(str); return *this; }
|
{ QList<ProString>::operator<<(str); return *this; }
|
||||||
|
|
||||||
int length() const { return size(); }
|
int length() const { return size(); }
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ Q_DECLARE_TYPEINFO(SedSubst, Q_MOVABLE_TYPE);
|
|||||||
|
|
||||||
static int doSed(int argc, char **argv)
|
static int doSed(int argc, char **argv)
|
||||||
{
|
{
|
||||||
QVector<SedSubst> substs;
|
QList<SedSubst> substs;
|
||||||
QList<const char *> inFiles;
|
QList<const char *> inFiles;
|
||||||
for (int i = 0; i < argc; i++) {
|
for (int i = 0; i < argc; i++) {
|
||||||
if (!strcmp(argv[i], "-e")) {
|
if (!strcmp(argv[i], "-e")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user