Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
cf951dbc
Commit
cf951dbc
authored
Jun 07, 2020
by
Simon Eugster
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated locale related code
Locale is now set after initialising MLT factory. Related:
#713
parent
26b583b0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
3 additions
and
79 deletions
+3
-79
renderer/renderjob.cpp
renderer/renderjob.cpp
+0
-5
renderer/renderjob.h
renderer/renderjob.h
+0
-1
src/assets/abstractassetsrepository.ipp
src/assets/abstractassetsrepository.ipp
+0
-7
src/core.cpp
src/core.cpp
+1
-23
src/doc/documentvalidator.cpp
src/doc/documentvalidator.cpp
+0
-8
src/doc/kdenlivedoc.cpp
src/doc/kdenlivedoc.cpp
+0
-14
src/mltconnection.cpp
src/mltconnection.cpp
+1
-0
src/project/projectmanager.cpp
src/project/projectmanager.cpp
+0
-21
thumbnailer/mltpreview.cpp
thumbnailer/mltpreview.cpp
+1
-0
No files found.
renderer/renderjob.cpp
View file @
cf951dbc
...
...
@@ -80,11 +80,6 @@ RenderJob::~RenderJob()
m_logfile
.
close
();
}
void
RenderJob
::
setLocale
(
const
QString
&
locale
)
{
qputenv
(
"LC_NUMERIC"
,
locale
.
toUtf8
().
constData
());
}
void
RenderJob
::
slotAbort
(
const
QString
&
url
)
{
if
(
m_dest
==
url
)
{
...
...
renderer/renderjob.h
View file @
cf951dbc
...
...
@@ -35,7 +35,6 @@ class RenderJob : public QObject
public:
RenderJob
(
const
QString
&
render
,
const
QString
&
scenelist
,
const
QString
&
target
,
int
pid
=
-
1
,
int
in
=
-
1
,
int
out
=
-
1
,
QObject
*
parent
=
nullptr
);
~
RenderJob
();
void
setLocale
(
const
QString
&
locale
);
public
slots
:
void
start
();
...
...
src/assets/abstractassetsrepository.ipp
View file @
cf951dbc
...
...
@@ -38,13 +38,6 @@ template <typename AssetType> AbstractAssetsRepository<AssetType>::AbstractAsset
template <typename AssetType> void AbstractAssetsRepository<AssetType>::init()
{
// Warning: Mlt::Factory::init() resets the locale to the default system value, make sure we keep correct locale
#ifndef Q_OS_MAC
setlocale(LC_NUMERIC, nullptr);
#else
setlocale(LC_NUMERIC_MASK, nullptr);
#endif
// Parse blacklist
parseAssetList(assetBlackListPath(), m_blacklist);
...
...
src/core.cpp
View file @
cf951dbc
...
...
@@ -285,30 +285,8 @@ MixerManager *Core::mixer()
void
Core
::
initLocale
()
{
qDebug
()
<<
"Using modified system locale without group separator for numbers"
;
QLocale
systemLocale
=
QLocale
();
#ifndef Q_OS_MAC
setlocale
(
LC_NUMERIC
,
nullptr
);
#else
setlocale
(
LC_NUMERIC_MASK
,
nullptr
);
#endif
// localeconv()->decimal_point does not give reliable results on Windows
#ifndef Q_OS_WIN
char
*
separator
=
localeconv
()
->
decimal_point
;
if
(
QString
::
fromUtf8
(
separator
)
!=
QChar
(
systemLocale
.
decimalPoint
()))
{
// qCDebug(KDENLIVE_LOG)<<"------\n!!! system locale is not similar to Qt's locale... be prepared for bugs!!!\n------";
// HACK: There is a locale conflict, so set locale to C
// Make sure to override exported values or it won't work
qputenv
(
"LANG"
,
"C"
);
#ifndef Q_OS_MAC
setlocale
(
LC_NUMERIC
,
"C"
);
#else
setlocale
(
LC_NUMERIC_MASK
,
"C"
);
#endif
systemLocale
=
QLocale
::
c
();
}
#endif
systemLocale
.
setNumberOptions
(
QLocale
::
OmitGroupSeparator
);
QLocale
::
setDefault
(
systemLocale
);
}
...
...
src/doc/documentvalidator.cpp
View file @
cf951dbc
...
...
@@ -185,14 +185,6 @@ bool DocumentValidator::validate(const double currentVersion)
"
\"
%2
\"
. Change your computer settings or you might not be able to correctly open the project."
,
documentLocale
.
decimalPoint
(),
QLocale
().
decimalPoint
()));
}
// locale conversion might need to be redone
// TODO reload repositories
/*#ifndef Q_OS_MAC
initEffects::parseEffectFiles(pCore->getMltRepository(), QString::fromLatin1(setlocale(LC_NUMERIC, nullptr)));
#else
initEffects::parseEffectFiles(pCore->getMltRepository(), QString::fromLatin1(setlocale(LC_NUMERIC_MASK, nullptr)));
#endif
*/
}
double
version
=
-
1
;
if
(
kdenliveDoc
.
isNull
()
||
!
kdenliveDoc
.
hasAttribute
(
QStringLiteral
(
"version"
)))
{
...
...
src/doc/kdenlivedoc.cpp
View file @
cf951dbc
...
...
@@ -128,19 +128,6 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, QString projectFolder, QUndoGroup *und
j
.
next
();
m_documentMetadata
[
j
.
key
()]
=
j
.
value
();
}
/*if (QLocale().decimalPoint() != QLocale::system().decimalPoint()) {
qDebug()<<"* * ** AARCH DOCUMENT PROBLEM;";
exit(1);
setlocale(LC_NUMERIC, "");
QLocale systemLocale = QLocale::system();
systemLocale.setNumberOptions(QLocale::OmitGroupSeparator);
QLocale::setDefault(systemLocale);
// locale conversion might need to be redone
///TODO: how to reset repositories...
//EffectsRepository::get()->init();
//TransitionsRepository::get()->init();
//initEffects::parseEffectFiles(pCore->getMltRepository(), QString::fromLatin1(setlocale(LC_NUMERIC, nullptr)));
}*/
*
openBackup
=
false
;
if
(
url
.
isValid
())
{
QFile
file
(
url
.
toLocalFile
());
...
...
@@ -1274,7 +1261,6 @@ QMap<QString, QString> KdenliveDoc::documentProperties()
m_projectFolder
+
QLatin1Char
(
'/'
)
+
m_documentProperties
.
value
(
QStringLiteral
(
"documentid"
)));
}
m_documentProperties
.
insert
(
QStringLiteral
(
"profile"
),
pCore
->
getCurrentProfile
()
->
path
());
;
if
(
!
m_documentProperties
.
contains
(
QStringLiteral
(
"decimalPoint"
)))
{
m_documentProperties
.
insert
(
QStringLiteral
(
"decimalPoint"
),
QLocale
().
decimalPoint
());
}
...
...
src/mltconnection.cpp
View file @
cf951dbc
...
...
@@ -91,6 +91,7 @@ MltConnection::MltConnection(const QString &mltPath)
m_repository
=
std
::
unique_ptr
<
Mlt
::
Repository
>
(
Mlt
::
Factory
::
init
());
std
::
setlocale
(
LC_ALL
,
"C"
);
::
qputenv
(
"LC_ALL"
,
"C"
);
qDebug
()
<<
"LC_ALL set to C after initialising MLT"
;
locateMeltAndProfilesPath
(
mltPath
);
...
...
src/project/projectmanager.cpp
View file @
cf951dbc
...
...
@@ -282,27 +282,6 @@ bool ProjectManager::closeCurrentDocument(bool saveChanges, bool quit)
m_project
=
nullptr
;
}
}
/* // Make sure to reset locale to system's default
QString requestedLocale = QLocale::system().name();
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
if (env.contains(QStringLiteral("LC_NUMERIC"))) {
requestedLocale = env.value(QStringLiteral("LC_NUMERIC"));
}
qDebug()<<"//////////// RESETTING LOCALE TO: "<<requestedLocale;
#ifdef Q_OS_MAC
setlocale(LC_NUMERIC_MASK, requestedLocale.toUtf8().constData());
#elif defined(Q_OS_WIN)
std::locale::global(std::locale(requestedLocale.toUtf8().constData()));
#else
QLocale newLocale(requestedLocale);
char *separator = localeconv()->decimal_point;
if (QString::fromUtf8(separator) != QString(newLocale.decimalPoint())) {
pCore->displayBinMessage(i18n("There is a locale conflict on your system, project might get corrupt"), KMessageWidget::Warning);
}
setlocale(LC_NUMERIC, requestedLocale.toUtf8().constData());
#endif
QLocale::setDefault(newLocale);*/
return
true
;
}
...
...
thumbnailer/mltpreview.cpp
View file @
cf951dbc
...
...
@@ -41,6 +41,7 @@ MltPreview::MltPreview()
Mlt
::
Factory
::
init
();
std
::
setlocale
(
LC_ALL
,
"C"
);
::
qputenv
(
"LC_ALL"
,
"C"
);
qDebug
()
<<
"LC_ALL set to C after initialising MLT"
;
}
MltPreview
::~
MltPreview
()
...
...
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