Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
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
Tobias Hunger
qt-creator
Commits
e077d260
Commit
e077d260
authored
14 years ago
by
ck
Browse files
Options
Downloads
Patches
Plain Diff
Maemo: Fix end-of-process detection.
The remote terminal likes to insert backspaces just for fun.
parent
5b47f47d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
+22
-2
22 additions, 2 deletions
src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
src/plugins/qt4projectmanager/qt-maemo/maemosshthread.h
+1
-0
1 addition, 0 deletions
src/plugins/qt4projectmanager/qt-maemo/maemosshthread.h
with
23 additions
and
2 deletions
src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
+
22
−
2
View file @
e077d260
...
...
@@ -123,7 +123,8 @@ void MaemoSshRunner::initState()
void
MaemoSshRunner
::
handleRemoteOutput
(
const
QByteArray
&
curOutput
)
{
const
QByteArray
output
=
m_potentialEndMarkerPrefix
+
curOutput
;
const
QByteArray
output
=
filterTerminalControlChars
(
m_potentialEndMarkerPrefix
+
curOutput
);
// Wait for a prompt before sending the command.
if
(
!
m_promptEncountered
)
{
...
...
@@ -184,7 +185,26 @@ void MaemoSshRunner::handleRemoteOutput(const QByteArray &curOutput)
if
(
m_endMarkerCount
==
2
)
stop
();
m_potentialEndMarkerPrefix
=
output
.
right
(
EndMarker
.
count
()
-
1
);
m_potentialEndMarkerPrefix
=
output
.
right
(
EndMarker
.
count
());
}
QByteArray
MaemoSshRunner
::
filterTerminalControlChars
(
const
QByteArray
&
data
)
{
QByteArray
filteredData
;
for
(
int
i
=
0
;
i
<
data
.
size
();
++
i
)
{
if
(
data
.
at
(
i
)
==
'\b'
)
{
if
(
filteredData
.
isEmpty
())
{
qWarning
(
"Failed to filter terminal control characters, "
"remote output may not appear."
);
}
else
{
filteredData
.
remove
(
filteredData
.
count
()
-
1
,
1
);
}
}
else
{
filteredData
.
append
(
data
.
at
(
i
));
}
}
return
filteredData
;
}
const
QByteArray
MaemoSshRunner
::
EndMarker
(
QString
(
QChar
(
0x13a0
)).
toUtf8
());
...
...
This diff is collapsed.
Click to expand it.
src/plugins/qt4projectmanager/qt-maemo/maemosshthread.h
+
1
−
0
View file @
e077d260
...
...
@@ -98,6 +98,7 @@ private:
virtual
bool
runInternal
();
Q_SLOT
void
handleRemoteOutput
(
const
QByteArray
&
output
);
void
initState
();
QByteArray
filterTerminalControlChars
(
const
QByteArray
&
data
);
static
const
QByteArray
EndMarker
;
...
...
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