diff --git a/src/plugins/projectexplorer/customwizard/customwizard.cpp b/src/plugins/projectexplorer/customwizard/customwizard.cpp index af911524716be6140d81f1b2d0d101d3b73cc478..34870de77422175b203a7342a3187fb92d89dcb5 100644 --- a/src/plugins/projectexplorer/customwizard/customwizard.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizard.cpp @@ -309,6 +309,11 @@ QList<CustomWizard*> CustomWizard::createWizards() const QString templateDirName = Core::ICore::instance()->resourcePath() + QLatin1Char('/') + QLatin1String(templatePathC); + + const QString userTemplateDirName = Core::ICore::instance()->userResourcePath() + + QLatin1Char('/') + QLatin1String(templatePathC); + + const QDir templateDir(templateDirName); if (CustomWizardPrivate::verbose) verboseLog = QString::fromLatin1("### CustomWizard: Checking '%1'\n").arg(templateDirName); @@ -318,8 +323,19 @@ QList<CustomWizard*> CustomWizard::createWizards() return rc; } - const QList<QFileInfo> dirs = templateDir.entryInfoList(QDir::Dirs|QDir::Readable|QDir::NoDotAndDotDot, + const QDir userTemplateDir(userTemplateDirName); + if (CustomWizardPrivate::verbose) + verboseLog = QString::fromLatin1("### CustomWizard: Checking '%1'\n").arg(userTemplateDirName); + + QList<QFileInfo> dirs = templateDir.entryInfoList(QDir::Dirs|QDir::Readable|QDir::NoDotAndDotDot, QDir::Name|QDir::IgnoreCase); + if (userTemplateDir.exists()) { + if (CustomWizardPrivate::verbose) + verboseLog = QString::fromLatin1("### CustomWizard: userTemplateDir '%1' found, adding\n").arg(userTemplateDirName); + dirs += userTemplateDir.entryInfoList(QDir::Dirs|QDir::Readable|QDir::NoDotAndDotDot, + QDir::Name|QDir::IgnoreCase); + } + const QString configFile = QLatin1String(configFileC); // Check and parse config file in each directory.