forked from qt-creator/qt-creator
BaseQtVersion: Deduplicate documentation related methods
Use docsPath() over documentationPath() since that fits better into the naming scheme of the rest and already returns a FilePath. Change hasDocumentation() to hasDocs() accordingly. Change-Id: I619d7c68e612c4e25a830e4dce128d9a1e84c2e2 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1240,17 +1240,12 @@ void BaseQtVersion::applyProperties(QMakeGlobals *qmakeGlobals) const
|
||||
qmakeGlobals->setProperties(d->versionInfo());
|
||||
}
|
||||
|
||||
bool BaseQtVersion::hasDocumentation() const
|
||||
bool BaseQtVersion::hasDocs() const
|
||||
{
|
||||
d->updateVersionInfo();
|
||||
return d->m_hasDocumentation;
|
||||
}
|
||||
|
||||
QString BaseQtVersion::documentationPath() const
|
||||
{
|
||||
return qmakeProperty("QT_INSTALL_DOCS");
|
||||
}
|
||||
|
||||
bool BaseQtVersion::hasDemos() const
|
||||
{
|
||||
d->updateVersionInfo();
|
||||
|
@@ -146,11 +146,9 @@ public:
|
||||
QStringList qtSoPaths() const;
|
||||
|
||||
bool hasExamples() const;
|
||||
bool hasDocumentation() const;
|
||||
bool hasDocs() const;
|
||||
bool hasDemos() const;
|
||||
|
||||
QString documentationPath() const;
|
||||
|
||||
QString frameworkInstallPath() const;
|
||||
|
||||
// former local functions
|
||||
|
@@ -141,7 +141,7 @@ void ExampleSetModel::recreateModel(const QList<BaseQtVersion *> &qtVersions)
|
||||
|
||||
foreach (BaseQtVersion *version, qtVersions) {
|
||||
// sanitize away qt versions that have already been added through extra sets
|
||||
if (extraManifestDirs.contains(version->documentationPath())) {
|
||||
if (extraManifestDirs.contains(version->docsPath().toString())) {
|
||||
if (debugExamples()) {
|
||||
qWarning() << "Not showing Qt version because manifest path is already added through InstalledExamples settings:"
|
||||
<< version->displayName();
|
||||
@@ -172,7 +172,7 @@ int ExampleSetModel::indexForQtVersion(BaseQtVersion *qtVersion) const
|
||||
}
|
||||
|
||||
// check for extra set
|
||||
const QString &documentationPath = qtVersion->documentationPath();
|
||||
const QString &documentationPath = qtVersion->docsPath().toString();
|
||||
for (int i = 0; i < rowCount(); ++i) {
|
||||
if (getType(i) == ExtraExampleSetType
|
||||
&& m_extraExampleSets.at(getExtraExampleSetIndex(i)).manifestPath == documentationPath)
|
||||
@@ -577,7 +577,7 @@ QStringList ExampleSetModel::exampleSources(QString *examplesInstallPath, QStrin
|
||||
int qtId = getQtId(m_selectedExampleSetIndex);
|
||||
foreach (BaseQtVersion *version, QtVersionManager::versions()) {
|
||||
if (version->uniqueId() == qtId) {
|
||||
manifestScanPath = version->documentationPath();
|
||||
manifestScanPath = version->docsPath().toString();
|
||||
examplesPath = version->examplesPath().toString();
|
||||
demosPath = version->demosPath().toString();
|
||||
break;
|
||||
|
@@ -469,8 +469,8 @@ static void updateDocumentation()
|
||||
{
|
||||
QStringList files;
|
||||
foreach (BaseQtVersion *v, m_versions) {
|
||||
const QStringList docPaths = QStringList({v->documentationPath() + QChar('/'),
|
||||
v->documentationPath() + "/qch/"});
|
||||
const QStringList docPaths = QStringList(
|
||||
{v->docsPath().toString() + QChar('/'), v->docsPath().toString() + "/qch/"});
|
||||
foreach (const QString &docPath, docPaths) {
|
||||
const QDir versionHelpDir(docPath);
|
||||
foreach (const QString &helpFile,
|
||||
|
Reference in New Issue
Block a user