Commit 4d429751 authored by Tobias Hunger's avatar Tobias Hunger

CppTools: Export licensetemplate and licensetemplatepath as variables

Change-Id: Id86b72b275d3381a32003c0439ff2d6b3b6ab505
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent d7b29eb6
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment