summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-10-08 12:48:46 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-08 06:26:03 -0700
commit218c0956e201524d5f91bebd3ee87930200a0974 (patch)
treebb21855225fc173c3d3fdf9a9da9adac8445829c /main.cpp
parentd0e9d1f383c64b83b9124f96d1ad67e994efe8f9 (diff)
downloadsubsurface-218c0956e201524d5f91bebd3ee87930200a0974.tar.gz
main.cpp: remove usage of subsurface_command_line_*
subsurface_command_line_* are now redundant as Qt should handle the command line argument parsing on Windows for which these functions where mainly used and where NOP for other OS. main.cpp also receives a couple of small changes to use: QCoreApplication::arguments() to obtain the list of expanded arguments and parse those instead. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/main.cpp b/main.cpp
index fddf508ec..c7d916c9c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -32,23 +32,23 @@ int main(int argc, char **argv)
setup_system_prefs();
prefs = default_prefs;
- subsurface_command_line_init(&argc, &argv);
init_ui(&argc, &argv);
parse_xml_init();
QStringList files;
QStringList importedFiles;
- for (i = 1; i < argc; i++) {
- const char *a = argv[i];
- if (a[0] == '-') {
- parse_argument(a);
+ QStringList arguments = QCoreApplication::arguments();
+ for (i = 1; i < arguments.length(); i++) {
+ QString a = arguments.at(i);
+ if (a.at(0) == '-') {
+ parse_argument(a.toLocal8Bit().data());
continue;
}
if (imported) {
- importedFiles.push_back( QString(a) );
+ importedFiles.push_back(a);
} else {
no_filenames = false;
- files.push_back( QString(a) );
+ files.push_back(a);
}
}
if (no_filenames) {
@@ -57,7 +57,6 @@ int main(int argc, char **argv)
files.push_back( QString(prefs.default_filename) );
}
parse_xml_exit();
- subsurface_command_line_exit(&argc, &argv);
mainWindow()->loadFiles(files);
mainWindow()->importFiles(importedFiles);
run_ui();