Commit 6d731feb authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use Q_EMIT here

parent 3598e9ef
......@@ -63,10 +63,10 @@ FakeLogindSession::~FakeLogindSession()
void FakeLogindSession::lock()
{
emit Lock();
Q_EMIT Lock();
}
void FakeLogindSession::unlock()
{
emit Unlock();
Q_EMIT Unlock();
}
......@@ -109,7 +109,7 @@ void NoScreensTest::init()
connect(m_shell, &ShellInterface::surfaceCreated, this, [this](ShellSurfaceInterface *surface) {
m_surface = surface->surface();
connect(surface->surface(), &SurfaceInterface::damaged, this, [this, surface] {
emit surfaceShown();
Q_EMIT surfaceShown();
ScreenLocker::KSldApp::self()->lockScreenShown();
surface->surface()->frameRendered(0);
surface->client()->flush();
......
......@@ -58,11 +58,11 @@ Authenticator::~Authenticator() = default;
void Authenticator::tryUnlock(const QString &password)
{
if (isGraceLocked()) {
emit failed();
Q_EMIT failed();
return;
}
m_graceLockTimer->start();
emit graceLockedChanged();
Q_EMIT graceLockedChanged();
if (!m_checkPass) {
m_checkPass = new KCheckPass(AuthenticationMode::Direct, this);
......@@ -70,7 +70,7 @@ void Authenticator::tryUnlock(const QString &password)
setupCheckPass();
} else {
if (!m_checkPass->isReady()) {
emit failed();
Q_EMIT failed();
return;
}
m_checkPass->setPassword(password);
......@@ -268,21 +268,21 @@ void KCheckPass::handleVerify()
if (!GRecvArr(&arr)) {
break;
}
emit message(QString::fromLocal8Bit(arr));
Q_EMIT message(QString::fromLocal8Bit(arr));
::free(arr);
return;
case ConvPutError:
if (!GRecvArr(&arr)) {
break;
}
emit error(QString::fromLocal8Bit(arr));
Q_EMIT error(QString::fromLocal8Bit(arr));
::free(arr);
return;
case ConvPutAuthSucceeded:
emit succeeded();
Q_EMIT succeeded();
return;
case ConvPutAuthFailed:
emit failed();
Q_EMIT failed();
return;
case ConvPutAuthError:
cantCheck();
......@@ -324,7 +324,7 @@ void KCheckPass::reapVerify()
void KCheckPass::cantCheck()
{
// TODO: better signal?
emit failed();
Q_EMIT failed();
}
void KCheckPass::startAuth()
......
......@@ -187,13 +187,13 @@ void Interface::UnThrottle(uint cookie)
void Interface::slotLocked()
{
sendLockReplies();
emit ActiveChanged(true);
Q_EMIT ActiveChanged(true);
}
void Interface::slotUnlocked()
{
sendLockReplies();
emit ActiveChanged(false);
Q_EMIT ActiveChanged(false);
}
void Interface::configure()
......
......@@ -95,7 +95,7 @@ void ScreenLockerKcm::defaults()
void ScreenLockerKcm::updateState()
{
settingsChanged();
emit isDefaultsAppearanceChanged();
Q_EMIT isDefaultsAppearanceChanged();
}
bool ScreenLockerKcm::isSaveNeeded() const
......
......@@ -377,7 +377,7 @@ void KSldApp::lock(EstablishLock establishLock, int attemptCount)
}
if (attemptCount == 0) {
emit aboutToLock();
Q_EMIT aboutToLock();
}
qCDebug(KSCREENLOCKER) << "lock called";
......@@ -403,7 +403,7 @@ void KSldApp::lock(EstablishLock establishLock, int attemptCount)
setForceSoftwareRendering(false);
// start unlock screen process
startLockProcess(establishLock);
emit lockStateChanged();
Q_EMIT lockStateChanged();
}
/*
......@@ -553,8 +553,8 @@ void KSldApp::doUnlock()
endGraceTime();
m_waylandServer->stop();
KNotification::event(QStringLiteral("unlocked"), i18n("Screen unlocked"), QPixmap(), nullptr, KNotification::CloseOnTimeout, QStringLiteral("ksmserver"));
emit unlocked();
emit lockStateChanged();
Q_EMIT unlocked();
Q_EMIT lockStateChanged();
}
bool KSldApp::isFdoPowerInhibited() const
......@@ -602,7 +602,7 @@ void KSldApp::startLockProcess(EstablishLock establishLock)
int fd = m_waylandServer->start();
if (fd == -1) {
qCWarning(KSCREENLOCKER) << "Could not start the Wayland server.";
emit m_lockProcess->errorOccurred(QProcess::FailedToStart);
Q_EMIT m_lockProcess->errorOccurred(QProcess::FailedToStart);
return;
}
......@@ -724,8 +724,8 @@ void KSldApp::lockScreenShown()
}
m_lockState = Locked;
m_lockedTimer.restart();
emit locked();
emit lockStateChanged();
Q_EMIT locked();
Q_EMIT lockStateChanged();
}
void KSldApp::setGreeterEnvironment(const QProcessEnvironment &env)
......
......@@ -55,7 +55,7 @@ LogindIntegration::LogindIntegration(const QDBusConnection &connection, QObject
connect(m_logindServiceWatcher, &QDBusServiceWatcher::serviceUnregistered, this, [this]() {
m_connected = false;
m_sessionPath = QString();
emit connectedChanged();
Q_EMIT connectedChanged();
});
// check whether the logind service is registered
......@@ -146,7 +146,7 @@ void LogindIntegration::commonServiceRegistered(QDBusPendingCallWatcher *watcher
m_bus.connect(*m_service, m_sessionPath, *m_sessionInterface, QStringLiteral("Lock"), this, SIGNAL(requestLock()));
m_bus.connect(*m_service, m_sessionPath, *m_sessionInterface, QStringLiteral("Unlock"), this, SIGNAL(requestUnlock()));
m_connected = true;
emit connectedChanged();
Q_EMIT connectedChanged();
});
// connect to manager object's signals we need
......@@ -175,7 +175,7 @@ void LogindIntegration::inhibit()
return;
}
reply.value().swap(m_inhibitFileDescriptor);
emit inhibited();
Q_EMIT inhibited();
});
}
......
......@@ -94,7 +94,7 @@ void PowerManagement::Private::setCanHibernate(bool set)
return;
}
canHibernate = set;
emit q->canHibernateChanged();
Q_EMIT q->canHibernateChanged();
}
void PowerManagement::Private::setCanSuspend(bool set)
......@@ -103,7 +103,7 @@ void PowerManagement::Private::setCanSuspend(bool set)
return;
}
canSuspend = set;
emit q->canSuspendChanged();
Q_EMIT q->canSuspendChanged();
}
PowerManagement *PowerManagement::instance()
......
......@@ -69,12 +69,12 @@ void AppearanceSettings::load()
if (m_lnfSettings) {
m_lnfSettings->load();
emit m_lnfSettings->configChanged(); // To force the ConfigPropertyMap to reevaluate
Q_EMIT m_lnfSettings->configChanged(); // To force the ConfigPropertyMap to reevaluate
}
if (m_wallpaperSettings) {
m_wallpaperSettings->load();
emit m_wallpaperSettings->configChanged(); // To force the ConfigPropertyMap to reevaluate
Q_EMIT m_wallpaperSettings->configChanged(); // To force the ConfigPropertyMap to reevaluate
}
}
......@@ -93,12 +93,12 @@ void AppearanceSettings::defaults()
{
if (m_lnfSettings) {
m_lnfSettings->setDefaults();
emit m_lnfSettings->configChanged(); // To force the ConfigPropertyMap to reevaluate
Q_EMIT m_lnfSettings->configChanged(); // To force the ConfigPropertyMap to reevaluate
}
if (m_wallpaperSettings) {
m_wallpaperSettings->setDefaults();
emit m_wallpaperSettings->configChanged(); // To force the ConfigPropertyMap to reevaluate
Q_EMIT m_wallpaperSettings->configChanged(); // To force the ConfigPropertyMap to reevaluate
}
}
......@@ -147,7 +147,7 @@ void AppearanceSettings::loadWallpaperConfig()
m_wallpaperIntegration->init();
m_wallpaperSettings = m_wallpaperIntegration->configScheme();
m_wallpaperConfigFile = m_wallpaperIntegration->package().fileUrl(QByteArrayLiteral("ui"), QStringLiteral("config.qml"));
emit currentWallpaperChanged();
Q_EMIT currentWallpaperChanged();
}
void AppearanceSettings::loadLnfConfig()
......
......@@ -104,7 +104,7 @@ KScreenSaverSettings::KScreenSaverSettings(QObject *parent)
auto shortcutItem = new KPropertySkeletonItem(m_store, "shortcut", defaultShortcuts().first());
addItem(shortcutItem, QStringLiteral("shortcut"));
shortcutItem->setNotifyFunction([this] {
emit shortcutChanged();
Q_EMIT shortcutChanged();
});
}
......
......@@ -62,7 +62,7 @@ void WallpaperIntegration::setPluginName(const QString &name)
}
m_pluginName = name;
m_package.setPath(name);
emit packageChanged();
Q_EMIT packageChanged();
}
KConfigLoader *WallpaperIntegration::configScheme()
......
......@@ -137,7 +137,7 @@ void WaylandServer::x11WindowCallback(wl_client *client, wl_resource *resource,
if (s->m_allowedClient->client() != client) {
return;
}
emit s->x11WindowAdded(id);
Q_EMIT s->x11WindowAdded(id);
}
void WaylandServer::suspendSystemCallback(wl_client *client, wl_resource *resource)
......
......@@ -119,7 +119,7 @@ void X11Locker::showLockWindow()
//
void X11Locker::hideLockWindow()
{
emit userActivity();
Q_EMIT userActivity();
m_background->hide();
m_background->lower();
removeVRoot(m_background->winId());
......@@ -284,7 +284,7 @@ bool X11Locker::nativeEventFilter(const QByteArray &eventType, void *message, lo
const uint8_t responseType = event->response_type & ~0x80;
if (globalAccel() && responseType == XCB_KEY_PRESS) {
if (globalAccel()->checkKeyPress(reinterpret_cast<xcb_key_press_event_t *>(event))) {
emit userActivity();
Q_EMIT userActivity();
return true;
}
}
......@@ -295,7 +295,7 @@ bool X11Locker::nativeEventFilter(const QByteArray &eventType, void *message, lo
case XCB_KEY_PRESS:
case XCB_KEY_RELEASE:
case XCB_MOTION_NOTIFY:
emit userActivity();
Q_EMIT userActivity();
if (!m_lockWindows.isEmpty()) {
int x = 0;
int y = 0;
......@@ -388,7 +388,7 @@ bool X11Locker::nativeEventFilter(const QByteArray &eventType, void *message, lo
}
if (xm->window == m_background->winId()) {
m_background->update();
emit lockWindowShown();
Q_EMIT lockWindowShown();
return false;
}
stayOnTop();
......
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