[plasma/krdp] src: RdpConnection: use contextForPeer in peer callbacks

David Edmundson <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 5fadcf7aff2d822015e6516074480ada3bbb621b by David Edmundson, on behalf of Jie Liu.
Committed on 29/07/2026 at 14:06.
Pushed by davidedmundson into branch 'master'.

RdpConnection: use contextForPeer in peer callbacks

Avoid accessing the peer context directly in peerCapabilities and
peerPostConnect.

M  +2    -2    src/RdpConnection.cpp

https://invent.kde.org/plasma/krdp/-/commit/5fadcf7aff2d822015e6516074480ada3bbb621b

diff --git a/src/RdpConnection.cpp b/src/RdpConnection.cpp
index fe863e6..33f8eb4 100644
--- a/src/RdpConnection.cpp
+++ b/src/RdpConnection.cpp
@@ -150,7 +150,7 @@ static int pamAuthenticate(const QString &user, const QString &password)
  */
 BOOL peerCapabilities(freerdp_peer *peer)
 {
-    auto context = reinterpret_cast<PeerContext *>(peer->context);
+    auto context = contextForPeer(peer);
     if (context->connection->onCapabilities()) {
         return TRUE;
     }
@@ -163,7 +163,7 @@ BOOL peerCapabilities(freerdp_peer *peer)
  */
 BOOL peerPostConnect(freerdp_peer *peer)
 {
-    auto context = reinterpret_cast<PeerContext *>(peer->context);
+    auto context = contextForPeer(peer);
     if (context->connection->onPostConnect()) {
         return TRUE;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.