logic: source groups for project settings
* project can not have multiple source groups with different types * language of a project is now inferred from source groups * setting global NameHierarchy delimiter of first sourceGroup in project * added project settings migrations for source groups * Add Settings Migration classes (MoveKey, DeleteKey, Lambda) * Update sample projects with migrations * added method to config to retrieve sublevel key names * implemented recursive removing of keys in settings * moved project files out of top level * removed solution parsing code as it is not used anymore fortune cookie message = The secret of getting ahead is getting started.
This commit is contained in:
@@ -1476,7 +1476,7 @@ std::set<FilePath> PersistentStorage::getReferencedByIncludes(const std::set<Fil
|
||||
|
||||
std::set<FilePath> paths;
|
||||
for (Id id: ids)
|
||||
{
|
||||
{ // TODO: performance optimize: use just one request for all ids!
|
||||
paths.insert(getFileNodePath(id));
|
||||
}
|
||||
|
||||
|
||||
@@ -4,19 +4,22 @@
|
||||
#include "data/PersistentStorage.h"
|
||||
#include "utility/scheduling/Blackboard.h"
|
||||
#include "utility/utility.h"
|
||||
#include "Application.h"
|
||||
|
||||
TaskCleanStorage::TaskCleanStorage(
|
||||
PersistentStorage* storage, const std::vector<FilePath>& filePaths, std::shared_ptr<DialogView> dialogView
|
||||
PersistentStorage* storage, const std::vector<FilePath>& filePaths
|
||||
)
|
||||
: m_storage(storage)
|
||||
, m_filePaths(filePaths)
|
||||
, m_dialogView(dialogView)
|
||||
{
|
||||
}
|
||||
|
||||
void TaskCleanStorage::doEnter(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
m_dialogView->showStatusDialog("Clearing Files", std::to_string(m_filePaths.size()) + " Files");
|
||||
if (std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView())
|
||||
{
|
||||
dialogView->showStatusDialog("Clearing Files", std::to_string(m_filePaths.size()) + " Files");
|
||||
}
|
||||
|
||||
m_start = utility::durationStart();
|
||||
|
||||
@@ -28,10 +31,9 @@ void TaskCleanStorage::doEnter(std::shared_ptr<Blackboard> blackboard)
|
||||
|
||||
Task::TaskState TaskCleanStorage::doUpdate(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
std::shared_ptr<DialogView> dialogView = m_dialogView;
|
||||
m_storage->clearFileElements(m_filePaths, [=](int progress)
|
||||
{
|
||||
if (dialogView != nullptr)
|
||||
if (std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView())
|
||||
{
|
||||
dialogView->showProgressDialog("Clearing", std::to_string(m_filePaths.size()) + " Files", progress);
|
||||
}
|
||||
@@ -46,8 +48,10 @@ Task::TaskState TaskCleanStorage::doUpdate(std::shared_ptr<Blackboard> blackboar
|
||||
void TaskCleanStorage::doExit(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
blackboard->set("clear_time", utility::duration(m_start));
|
||||
|
||||
m_dialogView->hideProgressDialog();
|
||||
if (std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView())
|
||||
{
|
||||
dialogView->hideProgressDialog();
|
||||
}
|
||||
}
|
||||
|
||||
void TaskCleanStorage::doReset(std::shared_ptr<Blackboard> blackboard)
|
||||
|
||||
@@ -16,8 +16,7 @@ class TaskCleanStorage
|
||||
public:
|
||||
TaskCleanStorage(
|
||||
PersistentStorage* storage,
|
||||
const std::vector<FilePath>& filePaths,
|
||||
std::shared_ptr<DialogView> dialogView
|
||||
const std::vector<FilePath>& filePaths
|
||||
);
|
||||
|
||||
private:
|
||||
@@ -28,7 +27,6 @@ private:
|
||||
|
||||
PersistentStorage* m_storage;
|
||||
std::vector<FilePath> m_filePaths;
|
||||
std::shared_ptr<DialogView> m_dialogView;
|
||||
|
||||
TimePoint m_start;
|
||||
};
|
||||
|
||||
@@ -6,15 +6,14 @@
|
||||
#include "utility/messaging/type/MessageFinishedParsing.h"
|
||||
#include "utility/scheduling/Blackboard.h"
|
||||
#include "utility/utility.h"
|
||||
#include "Application.h"
|
||||
|
||||
TaskFinishParsing::TaskFinishParsing(
|
||||
PersistentStorage* storage,
|
||||
StorageAccess* storageAccess,
|
||||
std::shared_ptr<DialogView> dialogView
|
||||
StorageAccess* storageAccess
|
||||
)
|
||||
: m_storage(storage)
|
||||
, m_storageAccess(storageAccess)
|
||||
, m_dialogView(dialogView)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -31,21 +30,23 @@ Task::TaskState TaskFinishParsing::doUpdate(std::shared_ptr<Blackboard> blackboa
|
||||
{
|
||||
TimePoint start = utility::durationStart();
|
||||
|
||||
if (m_dialogView)
|
||||
std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView();
|
||||
|
||||
if (dialogView)
|
||||
{
|
||||
m_dialogView->showStatusDialog("Finish Indexing", "Optimizing database");
|
||||
dialogView->showStatusDialog("Finish Indexing", "Optimizing database");
|
||||
}
|
||||
m_storage->optimizeMemory();
|
||||
|
||||
if (m_dialogView)
|
||||
if (dialogView)
|
||||
{
|
||||
m_dialogView->showStatusDialog("Finish Indexing", "Building caches");
|
||||
dialogView->showStatusDialog("Finish Indexing", "Building caches");
|
||||
}
|
||||
m_storage->buildCaches();
|
||||
|
||||
if (m_dialogView)
|
||||
if (dialogView)
|
||||
{
|
||||
m_dialogView->hideStatusDialog();
|
||||
dialogView->hideStatusDialog();
|
||||
}
|
||||
MessageFinishedParsing().dispatch();
|
||||
|
||||
@@ -71,9 +72,9 @@ Task::TaskState TaskFinishParsing::doUpdate(std::shared_ptr<Blackboard> blackboa
|
||||
int sourceFileCount = 0;
|
||||
blackboard->get("source_file_count", sourceFileCount);
|
||||
|
||||
if (m_dialogView)
|
||||
if (dialogView)
|
||||
{
|
||||
m_dialogView->finishedIndexingDialog(
|
||||
dialogView->finishedIndexingDialog(
|
||||
indexedSourceFileCount,
|
||||
sourceFileCount,
|
||||
time,
|
||||
|
||||
@@ -17,8 +17,7 @@ class TaskFinishParsing
|
||||
public:
|
||||
TaskFinishParsing(
|
||||
PersistentStorage* storage,
|
||||
StorageAccess* storageAccess,
|
||||
std::shared_ptr<DialogView> dialogView
|
||||
StorageAccess* storageAccess
|
||||
);
|
||||
|
||||
virtual ~TaskFinishParsing();
|
||||
@@ -31,7 +30,6 @@ private:
|
||||
|
||||
PersistentStorage* m_storage;
|
||||
StorageAccess* m_storageAccess;
|
||||
std::shared_ptr<DialogView> m_dialogView;
|
||||
};
|
||||
|
||||
#endif // TASK_FINISH_PARSING_H
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
#include "data/TaskShowStatusDialog.h"
|
||||
|
||||
#include "component/view/DialogView.h"
|
||||
#include "Application.h"
|
||||
|
||||
TaskShowStatusDialog::TaskShowStatusDialog(
|
||||
const std::string& title,
|
||||
const std::string& message,
|
||||
std::shared_ptr<DialogView> dialogView
|
||||
const std::string& message
|
||||
)
|
||||
: m_title(title)
|
||||
, m_message(message)
|
||||
, m_dialogView(dialogView)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -23,9 +22,9 @@ void TaskShowStatusDialog::doEnter(std::shared_ptr<Blackboard> blackboard)
|
||||
|
||||
Task::TaskState TaskShowStatusDialog::doUpdate(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
if (m_dialogView)
|
||||
{
|
||||
m_dialogView->showStatusDialog(m_title, m_message);
|
||||
if (std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView())
|
||||
{
|
||||
dialogView->showStatusDialog(m_title, m_message);
|
||||
}
|
||||
return STATE_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@ class TaskShowStatusDialog
|
||||
public:
|
||||
TaskShowStatusDialog(
|
||||
const std::string& title,
|
||||
const std::string& message,
|
||||
std::shared_ptr<DialogView> dialogView
|
||||
const std::string& message
|
||||
);
|
||||
|
||||
virtual ~TaskShowStatusDialog();
|
||||
@@ -27,7 +26,6 @@ private:
|
||||
|
||||
const std::string m_title;
|
||||
const std::string m_message;
|
||||
std::shared_ptr<DialogView> m_dialogView;
|
||||
};
|
||||
|
||||
#endif // TASK_SHOW_STATUS_DIALOG_H
|
||||
|
||||
@@ -9,17 +9,16 @@
|
||||
#include "utility/file/FileRegisterStateData.h"
|
||||
#include "utility/scheduling/Blackboard.h"
|
||||
#include "ApplicationStateMonitor.h"
|
||||
#include "Application.h"
|
||||
|
||||
TaskBuildIndex::TaskBuildIndex(
|
||||
std::shared_ptr<IndexerCommandList> indexerCommandList,
|
||||
std::shared_ptr<StorageProvider> storageProvider,
|
||||
std::shared_ptr<FileRegisterStateData> fileRegisterStateData,
|
||||
std::shared_ptr<DialogView> dialogView
|
||||
std::shared_ptr<FileRegisterStateData> fileRegisterStateData
|
||||
)
|
||||
: m_indexerCommandList(indexerCommandList)
|
||||
, m_storageProvider(storageProvider)
|
||||
, m_fileRegisterStateData(fileRegisterStateData)
|
||||
, m_dialogView(dialogView)
|
||||
{
|
||||
m_indexer = IndexerFactory::getInstance()->createCompositeIndexerForAllRegisteredModules();
|
||||
}
|
||||
@@ -57,9 +56,9 @@ Task::TaskState TaskBuildIndex::doUpdate(std::shared_ptr<Blackboard> blackboard)
|
||||
int indexedSourceFileCount = 0;
|
||||
blackboard->get("indexed_source_file_count", indexedSourceFileCount);
|
||||
|
||||
if (m_dialogView)
|
||||
if (std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView())
|
||||
{
|
||||
m_dialogView->updateIndexingDialog(
|
||||
dialogView->updateIndexingDialog(
|
||||
indexedSourceFileCount, sourceFileCount, indexerCommand->getSourceFilePath().str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,7 @@ public:
|
||||
TaskBuildIndex(
|
||||
std::shared_ptr<IndexerCommandList> indexerCommandList,
|
||||
std::shared_ptr<StorageProvider> storageProvider,
|
||||
std::shared_ptr<FileRegisterStateData> fileRegisterStateData,
|
||||
std::shared_ptr<DialogView> dialogView
|
||||
std::shared_ptr<FileRegisterStateData> fileRegisterStateData
|
||||
);
|
||||
|
||||
protected:
|
||||
@@ -36,7 +35,6 @@ protected:
|
||||
std::shared_ptr<IndexerCommandList> m_indexerCommandList;
|
||||
std::shared_ptr<StorageProvider> m_storageProvider;
|
||||
std::shared_ptr<FileRegisterStateData> m_fileRegisterStateData;
|
||||
std::shared_ptr<DialogView> m_dialogView;
|
||||
|
||||
std::shared_ptr<IndexerBase> m_indexer;
|
||||
};
|
||||
|
||||
@@ -4,13 +4,10 @@
|
||||
#include "data/PersistentStorage.h"
|
||||
#include "utility/scheduling/Blackboard.h"
|
||||
#include "utility/utility.h"
|
||||
#include "Application.h"
|
||||
|
||||
TaskParseWrapper::TaskParseWrapper(
|
||||
PersistentStorage* storage,
|
||||
std::shared_ptr<DialogView> dialogView
|
||||
)
|
||||
TaskParseWrapper::TaskParseWrapper(PersistentStorage* storage)
|
||||
: m_storage(storage)
|
||||
, m_dialogView(dialogView)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -30,9 +27,9 @@ void TaskParseWrapper::doEnter(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
int sourceFileCount = 0;
|
||||
blackboard->get("source_file_count", sourceFileCount);
|
||||
if (m_dialogView)
|
||||
{
|
||||
m_dialogView->updateIndexingDialog(0, sourceFileCount, "");
|
||||
if (std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView())
|
||||
{
|
||||
dialogView->updateIndexingDialog(0, sourceFileCount, "");
|
||||
}
|
||||
|
||||
m_start = utility::durationStart();
|
||||
|
||||
@@ -18,10 +18,7 @@ class TaskParseWrapper
|
||||
: public TaskDecorator
|
||||
{
|
||||
public:
|
||||
TaskParseWrapper(
|
||||
PersistentStorage* storage,
|
||||
std::shared_ptr<DialogView> dialogView
|
||||
);
|
||||
TaskParseWrapper(PersistentStorage* storage);
|
||||
virtual ~TaskParseWrapper();
|
||||
|
||||
virtual void setTask(std::shared_ptr<Task> task);
|
||||
@@ -33,7 +30,6 @@ private:
|
||||
virtual void doReset(std::shared_ptr<Blackboard> blackboard);
|
||||
|
||||
PersistentStorage* m_storage;
|
||||
std::shared_ptr<DialogView> m_dialogView;
|
||||
|
||||
TimePoint m_start;
|
||||
std::shared_ptr<TaskRunner> m_taskRunner;
|
||||
|
||||
Reference in New Issue
Block a user