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:
Jarek Kobus 2020-07-06 11:11:44 +02:00
parent 973a795bec
commit 8ef41d1713
11 changed files with 22 additions and 22 deletions

View File

@ -601,7 +601,7 @@ MakefileGenerator::init()
int x;
//build up a list of compilers
QVector<Compiler> compilers;
QList<Compiler> compilers;
{
const char *builtins[] = { "OBJECTS", "SOURCES", "PRECOMPILED_HEADER", nullptr };
for(x = 0; builtins[x]; ++x) {
@ -764,7 +764,7 @@ MakefileGenerator::init()
ProStringList incDirs = v["DEPENDPATH"] + v["QMAKE_ABSOLUTE_SOURCE_PATH"];
if(project->isActiveConfig("depend_includepath"))
incDirs += v["INCLUDEPATH"];
QVector<QMakeLocalFileName> deplist;
QList<QMakeLocalFileName> deplist;
deplist.reserve(incDirs.size());
for (ProStringList::Iterator it = incDirs.begin(); it != incDirs.end(); ++it)
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)
{
const QVector<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths();
const QList<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths();
for (const auto &depdir : depdirs) {
const QString &local = depdir.local();
QString lf = outDir.absoluteFilePath(local + '/' + file);
@ -3095,7 +3095,7 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
if(Option::output_dir != qmake_getpwd()
&& 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());
QString pwd = qmake_getpwd();
if(pwd.at(pwd.length()-1) != '/')

View File

@ -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
QVector<QMakeLocalFileName> ll;
QList<QMakeLocalFileName> ll;
for (int i = 0; i < l.count(); ++i) {
if (!ll.contains(l.at(i)))
ll.append(l.at(i));

View File

@ -31,9 +31,9 @@
#include <proitems.h>
#include <qstringlist.h>
#include <qfileinfo.h>
#include <qvector.h>
#include <qlist.h>
#include <qstringlist.h>
QT_BEGIN_NAMESPACE
@ -66,7 +66,7 @@ private:
//quick project lookups
SourceFiles *files, *includes;
bool files_changed;
QVector<QMakeLocalFileName> depdirs;
QList<QMakeLocalFileName> depdirs;
QStringList systemIncludes;
//sleezy buffer code
@ -89,8 +89,8 @@ public:
QMakeSourceFileInfo();
virtual ~QMakeSourceFileInfo();
QVector<QMakeLocalFileName> dependencyPaths() const { return depdirs; }
void setDependencyPaths(const QVector<QMakeLocalFileName> &);
QList<QMakeLocalFileName> dependencyPaths() const { return depdirs; }
void setDependencyPaths(const QList<QMakeLocalFileName> &);
enum DependencyMode { Recursive, NonRecursive };
inline void setDependencyMode(DependencyMode mode) { dep_mode = mode; }

View File

@ -258,7 +258,7 @@ void BuildsMetaMakefileGenerator::checkForConflictingTargets() const
return;
}
using TargetInfo = std::pair<Build *, ProString>;
QVector<TargetInfo> targets;
QList<TargetInfo> targets;
const int last = makefiles.count() - 1;
targets.resize(last);
for (int i = 0; i < last; ++i) {

View File

@ -215,7 +215,7 @@ ProjectGenerator::init()
}
//setup deplist
QVector<QMakeLocalFileName> deplist;
QList<QMakeLocalFileName> deplist;
{
const ProStringList &d = v["DEPENDPATH"];
for(int i = 0; i < d.size(); ++i)

View File

@ -391,7 +391,7 @@ UnixMakefileGenerator::fixLibFlag(const ProString &lib)
bool
UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
{
QVector<QMakeLocalFileName> libdirs, frameworkdirs;
QList<QMakeLocalFileName> libdirs, frameworkdirs;
int libidx = 0, fwidx = 0;
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
libdirs.append(QMakeLocalFileName(dlib.toQString()));

View File

@ -958,7 +958,7 @@ public:
VCCLCompilerTool CompilerTool;
};
typedef QVector<VCFilter> VCFilterList;
typedef QList<VCFilter> VCFilterList;
class VCProjectSingleConfig
{
public:

View File

@ -355,7 +355,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
QHash<QString, ProStringList> &subdirProjectLookup,
const ProStringList &allDependencies)
{
QVector<QPair<QString, ProStringList> > collectedSubdirs;
QList<QPair<QString, ProStringList>> collectedSubdirs;
ProStringList tmp_proj_subdirs = proj->values("SUBDIRS");
ProStringList projectsInProject;
const int numSubdirs = tmp_proj_subdirs.size();

View File

@ -102,7 +102,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
ProStringList impexts = project->values("QMAKE_LIB_EXTENSIONS");
if (impexts.isEmpty())
impexts = project->values("QMAKE_EXTENSION_STATICLIB");
QVector<LibrarySearchPath> dirs;
QList<LibrarySearchPath> dirs;
int libidx = 0;
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
dirs.append(LibrarySearchPath(dlib.toQString(), true));

View File

@ -32,10 +32,10 @@
#include "qmake_global.h"
#include <qdebug.h>
#include <qstring.h>
#include <qvector.h>
#include <qhash.h>
#include <qlist.h>
#include <qmap.h>
#include <qstring.h>
QT_BEGIN_NAMESPACE
@ -311,7 +311,7 @@ private:
const ProString *m_ps;
};
class ProStringList : public QVector<ProString> {
class ProStringList : public QList<ProString> {
public:
ProStringList() {}
ProStringList(const ProString &str) { *this << str; }
@ -319,7 +319,7 @@ public:
QStringList toQStringList() const;
ProStringList &operator<<(const ProString &str)
{ QVector<ProString>::operator<<(str); return *this; }
{ QList<ProString>::operator<<(str); return *this; }
int length() const { return size(); }

View File

@ -67,7 +67,7 @@ Q_DECLARE_TYPEINFO(SedSubst, Q_MOVABLE_TYPE);
static int doSed(int argc, char **argv)
{
QVector<SedSubst> substs;
QList<SedSubst> substs;
QList<const char *> inFiles;
for (int i = 0; i < argc; i++) {
if (!strcmp(argv[i], "-e")) {