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
dde46ec1
Commit
dde46ec1
authored
Dec 14, 2009
by
Friedemann Kleint
Browse files
VCS: Introduce configureable timeout to vcs,svn, p4.
as already present for git, mercurial. Task-number: QTCREATORBUG-475
parent
e600c0dd
Changes
16
Hide whitespace changes
Inline
Side-by-side
src/plugins/cvs/cvsplugin.cpp
View file @
dde46ec1
...
...
@@ -79,11 +79,6 @@ static inline QString msgLogParsingFailed()
return
CVSPlugin
::
tr
(
"Parsing of the log output failed"
);
}
// Timeout for normal output commands
enum
{
cvsShortTimeOut
=
10000
};
// Timeout for submit, update
enum
{
cvsLongTimeOut
=
120000
};
static
const
char
*
const
CMD_ID_CVS_MENU
=
"CVS.Menu"
;
static
const
char
*
const
CMD_ID_ADD
=
"CVS.Add"
;
static
const
char
*
const
CMD_ID_DELETE_FILE
=
"CVS.Delete"
;
...
...
@@ -434,7 +429,7 @@ void CVSPlugin::cvsDiff(const QString &workingDir, const QStringList &files)
// CVS returns the diff exit code (1 if files differ), which is
// undistinguishable from a "file not found" error, unfortunately.
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
false
,
codec
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
codec
);
switch
(
response
.
result
)
{
case
CVSResponse
::
NonNullExitCode
:
case
CVSResponse
::
Ok
:
...
...
@@ -518,7 +513,7 @@ void CVSPlugin::revertCurrentFile()
QTC_ASSERT
(
state
.
hasFile
(),
return
)
QStringList
args
;
args
<<
QLatin1String
(
"diff"
)
<<
state
.
relativeCurrentFile
();
const
CVSResponse
diffResponse
=
runCVS
(
state
.
currentFileTopLevel
(),
args
,
cvsShortT
imeOut
,
false
);
const
CVSResponse
diffResponse
=
runCVS
(
state
.
currentFileTopLevel
(),
args
,
m_settings
.
t
imeOut
MS
()
,
false
);
switch
(
diffResponse
.
result
)
{
case
CVSResponse
::
Ok
:
return
;
// Not modified, diff exit code 0
...
...
@@ -539,7 +534,7 @@ void CVSPlugin::revertCurrentFile()
// revert
args
.
clear
();
args
<<
QLatin1String
(
"update"
)
<<
QLatin1String
(
"-C"
)
<<
state
.
relativeCurrentFile
();
const
CVSResponse
revertResponse
=
runCVS
(
state
.
currentFileTopLevel
(),
args
,
cvsShortT
imeOut
,
true
);
const
CVSResponse
revertResponse
=
runCVS
(
state
.
currentFileTopLevel
(),
args
,
m_settings
.
t
imeOut
MS
()
,
true
);
if
(
revertResponse
.
result
==
CVSResponse
::
Ok
)
{
fcb
.
setModifiedReload
(
true
);
cvsVersionControl
()
->
emitFilesChanged
(
QStringList
(
state
.
currentFile
()));
...
...
@@ -589,7 +584,7 @@ void CVSPlugin::startCommit(const QString &workingDir, const QStringList &files)
// We need the "Examining <subdir>" stderr output to tell
// where we are, so, have stdout/stderr channels merged.
QStringList
args
=
QStringList
(
QLatin1String
(
"status"
));
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
false
,
0
,
true
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
0
,
true
);
if
(
response
.
result
!=
CVSResponse
::
Ok
)
return
;
// Get list of added/modified/deleted files and purge out undesired ones
...
...
@@ -638,7 +633,7 @@ bool CVSPlugin::commit(const QString &messageFile,
QStringList
args
=
QStringList
(
QLatin1String
(
"commit"
));
args
<<
QLatin1String
(
"-F"
)
<<
messageFile
;
args
.
append
(
fileList
);
const
CVSResponse
response
=
runCVS
(
m_commitRepository
,
args
,
cvsL
ongTimeOut
,
true
);
const
CVSResponse
response
=
runCVS
(
m_commitRepository
,
args
,
m_settings
.
l
ongTimeOut
MS
()
,
true
);
return
response
.
result
==
CVSResponse
::
Ok
;
}
...
...
@@ -658,7 +653,7 @@ void CVSPlugin::filelog(const QString &workingDir, const QStringList &files)
QStringList
args
;
args
<<
QLatin1String
(
"log"
);
args
.
append
(
files
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
false
,
codec
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
codec
);
if
(
response
.
result
!=
CVSResponse
::
Ok
)
return
;
...
...
@@ -683,7 +678,7 @@ void CVSPlugin::updateProject()
QStringList
args
(
QLatin1String
(
"update"
));
args
.
push_back
(
QLatin1String
(
"-dR"
));
args
.
append
(
state
.
relativeCurrentProject
());
const
CVSResponse
response
=
runCVS
(
state
.
currentProjectTopLevel
(),
args
,
cvsL
ongTimeOut
,
true
);
const
CVSResponse
response
=
runCVS
(
state
.
currentProjectTopLevel
(),
args
,
m_settings
.
l
ongTimeOut
MS
()
,
true
);
if
(
response
.
result
==
CVSResponse
::
Ok
)
cvsVersionControl
()
->
emitRepositoryChanged
(
state
.
currentProjectTopLevel
());
}
...
...
@@ -703,7 +698,7 @@ void CVSPlugin::annotate(const QString &workingDir, const QString &file)
const
QString
source
=
VCSBase
::
VCSBaseEditor
::
getSource
(
workingDir
,
file
);
QStringList
args
;
args
<<
QLatin1String
(
"annotate"
)
<<
file
;
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
false
,
codec
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
codec
);
if
(
response
.
result
!=
CVSResponse
::
Ok
)
return
;
...
...
@@ -729,7 +724,7 @@ void CVSPlugin::projectStatus()
QTC_ASSERT
(
state
.
hasProject
(),
return
)
QStringList
args
;
args
<<
QLatin1String
(
"status"
)
<<
state
.
relativeCurrentProject
();
const
CVSResponse
response
=
runCVS
(
state
.
currentProjectTopLevel
(),
args
,
cvsShortT
imeOut
,
false
);
const
CVSResponse
response
=
runCVS
(
state
.
currentProjectTopLevel
(),
args
,
m_settings
.
t
imeOut
MS
()
,
false
);
if
(
response
.
result
==
CVSResponse
::
Ok
)
showOutputInEditor
(
tr
(
"Project status"
),
response
.
stdOut
,
VCSBase
::
RegularCommandOutput
,
state
.
currentProjectTopLevel
(),
0
);
}
...
...
@@ -787,7 +782,7 @@ bool CVSPlugin::describe(const QString &toplevel, const QString &file, const
// Run log to obtain commit id and details
QStringList
args
;
args
<<
QLatin1String
(
"log"
)
<<
(
QLatin1String
(
"-r"
)
+
changeNr
)
<<
file
;
const
CVSResponse
logResponse
=
runCVS
(
toplevel
,
args
,
cvsShortT
imeOut
,
false
);
const
CVSResponse
logResponse
=
runCVS
(
toplevel
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
);
if
(
logResponse
.
result
!=
CVSResponse
::
Ok
)
{
*
errorMessage
=
logResponse
.
message
;
return
false
;
...
...
@@ -808,7 +803,7 @@ bool CVSPlugin::describe(const QString &toplevel, const QString &file, const
args
.
clear
();
args
<<
QLatin1String
(
"log"
)
<<
QLatin1String
(
"-d"
)
<<
(
dateS
+
QLatin1Char
(
'<'
)
+
nextDayS
);
const
CVSResponse
repoLogResponse
=
runCVS
(
toplevel
,
args
,
cvsL
ongTimeOut
,
false
);
const
CVSResponse
repoLogResponse
=
runCVS
(
toplevel
,
args
,
m_settings
.
l
ongTimeOut
MS
()
,
false
);
if
(
repoLogResponse
.
result
!=
CVSResponse
::
Ok
)
{
*
errorMessage
=
repoLogResponse
.
message
;
return
false
;
...
...
@@ -844,7 +839,7 @@ bool CVSPlugin::describe(const QString &repositoryPath,
// Run log
QStringList
args
(
QLatin1String
(
"log"
));
args
<<
(
QLatin1String
(
"-r"
)
+
it
->
revisions
.
front
().
revision
)
<<
it
->
file
;
const
CVSResponse
logResponse
=
runCVS
(
repositoryPath
,
args
,
cvsShortT
imeOut
,
false
);
const
CVSResponse
logResponse
=
runCVS
(
repositoryPath
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
);
if
(
logResponse
.
result
!=
CVSResponse
::
Ok
)
{
*
errorMessage
=
logResponse
.
message
;
return
false
;
...
...
@@ -860,7 +855,7 @@ bool CVSPlugin::describe(const QString &repositoryPath,
args
<<
m_settings
.
cvsDiffOptions
<<
QLatin1String
(
"-r"
)
<<
previousRev
<<
QLatin1String
(
"-r"
)
<<
it
->
revisions
.
front
().
revision
<<
it
->
file
;
const
CVSResponse
diffResponse
=
runCVS
(
repositoryPath
,
args
,
cvsShortT
imeOut
,
false
,
codec
);
const
CVSResponse
diffResponse
=
runCVS
(
repositoryPath
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
codec
);
switch
(
diffResponse
.
result
)
{
case
CVSResponse
::
Ok
:
case
CVSResponse
::
NonNullExitCode
:
// Diff exit code != 0
...
...
@@ -1037,7 +1032,7 @@ bool CVSPlugin::vcsAdd(const QString &workingDir, const QString &rawFileName)
{
QStringList
args
;
args
<<
QLatin1String
(
"add"
)
<<
rawFileName
;
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
true
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
true
);
return
response
.
result
==
CVSResponse
::
Ok
;
}
...
...
@@ -1045,7 +1040,7 @@ bool CVSPlugin::vcsDelete(const QString &workingDir, const QString &rawFileName)
{
QStringList
args
;
args
<<
QLatin1String
(
"remove"
)
<<
QLatin1String
(
"-f"
)
<<
rawFileName
;
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
true
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
true
);
return
response
.
result
==
CVSResponse
::
Ok
;
}
...
...
src/plugins/cvs/cvssettings.cpp
View file @
dde46ec1
...
...
@@ -39,6 +39,9 @@ static const char *promptToSubmitKeyC = "PromptForSubmit";
static
const
char
*
diffOptionsKeyC
=
"DiffOptions"
;
static
const
char
*
describeByCommitIdKeyC
=
"DescribeByCommitId"
;
static
const
char
*
defaultDiffOptions
=
"-du"
;
static
const
char
*
timeOutKeyC
=
"TimeOut"
;
enum
{
defaultTimeOutS
=
30
};
static
QString
defaultCommand
()
{
...
...
@@ -56,6 +59,7 @@ namespace CVS {
CVSSettings
::
CVSSettings
()
:
cvsCommand
(
defaultCommand
()),
cvsDiffOptions
(
QLatin1String
(
defaultDiffOptions
)),
timeOutS
(
defaultTimeOutS
),
promptToSubmit
(
true
),
describeByCommitId
(
true
)
{
...
...
@@ -69,6 +73,7 @@ void CVSSettings::fromSettings(QSettings *settings)
cvsRoot
=
settings
->
value
(
QLatin1String
(
rootC
),
QString
()).
toString
();
cvsDiffOptions
=
settings
->
value
(
QLatin1String
(
diffOptionsKeyC
),
QLatin1String
(
defaultDiffOptions
)).
toString
();
describeByCommitId
=
settings
->
value
(
QLatin1String
(
describeByCommitIdKeyC
),
true
).
toBool
();
timeOutS
=
settings
->
value
(
QLatin1String
(
timeOutKeyC
),
defaultTimeOutS
).
toInt
();
settings
->
endGroup
();
}
...
...
@@ -78,7 +83,8 @@ void CVSSettings::toSettings(QSettings *settings) const
settings
->
setValue
(
QLatin1String
(
commandKeyC
),
cvsCommand
);
settings
->
setValue
(
QLatin1String
(
promptToSubmitKeyC
),
promptToSubmit
);
settings
->
setValue
(
QLatin1String
(
rootC
),
cvsRoot
);
settings
->
setValue
(
QLatin1String
(
diffOptionsKeyC
),
cvsDiffOptions
);
settings
->
setValue
(
QLatin1String
(
diffOptionsKeyC
),
cvsDiffOptions
);
settings
->
setValue
(
QLatin1String
(
timeOutKeyC
),
timeOutS
);
settings
->
setValue
(
QLatin1String
(
describeByCommitIdKeyC
),
describeByCommitId
);
settings
->
endGroup
();
}
...
...
@@ -89,6 +95,7 @@ bool CVSSettings::equals(const CVSSettings &s) const
&&
describeByCommitId
==
s
.
describeByCommitId
&&
cvsCommand
==
s
.
cvsCommand
&&
cvsRoot
==
s
.
cvsRoot
&&
timeOutS
==
s
.
timeOutS
&&
cvsDiffOptions
==
s
.
cvsDiffOptions
;
}
...
...
src/plugins/cvs/cvssettings.h
View file @
dde46ec1
...
...
@@ -46,6 +46,9 @@ struct CVSSettings
void
fromSettings
(
QSettings
*
);
void
toSettings
(
QSettings
*
)
const
;
inline
int
timeOutMS
()
const
{
return
timeOutS
*
10000
;
}
inline
int
longTimeOutMS
()
const
{
return
timeOutS
*
100000
;
}
// Add common options to the command line
QStringList
addOptions
(
const
QStringList
&
args
)
const
;
...
...
@@ -54,6 +57,7 @@ struct CVSSettings
QString
cvsCommand
;
QString
cvsRoot
;
QString
cvsDiffOptions
;
int
timeOutS
;
bool
promptToSubmit
;
bool
describeByCommitId
;
};
...
...
src/plugins/cvs/settingspage.cpp
View file @
dde46ec1
...
...
@@ -57,6 +57,7 @@ CVSSettings SettingsPageWidget::settings() const
rc
.
cvsCommand
=
m_ui
.
commandPathChooser
->
path
();
rc
.
cvsRoot
=
m_ui
.
rootLineEdit
->
text
();
rc
.
cvsDiffOptions
=
m_ui
.
diffOptionsLineEdit
->
text
();
rc
.
timeOutS
=
m_ui
.
timeOutSpinBox
->
value
();
rc
.
promptToSubmit
=
m_ui
.
promptToSubmitCheckBox
->
isChecked
();
rc
.
describeByCommitId
=
m_ui
.
describeByCommitIdCheckBox
->
isChecked
();
return
rc
;
...
...
@@ -67,6 +68,7 @@ void SettingsPageWidget::setSettings(const CVSSettings &s)
m_ui
.
commandPathChooser
->
setPath
(
s
.
cvsCommand
);
m_ui
.
rootLineEdit
->
setText
(
s
.
cvsRoot
);
m_ui
.
diffOptionsLineEdit
->
setText
(
s
.
cvsDiffOptions
);
m_ui
.
timeOutSpinBox
->
setValue
(
s
.
timeOutS
);
m_ui
.
promptToSubmitCheckBox
->
setChecked
(
s
.
promptToSubmit
);
m_ui
.
describeByCommitIdCheckBox
->
setChecked
(
s
.
describeByCommitId
);
}
...
...
src/plugins/cvs/settingspage.ui
View file @
dde46ec1
...
...
@@ -2,6 +2,14 @@
<ui
version=
"4.0"
>
<class>
CVS::Internal::SettingsPage
</class>
<widget
class=
"QWidget"
name=
"CVS::Internal::SettingsPage"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
447
</width>
<height>
281
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QGroupBox"
name=
"miscGroupBox"
>
...
...
@@ -38,24 +46,24 @@
<string>
Miscellaneous
</string>
</property>
<layout
class=
"QFormLayout"
name=
"formLayout"
>
<item
row=
"
0
"
column=
"0"
>
<item
row=
"
1
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"diffOptionsLabel"
>
<property
name=
"text"
>
<string>
Diff Options:
</string>
</property>
</widget>
</item>
<item
row=
"
0
"
column=
"1"
>
<item
row=
"
1
"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"diffOptionsLineEdit"
/>
</item>
<item
row=
"
1
"
column=
"0"
colspan=
"2"
>
<item
row=
"
2
"
column=
"0"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"promptToSubmitCheckBox"
>
<property
name=
"text"
>
<string>
Prompt on submit
</string>
</property>
</widget>
</item>
<item
row=
"
2
"
column=
"0"
colspan=
"2"
>
<item
row=
"
3
"
column=
"0"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"describeByCommitIdCheckBox"
>
<property
name=
"toolTip"
>
<string>
When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit id). Otherwise, only the respective file will be displayed.
</string>
...
...
@@ -65,6 +73,26 @@
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"timeOutLabel"
>
<property
name=
"text"
>
<string>
Timeout:
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QSpinBox"
name=
"timeOutSpinBox"
>
<property
name=
"suffix"
>
<string>
s
</string>
</property>
<property
name=
"minimum"
>
<number>
1
</number>
</property>
<property
name=
"maximum"
>
<number>
360
</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
...
...
src/plugins/git/settingspage.ui
View file @
dde46ec1
...
...
@@ -91,12 +91,15 @@
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"timeoutLabel"
>
<property
name=
"text"
>
<string>
Timeout
(seconds)
:
</string>
<string>
Timeout:
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QSpinBox"
name=
"timeoutSpinBox"
>
<property
name=
"suffix"
>
<string>
s
</string>
</property>
<property
name=
"minimum"
>
<number>
10
</number>
</property>
...
...
src/plugins/perforce/perforceplugin.cpp
View file @
dde46ec1
...
...
@@ -68,9 +68,6 @@
#include <QtGui/QMenu>
#include <QtGui/QMessageBox>
enum
{
p4Timeout
=
20000
};
enum
{
longTimeoutFactor
=
4
};
static
const
VCSBase
::
VCSBaseEditorParameters
editorParameters
[]
=
{
{
VCSBase
::
RegularCommandOutput
,
...
...
@@ -895,7 +892,7 @@ PerforceResponse PerforcePlugin::synchronousProcess(const QString &workingDir,
VCSBase
::
VCSBaseOutputWindow
*
outputWindow
=
VCSBase
::
VCSBaseOutputWindow
::
instance
();
// Run, connect stderr to the output window
Utils
::
SynchronousProcess
process
;
const
int
timeOut
=
(
flags
&
LongTimeOut
)
?
longTime
o
ut
Factor
*
p4Timeout
:
p4T
ime
o
ut
;
const
int
timeOut
=
(
flags
&
LongTimeOut
)
?
m_settings
.
longTime
O
ut
MS
()
:
m_settings
.
t
ime
O
ut
MS
()
;
process
.
setTimeout
(
timeOut
);
process
.
setStdOutCodec
(
outputCodec
);
if
(
flags
&
OverrideDiffEnvironment
)
...
...
@@ -983,7 +980,7 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD
process
.
closeWriteChannel
();
}
const
int
timeOut
=
(
flags
&
LongTimeOut
)
?
longTime
o
ut
Factor
*
p4Timeout
:
p4T
ime
o
ut
;
const
int
timeOut
=
(
flags
&
LongTimeOut
)
?
m_settings
.
longTime
O
ut
MS
()
:
m_settings
.
t
ime
O
ut
MS
()
;
if
(
!
process
.
waitForFinished
(
timeOut
))
{
PerforceChecker
::
ensureProcessStopped
(
process
);
response
.
error
=
true
;
...
...
src/plugins/perforce/perforcesettings.cpp
View file @
dde46ec1
...
...
@@ -46,6 +46,9 @@ static const char *portKeyC = "Port";
static
const
char
*
clientKeyC
=
"Client"
;
static
const
char
*
userKeyC
=
"User"
;
static
const
char
*
promptToSubmitKeyC
=
"PromptForSubmit"
;
static
const
char
*
timeOutKeyC
=
"TimeOut"
;
enum
{
defaultTimeOutS
=
30
};
static
QString
defaultCommand
()
{
...
...
@@ -62,6 +65,7 @@ namespace Internal {
Settings
::
Settings
()
:
defaultEnv
(
true
),
timeOutS
(
defaultTimeOutS
),
promptToSubmit
(
true
)
{
}
...
...
@@ -71,7 +75,7 @@ bool Settings::equals(const Settings &rhs) const
return
defaultEnv
==
rhs
.
defaultEnv
&&
p4Command
==
rhs
.
p4Command
&&
p4Port
==
rhs
.
p4Port
&&
p4Client
==
rhs
.
p4Client
&&
p4User
==
rhs
.
p4User
&&
promptToSubmit
==
rhs
.
promptToSubmit
;
&&
timeOutS
==
rhs
.
timeOutS
&&
promptToSubmit
==
rhs
.
promptToSubmit
;
};
QStringList
Settings
::
commonP4Arguments
()
const
...
...
@@ -105,6 +109,7 @@ void PerforceSettings::fromSettings(QSettings *settings)
m_settings
.
p4Port
=
settings
->
value
(
QLatin1String
(
portKeyC
),
QString
()).
toString
();
m_settings
.
p4Client
=
settings
->
value
(
QLatin1String
(
clientKeyC
),
QString
()).
toString
();
m_settings
.
p4User
=
settings
->
value
(
QLatin1String
(
userKeyC
),
QString
()).
toString
();
m_settings
.
timeOutS
=
settings
->
value
(
QLatin1String
(
timeOutKeyC
),
defaultTimeOutS
).
toInt
();
m_settings
.
promptToSubmit
=
settings
->
value
(
QLatin1String
(
promptToSubmitKeyC
),
true
).
toBool
();
settings
->
endGroup
();
}
...
...
@@ -117,6 +122,7 @@ void PerforceSettings::toSettings(QSettings *settings) const
settings
->
setValue
(
QLatin1String
(
portKeyC
),
m_settings
.
p4Port
);
settings
->
setValue
(
QLatin1String
(
clientKeyC
),
m_settings
.
p4Client
);
settings
->
setValue
(
QLatin1String
(
userKeyC
),
m_settings
.
p4User
);
settings
->
setValue
(
QLatin1String
(
timeOutKeyC
),
m_settings
.
timeOutS
);
settings
->
setValue
(
QLatin1String
(
promptToSubmitKeyC
),
m_settings
.
promptToSubmit
);
settings
->
endGroup
();
}
...
...
src/plugins/perforce/perforcesettings.h
View file @
dde46ec1
...
...
@@ -58,6 +58,7 @@ struct Settings {
QString
p4User
;
QString
errorString
;
bool
defaultEnv
;
int
timeOutS
;
bool
promptToSubmit
;
};
...
...
@@ -92,6 +93,10 @@ public:
void
setSettings
(
const
Settings
&
s
);
Settings
settings
()
const
;
inline
int
timeOutS
()
const
{
return
m_settings
.
timeOutS
;
}
inline
int
timeOutMS
()
const
{
return
m_settings
.
timeOutS
*
10000
;
}
inline
int
longTimeOutMS
()
const
{
return
m_settings
.
timeOutS
*
100000
;
}
QString
topLevel
()
const
;
QString
topLevelSymLinkTarget
()
const
;
...
...
src/plugins/perforce/settingspage.cpp
View file @
dde46ec1
...
...
@@ -81,6 +81,7 @@ Settings SettingsPageWidget::settings() const
settings
.
p4Port
=
m_ui
.
portLineEdit
->
text
();
settings
.
p4User
=
m_ui
.
userLineEdit
->
text
();
settings
.
p4Client
=
m_ui
.
clientLineEdit
->
text
();
settings
.
timeOutS
=
m_ui
.
timeOutSpinBox
->
value
();
settings
.
promptToSubmit
=
m_ui
.
promptToSubmitCheckBox
->
isChecked
();
return
settings
;
}
...
...
@@ -92,6 +93,7 @@ void SettingsPageWidget::setSettings(const PerforceSettings &s)
m_ui
.
portLineEdit
->
setText
(
s
.
p4Port
());
m_ui
.
clientLineEdit
->
setText
(
s
.
p4Client
());
m_ui
.
userLineEdit
->
setText
(
s
.
p4User
());
m_ui
.
timeOutSpinBox
->
setValue
(
s
.
timeOutS
());
m_ui
.
promptToSubmitCheckBox
->
setChecked
(
s
.
promptToSubmit
());
}
...
...
src/plugins/perforce/settingspage.ui
View file @
dde46ec1
...
...
@@ -2,6 +2,14 @@
<ui
version=
"4.0"
>
<class>
Perforce::Internal::SettingsPage
</class>
<widget
class=
"QWidget"
name=
"Perforce::Internal::SettingsPage"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
437
</width>
<height>
407
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QGroupBox"
name=
"configGroupBox"
>
...
...
@@ -82,13 +90,33 @@
<string>
Miscellaneous
</string>
</property>
<layout
class=
"QFormLayout"
name=
"formLayout_2"
>
<item
row=
"
0
"
column=
"0"
colspan=
"2"
>
<item
row=
"
1
"
column=
"0"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"promptToSubmitCheckBox"
>
<property
name=
"text"
>
<string>
Prompt on submit
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"timeOutLabel"
>
<property
name=
"text"
>
<string>
Timeout:
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QSpinBox"
name=
"timeOutSpinBox"
>
<property
name=
"suffix"
>
<string>
s
</string>
</property>
<property
name=
"minimum"
>
<number>
1
</number>
</property>
<property
name=
"maximum"
>
<number>
360
</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
...
...
src/plugins/subversion/settingspage.cpp
View file @
dde46ec1
...
...
@@ -58,6 +58,7 @@ SubversionSettings SettingsPageWidget::settings() const
rc
.
useAuthentication
=
m_ui
.
userGroupBox
->
isChecked
();
rc
.
user
=
m_ui
.
usernameLineEdit
->
text
();
rc
.
password
=
m_ui
.
passwordLineEdit
->
text
();
rc
.
timeOutS
=
m_ui
.
timeOutSpinBox
->
value
();
if
(
rc
.
user
.
isEmpty
())
rc
.
useAuthentication
=
false
;
rc
.
promptToSubmit
=
m_ui
.
promptToSubmitCheckBox
->
isChecked
();
...
...
@@ -70,6 +71,7 @@ void SettingsPageWidget::setSettings(const SubversionSettings &s)
m_ui
.
usernameLineEdit
->
setText
(
s
.
user
);
m_ui
.
passwordLineEdit
->
setText
(
s
.
password
);
m_ui
.
userGroupBox
->
setChecked
(
s
.
useAuthentication
);
m_ui
.
timeOutSpinBox
->
setValue
(
s
.
timeOutS
);
m_ui
.
promptToSubmitCheckBox
->
setChecked
(
s
.
promptToSubmit
);
}
...
...
src/plugins/subversion/settingspage.ui
View file @
dde46ec1
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
4
73
</width>
<width>
4
96
</width>
<height>
295
</height>
</rect>
</property>
...
...
@@ -72,13 +72,33 @@
<string>
Miscellaneous
</string>
</property>
<layout
class=
"QFormLayout"
name=
"formLayout_2"
>
<item
row=
"
0
"
column=
"0"
colspan=
"2"
>
<item
row=
"
1
"
column=
"0"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"promptToSubmitCheckBox"
>
<property
name=
"text"
>
<string>
Prompt on submit
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"timeOutLabel"
>
<property
name=
"text"
>
<string>
Timeout:
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QSpinBox"
name=
"timeOutSpinBox"
>
<property
name=
"suffix"
>
<string>
s
</string>
</property>
<property
name=
"minimum"
>
<number>
1
</number>
</property>
<property
name=
"maximum"
>
<number>
360
</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
...
...
src/plugins/subversion/subversionplugin.cpp
View file @
dde46ec1
...
...
@@ -71,11 +71,6 @@
using
namespace
Subversion
::
Internal
;
// Timeout for normal output commands
enum
{
subversionShortTimeOut
=
10000
};
// Timeout for submit, update
enum
{
subversionLongTimeOut
=
120000
};
static
const
char
*
const
CMD_ID_SUBVERSION_MENU
=
"Subversion.Menu"
;
static
const
char
*
const
CMD_ID_ADD
=
"Subversion.Add"
;
static
const
char
*
const
CMD_ID_DELETE_FILE
=
"Subversion.Delete"
;
...
...
@@ -470,7 +465,7 @@ void SubversionPlugin::svnDiff(const QString &workingDir, const QStringList &fil
QStringList
args
(
QLatin1String
(
"diff"
));
args
<<
files
;
const
SubversionResponse
response
=
runSvn
(
workingDir
,
args
,
subversionShortT
imeOut
,
false
,
codec
);
const
SubversionResponse
response
=
runSvn
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
codec
);
if
(
response
.
error
)
return
;
...
...
@@ -551,7 +546,7 @@ void SubversionPlugin::revertCurrentFile()
QStringList
args
(
QLatin1String
(
"diff"
));
args
.
push_back
(
state
.
relativeCurrentFile
());
const
SubversionResponse
diffResponse
=
runSvn
(
state
.
currentFileTopLevel
(),
args
,
subversionShortT
imeOut
,
false
);
const
SubversionResponse
diffResponse
=
runSvn
(
state
.
currentFileTopLevel
(),
args
,
m_settings
.
t
imeOut
MS
()
,
false
);
if
(
diffResponse
.
error
)
return
;
...
...
@@ -568,7 +563,7 @@ void SubversionPlugin::revertCurrentFile()
args
.
clear
();
args
<<
QLatin1String
(
"revert"
)
<<
state
.
relativeCurrentFile
();
const
SubversionResponse
revertResponse
=
runSvn
(
state
.
currentFileTopLevel
(),
args
,
subversionShortT
imeOut
,
true
);
const
SubversionResponse
revertResponse
=
runSvn
(
state
.
currentFileTopLevel
(),
args
,
m_settings
.
t
imeOut
MS
()
,
true
);
if
(
!
revertResponse
.
error
)
{
fcb
.
setModifiedReload
(
true
);
subVersionControl
()
->
emitFilesChanged
(
QStringList
(
state
.
currentFile
()));
...
...
@@ -618,7 +613,7 @@ void SubversionPlugin::startCommit(const QString &workingDir, const QStringList
QStringList
args
(
QLatin1String
(
"status"
));
args
+=
files
;
const
SubversionResponse
response
=
runSvn
(
workingDir
,
args
,
subversionShortT
imeOut
,
false
);
const
SubversionResponse
response
=
runSvn
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
);
if
(
response
.
error
)
return
;
...
...
@@ -659,7 +654,7 @@ bool SubversionPlugin::commit(const QString &messageFile,
QStringList
args
=
QStringList
(
QLatin1String
(
"commit"
));
args
<<
QLatin1String
(
nonInteractiveOptionC
)
<<
QLatin1String
(
"--file"
)
<<
messageFile
;
args
.
append
(
subVersionFileList
);
const
SubversionResponse
response
=
runSvn
(
m_commitRepository
,
args
,
subversionL
ongTimeOut
,
true
);
const
SubversionResponse
response
=
runSvn
(
m_commitRepository
,
args
,
m_settings
.
l
ongTimeOut
MS
()
,
true
);
return
!
response
.
error
;
}
...
...
@@ -678,7 +673,7 @@ void SubversionPlugin::filelog(const QString &workingDir, const QStringList &fil
foreach
(
const
QString
&
file
,
files
)
args
.
append
(
QDir
::
toNativeSeparators
(
file
));
const
SubversionResponse
response
=
runSvn
(
workingDir
,
args
,
subversionShortT
imeOut
,
false
,
codec
);
const
SubversionResponse
response
=
runSvn
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
codec
);
if
(
response
.
error
)
return
;
...
...
@@ -705,7 +700,7 @@ void SubversionPlugin::updateProject()
QStringList
args
(
QLatin1String
(
"update"
));
args
.
push_back
(
QLatin1String
(
nonInteractiveOptionC
));
args
.
append
(
state
.
relativeCurrentProject
());
const
SubversionResponse
response
=
runSvn
(
state
.
currentProjectTopLevel
(),
args
,
subversionL
ongTimeOut
,
true
);
const
SubversionResponse
response
=
runSvn
(
state
.
currentProjectTopLevel
(),
args
,
m_settings
.
l
ongTimeOut
MS
()
,
true
);
if
(
!
response
.
error
)
subVersionControl
()
->
emitRepositoryChanged
(
state
.
currentProjectTopLevel
());
}
...
...
@@ -725,7 +720,7 @@ void SubversionPlugin::annotate(const QString &workingDir, const QString &file)
args
.
push_back
(
QLatin1String
(
"-v"
));
args
.
append
(
QDir
::
toNativeSeparators
(
file
));