summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/plugins/cpptools/cpptoolsplugin.cpp18
-rw-r--r--src/plugins/cpptools/cpptoolsplugin.h4
2 files changed, 22 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;
}
diff --git a/src/plugins/cpptools/cpptoolsplugin.h b/src/plugins/cpptools/cpptoolsplugin.h
index 3d54eb0cde..74fccf7179 100644
--- a/src/plugins/cpptools/cpptoolsplugin.h
+++ b/src/plugins/cpptools/cpptoolsplugin.h
@@ -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();