diff options
-rw-r--r-- | src/gui/main-window.cc | 3 | ||||
-rw-r--r-- | src/gui/main-window.h | 2 | ||||
-rw-r--r-- | src/gui/main.cc | 8 | ||||
-rw-r--r-- | src/gui/server.cc | 10 | ||||
-rw-r--r-- | src/gui/server.h | 2 |
5 files changed, 15 insertions, 10 deletions
diff --git a/src/gui/main-window.cc b/src/gui/main-window.cc index 79bb2b26..c58c86e5 100644 --- a/src/gui/main-window.cc +++ b/src/gui/main-window.cc @@ -38,7 +38,8 @@ #include "main-window.h" namespace OpenAxiom { - MainWindow::MainWindow(Command& cmd) : srv(cmd), tabs(this) { + MainWindow::MainWindow(int argc, char* argv[]) + : srv(argc, argv), tabs(this) { setCentralWidget(&tabs); setWindowTitle("OpenAxiom"); Debate* debate = new Debate(this, &tabs); diff --git a/src/gui/main-window.h b/src/gui/main-window.h index c16c4136..eb6e6988 100644 --- a/src/gui/main-window.h +++ b/src/gui/main-window.h @@ -42,7 +42,7 @@ namespace OpenAxiom { class MainWindow : public QMainWindow { Q_OBJECT; public: - MainWindow(Command&); + MainWindow(int, char*[]); ~MainWindow(); Server* server() { return &srv; } diff --git a/src/gui/main.cc b/src/gui/main.cc index c806889a..e6db3db6 100644 --- a/src/gui/main.cc +++ b/src/gui/main.cc @@ -30,20 +30,16 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <QApplication> +#include <QMessageBox> #include "main-window.h" int main(int argc, char* argv[]) { using namespace OpenAxiom; QApplication app(argc, argv); - Command command; - // The toplevel driver may be have called us with the - // path to the gui interface (argv[0]) and the full name - // of the toplevel driver itself (argv[1].) Skip. - preprocess_arguments(&command, argc - 1, argv + 1); QApplication::setApplicationName("OpenAxiom"); QApplication::setOrganizationDomain("www.open-axiom.org"); - MainWindow main_win(command); + MainWindow main_win(argc, argv); main_win.show(); return app.exec(); } diff --git a/src/gui/server.cc b/src/gui/server.cc index 601599e9..32f7ade7 100644 --- a/src/gui/server.cc +++ b/src/gui/server.cc @@ -33,7 +33,15 @@ #include "server.h" namespace OpenAxiom { - Server::Server(const Command& c) : cmd(c), fs(c.root_dir) { + static Command + process_arguments(int argc, char* argv[]) { + Command cmd; + preprocess_arguments(&cmd, argc, argv); + return cmd; + } + + Server::Server(int argc, char* argv[]) + : cmd(process_arguments(argc, argv)), fs(cmd.root_dir) { } Server::~Server() { diff --git a/src/gui/server.h b/src/gui/server.h index e67b5291..8cf1f227 100644 --- a/src/gui/server.h +++ b/src/gui/server.h @@ -38,7 +38,7 @@ namespace OpenAxiom { struct Server : QProcess { - explicit Server(const Command&); + Server(int, char*[]); ~Server(); const Filesystem& system_root() const { return fs; } |