aboutsummaryrefslogtreecommitdiff
path: root/lib/configuration
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-09-19 23:35:43 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-09-19 23:35:43 +0200
commit2c20acb1981fc8fbd884dbece2a1115ca37732d2 (patch)
treecafd753960b509f1c572448aaf7591a4ddb2dce8 /lib/configuration
parentclang-format pass (diff)
downloadsmolbote-2c20acb1981fc8fbd884dbece2a1115ca37732d2.tar.xz
Update documentation
Diffstat (limited to 'lib/configuration')
-rw-r--r--lib/configuration/CMakeLists.txt6
-rw-r--r--lib/configuration/configuration.cpp14
-rw-r--r--lib/configuration/defaults.h.in13
-rw-r--r--lib/configuration/defaults.h.linux10
-rw-r--r--lib/configuration/defaults.h.win3212
5 files changed, 21 insertions, 34 deletions
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<std::string>()->default_value("F11"))
// Filter settings
- ("filter.path", po::value<std::string>()->default_value(filter_path))
+ ("filter.path", po::value<std::string>()->default_value(FilterPath))
("filter.adblock", po::value<std::string>())
("filter.header", po::value<std::vector<std::string>>())
// ("filter.cookies.block.all", po::value<bool>()->default_value(false))
@@ -104,22 +104,22 @@ Configuration::Configuration(QObject *parent)
// ("filter.cookies.path", po::value<std::string>()->default_value("~/.config/smolbote/cookies.d"))
// Plugin settings
- ("plugins.path", po::value<std::string>()->default_value(plugins_path))
+ ("plugins.path", po::value<std::string>()->default_value(PluginsPath))
// Profile settings
// default profile name the browser should use; "" is off-the-record
("profile.default", po::value<std::string>()->default_value(""))
- ("profile.path", po::value<std::string>()->default_value(profiles_path))
+ ("profile.path", po::value<std::string>()->default_value(ProfilesPath))
("profile.search", po::value<std::string>()->default_value("https://duckduckgo.com/?q=%1&ia=web"))
("profile.homepage", po::value<std::string>()->default_value("about:blank"))
("profile.newtab", po::value<std::string>()->default_value("about:blank"))
// Bookmark settings
- ("bookmarks.path", po::value<std::string>()->default_value(bookmarks_path))
+ ("bookmarks.path", po::value<std::string>()->default_value(BookmarksPath))
("bookmarks.shortcut", po::value<std::string>()->default_value("Ctrl+B"))
// Downloads settings
- ("downloads.path", po::value<std::string>()->default_value(downloads_path))
+ ("downloads.path", po::value<std::string>()->default_value(DownloadsPath))
("downloads.shortcut", po::value<std::string>()->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