Commit ebea2c74 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

run git clang-format

parent 223153c1
......@@ -14,10 +14,10 @@
#include "settings.h"
#include "settingsadaptor.h"
#include <itemfetchscope.h>
#include <AkonadiCore/ServerManager>
#include <MailTransportAkonadi/SentActionAttribute>
#include <MailTransportAkonadi/SentBehaviourAttribute>
#include <AkonadiCore/ServerManager>
#include <itemfetchscope.h>
#include "maildispatcher_debug.h"
#include <KLocalizedString>
......@@ -25,8 +25,8 @@
#include <KNotification>
#include <Kdelibs4ConfigMigrator>
#include <QTimer>
#include <QDBusConnection>
#include <QTimer>
#ifdef MAIL_SERIALIZER_PLUGIN_STATIC
......@@ -75,9 +75,7 @@ void MailDispatcherAgent::dispatch()
mSentItemsSize = 0;
Q_EMIT percent(0);
}
Q_EMIT status(AgentBase::Running,
i18np("Sending messages (1 item in queue)...",
"Sending messages (%1 items in queue)...", mQueue->count()));
Q_EMIT status(AgentBase::Running, i18np("Sending messages (1 item in queue)...", "Sending messages (%1 items in queue)...", mQueue->count()));
qCDebug(MAILDISPATCHER_LOG) << "Attempting to dispatch the next message.";
mSendingInProgress = true;
mQueue->fetchOne(); // will trigger itemFetched
......@@ -128,11 +126,9 @@ MailDispatcherAgent::MailDispatcherAgent(const QString &id)
new SettingsAdaptor(Settings::self());
new MailDispatcherAgentAdaptor(this);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"),
Settings::self(), QDBusConnection::ExportAdaptors);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"), Settings::self(), QDBusConnection::ExportAdaptors);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/MailDispatcherAgent"),
this, QDBusConnection::ExportAdaptors);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/MailDispatcherAgent"), this, QDBusConnection::ExportAdaptors);
QString service = QStringLiteral("org.freedesktop.Akonadi.MailDispatcherAgent");
if (Akonadi::ServerManager::hasInstanceIdentifier()) {
service += QLatin1Char('.') + Akonadi::ServerManager::instanceIdentifier();
......@@ -141,16 +137,11 @@ MailDispatcherAgent::MailDispatcherAgent(const QString &id)
QDBusConnection::sessionBus().registerService(service);
mQueue = new OutboxQueue(this);
connect(mQueue, &OutboxQueue::newItems,
this, &MailDispatcherAgent::dispatch);
connect(mQueue, &OutboxQueue::itemReady,
this, &MailDispatcherAgent::itemFetched);
connect(mQueue, &OutboxQueue::error,
this, &MailDispatcherAgent::queueError);
connect(this, &MailDispatcherAgent::itemProcessed,
mQueue, &OutboxQueue::itemProcessed);
connect(this, &MailDispatcherAgent::abortRequested,
this, &MailDispatcherAgent::abort);
connect(mQueue, &OutboxQueue::newItems, this, &MailDispatcherAgent::dispatch);
connect(mQueue, &OutboxQueue::itemReady, this, &MailDispatcherAgent::itemFetched);
connect(mQueue, &OutboxQueue::error, this, &MailDispatcherAgent::queueError);
connect(this, &MailDispatcherAgent::itemProcessed, mQueue, &OutboxQueue::itemProcessed);
connect(this, &MailDispatcherAgent::abortRequested, this, &MailDispatcherAgent::abort);
mSentActionHandler = new SentActionHandler(this);
......@@ -194,14 +185,12 @@ void MailDispatcherAgent::itemFetched(const Item &item)
mCurrentJob->setMarkAborted();
}
Q_EMIT status(AgentBase::Running, i18nc("Message with given subject is being sent.", "Sending: %1",
item.payload<KMime::Message::Ptr>()->subject()->asUnicodeString()));
Q_EMIT status(AgentBase::Running,
i18nc("Message with given subject is being sent.", "Sending: %1", item.payload<KMime::Message::Ptr>()->subject()->asUnicodeString()));
connect(mCurrentJob, &KJob::result,
this, &MailDispatcherAgent::sendResult);
//TODO wait kf6. For the moment we can't convert to new connect api.
connect(mCurrentJob, SIGNAL(percent(KJob*,ulong)),
this, SLOT(sendPercent(KJob*,ulong)));
connect(mCurrentJob, &KJob::result, this, &MailDispatcherAgent::sendResult);
// TODO wait kf6. For the moment we can't convert to new connect api.
connect(mCurrentJob, SIGNAL(percent(KJob *, ulong)), this, SLOT(sendPercent(KJob *, ulong)));
mCurrentJob->start();
}
......@@ -224,14 +213,13 @@ void MailDispatcherAgent::sendPercent(KJob *job, unsigned long)
// Give the transport 80% of the weight, and move-to-sendmail 20%.
const double transportWeight = 0.8;
const int percentValue = 100 * (mSentItemsSize + job->processedAmount(KJob::Bytes) * transportWeight)
/ (mSentItemsSize + mCurrentItem.size() + mQueue->totalSize());
const int percentValue =
100 * (mSentItemsSize + job->processedAmount(KJob::Bytes) * transportWeight) / (mSentItemsSize + mCurrentItem.size() + mQueue->totalSize());
qCDebug(MAILDISPATCHER_LOG) << "sentItemsSize" << mSentItemsSize
<< "this job processed" << job->processedAmount(KJob::Bytes)
<< "queue totalSize" << mQueue->totalSize()
<< "total total size (sent+current+queue)" << (mSentItemsSize + mCurrentItem.size() + mQueue->totalSize())
<< "new percentage" << percentValue << "old percentage" << progress();
qCDebug(MAILDISPATCHER_LOG) << "sentItemsSize" << mSentItemsSize << "this job processed" << job->processedAmount(KJob::Bytes) << "queue totalSize"
<< mQueue->totalSize() << "total total size (sent+current+queue)"
<< (mSentItemsSize + mCurrentItem.size() + mQueue->totalSize()) << "new percentage" << percentValue << "old percentage"
<< progress();
if (percentValue != progress()) {
// The progress can decrease too, if messages got added to the queue.
......@@ -239,9 +227,7 @@ void MailDispatcherAgent::sendPercent(KJob *job, unsigned long)
}
// It is possible that the number of queued messages has changed.
Q_EMIT status(AgentBase::Running,
i18np("Sending messages (1 item in queue)...",
"Sending messages (%1 items in queue)...", 1 + mQueue->count()));
Q_EMIT status(AgentBase::Running, i18np("Sending messages (1 item in queue)...", "Sending messages (%1 items in queue)...", 1 + mQueue->count()));
}
void MailDispatcherAgent::sendResult(KJob *job)
......
......@@ -43,6 +43,7 @@ protected:
private Q_SLOTS:
void sendPercent(KJob *job, unsigned long percent);
private:
// Q_SLOTS:
void abort();
......
......@@ -11,14 +11,14 @@
#include "maildispatcher_debug.h"
#include <KLocalizedString>
#include <Attribute>
#include <ItemFetchJob>
#include <ItemFetchScope>
#include <Monitor>
#include <Akonadi/KMime/AddressAttribute>
#include <Akonadi/KMime/MessageFlags>
#include <Akonadi/KMime/SpecialMailCollections>
#include <Akonadi/KMime/SpecialMailCollectionsRequestJob>
#include <Attribute>
#include <ItemFetchJob>
#include <ItemFetchScope>
#include <Monitor>
#include <kmime/kmime_message.h>
......@@ -97,8 +97,7 @@ void OutboxQueue::addIfComplete(const Item &item)
const auto *sentBehaviourAttribute = item.attribute<SentBehaviourAttribute>();
Q_ASSERT(sentBehaviourAttribute);
if (sentBehaviourAttribute->sentBehaviour() == SentBehaviourAttribute::MoveToCollection
&& !sentBehaviourAttribute->moveToCollection().isValid()) {
if (sentBehaviourAttribute->sentBehaviour() == SentBehaviourAttribute::MoveToCollection && !sentBehaviourAttribute->moveToCollection().isValid()) {
qCWarning(MAILDISPATCHER_LOG) << "Item " << item.id() << "has invalid sent-mail collection.";
return;
}
......@@ -111,8 +110,7 @@ void OutboxQueue::addIfComplete(const Item &item)
}
*/
if (dispatchModeAttribute->dispatchMode() == DispatchModeAttribute::Automatic
&& dispatchModeAttribute->sendAfter().isValid()
if (dispatchModeAttribute->dispatchMode() == DispatchModeAttribute::Automatic && dispatchModeAttribute->sendAfter().isValid()
&& dispatchModeAttribute->sendAfter() > QDateTime::currentDateTime()) {
// All the above was OK, so accept it for the future.
qCDebug(MAILDISPATCHER_LOG) << "Item" << item.id() << "is accepted to be sent in the future.";
......@@ -319,12 +317,9 @@ OutboxQueue::OutboxQueue(QObject *parent)
mMonitor = new Monitor(this);
mMonitor->itemFetchScope().fetchAllAttributes();
mMonitor->itemFetchScope().fetchFullPayload(false);
connect(mMonitor, &Monitor::itemAdded,
this, &OutboxQueue::itemAdded);
connect(mMonitor, &Monitor::itemChanged,
this, &OutboxQueue::itemChanged);
connect(mMonitor, &Monitor::itemMoved,
this, &OutboxQueue::itemMoved);
connect(mMonitor, &Monitor::itemAdded, this, &OutboxQueue::itemAdded);
connect(mMonitor, &Monitor::itemChanged, this, &OutboxQueue::itemChanged);
connect(mMonitor, &Monitor::itemMoved, this, &OutboxQueue::itemMoved);
connect(mMonitor, &Monitor::itemRemoved, this, &OutboxQueue::itemRemoved);
connect(SpecialMailCollections::self(), &SpecialMailCollections::defaultCollectionsChanged, this, &OutboxQueue::localFoldersChanged);
......@@ -332,7 +327,7 @@ OutboxQueue::OutboxQueue(QObject *parent)
mFutureTimer = new QTimer(this);
connect(mFutureTimer, &QTimer::timeout, this, &OutboxQueue::checkFuture);
mFutureTimer->start(60 * 60 * 1000); // 1 hour
mFutureTimer->start(60 * 60 * 1000); // 1 hour
}
OutboxQueue::~OutboxQueue()
......
......@@ -14,7 +14,8 @@
class KJob;
class QTimer;
namespace Akonadi {
namespace Akonadi
{
class Monitor;
}
......
......@@ -8,32 +8,32 @@
#include "storeresultjob.h"
#include "maildispatcher_debug.h"
#include <Akonadi/KMime/AddressAttribute>
#include <Akonadi/KMime/MessageParts>
#include <Akonadi/KMime/SpecialMailCollections>
#include <AkonadiCore/ServerManager>
#include <KLocalizedString>
#include <MailTransport/Transport>
#include <MailTransport/TransportJob>
#include <MailTransport/TransportManager>
#include <MailTransportAkonadi/SentBehaviourAttribute>
#include <MailTransportAkonadi/TransportAttribute>
#include <QDBusConnection>
#include <agentinstance.h>
#include <agentmanager.h>
#include <collection.h>
#include <QDBusConnection>
#include <collectionfetchjob.h>
#include <item.h>
#include <itemdeletejob.h>
#include <itemmodifyjob.h>
#include <itemmovejob.h>
#include <collectionfetchjob.h>
#include <Akonadi/KMime/AddressAttribute>
#include <Akonadi/KMime/MessageParts>
#include <Akonadi/KMime/SpecialMailCollections>
#include <transportresourcebase.h>
#include "maildispatcher_debug.h"
#include <KLocalizedString>
#include <kmime/kmime_message.h>
#include <MailTransportAkonadi/SentBehaviourAttribute>
#include <MailTransport/Transport>
#include <MailTransportAkonadi/TransportAttribute>
#include <MailTransport/TransportJob>
#include <MailTransport/TransportManager>
#include <AkonadiCore/ServerManager>
#include <transportresourcebase.h>
#include <QTimer>
#include <QDBusInterface>
#include <QDBusReply>
#include <QTimer>
using namespace Akonadi;
using namespace KMime;
......@@ -65,7 +65,7 @@ void SendJob::doTransport()
return;
}
if (!filterItem(8)) { //BeforeOutbound
if (!filterItem(8)) { // BeforeOutbound
return;
}
......@@ -84,13 +84,13 @@ void SendJob::doAkonadiTransport()
Q_ASSERT(!mResourceId.isEmpty());
Q_ASSERT(mInterface == nullptr);
const auto service = Akonadi::ServerManager::agentServiceName(Akonadi::ServerManager::Resource,
mResourceId);
const auto service = Akonadi::ServerManager::agentServiceName(Akonadi::ServerManager::Resource, mResourceId);
mInterface = new QDBusInterface(service,
QStringLiteral("/Transport"),
QStringLiteral("org.freedesktop.Akonadi.Resource.Transport"),
QDBusConnection::sessionBus(), this);
QDBusConnection::sessionBus(),
this);
if (!mInterface->isValid()) {
storeResult(false, i18n("Failed to get D-Bus interface of resource %1.", mResourceId));
......@@ -100,10 +100,8 @@ void SendJob::doAkonadiTransport()
}
// Signals.
QObject::connect(AgentManager::self(), &AgentManager::instanceProgressChanged,
this, &SendJob::resourceProgress);
QObject::connect(mInterface, SIGNAL(transportResult(qlonglong,int,QString)),
this, SLOT(resourceResult(qlonglong,int,QString)));
QObject::connect(AgentManager::self(), &AgentManager::instanceProgressChanged, this, &SendJob::resourceProgress);
QObject::connect(mInterface, SIGNAL(transportResult(qlonglong, int, QString)), this, SLOT(resourceResult(qlonglong, int, QString)));
// Start sending.
const QDBusReply<void> reply = mInterface->call(QStringLiteral("send"), mItem.id());
......@@ -167,20 +165,18 @@ void SendJob::doTraditionalTransport()
// Signals.
connect(job, &TransportJob::result, this, &SendJob::transportResult);
//Wait kf6 We have a private signal
//connect(job, thisOverload<KJob*, ulong>::of(&TransportJob::percent), this, [this](KJob *job,ulong val) {transportPercent(job, val); });
connect(job, SIGNAL(percent(KJob*,ulong)),
this, SLOT(transportPercent(KJob*,ulong)));
// Wait kf6 We have a private signal
// connect(job, thisOverload<KJob*, ulong>::of(&TransportJob::percent), this, [this](KJob *job,ulong val) {transportPercent(job, val); });
connect(job, SIGNAL(percent(KJob *, ulong)), this, SLOT(transportPercent(KJob *, ulong)));
job->start();
}
void SendJob::transportPercent(KJob *job, unsigned long)
{
Q_ASSERT(mCurrentJob == job);
qCDebug(MAILDISPATCHER_LOG) << "Processed amount" << job->processedAmount(KJob::Bytes)
<< "total amount" << job->totalAmount(KJob::Bytes);
qCDebug(MAILDISPATCHER_LOG) << "Processed amount" << job->processedAmount(KJob::Bytes) << "total amount" << job->totalAmount(KJob::Bytes);
setTotalAmount(KJob::Bytes, job->totalAmount(KJob::Bytes)); // Is not set at the time of start().
setTotalAmount(KJob::Bytes, job->totalAmount(KJob::Bytes)); // Is not set at the time of start().
setProcessedAmount(KJob::Bytes, job->processedAmount(KJob::Bytes));
}
......@@ -213,8 +209,7 @@ void SendJob::resourceResult(qlonglong itemId, int result, const QString &messag
delete mInterface; // So that abort() knows the transport job is over.
mInterface = nullptr;
const auto transportResult
= static_cast<TransportResourceBase::TransportResult>(result);
const auto transportResult = static_cast<TransportResourceBase::TransportResult>(result);
const bool success = (transportResult == TransportResourceBase::TransportSucceeded);
......@@ -240,8 +235,7 @@ void SendJob::doPostJob(bool transportSuccess, const QString &transportMessage)
qCDebug(MAILDISPATCHER_LOG) << "Error transporting.";
setError(UserDefinedError);
const QString error = mAborting ? i18n("Message transport aborted.")
: i18n("Failed to transport message.");
const QString error = mAborting ? i18n("Message transport aborted.") : i18n("Failed to transport message.");
setErrorText(error + QLatin1Char(' ') + transportMessage);
storeResult(false, errorString());
......@@ -275,19 +269,19 @@ void SendJob::doPostJob(bool transportSuccess, const QString &transportMessage)
bool SendJob::filterItem(int filterset)
{
const auto service = Akonadi::ServerManager::agentServiceName(Akonadi::ServerManager::Agent,
QStringLiteral("akonadi_mailfilter_agent"));
const auto service = Akonadi::ServerManager::agentServiceName(Akonadi::ServerManager::Agent, QStringLiteral("akonadi_mailfilter_agent"));
QDBusInterface iface(service,
QStringLiteral("/MailFilterAgent"),
QStringLiteral("org.freedesktop.Akonadi.MailFilterAgent"),
QDBusConnection::sessionBus(), this);
QDBusConnection::sessionBus(),
this);
if (!iface.isValid()) {
storeResult(false, i18n("Failed to get D-Bus interface of mailfilteragent."));
return false;
}
//Outbound = 0x2
// Outbound = 0x2
const QDBusReply<void> reply = iface.call(QStringLiteral("filterItem"), mItem.id(), filterset, QString());
if (!reply.isValid()) {
storeResult(false, i18n("Invalid D-Bus reply from mailfilteragent"));
......@@ -332,12 +326,10 @@ void SendJob::postJobResult(KJob *job)
QString errorStr;
switch (attribute->sentBehaviour()) {
case SentBehaviourAttribute::Delete:
errorStr
= i18n("Sending succeeded, but failed to remove the message from the outbox.");
errorStr = i18n("Sending succeeded, but failed to remove the message from the outbox.");
break;
default:
errorStr
= i18n("Sending succeeded, but failed to move the message to the sent-mail folder.");
errorStr = i18n("Sending succeeded, but failed to move the message to the sent-mail folder.");
break;
}
setError(UserDefinedError);
......@@ -345,7 +337,7 @@ void SendJob::postJobResult(KJob *job)
storeResult(false, errorString());
} else {
qCDebug(MAILDISPATCHER_LOG) << "Success deleting or moving to sent-mail.";
if (!filterItem(2)) { //Outbound
if (!filterItem(2)) { // Outbound
return;
}
if (attribute->sentBehaviour() == SentBehaviourAttribute::Delete) {
......
......@@ -7,9 +7,10 @@
#ifndef SENDJOB_H
#define SENDJOB_H
#include <KJob>
#include <AkonadiCore/Item>
namespace Akonadi {
#include <KJob>
namespace Akonadi
{
class Item;
class AgentInstance;
}
......@@ -62,6 +63,7 @@ public:
private Q_SLOTS:
void transportPercent(KJob *job, unsigned long percent);
void resourceResult(qlonglong itemId, int result, const QString &message);
private:
void doAkonadiTransport();
void doTraditionalTransport();
......
......@@ -7,10 +7,10 @@
#include "sentactionhandler.h"
#include "maildispatcher_debug.h"
#include <Akonadi/KMime/MessageFlags>
#include <itemfetchjob.h>
#include <itemmodifyjob.h>
#include <Akonadi/KMime/MessageFlags>
#include "maildispatcher_debug.h"
using namespace MailTransport;
......@@ -21,8 +21,7 @@ SentActionHandler::SentActionHandler(QObject *parent)
void SentActionHandler::runAction(const SentActionAttribute::Action &action)
{
if (action.type() == SentActionAttribute::Action::MarkAsReplied
|| action.type() == SentActionAttribute::Action::MarkAsForwarded) {
if (action.type() == SentActionAttribute::Action::MarkAsReplied || action.type() == SentActionAttribute::Action::MarkAsForwarded) {
const Akonadi::Item item(action.value().toLongLong());
auto job = new Akonadi::ItemFetchJob(item);
connect(job, &Akonadi::ItemFetchJob::result, this, &SentActionHandler::itemFetchResult);
......
......@@ -6,14 +6,14 @@
#include "storeresultjob.h"
#include "maildispatcher_debug.h"
#include <Akonadi/KMime/MessageFlags>
#include <Item>
#include <ItemFetchJob>
#include <ItemModifyJob>
#include <Akonadi/KMime/MessageFlags>
#include "maildispatcher_debug.h"
#include <KLocalizedString>
#include <MailTransportAkonadi/ErrorAttribute>
#include <MailTransportAkonadi/DispatchModeAttribute>
#include <MailTransportAkonadi/ErrorAttribute>
using namespace Akonadi;
using namespace MailTransport;
......
......@@ -9,8 +9,8 @@
#include <TransactionSequence>
#include <QString>
#include <AkonadiCore/Item>
#include <QString>
/**
* This class stores the result of a StoreResultJob in an item.
* First, it removes the 'queued' flag.
......
......@@ -6,11 +6,11 @@
*/
#include "dummymigrator.h"
#include <QTimer>
#include <QDebug>
#include <QTimer>
DummyMigrator::DummyMigrator(const QString &identifier)
: MigratorBase(QLatin1String("dummymigrator") + identifier, QString(), QString())
: MigratorBase(QLatin1String("dummymigrator") + identifier, QString(), QString())
{
}
......
......@@ -5,10 +5,10 @@
*
*/
#include <QTest>
#include <QSignalSpy>
#include <QDebug>
#include <KJobTrackerInterface>
#include <QDebug>
#include <QSignalSpy>
#include <QTest>
#include "../migrationscheduler.h"
#include <migration/migratorbase.h>
......@@ -65,7 +65,8 @@ public:
class TestJobTracker : public KJobTrackerInterface
{
public:
TestJobTracker() : mPercent(0)
TestJobTracker()
: mPercent(0)
{
}
......@@ -224,7 +225,7 @@ private Q_SLOTS:
m1->complete();
//Give the job some time to delete itself
// Give the job some time to delete itself
QTest::qWait(500);
QCOMPARE(jobTracker.mJobs.size(), 0);
......
......@@ -12,14 +12,15 @@
#include <migration/googlegroupware/googleresourcemigrator.h>
#include <KContacts/Addressee>
#include <KWindowSystem>
#include <QDialog>
#include <KLocalizedString>
#include <KUiServerJobTracker>
#include <KWindowSystem>
#include <QDialog>
#include <QDialogButtonBox>
#include <QVBoxLayout>
namespace Akonadi {
namespace Akonadi
{
MigrationAgent::MigrationAgent(const QString &id)
: AgentBase(id)
, mScheduler(new KUiServerJobTracker)
......@@ -42,7 +43,8 @@ void MigrationAgent::configure(WId windowId)
connect(buttonBox, &QDialogButtonBox::rejected, dlg, &QDialog::reject);
topLayout->addWidget(buttonBox);
dlg->setWindowTitle(i18nc("Title of the window that shows the status of the migration agent and offers controls to start/stop individual migration jobs.", "Migration Status"));
dlg->setWindowTitle(i18nc("Title of the window that shows the status of the migration agent and offers controls to start/stop individual migration jobs.",
"Migration Status"));
dlg->resize(600, 300);
if (windowId) {
......
......@@ -8,16 +8,18 @@
#ifndef MIGRATIONAGENT_H
#define MIGRATIONAGENT_H
#include <agentbase.h>
#include "migrationscheduler.h"
#include <agentbase.h>
namespace Akonadi {
namespace Akonadi
{
class MigrationAgent : public AgentBase, public AgentBase::ObserverV2
{
Q_OBJECT
public:
explicit MigrationAgent(const QString &id);
void configure(WId windowId) override;
private:
MigrationScheduler mScheduler;
};
......
......@@ -53,7 +53,7 @@ void MigrationExecutor::onStoppedProcessing()
{
mAlreadyProcessed++;
Q_ASSERT(mTotalAmount > 0);
//TODO: setProcessedAmount would be better, but we need support for suitable units first (there's only files, folders, bytes).
// TODO: setProcessedAmount would be better, but we need support for suitable units first (there's only files, folders, bytes).
setPercent(mAlreadyProcessed * 100.0 / mTotalAmount);
mCurrentMigrator.clear();
executeNext();
......
......@@ -37,7 +37,7 @@ private Q_SLOTS:
void executeNext();
private:
QQueue< QWeakPointer<MigratorBase> > mQueue;
QQueue<QWeakPointer<MigratorBase>> mQueue;
QWeakPointer<MigratorBase> mCurrentMigrator;
bool mSuspended = false;
int mTotalAmount = 0;
......
......@@ -7,46 +7,41 @@
#include "migrationscheduler.h"
#include <KJobTrackerInterface>
#include <KLocalizedString>
#include <QDebug>
#include <QIcon>
#include <KJobTrackerInterface>
#include "migrationexecutor.h"
void LogModel::message(MigratorBase::MessageType type, const QString &msg)
{
switch (type) {
case MigratorBase::Success:
{
case MigratorBase::Success: {
QStandardItem *item = new QStandardItem(QIcon::fromTheme(QStringLiteral("dialog-ok-apply")), msg);
item->setEditable(false);
appendRow(item);
break;
}
case MigratorBase::Skip:
{
case MigratorBase::Skip: {
QStandardItem *item = new QStandardItem(QIcon::fromTheme(QStringLiteral("dialog-ok")), msg);
item->setEditable(false);
appendRow(item);
break;
}
case MigratorBase::Info: