diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-06-09 13:56:08 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-06-10 11:57:05 +0000 |
commit | f733f1805aac087948d48c87df3a415042005e0d (patch) | |
tree | fdbcec98785d8f5f7466b8f88f8637fa0f2dfb40 /src/plugins/coreplugin/coreplugin.cpp | |
parent | 14ec0a63b95802c57dd62360ea771f7897d89dfb (diff) | |
download | qt-creator-f733f1805aac087948d48c87df3a415042005e0d.tar.gz |
Core: Expose DocumentManager data to MacroExpander
Expose the last visited directory as well as the project directory
stored by the DocumentManager to the MacroExpander.
Change-Id: I7cdbe5e5471b5c96954c74f21187786de7bb9aa3
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/coreplugin/coreplugin.cpp')
-rw-r--r-- | src/plugins/coreplugin/coreplugin.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 906394e9ea..34b0b61031 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -39,6 +39,7 @@ #include "iwizardfactory.h" #include <coreplugin/actionmanager/actionmanager.h> +#include <coreplugin/documentmanager.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/find/findplugin.h> #include <coreplugin/locator/locator.h> @@ -206,6 +207,10 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) []() { return QDate::currentDate().toString(Qt::DefaultLocaleShortDate); }); expander->registerVariable("CurrentTime:Locale", tr("The current time (Locale)."), []() { return QTime::currentTime().toString(Qt::DefaultLocaleShortDate); }); + expander->registerVariable("Config:DefaultProjectDirectory", tr("The configured default directory for projects."), + []() { return DocumentManager::projectsDirectory(); }); + expander->registerVariable("Config:LastFileDialogDirectory", tr("The directory last visited in a file dialog."), + []() { return DocumentManager::fileDialogLastVisitedDirectory(); }); expander->registerPrefix("CurrentDate:", tr("The current date (QDate formatstring)."), [](const QString &fmt) { return QDate::currentDate().toString(fmt); }); expander->registerPrefix("CurrentTime:", tr("The current time (QTime formatstring)."), |