From c7bc384d2e91dc7965c0b39a912858bd00dd54f0 Mon Sep 17 00:00:00 2001 From: ComixHe Date: Fri, 24 Nov 2023 14:50:10 +0800 Subject: [PATCH] chore: suppress compile warnings Signed-off-by: ComixHe --- CMakeLists.txt | 5 +++-- src/auth/AuthMessages.h | 2 +- src/auth/AuthRequest.cpp | 6 +++--- src/common/ConfigReader.cpp | 8 ++++---- src/common/Session.cpp | 6 +++--- src/daemon/Seat.cpp | 2 +- src/daemon/SeatManager.cpp | 8 ++++---- src/daemon/SingleWaylandDisplayServer.cpp | 12 ++++++------ src/greeter/GreeterApp.h | 2 +- src/greeter/SessionModel.cpp | 2 +- src/helper/UserSession.cpp | 1 - src/treeland/helper.cpp | 4 +++- src/treeland/helper.h | 6 +----- .../ext_foreign_toplevel_list_impl.cpp | 10 +++++----- .../foreign_toplevel_manager_impl.cpp | 11 ++++++----- .../protocols/shortcut_manager_impl.cpp | 4 ++-- src/treeland/protocols/socket_manager_impl.cpp | 15 +++++++++------ .../treeland-fake-session/fake-session.cpp | 18 ++++++++---------- src/treeland/treeland-helper/sockethelper.cpp | 2 +- src/treeland/treeland.cpp | 6 +++--- src/treeland/treelandhelper.cpp | 1 - 21 files changed, 65 insertions(+), 66 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff805614c..3afbd3489 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ project(DDM LANGUAGES CXX C) set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) @@ -234,8 +235,8 @@ add_subdirectory(data) add_subdirectory(services) add_subdirectory(src) -#enable_testing() -#add_subdirectory(test) +# enable_testing() +# add_subdirectory(test) # Display feature summary feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/auth/AuthMessages.h b/src/auth/AuthMessages.h index 6aea7483f..42b778b7d 100644 --- a/src/auth/AuthMessages.h +++ b/src/auth/AuthMessages.h @@ -188,7 +188,7 @@ namespace SDDM { inline QDataStream& operator<<(QDataStream &s, const Request &m) { qint32 length = m.prompts.length(); s << length; - for(const Prompt &p : qAsConst(m.prompts)) { + for (const Prompt &p : std::as_const(m.prompts)) { s << p; } return s; diff --git a/src/auth/AuthRequest.cpp b/src/auth/AuthRequest.cpp index 9ccc2d259..110a6a9da 100644 --- a/src/auth/AuthRequest.cpp +++ b/src/auth/AuthRequest.cpp @@ -38,7 +38,7 @@ namespace SDDM { : QObject(parent) { } void AuthRequest::Private::responseChanged() { - for(const AuthPrompt *qap : qAsConst(prompts)) { + for (const AuthPrompt *qap : std::as_const(prompts)) { if (qap->response().isEmpty()) return; } @@ -54,7 +54,7 @@ namespace SDDM { QList promptsCopy(d->prompts); d->prompts.clear(); if (request != nullptr) { - for (const Prompt& p : qAsConst(request->prompts)) { + for (const Prompt &p : std::as_const(request->prompts)) { AuthPrompt *qap = new AuthPrompt(&p, this); d->prompts << qap; if (finishAutomatically()) @@ -96,7 +96,7 @@ namespace SDDM { Request AuthRequest::request() const { Request r; - for (const AuthPrompt* qap : qAsConst(d->prompts)) { + for (const AuthPrompt *qap : std::as_const(d->prompts)) { Prompt p; p.hidden = qap->hidden(); p.message = qap->message(); diff --git a/src/common/ConfigReader.cpp b/src/common/ConfigReader.cpp index 86d998645..f0e190b5a 100644 --- a/src/common/ConfigReader.cpp +++ b/src/common/ConfigReader.cpp @@ -182,7 +182,7 @@ namespace SDDM { } m_fileModificationTime = latestModificationTime; - for (const QString &filepath : qAsConst(files)) { + for (const QString &filepath : std::as_const(files)) { loadInternal(filepath); } } @@ -245,14 +245,14 @@ namespace SDDM { if (entry && !entry->matchesDefault()) remainingEntries.insert(section, entry); else { - for (const ConfigEntryBase *b : qAsConst(section->entries())) + for (const ConfigEntryBase *b : std::as_const(section->entries())) if (!b->matchesDefault()) remainingEntries.insert(section, b); } } else { - for (const ConfigSection *s : qAsConst(m_sections)) { - for (const ConfigEntryBase *b : qAsConst(s->entries())) + for (const ConfigSection *s : std::as_const(m_sections)) { + for (const ConfigEntryBase *b : std::as_const(s->entries())) if (!b->matchesDefault()) remainingEntries.insert(s, b); } diff --git a/src/common/Session.cpp b/src/common/Session.cpp index b856e63bc..724b3686a 100644 --- a/src/common/Session.cpp +++ b/src/common/Session.cpp @@ -216,7 +216,7 @@ namespace SDDM { } QFile file; - for (const auto &path: qAsConst(sessionDirs)) { + for (const auto &path : std::as_const(sessionDirs)) { m_dir.setPath(path); m_fileName = m_dir.absoluteFilePath(fileName); @@ -243,8 +243,8 @@ namespace SDDM { settings.beginGroup(QLatin1String("Desktop Entry")); - auto localizedValue = [&] (const QLatin1String &key) { - for (QString locale : qAsConst(locales)) { + auto localizedValue = [&](const QLatin1String &key) { + for (QString locale : std::as_const(locales)) { QString localizedValue = settings.value(key + QLatin1Char('[') + locale + QLatin1Char(']'), QString()).toString(); if (!localizedValue.isEmpty()) { return localizedValue; diff --git a/src/daemon/Seat.cpp b/src/daemon/Seat.cpp index 742216521..eb9d8adce 100644 --- a/src/daemon/Seat.cpp +++ b/src/daemon/Seat.cpp @@ -96,7 +96,7 @@ namespace SDDM { return; } - QTimer::singleShot(2000, display, [=] { startDisplay(display, tryNr + 1); }); + QTimer::singleShot(2000, display, [this, display, tryNr] { startDisplay(display, tryNr + 1); }); } void Seat::removeDisplay(Display* display) { diff --git a/src/daemon/SeatManager.cpp b/src/daemon/SeatManager.cpp index bd207e61f..f8e35da0a 100644 --- a/src/daemon/SeatManager.cpp +++ b/src/daemon/SeatManager.cpp @@ -57,7 +57,7 @@ namespace SDDM { QDBusPendingReply reply = QDBusConnection::systemBus().asyncCall(canGraphicalMsg); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply); - connect(watcher, &QDBusPendingCallWatcher::finished, this, [=]() { + connect(watcher, &QDBusPendingCallWatcher::finished, this, [watcher, reply, this]() { watcher->deleteLater(); if (!reply.isValid()) return; @@ -105,10 +105,10 @@ namespace SDDM { QDBusPendingReply reply = QDBusConnection::systemBus().asyncCall(listSeatsMsg); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply); - connect(watcher, &QDBusPendingCallWatcher::finished, this, [=]() { + connect(watcher, &QDBusPendingCallWatcher::finished, this, [watcher, reply, this]() { watcher->deleteLater(); const auto seats = reply.value(); - for(const NamedSeatPath &seat : seats) { + for (const NamedSeatPath &seat : seats) { logindSeatAdded(seat.name, seat.path); } }); @@ -155,7 +155,7 @@ namespace SDDM { void SDDM::SeatManager::logindSeatAdded(const QString& name, const QDBusObjectPath& objectPath) { auto logindSeat = new LogindSeat(name, objectPath); - connect(logindSeat, &LogindSeat::canGraphicalChanged, this, [=]() { + connect(logindSeat, &LogindSeat::canGraphicalChanged, this, [this, logindSeat]() { if (logindSeat->canGraphical()) { createSeat(logindSeat->name()); } else { diff --git a/src/daemon/SingleWaylandDisplayServer.cpp b/src/daemon/SingleWaylandDisplayServer.cpp index 6f821f766..3e01fa07c 100644 --- a/src/daemon/SingleWaylandDisplayServer.cpp +++ b/src/daemon/SingleWaylandDisplayServer.cpp @@ -70,11 +70,11 @@ SingleWaylandDisplayServer::SingleWaylandDisplayServer(SocketServer *socketServe qDebug() << "Socket server started."; // connect signals - connect(m_helperServer, &QLocalServer::newConnection, this, [=] { + connect(m_helperServer, &QLocalServer::newConnection, this, [this] { QLocalSocket *socket = m_helperServer->nextPendingConnection(); // connect signals - connect(socket, &QLocalSocket::readyRead, this, [=] { + connect(socket, &QLocalSocket::readyRead, this, [this] { QLocalSocket *socket = qobject_cast(sender()); QDataStream input(socket); @@ -120,8 +120,8 @@ SingleWaylandDisplayServer::SingleWaylandDisplayServer(SocketServer *socketServe connect(socket, &QLocalSocket::disconnected, socket, &QLocalSocket::deleteLater); }); - connect(m_socketServer, &SocketServer::connected, this, [=](QLocalSocket *socket) { - m_greeterSockets << socket; + connect(m_socketServer, &SocketServer::connected, this, [this](QLocalSocket *socket) { + m_greeterSockets << socket; }); connect(m_socketServer, &SocketServer::requestStartHelper, this, [this](QLocalSocket *, const QString &path) { QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); @@ -131,12 +131,12 @@ SingleWaylandDisplayServer::SingleWaylandDisplayServer(SocketServer *socketServe m_helper->setProcessEnvironment(env); m_helper->start(); }); - connect(m_socketServer, &SocketServer::disconnected, this, [=](QLocalSocket *socket) { + connect(m_socketServer, &SocketServer::disconnected, this, [this](QLocalSocket *socket) { m_greeterSockets.removeOne(socket); }); // TODO: use PAM auth again - connect(m_socketServer, &SocketServer::requestActivateUser, this, [this](QLocalSocket *socket, const QString &user){ + connect(m_socketServer, &SocketServer::requestActivateUser, this, [this]([[maybe_unused]] QLocalSocket *socket, const QString &user){ activateUser(user); }); } diff --git a/src/greeter/GreeterApp.h b/src/greeter/GreeterApp.h index 4c41ab30a..c15935da8 100644 --- a/src/greeter/GreeterApp.h +++ b/src/greeter/GreeterApp.h @@ -44,7 +44,7 @@ class GreeterExtensionPlugin : public QQmlEngineExtensionPlugin qmlRegisterType("TreeLand.Greeter", 1, 0, "Proxy"); } - void initializeEngine(QQmlEngine *engine, const char *uri) final + void initializeEngine([[maybe_unused]] QQmlEngine *engine, [[maybe_unused]] const char *uri) final { } }; diff --git a/src/greeter/SessionModel.cpp b/src/greeter/SessionModel.cpp index 6034f5240..bf6f8ed90 100644 --- a/src/greeter/SessionModel.cpp +++ b/src/greeter/SessionModel.cpp @@ -139,7 +139,7 @@ void SessionModel::populate(Session::Type type, const QStringList &dirPaths) { } // read session sessions.removeDuplicates(); - for (auto& session : qAsConst(sessions)) { + for (auto &session : std::as_const(sessions)) { Session *si = new Session(type, session); bool execAllowed = true; QFileInfo fi(si->tryExec()); diff --git a/src/helper/UserSession.cpp b/src/helper/UserSession.cpp index 46093f5b9..4afa15e36 100644 --- a/src/helper/UserSession.cpp +++ b/src/helper/UserSession.cpp @@ -210,7 +210,6 @@ namespace SDDM { QString sessionType = processEnvironment().value(QStringLiteral("XDG_SESSION_TYPE")); QString sessionClass = processEnvironment().value(QStringLiteral("XDG_SESSION_CLASS")); const bool hasDisplayServer = !m_displayServerCmd.isEmpty(); - const bool x11UserSession = sessionType == QLatin1String("x11") && sessionClass == QLatin1String("user"); const bool waylandUserSession = sessionType == QLatin1String("wayland") && sessionClass == QLatin1String("user"); // When the display server is part of the session, we leak the VT into diff --git a/src/treeland/helper.cpp b/src/treeland/helper.cpp index ae3b47dfe..c2ed64d9d 100644 --- a/src/treeland/helper.cpp +++ b/src/treeland/helper.cpp @@ -25,7 +25,6 @@ #include extern "C" { -#define WLR_USE_UNSTABLE #define static #include #include @@ -98,6 +97,7 @@ bool Helper::registerExclusiveZone(WLayerSurface *layerSurface) case Right: infoPtr->m_rightExclusiveMargin += exclusiveZone; Q_EMIT rightExclusiveMarginChanged(); + break; default: Q_UNREACHABLE(); } @@ -133,6 +133,7 @@ bool Helper::unregisterExclusiveZone(WLayerSurface *layerSurface) case Right: infoPtr->m_rightExclusiveMargin -= exclusiveZone; Q_EMIT rightExclusiveMarginChanged(); + break; default: Q_UNREACHABLE(); } @@ -167,6 +168,7 @@ QJSValue Helper::getExclusiveMargins(WLayerSurface *layerSurface) break; case Right: margins.setRight(margins.right() + exclusiveZone); + break; default: Q_UNREACHABLE(); } diff --git a/src/treeland/helper.h b/src/treeland/helper.h index 2c0c868f7..16083a7ba 100644 --- a/src/treeland/helper.h +++ b/src/treeland/helper.h @@ -24,11 +24,7 @@ class Helper : public WSeatEventFilter { Q_OBJECT Q_PROPERTY(WToplevelSurface* activatedSurface READ activatedSurface WRITE setActivateSurface NOTIFY activatedSurfaceChanged FINAL) Q_PROPERTY(WSurfaceItem* resizingItem READ resizingItem NOTIFY resizingItemChanged FINAL) - Q_PROPERTY(WSurfaceItem* movingItem READ movingItem NOTIFY movingItemChanged FINAL) - Q_PROPERTY(quint32 topExclusiveMargin NOTIFY topExclusiveMarginChanged) - Q_PROPERTY(quint32 bottomExclusiveMargin NOTIFY bottomExclusiveMarginChanged) - Q_PROPERTY(quint32 leftExclusiveMargin NOTIFY leftExclusiveMarginChanged) - Q_PROPERTY(quint32 rightExclusiveMargin NOTIFY rightExclusiveMarginChanged) + Q_PROPERTY(WSurfaceItem *movingItem READ movingItem NOTIFY movingItemChanged FINAL) QML_ELEMENT QML_SINGLETON diff --git a/src/treeland/protocols/ext_foreign_toplevel_list_impl.cpp b/src/treeland/protocols/ext_foreign_toplevel_list_impl.cpp index 30d31db8d..26845e1d7 100644 --- a/src/treeland/protocols/ext_foreign_toplevel_list_impl.cpp +++ b/src/treeland/protocols/ext_foreign_toplevel_list_impl.cpp @@ -52,9 +52,9 @@ static const struct ext_foreign_toplevel_list_v1_interface toplevel_list_impl .stop = foreign_toplevel_list_handle_stop, .destroy = resource_handle_destroy }; -void foreign_toplevel_list_handle_stop(struct wl_client *client, struct wl_resource *resource) +void foreign_toplevel_list_handle_stop([[maybe_unused]] struct wl_client *client, struct wl_resource *resource) { - struct ext_foreign_toplevel_list_v1 *handle = foreign_toplevel_list_from_resource(resource); + [[maybe_unused]] struct ext_foreign_toplevel_list_v1 *handle = foreign_toplevel_list_from_resource(resource); // TODO: stop } @@ -137,7 +137,7 @@ void ext_foreign_toplevel_list_bind(struct wl_client *client, } } -void ext_foreign_toplevel_list_handle_display_destroy(struct wl_listener *listener, void *data) +void ext_foreign_toplevel_list_handle_display_destroy(struct wl_listener *listener, [[maybe_unused]] void *data) { struct ext_foreign_toplevel_list_v1 *list = wl_container_of(listener, list, display_destroy); ext_foreign_toplevel_list_v1_destroy(list); @@ -154,8 +154,8 @@ struct ext_foreign_toplevel_list_v1 *ext_foreign_toplevel_list_v1_create(struct handle, ext_foreign_toplevel_list_bind); if (!handle->global) { - free(handle); - return NULL; + delete handle; + return nullptr; } wl_signal_init(&handle->events.destroy); diff --git a/src/treeland/protocols/foreign_toplevel_manager_impl.cpp b/src/treeland/protocols/foreign_toplevel_manager_impl.cpp index c3e703597..070ab0620 100644 --- a/src/treeland/protocols/foreign_toplevel_manager_impl.cpp +++ b/src/treeland/protocols/foreign_toplevel_manager_impl.cpp @@ -22,7 +22,8 @@ static const struct ztreeland_foreign_toplevel_manager_v1_interface foreign_topl .stop = foreign_toplevel_manager_handle_stop }; -void foreign_toplevel_manager_handle_stop(struct wl_client *client, struct wl_resource *resource) +void foreign_toplevel_manager_handle_stop([[maybe_unused]] struct wl_client *client, + [[maybe_unused]] struct wl_resource *resource) { qDebug() << Q_FUNC_INFO; } @@ -118,7 +119,7 @@ void foreign_toplevel_manager_bind(struct wl_client *client, } } -void foreign_toplevel_manager_handle_display_destroy(struct wl_listener *listener, void *data) +void foreign_toplevel_manager_handle_display_destroy(struct wl_listener *listener, [[maybe_unused]] void *data) { struct ztreeland_foreign_toplevel_manager_v1 *manager = wl_container_of(listener, manager, display_destroy); @@ -150,8 +151,8 @@ ztreeland_foreign_toplevel_manager_v1_create(struct wl_display *display) handle, foreign_toplevel_manager_bind); if (!handle->global) { - free(handle); - return NULL; + delete handle; + return nullptr; } wl_signal_init(&handle->events.destroy); @@ -253,4 +254,4 @@ void ztreeland_foreign_toplevel_handle_v1_identifier( identifier.toUtf8()); } } -} \ No newline at end of file +} diff --git a/src/treeland/protocols/shortcut_manager_impl.cpp b/src/treeland/protocols/shortcut_manager_impl.cpp index f77f48684..52b54b7bd 100644 --- a/src/treeland/protocols/shortcut_manager_impl.cpp +++ b/src/treeland/protocols/shortcut_manager_impl.cpp @@ -98,7 +98,7 @@ void shortcut_manager_bind(struct wl_client *client, NULL); } -void shortcut_manager_handle_display_destroy(struct wl_listener *listener, void *data) +void shortcut_manager_handle_display_destroy(struct wl_listener *listener, [[maybe_unused]] void *data) { struct ztreeland_shortcut_manager_v1 *manager = wl_container_of(listener, manager, display_destroy); @@ -115,4 +115,4 @@ void shortcut_manager_handle_display_destroy(struct wl_listener *listener, void wl_global_destroy(manager->global); wl_list_remove(&manager->display_destroy.link); free(manager); -} \ No newline at end of file +} diff --git a/src/treeland/protocols/socket_manager_impl.cpp b/src/treeland/protocols/socket_manager_impl.cpp index 141d89dc6..7f6158116 100644 --- a/src/treeland/protocols/socket_manager_impl.cpp +++ b/src/treeland/protocols/socket_manager_impl.cpp @@ -25,8 +25,8 @@ struct treeland_socket_context_v1 *socket_context_from_resource(struct wl_resour struct treeland_socket_manager_v1 *socket_manager_from_resource( struct wl_resource *resource); -void context_handle_set_username(struct wl_client *client, - struct wl_resource *resource, const char *username) { +void context_handle_set_username([[maybe_unused]] struct wl_client *client, struct wl_resource *resource, const char *username) +{ struct treeland_socket_context_v1 *context = socket_context_from_resource(resource); if (!context) { wl_resource_post_error(resource, @@ -39,7 +39,8 @@ void context_handle_set_username(struct wl_client *client, context->state.username = strdup(username); } -void context_handle_set_fd(struct wl_client *client, struct wl_resource *resource, int32_t fd) { +void context_handle_set_fd([[maybe_unused]] struct wl_client *client, struct wl_resource *resource, int32_t fd) +{ struct treeland_socket_context_v1 *context = socket_context_from_resource(resource); if (!context) { wl_resource_post_error(resource, @@ -52,7 +53,8 @@ void context_handle_set_fd(struct wl_client *client, struct wl_resource *resourc context->state.fd = fd; } -void context_handle_commit(struct wl_client *client, struct wl_resource *resource) { +void context_handle_commit([[maybe_unused]] struct wl_client *client, struct wl_resource *resource) +{ struct treeland_socket_context_v1 *context = socket_context_from_resource(resource); if (!context) { wl_resource_post_error(resource, @@ -145,7 +147,8 @@ void socket_manager_bind(struct wl_client *client, void *data, uint32_t version, wl_resource_set_implementation(resource, &socket_manager_impl, manager, NULL); } -void socket_manager_handle_display_destroy(struct wl_listener *listener, void *data) { +void socket_manager_handle_display_destroy(struct wl_listener *listener, [[maybe_unused]] void *data) +{ struct treeland_socket_manager_v1 *manager = wl_container_of(listener, manager, display_destroy); wl_signal_emit_mutable(&manager->events.destroy, manager); @@ -160,4 +163,4 @@ void socket_manager_handle_display_destroy(struct wl_listener *listener, void *d wl_global_destroy(manager->global); wl_list_remove(&manager->display_destroy.link); free(manager); -} \ No newline at end of file +} diff --git a/src/treeland/treeland-fake-session/fake-session.cpp b/src/treeland/treeland-fake-session/fake-session.cpp index c86c388a3..ddbc3c5e4 100644 --- a/src/treeland/treeland-fake-session/fake-session.cpp +++ b/src/treeland/treeland-fake-session/fake-session.cpp @@ -72,7 +72,7 @@ ForeignToplevelHandle::ForeignToplevelHandle(struct ::ztreeland_foreign_toplevel , m_pid(-1) {} -void ForeignToplevelHandle::ztreeland_foreign_toplevel_handle_v1_app_id(const QString &app_id) +void ForeignToplevelHandle::ztreeland_foreign_toplevel_handle_v1_app_id([[maybe_unused]] const QString &app_id) { } @@ -120,12 +120,12 @@ FakeSession::FakeSession(int argc, char* argv[]) , m_toplevelManager(new ForeignToplevelManager) , m_extForeignToplevelList(new ExtForeignToplevelList) { - connect(m_shortcutManager, &ShortcutManager::activeChanged, this, [=] { + connect(m_shortcutManager, &ShortcutManager::activeChanged, this, [this] { qDebug() << m_shortcutManager->isActive(); if (m_shortcutManager->isActive()) { ShortcutContext* context = new ShortcutContext(m_shortcutManager->get_shortcut_context()); - connect(context, &ShortcutContext::shortcutHappended, this, [=](uint32_t keycode, uint32_t modify) { + connect(context, &ShortcutContext::shortcutHappended, this, [](uint32_t keycode, uint32_t modify) { auto keyEnum = static_cast(keycode); auto modifyEnum = static_cast(modify); qDebug() << keyEnum << modifyEnum; @@ -145,14 +145,12 @@ FakeSession::FakeSession(int argc, char* argv[]) } }); - connect(m_toplevelManager, &ForeignToplevelManager::newForeignToplevelHandle, this, [=](ForeignToplevelHandle *handle) { - connect(handle, &ForeignToplevelHandle::pidChanged, this, [=](uint32_t pid) { - qDebug() << "toplevel pid: " << pid; - }); + connect(m_toplevelManager, &ForeignToplevelManager::newForeignToplevelHandle, this, [this](ForeignToplevelHandle *handle) { + connect(handle, &ForeignToplevelHandle::pidChanged, this, [](uint32_t pid) { qDebug() << "toplevel pid: " << pid; }); }); - connect(m_extForeignToplevelList, &ExtForeignToplevelList::newToplevel, this, [=](ExtForeignToplevelHandle *handle) { - connect(handle, &ExtForeignToplevelHandle::appIdChanged, this, [=](const QString &appId) { + connect(m_extForeignToplevelList, &ExtForeignToplevelList::newToplevel, this, [this](ExtForeignToplevelHandle *handle) { + connect(handle, &ExtForeignToplevelHandle::appIdChanged, this, [](const QString &appId) { qDebug() << "toplevel appid: " << appId; }); }); @@ -164,4 +162,4 @@ int main (int argc, char *argv[]) { FakeSession helper(argc, argv); return helper.exec(); -} \ No newline at end of file +} diff --git a/src/treeland/treeland-helper/sockethelper.cpp b/src/treeland/treeland-helper/sockethelper.cpp index 628b89f75..c7aee217e 100644 --- a/src/treeland/treeland-helper/sockethelper.cpp +++ b/src/treeland/treeland-helper/sockethelper.cpp @@ -60,7 +60,7 @@ SocketHelper::SocketHelper(int argc, char* argv[]) connect(m_socket, &QLocalSocket::readyRead, this, &SocketHelper::readyRead); connect(m_socket, &QLocalSocket::errorOccurred, this, &SocketHelper::error); - connect(m_socketManager, &SocketManager::activeChanged, this, [=] { + connect(m_socketManager, &SocketManager::activeChanged, this, [this, server] { if (m_socketManager->isActive()) { m_socket->connectToServer(server); } diff --git a/src/treeland/treeland.cpp b/src/treeland/treeland.cpp index 06d623095..d74afe747 100644 --- a/src/treeland/treeland.cpp +++ b/src/treeland/treeland.cpp @@ -106,11 +106,11 @@ void TreeLand::connected() { #endif Q_ASSERT(helper); - connect(helper, &Helper::backToNormal, this, [=] { + connect(helper, &Helper::backToNormal, this, [this] { SocketWriter(m_socket) << quint32(GreeterMessages::BackToNormal); }); - connect(helper, &Helper::reboot, this, [=] { - SocketWriter(m_socket) << quint32(GreeterMessages::Reboot); + connect(helper, &Helper::reboot, this, [this] { + SocketWriter(m_socket) << quint32(GreeterMessages::Reboot); }); // send connected message diff --git a/src/treeland/treelandhelper.cpp b/src/treeland/treelandhelper.cpp index 015d4166d..ad49c97d7 100644 --- a/src/treeland/treelandhelper.cpp +++ b/src/treeland/treelandhelper.cpp @@ -12,7 +12,6 @@ #include extern "C" { -#define WLR_USE_UNSTABLE #define static #include #include