forked from qt-creator/qt-creator
CppTools: Export licensetemplate and licensetemplatepath as variables
Change-Id: Id86b72b275d3381a32003c0439ff2d6b3b6ab505 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablemanager.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
|
||||
@@ -96,6 +97,16 @@ void CppToolsPlugin::clearHeaderSourceCache()
|
||||
m_headerSourceMapping.clear();
|
||||
}
|
||||
|
||||
Utils::FileName CppToolsPlugin::licenseTemplatePath()
|
||||
{
|
||||
return Utils::FileName::fromString(m_instance->m_fileSettings->licenseTemplatePath);
|
||||
}
|
||||
|
||||
QString CppToolsPlugin::licenseTemplate()
|
||||
{
|
||||
return m_instance->m_fileSettings->licenseTemplate();
|
||||
}
|
||||
|
||||
const QStringList &CppToolsPlugin::headerSearchPaths()
|
||||
{
|
||||
return m_instance->m_fileSettings->headerSearchPaths;
|
||||
@@ -173,6 +184,13 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
mcpptools->addAction(command);
|
||||
connect(openInNextSplitAction, SIGNAL(triggered()), this, SLOT(switchHeaderSourceInNextSplit()));
|
||||
|
||||
Core::VariableManager::registerVariable("Cpp:LicenseTemplate",
|
||||
tr("The license template."),
|
||||
[]() { return CppToolsPlugin::licenseTemplate(); });
|
||||
Core::VariableManager::registerFileVariables("Cpp:LicenseTemplatePath",
|
||||
tr("The configured path to the license template."),
|
||||
[]() { return CppToolsPlugin::licenseTemplatePath().toString(); });
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@ class QFileInfo;
|
||||
class QDir;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils { class FileName; }
|
||||
|
||||
namespace CppTools {
|
||||
|
||||
class CppToolsSettings;
|
||||
@@ -67,6 +69,8 @@ public:
|
||||
static const QStringList &headerPrefixes();
|
||||
static const QStringList &sourcePrefixes();
|
||||
static void clearHeaderSourceCache();
|
||||
static Utils::FileName licenseTemplatePath();
|
||||
static QString licenseTemplate();
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *errorMessage);
|
||||
void extensionsInitialized();
|
||||
|
||||
Reference in New Issue
Block a user