Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 07cb3111 authored by Laurent Montel's avatar Laurent Montel 😁

Fix some clazy warning

parent a6eebc2a
......@@ -51,29 +51,29 @@ AccountInfo::AccountInfo(AccountModel* model, QWidget* parent, Qt::WindowFlags f
m_info->formLayout->removeWidget(m_info->passwordEdit);
delete m_info->passwordEdit;
connect(m_info->username, SIGNAL(textEdited(QString)), SLOT(hasChanged()));
connect(m_info->realName, SIGNAL(textEdited(QString)), SLOT(hasChanged()));
connect(m_info->email, SIGNAL(textEdited(QString)), SLOT(hasChanged()));
connect(m_info->administrator, SIGNAL(clicked(bool)), SLOT(hasChanged()));
connect(m_info->automaticLogin, SIGNAL(clicked(bool)), SLOT(hasChanged()));
connect(m_passwordEdit, SIGNAL(focused()), SLOT(changePassword()));
connect(m_passwordEdit, SIGNAL(textEdited(QString)), SLOT(changePassword()));
connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(dataChanged(QModelIndex)));
connect(m_info->username, &QLineEdit::textEdited, this, &AccountInfo::hasChanged);
connect(m_info->realName, &QLineEdit::textEdited, this, &AccountInfo::hasChanged);
connect(m_info->email, &QLineEdit::textEdited, this, &AccountInfo::hasChanged);
connect(m_info->administrator, &QAbstractButton::clicked, this, &AccountInfo::hasChanged);
connect(m_info->automaticLogin, &QAbstractButton::clicked, this, &AccountInfo::hasChanged);
connect(m_passwordEdit, &PasswordEdit::focused, this, &AccountInfo::changePassword);
connect(m_passwordEdit, &QLineEdit::textEdited, this, &AccountInfo::changePassword);
connect(m_model, &QAbstractItemModel::dataChanged, this, &AccountInfo::dataChanged);
m_info->face->setPopupMode(QToolButton::InstantPopup);
QMenu* menu = new QMenu(this);
QAction *gallery = new QAction(i18n("Choose from Gallery..."), this);
gallery->setIcon(QIcon::fromTheme(QLatin1String("shape-choose"))); // TODO proper icon
gallery->setIcon(QIcon::fromTheme(QStringLiteral("shape-choose"))); // TODO proper icon
connect(gallery, &QAction::triggered, this, &AccountInfo::openGallery);
QAction *openAvatar = new QAction(i18n("Load from file..."), this);
openAvatar->setIcon(QIcon::fromTheme(QLatin1String("document-open-folder")));
connect(openAvatar, SIGNAL(triggered(bool)), SLOT(openAvatarSlot()));
openAvatar->setIcon(QIcon::fromTheme(QStringLiteral("document-open-folder")));
connect(openAvatar, &QAction::triggered, this, &AccountInfo::openAvatarSlot);
QAction *editClear = new QAction(i18n("Clear Avatar"), this);
editClear->setIcon(QIcon::fromTheme(QLatin1String("edit-clear")));
connect(editClear, SIGNAL(triggered(bool)), SLOT(clearAvatar()));
editClear->setIcon(QIcon::fromTheme(QStringLiteral("edit-clear")));
connect(editClear, &QAction::triggered, this, &AccountInfo::clearAvatar);
menu->addAction(gallery);
menu->addAction(openAvatar);
......@@ -189,7 +189,7 @@ bool AccountInfo::save()
QFile::remove(faceFile);
KIO::CopyJob* copyJob = KIO::copy(QUrl::fromLocalFile(path), QUrl::fromLocalFile(faceFile), KIO::HideProgressInfo);
connect(copyJob, SIGNAL(finished(KJob*)), SLOT(avatarModelChanged(KJob*)));
connect(copyJob, &KJob::finished, this, &AccountInfo::avatarModelChanged);
copyJob->setUiDelegate(nullptr);
copyJob->setUiDelegateExtension(nullptr);
copyJob->start();
......@@ -435,7 +435,7 @@ void AccountInfo::openAvatarSlot()
QUrl url = QUrl::fromLocalFile(dlg.selectedFiles().first());
CreateAvatarJob *job = new CreateAvatarJob(this);
connect(job, SIGNAL(finished(KJob*)), SLOT(avatarCreated(KJob*)));
connect(job, &KJob::finished, this, &AccountInfo::avatarCreated);
job->setUrl(url);
job->start();
}
......
......@@ -57,7 +57,7 @@ void CreateAvatarJob::doStart()
qCDebug(USER_MANAGER_LOG) << "From: " << m_url << "to: " << m_tmpFile;
KIO::CopyJob* job = KIO::copy(m_url, QUrl::fromLocalFile(m_tmpFile), KIO::HideProgressInfo);
connect(job, SIGNAL(finished(KJob*)), SLOT(copyDone(KJob*)));
connect(job, &KJob::finished, this, &CreateAvatarJob::copyDone);
job->setUiDelegate(nullptr);
job->start();
}
......
......@@ -98,10 +98,10 @@ AccountModel::AccountModel(QObject* parent)
m_kEmailSettings.setProfile(m_kEmailSettings.defaultProfileName());
connect(m_dbus, SIGNAL(UserAdded(QDBusObjectPath)), SLOT(UserAdded(QDBusObjectPath)));
connect(m_dbus, SIGNAL(UserDeleted(QDBusObjectPath)), SLOT(UserDeleted(QDBusObjectPath)));
connect(m_dbus, &OrgFreedesktopAccountsInterface::UserAdded, this, &AccountModel::UserAdded);
connect(m_dbus, &OrgFreedesktopAccountsInterface::UserDeleted, this, &AccountModel::UserDeleted);
connect(m_sessions, SIGNAL(userLogged(uint,bool)), SLOT(userLogged(uint,bool)));
connect(m_sessions, &UserSession::userLogged, this, &AccountModel::userLogged);
}
AccountModel::~AccountModel()
......@@ -356,7 +356,7 @@ void AccountModel::addAccount(const QString& path)
return;
}
connect(acc, SIGNAL(Changed()), SLOT(Changed()));
connect(acc, &OrgFreedesktopAccountsUserInterface::Changed, this, &AccountModel::Changed);
if (uid == getuid()) {
addAccountToCache(path, acc, 0);
return;
......@@ -433,7 +433,7 @@ void AccountModel::UserAdded(const QDBusObjectPath& dbusPath)
if (acc->systemAccount()) {
return;
}
connect(acc, SIGNAL(Changed()), SLOT(Changed()));
connect(acc, &OrgFreedesktopAccountsUserInterface::Changed, this, &AccountModel::Changed);
// First, we modify "new-user" to become the new created user
int row = rowCount();
......
......@@ -33,44 +33,44 @@ ModelTest::ModelTest(QAbstractItemModel *_model, QObject *parent) : QObject(pare
{
Q_ASSERT(model);
connect(model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
this, SLOT(runAllTests()));
connect(model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(runAllTests()));
connect(model, SIGNAL(columnsInserted(QModelIndex,int,int)),
this, SLOT(runAllTests()));
connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
this, SLOT(runAllTests()));
connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(runAllTests()));
connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
this, SLOT(runAllTests()));
connect(model, SIGNAL(layoutAboutToBeChanged()), this, SLOT(runAllTests()));
connect(model, SIGNAL(layoutChanged()), this, SLOT(runAllTests()));
connect(model, SIGNAL(modelReset()), this, SLOT(runAllTests()));
connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
this, SLOT(runAllTests()));
connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(runAllTests()));
connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(runAllTests()));
connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SLOT(runAllTests()));
connect(model, &QAbstractItemModel::columnsAboutToBeInserted,
this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::columnsAboutToBeRemoved,
this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::columnsInserted,
this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::columnsRemoved,
this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::dataChanged,
this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::headerDataChanged,
this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::layoutAboutToBeChanged, this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::layoutChanged, this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::modelReset, this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::rowsAboutToBeInserted,
this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::rowsAboutToBeRemoved,
this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::rowsInserted,
this, &ModelTest::runAllTests);
connect(model, &QAbstractItemModel::rowsRemoved,
this, &ModelTest::runAllTests);
// Special checks for inserting/removing
connect(model, SIGNAL(layoutAboutToBeChanged()),
this, SLOT(layoutAboutToBeChanged()));
connect(model, SIGNAL(layoutChanged()),
this, SLOT(layoutChanged()));
connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int)));
connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)));
connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(rowsInserted(QModelIndex,int,int)));
connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SLOT(rowsRemoved(QModelIndex,int,int)));
connect(model, &QAbstractItemModel::layoutAboutToBeChanged,
this, &ModelTest::layoutAboutToBeChanged);
connect(model, &QAbstractItemModel::layoutChanged,
this, &ModelTest::layoutChanged);
connect(model, &QAbstractItemModel::rowsAboutToBeInserted,
this, &ModelTest::rowsAboutToBeInserted);
connect(model, &QAbstractItemModel::rowsAboutToBeRemoved,
this, &ModelTest::rowsAboutToBeRemoved);
connect(model, &QAbstractItemModel::rowsInserted,
this, &ModelTest::rowsInserted);
connect(model, &QAbstractItemModel::rowsRemoved,
this, &ModelTest::rowsRemoved);
runAllTests();
}
......
......@@ -47,12 +47,12 @@ UserSession::UserSession(QObject* parent): QObject(parent)
qDBusRegisterMetaType<UserInfoList>();
m_manager = new Manager(QStringLiteral("org.freedesktop.login1"), QStringLiteral("/org/freedesktop/login1"), QDBusConnection::systemBus());
connect(m_manager, SIGNAL(UserNew(uint,QDBusObjectPath)), SLOT(UserNew(uint)));
connect(m_manager, SIGNAL(UserRemoved(uint,QDBusObjectPath)), SLOT(UserRemoved(uint)));
connect(m_manager, &OrgFreedesktopLogin1ManagerInterface::UserNew, this, &UserSession::UserNew);
connect(m_manager, &OrgFreedesktopLogin1ManagerInterface::UserRemoved, this, &UserSession::UserRemoved);
QDBusPendingReply <UserInfoList> reply = m_manager->ListUsers();
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(listUsersSlot(QDBusPendingCallWatcher*)));
connect(watcher, &QDBusPendingCallWatcher::finished, this, &UserSession::listUsersSlot);
}
UserSession::~UserSession()
......
......@@ -59,9 +59,9 @@ PasswordDialog::PasswordDialog(QWidget* parent, Qt::WindowFlags flags)
KColorScheme::adjustForeground(m_neutral, KColorScheme::NeutralText, strenghtLbl->foregroundRole());
KColorScheme::adjustForeground(m_positive, KColorScheme::PositiveText, strenghtLbl->foregroundRole());
connect(m_timer, SIGNAL(timeout()), SLOT(checkPassword()));
connect(passwordEdit, SIGNAL(textEdited(QString)), SLOT(passwordChanged()));
connect(verifyEdit, SIGNAL(textEdited(QString)), SLOT(passwordChanged()));
connect(m_timer, &QTimer::timeout, this, &PasswordDialog::checkPassword);
connect(passwordEdit, &QLineEdit::textEdited, this, &PasswordDialog::passwordChanged);
connect(verifyEdit, &QLineEdit::textEdited, this, &PasswordDialog::passwordChanged);
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
......
......@@ -51,7 +51,7 @@ UserManager::UserManager(QWidget* parent, const QVariantList& args)
layout->addWidget(m_widget);
m_selectionModel = new QItemSelectionModel(m_model);
connect(m_selectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(currentChanged(QModelIndex,QModelIndex)));
connect(m_selectionModel, &QItemSelectionModel::currentChanged, this, &UserManager::currentChanged);
m_selectionModel->setCurrentIndex(m_model->index(0), QItemSelectionModel::SelectCurrent);
m_ui->userList->setModel(m_model);
......@@ -61,10 +61,10 @@ UserManager::UserManager(QWidget* parent, const QVariantList& args)
ModelTest* test = new ModelTest(m_model, nullptr);
Q_UNUSED(test)
connect(m_ui->addBtn, SIGNAL(clicked(bool)), SLOT(addNewUser()));
connect(m_ui->removeBtn, SIGNAL(clicked(bool)), SLOT(removeUser()));
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_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(dataChanged(QModelIndex,QModelIndex)));
connect(m_model, &QAbstractItemModel::dataChanged, this, &UserManager::dataChanged);
}
UserManager::~UserManager()
......
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