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
PIM
Akonadi
Commits
686fc722
Verified
Commit
686fc722
authored
Aug 05, 2020
by
Daniel Vrátil
🤖
Browse files
Port away from deprecated method
parent
77c5d7dd
Changes
6
Hide whitespace changes
Inline
Side-by-side
autotests/libs/mimetypecheckertest.cpp
View file @
686fc722
...
...
@@ -67,8 +67,14 @@ void MimeTypeCheckerTest::initTestCase()
QCOMPARE
(
mCalendarChecker
.
wantedMimeTypes
(),
QStringList
()
<<
textCalendar
);
QCOMPARE
(
mSubTypeChecker
.
wantedMimeTypes
().
count
(),
2
);
const
QSet
<
QString
>
calendarSubTypes
=
QSet
<
QString
>::
fromList
(
mCalendarSubTypes
);
const
QSet
<
QString
>
wantedSubTypes
=
QSet
<
QString
>::
fromList
(
mSubTypeChecker
.
wantedMimeTypes
());
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
const
auto
calendarSubTypes
=
QSet
<
QString
>::
fromList
(
mCalendarSubTypes
);
const
auto
wantedSubTypes
=
QSet
<
QString
>::
fromList
(
mSubTypeChecker
.
wantedMimeTypes
());
#else
const
auto
calendarSubTypes
=
QSet
<
QString
>
(
mCalendarSubTypes
.
begin
(),
mCalendarSubTypes
.
end
());
const
auto
wantedMimeTypes
=
mSubTypeChecker
.
wantedMimeTypes
();
const
auto
wantedSubTypes
=
QSet
<
QString
>
(
wantedMimeTypes
.
begin
(),
wantedMimeTypes
.
end
());
#endif
QCOMPARE
(
wantedSubTypes
,
calendarSubTypes
);
QCOMPARE
(
mAliasChecker
.
wantedMimeTypes
().
count
(),
1
);
...
...
autotests/shared/akrangestest.cpp
View file @
686fc722
...
...
@@ -85,13 +85,21 @@ private Q_SLOTS:
QVector
<
int
>
in
=
{
1
,
2
,
3
,
4
,
5
};
QCOMPARE
(
in
|
Actions
::
toQList
,
in
.
toList
());
QCOMPARE
(
in
|
Actions
::
toQList
|
Actions
::
toQVector
,
in
);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QCOMPARE
(
in
|
Actions
::
toQSet
,
in
.
toList
().
toSet
());
// clazy:exclude=container-anti-pattern
#else
QCOMPARE
(
in
|
Actions
::
toQSet
,
QSet
<
int
>
(
in
.
begin
(),
in
.
end
()));
#endif
}
{
QList
<
int
>
in
=
{
1
,
2
,
3
,
4
,
5
};
QCOMPARE
(
in
|
Actions
::
toQVector
,
in
.
toVector
());
QCOMPARE
(
in
|
Actions
::
toQVector
|
Actions
::
toQList
,
in
);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QCOMPARE
(
in
|
Actions
::
toQSet
,
in
.
toSet
());
#else
QCOMPARE
(
in
|
Actions
::
toQSet
,
QSet
<
int
>
(
in
.
begin
(),
in
.
end
()));
#endif
}
}
...
...
src/core/mimetypechecker.cpp
View file @
686fc722
...
...
@@ -48,7 +48,11 @@ bool MimeTypeChecker::hasWantedMimeTypes() const
void
MimeTypeChecker
::
setWantedMimeTypes
(
const
QStringList
&
mimeTypes
)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
d
->
mWantedMimeTypes
=
QSet
<
QString
>::
fromList
(
mimeTypes
);
#else
d
->
mWantedMimeTypes
=
QSet
<
QString
>
(
mimeTypes
.
begin
(),
mimeTypes
.
end
());
#endif
}
void
MimeTypeChecker
::
addWantedMimeType
(
const
QString
&
mimeType
)
...
...
src/core/session.cpp
View file @
686fc722
...
...
@@ -26,6 +26,7 @@
#include <QTimer>
#include <QThread>
#include <QPointer>
#include <QRandomGenerator>
#include <QHostAddress>
#include <QApplication>
...
...
@@ -316,7 +317,7 @@ void SessionPrivate::init(const QByteArray &id)
sessionId
=
id
;
}
else
{
sessionId
=
QCoreApplication
::
instance
()
->
applicationName
().
toUtf8
()
+
'-'
+
QByteArray
::
number
(
qrand
());
+
'-'
+
QByteArray
::
number
(
QRandomGenerator
::
global
()
->
generate
());
}
qCDebug
(
AKONADICORE_LOG
)
<<
"Initializing session with ID"
<<
id
;
...
...
src/private/imapparser.cpp
View file @
686fc722
...
...
@@ -312,7 +312,11 @@ QByteArray ImapParser::join(const QList<QByteArray> &list, const QByteArray &sep
QByteArray
ImapParser
::
join
(
const
QSet
<
QByteArray
>
&
set
,
const
QByteArray
&
separator
)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
const
QList
<
QByteArray
>
list
=
QList
<
QByteArray
>::
fromSet
(
set
);
#else
const
QList
<
QByteArray
>
list
(
set
.
begin
(),
set
.
end
());
#endif
return
ImapParser
::
join
(
list
,
separator
);
}
...
...
src/server/handler/itemmovehandler.cpp
View file @
686fc722
...
...
@@ -49,7 +49,7 @@ void ItemMoveHandler::itemsRetrieved(const QVector<qint64> &ids)
const
QDateTime
mtime
=
QDateTime
::
currentDateTimeUtc
();
// Split the list by source collection
QMap
<
Entity
::
Id
/* collection */
,
PimItem
>
toMove
;
QM
ultiM
ap
<
Entity
::
Id
/* collection */
,
PimItem
>
toMove
;
QMap
<
Entity
::
Id
/* collection */
,
Collection
>
sources
;
ImapSet
toMoveIds
;
for
(
PimItem
item
:
items
)
{
//krazy:exclude=foreach
...
...
@@ -82,7 +82,7 @@ void ItemMoveHandler::itemsRetrieved(const QVector<qint64> &ids)
return
;
}
toMove
.
insert
Multi
(
source
.
id
(),
item
);
toMove
.
insert
(
source
.
id
(),
item
);
toMoveIds
.
add
(
QVector
<
qint64
>
{
item
.
id
()
});
}
...
...
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