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
bad8a15f
Commit
bad8a15f
authored
Dec 14, 2009
by
Friedemann Kleint
Browse files
Introduce long timeout.
parent
79191a76
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/perforce/perforceplugin.cpp
View file @
bad8a15f
...
...
@@ -69,6 +69,7 @@
#include <QtGui/QMessageBox>
enum
{
p4Timeout
=
20000
};
enum
{
longTimeoutFactor
=
4
};
static
const
VCSBase
::
VCSBaseEditorParameters
editorParameters
[]
=
{
{
...
...
@@ -866,9 +867,9 @@ static inline QString msgNotStarted(const QString &cmd)
return
PerforcePlugin
::
tr
(
"Could not start perforce '%1'. Please check your settings in the preferences."
).
arg
(
cmd
);
}
static
inline
QString
msgTimeout
()
static
inline
QString
msgTimeout
(
int
timeOut
)
{
return
PerforcePlugin
::
tr
(
"Perforce did not respond within timeout limit (%1 ms)."
).
arg
(
p4T
ime
o
ut
);
return
PerforcePlugin
::
tr
(
"Perforce did not respond within timeout limit (%1 ms)."
).
arg
(
t
ime
O
ut
);
}
static
inline
QString
msgCrash
()
...
...
@@ -893,7 +894,8 @@ PerforceResponse PerforcePlugin::synchronousProcess(const QString &workingDir,
VCSBase
::
VCSBaseOutputWindow
*
outputWindow
=
VCSBase
::
VCSBaseOutputWindow
::
instance
();
// Run, connect stderr to the output window
Utils
::
SynchronousProcess
process
;
process
.
setTimeout
(
p4Timeout
);
const
int
timeOut
=
(
flags
&
LongTimeOut
)
?
longTimeoutFactor
*
p4Timeout
:
p4Timeout
;
process
.
setTimeout
(
timeOut
);
process
.
setStdOutCodec
(
outputCodec
);
if
(
flags
&
OverrideDiffEnvironment
)
process
.
setProcessEnvironment
(
overrideDiffEnvironmentVariable
());
...
...
@@ -980,10 +982,11 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD
process
.
closeWriteChannel
();
}
if
(
!
process
.
waitForFinished
(
p4Timeout
))
{
const
int
timeOut
=
(
flags
&
LongTimeOut
)
?
longTimeoutFactor
*
p4Timeout
:
p4Timeout
;
if
(
!
process
.
waitForFinished
(
timeOut
))
{
PerforceChecker
::
ensureProcessStopped
(
process
);
response
.
error
=
true
;
response
.
message
=
msgTimeout
();
response
.
message
=
msgTimeout
(
timeOut
);
return
response
;
}
if
(
process
.
exitStatus
()
!=
QProcess
::
NormalExit
)
{
...
...
@@ -1199,7 +1202,7 @@ bool PerforcePlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *subm
QStringList
submitArgs
;
submitArgs
<<
QLatin1String
(
"submit"
)
<<
QLatin1String
(
"-i"
);
const
PerforceResponse
submitResponse
=
runP4Cmd
(
m_settings
.
topLevelSymLinkTarget
(),
submitArgs
,
RunFullySynchronous
|
CommandToWindow
|
StdErrToWindow
|
ErrorToWindow
|
ShowBusyCursor
,
LongTimeOut
|
RunFullySynchronous
|
CommandToWindow
|
StdErrToWindow
|
ErrorToWindow
|
ShowBusyCursor
,
QStringList
(),
changeDescription
);
if
(
submitResponse
.
error
)
{
VCSBase
::
VCSBaseOutputWindow
::
instance
()
->
appendError
(
tr
(
"p4 submit failed: %1"
).
arg
(
submitResponse
.
message
));
...
...
src/plugins/perforce/perforceplugin.h
View file @
bad8a15f
...
...
@@ -146,7 +146,8 @@ private:
// Run completely synchronously, no signals emitted
RunFullySynchronous
=
0x20
,
IgnoreExitCode
=
0x40
,
ShowBusyCursor
=
0x80
ShowBusyCursor
=
0x80
,
LongTimeOut
=
0x100
};
// args are passed as command line arguments
...
...
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