Commit b7a26f3b authored by Laurent Montel's avatar Laurent Montel
Browse files

const'ify + use QStringLiteral + remove SLOT usage when not necessary

parent f0de6e61
Pipeline #231780 failed with stage
in 10 minutes and 26 seconds
......@@ -27,10 +27,8 @@ public:
void requestPassword(RequestType request, const QString &serverError) override;
void cancelPasswordRequests() override;
private Q_SLOTS:
void onTokenRequestFinished(KGAPI2::AccountPromise *promise);
private:
void onTokenRequestFinished(KGAPI2::AccountPromise *promise);
ImapResourceBase *const mResource;
QPointer<KGAPI2::AccountPromise> mPendingPromise;
};
......@@ -51,7 +51,7 @@ QString ImapResource::defaultName() const
QByteArray ImapResource::clientId() const
{
return "Kontact IMAP Resource";
return QByteArrayLiteral("Kontact IMAP Resource");
}
QDialog *ImapResource::createConfigureDialog(WId windowId)
......
......@@ -28,6 +28,6 @@ protected:
QString defaultName() const override;
QByteArray clientId() const override;
private Q_SLOTS:
private:
void onConfigurationDone(int result);
};
......@@ -85,7 +85,6 @@ ImapResourceBase::ImapResourceBase(const QString &id)
: ResourceBase(id)
, m_pool(new SessionPool(2, this))
, m_settings(nullptr)
, m_idle(nullptr)
{
QTimer::singleShot(0, this, &ImapResourceBase::updateResourceName);
......
......@@ -46,7 +46,7 @@ void RemoveCollectionRecursiveTask::onMailBoxesReceived(const QList<KIMAP::MailB
// we use a map here that has the level of nesting as key.
QMultiMap<int, KIMAP::MailBoxDescriptor> foldersToDelete;
for (int i = 0; i < descriptors.size(); ++i) {
for (int i = 0, total = descriptors.size(); i < total; ++i) {
const KIMAP::MailBoxDescriptor descriptor = descriptors[i];
if (descriptor.name == mailBox || descriptor.name.startsWith(mailBox + descriptor.separator)) { // a sub folder to delete
......
......@@ -27,12 +27,12 @@ private Q_SLOTS:
void askUserInput(const QString &serverError);
void onPasswordRequestCompleted(const QString &password, bool userRejected);
void onDialogDestroyed();
void slotCancelClicked();
void slotYesClicked();
void slotNoClicked();
void onSettingsDialogFinished(int result);
private:
void slotCancelClicked();
void slotYesClicked();
void slotNoClicked();
QString requestManualAuth(bool *userRejected);
ImapResourceBase *const m_resource;
......
......@@ -56,7 +56,7 @@ public:
Q_REQUIRED_RESULT bool shouldClearCache() const;
private Q_SLOTS:
private:
/**
* Call this if you want the settings saved from this page.
*/
......@@ -65,8 +65,6 @@ private Q_SLOTS:
void slotEncryptionRadioChanged();
void slotSubcriptionCheckboxChanged();
void slotShowServerInfo();
private:
void readSettings();
void populateDefaultAuthenticationOptions();
......
......@@ -20,10 +20,10 @@ int main(int argc, char **argv)
return 1;
}
QString server = app.arguments().at(1);
int port = app.arguments().at(2).toInt();
QString user = app.arguments().at(3);
QString password = app.arguments().at(4);
const QString server = app.arguments().at(1);
const int port = app.arguments().at(2).toInt();
const QString user = app.arguments().at(3);
const QString password = app.arguments().at(4);
qDebug() << "Querying:" << server << port << user << password;
qDebug();
......
Supports Markdown
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