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
+1 -12
View File
@@ -4,15 +4,11 @@
#include <memory>
#include <vector>
#include <QFont>
#include "component/view/CodeView.h"
#include "qt/utility/QtThreadedFunctor.h"
#include "utility/types.h"
class QtCodeSnippet;
class QtHighlighter;
class QTextEdit;
class QtCodeView: public CodeView
{
@@ -31,17 +27,10 @@ public:
void activateToken(Id tokenId) const;
private:
struct Snippet
{
std::shared_ptr<QtCodeSnippet> textField;
std::shared_ptr<QtHighlighter> highlighter;
};
std::vector<std::shared_ptr<Snippet>> m_snippets;
void doAddCodeSnippet(const std::string& str, const TokenLocationFile& locationFile, int startLineNumber);
void doClearCodeSnippets();
QFont m_font;
std::vector<std::shared_ptr<QtCodeSnippet> > m_snippets;
QtThreadedFunctor<void> m_clearCodeSnippetsFunctor;
QtThreadedFunctor<const std::string&, const TokenLocationFile&, int> m_addCodeSnippetFunctor;