Commit bf04e170 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts

project: move "index" member to "enable" ctags group member

parent 81ac491a
......@@ -12,9 +12,6 @@ struct
/// Otherwise, the directory in which the project file is located as the base directory.
string directory;
/// If "index" is set to "1", a ctags index file is generated.
bool index;
/// The "files" struct describes which files belong to the project.
/// There are five miutually exclusive methods to do this.
struct files
......@@ -82,6 +79,10 @@ struct
/// If set, it may contain extra options for ctags command used to populate the auto completion popup in Kate.
struct ctags
{
/// If "enable" is set to "1", a ctags index file is generated.
/// If not present, generation of index depends on project plugin setting.
bool enable;
/// "options" can be set to a list of ctags options. You may need to escape character "\".
vector< string > options;
......
......@@ -466,13 +466,15 @@ QStringList KateProjectWorker::filesFromDirectory(const QDir &_dir, bool recursi
void KateProjectWorker::loadIndex(const QStringList &files, bool force)
{
const QString keyCtags = QStringLiteral("ctags");
const QVariantMap ctagsMap = m_projectMap[keyCtags].toMap();
/**
* load index, if enabled
* before this was default on, which is dangerous for large repositories, e.g. out-of-memory or out-of-disk
* if specified in project map; use that setting, otherwise fall back to global setting
*/
bool indexEnabled = !m_indexDir.isEmpty();
auto indexValue = m_projectMap[QStringLiteral("index")];
auto indexValue = ctagsMap[QStringLiteral("enable")];
if (!indexValue.isNull()) {
indexEnabled = indexValue.toBool();
}
......@@ -485,8 +487,7 @@ void KateProjectWorker::loadIndex(const QStringList &files, bool force)
* create new index, this will do the loading in the constructor
* wrap it into shared pointer for transfer to main thread
*/
const QString keyCtags = QStringLiteral("ctags");
KateProjectSharedProjectIndex index(new KateProjectIndex(m_baseDir, m_indexDir, files, m_projectMap[keyCtags].toMap(), force));
KateProjectSharedProjectIndex index(new KateProjectIndex(m_baseDir, m_indexDir, files, ctagsMap, force));
emit loadIndexDone(index);
}
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