qmake: Apply modernize-use-override

Add overrides to functions, except for destructors.

Change-Id: I6e4640aa95a5c97d6bd6f6d8692d3290c421344e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Alessandro Portale 2018-08-02 23:34:53 +02:00
parent 24115f5a9c
commit 182aca8487
13 changed files with 118 additions and 118 deletions

View File

@ -40,7 +40,7 @@ class ProjectBuilderMakefileGenerator : public UnixMakefileGenerator
int pbuilderVersion() const;
bool writeSubDirs(QTextStream &);
bool writeMakeParts(QTextStream &);
bool writeMakefile(QTextStream &);
bool writeMakefile(QTextStream &) override;
QString pbxbuild();
QHash<QString, QString> keys;
@ -64,11 +64,11 @@ public:
ProjectBuilderMakefileGenerator();
~ProjectBuilderMakefileGenerator();
virtual bool supportsMetaBuild() { return false; }
virtual bool openOutput(QFile &, const QString &) const;
bool supportsMetaBuild() override { return false; }
bool openOutput(QFile &, const QString &) const override;
protected:
bool doPrecompiledHeaders() const { return false; }
virtual bool doDepends() const { return writingUnixMakefileGenerator && UnixMakefileGenerator::doDepends(); }
bool doPrecompiledHeaders() const override { return false; }
bool doDepends() const override { return writingUnixMakefileGenerator && UnixMakefileGenerator::doDepends(); }
};
inline ProjectBuilderMakefileGenerator::~ProjectBuilderMakefileGenerator()

View File

@ -124,9 +124,9 @@ protected:
{ return replaceExtraCompilerVariables(val, QStringList(in), QStringList(out), forShell); }
//interface to the source file info
QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool);
QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &);
QFileInfo findFileInfo(const QMakeLocalFileName &);
QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool) override;
QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &) override;
QFileInfo findFileInfo(const QMakeLocalFileName &) override;
QMakeProject *project;
//escape
@ -253,7 +253,7 @@ protected:
public:
MakefileGenerator();
virtual ~MakefileGenerator();
~MakefileGenerator();
QMakeProject *projectFile() const;
void setProjectFile(QMakeProject *p);

View File

@ -62,11 +62,11 @@ private:
public:
BuildsMetaMakefileGenerator(QMakeProject *p, const QString &n, bool op) : MetaMakefileGenerator(p, n, op), init_flag(false) { }
virtual ~BuildsMetaMakefileGenerator() { clearBuilds(); }
~BuildsMetaMakefileGenerator() { clearBuilds(); }
virtual bool init();
virtual int type() const { return BUILDSMETATYPE; }
virtual bool write();
bool init() override;
int type() const override { return BUILDSMETATYPE; }
bool write() override;
};
void
@ -248,11 +248,11 @@ protected:
public:
SubdirsMetaMakefileGenerator(QMakeProject *p, const QString &n, bool op) : MetaMakefileGenerator(p, n, op), init_flag(false) { }
virtual ~SubdirsMetaMakefileGenerator();
~SubdirsMetaMakefileGenerator();
virtual bool init();
virtual int type() const { return SUBDIRSMETATYPE; }
virtual bool write();
bool init() override;
int type() const override { return SUBDIRSMETATYPE; }
bool write() override;
};
bool

View File

@ -40,16 +40,16 @@ class ProjectGenerator : public MakefileGenerator
QString getWritableVar(const char *, bool fixPath=true);
QString fixPathToQmake(const QString &file);
protected:
virtual void init();
virtual bool writeMakefile(QTextStream &);
void init() override;
bool writeMakefile(QTextStream &) override;
virtual QString escapeFilePath(const QString &path) const { Q_ASSERT(false); return QString(); }
QString escapeFilePath(const QString &path) const override { Q_ASSERT(false); return QString(); }
public:
ProjectGenerator();
~ProjectGenerator();
virtual bool supportsMetaBuild() { return false; }
virtual bool openOutput(QFile &, const QString &) const;
bool supportsMetaBuild() override { return false; }
bool openOutput(QFile &, const QString &) const override;
};
inline ProjectGenerator::~ProjectGenerator()

