From 2c20acb1981fc8fbd884dbece2a1115ca37732d2 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 19 Sep 2018 23:35:43 +0200 Subject: Update documentation --- lib/configuration/CMakeLists.txt | 6 +----- lib/configuration/configuration.cpp | 14 +++++++------- lib/configuration/defaults.h.in | 13 +++++++++++++ lib/configuration/defaults.h.linux | 10 ---------- lib/configuration/defaults.h.win32 | 12 ------------ 5 files changed, 21 insertions(+), 34 deletions(-) create mode 100644 lib/configuration/defaults.h.in delete mode 100644 lib/configuration/defaults.h.linux delete mode 100644 lib/configuration/defaults.h.win32 (limited to 'lib/configuration') diff --git a/lib/configuration/CMakeLists.txt b/lib/configuration/CMakeLists.txt index dc5bf6d..581e1eb 100644 --- a/lib/configuration/CMakeLists.txt +++ b/lib/configuration/CMakeLists.txt @@ -6,11 +6,7 @@ set(CMAKE_AUTOMOC ON) #set(CMAKE_AUTOUIC ON) #set(CMAKE_AUTORCC ON) -if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - configure_file(defaults.h.win32 ${PROJECT_BINARY_DIR}/lib/configuration/defaults.h) -else() - configure_file(defaults.h.linux ${PROJECT_BINARY_DIR}/lib/configuration/defaults.h) -endif() +configure_file(defaults.h.in ${PROJECT_BINARY_DIR}/lib/configuration/defaults.h) add_library(configuration configuration.cpp diff --git a/lib/configuration/configuration.cpp b/lib/configuration/configuration.cpp index 9931ec5..a61247b 100644 --- a/lib/configuration/configuration.cpp +++ b/lib/configuration/configuration.cpp @@ -18,8 +18,8 @@ namespace po = boost::program_options; inline std::string defaultUserConfigLocation() { -#ifdef config_path - return config_path; +#ifdef ConfigPath + return ConfigPath; #else // try to locate an existing config QString path = QStandardPaths::locate(QStandardPaths::ConfigLocation, "smolbote/smolbote.cfg"); @@ -96,7 +96,7 @@ Configuration::Configuration(QObject *parent) ("subwindow.shortcuts.fullscreen", po::value()->default_value("F11")) // Filter settings - ("filter.path", po::value()->default_value(filter_path)) + ("filter.path", po::value()->default_value(FilterPath)) ("filter.adblock", po::value()) ("filter.header", po::value>()) // ("filter.cookies.block.all", po::value()->default_value(false)) @@ -104,22 +104,22 @@ Configuration::Configuration(QObject *parent) // ("filter.cookies.path", po::value()->default_value("~/.config/smolbote/cookies.d")) // Plugin settings - ("plugins.path", po::value()->default_value(plugins_path)) + ("plugins.path", po::value()->default_value(PluginsPath)) // Profile settings // default profile name the browser should use; "" is off-the-record ("profile.default", po::value()->default_value("")) - ("profile.path", po::value()->default_value(profiles_path)) + ("profile.path", po::value()->default_value(ProfilesPath)) ("profile.search", po::value()->default_value("https://duckduckgo.com/?q=%1&ia=web")) ("profile.homepage", po::value()->default_value("about:blank")) ("profile.newtab", po::value()->default_value("about:blank")) // Bookmark settings - ("bookmarks.path", po::value()->default_value(bookmarks_path)) + ("bookmarks.path", po::value()->default_value(BookmarksPath)) ("bookmarks.shortcut", po::value()->default_value("Ctrl+B")) // Downloads settings - ("downloads.path", po::value()->default_value(downloads_path)) + ("downloads.path", po::value()->default_value(DownloadsPath)) ("downloads.shortcut", po::value()->default_value("Ctrl+D")) ; } diff --git a/lib/configuration/defaults.h.in b/lib/configuration/defaults.h.in new file mode 100644 index 0000000..8c4b334 --- /dev/null +++ b/lib/configuration/defaults.h.in @@ -0,0 +1,13 @@ +#ifndef SMOLBOTE_DEFAULTS +#define SMOLBOTE_DEFAULTS + +#cmakedefine ConfigPath "@ConfigPath@" + +#cmakedefine FilterPath "@FilterPath@" +#cmakedefine PluginsPath "@PluginsPath@" +#cmakedefine ProfilesPath "@ProfilesPath@" + +#cmakedefine BookmarksPath "@BookmarksPath@" +#cmakedefine DownloadsPath "@DownloadsPath@" + +#endif // SMOLBOTE_DEFAULTS diff --git a/lib/configuration/defaults.h.linux b/lib/configuration/defaults.h.linux deleted file mode 100644 index 983e36b..0000000 --- a/lib/configuration/defaults.h.linux +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef SMOLBOTE_DEFAULTS -#define SMOLBOTE_DEFAULTS - -#define filter_path "~/.config/smolbote/hosts.d" -#define plugins_path "~/.config/smolbote/plugins.d" -#define profiles_path "~/.config/smolbote/profiles.d" -#define bookmarks_path "~/.config/smolbote/bookmarks.xbel" -#define downloads_path "~/Downloads" - -#endif // SMOLBOTE_DEFAULTS diff --git a/lib/configuration/defaults.h.win32 b/lib/configuration/defaults.h.win32 deleted file mode 100644 index dee9b14..0000000 --- a/lib/configuration/defaults.h.win32 +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef SMOLBOTE_DEFAULTS -#define SMOLBOTE_DEFAULTS - -#define config_path "smolbote.ini" - -#define filter_path "hosts" -#define plugins_path "plugins" -#define profiles_path "profiles" -#define bookmarks_path "bookmarks.xbel" -#define downloads_path "~/Downloads" - -#endif // SMOLBOTE_DEFAULTS -- cgit v1.2.1