[PATCH] Move the qtTranslator and ssrfTranslator pointers to qt-init.cpp

Thiago Macieira thiago at macieira.org
Sun May 1 21:27:35 PDT 2016


No point in having it defined in each main program's .cpp. Especially
since the unit tests don't define them.

Signed-off-by: Thiago Macieira <thiago at macieira.org>
---
 core/qt-init.cpp            | 1 +
 export-html.cpp             | 3 +--
 subsurface-desktop-main.cpp | 2 --
 subsurface-mobile-main.cpp  | 2 --
 4 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/core/qt-init.cpp b/core/qt-init.cpp
index 5dc25f9..3dffc6f 100644
--- a/core/qt-init.cpp
+++ b/core/qt-init.cpp
@@ -5,6 +5,7 @@
 #include "helpers.h"
 
 char *settings_suffix = NULL;
+QTranslator *qtTranslator, *ssrfTranslator;
 
 void init_qt_late()
 {
diff --git a/export-html.cpp b/export-html.cpp
index 0c270c6..e030cb6 100644
--- a/export-html.cpp
+++ b/export-html.cpp
@@ -5,6 +5,7 @@
 #include <QDebug>
 
 #include "qt-gui.h"
+#include "qthelper.h"
 #include "dive.h"
 #include "save-html.h"
 #include "stdio.h"
@@ -14,8 +15,6 @@
 #include "windowtitleupdate.h"
 #include "statistics.h"
 
-QTranslator *qtTranslator, *ssrfTranslator;
-
 int main(int argc, char **argv)
 {
 	QApplication *application = new QApplication(argc, argv);
diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp
index 0bdad42..165d1f7 100644
--- a/subsurface-desktop-main.cpp
+++ b/subsurface-desktop-main.cpp
@@ -21,8 +21,6 @@
 #include <QLoggingCategory>
 #include <git2.h>
 
-QTranslator *qtTranslator, *ssrfTranslator;
-
 static bool filesOnCommandLine = false;
 
 int main(int argc, char **argv)
diff --git a/subsurface-mobile-main.cpp b/subsurface-mobile-main.cpp
index b7259c4..f32f11e 100644
--- a/subsurface-mobile-main.cpp
+++ b/subsurface-mobile-main.cpp
@@ -17,8 +17,6 @@
 #include <QLoggingCategory>
 #include <git2.h>
 
-QTranslator *qtTranslator, *ssrfTranslator;
-
 int main(int argc, char **argv)
 {
 	int i;
-- 
2.8.1



More information about the subsurface mailing list