summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 6bd0897..2213913 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -40,8 +40,8 @@ int main(int argc, char** argv)
QCommandLineOption fullscreen("fullscreen", "Run browser in full screen.");
QCommandLineOption maximized("maximized", "Maximize window on startup");
QCommandLineOption reloadInterval("reload-interval", "Reload displayed page every X seconds.", "seconds");
- QCommandLineOption whitelist("whitelist", "Path to a file of allowed URLs. Mutually exclusive with blacklist.", "file");
- QCommandLineOption blacklist("blacklist", "Path to a file of disallowed URLs. Mutually exclusive with whitelist.", "file");
+ QCommandLineOption whitelist("whitelist", "Path to a file of allowed URLs.", "file");
+ QCommandLineOption blacklist("blacklist", "Path to a file of disallowed URLs.", "file");
parser.addOption(ignoreSsl);
parser.addOption(fullscreen);
parser.addOption(maximized);
@@ -54,10 +54,6 @@ int main(int argc, char** argv)
QMessageBox::critical(nullptr, "Error", "Need one argument: file name");
return 1;
}
- if (parser.isSet(whitelist) && parser.isSet(blacklist)) {
- QMessageBox::critical(nullptr, "Error", "Need either blacklist or whitelist, not both");
- return 2;
- }
BrowserSettings settings;
settings.url = list[0];
settings.fullscreen = parser.isSet(fullscreen);
@@ -65,11 +61,11 @@ int main(int argc, char** argv)
settings.ignoreSslErrors = parser.isSet(ignoreSsl);
settings.reloadInterval = parser.value(reloadInterval).toInt();
if (parser.isSet(whitelist)) {
- settings.urlList = loadUrlList(parser.value(whitelist));
- } else if (parser.isSet(blacklist)) {
- settings.urlList = loadUrlList(parser.value(blacklist));
+ settings.whiteList = loadUrlList(parser.value(whitelist));
+ }
+ if (parser.isSet(blacklist)) {
+ settings.blackList = loadUrlList(parser.value(blacklist));
}
- settings.isWhitelist = parser.isSet(whitelist);
SlxBrowser main(settings);
main.show();
app.installEventFilter(new KeyHandler(&main));