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
System
LibQApt
Commits
4b6cd0f2
Commit
4b6cd0f2
authored
Jul 03, 2014
by
Harald Sitter
🏳️🌈
Browse files
Merge branch '2.2'
BUG: 316187
parents
2a2d8ca9
1dd424c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/worker/aptworker.cpp
View file @
4b6cd0f2
...
...
@@ -628,6 +628,14 @@ void AptWorker::downloadArchives()
void
AptWorker
::
installFile
()
{
m_trans
->
setStatus
(
QApt
::
RunningStatus
);
// FIXME: bloody workaround.
// setTransaction contains logic WRT locale and debconf setup, which
// is also useful to dpkg. For now simply reuse WorkerInstallProgress
// as it has no adverse effects.
WorkerInstallProgress
installProgress
(
50
,
90
);
installProgress
.
setTransaction
(
m_trans
);
QApt
::
DebFile
deb
(
m_trans
->
filePath
());
QString
debArch
=
deb
.
architecture
();
...
...
src/worker/workerinstallprogress.cpp
View file @
4b6cd0f2
...
...
@@ -23,6 +23,7 @@
#include
<QtCore/QStringBuilder>
#include
<QtCore/QStringList>
#include
<QtCore/QTextCodec>
#include
<QDebug>
#include
<apt-pkg/error.h>
...
...
@@ -56,6 +57,22 @@ void WorkerInstallProgress::setTransaction(Transaction *trans)
m_trans
=
trans
;
std
::
setlocale
(
LC_ALL
,
m_trans
->
locale
().
toAscii
());
// FIXME: bloody workaround.
// Since QLocale::system and consequently QTextCodec::forLocale is
// set way before we get here there's a need to manually override
// the already set default codec with that is requested by the client.
// Since the client talks to us about posix locales however we cannot
// expect a reliable mapping from split(.).last() to a proper codec.
// Also there is no explicit Qt api to translate a given posix locale
// to QLocale & QTextCodec.
// Ultimately transactions should get new properties for QLocale::name
// and QTextCodec::name, assuming generally meaningful values we can
// through those properties accurately recreate the client locale env.
QTextCodec
*
codec
=
QTextCodec
::
codecForName
(
m_trans
->
locale
().
split
(
'.'
).
last
().
toUtf8
());
QTextCodec
::
setCodecForCStrings
(
codec
);
QTextCodec
::
setCodecForLocale
(
codec
);
QTextCodec
::
setCodecForTr
(
codec
);
if
((
trans
->
frontendCaps
()
&
QApt
::
DebconfCap
)
&&
!
trans
->
debconfPipe
().
isEmpty
())
{
setenv
(
"DEBIAN_FRONTEND"
,
"passthrough"
,
1
);
setenv
(
"DEBCONF_PIPE"
,
trans
->
debconfPipe
().
toAscii
(),
1
);
...
...
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