summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qdoc/config.cpp8
-rw-r--r--src/qdoc/doc.cpp2
-rw-r--r--src/qdoc/location.cpp14
-rw-r--r--src/qdoc/location.h2
-rw-r--r--src/qdoc/main.cpp10
-rw-r--r--src/qdoc/qdocdatabase.cpp8
-rw-r--r--src/qdoc/qdoctagfiles.cpp2
-rw-r--r--src/qdoc/quoter.cpp2
8 files changed, 22 insertions, 26 deletions
diff --git a/src/qdoc/config.cpp b/src/qdoc/config.cpp
index e7ca42150..55a23610b 100644
--- a/src/qdoc/config.cpp
+++ b/src/qdoc/config.cpp
@@ -275,7 +275,7 @@ Config::~Config()
*/
void Config::clear()
{
- loc = lastLocation_ = Location::null;
+ loc = lastLocation_ = Location();
configVars_.clear();
includeFilesMap_.clear();
}
@@ -327,12 +327,12 @@ void Config::load(const QString &fileName)
if (configVars_.contains(CONFIG_PROJECT))
reset();
- load(Location::null, fileName);
+ load(Location(), fileName);
if (loc.isEmpty())
loc = Location(fileName);
else
loc.setEtc(true);
- lastLocation_ = Location::null;
+ lastLocation_ = Location();
// Add defines and includepaths from command line to their
// respective configuration variables. Values set here are
@@ -965,7 +965,7 @@ bool Config::isMetaKeyChar(QChar ch)
*/
QStringList Config::loadMaster(const QString &fileName)
{
- Location location = Location::null;
+ Location location;
QFile fin(fileName);
if (!fin.open(QFile::ReadOnly | QFile::Text)) {
if (!Config::installDir.isEmpty()) {
diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp
index 89748b0ad..e20870319 100644
--- a/src/qdoc/doc.cpp
+++ b/src/qdoc/doc.cpp
@@ -328,7 +328,7 @@ typedef QMap<QString, ArgList> CommandMap;
class DocPrivate : public Shared
{
public:
- DocPrivate(const Location &start = Location::null, const Location &end = Location::null,
+ DocPrivate(const Location &start = Location(), const Location &end = Location(),
const QString &source = QString());
~DocPrivate();
diff --git a/src/qdoc/location.cpp b/src/qdoc/location.cpp
index aab8ede19..dc378b1d1 100644
--- a/src/qdoc/location.cpp
+++ b/src/qdoc/location.cpp
@@ -42,8 +42,6 @@
QT_BEGIN_NAMESPACE
-const Location Location::null;
-
int Location::tabSize;
int Location::warningCount = 0;
int Location::warningLimit = -1;
@@ -283,7 +281,7 @@ int Location::exitCode()
if (warningLimit < 0 || warningCount <= warningLimit)
return EXIT_SUCCESS;
- Location::null.emitMessage(
+ Location().emitMessage(
Error,
tr("Documentation warnings (%1) exceeded the limit (%2) for '%3'.")
.arg(QString::number(warningCount), QString::number(warningLimit), project),
@@ -391,11 +389,11 @@ void Location::logToStdErrAlways(const QString &message)
*/
void Location::internalError(const QString &hint)
{
- Location::null.fatal(tr("Internal error (%1)").arg(hint),
- tr("There is a bug in %1. Seek advice from your local"
- " %2 guru.")
- .arg(programName)
- .arg(programName));
+ Location().fatal(tr("Internal error (%1)").arg(hint),
+ tr("There is a bug in %1. Seek advice from your local"
+ " %2 guru.")
+ .arg(programName)
+ .arg(programName));
}
/*!
diff --git a/src/qdoc/location.h b/src/qdoc/location.h
index 9ad601e1b..fb35038a8 100644
--- a/src/qdoc/location.h
+++ b/src/qdoc/location.h
@@ -80,8 +80,6 @@ public:
void fatal(const QString &message, const QString &details = QString()) const;
void report(const QString &message, const QString &details = QString()) const;
- static const Location null;
-
static void initialize(const Config &config);
static void terminate();
static void information(const QString &message);
diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp
index 79cb471ce..72259d4e3 100644
--- a/src/qdoc/main.cpp
+++ b/src/qdoc/main.cpp
@@ -97,7 +97,7 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats)
if (fi.exists() && fi.isFile())
indexFiles << index;
else
- Location::null.warning(QString("Index file not found: %1").arg(index));
+ Location().warning(QString("Index file not found: %1").arg(index));
}
config.dependModules() += config.getStringList(CONFIG_DEPENDS);
@@ -194,10 +194,10 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats)
indexPaths.reserve(foundIndices.size());
for (const auto &found : qAsConst(foundIndices))
indexPaths << found.absoluteFilePath();
- Location::null.warning(
+ Location().warning(
QString("Multiple index files found for dependency \"%1\":\n%2")
.arg(module, indexPaths.join('\n')));
- Location::null.warning(
+ Location().warning(
QString("Using %1 as index file for dependency \"%2\"")
.arg(foundIndices[foundIndices.size() - 1].absoluteFilePath(),
module));
@@ -209,13 +209,13 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats)
if (!indexFiles.contains(indexToAdd))
indexFiles << indexToAdd;
} else if (!asteriskUsed) {
- Location::null.warning(
+ Location().warning(
QString("\"%1\" Cannot locate index file for dependency \"%2\"")
.arg(config.getString(CONFIG_PROJECT), module));
}
}
} else {
- Location::null.warning(
+ Location().warning(
QLatin1String("Dependent modules specified, but no index directories were set. "
"There will probably be errors for missing links."));
}
diff --git a/src/qdoc/qdocdatabase.cpp b/src/qdoc/qdocdatabase.cpp
index be257b4b8..f32c4b7dc 100644
--- a/src/qdoc/qdocdatabase.cpp
+++ b/src/qdoc/qdocdatabase.cpp
@@ -336,7 +336,7 @@ const Node *QDocForest::findNodeForTarget(QStringList &targetPath, const Node *r
*/
void QDocForest::printLinkCounts(const QString &project)
{
- Location::null.report(QString("%1: Link Counts").arg(project));
+ Location().report(QString("%1: Link Counts").arg(project));
QMultiMap<int, QString> m;
for (const auto *tree : searchOrder()) {
if (tree->linkCount() < 0)
@@ -352,10 +352,10 @@ void QDocForest::printLinkCounts(const QString &project)
for (int k = 0; k < pad; ++k)
line += QLatin1Char(' ');
line += "%1";
- Location::null.report(line.arg(-(it.key())));
+ Location().report(line.arg(-(it.key())));
}
- Location::null.report("Optimal depends variable:");
- Location::null.report(depends);
+ Location().report("Optimal depends variable:");
+ Location().report(depends);
}
/*!
diff --git a/src/qdoc/qdoctagfiles.cpp b/src/qdoc/qdoctagfiles.cpp
index 8d97ce48a..cf593aa4c 100644
--- a/src/qdoc/qdoctagfiles.cpp
+++ b/src/qdoc/qdoctagfiles.cpp
@@ -341,7 +341,7 @@ void QDocTagFiles::generateTagFile(const QString &fileName, Generator *g)
file.setFileName(gen_->outputDir() + QLatin1Char('/') + fileInfo.fileName());
if (!file.open(QFile::WriteOnly | QFile::Text)) {
- Location::null.warning(QString("Failed to open %1 for writing.").arg(file.fileName()));
+ Location().warning(QString("Failed to open %1 for writing.").arg(file.fileName()));
return;
}
diff --git a/src/qdoc/quoter.cpp b/src/qdoc/quoter.cpp
index a313ab5c5..fcdc6dee1 100644
--- a/src/qdoc/quoter.cpp
+++ b/src/qdoc/quoter.cpp
@@ -134,7 +134,7 @@ void Quoter::reset()
silent = false;
plainLines.clear();
markedLines.clear();
- codeLocation = Location::null;
+ codeLocation = Location();
}
void Quoter::quoteFromFile(const QString &userFriendlyFilePath, const QString &plainCode,