Verified Commit 1bc18f81 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Small fixes in autotests

parent 97fcc9be
......@@ -23,8 +23,11 @@
#include <storage/datastore.h>
#include <storage/parttypehelper.h>
#include "shared/akranges.h"
using namespace Akonadi;
using namespace Akonadi::Server;
using namespace AkRanges;
DbInitializer::~DbInitializer()
{
......@@ -125,11 +128,7 @@ Akonadi::Protocol::FetchCollectionsResponsePtr DbInitializer::listResponse(const
resp->setParentId(col.parentId());
resp->setName(col.name());
if (mimetypes) {
QStringList mts;
for (const Akonadi::Server::MimeType &mt : col.mimeTypes()) {
mts << mt.name();
}
resp->setMimeTypes(mts);
resp->setMimeTypes(col.mimeTypes() | Views::transform(&MimeType::name) | Actions::toQList);
}
resp->setRemoteId(col.remoteId());
resp->setRemoteRevision(col.remoteRevision());
......
......@@ -193,7 +193,7 @@
<xsl:text>QString()</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>QLatin1String("</xsl:text><xsl:value-of select="$columnValue" /><xsl:text>")</xsl:text>
<xsl:text>QStringLiteral("</xsl:text><xsl:value-of select="$columnValue" /><xsl:text>")</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
......@@ -201,7 +201,7 @@
<xsl:text>"</xsl:text><xsl:value-of select="$columnValue" /><xsl:text>"</xsl:text>
</xsl:when>
<xsl:when test="@type = 'QDateTime'">
<xsl:text>QDateTime::fromString(QLatin1String("</xsl:text><xsl:value-of select="$columnValue" /><xsl:text>"), Qt::ISODate)</xsl:text>
<xsl:text>QDateTime::fromString(QStringLiteral("</xsl:text><xsl:value-of select="$columnValue" /><xsl:text>"), Qt::ISODate)</xsl:text>
</xsl:when>
</xsl:choose>
<xsl:text>);
......
......@@ -135,7 +135,7 @@ QString FakeAkonadiServer::instanceName()
TestScenario::List FakeAkonadiServer::loginScenario(const QByteArray &sessionId)
{
SchemaVersion schema = SchemaVersion::retrieveAll().first();
SchemaVersion schema = SchemaVersion::retrieveAll().at(0);
auto hello = Protocol::HelloResponsePtr::create();
hello->setServerName(QStringLiteral("Akonadi"));
......@@ -316,7 +316,7 @@ void FakeAkonadiServer::runTest()
QEventLoop serverLoop;
connect(mClient.get(), &QThread::finished,
this, [this, &serverLoop]() {
this, [this, &serverLoop]() { // clazy:exclude=lambda-in-connect
disconnect(mClient.get(), &QThread::finished, this, nullptr);
// Flush any pending notifications and wait for them
// before shutting down the event loop
......
......@@ -27,8 +27,8 @@ InspectableNotificationCollector::InspectableNotificationCollector(AkonadiServer
{
}
void InspectableNotificationCollector::notify(Protocol::ChangeNotificationList ntfs)
void InspectableNotificationCollector::notify(Protocol::ChangeNotificationList &&ntfs)
{
Q_EMIT notifySignal(ntfs);
NotificationCollector::notify(ntfs);
NotificationCollector::notify(std::move(ntfs));
}
......@@ -35,7 +35,7 @@ public:
InspectableNotificationCollector(AkonadiServer &akonadi, DataStore *store);
~InspectableNotificationCollector() override = default;
void notify(Protocol::ChangeNotificationList ntfs) override;
void notify(Protocol::ChangeNotificationList &&ntfs) override;
Q_SIGNALS:
void notifySignal(const Akonadi::Protocol::ChangeNotificationList &msgs);
......
......@@ -46,7 +46,7 @@
AkCoreApplication app(argc, argv); \
KCrash::setDrKonqiEnabled(false); \
app.addCommandLineOptions(QCommandLineOption( \
QLatin1String("no-cleanup"), QLatin1String("Don't clean up the temporary runtime environment"))); \
QStringLiteral("no-cleanup"), QStringLiteral("Don't clean up the temporary runtime environment"))); \
app.parseCommandLine(); \
TestObject tc; \
return QTest::qExec(&tc, argc, argv); \
......
......@@ -43,8 +43,7 @@ Dialog::Dialog(QWidget *parent)
mFilter->addItem(QStringLiteral("text/calendar"));
mFilter->addItem(QStringLiteral("text/directory"));
mFilter->addItem(QStringLiteral("message/rfc822"));
connect(mFilter, SIGNAL(activated(int)),
this, SLOT(filterChanged(int)));
connect(mFilter, qOverload<int>(&QComboBox::activated), this, &Dialog::filterChanged);
mWidget = new Akonadi::AgentTypeWidget(this);
connect(mWidget, &Akonadi::AgentTypeWidget::currentChanged,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment