Commit e5c47e07 authored by Shashwat Jolly's avatar Shashwat Jolly

Minor changes - used QtConcurrent, changed NULL to nullptr

parent 595bf8f9
......@@ -69,7 +69,7 @@ bool BaseHandler::createEteSyncEntry(const EteSyncSyncEntry *syncEntry, const Et
return false;
}
EteSyncEntryManagerPtr entryManager = etesync_entry_manager_new(mClientState->client(), collection.remoteId());
EteSyncEntry *entries[] = {entry.get(), NULL};
EteSyncEntry *entries[] = {entry.get(), nullptr};
if (etesync_entry_manager_create(entryManager.get(), entries, collection.remoteRevision())) {
handleConflictError(collection);
mResource->handleError();
......
......@@ -19,7 +19,7 @@
#include <kio/job.h>
#include <QTimer>
#include <QtConcurrent>
#include "etesync_debug.h"
#include "settings.h"
......@@ -33,7 +33,7 @@ EntriesFetchJob::EntriesFetchJob(const EteSync *client, const Akonadi::Collectio
void EntriesFetchJob::start()
{
QTimer::singleShot(0, this, &EntriesFetchJob::fetchEntries);
QtConcurrent::run(this, &EntriesFetchJob::fetchEntries);
}
void EntriesFetchJob::fetchEntries()
......
......@@ -21,7 +21,7 @@
QString QStringFromCharPtr(const CharPtr &str)
{
if (str.get() == NULL) {
if (str.get() == nullptr) {
return QString();
}
QString ret = QString::fromUtf8(str.get());
......
......@@ -24,7 +24,7 @@
#include <memory>
#include <vector>
#define charArrFromQString(str) str.isNull() ? NULL : qUtf8Printable(str)
#define charArrFromQString(str) ((str).isNull() ? nullptr : qUtf8Printable((str)))
struct EteSyncDeleter
{
......
......@@ -30,7 +30,6 @@
#include <AkonadiCore/ItemFetchScope>
#include <KCalendarCore/Event>
#include <KCalendarCore/Todo>
#include <KLocalizedString>
#include <KMessageBox>
#include <QDBusConnection>
......@@ -214,7 +213,7 @@ void EteSyncResource::slotTokenRefreshed(bool successful)
if (!successful) {
if (etesync_get_error_code() == ETESYNC_ERROR_CODE_HTTP) {
qCDebug(ETESYNC_LOG) << "HTTP Error while tokenRefresh - calling reconfigure";
showErrorDialog(QStringLiteral("Your EteSync credentials were changed. Please click OK to re-enter your credentials."), QStringFromCharPtr(CharPtr(etesync_get_error_message())), QStringLiteral("Credentials Changed"));
showErrorDialog(i18n("Your EteSync credentials were changed. Please click OK to re-enter your credentials."), i18n(CharPtr(etesync_get_error_message()).get()), i18n("Credentials Changed"));
qCDebug(ETESYNC_LOG) << "Setting offline";
setOnline(false);
configure(winIdForDialogs());
......
......@@ -19,6 +19,7 @@
#define ETESYNCRESOURCE_H
#include <AkonadiAgentBase/ResourceBase>
#include <KLocalizedString>
#include "calendarhandler.h"
#include "contacthandler.h"
......@@ -79,7 +80,7 @@ private Q_SLOTS:
void slotItemsRetrieved(KJob *job);
void slotCollectionsRetrieved(KJob *job);
void slotTokenRefreshed(bool successful);
void showErrorDialog(const QString &errorText, const QString &errorDetails = QString(), const QString &title = QStringLiteral("Something went wrong"));
void showErrorDialog(const QString &errorText, const QString &errorDetails = QString(), const QString &title = i18n("Something went wrong"));
private:
EteSyncClientState::Ptr mClientState;
......
......@@ -19,7 +19,7 @@
#include <kio/job.h>
#include <QTimer>
#include <QtConcurrent>
using namespace EteSyncAPI;
......@@ -30,7 +30,7 @@ JournalsFetchJob::JournalsFetchJob(EteSync *client, QObject *parent)
void JournalsFetchJob::start()
{
QTimer::singleShot(0, this, &JournalsFetchJob::fetchJournals);
QtConcurrent::run(this, &JournalsFetchJob::fetchJournals);
}
void JournalsFetchJob::fetchJournals()
......
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