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
Marco Bubke
flatpak-qt-creator
Commits
d35e1906
Commit
d35e1906
authored
Jan 30, 2009
by
Oswald Buddenhagen
Browse files
don't allocate m_process dynamically
parent
1c2f0f64
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libs/utils/consoleprocess.h
View file @
d35e1906
...
...
@@ -82,7 +82,7 @@ private:
QWinEventNotifier
*
processFinishedNotifier
;
#else
private:
QProcess
*
m_process
;
QProcess
m_process
;
private
slots
:
void
processFinished
(
int
,
QProcess
::
ExitStatus
);
#endif
...
...
src/libs/utils/consoleprocess_unix.cpp
View file @
d35e1906
...
...
@@ -35,7 +35,6 @@ ConsoleProcess::ConsoleProcess(QObject *parent)
:
QObject
(
parent
)
{
m_isRunning
=
false
;
m_process
=
new
QProcess
(
this
);
}
ConsoleProcess
::~
ConsoleProcess
()
...
...
@@ -53,7 +52,7 @@ static QString shellEscape(const QString &in)
bool
ConsoleProcess
::
start
(
const
QString
&
program
,
const
QStringList
&
args
)
{
if
(
m_process
->
state
()
!=
QProcess
::
NotRunning
)
if
(
m_process
.
state
()
!=
QProcess
::
NotRunning
)
return
false
;
QString
shellArgs
;
shellArgs
+=
QLatin1String
(
"cd "
);
...
...
@@ -66,13 +65,13 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
}
shellArgs
+=
QLatin1String
(
"; echo; echo
\"
Press enter to close this window
\"
; read DUMMY"
);
m_process
->
setEnvironment
(
environment
());
m_process
.
setEnvironment
(
environment
());
connect
(
m_process
,
SIGNAL
(
finished
(
int
,
QProcess
::
ExitStatus
)),
connect
(
&
m_process
,
SIGNAL
(
finished
(
int
,
QProcess
::
ExitStatus
)),
this
,
SLOT
(
processFinished
(
int
,
QProcess
::
ExitStatus
)));
m_process
->
start
(
QLatin1String
(
"xterm"
),
QStringList
()
<<
QLatin1String
(
"-e"
)
<<
"/bin/sh"
<<
"-c"
<<
shellArgs
);
if
(
!
m_process
->
waitForStarted
())
m_process
.
start
(
QLatin1String
(
"xterm"
),
QStringList
()
<<
QLatin1String
(
"-e"
)
<<
"/bin/sh"
<<
"-c"
<<
shellArgs
);
if
(
!
m_process
.
waitForStarted
())
return
false
;
emit
processStarted
();
return
true
;
...
...
@@ -85,22 +84,22 @@ void ConsoleProcess::processFinished(int, QProcess::ExitStatus)
bool
ConsoleProcess
::
isRunning
()
const
{
return
m_process
->
state
()
!=
QProcess
::
NotRunning
;
return
m_process
.
state
()
!=
QProcess
::
NotRunning
;
}
void
ConsoleProcess
::
stop
()
{
m_process
->
terminate
();
m_process
->
waitForFinished
();
m_process
.
terminate
();
m_process
.
waitForFinished
();
}
qint64
ConsoleProcess
::
applicationPID
()
const
{
return
m_process
->
pid
();
return
m_process
.
pid
();
}
int
ConsoleProcess
::
exitCode
()
const
{
return
m_process
->
exitCode
();
return
m_process
.
exitCode
();
}
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