Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flatpak-qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Bubke
flatpak-qt-creator
Commits
ea56809c
Commit
ea56809c
authored
14 years ago
by
kh1
Browse files
Options
Downloads
Patches
Plain Diff
Fix broken env reader, it did not reread on device changes.
Reviewed-by: ck
parent
a81e3325
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.cpp
+21
-13
21 additions, 13 deletions
...ugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.cpp
src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.h
+2
-3
2 additions, 3 deletions
...plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.h
with
23 additions
and
16 deletions
src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.cpp
+
21
−
13
View file @
ea56809c
...
...
@@ -47,7 +47,10 @@ MaemoDeviceEnvReader::MaemoDeviceEnvReader(QObject *parent, MaemoRunConfiguratio
:
QObject
(
parent
)
,
m_stop
(
false
)
,
m_devConfig
(
config
->
deviceConfig
())
,
m_runConfig
(
config
)
{
connect
(
config
,
SIGNAL
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)),
this
,
SLOT
(
handleCurrentDeviceConfigChanged
()));
}
MaemoDeviceEnvReader
::~
MaemoDeviceEnvReader
()
...
...
@@ -59,11 +62,11 @@ void MaemoDeviceEnvReader::start()
m_stop
=
false
;
if
(
m_connection
)
disconnect
(
m_connection
.
data
(),
0
,
this
,
0
);
const
bool
reuse
=
m_connection
&&
m_connection
->
state
()
==
Core
::
SshConnection
::
Connected
&&
m_connection
->
connectionParameters
()
==
m_devConfig
.
server
;
if
(
!
reuse
)
m_connection
=
Core
::
SshConnection
::
create
();
...
...
@@ -71,7 +74,7 @@ void MaemoDeviceEnvReader::start()
SLOT
(
executeRemoteCall
()));
connect
(
m_connection
.
data
(),
SIGNAL
(
error
(
SshError
)),
this
,
SLOT
(
handleConnectionFailure
()));
if
(
reuse
)
executeRemoteCall
();
else
...
...
@@ -89,20 +92,13 @@ void MaemoDeviceEnvReader::stop()
}
}
void
MaemoDeviceEnvReader
::
setEnvironment
()
{
if
(
m_remoteOutput
.
isEmpty
())
return
;
m_env
=
Utils
::
Environment
(
m_remoteOutput
.
split
(
QLatin1Char
(
'\n'
),
QString
::
SkipEmptyParts
));
}
void
MaemoDeviceEnvReader
::
executeRemoteCall
()
{
if
(
m_stop
)
return
;
const
QByteArray
remoteCall
=
MaemoGlobal
::
remoteSourceProfilesCommand
().
toUtf8
()
+
"; env"
;
const
QByteArray
remoteCall
=
MaemoGlobal
::
remoteSourceProfilesCommand
()
.
toUtf8
()
+
"; env"
;
m_remoteProcess
=
m_connection
->
createRemoteProcess
(
remoteCall
);
connect
(
m_remoteProcess
.
data
(),
SIGNAL
(
closed
(
int
)),
this
,
...
...
@@ -123,6 +119,14 @@ void MaemoDeviceEnvReader::handleConnectionFailure()
emit
finished
();
}
void
MaemoDeviceEnvReader
::
handleCurrentDeviceConfigChanged
()
{
m_devConfig
=
m_runConfig
->
deviceConfig
();
m_env
.
clear
();
emit
finished
();
}
void
MaemoDeviceEnvReader
::
remoteProcessFinished
(
int
exitCode
)
{
Q_ASSERT
(
exitCode
==
Core
::
SshRemoteProcess
::
FailedToStart
...
...
@@ -132,8 +136,12 @@ void MaemoDeviceEnvReader::remoteProcessFinished(int exitCode)
if
(
m_stop
)
return
;
m_env
.
clear
();
if
(
exitCode
==
Core
::
SshRemoteProcess
::
ExitedNormally
)
{
setEnvironment
();
if
(
!
m_remoteOutput
.
isEmpty
())
{
m_env
=
Utils
::
Environment
(
m_remoteOutput
.
split
(
QLatin1Char
(
'\n'
),
QString
::
SkipEmptyParts
));
}
}
else
{
emit
error
(
tr
(
"Error running remote process: %1"
)
.
arg
(
m_remoteProcess
->
errorString
()));
...
...
This diff is collapsed.
Click to expand it.
src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.h
+
2
−
3
View file @
ea56809c
...
...
@@ -67,12 +67,10 @@ signals:
void
finished
();
void
error
(
const
QString
&
error
);
private
:
void
setEnvironment
();
private
slots
:
void
executeRemoteCall
();
void
handleConnectionFailure
();
void
handleCurrentDeviceConfigChanged
();
void
remoteProcessFinished
(
int
exitCode
);
void
remoteOutput
(
const
QByteArray
&
data
);
...
...
@@ -83,6 +81,7 @@ private:
QString
m_remoteOutput
;
Utils
::
Environment
m_env
;
MaemoDeviceConfig
m_devConfig
;
MaemoRunConfiguration
*
m_runConfig
;
QSharedPointer
<
Core
::
SshConnection
>
m_connection
;
QSharedPointer
<
Core
::
SshRemoteProcess
>
m_remoteProcess
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment