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
PIM
KAlarm
Commits
63963320
Commit
63963320
authored
Aug 01, 2022
by
David Jarvie
Browse files
QRegExp -> QRegularExpression
parent
5ac7ad15
Pipeline
#211604
passed with stage
in 1 minute and 50 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Changelog
View file @
63963320
KAlarm Change Log
=== Version 3.5.1 (KDE Gear 22.12) --- 1 August 2022 ===
* Improve Qt6 compatibility.
=== Version 3.5.0 (KDE Gear 22.08) --- 19 July 2022 ===
* Provide options to build and/or run KAlarm without any Akonadi dependency.
* Set volume correctly for repeated audio alarms [KDE Bug 456845]
...
...
src/find.cpp
View file @
63963320
...
...
@@ -26,7 +26,7 @@
#include
<QCheckBox>
#include
<QVBoxLayout>
#include
<QGridLayout>
#include
<QReg
Exp
>
#include
<QReg
ularExpression
>
using
namespace
KAlarmCal
;
...
...
@@ -215,7 +215,7 @@ void Find::slotFind()
return
;
mHistory
=
mDialog
->
findHistory
();
// save search history so that it can be displayed again
mOptions
=
mDialog
->
options
()
&
~
FIND_KALARM_OPTIONS
;
if
((
mOptions
&
KFind
::
RegularExpression
)
&&
!
QReg
Exp
(
mDialog
->
pattern
()).
isValid
())
if
((
mOptions
&
KFind
::
RegularExpression
)
&&
!
QReg
ularExpression
(
mDialog
->
pattern
()).
isValid
())
return
;
mOptions
|=
(
mLive
->
isEnabled
()
&&
mLive
->
isChecked
()
?
FIND_LIVE
:
0
)
|
(
mArchived
->
isEnabled
()
&&
mArchived
->
isChecked
()
?
FIND_ARCHIVED
:
0
)
...
...
src/lib/file.cpp
View file @
63963320
/*
* lib/file.cpp - functions to handle files
* Program: kalarm
* SPDX-FileCopyrightText: 2005-202
1
David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2005-202
2
David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
...
...
@@ -18,7 +18,7 @@
#include
<KFileItem>
#include
<QDir>
#include
<QReg
Exp
>
#include
<QReg
ularExpression
>
#include
<QFileDialog>
namespace
File
...
...
@@ -98,10 +98,7 @@ bool showFileErrMessage(const QString& filename, FileErr err, FileErr blankError
if
(
err
!=
FileErr
::
None
)
{
// If file is a local file, remove "file://" from name
QString
file
=
filename
;
const
QRegExp
f
(
QStringLiteral
(
"^file:/+"
));
if
(
f
.
indexIn
(
file
)
>=
0
)
file
=
file
.
mid
(
f
.
matchedLength
()
-
1
);
const
QString
file
=
pathOrUrl
(
filename
);
QString
errmsg
;
switch
(
err
)
...
...
@@ -136,8 +133,9 @@ bool showFileErrMessage(const QString& filename, FileErr err, FileErr blankError
*/
QString
pathOrUrl
(
const
QString
&
url
)
{
static
const
QRegExp
localfile
(
QStringLiteral
(
"^file:/+"
));
return
(
localfile
.
indexIn
(
url
)
>=
0
)
?
url
.
mid
(
localfile
.
matchedLength
()
-
1
)
:
url
;
const
QRegularExpression
re
(
QStringLiteral
(
"^file:/+"
));
const
QRegularExpressionMatch
match
=
re
.
match
(
url
);
return
match
.
hasMatch
()
?
url
.
mid
(
match
.
capturedEnd
(
0
)
-
1
)
:
url
;
}
/******************************************************************************
...
...
@@ -165,7 +163,7 @@ bool browseFile(QString& file, const QString& caption, QString& defaultDir,
bool
existing
,
QWidget
*
parent
)
{
file
.
clear
();
const
QString
initialDir
=
!
initialFile
.
isEmpty
()
?
QString
(
initialFile
).
remove
(
QReg
Exp
(
QLatin1String
(
"/[^/]*$"
)))
const
QString
initialDir
=
!
initialFile
.
isEmpty
()
?
pathOrUrl
(
initialFile
).
remove
(
QReg
ularExpression
(
QLatin1String
(
"/[^/]*$"
)))
:
!
defaultDir
.
isEmpty
()
?
defaultDir
:
QDir
::
homePath
();
// Use AutoQPointer to guard against crash on application exit while
...
...
src/lib/lineedit.cpp
View file @
63963320
...
...
@@ -17,7 +17,6 @@
#include
<KShell>
#include
<QUrl>
#include
<QRegExp>
#include
<QMimeData>
#include
<QDragEnterEvent>
#include
<QDropEvent>
...
...
src/messagedisplayhelper.cpp
View file @
63963320
...
...
@@ -44,7 +44,7 @@
#include
<QUrl>
#include
<QTextBrowser>
#include
<QTemporaryFile>
#include
<QReg
Exp
>
#include
<QReg
ularExpression
>
using
namespace
KAlarmCal
;
...
...
@@ -210,10 +210,10 @@ void MessageDisplayHelper::initTexts()
// start of the translated string, allowing for possible HTML tags
// enclosing "Reminder".
QString
s
=
i18nc
(
"@info"
,
"Reminder"
);
QRegExp
re
(
QStringLiteral
(
"^(<[^>]+>)*"
));
// search for HTML tag "<...>"
(
void
)
re
.
indexIn
(
s
);
const
QRegularExpression
re
(
QStringLiteral
(
"^(<[^>]+>)*"
));
// search for HTML tag "<...>"
const
QRegularExpressionMatch
match
=
re
.
match
(
s
);
// Prefix the time, plus a newline, to "Reminder", inside any HTML tags.
s
.
insert
(
re
.
match
edLength
(
),
mTexts
.
time
+
QLatin1String
(
"<br/>"
));
s
.
insert
(
match
.
capturedEnd
(
0
),
mTexts
.
time
+
QLatin1String
(
"<br/>"
));
mTexts
.
timeFull
=
s
;
}
}
...
...
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