View File

@ -38,7 +38,7 @@ class UnixMakefileGenerator : public MakefileGenerator
bool include_deps;
QString libtoolFileName(bool fixify=true);
void writeLibtoolFile(); // for libtool
void writePrlFile(QTextStream &);
void writePrlFile(QTextStream &) override;
public:
UnixMakefileGenerator();
@ -46,23 +46,23 @@ public:
protected:
virtual bool doPrecompiledHeaders() const { return project->isActiveConfig("precompile_header"); }
virtual bool doDepends() const { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); }
bool doDepends() const override { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); }
#ifdef Q_OS_WIN // MinGW x-compiling for QNX
virtual QString installRoot() const;
QString installRoot() const override;
#endif
virtual QString defaultInstall(const QString &);
virtual ProString fixLibFlag(const ProString &lib);
QString defaultInstall(const QString &) override;
ProString fixLibFlag(const ProString &lib) override;
virtual bool findLibraries(bool linkPrl, bool mergeLflags);
virtual QString escapeFilePath(const QString &path) const;
bool findLibraries(bool linkPrl, bool mergeLflags) override;
QString escapeFilePath(const QString &path) const override;
ProString escapeFilePath(const ProString &path) const { return MakefileGenerator::escapeFilePath(path); }
virtual QStringList &findDependencies(const QString &);
virtual void init();
QStringList &findDependencies(const QString &) override;
void init() override;
virtual void writeDefaultVariables(QTextStream &t);
virtual void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags);
void writeDefaultVariables(QTextStream &t) override;
void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags) override;
void writeMakeParts(QTextStream &);
bool writeMakefile(QTextStream &);
bool writeMakefile(QTextStream &) override;
private:
void init2();

View File

@ -40,27 +40,27 @@ public:
~MingwMakefileGenerator();
protected:
using MakefileGenerator::escapeDependencyPath;
virtual QString escapeDependencyPath(const QString &path) const;
virtual ProString fixLibFlag(const ProString &lib);
virtual bool processPrlFileBase(QString &origFile, const QStringRef &origName,
const QStringRef &fixedBase, int slashOff);
virtual QString getManifestFileForRcFile() const;
bool writeMakefile(QTextStream &);
void init();
virtual QString installRoot() const;
QString escapeDependencyPath(const QString &path) const override;
ProString fixLibFlag(const ProString &lib) override;
bool processPrlFileBase(QString &origFile, const QStringRef &origName,
const QStringRef &fixedBase, int slashOff) override;
QString getManifestFileForRcFile() const override;
bool writeMakefile(QTextStream &) override;
void init() override;
QString installRoot() const override;
private:
void writeMingwParts(QTextStream &);
void writeIncPart(QTextStream &t);
void writeLibsPart(QTextStream &t);
void writeObjectsPart(QTextStream &t);
void writeBuildRulesPart(QTextStream &t);
void writeRcFilePart(QTextStream &t);
void writeIncPart(QTextStream &t) override;
void writeLibsPart(QTextStream &t) override;
void writeObjectsPart(QTextStream &t) override;
void writeBuildRulesPart(QTextStream &t) override;
void writeRcFilePart(QTextStream &t) override;
QStringList &findDependencies(const QString &file);
QStringList &findDependencies(const QString &file) override;
QString preCompHeaderOut;
virtual LibFlagType parseLibFlag(const ProString &flag, ProString *arg);
LibFlagType parseLibFlag(const ProString &flag, ProString *arg) override;
QString objectsLinkLine;
};

View File

