Commit 5073cd28 authored by Laurent Montel's avatar Laurent Montel 😁

Clean up

parent 738d9f31
......@@ -35,11 +35,9 @@ public:
// automatically called by KJob
void start() override;
private Q_SLOTS:
private:
// This will be called once the request is finished.
void onRequestFinished();
private:
Akonadi::Collection::List mResultCollections;
QString mCollectionName;
int mRefreshInterval;
......
......@@ -34,11 +34,9 @@ public:
// automatically called by KJob
void start() override;
private Q_SLOTS:
private:
// This will be called once the request is finished.
void onRequestFinished();
private:
Akonadi::Item mResultItem;
};
......
......@@ -35,12 +35,10 @@ public:
// automatically called by KJob
void start() override;
private Q_SLOTS:
// This will be called once the request is finished.
void onRequestFinished();
private:
Akonadi::Collection::Id mCollectionId;
// This will be called once the request is finished.
void onRequestFinished();
Akonadi::Item::List mResultItems;
};
......
......@@ -44,11 +44,9 @@ public:
// automatically called by KJob
void start() override;
private Q_SLOTS:
private:
// This will be called once the request is finished.
void onRequestFinished();
private:
// Workaround for https://bugreports.qt-project.org/browse/QTBUG-26161 Qt bug
QString getCurrentISOTime() const;
......
......@@ -231,24 +231,23 @@ void TomboyNotesResource::configure(WId windowId)
}
// Run the configuration dialog an save settings if accepted
if (dialog.exec() != QDialog::Accepted) {
Q_EMIT configurationDialogRejected();
return;
}
dialog.saveSettings();
setAgentName(Settings::collectionName());
if (configurationNotValid()) {
auto job = new TomboyServerAuthenticateJob(mManager, this);
job->setServerURL(Settings::serverURL(), QString());
connect(job, &KJob::result, this, &TomboyNotesResource::onAuthorizationFinished);
job->start();
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Authorization job started";
if (dialog.exec() == QDialog::Accepted) {
dialog.saveSettings();
setAgentName(Settings::collectionName());
if (configurationNotValid()) {
auto job = new TomboyServerAuthenticateJob(mManager, this);
job->setServerURL(Settings::serverURL(), QString());
connect(job, &KJob::result, this, &TomboyNotesResource::onAuthorizationFinished);
job->start();
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Authorization job started";
} else {
synchronize();
}
Q_EMIT configurationDialogAccepted();
} else {
synchronize();
Q_EMIT configurationDialogRejected();
}
Q_EMIT configurationDialogAccepted();
}
void TomboyNotesResource::itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection)
......
......@@ -28,8 +28,8 @@ class TomboyNotesResource : public Akonadi::ResourceBase, public Akonadi::AgentB
Q_OBJECT
public:
TomboyNotesResource(const QString &id);
~TomboyNotesResource();
explicit TomboyNotesResource(const QString &id);
~TomboyNotesResource() override;
public Q_SLOTS:
void configure(WId windowId) override;
......
......@@ -28,9 +28,9 @@ class TomboyServerAuthenticateJob : public TomboyJobBase
{
Q_OBJECT
public:
TomboyServerAuthenticateJob(KIO::AccessManager *manager, QObject *parent = nullptr);
explicit TomboyServerAuthenticateJob(KIO::AccessManager *manager, QObject *parent = nullptr);
~TomboyServerAuthenticateJob();
~TomboyServerAuthenticateJob() override;
QString getRequestToken() const;
QString getRequestTokenSecret() const;
......
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