Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
552a0728
Commit
552a0728
authored
May 12, 2010
by
ck
Browse files
Maemo: Fix corner case in end-of-remote-process detection.
parent
20f26c98
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
View file @
552a0728
...
...
@@ -115,8 +115,10 @@ bool MaemoSshRunner::runInternal()
return
!
m_connection
->
hasError
();
}
void
MaemoSshRunner
::
handleRemoteOutput
(
const
QByteArray
&
o
utput
)
void
MaemoSshRunner
::
handleRemoteOutput
(
const
QByteArray
&
curO
utput
)
{
const
QByteArray
output
=
m_potentialEndMarkerPrefix
+
curOutput
;
// Wait for a prompt before sending the command.
if
(
!
m_promptEncountered
)
{
if
(
output
.
indexOf
(
m_prompt
)
!=
-
1
)
{
...
...
@@ -141,8 +143,6 @@ void MaemoSshRunner::handleRemoteOutput(const QByteArray &output)
/*
* The output the user should see is everything after the first
* and before the last occurrence of our marker string.
* Note: We don't currently handle the case of an incomplete unicode
* character being sent.
*/
int
firstCharToEmit
;
int
charsToEmitCount
;
...
...
@@ -166,16 +166,19 @@ void MaemoSshRunner::handleRemoteOutput(const QByteArray &output)
if
(
m_endMarkerCount
==
0
)
{
charsToEmitCount
=
0
;
}
else
{
firstCharToEmit
=
0
;
firstCharToEmit
=
m_potentialEndMarkerPrefix
.
count
()
;
charsToEmitCount
=
-
1
;
}
}
if
(
charsToEmitCount
!=
0
)
if
(
charsToEmitCount
!=
0
)
{
emit
remoteOutput
(
QString
::
fromUtf8
(
output
.
data
()
+
firstCharToEmit
,
charsToEmitCount
));
}
if
(
m_endMarkerCount
==
2
)
stop
();
m_potentialEndMarkerPrefix
=
output
.
right
(
EndMarker
.
count
()
-
1
);
}
const
QByteArray
MaemoSshRunner
::
EndMarker
(
QString
(
QChar
(
0x13a0
)).
toUtf8
());
...
...
src/plugins/qt4projectmanager/qt-maemo/maemosshthread.h
View file @
552a0728
...
...
@@ -104,6 +104,7 @@ private:
const
char
*
m_prompt
;
int
m_endMarkerCount
;
bool
m_promptEncountered
;
QByteArray
m_potentialEndMarkerPrefix
;
};
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment