From 949b25b738f9be1504270033078a07c8e4af66bb Mon Sep 17 00:00:00 2001 From: cazfi Date: Fri, 12 Aug 2016 12:13:10 +0000 Subject: [PATCH] Merged ruledit_qt_setup(), ruledit_qt_run(), and ruledit_qt_close() See patch #7591 git-svn-id: svn://svn.gna.org/svn/freeciv/branches/S2_6@33574 a0f10bec-cc02-0410-94fc-a9cfff90b4cd --- tools/ruledit/ruledit.cpp | 4 +--- tools/ruledit/ruledit_qt.cpp | 23 ++++++----------------- tools/ruledit/ruledit_qt.h | 6 ++---- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/tools/ruledit/ruledit.cpp b/tools/ruledit/ruledit.cpp index 4129e42a5f..e2d32f4ccd 100644 --- a/tools/ruledit/ruledit.cpp +++ b/tools/ruledit/ruledit.cpp @@ -99,9 +99,7 @@ int main(int argc, char **argv) game_init(); i_am_server(); - ruledit_qt_setup(ui_options, argv); - ruledit_qt_run(); - ruledit_qt_close(); + ruledit_qt_run(ui_options, argv); } registry_module_close(); diff --git a/tools/ruledit/ruledit_qt.cpp b/tools/ruledit/ruledit_qt.cpp index 98b14f51b0..a82b8df93c 100644 --- a/tools/ruledit/ruledit_qt.cpp +++ b/tools/ruledit/ruledit_qt.cpp @@ -53,12 +53,13 @@ static ruledit_gui *gui; static QApplication *qapp; /************************************************************************** - Setup ruledit-qt gui. + Run ruledit-qt gui. **************************************************************************/ -bool ruledit_qt_setup(int argc, char **argv) +int ruledit_qt_run(int argc, char **argv) { ruledit_main *main_window; QWidget *central; + int ret; qapp = new QApplication(argc, argv); central = new QWidget; @@ -69,24 +70,12 @@ bool ruledit_qt_setup(int argc, char **argv) main_window->setCentralWidget(central); main_window->setVisible(true); - return true; -} + ret = qapp->exec(); -/************************************************************************** - Execute ruledit-qt gui. -**************************************************************************/ -int ruledit_qt_run() -{ - return qapp->exec(); -} - -/************************************************************************** - Close ruledit-qt gui. -**************************************************************************/ -void ruledit_qt_close() -{ delete gui; delete qapp; + + return ret; } /************************************************************************** diff --git a/tools/ruledit/ruledit_qt.h b/tools/ruledit/ruledit_qt.h index a490f0696b..a097696226 100644 --- a/tools/ruledit/ruledit_qt.h +++ b/tools/ruledit/ruledit_qt.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -82,9 +82,7 @@ class ruledit_gui : public QObject void launch_now(); }; -bool ruledit_qt_setup(int argc, char **argv); -int ruledit_qt_run(); -void ruledit_qt_close(); +int ruledit_qt_run(int argc, char **argv); void ruledit_qt_display_requirers(const char *msg); #endif // FC__RULEDIT_QT_H -- 2.11.4.GIT