aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--config/CMakeLists.txt11
-rw-r--r--config/settingsdialog.cpp3
-rw-r--r--config/settingsdialog.h8
-rw-r--r--lib/configuration/CMakeLists.txt8
-rw-r--r--lib/configuration/configuration.cpp (renamed from src/configuration.cpp)0
-rw-r--r--lib/configuration/configuration.h (renamed from src/configuration.h)6
-rw-r--r--lib/settings/CMakeLists.txt12
-rw-r--r--src/CMakeLists.txt7
9 files changed, 29 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c0ab789..a7cd876 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,6 +37,7 @@ endif (UseLibCpp)
add_subdirectory(lib/bookmarks)
add_subdirectory(lib/downloads)
+add_subdirectory(lib/configuration)
add_subdirectory(plugins/ProfileEditor)
diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt
index cde4648..9ae0381 100644
--- a/config/CMakeLists.txt
+++ b/config/CMakeLists.txt
@@ -10,12 +10,15 @@ add_executable(poi-config
main.cpp
settingsdialog.cpp
settingsdialog.h
- ../src/configuration.h
- ../src/configuration.cpp
- )
+)
+
+target_include_directories(poi-config
+ PRIVATE ../lib/configuration
+)
target_link_libraries(poi-config
Qt5::Core Qt5::Widgets
- ${Boost_LIBRARIES})
+ configuration
+)
install(TARGETS poi-config RUNTIME DESTINATION bin CONFIGURATIONS Release)
diff --git a/config/settingsdialog.cpp b/config/settingsdialog.cpp
index 56acc01..ef21a47 100644
--- a/config/settingsdialog.cpp
+++ b/config/settingsdialog.cpp
@@ -24,6 +24,7 @@ SettingsDialog::SettingsDialog(QWidget *parent)
setCentralWidget(&treeWidget);
treeWidget.setColumnCount(2);
+ treeWidget.setHeaderLabels({ tr("setting"), tr("value") });
//config.read()
@@ -32,6 +33,8 @@ SettingsDialog::SettingsDialog(QWidget *parent)
item->setText(0, QString::fromStdString(option->long_name()));
item->setText(1, QString::fromStdString(config.value<std::string>(option->long_name().c_str()).value_or(std::string())));
}
+
+ treeWidget.resizeColumnToContents(0);
}
SettingsDialog::~SettingsDialog() = default;
diff --git a/config/settingsdialog.h b/config/settingsdialog.h
index 82cd1be..dc3cc08 100644
--- a/config/settingsdialog.h
+++ b/config/settingsdialog.h
@@ -6,13 +6,13 @@
* SPDX-License-Identifier: GPL-3.0
*/
-#ifndef SETTINGSDIALOG_H
-#define SETTINGSDIALOG_H
+#ifndef SMOLBOTE_SETTINGSDIALOG_H
+#define SMOLBOTE_SETTINGSDIALOG_H
-#include "../src/configuration.h"
#include <QMainWindow>
#include <QMenu>
#include <QTreeWidget>
+#include <configuration.h>
class SettingsDialog : public QMainWindow
{
@@ -28,4 +28,4 @@ private:
Configuration config;
};
-#endif // SETTINGSDIALOG_H
+#endif // SMOLBOTE_SETTINGSDIALOG_H
diff --git a/lib/configuration/CMakeLists.txt b/lib/configuration/CMakeLists.txt
new file mode 100644
index 0000000..f68a5b1
--- /dev/null
+++ b/lib/configuration/CMakeLists.txt
@@ -0,0 +1,8 @@
+add_library(configuration
+ configuration.cpp
+ configuration.h)
+
+target_link_libraries(configuration
+ Qt5::Core
+ ${Boost_LIBRARIES}
+)
diff --git a/src/configuration.cpp b/lib/configuration/configuration.cpp
index c114155..c114155 100644
--- a/src/configuration.cpp
+++ b/lib/configuration/configuration.cpp
diff --git a/src/configuration.h b/lib/configuration/configuration.h
index 5038a4d..4d58a90 100644
--- a/src/configuration.h
+++ b/lib/configuration/configuration.h
@@ -6,8 +6,8 @@
* SPDX-License-Identifier: GPL-3.0
*/
-#ifndef CONFIGURATION_H
-#define CONFIGURATION_H
+#ifndef SMOLBOTE_CONFIGURATION_H
+#define SMOLBOTE_CONFIGURATION_H
#include <optional>
#include <string>
@@ -73,4 +73,4 @@ private:
std::string m_homePath;
};
-#endif // CONFIGURATION_H
+#endif // SMOLBOTE_CONFIGURATION_H
diff --git a/lib/settings/CMakeLists.txt b/lib/settings/CMakeLists.txt
deleted file mode 100644
index 20c78ae..0000000
--- a/lib/settings/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-cmake_minimum_required(VERSION 3.1.0)
-
-add_library(configuration
- settingsdialog.cpp
- settingsdialog.h
- settingsdialog.ui)
-
-if (CLikeConfig)
- target_compile_definitions(configuration PRIVATE C_LIKE_CONFIG)
-endif (CLikeConfig)
-
-target_link_libraries(configuration config++ Qt5::Widgets)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d2febde..f017d6b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,8 +21,6 @@ add_executable(poi
singleapplication.h
browser.cpp
browser.h
- configuration.cpp
- configuration.h
../data/resources.qrc
# main window
@@ -74,11 +72,12 @@ add_executable(poi
../plugins/interfaces.h commandline.cpp commandline.h)
target_include_directories(poi
- PRIVATE ../lib ../plugins)
+ PRIVATE ../lib ../plugins
+ PRIVATE ../lib/configuration)
target_link_libraries(poi
Qt5::Core Qt5::Widgets Qt5::Concurrent Qt5::WebEngineWidgets
- ${Boost_LIBRARIES}
+ configuration
bookmarks downloads)
install(TARGETS poi RUNTIME DESTINATION bin CONFIGURATIONS Release)