summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cpptoolsplugin.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2014-07-15 11:50:42 +0200
committerTobias Hunger <tobias.hunger@digia.com>2014-07-15 14:45:25 +0200
commit4d429751a4501fa07f9188e66d6bee0daf9ab25e (patch)
treeb3448b1ac24ec86f2b973697bd9097f88f5aa4ee /src/plugins/cpptools/cpptoolsplugin.cpp
parentd7b29eb6077dbb2c221003925f58c8d7013e2532 (diff)
downloadqt-creator-4d429751a4501fa07f9188e66d6bee0daf9ab25e.tar.gz
CppTools: Export licensetemplate and licensetemplatepath as variables
Change-Id: Id86b72b275d3381a32003c0439ff2d6b3b6ab505 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cpptoolsplugin.cpp')
-rw-r--r--src/plugins/cpptools/cpptoolsplugin.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp
index 44179a1fb4..8f6cf77f3e 100644
--- a/src/plugins/cpptools/cpptoolsplugin.cpp
+++ b/src/plugins/cpptools/cpptoolsplugin.cpp
@@ -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;
}