Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SDK
Dolphin Plugins
Commits
a4b32428
Commit
a4b32428
authored
Aug 04, 2022
by
Laurent Montel
Browse files
Use QREgularExpression
parent
209e9c58
Pipeline
#212684
passed with stage
in 53 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
git/checkoutdialog.cpp
View file @
a4b32428
...
...
@@ -20,6 +20,7 @@
#include
<QVBoxLayout>
#include
<QDialogButtonBox>
#include
<QPushButton>
#include
<QRegularExpression>
CheckoutDialog
::
CheckoutDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
,
Qt
::
Dialog
),
...
...
@@ -213,7 +214,7 @@ void CheckoutDialog::setOkButtonState()
m_newBranchName
->
setToolTip
(
tt
);
okButton
->
setToolTip
(
tt
);
}
if
(
newBranchName
.
contains
(
QReg
Exp
(
"
\\
s"
)))
{
if
(
newBranchName
.
contains
(
QReg
ularExpression
(
"
\\
s"
)))
{
enableButton
=
false
;
newNameError
=
true
;
const
QString
tt
=
i18nc
(
"@info:tooltip"
,
"Branch names may not contain any whitespace."
);
...
...
git/tagdialog.cpp
View file @
a4b32428
...
...
@@ -21,6 +21,7 @@
#include
<QLabel>
#include
<QLineEdit>
#include
<QDialogButtonBox>
#include
<QRegularExpression>
TagDialog
::
TagDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
,
Qt
::
Dialog
),
...
...
@@ -125,7 +126,7 @@ void TagDialog::setOkButtonState()
if
(
tagName
.
isEmpty
())
{
toolTip
=
i18nc
(
"@info:tooltip"
,
"You must enter a tag name first."
);
}
else
if
(
tagName
.
contains
(
QReg
Exp
(
"
\\
s"
)))
{
else
if
(
tagName
.
contains
(
QReg
ularExpression
(
"
\\
s"
)))
{
toolTip
=
i18nc
(
"@info:tooltip"
,
"Tag names may not contain any whitespace."
);
}
else
if
(
m_tagNames
.
contains
(
tagName
))
{
...
...
hg/fileviewhgplugin.cpp
View file @
a4b32428
...
...
@@ -41,6 +41,7 @@
#include
<KLocalizedString>
#include
<KPluginFactory>
#include
<QRegularExpression>
K_PLUGIN_CLASS_WITH_JSON
(
FileViewHgPlugin
,
"fileviewhgplugin.json"
)
...
...
@@ -780,7 +781,7 @@ void FileViewHgPlugin::rollback()
}
// get what will be rolled back
QString
lastTransaction
=
m_hgWrapper
->
readAllStandardOutput
();
int
cutOfFrom
=
lastTransaction
.
indexOf
(
QReg
Exp
(
"
\\
d"
));
int
cutOfFrom
=
lastTransaction
.
indexOf
(
QReg
ularExpression
(
"
\\
d"
));
lastTransaction
=
lastTransaction
.
mid
(
cutOfFrom
);
// ask
...
...
hg/hgwrapper.cpp
View file @
a4b32428
...
...
@@ -10,6 +10,7 @@
#include
<QTextCodec>
#include
<QUrl>
#include
<QDebug>
#include
<QRegularExpression>
//TODO: Replace start() with executeCommand functions wherever possible.
//FIXME: Add/Remove/Revert argument length limit. Divide the list.
...
...
@@ -291,7 +292,7 @@ QStringList HgWrapper::getTags()
while
(
m_process
.
waitForReadyRead
())
{
char
buffer
[
1048
];
while
(
m_process
.
readLine
(
buffer
,
sizeof
(
buffer
))
>
0
)
{
result
<<
QString
(
buffer
).
split
(
QReg
Exp
(
"
\\
s+"
),
result
<<
QString
(
buffer
).
split
(
QReg
ularExpression
(
"
\\
s+"
),
Qt
::
SkipEmptyParts
).
first
();
}
}
...
...
@@ -308,7 +309,7 @@ QStringList HgWrapper::getBranches()
// 'hg branches' command lists the branches in following format
// <branchname> <revision:changeset_hash> [(inactive)]
// Extract just the branchname
result
<<
QString
(
buffer
).
remove
(
QReg
Exp
(
"[
\\
s]+[
\\
d:a-zA-Z
\\
(
\\
)]*"
));
result
<<
QString
(
buffer
).
remove
(
QReg
ularExpression
(
"[
\\
s]+[
\\
d:a-zA-Z
\\
(
\\
)]*"
));
}
}
return
result
;
...
...
svn/svncommands.cpp
View file @
a4b32428
...
...
@@ -397,29 +397,29 @@ QSharedPointer< QVector<logEntry> > SvnCommands::getLog(const QString& filePath,
QXmlStreamReader
xml
(
&
process
);
int
itemsAppended
=
0
;
if
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
"log"
)
{
if
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
QLatin1String
(
"log"
)
)
{
while
(
!
xml
.
atEnd
()
&&
xml
.
readNext
()
!=
QXmlStreamReader
::
EndDocument
)
{
if
(
!
xml
.
isStartElement
()
||
xml
.
name
()
!=
"logentry"
)
{
if
(
!
xml
.
isStartElement
()
||
xml
.
name
()
!=
QLatin1String
(
"logentry"
)
)
{
continue
;
}
logEntry
entry
;
entry
.
revision
=
xml
.
attributes
().
value
(
"revision"
).
toULong
();
if
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
"author"
)
{
if
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
QLatin1String
(
"author"
)
)
{
entry
.
author
=
xml
.
readElementText
();
}
if
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
"date"
)
{
if
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
QLatin1String
(
"date"
)
)
{
entry
.
date
=
QDateTime
::
fromString
(
xml
.
readElementText
(),
Qt
::
ISODateWithMs
);
}
if
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
"paths"
)
{
while
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
"path"
)
{
if
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
QLatin1String
(
"paths"
)
)
{
while
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
QLatin1String
(
"path"
)
)
{
affectedPath
path
;
path
.
action
=
xml
.
attributes
().
value
(
"action"
).
toString
();
path
.
propMods
=
xml
.
attributes
().
value
(
"prop-mods"
).
toString
()
==
"true"
;
path
.
textMods
=
xml
.
attributes
().
value
(
"text-mods"
).
toString
()
==
"true"
;
path
.
propMods
=
xml
.
attributes
().
value
(
"prop-mods"
).
toString
()
==
QLatin1String
(
"true"
)
;
path
.
textMods
=
xml
.
attributes
().
value
(
"text-mods"
).
toString
()
==
QLatin1String
(
"true"
)
;
path
.
kind
=
xml
.
attributes
().
value
(
"kind"
).
toString
();
path
.
path
=
xml
.
readElementText
();
...
...
@@ -428,7 +428,7 @@ QSharedPointer< QVector<logEntry> > SvnCommands::getLog(const QString& filePath,
}
}
if
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
"msg"
)
{
if
(
xml
.
readNextStartElement
()
&&
xml
.
name
()
==
QLatin1String
(
"msg"
)
)
{
entry
.
msg
=
xml
.
readElementText
();
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment