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

Add missing const + add Q_REQUIRED_RESULT

parent 18240a9a
......@@ -28,17 +28,17 @@ public:
void start() override;
Akonadi::Item::List items() const
Q_REQUIRED_RESULT Akonadi::Item::List items() const
{
return mItems;
}
Akonadi::Item::List removedItems() const
Q_REQUIRED_RESULT Akonadi::Item::List removedItems() const
{
return mRemovedItems;
}
Akonadi::Collection collection() const
Q_REQUIRED_RESULT Akonadi::Collection collection() const
{
return mCollection;
}
......@@ -48,7 +48,7 @@ protected:
void setupItem(const EtebaseItem *etesyncItem, const QString &type);
private:
const EteSyncClientState *mClientState = nullptr;
const EteSyncClientState *const mClientState;
Akonadi::Collection mCollection;
const EtebaseCollectionPtr mEtesyncCollection;
Akonadi::Item::List mItems;
......
......@@ -45,17 +45,17 @@ public:
return mAccount.get();
}
QString username() const
Q_REQUIRED_RESULT QString username() const
{
return mUsername;
}
QString serverUrl() const
Q_REQUIRED_RESULT QString serverUrl() const
{
return mServerUrl;
}
bool isInitialized()
Q_REQUIRED_RESULT bool isInitialized() const
{
return !mServerUrl.isEmpty();
}
......
......@@ -45,10 +45,10 @@ protected:
void initialise();
Akonadi::Collection createRootCollection();
Q_REQUIRED_RESULT Akonadi::Collection createRootCollection();
void initialiseDirectory(const QString &path) const;
QString baseDirectoryPath() const;
Q_REQUIRED_RESULT QString baseDirectoryPath() const;
bool handleError();
bool handleError(const int errorCode, const QString &errorMessage);
......
......@@ -66,29 +66,29 @@ LoginPage::LoginPage(QWidget *parent)
QFormLayout *layout = new QFormLayout(this);
mLoginLabel = new QLabel;
mLoginLabel = new QLabel(this);
mLoginLabel->setWordWrap(true);
layout->addWidget(mLoginLabel);
mUserName = new QLineEdit;
mUserName = new QLineEdit(this);
layout->addRow(i18n("Username:"), mUserName);
registerField(QStringLiteral("credentialsUserName*"), mUserName);
mPassword = new KPasswordLineEdit;
mPassword = new KPasswordLineEdit(this);
layout->addRow(i18n("Password:"), mPassword);
registerField(QStringLiteral("credentialsPassword*"), mPassword, "password", SIGNAL(passwordChanged(QString)));
mAdvancedSettings = new QCheckBox(i18n("Advanced settings"), this);
layout->addWidget(mAdvancedSettings);
mServerUrl = new QLineEdit;
mServerUrl = new QLineEdit(this);
mServerUrl->setVisible(false);
layout->addRow(i18n("Server:"), mServerUrl);
registerField(QStringLiteral("credentialsServerUrl"), mServerUrl);
layout->labelForField(mServerUrl)->setVisible(false);
mProgressBar = new QProgressBar;
mProgressBar = new QProgressBar(this);
mProgressBar->setVisible(false);
mProgressBar->setRange(0, 0);
layout->addWidget(mProgressBar);
......@@ -112,7 +112,7 @@ void LoginPage::initializePage()
if (mIsInitialized) {
mAdvancedSettings->setVisible(false);
setField(QStringLiteral("credentialsServerUrl"), static_cast<SetupWizard *>(wizard())->mClientState->serverUrl());
QString username = static_cast<SetupWizard *>(wizard())->mClientState->username();
const QString username = static_cast<SetupWizard *>(wizard())->mClientState->username();
mUserName->setText(username);
mPasswordInfo->setVisible(true);
}
......
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