Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
c55b5b7b
Commit
c55b5b7b
authored
Jan 05, 2010
by
Friedemann Kleint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Git/SVN: Ignore whitespace in annotation/blame (introduce setting).
Defaulting to true. Task-number: QTCREATORBUG-502
parent
59ecb9cf
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
45 additions
and
6 deletions
+45
-6
src/plugins/git/gitclient.cpp
src/plugins/git/gitclient.cpp
+3
-0
src/plugins/git/gitsettings.cpp
src/plugins/git/gitsettings.cpp
+6
-2
src/plugins/git/gitsettings.h
src/plugins/git/gitsettings.h
+1
-0
src/plugins/git/settingspage.cpp
src/plugins/git/settingspage.cpp
+4
-1
src/plugins/git/settingspage.ui
src/plugins/git/settingspage.ui
+10
-0
src/plugins/subversion/settingspage.cpp
src/plugins/subversion/settingspage.cpp
+4
-1
src/plugins/subversion/settingspage.ui
src/plugins/subversion/settingspage.ui
+7
-0
src/plugins/subversion/subversionplugin.cpp
src/plugins/subversion/subversionplugin.cpp
+2
-0
src/plugins/subversion/subversionsettings.cpp
src/plugins/subversion/subversionsettings.cpp
+7
-2
src/plugins/subversion/subversionsettings.h
src/plugins/subversion/subversionsettings.h
+1
-0
No files found.
src/plugins/git/gitclient.cpp
View file @
c55b5b7b
...
...
@@ -302,6 +302,9 @@ void GitClient::blame(const QString &workingDirectory, const QString &fileName,
if
(
Git
::
Constants
::
debug
)
qDebug
()
<<
"blame"
<<
workingDirectory
<<
fileName
<<
lineNumber
;
QStringList
arguments
(
QLatin1String
(
"blame"
));
arguments
<<
QLatin1String
(
"--root"
);
if
(
m_plugin
->
settings
().
spaceIgnorantBlame
)
arguments
<<
QLatin1String
(
"-w"
);
arguments
<<
QLatin1String
(
"--"
)
<<
fileName
;
const
QString
kind
=
QLatin1String
(
Git
::
Constants
::
GIT_BLAME_EDITOR_KIND
);
...
...
src/plugins/git/gitsettings.cpp
View file @
c55b5b7b
...
...
@@ -43,6 +43,7 @@ static const char *logCountKeyC = "LogCount";
static
const
char
*
timeoutKeyC
=
"TimeOut"
;
static
const
char
*
promptToSubmitKeyC
=
"PromptForSubmit"
;
static
const
char
*
omitAnnotationDateKeyC
=
"OmitAnnotationDate"
;
static
const
char
*
spaceIgnorantBlameKeyC
=
"SpaceIgnorantBlame"
;
enum
{
defaultLogCount
=
10
,
defaultTimeOut
=
30
};
...
...
@@ -54,7 +55,8 @@ GitSettings::GitSettings() :
logCount
(
defaultLogCount
),
timeout
(
defaultTimeOut
),
promptToSubmit
(
true
),
omitAnnotationDate
(
false
)
omitAnnotationDate
(
false
),
spaceIgnorantBlame
(
true
)
{
}
...
...
@@ -67,6 +69,7 @@ void GitSettings::fromSettings(QSettings *settings)
timeout
=
settings
->
value
(
QLatin1String
(
timeoutKeyC
),
defaultTimeOut
).
toInt
();
promptToSubmit
=
settings
->
value
(
QLatin1String
(
promptToSubmitKeyC
),
true
).
toBool
();
omitAnnotationDate
=
settings
->
value
(
QLatin1String
(
omitAnnotationDateKeyC
),
false
).
toBool
();
spaceIgnorantBlame
=
settings
->
value
(
QLatin1String
(
spaceIgnorantBlameKeyC
),
true
).
toBool
();
settings
->
endGroup
();
}
...
...
@@ -79,6 +82,7 @@ void GitSettings::toSettings(QSettings *settings) const
settings
->
setValue
(
QLatin1String
(
timeoutKeyC
),
timeout
);
settings
->
setValue
(
QLatin1String
(
promptToSubmitKeyC
),
promptToSubmit
);
settings
->
setValue
(
QLatin1String
(
omitAnnotationDateKeyC
),
omitAnnotationDate
);
settings
->
setValue
(
QLatin1String
(
spaceIgnorantBlameKeyC
),
spaceIgnorantBlame
);
settings
->
endGroup
();
}
...
...
@@ -86,7 +90,7 @@ bool GitSettings::equals(const GitSettings &s) const
{
return
adoptPath
==
s
.
adoptPath
&&
path
==
s
.
path
&&
logCount
==
s
.
logCount
&&
timeout
==
s
.
timeout
&&
promptToSubmit
==
s
.
promptToSubmit
&&
omitAnnotationDate
==
s
.
omitAnnotationDate
;
&&
omitAnnotationDate
==
s
.
omitAnnotationDate
&&
spaceIgnorantBlame
==
s
.
spaceIgnorantBlame
;
}
QString
GitSettings
::
gitBinaryPath
(
bool
*
ok
,
QString
*
errorMessage
)
const
...
...
src/plugins/git/gitsettings.h
View file @
c55b5b7b
...
...
@@ -57,6 +57,7 @@ struct GitSettings
int
timeout
;
bool
promptToSubmit
;
bool
omitAnnotationDate
;
bool
spaceIgnorantBlame
;
};
inline
bool
operator
==
(
const
GitSettings
&
p1
,
const
GitSettings
&
p2
)
...
...
src/plugins/git/settingspage.cpp
View file @
c55b5b7b
...
...
@@ -58,6 +58,7 @@ GitSettings SettingsPageWidget::settings() const
rc
.
timeout
=
m_ui
.
timeoutSpinBox
->
value
();
rc
.
promptToSubmit
=
m_ui
.
promptToSubmitCheckBox
->
isChecked
();
rc
.
omitAnnotationDate
=
m_ui
.
omitAnnotationDataCheckBox
->
isChecked
();
rc
.
spaceIgnorantBlame
=
m_ui
.
spaceIgnorantBlameCheckBox
->
isChecked
();
return
rc
;
}
...
...
@@ -69,6 +70,7 @@ void SettingsPageWidget::setSettings(const GitSettings &s)
m_ui
.
timeoutSpinBox
->
setValue
(
s
.
timeout
);
m_ui
.
promptToSubmitCheckBox
->
setChecked
(
s
.
promptToSubmit
);
m_ui
.
omitAnnotationDataCheckBox
->
setChecked
(
s
.
omitAnnotationDate
);
m_ui
.
spaceIgnorantBlameCheckBox
->
setChecked
(
s
.
spaceIgnorantBlame
);
}
void
SettingsPageWidget
::
setSystemPath
()
...
...
@@ -83,7 +85,8 @@ QString SettingsPageWidget::searchKeywords() const
<<
' '
<<
m_ui
.
timeoutLabel
->
text
()
<<
' '
<<
m_ui
.
promptToSubmitCheckBox
->
text
()
<<
' '
<<
m_ui
.
omitAnnotationDataCheckBox
->
text
()
<<
' '
<<
m_ui
.
environmentGroupBox
->
title
();
<<
' '
<<
m_ui
.
environmentGroupBox
->
title
()
<<
' '
<<
m_ui
.
spaceIgnorantBlameCheckBox
->
text
();
rc
.
remove
(
QLatin1Char
(
'&'
));
return
rc
;
}
...
...
src/plugins/git/settingspage.ui
View file @
c55b5b7b
...
...
@@ -71,6 +71,9 @@
<string>
Miscellaneous
</string>
</property>
<layout
class=
"QFormLayout"
name=
"formLayout"
>
<property
name=
"fieldGrowthPolicy"
>
<enum>
QFormLayout::ExpandingFieldsGrow
</enum>
</property>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"logCountLabel"
>
<property
name=
"text"
>
...
...
@@ -125,6 +128,13 @@
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"spaceIgnorantBlameCheckBox"
>
<property
name=
"text"
>
<string>
Ignore whitespace changes in annotation
</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
...
...
src/plugins/subversion/settingspage.cpp
View file @
c55b5b7b
...
...
@@ -62,6 +62,7 @@ SubversionSettings SettingsPageWidget::settings() const
if
(
rc
.
user
.
isEmpty
())
rc
.
useAuthentication
=
false
;
rc
.
promptToSubmit
=
m_ui
.
promptToSubmitCheckBox
->
isChecked
();
rc
.
spaceIgnorantAnnotation
=
m_ui
.
spaceIgnorantAnnotationCheckBox
->
isChecked
();
return
rc
;
}
...
...
@@ -73,6 +74,7 @@ void SettingsPageWidget::setSettings(const SubversionSettings &s)
m_ui
.
userGroupBox
->
setChecked
(
s
.
useAuthentication
);
m_ui
.
timeOutSpinBox
->
setValue
(
s
.
timeOutS
);
m_ui
.
promptToSubmitCheckBox
->
setChecked
(
s
.
promptToSubmit
);
m_ui
.
spaceIgnorantAnnotationCheckBox
->
setChecked
(
s
.
spaceIgnorantAnnotation
);
}
QString
SettingsPageWidget
::
searchKeywords
()
const
...
...
@@ -81,7 +83,8 @@ QString SettingsPageWidget::searchKeywords() const
QTextStream
(
&
rc
)
<<
m_ui
.
commandLabel
->
text
()
<<
' '
<<
m_ui
.
usernameLabel
->
text
()
<<
' '
<<
m_ui
.
passwordLabel
->
text
()
<<
' '
<<
m_ui
.
userGroupBox
->
title
();
<<
' '
<<
m_ui
.
userGroupBox
->
title
()
<<
' '
<<
m_ui
.
spaceIgnorantAnnotationCheckBox
->
text
();
rc
.
remove
(
QLatin1Char
(
'&'
));
return
rc
;
}
...
...
src/plugins/subversion/settingspage.ui
View file @
c55b5b7b
...
...
@@ -99,6 +99,13 @@
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"spaceIgnorantAnnotationCheckBox"
>
<property
name=
"text"
>
<string>
Ignore whitespace changes in annotation
</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
...
...
src/plugins/subversion/subversionplugin.cpp
View file @
c55b5b7b
...
...
@@ -717,6 +717,8 @@ void SubversionPlugin::annotate(const QString &workingDir, const QString &file)
QTextCodec
*
codec
=
VCSBase
::
VCSBaseEditor
::
getCodec
(
file
);
QStringList
args
(
QLatin1String
(
"annotate"
));
if
(
m_settings
.
spaceIgnorantAnnotation
)
args
<<
QLatin1String
(
"-x"
)
<<
QLatin1String
(
"-uw"
);
args
.
push_back
(
QLatin1String
(
"-v"
));
args
.
append
(
QDir
::
toNativeSeparators
(
file
));
...
...
src/plugins/subversion/subversionsettings.cpp
View file @
c55b5b7b
...
...
@@ -42,6 +42,7 @@ static const char *userNameOptionC = "--username";
static
const
char
*
passwordOptionC
=
"--password"
;
static
const
char
*
promptToSubmitKeyC
=
"PromptForSubmit"
;
static
const
char
*
timeOutKeyC
=
"TimeOut"
;
static
const
char
*
spaceIgnorantAnnotationKeyC
=
"SpaceIgnorantAnnotation"
;
enum
{
defaultTimeOutS
=
30
};
...
...
@@ -61,7 +62,8 @@ SubversionSettings::SubversionSettings() :
svnCommand
(
defaultCommand
()),
useAuthentication
(
false
),
timeOutS
(
defaultTimeOutS
),
promptToSubmit
(
true
)
promptToSubmit
(
true
),
spaceIgnorantAnnotation
(
true
)
{
}
...
...
@@ -74,6 +76,7 @@ void SubversionSettings::fromSettings(QSettings *settings)
password
=
settings
->
value
(
QLatin1String
(
passwordKeyC
),
QString
()).
toString
();
timeOutS
=
settings
->
value
(
QLatin1String
(
timeOutKeyC
),
defaultTimeOutS
).
toInt
();
promptToSubmit
=
settings
->
value
(
QLatin1String
(
promptToSubmitKeyC
),
true
).
toBool
();
spaceIgnorantAnnotation
=
settings
->
value
(
QLatin1String
(
spaceIgnorantAnnotationKeyC
),
true
).
toBool
();
settings
->
endGroup
();
}
...
...
@@ -86,6 +89,7 @@ void SubversionSettings::toSettings(QSettings *settings) const
settings
->
setValue
(
QLatin1String
(
passwordKeyC
),
password
);
settings
->
setValue
(
QLatin1String
(
promptToSubmitKeyC
),
promptToSubmit
);
settings
->
setValue
(
QLatin1String
(
timeOutKeyC
),
timeOutS
);
settings
->
setValue
(
QLatin1String
(
spaceIgnorantAnnotationKeyC
),
spaceIgnorantAnnotation
);
settings
->
endGroup
();
}
...
...
@@ -96,7 +100,8 @@ bool SubversionSettings::equals(const SubversionSettings &s) const
&&
user
==
s
.
user
&&
password
==
s
.
password
&&
timeOutS
==
s
.
timeOutS
&&
promptToSubmit
==
s
.
promptToSubmit
;
&&
promptToSubmit
==
s
.
promptToSubmit
&&
spaceIgnorantAnnotation
==
s
.
spaceIgnorantAnnotation
;
}
QStringList
SubversionSettings
::
addOptions
(
const
QStringList
&
args
)
const
...
...
src/plugins/subversion/subversionsettings.h
View file @
c55b5b7b
...
...
@@ -64,6 +64,7 @@ struct SubversionSettings
QString
password
;
int
timeOutS
;
bool
promptToSubmit
;
bool
spaceIgnorantAnnotation
;
};
inline
bool
operator
==
(
const
SubversionSettings
&
p1
,
const
SubversionSettings
&
p2
)
...
...
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