* TaskBuildIndex starts seperate indexer processes and communicates via shared memory * indexer processes get restarted if they fail * indexer processes are killed when the app closes or crashes * added utility class SharedMemory to allocate and access shared memory, providing basic data structures * added SharedMemoryGarbageCollector for keeping track of running instances and cleaning up shared memory in case of a crash * show errors for source files that crashed during indexing * added basic exception handling to task scheduling * added option to turn off processes and use threads in preferences, but still use shared memory fortune cookie message = Good news from someone dear is coming soon.
142 lines
3.6 KiB
C++
142 lines
3.6 KiB
C++
#ifndef APPLICATION_SETTINGS_H
|
|
#define APPLICATION_SETTINGS_H
|
|
|
|
#include <memory>
|
|
|
|
#include "settings/Settings.h"
|
|
|
|
class ApplicationSettings
|
|
: public Settings
|
|
{
|
|
public:
|
|
static std::shared_ptr<ApplicationSettings> getInstance();
|
|
|
|
static const size_t VERSION;
|
|
|
|
ApplicationSettings();
|
|
~ApplicationSettings();
|
|
|
|
bool load(const FilePath& filePath);
|
|
|
|
bool operator==(const ApplicationSettings& other) const;
|
|
|
|
int getMaxRecentProjectsCount() const;
|
|
|
|
// application
|
|
std::string getFontName() const;
|
|
void setFontName(const std::string& fontName);
|
|
|
|
int getFontSize() const;
|
|
void setFontSize(int fontSize);
|
|
|
|
FilePath getColorSchemePath() const;
|
|
void setColorSchemePath(const FilePath& colorSchemePath);
|
|
|
|
int getFontSizeMax() const;
|
|
void setFontSizeMax(const int fontSizeMax);
|
|
|
|
int getFontSizeMin() const;
|
|
void setFontSizeMin(const int fontSizeMin);
|
|
|
|
int getFontSizeStd() const;
|
|
void setFontSizeStd(const int fontSizeStd);
|
|
|
|
bool getUseAnimations() const;
|
|
void setUseAnimations(bool useAnimations);
|
|
|
|
int getWindowBaseWidth() const;
|
|
int getWindowBaseHeight() const;
|
|
|
|
float getScrollSpeed() const;
|
|
void setScrollSpeed(float scrollSpeed);
|
|
|
|
bool getGraphControlsVisible() const;
|
|
void setGraphControlsVisible(bool visible);
|
|
|
|
// logging
|
|
bool getLoggingEnabled() const;
|
|
void setLoggingEnabled(bool loggingEnabled);
|
|
|
|
bool getVerboseIndexerLoggingEnabled() const;
|
|
void setVerboseIndexerLoggingEnabled(bool loggingEnabled);
|
|
|
|
int getLogFilter() const;
|
|
void setLogFilter(int mask);
|
|
|
|
int getStatusFilter() const;
|
|
void setStatusFilter(int mask);
|
|
|
|
std::vector<FilePath> getIndexingFilePaths() const;
|
|
bool setIndexingFilePaths(const std::vector<FilePath>& indexingFiles);
|
|
|
|
// indexing
|
|
int getIndexerThreadCount() const;
|
|
void setIndexerThreadCount(const int count);
|
|
|
|
bool getMultiProcessIndexingEnabled() const;
|
|
void setMultiProcessIndexingEnabled(bool enabled);
|
|
|
|
std::string getJavaPath() const;
|
|
void setJavaPath(const std::string path);
|
|
|
|
int getJavaMaximumMemory() const;
|
|
void setJavaMaximumMemory(int size);
|
|
|
|
FilePath getMavenPath() const;
|
|
void setMavenPath(const FilePath& path);
|
|
|
|
std::vector<FilePath> getHeaderSearchPaths() const;
|
|
std::vector<FilePath> getHeaderSearchPathsExpanded() const;
|
|
bool setHeaderSearchPaths(const std::vector<FilePath>& headerSearchPaths);
|
|
|
|
std::vector<FilePath> getFrameworkSearchPaths() const;
|
|
std::vector<FilePath> getFrameworkSearchPathsExpanded() const;
|
|
bool setFrameworkSearchPaths(const std::vector<FilePath>& frameworkSearchPaths);
|
|
|
|
// code
|
|
int getCodeTabWidth() const;
|
|
void setCodeTabWidth(int codeTabWidth);
|
|
|
|
int getCodeSnippetSnapRange() const;
|
|
void setCodeSnippetSnapRange(int range);
|
|
|
|
int getCodeSnippetExpandRange() const;
|
|
void setCodeSnippetExpandRange(int range);
|
|
|
|
bool getCodeViewModeSingle() const;
|
|
void setCodeViewModeSingle(bool enabled);
|
|
|
|
// user
|
|
std::vector<FilePath> getRecentProjects() const;
|
|
bool setRecentProjects(const std::vector<FilePath>& recentProjects);
|
|
|
|
// network
|
|
int getPluginPort() const;
|
|
void setPluginPort(const int pluginPort);
|
|
|
|
int getSourcetrailPort() const;
|
|
void setSourcetrailPort(const int sourcetrailPort);
|
|
|
|
// controls
|
|
int getControlsMouseBackButton() const;
|
|
int getControlsMouseForwardButton() const;
|
|
|
|
bool getControlsGraphZoomOnMouseWheel() const;
|
|
void setControlsGraphZoomOnMouseWheel(bool zoomingDefault);
|
|
|
|
// license
|
|
std::string getLicenseString() const;
|
|
void setLicenseString(const std::string& licenseString);
|
|
|
|
std::string getLicenseCheck() const;
|
|
void setLicenseCheck(const std::string& hash);
|
|
|
|
private:
|
|
ApplicationSettings(const ApplicationSettings&);
|
|
void operator=(const ApplicationSettings&);
|
|
|
|
static std::shared_ptr<ApplicationSettings> s_instance;
|
|
};
|
|
|
|
#endif // APPLICATION_SETTINGS_H
|