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
Friedrich W. H. Kossebau
kdevelop
Commits
360bf1b5
Commit
360bf1b5
authored
Nov 05, 2019
by
Kevin Whitaker
Committed by
Kevin Whitaker
Dec 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass environment variables from process environment and set up with flatpak environment.
parent
f4b32496
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
plugins/flatpak/flatpakruntime.cpp
plugins/flatpak/flatpakruntime.cpp
+12
-2
No files found.
plugins/flatpak/flatpakruntime.cpp
View file @
360bf1b5
...
...
@@ -98,7 +98,12 @@ void FlatpakRuntime::setEnabled(bool /*enable*/)
void
FlatpakRuntime
::
startProcess
(
QProcess
*
process
)
const
{
const
QStringList
args
=
m_finishArgs
+
QStringList
{
QStringLiteral
(
"build"
),
QStringLiteral
(
"--talk-name=org.freedesktop.DBus"
),
m_buildDirectory
.
toLocalFile
(),
process
->
program
()}
<<
process
->
arguments
();
//Take any environment variables specified in process and pass through to flatpak.
QStringList
env_args
;
for
(
QString
env_var
:
process
->
processEnvironment
().
toStringList
())
{
env_args
<<
QLatin1String
(
"--env="
)
+
env_var
;
}
const
QStringList
args
=
m_finishArgs
+
env_args
+
QStringList
{
QStringLiteral
(
"build"
),
QStringLiteral
(
"--talk-name=org.freedesktop.DBus"
),
m_buildDirectory
.
toLocalFile
(),
process
->
program
()}
<<
process
->
arguments
();
process
->
setProgram
(
QStringLiteral
(
"flatpak"
));
process
->
setArguments
(
args
);
...
...
@@ -108,7 +113,12 @@ void FlatpakRuntime::startProcess(QProcess* process) const
void
FlatpakRuntime
::
startProcess
(
KProcess
*
process
)
const
{
process
->
setProgram
(
QStringList
{
QStringLiteral
(
"flatpak"
)}
<<
m_finishArgs
<<
QStringList
{
QStringLiteral
(
"build"
),
QStringLiteral
(
"--talk-name=org.freedesktop.DBus"
),
m_buildDirectory
.
toLocalFile
()
}
<<
process
->
program
());
//Take any environment variables specified in process and pass through to flatpak.
QStringList
env_args
;
for
(
QString
env_var
:
process
->
processEnvironment
().
toStringList
())
{
env_args
<<
QLatin1String
(
"--env="
)
+
env_var
;
}
process
->
setProgram
(
QStringList
{
QStringLiteral
(
"flatpak"
)}
<<
m_finishArgs
<<
env_args
<<
QStringList
{
QStringLiteral
(
"build"
),
QStringLiteral
(
"--talk-name=org.freedesktop.DBus"
),
m_buildDirectory
.
toLocalFile
()
}
<<
process
->
program
());
qCDebug
(
FLATPAK
)
<<
"starting kprocess"
<<
process
->
program
().
join
(
QLatin1Char
(
' '
));
process
->
start
();
...
...
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