@ -72,7 +72,7 @@ public:
return Uindex;
}
void addElement(const QString &filepath, const VCFilterFile &allInfo){
void addElement(const QString &filepath, const VCFilterFile &allInfo) override {
QString newNodeName(filepath);
int index = pathIndex(filepath);
@ -89,7 +89,7 @@ public:
n->addElement(filepath.mid(index+1), allInfo);
}
void removeElements() {
void removeElements() override {
ChildrenMap::ConstIterator it = children.constBegin();
ChildrenMap::ConstIterator end = children.constEnd();
for( ; it != end; it++) {
@ -100,8 +100,8 @@ public:
}
void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &tool,
const QString &filter);
bool hasElements() {
const QString &filter) override;
bool hasElements() override {
return children.size() != 0;
}
};
@ -124,7 +124,7 @@ public:
return Uindex;
}
void addElement(const QString &filepath, const VCFilterFile &allInfo){
void addElement(const QString &filepath, const VCFilterFile &allInfo) override {
QString newKey(filepath);
int index = pathIndex(filepath);
@ -136,13 +136,13 @@ public:
children.insert(newKey + "\0" + allInfo.file, allInfo);
}
void removeElements() {
void removeElements() override {
children.clear();
}
void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &proj,
const QString &filter);
bool hasElements() {
const QString &filter) override;
bool hasElements() override {
return children.size() != 0;
}
};
@ -150,20 +150,20 @@ public:
class VCXProjectWriter : public VCProjectWriter
{
public:
void write(XmlOutput &, VCProjectSingleConfig &);
void write(XmlOutput &, VCProject &);
void write(XmlOutput &, VCProjectSingleConfig &) override;
void write(XmlOutput &, VCProject &) override;
void write(XmlOutput &, const VCCLCompilerTool &);
void write(XmlOutput &, const VCLinkerTool &);
void write(XmlOutput &, const VCMIDLTool &);
void write(XmlOutput &, const VCCustomBuildTool &);
void write(XmlOutput &, const VCLibrarianTool &);
void write(XmlOutput &, const VCResourceCompilerTool &);
void write(XmlOutput &, const VCEventTool &);
void write(XmlOutput &, const VCDeploymentTool &);
void write(XmlOutput &, const VCWinDeployQtTool &);
void write(XmlOutput &, const VCConfiguration &);
void write(XmlOutput &, VCFilter &);
void write(XmlOutput &, const VCCLCompilerTool &) override;
void write(XmlOutput &, const VCLinkerTool &) override;
void write(XmlOutput &, const VCMIDLTool &) override;
void write(XmlOutput &, const VCCustomBuildTool &) override;
void write(XmlOutput &, const VCLibrarianTool &) override;
void write(XmlOutput &, const VCResourceCompilerTool &) override;
void write(XmlOutput &, const VCEventTool &) override;
void write(XmlOutput &, const VCDeploymentTool &) override;
void write(XmlOutput &, const VCWinDeployQtTool &) override;
void write(XmlOutput &, const VCConfiguration &) override;
void write(XmlOutput &, VCFilter &) override;
private:
struct OutputFilterData

View File

@ -36,21 +36,21 @@ QT_BEGIN_NAMESPACE
class NmakeMakefileGenerator : public Win32MakefileGenerator
{
void writeNmakeParts(QTextStream &);
bool writeMakefile(QTextStream &);
void writeImplicitRulesPart(QTextStream &t);
void writeBuildRulesPart(QTextStream &t);
bool writeMakefile(QTextStream &) override;
void writeImplicitRulesPart(QTextStream &t) override;
void writeBuildRulesPart(QTextStream &t) override;
void writeLinkCommand(QTextStream &t, const QString &extraFlags = QString(), const QString &extraInlineFileContent = QString());
void writeResponseFileFiles(QTextStream &t, const ProStringList &files);
int msvcVersion() const;
void init();
void init() override;
static QStringList sourceFilesForImplicitRulesFilter();
protected:
virtual void writeSubMakeCall(QTextStream &t, const QString &callPrefix,
const QString &makeArguments);
virtual QString defaultInstall(const QString &t);
virtual QStringList &findDependencies(const QString &file);
QString var(const ProKey &value) const;
void writeSubMakeCall(QTextStream &t, const QString &callPrefix,
const QString &makeArguments) override;
QString defaultInstall(const QString &t) override;
QStringList &findDependencies(const QString &file) override;
QString var(const ProKey &value) const override;
QString precompH, precompObj, precompPch;
QString precompObjC, precompPchC;
bool usePCH, usePCHC;

View File

@ -484,7 +484,7 @@ public:
// Functions
VCCLCompilerTool();
bool parseOption(const char* option);
bool parseOption(const char* option) override;
// Variables
QStringList AdditionalIncludeDirectories;
@ -581,7 +581,7 @@ public:
// Functions
VCLinkerTool();
bool parseOption(const char* option);
bool parseOption(const char* option) override;
// Variables
QStringList AdditionalDependencies;
@ -676,7 +676,7 @@ class VCManifestTool : public VCToolBase
public:
VCManifestTool();
bool parseOption(const char* option);
bool parseOption(const char* option) override;
triState EmbedManifest;
};
@ -687,7 +687,7 @@ public:
// Functions
VCMIDLTool();
bool parseOption(const char* option);
bool parseOption(const char* option) override;
// Variables
QStringList AdditionalIncludeDirectories;
@ -741,7 +741,7 @@ public:
// Functions
VCLibrarianTool();
bool parseOption(const char*){ return false; }
bool parseOption(const char*) override { return false; }
// Variables
QStringList AdditionalDependencies;
@ -762,7 +762,7 @@ public:
// Functions
VCCustomBuildTool();
bool parseOption(const char*){ return false; }
bool parseOption(const char*) override { return false; }
// Variables
QStringList AdditionalDependencies;
@ -781,7 +781,7 @@ public:
// Functions
VCResourceCompilerTool();
bool parseOption(const char*){ return false; }
bool parseOption(const char*) override { return false; }
// Variables
QStringList AdditionalIncludeDirectories;
@ -815,7 +815,7 @@ protected:
// Functions
VCEventTool(const QString &eventName);
bool parseOption(const char*){ return false; }
bool parseOption(const char*) override { return false; }
public:
// Variables
@ -851,7 +851,7 @@ public:
VCWinDeployQtTool() {}
protected:
bool parseOption(const char *) { return false; }
bool parseOption(const char *) override { return false; }
public:
// Variables
@ -1037,7 +1037,7 @@ public:
return Uindex;
}
void addElement(const QString &filepath, const VCFilterFile &allInfo){
void addElement(const QString &filepath, const VCFilterFile &allInfo) override {
QString newNodeName(filepath);
int index = pathIndex(filepath);
@ -1054,7 +1054,7 @@ public:
n->addElement(filepath.mid(index+1), allInfo);
}
void removeElements() {
void removeElements() override {
ChildrenMap::ConstIterator it = children.constBegin();
ChildrenMap::ConstIterator end = children.constEnd();
for( ; it != end; it++) {
@ -1064,8 +1064,8 @@ public:
children.clear();
}
void generateXML(XmlOutput &xml, const QString &tagName, VCProject &tool, const QString &filter);
bool hasElements() {
void generateXML(XmlOutput &xml, const QString &tagName, VCProject &tool, const QString &filter) override;
bool hasElements() override {
return children.size() != 0;
}
};
@ -1088,7 +1088,7 @@ public:
return Uindex;
}
void addElement(const QString &filepath, const VCFilterFile &allInfo){
void addElement(const QString &filepath, const VCFilterFile &allInfo) override {
QString newKey(filepath);
int index = pathIndex(filepath);
@ -1100,12 +1100,12 @@ public:
children.insert(newKey + "\0" + allInfo.file, allInfo);
}
void removeElements() {
void removeElements() override {
children.clear();
}
void generateXML(XmlOutput &xml, const QString &tagName, VCProject &proj, const QString &filter);
bool hasElements() {
void generateXML(XmlOutput &xml, const QString &tagName, VCProject &proj, const QString &filter) override;
bool hasElements() override {
return children.size() != 0;
}
};

View File

@ -47,10 +47,10 @@ class VcprojGenerator : public Win32MakefileGenerator
bool is64Bit;
bool writeVcprojParts(QTextStream &);
bool writeMakefile(QTextStream &);
bool writeProjectMakefile();
bool writeMakefile(QTextStream &) override;
bool writeProjectMakefile() override;
void init();
void init() override;
public:
VcprojGenerator();
@ -70,14 +70,14 @@ public:
protected:
virtual VCProjectWriter *createProjectWriter();
virtual bool doDepends() const { return false; } //never necesary
bool doDepends() const override { return false; } // Never necessary
using Win32MakefileGenerator::replaceExtraCompilerVariables;
virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &, ReplaceFor);
virtual bool supportsMetaBuild() { return true; }
virtual bool supportsMergedBuilds() { return true; }
virtual bool mergeBuildProject(MakefileGenerator *other);
QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &, ReplaceFor) override;
bool supportsMetaBuild() override { return true; }
bool supportsMergedBuilds() override { return true; }
bool mergeBuildProject(MakefileGenerator *other) override;
virtual bool openOutput(QFile &file, const QString &build) const;
bool openOutput(QFile &file, const QString &build) const override;
virtual void initProject();
void initConfiguration();

View File

@ -39,7 +39,7 @@ public:
VcxprojGenerator();
protected:
virtual VCProjectWriter *createProjectWriter();
VCProjectWriter *createProjectWriter() override;
};
QT_END_NAMESPACE

View File

@ -39,7 +39,7 @@ public:
Win32MakefileGenerator();
~Win32MakefileGenerator();
protected:
virtual QString defaultInstall(const QString &);
QString defaultInstall(const QString &) override;
virtual void writeCleanParts(QTextStream &t);
virtual void writeStandardParts(QTextStream &t);
virtual void writeIncPart(QTextStream &t);
@ -48,18 +48,18 @@ protected:
virtual void writeImplicitRulesPart(QTextStream &t);
virtual void writeBuildRulesPart(QTextStream &);
using MakefileGenerator::escapeFilePath;
virtual QString escapeFilePath(const QString &path) const;
QString escapeFilePath(const QString &path) const override;
using MakefileGenerator::escapeDependencyPath;
virtual QString escapeDependencyPath(const QString &path) const;
QString escapeDependencyPath(const QString &path) const override;
virtual void writeRcFilePart(QTextStream &t);
virtual bool findLibraries(bool linkPrl, bool mergeLflags);
bool findLibraries(bool linkPrl, bool mergeLflags) override;
virtual LibFlagType parseLibFlag(const ProString &flag, ProString *arg);
virtual ProString fixLibFlag(const ProString &lib);
virtual bool processPrlFileBase(QString &origFile, const QStringRef &origName,
const QStringRef &fixedBase, int slashOff);
LibFlagType parseLibFlag(const ProString &flag, ProString *arg) override;
ProString fixLibFlag(const ProString &lib) override;
bool processPrlFileBase(QString &origFile, const QStringRef &origName,
const QStringRef &fixedBase, int slashOff) override;
void processVars();
void fixTargetExt();

View File

@ -60,12 +60,12 @@ class QMakeProject;
class EvalHandler : public QMakeHandler {
public:
void message(int type, const QString &msg, const QString &fileName, int lineNo);
void message(int type, const QString &msg, const QString &fileName, int lineNo) override;
void fileMessage(int type, const QString &msg);
void fileMessage(int type, const QString &msg) override;
void aboutToEval(ProFile *, ProFile *, EvalFileType);
void doneWithEval(ProFile *);
void aboutToEval(ProFile *, ProFile *, EvalFileType) override;
void doneWithEval(ProFile *) override;
};
struct Option