aboutsummaryrefslogtreecommitdiff
path: root/lib/configuration
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-07-02 14:05:54 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-07-02 14:05:54 +0200
commitdbca8cdb2a3c8e65c814521ba98f50a582194a73 (patch)
treea4054bb9963a9015e45e95e8a054fe0116ffb8ae /lib/configuration
parentAdd --no-remote option (diff)
downloadsmolbote-dbca8cdb2a3c8e65c814521ba98f50a582194a73.tar.xz
Add configuration/defaults.h
Diffstat (limited to 'lib/configuration')
-rw-r--r--lib/configuration/CMakeLists.txt6
-rw-r--r--lib/configuration/configuration.cpp17
-rw-r--r--lib/configuration/defaults.h.linux10
-rw-r--r--lib/configuration/defaults.h.win3210
4 files changed, 35 insertions, 8 deletions
diff --git a/lib/configuration/CMakeLists.txt b/lib/configuration/CMakeLists.txt
index ed0235d..dc5bf6d 100644
--- a/lib/configuration/CMakeLists.txt
+++ b/lib/configuration/CMakeLists.txt
@@ -6,6 +6,12 @@ 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()
+
add_library(configuration
configuration.cpp
configuration.h)
diff --git a/lib/configuration/configuration.cpp b/lib/configuration/configuration.cpp
index c7209e3..cae21fd 100644
--- a/lib/configuration/configuration.cpp
+++ b/lib/configuration/configuration.cpp
@@ -12,6 +12,7 @@
#include <boost/algorithm/string/predicate.hpp>
#include <iostream>
#include <QCoreApplication>
+#include "defaults.h"
namespace po = boost::program_options;
@@ -90,28 +91,28 @@ Configuration::Configuration(QObject *parent)
("window.shortcuts.fullscreen", po::value<std::string>()->default_value("F11"))
// Filter settings
- ("filter.path", po::value<std::string>()->default_value("~/.config/smolbote/hosts.d"))
- ("filter.cookies.block.all", po::value<bool>()->default_value(false))
- ("filter.cookies.block.thirdParty", po::value<bool>()->default_value(true))
- ("filter.cookies.path", po::value<std::string>()->default_value("~/.config/smolbote/cookies.d"))
+ ("filter.path", po::value<std::string>()->default_value(filter_path))
+// ("filter.cookies.block.all", po::value<bool>()->default_value(false))
+// ("filter.cookies.block.thirdParty", po::value<bool>()->default_value(true))
+// ("filter.cookies.path", po::value<std::string>()->default_value("~/.config/smolbote/cookies.d"))
// Plugin settings
- ("plugins.path", po::value<std::string>()->default_value("~/.config/smolbote/plugins.d"))
+ ("plugins.path", po::value<std::string>()->default_value(plugins_path))
// 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("~/.config/smolbote/profiles.d"))
+ ("profile.path", po::value<std::string>()->default_value(profiles_path))
("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("~/.config/smolbote/bookmarks.xbel"))
+ ("bookmarks.path", po::value<std::string>()->default_value(bookmarks_path))
("bookmarks.shortcut", po::value<std::string>()->default_value("Ctrl+B"))
// Downloads settings
- ("downloads.path", po::value<std::string>()->default_value("~/Downloads"))
+ ("downloads.path", po::value<std::string>()->default_value(downloads_path))
("downloads.shortcut", po::value<std::string>()->default_value("Ctrl+D"))
;
}
diff --git a/lib/configuration/defaults.h.linux b/lib/configuration/defaults.h.linux
new file mode 100644
index 0000000..983e36b
--- /dev/null
+++ b/lib/configuration/defaults.h.linux
@@ -0,0 +1,10 @@
+#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
new file mode 100644
index 0000000..9a8d5b3
--- /dev/null
+++ b/lib/configuration/defaults.h.win32
@@ -0,0 +1,10 @@
+#ifndef SMOLBOTE_DEFAULTS
+#define SMOLBOTE_DEFAULTS
+
+#define filter_path "hosts"
+#define plugins_path "plugins"
+#define profiles_path "profiles"
+#define bookmarks_path "bookmarks.xbel"
+#define downloads_path "~/Downloads"
+
+#endif // SMOLBOTE_DEFAULTS