[X2Go-Commits] [x2gokdriveclient] 01/01: use Qt::endl and Qt::hex in Qt >= 5.15 and endl and hex otherwise.

git-admin at x2go.org git-admin at x2go.org
Thu Oct 14 19:26:45 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gokdriveclient.

commit 22ca55f2081c565f996902022d863f70672e9eb7
Author: Oleksandr Shneyder <o.shneyder at phoca-gmbh.de>
Date:   Thu Oct 14 12:26:35 2021 -0500

    use Qt::endl and Qt::hex in Qt >= 5.15 and endl and hex otherwise.
---
 client.cpp       | 15 ++++++++-------
 client.h         | 10 +++++++++-
 debian/changelog |  1 +
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/client.cpp b/client.cpp
index 7388bd6..ace9948 100644
--- a/client.cpp
+++ b/client.cpp
@@ -145,7 +145,7 @@ QTextStream& Client::KDRStdErr(bool dbg)
     static QTextStream nl(&nls);
     if(debug || !dbg)
     {
-        out<<Qt::endl;
+        out<<KDR_ENDL;
         return out;
     }
     return nl;
@@ -705,7 +705,7 @@ QPixmap Client::getPixmapFromCache(uint32_t crc)
 {
     if(!frameCache.contains(crc))
     {
-        KDRStdErr()<<"GETPIXMAP: frame "<<Qt::hex<<crc<<" not found in cache";
+        KDRStdErr()<<"GETPIXMAP: frame "<<KDR_HEX<<crc<<" not found in cache";
         if(serverVersion<5)
             exitOnError(tr("Frame not found in cache"));
         else
@@ -749,7 +749,7 @@ void Client::renderFrame()
                 {
                     if(!frameCache.contains(reg->source_crc))
                     {
-                        KDRStdErr()<<"region "<<Qt::hex<<reg->source_crc<<" not found in cache";
+                        KDRStdErr()<<"region "<<KDR_HEX<<reg->source_crc<<" not found in cache";
                         if(serverVersion<5)
                             exitOnError(tr("region not found in cache"));
                         else
@@ -1030,14 +1030,14 @@ void Client::getDeletedFramesList()
         uint32_t crc=*((uint32_t*)messageBuffer+i);
         if(!frameCache.contains(crc))
         {
-            KDRStdErr()<<"DELETING: frame not found in cache: "<<Qt::hex<<crc;
+            KDRStdErr()<<"DELETING: frame not found in cache: "<<KDR_HEX<<crc;
             if(serverVersion<5)
                 exitOnError(tr("frame not found in cache"));
             else
                 requestCacheRebuild();
             return;
         }
-//         KDRStdErr()<<"deleting frame from cache with crc"<<hex<<crc;
+        //         KDRStdErr()<<"deleting frame from cache with crc"<<KDR_HEX<<crc;
         QPixmap pix=frameCache[crc];
         cacheSize-=pix.width()*pix.height()*pix.depth()/8;
 
@@ -1143,7 +1143,7 @@ void Client::getRegionImage()
     }
     else
     {
-        KDRStdErr()<<"Image loading failed: "<<Qt::hex<<currentFrame->crc;
+        KDRStdErr()<<"Image loading failed: "<<KDR_HEX<<currentFrame->crc;
 /*        KDRStdErr()<<currentFrame->regions.last()->dataSize;
         QFile fl("/tmp/client/failed.jpg");
         fl.open(QFile::WriteOnly);
@@ -1350,7 +1350,8 @@ void Client::dataArrived()
 void Client::socketConnected()
 {
     displayArea->setStyleSheet("QFrame#DisplayArea{background-color:black;}");
-    KDRStdErr(false)<<"Connected to server"<<Qt::endl<<"Established X server connection";
+    KDRStdErr()<<"Connected to server";
+    KDRStdErr(false)<<"Established X server connection";
 
     if(cookie.length())
     {
diff --git a/client.h b/client.h
index c71e234..344eaf7 100644
--- a/client.h
+++ b/client.h
@@ -86,7 +86,6 @@ enum ClipboardMode{CLIP_BOTH, CLIP_SERVER, CLIP_CLIENT, CLIP_NONE};
 
 
 
-
 #include <QMainWindow>
 #include <QAbstractSocket>
 #include <stdlib.h>
@@ -100,6 +99,15 @@ enum ClipboardMode{CLIP_BOTH, CLIP_SERVER, CLIP_CLIENT, CLIP_NONE};
 class XCBClip;
 #endif
 
+#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
+#define KDR_ENDL Qt::endl
+#define KDR_HEX Qt::hex
+#else
+#define KDR_ENDL endl
+#define KDR_HEX hex
+#endif
+
+
 class FrameRegion
 {
 public:
diff --git a/debian/changelog b/debian/changelog
index 62560ad..25a651b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -35,5 +35,6 @@ x2gokdriveclient (0.0.0.1-0x2go1) UNRELEASED; urgency=medium
     - support for --debug command line argument.
     - wait for server version before requesting main image.
     - use QTextStream(stderr) instead of qDebug.
+    - use Qt::endl and Qt::hex in Qt >= 5.15 and endl and hex otherwise.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Tue, 04 Jun 2019 11:10:43 +0200

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gokdriveclient.git


More information about the x2go-commits mailing list