aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 960c11c..789a3e6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -18,11 +18,25 @@
**
******************************************************************************/
+#include <iostream>
#include "browser.h"
#include "mainwindow.h"
#include <QApplication>
#include <QCommandLineParser>
+/**
+ * @brief printPoiToml Print the built-in config (if any)
+ * @param output std::ostream to print to
+ */
+void printPoiToml(std::ostream &output)
+{
+ QFile conf(":/poi.toml");
+ if(conf.open(QIODevice::ReadOnly)) {
+ output << conf.readAll().toStdString() << std::endl;
+ conf.close();
+ }
+}
+
int main(int argc, char *argv[])
{
//
@@ -40,7 +54,7 @@ int main(int argc, char *argv[])
QCommandLineOption configOption(QStringList() << "c" << "config", "Set configuration file.", "PATH");
parser.addOption(configOption);
- QCommandLineOption defaultConfigOption(QStringList() << "default-config", "Print default configuration");
+ QCommandLineOption defaultConfigOption(QStringList() << "default-config", "Print default configuration.");
parser.addOption(defaultConfigOption);
QCommandLineOption profileOption(QStringList() << "p" << "profile", "Use this profile.", "PROFILE");
@@ -62,6 +76,11 @@ int main(int argc, char *argv[])
parser.process(app);
+ if(parser.isSet(defaultConfigOption)) {
+ printPoiToml(std::cout);
+ return 0;
+ }
+
app.setWindowIcon(QIcon(QLatin1String(":/icon.svg")));
// This lets the web view automatically scale on high-dpi displays.
app.setAttribute(Qt::AA_EnableHighDpiScaling);