Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
381e4026
Commit
381e4026
authored
Jul 05, 2020
by
Jean-Baptiste Mardelle
Browse files
Attempt to fix freebsd compilation
parent
a013623b
Pipeline
#26022
failed with stage
in 4 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/localeHandling.cpp
View file @
381e4026
...
...
@@ -11,6 +11,8 @@ the Free Software Foundation, either version 3 of the License, or
#include "localeHandling.h"
#include <QtCore/QDebug>
#include <QtCore/QList>
#include <QtGlobal>
#include <locale.h>
auto
LocaleHandling
::
setLocale
(
const
QString
&
lcName
)
->
QString
{
...
...
@@ -18,7 +20,11 @@ auto LocaleHandling::setLocale(const QString &lcName) -> QString
QList
<
QString
>
localesToTest
;
localesToTest
<<
lcName
<<
lcName
+
".utf-8"
<<
lcName
+
".UTF-8"
<<
lcName
+
".utf8"
<<
lcName
+
".UTF8"
;
for
(
const
auto
&
locale
:
localesToTest
)
{
#ifdef Q_OS_FREEBSD
auto
*
result
=
setlocale
(
LC_ALL
,
locale
.
toStdString
().
c_str
());
#else
auto
*
result
=
std
::
setlocale
(
LC_ALL
,
locale
.
toStdString
().
c_str
());
#endif
if
(
result
!=
nullptr
)
{
::
qputenv
(
"LC_ALL"
,
locale
.
toStdString
().
c_str
());
newLocale
=
locale
;
...
...
@@ -33,7 +39,11 @@ auto LocaleHandling::setLocale(const QString &lcName) -> QString
void
LocaleHandling
::
resetLocale
()
{
#ifdef Q_OS_FREEBSD
setlocale
(
LC_ALL
,
"C"
);
#else
std
::
setlocale
(
LC_ALL
,
"C"
);
#endif
::
qputenv
(
"LC_ALL"
,
"C"
);
qDebug
()
<<
"LC_ALL reset to C"
;
}
...
...
Write
Preview
Supports
Markdown
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