Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
728f008b
Commit
728f008b
authored
Sep 07, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding code to actually load localization strings.
parent
64c930d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
10 deletions
+25
-10
QGCApplication.cc
src/QGCApplication.cc
+23
-10
QGCApplication.h
src/QGCApplication.h
+2
-0
No files found.
src/QGCApplication.cc
View file @
728f008b
...
...
@@ -114,7 +114,7 @@
#include "QGCMapEngine.h"
QGCApplication
*
QGCApplication
::
_app
=
NULL
;
QGCApplication
*
QGCApplication
::
_app
=
nullptr
;
const
char
*
QGCApplication
::
_deleteAllSettingsKey
=
"DeleteAllSettingsNextBoot"
;
const
char
*
QGCApplication
::
_settingsVersionKey
=
"SettingsVersion"
;
...
...
@@ -150,7 +150,7 @@ static QObject* kmlFileHelperSingletonFactory(QQmlEngine*, QJSEngine*)
QGCApplication
::
QGCApplication
(
int
&
argc
,
char
*
argv
[],
bool
unitTesting
)
#ifdef __mobile__
:
QGuiApplication
(
argc
,
argv
)
,
_qmlAppEngine
(
NULL
)
,
_qmlAppEngine
(
nullptr
)
#else
:
QApplication
(
argc
,
argv
)
#endif
...
...
@@ -161,11 +161,24 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
#ifdef QT_DEBUG
,
_testHighDPI
(
false
)
#endif
,
_toolbox
(
NULL
)
,
_toolbox
(
nullptr
)
,
_bluetoothAvailable
(
false
)
{
_app
=
this
;
QLocale
locale
=
QLocale
::
system
();
//-- Some forced locales for testing
//QLocale locale = QLocale(QLocale::German);
//QLocale locale = QLocale(QLocale::French);
//QLocale locale = QLocale(QLocale::Chinese);
#if defined (__macos__)
locale
=
QLocale
(
locale
.
name
());
#endif
//-- Our localization
if
(
_QGCTranslator
.
load
(
locale
,
"qgc_"
,
""
,
":/localization"
))
_app
->
installTranslator
(
&
_QGCTranslator
);
// This prevents usage of QQuickWidget to fail since it doesn't support native widget siblings
#ifndef __android__
setAttribute
(
Qt
::
AA_DontCreateNativeWidgetSiblings
);
...
...
@@ -222,12 +235,12 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
QString
loggingOptions
;
CmdLineOpt_t
rgCmdLineOptions
[]
=
{
{
"--clear-settings"
,
&
fClearSettingsOptions
,
NULL
},
{
"--clear-settings"
,
&
fClearSettingsOptions
,
nullptr
},
{
"--logging"
,
&
logging
,
&
loggingOptions
},
{
"--fake-mobile"
,
&
_fakeMobile
,
NULL
},
{
"--log-output"
,
&
_logOutput
,
NULL
},
{
"--fake-mobile"
,
&
_fakeMobile
,
nullptr
},
{
"--log-output"
,
&
_logOutput
,
nullptr
},
#ifdef QT_DEBUG
{
"--test-high-dpi"
,
&
_testHighDPI
,
NULL
},
{
"--test-high-dpi"
,
&
_testHighDPI
,
nullptr
},
#endif
// Add additional command line option flags here
};
...
...
@@ -344,7 +357,7 @@ void QGCApplication::_shutdown(void)
QGCApplication
::~
QGCApplication
()
{
// Place shutdown code in _shutdown
_app
=
NULL
;
_app
=
nullptr
;
}
void
QGCApplication
::
_initCommon
(
void
)
...
...
@@ -648,10 +661,10 @@ QObject* QGCApplication::_rootQmlObject()
return
mainWindow
->
rootQmlObject
();
}
else
if
(
runningUnitTests
()){
// Unit test can run without a main window
return
NULL
;
return
nullptr
;
}
else
{
qWarning
()
<<
"Why is MainWindow missing?"
;
return
NULL
;
return
nullptr
;
}
#endif
}
...
...
src/QGCApplication.h
View file @
728f008b
...
...
@@ -177,6 +177,8 @@ private:
QGCToolbox
*
_toolbox
;
QTranslator
_QGCTranslator
;
bool
_bluetoothAvailable
;
static
const
char
*
_settingsVersionKey
;
///< Settings key which hold settings version
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment