diff --git a/src/accountinfo.cpp b/src/accountinfo.cpp --- a/src/accountinfo.cpp +++ b/src/accountinfo.cpp @@ -248,7 +248,7 @@ m_infoToSave = infoToSave; - Q_EMIT changed(!m_infoToSave.isEmpty()); + emit changed(!m_infoToSave.isEmpty()); } QString AccountInfo::cleanName(QString name) const @@ -400,7 +400,7 @@ QString path = gallery->url().toLocalFile(); m_info->face->setIcon(QIcon(path)); m_infoToSave.insert(AccountModel::Face, path); - Q_EMIT changed(true); + emit changed(true); } QStringList AccountInfo::imageFormats() const @@ -440,7 +440,7 @@ CreateAvatarJob *aJob = qobject_cast(job); m_info->face->setIcon(QIcon(aJob->avatarPath())); m_infoToSave.insert(AccountModel::Face, aJob->avatarPath()); - Q_EMIT changed(true); + emit changed(true); } } @@ -459,7 +459,7 @@ { m_info->face->setIcon(QIcon::fromTheme(QStringLiteral("user-identity")).pixmap(48, 48)); m_infoToSave.insert(AccountModel::Face, QString()); - Q_EMIT changed(true); + emit changed(true); } void AccountInfo::changePassword() @@ -472,5 +472,5 @@ } m_infoToSave[AccountModel::Password] = dialog->password(); - Q_EMIT changed(true); + emit changed(true); } diff --git a/src/usermanager.cpp b/src/usermanager.cpp --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -41,7 +41,11 @@ , m_widget(new AccountInfo(m_model, this)) , m_ui(new Ui::KCMUserManager) { - Q_UNUSED(args); + Q_UNUSED(args) + + // No default button + setButtons( Apply | Help); + QVBoxLayout *layout = new QVBoxLayout(); m_ui->setupUi(this); m_ui->accountInfo->setLayout(layout); @@ -61,7 +65,7 @@ connect(m_ui->addBtn, &QAbstractButton::clicked, this, &UserManager::addNewUser); connect(m_ui->removeBtn, &QAbstractButton::clicked, this, &UserManager::removeUser); - connect(m_widget, SIGNAL(changed(bool)), SIGNAL(changed(bool))); + connect(m_widget, &AccountInfo::changed, this, &KCModule::changed); connect(m_model, &QAbstractItemModel::dataChanged, this, &UserManager::dataChanged); } @@ -82,7 +86,7 @@ void UserManager::currentChanged(const QModelIndex& selected, const QModelIndex& previous) { - Q_UNUSED(previous); + Q_UNUSED(previous) m_widget->setModelIndex(selected); bool enabled = false; @@ -97,7 +101,7 @@ void UserManager::dataChanged(const QModelIndex& topLeft, const QModelIndex& topRight) { - Q_UNUSED(topRight); + Q_UNUSED(topRight) if (m_selectionModel->currentIndex() != topLeft) { return; } @@ -133,7 +137,7 @@ bool deleteFiles = result == KMessageBox::Yes ? false : true; m_model->removeAccountKeepingFiles(index.row(), deleteFiles); - Q_EMIT changed(false); + emit changed(false); } #include "usermanager.moc"