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
Plasma
Plasma Workspace
Commits
ef4d5d0f
Commit
ef4d5d0f
authored
Feb 18, 2021
by
Alexander Lohnau
💬
Browse files
calculatorrunner: Fix mixed hex+decimal calculations
BUG: 431362
FIXED-IN: 5.21.1
parent
1a6848cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
runners/calculator/calculatorrunner.cpp
View file @
ef4d5d0f
...
@@ -231,7 +231,7 @@ void CalculatorRunner::match(Plasma::RunnerContext &context)
...
@@ -231,7 +231,7 @@ void CalculatorRunner::match(Plasma::RunnerContext &context)
bool
toHex
=
cmd
.
startsWith
(
QLatin1String
(
"hex="
));
bool
toHex
=
cmd
.
startsWith
(
QLatin1String
(
"hex="
));
bool
startsWithEquals
=
!
toHex
&&
cmd
[
0
]
==
QLatin1Char
(
'='
);
bool
startsWithEquals
=
!
toHex
&&
cmd
[
0
]
==
QLatin1Char
(
'='
);
const
static
QRegularExpression
hexRegex
(
QStringLiteral
(
"
^=?0x.
+"
),
QRegularExpression
::
CaseInsensitiveOption
);
const
static
QRegularExpression
hexRegex
(
QStringLiteral
(
"
0x[0-9a-f]
+"
),
QRegularExpression
::
CaseInsensitiveOption
);
const
bool
parseHex
=
cmd
.
contains
(
hexRegex
);
const
bool
parseHex
=
cmd
.
contains
(
hexRegex
);
if
(
!
parseHex
)
{
if
(
!
parseHex
)
{
userFriendlyMultiplication
(
cmd
);
userFriendlyMultiplication
(
cmd
);
...
...
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