ui: Refactored QtCodeSnippet and added view settings to ApplicationSettings

This change refactors parts of the QtCodeSnippet and places some settings into ApplicationSettings.
Additionally Application- and ProjectSettings were abstracted to the common base class Settings, which takes care of the
getting and setting values of the Configmanager member.
This commit is contained in:
Eberhard Graether
2014-07-03 16:10:55 +02:00
parent 4ae6f4a04a
commit 042a508422
15 changed files with 254 additions and 125 deletions
-33
View File
@@ -33,39 +33,6 @@ void ComponentManager::setup()
std::shared_ptr<Component> codeComponent = m_componentFactory->createCodeComponent();
m_components.push_back(codeComponent);
CodeView* codeView = codeComponent->getView<CodeView>();
std::string code =
"class HelloWorld;\n"
"static int n = 42; // the answer.\n"
"\n"
"int sum(int a, int b)\n"
"{\n"
" return a + b;\n"
"}\n";
TokenLocationFile locationFile("test.cpp");
locationFile.addTokenLocation(1, 1, 7, 1, 16);
locationFile.addTokenLocation(2, 2, 8, 2, 10);
locationFile.addTokenLocation(3, 2, 12, 2, 12);
locationFile.addTokenLocation(4, 4, 1, 7, 1);
codeView->addCodeSnippet(code, locationFile, 1);
std::string code2 =
"const char* name = new char[10];\n"
"\n"
"name = \"MetaVizz\\0\";";
TokenLocationFile locationFile2("test.cpp");
locationFile2.addTokenLocation(5, 123, 1, 123, 11);
locationFile2.addTokenLocation(6, 123, 13, 123, 16);
locationFile2.addTokenLocation(7, 125, 1, 125, 4);
codeView->addCodeSnippet(code2, locationFile2, 123);
// codeView->clearCodeSnippets();
}
ComponentManager::ComponentManager()